From pouya.tafti at a3.epfl.ch Sat Jan 1 04:49:34 2011 From: pouya.tafti at a3.epfl.ch (Pouya D. Tafti) Date: Sat, 1 Jan 2011 11:49:34 +0100 Subject: [Maxima] defining simplification rules Message-ID: Hi, I am very new to maxima and CAS in general, and also to this list. So I hope you will excuse me if my question happens to be trivial. I am trying to define some new simplification rules for gamma functions. After looking at the help files and some sources in maxima's share directory (and not quite understanding what was going on), I came up with the following definitions: (%i1) matchdeclare(z,true)$ (%i2) defrule(gammarule0,z!,gamma(z+1))$ (%i3) defrule(gammarule1,gamma(1-z)*gamma(z),%pi/sin(%pi*z))$ (%i4) defrule(gammarule2,gamma(z)*gamma(z+1/2),2^(1-2*z)*sqrt(%pi)*gamma(2*z))$ (%i5) defrule(gammarule3,z*gamma(z),gamma(z+1))$ (%i6) gammasimp(f) := apply1(expand(f),gammarule0,gammarule1,gammarule2,gammarule3)$ Now, when I try to simplify, say, n!*(-1-n)!, I get (%i7) gammasimp(n!*(-1-n)!); %pi (%o7) - ---------- sin(%pi n) which is what I want. On the other hand, if I try something like (%i8) gammasimp(gamma(n)*gamma(n+1/2)); 1 (%o8) gamma(n) gamma(n + -) 2 (which, I imagine, should be matched by gammarule2), there is no simplification in the output. What am I doing wrong? Thanks, and happy new year too, Pouya From fateman at eecs.berkeley.edu Sat Jan 1 15:46:07 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 01 Jan 2011 13:46:07 -0800 Subject: [Maxima] defining simplification rules In-Reply-To: References: Message-ID: <4D1FA09F.3040804@eecs.berkeley.edu> On 1/1/2011 2:49 AM, Pouya D. Tafti wrote: > Hi, > > I am very new to maxima and CAS in general, and also to this list. So > I hope you will excuse me if my question happens to be trivial. It doesn't look that the question is trivial. Or at least the answer is not. Your rules will probably not work in sufficient generality because you need to deal with situations in which you have *gamma(..)*gamma(..), and for the rule to succeed you need to match also. It would probably help if you specified z ahead of time, e.g. gammasimp(f,z) := ... You should realize that you are not specifying rules for gamma, really. You are specifying rules for multiplication, and as such, they will affect the speed of simplifying '*' everywhere. Other than that, I don't see, offhand, what's wrong with gammarule2, and it should work. The best I can see is this: the matcher finds gamma(z) as one factor in e= gamma(z)*gamma(z+1/2). It then tries to match gamma(z+1/2) to e/(gamma(z). But the quotient is not simplified to gamma(z+1/2), and so it fails. Possible programs to trace (in lisp) are compilematch [when the rule is defined] and meval, findfun [when the rule is run, e.g. by gammarule2( gamma(n)*gamma(n+1/2)); ] RJF > I am trying to define some new simplification rules for gamma > functions. After looking at the help files and some sources in > maxima's share directory (and not quite understanding what was going > on), I came up with the following definitions: > > (%i1) matchdeclare(z,true)$ > (%i2) defrule(gammarule0,z!,gamma(z+1))$ > (%i3) defrule(gammarule1,gamma(1-z)*gamma(z),%pi/sin(%pi*z))$ > (%i4) defrule(gammarule2,gamma(z)*gamma(z+1/2),2^(1-2*z)*sqrt(%pi)*gamma(2*z))$ > (%i5) defrule(gammarule3,z*gamma(z),gamma(z+1))$ > (%i6) gammasimp(f) := > apply1(expand(f),gammarule0,gammarule1,gammarule2,gammarule3)$ > > Now, when I try to simplify, say, n!*(-1-n)!, I get > > (%i7) gammasimp(n!*(-1-n)!); > %pi > (%o7) - ---------- > sin(%pi n) > > which is what I want. On the other hand, if I try something like > > (%i8) gammasimp(gamma(n)*gamma(n+1/2)); > 1 > (%o8) gamma(n) gamma(n + -) > 2 > (which, I imagine, should be matched by gammarule2), there is no > simplification in the output. > > What am I doing wrong? > > Thanks, and happy new year too, > Pouya > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at eecs.berkeley.edu Sat Jan 1 17:00:03 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 01 Jan 2011 15:00:03 -0800 Subject: [Maxima] defining simplification rules In-Reply-To: <4D1FA09F.3040804@eecs.berkeley.edu> References: <4D1FA09F.3040804@eecs.berkeley.edu> Message-ID: <4D1FB1F3.3030907@eecs.berkeley.edu> On 1/1/2011 1:46 PM, Richard Fateman wrote: > > the matcher finds gamma(z) as one factor in e= gamma(z)*gamma(z+1/2). > It then tries to match > gamma(z+1/2) to e/(gamma(z). But the quotient is not > simplified to gamma(z+1/2), > and so it fails. The bug is not in the dealing with quotient, but something having to do with binding of the variable z, I now think. (I mention this not so that you, Pouya, will fix it, but that perhaps someone else will notice, or I will pick it up again when I have more time.) RJF From pouya.tafti at a3.epfl.ch Sun Jan 2 01:41:08 2011 From: pouya.tafti at a3.epfl.ch (Pouya D. Tafti) Date: Sun, 2 Jan 2011 08:41:08 +0100 Subject: [Maxima] defining simplification rules In-Reply-To: <4D1FA09F.3040804@eecs.berkeley.edu> References: <4D1FA09F.3040804@eecs.berkeley.edu> Message-ID: On 1 January 2011 22:46, Richard Fateman wrote: >> On 1/1/2011 2:49 AM, Pouya D. Tafti wrote: >> Hi, >> >> I am very new to maxima and CAS in general, and also to this list. So >> I hope you will excuse me if my question happens to be trivial. > > It doesn't look that the question is trivial. Or at least the answer is not. > > Your rules will probably not work in sufficient > generality because you need > to > deal with situations in which you have *gamma(..)*gamma(..), ?and > for the > rule to succeed you need to match ?also. > It would probably help if you specified z ahead of time, e.g. > gammasimp(f,z) := ... > > You should realize that you are not specifying rules for gamma, really. ?You > are > specifying rules for multiplication, and as such, they will affect the speed > of > simplifying '*' ?everywhere. [...] Thank you very much for your response. I re-used the idea of specifying z ahead of time somewhere else and it really helped. I think I shall try to educate myself about lambda calculus (and LISP) when I find the time in order to use maxima effectively. Other than that, would share/trigonometry/trgsmp.mac be a good example to follow for what I am trying to do? Thanks again, Pouya From fateman at eecs.berkeley.edu Sun Jan 2 12:10:03 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 02 Jan 2011 10:10:03 -0800 Subject: [Maxima] defining simplification rules In-Reply-To: References: <4D1FA09F.3040804@eecs.berkeley.edu> Message-ID: <4D20BF7B.1090401@eecs.berkeley.edu> On 1/1/2011 11:41 PM, Pouya D. Tafti wrote:.. ... > Other than that, would share/trigonometry/trgsmp.mac be a good example > to follow for what I am trying to do? > > Thanks again, > Pouya Here's a suggestion. Look at http://www.cs.berkeley.edu/~fateman/papers/partition.pdf Write a program gammasimp(p) which does the following Given a product p= A*B*C... collect, in a list L , all of the objects which look like gamma(argument) for some argument. for each e=gamma(z) in L, look for gamma(z+1/2), gamma(z-1/2), gamma(1-z), etc. if you find one of these, apply the appropriate substitution, perhaps by ratsubst: ratsubst(%pi/sin(%pi*z),gamma(z)*gamma(1-z), p); If p is not a product, or does not contain any gammas,and is not atomic you can recursively try to apply gammasimp on the subexpressions of p. A separate program could convert factorials to gammas, or you could do it all in the same program, I suppose. Returning special values for individual gamma functions, e.g. gamma(1/2) is much simpler than dealing with products of gammas. Note that you may also want to look for powers of gamma, e.g. gamma(z)*gamma(z-1)^(-1), which would be gamma(z)/gamma(z-1) ... RJF From willisb at unk.edu Sun Jan 2 12:49:17 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 2 Jan 2011 12:49:17 -0600 Subject: [Maxima] defining simplification rules In-Reply-To: <4D20BF7B.1090401@eecs.berkeley.edu> References: <4D1FA09F.3040804@eecs.berkeley.edu> , <4D20BF7B.1090401@eecs.berkeley.edu> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >collect, in a list L , all of the objects which look like gamma(argument) for some argument. There is a function gatherargs that might be helpful. To use gatherargs, first do load("opsubst"). The quotes are important :( --Barton From dbmaxima at gmail.com Sun Jan 2 16:14:01 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Mon, 03 Jan 2011 09:14:01 +1100 Subject: [Maxima] defining simplification rules In-Reply-To: References: <4D1FA09F.3040804@eecs.berkeley.edu> , <4D20BF7B.1090401@eecs.berkeley.edu> Message-ID: <4D20F8A9.8080703@gmail.com> On 3/01/2011 5:49 AM, Barton Willis wrote: > There is a function gatherargs that might be helpful. To use gatherargs, first > do load("opsubst"). The quotes are important :( > > --Barton There are simplification functions for Bessel and Exponentional Integral functions that use gatherargs and then partition the expressions based on arguments in share/contrib/diffequations/contrib_ode.mac. David From thomas at geogebra.org Mon Jan 3 04:41:00 2011 From: thomas at geogebra.org (thomas) Date: Mon, 03 Jan 2011 11:41:00 +0100 Subject: [Maxima] noninteractive-bug? 0^0 error message varies between systems. Message-ID: <4D21A7BC.4090803@geogebra.org> Hi there! As I understand it, maxima has a standard-error message that gets issued every time 0^0 is generated. However, I am using maxima through the non-interactive mode, and the message I get varies depending on the system it runs on. On my Linux machine, I get: Maxima 5.22.1 http://maxima.sourceforge.net using Lisp SBCL 1.0.40.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) load(noninteractive); STYLE-WARNING: redefining INTEXT in DEFUN STYLE-WARNING: redefining PARSE-CONDITION in DEFUN STYLE-WARNING: redefining MERROR in DEFUN STYLE-WARNING: redefining $GENSYM in DEFUN STYLE-WARNING: redefining TOPLEVEL-MACSYMA-EVAL in DEFUN STYLE-WARNING: redefining ASKSIGN1 in DEFUN STYLE-WARNING: redefining ASK-PROP in DEFUN (%o1) /usr/share/maxima/5.22.1/share/contrib/noninteractive/noninteractive.mac (%i2) 0^0; 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. PROCEED WITH CAUTION. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i3) Whereas my Windows system says: Maxima 5.22.1 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) load(noninteractive); (%o1) C:/PROGRA~1/MAXIMA~1.1/share/maxima/5.22.1/share/contrib/noninteractive/\ noninteractive.mac (%i2) 0^0; Maxima encountered a Lisp error: Error in MERROR [or a callee]: Bind stack overflow. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i3) I assume this is due to the different underlying Lisp used. In any case, this makes it difficult to catch any 0^0 errors when using the noninteractive-mode. Is this by design, or is this a bug that I should create a bug-report for? Cheers (& happy new year! :) ) Thomas From renekaelin at gmx.ch Mon Jan 3 04:49:00 2011 From: renekaelin at gmx.ch (rene kaelin) Date: Mon, 3 Jan 2011 11:49:00 +0100 Subject: [Maxima] solution set Message-ID: Hello load(to_poly_solver)$ eq:(2*x-3)^(1/2)=(x-2)^(1/2)$ sol:to_poly_solve(eq,x)$ sol:subst(%union="[",sol)$ map(rhs,flatten(sol)); gives the output [1] The solution 1 leads to non-real values on the left and the right sides of the equation ( e.g. (2*1-3)^(1/2) can't be computed in the real numbers ). I'd like to eliminate such solutions. So the solution set of the equation above should be [ ] (empty set). Can you help me, please? By the way, what is the solution set of x*(2*x-3)^(1/2)=x*(x-2)^(1/2) if non-real values are not allowed? What would you prefer? From ChristianLupus at gmx.de Mon Jan 3 05:53:01 2011 From: ChristianLupus at gmx.de (Christian Wolf) Date: Mon, 3 Jan 2011 12:53:01 +0100 Subject: [Maxima] Special Operators Message-ID: <201101031253.01908.ChristianLupus@gmx.de> Hello to everybody, I new to maxima and I have some questions on operators: 1. Is it possible to define a prefix operator with a parameter? E.g. M(A) f(x) should evaluate the operator M(A) on the argument f(x), where A is a parameter of M. Or have I to use infix operators (A M f(x))? 2. How is it possible to resurse operators? In the way (in prefix notation) M(A)^^2 f as M(A) M(A) f. Maybe there are coming more questions up. But that's so far. Thanks in advance Christian From pouya.tafti at a3.epfl.ch Mon Jan 3 06:57:41 2011 From: pouya.tafti at a3.epfl.ch (Pouya D. Tafti) Date: Mon, 3 Jan 2011 13:57:41 +0100 Subject: [Maxima] defining simplification rules In-Reply-To: <4D20F8A9.8080703@gmail.com> References: <4D1FA09F.3040804@eecs.berkeley.edu> <4D20BF7B.1090401@eecs.berkeley.edu> <4D20F8A9.8080703@gmail.com> Message-ID: [Richard Fateman] >>> Here's a suggestion. >>> Look at >>> http://www.cs.berkeley.edu/~fateman/papers/partition.pdf >>> >>> Write a program gammasimp(p) which does the following [...] [Barton Willis] >> >> There is a function gatherargs that might be helpful. To use gatherargs, >> first >> do load("opsubst"). ?The quotes are important :( >> >> --Barton [David Billinghurst] > There are simplification functions for Bessel and Exponentional Integral > functions that use gatherargs and then partition the expressions based on > arguments in share/contrib/diffequations/contrib_ode.mac. > > ? ?David Thanks everyone. You have been extremely helpful. I am a bit short of time at the moment; but in a few weeks' time I hope I will be able to revisit the problem. The idea sketched in Richard Fateman's e-mail and paper seems far better than my naive pattern matching (I suppose I might still need to find a solution for infinite loops of substitutions). Thanks again, Pouya From fateman at eecs.berkeley.edu Mon Jan 3 08:32:47 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 03 Jan 2011 06:32:47 -0800 Subject: [Maxima] noninteractive-bug? 0^0 error message varies between systems. In-Reply-To: <4D21A7BC.4090803@geogebra.org> References: <4D21A7BC.4090803@geogebra.org> Message-ID: <4D21DE0F.3020206@eecs.berkeley.edu> version 5.21.0 in GCL works, in the sense that it just gives an error, so maybe it is a recent change.. From ChristianLupus at gmx.de Mon Jan 3 08:56:57 2011 From: ChristianLupus at gmx.de (Christian Wolf) Date: Mon, 3 Jan 2011 15:56:57 +0100 Subject: [Maxima] Export function Message-ID: <201101031556.57742.ChristianLupus@gmx.de> Hello again, here another simple question: How to export a function with save? I got it running with simple functions e.g. gradient(y,x) := .... with save("", gradient). But my problem is th efollowing: matchfix("L[","]"); L[f,g,x] := ..... save("/tmp/show_form.lisp", L[ ) Now I am not able to find the correct syntax to write this function to a file. I get an message about an illegal use of delimiter (Space before the L[). What's wrong? Thx Christian From fateman at eecs.berkeley.edu Mon Jan 3 10:36:54 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 03 Jan 2011 08:36:54 -0800 Subject: [Maxima] Export function In-Reply-To: <201101031556.57742.ChristianLupus@gmx.de> References: <201101031556.57742.ChristianLupus@gmx.de> Message-ID: <4D21FB26.20004@eecs.berkeley.edu> On 1/3/2011 6:56 AM, Christian Wolf wrote: > Hello again, > > here another simple question: How to export a function with save? > > I got it running with simple functions e.g. gradient(y,x) := .... with > save("", gradient). > > But my problem is th efollowing: > matchfix("L[","]"); > L[f,g,x] := ..... > save("/tmp/show_form.lisp", L[ ) > > Now I am not able to find the correct syntax to write this function to a file. I > get an message about an illegal use of delimiter (Space before the L[). > > What's wrong? > Thx > Christian > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima I suspect Maxima has not been programmed to save syntax extensions. Two suggestions: 1. Write out your program commands as ordinary text in a "batch" file, and load them in. 2. or if you want to save the syntax, put the matchfix command in a program, say setup():=block([], matchfix(....) .... other initialization ...). From ChristianLupus at gmx.de Mon Jan 3 12:26:22 2011 From: ChristianLupus at gmx.de (Christian Wolf) Date: Mon, 3 Jan 2011 19:26:22 +0100 Subject: [Maxima] Solve with symbols Message-ID: <201101031926.22682.ChristianLupus@gmx.de> Hello again, I found another point, I did not find anythng about at google. I have a bigger script but for debugging I wrote it in some lines: (%i33) y : y(t); (%o33) y(t) (%i34) [eq1: x+y = 3, eq2: 2*x+y = 5]; (%o34) [x+y(t)=3,2*x+y(t)=5] (%i40) solve([eq1, eq2], [x,y]); apply: found y evaluates to y(t) where a function was expected. -- an error. To debug this try: debugmode(true); (%i41) [eq3: x+z(t) = 3, eq4: 2*x+z(t) = 5]; (%o41) [x+z(t)=3,2*x+z(t)=5] (%i42) solve([eq3,eq4], [x,z(t)]); (%o42) [[x=2,z(t)=1]] Why does %i40 throw an error? I have serveral Symbols in my script just the way as in %i33 and it will not be much funny to change all of them. I don't understand why I works with an explicit (t) at z and not with the implicit one with y. Any ideas (and hopefully solutions)? Thx Christian From robert.dodier at gmail.com Mon Jan 3 13:20:10 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 3 Jan 2011 12:20:10 -0700 Subject: [Maxima] noninteractive-bug? 0^0 error message varies between systems. In-Reply-To: <4D21DE0F.3020206@eecs.berkeley.edu> References: <4D21A7BC.4090803@geogebra.org> <4D21DE0F.3020206@eecs.berkeley.edu> Message-ID: Thomas, it's a bug. Please file a report at: http://sourceforge.net/projects/maxima/bugs (URL approximate ... don't remember for sure.) I'll take a look at it soon (unless of course someone else fixes it first). best Robert Dodier From willisb at unk.edu Mon Jan 3 18:32:08 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 3 Jan 2011 18:32:08 -0600 Subject: [Maxima] Solve with symbols In-Reply-To: <201101031926.22682.ChristianLupus@gmx.de> References: <201101031926.22682.ChristianLupus@gmx.de> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >(%i33) y : y(t); >(%o33) y(t) > >(%i34) [eq1: x+y = 3, eq2: 2*x+y = 5]; >(%o34) [x+y(t)=3,2*x+y(t)=5] > >(%i40) solve([eq1, eq2], [x,y]); >apply: found y evaluates to y(t) where a function was expected. > -- an error. To debug this try: debugmode(true); The assignment y : y(t) is a problem. Evaluating y(t) gives y(t)(t). But y(t) isn't a valid identifier for a function--thus the error. Try removing the assigment y : y(t). and either change each y to y(t), or change each y(t) to y. --Barton From macrakis at alum.mit.edu Mon Jan 3 18:35:45 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 3 Jan 2011 19:35:45 -0500 Subject: [Maxima] Solve with symbols In-Reply-To: References: <201101031926.22682.ChristianLupus@gmx.de> Message-ID: ... and if you write your equations in terms of y(t), don't solve for y, but for y(t), e.g. solve( [x+y(t)=3,2*x+y(t)=5], [x, y(t) ] ) On Mon, Jan 3, 2011 at 19:32, Barton Willis wrote: > > -----maxima-bounces at math.utexas.edu wrote: ----- > > >(%i33) y : y(t); > >(%o33) y(t) > > > >(%i34) [eq1: x+y = 3, eq2: 2*x+y = 5]; > >(%o34) [x+y(t)=3,2*x+y(t)=5] > > > >(%i40) solve([eq1, eq2], [x,y]); > >apply: found y evaluates to y(t) where a function was expected. > > -- an error. To debug this try: debugmode(true); > > The assignment y : y(t) is a problem. Evaluating y(t) gives y(t)(t). But > y(t) isn't a > valid identifier for a function--thus the error. Try removing the assigment > y : y(t). > and either change each y to y(t), or change each y(t) to y. > > --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 robert.dodier at gmail.com Mon Jan 3 22:54:27 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 3 Jan 2011 21:54:27 -0700 Subject: [Maxima] noninteractive-bug? 0^0 error message varies between systems. In-Reply-To: <4D21A7BC.4090803@geogebra.org> References: <4D21A7BC.4090803@geogebra.org> Message-ID: I've committed a bug fix. It will be present in 5.23.1 (which will probably be released in a few days). Here is what I get now. (%i1) load (noninteractive); WARNING: DEFUN/DEFMACRO: redefining function INTEXT in (%o1) /home/robert/maxima/maxima-cvs-build/maxima/share/contrib/noninteractive\ /noninteractive.mac (%i2) display2d : false; (%o2) false (%i3) 0^0; (%o3) ?merror("~M has been generated",0^0) best, Robert Dodier From thomas at geogebra.org Tue Jan 4 03:24:03 2011 From: thomas at geogebra.org (thomas) Date: Tue, 04 Jan 2011 10:24:03 +0100 Subject: [Maxima] noninteractive-bug? 0^0 error message varies between systems. In-Reply-To: References: <4D21A7BC.4090803@geogebra.org> Message-ID: <4D22E733.5010901@geogebra.org> Wow, thank you very much for fixing this so quickly :) Cheers Thomas From l.couraud at gmail.com Tue Jan 4 05:03:52 2011 From: l.couraud at gmail.com (laurent couraud) Date: Tue, 4 Jan 2011 12:03:52 +0100 Subject: [Maxima] Windows installer for 5.23.0 Message-ID: Hello, Nothing dramatic but just to say there is no windows installer for 5.23 until now. Best. From andrej.vodopivec at gmail.com Tue Jan 4 08:54:55 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Tue, 4 Jan 2011 15:54:55 +0100 Subject: [Maxima] Windows installer for 5.23.0 In-Reply-To: References: Message-ID: A windows installer is now available: http://sourceforge.net/projects/maxima/files/Maxima-Windows/5.23.0-Windows/maxima-5.23.0.exe/download I have added grcommon.lisp and drawdf.mac files which were missing from the tarball. I have also upgraded gnuplot to 4.4. Small changes to plot.lisp and maxima.iss are required for gnuplot 4.4. These are not yet in cvs but I will commit them soon and should be included in the final 5.23 version. Andrej On Tue, Jan 4, 2011 at 12:03 PM, laurent couraud wrote: > Hello, > > Nothing dramatic but just to say there is no windows installer for 5.23 until now. > > Best. > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From ChristianLupus at gmx.de Tue Jan 4 10:42:30 2011 From: ChristianLupus at gmx.de (Christian Wolf) Date: Tue, 4 Jan 2011 17:42:30 +0100 Subject: [Maxima] Problems with sovle Message-ID: <201101041742.31060.ChristianLupus@gmx.de> Hello again, I got solve running. But it does not really does what I expect: 1. It does not find any solution and returns just a [ ]. This happens if I give too much equations to solve (only the first equation would be enough to solve for the first variable. If give 2 equations, [ ] is returned). 2. "Simple" problems can't be solved: In a nonlinear, but easy to solve equation system solve does not find a solution. Example: Search for x1,x2,x3 and u1 in [z1=x1,z2=x2,dz1=u1*cos(x3),dz2=u1*sin(x3)] Here I get no result, but only [ ]. Is this the same problem as in 1? As you can see, the equations are not that complicated. If you go through by hand (original system has order 8 and every 2 equations there are 2 new variables, so this is possible, even if not handy), I get a solutions. 3. Uncomplete solve: Sometimes (often in combination with trigonometrics) I get a solution, that is quite near to the correct result. The output is 1-2 step(s) befor the final result. e.g.: Try to solve the following equation in respect to u2. v2 = sin(x3)*(u1^2*sin(u2)*sin(x3)+dv1*cos(u2))/(cos(u2)*cos(x3)) +tan(u2)*v1^2/cos(x3)$ retuns: [sin(u2)=-(cos(u2)*(dv1*sin(x3)-v2*cos(x3)))/(u1^2*sin(x3)^2+v1^2)] Just dividing with cos(u2) and applying atan(.) would be enough. So please, can you tell me, what I am doing wrong? Thank you in advance Christian From razif66 at gmail.com Tue Jan 4 20:28:16 2011 From: razif66 at gmail.com (razif razali) Date: Wed, 5 Jan 2011 10:28:16 +0800 Subject: [Maxima] best approximation for (a+b)^n Message-ID: how to solve (a+b)^n in maxima?maybe the best approximation that we can have in maxima...can someone help with this -- 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 macrakis at alum.mit.edu Tue Jan 4 20:31:56 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 4 Jan 2011 21:31:56 -0500 Subject: [Maxima] best approximation for (a+b)^n In-Reply-To: References: Message-ID: What exactly do you mean by "solve (a+b)^n"? On Tue, Jan 4, 2011 at 21:28, razif razali wrote: > how to solve (a+b)^n in maxima?maybe the best approximation that we can > have in maxima...can someone help with this > > -- > 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 Wed Jan 5 01:30:13 2011 From: razif66 at gmail.com (razif razali) Date: Wed, 5 Jan 2011 15:30:13 +0800 Subject: [Maxima] how to make maxima create equation like i give in attachment In-Reply-To: References: Message-ID: General equation df(2n_k) / ds = \psi [ (k-1) sqrt {n-k+2} f(2n_k-1) - k sqrt{n-k+1} f(2n_k+1) with k = 1,2,3,4,5...n+1 , and n = 0,1,2,3,4...n for n=0 , we will get df(0_1) / ds = 0 for n=1, we should get equation for df(2_1)/ds and df(2_2)/ds and for n=2, we should get equation for df(4_1)/ds , df(4_2)/ds and df(4_3)/ds respectively. For higher n it should follow the general equation and will generate n+1 differential equation from it, so what i want to do is, how to code in maxima and get all those differential equation from general equation by just giving maxima the value of n number. hope someone can help me and sorry for bad writing in this email because i try to attach pdf file but then its too large for maxima newslater to broadcast it to all of you. Thanks a lot, if someone need the pdf file, i'll sent those file directly to you when you reply this problem. regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From razif66 at gmail.com Wed Jan 5 01:13:28 2011 From: razif66 at gmail.com (razif razali) Date: Wed, 5 Jan 2011 15:13:28 +0800 Subject: [Maxima] how to make maxima create equation like i give in attachment Message-ID: Dear Maxima user, I attach my problem with this email, I'm new with maxima and i tried to generate those equation given in attach file using maxima, I want to make maxima generate all differential equation by giving maxima the n number in problem attach. hope can get help from all of you. Thanks a alot -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: prob1.pdf Type: application/pdf Size: 39607 bytes Desc: not available URL: From fateman at eecs.berkeley.edu Wed Jan 5 08:48:12 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 05 Jan 2011 06:48:12 -0800 Subject: [Maxima] how to make maxima create equation like i give in attachment In-Reply-To: References: Message-ID: <4D2484AC.70404@eecs.berkeley.edu> 1. first of all, you already sent the pdf file to everyone. 2. Maxima notation does not have "superscripted" variables. However, it does allow any number of subscripts. Therefore you can encode your function as f[2*n,k], or even better to show the dependency on s, you can use the notation f[2*n,k](s). 3. The notation for derivatives is this: diff( f[2*n,k](s), s). 4. The notation for square roots is sqrt(n-k-1) 5. If you want to make lists of equations, you can use makelist(). You can read about it by typing ? makelist in to the command line of wxmaxima, which I hope you are using. 6. If you plan to do anything with Maxima, I suggest you read a tutorial. It is not the same as TeX. On 1/4/2011 11:30 PM, razif razali wrote: > General equation > > df(2n_k) / ds = \psi [ (k-1) sqrt {n-k+2} f(2n_k-1) - k sqrt{n-k+1} > f(2n_k+1) > > with k = 1,2,3,4,5...n+1 , and n = 0,1,2,3,4...n > > for n=0 , we will get df(0_1) / ds = 0 > > for n=1, we should get equation for df(2_1)/ds and df(2_2)/ds > > and for n=2, we should get equation for df(4_1)/ds , df(4_2)/ds and > df(4_3)/ds respectively. > > For higher n it should follow the general equation and will generate > n+1 differential equation from it, > > so what i want to do is, how to code in maxima and get all those > differential equation from general equation by just giving maxima the > value of n number. > > hope someone can help me and sorry for bad writing in this email > because i try to attach pdf file but then its too large for > maxima newslater to broadcast it to all of you. > > Thanks a lot, if someone need the pdf file, i'll sent those file > directly to you when you reply this problem. > > regards > > > _______________________________________________ > 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 Jan 5 09:10:10 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 5 Jan 2011 10:10:10 -0500 Subject: [Maxima] best approximation for (a+b)^n In-Reply-To: References: Message-ID: (a+b)^n is an expression, not an equation. What exactly do you mean by 'solving' it? Solving k=(a+b)^n for a or b is trivial -- solve( k=(a+b)^n, a) works -- so I assume you mean something else. -s On Tue, Jan 4, 2011 at 23:19, razif razali wrote: > what i means is how to solve those equation in terms of a and b...maybe in > approximation solution if "n" can goes infinity.... > > On Wed, Jan 5, 2011 at 10:31 AM, Stavros Macrakis wrote: > >> What exactly do you mean by "solve (a+b)^n"? >> >> On Tue, Jan 4, 2011 at 21:28, razif razali wrote: >> >>> how to solve (a+b)^n in maxima?maybe the best approximation that we can >>> have in maxima...can someone help with this >>> >>> -- >>> 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 > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Wed Jan 5 09:30:42 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 05 Jan 2011 15:30:42 +0000 Subject: [Maxima] how to make maxima create equation like i give in attachment References: <4D2484AC.70404@eecs.berkeley.edu> Message-ID: Richard Fateman writes: > 1. first of all, you already sent the pdf file to everyone. Well, only sort of: it got held up in the moderation queue because of the size. Maybe I should have discarded it instead? That seemed wrong though. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From joshua.stults at gmail.com Wed Jan 5 09:32:02 2011 From: joshua.stults at gmail.com (Joshua Stults) Date: Wed, 5 Jan 2011 10:32:02 -0500 Subject: [Maxima] Problem with gramschmidt and indexed matrix elements Message-ID: Here's the code that illustrates my problem: R : apply(matrix, makelist(makelist(concat(concat(r,i),j),i,1,3),j,1,3)) $ rsubs : map("=",create_list(concat(concat(r,i),j),i,1,3,j,1,3),create_list(r[i,j],i,1,3,j,1,3)) $ R_indexed : subst(rsubs, R) $ load("eigen") $ gramschmidt(R); gramschmidt(R_indexed); Compare the result of the last two lines. Why doesn't gramschmidt "multiply through" for the matrix with non-indexed elements but does for the matrix with indexed elements? Is there a setting I can change to get the non-indexed sort of result for a matrix with indexed elements? I tried setting doscmxops : true, but that didn't help. I have the same sort of trouble with invert(), which leaves the determinant factored out even if detout : false, when I have a matrix with indexed elements. I'm running this in wxMaxima 0.8.5, Maxima version: 5.22.1, Lisp: SBCL 1.0.38-2.fc13 (all as packaged for Fedora). Thanks for any pointers. -- Joshua Stults Website: http://j-stults.blogspot.com From macrakis at alum.mit.edu Wed Jan 5 09:45:10 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 5 Jan 2011 10:45:10 -0500 Subject: [Maxima] Problem with gramschmidt and indexed matrix elements In-Reply-To: References: Message-ID: This appears to be a bug in the general simplifier. Here's a simpler case: %i85) display2d:false; (%o85) false (%i86) listarith:true; (%o86) true (%i87) a*[x,y]; (%o87) [a*x,a*y] (%i88) a[1]*[x,y]; (%o88) a[1]*[x,y] On Wed, Jan 5, 2011 at 10:32, Joshua Stults wrote: > R : apply(matrix, makelist(makelist(concat(concat(r,i),j),i,1,3),j,1,3)) $ > rsubs : > map("=",create_list(concat(concat(r,i),j),i,1,3,j,1,3),create_list(r[i,j],i,1,3,j,1,3)) > $ > R_indexed : subst(rsubs, R) $ > load("eigen") $ > gramschmidt(R); > gramschmidt(R_indexed); > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Wed Jan 5 09:46:03 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 05 Jan 2011 07:46:03 -0800 Subject: [Maxima] Problem with gramschmidt and indexed matrix elements In-Reply-To: References: Message-ID: <4D24923B.5050003@eecs.berkeley.edu> On 1/5/2011 7:32 AM, Joshua Stults wrote: > Here's the code that illustrates my problem: > > R : apply(matrix, makelist(makelist(concat(concat(r,i),j),i,1,3),j,1,3)) $ > rsubs : map("=",create_list(concat(concat(r,i),j),i,1,3,j,1,3),create_list(r[i,j],i,1,3,j,1,3)) > $ > R_indexed : subst(rsubs, R) $ > load("eigen") $ > gramschmidt(R); > gramschmidt(R_indexed); > > Compare the result of the last two lines. Why doesn't gramschmidt > "multiply through" for the matrix with non-indexed elements but does > for the matrix with indexed elements? Is there a setting I can change > to get the non-indexed sort of result for a matrix with indexed > elements? I tried setting doscmxops : true, but that didn't help. I > have the same sort of trouble with invert(), which leaves the > determinant factored out even if detout : false, when I have a matrix > with indexed elements. > > I'm running this in wxMaxima 0.8.5, Maxima version: 5.22.1, Lisp: SBCL > 1.0.38-2.fc13 (all as packaged for Fedora). Thanks for any pointers. > No answer to the main question, but I looked at the gramschmidt documentation which points out that the answer may have factored integers in it, something potentially costly and (I think) unnecessary. If someone fixes the code, perhaps binding factorflag to false should also be done. (and the documentation fixed.) From robert.dodier at gmail.com Wed Jan 5 10:01:57 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 5 Jan 2011 09:01:57 -0700 Subject: [Maxima] Problem with gramschmidt and indexed matrix elements In-Reply-To: References: Message-ID: On 1/5/11, Stavros Macrakis wrote: > This appears to be a bug in the general simplifier. Here's a simpler case: > > %i85) display2d:false; > (%o85) false > (%i86) listarith:true; > (%o86) true > (%i87) a*[x,y]; > (%o87) [a*x,a*y] > (%i88) a[1]*[x,y]; > (%o88) a[1]*[x,y] Hmm. In 5.23.0 (Linux, Clisp) I get [a[1]*x,a[1]*y]. Maybe it has been fixed? best Robert Dodier From robert.dodier at gmail.com Wed Jan 5 10:12:46 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 5 Jan 2011 09:12:46 -0700 Subject: [Maxima] Special Operators In-Reply-To: <201101031253.01908.ChristianLupus@gmx.de> References: <201101031253.01908.ChristianLupus@gmx.de> Message-ID: On 1/3/11, Christian Wolf wrote: > 1. Is it possible to define a prefix operator with a parameter? E.g. M(A) > f(x) should evaluate the operator M(A) on the argument f(x), > where A is a parameter of M. Or have I to use infix operators (A M f(x))? I think the Maxima parser is not powerful enough to handle M(A) f(x). However, M(A)(f(x)) is acceptable to the parser -- is that good enough? As it stands, an expression like M(A)(f(x)) is acceptable to the parser and the simplifier, but not the evaluator. I have a trivial patch to allow it (simply don't trigger an error). I'll write more about it later. Maxima allows expressions like M[A](f(x)). In this case M is a so-called "memoizing" function, which remembers the value calculated for M[A] the first time A is an argument. I don't know if that's useful to you. > 2. How is it possible to resurse operators? In the way (in prefix notation) > M(A)^^2 f as M(A) M(A) f. I think it can be done with simplification rules, although I wonder how to use ^ or ^^ to represent repeated function evaluation since those operators already represent something else. (I would like to make it work that way, I just don't see how.) best Robert Dodier From macrakis at alum.mit.edu Wed Jan 5 10:57:04 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 5 Jan 2011 11:57:04 -0500 Subject: [Maxima] Problem with gramschmidt and indexed matrix elements In-Reply-To: References: Message-ID: Sorry, I should have reported my version: Maxima 5.22.1 GCL 2.6.8 Windows 7. I see that 5.23.0 was just created for Windows, so I installed it, and sure enough, the bug is fixed. -s On Wed, Jan 5, 2011 at 11:01, Robert Dodier wrote: > On 1/5/11, Stavros Macrakis wrote: > > This appears to be a bug in the general simplifier. Here's a simpler > case: > > > > %i85) display2d:false; > > (%o85) false > > (%i86) listarith:true; > > (%o86) true > > (%i87) a*[x,y]; > > (%o87) [a*x,a*y] > > (%i88) a[1]*[x,y]; > > (%o88) a[1]*[x,y] > > Hmm. In 5.23.0 (Linux, Clisp) I get [a[1]*x,a[1]*y]. > Maybe it has been fixed? > > best > > Robert Dodier > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhw at netris.org Wed Jan 5 13:38:40 2011 From: mhw at netris.org (Mark H Weaver) Date: Wed, 05 Jan 2011 14:38:40 -0500 Subject: [Maxima] Support for pngcairo in draw, and backward compatibility issues Message-ID: <87wrmjp2db.fsf@yeeloong.netris.org> I have a few small patches which I hope will find their way into 5.23.1. First: the 'pic_width' and 'pic_height' options of the draw package are now deprecated and print warnings whenever they are used. Both Imaxima and wxMaxima pass these options when their wx* commands are used. Here is a small fix to interfaces/emacs/imaxima/imaxima.lisp to use 'dimensions' instead: --- imaxima-orig.lisp 2009-11-16 17:09:19.000000000 -0500 +++ imaxima.lisp 2011-01-05 13:04:29.000000000 -0500 @@ -673,8 +673,11 @@ (append `( ((mequal simp) $terminal $eps) - ((mequal simp) $pic_width ,($first $wxplot_size)) - ((mequal simp) $pic_height ,($second $wxplot_size)) + ((mequal simp) $dimensions + ((mlist simp) + ;; convert points to 1/100 of cm + ,(* 3.53 ($first $wxplot_size)) + ,(* 3.53 ($second $wxplot_size)))) ((mequal simp) $file_name ,filename)) args))) ($ldisp `((wxxmltag simp) ,(format nil "~a.eps" filename) "img")) Second: the {eps,pdf}_{width,height} options, formerly specified in cm, have been replaced by 'dimensions' which is specified in cm/100. The code still accepts the old options, but fails to do the necessary conversion from cm to cm/100. The following patch does the necessary conversion, and also silences the warnings about 'pic_height' and 'pic_width'. The reason for the latter is that wxMaxima uses those options, and it looks bad to see the warnings before every inline plot. Yet how can wxMaxima fix this bug without breaking support for older versions of Maxima? I suggest that we wait a few releases before issuing these warnings. --- grcommon-orig.lisp 2010-12-02 16:13:26.000000000 -0500 +++ grcommon.lisp 2011-01-05 13:52:39.000000000 -0500 @@ -831,17 +833,17 @@ ($print "WARNING: 'rot_horizontal' is deprecated, using 'view' instead...") (update-view (list '(mlist) (first (gethash '$view *gr-options*)) val))) ($pic_width - ($print "WARNING: 'pic_width' is deprecated, using 'dimensions' instead...") + ;; ($print "WARNING: 'pic_width' is deprecated, using 'dimensions' instead...") (update-dimensions (list '(mlist) val (second (gethash '$dimensions *gr-options*))))) ($pic_height - ($print "WARNING: 'pic_height' is deprecated, using 'dimensions' instead...") + ;; ($print "WARNING: 'pic_height' is deprecated, using 'dimensions' instead...") (update-dimensions (list '(mlist) (first (gethash '$dimensions *gr-options*)) val))) (($eps_width $pdf_width) ($print "WARNING: 'eps_width' is deprecated, using 'dimensions' instead...") - (update-dimensions (list '(mlist) val (second (gethash '$dimensions *gr-options*))))) + (update-dimensions (list '(mlist) (* 100 val) (second (gethash '$dimensions *gr-options*))))) (($eps_height $pdf_height) ($print "WARNING: 'eps_height' is deprecated, using 'dimensions' instead...") - (update-dimensions (list '(mlist) (first (gethash '$dimensions *gr-options*)) val))) + (update-dimensions (list '(mlist) (first (gethash '$dimensions *gr-options*)) (* 100 val)))) (otherwise (merror "draw: unknown option ~M " opt)) ) ) Finally, attached below is a patch to add support for gnuplot's pngcairo terminal to draw. The plots look much better, especially when drawing direction fields with drawdf. Many small arrows look very bad without anti-aliasing. This patch also includes a small hack to allow users of wxMaxima to easily make use of pngcairo for inline plots: if $draw_use_pngcairo is true, then pngcairo will be used when 'png' is requested. [There's one other minor fix here as well: the gnuplot terminal options "enhanced truecolor" were specified when drawing "png" directly, but not when using $draw_file. The following patch fixes that.] Thanks, Mark --- draw-orig.lisp 2010-12-13 12:00:38.000000000 -0500 +++ draw.lisp 2011-01-05 13:46:27.000000000 -0500 @@ -41,6 +41,8 @@ (defvar $draw_compound t) +(defvar $draw_use_pngcairo nil "If true, use pngcairo terminal when png is requested.") + (defvar *windows-OS* (string= *autoconf-win32* "true")) (defmacro write-font-type () @@ -3161,6 +3163,11 @@ (round (second (get-option '$dimensions))) (hex-to-xhex (get-option '$background_color)) (get-option '$file_name) ) ) + ($pngcairo (format cmdstorage "set terminal pngcairo enhanced truecolor ~a size ~a, ~a~%set out '~a.png'" + (write-font-type) + (round (first (get-option '$dimensions))) + (round (second (get-option '$dimensions))) + (get-option '$file_name) ) ) ($eps (format cmdstorage "set terminal postscript eps enhanced ~a size ~acm, ~acm~%set out '~a.eps'" (write-font-type) (/ (first (get-option '$dimensions)) 100.0) @@ -3383,12 +3390,17 @@ (update-gr-option ($lhs x) ($rhs x)) (merror "draw: item ~M is not recognized as an option assignment" x))) (case (get-option '$terminal) - ($png (setf str (format nil "set terminal png ~a size ~a, ~a ~a~%set out '~a.png'" + ($png (setf str (format nil "set terminal png enhanced truecolor ~a size ~a, ~a ~a~%set out '~a.png'" (write-font-type) (round (first (get-option '$dimensions))) (round (second (get-option '$dimensions))) (hex-to-xhex (get-option '$background_color)) (get-option '$file_name) ) )) + ($pngcairo (setf str (format nil "set terminal pngcairo enhanced truecolor ~a size ~a, ~a~%set out '~a.png'" + (write-font-type) + (round (first (get-option '$dimensions))) + (round (second (get-option '$dimensions))) + (get-option '$file_name) ) )) ($eps (setf str (format nil "set terminal postscript eps enhanced ~a size ~acm, ~acm~%set out '~a.eps'" (write-font-type) ; other alternatives are Arial, Courier (/ (first (get-option '$dimensions)) 100.0) --- grcommon-orig.lisp 2010-12-02 16:13:26.000000000 -0500 +++ grcommon.lisp 2011-01-05 13:52:39.000000000 -0500 @@ -328,10 +328,12 @@ (defvar *draw-terminal-number* "") (defun update-terminal (val) - (let ((terms '($screen $png $jpg $gif $eps $eps_color $svg + (let ((terms '($screen $png $pngcairo $jpg $gif $eps $eps_color $svg $pdf $pdfcairo $wxt $animated_gif $aquaterm))) (cond ((member val terms) + (when (and (eq val '$png) $draw_use_pngcairo) + (setq val '$pngcairo)) (setf (gethash '$terminal *gr-options*) val *draw-terminal-number* "")) ((and ($listp val) From rich.hennessy at verizon.net Wed Jan 5 15:24:24 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 05 Jan 2011 16:24:24 -0500 Subject: [Maxima] Are these both the right answer for the integral? Message-ID: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> Hi List, I found an article which gives an integral problem of interest. integrate(3*x^2*sqrt(1-1/x^2),x); Maxima alone said it works out to (1-1/x^2)^(3/2)*x^3, with abs_integrate loaded the answer is the same (1-1/x^2)^(3/2)*x^3, but with pw.mac loaded Maxima gives 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) They all agree that diff(integrate(3*x^2*sqrt(1-1/x^2),x),x) gives the original form back, but not directly. You have to simplify to get everything to cancel out to 0. I don?t know why pw.mac returns an answer with %i in it. Is that a bug? Rich (%i25) kill(all); (out0) done (%i1) 3*x^2*sqrt(1-1/x^2); (out1) 3*sqrt(1-1/x^2)*x^2 (%i2) integrate(%,x); (out2) (1-1/x^2)^(3/2)*x^3 (%i3) diff(%,x); (out3) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) (%i4) radcan(%-(out1)); (out4) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) (%i5) radcan(%); (out5) 0 (%i6) kill(all); (out0) done (%i1) load(pw); (out1) "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/pw.mac" (%i2) 3*x^2*sqrt(1-1/x^2); (out2) 3*sqrt(1-1/x^2)*x^2 (%i3) pwint(%,x); (out3) 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) (%i4) diff(%,x); (out4) 3*x*sqrt((x-1)*(x+1))*signum(x) (%i5) radcan(%-(out2)); (out5) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) (%i6) radcan(%); (out6) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) (%i7) signum2abs(%); (out7) 0 (%i8) kill(all); (out0) done (%i1) load(abs_integrate); (out1) "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/integration/abs_integrate.mac" (%i2) 3*x^2*sqrt(1-1/x^2); (out2) 3*sqrt(1-1/x^2)*x^2 (%i3) integrate(%,x); (out3) (1-1/x^2)^(3/2)*x^3 (%i4) diff(%,x); (out4) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) (%i5) radcan(%-(out2)); (out5) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) (%i6) radcan(%); (out6) 0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.reyssat at math.unicaen.fr Wed Jan 5 16:06:45 2011 From: eric.reyssat at math.unicaen.fr (reyssat) Date: Wed, 05 Jan 2011 23:06:45 +0100 Subject: [Maxima] Are these both the right answer for the integral? In-Reply-To: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> Message-ID: <4D24EB75.8070609@math.unicaen.fr> Richard Hennessy a ?crit : > Hi List, > > I found an article which gives an integral problem of interest. > > integrate(3*x^2*sqrt(1-1/x^2),x); > > Maxima alone said it works out to (1-1/x^2)^(3/2)*x^3, with > abs_integrate loaded the answer is the same (1-1/x^2)^(3/2)*x^3, but > with pw.mac loaded Maxima gives 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) > > They all agree that diff(integrate(3*x^2*sqrt(1-1/x^2),x),x) gives the > original form back, but not directly. You have to simplify to get > everything to cancel out to 0. I don?t know why pw.mac returns an > answer with %i in it. Is that a bug? > > Rich > Hi Rich, The function is a multivalued function defined on the complex plane except at 0 , 1 and -1. So on the real line, depending on how the integral is computed, the answer is defined only up to an additive constant on each of the intervals ]-inf,-1[ , ]-1,0[ , ]0,1[ , ]1,inf[. The answer with pw.mac just adds %i, this is ok, it could even be worse : adding %i + 5*%i*signum(1-x) - (3+2*%i)*signum(1+x) is also a correct result. So I don't know either why pw.mac adds %i, but I would consider it as a feature, not a bug. Eric > > > (%i25) kill(all); > (out0) done > (%i1) 3*x^2*sqrt(1-1/x^2); > (out1) 3*sqrt(1-1/x^2)*x^2 > (%i2) integrate(%,x); > (out2) (1-1/x^2)^(3/2)*x^3 > (%i3) diff(%,x); > (out3) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) > (%i4) radcan(%-(out1)); > (out4) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) > (%i5) radcan(%); > (out5) 0 > > (%i6) kill(all); > (out0) done > (%i1) load(pw); > (out1) "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/pw.mac" > (%i2) 3*x^2*sqrt(1-1/x^2); > (out2) 3*sqrt(1-1/x^2)*x^2 > (%i3) pwint(%,x); > (out3) 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) > (%i4) diff(%,x); > (out4) 3*x*sqrt((x-1)*(x+1))*signum(x) > (%i5) radcan(%-(out2)); > (out5) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) > (%i6) radcan(%); > (out6) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) > (%i7) signum2abs(%); > (out7) 0 > > (%i8) kill(all); > (out0) done > (%i1) load(abs_integrate); > (out1) > "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/integration/abs_integrate.mac" > (%i2) 3*x^2*sqrt(1-1/x^2); > (out2) 3*sqrt(1-1/x^2)*x^2 > (%i3) integrate(%,x); > (out3) (1-1/x^2)^(3/2)*x^3 > (%i4) diff(%,x); > (out4) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) > (%i5) radcan(%-(out2)); > (out5) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) > (%i6) radcan(%); > (out6) 0 > > ------------------------------------------------------------------------ > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From rich.hennessy at verizon.net Wed Jan 5 16:10:13 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 05 Jan 2011 17:10:13 -0500 Subject: [Maxima] Are these both the right answer for the integral? In-Reply-To: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> Message-ID: Sorry, I made a mistake. It should read integrate(3*x^2*sqrt(1+1/x^2),x); With this change pw.mac gives a real answer so I guess my mistake is making me learn about the difference in integration with respect to real verses complex numbers. Rich From: Richard Hennessy Sent: Wednesday, January 05, 2011 4:24 PM To: Maxima List Subject: [Maxima] Are these both the right answer for the integral? Hi List, I found an article which gives an integral problem of interest. integrate(3*x^2*sqrt(1-1/x^2),x); Maxima alone said it works out to (1-1/x^2)^(3/2)*x^3, with abs_integrate loaded the answer is the same (1-1/x^2)^(3/2)*x^3, but with pw.mac loaded Maxima gives 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) They all agree that diff(integrate(3*x^2*sqrt(1-1/x^2),x),x) gives the original form back, but not directly. You have to simplify to get everything to cancel out to 0. I don?t know why pw.mac returns an answer with %i in it. Is that a bug? Rich (%i25) kill(all); (out0) done (%i1) 3*x^2*sqrt(1-1/x^2); (out1) 3*sqrt(1-1/x^2)*x^2 (%i2) integrate(%,x); (out2) (1-1/x^2)^(3/2)*x^3 (%i3) diff(%,x); (out3) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) (%i4) radcan(%-(out1)); (out4) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) (%i5) radcan(%); (out5) 0 (%i6) kill(all); (out0) done (%i1) load(pw); (out1) "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/pw.mac" (%i2) 3*x^2*sqrt(1-1/x^2); (out2) 3*sqrt(1-1/x^2)*x^2 (%i3) pwint(%,x); (out3) 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) (%i4) diff(%,x); (out4) 3*x*sqrt((x-1)*(x+1))*signum(x) (%i5) radcan(%-(out2)); (out5) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) (%i6) radcan(%); (out6) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) (%i7) signum2abs(%); (out7) 0 (%i8) kill(all); (out0) done (%i1) load(abs_integrate); (out1) "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/integration/abs_integrate.mac" (%i2) 3*x^2*sqrt(1-1/x^2); (out2) 3*sqrt(1-1/x^2)*x^2 (%i3) integrate(%,x); (out3) (1-1/x^2)^(3/2)*x^3 (%i4) diff(%,x); (out4) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) (%i5) radcan(%-(out2)); (out5) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) (%i6) radcan(%); (out6) 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 rich.hennessy at verizon.net Wed Jan 5 16:48:15 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 05 Jan 2011 17:48:15 -0500 Subject: [Maxima] Are these both the right answer for the integral? In-Reply-To: <4D24EB75.8070609@math.unicaen.fr> References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> <4D24EB75.8070609@math.unicaen.fr> Message-ID: <191FAB1AE0E24403810041E42BAA03BE@RichsLaptop> Thanks, your right, it is always okay to add a constant to the answer for integrate. I don't understand integration with respect to complex numbers very well. The article mentions that users who are only familiar with real integration would have a problem with understanding the answer to integration of some piecewise functions. I am not sure if my algorithm is right, I designed it for real numbers but sometimes complex numbers appear out of nowhere. Rich -----Original Message----- From: reyssat Sent: Wednesday, January 05, 2011 5:06 PM To: Richard Hennessy Cc: Maxima List Subject: Re: [Maxima] Are these both the right answer for the integral? Richard Hennessy a ?crit : > Hi List, > I found an article which gives an integral problem of interest. > integrate(3*x^2*sqrt(1-1/x^2),x); > Maxima alone said it works out to (1-1/x^2)^(3/2)*x^3, with abs_integrate > loaded the answer is the same (1-1/x^2)^(3/2)*x^3, but with pw.mac loaded > Maxima gives 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) > They all agree that diff(integrate(3*x^2*sqrt(1-1/x^2),x),x) gives the > original form back, but not directly. You have to simplify to get > everything to cancel out to 0. I don?t know why pw.mac returns an answer > with %i in it. Is that a bug? > Rich > Hi Rich, The function is a multivalued function defined on the complex plane except at 0 , 1 and -1. So on the real line, depending on how the integral is computed, the answer is defined only up to an additive constant on each of the intervals ]-inf,-1[ , ]-1,0[ , ]0,1[ , ]1,inf[. The answer with pw.mac just adds %i, this is ok, it could even be worse : adding %i + 5*%i*signum(1-x) - (3+2*%i)*signum(1+x) is also a correct result. So I don't know either why pw.mac adds %i, but I would consider it as a feature, not a bug. Eric > (%i25) kill(all); > (out0) done > (%i1) 3*x^2*sqrt(1-1/x^2); > (out1) 3*sqrt(1-1/x^2)*x^2 > (%i2) integrate(%,x); > (out2) (1-1/x^2)^(3/2)*x^3 > (%i3) diff(%,x); > (out3) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) > (%i4) radcan(%-(out1)); > (out4) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) > (%i5) radcan(%); > (out5) 0 > (%i6) kill(all); > (out0) done > (%i1) load(pw); > (out1) "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/pw.mac" > (%i2) 3*x^2*sqrt(1-1/x^2); > (out2) 3*sqrt(1-1/x^2)*x^2 > (%i3) pwint(%,x); > (out3) 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) > (%i4) diff(%,x); > (out4) 3*x*sqrt((x-1)*(x+1))*signum(x) > (%i5) radcan(%-(out2)); > (out5) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) > (%i6) radcan(%); > (out6) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) > (%i7) signum2abs(%); > (out7) 0 > (%i8) kill(all); > (out0) done > (%i1) load(abs_integrate); > (out1) > "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/integration/abs_integrate.mac" > (%i2) 3*x^2*sqrt(1-1/x^2); > (out2) 3*sqrt(1-1/x^2)*x^2 > (%i3) integrate(%,x); > (out3) (1-1/x^2)^(3/2)*x^3 > (%i4) diff(%,x); > (out4) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) > (%i5) radcan(%-(out2)); > (out5) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) > (%i6) radcan(%); > (out6) 0 > ------------------------------------------------------------------------ > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From mhw at netris.org Wed Jan 5 17:08:46 2011 From: mhw at netris.org (Mark H Weaver) Date: Wed, 05 Jan 2011 18:08:46 -0500 Subject: [Maxima] Bugs in abs_integrate.mac Message-ID: <87r5crosn5.fsf@yeeloong.netris.org> I have found some bugs in abs_integrate.mac: (%i1) display2d:false; (%o1) false (%i2) load(abs_integrate); (%o2) "/usr/local/share/maxima/5.23.0/share/contrib/integration/abs_integrate.mac" (%i3) abs_defint(unit_step(x),x,99,100); (%o3) 100 The problem here is that abs_defint accidentally extends its integration interval to include all other values of x at which signum, unit_step, abs, etc, switch between cases. After determining all such values of x (in this case x=0 is the only one), abs_defint calls partitions_interval_p, which sorts all of these points including the endpoints (here 99 and 100). In this case partitions_interval_p returns [0,99,100], and then the integration is performed from 0 to 100. Presumably partitions_interval_p should trim the resulting list to include only the portion within the given endpoints. *** Here is a more difficult bug: (%i4) abs_defint(unit_step(unit_step(x)),x,-1,0); (%o4) 1/2 Since unit_step(unit_step(x))=0 for all x<=0, the answer should be 0. The problem here is that convert_to_signum converts unit_step(x) to (signum(x)+1)/2. Obviously this is incorrect at x=0, but in most cases this does not affect the result, since integration is insensitive to the values of the integrand at any finite (or countable) set of points. But consider unit_step(f(x)) where f(x)=0 over a proper interval of x. In these cases, the transformation done by convert_to_signum is invalid, and can cause several of the routines in abs_integrate.mac to give wrong answers. I don't see any simple fix to this problem. To fix it properly, I guess these routines must look not only for isolated values of x, but in the general case also _intervals_ of x at which the argument of signum or unit_step is 0. Best, Mark From rich.hennessy at verizon.net Wed Jan 5 18:19:48 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 05 Jan 2011 19:19:48 -0500 Subject: [Maxima] Are these both the right answer for the integral? In-Reply-To: <191FAB1AE0E24403810041E42BAA03BE@RichsLaptop> References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> <4D24EB75.8070609@math.unicaen.fr> <191FAB1AE0E24403810041E42BAA03BE@RichsLaptop> Message-ID: On second thought this is not okay. You cannot add signum(x) *%i, because that is not a constant. I think it is a bug which I don't know offhand how to fix. I would not call it a feature. The function is not real from (-1,1). That is not a supported type of function. When I wrote pw I was thinking about real functions not complex ones. I will have to figure it out. I don't see how you can call it a feature. I just don't understand the problem yet. Rich -----Original Message----- From: Richard Hennessy Sent: Wednesday, January 05, 2011 5:48 PM To: reyssat Cc: Maxima List Subject: Re: [Maxima] Are these both the right answer for the integral? Thanks, your right, it is always okay to add a constant to the answer for integrate. I don't understand integration with respect to complex numbers very well. The article mentions that users who are only familiar with real integration would have a problem with understanding the answer to integration of some piecewise functions. I am not sure if my algorithm is right, I designed it for real numbers but sometimes complex numbers appear out of nowhere. Rich -----Original Message----- From: reyssat Sent: Wednesday, January 05, 2011 5:06 PM To: Richard Hennessy Cc: Maxima List Subject: Re: [Maxima] Are these both the right answer for the integral? Richard Hennessy a ?crit : > Hi List, > I found an article which gives an integral problem of interest. > integrate(3*x^2*sqrt(1-1/x^2),x); > Maxima alone said it works out to (1-1/x^2)^(3/2)*x^3, with abs_integrate > loaded the answer is the same (1-1/x^2)^(3/2)*x^3, but with pw.mac loaded > Maxima gives 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) > They all agree that diff(integrate(3*x^2*sqrt(1-1/x^2),x),x) gives the > original form back, but not directly. You have to simplify to get > everything to cancel out to 0. I don?t know why pw.mac returns an answer > with %i in it. Is that a bug? > Rich > Hi Rich, The function is a multivalued function defined on the complex plane except at 0 , 1 and -1. So on the real line, depending on how the integral is computed, the answer is defined only up to an additive constant on each of the intervals ]-inf,-1[ , ]-1,0[ , ]0,1[ , ]1,inf[. The answer with pw.mac just adds %i, this is ok, it could even be worse : adding %i + 5*%i*signum(1-x) - (3+2*%i)*signum(1+x) is also a correct result. So I don't know either why pw.mac adds %i, but I would consider it as a feature, not a bug. Eric > (%i25) kill(all); > (out0) done > (%i1) 3*x^2*sqrt(1-1/x^2); > (out1) 3*sqrt(1-1/x^2)*x^2 > (%i2) integrate(%,x); > (out2) (1-1/x^2)^(3/2)*x^3 > (%i3) diff(%,x); > (out3) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) > (%i4) radcan(%-(out1)); > (out4) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) > (%i5) radcan(%); > (out5) 0 > (%i6) kill(all); > (out0) done > (%i1) load(pw); > (out1) "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/pw.mac" > (%i2) 3*x^2*sqrt(1-1/x^2); > (out2) 3*sqrt(1-1/x^2)*x^2 > (%i3) pwint(%,x); > (out3) 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) > (%i4) diff(%,x); > (out4) 3*x*sqrt((x-1)*(x+1))*signum(x) > (%i5) radcan(%-(out2)); > (out5) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) > (%i6) radcan(%); > (out6) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) > (%i7) signum2abs(%); > (out7) 0 > (%i8) kill(all); > (out0) done > (%i1) load(abs_integrate); > (out1) > "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/integration/abs_integrate.mac" > (%i2) 3*x^2*sqrt(1-1/x^2); > (out2) 3*sqrt(1-1/x^2)*x^2 > (%i3) integrate(%,x); > (out3) (1-1/x^2)^(3/2)*x^3 > (%i4) diff(%,x); > (out4) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) > (%i5) radcan(%-(out2)); > (out5) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) > (%i6) radcan(%); > (out6) 0 > ------------------------------------------------------------------------ > > _______________________________________________ > 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 biomates at telefonica.net Wed Jan 5 18:20:37 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 06 Jan 2011 01:20:37 +0100 Subject: [Maxima] Support for pngcairo in draw, and backward compatibility issues In-Reply-To: <87wrmjp2db.fsf@yeeloong.netris.org> References: <87wrmjp2db.fsf@yeeloong.netris.org> Message-ID: <1294273237.1678.21.camel@trasno> El mi?, 05-01-2011 a las 14:38 -0500, Mark H Weaver escribi?: > Here is a small fix to interfaces/emacs/imaxima/imaxima.lisp to use > 'dimensions' instead: > I never use emacs, and I didn't know of the existence of this problem. It's now fixed. > > Second: the {eps,pdf}_{width,height} options, formerly specified in cm, > have been replaced by 'dimensions' which is specified in cm/100. The > code still accepts the old options, but fails to do the necessary > conversion from cm to cm/100. Certainly, there weren't any transformations here. Fixed. > The following patch does the necessary conversion, and also silences the > warnings about 'pic_height' and 'pic_width'. The reason for the latter > is that wxMaxima uses those options, and it looks bad to see the > warnings before every inline plot. Yet how can wxMaxima fix this bug > without breaking support for older versions of Maxima? I suggest that > we wait a few releases before issuing these warnings. Not necessarily. wxMaxima 0.8.7 has been changed appropriately; in fact, the windows binary doesn't have this problem. I think wxMaxima's new version will be released soon. Since the warnings in wxMaxima will disappear in short, I prefer to maintain them. > Finally, attached below is a patch to add support for gnuplot's pngcairo > terminal to draw. The plots look much better, especially when drawing > direction fields with drawdf. Many small arrows look very bad without > anti-aliasing. Nice contribution. PNG's look really better. > > This patch also includes a small hack to allow users of wxMaxima to > easily make use of pngcairo for inline plots: if $draw_use_pngcairo is > true, then pngcairo will be used when 'png' is requested. I have included this variable in draw.lisp as you suggested, but I think this fact should be controlled from wxMaxima. Let $draw_use_pngcairo be defined here for the moment. > [There's one other minor fix here as well: the gnuplot terminal options > "enhanced truecolor" were specified when drawing "png" directly, but > not when using $draw_file. The following patch fixes that.] Yes, I forgot to include this option in $draw_file. > > Thanks, > Mark No, thanks to you. -- Mario From eric.reyssat at math.unicaen.fr Wed Jan 5 18:59:18 2011 From: eric.reyssat at math.unicaen.fr (reyssat) Date: Thu, 06 Jan 2011 01:59:18 +0100 Subject: [Maxima] Are these both the right answer for the integral? In-Reply-To: References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> <4D24EB75.8070609@math.unicaen.fr> <191FAB1AE0E24403810041E42BAA03BE@RichsLaptop> Message-ID: <4D2513E6.5000405@math.unicaen.fr> Le 06/01/2011 01:19, Richard Hennessy a ?crit : > On second thought this is not okay. You cannot add signum(x) *%i, > because that is not a constant. Due to the term 1-1/x^2, the function is not defined at 0 hence signum(x)*%i _is_ a constant on each interval where your function is defined. You can choose different integration constants on disjoint intervals. > I think it is a bug which I don't know offhand how to fix. I would not > call it a feature. The function is not real from (-1,1). That is not > a supported type of function. When I wrote pw I was thinking about > real functions not complex ones. I will have to figure it out. I > don't see how you can call it a feature. The complex function explains the behaviour of the real one, but we may of course restrict to the real values only. I didn't look precisely at the documentation about your integration procedure of piecewise defined functions, so I cannot assert that it is a bug (i.e. contradictory to what you write it should return) or not. But in this case, the returned result (even with the singnum(x)*%i) is a function which has the correct derivative at each point of the real line where the given function f is defined without branch point (points where you can choose more than one analytic continuation, the points 1 and -1 here). I call it a feature because it gives a reasonable value of what we can call an integral of f. It would be a bug if you say in the documentation that the result is either an error message or an everywhere (on the real line) differentiable function whose derivative is f, since it is clearly not the case here. Eric > I just don't understand the problem yet. > > Rich > > > > -----Original Message----- From: Richard Hennessy > Sent: Wednesday, January 05, 2011 5:48 PM > To: reyssat > Cc: Maxima List > Subject: Re: [Maxima] Are these both the right answer for the integral? > > Thanks, your right, it is always okay to add a constant to the answer for > integrate. I don't understand integration with respect to complex > numbers > very well. The article mentions that users who are only familiar with > real > integration would have a problem with understanding the answer to > integration of some piecewise functions. I am not sure if my > algorithm is > right, I designed it for real numbers but sometimes complex numbers > appear > out of nowhere. > > Rich > > > -----Original Message----- From: reyssat > Sent: Wednesday, January 05, 2011 5:06 PM > To: Richard Hennessy > Cc: Maxima List > Subject: Re: [Maxima] Are these both the right answer for the integral? > > Richard Hennessy a ?crit : >> Hi List, >> I found an article which gives an integral problem of interest. >> integrate(3*x^2*sqrt(1-1/x^2),x); >> Maxima alone said it works out to (1-1/x^2)^(3/2)*x^3, with >> abs_integrate loaded the answer is the same (1-1/x^2)^(3/2)*x^3, but >> with pw.mac loaded Maxima gives 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) >> They all agree that diff(integrate(3*x^2*sqrt(1-1/x^2),x),x) gives >> the original form back, but not directly. You have to simplify to >> get everything to cancel out to 0. I don?t know why pw.mac returns >> an answer with %i in it. Is that a bug? >> Rich >> > Hi Rich, > The function is a multivalued function defined on the complex plane > except at 0 , 1 and -1. > So on the real line, depending on how the integral is computed, the > answer is defined only up to an additive constant on each of the > intervals ]-inf,-1[ , ]-1,0[ , ]0,1[ , ]1,inf[. The answer with pw.mac > just adds %i, this is ok, it could even be worse : adding %i + > 5*%i*signum(1-x) - (3+2*%i)*signum(1+x) is also a correct result. > So I don't know either why pw.mac adds %i, but I would consider it as a > feature, not a bug. > > Eric >> (%i25) kill(all); >> (out0) done >> (%i1) 3*x^2*sqrt(1-1/x^2); >> (out1) 3*sqrt(1-1/x^2)*x^2 >> (%i2) integrate(%,x); >> (out2) (1-1/x^2)^(3/2)*x^3 >> (%i3) diff(%,x); >> (out3) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) >> (%i4) radcan(%-(out1)); >> (out4) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) >> (%i5) radcan(%); >> (out5) 0 >> (%i6) kill(all); >> (out0) done >> (%i1) load(pw); >> (out1) "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/pw.mac" >> (%i2) 3*x^2*sqrt(1-1/x^2); >> (out2) 3*sqrt(1-1/x^2)*x^2 >> (%i3) pwint(%,x); >> (out3) 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) >> (%i4) diff(%,x); >> (out4) 3*x*sqrt((x-1)*(x+1))*signum(x) >> (%i5) radcan(%-(out2)); >> (out5) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) >> (%i6) radcan(%); >> (out6) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) >> (%i7) signum2abs(%); >> (out7) 0 >> (%i8) kill(all); >> (out0) done >> (%i1) load(abs_integrate); >> (out1) >> "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/integration/abs_integrate.mac" >> >> (%i2) 3*x^2*sqrt(1-1/x^2); >> (out2) 3*sqrt(1-1/x^2)*x^2 >> (%i3) integrate(%,x); >> (out3) (1-1/x^2)^(3/2)*x^3 >> (%i4) diff(%,x); >> (out4) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) >> (%i5) radcan(%-(out2)); >> (out5) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) >> (%i6) radcan(%); >> (out6) 0 >> ------------------------------------------------------------------------ >> >> >> _______________________________________________ >> 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 mhw at netris.org Wed Jan 5 19:08:45 2011 From: mhw at netris.org (Mark H Weaver) Date: Wed, 05 Jan 2011 20:08:45 -0500 Subject: [Maxima] Are these both the right answer for the integral? In-Reply-To: (Richard Hennessy's message of "Wed, 05 Jan 2011 19:19:48 -0500") References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> <4D24EB75.8070609@math.unicaen.fr> <191FAB1AE0E24403810041E42BAA03BE@RichsLaptop> Message-ID: <87ei8qq1nm.fsf@yeeloong.netris.org> "Richard Hennessy" writes: > On second thought this is not okay. You cannot add signum(x) *%i, > because that is not a constant. As reyssat pointed out, since the integrand is undefined at x=-1, x=0, and x=1, the integral is defined only up to an additive constant on _each_ of the intervals (-inf,-1) (-1,0) (0,1) and (1,inf). Each of those intervals can have its own constant, and they needn't be the same. In other words, instead of the traditional integration constant C, in this case you may add f(x) to the integral, where f is defined as follows (for any constants C1,C2,C3,C4): f(x) := if x<-1 then C1 elseif x<0 then C2 elseif x<1 then C3 else C4; signum(x)*%i is equivalent to f(x) where C1=C2=-%i and C3=C4=%i, except at 0 where the integral is undefined anyway. Mark From rich.hennessy at verizon.net Wed Jan 5 22:12:13 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 05 Jan 2011 23:12:13 -0500 Subject: [Maxima] Are these both the right answer for the integral? In-Reply-To: <4D2513E6.5000405@math.unicaen.fr> References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> <4D24EB75.8070609@math.unicaen.fr> <191FAB1AE0E24403810041E42BAA03BE@RichsLaptop> <4D2513E6.5000405@math.unicaen.fr> Message-ID: You are right again. The answer from pwint is. pwint(3*x^2*sqrt(1-1/x^2),x); 3/2 ((x - 1) (x + 1)) %i 3 (-------------------- + --) signum(x) 3 3 expand(%); 2 3/2 (x - 1) signum(x) + %i signum(x) So if you drop %i*signum(x) you get 2 3/2 (x - 1) signum(x) Which is okay too but undefined between (-1,1). I said it was wrong because I tried to plot the function and it looked wrong, but I must have made a mistake, the plot looks fine. You can call it a feature, but to plot it you have to drop the %i*signum(x) term. Thanks for your help. Rich -----Original Message----- From: reyssat Sent: Wednesday, January 05, 2011 7:59 PM To: Richard Hennessy Cc: Maxima List ; reyssat at math.unicaen.fr Subject: Re: [Maxima] Are these both the right answer for the integral? Le 06/01/2011 01:19, Richard Hennessy a ?crit : > On second thought this is not okay. You cannot add signum(x) *%i, because > that is not a constant. Due to the term 1-1/x^2, the function is not defined at 0 hence signum(x)*%i _is_ a constant on each interval where your function is defined. You can choose different integration constants on disjoint intervals. > I think it is a bug which I don't know offhand how to fix. I would not > call it a feature. The function is not real from (-1,1). That is not a > supported type of function. When I wrote pw I was thinking about real > functions not complex ones. I will have to figure it out. I don't see > how you can call it a feature. The complex function explains the behaviour of the real one, but we may of course restrict to the real values only. I didn't look precisely at the documentation about your integration procedure of piecewise defined functions, so I cannot assert that it is a bug (i.e. contradictory to what you write it should return) or not. But in this case, the returned result (even with the singnum(x)*%i) is a function which has the correct derivative at each point of the real line where the given function f is defined without branch point (points where you can choose more than one analytic continuation, the points 1 and -1 here). I call it a feature because it gives a reasonable value of what we can call an integral of f. It would be a bug if you say in the documentation that the result is either an error message or an everywhere (on the real line) differentiable function whose derivative is f, since it is clearly not the case here. Eric > I just don't understand the problem yet. > > Rich > > > > -----Original Message----- From: Richard Hennessy > Sent: Wednesday, January 05, 2011 5:48 PM > To: reyssat > Cc: Maxima List > Subject: Re: [Maxima] Are these both the right answer for the integral? > > Thanks, your right, it is always okay to add a constant to the answer for > integrate. I don't understand integration with respect to complex numbers > very well. The article mentions that users who are only familiar with > real > integration would have a problem with understanding the answer to > integration of some piecewise functions. I am not sure if my algorithm is > right, I designed it for real numbers but sometimes complex numbers appear > out of nowhere. > > Rich > > > -----Original Message----- From: reyssat > Sent: Wednesday, January 05, 2011 5:06 PM > To: Richard Hennessy > Cc: Maxima List > Subject: Re: [Maxima] Are these both the right answer for the integral? > > Richard Hennessy a ?crit : >> Hi List, >> I found an article which gives an integral problem of interest. >> integrate(3*x^2*sqrt(1-1/x^2),x); >> Maxima alone said it works out to (1-1/x^2)^(3/2)*x^3, with >> abs_integrate loaded the answer is the same (1-1/x^2)^(3/2)*x^3, but with >> pw.mac loaded Maxima gives 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) >> They all agree that diff(integrate(3*x^2*sqrt(1-1/x^2),x),x) gives the >> original form back, but not directly. You have to simplify to get >> everything to cancel out to 0. I don?t know why pw.mac returns an answer >> with %i in it. Is that a bug? >> Rich >> > Hi Rich, > The function is a multivalued function defined on the complex plane > except at 0 , 1 and -1. > So on the real line, depending on how the integral is computed, the > answer is defined only up to an additive constant on each of the > intervals ]-inf,-1[ , ]-1,0[ , ]0,1[ , ]1,inf[. The answer with pw.mac > just adds %i, this is ok, it could even be worse : adding %i + > 5*%i*signum(1-x) - (3+2*%i)*signum(1+x) is also a correct result. > So I don't know either why pw.mac adds %i, but I would consider it as a > feature, not a bug. > > Eric >> (%i25) kill(all); >> (out0) done >> (%i1) 3*x^2*sqrt(1-1/x^2); >> (out1) 3*sqrt(1-1/x^2)*x^2 >> (%i2) integrate(%,x); >> (out2) (1-1/x^2)^(3/2)*x^3 >> (%i3) diff(%,x); >> (out3) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) >> (%i4) radcan(%-(out1)); >> (out4) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) >> (%i5) radcan(%); >> (out5) 0 >> (%i6) kill(all); >> (out0) done >> (%i1) load(pw); >> (out1) "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/pw.mac" >> (%i2) 3*x^2*sqrt(1-1/x^2); >> (out2) 3*sqrt(1-1/x^2)*x^2 >> (%i3) pwint(%,x); >> (out3) 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x) >> (%i4) diff(%,x); >> (out4) 3*x*sqrt((x-1)*(x+1))*signum(x) >> (%i5) radcan(%-(out2)); >> (out5) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) >> (%i6) radcan(%); >> (out6) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x) >> (%i7) signum2abs(%); >> (out7) 0 >> (%i8) kill(all); >> (out0) done >> (%i1) load(abs_integrate); >> (out1) >> "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/integration/abs_integrate.mac" >> (%i2) 3*x^2*sqrt(1-1/x^2); >> (out2) 3*sqrt(1-1/x^2)*x^2 >> (%i3) integrate(%,x); >> (out3) (1-1/x^2)^(3/2)*x^3 >> (%i4) diff(%,x); >> (out4) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2) >> (%i5) radcan(%-(out2)); >> (out5) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x)) >> (%i6) radcan(%); >> (out6) 0 >> ------------------------------------------------------------------------ >> >> >> _______________________________________________ >> 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 Wed Jan 5 22:41:02 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 05 Jan 2011 23:41:02 -0500 Subject: [Maxima] Are these both the right answer for the integral? In-Reply-To: <87ei8qq1nm.fsf@yeeloong.netris.org> References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> <4D24EB75.8070609@math.unicaen.fr> <191FAB1AE0E24403810041E42BAA03BE@RichsLaptop> <87ei8qq1nm.fsf@yeeloong.netris.org> Message-ID: You are right too. I think I tried to plot realpart() of the answer which is not the right way to check for correctness in all cases. Plotting realpart(%) gives the wrong sign for x < 0. Rich -----Original Message----- From: Mark H Weaver Sent: Wednesday, January 05, 2011 8:08 PM To: Richard Hennessy Cc: reyssat ; Maxima List Subject: Re: Are these both the right answer for the integral? "Richard Hennessy" writes: > On second thought this is not okay. You cannot add signum(x) *%i, > because that is not a constant. As reyssat pointed out, since the integrand is undefined at x=-1, x=0, and x=1, the integral is defined only up to an additive constant on _each_ of the intervals (-inf,-1) (-1,0) (0,1) and (1,inf). Each of those intervals can have its own constant, and they needn't be the same. In other words, instead of the traditional integration constant C, in this case you may add f(x) to the integral, where f is defined as follows (for any constants C1,C2,C3,C4): f(x) := if x<-1 then C1 elseif x<0 then C2 elseif x<1 then C3 else C4; signum(x)*%i is equivalent to f(x) where C1=C2=-%i and C3=C4=%i, except at 0 where the integral is undefined anyway. Mark From eric.reyssat at math.unicaen.fr Thu Jan 6 01:43:01 2011 From: eric.reyssat at math.unicaen.fr (reyssat) Date: Thu, 06 Jan 2011 08:43:01 +0100 Subject: [Maxima] Are these both the right answer for the integral? In-Reply-To: References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> <4D24EB75.8070609@math.unicaen.fr> <191FAB1AE0E24403810041E42BAA03BE@RichsLaptop> <87ei8qq1nm.fsf@yeeloong.netris.org> Message-ID: <4D257285.60100@math.unicaen.fr> Le 06/01/2011 05:41, Richard Hennessy a ?crit : > You are right too. I think I tried to plot realpart() of the answer > which is not the right way to check for correctness in all cases. > Plotting realpart(%) gives the wrong sign for x < 0. There is no right or wrong sign when the function x --> (x^2-1)^(3/2) is involved. Both are correct (this is the multivaluedness of fractional power functions). Each time you try to force a sign, the function will trap you somewhere else. For instance, you may force each fractional power (with even denominator) to be positive, but then (-2)^(2/6) is positive and (-2)^(1/3) is negative ! Even if this is not the most convincing example, the fact that the function is defined for complex numbers (and continuous there, even analytic) except a finite number of points, forces to accept ALL signs (we say all determinations) of the function, even on R. You may choose some signs in some occasions, but the choices CANNOT be always consistent, in particular if you look globally (i.e. on the whole real line). Eric > > Rich > > > > -----Original Message----- From: Mark H Weaver > Sent: Wednesday, January 05, 2011 8:08 PM > To: Richard Hennessy > Cc: reyssat ; Maxima List > Subject: Re: Are these both the right answer for the integral? > > "Richard Hennessy" writes: >> On second thought this is not okay. You cannot add signum(x) *%i, >> because that is not a constant. > > As reyssat pointed out, since the integrand is undefined at x=-1, x=0, > and x=1, the integral is defined only up to an additive constant on > _each_ of the intervals (-inf,-1) (-1,0) (0,1) and (1,inf). Each of > those intervals can have its own constant, and they needn't be the same. > > In other words, instead of the traditional integration constant C, in > this case you may add f(x) to the integral, where f is defined as > follows (for any constants C1,C2,C3,C4): > > f(x) := if x<-1 then C1 elseif x<0 then C2 elseif x<1 then C3 else C4; > > signum(x)*%i is equivalent to f(x) where C1=C2=-%i and C3=C4=%i, except > at 0 where the integral is undefined anyway. > > Mark > From razif66 at gmail.com Thu Jan 6 02:23:11 2011 From: razif66 at gmail.com (razif razali) Date: Thu, 6 Jan 2011 16:23:11 +0800 Subject: [Maxima] how to make maxima create equation like i give in attachment In-Reply-To: <4D2484AC.70404@eecs.berkeley.edu> References: <4D2484AC.70404@eecs.berkeley.edu> Message-ID: Thanks for your reply, so from your guide, here what I come through, ------------------ df(n,k):= block ([], if n=0 then 0 else 'diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]) ); makelist(df(1,k),k,1,2); ------------------------ I can get the equation for diff( f[2,1],s) and diff( f[2,2],s) respectively, so next thing is, how can i make diff( f[2,1],s) and diff( f[2,2]) hold it value?because when I type again diff( f[2,1],s) in maxima after give code above, it gives zero. what i want do here is after i get equation diff( f[2,1],s) i want to solve with both equation using ode method to get function of f[2,1] and f[2,2] with f[2*n,k](0)=A, and value of x and A are not zero... On Wed, Jan 5, 2011 at 10:48 PM, Richard Fateman wrote: > 1. first of all, you already sent the pdf file to everyone. > > 2. Maxima notation does not have "superscripted" variables. However, it > does allow any number of subscripts. > Therefore you can encode your function as f[2*n,k], or even better to > show the dependency on s, > you can use the notation f[2*n,k](s). > > 3. The notation for derivatives is this: diff( f[2*n,k](s), s). > > 4. The notation for square roots is sqrt(n-k-1) > > 5. If you want to make lists of equations, you can use makelist(). You can > read about > it by typing ? makelist in to the command line of wxmaxima, which I hope > you are using. > > 6. If you plan to do anything with Maxima, I suggest you read a tutorial. > It is not the same as TeX. > > > > > > > On 1/4/2011 11:30 PM, razif razali wrote: > > General equation > > df(2n_k) / ds = \psi [ (k-1) sqrt {n-k+2} f(2n_k-1) - k sqrt{n-k+1} > f(2n_k+1) > > with k = 1,2,3,4,5...n+1 , and n = 0,1,2,3,4...n > > for n=0 , we will get df(0_1) / ds = 0 > > for n=1, we should get equation for df(2_1)/ds and df(2_2)/ds > > and for n=2, we should get equation for df(4_1)/ds , df(4_2)/ds and > df(4_3)/ds respectively. > > For higher n it should follow the general equation and will generate n+1 > differential equation from it, > > so what i want to do is, how to code in maxima and get all those > differential equation from general equation by just giving maxima the value > of n number. > > hope someone can help me and sorry for bad writing in this email because > i try to attach pdf file but then its too large for maxima newslater to > broadcast it to all of you. > > Thanks a lot, if someone need the pdf file, i'll sent those file directly > to you when you reply this problem. > > regards > > > _______________________________________________ > 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: From l.butler at ed.ac.uk Thu Jan 6 07:40:50 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 6 Jan 2011 13:40:50 +0000 (GMT) Subject: [Maxima] how to make maxima create equation like i give in attachment In-Reply-To: References: <4D2484AC.70404@eecs.berkeley.edu> Message-ID: On Thu, 6 Jan 2011, razif razali wrote: < Thanks for your reply, < so from your guide, here what I come through, < ------------------ < df(n,k):= < block ([], < ?? ?if n=0 < ?? ?then 0 < ??else < ??'diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]) < ); < makelist(df(1,k),k,1,2); < ------------------------ < I can get the equation for diff( f[2,1],s) and diff( f[2,2],s) respectively, < < so next thing is, how can i make diff( f[2,1],s) and diff( f[2,2]) hold it value?because when I type again diff( f[2,1],s) in maxima after give code above, it gives < zero. what i want do here is after i get equation diff( f[2,1],s) i want to solve with both equation using ode method to get function of f[2,1] and f[2,2] with < f[2*n,k](0)=A, and value of x and A are not zero... The problem is that Maxima does not know that f[n,k] is a function of s, too. Here is a solution: depends(f,s); df[n,k] := if n=0 then 0 else diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); . . . Note that I do not use 'diff, because the first line tells Maxima that f is a function of s. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From willisb at unk.edu Thu Jan 6 08:50:00 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 6 Jan 2011 08:50:00 -0600 Subject: [Maxima] Bugs in abs_integrate.mac In-Reply-To: <87r5crosn5.fsf@yeeloong.netris.org> References: <87r5crosn5.fsf@yeeloong.netris.org> Message-ID: Mark, Thanks for the bug report and (especially) your clear and detailed analysis. I have fixes for each of these bugs. The fix for abs_defint(unit_step(x),x,99,100) is what you suggested. To fix abs_defint(unit_step(unit_step(x)),x,-1,0), I changed the signum representation for unit_step to unit_step(x) = (signum(x)*(signum(x)+1))/2 Additionally, some abs_integrate functions convert terms such as signum(nonconstant polynomial)^2 to 1. In the context of an integrand signum(nonconstant polynomial)^2 = 1 is an OK identity, I think. It will take me some time to re-think and improve these fixes. Maybe you could file a bug report--I like having a record of bugs. Again, thanks for your bug report. --Barton (author of abs_integrate) -----maxima-bounces at math.utexas.edu wrote: ----- >I?have?found?some?bugs?in?abs_integrate.mac: >(%i3)?abs_defint(unit_step(x),x,99,100); >(%o3)?100 >(%i4)?abs_defint(unit_step(unit_step(x)),x,-1,0); >(%o4)?1/2 From mhw at netris.org Thu Jan 6 12:06:01 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 06 Jan 2011 13:06:01 -0500 Subject: [Maxima] Bug in simpplog Message-ID: [I posted this in July, but it got lost in the moderator queue] I noticed recently that plog's simplifier knows less than atan2's: (%i1) display2d:false; (%o1) false (%i2) plog( (%i + sqrt(3))/2 ); (%o2) plog((%i+sqrt(3))/2) (%i3) atan2( 1/2, sqrt(3)/2 ); (%o3) %pi/6 After some investigation, I found that simpplog contains the necessary logic to simplify the example above, but is failing due to a bug. simpplog (in csimp2.lisp) calls newvar (in rat3e.lisp) to find the variables in plog's argument. In the case of complex numbers which are neither real nor purely imaginary, it only attempts simplification if the FIRST variable found by newvar is %i, and the rest are all non-atoms: (cond ((and (eq '$%i (car varlist)) (not (some #'atom (cdr varlist)))) In the example above, newvar reports two "variables": sqrt(3) and %i, in that order. Since the the %i doesn't come first, simpplog refuses to simplify it. The patch below changes the test as follows, so that %i needn't come first. (cond ((and (member '$%i varlist) (not (some #'(lambda (v) (and (atom v) (not (eq v '$%i)))) varlist))) With this change, plog now handles the above case properly: (%i2) plog( (%i + sqrt(3))/2 ); (%o2) %i*%pi/6 However, I also wonder about the rationale of requiring that other "variables" (other than %i) be non-atomic. Is this test really relevant to decide whether to perform this simplification? Mark diff -u -F defmfun src/csimp2{-orig,}.lisp --- src/csimp2-orig.lisp 2010-09-24 15:42:04.000000000 -0400 +++ src/csimp2.lisp 2011-01-06 12:52:48.000000000 -0500 @@ -38,7 +38,10 @@ (defmfun simpplog (x vestigial z) (return (eqtest (list '(%plog) x) check)))) (newvar x) (cond - ((and (eq '$%i (car varlist)) (not (some #'atom (cdr varlist)))) + ((and (member '$%i varlist) + (not (some #'(lambda (v) + (and (atom v) (not (eq v '$%i)))) + varlist))) (setq dd (trisplit x)) (cond ((setq z (patan (car dd) (cdr dd))) (return (add2* (simpln (list '(%log) From mhw at netris.org Thu Jan 6 13:31:01 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 06 Jan 2011 14:31:01 -0500 Subject: [Maxima] Bug in z_transform.mac? Message-ID: z_transform.mac includes the following rule: defrule (r913_2b, z_transform (unit_step (nn%), nn%, zz%), zz/(zz - 1)); Presumably this package is meant to compute the unilateral Z-transform, which is defined as follows: (according to http://en.wikipedia.org/wiki/Z-transform ) z_transform(f(n),n,z) = sum(f(n)*z^(-n), n,0,inf) By this definition, the rule above is incorrect. The rule would be correct for a right-continuous unit_step function, i.e. where unit_step(0)=1. However, given that unit_step(0)=0, this is the correct rule: defrule (r913_2b, z_transform (unit_step (nn%), nn%, zz%), 1/(zz - 1)); I confess that I've never used the Z-transform, but I guess that a right-continuous unit_step function is more convenient in this context. Nonetheless, it seems like a very bad idea for most of Maxima to believe that unit_step(0)=0, but for z_transform.mac to assume that unit_step(0)=1. FYI, I'm currently adding support for a Heaviside step function hstep(x) such that hstep(0)=1/2. Perhaps we should support all three common variants of unit_step: left-continuous, right-continuous, and hstep. It should not be too hard to search for all occurrences of unit_step in the code and incorporate support for the other variants. What do you think? Mark From rich.hennessy at verizon.net Thu Jan 6 13:47:18 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 06 Jan 2011 14:47:18 -0500 Subject: [Maxima] Are these both the right answer for the integral? In-Reply-To: <4D257285.60100@math.unicaen.fr> References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> <4D24EB75.8070609@math.unicaen.fr> <191FAB1AE0E24403810041E42BAA03BE@RichsLaptop> <87ei8qq1nm.fsf@yeeloong.netris.org> <4D257285.60100@math.unicaen.fr> Message-ID: <779047244543440FBF86E3E5A9EB304F@RichsLaptop> It?s a feature, it's a feature!! (not a cookbook fortunately). Thanks for your detailed analysis. Rich -----Original Message----- From: reyssat Sent: Thursday, January 06, 2011 2:43 AM To: Richard Hennessy Cc: Maxima List Subject: Re: Are these both the right answer for the integral? Le 06/01/2011 05:41, Richard Hennessy a ?crit : > You are right too. I think I tried to plot realpart() of the answer which > is not the right way to check for correctness in all cases. Plotting > realpart(%) gives the wrong sign for x < 0. There is no right or wrong sign when the function x --> (x^2-1)^(3/2) is involved. Both are correct (this is the multivaluedness of fractional power functions). Each time you try to force a sign, the function will trap you somewhere else. For instance, you may force each fractional power (with even denominator) to be positive, but then (-2)^(2/6) is positive and (-2)^(1/3) is negative ! Even if this is not the most convincing example, the fact that the function is defined for complex numbers (and continuous there, even analytic) except a finite number of points, forces to accept ALL signs (we say all determinations) of the function, even on R. You may choose some signs in some occasions, but the choices CANNOT be always consistent, in particular if you look globally (i.e. on the whole real line). Eric > > Rich > > > > -----Original Message----- From: Mark H Weaver > Sent: Wednesday, January 05, 2011 8:08 PM > To: Richard Hennessy > Cc: reyssat ; Maxima List > Subject: Re: Are these both the right answer for the integral? > > "Richard Hennessy" writes: >> On second thought this is not okay. You cannot add signum(x) *%i, >> because that is not a constant. > > As reyssat pointed out, since the integrand is undefined at x=-1, x=0, > and x=1, the integral is defined only up to an additive constant on > _each_ of the intervals (-inf,-1) (-1,0) (0,1) and (1,inf). Each of > those intervals can have its own constant, and they needn't be the same. > > In other words, instead of the traditional integration constant C, in > this case you may add f(x) to the integral, where f is defined as > follows (for any constants C1,C2,C3,C4): > > f(x) := if x<-1 then C1 elseif x<0 then C2 elseif x<1 then C3 else C4; > > signum(x)*%i is equivalent to f(x) where C1=C2=-%i and C3=C4=%i, except > at 0 where the integral is undefined anyway. > > Mark > From mhw at netris.org Thu Jan 6 14:50:17 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 06 Jan 2011 15:50:17 -0500 Subject: [Maxima] Enhancement to solve_rec.mac Message-ID: <871v4ppxiu.fsf@yeeloong.netris.org> Hello Andrej and users of solve_rec.mac, A few months ago I tried to solve the following recurrence with solve_rec, but it failed: (%i1) display2d:false$ (%i2) load(solve_rec); (%o2) "/usr/local/share/maxima/5.23.0/share/contrib/solve_rec/solve_rec.mac" (%i3) solve_rec( c[n+1]=-n*c[n-1]/(n+1), c[n], c[0]=1, c[1]=2 ); (%o3) false However, I noticed that this recurrence is actually two independent recurrences: one recurrence for odd n, and one for even n. If I break them apart by hand, solve_rec is able to solve each one. I added code to solve_rec to do this job automatically: (%i4) load(solve_rec_mhw); (%o4) "/home/mhw/.maxima/solve_rec_mhw.mac" (%i5) solve_rec( c[n+1]=-n*c[n-1]/(n+1), c[n], c[0]=1, c[1]=2 ); (%t5) c_even[n] = -gamma(n/2+1/2)*(-1)^(n/2-1)/(sqrt(%pi)*(n/2)!) (%t6) c_odd[n] = -sqrt(%pi)*((n-1)/2)!*(-1)^((n-1)/2-1)/gamma((n-1)/2+3/2) (%o6) [%t5,%t6] It can split recurrences not only into evens and odds, but into any finite number of independent recurrences: (%i7) solve_rec( c[n+1]=-n*c[n-2]/(n+1), c[n], c[0]=1, c[1]=2, c[2]=3 ); (%t7) c_0[n] = -gamma(n/3+2/3)*(-1)^(n/3-1)/(gamma(2/3)*(n/3)!) (%t8) c_1[n] = -2*gamma(1/3)*((n-1)/3)!*(-1)^((n-1)/3-1) /(3*gamma((n-1)/3+4/3)) (%t9) c_2[n] = -6*gamma(2/3)*gamma((n-2)/3+4/3)*(-1)^((n-2)/3-1) /(gamma(1/3)*gamma((n-2)/3+5/3)) (%o9) [%t7,%t8,%t9] My patch follows. Comments and suggestions welcome. I'd especially be interested in possible suggestions on how best to return these results to the caller. Best, Mark *** share/contrib/solve_rec/solve_rec-orig.mac 2009-10-05 03:21:50.000000000 -0400 --- share/contrib/solve_rec/solve_rec.mac 2010-11-02 21:14:32.000000000 -0400 *************** *** 14,19 **** --- 14,25 ---- * *** Version: 1.08 *** * * *** Author: Andrej Vodopivec *** * * *** *** * + * *** Modified by Mark H Weaver in November 2010 *** * + * *** to solve recurrences in which the gcd of the index shifts is *** * + * *** greater than 1, such that the recurrence is equivalent to *** * + * *** multiple independent recurrences of lesser order, e.g.: *** * + * *** solve_rec( c[n+1]=-n*c[n-1]/(n+1), c[n], c[0]=1, c[1]=2 ); *** * + * *** *** * * ************************************************************************* * * * * * *************** *** 96,101 **** --- 102,112 ---- map(lambda([%u], change_to_shift_op(%u, %f, %n)), args(expr))) else expr$ + gcd_shift(expr) := + if atom(expr) then 0 + else if part(expr, 0)=shift_op then part(expr, 3) + else first(apply('ezgcd, map('gcd_shift, args(expr))))$ + max_shift(expr) := if atom(expr) then -inf else if part(expr, 0)=shift_op then part(expr, 3) *************** *** 156,161 **** --- 167,217 ---- to_standard_form1(tmp, %n, m) )$ + /************************************************************************** + * + * reduce the order of a recurrence whose shifts have a gcd > 1 + * + *************************************************************************/ + + srec_reduce_order(expr) := + if atom(expr) then ( + if expr=%n then (%nn * %mult) + %offset + else expr + ) + else if part(expr, 0)='shift_op then ( + if part(expr, 2)=%n + then funmake('shift_op, [%ff, %nn, part(expr, 3) / %mult]) + else expr + ) + else if member(part(expr, 0), ["+", "-", "*", "/", "^"]) + then apply(part(expr, 0), map('srec_reduce_order, args(expr))) + else subst(%n = (%nn * %mult) + %offset, expr)$ + + srec_reduce_order_cond1(cond) := + if part(cond,0)#"=" or part(cond,1,0)#%f or + length(part(cond,1))#1 or not integerp(part(cond,1,1)) + then error("Invalid solve_rec condition", cond) + else block ([newidx : (part(cond,1,1) - %offset) / %mult], + if integerp(newidx) + then [ substpart(%ff, substpart(newidx,cond,1,1), 1, 0) ] + else [] + )$ + + srec_reduce_order_conds(conds) := + apply('append, map(srec_reduce_order_cond1, conds))$ + + srec_finalize_reduced_order_sol(expr) := + if atom(expr) then ( + if expr=%nn then (%n - %offset) / %mult + else expr + ) + else if part(expr,0)=%ff then ( + srec_finalize_reduced_order_sol(part(expr,1)) * %mult + %offset, + substpart(%%, fn, 1), + substpart(%fff, %%, 0) + ) + else if mapatom(expr) then expr + else map('srec_finalize_reduced_order_sol, expr)$ /************************************************************************** * *************** *** 164,170 **** *************************************************************************/ solve_rec(eq, fn, [cond]) := block( ! [std_form, %f, %n, deg, ord, hyper_to_product : true, sol : false], if atom(fn) then return(false), if length(fn)#1 then return(false), %f : part(fn, 0), --- 220,227 ---- *************************************************************************/ solve_rec(eq, fn, [cond]) := block( ! [std_form, %f, %n, deg, ord, %mult, ! hyper_to_product : true, sol : false], if atom(fn) then return(false), if length(fn)#1 then return(false), %f : part(fn, 0), *************** *** 175,189 **** std_form : to_standard_form(eq, %f, %n), std_form : expand(num(ratsimp(std_form))), ! ord : differ_order(std_form), ! if ord=1 then sol : solve_rec_order_1(std_form, %f, %n, cond) ! else sol : solve_rec_gen(std_form, %f, %n, cond), ! if sol=false then false ! else ( ! if listp(sol) then sol ! else fn=sol ) )$ --- 232,272 ---- std_form : to_standard_form(eq, %f, %n), std_form : expand(num(ratsimp(std_form))), ! %mult : gcd_shift(std_form), ! if %mult=1 then ( ! ord : differ_order(std_form), ! if ord=1 then sol : solve_rec_order_1(std_form, %f, %n, cond) ! else sol : solve_rec_gen(std_form, %f, %n, cond), ! if sol=false then false ! else ( ! if listp(sol) then sol ! else fn=sol ! ) ! ) else block( ! [ %nn : ?gensym(), %ff : ?gensym(), %fff, ! reduced_form, reduced_cond, solns : [] ], ! ! for %offset:0 thru %mult-1 do ( ! if %mult # 2 then %fff : concat(%f, "_", %offset) ! else if %offset = 0 then %fff : concat(%f, "_even") ! else %fff : concat(%f, "_odd"), ! ! reduced_form : srec_reduce_order(std_form), ! reduced_cond : srec_reduce_order_conds(cond), ! ! ord : differ_order(reduced_form), ! ! if ord=1 then sol : solve_rec_order_1(reduced_form, %ff, %nn, reduced_cond) ! else sol : solve_rec_gen(reduced_form, %ff, %nn, reduced_cond), ! ! if sol#false and not listp(sol) then sol : arraymake(%ff,[%nn])=sol, ! sol : srec_finalize_reduced_order_sol(sol), ! solns : cons(sol, solns) ! ), ! solns : reverse(solns), ! apply('ldisp, solns) ) )$ From micknudsen at gmail.com Thu Jan 6 13:30:38 2011 From: micknudsen at gmail.com (Michael Knudsen) Date: Thu, 6 Jan 2011 20:30:38 +0100 Subject: [Maxima] Body of For Loop Message-ID: Hi, I have a list of equations called myEquations, and they all depend on a single parameter p. Using a command like specificEquations : myEquations, p = 1; one gets a new list, specificEquations, containing the original equations with 1 substituted for the variable p. So far, so good! However, if I try to do something similar in a for loop, something strange happens. for i from 1 thru 10 do ( (specificEquations : myEquations, p = i), print(specificEquations) ); Here all print statements yield the same output, which is just myEquations with no value substituted for p. What am I missing here? Thanks in advance! Michael Knudsen -- Michael Knudsen micknudsen at gmail.com From rich.hennessy at verizon.net Thu Jan 6 16:36:53 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 06 Jan 2011 17:36:53 -0500 Subject: [Maxima] Body of For Loop In-Reply-To: References: Message-ID: <1DF253BD07314CD9B78C50028D607FD8@RichsLaptop> You probably want to do. for i from 1 thru 10 do ( ( p : i, specificEquations : myEquations, print(specificEquations) ); In a program the syntax is a little different since commas indicate the end of a statement (in a program). Rich -----Original Message----- From: Michael Knudsen Sent: Thursday, January 06, 2011 2:30 PM To: maxima at math.utexas.edu Subject: [Maxima] Body of For Loop Hi, I have a list of equations called myEquations, and they all depend on a single parameter p. Using a command like specificEquations : myEquations, p = 1; one gets a new list, specificEquations, containing the original equations with 1 substituted for the variable p. So far, so good! However, if I try to do something similar in a for loop, something strange happens. for i from 1 thru 10 do ( (specificEquations : myEquations, p = i), print(specificEquations) ); Here all print statements yield the same output, which is just myEquations with no value substituted for p. What am I missing here? Thanks in advance! Michael Knudsen -- Michael Knudsen micknudsen at gmail.com _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Thu Jan 6 16:41:17 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 6 Jan 2011 17:41:17 -0500 Subject: [Maxima] Body of For Loop In-Reply-To: References: Message-ID: The command-line syntax sdlfskdljf, sdfsdf ; is a syntactic shortcut for ev(sdlfskdljf, sdfsdf), which you can use within your for-loop. However, I warn you that the semantics of 'ev' are extremely messy and rarely appropriate for programmatic use. The cleaner way to do this is to use substitution, e.g. specificEquations : subst(p=i,myEquations) or even better specificEquations : subst(i,'p,myEquations) Writing 'p rather than p ensures that if p happens to have an assigned value, that won't interfere with the intended operation. -s On Thu, Jan 6, 2011 at 14:30, Michael Knudsen wrote: > Hi, > > I have a list of equations called myEquations, and they all depend on > a single parameter p. Using a command like > > specificEquations : myEquations, p = 1; > > one gets a new list, specificEquations, containing the original > equations with 1 substituted for the variable p. So far, so good! > However, if I try to do something similar in a for loop, something > strange happens. > > for i from 1 thru 10 do ( > > (specificEquations : myEquations, p = i), > print(specificEquations) > > ); > > Here all print statements yield the same output, which is just > myEquations with no value substituted for p. > > What am I missing here? Thanks in advance! > > Michael Knudsen > > -- > Michael Knudsen > micknudsen at gmail.com > _______________________________________________ > 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 Jan 6 16:43:23 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 6 Jan 2011 17:43:23 -0500 Subject: [Maxima] Body of For Loop In-Reply-To: <1DF253BD07314CD9B78C50028D607FD8@RichsLaptop> References: <1DF253BD07314CD9B78C50028D607FD8@RichsLaptop> Message-ID: Richard, I doubt that that is what Knudsen wants to do. Assigning p:i does not substitute i for p in myEquations: (%i9) myeqs: [x=2*p,y=p^2]; (%o9) [x = 2*p,y = p^2] (%i10) p:23$ (%i11) myeqs; (%o11) [x = 2*p,y = p^2] <<< no substitution performed -s On Thu, Jan 6, 2011 at 17:36, Richard Hennessy wrote: > You probably want to do. > > > > for i from 1 thru 10 do ( > ( > p : i, > specificEquations : myEquations, > print(specificEquations) > ); > > In a program the syntax is a little different since commas indicate the end > of a statement (in a program). > > Rich > > > -----Original Message----- From: Michael Knudsen > Sent: Thursday, January 06, 2011 2:30 PM > To: maxima at math.utexas.edu > Subject: [Maxima] Body of For Loop > > > Hi, > > I have a list of equations called myEquations, and they all depend on > a single parameter p. Using a command like > > specificEquations : myEquations, p = 1; > > one gets a new list, specificEquations, containing the original > equations with 1 substituted for the variable p. So far, so good! > However, if I try to do something similar in a for loop, something > strange happens. > > for i from 1 thru 10 do ( > > (specificEquations : myEquations, p = i), > print(specificEquations) > > ); > > Here all print statements yield the same output, which is just > myEquations with no value substituted for p. > > What am I missing here? Thanks in advance! > > Michael Knudsen > > -- > Michael Knudsen > micknudsen at gmail.com > _______________________________________________ > 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 eb at civil.aau.dk Thu Jan 6 17:02:57 2011 From: eb at civil.aau.dk (Esben Byskov) Date: Fri, 7 Jan 2011 00:02:57 +0100 Subject: [Maxima] 4th order DE Message-ID: <4D264A21.8050202@civil.aau.dk> *Hi, Can anyone tell me if there are ways to solve 4th order ordinary differential equations in maxima. I am particularly interested in boundary value problems rather than initial value problems. As an example: ode: 'diff((1-1/2*t)*'diff(y(t),t,2),t,2)=1; atvalue(y(t),t=0,0); atvalue(y(t),t=1,0); atvalue('diff(y(t),t,2),t=1,0); atvalue('diff(y(t),t),t=0,0); (It is concerned with bending of a beam.) I have used Maple and MuPAD, most frequently MuPAD, and both these programs solve such a problem easily. But, I am considering switching to maxima. Thank you very much, Esben Byskov * -- Esben Byskov, Ph.D., Dr.Techn. Professor Emeritus of Structural Analysis Department of Civil Engineering Aalborg University Sohngaardsholmsvej 57 DK-9000 Aalborg Denmark Phone: +45 3963 7328 e-mail: eb at civil.aau.dk -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Thu Jan 6 17:16:33 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 06 Jan 2011 15:16:33 -0800 Subject: [Maxima] 4th order DE In-Reply-To: <4D264A21.8050202@civil.aau.dk> References: <4D264A21.8050202@civil.aau.dk> Message-ID: <4D264D51.5020909@eecs.berkeley.edu> On 1/6/2011 3:02 PM, Esben Byskov wrote: > *Hi, > > Can anyone tell me if there are ways to solve 4th order ordinary > differential equations in maxima. I am particularly interested > in boundary value problems rather than initial value problems.* *I don't know if someone has written this out, but the usual approach that you might use by hand can also be done by Maxima. I expect that is to write this out as a system of 4 first order ODEs, and solve this system. I don't know if there is a single command in some package to do this, but all the needed components are around.** * -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Thu Jan 6 17:23:36 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 06 Jan 2011 18:23:36 -0500 Subject: [Maxima] Body of For Loop In-Reply-To: References: <1DF253BD07314CD9B78C50028D607FD8@RichsLaptop> Message-ID: <91FDE155B7074370910C703B6BF118D5@RichsLaptop> You are right, that does not work. Another way is to use at(). for i from 1 thru 10 do ( ( specificEquations : at(myEquations, [p=i]), print(specificEquations) ); Of course this is just another way, not necessarily better. I don?t recommend ev() either BTW. Rich From: Stavros Macrakis Sent: Thursday, January 06, 2011 5:43 PM To: Richard Hennessy Cc: Michael Knudsen ; maxima at math.utexas.edu Subject: Re: [Maxima] Body of For Loop Richard, I doubt that that is what Knudsen wants to do. Assigning p:i does not substitute i for p in myEquations: (%i9) myeqs: [x=2*p,y=p^2]; (%o9) [x = 2*p,y = p^2] (%i10) p:23$ (%i11) myeqs; (%o11) [x = 2*p,y = p^2] <<< no substitution performed -s On Thu, Jan 6, 2011 at 17:36, Richard Hennessy wrote: You probably want to do. for i from 1 thru 10 do ( ( p : i, specificEquations : myEquations, print(specificEquations) ); In a program the syntax is a little different since commas indicate the end of a statement (in a program). Rich -----Original Message----- From: Michael Knudsen Sent: Thursday, January 06, 2011 2:30 PM To: maxima at math.utexas.edu Subject: [Maxima] Body of For Loop Hi, I have a list of equations called myEquations, and they all depend on a single parameter p. Using a command like specificEquations : myEquations, p = 1; one gets a new list, specificEquations, containing the original equations with 1 substituted for the variable p. So far, so good! However, if I try to do something similar in a for loop, something strange happens. for i from 1 thru 10 do ( (specificEquations : myEquations, p = i), print(specificEquations) ); Here all print statements yield the same output, which is just myEquations with no value substituted for p. What am I missing here? Thanks in advance! Michael Knudsen -- Michael Knudsen micknudsen at gmail.com _______________________________________________ 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 eb at civil.aau.dk Thu Jan 6 17:38:12 2011 From: eb at civil.aau.dk (Esben Byskov) Date: Fri, 7 Jan 2011 00:38:12 +0100 Subject: [Maxima] 4th order DE In-Reply-To: <4D264D51.5020909@eecs.berkeley.edu> References: <4D264A21.8050202@civil.aau.dk> <4D264D51.5020909@eecs.berkeley.edu> Message-ID: <4D265264.9090606@civil.aau.dk> *Thanks to Richard Fateman for the answer. I don't have access to Maple anymore, but this did the job: diffeqw:= ({diff((1-alpha*xi)*diff(w(xi),xi$2),xi$2) = 1, \ w(0)=0, \ D(w)(0)=0, \ w(1)=0, \ D(D(w))(1)=0}, \ w(xi)); wsol:=dsolve(diffeqw); wsol:=op(2,wsol); and MuPAD has something like it: diffeqw:=ode({diff((1-1/2*xi)*diff(w(xi),xi$2),xi$2) = 1, \ w(0)=0, \ D(w)(0)=0, \ w(1)=0, \ D(D(w))(1)=0}, \ w(xi)); w0:=solve(diffeqw); w0:=op(w0,1); Both these ways seem easier than converting the problem to a system of 4 first order ODEs. Best regards, Esben Byskov * Esben Byskov, Ph.D., Dr.Techn. Professor Emeritus of Structural Analysis Department of Civil Engineering Aalborg University Sohngaardsholmsvej 57 DK-9000 Aalborg Denmark Phone: +45 3963 7328 e-mail: eb at civil.aau.dk On 2011-01-07 00:16, Richard Fateman wrote: > On 1/6/2011 3:02 PM, Esben Byskov wrote: >> *Hi, >> >> Can anyone tell me if there are ways to solve 4th order ordinary >> differential equations in maxima. I am particularly interested >> in boundary value problems rather than initial value problems.* > *I don't know if someone has written this out, but the usual approach that > you might use by hand can also be done by Maxima. > > I expect that is to write this out as a system of 4 first order ODEs, and > solve this system. I don't know if there is a single command > in some package to do this, > but all the needed components are around.** > > * -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Thu Jan 6 19:01:13 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 6 Jan 2011 19:01:13 -0600 Subject: [Maxima] 4th order DE In-Reply-To: <4D265264.9090606@civil.aau.dk> References: <4D264A21.8050202@civil.aau.dk> <4D264D51.5020909@eecs.berkeley.edu>, <4D265264.9090606@civil.aau.dk> Message-ID: Maxima has desolve, but for this equation ilt (inverse Laplace transform) is unable to determine the needed transform: (%i11) 'diff((1-1/2*t)*'diff(y(t),t,2),t,2)=1$ (%i12) desolve('diff((1-1/2*t)*'diff(y(t),t,2),t,2)=1,[y(t)]); (%o12) y(t)=ilt(-(g35251^5*('diff(laplace(y(t),t,g35251),g35251,1))+y(0)*(-2*g35251^4-g35251^3)-2*(at('diff(y(t),t,1),t=0))*g35251^3+ (at('diff(y(t),t,2),t=0))*(g35251-2*g35251^2)-2*(at('diff(y(t),t,3),t=0))*g35251-2)/(2*g35251^5+2*g35251^4),g35251,t) A hand solution is something like: (%i16) ode2(integrate(integrate('diff((1-1/2*t)*'diff(y,t,2),t,2)=1,t),t),y,t); (%o16) y=-(((12*%c7+24*%c6+24)*t-24*%c7-48*%c6-48)*log(t-2)+t^3+(6*%c6+6)*t^2+(-12*%c7-24*%c6-24)*t)/6+%k2*t+%k1 You'll need to impose the boundary conditions. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >??????????I?don't?have?access?to?Maple?anymore,?but?this?did?the?job: >???????????diffeqw:=???({diff((1-alpha*xi)*diff(w(xi),xi$2),xi$2)?=?1,?\ > >????????????????????????w(0)=0,?\ > >????????????????????????D(w)(0)=0,?\ > >????????????????????????w(1)=0,?\ > >????????????????????????D(D(w))(1)=0},?\ > >????????????????????????w(xi)); > >?????????? > >???????????wsol:=dsolve(diffeqw); > >???????????wsol:=op(2,wsol); From rich.hennessy at verizon.net Thu Jan 6 21:43:47 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 06 Jan 2011 22:43:47 -0500 Subject: [Maxima] Bugs in abs_integrate.mac In-Reply-To: References: <87r5crosn5.fsf@yeeloong.netris.org> Message-ID: pw.mac's pwint() has similar problems. I added some new test cases to rtest_pw.mac. This is not easy to fix anymore, pw.mac has become complex. Rich -----Original Message----- From: Barton Willis Sent: Thursday, January 06, 2011 9:50 AM To: Mark H Weaver Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bugs in abs_integrate.mac Mark, Thanks for the bug report and (especially) your clear and detailed analysis. I have fixes for each of these bugs. The fix for abs_defint(unit_step(x),x,99,100) is what you suggested. To fix abs_defint(unit_step(unit_step(x)),x,-1,0), I changed the signum representation for unit_step to unit_step(x) = (signum(x)*(signum(x)+1))/2 Additionally, some abs_integrate functions convert terms such as signum(nonconstant polynomial)^2 to 1. In the context of an integrand signum(nonconstant polynomial)^2 = 1 is an OK identity, I think. It will take me some time to re-think and improve these fixes. Maybe you could file a bug report--I like having a record of bugs. Again, thanks for your bug report. --Barton (author of abs_integrate) -----maxima-bounces at math.utexas.edu wrote: ----- >I have found some bugs in abs_integrate.mac: >(%i3) abs_defint(unit_step(x),x,99,100); >(%o3) 100 >(%i4) abs_defint(unit_step(unit_step(x)),x,-1,0); >(%o4) 1/2 _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From micknudsen at gmail.com Fri Jan 7 02:42:35 2011 From: micknudsen at gmail.com (Michael Knudsen) Date: Fri, 7 Jan 2011 09:42:35 +0100 Subject: [Maxima] Body of For Loop In-Reply-To: <91FDE155B7074370910C703B6BF118D5@RichsLaptop> References: <1DF253BD07314CD9B78C50028D607FD8@RichsLaptop> <91FDE155B7074370910C703B6BF118D5@RichsLaptop> Message-ID: On Fri, Jan 7, 2011 at 12:23 AM, Richard Hennessy wrote: > for i from 1 thru 10 do ( > ( > ? specificEquations : at(myEquations, [p=i]), > ? print(specificEquations) > ); Thanks! It works! By the way, it was the only suggestion that worked. The one with subst didn't, for reasons I don't know, substitute i for p. Best, Michael -- Michael Knudsen micknudsen at gmail.com From willisb at unk.edu Fri Jan 7 06:44:13 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 7 Jan 2011 06:44:13 -0600 Subject: [Maxima] Bug in z_transform.mac? In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >FYI,?I'm?currently?adding?support?for?a?Heaviside?step?function >hstep(x)?such?that?hstep(0)=1/2.??Perhaps?we?should?support?all?three >common?variants?of?unit_step:?left-continuous,?right-continuous,?and >hstep.??It?should?not?be?too?hard?to?search?for?all?occurrences?of >unit_step?in?the?code?and?incorporate?support?for?the?other?variants. > >What?do?you?think? There are simplifications involving sums and products of these functions that would be difficult to detect; for example x * (left_continuous_step(x) - right_continuous_step(x)) = 0. Some days I think we should concentrate on making Maxima conditionals (if then else) better instead of appending more step-like functions. It be great if Maxima do (if x < 0 then 0 else 1) - (if x <= 0 then 0 else 1) --> if x = 0 then 1 else 0 and x * (if x = 0 then 1 else 0) --> 0. At least for linear inequalities, I think this is algorithmically possible. --Barton From pouya.tafti at a3.epfl.ch Fri Jan 7 07:00:40 2011 From: pouya.tafti at a3.epfl.ch (Pouya D. Tafti) Date: Fri, 7 Jan 2011 14:00:40 +0100 Subject: [Maxima] Bug in z_transform.mac? In-Reply-To: References: Message-ID: On 6 January 2011 20:31, Mark H Weaver wrote: > z_transform.mac includes the following rule: > > ?defrule (r913_2b, > ? ? ?z_transform (unit_step (nn%), nn%, zz%), > ? ? ?zz/(zz - 1)); > > Presumably this package is meant to compute the unilateral > Z-transform, which is defined as follows: (according to > http://en.wikipedia.org/wiki/Z-transform ) > > ?z_transform(f(n),n,z) = sum(f(n)*z^(-n), n,0,inf) > > By this definition, the rule above is incorrect. ?The rule would be > correct for a right-continuous unit_step function, i.e. where > unit_step(0)=1. > The z transform is defined for "sequences", not functions of a real variable. It is unclear to me what you mean by left/right continuity in this context. > However, given that unit_step(0)=0, this is the correct rule: > > ?defrule (r913_2b, > ? ? ?z_transform (unit_step (nn%), nn%, zz%), > ? ? ?1/(zz - 1)); > > I confess that I've never used the Z-transform, but I guess that a > right-continuous unit_step function is more convenient in this > context. ?Nonetheless, it seems like a very bad idea for most of > Maxima to believe that unit_step(0)=0, but for z_transform.mac to > assume that unit_step(0)=1. > > FYI, I'm currently adding support for a Heaviside step function > hstep(x) such that hstep(0)=1/2. The Heaviside step function is different from the "discrete" step function. The value of the Heaviside step at 0 (or any other single point) is often irrelevant, since it is typically defined as a distribution. Pouya > Perhaps we should support all three > common variants of unit_step: left-continuous, right-continuous, and > hstep. ?It should not be too hard to search for all occurrences of > unit_step in the code and incorporate support for the other variants. > > What do you think? > > ? ?Mark > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From eb at civil.aau.dk Fri Jan 7 07:46:28 2011 From: eb at civil.aau.dk (Esben Byskov) Date: Fri, 7 Jan 2011 14:46:28 +0100 Subject: [Maxima] 4th order DE In-Reply-To: References: <4D264A21.8050202@civil.aau.dk> <4D264D51.5020909@eecs.berkeley.edu>, <4D265264.9090606@civil.aau.dk> Message-ID: <4D271934.2@civil.aau.dk> *Many thanks to Barton Willis, In this case determining the constants from the boundary conditions takes some effort. The way both Maple and MuPAD (I gather that Mathematica does it in a similar way) handle my problem seems easier. It is somewhat surprising that, given the fact that maxima has been around for so many more years than the other programs, it does not have a similar feature. Best regards, Esben Byskov * Esben Byskov, Ph.D., Dr.Techn. Professor Emeritus of Structural Analysis Department of Civil Engineering Aalborg University Sohngaardsholmsvej 57 DK-9000 Aalborg Denmark Phone: +45 3963 7328 e-mail: eb at civil.aau.dk On 2011-01-07 02:01, Barton Willis wrote: > Maxima has desolve, but for this equation ilt (inverse Laplace transform) is unable to determine the > needed transform: > > (%i11) 'diff((1-1/2*t)*'diff(y(t),t,2),t,2)=1$ > > (%i12) desolve('diff((1-1/2*t)*'diff(y(t),t,2),t,2)=1,[y(t)]); > (%o12) y(t)=ilt(-(g35251^5*('diff(laplace(y(t),t,g35251),g35251,1))+y(0)*(-2*g35251^4-g35251^3)-2*(at('diff(y(t),t,1),t=0))*g35251^3+ (at('diff(y(t),t,2),t=0))*(g35251-2*g35251^2)-2*(at('diff(y(t),t,3),t=0))*g35251-2)/(2*g35251^5+2*g35251^4),g35251,t) > > A hand solution is something like: > > (%i16) ode2(integrate(integrate('diff((1-1/2*t)*'diff(y,t,2),t,2)=1,t),t),y,t); > (%o16) y=-(((12*%c7+24*%c6+24)*t-24*%c7-48*%c6-48)*log(t-2)+t^3+(6*%c6+6)*t^2+(-12*%c7-24*%c6-24)*t)/6+%k2*t+%k1 > > You'll need to impose the boundary conditions. > > --Barton > > -----maxima-bounces at math.utexas.edu wrote: ----- > >> I don't have access to Maple anymore, but this did the job: >> diffeqw:= ({diff((1-alpha*xi)*diff(w(xi),xi$2),xi$2) = 1, \ >> >> w(0)=0, \ >> >> D(w)(0)=0, \ >> >> w(1)=0, \ >> >> D(D(w))(1)=0}, \ >> >> w(xi)); >> >> >> >> wsol:=dsolve(diffeqw); >> >> wsol:=op(2,wsol); -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrej.vodopivec at gmail.com Fri Jan 7 08:39:23 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Fri, 7 Jan 2011 15:39:23 +0100 Subject: [Maxima] Enhancement to solve_rec.mac In-Reply-To: <871v4ppxiu.fsf@yeeloong.netris.org> References: <871v4ppxiu.fsf@yeeloong.netris.org> Message-ID: I think that this extension should be included. I did not look at the patch carefully though. Maybe solve_rec should return the answer as > (%t5) c[2*n] = ... > (%t6) c[2*n+1] = ... instead of > (%t5) c_even[n] = -gamma(n/2+1/2)*(-1)^(n/2-1)/(sqrt(%pi)*(n/2)!) > (%t6) c_odd[n] = -sqrt(%pi)*((n-1)/2)!*(-1)^((n-1)/2-1)/gamma((n-1)/2+3/2) Andrej On Thu, Jan 6, 2011 at 9:50 PM, Mark H Weaver wrote: > Hello Andrej and users of solve_rec.mac, > > A few months ago I tried to solve the following recurrence with > solve_rec, but it failed: > > (%i1) display2d:false$ > (%i2) load(solve_rec); > (%o2) "/usr/local/share/maxima/5.23.0/share/contrib/solve_rec/solve_rec.mac" > (%i3) solve_rec( c[n+1]=-n*c[n-1]/(n+1), c[n], c[0]=1, c[1]=2 ); > (%o3) false > > However, I noticed that this recurrence is actually two independent > recurrences: one recurrence for odd n, and one for even n. ?If I break > them apart by hand, solve_rec is able to solve each one. > > I added code to solve_rec to do this job automatically: > > (%i4) load(solve_rec_mhw); > (%o4) "/home/mhw/.maxima/solve_rec_mhw.mac" > (%i5) solve_rec( c[n+1]=-n*c[n-1]/(n+1), c[n], c[0]=1, c[1]=2 ); > (%t5) c_even[n] = -gamma(n/2+1/2)*(-1)^(n/2-1)/(sqrt(%pi)*(n/2)!) > (%t6) c_odd[n] = -sqrt(%pi)*((n-1)/2)!*(-1)^((n-1)/2-1)/gamma((n-1)/2+3/2) > (%o6) [%t5,%t6] > > It can split recurrences not only into evens and odds, but into any > finite number of independent recurrences: > > (%i7) solve_rec( c[n+1]=-n*c[n-2]/(n+1), c[n], c[0]=1, c[1]=2, c[2]=3 ); > (%t7) c_0[n] = -gamma(n/3+2/3)*(-1)^(n/3-1)/(gamma(2/3)*(n/3)!) > (%t8) c_1[n] = -2*gamma(1/3)*((n-1)/3)!*(-1)^((n-1)/3-1) > ? ? ? ? ? ? /(3*gamma((n-1)/3+4/3)) > (%t9) c_2[n] = -6*gamma(2/3)*gamma((n-2)/3+4/3)*(-1)^((n-2)/3-1) > ? ? ? ? ? ? /(gamma(1/3)*gamma((n-2)/3+5/3)) > (%o9) [%t7,%t8,%t9] > > My patch follows. ?Comments and suggestions welcome. ?I'd especially be > interested in possible suggestions on how best to return these results > to the caller. > > ? ? Best, > ? ? ?Mark > > > *** share/contrib/solve_rec/solve_rec-orig.mac ?2009-10-05 03:21:50.000000000 -0400 > --- share/contrib/solve_rec/solve_rec.mac ? ? ? 2010-11-02 21:14:32.000000000 -0400 > *************** > *** 14,19 **** > --- 14,25 ---- > ? * *** ? Version: 1.08 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? *** * > ? * *** ? Author: ?Andrej Vodopivec ? ? ? *** * > ? * *** ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? *** * > + ?* *** ? Modified by Mark H Weaver in November 2010 ? ? *** * > + ?* *** ? to solve recurrences in which the gcd of the index shifts is ? ?*** * > + ?* *** ? greater than 1, such that the recurrence is equivalent to ? ? ? *** * > + ?* *** ? multiple independent recurrences of lesser order, e.g.: ? ? ? ? *** * > + ?* *** ? solve_rec( c[n+1]=-n*c[n-1]/(n+1), c[n], c[0]=1, c[1]=2 ); ? ? ?*** * > + ?* *** ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? *** * > ? * ************************************************************************* * > ? * ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? * > ? * ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? * > *************** > *** 96,101 **** > --- 102,112 ---- > ? ? ? ?map(lambda([%u], change_to_shift_op(%u, %f, %n)), args(expr))) > ? ?else expr$ > > + gcd_shift(expr) := > + ? if atom(expr) then 0 > + ? else if part(expr, 0)=shift_op then part(expr, 3) > + ? else first(apply('ezgcd, map('gcd_shift, args(expr))))$ > + > ?max_shift(expr) := > ? ?if atom(expr) then -inf > ? ?else if part(expr, 0)=shift_op then part(expr, 3) > *************** > *** 156,161 **** > --- 167,217 ---- > ? ?to_standard_form1(tmp, %n, m) > ?)$ > > + /************************************************************************** > + ?* > + ?* reduce the order of a recurrence whose shifts have a gcd > 1 > + ?* > + ?*************************************************************************/ > + > + srec_reduce_order(expr) := > + ? if atom(expr) then ( > + ? ? if expr=%n then (%nn * %mult) + %offset > + ? ? else expr > + ? ) > + ? else if part(expr, 0)='shift_op then ( > + ? ? if part(expr, 2)=%n > + ? ? then funmake('shift_op, [%ff, %nn, part(expr, 3) / %mult]) > + ? ? else expr > + ? ) > + ? else if member(part(expr, 0), ["+", "-", "*", "/", "^"]) > + ? then apply(part(expr, 0), map('srec_reduce_order, args(expr))) > + ? else subst(%n = (%nn * %mult) + %offset, expr)$ > + > + srec_reduce_order_cond1(cond) := > + ? if part(cond,0)#"=" or part(cond,1,0)#%f or > + ? ? ?length(part(cond,1))#1 or not integerp(part(cond,1,1)) > + ? then error("Invalid solve_rec condition", cond) > + ? else block ([newidx : (part(cond,1,1) - %offset) / %mult], > + ? ? if integerp(newidx) > + ? ? then [ substpart(%ff, substpart(newidx,cond,1,1), 1, 0) ] > + ? ? else [] > + ? )$ > + > + srec_reduce_order_conds(conds) := > + ? apply('append, map(srec_reduce_order_cond1, conds))$ > + > + srec_finalize_reduced_order_sol(expr) := > + ? if atom(expr) then ( > + ? ? if expr=%nn then (%n - %offset) / %mult > + ? ? else expr > + ? ) > + ? else if part(expr,0)=%ff then ( > + ? ? srec_finalize_reduced_order_sol(part(expr,1)) * %mult + %offset, > + ? ? substpart(%%, fn, 1), > + ? ? substpart(%fff, %%, 0) > + ? ) > + ? else if mapatom(expr) then expr > + ? else map('srec_finalize_reduced_order_sol, expr)$ > > ?/************************************************************************** > ? * > *************** > *** 164,170 **** > ? *************************************************************************/ > > ?solve_rec(eq, fn, [cond]) := block( > ! ? [std_form, %f, %n, deg, ord, hyper_to_product : true, sol : false], > ? ?if atom(fn) then return(false), > ? ?if length(fn)#1 then return(false), > ? ?%f : part(fn, 0), > --- 220,227 ---- > ? *************************************************************************/ > > ?solve_rec(eq, fn, [cond]) := block( > ! ? [std_form, %f, %n, deg, ord, %mult, > ! ? ?hyper_to_product : true, sol : false], > ? ?if atom(fn) then return(false), > ? ?if length(fn)#1 then return(false), > ? ?%f : part(fn, 0), > *************** > *** 175,189 **** > > ? ?std_form : to_standard_form(eq, %f, %n), > ? ?std_form : expand(num(ratsimp(std_form))), > ! ? ord : differ_order(std_form), > > ! ? if ord=1 then sol : solve_rec_order_1(std_form, %f, %n, cond) > ! ? else sol : solve_rec_gen(std_form, %f, %n, cond), > > ! ? if sol=false then false > ! ? else ( > ! ? ? if listp(sol) then sol > ! ? ? else fn=sol > ? ?) > ?)$ > > --- 232,272 ---- > > ? ?std_form : to_standard_form(eq, %f, %n), > ? ?std_form : expand(num(ratsimp(std_form))), > ! ? %mult : gcd_shift(std_form), > ! ? if %mult=1 then ( > ! ? ? ord : differ_order(std_form), > > ! ? ? if ord=1 then sol : solve_rec_order_1(std_form, %f, %n, cond) > ! ? ? else sol : solve_rec_gen(std_form, %f, %n, cond), > > ! ? ? if sol=false then false > ! ? ? else ( > ! ? ? ? if listp(sol) then sol > ! ? ? ? else fn=sol > ! ? ? ) > ! ? ) else block( > ! ? ? [ %nn : ?gensym(), %ff : ?gensym(), %fff, > ! ? ? ? reduced_form, reduced_cond, solns : [] ], > ! > ! ? ? for %offset:0 thru %mult-1 do ( > ! ? ? ? if %mult # 2 then %fff : concat(%f, "_", %offset) > ! ? ? ? else if %offset = 0 then %fff : concat(%f, "_even") > ! ? ? ? else %fff : concat(%f, "_odd"), > ! > ! ? ? ? reduced_form : srec_reduce_order(std_form), > ! ? ? ? reduced_cond : srec_reduce_order_conds(cond), > ! > ! ? ? ? ord : differ_order(reduced_form), > ! > ! ? ? ? if ord=1 then sol : solve_rec_order_1(reduced_form, %ff, %nn, reduced_cond) > ! ? ? ? else sol : solve_rec_gen(reduced_form, %ff, %nn, reduced_cond), > ! > ! ? ? ? if sol#false and not listp(sol) then sol : arraymake(%ff,[%nn])=sol, > ! ? ? ? sol : srec_finalize_reduced_order_sol(sol), > ! ? ? ? solns : cons(sol, solns) > ! ? ? ), > ! ? ? solns : reverse(solns), > ! ? ? apply('ldisp, solns) > ? ?) > ?)$ > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From macrakis at alum.mit.edu Fri Jan 7 08:46:42 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 7 Jan 2011 09:46:42 -0500 Subject: [Maxima] Enhancement to solve_rec.mac In-Reply-To: References: <871v4ppxiu.fsf@yeeloong.netris.org> Message-ID: How about returning an explicit executable definition with a conditional, e.g. c[n] := if mod(n,2)=0 then ... elseif mod(n,2)=1 then ... On Fri, Jan 7, 2011 at 09:39, Andrej Vodopivec wrote: > I think that this extension should be included. I did not look at the > patch carefully though. Maybe solve_rec should return the answer as > > > (%t5) c[2*n] = ... > > (%t6) c[2*n+1] = ... > > instead of > > > (%t5) c_even[n] = -gamma(n/2+1/2)*(-1)^(n/2-1)/(sqrt(%pi)*(n/2)!) > > (%t6) c_odd[n] = > -sqrt(%pi)*((n-1)/2)!*(-1)^((n-1)/2-1)/gamma((n-1)/2+3/2) > > Andrej > > > > On Thu, Jan 6, 2011 at 9:50 PM, Mark H Weaver wrote: > > Hello Andrej and users of solve_rec.mac, > > > > A few months ago I tried to solve the following recurrence with > > solve_rec, but it failed: > > > > (%i1) display2d:false$ > > (%i2) load(solve_rec); > > (%o2) > "/usr/local/share/maxima/5.23.0/share/contrib/solve_rec/solve_rec.mac" > > (%i3) solve_rec( c[n+1]=-n*c[n-1]/(n+1), c[n], c[0]=1, c[1]=2 ); > > (%o3) false > > > > However, I noticed that this recurrence is actually two independent > > recurrences: one recurrence for odd n, and one for even n. If I break > > them apart by hand, solve_rec is able to solve each one. > > > > I added code to solve_rec to do this job automatically: > > > > (%i4) load(solve_rec_mhw); > > (%o4) "/home/mhw/.maxima/solve_rec_mhw.mac" > > (%i5) solve_rec( c[n+1]=-n*c[n-1]/(n+1), c[n], c[0]=1, c[1]=2 ); > > (%t5) c_even[n] = -gamma(n/2+1/2)*(-1)^(n/2-1)/(sqrt(%pi)*(n/2)!) > > (%t6) c_odd[n] = > -sqrt(%pi)*((n-1)/2)!*(-1)^((n-1)/2-1)/gamma((n-1)/2+3/2) > > (%o6) [%t5,%t6] > > > > It can split recurrences not only into evens and odds, but into any > > finite number of independent recurrences: > > > > (%i7) solve_rec( c[n+1]=-n*c[n-2]/(n+1), c[n], c[0]=1, c[1]=2, c[2]=3 ); > > (%t7) c_0[n] = -gamma(n/3+2/3)*(-1)^(n/3-1)/(gamma(2/3)*(n/3)!) > > (%t8) c_1[n] = -2*gamma(1/3)*((n-1)/3)!*(-1)^((n-1)/3-1) > > /(3*gamma((n-1)/3+4/3)) > > (%t9) c_2[n] = -6*gamma(2/3)*gamma((n-2)/3+4/3)*(-1)^((n-2)/3-1) > > /(gamma(1/3)*gamma((n-2)/3+5/3)) > > (%o9) [%t7,%t8,%t9] > > > > My patch follows. Comments and suggestions welcome. I'd especially be > > interested in possible suggestions on how best to return these results > > to the caller. > > > > Best, > > Mark > > > > > > *** share/contrib/solve_rec/solve_rec-orig.mac 2009-10-05 > 03:21:50.000000000 -0400 > > --- share/contrib/solve_rec/solve_rec.mac 2010-11-02 > 21:14:32.000000000 -0400 > > *************** > > *** 14,19 **** > > --- 14,25 ---- > > * *** Version: 1.08 > *** * > > * *** Author: Andrej Vodopivec > *** * > > * *** > *** * > > + * *** Modified by Mark H Weaver in November 2010 > *** * > > + * *** to solve recurrences in which the gcd of the index shifts is > *** * > > + * *** greater than 1, such that the recurrence is equivalent to > *** * > > + * *** multiple independent recurrences of lesser order, e.g.: > *** * > > + * *** solve_rec( c[n+1]=-n*c[n-1]/(n+1), c[n], c[0]=1, c[1]=2 ); > *** * > > + * *** > *** * > > * > ************************************************************************* * > > * > * > > * > * > > *************** > > *** 96,101 **** > > --- 102,112 ---- > > map(lambda([%u], change_to_shift_op(%u, %f, %n)), args(expr))) > > else expr$ > > > > + gcd_shift(expr) := > > + if atom(expr) then 0 > > + else if part(expr, 0)=shift_op then part(expr, 3) > > + else first(apply('ezgcd, map('gcd_shift, args(expr))))$ > > + > > max_shift(expr) := > > if atom(expr) then -inf > > else if part(expr, 0)=shift_op then part(expr, 3) > > *************** > > *** 156,161 **** > > --- 167,217 ---- > > to_standard_form1(tmp, %n, m) > > )$ > > > > + > /************************************************************************** > > + * > > + * reduce the order of a recurrence whose shifts have a gcd > 1 > > + * > > + > *************************************************************************/ > > + > > + srec_reduce_order(expr) := > > + if atom(expr) then ( > > + if expr=%n then (%nn * %mult) + %offset > > + else expr > > + ) > > + else if part(expr, 0)='shift_op then ( > > + if part(expr, 2)=%n > > + then funmake('shift_op, [%ff, %nn, part(expr, 3) / %mult]) > > + else expr > > + ) > > + else if member(part(expr, 0), ["+", "-", "*", "/", "^"]) > > + then apply(part(expr, 0), map('srec_reduce_order, args(expr))) > > + else subst(%n = (%nn * %mult) + %offset, expr)$ > > + > > + srec_reduce_order_cond1(cond) := > > + if part(cond,0)#"=" or part(cond,1,0)#%f or > > + length(part(cond,1))#1 or not integerp(part(cond,1,1)) > > + then error("Invalid solve_rec condition", cond) > > + else block ([newidx : (part(cond,1,1) - %offset) / %mult], > > + if integerp(newidx) > > + then [ substpart(%ff, substpart(newidx,cond,1,1), 1, 0) ] > > + else [] > > + )$ > > + > > + srec_reduce_order_conds(conds) := > > + apply('append, map(srec_reduce_order_cond1, conds))$ > > + > > + srec_finalize_reduced_order_sol(expr) := > > + if atom(expr) then ( > > + if expr=%nn then (%n - %offset) / %mult > > + else expr > > + ) > > + else if part(expr,0)=%ff then ( > > + srec_finalize_reduced_order_sol(part(expr,1)) * %mult + %offset, > > + substpart(%%, fn, 1), > > + substpart(%fff, %%, 0) > > + ) > > + else if mapatom(expr) then expr > > + else map('srec_finalize_reduced_order_sol, expr)$ > > > > > /************************************************************************** > > * > > *************** > > *** 164,170 **** > > > *************************************************************************/ > > > > solve_rec(eq, fn, [cond]) := block( > > ! [std_form, %f, %n, deg, ord, hyper_to_product : true, sol : false], > > if atom(fn) then return(false), > > if length(fn)#1 then return(false), > > %f : part(fn, 0), > > --- 220,227 ---- > > > *************************************************************************/ > > > > solve_rec(eq, fn, [cond]) := block( > > ! [std_form, %f, %n, deg, ord, %mult, > > ! hyper_to_product : true, sol : false], > > if atom(fn) then return(false), > > if length(fn)#1 then return(false), > > %f : part(fn, 0), > > *************** > > *** 175,189 **** > > > > std_form : to_standard_form(eq, %f, %n), > > std_form : expand(num(ratsimp(std_form))), > > ! ord : differ_order(std_form), > > > > ! if ord=1 then sol : solve_rec_order_1(std_form, %f, %n, cond) > > ! else sol : solve_rec_gen(std_form, %f, %n, cond), > > > > ! if sol=false then false > > ! else ( > > ! if listp(sol) then sol > > ! else fn=sol > > ) > > )$ > > > > --- 232,272 ---- > > > > std_form : to_standard_form(eq, %f, %n), > > std_form : expand(num(ratsimp(std_form))), > > ! %mult : gcd_shift(std_form), > > ! if %mult=1 then ( > > ! ord : differ_order(std_form), > > > > ! if ord=1 then sol : solve_rec_order_1(std_form, %f, %n, cond) > > ! else sol : solve_rec_gen(std_form, %f, %n, cond), > > > > ! if sol=false then false > > ! else ( > > ! if listp(sol) then sol > > ! else fn=sol > > ! ) > > ! ) else block( > > ! [ %nn : ?gensym(), %ff : ?gensym(), %fff, > > ! reduced_form, reduced_cond, solns : [] ], > > ! > > ! for %offset:0 thru %mult-1 do ( > > ! if %mult # 2 then %fff : concat(%f, "_", %offset) > > ! else if %offset = 0 then %fff : concat(%f, "_even") > > ! else %fff : concat(%f, "_odd"), > > ! > > ! reduced_form : srec_reduce_order(std_form), > > ! reduced_cond : srec_reduce_order_conds(cond), > > ! > > ! ord : differ_order(reduced_form), > > ! > > ! if ord=1 then sol : solve_rec_order_1(reduced_form, %ff, %nn, > reduced_cond) > > ! else sol : solve_rec_gen(reduced_form, %ff, %nn, reduced_cond), > > ! > > ! if sol#false and not listp(sol) then sol : > arraymake(%ff,[%nn])=sol, > > ! sol : srec_finalize_reduced_order_sol(sol), > > ! solns : cons(sol, solns) > > ! ), > > ! solns : reverse(solns), > > ! apply('ldisp, solns) > > ) > > )$ > > > > _______________________________________________ > > 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 mhw at netris.org Fri Jan 7 10:49:54 2011 From: mhw at netris.org (Mark H Weaver) Date: Fri, 07 Jan 2011 11:49:54 -0500 Subject: [Maxima] Bug in z_transform.mac? In-Reply-To: (Pouya D. Tafti's message of "Fri, 7 Jan 2011 14:00:40 +0100") References: Message-ID: <87vd20odzh.fsf@yeeloong.netris.org> "Pouya D. Tafti" writes: > On 6 January 2011 20:31, Mark H Weaver wrote: >> z_transform.mac includes the following rule: >> >> ?defrule (r913_2b, >> ? ? ?z_transform (unit_step (nn%), nn%, zz%), >> ? ? ?zz/(zz - 1)); >> >> Presumably this package is meant to compute the unilateral >> Z-transform, which is defined as follows: (according to >> http://en.wikipedia.org/wiki/Z-transform ) >> >> ?z_transform(f(n),n,z) = sum(f(n)*z^(-n), n,0,inf) >> >> By this definition, the rule above is incorrect. ?The rule would be >> correct for a right-continuous unit_step function, i.e. where >> unit_step(0)=1. >> > > The z transform is defined for "sequences", not functions of a real > variable. It is unclear to me what you mean by left/right continuity > in this context. Apologies, those words were poorly chosen for this context. It is customary to describe variants of the unit step function in terms of left or right continuity at x=0, but in this context it is clearer to describe them by their values at x=0. There are four common variants of the unit step function. All agree that step(x)=0 for x<0 and step(x)=1 for x>0. The four common values for step(0) are: 0, 1, 1/2, or unspecified. For Maxima's built-in unit_step(x) function, unit_step(0)=0. By the above definition of the unilateral Z-transform, the rule above is incorrect. The rule would be correct for a different variant of step function, where step(0)=1. >> However, given that unit_step(0)=0, this is the correct rule: >> >> ?defrule (r913_2b, >> ? ? ?z_transform (unit_step (nn%), nn%, zz%), >> ? ? ?1/(zz - 1)); I guess that when working with sequences, it is more convenient to work with a step function for which step(0)=1. In other cases, step(0)=1/2 or step(0)=0 may be more convenient. That is why I am thinking about how best to add support for other variants of the unit step function to Maxima. I will write more on that soon. Best, Mark From pouya.tafti at a3.epfl.ch Fri Jan 7 16:23:35 2011 From: pouya.tafti at a3.epfl.ch (Pouya D. Tafti) Date: Fri, 7 Jan 2011 23:23:35 +0100 Subject: [Maxima] Bug in z_transform.mac? In-Reply-To: <87vd20odzh.fsf@yeeloong.netris.org> References: <87vd20odzh.fsf@yeeloong.netris.org> Message-ID: On 7 January 2011 17:49, Mark H Weaver wrote: [...] > There are four common variants of the unit step function. ?All agree > that step(x)=0 for x<0 and step(x)=1 for x>0. ?The four common values > for step(0) are: 0, 1, 1/2, or unspecified. > > For Maxima's built-in unit_step(x) function, unit_step(0)=0. > > By the above definition of the unilateral Z-transform, the rule above is > incorrect. ?The rule would be correct for a different variant of step > function, where step(0)=1. > >>> However, given that unit_step(0)=0, this is the correct rule: >>> >>> ?defrule (r913_2b, >>> ? ? ?z_transform (unit_step (nn%), nn%, zz%), >>> ? ? ?1/(zz - 1)); > > I guess that when working with sequences, it is more convenient to work > with a step function for which step(0)=1. ?In other cases, step(0)=1/2 > or step(0)=0 may be more convenient. ?That is why I am thinking about > how best to add support for other variants of the unit step function to > Maxima. > > I will write more on that soon. Speaking purely as a non-computer scientist, it would seem more correct to me to have separate discrete- and continuous-variable "step" functions already to begin with. One is a sequence and has a z transform, the other isn't and does not. Thanks, Pouya From drdieterkaiser at web.de Sat Jan 8 06:07:05 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 08 Jan 2011 13:07:05 +0100 Subject: [Maxima] Undefined variable $DRAW_USE_PNGCAIRO Message-ID: <1294488425.1520.9.camel@dieter> On my system I get a warning about an undefined variable $DRAW_USE_PNGCAIRO when loading the draw package. Maxima version: 5.23post Maxima build date: 11:42 1/8/2011 Host type: i686-pc-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.45 (%i1) load(draw); ; (AND (EQ MAXIMA::VAL 'MAXIMA::$PNG) MAXIMA::$DRAW_USE_PNGCAIRO) ; --> IF AND ; ==> ; (THE T MAXIMA::$DRAW_USE_PNGCAIRO) ; ; caught WARNING: ; undefined variable: $DRAW_USE_PNGCAIRO ; ; compilation unit finished ; Undefined variable: ; $DRAW_USE_PNGCAIRO ; caught 1 WARNING condition (%o1) /usr/local/share/maxima/5.23post/share/draw/draw.lisp Dieter Kaiser From nijso at numerically-related.com Sat Jan 8 07:47:22 2011 From: nijso at numerically-related.com (nijso beishuizen) Date: Sat, 8 Jan 2011 14:47:22 +0100 Subject: [Maxima] integration of g(x).dg(x)dx.exp(g(x)) Message-ID: Hello all, I am trying to integrate the following function: f:g(x)*exp(g(x))*diff(g(x),x); sol:integrate(f,x); The solution is sol:(g(x)-1)*exp(g(x)); which can be checked by differentiating again to x: ratsimp(diff(sol,x)); However, integrate does not seem to be able to find this solution. antidiff by the way, is able to handle this problem correctly: antidiff(f,x,g(x)); This is by the way a standard example of what the Risch algorithm should be able to solve, which is based on the idea that (f*exp(g))' = ( f' + f * g' ) * exp(g) I am a bit puzzled. Why does integrate not handle this simple problem? Should integrate be able to handle this problem? Is there a way to get this solution without using antidiff? Or can I simply always use antidiff instead of integrate when I am only dealing with indefinite integrals? Regards, NB From villate at fe.up.pt Sat Jan 8 08:38:34 2011 From: villate at fe.up.pt (Jaime Villate) Date: Sat, 08 Jan 2011 14:38:34 +0000 Subject: [Maxima] integration of g(x).dg(x)dx.exp(g(x)) In-Reply-To: References: Message-ID: <1294497514.5804.6.camel@wigner> On Sat, 2011-01-08 at 14:47 +0100, nijso beishuizen wrote: > f:g(x)*exp(g(x))*diff(g(x),x); > sol:integrate(f,x); > ... > However, integrate does not seem to be able to find this solution. > antidiff by the way, is able to handle this problem correctly: > antidiff(f,x,g(x)); > ... > I am a bit puzzled. Why does integrate not handle this simple problem? > Should integrate be able to handle this problem? Is there a way to get this > solution without using antidiff? > Or can I simply always use antidiff instead of integrate when I am only > dealing with indefinite integrals? Hi look at the manual: -- Function: integrate (, ) Attempts to symbolically compute the integral of with respect to . `integrate (, )' is an indefinite integral. -- Function: antidiff (, , ()) Returns an antiderivative of with respect to . The expression may contain an unknown function and its derivatives. Thus, the answers to your questions are: integrate is not supposed to solve your problem. You should use antidiff and not integrate when expr contains an unknown function and its derivatives, otherwise, you should be able to use either integrate or antidiff. Regards, Jaime From mhw at netris.org Sat Jan 8 10:53:14 2011 From: mhw at netris.org (Mark H Weaver) Date: Sat, 08 Jan 2011 11:53:14 -0500 Subject: [Maxima] Undefined variable $DRAW_USE_PNGCAIRO In-Reply-To: <1294488425.1520.9.camel@dieter> (Dieter Kaiser's message of "Sat, 08 Jan 2011 13:07:05 +0100") References: <1294488425.1520.9.camel@dieter> Message-ID: <87ei8nnxqd.fsf@yeeloong.netris.org> Dieter Kaiser writes: > On my system I get a warning about an undefined variable > $DRAW_USE_PNGCAIRO when loading the draw package. Sorry, this is my fault. I should have put the declaration of $draw_use_pngcairo into grcommon.lisp instead of draw.lisp. GCL did not complain, so I didn't notice. The following patch should fix it. Mark --- draw-orig.lisp 2011-01-06 22:52:57.000000000 -0500 +++ draw.lisp 2011-01-08 11:42:03.000000000 -0500 @@ -41,8 +41,6 @@ (defvar $draw_compound t) -(defvar $draw_use_pngcairo nil "If true, use pngcairo terminal when png is requested.") - (defvar *windows-OS* (string= *autoconf-win32* "true")) (defmacro write-font-type () --- grcommon-orig.lisp 2011-01-06 22:54:49.000000000 -0500 +++ grcommon.lisp 2011-01-08 11:42:00.000000000 -0500 @@ -33,6 +33,10 @@ (defvar *user-gr-default-options* '()) +(defvar $draw_use_pngcairo nil + "If true, use pngcairo terminal when png is requested.") + + (defun $set_draw_defaults (&rest opts) (setf *user-gr-default-options* opts) (cons '(mlist) opts)) From rmodesi at msn.com Sat Jan 8 17:09:46 2011 From: rmodesi at msn.com (RONALD F MODESITT) Date: Sat, 8 Jan 2011 16:09:46 -0700 Subject: [Maxima] wxMaxima does not read maxima-init.mac Message-ID: I am running wxMaxima 8.5 on Ubuntu 10.10. Maxima does not appear to read maxima-init.mac located in my /home/ron/.maxima folder or in any other folder. Is there a preferred location for wxMaxima other than the .maxima folder? Also, is there any documentation on editing the .wxMaxima file in my home folder? Many thanks Ronald F. Modesitt, PE -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Sat Jan 8 17:40:07 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 09 Jan 2011 00:40:07 +0100 Subject: [Maxima] Undefined variable $DRAW_USE_PNGCAIRO In-Reply-To: <87ei8nnxqd.fsf@yeeloong.netris.org> References: <1294488425.1520.9.camel@dieter> <87ei8nnxqd.fsf@yeeloong.netris.org> Message-ID: <1294530007.1614.5.camel@trasno> El s?b, 08-01-2011 a las 11:53 -0500, Mark H Weaver escribi?: > GCL did not complain, so I didn't notice. Neither CLISP did :-/ -- Mario From nijso at numerically-related.com Sun Jan 9 05:08:20 2011 From: nijso at numerically-related.com (nijso beishuizen) Date: Sun, 9 Jan 2011 12:08:20 +0100 Subject: [Maxima] hyperbolic functions Message-ID: Hello all, I have some problems rewriting the following expression to the tanh function: f: y = (%e^(2*x)+1)/(%e^(2*x)-1)+%c; I only know about the 'trick' to substitute an imaginary number and then use demoivre. However, I could not make maxima convert the equation above to tanh. Is there another way to proceed here? Or is there now a more elegant way like using a default simplifying rule that uses hyperbolic functions? Regards, NB From rmodesi at msn.com Sun Jan 9 09:20:11 2011 From: rmodesi at msn.com (RONALD F MODESITT) Date: Sun, 9 Jan 2011 08:20:11 -0700 Subject: [Maxima] wxMaxima does not read maxima-init.mac Message-ID: All, I need to clarify my question. It appears to me that wxMaxima under Linux does not allow Maxima to automatically execute maxima-init.mac. Is this a correct observation? As stated previously my maxima-init.mac file is in the default userdir pointed to by maxima_userdir (/home/ron/.maxima). I tried the load command "load(maxima-init) and get the following error: Maxima encountered a Lisp error: Error in LET [or a callee]: ((MPLUS . #0=(SIMP)) ((MTIMES . #0#) -1 $INIT) $MAXIMA) cannot be coerced to a namestring. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. I copied the contents of maxima-init.mac to another file (x1.mac) which executes without error. This leads me to believe that there is some conflict with the filename maxima-init.mac and wxMaxima. This leads me to another question regarding documentation on the format of .mac files. I would appreciate help in locating such. And, finally, I'll repeat my last request from the previous email for documentation for the .wxMaxima file in my home folder. Thanks for your patience. Ronald F. Modesitt, PE -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhw at netris.org Sun Jan 9 12:12:24 2011 From: mhw at netris.org (Mark H Weaver) Date: Sun, 09 Jan 2011 13:12:24 -0500 Subject: [Maxima] wxMaxima does not read maxima-init.mac In-Reply-To: (RONALD F. MODESITT's message of "Sun, 9 Jan 2011 08:20:11 -0700") References: Message-ID: <87pqs6lzef.fsf@yeeloong.netris.org> RONALD F MODESITT writes: > It appears to me that wxMaxima under Linux does not allow Maxima to > automatically execute maxima-init.mac. Is this a correct observation? No, wxMaxima-0.8.5 automatically executes ~/.maxima/maxima-init.mac on my Debian GNU/Linux system. Perhaps the problem is specific to Ubuntu. > I tried the load command "load(maxima-init) and get the following > error: You must instead write: load("maxima-init"); For simple names, it is okay to pass a symbol instead of a string, but in this case Maxima parses "maxima-init" not as a symbol but as a difference expression (maxima - init). > This leads me to another question regarding documentation on the > format of .mac files. I would appreciate help in locating such. To a first approximation, "*.mac" files simply contain commands as you would enter them at Maxima's prompt. However, there are some minor restrictions. The file cannot include ":lisp" constructs, and you cannot use "%" or "%th" to refer to the output of commands within the file. "*.mac" files are loaded using the "batchload" command, and the restrictions are documented there. > And, finally, I'll repeat my last request from the previous email for > documentation for the .wxMaxima file in my home folder. I'm not aware of any documentation describing the format of that file. Most of the parameters of interest can be edited within wxMaxima by choosing "configure" from the "edit" menu. Is there a specific reason that you'd like to edit it directly? Mark From robert.dodier at gmail.com Sun Jan 9 12:20:12 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 9 Jan 2011 11:20:12 -0700 Subject: [Maxima] new developer Mark Weaver, was: Bug in simpplog Message-ID: OK, great. I have put you on the list of developers for the Maxima project at Sourceforge. Here is some advice: http://sourceforge.net/apps/mediawiki/maxima/index.php?title=Advice_to_developers There is some stuff about how to carry out particular operations in maxima/README.developers-howto, although the stuff about the share directory is a little out of date. Welcome to the team. I look forward to your contributions. best Robert Dodier On 1/8/11, Mark H Weaver wrote: > Hi Robert, > > I will gladly accept CVS write permission! I intend to spend a great > deal of time on Maxima over the coming months. Of course, I'll always > discuss ideas on the mailing list and wait for input from the more > experienced Maxima hackers before committing anything. > > My SourceForge account name is: "mhw2" (don't forget the 2!) > > Best, > Mark > > >> Mark, you seem to know what you're doing. >> I wonder if you're interested in having CVS write permission so >> that you can apply patches directly. >> >> Generally the way things work around here is that people >> kick around ideas on the mailing list, and then stuff gets >> committed if it doesn't cause too much of a fuss. >> If that seems like a workable arrangement, maybe you >> can join the fun. Let me know what you think. >> >> best >> >> Robert Dodier >> >> PS. I'm an administrator of the maxima project at Sourceforge. > From rmodesi at msn.com Sun Jan 9 12:53:06 2011 From: rmodesi at msn.com (RONALD F MODESITT) Date: Sun, 9 Jan 2011 11:53:06 -0700 Subject: [Maxima] wxMaxima does not read maxima-init.mac In-Reply-To: <87pqs6lzef.fsf@yeeloong.netris.org> References: , <87pqs6lzef.fsf@yeeloong.netris.org> Message-ID: Mark, Many thanks for the reply and especially for taking time on your Sunday. I haven't used wxMaxima (or Maxima) for a couple of years so please correct me if I should be responding differently i.e. through the archives. Thanks for catching my error on "maxima-init" in quotes. I'm obviously a novice with Maxima. The Maxima learning curve is steep but you always need to watch your syntax! For whatever reason my "maxima-init.mac" file had a space embedded in the name and was "maxima-init.mac". I couldn't see this from the gnome interface but after doing an 'ls' from terminal I saw the problem. After correction all works as should. (Could I blame it on the keyboard?) I am not so much interested in editing the .wxMaxima file as I am in understanding it's possibilities. I grew up in the days of 'ini' files and I always have to know what they are doing. The wxMaxima site isn't too helpful in this regard. Thanks again, Ron -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Jan 9 13:05:53 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 9 Jan 2011 14:05:53 -0500 Subject: [Maxima] hyperbolic functions In-Reply-To: References: Message-ID: I haven't found an *automated* way of reexpressing this with tanh. However, but substituting atanh(tanh(x)) for x (but temporarily blocking the simplification), you can derive the result: (%i56) f: y = (%e^(2*x)+1)/(%e^(2*x)-1)+%c$ (%i57) subst(atanh(box(tanh(x))),x,f); (%o57) y = (%e^(2*atanh(box(tanh(x))))+1)/(%e^(2*atanh(box(tanh(x))))-1)+%c (%i58) expand(rembox(ratsimp(logarc(%)))); (%o58) y = 1/tanh(x)+%c On Sun, Jan 9, 2011 at 06:08, nijso beishuizen < nijso at numerically-related.com> wrote: > f: y = (%e^(2*x)+1)/(%e^(2*x)-1)+%c; -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sun Jan 9 13:48:04 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 9 Jan 2011 13:48:04 -0600 Subject: [Maxima] hyperbolic functions In-Reply-To: References: , Message-ID: Another possibility: (%i45) exp_to_tanh(e) := subst("^" = lambda([a,x], if a = '%e then (1 + tanh(x/2))/(1 - tanh(x/2)) else a^x),e)$ (%i47) ratsimp(exp_to_tanh( y = (%e^(2*x)+1)/(%e^(2*x)-1)+%c)); (%o47) y=(%c*tanh(x)+1)/tanh(x) (%i50) exp_to_tanh( y = x^2/9 + exp(x^2)); (%o50) y=(tanh(x^2/2)+1)/(1-tanh(x^2/2))+x^2/9 Of course, it would be much better do the exp --> tanh substitution only when the result is something that is more appealing (aka simplified). --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >I?haven't?found?an?*automated*?way?of?reexpressing?this?with?tanh. >However,?but?substituting?atanh(tanh(x))?for?x?(but?temporarily?blocking >the?simplification),?you?can?derive?the?result: > >(%i56)?f:??y?=?(%e^(2*x)+1)/(%e^(2*x)-1)+%c$ >(%i57)?subst(atanh(box(tanh(x))),x,f); >(%o57)?y?= >(%e^(2*atanh(box(tanh(x))))+1)/(%e^(2*atanh(box(tanh(x))))-1)+%c > >(%i58)?expand(rembox(ratsimp(logarc(%)))); >(%o58)?y?=?1/tanh(x)+%c > >On?Sun,?Jan?9,?2011?at?06:08,?nijso?beishuizen >?wrote: > >f:??y?=?(%e^(2*x)+1)/(%e^(2*x)-1)+%c; From macrakis at alum.mit.edu Sun Jan 9 14:30:41 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 9 Jan 2011 15:30:41 -0500 Subject: [Maxima] hyperbolic functions In-Reply-To: References: Message-ID: I like the subst trick, but it can give ugly results even for simple cases: (%i1) exp_to_tanh(e) := subst("^" = lambda([a,x], if a = '%e then (1 + tanh(x/2))/(1 - tanh(x/2)) else a^x),e)$ (%i2) exp_to_tanh(exponentialize(tanh(x))); (%o2) ((tanh(x/2)+1)/(1-tanh(x/2))-(1-tanh(x/2))/(tanh(x/2)+1)) /((1-tanh(x/2))/(tanh(x/2)+1)+(tanh(x/2)+1)/(1-tanh(x/2))) (%i3) ratsimp(%); (%o3) 2*tanh(x/2)/(tanh(x/2)^2+1) <<< not very nice (%i4) %,halfangles; (%o4) 2*(cosh(x)-1)/(((cosh(x)-1)^2/sinh(x)^2+1)*sinh(x)) <<< no better Of course, the box/rembox trick requires that you know in advance what the argument to the desired tanh is. Applying it to say tanh(a*x) doesn't work very well.... -s On Sun, Jan 9, 2011 at 14:48, Barton Willis wrote: > Another possibility: > > (%i45) exp_to_tanh(e) := subst("^" = lambda([a,x], if a = '%e then (1 + > tanh(x/2))/(1 - tanh(x/2)) else a^x),e)$ > > (%i47) ratsimp(exp_to_tanh( y = (%e^(2*x)+1)/(%e^(2*x)-1)+%c)); > (%o47) y=(%c*tanh(x)+1)/tanh(x) > > (%i50) exp_to_tanh( y = x^2/9 + exp(x^2)); > (%o50) y=(tanh(x^2/2)+1)/(1-tanh(x^2/2))+x^2/9 > > Of course, it would be much better do the exp --> tanh substitution only > when the result is something that > is more appealing (aka simplified). > > --Barton > > -----maxima-bounces at math.utexas.edu wrote: ----- > > > >I haven't found an *automated* way of reexpressing this with tanh. > >However, but substituting atanh(tanh(x)) for x (but temporarily blocking > >the simplification), you can derive the result: > > > >(%i56) f: y = (%e^(2*x)+1)/(%e^(2*x)-1)+%c$ > >(%i57) subst(atanh(box(tanh(x))),x,f); > >(%o57) y = > >(%e^(2*atanh(box(tanh(x))))+1)/(%e^(2*atanh(box(tanh(x))))-1)+%c > > > >(%i58) expand(rembox(ratsimp(logarc(%)))); > >(%o58) y = 1/tanh(x)+%c > > > >On Sun, Jan 9, 2011 at 06:08, nijso beishuizen > > wrote: > > > >f: y = (%e^(2*x)+1)/(%e^(2*x)-1)+%c; > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.reyssat at math.unicaen.fr Sun Jan 9 14:52:51 2011 From: eric.reyssat at math.unicaen.fr (reyssat) Date: Sun, 09 Jan 2011 21:52:51 +0100 Subject: [Maxima] hyperbolic functions In-Reply-To: References: Message-ID: <4D2A2023.8080104@math.unicaen.fr> Maybe exponentialize + solve is what you want, at least in this simple case, since it is a system of rational equations in %e^x : (%i2) f: y = (%e^(2*x)+1)/(%e^(2*x)-1)+%c; (%o2) y = (%e^(2*x)+1)/(%e^(2*x)-1)+%c (%i3) solve([t=exponentialize(tanh(x)),f],[%e^x,y]); (%o3) [[%e^x = %r1,y = (%c*t+1)/t]] Eric Le 09/01/2011 12:08, nijso beishuizen a ?crit : > Hello all, > > I have some problems rewriting the following expression to the tanh function: > > f: y = (%e^(2*x)+1)/(%e^(2*x)-1)+%c; > > I only know about the 'trick' to substitute an imaginary number and then use > demoivre. However, I could not make maxima convert the equation above to tanh. > Is there another way to proceed here? Or is there now a more elegant way like > using a default simplifying rule that uses hyperbolic functions? > > Regards, > NB > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > From drdieterkaiser at web.de Sun Jan 9 15:38:34 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 09 Jan 2011 22:38:34 +0100 Subject: [Maxima] new developer Mark Weaver, was: Bug in simpplog In-Reply-To: References: Message-ID: <1294609114.4134.2.camel@dieter> Am Sonntag, den 09.01.2011, 11:20 -0700 schrieb Robert Dodier: > OK, great. I have put you on the list of developers for > the Maxima project at Sourceforge. > > Here is some advice: > http://sourceforge.net/apps/mediawiki/maxima/index.php?title=Advice_to_developers > > There is some stuff about how to carry out particular > operations in maxima/README.developers-howto, > although the stuff about the share directory is a little > out of date. > > Welcome to the team. I look forward to your contributions. Hello Mark, welcome to the team from me, too. Dieter Kaiser From rich.hennessy at verizon.net Sun Jan 9 20:31:14 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 09 Jan 2011 21:31:14 -0500 Subject: [Maxima] Bug in z_transform.mac? In-Reply-To: References: Message-ID: x * (if x = 0 then 1 else 0) --> 0. At least for linear inequalities, I think this is algorithmically possible. Would this make Maxima faster? From rich.hennessy at verizon.net Sun Jan 9 21:23:09 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 09 Jan 2011 22:23:09 -0500 Subject: [Maxima] Bug in z_transform.mac? In-Reply-To: References: Message-ID: I should have been more clear. I know that this way would work and in some cases it is faster. Some problems occur when trying to consolidate the if's. Taking (if x>0 then sin(x) else cos(x)) * (if x>4 then x else x^2) into a single if can be done fairly easily. I suppose the only way to know if it is faster (and therefore worth it) is to try it. Rich -----Original Message----- From: Richard Hennessy Sent: Sunday, January 09, 2011 9:31 PM To: Barton Willis ; Mark H Weaver Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bug in z_transform.mac? x * (if x = 0 then 1 else 0) --> 0. At least for linear inequalities, I think this is algorithmically possible. Would this make Maxima faster? _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From mhw at netris.org Mon Jan 10 13:21:33 2011 From: mhw at netris.org (Mark H Weaver) Date: Mon, 10 Jan 2011 14:21:33 -0500 Subject: [Maxima] Enhancement to solve_rec.mac In-Reply-To: (Stavros Macrakis's message of "Fri, 7 Jan 2011 09:46:42 -0500") References: <871v4ppxiu.fsf@yeeloong.netris.org> Message-ID: <87ei8kmuo2.fsf@yeeloong.netris.org> Stavros Macrakis writes: > How about returning an explicit executable definition with a conditional, e.g. > > ?? ? c[n] := if mod(n,2)=0 then ... elseif mod(n,2)=1 then ... Regarding the "if mod(n,2)=0 then ..." part: I think this is the ideal solution, though it will be a bit inconvenient until Maxima is able to manipulate and simplify conditional expressions more effectively. In particular, I'd want an easy way to simplify an expression assuming that mod(n,m)=c. As for the ":=", I'm not sure why this would be appropriate here, when the norm for other solvers in Maxima is to return equations. Best, Mark From woollett at charter.net Mon Jan 10 14:13:38 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 10 Jan 2011 12:13:38 -0800 Subject: [Maxima] Maxima by Example: Ch. 12 update Message-ID: <0E4A8A71B4EB41F4A126B0211D887E77@edwinc367e16bd> Maxima by Example, Ch. 12, Dirac Algebra and Quantum Electrodynamics update Jan. 10, 2011. The file dgtrace.mac has a revised version of the function reduce_g5 which corrects the trace of a product of Gamma5 with a product of eight Dirac gamma matrices. This revision has no connection to the calculations in the twelve batch files which illustrate QED problems. The file traceConEx.mac has been slightly changed, and the new pdf file reflects the new correct Gamma5 trace calculation. The corrected section makes use of the Chisholm-Kahane Dirac matrix identity which expresses a product of three Dirac matrices as a series of four terms, three of which are proportional to a single Dirac matrix, and the last is proportional to gamma5*(one Dirac matrix) (see page 14 of the pdf file). The following Windows zip file contains all Chapter 12 files, including the pdf. --mbe12dirac.zip : All Ch. 12 Files, 1-10-11, Maxima 5.21.1, 444 KB --NEW-- The following tar.gz file contains all Ch. 12 files, including the pdf file. --mbe12dirac.tar.gz : All Ch. 12 Files, 1-10-11, Maxima 5.21.1, 429 KB --NEW-- the updated files are: 1. --mbe12dirac.pdf : Ch. 12, Dirac Algebra and Quantum Electrodynamics, 1-10-11, Maxima 5.21.1, 68 pages, --NEW-- 5. --dgtrace.mac : Symbolic trace code, 1-10-11, Maxima 5.21.1, --NEW-- 21. --traceConEx.mac : Batch file which demonstrates many of the most used Dirac package functions, 1-10-11, Maxima 5.21.1, --NEW-- Ted Woollett http://www.csulb.edu/~woollett From rich.hennessy at verizon.net Mon Jan 10 14:17:41 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Mon, 10 Jan 2011 15:17:41 -0500 Subject: [Maxima] Bug in z_transform.mac? In-Reply-To: References: Message-ID: <9FCA9F98616D4DC6B235FED94CCBB0F4@RichsLaptop> >FYI, I'm currently adding support for a Heaviside step function >hstep(x) such that hstep(0)=1/2. Perhaps we should support all three >common variants of unit_step: left-continuous, right-continuous, and >hstep. It should not be too hard to search for all occurrences of >unit_step in the code and incorporate support for the other variants. > >What do you think? "There are simplifications involving sums and products of these functions that would be difficult to detect; for example x * (left_continuous_step(x) - right_continuous_step(x)) = 0. Some days I think we should concentrate on making Maxima conditionals (if then else) better instead of appending more step-like functions. It be great if Maxima do (if x < 0 then 0 else 1) - (if x <= 0 then 0 else 1) --> if x = 0 then 1 else 0 and x * (if x = 0 then 1 else 0) --> 0. At least for linear inequalities, I think this is algorithmically possible." I have made small changes to pw.mac which makes this possible for simple cases. Now you can do this. (%i2) load(pw)$ (%i3) (if x < 0 then 0 else 1) - (if x <= 0 then 0 else 1); (out3) (if x < 0 then 0 else 1) - (if x <= 0 then 0 else 1) (%i4) iif2ifthen(pwsimp(%,x,iif)); (out4) if equal(x, 0) then 1 else 0 "I think this is algorithmically possible." Yes, it is possible but maybe it should not be part of pw.mac. Pw does it by converting to iif() then to signum() expressions and then simplifying them and then converting back to if then. You could start there. Rich From rich.hennessy at verizon.net Mon Jan 10 14:50:14 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Mon, 10 Jan 2011 15:50:14 -0500 Subject: [Maxima] Bug in z_transform.mac? In-Reply-To: <9FCA9F98616D4DC6B235FED94CCBB0F4@RichsLaptop> References: <9FCA9F98616D4DC6B235FED94CCBB0F4@RichsLaptop> Message-ID: <6A768B3343594E7D8A844918E782F262@RichsLaptop> "What do you think? There are simplifications involving sums and products of these functions that would be difficult to detect; for example x * (left_continuous_step(x) - right_continuous_step(x)) = 0. Some days I think we should concentrate on making Maxima conditionals (if then else) better instead of appending more step-like functions. It be great if Maxima do (if x < 0 then 0 else 1) - (if x <= 0 then 0 else 1) --> if x = 0 then 1 else 0 and x * (if x = 0 then 1 else 0) --> 0. At least for linear inequalities, I think this is algorithmically possible." I have made small changes to pw.mac which makes this possible for simple cases. Now you can do this. (%i2) load(pw)$ (%i3) (if x < 0 then 0 else 1) - (if x <= 0 then 0 else 1); (out3) (if x < 0 then 0 else 1) - (if x <= 0 then 0 else 1) (%i4) iif2ifthen(pwsimp(%,x,iif)); (out4) if equal(x, 0) then 1 else 0 "I think this is algorithmically possible." Yes, it is possible but maybe it should not be part of pw.mac. Pw does it by converting to iif() then to signum() expressions and then simplifying them and then converting back to if then. You could start there. Basically what happened is that if then was converted to a math expression then converted back to English. In the process it gets simplified. I would begin by looking at how pwsimp() works in pw.mac. As far as the Heavyside step function is concerned, I am not for or against it. I suppose it is more well known than the signum() function historically. The version that returns 1/2 at zero would be especially easy to work with. Rich From rich.hennessy at verizon.net Mon Jan 10 15:25:57 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Mon, 10 Jan 2011 16:25:57 -0500 Subject: [Maxima] How to make a simplifier Message-ID: I would like general information on how to make a simplifier for pw. I can get expressions in a complex form that can be simplified further but I don?t know how to write a simplifier. Can someone point me in the right direction? Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Mon Jan 10 16:09:05 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 10 Jan 2011 14:09:05 -0800 Subject: [Maxima] How to make a simplifier In-Reply-To: References: Message-ID: <4D2B8381.7010805@eecs.berkeley.edu> On 1/10/2011 1:25 PM, Richard Hennessy wrote: > I would like general information on how to make a simplifier for pw. > I can get expressions in a complex form that can be simplified further > but I don?t know how to write a simplifier. Can someone point me in > the right direction? > Rich Look at the source file simp.lisp and see how various functions are simplified. look at tan, cos, sin for "functions that are simplified when their single arguments are special values". look at simplus and simptimes and friends for "functions that are simplified based on the relationships of their arguments to each other". -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhw at netris.org Mon Jan 10 16:30:05 2011 From: mhw at netris.org (Mark H Weaver) Date: Mon, 10 Jan 2011 17:30:05 -0500 Subject: [Maxima] Bugs in tex-mcond Message-ID: I noticed recently that tex-mcond is quite broken: (%i2) tex(if x<0 then 0)$ $$\mathbf{if}\;x<0\;\mathbf{then}\;0\;\mathbf{else}\;\mathbf{false}$$ [looks like: if x<0 then 0 else false] (%i3) tex(if x<0 then 0 elseif x>0 then 1)$ $$\mathbf{if}\;x<0\;\mathbf{then}\;0\;\mathbf{else}\;1$$ [looks like: if x<0 then 0 else 1] (%i4) tex(if x<0 then 0 elseif x>0 then 1 else 1/2)$ $$\mathbf{if}\;x<0\;\mathbf{then}\;0\;\mathbf{else}\;1$$ [looks like: if x<0 then 0 else 1] The code assumes that the mcond contains only two clauses, and that the condition of the second clause is T. Thus it only handles the following case correctly: "if then else " Also, it contains logic to print only "if then " if the result of the second clause is '$false. I believe it should be checking for NIL instead, since Maxima parses "false" as NIL, and NIL is what one actually finds in such expressions: (%i5) ?print(if x<0 then 0)$ ((MCOND SIMP) ((MLESSP SIMP) $X 0) 0 T NIL) After applying the patch below, these are the new results: (%i2) tex(if x<0 then 0)$ $$\mathbf{if}\;x<0\;\mathbf{then}\;0$$ (%i3) tex(if x<0 then 0 elseif x>0 then 1)$ $$\mathbf{if}\;x<0\;\mathbf{then}\;0\;\mathbf{elseif}\;x>0 \;\mathbf{then}\;1$$ (%i4) tex(if x<0 then 0 elseif x>0 then 1 else 1/2)$ $$\mathbf{if}\;x<0\;\mathbf{then}\;0\;\mathbf{elseif}\;x>0 \;\mathbf{then}\;1\;\mathbf{else}\;\frac{1}{2}$$ If I don't hear any objections, I will soon commit this patch to both the trunk and the 5.23 branch. Mark From mhw at netris.org Mon Jan 10 16:34:58 2011 From: mhw at netris.org (Mark H Weaver) Date: Mon, 10 Jan 2011 17:34:58 -0500 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: (Mark H. Weaver's message of "Mon, 10 Jan 2011 17:30:05 -0500") References: Message-ID: <877hecmlpp.fsf@yeeloong.netris.org> I wrote: > If I don't hear any objections, I will soon commit this patch to both > the trunk and the 5.23 branch. Oops, I forgot to include the patch :) Mark *** mactex.lisp 22 Nov 2009 04:53:36 -0000 1.71 --- mactex.lisp 10 Jan 2011 21:59:13 -0000 *************** *** 1,3 **** --- 1,5 ---- + ;;; -*- Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*- ;;;; + (in-package :maxima) ;; TeX-printing *************** *** 938,950 **** ((= c 0)(odds (cdr n) 1)))) (defun tex-mcond (x l r) ! (append l ! (tex (cadr x) '("\\mathbf{if}\\;") ! '("\\;\\mathbf{then}\\;") 'mparen 'mparen) ! (if (eql (fifth x) '$false) ! (tex (caddr x) nil r 'mcond rop) ! (append (tex (caddr x) nil nil 'mparen 'mparen) ! (tex (fifth x) '("\\;\\mathbf{else}\\;") r 'mcond rop))))) (defprop mdo tex-mdo tex) (defprop mdoin tex-mdoin tex) --- 940,958 ---- ((= c 0)(odds (cdr n) 1)))) (defun tex-mcond (x l r) ! (labels ! ((recurse (x l) ! (append (tex (car x) l '("\\;\\mathbf{then}\\;") 'mparen 'mparen) ! (cond ((equal (cdddr x) '(nil)) ! (tex (cadr x) nil r 'mcond rop)) ! ((null (cddddr x)) ! (append (tex (cadr x) nil nil 'mparen 'mparen) ! (tex (cadddr x) '("\\;\\mathbf{else}\\;") r ! 'mcond rop))) ! (t (append (tex (cadr x) nil nil 'mparen 'mparen) ! (recurse (cddr x) ! '("\\;\\mathbf{elseif}\\;")))))))) ! (append l (recurse (cdr x) '("\\mathbf{if}\\;"))))) (defprop mdo tex-mdo tex) (defprop mdoin tex-mdoin tex) From nijso at hotmail.com Mon Jan 10 16:53:43 2011 From: nijso at hotmail.com (nijso beishuizen) Date: Mon, 10 Jan 2011 23:53:43 +0100 Subject: [Maxima] hyperbolic functions Message-ID: Ok, Thanks for all your input. I will try to generalize the 'box' method and see if I can use it to simplify other functions that I encounter. I am also looking at the function trigsimp in the code. May this will help in building some simplification rules for hyperbolic functions as well. Does somebody know of a mathematical reference (paper, book) that explains the mathematics behind simplification rules (treating canonical forms, intermediate expression swell, practical algorithms)? Regards, Nijso -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Mon Jan 10 17:15:41 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 10 Jan 2011 15:15:41 -0800 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: <877hecmlpp.fsf@yeeloong.netris.org> References: <877hecmlpp.fsf@yeeloong.netris.org> Message-ID: <4D2B931D.2000307@eecs.berkeley.edu> On 1/10/2011 2:34 PM, Mark H Weaver wrote: > I wrote: >> If I don't hear any objections, I will soon commit this patch to both >> the trunk and the 5.23 branch. > Oops, I forgot to include the patch :) > > Mark > as the author of tex(), I was wondering how this happened. answer: elseif was introduced into Maxima after tex() was written. I'm not sure about the nil vs $false, but it looks like a bug in handling "if". in particular tex ('(if x>0 then 0)); works just fine. compare ?print ('(if x>0 then 0)) to ?print ( if x>0 then 0) one has nil the other $false. By comparison, the commercial Macsyma gives a "unable to evaluate" error for if x>0 then 0. I have not really checked over the patches, but I suggest you sign them, in the code. perhaps cadddr should be fourth? cddddr could be (nthcdr 4 ..) and also explain the format of mcond with elseif, somewhere. RJF From l.butler at ed.ac.uk Mon Jan 10 17:30:03 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 10 Jan 2011 23:30:03 +0000 (GMT) Subject: [Maxima] Bugs in tex-mcond In-Reply-To: <4D2B931D.2000307@eecs.berkeley.edu> References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> Message-ID: < .... I suggest you sign them, in < the code. Please don't introduce needless graffiti into the source files like this. If someone wishes to know who did what and why, this information is available from the CVS log. This can be browsed from any decent editor, like emacs, or in a web browser from the sourceforge site. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From fateman at eecs.berkeley.edu Mon Jan 10 18:18:27 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 10 Jan 2011 16:18:27 -0800 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> Message-ID: <4D2BA1D3.3070807@eecs.berkeley.edu> On 1/10/2011 3:30 PM, Leo Butler wrote: > < .... I suggest you sign them, in > < the code. > > Please don't introduce needless graffiti into the source files like > this. I disagree with this. I think that browsing through the CVS is an extra step, and that when one is (for example) wondering why version n of Maxima does something and version n+1 does something else, finding comments in the code near the location of the change, helps. When code is anonymous (or anonymous until checking in CVS) it is too easy to leave out full explanations. I also appreciate a line or two in the heading of a "share" file identifying the author, date, etc. Recently I came across a share file that was really in need of revision, written in a very inefficient and long-winded way. I eventually figured out that it was essentially anonymously contributed, part of the MIT 1982 legacy code. > If someone wishes to know who did what and why, this information is available > from the CVS log. This can be browsed from any decent editor, like emacs, or > in a web browser from the sourceforge site. Any decent editor, like emacs, can display comments in a form in which they do not intrude in the code (say in a different font and/or color), but are easily available. Maybe I'm old fashioned, but I find opening the CVS log at sourceforge to be a pain. I'm not objecting to using CVS additionally, to track changes, but I do not see this a substitute for useful comments in the code, which I believe should reflect as much as possible, an explanation of what is intended by the programs. And I think as a courtesy to readers, an indication of the author. In the case of a set of revisions widely dispersed, perhaps over several files, in which a fuller explanation of the >>changes<< can more reasonably be done in a CVS log, in one place, I think I would still prefer some comments that refer back to the CVS log, in the code. Perhaps in the header of the file, and also near where some large change is made in the source. Again, this would not be a substitute for comments in the code that might be added to explain what was going on (and, sometimes what might have been going on before, that wasn't correct until changed.) So I think we can do both --- but I hope the tradition of putting a name on any substantial change (common in the MIT source code) is not lost nor considered grafitti. RJF From mhw at netris.org Mon Jan 10 20:08:45 2011 From: mhw at netris.org (Mark H Weaver) Date: Mon, 10 Jan 2011 21:08:45 -0500 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: <4D2B931D.2000307@eecs.berkeley.edu> (Richard Fateman's message of "Mon, 10 Jan 2011 15:15:41 -0800") References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> Message-ID: <871v4kmbte.fsf@yeeloong.netris.org> Richard Fateman writes: > I'm not sure about the nil vs $false, but it looks like a bug in > handling "if". > > in particular tex ('(if x>0 then 0)); works just fine. Interesting. Notice the end of PARSE-CONDITION in nparse.lisp: (t ; Note: $false instead of () makes DISPLA suppress display! (list t '$false))))) DIM-MCOND in displa.lisp handles both cases: (unless (or (eq '$false else-or-then) (eq nil else-or-then)) and it also handles a third case, when the last condition is not T. All three of these cases are rendered as "if a then b" by DISPLA: ((%mcond) $a $b) ((%mcond) $a $b t nil) ((%mcond) $a $b t $false) I wouldn't be surprised if we could remove this old '$FALSE cruft from both nparse.lisp and displa.lisp. However, I don't feel confident that I understand the possible consequences. Therefore, I have changed mactex.lisp to handle all three cases the same as DISPLA does. Here's a new patch. Comments and suggestions welcome, or else I'll soon commit this to both the trunk and the 5.23 branch. Mark *** mactex.lisp 22 Nov 2009 04:53:36 -0000 1.71 --- mactex.lisp 11 Jan 2011 01:49:10 -0000 *************** *** 1,3 **** --- 1,5 ---- + ;;; -*- Mode: Lisp; Package: Maxima; Syntax: Common-Lisp; Base: 10 -*- ;;;; + (in-package :maxima) ;; TeX-printing *************** *** 937,950 **** ((= c 1)(cons (car n)(odds (cdr n) 0))) ((= c 0)(odds (cdr n) 1)))) (defun tex-mcond (x l r) ! (append l ! (tex (cadr x) '("\\mathbf{if}\\;") ! '("\\;\\mathbf{then}\\;") 'mparen 'mparen) ! (if (eql (fifth x) '$false) ! (tex (caddr x) nil r 'mcond rop) ! (append (tex (caddr x) nil nil 'mparen 'mparen) ! (tex (fifth x) '("\\;\\mathbf{else}\\;") r 'mcond rop))))) (defprop mdo tex-mdo tex) (defprop mdoin tex-mdoin tex) --- 939,964 ---- ((= c 1)(cons (car n)(odds (cdr n) 0))) ((= c 0)(odds (cdr n) 1)))) + ;; Modified by Mark H Weaver in January 2011 to add + ;; support for MCOND expressions containing more than one non-T + ;; condition, i.e. elseif, which was added after this code was + ;; originally written by RJF. The format of MCOND expressions is + ;; documented above the definition of dim-mcond in displa.lisp. (defun tex-mcond (x l r) ! (labels ! ((recurse (x l) ! (append ! (tex (car x) l '("\\;\\mathbf{then}\\;") 'mparen 'mparen) ! (cond ((member (cddr x) '(() (t nil) (t $false)) :test #'equal) ! (tex (second x) nil r 'mcond rop)) ! ((eq (third x) t) ! (append ! (tex (second x) nil nil 'mparen 'mparen) ! (tex (fourth x) '("\\;\\mathbf{else}\\;") r 'mcond rop))) ! (t (append ! (tex (second x) nil nil 'mparen 'mparen) ! (recurse (cddr x) '("\\;\\mathbf{elseif}\\;")))))))) ! (append l (recurse (cdr x) '("\\mathbf{if}\\;"))))) (defprop mdo tex-mdo tex) (defprop mdoin tex-mdoin tex) From l.butler at ed.ac.uk Mon Jan 10 20:55:18 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 11 Jan 2011 02:55:18 +0000 (GMT) Subject: [Maxima] Bugs in tex-mcond In-Reply-To: <4D2BA1D3.3070807@eecs.berkeley.edu> References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> <4D2BA1D3.3070807@eecs.berkeley.edu> Message-ID: On Mon, 10 Jan 2011, Richard Fateman wrote: Any decent editor, like emacs, can display comments in a form in which they do < not < intrude in the code (say in a different font and/or color), but are easily < available. The issue is not so much hiding comments, it is this: what happens when Y alters X's signed code with its pretty comments. Does Y leave X's comments, and add more? delete X's and add more? The dilemma faced by a graffiti artist, created by not using the appropriate tool: an rcs. < Maybe < I'm old fashioned, but I find opening the CVS log at sourceforge to be a pain. It's CTRL-xvl in emacs. Even better, you can check out the previous revisions and see the changes yourself, all with half-a-dozen key strokes. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From fateman at eecs.berkeley.edu Mon Jan 10 22:43:16 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 10 Jan 2011 20:43:16 -0800 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> <4D2BA1D3.3070807@eecs.berkeley.edu> Message-ID: <4D2BDFE4.8080603@eecs.berkeley.edu> On 1/10/2011 6:55 PM, Leo Butler wrote: > > On Mon, 10 Jan 2011, Richard Fateman wrote: > > Any decent editor, like emacs, can display comments in a form in which they do > < not > < intrude in the code (say in a different font and/or color), but are easily > < available. > > The issue is not so much hiding comments, it is this: what happens when > Y alters X's signed code with its pretty comments. Does Y leave X's > comments, and add more? Ordinarily, yes. > delete X's and add more? If X's comments are no longer appropriate, that is occasionally possible, but hazardous since Y might be wrong, in which case Z might fix both the comments and the code. > The dilemma faced by > a graffiti artist, created by not using the appropriate tool: an rcs. > > > < Maybe > < I'm old fashioned, but I find opening the CVS log at sourceforge to be a pain. > > It's CTRL-xvl in emacs. "no fileset is available here." I do not ordinarily download every new source directory, nor do I download CVS. > Even better, you can check out the previous > revisions and see the changes yourself, all with half-a-dozen key > strokes. If a source file is to be readable as a document describing a program, it should be possible to print it out and read it. I would hesitate to read a book which could only be read on-line and which would not make sense unless you clicked on links. Such a document/web page DOES make sense in some contexts, where you are interacting with some neat web application. I just don't think of program listings that way. Usually. RJF From robert.dodier at gmail.com Mon Jan 10 23:05:52 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 10 Jan 2011 22:05:52 -0700 Subject: [Maxima] Fwd: Bugs in tex-mcond In-Reply-To: References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> <871v4kmbte.fsf@yeeloong.netris.org> Message-ID: oops ... forgot to hit reply-all. ---------- Forwarded message ---------- From: Robert Dodier Date: Mon, 10 Jan 2011 22:04:02 -0700 Subject: Re: [Maxima] Bugs in tex-mcond To: Mark H Weaver Hey gang, a couple of comments. (1) about the TeX output, I have a patch somewhere (I guess I didn't commit it) to output conditional expressions with \left{ i.e. with a big left curly brace then the value of each branch and then the condition for the branch, which is, I believe, a conventional way to display conditional expressions. I'll dig it out, although the patch is not really complicated and I'm sure Mark or anyone could reinvent it from this description. (2) about $FALSE vs NIL, I agree that the special cases for $FALSE should be axed. best Robert Dodier From robert.dodier at gmail.com Mon Jan 10 23:25:16 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 10 Jan 2011 22:25:16 -0700 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: <871v4kmbte.fsf@yeeloong.netris.org> References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> <871v4kmbte.fsf@yeeloong.netris.org> Message-ID: On 1/10/11, Mark H Weaver wrote: > + ;; Modified by Mark H Weaver in January 2011 to add > + ;; support for MCOND expressions containing more than one non-T > + ;; condition, i.e. elseif, which was added after this code was > + ;; originally written by RJF. The format of MCOND expressions is > + ;; documented above the definition of dim-mcond in displa.lisp. I'm sorry to say it, but this is a mess. I'm all for comments in the code, but please, in the name of all that is good, just stick to what's technically relevant. Commentary like the stuff shown above is best left to the CVS log. Maybe in some rare cases it is necessary to let the outside world intrude in form of names and dates and historical commentary. But for crying out loud, consider what a swamp, what a mess Maxima would be if we had decades of such cruft cluttering up the code. Interesting parts of Maxima have been touched by dozens of hands over many years -- do we really need to recapitulate the whole freaking Old Testament in order to show what the code does? It's too ugly to contemplate. FWIW Robert Dodier From robert.dodier at gmail.com Tue Jan 11 00:15:14 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 10 Jan 2011 23:15:14 -0700 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: References: Message-ID: I have a different patch for tex-mcond. I pasted the output into a TeX document and generated a PDF (attached) from it. FWIW Robert Dodier PS. Here are some example outputs: (%i2) tex (if x < 0 then foo); \begin{equation} \left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< 0 \\ \mathbf{false}& \mathrm{otherwise}\end{array}\right. \end{equation} (%o2) false (%i3) tex (if x < 0 then foo else bar); \begin{equation} \left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< 0 \\ {\it bar}& \mathrm{otherwise}\end{array}\right. \end{equation} (%o3) false (%i4) tex (if x < 0 then foo elseif x > 0 then bar else baz); \begin{equation} \left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< 0 \\ {\it bar} & \mathrm{if}\; x>0 \\ {\it baz}& \mathrm{otherwise} \end{array}\right. \end{equation} (%o4) false (%i5) tex (if x < 0 then foo else if x > 0 then bar else baz); \begin{equation} \left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< 0 \\ \left(\left\{\begin{array}{ll}{\it bar} & \mathrm{if}\; x>0 \\ {\it baz}& \mathrm{otherwise}\end{array}\right.\right) & \mathrm{otherwise}\end{array}\right. \end{equation} PPS. Here's the patch. --- src/mactex.lisp 22 Nov 2009 04:53:36 -0000 1.71 +++ src/mactex.lisp 14 Nov 2010 08:00:51 -0000 @@ -888,6 +892,11 @@ (defprop mcond tex-mcond tex) (defprop %mcond tex-mcond tex) +(setf (get 'mcond 'tex-environment) + `(,(format nil "~%\\begin{equation}~%") . ,(format nil "~%\\end{equation}~%"))) + +(setf (get '%mcond 'tex-environment) (get 'mcond 'tex-environment)) + (defprop %derivative tex-derivative tex) (defun tex-derivative (x l r) (tex (if $derivabbrev @@ -939,12 +948,17 @@ (defun tex-mcond (x l r) (append l - (tex (cadr x) '("\\mathbf{if}\\;") - '("\\;\\mathbf{then}\\;") 'mparen 'mparen) - (if (eql (fifth x) '$false) - (tex (caddr x) nil r 'mcond rop) - (append (tex (caddr x) nil nil 'mparen 'mparen) - (tex (fifth x) '("\\;\\mathbf{else}\\;") r 'mcond rop))))) + '("\\left\\{\\begin{array}{ll}") + (apply #'append + (mapcar + #'(lambda (p e) + (if (eq p t) + (tex e nil '("& \\mathrm{otherwise}") nil nil) + (tex-list (list e p) nil '(" \\\\ ") " & \\mathrm{if}\\; "))) + (odds (rest x) 1) + (odds (rest x) 0))) + '("\\end{array}\\right.") + r)) (defprop mdo tex-mdo tex) (defprop mdoin tex-mdoin tex) -------------- next part -------------- A non-text attachment was scrubbed... Name: t.pdf Type: application/pdf Size: 25544 bytes Desc: not available URL: From fateman at eecs.berkeley.edu Tue Jan 11 00:28:05 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 10 Jan 2011 22:28:05 -0800 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> <871v4kmbte.fsf@yeeloong.netris.org> Message-ID: <4D2BF875.1070906@eecs.berkeley.edu> On 1/10/2011 9:25 PM, Robert Dodier wrote: > On 1/10/11, Mark H Weaver wrote: > >> + ;; Modified by Mark H Weaver in January 2011 to add >> + ;; support for MCOND expressions containing more than one non-T >> + ;; condition, i.e. elseif, which was added after this code was >> + ;; originally written by RJF. The format of MCOND expressions is >> + ;; documented above the definition of dim-mcond in displa.lisp. > I'm sorry to say it, but this is a mess. I think it is fine. > I'm all for comments in the code, but please, in the name > of all that is good, just stick to what's technically relevant. In general one may not know what is technically relevant. Sometimes people take out code because they simply don't understand that it has to be there. Certainly this has happened numerous times in the last 12 months. If you want to make a distinction between technically relevant (goes in the source) and non-technically relevant, (in CVS only), you are probably assuming more skill than most people have. I think that comments like the above are important to avoid some subtle breakage and the code would be really hard to repair, unless one were online with CVS, and willing to delve into it. The fact remains that when I see certain hands are responsible for certain pieces of code, I use that as a clue as to where the bug may be. I'm not sure that CVS would help in exactly the case of the subtle breakage in tex of mcond that was introduced by Raymond Toy in 2005 in nparse.lisp, and updated by Robert Dodier in 2006. (the bug being introducing elseif to the parser and not fixing all the other places that needed fixing.) It might be good to point out in a comment in the code for nparse that changes to the language may need to be reflected in other places that may not be obvious. The obvious ones are evaluation, simplification, display. Tex is maybe not so obvious. maybe string() and fortran(). But the fortran() command seems to be quite weak, and can't handle if-then-else much less if-then-elseif-.. Whether it is relevant that tex() was written before 2005 or not would not appear in the CVS for nparse, if indeed anyone would think to look there. Or maybe it doesn't matter how the bug was produced if Mark Weaver fixes it? > Commentary like the stuff shown above is best left to > the CVS log. > > Maybe in some rare cases it is necessary to let the outside > world intrude in form of names and dates and historical > commentary. But for crying out loud, consider what a swamp, > what a mess Maxima would be if we had decades of such > cruft cluttering up the code. Look at the first couple of pages of nparse. There are pieces of source that can, in my opinion, be cut out, and have, such as specialized assembly code that ran only on machines no longer in existence, like the PDP-10 (KA model). or on software that no longer runs, like ITS, the Incompatible Timesharing System. But eliminating code forever, or removing comments is bad policy, I think. Sometimes I leave code around (defun foo()...) ;; old foo, for comparison #+ignore (defun foo() ...) This has the excellent property that the old version of foo can be loaded into lisp / Maxima to replace the new one with meta-control-x. I find that replacing lines one at a time is much less convenient. > Interesting parts of Maxima have > been touched by dozens of hands over many years -- do we > really need to recapitulate the whole freaking Old Testament > in order to show what the code does? Sometimes it is not a bad idea. Especially when the "new" comments turn out to be wrong, based on a misunderstanding of the Old Testament code, and having those comments (and even code) around can help. Yes one can revert code with CVS, too. > It's too ugly to > contemplate. The programmers of today are not immune from making mistakes. The test-suite hardly tests everything. The fact that some change is recorded in the CVS apparently provides some people with more comfort than for me.. RJF From robert.dodier at gmail.com Tue Jan 11 00:28:12 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 10 Jan 2011 23:28:12 -0700 Subject: [Maxima] How to make a simplifier In-Reply-To: References: Message-ID: On 1/10/11, Richard Hennessy wrote: > I would like general information on how to make a simplifier for pw. I can > get expressions in a complex form that can be simplified further but I don?t > know how to write a simplifier. Can someone point me in the right > direction? Rich, a "simplifier" in Maxima's world is just a function which is called (by Maxima's general simplifier) to apply an identity to an expression. Maxima associates a simplifier function with the main (i.e. top-level) operator of the expression. So the simplifier for pw expressions (assuming the operator is pw) is a function associated with the symbol pw. You can construct simplifier functions at the user level via tellsimp and friends. The easiest case to handle is an operator which has no built-in simplifications, and no evaluation function (i.e. there is no pw(x) := ... nor (defun $pw (x) ...) for it). Then you can do stuff matchdeclare (xx, ... ...); tellsimp (pw (xx), FOO (xx)); where FOO is a function which returns some transformed version of pw (maybe still a pw expression or something else). If pw takes a variable number of arguments, or if there is an evaluation function, or you run into some other complication, you might be better off programming in Lisp. If you know how to program in Lisp, it's not a big deal to write a simplification function. But let's hold off on that for the moment. Hope this helps, Robert Dodier From fateman at eecs.berkeley.edu Tue Jan 11 00:55:37 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 10 Jan 2011 22:55:37 -0800 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: References: Message-ID: <4D2BFEE9.7080500@eecs.berkeley.edu> On 1/10/2011 10:15 PM, Robert Dodier wrote: > I have a different patch for tex-mcond. > I pasted the output into a TeX document and > generated a PDF (attached) from it. This is an interesting display, but maybe not what people would want by default, especially for a simple if-then-else. Maybe a tex-related flag? There is another construction, another multi-way branch, not in Maxima, but Macsyma, which might have a nice 2-d display, the "case" statement.. CASE(keyword, ['list-of-indicators1,form1] {, ['list-of-indicators2, form2], ..., ['list-of-indicatorsN, formN]}) Evaluates keyword and compares it with the list of indicators in the subsequent arguments. The indicators are not evaluated. If keyword is a member of the list of indicators then the corresponding form is evaluated and the result is returned. If a single indicator is given then it need not be a list. If the final indicator is either OTHERWISE or TRUE then the final form is evaluated. example... case( b2,[[a1,a2], a] [[b1, b2],b], [otherwise,x]) familiar to common lisp programmers. From rmodesi at msn.com Tue Jan 11 11:29:03 2011 From: rmodesi at msn.com (RONALD F MODESITT) Date: Tue, 11 Jan 2011 10:29:03 -0700 Subject: [Maxima] syntax error in maxima-init.mac Message-ID: All, I would appreciate your review of my maxima-init.mac file. The file executes properly. Environment variables for userdir, tempdir, and file_search_... are set and Professor Woollett's mbe1util file is executed on boot of wxMaxima. However, the two disp() and print() functions do not result in output. I have reviewed the manual for display variables that may affect these functions but do not see anything specific. Therefore I assume I have a syntax error (nothing new to me). I would appreciate your review and comments. maxima_userdir : "/home/ron/MaximaWork"$ maxima_tempdir : "/home/ron/Maxima_temp"$ file_search_maxima : append(file_search_maxima, ["/home/ron/MaximaWork/###.{mac,mc}"])$ file_search_lisp : append(["/home/ron/MaximaWork/###.lisp"],file_search_lisp)$ load (mbe1util)$ disp("Welcome Master")$ print(" mbe1util.mac functions ", functions)$ disp ("Maxima is the Future!")$ Thanks in advance Ronald F. Modesitt, PE 835 Sanctuary Circle Longmont, CO 80504 303-485-3887 720-684-8708 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhw at netris.org Tue Jan 11 13:03:25 2011 From: mhw at netris.org (Mark H Weaver) Date: Tue, 11 Jan 2011 14:03:25 -0500 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: (Robert Dodier's message of "Mon, 10 Jan 2011 22:25:16 -0700") References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> <871v4kmbte.fsf@yeeloong.netris.org> Message-ID: <87mxn7l0ua.fsf@yeeloong.netris.org> Robert Dodier writes: > On 1/10/11, Mark H Weaver wrote: > >> + ;; Modified by Mark H Weaver in January 2011 to add >> + ;; support for MCOND expressions containing more than one non-T >> + ;; condition, i.e. elseif, which was added after this code was >> + ;; originally written by RJF. The format of MCOND expressions is >> + ;; documented above the definition of dim-mcond in displa.lisp. > > I'm sorry to say it, but this is a mess. > I'm all for comments in the code, but please, in the name > of all that is good, just stick to what's technically relevant. > Commentary like the stuff shown above is best left to > the CVS log. I agree with you, Robert. This comment was poorly conceived. Mark From mhw at netris.org Tue Jan 11 14:10:36 2011 From: mhw at netris.org (Mark H Weaver) Date: Tue, 11 Jan 2011 15:10:36 -0500 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: (Robert Dodier's message of "Mon, 10 Jan 2011 23:15:14 -0700") References: Message-ID: <87fwszkxqb.fsf@yeeloong.netris.org> Robert, I like your version of tex-mcond very much! It is far superior to the old style of display, and ideal for beautiful display of piecewise functions. There are some contexts, e.g. large procedural function definitions, where we might want MCONDs displayed in the old style, except with automatic line breaks and indentation. I agree that there should be a global variable to switch to the old style if desired, but my preference is that your MCOND display style should be the default. Mark Robert Dodier writes: > I have a different patch for tex-mcond. > I pasted the output into a TeX document and > generated a PDF (attached) from it. > > FWIW > > Robert Dodier > > PS. Here are some example outputs: > > (%i2) tex (if x < 0 then foo); > > \begin{equation} > \left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< > 0 \\ \mathbf{false}& \mathrm{otherwise}\end{array}\right. > \end{equation} > > (%o2) false > (%i3) tex (if x < 0 then foo else bar); > > \begin{equation} > \left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< > 0 \\ {\it bar}& \mathrm{otherwise}\end{array}\right. > \end{equation} > > (%o3) false > (%i4) tex (if x < 0 then foo elseif x > 0 then bar else baz); > > \begin{equation} > \left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< > 0 \\ {\it bar} & \mathrm{if}\; x>0 \\ {\it baz}& \mathrm{otherwise} > \end{array}\right. > \end{equation} > > (%o4) false > (%i5) tex (if x < 0 then foo else if x > 0 then bar else baz); > > \begin{equation} > \left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< > 0 \\ \left(\left\{\begin{array}{ll}{\it bar} & \mathrm{if}\; x>0 \\ > {\it baz}& \mathrm{otherwise}\end{array}\right.\right) > & \mathrm{otherwise}\end{array}\right. > \end{equation} > > > PPS. Here's the patch. > > --- src/mactex.lisp 22 Nov 2009 04:53:36 -0000 1.71 > +++ src/mactex.lisp 14 Nov 2010 08:00:51 -0000 > @@ -888,6 +892,11 @@ > (defprop mcond tex-mcond tex) > (defprop %mcond tex-mcond tex) > > +(setf (get 'mcond 'tex-environment) > + `(,(format nil "~%\\begin{equation}~%") . ,(format nil > "~%\\end{equation}~%"))) > + > +(setf (get '%mcond 'tex-environment) (get 'mcond 'tex-environment)) > + > (defprop %derivative tex-derivative tex) > (defun tex-derivative (x l r) > (tex (if $derivabbrev > @@ -939,12 +948,17 @@ > > (defun tex-mcond (x l r) > (append l > - (tex (cadr x) '("\\mathbf{if}\\;") > - '("\\;\\mathbf{then}\\;") 'mparen 'mparen) > - (if (eql (fifth x) '$false) > - (tex (caddr x) nil r 'mcond rop) > - (append (tex (caddr x) nil nil 'mparen 'mparen) > - (tex (fifth x) '("\\;\\mathbf{else}\\;") r 'mcond rop))))) > + '("\\left\\{\\begin{array}{ll}") > + (apply #'append > + (mapcar > + #'(lambda (p e) > + (if (eq p t) > + (tex e nil '("& \\mathrm{otherwise}") nil nil) > + (tex-list (list e p) nil '(" \\\\ ") " & > \\mathrm{if}\\; "))) > + (odds (rest x) 1) > + (odds (rest x) 0))) > + '("\\end{array}\\right.") > + r)) > > (defprop mdo tex-mdo tex) > (defprop mdoin tex-mdoin tex) From rich.hennessy at verizon.net Tue Jan 11 15:23:55 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 11 Jan 2011 16:23:55 -0500 Subject: [Maxima] syntax error in maxima-init.mac In-Reply-To: References: Message-ID: <10878A76CE4F4082B51A6363BAE02F02@RichsLaptop> Hi, wxMaxima suppresses disp() output in the Maxima-Init.mac file. I don?t know if there is a flag you can set to change this. It is not a bug, it?s a feature. In command line Maxima this does not happen. Rich From: RONALD F MODESITT Sent: Tuesday, January 11, 2011 12:29 PM To: maxima at math.utexas.edu Subject: [Maxima] syntax error in maxima-init.mac All, I would appreciate your review of my maxima-init.mac file. The file executes properly. Environment variables for userdir, tempdir, and file_search_... are set and Professor Woollett's mbe1util file is executed on boot of wxMaxima. However, the two disp() and print() functions do not result in output. I have reviewed the manual for display variables that may affect these functions but do not see anything specific. Therefore I assume I have a syntax error (nothing new to me). I would appreciate your review and comments. maxima_userdir : "/home/ron/MaximaWork"$ maxima_tempdir : "/home/ron/Maxima_temp"$ file_search_maxima : append(file_search_maxima, ["/home/ron/MaximaWork/###.{mac,mc}"])$ file_search_lisp : append(["/home/ron/MaximaWork/###.lisp"],file_search_lisp)$ load (mbe1util)$ disp("Welcome Master")$ print(" mbe1util.mac functions ", functions)$ disp ("Maxima is the Future!")$ Thanks in advance Ronald F. M sitt, PE 835 Sanctuary Circle Longmont, CO 80504 303-485-3887 720-684-8708 -------------------------------------------------------------------------------- _______________________________________________ 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 Jan 11 15:35:26 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 11 Jan 2011 16:35:26 -0500 Subject: [Maxima] Bugs in abs_integrate.mac In-Reply-To: References: <87r5crosn5.fsf@yeeloong.netris.org> Message-ID: <2D69FB67BCF346D4A40FACA4BA06561B@RichsLaptop> I don't know if you use pw.mac but if you do there is some overlap in abs_integrate.mac and pw.mac. Both have an integrator for expressions involving unit_step() and signum(). Anyway the bug you found highlighted some bugs that were also present in pw.mac. I just fixed the problem so now pwint() (integrate()) gives the right answer for all cases. Thanks for pointing this out. FYI, Rich -----Original Message----- From: Barton Willis Sent: Thursday, January 06, 2011 9:50 AM To: Mark H Weaver Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Bugs in abs_integrate.mac Mark, Thanks for the bug report and (especially) your clear and detailed analysis. I have fixes for each of these bugs. The fix for abs_defint(unit_step(x),x,99,100) is what you suggested. To fix abs_defint(unit_step(unit_step(x)),x,-1,0), I changed the signum representation for unit_step to unit_step(x) = (signum(x)*(signum(x)+1))/2 Additionally, some abs_integrate functions convert terms such as signum(nonconstant polynomial)^2 to 1. In the context of an integrand signum(nonconstant polynomial)^2 = 1 is an OK identity, I think. It will take me some time to re-think and improve these fixes. Maybe you could file a bug report--I like having a record of bugs. Again, thanks for your bug report. --Barton (author of abs_integrate) -----maxima-bounces at math.utexas.edu wrote: ----- >I have found some bugs in abs_integrate.mac: >(%i3) abs_defint(unit_step(x),x,99,100); >(%o3) 100 >(%i4) abs_defint(unit_step(unit_step(x)),x,-1,0); >(%o4) 1/2 _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at eecs.berkeley.edu Tue Jan 11 15:38:37 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 11 Jan 2011 13:38:37 -0800 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: <87fwszkxqb.fsf@yeeloong.netris.org> References: <87fwszkxqb.fsf@yeeloong.netris.org> Message-ID: <4D2CCDDD.3000608@eecs.berkeley.edu> It is potentially an issue that if-then-elseif etc does not necessarily mean the same thing as the bracketed stack. If-then-elseif etc means a sequential checking of conditions such that the first "true" condition provides a value. The bracket notation usually means a testing of some set of disjoint conditions, perhaps unordered. If the conditions are not disjoint, I'm not sure one would use it. A mathematical notation for describing imperative programming constructs is perhaps best described via an imperative programming construct. An if-then-else can be used to change program flow e.g. return() or go(). The bracket notation helps with the "value" of the if, but not these side effects. RJF On 1/11/2011 12:10 PM, Mark H Weaver wrote: > Robert, > > I like your version of tex-mcond very much! It is far superior to the > old style of display, and ideal for beautiful display of piecewise > functions. > > There are some contexts, e.g. large procedural function definitions, > where we might want MCONDs displayed in the old style, except with > automatic line breaks and indentation. > > I agree that there should be a global variable to switch to the old > style if desired, but my preference is that your MCOND display style > should be the default. > > Mark > > > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From toy.raymond at gmail.com Tue Jan 11 16:07:25 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 11 Jan 2011 17:07:25 -0500 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: <87mxn7l0ua.fsf@yeeloong.netris.org> References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> <871v4kmbte.fsf@yeeloong.netris.org> <87mxn7l0ua.fsf@yeeloong.netris.org> Message-ID: <4D2CD49D.8010206@gmail.com> On 1/11/11 2:03 PM, Mark H Weaver wrote: > Robert Dodier writes: >> On 1/10/11, Mark H Weaver wrote: >> >>> + ;; Modified by Mark H Weaver in January 2011 to add >>> + ;; support for MCOND expressions containing more than one non-T >>> + ;; condition, i.e. elseif, which was added after this code was >>> + ;; originally written by RJF. The format of MCOND expressions is >>> + ;; documented above the definition of dim-mcond in displa.lisp. >> I'm sorry to say it, but this is a mess. >> I'm all for comments in the code, but please, in the name >> of all that is good, just stick to what's technically relevant. >> Commentary like the stuff shown above is best left to >> the CVS log. > I agree with you, Robert. This comment was poorly conceived. The issue of comments in the code has been discussed many times. I, however, partly disagree with you and Robert. I think part of the comment you gave *IS* relevant. I don't care too much about the name, but surely the comment about supporting more than one non-T condition is good. The reference to dim-mcond is good too. (Things in maxima are spread all over and are often times not where I expect them to be. Grep is my friend.) If you were just given the code for new tex-mcond, would you be able to figure out what it does? I would not be able to. But Mark's comment about supporting more than one non-T condition helps a lot. I certainly don't want to have to go to CVS to find the commit log for this, especially after many commits have been done on this file. cvs annotate can help, but given that people often times reindent things just because they can, cvs annotate doesn't always help either. I think we can all agree, however, that everyone should use good judgment. If it was hard to figure out, by all means, put as many comments as needed to describe it. (Be as brief as possible, but no briefer!) If you needed some history to figure it out, then that might be relevant. Or if the data structures are described somewhere else that's not obvious, a cross-reference would be welcome. Ray From rich.hennessy at verizon.net Tue Jan 11 17:46:02 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 11 Jan 2011 18:46:02 -0500 Subject: [Maxima] I have created a Sourceforge.net project for pw.mac Message-ID: <1921CA1B97E04353B456D014851D3463@RichsLaptop> Hi, You can now get pw.mac from sourceforge.net. Thus version control is easier for me, etc... The place to go is http://sourceforge.net/projects/piecewisefunc/ Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Tue Jan 11 20:46:31 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 11 Jan 2011 19:46:31 -0700 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: <4D2CD49D.8010206@gmail.com> References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> <871v4kmbte.fsf@yeeloong.netris.org> <87mxn7l0ua.fsf@yeeloong.netris.org> <4D2CD49D.8010206@gmail.com> Message-ID: On 1/11/11, Raymond Toy wrote: > I, however, partly disagree with you and Robert. I think part of the > comment you gave *IS* relevant. I don't care too much about the name, > but surely the comment about supporting more than one non-T condition is > good. The reference to dim-mcond is good too. (Things in maxima are > spread all over and are often times not where I expect them to be. Grep > is my friend.) Well, the stuff about MCOND expressions is fine; any technical stuff is fine, which I said before. I was reacting to the dates & authors business. I guess I didn't make that clear. best Robert Dodier From fateman at eecs.berkeley.edu Tue Jan 11 21:09:07 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 11 Jan 2011 19:09:07 -0800 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> <871v4kmbte.fsf@yeeloong.netris.org> <87mxn7l0ua.fsf@yeeloong.netris.org> <4D2CD49D.8010206@gmail.com> Message-ID: <4D2D1B53.2080800@eecs.berkeley.edu> On 1/11/2011 6:46 PM, Robert Dodier wrote: > On 1/11/11, Raymond Toy wrote: > >> I, however, partly disagree with you and Robert. I think part of the >> comment you gave *IS* relevant. I don't care too much about the name, >> but surely the comment about supporting more than one non-T condition is >> good. The reference to dim-mcond is good too. (Things in maxima are >> spread all over and are often times not where I expect them to be. Grep >> is my friend.) > Well, the stuff about MCOND expressions is fine; > any technical stuff is fine, which I said before. > I was reacting to the dates& authors business. > I guess I didn't make that clear. > ... I have mixed feelings about this. One of the reasons to have some historical background in the code is to provide additional clues for why the program is the way it is, and not some other plausible way. One possible unfortunate scenario goes like this. 1. Person X designs a new feature and implements it, and it works to the satisfaction of X. 2. Person Y uses the code and finds it unsatisfactory, actually fixes and generalizes it so that it works for both X and Y. 3. Person Z uses the program but finds it not quite satisfactory and decides to "fix" it by replacing it by something equivalent to the simplistic version of X, and then adding his own features. Why? He doesn't understand Y's code. He just wipes it out, and so unless Y goes back and tests the code, the new version, X+Z seems to be just fine. And it is, for almost everyone except Y. This happens. Then (2') Person Y uses the code but it is broken. He restores his old code. etc. Now, all of this can be handled using CVS IF everyone reads all the comments and understands all the parts. And having comments in the code might not prevent it from happening. But certainly the amount of comment is not such a burden that extra stuff (if accurate) should be discarded. I have heard arguments that any comments are bad. Code should be so clear that comments are not only unnecessary, but hazardous, because the program might be changed and then the pre-existing comments would be misleading, so better not to have any. I disagree with that view :) RJF From toy.raymond at gmail.com Tue Jan 11 21:45:35 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 11 Jan 2011 22:45:35 -0500 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: <4D2D1B53.2080800@eecs.berkeley.edu> References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> <871v4kmbte.fsf@yeeloong.netris.org> <87mxn7l0ua.fsf@yeeloong.netris.org> <4D2CD49D.8010206@gmail.com> <4D2D1B53.2080800@eecs.berkeley.edu> Message-ID: <4D2D23DF.5080800@gmail.com> On 1/11/11 10:09 PM, Richard Fateman wrote: > >> any technical stuff is fine, which I said before. >> I was reacting to the dates& authors business. >> I guess I didn't make that clear. >> > Well, the stuff about MCOND expressions is fine; > ... > I have mixed feelings about this. > One of the reasons to have some historical background in the code is > to provide > additional clues for why the program is the way it is, and not some > other plausible > way. > > One possible unfortunate scenario goes like this. > > 1. Person X designs a new feature and implements it, and it works to the > satisfaction of X. > 2. Person Y uses the code and finds it unsatisfactory, actually fixes > and generalizes > it so that it works for both X and Y. > 3. Person Z uses the program but finds it not quite satisfactory and > decides to > "fix" it by replacing it by something equivalent to the simplistic > version of X, and then adding his own > features. Why? He doesn't understand Y's code. He just wipes it > out, and > so unless Y goes back and tests the code, the new version, X+Z seems > to be just fine. > And it is, for almost everyone except Y. > > This happens. Indeed. I've seen such things in happen in production code (!!!!) I also have mixed feelings. I don't care if names and dates are given, but I would certainly like explanations about why things are changed for complicated things. Hopefully tests case have been provided to exercise the changes so when Z wipes out Y's code, tests suddenly start failing. Yes, this is hard, but we can at least try to make it better. > > Now, all of this can be handled using CVS IF everyone reads all the > comments > and understands all the parts. And having comments in the code might > not prevent it from happening. But certainly the amount of comment is not > such a burden that extra stuff (if accurate) should be discarded. > > I have > heard arguments that any comments are bad. Code should be > so clear that comments are not only unnecessary, but hazardous, because > the program might be changed and then the pre-existing comments would be > misleading, so better not to have any. > I disagree with that view :) I do too. I once wrote some code where it was clearly commented why it was the way it was, and even referenced the standard specification. Someone later on commented out the code because it caused some reference tests to fail. He clearly never thought that the tests themselves were bad. The tests were actually bad, and the code that was commented out actually caused failures in type-approval and field tests, where it really matters. Everyone should use good judgment. But I guess that only comes one way---experience. Ray From robert.dodier at gmail.com Tue Jan 11 23:21:49 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 11 Jan 2011 22:21:49 -0700 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: <4D2D1B53.2080800@eecs.berkeley.edu> References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> <871v4kmbte.fsf@yeeloong.netris.org> <87mxn7l0ua.fsf@yeeloong.netris.org> <4D2CD49D.8010206@gmail.com> <4D2D1B53.2080800@eecs.berkeley.edu> Message-ID: On 1/11/11, Richard Fateman wrote: > Now, all of this can be handled using CVS IF everyone reads all the comments > and understands all the parts. And having comments in the code might > not prevent it from happening. But certainly the amount of comment is not > such a burden that extra stuff (if accurate) should be discarded. Nobody has argued for putting all of the comments in CVS. > I have heard arguments that any comments are bad. Code should be > so clear that comments are not only unnecessary, but hazardous, because > the program might be changed and then the pre-existing comments would be > misleading, so better not to have any. > I disagree with that view :) Nobody has argued for omitting comments entirely. Robert Dodier From smh at franz.com Wed Jan 12 00:02:37 2011 From: smh at franz.com (Steve Haflich) Date: Tue, 11 Jan 2011 22:02:37 -0800 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> <871v4kmbte.fsf@yeeloong.netris.org> <87mxn7l0ua.fsf@yeeloong.netris.org> <4D2CD49D.8010206@gmail.com> <4D2D1B53.2080800@eecs.berkeley.edu> Message-ID: <24821.1294812157@gemini.franz.com> Robert Dodier wrote: On 1/11/11, Richard Fateman wrote: > Now, all of this can be handled using CVS IF everyone reads all the comments > and understands all the parts. And having comments in the code might > not prevent it from happening. But certainly the amount of comment is not > such a burden that extra stuff (if accurate) should be discarded. Nobody has argued for putting all of the comments in CVS. > I have heard arguments that any comments are bad. Code should be > so clear that comments are not only unnecessary, but hazardous, because > the program might be changed and then the pre-existing comments would be > misleading, so better not to have any. > I disagree with that view :) Nobody has argued for omitting comments entirely. ;; This comment is no longer valid. From rich.hennessy at verizon.net Wed Jan 12 00:02:55 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 12 Jan 2011 01:02:55 -0500 Subject: [Maxima] How to make a simplifier In-Reply-To: References: Message-ID: <1C1AC6E7BBF1424086549545F404F61B@RichsLaptop> "If you know how to program in Lisp, it's not a big deal to write a simplification function. But let's hold off on that for the moment." Why Lisp, Maxima's language is easier. I am not good at Lisp. Rich -----Original Message----- From: Robert Dodier Sent: Tuesday, January 11, 2011 1:28 AM To: Richard Hennessy Cc: Maxima List Subject: Re: [Maxima] How to make a simplifier On 1/10/11, Richard Hennessy wrote: > I would like general information on how to make a simplifier for pw. I > can > get expressions in a complex form that can be simplified further but I don?t > know how to write a simplifier. Can someone point me in the right > direction? Rich, a "simplifier" in Maxima's world is just a function which is called (by Maxima's general simplifier) to apply an identity to an expression. Maxima associates a simplifier function with the main (i.e. top-level) operator of the expression. So the simplifier for pw expressions (assuming the operator is pw) is a function associated with the symbol pw. You can construct simplifier functions at the user level via tellsimp and friends. The easiest case to handle is an operator which has no built-in simplifications, and no evaluation function (i.e. there is no pw(x) := ... nor (defun $pw (x) ...) for it). Then you can do stuff matchdeclare (xx, ... ...); tellsimp (pw (xx), FOO (xx)); where FOO is a function which returns some transformed version of pw (maybe still a pw expression or something else). If pw takes a variable number of arguments, or if there is an evaluation function, or you run into some other complication, you might be better off programming in Lisp. If you know how to program in Lisp, it's not a big deal to write a simplification function. But let's hold off on that for the moment. Hope this helps, Robert Dodier From fateman at eecs.berkeley.edu Wed Jan 12 00:08:49 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 11 Jan 2011 22:08:49 -0800 Subject: [Maxima] How to make a simplifier In-Reply-To: <1C1AC6E7BBF1424086549545F404F61B@RichsLaptop> References: <1C1AC6E7BBF1424086549545F404F61B@RichsLaptop> Message-ID: <4D2D4571.3090802@eecs.berkeley.edu> On 1/11/2011 10:02 PM, Richard Hennessy wrote: > "If you know how to program in Lisp, it's not a big deal to write a > simplification function. But let's hold off on that for the moment." > > Why Lisp, Maxima's language is easier. I am not good at Lisp. > > Rich > If you are not good in Lisp, then Lisp will naturally be harder. If you know Lisp (also), you can make a choice as to which is better for a particular task. If you are constructing a lot of large symbolic math expressions and need to have them evaluated and simplified at every turn, the Maxima language may indeed be easier. It can also be compiled into (somewhat clumsy) Lisp. Tellsimp and friends also compile rules into Lisp. RJF From wilhelm.haager at htlstp.ac.at Wed Jan 12 07:56:14 2011 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Wed, 12 Jan 2011 14:56:14 +0100 Subject: [Maxima] =?utf-8?q?Error_in_Gnuplot=3F=3F?= Message-ID: <6b87a44292cd346953093119eebf8794@localhost> Hi, I suppose, the new Maxima (5.23.0) contains an erroneous version of Gnuplot (version 4.4). The following command lets Gnuplot crash (at least under Windows XP): draw2d(color=red,explicit(sin(x),x,0,2*%pi),terminal=eps,file_name="test"); Has anybody noticed similar effects? Regards Wilhelm Haager From anton.n.voropaev at gmail.com Wed Jan 12 08:00:56 2011 From: anton.n.voropaev at gmail.com (Anton Voropaev) Date: Wed, 12 Jan 2011 17:00:56 +0300 Subject: [Maxima] Recognition of elliptic integrals Message-ID: <002101cbb261$26332910$baa010ac@homecomp> Has Maxima tools to evaluate integrals in terms of elliptic integrals or in terms of hypergeometric function? From biomates at telefonica.net Wed Jan 12 12:06:47 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 12 Jan 2011 19:06:47 +0100 Subject: [Maxima] Error in Gnuplot?? In-Reply-To: <6b87a44292cd346953093119eebf8794@localhost> References: <6b87a44292cd346953093119eebf8794@localhost> Message-ID: <1294855607.1642.11.camel@trasno> El mi?, 12-01-2011 a las 14:56 +0100, Wilhelm Haager escribi?: > Hi, > I suppose, the new Maxima (5.23.0) contains an erroneous version of > Gnuplot (version 4.4). > The following command lets Gnuplot crash (at least under Windows XP): Hello, It seems to be a problem specific to Windows. When I run (in Linux through Wine) Maxima-5.23.0/bin/wgnuplot.exe and write the following commans: set term postscript set out "myfile" plot sin (x) I get this output: Can't find PostScript prologue file C:\Archivos de programa \Maxima-5.23.0\\share/gnuplot/4.4/PostScript\prologue.ps loadpath is empty Please copy prologue.ps to one of the above directories or set the loadpath appropriately or set the environmental variable GNUPLOT_PS_DIR Plot failed! I've found prologue.ps in this folder: Maxima-5.23.0/bin/share/PostScript -- Mario From woollett at charter.net Wed Jan 12 13:02:34 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 12 Jan 2011 11:02:34 -0800 Subject: [Maxima] syntax error in maxima-init.mac Message-ID: On Jan. 11, 2011, Ronald F. Modesitt wrote: ------------------------- I would appreciate your review of my maxima-init.mac file. The file executes properly. Environment variables for userdir, tempdir, and file_search_... are set and Professor Woollett's mbe1util file is executed on boot of wxMaxima. However, the two disp() and print() functions do not result in output. I have reviewed the manual for display variables that may affect these functions but do not see anything specific. Therefore I assume I have a syntax error (nothing new to me). I would appreciate your review and comments. maxima_userdir : "/home/ron/MaximaWork"$ maxima_tempdir : "/home/ron/Maxima_temp"$ file_search_maxima : append(file_search_maxima, ["/home/ron/MaximaWork/###.{mac,mc}"])$ file_search_lisp : append(["/home/ron/MaximaWork/###.lisp"],file_search_lisp)$ load (mbe1util)$ disp("Welcome Master")$ print(" mbe1util.mac functions ", functions)$ disp ("Maxima is the Future!")$ ----------------------------- The disp and print commands display correctly using XMaxima but I get no response when I use wxmaxima (which I rarely use). The wxmaxima experts must have the solution. Best Wishes, Ted Woollett From rmodesi at msn.com Wed Jan 12 14:13:44 2011 From: rmodesi at msn.com (RONALD F MODESITT) Date: Wed, 12 Jan 2011 13:13:44 -0700 Subject: [Maxima] syntax error in maxima-init.mac In-Reply-To: References: Message-ID: Professor Woollett, Thank you for the reply to my maxima-init problem. I'd like some clarification: (1) Are you using the GUI interface to XMaxima? (2) I get the same results in the XMaxima GUI as with wxMaxima. However, the terminal command line environment for XMaxima does show the results of the disp() command. (3) What screen resolution do you use in the XMaxima GUI? I don't care for the results but that may be the X interface. I really appreciate your MBE documents. I began with those after a couple of years away from Maxima remembering how well they guide the user. I was pleased to see that they have been updated as well. I recently discovered a new application called SMath Studio, which has a GUI much like Matlab. It is a native Windows application and runs well under XP. I am also using it under Linux and Mono with good results. It seems to fit the engineering environment better than Maxima. Have you tested this product? Many thanks again, Ron -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbmaxima at gmail.com Wed Jan 12 18:21:21 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Thu, 13 Jan 2011 11:21:21 +1100 Subject: [Maxima] Recognition of elliptic integrals In-Reply-To: <002101cbb261$26332910$baa010ac@homecomp> References: <002101cbb261$26332910$baa010ac@homecomp> Message-ID: <4D2E4581.9060104@gmail.com> On 13/01/2011 1:00 AM, Anton Voropaev wrote: > Has Maxima tools to evaluate integrals > in terms of elliptic integrals or in terms > of hypergeometric function? Maxima has little capability in this area at present. The integrals of few special functions, for example Airy and some Bessel functions, are expressed in terms of hypergeometric functions. It is quite easy to add integrals for other special functions if you can identify gaps. There was some discussion about adding more general algorithms for integrals in terms of hypergeometric or Meijer G functions, but no code yet. From razif66 at gmail.com Wed Jan 12 21:46:46 2011 From: razif66 at gmail.com (razif razali) Date: Thu, 13 Jan 2011 11:46:46 +0800 Subject: [Maxima] how to make maxima create equation like i give in attachment In-Reply-To: References: <4D2484AC.70404@eecs.berkeley.edu> Message-ID: On Thu, Jan 6, 2011 at 9:40 PM, Leo Butler wrote: > > > On Thu, 6 Jan 2011, razif razali wrote: > > < Thanks for your reply, > < so from your guide, here what I come through, > < ------------------ > < df(n,k):= > < block ([], > < if n=0 > < then 0 > < else > < > 'diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]) > < ); > < makelist(df(1,k),k,1,2); > < ------------------------ > < I can get the equation for diff( f[2,1],s) and diff( f[2,2],s) > respectively, > < > < so next thing is, how can i make diff( f[2,1],s) and diff( f[2,2]) hold > it value?because when I type again diff( f[2,1],s) in maxima after give code > above, it gives > < zero. what i want do here is after i get equation diff( f[2,1],s) i want > to solve with both equation using ode method to get function of f[2,1] and > f[2,2] with > < f[2*n,k](0)=A, and value of x and A are not zero... > > The problem is that Maxima does not know that f[n,k] is a function of > s, too. Here is a solution: > > depends(f,s); > df[n,k] := if n=0 then 0 else > diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); > . > . > . > Note that I do not use 'diff, because the first line tells Maxima > that f is a function of s. > > Leo > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > by telling MAXIMA that f[n,k] is function of s to helped me without using 'diff but then it still not hold the function for next used? the result still the same, depends(f,s); df[n,k] := if n=0 then 0 else diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); makelist(df[1,k],k,1,2); then i got the diff(f [2,1],s) and diff( f[2,2],s) so how to make diff(f [2,1],s) and diff( f[2,2],s) hold its function so that I can solve it using ODE in MAXIMA?because when i type all command above and get the result, when i type again diff( f[2,1],s) it give nothing... -- 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 Jan 12 22:05:29 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 12 Jan 2011 20:05:29 -0800 Subject: [Maxima] how to make maxima create equation like i give in attachment In-Reply-To: References: <4D2484AC.70404@eecs.berkeley.edu> Message-ID: <4D2E7A09.3080404@eecs.berkeley.edu> On 1/12/2011 7:46 PM, razif razali wrote: > but then it still not hold the function for next used? > the result still the same, > Please try to explain what you want in better English. This does not make sense to me. Maybe find someone else you can talk to at your university. From macrakis at alum.mit.edu Wed Jan 12 22:41:52 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 12 Jan 2011 23:41:52 -0500 Subject: [Maxima] how to make maxima create equation like i give in attachment In-Reply-To: References: <4D2484AC.70404@eecs.berkeley.edu> Message-ID: Razif, In Maxima, you do not assign values to derivatives etc. You write equations and can store the equations in variables or lists. Let me give an example with ordinary (not differential) equations. eq1: x = y+3$ eq2: x*5=2*y-7$ solve( [eq1, eq2], [x,y]); OR eqs: [ x = y+3, x*5=2*y-7 ]$ vars: [x,y]$ solve(eqs,vars); You can do the same thing for systems of equations using 'makelist': eqs: makelist( x[ i ] = x[ i+1 ] + x[ i-1 ] + 1, i , 1, 5 )$ solve( append([x[0]=x[8],x[3]=1],eqs), << add some extra equations makelist(x[i],i,0,8)); << list of variables I have not worked with the differential equation solvers for a long time, so I don't know whether they can solve your equations. -s On Wed, Jan 12, 2011 at 22:46, razif razali wrote: > > > On Thu, Jan 6, 2011 at 9:40 PM, Leo Butler wrote: > >> >> >> On Thu, 6 Jan 2011, razif razali wrote: >> >> < Thanks for your reply, >> < so from your guide, here what I come through, >> < ------------------ >> < df(n,k):= >> < block ([], >> < if n=0 >> < then 0 >> < else >> < >> 'diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]) >> < ); >> < makelist(df(1,k),k,1,2); >> < ------------------------ >> < I can get the equation for diff( f[2,1],s) and diff( f[2,2],s) >> respectively, >> < >> < so next thing is, how can i make diff( f[2,1],s) and diff( f[2,2]) hold >> it value?because when I type again diff( f[2,1],s) in maxima after give code >> above, it gives >> < zero. what i want do here is after i get equation diff( f[2,1],s) i want >> to solve with both equation using ode method to get function of f[2,1] and >> f[2,2] with >> < f[2*n,k](0)=A, and value of x and A are not zero... >> >> The problem is that Maxima does not know that f[n,k] is a function of >> s, too. Here is a solution: >> >> depends(f,s); >> df[n,k] := if n=0 then 0 else >> diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); >> . >> . >> . >> Note that I do not use 'diff, because the first line tells Maxima >> that f is a function of s. >> >> Leo >> -- >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> by telling MAXIMA that f[n,k] is function of s to helped me without using > 'diff but then it still not hold the function for next used? > the result still the same, > > depends(f,s); > df[n,k] := if n=0 then 0 else > diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); > makelist(df[1,k],k,1,2); > > then i got the diff(f [2,1],s) and diff( f[2,2],s) > > so how to make diff(f [2,1],s) and diff( f[2,2],s) hold its function so > that I can solve it using ODE in MAXIMA?because when i type all command > above and get the result, when i type again diff( f[2,1],s) it give > nothing... > > > > > -- > 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 Jan 13 02:44:04 2011 From: razif66 at gmail.com (razif razali) Date: Thu, 13 Jan 2011 16:44:04 +0800 Subject: [Maxima] how to make maxima create equation like i give in attachment In-Reply-To: References: <4D2484AC.70404@eecs.berkeley.edu> Message-ID: Macrakis, Here example that I used 'desolve' for my problem, -------------------------------------------------------------------- eq1:diff(f(s),s)=-sqrt(2)*g(s)*k; eq2:diff(g(s),s)=k*(sqrt(2)*f(s)-2*h(s)); eq3:diff(h(s),s)=2*k*g(s); atvalue(f(s),s=0,f0); atvalue(g(s),s=0,0); atvalue(h(s),s=0,0); desolve([eq1,eq2,eq3],[f(s),g(s),h(s)]); nonzero; --------------------------------------------------- I manually replace f[4,1] to f(s), f[4,2] to g(s) and f[4,3] to h(s) because 'atvalue' can't accept f[4,1](s), it will give error. so how to make maxima automatically convert all those f[n,k] function into f(s),g(s),h(s).....n(s) in code below so that I can used code above to solve my problem? -------------------------------------- depends(f,s); df[n,k] := if n=0 then 0 else diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); eqs:makelist(df[2,k],k,1,3); ----------------------------------------- or maybe there some way that we didn't need to replace the function but make maxima solve it automatically? On Thu, Jan 13, 2011 at 12:41 PM, Stavros Macrakis wrote: > Razif, > > In Maxima, you do not assign values to derivatives etc. You write > equations and can store the equations in variables or lists. > > Let me give an example with ordinary (not differential) equations. > > eq1: x = y+3$ > eq2: x*5=2*y-7$ > > solve( [eq1, eq2], [x,y]); > > OR > > eqs: [ x = y+3, x*5=2*y-7 ]$ > vars: [x,y]$ > solve(eqs,vars); > > You can do the same thing for systems of equations using 'makelist': > > eqs: makelist( x[ i ] = x[ i+1 ] + x[ i-1 ] + 1, i , 1, 5 )$ > solve( append([x[0]=x[8],x[3]=1],eqs), << add some extra equations > makelist(x[i],i,0,8)); << list of > variables > > I have not worked with the differential equation solvers for a long time, > so I don't know whether they can solve your equations. > > -s > > > > > On Wed, Jan 12, 2011 at 22:46, razif razali wrote: > >> >> >> On Thu, Jan 6, 2011 at 9:40 PM, Leo Butler wrote: >> >>> >>> >>> On Thu, 6 Jan 2011, razif razali wrote: >>> >>> < Thanks for your reply, >>> < so from your guide, here what I come through, >>> < ------------------ >>> < df(n,k):= >>> < block ([], >>> < if n=0 >>> < then 0 >>> < else >>> < >>> 'diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]) >>> < ); >>> < makelist(df(1,k),k,1,2); >>> < ------------------------ >>> < I can get the equation for diff( f[2,1],s) and diff( f[2,2],s) >>> respectively, >>> < >>> < so next thing is, how can i make diff( f[2,1],s) and diff( f[2,2]) hold >>> it value?because when I type again diff( f[2,1],s) in maxima after give code >>> above, it gives >>> < zero. what i want do here is after i get equation diff( f[2,1],s) i >>> want to solve with both equation using ode method to get function of f[2,1] >>> and f[2,2] with >>> < f[2*n,k](0)=A, and value of x and A are not zero... >>> >>> The problem is that Maxima does not know that f[n,k] is a function of >>> s, too. Here is a solution: >>> >>> depends(f,s); >>> df[n,k] := if n=0 then 0 else >>> diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); >>> . >>> . >>> . >>> Note that I do not use 'diff, because the first line tells Maxima >>> that f is a function of s. >>> >>> Leo >>> -- >>> The University of Edinburgh is a charitable body, registered in >>> Scotland, with registration number SC005336. >>> >>> by telling MAXIMA that f[n,k] is function of s to helped me without using >> 'diff but then it still not hold the function for next used? >> the result still the same, >> >> depends(f,s); >> df[n,k] := if n=0 then 0 else >> diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); >> makelist(df[1,k],k,1,2); >> >> then i got the diff(f [2,1],s) and diff( f[2,2],s) >> >> so how to make diff(f [2,1],s) and diff( f[2,2],s) hold its function so >> that I can solve it using ODE in MAXIMA?because when i type all command >> above and get the result, when i type again diff( f[2,1],s) it give >> nothing... >> >> >> >> >> -- >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From wilhelm.haager at htlstp.ac.at Thu Jan 13 03:56:53 2011 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Thu, 13 Jan 2011 10:56:53 +0100 Subject: [Maxima] =?utf-8?q?Error_in_Gnuplot=3F=3F?= In-Reply-To: <1294855607.1642.11.camel@trasno> References: <6b87a44292cd346953093119eebf8794@localhost> <1294855607.1642.11.camel@trasno> Message-ID: On Wed, 12 Jan 2011 19:06:47 +0100, Mario Rodriguez wrote: > El mi?, 12-01-2011 a las 14:56 +0100, Wilhelm Haager escribi?: >> Hi, >> I suppose, the new Maxima (5.23.0) contains an erroneous version of >> Gnuplot (version 4.4). >> The following command lets Gnuplot crash (at least under Windows XP): > > > Hello, > > It seems to be a problem specific to Windows. > > When I run (in Linux through Wine) > > Maxima-5.23.0/bin/wgnuplot.exe > > and write the following commans: > > set term postscript > set out "myfile" > plot sin (x) > > I get this output: > > > Can't find PostScript prologue file C:\Archivos de programa > \Maxima-5.23.0\\share/gnuplot/4.4/PostScript\prologue.ps > loadpath is empty > Please copy prologue.ps to one of the above directories > or set the loadpath appropriately > or set the environmental variable GNUPLOT_PS_DIR > Plot failed! > > > I've found prologue.ps in this folder: > Maxima-5.23.0/bin/share/PostScript > > -- > Mario Thanks, Mario, that seemed to be the Problem. Wilhelm From nathaniel.cunningham at gmail.com Wed Jan 12 22:31:41 2011 From: nathaniel.cunningham at gmail.com (Nathaniel Cunningham) Date: Wed, 12 Jan 2011 22:31:41 -0600 Subject: [Maxima] building maxima.app for OS X Message-ID: Hi, I would like to be able to build Maxima.app each time from the latest-and-greatest maxima version. Is the Xcode project or build code for this (Maxima.app) available? Thanks, Nathaniel nathaniel.cunningham at gmail.com p.s. Please include my address directly in replies, as I'm not a list subscriber. -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Jan 13 07:08:46 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 13 Jan 2011 08:08:46 -0500 Subject: [Maxima] how to make maxima create equation like i give in attachment In-Reply-To: References: <4D2484AC.70404@eecs.berkeley.edu> Message-ID: Sorry for the bug in atvalue. You can replace the f[i,j]'s with the atomic f_i_j using subst( concat("f_",i,"_",j), f[i,j], ... ). Or even easier, define: f[n,k] := concat("f_",n,"_",k) and then whenever you write f[n,k], it will evaluate to f_n_k. You also need to either declare all the f_n_k's as depending on s or, better, write 'diff(...) instead of diff(...). -s On Thu, Jan 13, 2011 at 03:44, razif razali wrote: > Macrakis, > > Here example that I used 'desolve' for my problem, > -------------------------------------------------------------------- > eq1:diff(f(s),s)=-sqrt(2)*g(s)*k; > > eq2:diff(g(s),s)=k*(sqrt(2)*f(s)-2*h(s)); > > eq3:diff(h(s),s)=2*k*g(s); > > atvalue(f(s),s=0,f0); > > atvalue(g(s),s=0,0); > > atvalue(h(s),s=0,0); > > desolve([eq1,eq2,eq3],[f(s),g(s),h(s)]); > > nonzero; > --------------------------------------------------- > > I manually replace f[4,1] to f(s), f[4,2] to g(s) and f[4,3] to h(s) > because 'atvalue' can't accept f[4,1](s), it will give error. > > so how to make maxima automatically convert all those f[n,k] function into > f(s),g(s),h(s).....n(s) in code below so that I can used code above to solve > my problem? > > -------------------------------------- > depends(f,s); > df[n,k] := > if n=0 > then 0 > else > > diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); > eqs:makelist(df[2,k],k,1,3); > ----------------------------------------- > > or maybe there some way that we didn't need to replace the function but > make maxima solve it automatically? > > On Thu, Jan 13, 2011 at 12:41 PM, Stavros Macrakis wrote: > >> Razif, >> >> In Maxima, you do not assign values to derivatives etc. You write >> equations and can store the equations in variables or lists. >> >> Let me give an example with ordinary (not differential) equations. >> >> eq1: x = y+3$ >> eq2: x*5=2*y-7$ >> >> solve( [eq1, eq2], [x,y]); >> >> OR >> >> eqs: [ x = y+3, x*5=2*y-7 ]$ >> vars: [x,y]$ >> solve(eqs,vars); >> >> You can do the same thing for systems of equations using 'makelist': >> >> eqs: makelist( x[ i ] = x[ i+1 ] + x[ i-1 ] + 1, i , 1, 5 )$ >> solve( append([x[0]=x[8],x[3]=1],eqs), << add some extra >> equations >> makelist(x[i],i,0,8)); << list of >> variables >> >> I have not worked with the differential equation solvers for a long time, >> so I don't know whether they can solve your equations. >> >> -s >> >> >> >> >> On Wed, Jan 12, 2011 at 22:46, razif razali wrote: >> >>> >>> >>> On Thu, Jan 6, 2011 at 9:40 PM, Leo Butler wrote: >>> >>>> >>>> >>>> On Thu, 6 Jan 2011, razif razali wrote: >>>> >>>> < Thanks for your reply, >>>> < so from your guide, here what I come through, >>>> < ------------------ >>>> < df(n,k):= >>>> < block ([], >>>> < if n=0 >>>> < then 0 >>>> < else >>>> < >>>> 'diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]) >>>> < ); >>>> < makelist(df(1,k),k,1,2); >>>> < ------------------------ >>>> < I can get the equation for diff( f[2,1],s) and diff( f[2,2],s) >>>> respectively, >>>> < >>>> < so next thing is, how can i make diff( f[2,1],s) and diff( f[2,2]) >>>> hold it value?because when I type again diff( f[2,1],s) in maxima after give >>>> code above, it gives >>>> < zero. what i want do here is after i get equation diff( f[2,1],s) i >>>> want to solve with both equation using ode method to get function of f[2,1] >>>> and f[2,2] with >>>> < f[2*n,k](0)=A, and value of x and A are not zero... >>>> >>>> The problem is that Maxima does not know that f[n,k] is a function of >>>> s, too. Here is a solution: >>>> >>>> depends(f,s); >>>> df[n,k] := if n=0 then 0 else >>>> diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); >>>> . >>>> . >>>> . >>>> Note that I do not use 'diff, because the first line tells Maxima >>>> that f is a function of s. >>>> >>>> Leo >>>> -- >>>> The University of Edinburgh is a charitable body, registered in >>>> Scotland, with registration number SC005336. >>>> >>>> by telling MAXIMA that f[n,k] is function of s to helped me without >>> using 'diff but then it still not hold the function for next used? >>> the result still the same, >>> >>> depends(f,s); >>> df[n,k] := if n=0 then 0 else >>> diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); >>> makelist(df[1,k],k,1,2); >>> >>> then i got the diff(f [2,1],s) and diff( f[2,2],s) >>> >>> so how to make diff(f [2,1],s) and diff( f[2,2],s) hold its function so >>> that I can solve it using ODE in MAXIMA?because when i type all command >>> above and get the result, when i type again diff( f[2,1],s) it give >>> nothing... >>> >>> >>> >>> >>> -- >>> 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 > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Jan 13 07:19:22 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 13 Jan 2011 08:19:22 -0500 Subject: [Maxima] how to make maxima create equation like i give in attachment In-Reply-To: References: <4D2484AC.70404@eecs.berkeley.edu> Message-ID: Should be f[n,k] := concat('f_,n,"_",k)(s) to produce a function call, not a string. So the complete solution is: f[n,k] := concat('f_,n,"_",k)(s)$ df[n,k] := if n=0 then 0 else 'diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1])$ desolve( makelist( df[2,k],k,1,3 ), makelist(f[4,k],k,1,3) ); Remember that f[...]:= defines a *memoizing* function, so you need to kill f if you want to redefine it. -s On Thu, Jan 13, 2011 at 08:08, Stavros Macrakis wrote: > Sorry for the bug in atvalue. > > You can replace the f[i,j]'s with the atomic f_i_j using subst( > concat("f_",i,"_",j), f[i,j], ... ). Or even easier, define: > > f[n,k] := concat("f_",n,"_",k) > > and then whenever you write f[n,k], it will evaluate to f_n_k. > > You also need to either declare all the f_n_k's as depending on s or, > better, write 'diff(...) instead of diff(...). > > -s > > On Thu, Jan 13, 2011 at 03:44, razif razali wrote: > >> Macrakis, >> >> Here example that I used 'desolve' for my problem, >> -------------------------------------------------------------------- >> eq1:diff(f(s),s)=-sqrt(2)*g(s)*k; >> >> eq2:diff(g(s),s)=k*(sqrt(2)*f(s)-2*h(s)); >> >> eq3:diff(h(s),s)=2*k*g(s); >> >> atvalue(f(s),s=0,f0); >> >> atvalue(g(s),s=0,0); >> >> atvalue(h(s),s=0,0); >> >> desolve([eq1,eq2,eq3],[f(s),g(s),h(s)]); >> >> nonzero; >> --------------------------------------------------- >> >> I manually replace f[4,1] to f(s), f[4,2] to g(s) and f[4,3] to h(s) >> because 'atvalue' can't accept f[4,1](s), it will give error. >> >> so how to make maxima automatically convert all those f[n,k] function into >> f(s),g(s),h(s).....n(s) in code below so that I can used code above to solve >> my problem? >> >> -------------------------------------- >> depends(f,s); >> df[n,k] := >> if n=0 >> then 0 >> else >> >> diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); >> eqs:makelist(df[2,k],k,1,3); >> ----------------------------------------- >> >> or maybe there some way that we didn't need to replace the function but >> make maxima solve it automatically? >> >> On Thu, Jan 13, 2011 at 12:41 PM, Stavros Macrakis > > wrote: >> >>> Razif, >>> >>> In Maxima, you do not assign values to derivatives etc. You write >>> equations and can store the equations in variables or lists. >>> >>> Let me give an example with ordinary (not differential) equations. >>> >>> eq1: x = y+3$ >>> eq2: x*5=2*y-7$ >>> >>> solve( [eq1, eq2], [x,y]); >>> >>> OR >>> >>> eqs: [ x = y+3, x*5=2*y-7 ]$ >>> vars: [x,y]$ >>> solve(eqs,vars); >>> >>> You can do the same thing for systems of equations using 'makelist': >>> >>> eqs: makelist( x[ i ] = x[ i+1 ] + x[ i-1 ] + 1, i , 1, 5 )$ >>> solve( append([x[0]=x[8],x[3]=1],eqs), << add some extra >>> equations >>> makelist(x[i],i,0,8)); << list of >>> variables >>> >>> I have not worked with the differential equation solvers for a long time, >>> so I don't know whether they can solve your equations. >>> >>> -s >>> >>> >>> >>> >>> On Wed, Jan 12, 2011 at 22:46, razif razali wrote: >>> >>>> >>>> >>>> On Thu, Jan 6, 2011 at 9:40 PM, Leo Butler wrote: >>>> >>>>> >>>>> >>>>> On Thu, 6 Jan 2011, razif razali wrote: >>>>> >>>>> < Thanks for your reply, >>>>> < so from your guide, here what I come through, >>>>> < ------------------ >>>>> < df(n,k):= >>>>> < block ([], >>>>> < if n=0 >>>>> < then 0 >>>>> < else >>>>> < >>>>> 'diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]) >>>>> < ); >>>>> < makelist(df(1,k),k,1,2); >>>>> < ------------------------ >>>>> < I can get the equation for diff( f[2,1],s) and diff( f[2,2],s) >>>>> respectively, >>>>> < >>>>> < so next thing is, how can i make diff( f[2,1],s) and diff( f[2,2]) >>>>> hold it value?because when I type again diff( f[2,1],s) in maxima after give >>>>> code above, it gives >>>>> < zero. what i want do here is after i get equation diff( f[2,1],s) i >>>>> want to solve with both equation using ode method to get function of f[2,1] >>>>> and f[2,2] with >>>>> < f[2*n,k](0)=A, and value of x and A are not zero... >>>>> >>>>> The problem is that Maxima does not know that f[n,k] is a function of >>>>> s, too. Here is a solution: >>>>> >>>>> depends(f,s); >>>>> df[n,k] := if n=0 then 0 else >>>>> diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); >>>>> . >>>>> . >>>>> . >>>>> Note that I do not use 'diff, because the first line tells Maxima >>>>> that f is a function of s. >>>>> >>>>> Leo >>>>> -- >>>>> The University of Edinburgh is a charitable body, registered in >>>>> Scotland, with registration number SC005336. >>>>> >>>>> by telling MAXIMA that f[n,k] is function of s to helped me without >>>> using 'diff but then it still not hold the function for next used? >>>> the result still the same, >>>> >>>> depends(f,s); >>>> df[n,k] := if n=0 then 0 else >>>> diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); >>>> makelist(df[1,k],k,1,2); >>>> >>>> then i got the diff(f [2,1],s) and diff( f[2,2],s) >>>> >>>> so how to make diff(f [2,1],s) and diff( f[2,2],s) hold its function so >>>> that I can solve it using ODE in MAXIMA?because when i type all command >>>> above and get the result, when i type again diff( f[2,1],s) it give >>>> nothing... >>>> >>>> >>>> >>>> >>>> -- >>>> 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 >> >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Thu Jan 13 10:21:58 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 13 Jan 2011 09:21:58 -0700 Subject: [Maxima] Error in Gnuplot?? In-Reply-To: <1294855607.1642.11.camel@trasno> References: <6b87a44292cd346953093119eebf8794@localhost> <1294855607.1642.11.camel@trasno> Message-ID: Is this a packaging problem of some kind? Who needs to solve it? -- wxMaxima, Maxima, or the user? best Robert On 1/12/11, Mario Rodriguez wrote: > El mi?, 12-01-2011 a las 14:56 +0100, Wilhelm Haager escribi?: >> Hi, >> I suppose, the new Maxima (5.23.0) contains an erroneous version of >> Gnuplot (version 4.4). >> The following command lets Gnuplot crash (at least under Windows XP): > > > Hello, > > It seems to be a problem specific to Windows. > > When I run (in Linux through Wine) > > Maxima-5.23.0/bin/wgnuplot.exe > > and write the following commans: > > set term postscript > set out "myfile" > plot sin (x) > > I get this output: > > > Can't find PostScript prologue file C:\Archivos de programa > \Maxima-5.23.0\\share/gnuplot/4.4/PostScript\prologue.ps > loadpath is empty > Please copy prologue.ps to one of the above directories > or set the loadpath appropriately > or set the environmental variable GNUPLOT_PS_DIR > Plot failed! > > > I've found prologue.ps in this folder: > Maxima-5.23.0/bin/share/PostScript > > -- > Mario > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From andrej.vodopivec at gmail.com Thu Jan 13 11:16:54 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Thu, 13 Jan 2011 18:16:54 +0100 Subject: [Maxima] Error in Gnuplot?? In-Reply-To: References: <6b87a44292cd346953093119eebf8794@localhost> <1294855607.1642.11.camel@trasno> Message-ID: This is a packaging problem. I will set the GNUPLOT_PS_DIR variable in maxima.bat so that gnuplot will find prologue.ps. Andrej On Thu, Jan 13, 2011 at 5:21 PM, Robert Dodier wrote: > Is this a packaging problem of some kind? > Who needs to solve it? -- wxMaxima, Maxima, or the user? > > best > > Robert > > > On 1/12/11, Mario Rodriguez wrote: >> El mi?, 12-01-2011 a las 14:56 +0100, Wilhelm Haager escribi?: >>> Hi, >>> I suppose, the new Maxima (5.23.0) contains an erroneous version of >>> Gnuplot (version 4.4). >>> The following command lets Gnuplot crash (at least under Windows XP): >> >> >> Hello, >> >> It seems to be a problem specific to Windows. >> >> When I run (in Linux through Wine) >> >> Maxima-5.23.0/bin/wgnuplot.exe >> >> and write the following commans: >> >> set term postscript >> set out "myfile" >> plot sin (x) >> >> I get this output: >> >> >> Can't find PostScript prologue file C:\Archivos de programa >> \Maxima-5.23.0\\share/gnuplot/4.4/PostScript\prologue.ps >> ? ? ? ? loadpath is empty >> Please copy prologue.ps to one of the above directories >> or set the loadpath appropriately >> or set the environmental variable GNUPLOT_PS_DIR >> ? ? ? ? ?Plot failed! >> >> >> I've found prologue.ps in this folder: >> Maxima-5.23.0/bin/share/PostScript >> >> -- >> Mario >> >> _______________________________________________ >> 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 Thu Jan 13 12:00:20 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 13 Jan 2011 11:00:20 -0700 Subject: [Maxima] Error in Gnuplot?? In-Reply-To: References: <6b87a44292cd346953093119eebf8794@localhost> <1294855607.1642.11.camel@trasno> Message-ID: OK, thanks for the info. I will tag 5.23.1 in CVS in a day or so and then you can create an updated package. (There have been some other minor fixes on the release branch if I'm not mistaken.) best Robert Dodier On 1/13/11, Andrej Vodopivec wrote: > This is a packaging problem. I will set the GNUPLOT_PS_DIR variable in > maxima.bat so that gnuplot will find prologue.ps. > > Andrej > > > > On Thu, Jan 13, 2011 at 5:21 PM, Robert Dodier > wrote: >> Is this a packaging problem of some kind? >> Who needs to solve it? -- wxMaxima, Maxima, or the user? >> >> best >> >> Robert >> >> >> On 1/12/11, Mario Rodriguez wrote: >>> El mi?, 12-01-2011 a las 14:56 +0100, Wilhelm Haager escribi?: >>>> Hi, >>>> I suppose, the new Maxima (5.23.0) contains an erroneous version of >>>> Gnuplot (version 4.4). >>>> The following command lets Gnuplot crash (at least under Windows XP): >>> >>> >>> Hello, >>> >>> It seems to be a problem specific to Windows. >>> >>> When I run (in Linux through Wine) >>> >>> Maxima-5.23.0/bin/wgnuplot.exe >>> >>> and write the following commans: >>> >>> set term postscript >>> set out "myfile" >>> plot sin (x) >>> >>> I get this output: >>> >>> >>> Can't find PostScript prologue file C:\Archivos de programa >>> \Maxima-5.23.0\\share/gnuplot/4.4/PostScript\prologue.ps >>> ? ? ? ? loadpath is empty >>> Please copy prologue.ps to one of the above directories >>> or set the loadpath appropriately >>> or set the environmental variable GNUPLOT_PS_DIR >>> ? ? ? ? ?Plot failed! >>> >>> >>> I've found prologue.ps in this folder: >>> Maxima-5.23.0/bin/share/PostScript >>> >>> -- >>> Mario >>> >>> _______________________________________________ >>> 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 mhw at netris.org Thu Jan 13 15:01:02 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 13 Jan 2011 16:01:02 -0500 Subject: [Maxima] Bugs in tex-mcond In-Reply-To: (Robert Dodier's message of "Mon, 10 Jan 2011 22:25:16 -0700") References: <877hecmlpp.fsf@yeeloong.netris.org> <4D2B931D.2000307@eecs.berkeley.edu> <871v4kmbte.fsf@yeeloong.netris.org> Message-ID: <87zkr4wmb5.fsf@yeeloong.netris.org> Here's the comment I just added above the new TEX-MCOND. Hopefully it is acceptable. Best, Mark ;; ;; The format of MCOND expressions is documented above the definition ;; of DIM-MCOND in displa.lisp. Note that MCOND expressions may ;; contain more than one non-T condition when elseif is used. This ;; was not always the case, so it's possible that some code in Maxima ;; still doesn't handle this case properly. Here are some examples: ;; ;; ((%mcond) $a $b t nil) <==> 'if a then b ;; ((%mcond) $a $b t $d) <==> 'if a then b else d ;; ((%mcond) $a $b $c nil t nil) <==> 'if a then b elseif c then false ;; ((%mcond) $a $b $c $d t nil) <==> 'if a then b elseif c then d ;; ((%mcond) $a $b $c $d t $f) <==> 'if a then b elseif c then d else f ;; ;; Also note that DIM-MCOND omits display of the final "else" in the ;; following three cases, so we do the same here: ;; ;; ((%mcond) $a $b t nil) ==> 'if a then b ;; ((%mcond) $a $b t $false) ==> 'if a then b ;; ((%mcond) $a $b) ==> 'if a then b ;; ;; The first two cases happen in practice, as can be seen by ;; evaluating ?print(if a then b) and ?print('(if a then b)). ;; I'm not sure if the third case ever actually occurs. ;; ;; The use of '$false (instead of nil) may be a hack that is no longer ;; needed. For more information on this, search for $false in ;; PARSE-CONDITION of nparse.lisp and DIM-MCOND of displa.lisp. Also ;; see the mailing list thread with subject "Bugs in tex-mcond" which ;; took place in January 2011. -MHW ;; From andrej.vodopivec at gmail.com Thu Jan 13 16:03:58 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Thu, 13 Jan 2011 23:03:58 +0100 Subject: [Maxima] Error in Gnuplot?? In-Reply-To: References: <6b87a44292cd346953093119eebf8794@localhost> <1294855607.1642.11.camel@trasno> Message-ID: I think that the issue is fixed in cvs head and on the release branch (the changes I committed are a little different from those that I used for 5.23.) Andrej On Thu, Jan 13, 2011 at 7:00 PM, Robert Dodier wrote: > OK, thanks for the info. > I will tag 5.23.1 in CVS in a day or so and then > you can create an updated package. > (There have been some other minor fixes on the release branch > if I'm not mistaken.) > > best > > Robert Dodier > > On 1/13/11, Andrej Vodopivec wrote: >> This is a packaging problem. I will set the GNUPLOT_PS_DIR variable in >> maxima.bat so that gnuplot will find prologue.ps. >> >> Andrej >> >> >> >> On Thu, Jan 13, 2011 at 5:21 PM, Robert Dodier >> wrote: >>> Is this a packaging problem of some kind? >>> Who needs to solve it? -- wxMaxima, Maxima, or the user? >>> >>> best >>> >>> Robert >>> >>> >>> On 1/12/11, Mario Rodriguez wrote: >>>> El mi?, 12-01-2011 a las 14:56 +0100, Wilhelm Haager escribi?: >>>>> Hi, >>>>> I suppose, the new Maxima (5.23.0) contains an erroneous version of >>>>> Gnuplot (version 4.4). >>>>> The following command lets Gnuplot crash (at least under Windows XP): >>>> >>>> >>>> Hello, >>>> >>>> It seems to be a problem specific to Windows. >>>> >>>> When I run (in Linux through Wine) >>>> >>>> Maxima-5.23.0/bin/wgnuplot.exe >>>> >>>> and write the following commans: >>>> >>>> set term postscript >>>> set out "myfile" >>>> plot sin (x) >>>> >>>> I get this output: >>>> >>>> >>>> Can't find PostScript prologue file C:\Archivos de programa >>>> \Maxima-5.23.0\\share/gnuplot/4.4/PostScript\prologue.ps >>>> ? ? ? ? loadpath is empty >>>> Please copy prologue.ps to one of the above directories >>>> or set the loadpath appropriately >>>> or set the environmental variable GNUPLOT_PS_DIR >>>> ? ? ? ? ?Plot failed! >>>> >>>> >>>> I've found prologue.ps in this folder: >>>> Maxima-5.23.0/bin/share/PostScript >>>> >>>> -- >>>> Mario >>>> >>>> _______________________________________________ >>>> 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 biomates at telefonica.net Thu Jan 13 17:41:31 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 14 Jan 2011 00:41:31 +0100 Subject: [Maxima] Error in Gnuplot?? In-Reply-To: References: <6b87a44292cd346953093119eebf8794@localhost> <1294855607.1642.11.camel@trasno> Message-ID: <1294962091.3550.1.camel@pc> El jue, 13-01-2011 a las 23:03 +0100, Andrej Vodopivec escribi?: > I think that the issue is fixed in cvs head and on the release branch > (the changes I committed are a little different from those that I used > for 5.23.) > > Andrej Andrej, Thanks for including version 4.4 in the Windows installer. -- Mario From jrredford at yahoo.com Thu Jan 13 23:38:04 2011 From: jrredford at yahoo.com (James Redford) Date: Thu, 13 Jan 2011 21:38:04 -0800 (PST) Subject: [Maxima] Error in Gnuplot?? Message-ID: <150019.94803.qm@web121809.mail.ne1.yahoo.com> Is this actually version 4.4 of Gnuplot? Because version 4.4.2 is out, which fixes bugs and (at least on my computer) runs faster. ########## [Maxima] Error in Gnuplot?? Mario Rodriguez biomates at telefonica.net Thu Jan 13 17:41:31 CST 2011 El jue, 13-01-2011 a las 23:03 +0100, Andrej Vodopivec escribi?: > I think that the issue is fixed in cvs head and on the release branch > (the changes I committed are a little different from those that I used > for 5.23.) > > Andrej Andrej, Thanks for including version 4.4 in the Windows installer. -- Mario From razif66 at gmail.com Fri Jan 14 01:05:00 2011 From: razif66 at gmail.com (razif razali) Date: Fri, 14 Jan 2011 15:05:00 +0800 Subject: [Maxima] how to make maxima create equation like i give in attachment In-Reply-To: References: <4D2484AC.70404@eecs.berkeley.edu> Message-ID: Thanks Macrakis, That code works, but then I define only f_n_1(0) have value, else should be zero so, the code for df[2,k] will be f[n,k] := concat('f_,n,"_",k)(s)$ df[n,k] := if n=0 then 0 else 'diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1])$ atvalue(f_4_2(s),s=0,0)$ atvalue(f_4_3(s),s=0,0)$ desolve(makelist( df[2,k],k,1,3), makelist(f[4,k],k,1,3) ); nonzero; so how can we make atvalue f_n_1 will give value f_n_1(0) while else will have 0 value. and one more problem here is, code below only true for n=1 and n=2, when we goes to n=3 the solution give "ilt" which is inverse laplace transform solution, so how to make maxima evaluate the solution without ilt? On Thu, Jan 13, 2011 at 9:19 PM, Stavros Macrakis wrote: > Should be > > f[n,k] := concat('f_,n,"_",k)(s) > > to produce a function call, not a string. So the complete solution is: > > f[n,k] := concat('f_,n,"_",k)(s)$ > df[n,k] := > if n=0 then 0 > > else 'diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1])$ > > desolve( makelist( df[2,k],k,1,3 ), makelist(f[4,k],k,1,3) ); > > Remember that f[...]:= defines a *memoizing* function, so you need to kill > f if you want to redefine it. > > -s > > > On Thu, Jan 13, 2011 at 08:08, Stavros Macrakis wrote: > >> Sorry for the bug in atvalue. >> >> You can replace the f[i,j]'s with the atomic f_i_j using subst( >> concat("f_",i,"_",j), f[i,j], ... ). Or even easier, define: >> >> f[n,k] := concat("f_",n,"_",k) >> >> and then whenever you write f[n,k], it will evaluate to f_n_k. >> >> You also need to either declare all the f_n_k's as depending on s or, >> better, write 'diff(...) instead of diff(...). >> >> -s >> >> On Thu, Jan 13, 2011 at 03:44, razif razali wrote: >> >>> Macrakis, >>> >>> Here example that I used 'desolve' for my problem, >>> -------------------------------------------------------------------- >>> eq1:diff(f(s),s)=-sqrt(2)*g(s)*k; >>> >>> eq2:diff(g(s),s)=k*(sqrt(2)*f(s)-2*h(s)); >>> >>> eq3:diff(h(s),s)=2*k*g(s); >>> >>> atvalue(f(s),s=0,f0); >>> >>> atvalue(g(s),s=0,0); >>> >>> atvalue(h(s),s=0,0); >>> >>> desolve([eq1,eq2,eq3],[f(s),g(s),h(s)]); >>> >>> nonzero; >>> --------------------------------------------------- >>> >>> I manually replace f[4,1] to f(s), f[4,2] to g(s) and f[4,3] to h(s) >>> because 'atvalue' can't accept f[4,1](s), it will give error. >>> >>> so how to make maxima automatically convert all those f[n,k] function >>> into f(s),g(s),h(s).....n(s) in code below so that I can used code above to >>> solve my problem? >>> >>> -------------------------------------- >>> depends(f,s); >>> df[n,k] := >>> if n=0 >>> then 0 >>> else >>> >>> diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); >>> eqs:makelist(df[2,k],k,1,3); >>> ----------------------------------------- >>> >>> or maybe there some way that we didn't need to replace the function but >>> make maxima solve it automatically? >>> >>> On Thu, Jan 13, 2011 at 12:41 PM, Stavros Macrakis < >>> macrakis at alum.mit.edu> wrote: >>> >>>> Razif, >>>> >>>> In Maxima, you do not assign values to derivatives etc. You write >>>> equations and can store the equations in variables or lists. >>>> >>>> Let me give an example with ordinary (not differential) equations. >>>> >>>> eq1: x = y+3$ >>>> eq2: x*5=2*y-7$ >>>> >>>> solve( [eq1, eq2], [x,y]); >>>> >>>> OR >>>> >>>> eqs: [ x = y+3, x*5=2*y-7 ]$ >>>> vars: [x,y]$ >>>> solve(eqs,vars); >>>> >>>> You can do the same thing for systems of equations using 'makelist': >>>> >>>> eqs: makelist( x[ i ] = x[ i+1 ] + x[ i-1 ] + 1, i , 1, 5 )$ >>>> solve( append([x[0]=x[8],x[3]=1],eqs), << add some extra >>>> equations >>>> makelist(x[i],i,0,8)); << list of >>>> variables >>>> >>>> I have not worked with the differential equation solvers for a long >>>> time, so I don't know whether they can solve your equations. >>>> >>>> -s >>>> >>>> >>>> >>>> >>>> On Wed, Jan 12, 2011 at 22:46, razif razali wrote: >>>> >>>>> >>>>> >>>>> On Thu, Jan 6, 2011 at 9:40 PM, Leo Butler wrote: >>>>> >>>>>> >>>>>> >>>>>> On Thu, 6 Jan 2011, razif razali wrote: >>>>>> >>>>>> < Thanks for your reply, >>>>>> < so from your guide, here what I come through, >>>>>> < ------------------ >>>>>> < df(n,k):= >>>>>> < block ([], >>>>>> < if n=0 >>>>>> < then 0 >>>>>> < else >>>>>> < >>>>>> 'diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]) >>>>>> < ); >>>>>> < makelist(df(1,k),k,1,2); >>>>>> < ------------------------ >>>>>> < I can get the equation for diff( f[2,1],s) and diff( f[2,2],s) >>>>>> respectively, >>>>>> < >>>>>> < so next thing is, how can i make diff( f[2,1],s) and diff( f[2,2]) >>>>>> hold it value?because when I type again diff( f[2,1],s) in maxima after give >>>>>> code above, it gives >>>>>> < zero. what i want do here is after i get equation diff( f[2,1],s) i >>>>>> want to solve with both equation using ode method to get function of f[2,1] >>>>>> and f[2,2] with >>>>>> < f[2*n,k](0)=A, and value of x and A are not zero... >>>>>> >>>>>> The problem is that Maxima does not know that f[n,k] is a function of >>>>>> s, too. Here is a solution: >>>>>> >>>>>> depends(f,s); >>>>>> df[n,k] := if n=0 then 0 else >>>>>> diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); >>>>>> . >>>>>> . >>>>>> . >>>>>> Note that I do not use 'diff, because the first line tells Maxima >>>>>> that f is a function of s. >>>>>> >>>>>> Leo >>>>>> -- >>>>>> The University of Edinburgh is a charitable body, registered in >>>>>> Scotland, with registration number SC005336. >>>>>> >>>>>> by telling MAXIMA that f[n,k] is function of s to helped me without >>>>> using 'diff but then it still not hold the function for next used? >>>>> the result still the same, >>>>> >>>>> depends(f,s); >>>>> df[n,k] := if n=0 then 0 else >>>>> diff(f[2*n,k],s)=x*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1]); >>>>> makelist(df[1,k],k,1,2); >>>>> >>>>> then i got the diff(f [2,1],s) and diff( f[2,2],s) >>>>> >>>>> so how to make diff(f [2,1],s) and diff( f[2,2],s) hold its function so >>>>> that I can solve it using ODE in MAXIMA?because when i type all command >>>>> above and get the result, when i type again diff( f[2,1],s) it give >>>>> nothing... >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> 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 >>> >>> >>> >>> >> > -- 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 biomates at telefonica.net Fri Jan 14 02:27:02 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 14 Jan 2011 09:27:02 +0100 Subject: [Maxima] Error in Gnuplot?? In-Reply-To: <150019.94803.qm@web121809.mail.ne1.yahoo.com> References: <150019.94803.qm@web121809.mail.ne1.yahoo.com> Message-ID: <1294993624.1614.1.camel@trasno> El jue, 13-01-2011 a las 21:38 -0800, James Redford escribi?: > Is this actually version 4.4 of Gnuplot? Because version 4.4.2 is out, which fixes bugs and (at least on my computer) runs faster. Yes, in fact it's 4.4 patchlevel 2. -- Mario From dbmaxima at gmail.com Fri Jan 14 02:37:20 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Fri, 14 Jan 2011 19:37:20 +1100 Subject: [Maxima] Error in Gnuplot?? In-Reply-To: References: <6b87a44292cd346953093119eebf8794@localhost> <1294855607.1642.11.camel@trasno> Message-ID: <4D300B40.6080707@gmail.com> On 14/01/2011 4:16 AM, Andrej Vodopivec wrote: > This is a packaging problem. I will set the GNUPLOT_PS_DIR variable in > maxima.bat so that gnuplot will find prologue.ps. > > Andrej > Alternatively (or additionally) modify maxima/interfaces/xmaxima/win32/Makefile.in so that prologue.ps is copied into the place that gnuplot looks by default. From jrredford at yahoo.com Fri Jan 14 02:51:57 2011 From: jrredford at yahoo.com (James Redford) Date: Fri, 14 Jan 2011 00:51:57 -0800 (PST) Subject: [Maxima] Error in Gnuplot?? In-Reply-To: <1294993624.1614.1.camel@trasno> Message-ID: <429019.1237.qm@web121802.mail.ne1.yahoo.com> --- On Fri, 1/14/11, Mario Rodriguez wrote: > From: Mario Rodriguez > Subject: Re: [Maxima] Error in Gnuplot?? > To: "James Redford" > Cc: maxima at math.utexas.edu > Date: Friday, January 14, 2011, 2:27 AM > El jue, 13-01-2011 a las 21:38 -0800, > James Redford escribi?: > > Is this actually version 4.4 of Gnuplot? Because > version 4.4.2 is out, which fixes bugs and (at least on my > computer) runs faster. > > Yes, in fact it's 4.4 patchlevel 2. > > -- > Mario That's great. Thanks for telling me, Mario. Thanks for including it, Andrej. From feexcore at hotmail.com Fri Jan 14 10:00:11 2011 From: feexcore at hotmail.com (Fee Verheire) Date: Fri, 14 Jan 2011 17:00:11 +0100 Subject: [Maxima] FACTOR Message-ID: Dear, I have a question about the math-software Maxima. I'm writing a book about RSA cryptography. For this, I often use Maxima to make calculations. Now I have a question, the algoritme Maxima uses to factorise big numbers (commando: FACTOR(..)), is it based on the method of Fermat? I hope you will respond to this. Yours sicerely Fee Verheire -------------- next part -------------- An HTML attachment was scrubbed... URL: From ziga.lenarcic at gmail.com Fri Jan 14 10:11:36 2011 From: ziga.lenarcic at gmail.com (=?UTF-8?B?xb1pZ2EgTGVuYXLEjWnEjQ==?=) Date: Fri, 14 Jan 2011 17:11:36 +0100 Subject: [Maxima] building maxima.app for OS X Message-ID: No, I used to prepare these Maxima.app-s. The way you do it: Compile maxima with sbcl with configure & make. Then 'make install' with DESTDIR or something like this into a folder on your drive.. Then you open up previous Maxima.app and switch the old maxima with the new one (share dir and other things). Then perhaps correct the version in plist... also Maxima.app uses a modified 'maxima' script in /bin/ which you shouldn't overwrite... If you understand compiling, you should know how to do it. Also if you plan to distribute it you should use 32 bit version of sbcl -- for that you have to change some flag in the sbcl compilation process .. It's easy but there are some gotchas. Regards Ziga Lenarcic From infor.john at gmail.com Fri Jan 14 12:54:59 2011 From: infor.john at gmail.com (John Lenon) Date: Fri, 14 Jan 2011 16:54:59 -0200 Subject: [Maxima] How to contribute to project Message-ID: <4D309C03.5090504@gmail.com> Hi there, I am new at this mailing list, and I have a question : I developed an algorithm using Maxima to solve nonlinear least squares problem in my undergraduate research. I would like to know how can I publish this algoritm as a contribution for Maxima project, can I do this? Thanks in advance, John. From talon at lpthe.jussieu.fr Fri Jan 14 15:00:37 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 14 Jan 2011 22:00:37 +0100 Subject: [Maxima] 4th order DE References: <4D264A21.8050202@civil.aau.dk> <4D264D51.5020909@eecs.berkeley.edu> <4D265264.9090606@civil.aau.dk> <4D271934.2@civil.aau.dk> Message-ID: Esben Byskov wrote: > *Many thanks to Barton Willis, > > In this case determining the constants from the boundary > conditions takes some effort. The way both Maple and > MuPAD (I gather that Mathematica does it in a similar > way) handle my problem seems easier. > > It is somewhat surprising that, given the fact that maxima > has been around for so many more years than the other > programs, it does not have a similar feature. > > Best regards, > > Esben Byskov > In fact you can use colnew in maxima, which is able to solve (numerically) such problems and much more complicated ones (non linear, with many boundary conditions,etc.) Thanks to Raymond Toy colnew is included in maxima with a basic wrapper. I am always hoping to provide a simpler to use wrapper, but for the moment slowly learning lisp in my free time..... -- Michel Talon From talon at lpthe.jussieu.fr Fri Jan 14 16:03:07 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 14 Jan 2011 23:03:07 +0100 Subject: [Maxima] Maxima by Example: Ch. 12 update References: <0E4A8A71B4EB41F4A126B0211D887E77@edwinc367e16bd> Message-ID: Edwin Woollett wrote: > Maxima by Example, Ch. 12, Dirac Algebra > and Quantum Electrodynamics update Jan. 10, 2011. Hi, Edwin i have just looked at your manuals, and noted a problem i remarked recently, that you may have not noted in your Chapter 9, use of bfallroots. The problem is that if you feed a polynomial with bfloat coefficients (*) to bfallroots, to get the solution, the first thing it does is to convert all coeffs to rats, and does that with small precision (something like eight digits), so you can set fpprec=30 as much as you want the solutions are not correct to more than 7 digits. The solution is to also set ratepsilon=30 before beginning the computation, then you get roots correct to around 30 figures. If this appears somewhere on your paper i have not seen, please excuse my post. By the way, your Chapter 12 is really magnificent. (*) the example i had was with finding roots for a Bethe ansatz, the polynomials really has coefficients with a lot of digits, there are huge order of magnitudes between coeffs, still bfallroots finds correct results -- Michel Talon From toy.raymond at gmail.com Fri Jan 14 16:12:57 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 14 Jan 2011 17:12:57 -0500 Subject: [Maxima] 4th order DE In-Reply-To: References: <4D264A21.8050202@civil.aau.dk> <4D264D51.5020909@eecs.berkeley.edu> <4D265264.9090606@civil.aau.dk> <4D271934.2@civil.aau.dk> Message-ID: <4D30CA69.3070404@gmail.com> On 1/14/11 4:00 PM, Michel Talon wrote: > Esben Byskov wrote: > >> *Many thanks to Barton Willis, >> >> In this case determining the constants from the boundary >> conditions takes some effort. The way both Maple and >> MuPAD (I gather that Mathematica does it in a similar >> way) handle my problem seems easier. >> >> It is somewhat surprising that, given the fact that maxima >> has been around for so many more years than the other >> programs, it does not have a similar feature. >> >> Best regards, >> >> Esben Byskov >> > In fact you can use colnew in maxima, which is able to solve (numerically) > such problems and much more complicated ones (non linear, with many boundary > conditions,etc.) Thanks to Raymond Toy colnew is included in maxima with a > basic wrapper. I am always hoping to provide a simpler to use wrapper, but > for the moment slowly learning lisp in my free time..... > I don't think you have to learn lisp to make a simpler wrapper. You should be able to do it in maxima, talking to the rudimentary interface that's already there. If that interface doesn't have the features you want, let me know, and I'll make it available. (I actually like that approach. The direct lisp interface can be crude, but simple to write in lisp, and have the nice user interface in maxima. Then the user can get nice error messages and such from maxima instead of some random Lisp error message.) Ray From talon at lpthe.jussieu.fr Fri Jan 14 16:18:13 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 14 Jan 2011 23:18:13 +0100 Subject: [Maxima] Are these both the right answer for the integral? References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> Message-ID: Richard Hennessy wrote: > Hi List, Hi, Richard sorry to hijack this thread but sometimes ago you asked how to interact with maxima programmatically through a socket. If you don't have the solution i have found one today, after having tried "maxima -s" which doesn't work (namely this redirects output to the socket but leaves input on standard input). The thing which works is: First you open a listening socket, for example with netcat nc -l 8888 Then you connect maxima to the socket in the following way: maxima -r ":lisp (setup-client 8888)" Here you execute the function setup-client defined in server.lisp which connects to port 8888. Then everything is redirected to the socket. You can easily replace netcat by a program which parses maxima output, or feeds maxima input the way you want. -- Michel Talon From talon at lpthe.jussieu.fr Fri Jan 14 16:21:15 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 14 Jan 2011 23:21:15 +0100 Subject: [Maxima] 4th order DE References: <4D264A21.8050202@civil.aau.dk> <4D264D51.5020909@eecs.berkeley.edu> <4D265264.9090606@civil.aau.dk> <4D271934.2@civil.aau.dk> <4D30CA69.3070404@gmail.com> Message-ID: Raymond Toy wrote: > I don't think you have to learn lisp to make a simpler wrapper. Well it's also a challenge for me, i must say i am becoming fascinated by lisp. -- Michel Talon From rich.hennessy at verizon.net Fri Jan 14 19:07:39 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 14 Jan 2011 20:07:39 -0500 Subject: [Maxima] Are these both the right answer for the integral? In-Reply-To: References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> Message-ID: <30F348AEB9934EE5A9BE59CB66EEED86@RichsLaptop> I have had no luck with this so far, so I will try it your way. Thanks, Rich -----Original Message----- From: Michel Talon Sent: Friday, January 14, 2011 5:18 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] Are these both the right answer for the integral? Richard Hennessy wrote: > Hi List, Hi, Richard sorry to hijack this thread but sometimes ago you asked how to interact with maxima programmatically through a socket. If you don't have the solution i have found one today, after having tried "maxima -s" which doesn't work (namely this redirects output to the socket but leaves input on standard input). The thing which works is: First you open a listening socket, for example with netcat nc -l 8888 Then you connect maxima to the socket in the following way: maxima -r ":lisp (setup-client 8888)" Here you execute the function setup-client defined in server.lisp which connects to port 8888. Then everything is redirected to the socket. You can easily replace netcat by a program which parses maxima output, or feeds maxima input the way you want. -- Michel Talon _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From yhonda at mac.com Sat Jan 15 06:32:17 2011 From: yhonda at mac.com (Yasuaki Honda) Date: Sat, 15 Jan 2011 21:32:17 +0900 Subject: [Maxima] imaxima installation update Message-ID: Dear imaxima users, Due to the update of the MH latex package (now breqn.sty is part of MH), you may need to install additional latex package named expl3.tds.zip. The link to the file is: http://mirror.ctan.org/install/macros/latex/contrib/expl3.tds.zip The installation procedure of the file on your system depends on the latex system on your computer. You may find necessary information on the imaxima web site at: https://sites.google.com/site/imaximaimath/ Specific installation notes for the following operating systems are provided in the installation pages. Windows Vista/XP, Mac OS X, Fedora 14, Debian Squeeze, and Ubuntu 10.10. Also, the generic procedure for the Linux/Unix like systems is provided. For those who do not familiar with imaxima, please visit above link, and also http://zetafunction.blogspot.com/ to see the imaxima example sessions. Yasuaki Honda -------------- next part -------------- An HTML attachment was scrubbed... URL: From igryabinkin at gmail.com Sat Jan 15 07:56:12 2011 From: igryabinkin at gmail.com (Ilya Ryabinkin) Date: Sat, 15 Jan 2011 08:56:12 -0500 Subject: [Maxima] Completion in maxima-mode (emacs) is broken in Ubuntu 10.04 Message-ID: Colleagues, I'm using maxima-mode in emacs in Ubuntu 10.04. The problem is that completion (bound to Esc-Tab) is broken. For instance, when I write intergrat in a text buffer and press , I get the following message in minibuffer: comint-dynamic-simple-complete: Wrong number of arguments: #[(completions) "??!? ?\" =?_ (this is not the end of the message, but I cannot even copy the whole one) So, what's wrong and how I can solve this? Sincerely, Ilya From igryabinkin at gmail.com Sat Jan 15 08:00:30 2011 From: igryabinkin at gmail.com (Ilya Ryabinkin) Date: Sat, 15 Jan 2011 09:00:30 -0500 Subject: [Maxima] Completion in maxima-mode (emacs) is broken in Ubuntu 10.04 In-Reply-To: References: Message-ID: Sorry, I found the resolution: http://bugs.gentoo.org/307349 In a couple of word, the problem is with incorrect cheching for a version of emacs, which is broken for Emacs 23.1 Anyways, It would be useful for any maxima users Cheers, Ilya On Sat, Jan 15, 2011 at 8:56 AM, Ilya Ryabinkin wrote: > Colleagues, > I'm using maxima-mode in emacs in Ubuntu 10.04. The problem is that > completion (bound to Esc-Tab) is broken. For instance, when I write > > intergrat > > in a text buffer and press , I get the following message in minibuffer: > > comint-dynamic-simple-complete: Wrong number of arguments: > #[(completions) "??! ? ??\" > ?=?_ > > (this is not the end of the message, but I cannot even copy the whole one) > > So, what's wrong and how I can solve this? > > Sincerely, > Ilya > From robert.dodier at gmail.com Sat Jan 15 11:31:11 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 15 Jan 2011 10:31:11 -0700 Subject: [Maxima] Maxima 5.23.1 tagged Message-ID: Hi, I've tagged version-5_23_1 in CVS and uploaded rpms and tar.gz to the Sourceforge file manager. Should be able to find them there now: http://sourceforge.net/projects/maxima/files/ If someone can create a Windows installer, that would be great. If there aren't any problems (well, any new problems, at least) then I'll make a general announcement about this release. Sorry that it seems to have taken us longer than usual to get to this point. Oh well, that's the way the cookie crumbles. best Robert Dodier From woollett at charter.net Sat Jan 15 12:43:51 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 15 Jan 2011 10:43:51 -0800 Subject: [Maxima] Maxima by Example: Ch. 12 update Message-ID: <36526E0E2C8241348850A36668CC96E7@edwinc367e16bd> On Jan. 14, 2011, Michel Talon wrote: --------------------------------------------------- >>i have just looked at your manuals, and noted a problem i remarked >>recently, that you may have not noted in your Chapter 9, use of bfallroots. The problem is that if you feed a polynomial with bfloat coefficients (*) to bfallroots, to get the solution, the first thing it does is to convert all coeffs to rats, and does that with small precision (something like eight digits), so you can set fpprec=30 as much as you want the solutions are not correct to more than 7 digits. The solution is to also set ratepsilon=30 before beginning the computation, then you get roots correct to around 30 figures. If this appears somewhere on your paper i have not seen, please excuse my post. --------------------------------------------------------------------- Thanks for the information about the behavior of bfallroots. I really dropped the ball on that section, and will need to revise Ch. 9 with another look at that function. -------------------------------------------- >> the example i had was with finding roots for a Bethe ansatz, the polynomials really has coefficients with a lot of digits, there are huge order of magnitudes between coeffs, still bfallroots finds correct results ----------------------------------------------------- Perhaps you could send me a version of that example for possible inclusion in the next revision of Ch. 9. Thanks again, Ted (aka Edwin) From rich.hennessy at verizon.net Sat Jan 15 17:08:50 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sat, 15 Jan 2011 18:08:50 -0500 Subject: [Maxima] Are these both the right answer for the integral? In-Reply-To: <30F348AEB9934EE5A9BE59CB66EEED86@RichsLaptop> References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> <30F348AEB9934EE5A9BE59CB66EEED86@RichsLaptop> Message-ID: Yes, this way works but I would be happier if it was a feature of Maxima that makes this possible, not my code. That way I would not have to keep up with changes to Maxima's way of returning output to the server. Sometimes the output is a error message, sometimes a question, sometimes the output is too large for the buffer. It is a lot of work, which if I were to do it, would be based on trial and error. The way to connect to a Maxima server should be a feature of Maxima with documentation etc . . . Rich -----Original Message----- From: Richard Hennessy Sent: Friday, January 14, 2011 8:07 PM To: Michel Talon ; maxima at math.utexas.edu Subject: Re: [Maxima] Are these both the right answer for the integral? I have had no luck with this so far, so I will try it your way. Thanks, Rich -----Original Message----- From: Michel Talon Sent: Friday, January 14, 2011 5:18 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] Are these both the right answer for the integral? Richard Hennessy wrote: > Hi List, Hi, Richard sorry to hijack this thread but sometimes ago you asked how to interact with maxima programmatically through a socket. If you don't have the solution i have found one today, after having tried "maxima -s" which doesn't work (namely this redirects output to the socket but leaves input on standard input). The thing which works is: First you open a listening socket, for example with netcat nc -l 8888 Then you connect maxima to the socket in the following way: maxima -r ":lisp (setup-client 8888)" Here you execute the function setup-client defined in server.lisp which connects to port 8888. Then everything is redirected to the socket. You can easily replace netcat by a program which parses maxima output, or feeds maxima input the way you want. -- Michel Talon _______________________________________________ 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 Sat Jan 15 17:26:24 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sat, 15 Jan 2011 18:26:24 -0500 Subject: [Maxima] Are these both the right answer for the integral? In-Reply-To: References: <5AC2BBEC7C31447DB75F6FF2B2AB0441@RichsLaptop> <30F348AEB9934EE5A9BE59CB66EEED86@RichsLaptop> Message-ID: <104BF265C034425CBAADE8564E695244@RichsLaptop> What I have discovered is that the first thing to do is set display2d to false, which messes up a session if a program changes it to true. There are a lot a possible scenario's to consider. -----Original Message----- From: Richard Hennessy Sent: Saturday, January 15, 2011 6:08 PM To: Michel Talon ; maxima at math.utexas.edu Subject: Re: [Maxima] Are these both the right answer for the integral? Yes, this way works but I would be happier if it was a feature of Maxima that makes this possible, not my code. That way I would not have to keep up with changes to Maxima's way of returning output to the server. Sometimes the output is a error message, sometimes a question, sometimes the output is too large for the buffer. It is a lot of work, which if I were to do it, would be based on trial and error. The way to connect to a Maxima server should be a feature of Maxima with documentation etc . . . Rich -----Original Message----- From: Richard Hennessy Sent: Friday, January 14, 2011 8:07 PM To: Michel Talon ; maxima at math.utexas.edu Subject: Re: [Maxima] Are these both the right answer for the integral? I have had no luck with this so far, so I will try it your way. Thanks, Rich -----Original Message----- From: Michel Talon Sent: Friday, January 14, 2011 5:18 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] Are these both the right answer for the integral? Richard Hennessy wrote: > Hi List, Hi, Richard sorry to hijack this thread but sometimes ago you asked how to interact with maxima programmatically through a socket. If you don't have the solution i have found one today, after having tried "maxima -s" which doesn't work (namely this redirects output to the socket but leaves input on standard input). The thing which works is: First you open a listening socket, for example with netcat nc -l 8888 Then you connect maxima to the socket in the following way: maxima -r ":lisp (setup-client 8888)" Here you execute the function setup-client defined in server.lisp which connects to port 8888. Then everything is redirected to the socket. You can easily replace netcat by a program which parses maxima output, or feeds maxima input the way you want. -- Michel Talon _______________________________________________ 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 toy.raymond at gmail.com Sat Jan 15 18:49:43 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 15 Jan 2011 19:49:43 -0500 Subject: [Maxima] Maxima by Example: Ch. 12 update In-Reply-To: References: <0E4A8A71B4EB41F4A126B0211D887E77@edwinc367e16bd> Message-ID: On Fri, Jan 14, 2011 at 5:03 PM, Michel Talon wrote: > Edwin Woollett wrote: > > > Maxima by Example, Ch. 12, Dirac Algebra > > and Quantum Electrodynamics update Jan. 10, 2011. > > Hi, Edwin > > i have just looked at your manuals, and noted a problem i remarked > recently, > that you may have not noted in your Chapter 9, use of bfallroots. > > The problem is that if you feed a polynomial with bfloat coefficients (*) > to bfallroots, to get the solution, the first thing it does is to convert > all coeffs to rats, and does that with small precision (something like > eight digits), so you can set fpprec=30 as much as you want the solutions > are not correct to more than 7 digits. > > Oops. I guess that's also a bug in allroots. I think allroots and bfallroots should bind ratepsilon to the same precision of fpprec. Or maybe not rat the polynomial at all. Don't know if you do this, but if you define your bfloat polynomial with a value of fpprec, and then change it to a different value before calling bfallroots, the accuracy might be a bit different from what you expected because the original coefficients have the original fpprec precision. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhw at netris.org Sun Jan 16 09:36:59 2011 From: mhw at netris.org (Mark H Weaver) Date: Sun, 16 Jan 2011 10:36:59 -0500 Subject: [Maxima] Maxima 5.23.1 tagged In-Reply-To: (Robert Dodier's message of "Sat, 15 Jan 2011 10:31:11 -0700") References: Message-ID: <87mxn0x3l0.fsf@yeeloong.netris.org> To those who create the Windows and MacOS X installers: I would be grateful if you could make sure that GNUPLOT 4.4 includes support for the pngcairo terminal. It would enable the draw package to create much more beautiful anti-aliased inline plots in wxMaxima after setting draw_use_pngcairo:true; You could test the resulting package by typing the following commands in wxMaxima: draw_use_pngcairo:true; /* This could be added to maxima-init.mac */ load(drawdf); wxdrawdf(x^2-y^2, [x,-2,2], [y,-2,2]); Thanks! Mark Robert Dodier writes: > Hi, I've tagged version-5_23_1 in CVS and uploaded rpms > and tar.gz to the Sourceforge file manager. > Should be able to find them there now: > http://sourceforge.net/projects/maxima/files/ > > If someone can create a Windows installer, that would be great. > > If there aren't any problems (well, any new problems, at least) > then I'll make a general announcement about this release. > > Sorry that it seems to have taken us longer than usual > to get to this point. Oh well, that's the way the cookie crumbles. > > best > > Robert Dodier From A.G.Grozin at inp.nsk.su Sun Jan 16 10:15:21 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Sun, 16 Jan 2011 22:15:21 +0600 (NOVT) Subject: [Maxima] Maxima 5.23.1 tagged In-Reply-To: References: Message-ID: I've just committed maxima-5.23.1.ebuild to Gentoo Linux. Test results with various lisps on my Pentium E5300 box (real time, in seconds): sbcl-1.0.45 165 (*) cmucl-20b 172 gcl-2.6.8_pre 172 clozurecl-1.6 322 ecl-10.4.1 371 (**) (***) clisp-2.49 552 Test failures: (*) rtest16 385 (error ~3E-9 instead of E-15) (**) rtest16 384 385 (errors ~3E-9 instead of E-15) (***) rtest8 126 127 (find_root not evaluated) I hard that these failures in rtest8 in ecl are already fixed. ecl-11.1 will appear within a few days. Then I'll give an update. Andrey From l.butler at ed.ac.uk Sun Jan 16 10:23:34 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sun, 16 Jan 2011 16:23:34 +0000 (GMT) Subject: [Maxima] Completion in maxima-mode (emacs) is broken in Ubuntu 10.04 In-Reply-To: References: Message-ID: On Sat, 15 Jan 2011, Ilya Ryabinkin wrote: < Sorry, I found the resolution: < < http://bugs.gentoo.org/307349 < < In a couple of word, the problem is with incorrect cheching for a < version of emacs, which is broken for Emacs 23.1 < < Anyways, It would be useful for any maxima users < < Cheers, < Ilya Thank you for the report. The patched maxima.el is available as v1.63 from cvs. See also https://sourceforge.net/tracker/index.php?func=detail&aid=2808179&group_id=4933&atid=104933 Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From mch.heidinger at gmx.de Sun Jan 16 11:29:32 2011 From: mch.heidinger at gmx.de (Michael Heidinger) Date: Sun, 16 Jan 2011 18:29:32 +0100 Subject: [Maxima] Plot2d-Question: How to plot 2 changing functions economically Message-ID: <4D332AFC.10101@gmx.de> Hello, first of all, i'm new to this mailing list - Please excuse my language, as it's not my first. Well, I want to simulate an electrical circuit, which has two operation condition, each of them is discribed with a diffential equation. After a certain time i want to switch to the other equation. 1. Equation: 'diff(I,t)=(U-R*I)/L (eg. 1 second in this operating mode=t_equation1) 2. Equation: 'diff(I,t)=-(R*I+U)/L (eg. 2 second in this operation mode=t_equation2) Well, I solved them with ode2 and ic1 for some certain points. Eg: t=0 and I=0. But I want to plot I for a longer periode to see how I develops. I would wish myself a function where I can plot a continous flow of current. The function I would wish should look like I(U,R,L,t,t_equation1,t_equation2). Dear experts, how can I construct such a function? Thank you in advance for your help! Michael Heidinger From willisb at unk.edu Sun Jan 16 11:45:11 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 16 Jan 2011 11:45:11 -0600 Subject: [Maxima] How to contribute to project Message-ID: Maybe you could make your Maxima code and an article describing your algorithm available on a public server. That would allow the Maxima community to test your code and compare it to what we have already. Although I know nothing about our phpbb service, maybe you could upload your documents to http://sourceforge.net/apps/phpbb/maxima/. I think it would be especially important to include an article that explains how your method works. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >I?am?new?at?this?mailing?list,?and?I?have?a?question?:?I?developed?an? >algorithm?using?Maxima?to?solve?nonlinear?least?squares?problem?in?my? >undergraduate?research. >I?would?like?to?know?how?can?I?publish?this?algoritm?as?a?contribution? >for?Maxima?project,?can?I?do?this? > >Thanks?in?advance, >John. From andrej.vodopivec at gmail.com Sun Jan 16 14:41:41 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Sun, 16 Jan 2011 21:41:41 +0100 Subject: [Maxima] Maxima 5.23.1 tagged In-Reply-To: References: Message-ID: I uploaded a windows binary. The tarball still does not include grcommon.lisp. This time it is not included in the windows binary (I didn't notice it in time). pngcairo terminal works on windows but it is very slow on my computer. Saving plots to eps files should also work for plot and draw functions. Andrej On Sat, Jan 15, 2011 at 6:31 PM, Robert Dodier wrote: > Hi, I've tagged version-5_23_1 in CVS and uploaded rpms > and tar.gz to the Sourceforge file manager. > Should be able to find them there now: > http://sourceforge.net/projects/maxima/files/ > > If someone can create a Windows installer, that would be great. > > If there aren't any problems (well, any new problems, at least) > then I'll make a general announcement about this release. > > Sorry that it seems to have taken us longer than usual > to get to this point. Oh well, that's the way the cookie crumbles. > > best > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From rich.hennessy at verizon.net Sun Jan 16 16:29:00 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 16 Jan 2011 17:29:00 -0500 Subject: [Maxima] Plot2d-Question: How to plot 2 changing functions economically In-Reply-To: <4D332AFC.10101@gmx.de> References: <4D332AFC.10101@gmx.de> Message-ID: <786AACD6780848C5B4DA0D1ED01B29CC@RichsLaptop> Try this, it is not very efficient but it is what you asked for. eq1: 'diff(I,t)=(U-R*I)/L; eq2: 'diff(I,t)=-(R*I+U)/L; F(_t, _t0,_R,_L,_U,_eq1,_eq2):=block ( [_e1,_e2,_e3,_e4], _e1:ode2(_eq1,I,t), _e2:ic1(_e1, t=0, I=0), _e3:ode2(_eq2,I,t), _e4:ic1(_e3, t=_t0, I=rhs(_e2)), at(if t < _t0 then rhs(_e2) else rhs(_e4),[t=_t,R=_R,L=_L,U=_U]) )$ plot2d([F(t,4,2,6,3,eq1,eq2)],[t,0,14]); -----Original Message----- From: Michael Heidinger Sent: Sunday, January 16, 2011 12:29 PM To: maxima at math.utexas.edu Subject: [Maxima] Plot2d-Question: How to plot 2 changing functions economically Hello, first of all, i'm new to this mailing list - Please excuse my language, as it's not my first. Well, I want to simulate an electrical circuit, which has two operation condition, each of them is discribed with a diffential equation. After a certain time i want to switch to the other equation. 1. Equation: 'diff(I,t)=(U-R*I)/L (eg. 1 second in this operating mode=t_equation1) 2. Equation: 'diff(I,t)=-(R*I+U)/L (eg. 2 second in this operation mode=t_equation2) Well, I solved them with ode2 and ic1 for some certain points. Eg: t=0 and I=0. But I want to plot I for a longer periode to see how I develops. I would wish myself a function where I can plot a continous flow of current. The function I would wish should look like I(U,R,L,t,t_equation1,t_equation2). Dear experts, how can I construct such a function? Thank you in advance for your help! Michael Heidinger _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From razif66 at gmail.com Mon Jan 17 07:09:41 2011 From: razif66 at gmail.com (razif razali) Date: Mon, 17 Jan 2011 21:09:41 +0800 Subject: [Maxima] how to solve this differential equation Message-ID: Dear all, I got problem to solve this differential equation, hope some one can help me on this here my code problem and maxima code ------------------------------ eq1:diff(f(s),s)=-sqrt(3)*g(s)*k$ eq2:diff(g(s),s)=k*(sqrt(3)*f(s)-2^(3/2)*h(s))$ eq3:diff(h(s),s)=k*(2^(2/3)*g(s)-3*l(s))$ eq4:diff(l(s),s)=3*k*h(s)$ atvalue(f(s),s=0,f610)$ atvalue(g(s),s=0,0)$ atvalue(h(s),s=0,1/2*sqrt(3)*k*f610/sqrt(2))$ atvalue(l(s),s=0,0)$ desolve([eq1,eq2,eq3,eq4],[f(s),g(s),h(s),l(s)]); ------------------------------------ but then I get result with ilt solution and I assume that maxima failed to give me the correct answer, so I try to use ode2 command, I sort the eq1 and eq3 manually(can we do using maxima?), and I get below equation eqn1:'diff(f,s,2)+3*x^2*f=2*sqrt(2)*sqrt(3)*g; eqn3:'diff(g,s,2)+17*x^2*g=2*sqrt(2)*sqrt(3)*f; so I give ode2 command for both equation, x is nonzero, eqn2:ode2(eqn1,f,s); eqn4:ode2(eqn3,g,s); maxima give me some pretty result I think, but how to combine both equation and give ic1 or ic2 command to both result because both of them dependent on each other. can someone help me on this i try to get all solution for f(s),g(s),h(s) and l(s), thanks a lot -------------- next part -------------- An HTML attachment was scrubbed... URL: From A.G.Grozin at inp.nsk.su Mon Jan 17 09:49:47 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Mon, 17 Jan 2011 21:49:47 +0600 (NOVT) Subject: [Maxima] Maxima 5.23.1 tagged In-Reply-To: References: Message-ID: On Sun, 16 Jan 2011, Andrey G. Grozin wrote: > sbcl-1.0.45 165 (*) > cmucl-20b 172 > gcl-2.6.8_pre 172 > clozurecl-1.6 322 > ecl-10.4.1 371 (**) (***) ecl-11.1.1 344 (***) > clisp-2.49 552 So, ecl became faster, and errors in rtest16 (insufficient precision in some floating-point operations) disappeared. Failures in rtest8 remained. > (*) rtest16 385 (error ~3E-9 instead of E-15) > (**) rtest16 384 385 (errors ~3E-9 instead of E-15) > (***) rtest8 126 127 (find_root not evaluated) Andrey From robert.dodier at gmail.com Mon Jan 17 11:01:26 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 17 Jan 2011 10:01:26 -0700 Subject: [Maxima] Maxima 5.23.2 tagged Message-ID: I've tagged version-5_23_2 in CVS and uploaded rpms and source code to Sourceforge. These packages now include grcommon.lisp and drawdf.mac. I updated src/sharefiles.mk and committed it to the 5.23 release branch. I later figured out that sharefiles.mk needs to be on the EXTRA_DIST list in src/Makefile.am; I committed that to the main trunk. I hope we have the packaging problems straightened out now ... best Robert Dodier From mch.heidinger at gmx.de Mon Jan 17 12:45:01 2011 From: mch.heidinger at gmx.de (Michael Heidinger) Date: Mon, 17 Jan 2011 19:45:01 +0100 Subject: [Maxima] Plot2d-Question: How to plot 2 changing functions economically In-Reply-To: <786AACD6780848C5B4DA0D1ED01B29CC@RichsLaptop> References: <4D332AFC.10101@gmx.de> <786AACD6780848C5B4DA0D1ED01B29CC@RichsLaptop> Message-ID: <4D348E2D.1090708@gmx.de> Thank you very much, that looks great! Thanks! But I'm afraid i was not precious: I want to stay in eq1 for x seconds, than switch over to eq2, stay there y seconds, and then switch over to eq1 and stay there x seconds, and so on. I think you understand what I mean. How can I get this? (I think this might be a little bite more complicated...) Can you please help me! Michael On 01/16/2011 11:29 PM, Richard Hennessy wrote: > Try this, it is not very efficient but it is what you asked for. > > eq1: 'diff(I,t)=(U-R*I)/L; > eq2: 'diff(I,t)=-(R*I+U)/L; > > F(_t, _t0,_R,_L,_U,_eq1,_eq2):=block > ( > [_e1,_e2,_e3,_e4], > _e1:ode2(_eq1,I,t), > _e2:ic1(_e1, t=0, I=0), > _e3:ode2(_eq2,I,t), > _e4:ic1(_e3, t=_t0, I=rhs(_e2)), > at(if t < _t0 then rhs(_e2) else rhs(_e4),[t=_t,R=_R,L=_L,U=_U]) > )$ > > plot2d([F(t,4,2,6,3,eq1,eq2)],[t,0,14]); > > > -----Original Message----- From: Michael Heidinger > Sent: Sunday, January 16, 2011 12:29 PM > To: maxima at math.utexas.edu > Subject: [Maxima] Plot2d-Question: How to plot 2 changing functions > economically > > Hello, > first of all, i'm new to this mailing list - Please excuse my language, > as it's not my first. > > Well, I want to simulate an electrical circuit, which has two operation > condition, each of them is discribed with a diffential equation. After a > certain time i want to switch to the other equation. > 1. Equation: 'diff(I,t)=(U-R*I)/L (eg. 1 second in this operating > mode=t_equation1) > 2. Equation: 'diff(I,t)=-(R*I+U)/L (eg. 2 second in this operation > mode=t_equation2) > Well, I solved them with ode2 and ic1 for some certain points. Eg: t=0 > and I=0. But I want to plot I for a longer periode to see how I > develops. I would wish myself a function where I can plot a continous > flow of current. > The function I would wish should look like > I(U,R,L,t,t_equation1,t_equation2). > > Dear experts, how can I construct such a function? Thank you in advance > for your help! > Michael Heidinger > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From willisb at unk.edu Mon Jan 17 16:45:38 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 17 Jan 2011 16:45:38 -0600 Subject: [Maxima] how to solve this differential equation Message-ID: (0) The following solves your DEs. Algorithmically, the method is identical to the Laplace transform. The final part of the calculation (the stuff involving zip) is a check (always check your work). (1) After finding the solution, you may need to use untellrat. (2) The nullspace function and the tellrat mechanism work together (I think), but it's an undocumented feature of nullspace (there is an example of using tellrat together with nullspace). (3) Maybe you would like to generalize this method and write a solver for constant coefficient linear DEs that is better than desolve. If I were to do this, I might not use tellrat--I'm not sure that I trust tellrat to work correctly with linsolve. (4) The matrix_exp function can't solve this problem--after generating algebraic expressions for the eigenvalues, the calculation is unable to finish. There are other matrix exponential functions in Maxima that might work. I didn't try them. (5) It might be helpful to the Maxima list if we knew something about why you are solving these particular equations. (6) If you need an explanation of the method used here, I suggest that you work the homework questions in the first Chapter of "Perturbation Theory for Linear Operators," by Tosio Kato. /*---start--*/ deqs : [diff(f(s),s)=-sqrt(3)*g(s)*k, ?? ? ? diff(g(s),s)=k*(sqrt(3)*f(s)-2^(3/2)*h(s)), ?? ? ? diff(h(s),s)=k*(2^(2/3)*g(s)-3*l(s)), ?? ? ? diff(l(s),s)=3*k*h(s)]; deqs : map(lambda([s], rhs(s)-lhs(s)),deqs); algebraic : true$ deqs, f(s) : pf * exp(z*s), g(s) := pg ?* exp(z*s), ?h(s) := ph ?* exp(z*s), ?l(s) := pl ?* exp(z*s),diff$ eqs : ratexpand(%/exp(s*z)); m : coefmatrix(eqs,[pf, pg, ph, pl]); eigen_cond : ratexpand(determinant(m)); eigen_cond : first(solve(eigen_cond,z^4)); tellrat(eigen_cond); nullspace(m); cl : first(%); rreduce('addcol, makelist(subst(z = concat(z,i) , cl) * exp(concat(z,i)*t),i,1,4)); smat : % . matrix([f610],[0],[1/2*sqrt(3)*k*f610/sqrt(2)],[0]); f(t) := ''(part(smat,1,1)); g(t) := ''(part(smat,2,1)); h(t) := ''(part(smat,3,1)); l(t) := ''(part(smat,4,1)); zip : ev(deqs,diff,ratexpand); [subst(z = z1, eigen_cond), subst(z = z2, eigen_cond), subst(z = z3, eigen_cond), subst(z = z4, eigen_cond)]; subst(%, zip); ratexpand(%); /*---end---*/ --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >I?got?problem?to?solve?this?differential?equation,?hope?some?one?can?help >me?on?thishere?my?code?problem?and?maxima?code >------------------------------ >eq1:diff(f(s),s)=-sqrt(3)*g(s)*k$eq2:diff(g(s),s)=k*(sqrt(3)*f(s)-2^(3/2)* >h(s))$eq3:diff(h(s),s)=k*(2^(2/3)*g(s)-3*l(s))$eq4:diff(l(s),s)=3*k*h(s)$ >atvalue(f(s),s=0,f610)$ >atvalue(g(s),s=0,0)$atvalue(h(s),s=0,1/2*sqrt(3)*k*f610/sqrt(2))$atvalue(l >(s),s=0,0)$ >desolve([eq1,eq2,eq3,eq4],[f(s),g(s),h(s),l(s)]); From rich.hennessy at verizon.net Mon Jan 17 17:16:32 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Mon, 17 Jan 2011 18:16:32 -0500 Subject: [Maxima] Plot2d-Question: How to plot 2 changing functionseconomically In-Reply-To: <4D348E2D.1090708@gmx.de> References: <4D332AFC.10101@gmx.de> <786AACD6780848C5B4DA0D1ED01B29CC@RichsLaptop> <4D348E2D.1090708@gmx.de> Message-ID: <53558ABCFC1D479FAA5399AF9E7F5DDE@RichsLaptop> Just repeat the steps in the function as many times as you need . . . Rich -----Original Message----- From: Michael Heidinger Sent: Monday, January 17, 2011 1:45 PM To: Richard Hennessy Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Plot2d-Question: How to plot 2 changing functionseconomically Thank you very much, that looks great! Thanks! But I'm afraid i was not precious: I want to stay in eq1 for x seconds, than switch over to eq2, stay there y seconds, and then switch over to eq1 and stay there x seconds, and so on. I think you understand what I mean. How can I get this? (I think this might be a little bite more complicated...) Can you please help me! Michael On 01/16/2011 11:29 PM, Richard Hennessy wrote: > Try this, it is not very efficient but it is what you asked for. > > eq1: 'diff(I,t)=(U-R*I)/L; > eq2: 'diff(I,t)=-(R*I+U)/L; > > F(_t, _t0,_R,_L,_U,_eq1,_eq2):=block > ( > [_e1,_e2,_e3,_e4], > _e1:ode2(_eq1,I,t), > _e2:ic1(_e1, t=0, I=0), > _e3:ode2(_eq2,I,t), > _e4:ic1(_e3, t=_t0, I=rhs(_e2)), > at(if t < _t0 then rhs(_e2) else rhs(_e4),[t=_t,R=_R,L=_L,U=_U]) > )$ > > plot2d([F(t,4,2,6,3,eq1,eq2)],[t,0,14]); > > > -----Original Message----- From: Michael Heidinger > Sent: Sunday, January 16, 2011 12:29 PM > To: maxima at math.utexas.edu > Subject: [Maxima] Plot2d-Question: How to plot 2 changing functions > economically > > Hello, > first of all, i'm new to this mailing list - Please excuse my language, > as it's not my first. > > Well, I want to simulate an electrical circuit, which has two operation > condition, each of them is discribed with a diffential equation. After a > certain time i want to switch to the other equation. > 1. Equation: 'diff(I,t)=(U-R*I)/L (eg. 1 second in this operating > mode=t_equation1) > 2. Equation: 'diff(I,t)=-(R*I+U)/L (eg. 2 second in this operation > mode=t_equation2) > Well, I solved them with ode2 and ic1 for some certain points. Eg: t=0 > and I=0. But I want to plot I for a longer periode to see how I > develops. I would wish myself a function where I can plot a continous > flow of current. > The function I would wish should look like > I(U,R,L,t,t_equation1,t_equation2). > > Dear experts, how can I construct such a function? Thank you in advance > for your help! > Michael Heidinger > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From toy.raymond at gmail.com Mon Jan 17 23:54:34 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 18 Jan 2011 00:54:34 -0500 Subject: [Maxima] Maxima 5.23.1 tagged In-Reply-To: References: Message-ID: <4D352B1A.7010105@gmail.com> On 1/17/11 10:49 AM, Andrey G. Grozin wrote: > On Sun, 16 Jan 2011, Andrey G. Grozin wrote: >> sbcl-1.0.45 165 (*) This is a known failure that is supposed to be fixed in sbcl someday. It has to do with the accuracy of cl:expt. > > So, ecl became faster, and errors in rtest16 (insufficient precision > in some floating-point operations) disappeared. Failures in rtest8 > remained. Yes, this was fixed in ecl some time ago (from reading the mailing list). But I also get a failure in rtest14, prob 144. The bessel and airy functions are not evaluated for some reason. This bug and the others you mentioned have been there for quite some time. I've been too lazy to investigate. Ray From milind.gupta at gmail.com Mon Jan 17 23:36:57 2011 From: milind.gupta at gmail.com (Milind Gupta) Date: Mon, 17 Jan 2011 21:36:57 -0800 Subject: [Maxima] Simplifying Equations Message-ID: Hi, How do I simplify a simple equation in Maxima. For example: x*a + x*b = x*c and I should get a + b = c Which function can do this? Thanks, Milind -------------- next part -------------- An HTML attachment was scrubbed... URL: From carbajal at ifi.uzh.ch Tue Jan 18 03:59:25 2011 From: carbajal at ifi.uzh.ch (Juan Pablo Carbajal) Date: Tue, 18 Jan 2011 10:59:25 +0100 Subject: [Maxima] Simplifying Equations In-Reply-To: References: Message-ID: Hi, I do not know if there is a general wy to simplify equations in the desired form. What I usually do is to mix Maxima abilities with my own. So to discover what would you simplify you can apply helper functions, life factor, ratsimp and expand In you example eq: a*x + b*x = c*x; eq1: factor(eq); eq2:eq1/x; In eq1 you realize that x can be eliminated and you do it in eq2 Another why of proceeding is to move everything to the same side of the equation and try to apply more sophisticated functions eqnew : lhs(eq) - rhs(eq) and then work out eqnew. I hope it helps, maybe somebody else can give a less newbie solution. JPi On Tue, Jan 18, 2011 at 6:36 AM, Milind Gupta wrote: > Hi, > ?? ? ? ?How do I simplify a simple equation in Maxima. For example: > x*a + x*b = x*c > and I should get > ??a + b = c > ?? Which function can do this? > Thanks, > Milind > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -- M. Sc. Juan Pablo Carbajal ----- PhD Student University of Z?rich www.ailab.ch/carbajal From A.G.Grozin at inp.nsk.su Tue Jan 18 04:13:46 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Tue, 18 Jan 2011 16:13:46 +0600 (NOVT) Subject: [Maxima] Maxima 5.23.1 tagged In-Reply-To: <4D352B1A.7010105@gmail.com> References: <4D352B1A.7010105@gmail.com> Message-ID: On Tue, 18 Jan 2011, Raymond Toy wrote: > But I also get a failure in rtest14, prob 144. The bessel and airy > functions are not evaluated for some reason. This bug and the others > you mentioned have been there for quite some time. I've been too lazy > to investigate. Strange. I see no failures in rtest14 with both ecl-10.4.1 and ecl-11.1.1. Gentoo Linux, 32-bit Intel pentium. Andrey From toy.raymond at gmail.com Tue Jan 18 06:44:44 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 18 Jan 2011 07:44:44 -0500 Subject: [Maxima] Maxima 5.23.1 tagged In-Reply-To: References: <4D352B1A.7010105@gmail.com> Message-ID: <4D358B3C.3020809@gmail.com> On 1/18/11 5:13 AM, Andrey G. Grozin wrote: > On Tue, 18 Jan 2011, Raymond Toy wrote: >> But I also get a failure in rtest14, prob 144. The bessel and airy >> functions are not evaluated for some reason. This bug and the others >> you mentioned have been there for quite some time. I've been too lazy >> to investigate. > Strange. I see no failures in rtest14 with both ecl-10.4.1 and > ecl-11.1.1. > Gentoo Linux, 32-bit Intel pentium. Mac OS X, 32-bit ecl. Maybe I will try on my openSuSE system. But I wonder why they should be different. Seems odd. Ray From l.butler at ed.ac.uk Tue Jan 18 08:13:07 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 18 Jan 2011 14:13:07 +0000 (GMT) Subject: [Maxima] build failure from cvs head Message-ID: I tried to build Maxima from HEAD this morning and I got this error: Making all in src make[1]: Entering directory `/home/lbutler/data2/maxima/sandbox/maxima/src' make[1]: *** No rule to make target `procs.lisp', needed by `binary-clisp/maxima.mem'. Stop. make[1]: Leaving directory `/home/lbutler/data2/maxima/sandbox/maxima/src' make: *** [all-recursive] Error 1 Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From fateman at eecs.berkeley.edu Tue Jan 18 10:16:59 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 18 Jan 2011 08:16:59 -0800 Subject: [Maxima] Simplifying Equations In-Reply-To: References: Message-ID: <4D35BCFB.40906@eecs.berkeley.edu> On 1/17/2011 9:36 PM, Milind Gupta wrote: > Hi, > How do I simplify a simple equation in Maxima. For example: > > x*a + x*b = x*c > > and I should get > a + b = c > > Which function can do this? > > Thanks, > Milind > > You could do this eq: x*a + x*b =x*c ratsimp(eq/x); Your answer is not complete. It should be something like (x=0) or (a+b=c) RJF From macrakis at alum.mit.edu Tue Jan 18 10:50:29 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 18 Jan 2011 11:50:29 -0500 Subject: [Maxima] Simplifying Equations In-Reply-To: References: Message-ID: Just as in general it's not clear what it means to simplify an expression, in general, it's not clear what it means to 'simplify' an equation. And how is it different from solving the equation? I suppose in the case of x^2=0, few people will disagree that x=0 is a simpler equation. But how about x^2+1=2? Is x^2-1=0 or x^2=1 or (x-1)*(x+1)=0 'simpler'? How about (x=1 OR x= -1)? In your case, I suppose one possible simplification is (x=0 OR c=a+b). You can get this using the Maxima solve: eq: x*a + x*b = x*c; solve(eq,[x,a,b,c]) => [[x = 0, a = %r1, b = %r2, c = %r3], [x = %r4, a = %r5, b = %r6, c = %r6 + %r5]] (with an implicit OR) Another approach is to work only with expressions equated to zero: eq0: lhs(eq)-rhs(eq)$ factor(eq0) => - (c - b - a) x Is the factored equation (c - b - a) x = 0 simpler? Up to you to decide. -s On Tue, Jan 18, 2011 at 00:36, Milind Gupta wrote: > Hi, > ?? ? ? ?How do I simplify a simple equation in Maxima. For example: > x*a + x*b = x*c > and I should get > ??a + b = c > ?? Which function can do this? > Thanks, > Milind > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > From robert.dodier at gmail.com Tue Jan 18 11:01:13 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 18 Jan 2011 10:01:13 -0700 Subject: [Maxima] build failure from cvs head In-Reply-To: References: Message-ID: Hmm, I don't see that error. Seems like there is some stale data in src/Makefile or something. Does it work if you start over with sh bootstrap && ./configure && make ? src/procs.lisp got the axe a while ago (unused macrology) I think the build machinery was fixed up at the same time. best Robert Dodier On 1/18/11, Leo Butler wrote: > I tried to build Maxima from HEAD this morning and I got this error: > > Making all in src > make[1]: Entering directory > `/home/lbutler/data2/maxima/sandbox/maxima/src' > make[1]: *** No rule to make target `procs.lisp', needed by > `binary-clisp/maxima.mem'. Stop. > make[1]: Leaving directory > `/home/lbutler/data2/maxima/sandbox/maxima/src' > make: *** [all-recursive] Error 1 > > Leo > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From mch.heidinger at gmx.de Tue Jan 18 11:30:36 2011 From: mch.heidinger at gmx.de (Michael Heidinger) Date: Tue, 18 Jan 2011 18:30:36 +0100 Subject: [Maxima] Plot2d-Question: How to plot 2 changing functionseconomically In-Reply-To: <53558ABCFC1D479FAA5399AF9E7F5DDE@RichsLaptop> References: <4D332AFC.10101@gmx.de> <786AACD6780848C5B4DA0D1ED01B29CC@RichsLaptop> <4D348E2D.1090708@gmx.de> <53558ABCFC1D479FAA5399AF9E7F5DDE@RichsLaptop> Message-ID: <4D35CE3C.9070709@gmx.de> ...yeah, for sure this a solution, but is there a more practical version (I want to plot it over a larger range from 20 to 50). Thank you for your help. Michael On 01/18/2011 12:16 AM, Richard Hennessy wrote: > Just repeat the steps in the function as many times as you need . . . > > Rich > > > -----Original Message----- From: Michael Heidinger > Sent: Monday, January 17, 2011 1:45 PM > To: Richard Hennessy > Cc: maxima at math.utexas.edu > Subject: Re: [Maxima] Plot2d-Question: How to plot 2 changing > functionseconomically > > Thank you very much, that looks great! Thanks! > But I'm afraid i was not precious: > I want to stay in eq1 for x seconds, than switch over to eq2, stay there > y seconds, and then switch over to eq1 and stay there x seconds, and so > on. I think you understand what I mean. > How can I get this? (I think this might be a little bite more > complicated...) > Can you please help me! > Michael > > On 01/16/2011 11:29 PM, Richard Hennessy wrote: >> Try this, it is not very efficient but it is what you asked for. >> >> eq1: 'diff(I,t)=(U-R*I)/L; >> eq2: 'diff(I,t)=-(R*I+U)/L; >> >> F(_t, _t0,_R,_L,_U,_eq1,_eq2):=block >> ( >> [_e1,_e2,_e3,_e4], >> _e1:ode2(_eq1,I,t), >> _e2:ic1(_e1, t=0, I=0), >> _e3:ode2(_eq2,I,t), >> _e4:ic1(_e3, t=_t0, I=rhs(_e2)), >> at(if t < _t0 then rhs(_e2) else rhs(_e4),[t=_t,R=_R,L=_L,U=_U]) >> )$ >> >> plot2d([F(t,4,2,6,3,eq1,eq2)],[t,0,14]); >> >> >> -----Original Message----- From: Michael Heidinger >> Sent: Sunday, January 16, 2011 12:29 PM >> To: maxima at math.utexas.edu >> Subject: [Maxima] Plot2d-Question: How to plot 2 changing functions >> economically >> >> Hello, >> first of all, i'm new to this mailing list - Please excuse my language, >> as it's not my first. >> >> Well, I want to simulate an electrical circuit, which has two operation >> condition, each of them is discribed with a diffential equation. After a >> certain time i want to switch to the other equation. >> 1. Equation: 'diff(I,t)=(U-R*I)/L (eg. 1 second in this operating >> mode=t_equation1) >> 2. Equation: 'diff(I,t)=-(R*I+U)/L (eg. 2 second in this operation >> mode=t_equation2) >> Well, I solved them with ode2 and ic1 for some certain points. Eg: t=0 >> and I=0. But I want to plot I for a longer periode to see how I >> develops. I would wish myself a function where I can plot a continous >> flow of current. >> The function I would wish should look like >> I(U,R,L,t,t_equation1,t_equation2). >> >> Dear experts, how can I construct such a function? Thank you in advance >> for your help! >> Michael Heidinger >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > > From l.butler at ed.ac.uk Tue Jan 18 13:06:05 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 18 Jan 2011 19:06:05 +0000 (GMT) Subject: [Maxima] build failure from cvs head In-Reply-To: References: Message-ID: On Tue, 18 Jan 2011, Robert Dodier wrote: < Hmm, I don't see that error. Seems like there is some stale < data in src/Makefile or something. Does it work if you < start over with sh bootstrap && ./configure && make ? < < src/procs.lisp got the axe a while ago (unused macrology) < I think the build machinery was fixed up at the same time. My stupidity. I copied the configure line from config.log and there were a couple flags set to prevent the re-creation of the Makefiles. Cheers, Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From jrgrauh at yahoo.com Tue Jan 18 14:29:45 2011 From: jrgrauh at yahoo.com (Joerg Rauh) Date: Tue, 18 Jan 2011 12:29:45 -0800 (PST) Subject: [Maxima] Comment & Suggestion Message-ID: <251153.67765.qm@web45312.mail.sp1.yahoo.com> Dear Maxima-Developers, First let me thank you for all the work you are doing! I'm impressed at how comprehensive this package is. After using MacKichan's Scientific Workplace for a number of years, when the license expired and the Maple Engine was taken out and only the MuPad Engine was available, I had to find a new home for doing math which is Maxima. The most obvious difference was having to give up text-book like input. I want to work in three areas: 1. Differential Equations 2. Nabla 3. Tensors For DEs I was looking for 'slope fields' and didn't find them with this search term (in Maxima-5_13.pdf and Maxima-Help 5.22.1 Manual). For Nabla-Stuff I looked up Nabla and didn't find it with this search term except in a call to texput(). For Tensors I found three different packages. I did find the slope-fields in 66 Plotdf under the name of 'direction field' but only after going through the total manual. Eventually I found the Nabla material I was looking for (grad(), div(),curl(), laplace()) in Chapter 19 Differentiation in package 'vect' and embedded in function express(). With this experience I'd like to suggest including the search terms (i.e. slope field, nabla) in the manual and index and referring to where they are discussed - rather than not having them there at all. Not finding the search terms might give the impression that the package is unable to do the desired tasks - which isn't true. And 66 Plotdf could possibly become part of 22 Differential Equations? And 59 linearalgebra could possibly become part of 25 Matrices and Linear Algebra? After reading up on Maxima tensor packages I get the impression that ctensor is the most complete and the most up to date of the three. Surprisingly I found in the package two functions (bimetric(),invariant2()) with the express information: *** NOT YET IMPLEMENTED *** in both sources. In order to get a faster grip on Maxima functions I created a MySql-database that collects their names (by now 260, growing), their chapter, package, explanation and page number in the manual which I'm willing to contribute. By doing so I found some function declarations in two places like: dscalar() in '19 Differentiation' and '28 Ctensor'; rank() in '25 Matrices and Linear Algebra' and '59 linear algebra' which might not be intended. I'm looking forward to many pleasant hours of using Maxima in my daily routine. Kind regards Joerg Rauh -------------- next part -------------- An HTML attachment was scrubbed... URL: From vttoth at vttoth.com Tue Jan 18 15:41:17 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Tue, 18 Jan 2011 16:41:17 -0500 Subject: [Maxima] Comment & Suggestion In-Reply-To: <251153.67765.qm@web45312.mail.sp1.yahoo.com> References: <251153.67765.qm@web45312.mail.sp1.yahoo.com> Message-ID: <026601cbb758$732fd230$598f7690$@vttoth.com> > After reading up on Maxima tensor packages I get the impression > that ctensor is the most complete and the most up to date > of the three I don't think this impression is justified. The three packages differ not in the degree to which they are up to date, but in the purposes they serve. The ctensor package is designed to calculate the components of, and work with the tensors of Riemannian geometry given a specific coordinate frame and metric. The itensor package is a generic indicial tensor manipulation package that performs formal algebra and calculus on "indexed objects", applying symmetry rules, summation rules, etc, in a coordinate system independent manner. The atensor package implements the rules of an abstract noncommutative algebra. When working on alternate theories of gravity, I use itensor by far the most often. In particular, itensor can be used to derive the field equations of a Lagrangian field theory, and it can also be used to simplify and manage fairly complex tensorial expressions. I also use ctensor occasionally, e.g., when computing a specific solution (say, solving the field equations in a spherically symmetric, static case or in the case of an homogeneous, isotropic cosmology.) I find atensor to have a little less practical utility (though it's certainly educational.) Regarding the "NOT YET IMPLEMENTED" features: these are legacy entries on the documentation. The itensor package can be used to generate the Euler-Lagrange equations for any Lagrangian field theory, and as to Rosen's bimetric theory, I think it's a lot less in fashion today than back when ctensor was originally written. Nonetheless, if there is a real need for it, we can certainly contemplate implementing these features. They're not (yet?) implemented, but I felt no pressing need to remove the documentation entries. I recommend running demo(tensor) from the command line. (It may not work as intended in all graphical interfaces.) It provides many working examples for ctensor/itensor. Viktor From milind.gupta at gmail.com Tue Jan 18 16:08:19 2011 From: milind.gupta at gmail.com (Milind Gupta) Date: Tue, 18 Jan 2011 14:08:19 -0800 Subject: [Maxima] Simplifying Equations In-Reply-To: References: Message-ID: Thank you all, This certainly makes things clear for me. Best Regards, Milind On Tue, Jan 18, 2011 at 8:50 AM, Stavros Macrakis wrote: > Just as in general it's not clear what it means to simplify an > expression, in general, it's not clear what it means to 'simplify' an > equation. And how is it different from solving the equation? > > I suppose in the case of x^2=0, few people will disagree that x=0 is a > simpler equation. But how about x^2+1=2? Is x^2-1=0 or x^2=1 or > (x-1)*(x+1)=0 'simpler'? How about (x=1 OR x= -1)? > > In your case, I suppose one possible simplification is (x=0 OR c=a+b). > You can get this using the Maxima solve: > > eq: x*a + x*b = x*c; > solve(eq,[x,a,b,c]) => > [[x = 0, a = %r1, b = %r2, c = %r3], [x = %r4, a = %r5, b = %r6, > c = %r6 + %r5]] > (with an implicit OR) > > Another approach is to work only with expressions equated to zero: > > eq0: lhs(eq)-rhs(eq)$ > factor(eq0) => > - (c - b - a) x > > Is the factored equation (c - b - a) x = 0 simpler? Up to you to decide. > > -s > > On Tue, Jan 18, 2011 at 00:36, Milind Gupta > wrote: > > Hi, > > How do I simplify a simple equation in Maxima. For example: > > x*a + x*b = x*c > > and I should get > > a + b = c > > Which function can do this? > > Thanks, > > Milind > > > > > > _______________________________________________ > > 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 mohamedabouzied at hotmail.com Tue Jan 18 16:36:26 2011 From: mohamedabouzied at hotmail.com (mohamed abouzied) Date: Wed, 19 Jan 2011 00:36:26 +0200 Subject: [Maxima] Hyperbolic Simplification Message-ID: Dear Sir, If you want to use the demoavre identity of exp(i)+exp(-i)=2cos(0) we can use: trigrat(exp(%i)+exp(-%i)); But on the other hand if you want the hyperbolic identity, exp(1)+exp(-1)=2cosh(0) Why does this not implemented? I think it is much like the previous trigonimetric example{especially that the documentation says that trigonometric fns are sin, cos, sinh, cosh,.... } Unfortunately, I don't have time to learn Lisp, I went to trigrat fn in my share folder and there was .mac and .lisp. Thanks Mohamed Abouzied -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Jan 18 19:57:49 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 18 Jan 2011 20:57:49 -0500 Subject: [Maxima] rtest14, closeto, and ecl (Was Re: Maxima 5.23.1 tagged) In-Reply-To: References: <4D352B1A.7010105@gmail.com> Message-ID: <4D36451D.80300@gmail.com> On 1/18/11 5:13 AM, Andrey G. Grozin wrote: > On Tue, 18 Jan 2011, Raymond Toy wrote: >> But I also get a failure in rtest14, prob 144. The bessel and airy >> functions are not evaluated for some reason. This bug and the others >> you mentioned have been there for quite some time. I've been too lazy >> to investigate. > Strange. I see no failures in rtest14 with both ecl-10.4.1 and > ecl-11.1.1. > Gentoo Linux, 32-bit Intel pentium. The particular failure in rtest14, prob 144 is the following: closeto(e,tol):=block([numer:true,abse],abse:abs(e),if(abse 8.881784197001252e-16 8.88e-16 is less than 1e-15. I don't really understand how closeto is supposed to work. When abse >= tol, it's supposed to return abse. Shouldn't that be a number, not some symbolic expression? If abse really is symbolic, does the test abse < tol cause some further numerical evaluation? Could this be some subtle change somewhere? I'm confused. Ray From willisb at unk.edu Tue Jan 18 20:43:11 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 18 Jan 2011 20:43:11 -0600 Subject: [Maxima] rtest14, closeto, and ecl (Was Re: Maxima 5.23.1 tagged) In-Reply-To: <4D36451D.80300@gmail.com> References: <4D352B1A.7010105@gmail.com> , <4D36451D.80300@gmail.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I?don't?really?understand?how?closeto?is?supposed?to?work.??When?abse?>= >tol,?it's?supposed?to?return?abse.??Shouldn't?that?be?a?number,?not?some >symbolic??expression??? Maybe float_approx_equal (defined in mload) provides a better way to do the comparison. Or maybe not...I think I wrote float_approx_equal. --bw From wilhelm.haager at htlstp.ac.at Wed Jan 19 03:21:19 2011 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Wed, 19 Jan 2011 10:21:19 +0100 Subject: [Maxima] Simpliyfying the argument of a complex expression Message-ID: Hi, Is there a possibility to cause Maxima simplyfying (or evaluating) an expression like "carg(exp(%i*x))" to "x" (and not just to "atan2(sin(x),cos(x))")? Thanks in advance, Wilhelm Haager From villate at fe.up.pt Wed Jan 19 05:54:52 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 19 Jan 2011 11:54:52 +0000 Subject: [Maxima] Comment & Suggestion In-Reply-To: <251153.67765.qm@web45312.mail.sp1.yahoo.com> References: <251153.67765.qm@web45312.mail.sp1.yahoo.com> Message-ID: <1295438092.3389.14.camel@wigner> On Tue, 2011-01-18 at 12:29 -0800, Joerg Rauh wrote: > With this experience I'd like to suggest including the search terms > (i.e. slope field, nabla) in the manual and index and referring to > where they are discussed - rather than not having them there at all. > Not finding the search terms might give the impression that the > package is unable to do the desired tasks - which isn't true. And 66 > Plotdf could possibly become part of 22 Differential Equations? And 59 > linearalgebra could possibly become part of 25 Matrices and Linear > Algebra? Hello Joerg, welcome to the Maxima list. Your comments are very welcome. The ideas brought by someone who has worked with other packages in the past are always very important to help us improve Maxima. I will add the term "slope field" as a synonym for "direction field" as you suggest. The manual needs some major restructuring because it used to document only the core part of Maxima and the additional packages were added later on at the end; it really makes more sense to blend in the additional packages in the relevant sections rather than keeping them separate at the end. In any case, the manual you are referring to is a reference manual, intended to be used by a user with some previous knowledge of Maxima. A beginner should better use a user's manual or a tutorial. Those can be found in the tutorial section in http://maxima.sourceforge.net/documentation.html Also, according to the chapter numbers you mention, it seems to me that you are looking at a very old version of the manual. Which version are you using? Regards, Jaime From mathew.gwynne at gmail.com Wed Jan 19 12:55:11 2011 From: mathew.gwynne at gmail.com (Matthew Gwynne) Date: Wed, 19 Jan 2011 18:55:11 +0000 Subject: [Maxima] Implementation of random_permutation Message-ID: Hi, In our work, we make quite a lot of use of functions such as random_permutation for various experiments. In certain instances where performance is a big issue, we'd like to implement parts of the system in C++. However, we'd like to make sure that anything we write matches up with what we have at the Maxima level. To be able to do this, we need to know how the function random_permutation works to be able to replicate it in C++. The C++ standard has a std::random_shuffle and the boost library offers random number generators utilising the Mersenne twister (which the documentation suggests is used for the Maxima random number generator), so it seems it should be easy, however, it's not clear exactly how Maxima extracts integers from the state of the Mersenne twister, or precisely the implementation of the random_permutation function even if the random number generation were the same. Could anyone point me to some relevant documentation or maybe point me to some code for how these are implemented? Thanks! Matthew Gwynne http://cs.swan.ac.uk/~csmg/ P.S - As a note, in the coming C++ standard there will be random number generators and so on guaranteed by the standard library, and so it might make sense if simply using std::random_shuffle with the standard number generator yielded the same results as random_permutation in Maxima? This would make a description of the behaviour in the documentation very simple, as one could just point to the more elaborated C++ standard. From pbowyer at olynet.com Wed Jan 19 15:36:19 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Wed, 19 Jan 2011 13:36:19 -0800 Subject: [Maxima] Maxima-5.23.2 Message-ID: <4D375953.1010701@olynet.com> Information concerning the new release of Maxima-5-23-2. I downloaded the source files for Maxima-5-23-2 from sourceforge and built rpm files for my personal repository for PCLinuxOS-2010, which has been updated to the latest from their repositories, and this is just to inform you of the result. I'm using the following, which I also built from source (including GCL): wxMaxima 0.8.7 wxWidgets: 2.8.11 Unicode support: yes Maxima version: 5.23.2 Lisp: GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) Test suite run from Xmaxima gives: No unexpected errors found out of 8,720 tests. real time : 505.000 secs run-gbc time : 431.350 secs child run time : 1.660 secs gbc time : 43.090 secs Test suite run from wxMaxima gives: No unexpected errors found out of 8,720 tests. real time : 892.960 secs run-gbc time : 619.790 secs child run time : 3.300 secs gbc time : 55.380 secs My hardware is an older Pentium4 system running at 3.2Ghz. Before I say anything about problems, let me say that I appreciate all of the effort that goes into Maxima that makes it such a useful tool for a casual mathematics user like me. I know it takes a lot of effort to produce and maintain Maxima. I use Maxima to work out problems that I can later put into Java code because I can usually debug the math in Maxima easier than I can in the Java code, although I have found it necessary to double-check what Maxima produces in some cases. I've continued to monitor the list messages for my own edification but I've rarely commented because I feel my mathematics abilities are far below most of the users of Maxima I see posting on the list. I have been looking for progress concerning the bug related to 0^0 and sum(), but I've not seen any so I'm reiterating my findings related to the problem. Here are the test commands in wxmaxima-0.8.7 with Maxima-5.23.2 concerning the bug that shows up for 0^n and their output: ----------------------------------------------------------------------------- kill(all)$ n:5; sum(0^i, i, 0, n); 0^0; 0^1; 0^i; assume (i >= 0); 0^i; (%o1) 5 0^0 has been generated -- an error. To debug this try: debugmode(true); 0^0 has been generated -- an error. To debug this try: debugmode(true); (%o4) 0 (%o5) 0 (%o6) [i>=0] (%o7) 0 ----------------------------------------------------------------------------- The above sequence of commands and their resulting output is exactly the same as I got for Maxima-5-22.0. From what I can tell from my end it looks as though the problems associated with 0^0 and sum() are going to be with us for awhile, so maybe there should be a note added to the documentation for sum() (and anywhere else that's appropriate) warning users of the bug so they can try to work around it if they find it necessary. Just my $0.02 worth... Thanks again to all of the Maxima developers for all of the effort, Paul Bowyer From macrakis at alum.mit.edu Wed Jan 19 15:47:52 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 19 Jan 2011 16:47:52 -0500 Subject: [Maxima] Simpliyfying the argument of a complex expression In-Reply-To: References: Message-ID: Well, the principal value of carg(exp(%i*x)) is actually not x, but mod(x+%pi,2*%pi)-%pi. I do wish sometimes we had a 'sloppy' mode (the opposite of pedantic mode), which did things like atan(tan(x)) => x -- but of course you have to be very careful with such things. Ideally, assume(x>0,x<%pi/2) would allow atan2(sin(x),cos(x)) and atan(sin(x)/cos(x)) to simplify to x, but unfortunately Maxima's simplifier isn't smart enough to do that; it's not even smart enough to know that with those assumptions, sin(x) > 0 and cos(x) > 0. The best I can do is something like this: expr: carg(expr(%i*x))$ assume(x>0,x<%pi/2)$ trigreduce( subst(lambda([a,b],atan(a/b)),atan2,expr) ); Maybe that helps? -s On Wed, Jan 19, 2011 at 04:21, Wilhelm Haager wrote: > Hi, > > Is there a possibility to cause Maxima simplyfying (or evaluating) an > expression like > "carg(exp(%i*x))" to "x" (and not just to "atan2(sin(x),cos(x))")? > > Thanks in advance, > Wilhelm Haager > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From A.G.Grozin at inp.nsk.su Wed Jan 19 22:58:06 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Thu, 20 Jan 2011 10:58:06 +0600 (NOVT) Subject: [Maxima] Maxima-5.23.2 In-Reply-To: <4D375953.1010701@olynet.com> References: <4D375953.1010701@olynet.com> Message-ID: On Wed, 19 Jan 2011, Paul Bowyer wrote: > I'm using the following, which I also built from source (including GCL): > wxMaxima 0.8.7 > wxWidgets: 2.8.11 > Unicode support: yes > Maxima version: 5.23.2 > Lisp: GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) There is no such a thing as gcl-2.6.8. What exactly do you mean? cvs snapshot (when)? Debian patch (which)? Andrey From mhw at netris.org Thu Jan 20 00:51:47 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 20 Jan 2011 01:51:47 -0500 Subject: [Maxima] Enhanced Laplace transforms and desolve for Maxima Message-ID: <87bp3cvzi4.fsf@yeeloong.netris.org> I've been working on improving our support for Laplace transforms and inverse Laplace transforms. Michael and Razif, I've CC'd you because, as you will see below, these improvements solve your recent problems with Maxima more satisfactorily. The attached preliminary patches and new files provide the following improvements: * Added hstep(x), a simplifying Heaviside step function which is like unit_step(x) except that hstep(0)=1/2. * laplace(expr,t,s) now supports expressions containing step functions, and also now distributes itself over lists and matrices. * ilt(expr,s,t) is now able to return Dirac delta when the expression is free of s. * Added pwilt(expr,s,t), an improved inverse Laplace transform, which is able to return piecewise and periodic functions, and also handles some cases where ilt() fails, e.g. where the degree of the denominator is greater than 3. * Added support for hstep(x) to abs_integrate.mac. * Modified desoln.mac to use pwilt() instead of ilt(). Note that this is a work in progress, and probably not yet ready for submission. I have decided to post them now because they solve the following problems from Razif Razali and Michael Heidinger. razif razali wrote: > eq1:diff(f(s),s)=-sqrt(3)*g(s)*k$ > eq2:diff(g(s),s)=k*(sqrt(3)*f(s)-2^(3/2)*h(s))$ > eq3:diff(h(s),s)=k*(2^(2/3)*g(s)-3*l(s))$ > eq4:diff(l(s),s)=3*k*h(s)$ > > atvalue(f(s),s=0,f610)$ > atvalue(g(s),s=0,0)$ > atvalue(h(s),s=0,1/2*sqrt(3)*k*f610/sqrt(2))$ > atvalue(l(s),s=0,0)$ > > desolve([eq1,eq2,eq3,eq4],[f(s),g(s),h(s),l(s)]); With these enhancements, the commands above now produce the correct solution. I recommend using radcan(%) to simplify the results. Michael Heidinger wrote: > Well, I want to simulate an electrical circuit, which has two > operation condition, each of them is discribed with a diffential > equation. After a certain time i want to switch to the other equation. > 1. Equation: 'diff(I,t)=(U-R*I)/L (eg. 1 second in this operating > mode=t_equation1) > 2. Equation: 'diff(I,t)=-(R*I+U)/L (eg. 2 second in this operation > mode=t_equation2) [...] > I want to stay in eq1 for x seconds, than switch over to eq2, stay > there y seconds, and then switch over to eq1 and stay there x seconds, > and so on. I think you understand what I mean. With these enhancements, the following commands will do this job: load(desoln); de: diff(I(t),t) = -R*I(t)/L + U/L*(-hstep(t)+2*sum(hstep(t-k*y-k*x)-hstep(t-k*y-k*x-x), k,0,n)); de1: de, n=20, x=1, y=2, simpsum; sol: desolve(de1,I(t)); sol1: sol, I(0)=0, R=1, L=1, U=1; plot2d(rhs(sol1),[t,0,10]); The patches and new files are attached below. The patches are against the 5.23 branch. Note that the new laplac.lisp must be recompiled into the executable. At least on my system (using GCL), I am not able to dynamically load the modified version, due to issues with proclaimed special variables. However, the changes to laplac.lisp are only needed if you use piecewise functions. Even if you do, it *may* be sufficient to simply load abs_integrate.mac, since laplace() will fall back to integration if all else fails, though that method is less efficient and may fail. Comments and suggestions welcome. Mark -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: hstep.lisp URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: pwilt.lisp URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: laplac.diff Type: text/x-diff Size: 2617 bytes Desc: laplac.lisp patch URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: abs_integrate.diff Type: text/x-diff Size: 6200 bytes Desc: abs_integrate.mac patch URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: desoln.diff Type: text/x-diff Size: 598 bytes Desc: desoln.mac patch URL: From wilhelm.haager at htlstp.ac.at Thu Jan 20 03:46:05 2011 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Thu, 20 Jan 2011 10:46:05 +0100 Subject: [Maxima] Simpliyfying the argument of a complex expression In-Reply-To: References: Message-ID: <6e05580e561aa1d432631cdaeed980af@localhost> On Wed, 19 Jan 2011 16:47:52 -0500, Stavros Macrakis wrote: > Well, the principal value of carg(exp(%i*x)) is actually not x, but > mod(x+%pi,2*%pi)-%pi. > > I do wish sometimes we had a 'sloppy' mode (the opposite of pedantic > mode), which did things like atan(tan(x)) => x -- but of course you > have to be very careful with such things. > > Ideally, assume(x>0,x<%pi/2) would allow atan2(sin(x),cos(x)) and > atan(sin(x)/cos(x)) to simplify to x, but unfortunately Maxima's > simplifier isn't smart enough to do that; it's not even smart enough > to know that with those assumptions, sin(x) > 0 and cos(x) > 0. > > The best I can do is something like this: > > expr: carg(expr(%i*x))$ > assume(x>0,x<%pi/2)$ > trigreduce( subst(lambda([a,b],atan(a/b)),atan2,expr) ); > > Maybe that helps? > > -s > > On Wed, Jan 19, 2011 at 04:21, Wilhelm Haager > wrote: >> Hi, >> >> Is there a possibility to cause Maxima simplyfying (or evaluating) an >> expression like >> "carg(exp(%i*x))" to "x" (and not just to "atan2(sin(x),cos(x))")? >> >> Thanks in advance, >> Wilhelm Haager >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> Tanks a lot, Stavros; that's exactly what I've been looking for. It is a very interesting application of "subst"; I have not considered, that it is applicable on funcion names too. Btw: As a technician, I am more interested in 'pragmatic' solutions than in 'pedantic' mathematical exactness. Furthemore, in my case of the transfer function of a time delay system, I think, that simplification actually IS the correct solution (which can exceed 2*%pi and attain arbitrarily high values). Regards Wilhelm Haager From O.Kullmann at swansea.ac.uk Thu Jan 20 10:14:35 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Thu, 20 Jan 2011 16:14:35 +0000 Subject: [Maxima] next_prime(113) = 121 with Ecl 11.1.1 ! Message-ID: <20110120161435.GE32073@cs-wsok.swansea.ac.uk> Hello, Maxima 5.21.1 as well as 5.23.2, built with Ecl 11.1.1, has a completely corrupted next_prime function, e.g. next_prime(113) = 121 = 11^2 (determining all "primes" within {1,...,1000} yields 231 "primes", while there are 168). Don't know whether this is an Ecl or a Maxima (or a joint) problem. Would be good to find out. In any case, it would be good if Maxima had tests which would catch these failures (for example determining all primes within an interval, and counting them). Best regards Oliver From mhw at netris.org Thu Jan 20 10:31:35 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 20 Jan 2011 11:31:35 -0500 Subject: [Maxima] Hyperbolic Simplification In-Reply-To: (mohamed abouzied's message of "Wed, 19 Jan 2011 00:36:26 +0200") References: Message-ID: <874o93wn88.fsf@yeeloong.netris.org> mohamed abouzied writes: > If you want to use the demoavre identity of exp(i)+exp(-i)=2cos(0) we > can use: trigrat(exp(%i)+exp(-%i)); You can also use demoivre(exp(%i)+exp(-%i)) to do this, though the answer is 2*cos(1), not 2*cos(0). There's also an evaluation flag of the same name, so you can say "demoivre:true;" and then this conversion will be done automatically by the simplifier. > But on the other hand if you want the hyperbolic identity, > exp(1)+exp(-1)=2cosh(0) Why does this not implemented? Note: it should be 2*cosh(1), not 2*cosh(0). Despite the similarity, it turns out to be much more difficult to do this intelligently. Demoivre simply converts every exponential whose argument is in explicit rectangular form as follows: exp(a+b*%i) ==> exp(a)*(cos(b)+%i*sin(b)) The corresponding hyperbolic identity is: exp(a) ==> cosh(a) + sinh(a) However, this doesn't work well in practice. For example, consider: exp(2*x)+1 If you apply the simple rule above, you get: cosh(2*x) + sinh(2*x) + 1 However, you might have wanted this instead: 2*exp(x)*cosh(x) ... especially if the example above was the numerator of this larger expression: (exp(2*x)+1) / (exp(2*x)-1) ==> 2*exp(x)*cosh(x) / 2*exp(x)*sinh(x) ==> coth(x) So, although the simple demoivre rule can be uniformly applied to individual exponentials with good results, an intelligent "hyperbolize" function must find pairs of terms (at least one being an exponential), and selectively use the following rule: A*exp(C) + B*exp(D) (where C or D might be zero, but not both) ==> (A+B)*exp((C+D)/2)*cosh((C-D)/2) + (A-B)*exp((C+D)/2)*sinh((C-D)/2) What if there are more than two exponential terms in a sum? In that case, you have to decide how best to combine them into pairs. If there are many exponential terms, this may become a rather expensive search. I have written a preliminary "hyperbolize" function which attempts to use a combination of heuristics to do this job with O(n^2) complexity (where n is the number of terms per MPLUS with distinct exponential arguments), but it is far more complex and ad-hoc than I would prefer, and not yet ready for publication. See below for a taste of its current abilities and weaknesses. Mark (%i2) load(hyperbolize); (%o2) "/home/mhw/.maxima/hyperbolize.lisp" (%i3) ex1: (exp(2*x)+1)/(exp(2*x)-1) + C; (%o3) C+(%e^(2*x)+1)/(%e^(2*x)-1) (%i4) hyperbolize(ex1); (%o4) C+coth(x) (%i5) expand(ex1); (%o5) C+%e^(2*x)/(%e^(2*x)-1)+1/(%e^(2*x)-1) (%i6) hyperbolize(%); (%o6) C+coth(x) (%i7) ratsimp(ex1); (%o7) ((%e^(2*x)-1)*C+%e^(2*x)+1)/(%e^(2*x)-1) (%i8) hyperbolize(%); (%o8) C+coth(x) (%i9) ex2: exp(2*x)+exp(-2*x)-exp(y)+exp(-y)+exp(3*y); (%o9) %e^(3*y)-%e^y+%e^-y+%e^(2*x)+%e^-(2*x) (%i10) hyperbolize(ex2); (%o10) -2*sinh(y)+%e^(3*y)+2*cosh(2*x) (%i11) multthru(exp(y), ex2); (%o11) %e^(y+2*x)+%e^(y-2*x)+%e^(4*y)-%e^(2*y)+1 (%i12) hyperbolize(%); (%o12) 2*%e^(3*y)*sinh(y)+2*cosh(2*x)*%e^y+1 (%i13) hyperbolize(exp(2)+exp(-2)); (%o13) 2*cosh(2) (%i14) hyperbolize(exp(1)+exp(-2)); (%o14) %e+%e^-2 (%i15) hyperbolize(exp(1)+exp(-1)); (%o15) %e+%e^-1 (%i16) hyperbolize(1+exp(-2)); (%o16) 2*%e^-1*cosh(1) From O.Kullmann at swansea.ac.uk Thu Jan 20 10:38:21 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Thu, 20 Jan 2011 16:38:21 +0000 Subject: [Maxima] segmentation faults when loading Lisp code Message-ID: <20110120163821.GG32073@cs-wsok.swansea.ac.uk> Hello, we have a problem with Maxima, the same in 5.21.1 and 5.23.2, where we use Ecl 10.4.1. For large computation we need to reset the (far too low) default memory settings of Ecl, where we have written the following functions: frame_stack_ecl : 2^14; binding_stack_ecl : 2^17; c_stack_ecl : 2^22; heap_size_ecl : 2^30; lisp_stack_ecl : 2^18; show_memory_ecl() := ( print("frame_stack_ecl:", get_frame_stack_ecl()), print("binding_stack_ecl:", get_binding_stack_ecl()), print("c_stack_ecl:", get_c_stack_ecl()), print("heap_size_ecl:", get_heap_size_ecl()), print("lisp_stack_ecl:", get_lisp_stack_ecl()) )$ default_memory_ecl() := ( set_frame_stack_ecl(frame_stack_ecl), set_binding_stack_ecl(binding_stack_ecl), set_c_stack_ecl(c_stack_ecl), set_heap_size_ecl(heap_size_ecl), set_lisp_stack_ecl(lisp_stack_ecl) )$ which includes the following file with the underlying Lisp code: (defun $set_frame_stack_ecl (fs) (ext:set-limit 'ext:frame-stack fs) fs ) (defun $get_frame_stack_ecl () (ext:get-limit 'ext:frame-stack) ) (defun $set_binding_stack_ecl (bs) (ext:set-limit 'ext:binding-stack bs) bs ) (defun $get_binding_stack_ecl () (ext:get-limit 'ext:binding-stack) ) (defun $set_c_stack_ecl (cs) (ext:set-limit 'ext:c-stack cs) cs ) (defun $get_c_stack_ecl () (ext:get-limit 'ext:c-stack) ) (defun $set_heap_size_ecl (hs) (ext:set-limit 'ext:heap-size hs) hs ) (defun $get_heap_size_ecl () (ext:get-limit 'ext:heap-size) ) (defun $set_lisp_stack_ecl (ls) (ext:set-limit 'ext:lisp-stack ls) ls ) (defun $get_lisp_stack_ecl () (ext:get-limit 'ext:lisp-stack) ) This all works when called from the Maxima shell, but Maxima segfaults when loading a file containing the expression default_memory_ecl(); (where this file loads the .mac-file containing the above Maxima-definitions, and that file loads the file with the above Lisp-definitions). Whether the segfault occurs depends on the circumstances, sometimes a "batch" succeeds where a load doesn't. But altogether it seems completely impossible to set the memory-limits in batch-mode (and that's what we need --- we need to run Maxima in batch-mode for performing many computations, which all need more memory). If you need more information on how to reproduce the problem, I'll try my best, however I have the feeling that it depends in some random fashion on details of the environment (though in our environment it's completely reproducible). Hope something can be done about it (yet we are really completely unable to run the experiments --- there are many of them, and whatever we do in batch-mode, it segfaults). Hope something can be done. Thanks for your attention! Oliver -- Dr. Oliver Kullmann Computer Science Department Swansea University Faraday Building, Singleton Park Swansea SA2 8PP, UK http://cs.swan.ac.uk/~csoliver/ From jrgrauh at yahoo.com Thu Jan 20 11:18:12 2011 From: jrgrauh at yahoo.com (Joerg Rauh) Date: Thu, 20 Jan 2011 09:18:12 -0800 (PST) Subject: [Maxima] next_prime(113) = 121 with Ecl 11.1.1 ! In-Reply-To: <20110120161435.GE32073@cs-wsok.swansea.ac.uk> References: <20110120161435.GE32073@cs-wsok.swansea.ac.uk> Message-ID: <554420.94082.qm@web45316.mail.sp1.yahoo.com> Hello Oliver, using Maxima 5.22.1 I ran s:0$ for i: 1 while i<=1000 do if primep(i) then (s:s+1, print(i, s)); The last line displays: 997 168 So you might consider using version 5.22.1 Best of luck and best regards Joerg ________________________________ From: Oliver Kullmann To: maxima at math.utexas.edu Sent: Thu, January 20, 2011 5:14:35 PM Subject: [Maxima] next_prime(113) = 121 with Ecl 11.1.1 ! Hello, Maxima 5.21.1 as well as 5.23.2, built with Ecl 11.1.1, has a completely corrupted next_prime function, e.g. next_prime(113) = 121 = 11^2 (determining all "primes" within {1,...,1000} yields 231 "primes", while there are 168). Don't know whether this is an Ecl or a Maxima (or a joint) problem. Would be good to find out. In any case, it would be good if Maxima had tests which would catch these failures (for example determining all primes within an interval, and counting them). Best regards Oliver _______________________________________________ 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 Jan 20 11:26:02 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 20 Jan 2011 12:26:02 -0500 Subject: [Maxima] next_prime(113) = 121 with Ecl 11.1.1 ! In-Reply-To: <20110120161435.GE32073@cs-wsok.swansea.ac.uk> References: <20110120161435.GE32073@cs-wsok.swansea.ac.uk> Message-ID: <4D38702A.80809@gmail.com> On 1/20/11 11:14 AM, Oliver Kullmann wrote: > Hello, > > Maxima 5.21.1 as well as 5.23.2, built with Ecl 11.1.1, > has a completely corrupted next_prime function, e.g. > next_prime(113) = 121 = 11^2 > (determining all "primes" within {1,...,1000} yields 231 > "primes", while there are 168). > > Don't know whether this is an Ecl or a Maxima (or a joint) problem. > Would be good to find out. Possibly a bug in ecl. I get 121 using ecl 11.1.1, but both clisp and cmucl say 127. Ray From mhw at netris.org Thu Jan 20 11:31:06 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 20 Jan 2011 12:31:06 -0500 Subject: [Maxima] next_prime(113) = 121 with Ecl 11.1.1 ! In-Reply-To: <20110120161435.GE32073@cs-wsok.swansea.ac.uk> (Oliver Kullmann's message of "Thu, 20 Jan 2011 16:14:35 +0000") References: <20110120161435.GE32073@cs-wsok.swansea.ac.uk> Message-ID: <87wrlzv5wl.fsf@yeeloong.netris.org> Oliver Kullmann wrote: > Maxima 5.21.1 as well as 5.23.2, built with Ecl 11.1.1, > has a completely corrupted next_prime function, e.g. > next_prime(113) = 121 = 11^2 > (determining all "primes" within {1,...,1000} yields 231 > "primes", while there are 168). > > Don't know whether this is an Ecl or a Maxima (or a joint) problem. > Would be good to find out. On my system, Maxima 5.23.2 on GCL 2.6.7, next_prime(113) yields 127. Mark From alexanderk.hansen at gmail.com Thu Jan 20 11:56:12 2011 From: alexanderk.hansen at gmail.com (Alexander Hansen) Date: Thu, 20 Jan 2011 12:56:12 -0500 Subject: [Maxima] next_prime(113) = 121 with Ecl 11.1.1 ! In-Reply-To: <20110120161435.GE32073@cs-wsok.swansea.ac.uk> References: <20110120161435.GE32073@cs-wsok.swansea.ac.uk> Message-ID: <4D38773C.2000702@gmail.com> On 1/20/11 11:14 AM, Oliver Kullmann wrote: > Hello, > > Maxima 5.21.1 as well as 5.23.2, built with Ecl 11.1.1, > has a completely corrupted next_prime function, e.g. > next_prime(113) = 121 = 11^2 > (determining all "primes" within {1,...,1000} yields 231 > "primes", while there are 168). > > Don't know whether this is an Ecl or a Maxima (or a joint) problem. > Would be good to find out. > > In any case, it would be good if Maxima had tests which would catch > these failures (for example determining all primes within an interval, > and counting them). > > Best regards > > Oliver > It works for me on 5.23.2 with SBCL-1.0.45 (Mac OS 10.6, 32 or 64 bit): $ maxima Maxima 5.23.2 http://maxima.sourceforge.net using Lisp SBCL 1.0.45 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) next_prime(113); (%o1) 127 -- Alexander Hansen, Ph.D. Fink User Liaison From toy.raymond at gmail.com Thu Jan 20 12:42:52 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 20 Jan 2011 13:42:52 -0500 Subject: [Maxima] next_prime(113) = 121 with Ecl 11.1.1 ! In-Reply-To: <20110120161435.GE32073@cs-wsok.swansea.ac.uk> References: <20110120161435.GE32073@cs-wsok.swansea.ac.uk> Message-ID: <4D38822C.4070601@gmail.com> On 1/20/11 11:14 AM, Oliver Kullmann wrote: > Hello, > > Maxima 5.21.1 as well as 5.23.2, built with Ecl 11.1.1, > has a completely corrupted next_prime function, e.g. > next_prime(113) = 121 = 11^2 > (determining all "primes" within {1,...,1000} yields 231 > "primes", while there are 168). > > Don't know whether this is an Ecl or a Maxima (or a joint) problem. > Would be good to find out. Now that everyone has verified that other lisps don't show this, how about fixing it? A peek at next-prime-det in src/ifactor.lisp has this bit of code: (loop while 1 do (dolist (p *small-primes*) (if (= (mmod n p) 0) (return)) (if (>= (* p p) n) (return-from next-prime-det n))) (incf n (nth (mmod n 210) deltaprimes))) For whatever reason, ecl doesn't execute the loop. It should because "1" is equivalent to true. When I change the 1 to T, ecl returns 127 as the next prime. Of course, since this is an infinite loop, we could just get rid of the "while 1 do" part and just use plain loop. Sounds like a bug in ecl to me. Ray From toy.raymond at gmail.com Thu Jan 20 12:45:02 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 20 Jan 2011 13:45:02 -0500 Subject: [Maxima] rtest14, closeto, and ecl (Was Re: Maxima 5.23.1 tagged) In-Reply-To: References: <4D352B1A.7010105@gmail.com> , <4D36451D.80300@gmail.com> Message-ID: <4D3882AE.4010700@gmail.com> On 1/18/11 9:43 PM, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > >> I don't really understand how closeto is supposed to work. When abse >= >> tol, it's supposed to return abse. Shouldn't that be a number, not some >> symbolic expression? > Maybe float_approx_equal (defined in mload) provides a better way to do the > comparison. Or maybe not...I think I wrote float_approx_equal. > > No problem with using something else, but this example strikes me as a serious issue. But maybe it's a bug in ecl. I don't know and it's hard to tell. Ray From O.Kullmann at swansea.ac.uk Thu Jan 20 12:45:10 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Thu, 20 Jan 2011 18:45:10 +0000 Subject: [Maxima] next_prime(113) = 121 with Ecl 11.1.1 ! In-Reply-To: <4D38702A.80809@gmail.com> References: <20110120161435.GE32073@cs-wsok.swansea.ac.uk> <4D38702A.80809@gmail.com> Message-ID: <20110120184510.GH32073@cs-wsok.swansea.ac.uk> On Thu, Jan 20, 2011 at 12:26:02PM -0500, Raymond Toy wrote: > On 1/20/11 11:14 AM, Oliver Kullmann wrote: > > Hello, > > > > Maxima 5.21.1 as well as 5.23.2, built with Ecl 11.1.1, > > has a completely corrupted next_prime function, e.g. > > next_prime(113) = 121 = 11^2 > > (determining all "primes" within {1,...,1000} yields 231 > > "primes", while there are 168). > > > > Don't know whether this is an Ecl or a Maxima (or a joint) problem. > > Would be good to find out. > Possibly a bug in ecl. I get 121 using ecl 11.1.1, but both clisp and > cmucl say 127. > I forget to mention that with Ecl 10.4.1 we get the correct results. I'll report it to the Ecl list. Oliver From O.Kullmann at swansea.ac.uk Thu Jan 20 12:47:19 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Thu, 20 Jan 2011 18:47:19 +0000 Subject: [Maxima] next_prime(113) = 121 with Ecl 11.1.1 ! In-Reply-To: <554420.94082.qm@web45316.mail.sp1.yahoo.com> References: <20110120161435.GE32073@cs-wsok.swansea.ac.uk> <554420.94082.qm@web45316.mail.sp1.yahoo.com> Message-ID: <20110120184719.GI32073@cs-wsok.swansea.ac.uk> primep seems to work with Ecl 11.1.1, only next_prime yields false results. And since I get the same results for Maxima 5.21.1 and 5.23.2, it seems not depending on the Maxima version. So likely an Ecl bug. Thanks Oliver On Thu, Jan 20, 2011 at 09:18:12AM -0800, Joerg Rauh wrote: > Hello Oliver, > > > using Maxima 5.22.1 I ran > > s:0$ > for i: 1 while i<=1000 > do if primep(i) then (s:s+1, print(i, s)); > > > The last line displays: 997 168 > > So you might consider using version 5.22.1 > > Best of luck and best regards > > Joerg > > > > > ________________________________ > From: Oliver Kullmann > To: maxima at math.utexas.edu > Sent: Thu, January 20, 2011 5:14:35 PM > Subject: [Maxima] next_prime(113) = 121 with Ecl 11.1.1 ! > > Hello, > > Maxima 5.21.1 as well as 5.23.2, built with Ecl 11.1.1, > has a completely corrupted next_prime function, e.g. > next_prime(113) = 121 = 11^2 > (determining all "primes" within {1,...,1000} yields 231 > "primes", while there are 168). > > Don't know whether this is an Ecl or a Maxima (or a joint) problem. > Would be good to find out. > > In any case, it would be good if Maxima had tests which would catch > these failures (for example determining all primes within an interval, > and counting them). > > Best regards > > Oliver > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > > > -- Dr. Oliver Kullmann Computer Science Department Swansea University Faraday Building, Singleton Park Swansea SA2 8PP, UK http://cs.swan.ac.uk/~csoliver/ From mhw at netris.org Thu Jan 20 12:54:15 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 20 Jan 2011 13:54:15 -0500 Subject: [Maxima] Implementation of random_permutation In-Reply-To: (Matthew Gwynne's message of "Wed, 19 Jan 2011 18:55:11 +0000") References: Message-ID: <87sjwnv220.fsf@yeeloong.netris.org> Matthew Gwynne wrote: > In our work, we make quite a lot of use of functions such as > random_permutation for various experiments. In certain instances where > performance is a big issue, we'd like to implement parts of the system > in C++. However, we'd like to make sure that anything we write matches > up with what we have at the Maxima level. > > To be able to do this, we need to know how the function > random_permutation works to be able to replicate it in C++. [...] > Could anyone point me to some relevant documentation or maybe point me > to some code for how these are implemented? The code for random_permutation is in maxima/src/nset.lisp: (defun $random_permutation (a) (if ($listp a) (setq a (copy-list (cdr a))) (setq a (copy-list (require-set a "$random_permutation")))) (let ((n (length a))) (dotimes (i n) (let ((j (+ i ($random (- n i)))) (tmp (nth i a))) (setf (nth i a) (nth j a)) (setf (nth j a) tmp)))) `((mlist) , at a)) Here's a translation into pseudo-code, with zero-based arrays: random_permutation(array a1) { a <-- copy_array(a1); n <-- length(a); for i from 0 to n-1 do { j <-- random integer (such that i <= j < n); swap(a[i],a[j]); } return(a); } The random number generator used here is Mersenne Twister, MT19937, due to Makoto Matsumoto and T. Nishimura, "Mersenne twister: A 623-dimensionally equidistributed uniform pseudorandom number generator.", ACM Transactions on Modeling and Computer Simulation, 1997. Mark From macrakis at alum.mit.edu Thu Jan 20 12:11:04 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 20 Jan 2011 13:11:04 -0500 Subject: [Maxima] exp(complex)^k Message-ID: declare(z,complex)$ (%e^x)^y => %e^(x*y) (%e^z)^y => (%e^z)^y Can I turn off "pedantic mode" so that the second yields %e^(z*y)? From toy.raymond at gmail.com Thu Jan 20 12:56:13 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 20 Jan 2011 13:56:13 -0500 Subject: [Maxima] segmentation faults when loading Lisp code In-Reply-To: <20110120163821.GG32073@cs-wsok.swansea.ac.uk> References: <20110120163821.GG32073@cs-wsok.swansea.ac.uk> Message-ID: <4D38854D.7010909@gmail.com> On 1/20/11 11:38 AM, Oliver Kullmann wrote: > Hello, > > we have a problem with Maxima, the same in 5.21.1 and 5.23.2, > where we use Ecl 10.4.1. > > [snip] > This all works when called from the Maxima shell, but Maxima segfaults when loading a file > containing the expression > > default_memory_ecl(); > > (where this file loads the .mac-file containing the above Maxima-definitions, and > that file loads the file with the above Lisp-definitions). > > Whether the segfault occurs depends on the circumstances, sometimes a "batch" > succeeds where a load doesn't. But altogether it seems completely impossible > to set the memory-limits in batch-mode (and that's what we need --- we need to > run Maxima in batch-mode for performing many computations, which all need more > memory). FWIW, I can reproduce this by putting load("ecl-size.lisp"); load("eclset.mac"); default_memory_ecl(); in testecl.mac, and running batch("testecl.mac"). The file ecl-size.lisp contains the lisp code, and eclset.mac contains maxima code you gave. I don't know enough about ecl to say more than this. Ray From toy.raymond at gmail.com Thu Jan 20 13:13:03 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 20 Jan 2011 14:13:03 -0500 Subject: [Maxima] Implementation of random_permutation In-Reply-To: References: Message-ID: <4D38893F.80208@gmail.com> On 1/19/11 1:55 PM, Matthew Gwynne wrote: > Hi, > > documentation suggests is used for the Maxima random number > generator), so it seems it should be easy, however, it's not clear > exactly how Maxima extracts integers from the state of the Mersenne > twister, or precisely the implementation of the random_permutation > function even if the random number generation were the same. Maxima's implemention is in the file src/rand-mt19937.lisp. From a quick look at the code, a large integer is obtained by just concatenating a bunch of 32-bit integers produced by the generator. The first generated value is in the least significant position. > > P.S - As a note, in the coming C++ standard there will be random > number generators and so on guaranteed by the standard library, and so > it might make sense if simply using std::random_shuffle with the > standard number generator yielded the same results as > random_permutation in Maxima? This would make a description of the > behaviour in the documentation very simple, as one could just point to > the more elaborated C++ standard. That doesn't really help. Maxima is not written in C++. If the algorithm is described, perhaps we could use the same algorithm. But if it's different from what maxima already uses, then it might also break existing code. So, unless maxima's version is broken, I think we should keep maxima's implementation as is. Ray From fateman at eecs.berkeley.edu Thu Jan 20 13:23:44 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 20 Jan 2011 11:23:44 -0800 Subject: [Maxima] segmentation faults when loading Lisp code In-Reply-To: <4D38854D.7010909@gmail.com> References: <20110120163821.GG32073@cs-wsok.swansea.ac.uk> <4D38854D.7010909@gmail.com> Message-ID: <4D388BC0.6020200@eecs.berkeley.edu> It seems perfectly likely that ECL cannot change its memory configuration properly when there is some program running. Perhaps the changes to memory have to be done from the top-level read-eval-print loop, or even on a (unix?) command line. Changing the stack size when you are running is kind of like trying to change your socks while you are standing. If you have an open file (using batch) it may be like standing in shoes. Other lisp systems seem to require various drastic measures to change the memory size, like re-loading or even re-compiling (GCL?). The fact that ECL stays up when the commands are called from the shell (sometimes) is a plus. Something to try, perhaps: read in a program (via batch) but do not execute it until you close the batch file. I suspect you might find more robust support for this kind of fiddling from one of the commercial Lisps, but this is merely a guess from someone who does not have any knowledge of ECL. RJF From drdieterkaiser at web.de Thu Jan 20 14:25:16 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 20 Jan 2011 21:25:16 +0100 Subject: [Maxima] exp(complex)^k In-Reply-To: References: Message-ID: <1295555116.6959.1.camel@dieter> Am Donnerstag, den 20.01.2011, 13:11 -0500 schrieb Stavros Macrakis: > declare(z,complex)$ > (%e^x)^y => %e^(x*y) > (%e^z)^y => (%e^z)^y > > Can I turn off "pedantic mode" so that the second yields %e^(z*y)? It is the flag radexpand which switches off the "pedantic mode": (%i13) declare(z,complex); (%o13) done (%i14) exp(z)^y; (%o14) (%e^z)^y (%i15) exp(z)^y,radexpand:all; (%o15) %e^(y*z) Dieter Kaiser From mhw at netris.org Thu Jan 20 14:38:54 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 20 Jan 2011 15:38:54 -0500 Subject: [Maxima] Better implementation of random_permutation In-Reply-To: <87sjwnv220.fsf@yeeloong.netris.org> (Mark H. Weaver's message of "Thu, 20 Jan 2011 13:54:15 -0500") References: <87sjwnv220.fsf@yeeloong.netris.org> Message-ID: <87ipxjux7l.fsf_-_@yeeloong.netris.org> > The code for random_permutation is in maxima/src/nset.lisp: > > (defun $random_permutation (a) > (if ($listp a) > (setq a (copy-list (cdr a))) > (setq a (copy-list (require-set a "$random_permutation")))) > > (let ((n (length a))) > (dotimes (i n) > (let > ((j (+ i ($random (- n i)))) > (tmp (nth i a))) > (setf (nth i a) (nth j a)) > (setf (nth j a) tmp)))) > > `((mlist) , at a)) Note that the implementation above is quite slow, O(n^2). Here's a much faster O(n) version: (defun $random_permutation (arg) (let* ((lst (if ($listp arg) (cdr arg) (require-set arg "$random_permutation"))) (a (make-array (length lst)))) (loop for x in lst and i from 0 do (shiftf (svref a i) (svref a (random (1+ i))) x)) (cons '(mlist) (loop for x across a collect x)))) On my system (Maxima 5.23.2 on GCL 2.6.7 on a Loongson processor), this version runs about 46 times faster on a list of length 1000. Any objections to me committing this change to the trunk? Mark PS: here's equivalent pseudo-code for the new version: random_permutation(array b) { n <-- length(b); a <-- new_array(n); for i from 0 to n-1 do { j <-- random integer (such that 0 <= j <= i); a[i] <-- a[j]; a[j] <-- b[i]; } return(a); } From robert.dodier at gmail.com Thu Jan 20 15:28:33 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 20 Jan 2011 14:28:33 -0700 Subject: [Maxima] Better implementation of random_permutation In-Reply-To: <87ipxjux7l.fsf_-_@yeeloong.netris.org> References: <87sjwnv220.fsf@yeeloong.netris.org> <87ipxjux7l.fsf_-_@yeeloong.netris.org> Message-ID: Hmm, this is the same Knuth shuffle expressed in a different way, right? If so the only problem I see is that the random numbers should come from Maxima's $RANDOM and not CL RANDOM (so that random_permutation respects the seed the user sets, if any). Thanks for taking a look at it -- Robert Dodier On 1/20/11, Mark H Weaver wrote: >> The code for random_permutation is in maxima/src/nset.lisp: >> >> (defun $random_permutation (a) >> (if ($listp a) >> (setq a (copy-list (cdr a))) >> (setq a (copy-list (require-set a "$random_permutation")))) >> >> (let ((n (length a))) >> (dotimes (i n) >> (let >> ((j (+ i ($random (- n i)))) >> (tmp (nth i a))) >> (setf (nth i a) (nth j a)) >> (setf (nth j a) tmp)))) >> >> `((mlist) , at a)) > > Note that the implementation above is quite slow, O(n^2). > Here's a much faster O(n) version: > > (defun $random_permutation (arg) > (let* ((lst (if ($listp arg) > (cdr arg) > (require-set arg "$random_permutation"))) > (a (make-array (length lst)))) > (loop for x in lst > and i from 0 > do (shiftf (svref a i) > (svref a (random (1+ i))) > x)) > (cons '(mlist) > (loop for x across a > collect x)))) > > On my system (Maxima 5.23.2 on GCL 2.6.7 on a Loongson processor), > this version runs about 46 times faster on a list of length 1000. > > Any objections to me committing this change to the trunk? > > Mark > > > PS: here's equivalent pseudo-code for the new version: > > random_permutation(array b) > { > n <-- length(b); > a <-- new_array(n); > for i from 0 to n-1 do > { > j <-- random integer (such that 0 <= j <= i); > a[i] <-- a[j]; > a[j] <-- b[i]; > } > return(a); > } > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From robert.dodier at gmail.com Thu Jan 20 15:35:29 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 20 Jan 2011 14:35:29 -0700 Subject: [Maxima] Implementation of random_permutation In-Reply-To: <4D38893F.80208@gmail.com> References: <4D38893F.80208@gmail.com> Message-ID: IIRC Maxima's MT implement generates chunks of 32 bits at a time, and uses those to construct the output which is some number of bits wide. For each N-bit output, Maxima uses 1 + floor(N/32) chunks. Any leftover bits are thrown away (not used for the next output). All correct implementations of MT19937 should yield the same output given the same initial state, should they not? (Otherwise, it would seem, the nice properties of MT prng's aren't guaranteed.) best, Robert Dodier On 1/20/11, Raymond Toy wrote: > On 1/19/11 1:55 PM, Matthew Gwynne wrote: >> Hi, >> >> documentation suggests is used for the Maxima random number >> generator), so it seems it should be easy, however, it's not clear >> exactly how Maxima extracts integers from the state of the Mersenne >> twister, or precisely the implementation of the random_permutation >> function even if the random number generation were the same. > Maxima's implemention is in the file src/rand-mt19937.lisp. From a > quick look at the code, a large integer is obtained by just > concatenating a bunch of 32-bit integers produced by the generator. The > first generated value is in the least significant position. > >> >> P.S - As a note, in the coming C++ standard there will be random >> number generators and so on guaranteed by the standard library, and so >> it might make sense if simply using std::random_shuffle with the >> standard number generator yielded the same results as >> random_permutation in Maxima? This would make a description of the >> behaviour in the documentation very simple, as one could just point to >> the more elaborated C++ standard. > That doesn't really help. Maxima is not written in C++. > > If the algorithm is described, perhaps we could use the same algorithm. > But if it's different from what maxima already uses, then it might also > break existing code. So, unless maxima's version is broken, I think we > should keep maxima's implementation as is. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From mhw at netris.org Thu Jan 20 15:36:06 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 20 Jan 2011 16:36:06 -0500 Subject: [Maxima] Better implementation of random_permutation In-Reply-To: <87ipxjux7l.fsf_-_@yeeloong.netris.org> (Mark H. Weaver's message of "Thu, 20 Jan 2011 15:38:54 -0500") References: <87sjwnv220.fsf@yeeloong.netris.org> <87ipxjux7l.fsf_-_@yeeloong.netris.org> Message-ID: <87ei87uuk9.fsf@yeeloong.netris.org> I wrote: > On my system (Maxima 5.23.2 on GCL 2.6.7 on a Loongson processor), > this version runs about 46 times faster on a list of length 1000. Furthermore, it runs about 27 times faster on a list of length 100, and about 8.7 times faster on a list of length 10. Note that these timings are based on the total computation time (as measured by showtime:true) when calling random_permutation many times on the same list as follows: showtime:true$ lst: makelist(random(10),n,1,10)$ for i:1 thru 10000 do random_permutation(lst)$ lst: makelist(random(100),n,1,10)$ for i:1 thru 1000 do random_permutation(lst)$ lst: makelist(random(1000),n,1,10)$ for i:1 thru 100 do random_permutation(lst)$ > Any objections to me committing this change to the trunk? Mark From pbowyer at olynet.com Thu Jan 20 15:37:21 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Thu, 20 Jan 2011 13:37:21 -0800 Subject: [Maxima] Maxima-5.23.2 In-Reply-To: References: <4D375953.1010701@olynet.com> Message-ID: <4D38AB11.5080000@olynet.com> On 01/19/2011 08:58 PM, Andrey G. Grozin wrote: > On Wed, 19 Jan 2011, Paul Bowyer wrote: >> I'm using the following, which I also built from source (including GCL): >> wxMaxima 0.8.7 >> wxWidgets: 2.8.11 >> Unicode support: yes >> Maxima version: 5.23.2 >> Lisp: GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) > There is no such a thing as gcl-2.6.8. What exactly do you mean? cvs > snapshot (when)? Debian patch (which)? > > Andrey > Andrey: Yes, I built it from source taken from CVS. cvs -d :pserver:anonymous at cvs.sv.gnu.org:/sources/gcl co -d gcl-2.6.8pre -r Version_2_6_8pre gcl It probably should have been named gcl-2.6.8pre, or something like that, but it was for my own personal repository (as I tried to explain) so I wasn't too careful with the naming. Paul From mhw at netris.org Thu Jan 20 16:54:43 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 20 Jan 2011 17:54:43 -0500 Subject: [Maxima] Better implementation of random_permutation In-Reply-To: (Robert Dodier's message of "Thu, 20 Jan 2011 14:28:33 -0700") References: <87sjwnv220.fsf@yeeloong.netris.org> <87ipxjux7l.fsf_-_@yeeloong.netris.org> Message-ID: <87aaivuqx8.fsf@yeeloong.netris.org> Robert Dodier writes: > Hmm, this is the same Knuth shuffle expressed in a different way, > right? It's the slightly more efficient "inside-out" variant of the Knuth shuffle, a.k.a. Fisher-Yates shuffle. > If so the only problem I see is that the random numbers should > come from Maxima's $RANDOM and not CL RANDOM Oops, good catch! Unfortunately, $RANDOM is much slower than CL RANDOM. On my machine, it's about 37 times slower. When using $RANDOM, my new $RANDOM_PERMUTATION is only faster on my machine for lists with hundreds of elements: For size 10000, it's faster: ratio=5.15 For size 1000, it's faster: ratio=1.23 For size 100, it's slower: ratio=0.95 For size 10, it's slower: ratio=0.93 Mark From JoanR at beaufortccc.edu Thu Jan 20 17:50:05 2011 From: JoanR at beaufortccc.edu (Joan Robson) Date: Thu, 20 Jan 2011 18:50:05 -0500 Subject: [Maxima] delete from list Message-ID: <4D3883DD020000D10001585B@gwise.beaufortccc.edu> please delete me from this list. thank you. Special Populations Coordinator Beaufort County Community College P.O. Box 1069 Washington,NC 27889 E-mail correspondence to and from this sender may be subject to the North Carolina Public Records law and may be disclosed to third parties. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Thu Jan 20 19:19:43 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 20 Jan 2011 18:19:43 -0700 Subject: [Maxima] Maxima-5.23.2 In-Reply-To: <4D38AB11.5080000@olynet.com> References: <4D375953.1010701@olynet.com> <4D38AB11.5080000@olynet.com> Message-ID: IIRC gcl 2.6.8pre reports its version number as 2.6.8. I think that's something of a mess, but whatever. FWIW Robert Dodier On 1/20/11, Paul Bowyer wrote: > On 01/19/2011 08:58 PM, Andrey G. Grozin wrote: >> On Wed, 19 Jan 2011, Paul Bowyer wrote: >>> I'm using the following, which I also built from source (including GCL): >>> wxMaxima 0.8.7 >>> wxWidgets: 2.8.11 >>> Unicode support: yes >>> Maxima version: 5.23.2 >>> Lisp: GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) >> There is no such a thing as gcl-2.6.8. What exactly do you mean? cvs >> snapshot (when)? Debian patch (which)? >> >> Andrey >> > Andrey: > > Yes, I built it from source taken from CVS. > cvs -d :pserver:anonymous at cvs.sv.gnu.org:/sources/gcl co -d gcl-2.6.8pre > -r Version_2_6_8pre gcl > > It probably should have been named gcl-2.6.8pre, or something like > that, but it was for my own personal repository (as I tried to explain) > so I wasn't too careful with the naming. > > Paul > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From O.Kullmann at swansea.ac.uk Fri Jan 21 13:00:01 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Fri, 21 Jan 2011 19:00:01 +0000 Subject: [Maxima] segmentation faults when loading Lisp code In-Reply-To: <4D388BC0.6020200@eecs.berkeley.edu> References: <20110120163821.GG32073@cs-wsok.swansea.ac.uk> <4D38854D.7010909@gmail.com> <4D388BC0.6020200@eecs.berkeley.edu> Message-ID: <20110121190001.GS32073@cs-wsok.swansea.ac.uk> okay, thanks; so I try now to compile Ecl with the new defaults (just need to find these constants somewhere ...). For us that's perfectly already, since we re-distribute Maxima together with Ecl, and build it ourselves. Thanks again! Oliver On Thu, Jan 20, 2011 at 11:23:44AM -0800, Richard Fateman wrote: > It seems perfectly likely that ECL cannot change its memory > configuration properly > when there is some program running. Perhaps the changes to memory have > to be done from the top-level read-eval-print loop, or even on a (unix?) > command line. > > Changing the stack size when you are running is kind of like trying to > change > your socks while you are standing. > If you have an open file (using batch) it may be like standing in shoes. > > Other lisp systems seem to require various drastic measures to change > the memory size, like re-loading or even re-compiling (GCL?). > > The fact that ECL stays up when the commands are called from the > shell (sometimes) is a plus. > > Something to try, perhaps: read in a program (via batch) but do not > execute > it until you close the batch file. > > I suspect you might find more robust support > for this kind of fiddling from one of the commercial Lisps, but this > is merely a guess from someone who does not have any > knowledge of ECL. > > RJF > From mathew.gwynne at gmail.com Fri Jan 21 15:53:36 2011 From: mathew.gwynne at gmail.com (Matthew Gwynne) Date: Fri, 21 Jan 2011 21:53:36 +0000 Subject: [Maxima] Implementation of random_permutation In-Reply-To: References: <4D38893F.80208@gmail.com> Message-ID: Thanks all! On Thu, Jan 20, 2011 at 9:35 PM, Robert Dodier wrote: > IIRC Maxima's MT implement generates chunks of 32 bits at a time, > and uses those to construct the output which is some number > of bits wide. For each N-bit output, Maxima uses 1 + floor(N/32) chunks. > Any leftover bits are thrown away (not used for the next output). Ah yes, I've found this now. Is this described in the mt19937 standard? Or is this simply one way out of many to do this? > > All correct implementations of MT19937 should yield the same output > given the same initial state, should they not? > (Otherwise, it would seem, the nice properties of MT prng's aren't guaranteed.) Indeed, although I guess it's how one then casts the result down into the correct range that might be different. I'll keep looking into it. Thanks! Matthew Gwynne From toy.raymond at gmail.com Sat Jan 22 10:31:23 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 22 Jan 2011 11:31:23 -0500 Subject: [Maxima] Implementation of random_permutation In-Reply-To: References: <4D38893F.80208@gmail.com> Message-ID: <4D3B065B.1090800@gmail.com> On 1/21/11 4:53 PM, Matthew Gwynne wrote: > Thanks all! > > On Thu, Jan 20, 2011 at 9:35 PM, Robert Dodier wrote: >> IIRC Maxima's MT implement generates chunks of 32 bits at a time, >> and uses those to construct the output which is some number >> of bits wide. For each N-bit output, Maxima uses 1 + floor(N/32) chunks. >> Any leftover bits are thrown away (not used for the next output). > Ah yes, I've found this now. Is this described in the mt19937 > standard? Or is this simply one way out of many to do this? No, I don't think there's a description of how to do this in the mt19937 docs. There is an example, I think, of how to create a 64-bit floating-point number from the 32-bit values, though. And cmucl actually only takes part of each 32-bit integer and concatenates them to create the larger integer. This, I think, is for historical reasons where the old generator produced 32-bit chunks where the least (or most?) significant bits were not as random as the rest. Ray From fateman at eecs.berkeley.edu Sat Jan 22 11:47:01 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 22 Jan 2011 09:47:01 -0800 Subject: [Maxima] Implementation of random_permutation In-Reply-To: <4D3B065B.1090800@gmail.com> References: <4D38893F.80208@gmail.com> <4D3B065B.1090800@gmail.com> Message-ID: <4D3B1815.9020708@eecs.berkeley.edu> On 1/22/2011 8:31 AM, Raymond Toy wrote: > On 1/21/11 4:53 PM, Matthew Gwynne wrote: >> Thanks all! >> >> On Thu, Jan 20, 2011 at 9:35 PM, Robert Dodier wrote: >>> IIRC Maxima's MT implement generates chunks of 32 bits at a time, >>> and uses those to construct the output which is some number >>> of bits wide. For each N-bit output, Maxima uses 1 + floor(N/32) chunks. >>> Any leftover bits are thrown away (not used for the next output). >> Ah yes, I've found this now. Is this described in the mt19937 >> standard? Or is this simply one way out of many to do this? > No, I don't think there's a description of how to do this in the mt19937 > docs. There is an example, I think, of how to create a 64-bit > floating-point number from the 32-bit values, though. And cmucl > actually only takes part of each 32-bit integer and concatenates them to > create the larger integer. This, I think, is for historical reasons > where the old generator produced 32-bit chunks where the least (or > most?) significant bits were not as random as the rest. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Using a random number generator built in to Lisp probably has the cost that the answer must be allocated space (put in a "box") by the random() function. The costs associated with this can be considerable. (Though a "clever enough" compiler might eliminate them.) I found, in an exercise I went through quite a few years ago (a cellular automaton simulation with random transitions), that using random floats was a bad idea; using random fixnums generated by an external program, stored in an array and then used cyclically, was a major win. I think it sped up my program by 20X. That is, 95% of the original program was spent in random number generation. I see that the paper was never even posted, so I just updated it slightly and posted it as http://www.cs.berkeley.edu/~fateman/papers/cashort.pdf RJF From pbowyer at olynet.com Sat Jan 22 14:07:22 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sat, 22 Jan 2011 12:07:22 -0800 Subject: [Maxima] Maxima-5.23.2 In-Reply-To: References: <4D375953.1010701@olynet.com> <4D38AB11.5080000@olynet.com> Message-ID: <4D3B38FA.9090900@olynet.com> Robert: I tried some chicanery to see if I could change the way gcl-2.6.8pre reports its version number, but I was unsuccessful. If you are aware of a method to accomplish that, I'll see if I can make it happen. It's a small thing to me that it reports itself the way it does. I'm more interested in having Maxima corrected so the bug related to 00 and sum() no longer show up, but I have no idea how involved that task might be, so I am at the mercy of the Maxima developers. I imagine there are many more important tasks facing the developers, so I'll just try to be patient. Paul Bowyer On 01/20/2011 05:19 PM, Robert Dodier wrote: > IIRC gcl 2.6.8pre reports its version number as 2.6.8. > I think that's something of a mess, but whatever. > > FWIW > > Robert Dodier > > On 1/20/11, Paul Bowyer wrote: >> On 01/19/2011 08:58 PM, Andrey G. Grozin wrote: >>> On Wed, 19 Jan 2011, Paul Bowyer wrote: >>>> I'm using the following, which I also built from source (including GCL): >>>> wxMaxima 0.8.7 >>>> wxWidgets: 2.8.11 >>>> Unicode support: yes >>>> Maxima version: 5.23.2 >>>> Lisp: GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) >>> There is no such a thing as gcl-2.6.8. What exactly do you mean? cvs >>> snapshot (when)? Debian patch (which)? >>> >>> Andrey >>> >> Andrey: >> >> Yes, I built it from source taken from CVS. >> cvs -d :pserver:anonymous at cvs.sv.gnu.org:/sources/gcl co -d gcl-2.6.8pre >> -r Version_2_6_8pre gcl >> >> It probably should have been named gcl-2.6.8pre, or something like >> that, but it was for my own personal repository (as I tried to explain) >> so I wasn't too careful with the naming. >> >> 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 Jan 22 14:48:15 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 22 Jan 2011 14:48:15 -0600 Subject: [Maxima] Maxima-5.23.2 In-Reply-To: <4D3B38FA.9090900@olynet.com> References: <4D375953.1010701@olynet.com> <4D38AB11.5080000@olynet.com> , <4D3B38FA.9090900@olynet.com> Message-ID: >????I'm?more?interested?in?having?Maxima?corrected?so?the?bug?related?to >????00?and?sum()?no?longer?show?up, Maybe you would like to write your own power function that does power(0,0) --> 1. Functions such as simplify_sum would not recognize your power function, but in some contexts, maybe your own power function would work for you. I don't know much about the limit code, but I think it sometimes does what I call a spaghetti test (throw it against the wall and see if it sticks). That is, the limit code sometimes tries to evaluate a limit by direct substitution. Provided no errors result, limit thinks all is well. That is, I think, a poor method. Similarly, the definite integration code has a weak (and silly) check for continuity of the antiderivative (the undocumented option variable 'nointegrate' alters this check, I think). Both the limit code and the definite integration code could use a predicate that *tries* to determine if an expression is continuous (at a point or on an interval). Of course, such a predicate cannot be perfect, but it could at least be as good as an average freshman calculus student and better than the current spaghetti tests. In short, don't hold your breath for a 0^0 --> 1 option. --Barton From pbowyer at olynet.com Sat Jan 22 16:32:27 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sat, 22 Jan 2011 14:32:27 -0800 Subject: [Maxima] Maxima-5.23.2 In-Reply-To: References: <4D375953.1010701@olynet.com> <4D38AB11.5080000@olynet.com> , <4D3B38FA.9090900@olynet.com> Message-ID: <4D3B5AFB.8050100@olynet.com> Barton: I'm breathing easy... The sum() method is now producing an error message for the 0^0 condition, which it should. When I originally reported I was having problems (I was using Maxima-5.20.1), the sum() method was producing '0' for that condition, which was giving me incorrect results. I should have left out the part about the sum() method in my original posting for "Re: [Maxima] Maxima-5.23.2" because that was partially fixed some time ago. I just grabbed the input I had used in a message concerning "Re: [Maxima] Maxima 5.22.0" to indicate that things were still the same for Maxima 5.23.2. I should have been more discerning and only presented the part that was incorrect. I wasn't advocating a 0^0 --> 1 solution. Even my TI calculator doesn't recognize that as valid. The input 0^i gives 0 as output before Maxima knows anything about 'i' whereas my TI calculator produces an error message telling me that 'i' is undefined. Once 'i' is assumed to be '>=0' then 0^i in Maxima it again produces 0 for output as I think it should NOT, but rather it should indicate an error for 0^0. These "little" errors catch me napping periodically by producing incorrect results that I have to chase down to discover if the problem is in my math (more often than I want to admit) or Maxima's results. Paul Bowyer On 01/22/2011 12:48 PM, Barton Willis wrote: > In short, don't hold your breath for a 00 --> 1 option. -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sat Jan 22 16:57:03 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 22 Jan 2011 16:57:03 -0600 Subject: [Maxima] Maxima-5.23.2 In-Reply-To: <4D3B5AFB.8050100@olynet.com> References: <4D375953.1010701@olynet.com> <4D38AB11.5080000@olynet.com> , <4D3B38FA.9090900@olynet.com> , <4D3B5AFB.8050100@olynet.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >????I?wasn't?advocating?a?0^0?-->?1?solution.? Oh, I thought that maybe you were bothered by (%i1) assume(0 < x, x < 1)$ (%i2) sum(x^k,k,0,inf)$ (%i3) subst(x= 0, % = ev(%,simpsum)); (%o3) 0=1 --Barton From pbowyer at olynet.com Sat Jan 22 18:09:14 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sat, 22 Jan 2011 16:09:14 -0800 Subject: [Maxima] Maxima-5.23.2 In-Reply-To: References: <4D375953.1010701@olynet.com> <4D38AB11.5080000@olynet.com> , <4D3B38FA.9090900@olynet.com> , <4D3B5AFB.8050100@olynet.com> Message-ID: <4D3B71AA.40504@olynet.com> Nice trick. I haven't quite figured out how to use it though. Paul On 01/22/2011 02:57 PM, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > >> I wasn't advocating a 0^0 --> 1 solution. > Oh, I thought that maybe you were bothered by > > (%i1) assume(0< x, x< 1)$ > > (%i2) sum(x^k,k,0,inf)$ > > (%i3) subst(x= 0, % = ev(%,simpsum)); > (%o3) 0=1 > > --Barton > From ferriste at gmail.com Sun Jan 23 15:13:02 2011 From: ferriste at gmail.com (Stefano Ferri) Date: Sun, 23 Jan 2011 22:13:02 +0100 Subject: [Maxima] "describe" broken in 5.23.2 Message-ID: Dear list, I've just downloaded Maxima 5.23.2 for Windows, and I've notice d that the useful command "describe" is broken. Here's what I get: (%i1) describe(integrate); WARNING: Empty documentation index. Describe command will not work! No exact match found for topic `integrate'. Try `?? integrate' (inexact match) instead. (%o1) false I still have't tryed the linux version. This is a really annoying issue... The command ?? is broken, too. Stefano -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbowyer at olynet.com Sun Jan 23 16:29:14 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sun, 23 Jan 2011 14:29:14 -0800 Subject: [Maxima] "describe" broken in 5.23.2 In-Reply-To: References: Message-ID: <4D3CABBA.7010005@olynet.com> Stefano: I just tried the following in Xmaxima: describe(integrate); ?? integrate; and I got the full output describing the function. Here's the output from build_info() (but I'm actually running PCLinuxOS derived from mandriva) Maxima version: 5.23.2 Maxima build date: 21:3 1/21/2011 Host type: i586-mandriva-linux-gnu Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 Paul Bowyer On 01/23/2011 01:13 PM, Stefano Ferri wrote: > Dear list, > > I've just downloaded Maxima 5.23.2 for Windows, and I've notice d that > the useful command "describe" is broken. > Here's what I get: > > (%i1) describe(integrate); > WARNING: Empty documentation index. Describe command will not work! > No exact match found for topic `integrate'. > Try `?? integrate' (inexact match) instead. > > (%o1) false > > > I still have't tryed the linux version. This is a really annoying > issue... The command ?? is broken, too. > > Stefano > > > _______________________________________________ > 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 ferriste at gmail.com Mon Jan 24 02:33:58 2011 From: ferriste at gmail.com (Stefano Ferri) Date: Mon, 24 Jan 2011 09:33:58 +0100 Subject: [Maxima] "describe" broken in 5.23.2 In-Reply-To: <4D3CABBA.7010005@olynet.com> References: <4D3CABBA.7010005@olynet.com> Message-ID: Well, so it seems it is the Windows version that is broken... The warning is issued only the first time, further describe commands give "no exact match found". Seems like a build error dor documentation... (%i1) describe(integrate); WARNING: Empty documentation index. Describe command will not work! No exact match found for topic `integrate'. Try `?? integrate' (inexact match) instead. (%o1) false (%i2) describe(integrate); No exact match found for topic `integrate'. Try `?? integrate' (inexact match) instead. (%o2) false (%i3) build_info(); Maxima version: 5.23.2 Maxima build date: 17:9 1/17/2011 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 (%o3) 2011/1/23 Paul Bowyer > Stefano: > > I just tried the following in Xmaxima: > > describe(integrate); > ?? integrate; > > and I got the full output describing the function. > > Here's the output from build_info() (but I'm actually running PCLinuxOS > derived from mandriva) > Maxima version: 5.23.2 > Maxima build date: 21:3 1/21/2011 > Host type: i586-mandriva-linux-gnu > Lisp implementation type: GNU Common Lisp (GCL) > Lisp implementation version: GCL 2.6.8 > > Paul Bowyer > > > On 01/23/2011 01:13 PM, Stefano Ferri wrote: > > Dear list, > > I've just downloaded Maxima 5.23.2 for Windows, and I've notice d that the > useful command "describe" is broken. > Here's what I get: > > (%i1) describe(integrate); > WARNING: Empty documentation index. Describe command will not work! > No exact match found for topic `integrate'. > Try `?? integrate' (inexact match) instead. > > (%o1) false > > > I still have't tryed the linux version. This is a really annoying issue... > The command ?? is broken, too. > > Stefano > > > _______________________________________________ > Maxima mailing listMaxima at math.utexas.eduhttp://www.math.utexas.edu/mailman/listinfo/maxima > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Mon Jan 24 06:06:26 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 24 Jan 2011 06:06:26 -0600 Subject: [Maxima] Enhanced Laplace transforms and desolve for Maxima In-Reply-To: <87bp3cvzi4.fsf@yeeloong.netris.org> References: <87bp3cvzi4.fsf@yeeloong.netris.org> Message-ID: Mark, I looked at your patch for abs_integrate, but not the patches for the other files. In unit_step_mult_simp, your code replaces xreduce('max, ...) with code that duplicates the logic in max, I think. Is this a workaround for a limitation in max? Do you have examples of integrands that do not involve hstep that your code can handle that the current code cannot? My preference would be to *delete* the function unit_step_mult_simp from abs_integrate. The regression test for abs_integration runs OK without it; and as far as I know, unit_step_mult_simp isn't ever really needed (it sometimes keeps expressions more simple). As much as possible, I would like to keep abs_integrate focused on integration, not a general scheme for simplifying signum & friends. You didn't explain if your proposed changes to abs_integrate were needed by the other patches. Of course, abs_integrate resides in /share/contrib (for a good reason), so nothing in the Maxima's core should depend on code in abs_integrate. If you need just derivative divides integration for hstep, you can take care of that by giving hstep an integrate property. --Barton From andrej.vodopivec at gmail.com Mon Jan 24 06:16:52 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Mon, 24 Jan 2011 13:16:52 +0100 Subject: [Maxima] "describe" broken in 5.23.2 In-Reply-To: References: <4D3CABBA.7010005@olynet.com> Message-ID: There are two problems with describe. The first is that maxima-index.lisp is empty. This should be easy to fix. The second is that *maxima-infodir* is not correct set correctly. It should be maxima_prefix/share/info but it is set to maxima_prefix/info. I don't know how to fix this so I need some help. Andrej On Mon, Jan 24, 2011 at 9:33 AM, Stefano Ferri wrote: > Well, so it seems it is the Windows version that is broken... The warning is > issued only the first time, further describe commands give "no exact match > found". > Seems like a build error dor documentation... > > > (%i1) describe(integrate); > WARNING: Empty documentation index. Describe command will not work! > ? No exact match found for topic `integrate'. > ? Try `?? integrate' (inexact match) instead. > (%o1) false > > (%i2) describe(integrate); > ? No exact match found for topic `integrate'. > ? Try `?? integrate' (inexact match) instead. > (%o2) false > > (%i3) build_info(); > Maxima version: 5.23.2 > Maxima build date: 17:9 1/17/2011 > Host type: i686-pc-mingw32 > Lisp implementation type: GNU Common Lisp (GCL) > Lisp implementation version: GCL 2.6.8 > (%o3) > > > 2011/1/23 Paul Bowyer >> >> Stefano: >> >> I just tried the following in Xmaxima: >> >> describe(integrate); >> ?? integrate; >> >> and I got the full output describing the function. >> >> Here's the output from build_info()? (but I'm actually running PCLinuxOS >> derived from mandriva) >> Maxima version: 5.23.2 >> Maxima build date: 21:3 1/21/2011 >> Host type: i586-mandriva-linux-gnu >> Lisp implementation type: GNU Common Lisp (GCL) >> Lisp implementation version: GCL 2.6.8 >> >> Paul Bowyer >> >> On 01/23/2011 01:13 PM, Stefano Ferri wrote: >> >> Dear list, >> >> I've just downloaded Maxima 5.23.2 for Windows, and I've notice d that the >> useful command "describe" is broken. >> Here's what I get: >> >> (%i1) describe(integrate); >> WARNING: Empty documentation index. Describe command will not work! >> ? No exact match found for topic `integrate'. >> ? Try `?? integrate' (inexact match) instead. >> >> (%o1)? false >> >> >> I still have't tryed the linux version. This is a really annoying issue... >> The command ?? is broken, too. >> >> Stefano >> >> _______________________________________________ >> 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 mhw at netris.org Mon Jan 24 12:18:36 2011 From: mhw at netris.org (Mark H Weaver) Date: Mon, 24 Jan 2011 13:18:36 -0500 Subject: [Maxima] Enhanced Laplace transforms and desolve for Maxima In-Reply-To: (Barton Willis's message of "Mon, 24 Jan 2011 06:06:26 -0600") References: <87bp3cvzi4.fsf@yeeloong.netris.org> Message-ID: <878vya6u83.fsf@yeeloong.netris.org> Hi Barton, thanks for looking at my code. Barton Willis writes: > In unit_step_mult_simp, your code replaces xreduce('max, ...) with > code that duplicates the logic in max, I think. Is this a workaround > for a limitation in max? No, the new version is more powerful. First of all, the new unit_step_mult_simp can do partial simplifications in cases where minimum cannot be found. For example: (%i3) unit_step_mult_simp(unit_step(x-1)*unit_step(x-2)*unit_step(y-1)*unit_step(y-2)); (%o3) unit_step(x-2)*unit_step(y-2) where the old code will give up and do no simplification at all if unable to find min(x,y). The new version also simplifies unit_step(x)^p when p>0, where the old code does not. However, my primary motivation is that the rule: hstep(x)*hstep(y) = hstep(min(x,y)) is not valid if x=y. For example, hstep(x)^2 has value 1/4 at x=0. Without this added logic, integrate(hstep(hstep(x))^2, x,-1,0) would evaluate to 1/2 instead of 1/4. > Do you have examples of integrands that do not involve hstep that your > code can handle that the current code cannot? No, but I haven't searched very hard. > My preference would be to *delete* the function unit_step_mult_simp > from abs_integrate. Agreed. I will rewrite the new version in lisp, and make it part of the new step function code I'm working on. > You didn't explain if your proposed changes to abs_integrate were > needed by the other patches. No, they are not needed by the other patches. However, some people prefer to work with hstep(x) instead of unit_step(x), and I would like Maxima to be able to integrate piecewise functions defined in terms of hstep(x). > If you need just derivative divides integration for hstep, you can > take care of that by giving hstep an integrate property. I'm not sure what you mean by "derivative divides integration for hstep". Do you mean cases where you can change the variable of integration, e.g. u=hstep(x)? If so, this would almost never be useful. hstep(x) is typically used the same way that unit_step(x) is: to define piecewise functions as sums where each term is typically of the form f(x)*hstep(x-a). BTW, I agree with you that ultimately it would be better to support piecewise functions defined in terms of MCOND (aka if-then-else) or something like it. However, some people prefer to use step functions, and would like to see expressions displayed in terms of hstep(x). I'd like to support this mode of usage. I intend to provide routines to convert piecewise functions written in terms of step functions into MCOND form and vice versa, as well as various simplifiers and manipulators. Thanks, Mark From willisb at unk.edu Mon Jan 24 14:49:44 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 24 Jan 2011 14:49:44 -0600 Subject: [Maxima] Enhanced Laplace transforms and desolve for Maxima In-Reply-To: <878vya6u83.fsf@yeeloong.netris.org> References: <87bp3cvzi4.fsf@yeeloong.netris.org> <878vya6u83.fsf@yeeloong.netris.org> Message-ID: Mark H Weaver wrote on 01/24/2011 12:18:36 PM: > > My preference would be to *delete* the function unit_step_mult_simp > > from abs_integrate. > > Agreed. I will rewrite the new version in lisp, and make it part of the > new step function code I'm working on. Super--the next time I do abs_integrate maintenance, I'll delete unit_step_mult_simp. > I'm not sure what you mean by "derivative divides integration for > hstep". Do you mean cases where you can change the variable of > integration, e.g. u=hstep(x)? Derivative divides integration is also known as integration by subsitution: integrate(2 * x * f(x^2),x) --> subst(z = x^2, integrate(f(z),z)) --> ... There is a symbol property mechanism (I think) for telling Maxima the antiderivative of a function. If I were to declare a do-over for abs_integrate, maybe I'd convert signum & friends to conditionals and then integrate the conditionals. Thanks, --bw From dbmaxima at gmail.com Mon Jan 24 17:53:31 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Tue, 25 Jan 2011 10:53:31 +1100 Subject: [Maxima] Enhanced Laplace transforms and desolve for Maxima In-Reply-To: References: <87bp3cvzi4.fsf@yeeloong.netris.org> <878vya6u83.fsf@yeeloong.netris.org> Message-ID: <4D3E10FB.2060907@gmail.com> On 25/01/2011 7:49 AM, Barton Willis wrote: > There is a symbol property mechanism (I think) for telling Maxima the > antiderivative of a function. Yes. A simple example - in gamma.lisp. nil is returned as the integral wrt the first argument is unknown. ;;; Integral of the Incomplete Gamma function (defprop %gamma_incomplete ((a z) nil ((mplus) ((mtimes) -1 ((%gamma_incomplete) ((mplus) 1 a) z)) ((mtimes) ((%gamma_incomplete) a z) z))) integral) You can also use a function if you use putprop to avoid quoting issues - as in simp.lisp - (defun abs-integral (x) (mul (div 1 2) x (take '(mabs) x))) (putprop 'mabs `((x) ,#'abs-integral) 'integral) or a lambda expression - as in bessel.lisp. I should rewrite this. I couldn't get the quoting right when I tried to use a function. Obvious now :-) ;; Integral of the Bessel function wrt z (putprop '%bessel_j `((v z) nil ,(lambda (v z) (case v (0 ;; integrate(bessel_j(0,z) ;; = (1/2)*z*(%pi*bessel_j(1,z)*struve_h(0,z) ;; +bessel_j(0,z)*(2-%pi*struve_h(1,z))) '((mtimes) ((rat) 1 2) z ((mplus) ((mtimes) $%pi ((%bessel_j) 1 z) ((%struve_h) 0 z)) ((mtimes) ((%bessel_j) 0 z) ((mplus) 2 ((mtimes) -1 $%pi ((%struve_h) 1 z))))))) (1 ;; integrate(bessel_j(1,z) = -bessel_j(0,z) '((mtimes) -1 ((%bessel_j) 0 z))) (otherwise ;; http://functions.wolfram.com/03.01.21.0002.01 ;; integrate(bessel_j(v,z) ;; = 2^(-v-1)*z^(v+1)*gamma(v/2+1/2) ;; * hypergeometric_regularized([v/2+1/2],[v+1,v/2+3/2],-z^2/4) ;; = 2^(-v-1)*z^(v+1)*hypergeometric([v/2+1/2],[v+1,v/2+3/2],-z^2/4) ;; / ((v/2+1/2)*gamma(v+1)) '((mtimes) (($hypergeometric) ((mlist) ((mplus) ((rat) 1 2) ((mtimes) ((rat) 1 2) v))) ((mlist) ((mplus) ((rat) 3 2) ((mtimes) ((rat) 1 2) v)) ((mplus) 1 v)) ((mtimes) ((rat) -1 4) ((mexpt) z 2))) ((mexpt) ((mplus) ((rat) 1 2) ((mtimes) ((rat) 1 2) v)) -1) ((mexpt) 2 ((mplus) -1 ((mtimes) -1 v))) ((mexpt) ((%gamma) ((mplus) 1 v)) -1) ((mexpt) z ((mplus ) 1 v))))))) 'integral) -------------- next part -------------- An HTML attachment was scrubbed... URL: From coolens at kahosl.be Tue Jan 25 03:57:07 2011 From: coolens at kahosl.be (Hugo Coolens) Date: Tue, 25 Jan 2011 10:57:07 +0100 Subject: [Maxima] Enhanced Laplace transforms and desolve for Maxima In-Reply-To: <4D3E10FB.2060907@gmail.com> References: <87bp3cvzi4.fsf@yeeloong.netris.org> <878vya6u83.fsf@yeeloong.netris.org> <4D3E10FB.2060907@gmail.com> Message-ID: Will the new code also deal with this: ilt(exp(-a*s)/s,s,t); This would be great for (electronic) engineering students who want to make the shift to Maxima best regards, hugo From mhw at netris.org Tue Jan 25 10:51:23 2011 From: mhw at netris.org (Mark H Weaver) Date: Tue, 25 Jan 2011 11:51:23 -0500 Subject: [Maxima] Enhanced Laplace transforms and desolve for Maxima In-Reply-To: (Hugo Coolens's message of "Tue, 25 Jan 2011 10:57:07 +0100") References: <87bp3cvzi4.fsf@yeeloong.netris.org> <878vya6u83.fsf@yeeloong.netris.org> <4D3E10FB.2060907@gmail.com> Message-ID: <8739oh6i5w.fsf@yeeloong.netris.org> Hugo Coolens writes: > Will the new code also deal with this: > ilt(exp(-a*s)/s,s,t); I didn't modify ilt to do this, but my new pwilt does it: (%i2) load(pwilt)$ (%i3) pwilt(exp(-a*s)/s,s,t); (%o3) hstep(t-a) (%i4) pwilt(%e^-s*(s*%e^s-s^2-2*s-2)/s^3, s,t), ratsimp; (%o4) t-t^2*hstep(t-1) It is also designed to handle periodic functions (though currently it fails to detect this in some cases): (%i5) assume(a>0); (%o5) [a > 0] (%i6) pwilt(1/(s*(1-%e^-(2*a*s)))-%e^-(a*s)/(s*(1-%e^-(2*a*s))), s,t); (%o6) 'sum(hstep(t-2*%k*a)-hstep(t-2*%k*a-a),%k,0,inf) pwilt stands for "piecewise inverse laplace transform". I attached the code at the beginning of this thread. In the other direction, my changes to laplac.lisp support taking laplace transforms of piecewise functions defined in terms of hstep or unit_step. Note that this is still a work in progress. Best, Mark > This would be great for (electronic) engineering students who want to > make the shift to Maxima > > > best regards, > hugo From ko at research.att.com Tue Jan 25 11:35:13 2011 From: ko at research.att.com (Kostas Oikonomou) Date: Tue, 25 Jan 2011 12:35:13 -0500 Subject: [Maxima] Enhanced Laplace transforms and desolve for Maxima In-Reply-To: <8739oh6i5w.fsf@yeeloong.netris.org> References: <87bp3cvzi4.fsf@yeeloong.netris.org> <878vya6u83.fsf@yeeloong.netris.org> <4D3E10FB.2060907@gmail.com> <8739oh6i5w.fsf@yeeloong.netris.org> Message-ID: <4D3F09D1.80406@research.att.com> Mark, I think your Laplace transform work is great. So at this point I'd like to revive an old discussion about the names, "laplace" and "ilt". They are grossly mismatched. Why not laplace and inverse_laplace? Kostas On 01/25/11 11:51 AM, Mark H Weaver wrote: > Hugo Coolens writes: >> Will the new code also deal with this: >> ilt(exp(-a*s)/s,s,t); > > I didn't modify ilt to do this, but my new pwilt does it: > > (%i2) load(pwilt)$ > (%i3) pwilt(exp(-a*s)/s,s,t); > (%o3) hstep(t-a) > (%i4) pwilt(%e^-s*(s*%e^s-s^2-2*s-2)/s^3, s,t), ratsimp; > (%o4) t-t^2*hstep(t-1) > > It is also designed to handle periodic functions > (though currently it fails to detect this in some cases): > > (%i5) assume(a>0); > (%o5) [a> 0] > (%i6) pwilt(1/(s*(1-%e^-(2*a*s)))-%e^-(a*s)/(s*(1-%e^-(2*a*s))), s,t); > (%o6) 'sum(hstep(t-2*%k*a)-hstep(t-2*%k*a-a),%k,0,inf) > > pwilt stands for "piecewise inverse laplace transform". I attached the > code at the beginning of this thread. In the other direction, my > changes to laplac.lisp support taking laplace transforms of piecewise > functions defined in terms of hstep or unit_step. > > Note that this is still a work in progress. > > Best, > Mark > > >> This would be great for (electronic) engineering students who want to >> make the shift to Maxima >> >> >> best regards, >> hugo > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Tue Jan 25 13:41:35 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 25 Jan 2011 14:41:35 -0500 Subject: [Maxima] Enhanced Laplace transforms and desolve for Maxima In-Reply-To: <8739oh6i5w.fsf@yeeloong.netris.org> References: <87bp3cvzi4.fsf@yeeloong.netris.org> <878vya6u83.fsf@yeeloong.netris.org> <4D3E10FB.2060907@gmail.com> <8739oh6i5w.fsf@yeeloong.netris.org> Message-ID: <06C749E85D85463BA3D4C6592C580AD9@RichsLaptop> Hi Mark, I was working on an inverse Fourier transform function for piecewise functions for pw.mac (pwift()). I did not know of your work so I will suspend my work on that. I really don't have the time to work on this stuff anymore. I think your work is really great BTW. It has been a long time since I have had any math courses. Is there a way to do inverse Fourier transforms using ilt()? I can't remember. Good luck, Rich -----Original Message----- From: Mark H Weaver Sent: Tuesday, January 25, 2011 11:51 AM To: Hugo Coolens Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Enhanced Laplace transforms and desolve for Maxima Hugo Coolens writes: > Will the new code also deal with this: > ilt(exp(-a*s)/s,s,t); I didn't modify ilt to do this, but my new pwilt does it: (%i2) load(pwilt)$ (%i3) pwilt(exp(-a*s)/s,s,t); (%o3) hstep(t-a) (%i4) pwilt(%e^-s*(s*%e^s-s^2-2*s-2)/s^3, s,t), ratsimp; (%o4) t-t^2*hstep(t-1) It is also designed to handle periodic functions (though currently it fails to detect this in some cases): (%i5) assume(a>0); (%o5) [a > 0] (%i6) pwilt(1/(s*(1-%e^-(2*a*s)))-%e^-(a*s)/(s*(1-%e^-(2*a*s))), s,t); (%o6) 'sum(hstep(t-2*%k*a)-hstep(t-2*%k*a-a),%k,0,inf) pwilt stands for "piecewise inverse laplace transform". I attached the code at the beginning of this thread. In the other direction, my changes to laplac.lisp support taking laplace transforms of piecewise functions defined in terms of hstep or unit_step. Note that this is still a work in progress. Best, Mark > This would be great for (electronic) engineering students who want to > make the shift to Maxima > > > best regards, > hugo _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From mathew.gwynne at gmail.com Wed Jan 26 05:04:42 2011 From: mathew.gwynne at gmail.com (Matthew Gwynne) Date: Wed, 26 Jan 2011 11:04:42 +0000 Subject: [Maxima] Why does the state of the random number generator have 627 words? Message-ID: Hi, Looking at the documentation at http://maxima.sourceforge.net/docs/manual/en/maxima_5.html#IDX113 of make_random_state, it suggest that the state of the random number generator is comprised of 627 32-bit words, however in the MT19937 paper and other references to the random number generator there are 624 32-bit words in the generator. Is 627 a typo, or is there some significance to these extra 3 x 32-bits? Thanks! Matthew Gwynne http://cs.swan.ac.uk/~csmg/ From thomas at geogebra.org Wed Jan 26 05:06:40 2011 From: thomas at geogebra.org (thomas) Date: Wed, 26 Jan 2011 12:06:40 +0100 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions Message-ID: <4D400040.1020007@geogebra.org> Hi there! Some commands, such as "limit" or "sum" take a "target"-variable as an argument. E.g. for limit or sum, this is the 2nd argument. However, there is an inconsistency in the way maxima behaves when this variable was previously defined: $ maxima Maxima 5.23.2 http://maxima.sourceforge.net using Lisp SBCL 1.0.40.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) i:1; (%o1) 1 (%i2) limit(1/i, i, infinity); limit: second argument must be a variable, not a constant; found: 1 -- an error. To debug this try: debugmode(true); (%i3) sum(1/i, i, 1, 2); 3 (%o3) - 2 Since the 2nd argument in these commands is basically "local" to the command, it is my understanding that "sum" behaves correctly in this case, while "limit" (and others like "diff") should somehow be fixed. At least that is my understanding. Would this be possible/feasible? If that's not the case: is there some way to work around this? I've tried using local and a block, but that didn't seem to work out :( Any advice? Cheers Thomas From toy.raymond at gmail.com Wed Jan 26 06:47:06 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 26 Jan 2011 07:47:06 -0500 Subject: [Maxima] Why does the state of the random number generator have 627 words? In-Reply-To: References: Message-ID: <4D4017CA.7050704@gmail.com> On 1/26/11 6:04 AM, Matthew Gwynne wrote: > Hi, > > Looking at the documentation at > http://maxima.sourceforge.net/docs/manual/en/maxima_5.html#IDX113 of > make_random_state, it suggest that the state of the random number > generator is comprised of 627 32-bit words, however in the MT19937 > paper and other references to the random number generator there are > 624 32-bit words in the generator. Is 627 a typo, or is there some > significance to these extra 3 x 32-bits? A closer look shows that the state actually consists of 624 words of state and 3 extra words. One is used as an index into the state to choose which word is to be returned. The other two are constants used by the algorithm. Ray From thomas at geogebra.org Wed Jan 26 07:23:43 2011 From: thomas at geogebra.org (thomas) Date: Wed, 26 Jan 2011 14:23:43 +0100 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: <4D400040.1020007@geogebra.org> Message-ID: <4D40205F.8010702@geogebra.org> Thank you for your reply. :) Even though that is a nice work-around, it doesn't really solve the inconsistency-problem. And it's quite inconvinient to have to quote the variables in each expression I want to differentiate, limit, etc. Also I think that I'm probably not the only person who stumbled uppon this problem: when calculating things like "limit(1/i, i, infinity);" I might've already forgotten that I defined "i" in the first place, and might then use an incorrect result. Cheers Thomas On 01/26/2011 01:37 PM, Ilya Ryabinkin wrote: > You may try noun form 'i istead of i > > Ilya > > On Wed, Jan 26, 2011 at 6:06 AM, thomas wrote: >> Hi there! >> >> Some commands, such as "limit" or "sum" take a "target"-variable as an >> argument. E.g. for limit or sum, this is the 2nd argument. However, there is >> an inconsistency in the way maxima behaves when this variable was previously >> defined: >> >> >> $ maxima >> Maxima 5.23.2 http://maxima.sourceforge.net >> using Lisp SBCL 1.0.40.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) i:1; >> (%o1) 1 >> (%i2) limit(1/i, i, infinity); >> >> limit: second argument must be a variable, not a constant; found: 1 >> -- an error. To debug this try: debugmode(true); >> (%i3) sum(1/i, i, 1, 2); >> 3 >> (%o3) - >> 2 >> >> >> Since the 2nd argument in these commands is basically "local" to the >> command, it is my understanding that "sum" behaves correctly in this case, >> while "limit" (and others like "diff") should somehow be fixed. At least >> that is my understanding. Would this be possible/feasible? >> >> If that's not the case: is there some way to work around this? I've tried >> using local and a block, but that didn't seem to work out :( Any advice? >> >> Cheers >> >> Thomas >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> From fateman at eecs.berkeley.edu Wed Jan 26 08:27:24 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 26 Jan 2011 06:27:24 -0800 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: <4D40205F.8010702@geogebra.org> References: <4D400040.1020007@geogebra.org> <4D40205F.8010702@geogebra.org> Message-ID: <4D402F4C.90900@eecs.berkeley.edu> It is possible to define functions in Maxima that quote their arguments implicitly. Whether to do so is generally controversial, with people taking strong stands on either side of the issue. x:y solve ( ...., x) does one solve for x or y? If you have defined 'i' and forgotten it, then you have made an error. Some systems require that you define two distinct classes. Symbols and variables. Only variables may be given values. Symbols are 'indeterminates' and can't be assigned values. A more principled view of this activity is to say that the arguments to the function sum (etc) that are themselves functions, must display their bound variables explicitly. That is, limit ( lambda([i], 1/i), infinity) integrate( lambda([x], a*x+b) , [-1,1]) etc. On 1/26/2011 5:23 AM, thomas wrote: > Thank you for your reply. :) > Even though that is a nice work-around, it doesn't really solve the > inconsistency-problem. And it's quite inconvinient to have to quote > the variables in each expression I want to differentiate, limit, etc. Maybe we should implement a feature so that when you declare a name constant so you can never assign values to it. > Also I think that I'm probably not the only person who stumbled uppon > this problem: when calculating things like "limit(1/i, i, infinity);" > I might've already forgotten that I defined "i" in the first place, > and might then use an incorrect result. That happens. One person's incorrect result is another's correct result. RJF From robert.dodier at gmail.com Wed Jan 26 10:08:18 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 26 Jan 2011 09:08:18 -0700 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: <4D400040.1020007@geogebra.org> References: <4D400040.1020007@geogebra.org> Message-ID: On 1/26/11, thomas wrote: > Since the 2nd argument in these commands is basically "local" to the > command, it is my understanding that "sum" behaves correctly in this > case, while "limit" (and others like "diff") should somehow be fixed. At > least that is my understanding. Would this be possible/feasible? Well, sum treats the index in a rather subtle way; although it seems to correspond to what people expect, it's hard to explain exactly what it does. A function for which arguments are evaluated in the usual way is much easier to understand and therefore it's much easier to know what to expect. At this point I am inclined to think that consistency is very important; so sum, integrate, limit, etc should all evaluate their arguments like ordinary functions. The idea of sum etc taking lambda expressions as arguments is intriguing. > If that's not the case: is there some way to work around this? I've > tried using local and a block, but that didn't seem to work out :( Any > advice? Well, here's a half-baked idea. blex as shown below is a simple- minded attempt at a lexical block construct. i : 100; limit (1/i, i, inf); => error blex ([i], limit (1/i, i, inf)); => 0 blex([a, b, c], ...) replaces instances of a, b, c in ... with anonymous variables (gensyms) and then evaluates ... . The idea is that a, b, c inside the block are distinct from a, b, c outside the block. Maybe this is useful in some way. best Robert Dodier PS. (defmspec $blex (x) (let* ((args (cdr x)) (vars (cdr (car args))) (exprs (cdr args)) (gensym-vars (mapcar #'(lambda (s) (let ((s1 (gensym))) (setf (get s1 'reversealias) (or (get s 'reversealias) s)) s1)) vars)) (subst-eqns (mapcar #'(lambda (x y) `((mequal) ,x ,y)) vars gensym-vars)) (gensym-mprogn ($psubstitute `((mlist) , at subst-eqns) `((mprogn) , at exprs)))) (meval gensym-mprogn))) From robert.dodier at gmail.com Wed Jan 26 10:15:53 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 26 Jan 2011 09:15:53 -0700 Subject: [Maxima] ilt vs inverse_laplace, was: Enhanced Laplace transforms and desolve for Maxima Message-ID: On 1/25/11, Kostas Oikonomou wrote: > I think your Laplace transform work is great. So at this > point I'd like to revive an old discussion about the names, > "laplace" and "ilt". They are grossly mismatched. Why not > laplace and inverse_laplace? I'm in favor changing ilt to inverse_laplace. best Robert Dodier From willisb at unk.edu Wed Jan 26 10:29:26 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 26 Jan 2011 10:29:26 -0600 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: <4D400040.1020007@geogebra.org> Message-ID: maxima-bounces at math.utexas.edu wrote on 01/26/2011 10:08:18 AM: > The idea of sum etc taking lambda expressions as arguments is intriguing. It is intriguing, but for double sums, sum would need to return a lambda form--otherwise sum(sum(lambda([k], k),1,n),1, m) wouldn't work. Alternatively, we'd need a non-nested way to represent multiple sums. I'm OK with sum(lambda([k], k),1,n) --> lambda([k],k*(k+1)/2), but that would break stuff. ---Barton From ko at research.att.com Wed Jan 26 10:30:44 2011 From: ko at research.att.com (Kostas Oikonomou) Date: Wed, 26 Jan 2011 11:30:44 -0500 Subject: [Maxima] ilt vs inverse_laplace, was: Enhanced Laplace transforms and desolve for Maxima In-Reply-To: References: Message-ID: <4D404C34.3060800@research.att.com> Glad to hear it! In the same vein, is there a reason that Laplace transforms are under Ch. 19, "Differentiation", in the manual? Wouldn't they be better situated in a separate chapter, perhaps "Transforms", "Integral Transforms", or some such? Kostas On 01/26/11 11:15 AM, Robert Dodier wrote: > On 1/25/11, Kostas Oikonomou wrote: > >> I think your Laplace transform work is great. So at this >> point I'd like to revive an old discussion about the names, >> "laplace" and "ilt". They are grossly mismatched. Why not >> laplace and inverse_laplace? > > I'm in favor changing ilt to inverse_laplace. > > best > > Robert Dodier From macrakis at alum.mit.edu Wed Jan 26 10:52:56 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 26 Jan 2011 11:52:56 -0500 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: <4D400040.1020007@geogebra.org> Message-ID: You would write sum(lambda([n],sum(lambda([k], k),1,n)),1, m) But the traditional lambda syntax is clumsy and obscure to non-computer-scientists. Maybe it's as easy as defining a nicer syntax, e.g. sum( sum( k // k, 1:n ) // n, 1:m ) But then what do you do when you *do* want to define a function like sum_over (expr, varlist)? Do you define yet another syntax for syntactic lambda-construction? Do you use subst or buildq (yuck)? I suppose that at least moves the complexity to an 'expert' level. -s On Wed, Jan 26, 2011 at 11:29, Barton Willis wrote: > maxima-bounces at math.utexas.edu wrote on 01/26/2011 10:08:18 AM: > >> The idea of sum etc taking lambda expressions as arguments is > intriguing. > > It is intriguing, but for double sums, sum would need to return a > lambda form--otherwise sum(sum(lambda([k], k),1,n),1, m) wouldn't > work. Alternatively, we'd need a non-nested way to represent multiple > sums. > > I'm OK with sum(lambda([k], k),1,n) --> lambda([k],k*(k+1)/2), but > that would break stuff. > > ---Barton > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From fateman at eecs.berkeley.edu Wed Jan 26 11:10:36 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 26 Jan 2011 09:10:36 -0800 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: <4D400040.1020007@geogebra.org> Message-ID: <4D40558C.9080805@eecs.berkeley.edu> On 1/26/2011 8:52 AM, Stavros Macrakis wrote: > You would write > > sum(lambda([n],sum(lambda([k], k),1,n)),1, m) > > But the traditional lambda syntax is clumsy and obscure to > non-computer-scientists. you could write function[k]:k if that would make people happier. > Maybe it's as easy as defining a nicer > syntax, e.g. > > sum( sum( k // k, 1:n ) // n, 1:m ) > > But then what do you do when you *do* want to define a function like > sum_over (expr, varlist)? Do you define yet another syntax for > syntactic lambda-construction? Do you use subst or buildq (yuck)? I > suppose that at least moves the complexity to an 'expert' level. even if you changed sum(lambda([k],k),1,n) to return lambda([n], (n+n^2)/2) you would not be able to do the same with sum(lambda[k],k),n,m). You would need to respond with something like lambda([n,m] ....). People writing code in idiomatic Scheme might be more comfortable with such stuff, but the typical applied-math user would probably be uncomfortable with explicit functional notation. For what it is worth, much of the practical applied math books etc are jumbles of mismatched notation, but an expert has sufficient context so that he/she not only is comfortable, but doesn't even notice the subtle ambiguity. This is noticeable if you try to write a formal recognition program (i.e. for typeset math formulas in books). You also probably want a summation notation that allows sum over 1<=i,j<=n, i /= j, or over sets like odd(i). RJF From macrakis at alum.mit.edu Wed Jan 26 10:36:53 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 26 Jan 2011 11:36:53 -0500 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: <4D400040.1020007@geogebra.org> References: <4D400040.1020007@geogebra.org> Message-ID: Thomas, I agree that in a case like i:1$ limit(1/i,i,inf); you might want i to be locally interpreted as a local formal variable. That is simple enough -- write limit( '(1/i), 'i, inf). But what if you have something like this: all_limits( expr, vars ) := makelist( [var, limit(expr,var,inf)], var, vars) $ all_limits( x/(x+y),[x,y]); => [[x,1],[y,0]] Clearly in that case, you *don't* want var to be treated as a local formal variable. Since Maxima is designed to be user-extensible -- not just a symbolic desk calculator -- it is very important to be able to do this sort of thing. As for 'sum' inconsistently treating the variable as a formal argument, this was a "convenience feature" added a few years ago. This presumably makes the system easier to use in some cases, but it makes it much more complicated to use in other cases. I am opposed to such convenience features, which only lead to confusion down the road (I use a programming system called R, which is full of such "do what I mean" features which trip me up constantly...). I don't think we've figured out yet how to solve for this problem globally. Some systems treat all symbols as formal until they are explicitly evaluated -- this would make interactive use simpler in many cases, but make programming messier. -s On Wed, Jan 26, 2011 at 06:06, thomas wrote: > Hi there! > > Some commands, such as "limit" or "sum" take a "target"-variable as an > argument. E.g. for limit or sum, this is the 2nd argument. However, there is > an inconsistency in the way maxima behaves when this variable was previously > defined: > > > $ maxima > Maxima 5.23.2 http://maxima.sourceforge.net > using Lisp SBCL 1.0.40.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) i:1; > (%o1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?1 > (%i2) limit(1/i, i, infinity); > > limit: second argument must be a variable, not a constant; found: 1 > ?-- an error. To debug this try: debugmode(true); > (%i3) sum(1/i, i, 1, 2); > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 3 > (%o3) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2 > > > Since the 2nd argument in these commands is basically "local" to the > command, it is my understanding that "sum" behaves correctly in this case, > while "limit" (and others like "diff") should somehow be fixed. At least > that is my understanding. Would this be possible/feasible? > > If that's not the case: is there some way to work around this? I've tried > using local and a block, but that didn't seem to work out :( Any advice? > > Cheers > > Thomas > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From macrakis at alum.mit.edu Wed Jan 26 12:57:45 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 26 Jan 2011 13:57:45 -0500 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: <4D40558C.9080805@eecs.berkeley.edu> References: <4D400040.1020007@geogebra.org> <4D40558C.9080805@eecs.berkeley.edu> Message-ID: On Wed, Jan 26, 2011 at 12:10, Richard Fateman wrote: > On 1/26/2011 8:52 AM, Stavros Macrakis wrote: >> >> You would write >> >> ? ? ?sum(lambda([n],sum(lambda([k], k),1,n)),1, m) >> >> But the traditional lambda syntax is clumsy and obscure to >> non-computer-scientists. > > you could write ?function[k]:k ?if that would make people happier. Yes, something as trivial as that could make a difference.... >> ? Maybe it's as easy as defining a nicer >> syntax, e.g. >> >> ? ? ? sum( sum( k // k, 1:n ) // n, 1:m ) >> >> But then what do you do when you *do* want to define a function like >> sum_over (expr, varlist)? ?Do you define yet another syntax for >> syntactic lambda-construction? ?Do you use subst or buildq (yuck)? ?I >> suppose that at least moves the complexity to an 'expert' level. > > even if you changed ? sum(lambda([k],k),1,n) ?to return lambda([n], > (n+n^2)/2) No, I would not expect the free variable n to suddenly become bound in sum! The result of sum(lambda([k],k),1,n) should be simply (n+n^2)/2. If you want to nest that in another sum, with n being a bound variable, you'd write sum( lambda([n], sum(lambda([k],k),1,n), ...) ... > People writing code in idiomatic Scheme might be more comfortable with such > stuff, but the typical applied-math user would probably be uncomfortable with explicit > functional notation. Yes, I agree entirely. > ?For what it is worth, much of the practical applied math books etc are jumbles of mismatched notation, > but an expert has sufficient context so that he/she not only is comfortable, but doesn't > even notice the subtle ambiguity. Yes, see http://mitpress.mit.edu/sicm/book-Z-H-5.html#footnote_Temp_5 and http://mitpress.mit.edu/sicm/book-Z-H-12.html#footnote_Temp_69 in Sussman's Classical Mechanics for more examples of notational issues. > You also probably want a summation notation that allows sum over ?1<=i,j<=n, > i /= j, ?or over sets like ?odd(i). Well, that actually becomes conceptually much easier when you split out the functionality of sum() into (a) define the function being summed and (b) define the sequence over which it is being summed. You still need to define notation and simplifications etc. for objects like {natural number n where oddp(n)}, but at least the 'sum' function is conceptually the same. -s From MFoster at turbopowersystems.com Wed Jan 26 04:28:16 2011 From: MFoster at turbopowersystems.com (Martyn Foster) Date: Wed, 26 Jan 2011 10:28:16 -0000 Subject: [Maxima] Graphic representation of "e" in wxmaxima Message-ID: Hello Everyone We have just taken to use Maxima ( wxMaxima at present ). The question I have is to do with the output of formula's etc. The base "e" for natural logs seems to be represented by the character epsilon rather than e. Whenever we output with a font presentable for use in an open office//word document we get epsilon. How can we have %e replaced by the letter e in the Maxima output as it would be represented normally. We'd appreciate any input on this matter as overall we think the package is excellent and shows a lot of hard effort on behalf of the developers. Best Regards Martyn Foster ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From stas.kazmin at googlemail.com Wed Jan 26 15:26:31 2011 From: stas.kazmin at googlemail.com (stas.kazmin at googlemail.com) Date: Wed, 26 Jan 2011 22:26:31 +0100 Subject: [Maxima] substitutions in differential equations Message-ID: <4D409187.6010308@googlemail.com> Hello, I'm new to this mailing list and therefore I do not know, weather this is the right place for asking quastions. My question is, is there a way to substitute differential operators in explorations. Maybe an example can show what I mean. There are two different things I want to do. the first one is to substitute only the function, not the derivatives, to zero. Mathematically: f(x=a) = 0 where a can be a constant number for example 0. therefore I want to do (only the inputs): Input: depends( f , x ); Input: P : x - f / diff( f , x ); Input: atvalue( f( x ) , x = 0 , 0); # or something else. output for P x - f / (d/dx f); Expected output for P after substitution or whatever: P = x # because of the f(0) = 0 What I have tried: 1) Input: P,x=0; Output: Attempt to differentiate with respect to a number: 0 2) Input: subst(0, f, P); Output: Division by 0 Is there any other way to simplify those equations? The second thing is about substitutions aswell but here I want to substitute a whole expr like : "(d^2/dx^2) t" to A(x) or whatever. Is there a way to do it? Example: Input: Q : P + diff( t , x); Output: x - f / (d/dx f) + d/dx t; after that something like: Input: subst( Q , diff( t ,x) , a) Expected Output: x - f / (d/dx f) + a; It would be great, if you would have an answer for me. Tanks. From carbajal at ifi.uzh.ch Thu Jan 27 01:37:52 2011 From: carbajal at ifi.uzh.ch (Juan Pablo Carbajal) Date: Thu, 27 Jan 2011 08:37:52 +0100 Subject: [Maxima] substitutions in differential equations In-Reply-To: <4D409187.6010308@googlemail.com> References: <4D409187.6010308@googlemail.com> Message-ID: Hi, This works for me (If I understood what you want) depends( f , x ); P : x - f / diff( f , x ); /* Assuming there exist a point x=a such that f(x=a) = 0 */ at(P,[f=0, x=a]); %o3 a If you want to evaluate at a given point x, then you will have to define f in the proper way. JPi On Wed, Jan 26, 2011 at 10:26 PM, stas.kazmin at googlemail.com wrote: > P : x - f / diff( f , x ); -- M. Sc. Juan Pablo Carbajal ----- PhD Student University of Z?rich www.ailab.ch/carbajal From carbajal at ifi.uzh.ch Thu Jan 27 01:41:41 2011 From: carbajal at ifi.uzh.ch (Juan Pablo Carbajal) Date: Thu, 27 Jan 2011 08:41:41 +0100 Subject: [Maxima] plotdf not working in 0.8.5 Message-ID: Hi everybody, I installed wxMaxima from the repository in Ubuntu Maverik and plotdf is not working This is the output (I get no plots) load("plotdf")$ plotdf(exp(-x)+y,[trajectory_at,2,-0.1]); %o1 127 Any idea what I am missing? Thanks -- M. Sc. Juan Pablo Carbajal ----- PhD Student University of Z?rich www.ailab.ch/carbajal From willisb at unk.edu Thu Jan 27 04:49:35 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 27 Jan 2011 04:49:35 -0600 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >>>?But?the?traditional?lambda?syntax?is?clumsy?and?obscure?to >>>?non-computer-scientists. >> >>?you?could?write??function[k]:k??if?that?would?make?people?happier. Another possibility: ?(%i12) (infix("->",50,50), ?"->"(x,f) ::= (x : if listp(x) then x else [x], buildq([x,f], lambda(x,f))))$ ?(%i15) x -> x; ?(%o15) lambda([x],x) ?(%i16) [a,b] -> a+b; ?(%o16) lambda([a,b],b+a) --Barton From villate at fe.up.pt Thu Jan 27 06:00:05 2011 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 27 Jan 2011 12:00:05 +0000 Subject: [Maxima] plotdf not working in 0.8.5 In-Reply-To: References: Message-ID: <1296129605.2750.65.camel@wigner> On Thu, 2011-01-27 at 08:41 +0100, Juan Pablo Carbajal wrote: > load("plotdf")$ > plotdf(exp(-x)+y,[trajectory_at,2,-0.1]); > > %o1 127 > > Any idea what I am missing? Have you installed Xmaxima? It is needed by plotdf. Try for instance: plot2d(x,[x,0,5],[plot_format,xmaxima]); if you have Xmaxima and a recent version of Maxima it should work. Regards, Jaime From carbajal at ifi.uzh.ch Thu Jan 27 07:35:32 2011 From: carbajal at ifi.uzh.ch (Juan Pablo Carbajal) Date: Thu, 27 Jan 2011 14:35:32 +0100 Subject: [Maxima] [SOLVED] plotdf not working in 0.8.5 In-Reply-To: <1296129605.2750.65.camel@wigner> References: <1296129605.2750.65.camel@wigner> Message-ID: Indeed, That was the problem! Thank you very much On Thu, Jan 27, 2011 at 1:00 PM, Jaime Villate wrote: > On Thu, 2011-01-27 at 08:41 +0100, Juan Pablo Carbajal wrote: >> load("plotdf")$ >> plotdf(exp(-x)+y,[trajectory_at,2,-0.1]); >> >> %o1 127 >> >> Any idea what I am missing? > Have you installed Xmaxima? It is needed by plotdf. > Try for instance: > plot2d(x,[x,0,5],[plot_format,xmaxima]); > if you have Xmaxima and a recent version of Maxima it should work. > > Regards, > Jaime > > > -- M. Sc. Juan Pablo Carbajal ----- PhD Student University of Z?rich www.ailab.ch/carbajal From jrredford at yahoo.com Fri Jan 28 09:01:44 2011 From: jrredford at yahoo.com (James Redford) Date: Fri, 28 Jan 2011 07:01:44 -0800 (PST) Subject: [Maxima] "describe" broken in 5.23.2 Message-ID: <512188.75625.qm@web121808.mail.ne1.yahoo.com> I can confirm these bugs with the below-listed Maxima version. Hopefully this will be fixed soon. Maxima version: 5.23.2 Maxima build date: 17:9 1/17/2011 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 ########## [Maxima] "describe" broken in 5.23.2 Stefano Ferri ferriste at gmail.com Sun Jan 23 15:13:02 CST 2011 Dear list, I've just downloaded Maxima 5.23.2 for Windows, and I've notice d that the useful command "describe" is broken. Here's what I get: (%i1) describe(integrate); WARNING: Empty documentation index. Describe command will not work! No exact match found for topic `integrate'. Try `?? integrate' (inexact match) instead. (%o1) false I still have't tryed the linux version. This is a really annoying issue... The command ?? is broken, too. Stefano From macrakis at alum.mit.edu Fri Jan 28 09:58:47 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 28 Jan 2011 10:58:47 -0500 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: Message-ID: I suspect the biggest problem isn't syntactic, but conceptual. Can we really train users to write sum( j -> sum ( i -> 1/(i+j), 1:10 ), 1:10 ) instead of sum(sum(1/(i+j),i,1,10),j,1,10) And really, we should also support sum( sum ( i -> j-> 1/(i+j), 1:10 ), 1:10 ) where the inner sum would return the function j -> 1/(1+j) + 1/(2+j) + ... That would of course be horribly inefficient if implemented in the straightforward way.... -s On Thu, Jan 27, 2011 at 05:49, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > >>>>?But?the?traditional?lambda?syntax?is?clumsy?and?obscure?to >>>>?non-computer-scientists. >>> >>>?you?could?write??function[k]:k??if?that?would?make?people?happier. > > Another possibility: > > ?(%i12) (infix("->",50,50), ?"->"(x,f) ::= (x : if listp(x) then x else [x], buildq([x,f], lambda(x,f))))$ > > ?(%i15) x -> x; > ?(%o15) lambda([x],x) > > ?(%i16) [a,b] -> a+b; > ?(%o16) lambda([a,b],b+a) > > --Barton From jwmixon at bellsouth.net Fri Jan 28 11:55:13 2011 From: jwmixon at bellsouth.net (Wilson Mixon) Date: Fri, 28 Jan 2011 12:55:13 -0500 Subject: [Maxima] Pausing in wxMaxima References: Message-ID: I'm using wxMaxima to create a wxm file that will be used by students. One step is to use solve. In the next step, the solution is to be applied. For some parameter values, solve yields multiple solutions, typically one of which is real and positive. I'd like to be able to have students use wxMaxima's ctrl-r (evaluate all cells) but insert a pause so that, before executing the second step above, the student can provide the proper index from the list of solutions. Can this be done? Thanks, Wilson Mixon From ferriste at gmail.com Sat Jan 29 05:49:14 2011 From: ferriste at gmail.com (Stefano Ferri) Date: Sat, 29 Jan 2011 12:49:14 +0100 Subject: [Maxima] "describe" broken in 5.23.2 In-Reply-To: References: <4D3CABBA.7010005@olynet.com> Message-ID: Andrej, if you are fixing this problem, I have another question: before packaging, did you stripped bynaries to remove the debug symbols, since they are useless for normal users? By comparing file sizes, maxima + wxmaxima + gcl + gnuplot packages for linux, if stripped, have a size of about 16 Mb. Even considering that windows packages also ship wxmaxima, gcl and gnuplot, and dependencies and libraries not included in linux packages, 30 Mb aren't too much? Stefano 2011/1/24 Andrej Vodopivec > There are two problems with describe. > > The first is that maxima-index.lisp is empty. This should be easy to fix. > > The second is that *maxima-infodir* is not correct set correctly. It > should be maxima_prefix/share/info but it is set to > maxima_prefix/info. I don't know how to fix this so I need some help. > > Andrej > > > > On Mon, Jan 24, 2011 at 9:33 AM, Stefano Ferri wrote: > > Well, so it seems it is the Windows version that is broken... The warning > is > > issued only the first time, further describe commands give "no exact > match > > found". > > Seems like a build error dor documentation... > > > > > > (%i1) describe(integrate); > > WARNING: Empty documentation index. Describe command will not work! > > No exact match found for topic `integrate'. > > Try `?? integrate' (inexact match) instead. > > (%o1) false > > > > (%i2) describe(integrate); > > No exact match found for topic `integrate'. > > Try `?? integrate' (inexact match) instead. > > (%o2) false > > > > (%i3) build_info(); > > Maxima version: 5.23.2 > > Maxima build date: 17:9 1/17/2011 > > Host type: i686-pc-mingw32 > > Lisp implementation type: GNU Common Lisp (GCL) > > Lisp implementation version: GCL 2.6.8 > > (%o3) > > > > > > 2011/1/23 Paul Bowyer > >> > >> Stefano: > >> > >> I just tried the following in Xmaxima: > >> > >> describe(integrate); > >> ?? integrate; > >> > >> and I got the full output describing the function. > >> > >> Here's the output from build_info() (but I'm actually running PCLinuxOS > >> derived from mandriva) > >> Maxima version: 5.23.2 > >> Maxima build date: 21:3 1/21/2011 > >> Host type: i586-mandriva-linux-gnu > >> Lisp implementation type: GNU Common Lisp (GCL) > >> Lisp implementation version: GCL 2.6.8 > >> > >> Paul Bowyer > >> > >> On 01/23/2011 01:13 PM, Stefano Ferri wrote: > >> > >> Dear list, > >> > >> I've just downloaded Maxima 5.23.2 for Windows, and I've notice d that > the > >> useful command "describe" is broken. > >> Here's what I get: > >> > >> (%i1) describe(integrate); > >> WARNING: Empty documentation index. Describe command will not work! > >> No exact match found for topic `integrate'. > >> Try `?? integrate' (inexact match) instead. > >> > >> (%o1) false > >> > >> > >> I still have't tryed the linux version. This is a really annoying > issue... > >> The command ?? is broken, too. > >> > >> Stefano > >> > >> _______________________________________________ > >> 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 ko at research.att.com Sat Jan 29 10:07:30 2011 From: ko at research.att.com (Kostas Oikonomou) Date: Sat, 29 Jan 2011 11:07:30 -0500 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: Message-ID: <4D443B42.60508@research.att.com> With respect to multiple/nested sums, Stavros wrote for me a very nice function a while ago: /* Sum(expr, [i, i1, i2], [j, j1, j2], ...) returns the multiple (iterated) sum i2 j2 k2 --- --- --- \ \ \ / / / ... (expr) --- --- --- i=i1 j=j1 k=k1 */ Why not make that an official part of Maxima? On 01/28/11 10:58 AM, Stavros Macrakis wrote: > I suspect the biggest problem isn't syntactic, but conceptual. Can we > really train users to write > > sum( j -> sum ( i -> 1/(i+j), 1:10 ), 1:10 ) > > instead of > > sum(sum(1/(i+j),i,1,10),j,1,10) > > And really, we should also support > > sum( sum ( i -> j-> 1/(i+j), 1:10 ), 1:10 ) > > where the inner sum would return the function > > j -> 1/(1+j) + 1/(2+j) + ... > > That would of course be horribly inefficient if implemented in the > straightforward way.... > > -s > > > > On Thu, Jan 27, 2011 at 05:49, Barton Willis wrote: >> -----maxima-bounces at math.utexas.edu wrote: ----- >> >>>>> But the traditional lambda syntax is clumsy and obscure to >>>>> non-computer-scientists. >>>> >>>> you could write function[k]:k if that would make people happier. >> >> Another possibility: >> >> (%i12) (infix("->",50,50), "->"(x,f) ::= (x : if listp(x) then x else [x], buildq([x,f], lambda(x,f))))$ >> >> (%i15) x -> x; >> (%o15) lambda([x],x) >> >> (%i16) [a,b] -> a+b; >> (%o16) lambda([a,b],b+a) >> >> --Barton > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From O.Kullmann at swansea.ac.uk Sat Jan 29 11:39:23 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 29 Jan 2011 17:39:23 +0000 Subject: [Maxima] problems with printf: hex with capital or small letters? Message-ID: <20110129173923.GK32073@cs-wsok.swansea.ac.uk> Hello, I got now Maxima running with Ecl version post-11.1.1, but there is one change of behaviour: printf(false,"~x",11) returned "B" before, while now it returns "b" (in general: capital letters before, small letters now). I can't find a precise definition of printf (Maxima refers to using some Lisp reference, but I can't find a Lisp reference which is precise enough). Are both outputs possible? Can it be sometimes "b", sometimes "B" ? Or is only one form true (this would be best ...). Thanks for your time Oliver From l.butler at ed.ac.uk Sat Jan 29 12:33:56 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sat, 29 Jan 2011 18:33:56 +0000 (GMT) Subject: [Maxima] problems with printf: hex with capital or small letters? In-Reply-To: <20110129173923.GK32073@cs-wsok.swansea.ac.uk> References: <20110129173923.GK32073@cs-wsok.swansea.ac.uk> Message-ID: On Sat, 29 Jan 2011, Oliver Kullmann wrote: < Hello, < < I got now Maxima running with Ecl version post-11.1.1, but there is < one change of behaviour: < < printf(false,"~x",11) < < returned "B" before, while now it returns "b" (in general: capital letters < before, small letters now). < < I can't find a precise definition of printf (Maxima refers < to using some Lisp reference, but I can't find a Lisp reference < which is precise enough). < < Are both outputs possible? Can it be sometimes "b", sometimes "B" ? < Or is only one form true (this would be best ...). This is almost certainly down to a change in ecl. Try running ecl in a shell and enter (format t "~x" 11) There is no universal standard that hex 'digits' are uppercase. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From thomas at geogebra.org Sun Jan 30 07:53:32 2011 From: thomas at geogebra.org (thomas) Date: Sun, 30 Jan 2011 14:53:32 +0100 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: <4D400040.1020007@geogebra.org> Message-ID: <4D456D5C.7000705@geogebra.org> Thanks for the suggestion :) This does indeed work when simply using "limit". However, in my case (we call Maxima from inside another application), the call issued is actually "ev(limit('(1/n), 'n, inf),simp);", and in that case, it doesn't work. Any advice? Cheers Thomas On 01/26/2011 01:37 PM, Ilya Ryabinkin wrote: > You may try noun form 'i istead of i > > Ilya > > On Wed, Jan 26, 2011 at 6:06 AM, thomas wrote: >> Hi there! >> >> Some commands, such as "limit" or "sum" take a "target"-variable as an >> argument. E.g. for limit or sum, this is the 2nd argument. However, there is >> an inconsistency in the way maxima behaves when this variable was previously >> defined: >> >> >> $ maxima >> Maxima 5.23.2 http://maxima.sourceforge.net >> using Lisp SBCL 1.0.40.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) i:1; >> (%o1) 1 >> (%i2) limit(1/i, i, infinity); >> >> limit: second argument must be a variable, not a constant; found: 1 >> -- an error. To debug this try: debugmode(true); >> (%i3) sum(1/i, i, 1, 2); >> 3 >> (%o3) - >> 2 >> >> >> Since the 2nd argument in these commands is basically "local" to the >> command, it is my understanding that "sum" behaves correctly in this case, >> while "limit" (and others like "diff") should somehow be fixed. At least >> that is my understanding. Would this be possible/feasible? >> >> If that's not the case: is there some way to work around this? I've tried >> using local and a block, but that didn't seem to work out :( Any advice? >> >> Cheers >> >> Thomas >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> From chris.nassar at gmail.com Sun Jan 30 09:42:04 2011 From: chris.nassar at gmail.com (Chris Nassar) Date: Sun, 30 Jan 2011 10:42:04 -0500 Subject: [Maxima] Applying Boundary Conditions at Infinity? Message-ID: I'm trying to solve the differential equation A*p''(x)-p(x)/B=0 with the boundary conditions that p(infinity)=0 and p(xn)=pn. Maxima easily finds the general solution. ode2(A*'diff(p,x,2)-p/B,p,x); Is A B positive or negative? p x x --------------- - --------------- sqrt(A) sqrt(B) sqrt(A) sqrt(B) (%o1) p = %k1 %e + %k2 %e Applying the boundary conditions does not give the expected result bc2(%o1,x=inf,p=0,x=xn,p=pn); Maxima treats infinity as just another variable. Can I make maxima figure out that for p(infinity)=0 %k1 must be 0? Since I know the answer I can just set %k1 to zero, but it does not seem like a satisfactory solution. I couldn't find anything in the manual about it. Any help would be appreciated. Thanks, Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From igryabinkin at gmail.com Sun Jan 30 10:10:38 2011 From: igryabinkin at gmail.com (Ilya Ryabinkin) Date: Sun, 30 Jan 2011 11:10:38 -0500 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: <4D456D5C.7000705@geogebra.org> References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> Message-ID: As I can see, you have wrong understanding on what's going on behind the scene. Basically, Maxima has two types of functions: those which do evaluate their arguments, as funmake() and those which do note, like lambda() Look at sum() example more closely. sum() has to be able to evaluate the summation terms, but its summation variable is the _formal_ parameter, not a variable, just like "x" is a formal parameter in (in)definite integral int(f(x),x). You have to protect the formal variable against any attempt to interpret (evaluate) it. Calling "ev(limit('(1/n), 'n, inf),simp);" you force Maxima to evaluate every single parameter of the function sum(), so "'i" will also be evaluated. This is clearly not what you want. A similar issue would appear if you try to define a differential operator that transforms a function into its derivative. I spent a lot of time figuring out how it could be done; the only working way I found was quite an awkward construction D(f):= funmake('lambda, [['x], diff(f('x),'x)]); Again, this happened because you have to perform differentiation with respect to a formal argument, not a variable "x". Sincerely, Ilya On Sun, Jan 30, 2011 at 8:53 AM, thomas wrote: > Thanks for the suggestion :) > > This does indeed work when simply using "limit". However, in my case (we > call Maxima from inside another application), the call issued is actually > "ev(limit('(1/n), 'n, inf),simp);", and in that case, it doesn't work. Any > advice? > > Cheers > > Thomas > > On 01/26/2011 01:37 PM, Ilya Ryabinkin wrote: >> >> You may try noun form 'i istead of i >> >> Ilya >> >> On Wed, Jan 26, 2011 at 6:06 AM, thomas ?wrote: >>> >>> Hi there! >>> >>> Some commands, such as "limit" or "sum" take a "target"-variable as an >>> argument. E.g. for limit or sum, this is the 2nd argument. However, there >>> is >>> an inconsistency in the way maxima behaves when this variable was >>> previously >>> defined: >>> >>> >>> $ maxima >>> Maxima 5.23.2 http://maxima.sourceforge.net >>> using Lisp SBCL 1.0.40.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) i:1; >>> (%o1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?1 >>> (%i2) limit(1/i, i, infinity); >>> >>> limit: second argument must be a variable, not a constant; found: 1 >>> ?-- an error. To debug this try: debugmode(true); >>> (%i3) sum(1/i, i, 1, 2); >>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 3 >>> (%o3) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- >>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2 >>> >>> >>> Since the 2nd argument in these commands is basically "local" to the >>> command, it is my understanding that "sum" behaves correctly in this >>> case, >>> while "limit" (and others like "diff") should somehow be fixed. At least >>> that is my understanding. Would this be possible/feasible? >>> >>> If that's not the case: is there some way to work around this? I've tried >>> using local and a block, but that didn't seem to work out :( Any advice? >>> >>> Cheers >>> >>> Thomas >>> _______________________________________________ >>> 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 l.butler at ed.ac.uk Sun Jan 30 10:46:15 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sun, 30 Jan 2011 16:46:15 +0000 (GMT) Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> Message-ID: On Sun, 30 Jan 2011, Ilya Ryabinkin wrote: < A similar issue would appear if you try to define a differential < operator that transforms a function into its derivative. I spent a lot < of time figuring out how it could be done; the only working way I < found was quite an awkward construction < D(f):= < funmake('lambda, < [['x], diff(f('x),'x)]); < Again, this happened because you have to perform differentiation with < respect to a formal argument, not a variable "x". This solution is not foolproof: D(lambda([t],x+t)); ==> lambda([x], 2) The foolproof solution would use a gensym, but the answers would not look so nice. The problem is that mathematical functions are really 2nd class objects in Maxima. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From robert.dodier at gmail.com Sun Jan 30 11:06:47 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 30 Jan 2011 09:06:47 -0800 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> Message-ID: On 1/30/11, Leo Butler wrote: > The foolproof solution would use a gensym, but the answers would not > look so nice. The blex construct which I introduced earlier in this thread assigns display properties to gensyms so they appear to be ordinary variables, e.g. blex creates a new variable which displays as x but which is distinct from any existing x variable. Maybe that helps. > The problem is that mathematical functions are really 2nd class objects > in Maxima. Yup. Robert Dodier From robert.dodier at gmail.com Sun Jan 30 11:14:28 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 30 Jan 2011 09:14:28 -0800 Subject: [Maxima] "describe" broken in 5.23.2 In-Reply-To: References: <4D3CABBA.7010005@olynet.com> Message-ID: Can someone help Andrej sort out this problem? I'd like to make a general announcement about Maxima 5.23 but I'll wait until the Windows package is fixed. Thanks to everyone for their efforts. Robert Dodier On 1/29/11, Stefano Ferri wrote: > Andrej, > > if you are fixing this problem, I have another question: before packaging, > did you stripped bynaries to remove the debug symbols, since they are > useless for normal users? > By comparing file sizes, maxima + wxmaxima + gcl + gnuplot packages for > linux, if stripped, have a size of about 16 Mb. Even considering that > windows packages also ship wxmaxima, gcl and gnuplot, and dependencies and > libraries not included in linux packages, 30 Mb aren't too much? > > Stefano > > > > > 2011/1/24 Andrej Vodopivec > >> There are two problems with describe. >> >> The first is that maxima-index.lisp is empty. This should be easy to fix. >> >> The second is that *maxima-infodir* is not correct set correctly. It >> should be maxima_prefix/share/info but it is set to >> maxima_prefix/info. I don't know how to fix this so I need some help. >> >> Andrej >> >> >> >> On Mon, Jan 24, 2011 at 9:33 AM, Stefano Ferri wrote: >> > Well, so it seems it is the Windows version that is broken... The >> > warning >> is >> > issued only the first time, further describe commands give "no exact >> match >> > found". >> > Seems like a build error dor documentation... >> > >> > >> > (%i1) describe(integrate); >> > WARNING: Empty documentation index. Describe command will not work! >> > No exact match found for topic `integrate'. >> > Try `?? integrate' (inexact match) instead. >> > (%o1) false >> > >> > (%i2) describe(integrate); >> > No exact match found for topic `integrate'. >> > Try `?? integrate' (inexact match) instead. >> > (%o2) false >> > >> > (%i3) build_info(); >> > Maxima version: 5.23.2 >> > Maxima build date: 17:9 1/17/2011 >> > Host type: i686-pc-mingw32 >> > Lisp implementation type: GNU Common Lisp (GCL) >> > Lisp implementation version: GCL 2.6.8 >> > (%o3) >> > >> > >> > 2011/1/23 Paul Bowyer >> >> >> >> Stefano: >> >> >> >> I just tried the following in Xmaxima: >> >> >> >> describe(integrate); >> >> ?? integrate; >> >> >> >> and I got the full output describing the function. >> >> >> >> Here's the output from build_info() (but I'm actually running >> >> PCLinuxOS >> >> derived from mandriva) >> >> Maxima version: 5.23.2 >> >> Maxima build date: 21:3 1/21/2011 >> >> Host type: i586-mandriva-linux-gnu >> >> Lisp implementation type: GNU Common Lisp (GCL) >> >> Lisp implementation version: GCL 2.6.8 >> >> >> >> Paul Bowyer >> >> >> >> On 01/23/2011 01:13 PM, Stefano Ferri wrote: >> >> >> >> Dear list, >> >> >> >> I've just downloaded Maxima 5.23.2 for Windows, and I've notice d that >> the >> >> useful command "describe" is broken. >> >> Here's what I get: >> >> >> >> (%i1) describe(integrate); >> >> WARNING: Empty documentation index. Describe command will not work! >> >> No exact match found for topic `integrate'. >> >> Try `?? integrate' (inexact match) instead. >> >> >> >> (%o1) false >> >> >> >> >> >> I still have't tryed the linux version. This is a really annoying >> issue... >> >> The command ?? is broken, too. >> >> >> >> Stefano >> >> >> >> _______________________________________________ >> >> 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 thomas at geogebra.org Sun Jan 30 15:09:38 2011 From: thomas at geogebra.org (thomas) Date: Sun, 30 Jan 2011 22:09:38 +0100 Subject: [Maxima] Simplifying the result of integrate Message-ID: <4D45D392.801@geogebra.org> Hi there! when I integrate the expression "(3*x+2)^5", maxima returns the fully expanded polynom "(81*x^6)/2+162*x^5+270*x^4+240*x^3+120*x^2+32*x". Albeit correct, I'd like to massage this into the form " 1/18(3x+2)^6". Is there any way to do this? Cheers Thomas From macrakis at alum.mit.edu Sun Jan 30 15:29:31 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 30 Jan 2011 16:29:31 -0500 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: <4D456D5C.7000705@geogebra.org> References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> Message-ID: * ev is a weird and complicated routine, and you should avoid using it unless you absolutely have to. * ev( ... , simp ) is synonymous with ev( ... ) unless you have previously set simp to false (which is a bad idea). What did you expect it to do? On Sun, Jan 30, 2011 at 08:53, thomas wrote: > Thanks for the suggestion :) > > This does indeed work when simply using "limit". However, in my case (we > call Maxima from inside another application), the call issued is actually > "ev(limit('(1/n), 'n, inf),simp);", and in that case, it doesn't work. Any > advice? > > > Cheers > > Thomas > > On 01/26/2011 01:37 PM, Ilya Ryabinkin wrote: > >> You may try noun form 'i istead of i >> >> Ilya >> >> On Wed, Jan 26, 2011 at 6:06 AM, thomas wrote: >> >> Hi there! >>> >>> Some commands, such as "limit" or "sum" take a "target"-variable as an >>> argument. E.g. for limit or sum, this is the 2nd argument. However, there >>> is >>> an inconsistency in the way maxima behaves when this variable was >>> previously >>> defined: >>> >>> >>> $ maxima >>> Maxima 5.23.2 http://maxima.sourceforge.net >>> using Lisp SBCL 1.0.40.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) i:1; >>> (%o1) 1 >>> (%i2) limit(1/i, i, infinity); >>> >>> limit: second argument must be a variable, not a constant; found: 1 >>> -- an error. To debug this try: debugmode(true); >>> (%i3) sum(1/i, i, 1, 2); >>> 3 >>> (%o3) - >>> 2 >>> >>> >>> Since the 2nd argument in these commands is basically "local" to the >>> command, it is my understanding that "sum" behaves correctly in this >>> case, >>> while "limit" (and others like "diff") should somehow be fixed. At least >>> that is my understanding. Would this be possible/feasible? >>> >>> If that's not the case: is there some way to work around this? I've tried >>> using local and a block, but that didn't seem to work out :( Any advice? >>> >>> Cheers >>> >>> Thomas >>> _______________________________________________ >>> 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 willisb at unk.edu Sun Jan 30 15:55:54 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 30 Jan 2011 15:55:54 -0600 Subject: [Maxima] Simplifying the result of integrate Message-ID: This method requires insight: ?(%i20) factor(integrate((3*t+2)^5,t,-2/3,x)); ?(%o20) (3*x+2)^6/18 Sometime ago there were, I think, other suggestions for doing this on the list. I looked, but I wasn't able to find them... --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >Hi?there! > >when?I?integrate?the?expression?"(3*x+2)^5",?maxima?returns?the?fully? >expanded?polynom?"(81*x^6)/2+162*x^5+270*x^4+240*x^3+120*x^2+32*x".? >Albeit?correct,?I'd?like?to?massage?this?into?the?form?"?1/18(3x+2)^6".? >Is?there?any?way?to?do?this? From fateman at eecs.berkeley.edu Sun Jan 30 16:14:51 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 30 Jan 2011 14:14:51 -0800 Subject: [Maxima] Simplifying the result of integrate In-Reply-To: References: Message-ID: <4D45E2DB.9090106@eecs.berkeley.edu> On 1/30/2011 1:55 PM, Barton Willis wrote: > This method requires insight: > > (%i20) factor(integrate((3*t+2)^5,t,-2/3,x)); > (%o20) (3*x+2)^6/18 > > Sometime ago there were, I think, other suggestions for doing this on the list. > I looked, but I wasn't able to find them... > > --Barton > > -----maxima-bounces at math.utexas.edu wrote: ----- > > >> Hi there! >> >> when I integrate the expression "(3*x+2)^5", maxima returns the fully >> expanded polynom "(81*x^6)/2+162*x^5+270*x^4+240*x^3+120*x^2+32*x". >> Albeit correct, I'd like to massage this into the form " 1/18(3x+2)^6". >> Is there any way to do this? > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima if you load partitions2deep.mac and try intfudu( (3*t+2)^5,t) you get the factored answer for the indefinite integral. This is produced initially, and not as a result of factoring afterward. intfudu does lots of integrals, some that integrate cannot do, and sometimes produces a better form. integrate does some integrals that intfudu cannot do. RJF From willisb at unk.edu Sun Jan 30 19:57:14 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 30 Jan 2011 19:57:14 -0600 Subject: [Maxima] Simplifying the result of integrate In-Reply-To: <4D45E2DB.9090106@eecs.berkeley.edu> References: , <4D45E2DB.9090106@eecs.berkeley.edu> Message-ID: >if?you?load?partitions2deep.mac and?try intfudu(?(3*t+2)^5,t) >you?get?the?factored?answer?for?the?indefinite?integral. The file partitions.mac, but not partitions2deep.mac is in Maxima. The intfudu function in partitions.mac also does this particular problem. Calling intfudu by using the integrate noun form is a bit of a trick: (%i5) load(abs_integrate)$ (%i6) 'integrate((3*t+2)^5,t); (%o6) (3*t+2)^6/18 Or, call intfudu directly (%i7) intfudu((3*t+2)^5,t); (%o7) (3*t+2)^6/18 I could place partitions2deep into the folder along with partitions--I have a copy of it, but I'm not sure if it is current. --Barton From toy.raymond at gmail.com Sun Jan 30 20:15:40 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 30 Jan 2011 21:15:40 -0500 Subject: [Maxima] Simplifying the result of integrate In-Reply-To: References: Message-ID: <4D461B4C.3080807@gmail.com> On 1/30/11 4:55 PM, Barton Willis wrote: > This method requires insight: > > (%i20) factor(integrate((3*t+2)^5,t,-2/3,x)); > (%o20) (3*x+2)^6/18 > > Sometime ago there were, I think, other suggestions for doing this on the list. > I looked, but I wasn't able to find them... > Yes, this has come up before. For this particular integral (and others like it), some routine has a magic 6 hardwired in it. If the exponent is less than 6, the integrand is expanded before doing the integration. If the exponent is >= 6, the integrand is not expanded and you would get a result in terms of the integrand with one higher exponent. Nothing came of the discussions because in both cases maxima was correct, even if the answer may not have been what the user wanted. I don't think anyone wanted to create yet another global magic variable to control this behavior, and there was no consensus on what is the desired answer. Ray From toy.raymond at gmail.com Sun Jan 30 21:38:59 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 30 Jan 2011 22:38:59 -0500 Subject: [Maxima] Maxima sourceforge repository Message-ID: <4D462ED3.4000206@gmail.com> In case you may not have heard, there has been an attack on the Sourceforge site. More info can be found here: https://sourceforge.net/blog/ Apparently, nothing has been compromised, but Sourceforge is validating project data against backups before restoring project services. One item that I wanted to point out is that Sourceforge is considering the end-of-life of the CVS service. There's no timeline given, but this does affect maxima since maxima is currently using CVS. I suppose we should consider moving to another version control system sometime soon. (Other than the occasional downtime, I've been quite happy with CVS even if it is old and crusty. I don't really want to learn yet another system, but it seems we might be forced to.) Ray From robert.dodier at gmail.com Sun Jan 30 22:40:29 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 30 Jan 2011 20:40:29 -0800 Subject: [Maxima] Maxima sourceforge repository In-Reply-To: <4D462ED3.4000206@gmail.com> References: <4D462ED3.4000206@gmail.com> Message-ID: On 1/30/11, Raymond Toy wrote: > One item that I wanted to point out is that Sourceforge is considering > the end-of-life of the CVS service. There's no timeline given, but this > does affect maxima since maxima is currently using CVS. I suppose we > should consider moving to another version control system sometime soon. > (Other than the occasional downtime, I've been quite happy with CVS even > if it is old and crusty. I don't really want to learn yet another > system, but it seems we might be forced to.) Well, there have been suggestions to use some other system -- I think git and maybe subversion have been mentioned. I don't care too much one way or another. I guess at this point I wouldn't mind switching to git. best Robert Dodier PS. I seem to recall that someone was pulling the CVS repo via rsync every now and then -- is that still happening? I am thinking that it would be nice to recover the repo if SF grinds to a halt at some point .... From robert.dodier at gmail.com Sun Jan 30 22:55:40 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 30 Jan 2011 20:55:40 -0800 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> Message-ID: On 1/30/11, Stavros Macrakis wrote: > * ev is a weird and complicated routine, and you should avoid using it > unless you absolutely have to. The problem with ev is that it's too complicated to be able to predict what's going to happen when it's called. I'm in favor of moving most of the 50 different things it does into separate functions. That said, the function exists and it's documented, so we can hardly be surprised that people use it. > * ev( ... , simp ) is synonymous with ev( ... ) unless you have previously > set simp to false (which is a bad idea). What did you expect it to do? I disagree that simp:false is a bad idea. The effect is exactly what one would expect; it disables built-in simplifications. If that's what you want, then great. Maxima is kind of clumsy with simplification -- there really isn't any way to control built-in simplifications, short of disabling them entirely. That's a serious design flaw IMNSHO. best Robert Dodier From toy.raymond at gmail.com Mon Jan 31 00:06:46 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 31 Jan 2011 01:06:46 -0500 Subject: [Maxima] Maxima sourceforge repository In-Reply-To: References: <4D462ED3.4000206@gmail.com> Message-ID: <4D465176.8010506@gmail.com> On 1/30/11 11:40 PM, Robert Dodier wrote: > On 1/30/11, Raymond Toy wrote: > >> One item that I wanted to point out is that Sourceforge is considering >> the end-of-life of the CVS service. There's no timeline given, but this >> does affect maxima since maxima is currently using CVS. I suppose we >> should consider moving to another version control system sometime soon. >> (Other than the occasional downtime, I've been quite happy with CVS even >> if it is old and crusty. I don't really want to learn yet another >> system, but it seems we might be forced to.) > Well, there have been suggestions to use some other system -- > I think git and maybe subversion have been mentioned. > I don't care too much one way or another. > I guess at this point I wouldn't mind switching to git. I notice that clisp (also hosted on sourceforge) wants to move to hg (mercurial). Perhaps a distributed version control system like git or hg would be best. But I think subversion probably has the lowest learning curve if you're already familiar with cvs. I have used the others a very little. Only to get the latest version of something. > best > > Robert Dodier > > PS. I seem to recall that someone was pulling the CVS repo > via rsync every now and then -- is that still happening? > I am thinking that it would be nice to recover the repo if SF > grinds to a halt at some point .... > I still make rsync backups every month. I have one from Jan 15. I doubt SF will grind to a halt, though. Ray From rswarbrick at gmail.com Mon Jan 31 04:01:49 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Mon, 31 Jan 2011 10:01:49 +0000 Subject: [Maxima] Maxima sourceforge repository References: <4D462ED3.4000206@gmail.com> <4D465176.8010506@gmail.com> Message-ID: Raymond Toy writes: > On 1/30/11 11:40 PM, Robert Dodier wrote: >> On 1/30/11, Raymond Toy wrote: >> >>> One item that I wanted to point out is that Sourceforge is considering >>> the end-of-life of the CVS service. There's no timeline given, but this >>> does affect maxima since maxima is currently using CVS. I suppose we >>> should consider moving to another version control system sometime soon. >>> (Other than the occasional downtime, I've been quite happy with CVS even >>> if it is old and crusty. I don't really want to learn yet another >>> system, but it seems we might be forced to.) >> Well, there have been suggestions to use some other system -- >> I think git and maybe subversion have been mentioned. >> I don't care too much one way or another. >> I guess at this point I wouldn't mind switching to git. > I notice that clisp (also hosted on sourceforge) wants to move to hg > (mercurial). Perhaps a distributed version control system like git or > hg would be best. But I think subversion probably has the lowest > learning curve if you're already familiar with cvs. I have used the > others a very little. Only to get the latest version of something. Since I'm not particularly active on this list, the last thing I want to do is have my only post being a git vs. hg vs. CVS vs... flame. But... Git is much more complicated than CVS. But it's not more complicated for the "end users": either those committing to the project or those pulling it. For the committer, the typical usage looks like git status # Ooh, I changed some stuff. git add foo.lisp bar.lisp git commit # Type a commit message in the editor that appears git push For the person pulling from the tree just to build: git clone git://someurl ./configure && make && make install and then when they update: git pull Of course, there are more ways to do things, but my point is that it's easy. Now, you can also do clever things, which weren't possible with CVS. Doing these is somewhat complicated. But the things themselves are also complicated, so maybe this isn't a problem. Also bear in mind that git's very popular. As such, there are an awful lot of tutorials floating around for how to do semi-complicated things. That's just my 2 pence. Incidentally, at least I (and probably others) have been converting the maxima tree to git on the fly for a while, since it's much easier to work with and see what changed when. In case you're worried about bloat in the amount one has to store locally, my .git folder (which holds *all* the commit history of the project) is 40mb or so. 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 Mon Jan 31 09:29:28 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 31 Jan 2011 10:29:28 -0500 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> Message-ID: On Sun, Jan 30, 2011 at 23:55, Robert Dodier wrote: > On 1/30/11, Stavros Macrakis wrote: > > > * ev is a weird and complicated routine, and you should avoid using it > > unless you absolutely have to. > > The problem with ev is that it's too complicated to be able to predict > what's going to happen when it's called. I'm in favor of moving most > of the 50 different things it does into separate functions. > The reason 'ev' is such a mess is that it is really a "do what I mean" system designed so that the command-line syntax xxx, yyy will work 'intuitively'. I agree entirely that all its functions should be available through clean, separate functions; and there are only a few functions that are not already available that way. Most of the 50 things it does already do exist as independent functions or global variable settings. One of the nice things ev does for you is let you forget whether something is a function or a global variable. For example ev(x,ratsimp) == ratsimp(x), but ev(x,numer) == block([numer:true], x); and then there's ev(x,float) == block([float:true],x) which is NOT equivalent to float(x) :-( . > That said, the function exists and it's documented, so we can hardly > be surprised that people use it. > I agree. There should be a big WARNING at the top of the documentation. > * ev( ... , simp ) is synonymous with ev( ... ) unless you have previously > > set simp to false (which is a bad idea). What did you expect it to do? > > I disagree that simp:false is a bad idea. The effect is exactly what > one would expect; it disables built-in simplifications. If that's what > you want, then great. > Certainly, simp:false has its uses. But in this case, I very much doubt that the user actually needed or wanted simp:false. Maxima is kind of clumsy with simplification -- there really isn't any > way to control built-in simplifications, short of disabling them > entirely. That's a serious design flaw IMNSHO. > The simplest way to control built-in simplifications is judicious use of box(). Beyond that, things get tricky. For example, the fact that "+" is commutative and associative allows Maxima to have a standard order of arguments, which simplifies and speeds up many algorithms. If I decided to turn off the associativity of "+", many many things in Maxima would no longer work -- not just in the simplification of "+", but any function which assumes that constant arguments precede variable arguments, for example. (That is not sloppy programming, but an explicit part of the 'contract' of Maxima's internal representation.) It is of course possible to imagine a system that works directly from the axioms (which could be switched on and off), but I would think it would be much slower and less powerful (because there are many non-trivial theorems which the system would have to rederive). Another approach is what we currently do with the "." operator, which has a large (and confusing) array of switches; the main problem right now is that there is only one "." operator, and no clear way to define the interactions between multiple operators (say that operator *** is left-distributive over operator +++). Perhaps that is one way forward. What do you have in mind as a design? -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Mon Jan 31 10:14:27 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 31 Jan 2011 08:14:27 -0800 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> Message-ID: <4D46DFE3.9010603@eecs.berkeley.edu> If you want to see another "solution", look at Mathematica. This program was designed by people who presumably had the opportunity to see what was done not only by Macsyma, but by Reduce, Axiom, Maple, .... They came up with Attributes for functions that include Protected, ReadProtected, Locked, Temporary, HoldFirst, HoldRest, HoldAll, Flat, Orderless, OneIdentity, Listable, Constant, Stub, NHoldFirst, NHoldRest, NHoldAll, NumericFunction, SequenceHold, and HoldAllComplete. These Attributes control how functions' arguments are evaluated by default, how functions are numerically evaluated, and how functions can be redefined. Also, how simplification and pattern matching works. In addition to these Attributes, there are functions like ReleaseHold, Evaluate, EvaluatorNames, and who knows what else. I mention all this not to indicate that "here's a solution we should adapt to Maxima." I mention it to point out that -- if there is such a thing as a clean solution --- Wolfram has certainly not found it. RJF On 1/31/2011 7:29 AM, Stavros Macrakis wrote: > On Sun, Jan 30, 2011 at 23:55, Robert Dodier > wrote: > > On 1/30/11, Stavros Macrakis > wrote: > > > * ev is a weird and complicated routine, and you should avoid > using it > > unless you absolutely have to. > > The problem with ev is that it's too complicated to be able to predict > what's going to happen when it's called. I'm in favor of moving most > of the 50 different things it does into separate functions. > > > The reason 'ev' is such a mess is that it is really a "do what I mean" > system designed so that the command-line syntax xxx, yyy will work > 'intuitively'. I agree entirely that all its functions should be > available through clean, separate functions; and there are only a few > functions that are not already available that way. Most of the 50 > things it does already do exist as independent functions or global > variable settings. One of the nice things ev does for you is let you > forget whether something is a function or a global variable. For > example ev(x,ratsimp) == ratsimp(x), but ev(x,numer) == > block([numer:true], x); and then there's ev(x,float) == > block([float:true],x) which is NOT equivalent to float(x) :-( . > > That said, the function exists and it's documented, so we can hardly > be surprised that people use it. > > > I agree. There should be a big WARNING at the top of the documentation. > > > * ev( ... , simp ) is synonymous with ev( ... ) unless you have > previously > > set simp to false (which is a bad idea). What did you expect it > to do? > > I disagree that simp:false is a bad idea. The effect is exactly what > one would expect; it disables built-in simplifications. If that's what > you want, then great. > > > Certainly, simp:false has its uses. But in this case, I very much > doubt that the user actually needed or wanted simp:false. > > Maxima is kind of clumsy with simplification -- there really isn't any > way to control built-in simplifications, short of disabling them > entirely. That's a serious design flaw IMNSHO. > > > The simplest way to control built-in simplifications is judicious use > of box(). Beyond that, things get tricky. For example, the fact that > "+" is commutative and associative allows Maxima to have a standard > order of arguments, which simplifies and speeds up many algorithms. > If I decided to turn off the associativity of "+", many many things > in Maxima would no longer work -- not just in the simplification of > "+", but any function which assumes that constant arguments precede > variable arguments, for example. (That is not sloppy programming, but > an explicit part of the 'contract' of Maxima's internal representation.) > > It is of course possible to imagine a system that works directly from > the axioms (which could be switched on and off), but I would think it > would be much slower and less powerful (because there are many > non-trivial theorems which the system would have to rederive). > Another approach is what we currently do with the "." operator, which > has a large (and confusing) array of switches; the main problem right > now is that there is only one "." operator, and no clear way to define > the interactions between multiple operators (say that operator *** is > left-distributive over operator +++). Perhaps that is one way forward. > > What do you have in mind as a design? > > -s > > > _______________________________________________ > 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 ahmed.abdelhakim at student.unife.it Mon Jan 31 09:55:34 2011 From: ahmed.abdelhakim at student.unife.it (ABDELHAKIM MOUHAMED AHMED ABDELSATTAR) Date: Mon, 31 Jan 2011 16:55:34 +0100 Subject: [Maxima] Maxima for mac os x 10.3.9 Message-ID: Hello, I need maxima package for mac os x 10.3.9 on G4. What is the suitable version?(maxima 5.18 upwards work only on mac os 10.4 ) Where can I download it? How install it? Thank you so much. Really appreciate it -- Ahmed Abdelhakim Dipatimento di Matematica 35, via Machiavelli 44121- Ferrara (FE)-Italy From toy.raymond at gmail.com Mon Jan 31 12:24:39 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 31 Jan 2011 13:24:39 -0500 Subject: [Maxima] Maxima for mac os x 10.3.9 In-Reply-To: References: Message-ID: <4D46FE67.3060706@gmail.com> On 1/31/11 10:55 AM, ABDELHAKIM MOUHAMED AHMED ABDELSATTAR wrote: > Hello, > I need maxima package for mac os x 10.3.9 on G4. > What is the suitable version?(maxima 5.18 upwards work only on mac os 10.4 ) Get an implementation of Lisp that runs on your OSX 10.3.9 G4 machine. I'm pretty sure clisp, cmucl, and sbcl has implementations that will run there. > Where can I download it? > How install it? Don't know if there is a precompiled package for OSX 10.3.9, but you can grab the sources from maxima.sourceforge.net and build it yourself. It should be straightforward to build on OSX. Ray > Thank you so much. > Really appreciate it From O.Kullmann at swansea.ac.uk Mon Jan 31 12:54:53 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Mon, 31 Jan 2011 18:54:53 +0000 Subject: [Maxima] Maxima sourceforge repository In-Reply-To: References: <4D462ED3.4000206@gmail.com> <4D465176.8010506@gmail.com> Message-ID: <20110131185453.GQ32073@cs-wsok.swansea.ac.uk> We used CVS for several years, and switched to git nearly 6 years ago. We are very satisfied with git! To switch to subversion at this time would be really a step backwards, and that without need --- for the daily tasks git-usage is very intuitive, and with git-gui and gitk two standardised simple graphical tools are also available. Once you know it a bit, you will also use it for all (so well, nearly all) other tasks. For example collaboration on a mathematical paper: You just send around a tarball (archive) containing the git-repository: Some will just ignore it, just changing the .tex-files (for example), some will just look into the history (very easy with gitk), and some will make full use of it (basically trivial with git-gui) --- no need for some server or such stuff! There are also several books out there now. The talk on git being "complicated" for my understanding results from the fact that some people are involved in rather technical stuff and then forget to abstract away from it when they write about git: for example there was an article in a German Linux magazine for the normal user, the guy wanted to introduce git, but all examples came from the Linux-kernel, with all complications involved etc. --- it was hilarious! So you find overcomplicated presentations of git, but you can just ignore that. It seems to me that git has really overtaken hg. Oliver On Mon, Jan 31, 2011 at 10:01:49AM +0000, Rupert Swarbrick wrote: > Raymond Toy writes: > > On 1/30/11 11:40 PM, Robert Dodier wrote: > >> On 1/30/11, Raymond Toy wrote: > >> > >>> One item that I wanted to point out is that Sourceforge is considering > >>> the end-of-life of the CVS service. There's no timeline given, but this > >>> does affect maxima since maxima is currently using CVS. I suppose we > >>> should consider moving to another version control system sometime soon. > >>> (Other than the occasional downtime, I've been quite happy with CVS even > >>> if it is old and crusty. I don't really want to learn yet another > >>> system, but it seems we might be forced to.) > >> Well, there have been suggestions to use some other system -- > >> I think git and maybe subversion have been mentioned. > >> I don't care too much one way or another. > >> I guess at this point I wouldn't mind switching to git. > > I notice that clisp (also hosted on sourceforge) wants to move to hg > > (mercurial). Perhaps a distributed version control system like git or > > hg would be best. But I think subversion probably has the lowest > > learning curve if you're already familiar with cvs. I have used the > > others a very little. Only to get the latest version of something. > > Since I'm not particularly active on this list, the last thing I want to > do is have my only post being a git vs. hg vs. CVS vs... flame. But... > > Git is much more complicated than CVS. But it's not more complicated for > the "end users": either those committing to the project or those pulling > it. For the committer, the typical usage looks like > > git status > # Ooh, I changed some stuff. > git add foo.lisp bar.lisp > git commit > # Type a commit message in the editor that appears > git push > > For the person pulling from the tree just to build: > > git clone git://someurl > ./configure && make && make install > > and then when they update: > > git pull > > Of course, there are more ways to do things, but my point is that it's > easy. > > Now, you can also do clever things, which weren't possible with > CVS. Doing these is somewhat complicated. But the things themselves are > also complicated, so maybe this isn't a problem. Also bear in mind that > git's very popular. As such, there are an awful lot of tutorials > floating around for how to do semi-complicated things. > > That's just my 2 pence. Incidentally, at least I (and probably others) > have been converting the maxima tree to git on the fly for a while, > since it's much easier to work with and see what changed when. In case > you're worried about bloat in the amount one has to store locally, my > .git folder (which holds *all* the commit history of the project) is > 40mb or so. > > Rupert > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- Dr. Oliver Kullmann Computer Science Department Swansea University Faraday Building, Singleton Park Swansea SA2 8PP, UK http://cs.swan.ac.uk/~csoliver/ From toy.raymond at gmail.com Mon Jan 31 13:28:13 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 31 Jan 2011 14:28:13 -0500 Subject: [Maxima] Maxima sourceforge repository In-Reply-To: <20110131185453.GQ32073@cs-wsok.swansea.ac.uk> References: <4D462ED3.4000206@gmail.com> <4D465176.8010506@gmail.com> <20110131185453.GQ32073@cs-wsok.swansea.ac.uk> Message-ID: <4D470D4D.6050203@gmail.com> On 1/31/11 1:54 PM, Oliver Kullmann wrote: > The talk on git being "complicated" for my understanding results from the fact > that some people are involved in rather technical stuff and then forget to > abstract away from it when they write about git: for example there was an article > in a German Linux magazine for the normal user, the guy wanted to introduce git, > but all examples came from the Linux-kernel, with all complications involved etc. > --- it was hilarious! So you find overcomplicated presentations of git, but you > can just ignore that. > > It seems to me that git has really overtaken hg. Of course, everyone is biased on using what he's familiar with. CVS does everything I need it to do wrt to maxima. Git might be overtaking hg, but hg is probably not going away soon either. (I know clisp is moving to hg. Some large, well-known projects are using hg such as openJDK, OpenOffice, Octave, ScientificPython, Xen, as listed on Mercurial's page.) Likewise, there are a large number of projects using git, most notably the Linux kernel. Ray From l.butler at ed.ac.uk Mon Jan 31 14:37:35 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 31 Jan 2011 20:37:35 +0000 (GMT) Subject: [Maxima] Maxima sourceforge repository In-Reply-To: <4D470D4D.6050203@gmail.com> References: <4D462ED3.4000206@gmail.com> <4D465176.8010506@gmail.com> <20110131185453.GQ32073@cs-wsok.swansea.ac.uk> <4D470D4D.6050203@gmail.com> Message-ID: On Mon, 31 Jan 2011, Raymond Toy wrote: < On 1/31/11 1:54 PM, Oliver Kullmann wrote: < > The talk on git being "complicated" for my understanding results from the fact < > that some people are involved in rather technical stuff and then forget to < > abstract away from it when they write about git: for example there was an article < > in a German Linux magazine for the normal user, the guy wanted to introduce git, < > but all examples came from the Linux-kernel, with all complications involved etc. < > --- it was hilarious! So you find overcomplicated presentations of git, but you < > can just ignore that. < > < > It seems to me that git has really overtaken hg. < Of course, everyone is biased on using what he's familiar with. CVS < does everything I need it to do wrt to maxima. < < Git might be overtaking hg, but hg is probably not going away soon < either. (I know clisp is moving to hg. Some large, well-known projects < are using hg such as openJDK, OpenOffice, Octave, ScientificPython, Xen, < as listed on Mercurial's page.) < < Likewise, there are a large number of projects using git, most notably < the Linux kernel. Ray, I think there is another factor to consider: what appeals to younger, talented hackers. On my reading, git is far more appealing to this group (anecdotal evidence: this past week our phd students had a self-organised seminar on using git to manage their dissertation writing--I can't imagine them talking about subversion or mercurial, though, despite our university officially supporting subversion 'private' repositories). The Maxima project needs to attract such hackers for its long run health. Btw, what sort of support will SF provide for moving repos from one rcs to another? Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From O.Kullmann at swansea.ac.uk Mon Jan 31 14:52:51 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Mon, 31 Jan 2011 20:52:51 +0000 Subject: [Maxima] problems with printf: hex with capital or small letters? In-Reply-To: References: <20110129173923.GK32073@cs-wsok.swansea.ac.uk> Message-ID: <20110131205251.GS32073@cs-wsok.swansea.ac.uk> Okay, I use supcase now to fix upper-case. thanks Oliver On Sat, Jan 29, 2011 at 06:33:56PM +0000, Leo Butler wrote: > > > On Sat, 29 Jan 2011, Oliver Kullmann wrote: > > < Hello, > < > < I got now Maxima running with Ecl version post-11.1.1, but there is > < one change of behaviour: > < > < printf(false,"~x",11) > < > < returned "B" before, while now it returns "b" (in general: capital letters > < before, small letters now). > < > < I can't find a precise definition of printf (Maxima refers > < to using some Lisp reference, but I can't find a Lisp reference > < which is precise enough). > < > < Are both outputs possible? Can it be sometimes "b", sometimes "B" ? > < Or is only one form true (this would be best ...). > > This is almost certainly down to a change in ecl. > Try running ecl in a shell and enter > (format t "~x" 11) > > There is no universal standard that hex 'digits' are uppercase. > Leo > From andre.maute at gmx.de Mon Jan 31 16:55:45 2011 From: andre.maute at gmx.de (andre maute) Date: Mon, 31 Jan 2011 23:55:45 +0100 Subject: [Maxima] factor does not work as expected Message-ID: <4D473DF1.3040509@gmx.de> suppose one has ----factor.max--------------------- display2d : false; declare(a_1,integer); declare(a_2,integer); declare(a_3,integer); assume(1-xbar_1 > 0); assume(1-xbar_2 > 0); assume(a_1 >= 0); assume(a_2 >= 0); assume(a_3 >= 0); h : 2^(a_2-a_1)*4^(a_3-a_2)*(1-xbar_2)^(a_3+a_2)*(1-xbar_1)^(a_3+a_2+a_1)/8^a_3; factor(ratsimp(h)); ----factor.max--------------------------- maxima -b factor.max gives -------output--------------------------- Maxima 5.19.2 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(factor.max) batching /home/user/factor.max (%i2) display2d : false (%o2) false (%i3) declare(a_1,integer) (%o3) done (%i4) declare(a_2,integer) (%o4) done (%i5) declare(a_3,integer) (%o5) done (%i6) assume(1-xbar_1 > 0) (%o6) [xbar_1 < 1] (%i7) assume(1-xbar_2 > 0) (%o7) [xbar_2 < 1] (%i8) assume(a_1 >= 0) (%o8) [a_1 >= 0] (%i9) assume(a_2 >= 0) (%o9) [a_2 >= 0] (%i10) assume(a_3 >= 0) (%o10) [a_3 >= 0] (%i11) h:2^(a_2-a_1)*4^(a_3-a_2)*(1-xbar_2)^(a_2+a_3)*(1-xbar_1)^(a_1+a_2+a_3) /8^a_3 (%o11) 2^(a_2-a_1)*4^(a_3-a_2)*(1-xbar_1)^(a_3+a_2+a_1)*(1-xbar_2)^(a_3+a_2) /8^a_3 (%i12) factor(ratsimp(h)) (%o12) 2^(a_2-a_1)*4^(a_3-a_2)*(1-xbar_1)^(a_3+a_2+a_1)*(1-xbar_2)^(a_3+a_2) /8^a_3 (%o12) "/home/puck/factor.max" -------output--------------------------- 1. Question: Is it possible to force maxima to combine the integer powers? 2. Question: How can I extract the exponents of (1-xbar_1) respectively (1-xbar_2)? Thanks Andre From thomas at geogebra.org Mon Jan 31 17:14:02 2011 From: thomas at geogebra.org (thomas) Date: Tue, 01 Feb 2011 00:14:02 +0100 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> Message-ID: <4D47423A.9060907@geogebra.org> On 01/31/2011 04:29 PM, Stavros Macrakis wrote: > > > * ev( ... , simp ) is synonymous with ev( ... ) unless you have > previously > > set simp to false (which is a bad idea). What did you expect it > to do? > > I disagree that simp:false is a bad idea. The effect is exactly what > one would expect; it disables built-in simplifications. If that's what > you want, then great. > > > Certainly, simp:false has its uses. But in this case, I very much > doubt that the user actually needed or wanted simp:false. > This is probably not relevant to the discussion that evolved out of this, but: yes, we (meaning Geogebra, a math-software that's currently trying to interface maxima) actually use simp: false. The background is that since Maxima doesn't have any kind of "Hold"-statement, we sometimes need to send statements to maxima without having them simplified, to mimic the behaviour of "hold". Everything that we want to send to Maxima simplified will go through ev(..., simp) instead. This actually works pretty well for our purposes, we've yet to encounter any problems with this approach. The one with the limit('(..), 'i) was the first one I witnessed. Is there a better way to do this? Cheers Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Mon Jan 31 17:18:35 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 31 Jan 2011 18:18:35 -0500 Subject: [Maxima] Maxima sourceforge repository In-Reply-To: References: <4D462ED3.4000206@gmail.com> <4D465176.8010506@gmail.com> <20110131185453.GQ32073@cs-wsok.swansea.ac.uk> <4D470D4D.6050203@gmail.com> Message-ID: <4D47434B.6090201@gmail.com> On 1/31/11 3:37 PM, Leo Butler wrote: > Ray, I think there is another factor to consider: what appeals to > younger, talented hackers. On my reading, git is far more appealing > to this group (anecdotal evidence: this past week our phd students > had a self-organised seminar on using git to manage their dissertation > writing--I can't imagine them talking about subversion or mercurial, > though, despite our university officially supporting subversion > 'private' repositories). > The Maxima project needs to attract such hackers for its long run health. Sorry, but in my crotchety old age cynicism, I can't imagine young hackers saying, "Oh dang. It's not using git. I don't want to hack on it." And my cynicism also says we don't need hackers who say "Oh look! It's uses git. I can hack on it!!!!" :-) I'm not arguing that we use hg and not git. If it's not cvs, I have a bit of learning to do, not least of which is getting a replacement for my trusty old friend in pcl-cvs in emacs. > Btw, what sort of support will SF provide for moving repos from one rcs > to another? I doubt there will be any support other than you can enable svn, hg, or git. FWIW, though, I did convert series yesterday from cvs to git. Went ok, but I think I messed up a few things which I'll have to fix up when shell access is enabled again. Not really important, but I kind of wanted all of the cvs history, including labels and branches. Ray From fateman at eecs.berkeley.edu Mon Jan 31 17:18:36 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 31 Jan 2011 15:18:36 -0800 Subject: [Maxima] factor does not work as expected In-Reply-To: <4D473DF1.3040509@gmx.de> References: <4D473DF1.3040509@gmx.de> Message-ID: <4D47434C.6020103@eecs.berkeley.edu> declare and assume have no effect on factor or ratsimp. ratsimp(h) is probably unnecessary. you could try subst(h^3,8,%) subst(h^2,4,%) subst(h,2,%) subst(2,h,%) There is a function hipow you could use for the 2nd part. From macrakis at alum.mit.edu Mon Jan 31 17:25:31 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 31 Jan 2011 18:25:31 -0500 Subject: [Maxima] factor does not work as expected In-Reply-To: <4D473DF1.3040509@gmx.de> References: <4D473DF1.3040509@gmx.de> Message-ID: radcan(h) will combine the powers. To extract all x such that x^base appears in expr, how about: powers_of(expr,base):=block([inflag:true], if mapatom(expr) then [] elseif part(expr,0) = "^" and part(expr,1) = base then [part(expr,2)] else apply('append,maplist(lambda([ex],powers_of(ex,base)),expr))) On Mon, Jan 31, 2011 at 17:55, andre maute wrote: > suppose one has > ----factor.max--------------------- > > display2d : false; > > declare(a_1,integer); > declare(a_2,integer); > declare(a_3,integer); > > assume(1-xbar_1 > 0); > assume(1-xbar_2 > 0); > > assume(a_1 >= 0); > assume(a_2 >= 0); > assume(a_3 >= 0); > > h : > 2^(a_2-a_1)*4^(a_3-a_2)*(1-xbar_2)^(a_3+a_2)*(1-xbar_1)^(a_3+a_2+a_1)/8^a_3; > > factor(ratsimp(h)); > ----factor.max--------------------------- > > maxima -b factor.max > > gives > -------output--------------------------- > Maxima 5.19.2 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(factor.max) > > batching /home/user/factor.max > (%i2) display2d : false > (%o2) false > (%i3) declare(a_1,integer) > (%o3) done > (%i4) declare(a_2,integer) > (%o4) done > (%i5) declare(a_3,integer) > (%o5) done > (%i6) assume(1-xbar_1 > 0) > (%o6) [xbar_1 < 1] > (%i7) assume(1-xbar_2 > 0) > (%o7) [xbar_2 < 1] > (%i8) assume(a_1 >= 0) > (%o8) [a_1 >= 0] > (%i9) assume(a_2 >= 0) > (%o9) [a_2 >= 0] > (%i10) assume(a_3 >= 0) > (%o10) [a_3 >= 0] > (%i11) > h:2^(a_2-a_1)*4^(a_3-a_2)*(1-xbar_2)^(a_2+a_3)*(1-xbar_1)^(a_1+a_2+a_3) > /8^a_3 > (%o11) > 2^(a_2-a_1)*4^(a_3-a_2)*(1-xbar_1)^(a_3+a_2+a_1)*(1-xbar_2)^(a_3+a_2) > /8^a_3 > (%i12) factor(ratsimp(h)) > (%o12) > 2^(a_2-a_1)*4^(a_3-a_2)*(1-xbar_1)^(a_3+a_2+a_1)*(1-xbar_2)^(a_3+a_2) > /8^a_3 > (%o12) "/home/puck/factor.max" > -------output--------------------------- > > 1. Question: > Is it possible to force maxima to combine the integer powers? > > 2. Question: > How can I extract the exponents of (1-xbar_1) respectively (1-xbar_2)? > > Thanks > Andre > > _______________________________________________ > 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 31 17:30:03 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 31 Jan 2011 18:30:03 -0500 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: <4D47423A.9060907@geogebra.org> References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> <4D47423A.9060907@geogebra.org> Message-ID: I don't know what a "Hold" statement is. To simplify an expression that was created with simp:false, you can use simply block([simp:true], expr ) This avoids all the perverse semantics of 'ev'. If the expression has been simplified (or partially simplified) under different conditions than the current conditions (e.g. different assumptions, different global flags, etc.), you can do: block([simp:true], expand(expr,0,0) ) which forces Maxima to rescan the whole expression, including parts that are already tagged as simplified. -s On Mon, Jan 31, 2011 at 18:14, thomas wrote: > On 01/31/2011 04:29 PM, Stavros Macrakis wrote: > > > > * ev( ... , simp ) is synonymous with ev( ... ) unless you have >> previously >> > set simp to false (which is a bad idea). What did you expect it to do? >> >> I disagree that simp:false is a bad idea. The effect is exactly what >> one would expect; it disables built-in simplifications. If that's what >> you want, then great. >> > > Certainly, simp:false has its uses. But in this case, I very much doubt > that the user actually needed or wanted simp:false. > > > This is probably not relevant to the discussion that evolved out of this, > but: yes, we (meaning Geogebra, a math-software that's currently trying to > interface maxima) actually use simp: false. > The background is that since Maxima doesn't have any kind of > "Hold"-statement, we sometimes need to send statements to maxima without > having them simplified, to mimic the behaviour of "hold". Everything that we > want to send to Maxima simplified will go through ev(..., simp) instead. > This actually works pretty well for our purposes, we've yet to encounter any > problems with this approach. The one with the limit('(..), 'i) was the first > one I witnessed. Is there a better way to do this? > > Cheers > > Thomas > > _______________________________________________ > 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 Jan 31 17:30:16 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 31 Jan 2011 15:30:16 -0800 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: <4D47423A.9060907@geogebra.org> References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> <4D47423A.9060907@geogebra.org> Message-ID: <4D474608.20804@eecs.berkeley.edu> On 1/31/2011 3:14 PM, thomas wrote: > On 01/31/2011 04:29 PM, Stavros Macrakis wrote: >> >> > * ev( ... , simp ) is synonymous with ev( ... ) unless you have >> previously >> > set simp to false (which is a bad idea). What did you expect >> it to do? >> >> I disagree that simp:false is a bad idea. The effect is exactly what >> one would expect; it disables built-in simplifications. If that's >> what >> you want, then great. >> >> >> Certainly, simp:false has its uses. But in this case, I very much >> doubt that the user actually needed or wanted simp:false. >> > > This is probably not relevant to the discussion that evolved out of > this, but: yes, we (meaning Geogebra, a math-software that's currently > trying to interface maxima) actually use simp: false. I forget the exact context of your project, but if you are not using the simplifier, then perhaps what you want to use is just the parser and the display. Then occasionally you could call the simplifier or the evaluator. These are all Lisp programs. Note that neither the display nor the evaluator will necessarily work on forms that come from the parser and are not simplified, but they probably will for expressions that are > The background is that since Maxima doesn't have any kind of > "Hold"-statement, There are 2 operations, somewhat separable. simplification and evaluation. If you just use the parser to obtain an expression it is neither simplified nor evaluated. > we sometimes need to send statements to maxima without having them > simplified, to mimic the behaviour of "hold". Everything that we want > to send to Maxima simplified will go through ev(..., simp) instead. > This actually works pretty well for our purposes, we've yet to > encounter any problems with this approach. The one with the > limit('(..), 'i) was the first one I witnessed. Is there a better way > to do this? Probably you could use the specific Lisp programs to do exactly what you want done, and if there is something you do not want to do, then you don't call those programs. They include simplifya meval1 displa and I'm not sure what you would use for parsing, since it depends somewhat on how you interface with your data. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas at geogebra.org Mon Jan 31 17:45:01 2011 From: thomas at geogebra.org (thomas) Date: Tue, 01 Feb 2011 00:45:01 +0100 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> <4D47423A.9060907@geogebra.org> Message-ID: <4D47497D.30906@geogebra.org> On 02/01/2011 12:30 AM, Stavros Macrakis wrote: > I don't know what a "Hold" statement is. > > To simplify an expression that was created with simp:false, you can > use simply > > block([simp:true], expr ) > > This avoids all the perverse semantics of 'ev'. > > If the expression has been simplified (or partially simplified) under > different conditions than the current conditions (e.g. different > assumptions, different global flags, etc.), you can do: > > block([simp:true], expand(expr,0,0) ) > > which forces Maxima to rescan the whole expression, including parts > that are already tagged as simplified. > > -s Hi! Sorry for not explaining what I meant with "hold": I meant a command available in other CAS that is basically a way to enter an expression without evaluating or simplifying it. Since to my knowledge maxima doesn't have any such thing, so we emulate it by using simp:false as default and use ev(....., simp) every time we really do want to have somethign evaluated/simplified. Is "ev" (and using simp:false) really that evil? (Like I said, I've yet to encounter any "perverse" semantics of it, so far it worked pretty well)? (In any case, thank you for your suggestions and the tip with 'block' :) ) Cheers Thomas From thomas at geogebra.org Mon Jan 31 17:54:46 2011 From: thomas at geogebra.org (thomas) Date: Tue, 01 Feb 2011 00:54:46 +0100 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: <4D474608.20804@eecs.berkeley.edu> References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> <4D47423A.9060907@geogebra.org> <4D474608.20804@eecs.berkeley.edu> Message-ID: <4D474BC6.70704@geogebra.org> >> we sometimes need to send statements to maxima without having them >> simplified, to mimic the behaviour of "hold". Everything that we want >> to send to Maxima simplified will go through ev(..., simp) instead. >> This actually works pretty well for our purposes, we've yet to >> encounter any problems with this approach. The one with the >> limit('(..), 'i) was the first one I witnessed. Is there a better way >> to do this? > Probably you could use the specific Lisp programs to do exactly what > you want done, and if there is something > you do not want to do, then you don't call those programs. > They include > simplifya > meval1 > displa > and I'm not sure what you would use for parsing, since it depends > somewhat on how you interface with your data. > > > RJF > Most of the time, we DO want to evaluate and simplify statements, ie. we usually do want "the full package". But thank you for suggesting that it's possible to just use the parser,simplifier, etc. without using all of maxima, I'd never have thought of it myself. I'll keep it in mind in case we ever need it :) Out of curiosity: why do "simlifya", "meval1", etc. have such rather counter-intuitive names? :D Cheers Thomas From macrakis at alum.mit.edu Mon Jan 31 18:15:34 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 31 Jan 2011 19:15:34 -0500 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: <4D47497D.30906@geogebra.org> References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> <4D47423A.9060907@geogebra.org> <4D47497D.30906@geogebra.org> Message-ID: ev really is that evil -- take a look at my old note in http://www.math.utexas.edu/pipermail/maxima/2007/006737.html for some examples (certainly not exhaustive!). It is easy enough to create a pseudo-function that will quote its argument and 'protect' it from simplification: :lisp (defprop $nosimp (lambda(x) (list '(mlabox simp) (cadr x) '$nosimp)) mfexpr*) ex: nosimp(2+3); nosimp" "2 + 3" """"""" rembox(ex,'nosimp); 5 block([simp:false],print(rembox(%o44,'nosimp))); 2 + 3 <<< printed result from within the block 5 <<< gets simplified when returned from block On Mon, Jan 31, 2011 at 18:45, thomas wrote: > On 02/01/2011 12:30 AM, Stavros Macrakis wrote: > >> I don't know what a "Hold" statement is. >> >> To simplify an expression that was created with simp:false, you can use >> simply >> >> block([simp:true], expr ) >> >> This avoids all the perverse semantics of 'ev'. >> >> If the expression has been simplified (or partially simplified) under >> different conditions than the current conditions (e.g. different >> assumptions, different global flags, etc.), you can do: >> >> block([simp:true], expand(expr,0,0) ) >> >> which forces Maxima to rescan the whole expression, including parts that >> are already tagged as simplified. >> >> -s >> > > Hi! > Sorry for not explaining what I meant with "hold": I meant a command > available in other CAS that is basically a way to enter an expression > without evaluating or simplifying it. Since to my knowledge maxima doesn't > have any such thing, so we emulate it by using simp:false as default and use > ev(....., simp) every time we really do want to have somethign > evaluated/simplified. > > Is "ev" (and using simp:false) really that evil? (Like I said, I've yet to > encounter any "perverse" semantics of it, so far it worked pretty well)? > (In any case, thank you for your suggestions and the tip with 'block' :) > ) > > Cheers > > Thomas > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre.maute at gmx.de Mon Jan 31 18:13:04 2011 From: andre.maute at gmx.de (andre maute) Date: Tue, 01 Feb 2011 01:13:04 +0100 Subject: [Maxima] factor does not work as expected In-Reply-To: References: <4D473DF1.3040509@gmx.de> Message-ID: <4D475010.7090802@gmx.de> On 02/01/2011 12:25 AM, Stavros Macrakis wrote: > radcan(h) will combine the powers. > > To extract all x such that x^base appears in expr, how about: > > powers_of(expr,base):=block([inflag:true], > if mapatom(expr) then [] elseif part(expr,0) = "^" and > part(expr,1) = base then [part(expr,2)] > else > apply('append,maplist(lambda([ex],powers_of(ex,base)),expr))) Very nice, thank you for the quick response Andre > On Mon, Jan 31, 2011 at 17:55, andre maute wrote: > >> suppose one has >> ----factor.max--------------------- >> >> display2d : false; >> >> declare(a_1,integer); >> declare(a_2,integer); >> declare(a_3,integer); >> >> assume(1-xbar_1> 0); >> assume(1-xbar_2> 0); >> >> assume(a_1>= 0); >> assume(a_2>= 0); >> assume(a_3>= 0); >> >> h : >> 2^(a_2-a_1)*4^(a_3-a_2)*(1-xbar_2)^(a_3+a_2)*(1-xbar_1)^(a_3+a_2+a_1)/8^a_3; >> >> factor(ratsimp(h)); >> ----factor.max--------------------------- >> >> maxima -b factor.max >> >> gives >> -------output--------------------------- >> Maxima 5.19.2 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(factor.max) >> >> batching /home/user/factor.max >> (%i2) display2d : false >> (%o2) false >> (%i3) declare(a_1,integer) >> (%o3) done >> (%i4) declare(a_2,integer) >> (%o4) done >> (%i5) declare(a_3,integer) >> (%o5) done >> (%i6) assume(1-xbar_1> 0) >> (%o6) [xbar_1< 1] >> (%i7) assume(1-xbar_2> 0) >> (%o7) [xbar_2< 1] >> (%i8) assume(a_1>= 0) >> (%o8) [a_1>= 0] >> (%i9) assume(a_2>= 0) >> (%o9) [a_2>= 0] >> (%i10) assume(a_3>= 0) >> (%o10) [a_3>= 0] >> (%i11) >> h:2^(a_2-a_1)*4^(a_3-a_2)*(1-xbar_2)^(a_2+a_3)*(1-xbar_1)^(a_1+a_2+a_3) >> /8^a_3 >> (%o11) >> 2^(a_2-a_1)*4^(a_3-a_2)*(1-xbar_1)^(a_3+a_2+a_1)*(1-xbar_2)^(a_3+a_2) >> /8^a_3 >> (%i12) factor(ratsimp(h)) >> (%o12) >> 2^(a_2-a_1)*4^(a_3-a_2)*(1-xbar_1)^(a_3+a_2+a_1)*(1-xbar_2)^(a_3+a_2) >> /8^a_3 >> (%o12) "/home/puck/factor.max" >> -------output--------------------------- >> >> 1. Question: >> Is it possible to force maxima to combine the integer powers? >> >> 2. Question: >> How can I extract the exponents of (1-xbar_1) respectively (1-xbar_2)? >> >> Thanks >> Andre >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> From fateman at eecs.berkeley.edu Mon Jan 31 19:20:18 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 31 Jan 2011 17:20:18 -0800 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: <4D474BC6.70704@geogebra.org> References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> <4D47423A.9060907@geogebra.org> <4D474608.20804@eecs.berkeley.edu> <4D474BC6.70704@geogebra.org> Message-ID: <4D475FD2.6070908@eecs.berkeley.edu> On 1/31/2011 3:54 PM, thomas wrote: > > Out of curiosity: why do "simlifya", "meval1", etc. have such rather > counter-intuitive names? :D Historical. meval combines 2 facilities, which are generally used together... (defun meval (form) simplifya (meval1 form) nil)) why simplifya? maybe there was a simplify and simplifyb too. From thomas at geogebra.org Tue Feb 1 04:21:07 2011 From: thomas at geogebra.org (thomas) Date: Tue, 01 Feb 2011 11:21:07 +0100 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> <4D47423A.9060907@geogebra.org> <4D47497D.30906@geogebra.org> Message-ID: <4D47DE93.7020705@geogebra.org> Thanks :) On 02/01/2011 01:15 AM, Stavros Macrakis wrote: > ev really is that evil -- take a look at my old note in > http://www.math.utexas.edu/pipermail/maxima/2007/006737.html for some > examples (certainly not exhaustive!). > > It is easy enough to create a pseudo-function that will quote its > argument and 'protect' it from simplification: > > :lisp (defprop $nosimp (lambda(x) (list '(mlabox simp) (cadr x) > '$nosimp)) mfexpr*) > > ex: nosimp(2+3); > > nosimp" > "2 + 3" > """"""" > > rembox(ex,'nosimp); > > 5 > > block([simp:false],print(rembox(%o44,'nosimp))); > > 2 + 3 <<< printed result from within the block > > 5 <<< gets simplified when returned from block > > > On Mon, Jan 31, 2011 at 18:45, thomas > wrote: > > On 02/01/2011 12:30 AM, Stavros Macrakis wrote: > > I don't know what a "Hold" statement is. > > To simplify an expression that was created with simp:false, > you can use simply > > block([simp:true], expr ) > > This avoids all the perverse semantics of 'ev'. > > If the expression has been simplified (or partially > simplified) under different conditions than the current > conditions (e.g. different assumptions, different global > flags, etc.), you can do: > > block([simp:true], expand(expr,0,0) ) > > which forces Maxima to rescan the whole expression, including > parts that are already tagged as simplified. > > -s > > > Hi! > Sorry for not explaining what I meant with "hold": I meant a > command available in other CAS that is basically a way to enter an > expression without evaluating or simplifying it. Since to my > knowledge maxima doesn't have any such thing, so we emulate it by > using simp:false as default and use ev(....., simp) every time we > really do want to have somethign evaluated/simplified. > > Is "ev" (and using simp:false) really that evil? (Like I said, > I've yet to encounter any "perverse" semantics of it, so far it > worked pretty well)? > (In any case, thank you for your suggestions and the tip with > 'block' :) ) > > Cheers > > Thomas > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Tue Feb 1 05:36:11 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 1 Feb 2011 05:36:11 -0600 Subject: [Maxima] Inconsistency when using previously defined variables as arguments to functions In-Reply-To: <4D474BC6.70704@geogebra.org> References: <4D400040.1020007@geogebra.org> <4D456D5C.7000705@geogebra.org> <4D47423A.9060907@geogebra.org> <4D474608.20804@eecs.berkeley.edu>, <4D474BC6.70704@geogebra.org> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > But?thank?you?for?suggesting?that?it's?possible?to?just?use?the? > parser,simplifier,?etc.?without?using?all?of?maxima, A variant of (defmspec $read_no_simp (x) (displa (second x)) '$done) might be something you can use; example (%i21) read_no_simp(1/(1/x) + sin(0) + log(0) - 0^0 + 0/0); 1/(1/x)+sin(0)+log(0)-0^0+0/0 (%o21) done --Barton From steve at cs.clemson.edu Tue Feb 1 07:48:56 2011 From: steve at cs.clemson.edu (Steve Stevenson) Date: Tue, 1 Feb 2011 08:48:56 -0500 Subject: [Maxima] Fwd: Git conversion In-Reply-To: References: Message-ID: Just to back up some comments on where things seem to be going. I'm working with local professional developers and their opinion is that git is much better than subversion. They have moved all their projects to git. I have a class making a fancy open source interface for git using their design. -- D. E. (Steve) Stevenson, Associate Professor Director, Institute for Modeling and Simulation Applications. Clemson University steve at clemson dot edu From mhw at netris.org Tue Feb 1 09:45:04 2011 From: mhw at netris.org (Mark H Weaver) Date: Tue, 01 Feb 2011 10:45:04 -0500 Subject: [Maxima] Fwd: Git conversion In-Reply-To: (Steve Stevenson's message of "Tue, 1 Feb 2011 08:48:56 -0500") References: Message-ID: <8739o7wygv.fsf@yeeloong.netris.org> For what it's worth, as a long-time user of CVS and a recent user of git, I am extremely impressed with git's design and capabilities. I can't speak to how it compares with other distributed VCSs, since it is the only one I'm familiar with. However, I personally find the advantages of distributed VCS in general to be quite compelling. It is very nice to be able to look at the revision history, change logs, etc, without using the network. Even better is the ability to make changes on a local branch without having commit access to the repository. I think this feature has the potential to attract more developers, because it allows them to work more conveniently before they have sufficiently proven themselves to earn write access to the official repository. It is also very comforting that its design prevents a security breach from being able to modify the revision history. The git database is implemented as a non-mutable purely functional data structure, where pointers to a node are essentially represented as a secure cryptographic hash of the entire history leading to that node. I think it would be a great shame if we switched to subversion or stayed with CVS. Once you have become accustomed to the benefits of distributed VCS, it is very painful to go back. Mark From dlakelan at street-artists.org Tue Feb 1 23:16:22 2011 From: dlakelan at street-artists.org (dlakelan) Date: Tue, 01 Feb 2011 21:16:22 -0800 Subject: [Maxima] BUG: Strange behavior in diff with depends? Message-ID: <4D48E8A6.7010109@street-artists.org> Maxima 5.22.1 http://maxima.sourceforge.net using Lisp SBCL 1.0.34.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) depends(mu,T); (%o1) [mu(T)] (%i2) depends(T,[z,t]); (%o2) [T(z, t)] (%i3) diff(mu,z); dmu dT (%o3) --- -- dT dz (%i4) diff(1/mu,z); (%o4) 0 (%i5) diff(1/mu,mu)*diff(mu,T)*diff(T,z); dmu dT --- -- dT dz (%o5) - ------ 2 mu ------------- shouldn't %o4 be the same as %o5 be the same? From andrej.vodopivec at gmail.com Wed Feb 2 05:18:10 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Wed, 2 Feb 2011 12:18:10 +0100 Subject: [Maxima] "describe" broken in 5.23.2 In-Reply-To: References: <4D3CABBA.7010005@olynet.com> Message-ID: I have updated the windows package. Can someone confirm that help works? Andrej On Sun, Jan 30, 2011 at 6:14 PM, Robert Dodier wrote: > Can someone help Andrej sort out this problem? > I'd like to make a general announcement about Maxima 5.23 > but I'll wait until the Windows package is fixed. > > Thanks to everyone for their efforts. > > Robert Dodier > > > On 1/29/11, Stefano Ferri wrote: >> Andrej, >> >> if you are fixing this problem, I have another question: before packaging, >> did you stripped bynaries to remove the debug symbols, since they are >> useless for normal users? >> By comparing file sizes, maxima + wxmaxima + gcl + gnuplot packages for >> linux, if stripped, have a size of about 16 Mb. Even considering that >> windows packages also ship wxmaxima, gcl and gnuplot, and dependencies and >> libraries not included in linux packages, 30 Mb aren't too much? >> >> Stefano >> >> >> >> >> 2011/1/24 Andrej Vodopivec >> >>> There are two problems with describe. >>> >>> The first is that maxima-index.lisp is empty. This should be easy to fix. >>> >>> The second is that *maxima-infodir* is not correct set correctly. It >>> should be maxima_prefix/share/info but it is set to >>> maxima_prefix/info. I don't know how to fix this so I need some help. >>> >>> Andrej >>> >>> >>> >>> On Mon, Jan 24, 2011 at 9:33 AM, Stefano Ferri wrote: >>> > Well, so it seems it is the Windows version that is broken... The >>> > warning >>> is >>> > issued only the first time, further describe commands give "no exact >>> match >>> > found". >>> > Seems like a build error dor documentation... >>> > >>> > >>> > (%i1) describe(integrate); >>> > WARNING: Empty documentation index. Describe command will not work! >>> > ? No exact match found for topic `integrate'. >>> > ? Try `?? integrate' (inexact match) instead. >>> > (%o1) false >>> > >>> > (%i2) describe(integrate); >>> > ? No exact match found for topic `integrate'. >>> > ? Try `?? integrate' (inexact match) instead. >>> > (%o2) false >>> > >>> > (%i3) build_info(); >>> > Maxima version: 5.23.2 >>> > Maxima build date: 17:9 1/17/2011 >>> > Host type: i686-pc-mingw32 >>> > Lisp implementation type: GNU Common Lisp (GCL) >>> > Lisp implementation version: GCL 2.6.8 >>> > (%o3) >>> > >>> > >>> > 2011/1/23 Paul Bowyer >>> >> >>> >> Stefano: >>> >> >>> >> I just tried the following in Xmaxima: >>> >> >>> >> describe(integrate); >>> >> ?? integrate; >>> >> >>> >> and I got the full output describing the function. >>> >> >>> >> Here's the output from build_info() ?(but I'm actually running >>> >> PCLinuxOS >>> >> derived from mandriva) >>> >> Maxima version: 5.23.2 >>> >> Maxima build date: 21:3 1/21/2011 >>> >> Host type: i586-mandriva-linux-gnu >>> >> Lisp implementation type: GNU Common Lisp (GCL) >>> >> Lisp implementation version: GCL 2.6.8 >>> >> >>> >> Paul Bowyer >>> >> >>> >> On 01/23/2011 01:13 PM, Stefano Ferri wrote: >>> >> >>> >> Dear list, >>> >> >>> >> I've just downloaded Maxima 5.23.2 for Windows, and I've notice d that >>> the >>> >> useful command "describe" is broken. >>> >> Here's what I get: >>> >> >>> >> (%i1) describe(integrate); >>> >> WARNING: Empty documentation index. Describe command will not work! >>> >> ? No exact match found for topic `integrate'. >>> >> ? Try `?? integrate' (inexact match) instead. >>> >> >>> >> (%o1) ?false >>> >> >>> >> >>> >> I still have't tryed the linux version. This is a really annoying >>> issue... >>> >> The command ?? is broken, too. >>> >> >>> >> Stefano >>> >> >>> >> _______________________________________________ >>> >> 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 yhonda at mac.com Wed Feb 2 09:56:20 2011 From: yhonda at mac.com (Yasuaki Honda) Date: Thu, 3 Feb 2011 00:56:20 +0900 Subject: [Maxima] "describe" broken in 5.23.2 In-Reply-To: References: <4D3CABBA.7010005@olynet.com> Message-ID: <82067E49-6125-45F6-9114-506BABC47C8E@mac.com> Hi Andrej, The Windows package for 5.23.2 works fine for me. ?? and describe() function works as expected, too. Thanks for you very much!! Yasuaki Honda On 2011/02/02, at 20:18, Andrej Vodopivec wrote: > I have updated the windows package. Can someone confirm that help works? > > Andrej > > > > On Sun, Jan 30, 2011 at 6:14 PM, Robert Dodier wrote: >> Can someone help Andrej sort out this problem? >> I'd like to make a general announcement about Maxima 5.23 >> but I'll wait until the Windows package is fixed. >> >> Thanks to everyone for their efforts. >> >> Robert Dodier >> >> >> On 1/29/11, Stefano Ferri wrote: >>> Andrej, >>> >>> if you are fixing this problem, I have another question: before packaging, >>> did you stripped bynaries to remove the debug symbols, since they are >>> useless for normal users? >>> By comparing file sizes, maxima + wxmaxima + gcl + gnuplot packages for >>> linux, if stripped, have a size of about 16 Mb. Even considering that >>> windows packages also ship wxmaxima, gcl and gnuplot, and dependencies and >>> libraries not included in linux packages, 30 Mb aren't too much? >>> >>> Stefano >>> >>> >>> >>> >>> 2011/1/24 Andrej Vodopivec >>> >>>> There are two problems with describe. >>>> >>>> The first is that maxima-index.lisp is empty. This should be easy to fix. >>>> >>>> The second is that *maxima-infodir* is not correct set correctly. It >>>> should be maxima_prefix/share/info but it is set to >>>> maxima_prefix/info. I don't know how to fix this so I need some help. >>>> >>>> Andrej >>>> >>>> >>>> >>>> On Mon, Jan 24, 2011 at 9:33 AM, Stefano Ferri wrote: >>>>> Well, so it seems it is the Windows version that is broken... The >>>>> warning >>>> is >>>>> issued only the first time, further describe commands give "no exact >>>> match >>>>> found". >>>>> Seems like a build error dor documentation... >>>>> >>>>> >>>>> (%i1) describe(integrate); >>>>> WARNING: Empty documentation index. Describe command will not work! >>>>> No exact match found for topic `integrate'. >>>>> Try `?? integrate' (inexact match) instead. >>>>> (%o1) false >>>>> >>>>> (%i2) describe(integrate); >>>>> No exact match found for topic `integrate'. >>>>> Try `?? integrate' (inexact match) instead. >>>>> (%o2) false >>>>> >>>>> (%i3) build_info(); >>>>> Maxima version: 5.23.2 >>>>> Maxima build date: 17:9 1/17/2011 >>>>> Host type: i686-pc-mingw32 >>>>> Lisp implementation type: GNU Common Lisp (GCL) >>>>> Lisp implementation version: GCL 2.6.8 >>>>> (%o3) >>>>> >>>>> >>>>> 2011/1/23 Paul Bowyer >>>>>> >>>>>> Stefano: >>>>>> >>>>>> I just tried the following in Xmaxima: >>>>>> >>>>>> describe(integrate); >>>>>> ?? integrate; >>>>>> >>>>>> and I got the full output describing the function. >>>>>> >>>>>> Here's the output from build_info() (but I'm actually running >>>>>> PCLinuxOS >>>>>> derived from mandriva) >>>>>> Maxima version: 5.23.2 >>>>>> Maxima build date: 21:3 1/21/2011 >>>>>> Host type: i586-mandriva-linux-gnu >>>>>> Lisp implementation type: GNU Common Lisp (GCL) >>>>>> Lisp implementation version: GCL 2.6.8 >>>>>> >>>>>> Paul Bowyer >>>>>> >>>>>> On 01/23/2011 01:13 PM, Stefano Ferri wrote: >>>>>> >>>>>> Dear list, >>>>>> >>>>>> I've just downloaded Maxima 5.23.2 for Windows, and I've notice d that >>>> the >>>>>> useful command "describe" is broken. >>>>>> Here's what I get: >>>>>> >>>>>> (%i1) describe(integrate); >>>>>> WARNING: Empty documentation index. Describe command will not work! >>>>>> No exact match found for topic `integrate'. >>>>>> Try `?? integrate' (inexact match) instead. >>>>>> >>>>>> (%o1) false >>>>>> >>>>>> >>>>>> I still have't tryed the linux version. This is a really annoying >>>> issue... >>>>>> The command ?? is broken, too. >>>>>> >>>>>> Stefano >>>>>> >>>>>> _______________________________________________ >>>>>> 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 drdieterkaiser at web.de Wed Feb 2 12:30:46 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 02 Feb 2011 19:30:46 +0100 Subject: [Maxima] "describe" broken in 5.23.2 In-Reply-To: <82067E49-6125-45F6-9114-506BABC47C8E@mac.com> References: <4D3CABBA.7010005@olynet.com> <82067E49-6125-45F6-9114-506BABC47C8E@mac.com> Message-ID: <1296671446.1720.1.camel@dieter> Am Donnerstag, den 03.02.2011, 00:56 +0900 schrieb Yasuaki Honda: > Hi Andrej, > > The Windows package for 5.23.2 works fine for me. > ?? and describe() function works as expected, too. > > Thanks for you very much!! > > Yasuaki Honda I have no problems with Maxima 5.23.2 for Windows. The documentation is available and the testsuite has no problems. Dieter Kaiser From drdieterkaiser at web.de Wed Feb 2 12:36:43 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 02 Feb 2011 19:36:43 +0100 Subject: [Maxima] BUG: Strange behavior in diff with depends? In-Reply-To: <4D48E8A6.7010109@street-artists.org> References: <4D48E8A6.7010109@street-artists.org> Message-ID: <1296671803.1720.5.camel@dieter> Am Dienstag, den 01.02.2011, 21:16 -0800 schrieb dlakelan: > > Maxima 5.22.1 http://maxima.sourceforge.net > using Lisp SBCL 1.0.34.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) depends(mu,T); > (%o1) [mu(T)] > (%i2) depends(T,[z,t]); > (%o2) [T(z, t)] > (%i3) diff(mu,z); > dmu dT > (%o3) --- -- > dT dz > (%i4) diff(1/mu,z); > (%o4) 0 > (%i5) diff(1/mu,mu)*diff(mu,T)*diff(T,z); > dmu dT > --- -- > dT dz > (%o5) - ------ > 2 > mu > > ------------- > > shouldn't %o4 be the same as %o5 be the same? We had a bug in Maxima 5.22 (I have introduced it, when correcting another bug). In Maxima 5.23.2 the bug is no longer present. Perhaps, you can download and install the newest version Maxima 5.23.2. (%i2) depends(mu,T); (%o2) [mu(T)] (%i3) depends(T,[z,t]); (%o3) [T(z,t)] (%i4) diff(mu,z); (%o4) 'diff(mu,T,1)*'diff(T,z,1) (%i5) diff(1/mu,z); (%o5) -'diff(mu,T,1)*'diff(T,z,1)/mu^2 (%i6) diff(1/mu,mu)*diff(mu,T)*diff(T,z); (%o6) -'diff(mu,T,1)*'diff(T,z,1)/mu^2 Dieter Kaiser From dlakelan at street-artists.org Wed Feb 2 12:45:39 2011 From: dlakelan at street-artists.org (dlakelan) Date: Wed, 02 Feb 2011 10:45:39 -0800 Subject: [Maxima] BUG: Strange behavior in diff with depends? In-Reply-To: <1296671803.1720.5.camel@dieter> References: <4D48E8A6.7010109@street-artists.org> <1296671803.1720.5.camel@dieter> Message-ID: <4D49A653.5060300@street-artists.org> On 02/02/2011 10:36 AM, Dieter Kaiser wrote: > We had a bug in Maxima 5.22 (I have introduced it, when correcting > another bug). In Maxima 5.23.2 the bug is no longer present. Perhaps, > you can download and install the newest version Maxima 5.23.2. Thank you Dieter, I tried this a few minutes ago and it works. From willisb at unk.edu Wed Feb 2 19:31:51 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 2 Feb 2011 19:31:51 -0600 Subject: [Maxima] simplifying predicates In-Reply-To: <1296671803.1720.5.camel@dieter> References: <4D48E8A6.7010109@street-artists.org>, <1296671803.1720.5.camel@dieter> Message-ID: We've talked about making simplifying versions of integerp, oddp, and ...; see thread starting at http://www.math.utexas.edu/pipermail/maxima/2010/021502.html We could define simplifications for the nounforms of integerp and friends. This would work something like: (%i2) integerp(x); (%o2) false The nounform simplifies: (%i25) 'integerp(x); (%o25) integerp(x) (%i26) [subst(x = 42,%), subst(x = sqrt(2),%), subst(x = log(42),%)]; (%o26) [true,false,integerp(log(42))] Maxima doesn't know that log(42) isn't an integer. So it goes. (%i27) 'integerp(42); (%o27) true Maybe this scheme (especially %o27) isn't all that clear to users? Other functions work this way (integrate and sum, I think). --Barton From woollett at charter.net Thu Feb 3 17:17:26 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 3 Feb 2011 15:17:26 -0800 Subject: [Maxima] Maxima by Example Ch. 9 Update Message-ID: <5601DDD27A044EBC8773A2EC3CBFE969@edwinc367e16bd> The file mbe9bfloat.pdf has been revised. The section on the use of bfallroots is new with a simple example which clearly illustrates the need the assign values to fpprec and ratepsilon which "match" in order to take advantage of the arbitrary precision behavior. I am grateful to Michel Talon for alerting me to the bfallroots behavior. Perhaps the present behavior should be considered a bug rather than a feature. Ted Woollett http://www.csulb.edu/~woollett From jrredford at yahoo.com Fri Feb 4 02:35:08 2011 From: jrredford at yahoo.com (James Redford) Date: Fri, 4 Feb 2011 00:35:08 -0800 (PST) Subject: [Maxima] maxima.chm Is Messed Up in the maxima-5.23.2.exe Package Message-ID: <636811.10111.qm@web121809.mail.ne1.yahoo.com> The maxima.chm Maxima manual that comes in the latest maxima-5.23.2.exe package (MD5: cb4c26aa02d77eeb62412e0e7318d036 ) is missing the following sections: 1. Introduction to Maxima 2. Bug Detection and Reporting 2.1 Functions and Variables for Bug Detection and Reporting 3. Help 3.1 Lisp and Maxima 3.2 Garbage Collection 3.3 Documentation 3.4 Functions and Variables for Help 4. Command Line 4.1 Introduction to Command Line 4.2 Functions and Variables for Command Line By the way, would it be possible that anytime a new Maxima version is released that a PDF format of its manual is also released? If so, then I would be grateful. From plch at math.muni.cz Fri Feb 4 04:06:42 2011 From: plch at math.muni.cz (Roman Plch) Date: Fri, 4 Feb 2011 11:06:42 +0100 Subject: [Maxima] 3D graphics export Message-ID: <20110204100642.GA24955@queen.math.muni.cz> Hello, is there any possibility to export Maxima (or Gnuplot) 3D graphics as a VRML scene or as an .obj graphics object? Regards Roman %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Roman Plch, phone: 549496499 Dept. of Mathematics e-mail: plch at math.muni.cz Kotlarska 2, 611 37 BRNO WWW: http://www.math.muni.cz/~plch %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% From biomates at telefonica.net Fri Feb 4 10:12:48 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 04 Feb 2011 17:12:48 +0100 Subject: [Maxima] maxima.chm Is Messed Up in the maxima-5.23.2.exe Package In-Reply-To: <636811.10111.qm@web121809.mail.ne1.yahoo.com> References: <636811.10111.qm@web121809.mail.ne1.yahoo.com> Message-ID: <1296835968.6407.2.camel@pc> El vie, 04-02-2011 a las 00:35 -0800, James Redford escribi?: > > By the way, would it be possible that anytime a new Maxima version is released that a PDF format of its manual is also released? If so, then I would be grateful. > Documentation in html and pdf formats has been updated in http://maxima.sourceforge.net/documentation.html -- Mario From biomates at telefonica.net Fri Feb 4 10:37:28 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 04 Feb 2011 17:37:28 +0100 Subject: [Maxima] 3D graphics export In-Reply-To: <20110204100642.GA24955@queen.math.muni.cz> References: <20110204100642.GA24955@queen.math.muni.cz> Message-ID: <1296837448.6407.22.camel@pc> El vie, 04-02-2011 a las 11:06 +0100, Roman Plch escribi?: > Hello, > > is there any possibility to export Maxima (or Gnuplot) 3D graphics as a > VRML scene or as an .obj graphics object? > > Regards > Roman Hi Roman, There are bad and good news. Bad news first. Gnuplot is not a good 3d modelling tool. Therefore we can't export to vrml or obj from Gnuplot at this moment. Now the good ones. Support for vrml and obj is now in progress, but using vtk instead of gnuplot. I hope we can include a proof-of-concept package in the next Maxima release. Matlab, Octave and R also have access to the vtk visualization library. -- Mario From andrej.vodopivec at gmail.com Fri Feb 4 14:40:40 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Fri, 4 Feb 2011 21:40:40 +0100 Subject: [Maxima] maxima.chm Is Messed Up in the maxima-5.23.2.exe Package In-Reply-To: <636811.10111.qm@web121809.mail.ne1.yahoo.com> References: <636811.10111.qm@web121809.mail.ne1.yahoo.com> Message-ID: It looks like I have more problems with this version than before. I apologize for causing this delay for the final release. Anyway, another binary has been uploaded. Please try again. Andrej On Fri, Feb 4, 2011 at 9:35 AM, James Redford wrote: > The maxima.chm Maxima manual that comes in the latest maxima-5.23.2.exe package (MD5: cb4c26aa02d77eeb62412e0e7318d036 ) is missing the following sections: > > 1. Introduction to Maxima > 2. Bug Detection and Reporting > 2.1 Functions and Variables for Bug Detection and Reporting > 3. Help > 3.1 Lisp and Maxima > 3.2 Garbage Collection > 3.3 Documentation > 3.4 Functions and Variables for Help > 4. Command Line > 4.1 Introduction to Command Line > 4.2 Functions and Variables for Command Line > > > By the way, would it be possible that anytime a new Maxima version is released that a PDF format of its manual is also released? If so, then I would be grateful. > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From caleb.david8 at gmail.com Sat Feb 5 04:11:46 2011 From: caleb.david8 at gmail.com (caleb david) Date: Sat, 5 Feb 2011 04:11:46 -0600 Subject: [Maxima] Getting My Feet Wet Message-ID: So I just signed up for the mailing list. I am a physicist in Chicago. I want to slowly start contributing to community. Maybe this is a bad way to start but I noticed that Maxima doesn't have a Twitter account and wondered what the community would think about having a Twitter account that allows the community to publish useful interesting quickly. It could also be a way to get the name floating around in more places. Just thought I would throw that out there. I am new to contributing and maybe I am stepping on people's toes. But let me know what you folks think. -------------- next part -------------- An HTML attachment was scrubbed... URL: From luigi_marino2 at alice.it Sun Feb 6 05:07:44 2011 From: luigi_marino2 at alice.it (Luigi Marino) Date: Sun, 6 Feb 2011 12:07:44 +0100 Subject: [Maxima] antivirus ESET NOD32 and Maxima Message-ID: <000001cbc5ee$14946930$3dbd3b90$@it> The last upgrade of ESET NOD 32- 4 Antivirus on 4th February 2011 has made severe problem for Windows Maxima. Maxima not works because the antivirus puts in Quarantena the file maxima bacth of bin folder. Luigi Marino luigi_marino2 @alice.it -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Sun Feb 6 06:11:02 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sun, 06 Feb 2011 12:11:02 +0000 Subject: [Maxima] antivirus ESET NOD32 and Maxima References: <000001cbc5ee$14946930$3dbd3b90$@it> Message-ID: "Luigi Marino" writes: > The last upgrade of ESET NOD 32- 4 Antivirus on 4th February 2011 has made > severe problem for Windows Maxima. > > Maxima not works because the antivirus puts in Quarantena the file maxima > bacth of bin folder. > > Luigi Marino > Have you considered filing a bug with their antivirus software? It sounds like it's not working correctly... Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From cloos at jhcloos.com Sun Feb 6 15:46:58 2011 From: cloos at jhcloos.com (James Cloos) Date: Sun, 06 Feb 2011 16:46:58 -0500 Subject: [Maxima] Learning from reduce? Message-ID: This one came up on anther list as an example to try out in reduce: solve(log(sin(x+3))^5 = 8,x); Maxima returns [] to that, whereas reduce gives this beauty: 3/5 2 *cos((2*pi)/5) e {x=2*arbint(5)*pi + asin(-----------------------) - 3, 3/5 2 *sin((2*pi)/5)*i e 3/5 2 *cos((2*pi)/5) e x=2*arbint(5)*pi - asin(-----------------------) + pi - 3, 3/5 2 *sin((2*pi)/5)*i e 1 x=2*arbint(4)*pi + asin(------------------------------------) - 3, 3/5 3/5 2 *cos(pi/5) + 2 *sin(pi/5)*i e 1 x=2*arbint(4)*pi - asin(------------------------------------) + pi - 3, 3/5 3/5 2 *cos(pi/5) + 2 *sin(pi/5)*i e 3/5 2 *sin(pi/5)*i e x=2*arbint(3)*pi + asin(-------------------) - 3, 3/5 2 *cos(pi/5) e 3/5 2 *sin(pi/5)*i e x=2*arbint(3)*pi - asin(-------------------) + pi - 3, 3/5 2 *cos(pi/5) e 3/5 3/5 2 *cos((2*pi)/5) + 2 *sin((2*pi)/5)*i x=2*arbint(2)*pi + asin(e ) - 3, 3/5 3/5 2 *cos((2*pi)/5) + 2 *sin((2*pi)/5)*i x=2*arbint(2)*pi - asin(e ) + pi - 3, 3/5 2 x=2*arbint(1)*pi + asin(e ) - 3, 3/5 2 x=2*arbint(1)*pi - asin(e ) + pi - 3} Do any of maxima's addons let it solve a log(trig())? Would it take much effort to make solve() handle such constructs? (My upgrade from 5.22.1 to 5.23.2 will probably occur tonight (lots of upgrades this weekend). Perhaps .23 does better?) -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From willisb at unk.edu Sun Feb 6 16:26:14 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 6 Feb 2011 16:26:14 -0600 Subject: [Maxima] Learning from reduce? In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >This?one?came?up?on?anther?list?as?an?example?to?try?out?in?reduce: > >solve(log(sin(x+3))^5?=?8,x); >Do?any?of?maxima's?addons?let?it?solve?a?log(trig())? The to_poly_solver does not solve this equation; there is another solve function (try load(solver) that I don't know much about. As far as I can tell, this solver will not solve this equation either. >Would?it?take?much?effort?to?make?solve()?handle?such?constructs? You never know until you try. The to_poly_solver is fairly single-minded in its approach, but it's possible to append new methods to it. If you wrote a function that solved some new set of equations, most likely your code could be blended into the to_poly_solver. >(My?upgrade?from?5.22.1?to?5.23.2?will?probably?occur?tonight?(lots?of >upgrades?this?weekend).??Perhaps?.23?does?better?) No, definitely no improvements to solve. --Barton Willis (author of to_poly_solve) From robert.dodier at gmail.com Sun Feb 6 22:50:07 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 6 Feb 2011 21:50:07 -0700 Subject: [Maxima] Getting My Feet Wet In-Reply-To: References: Message-ID: On 2/5/11, caleb david wrote: > So I just signed up for the mailing list. I am a physicist in Chicago. I > want to slowly start contributing to community. Maybe this is a bad way to > start but I noticed that Maxima doesn't have a Twitter account and wondered > what the community would think about having a Twitter account that allows > the community to publish useful interesting quickly. It could also be a way > to get the name floating around in more places. > > Just thought I would throw that out there. I am new to contributing and > maybe I am stepping on people's toes. But let me know what you folks think. You're certainly free to start a Twitter feed or whatever it's called for Maxima. The good news is that Maxima is not very strongly organized. If you feel like doing something, you don't have to get anybody's approval about it, you can just start doing it. Have at it! The bad news is that you'll have to get other people interested to contribute or take over when you can't or don't want to handle it anymore. Thanks for your interest in Maxima, and welcome to the club. best Robert Dodier From robert.dodier at gmail.com Sun Feb 6 22:58:19 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 6 Feb 2011 21:58:19 -0700 Subject: [Maxima] [Maxima-lang-fr] edo logistique avec maxima In-Reply-To: <4D46E882.8060009@univ-orleans.fr> References: <4D46E882.8060009@univ-orleans.fr> Message-ID: Forwarding this message from the French language mailing list. On 1/31/11, Cyrille Piatercki wrote: > > -- > Chers tous, > > nouveau venu sur maxima, je voudrais r?soudre une ?quation > diff?rentielle logistique > > x' = a x(a-x) > > puis la tracer en fonction de la valeur de a et de la ou des conditions > initiales. Mais la seule repr?sentation que j'obtiens > est une repr?sentation implicite avec ode2. Y-a-t-il un moyen d'obtenir > la solution explicitement ? > > Merci > > Cyrille Piatecki From villate at fe.up.pt Mon Feb 7 03:41:33 2011 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 07 Feb 2011 09:41:33 +0000 Subject: [Maxima] [Maxima-lang-fr] edo logistique avec maxima In-Reply-To: References: <4D46E882.8060009@univ-orleans.fr> Message-ID: <1297071693.2474.2.camel@wigner> On Sun, 2011-02-06 at 21:58 -0700, Robert Dodier wrote: > Forwarding this message from the French language mailing list. > > On 1/31/11, Cyrille Piatercki wrote: > > je voudrais r?soudre une ?quation > > diff?rentielle logistique > > > > x' = a x(a-x) > > > > puis la tracer en fonction de la valeur de a et de la ou des conditions > > initiales. Mais la seule repr?sentation que j'obtiens > > est une repr?sentation implicite avec ode2. Y-a-t-il un moyen d'obtenir > > la solution explicitement ? There must be better ways, but at least you can do this: (%i1) display2d:false$ (%i2) ode2( 'diff(x,t)=a*x*(a-x), x, t); (%o2) -(log(x-a)-log(x))/a^2 = t+%c (%i3) %*a^2; (%o3) log(x)-log(x-a) = a^2*(t+%c) (%i4) logcontract(%); (%o4) log(x/(x-a)) = a^2*t+%c*a^2 (%i5) exp(lhs(%)) = exp(rhs(%)); (%o5) x/(x-a) = %e^(a^2*t+%c*a^2) (%i6) solve(%,x); (%o6) [x = a*%e^(a^2*t+%c*a^2)/(%e^(a^2*t+%c*a^2)-1)] Cheers, Jaime From lut.mentz at zen.co.uk Mon Feb 7 03:42:42 2011 From: lut.mentz at zen.co.uk (Lut Mentz) Date: Mon, 7 Feb 2011 09:42:42 -0000 Subject: [Maxima] Maxima : Getting a value from 'Solve' Message-ID: <000c01cbc6ab$6124f3b0$5d484552@albert2> Hi, I want to extract from the output of Solve() an executable string to make an assignment. For instance (%i1) solve([gz], [accz]); (%o1) [accz=-(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F] (%i2) %[1]; (%o2) accz=-(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F I'd like to turn the last output to "accz: -(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F" and execute it. Thanks, Lut Mentz -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Mon Feb 7 03:55:45 2011 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 07 Feb 2011 09:55:45 +0000 Subject: [Maxima] [Maxima-lang-fr] edo logistique avec maxima In-Reply-To: <1297071693.2474.2.camel@wigner> References: <4D46E882.8060009@univ-orleans.fr> <1297071693.2474.2.camel@wigner> Message-ID: <1297072545.2474.9.camel@wigner> On Mon, 2011-02-07 at 09:41 +0000, Jaime Villate wrote: > On Sun, 2011-02-06 at 21:58 -0700, Robert Dodier wrote: > > Forwarding this message from the French language mailing list. > > > > On 1/31/11, Cyrille Piatercki wrote: > > > je voudrais r?soudre une ?quation > > > diff?rentielle logistique > > > > > > x' = a x(a-x) > > > > > > puis la tracer en fonction de la valeur de a et de la ou des conditions > > > initiales. Mais la seule repr?sentation que j'obtiens > > > est une repr?sentation implicite avec ode2. Y-a-t-il un moyen d'obtenir > > > la solution explicitement ? > > There must be better ways, but at least you can do this: an example of a better way: (%i1) display2d:false$ (%i2) load("to_poly_solver")$ (%i3) ode2( 'diff(x,t)=a*x*(a-x), x, t); (%o3) -(log(x-a)-log(x))/a^2 = t+%c (%i4) to_poly_solve(%,x); (%o4) %union([x = a*%e^(a^2*t+%c*a^2)/(%e^(a^2*t+%c*a^2)-1)]) Regards, Jaime From rswarbrick at gmail.com Mon Feb 7 03:58:35 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Mon, 07 Feb 2011 09:58:35 +0000 Subject: [Maxima] Maxima : Getting a value from 'Solve' References: <000c01cbc6ab$6124f3b0$5d484552@albert2> Message-ID: "Lut Mentz" writes: > Hi, > > I want to extract from the output of Solve() an executable string to > make an assignment. For instance > > (%i1) solve([gz], [accz]); > (%o1) [accz=-(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F] > (%i2) %[1]; > (%o2) accz=-(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F > > I'd like to turn the last output to "accz: > -(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F" and execute it. > > Thanks, > Lut Mentz There might be a cleverer solution, but I generally use lhs and rhs: Maxima 5.23post http://maxima.sourceforge.net using Lisp SBCL 1.0.45.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) [accz=-(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F]; 2 4 2 2 - Fz Vt F + Fz Vz + 2 Fy Vy Vz - Fz Vy (%o1) [accz = ------------------------------------------] F (%i2) accz: rhs(first(%o1)); 2 4 2 2 - Fz Vt F + Fz Vz + 2 Fy Vy Vz - Fz Vy (%o2) ------------------------------------------ F (%i3) I can't think of a situation where you don't know ahead of time the variable name that you were solving for. Of course, if you're doing this programmatically, you have to test for empty solution sets and also that the rhs is free of the variable for which you're solving, since sometimes when solve() fails it returns something like: (%i3) solve (sin(x)+cos(x)=1, x); (%o3) [sin(x) = 1 - cos(x)] 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 Feb 7 04:02:36 2011 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 07 Feb 2011 10:02:36 +0000 Subject: [Maxima] Maxima : Getting a value from 'Solve' In-Reply-To: <000c01cbc6ab$6124f3b0$5d484552@albert2> References: <000c01cbc6ab$6124f3b0$5d484552@albert2> Message-ID: <1297072956.2474.14.camel@wigner> On Mon, 2011-02-07 at 09:42 +0000, Lut Mentz wrote: > I want to extract from the output of Solve() an executable string to > make an assignment. For instance > > (%i1) solve([gz], [accz]); > (%o1) [accz=-(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F] > (%i2) %[1]; > (%o2) accz=-(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F > > I'd like to turn the last output to "accz: > -(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F" and execute it. Try the following, instead of (%i2): (%i2) accz: rhs(%[1]); Regards, Jaime From rjwiltsh at gmail.com Mon Feb 7 12:58:11 2011 From: rjwiltsh at gmail.com (Ron Wiltshire) Date: Mon, 7 Feb 2011 18:58:11 +0000 Subject: [Maxima] Use of ev() with diff Message-ID: <98CD3ED4-78B2-47A2-93B1-82F8FEE7A902@gmail.com> Hello I am currently using wxMaxima 0.8.3a for Mac having used Macsyma for many years. I find that the function ev(sin(x),diff) does not return cos(x) although ev(2*(x+y),expand) will return 2x+2y. May be I am doing something wrong or perhaps there is a problem with ev(....., diff). Please can you advise? With kind regards - Ron Wiltshire From macrakis at alum.mit.edu Mon Feb 7 13:22:53 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 7 Feb 2011 14:22:53 -0500 Subject: [Maxima] Use of ev() with diff In-Reply-To: <98CD3ED4-78B2-47A2-93B1-82F8FEE7A902@gmail.com> References: <98CD3ED4-78B2-47A2-93B1-82F8FEE7A902@gmail.com> Message-ID: I don't know what commercial Macsyma means by ev(...,diff), but Maxima's documentation says:* **Special symbol:* *diff* When diff is present as an evflag in call to ev, all differentiations indicated in expr are carried out. For example, (%i1) A: 'diff(Q,R)$ <<< an unevaluated differentiation (%i2) Q: x^2$ (%i3) R: x$ (%i4) A; (%o4) 'diff(Q,R,1) (%i5) ev(A,diff); <<< substitute values (ev) and carry out differentiations (%o5) 2*x (%i6) ev(A,nouns); (%o6) 2*x To differentiate something, just write diff( ) or diff(,) On Mon, Feb 7, 2011 at 13:58, Ron Wiltshire wrote: > Hello > > I am currently using wxMaxima 0.8.3a for Mac having used Macsyma for many > years. I find that the function > > ev(sin(x),diff) does not return cos(x) > > although > > ev(2*(x+y),expand) will return 2x+2y. > > May be I am doing something wrong or perhaps there is a problem with > ev(....., diff). Please can you advise? > > > > With kind regards - Ron Wiltshire > > > > > > _______________________________________________ > 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 Mon Feb 7 13:46:50 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Tue, 08 Feb 2011 06:46:50 +1100 Subject: [Maxima] Use of ev() with diff In-Reply-To: <98CD3ED4-78B2-47A2-93B1-82F8FEE7A902@gmail.com> References: <98CD3ED4-78B2-47A2-93B1-82F8FEE7A902@gmail.com> Message-ID: <4D504C2A.9070604@gmail.com> On 8/02/2011 5:58 AM, Ron Wiltshire wrote: > Hello > > I am currently using wxMaxima 0.8.3a for Mac having used Macsyma for many years. I find that the function > > ev(sin(x),diff) does not return cos(x) > > although > > ev(2*(x+y),expand) will return 2x+2y. > > May be I am doing something wrong or perhaps there is a problem with ev(....., diff). Please can you advise? > > > > With kind regards - Ron Wiltshire > You are doing something wrong. Perhaps these examples will help. (%i1) diff(sin(x),x); (%o1) cos(x) (%i2) 'diff(sin(x),x); d (%o2) -- (sin(x)) dx (%i3) ev('diff(sin(x),x)); d (%o3) -- (sin(x)) dx (%i4) ev('diff(sin(x),x),diff); (%o4) cos(x) From simons17 at xs4all.nl Mon Feb 7 14:39:13 2011 From: simons17 at xs4all.nl (Jos Simons) Date: Mon, 7 Feb 2011 21:39:13 +0100 Subject: [Maxima] maxima-5.14.0a.exe Message-ID: <001a01cbc707$151d2080$3f576180$@nl> L.S., I want to download maxima-5.14.0a.exe for windows XP. Can you tell me where I can download this "older" version of Maxima. Thanking you in advance for your help, Dr. J. Simons -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon Feb 7 22:40:11 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 7 Feb 2011 21:40:11 -0700 Subject: [Maxima] maxima-5.14.0a.exe In-Reply-To: <001a01cbc707$151d2080$3f576180$@nl> References: <001a01cbc707$151d2080$3f576180$@nl> Message-ID: On 2/7/11, Jos Simons wrote: > I want to download maxima-5.14.0a.exe for windows XP. > > Can you tell me where I can download this "older" version of Maxima. I think it's here: http://sourceforge.net/projects/maxima/files/Maxima/5.14.0-Windows/ (Note that the SF file manager was reorganized (by me) a few years ago ... that accounts for the slightly different locations for older and newer files. Sorry for the bother.) best Robert Dodier From lut.mentz at zen.co.uk Tue Feb 8 03:05:41 2011 From: lut.mentz at zen.co.uk (Lut Mentz) Date: Tue, 8 Feb 2011 09:05:41 -0000 Subject: [Maxima] Maxima : Getting a value from 'Solve' Message-ID: <000d01cbc76f$60e4b650$5d484552@albert2> Many thanks, Rupert and Jaime, both work fine. Lut Mentz From yaalekseev at rambler.ru Tue Feb 8 13:37:42 2011 From: yaalekseev at rambler.ru (Yaroslav Alekseev) Date: Tue, 08 Feb 2011 22:37:42 +0300 Subject: [Maxima] itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis Message-ID: Hi to all! I need to learn how to compute various expressions with indexed objects in moving frames in specific coordinate systems and frame basis. For example: to compute contract(covdiff(V([],[j]),j)) in polar coordinate and frame basis:matrix([a(r,phi),b(r,phi)],[c(r,phi),d(r,phi)]). In Maxima: Maxima 5.23.2 http://maxima.sourceforge.net using Lisp SBCL 1.0.43 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) kill(all); (%o0) done (%i1) load(itensor); STYLE-WARNING: redefining MAXIMA::$NAME in DEFUN STYLE-WARNING: redefining MAXIMA::DERIV in DEFUN STYLE-WARNING: redefining MAXIMA::SDIFF in DEFUN STYLE-WARNING: redefining MAXIMA::I-$DEPENDENCIES in DEFUN STYLE-WARNING: redefining MAXIMA::$DECSYM in DEFUN STYLE-WARNING: redefining MAXIMA::$CANFORM in DEFUN (%o1) /usr/local/share/maxima/5.23.2/share/tensor/itensor.lisp (%i2) load(ctensor); (%o2) /usr/local/share/maxima/5.23.2/share/tensor/ctensor.mac (%i3) iframe_flag:true; (%o3) true (%i4) ishow(covdiff(V([],[j]),j)); j j %1 (%t4) V + icc2 V ,j %1 j (%o4) V([], [j], j) + icc2([%1, j], [j]) V([], [%1]) (%i5) ishow(ev(%,icc2)); %1 j j (%t5) V ifc2 + V %1 j ,j (%o5) V([], [%1]) ifc2([%1, j], [j]) + V([], [j], j) (%i6) ishow(ev(%,ifc2,ifc1)); %1 j %2 V ifg (ifb - ifb + ifb ) j %2 %1 %2 %1 j %1 j %2 j (%t6) -------------------------------------------------- + V 2 ,j (%o6) (V([], [%1]) ifg([], [j, %2]) (ifb([j, %2, %1]) - ifb([%2, %1, j]) + ifb([%1, j, %2])))/2 + V([], [j], j) (%i7) expr:contract(ratexpand(%)); V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) (%o7) ------------------------------------------------- 2 V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) - ------------------------------------------------- 2 V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) + ------------------------------------------------- + V([], [j], j) 2 (%i8) ishow(expr); %1 j %2 %1 j %2 %1 j %2 V ifg ifb V ifg ifb V ifg ifb j %2 %1 %2 %1 j %1 j %2 (%t8) ---------------------- - ---------------------- + ---------------------- 2 2 2 j + V ,j V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) (%o8) ------------------------------------------------- 2 V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) - ------------------------------------------------- 2 V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) + ------------------------------------------------- + V([], [j], j) 2 (%i9) eqn:ishow(eq=expr); %1 j %2 %1 j %2 V ifg ifb V ifg ifb j %2 %1 %2 %1 j (%t9) eq = ---------------------- - ---------------------- 2 2 %1 j %2 V ifg ifb %1 j %2 j + ---------------------- + V 2 ,j V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) (%o9) eq = ------------------------------------------------- 2 V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) - ------------------------------------------------- 2 V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) + ------------------------------------------------- + V([], [j], j) 2 (%i10) ceqn:ic_convert(eqn); STYLE-WARNING: redefining MAXIMA::$IC_CONVERT in DEFUN STYLE-WARNING: redefining MAXIMA::$MAKEBOX in DEFUN STYLE-WARNING: redefining MAXIMA::$CONMETDERIV in DEFUN STYLE-WARNING: redefining MAXIMA::$IGEODESIC_COORDS in DEFUN (%o10) eq : sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, 1, dim) %1 j, %2 j, %2, %1 --------------------------------------------------------------------------- 2 sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, 1, dim) %1 j, %2 %2, %1, j - --------------------------------------------------------------------------- 2 sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, 1, dim) %1 j, %2 %1, j, %2 + --------------------------------------------------------------------------- 2 + sum(diff(V , ct_coords ), j, 1, dim) j j (%i11) ct_coordsys(polar); (%o11) done (%i12) depends(V,ct_coords); (%o12) [V(r, phi)] (%i13) ev(ceqn); d d (%o13) ---- (V ) + -- (V ) + (V ifg ifb + V ifg ifb dphi 2 dr 1 2 2, 2 2, 2, 2 1 2, 2 2, 2, 1 + V ifg ifb + V ifg ifb + ifg ifb V 2 2, 1 2, 1, 2 1 2, 1 2, 1, 1 1, 2 1, 2, 2 2 + ifg ifb V + V ifg ifb + V ifg ifb )/2 1, 1 1, 1, 2 2 1 1, 2 1, 2, 1 1 1, 1 1, 1, 1 + (V ifg ifb + V ifg ifb + V ifb ifg 2 2, 2 2, 2, 2 2 2, 1 2, 2, 1 1 1, 2, 2 2, 2 + ifg V ifb + ifg V ifb + V ifb ifg 1, 2 2 2, 1, 2 1, 1 2 2, 1, 1 1 1, 2, 1 2, 1 + V ifb ifg + V ifg ifb )/2 1 1, 1, 2 1, 2 1 1, 1 1, 1, 1 - (V ifg ifb + ifg V ifb + V ifb ifg 2 2, 2 2, 2, 2 1, 2 2 2, 2, 1 1 2, 1, 2 2, 2 + V ifg ifb + ifb V ifg + V ifb ifg 1 1, 2 2, 1, 1 1, 2, 2 2 2, 1 1 1, 1, 2 2, 1 + ifg ifb V + V ifg ifb )/2 1, 1 1, 2, 1 2 1 1, 1 1, 1, 1 (%i14) What should I do next ? -- Yaroslav From vttoth at vttoth.com Tue Feb 8 13:39:04 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Tue, 8 Feb 2011 14:39:04 -0500 Subject: [Maxima] itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis In-Reply-To: References: Message-ID: <01f401cbc7c7$db6f87d0$924e9770$@vttoth.com> I think the only step missing is an evaluation of ifb before converting to a ctensor expression. Try this: load(itensor); load(ctensor); iframe_flag:true; cframe_flag:true; ct_coordsys(polar)$ depends([V,ifg,ifr,ifri],ct_coords)$ ishow(covdiff(V([],[j]),j))$ ishow(ev(%,icc2,ifc2,ifc1,ifb))$ eqn:eq=%$ ceqn:ic_convert(eqn)$ ev(ceqn); A word of warning: Presently, ic_convert has no explicit knowledge about the meaning of the symbols ifg, ifr, and ifri. It just treats them as it would treat any other indexed objects. In the present example, it is not relevant as the symbols cancel; in other cases, however, you may need to take steps to identify the itensor symbols ifr, ifri, and ifg with the corresponding ctensor matrices fri, ifri, and lfg/ufg as appropriate. Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Yaroslav Alekseev Sent: Tuesday, February 08, 2011 2:38 PM To: maxima at math.utexas.edu Subject: [Maxima] itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis Hi to all! I need to learn how to compute various expressions with indexed objects in moving frames in specific coordinate systems and frame basis. For example: to compute contract(covdiff(V([],[j]),j)) in polar coordinate and frame basis:matrix([a(r,phi),b(r,phi)],[c(r,phi),d(r,phi)]). In Maxima: Maxima 5.23.2 http://maxima.sourceforge.net using Lisp SBCL 1.0.43 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) kill(all); (%o0) done (%i1) load(itensor); STYLE-WARNING: redefining MAXIMA::$NAME in DEFUN STYLE-WARNING: redefining MAXIMA::DERIV in DEFUN STYLE-WARNING: redefining MAXIMA::SDIFF in DEFUN STYLE-WARNING: redefining MAXIMA::I-$DEPENDENCIES in DEFUN STYLE-WARNING: redefining MAXIMA::$DECSYM in DEFUN STYLE-WARNING: redefining MAXIMA::$CANFORM in DEFUN (%o1) /usr/local/share/maxima/5.23.2/share/tensor/itensor.lisp (%i2) load(ctensor); (%o2) /usr/local/share/maxima/5.23.2/share/tensor/ctensor.mac (%i3) iframe_flag:true; (%o3) true (%i4) ishow(covdiff(V([],[j]),j)); j j %1 (%t4) V + icc2 V ,j %1 j (%o4) V([], [j], j) + icc2([%1, j], [j]) V([], [%1]) (%i5) ishow(ev(%,icc2)); %1 j j (%t5) V ifc2 + V %1 j ,j (%o5) V([], [%1]) ifc2([%1, j], [j]) + V([], [j], j) (%i6) ishow(ev(%,ifc2,ifc1)); %1 j %2 V ifg (ifb - ifb + ifb ) j %2 %1 %2 %1 j %1 j %2 j (%t6) -------------------------------------------------- + V 2 ,j (%o6) (V([], [%1]) ifg([], [j, %2]) (ifb([j, %2, %1]) - ifb([%2, %1, j]) + ifb([%1, j, %2])))/2 + V([], [j], j) (%i7) expr:contract(ratexpand(%)); V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) (%o7) ------------------------------------------------- 2 V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) - ------------------------------------------------- 2 V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) + ------------------------------------------------- + V([], [j], j) 2 (%i8) ishow(expr); %1 j %2 %1 j %2 %1 j %2 V ifg ifb V ifg ifb V ifg ifb j %2 %1 %2 %1 j %1 j %2 (%t8) ---------------------- - ---------------------- + ---------------------- 2 2 2 j + V ,j V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) (%o8) ------------------------------------------------- 2 V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) - ------------------------------------------------- 2 V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) + ------------------------------------------------- + V([], [j], j) 2 (%i9) eqn:ishow(eq=expr); %1 j %2 %1 j %2 V ifg ifb V ifg ifb j %2 %1 %2 %1 j (%t9) eq = ---------------------- - ---------------------- 2 2 %1 j %2 V ifg ifb %1 j %2 j + ---------------------- + V 2 ,j V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) (%o9) eq = ------------------------------------------------- 2 V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) - ------------------------------------------------- 2 V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) + ------------------------------------------------- + V([], [j], j) 2 (%i10) ceqn:ic_convert(eqn); STYLE-WARNING: redefining MAXIMA::$IC_CONVERT in DEFUN STYLE-WARNING: redefining MAXIMA::$MAKEBOX in DEFUN STYLE-WARNING: redefining MAXIMA::$CONMETDERIV in DEFUN STYLE-WARNING: redefining MAXIMA::$IGEODESIC_COORDS in DEFUN (%o10) eq : sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, 1, dim) %1 j, %2 j, %2, %1 --------------------------------------------------------------------------- 2 sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, 1, dim) %1 j, %2 %2, %1, j - --------------------------------------------------------------------------- 2 sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, 1, dim) %1 j, %2 %1, j, %2 + --------------------------------------------------------------------------- 2 + sum(diff(V , ct_coords ), j, 1, dim) j j (%i11) ct_coordsys(polar); (%o11) done (%i12) depends(V,ct_coords); (%o12) [V(r, phi)] (%i13) ev(ceqn); d d (%o13) ---- (V ) + -- (V ) + (V ifg ifb + V ifg ifb dphi 2 dr 1 2 2, 2 2, 2, 2 1 2, 2 2, 2, 1 + V ifg ifb + V ifg ifb + ifg ifb V 2 2, 1 2, 1, 2 1 2, 1 2, 1, 1 1, 2 1, 2, 2 2 + ifg ifb V + V ifg ifb + V ifg ifb )/2 1, 1 1, 1, 2 2 1 1, 2 1, 2, 1 1 1, 1 1, 1, 1 + (V ifg ifb + V ifg ifb + V ifb ifg 2 2, 2 2, 2, 2 2 2, 1 2, 2, 1 1 1, 2, 2 2, 2 + ifg V ifb + ifg V ifb + V ifb ifg 1, 2 2 2, 1, 2 1, 1 2 2, 1, 1 1 1, 2, 1 2, 1 + V ifb ifg + V ifg ifb )/2 1 1, 1, 2 1, 2 1 1, 1 1, 1, 1 - (V ifg ifb + ifg V ifb + V ifb ifg 2 2, 2 2, 2, 2 1, 2 2 2, 2, 1 1 2, 1, 2 2, 2 + V ifg ifb + ifb V ifg + V ifb ifg 1 1, 2 2, 1, 1 1, 2, 2 2 2, 1 1 1, 1, 2 2, 1 + ifg ifb V + V ifg ifb )/2 1, 1 1, 2, 1 2 1 1, 1 1, 1, 1 (%i14) What should I do next ? -- Yaroslav _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From l.butler at ed.ac.uk Tue Feb 8 13:53:56 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 8 Feb 2011 19:53:56 +0000 (GMT) Subject: [Maxima] Maxima : Getting a value from 'Solve' In-Reply-To: <000c01cbc6ab$6124f3b0$5d484552@albert2> References: <000c01cbc6ab$6124f3b0$5d484552@albert2> Message-ID: On Mon, 7 Feb 2011, Lut Mentz wrote: < Hi, < ? < I want to extract from the output of Solve() an executable string to make an assignment. For instance < ? < (%i1) solve([gz], [accz]); < (%o1) [accz=-(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F] < (%i2)? %[1]; < (%o2) accz=-(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F < ? < I'd like to turn the last output to "accz: -(Fz*Vt^2*F^4-Fz*Vz^2-2*Fy*Vy*Vz+Fz*Vy^2)/F" and execute it. < ? Here is another way: solve(....); map(lambda([t],lhs(t)::rhs(t)),%); This will bind accz. If there are no solutions, that's ok; if there are multiple solutions, this binds accz to the last solution in the list. The :: operator is like : except that both sides are evaluated before binding. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From lut.mentz at zen.co.uk Wed Feb 9 00:56:32 2011 From: lut.mentz at zen.co.uk (Lut Mentz) Date: Wed, 9 Feb 2011 06:56:32 -0000 Subject: [Maxima] Maxima : Getting a value from 'Solve' References: <000c01cbc6ab$6124f3b0$5d484552@albert2> Message-ID: <000501cbc826$7ed43520$5d484552@albert2> Thank you, Leo. Regards, Lut Mentz ----- Original Message ----- From: "Leo Butler" To: "Lut Mentz" Cc: Sent: Tuesday, February 08, 2011 7:53 PM Subject: Re: [Maxima] Maxima : Getting a value from 'Solve' Here is another way: solve(....); map(lambda([t],lhs(t)::rhs(t)),%); This will bind accz. If there are no solutions, that's ok; if there are multiple solutions, this binds accz to the last solution in the list. The :: operator is like : except that both sides are evaluated before binding. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From renekaelin at gmx.ch Wed Feb 9 01:28:39 2011 From: renekaelin at gmx.ch (=?iso-8859-1?Q?=22Ren=E9_K=E4lin=22?=) Date: Wed, 09 Feb 2011 08:28:39 +0100 Subject: [Maxima] Problems with the sqrt function In-Reply-To: <4D504C2A.9070604@gmail.com> References: <98CD3ED4-78B2-47A2-93B1-82F8FEE7A902@gmail.com> <4D504C2A.9070604@gmail.com> Message-ID: <20110209072839.8080@gmx.net> Hello I found this interesting thread about the sqrt function. If I try this (with Maxima 5.21.1): domain:real$ t:x^(1/2)*x^(1/2); assume(x<0); t; forget(x<0)$ assume(x>=0); t; the output is: (%o2) x (%o3) [x<0] (%o4) x (%o6) [x>=0] (%o7) x I only want to consider some real numbers. Because the squareroot of x is not defined for x<0, %o4 is wrong, isn't it? The Problem seems to be that t:x^(1/2)*x^(1/2) is simplified immediately to x in every case. > On Sat, Jan 9, 2010 at 10:01 AM, Dieter Kaiser wrote: > > > I have already reported some work to overcome some of the problems. > > Perhaps it is of interest to go on and to start to correct the problems > > step by step. Perhaps it of interest to add the file rtest_sqrt.mac to > > the testsuite too. > > Yes, let's go ahead and try to fix these problems. > It's very important to correct the basic stuff since > otherwise more complicated operations might be incorrect, > as you're well aware, I'm sure. > I think committing rtest_sqrt is a good start. > > Thanks very much for your work on this topic & many others. Hello Robert, thank you for the feed back. I have already the code which helps to solve the three most important problems with the sqrt function. We have four issues with the testsuite I am working on. Most are not serious: 1. A lot of integrals in rtest_integrate.mac simplifies differently. Mostly because sqrt(-z^2) will no longer simplify to %i sqrt(z^2). I am reworking the examples. 2. Some integrals in rtestint.mac fails. This is because sqrt(1/x) is no longer 1/sqrt(x). To get these integrals to work again we can switch on the flag radexpand:all. 3. Some results of rtest_odelin.mac in the share_testsuite simplifies differently. I think the new results are simplified much better. 4. The most serious problem is, that radcan hangs for expressions like sqrt(1/(1+z)). This expression no longer simplifies to 1/sqrt(1+z), but the code of radcan seems to depend on this simplification. I have looked at the algorithm of radcan in more detail and I think I have found the code which causes the problem. A simple solution is to set radexpand:all in radcan. This does not change anything, because it is the way radcan simplifies the power function already. Examples with the code we have. Maxima does not automatically simplify the product: (%i2) sqrt(a*b); (%o2) sqrt(a*b) With radexpand:all the arguments a and b are assumend to be positive: (%i3) sqrt(a*b),radexpand:all; (%o3) sqrt(a)*sqrt(b) This is what radcan does too: (%i4) radcan(sqrt(a*b)); (%o4) sqrt(a)*sqrt(b) Again for the sqrt of a power: (%i5) sqrt(a^b); (%o5) sqrt(a^b) We get the expansion with radexpand:all: (%i7) sqrt(a^b),radexpand:all; (%o7) a^(b/2) Again radcan does it immediately: (%i8) radcan(sqrt(a^b)); (%o8) a^(b/2) I will report more of this work and show more examples. Dieter Kaiser -- Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail From talon at lpthe.jussieu.fr Wed Feb 9 03:34:30 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 09 Feb 2011 10:34:30 +0100 Subject: [Maxima] grinding, etc. Message-ID: Hello, i am trying to write a grind variant to convert expressions so that they can be embedded in Gnu GMP programs. In the course of doing that, i have, of course, consulted forta.lisp, grind.lisp and mactex.lisp, but i see that some expressions are of the following form: niobe% maxima (%i1) x:y*(z+t^2)$ (%i2) :lisp $X ((MTIMES . #1=(SIMP)) $Y ((MPLUS . #1#) ((MEXPT . #1#) $T 2) $Z)) I am puzzled by the #1=(SIMP) ... #1# I suppose that #1 has to be replaced by SIMP but would someone be kind enough to explain how this syntax can be understood from lisp? Well, grind.lisp is not the most obvious thing to understand, i see that prof Fateman has lifted some parts to texmacs.lisp and added some comments, but does someone know what msize is supposed to do? I am puzzled by such stuff: (%i2) :lisp (msize $X nil nil 'mparen 'mparen) (9 (1 y) (8 (3 * ( z) (5 (2 + t) (3 ^ 2 ))))) >From Fateman's comments i see that in defun msize (x l r lop rop) l and r are supposed to be stuff at the left and right of x, while lop and rop are left and right "parenthesis", here true parenthesis, but if somebody remembers what is this left and right stuff, and what these numbers 9 8 etc. mean, i would be grateful. By the way, at first sight, 9 is the total number of characters in the expansion of x, in (1 y) y has 1 character, in (8 ( ...)) there are 8 characters after the *, but at (3 * i don't understand precisely ... Of course i suppose the aim is to be able to cut long lines by counting characters but how exactly? Thanks a lot -- Michel Talon From smh at franz.com Wed Feb 9 03:43:45 2011 From: smh at franz.com (Steve Haflich) Date: Wed, 09 Feb 2011 01:43:45 -0800 Subject: [Maxima] grinding, etc. In-Reply-To: References: Message-ID: <20448.1297244625@gemini.franz.com> See *print-circle* in your favorite copy of the ANSI CL specification, or in CLtL2. From talon at lpthe.jussieu.fr Wed Feb 9 04:07:25 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 09 Feb 2011 11:07:25 +0100 Subject: [Maxima] grinding, etc. References: <20448.1297244625@gemini.franz.com> Message-ID: Steve Haflich wrote: > See *print-circle* in your favorite copy of the ANSI CL specification, > or in CLtL2. Thanks. This allowed me to find the more explicit (for me) explanation in http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node191.html #n= The syntax #n=object reads as whatever Lisp object has object as its printed representation. However, that object is labelled by n, a required unsigned decimal integer, for possible reference by the syntax #n# (below). The scope of the label is the expression being read by the outermost call to read. Within this expression the same label may not appear twice. #n# The syntax #n#, where n is a required unsigned decimal integer, serves as a reference to some object labelled by #n=; that is, #n# represents a pointer to the same identical (eq) object labelled by #n=. This permits notation of structures with shared or circular substructure. -- Michel Talon From macrakis at alum.mit.edu Wed Feb 9 09:01:29 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 9 Feb 2011 10:01:29 -0500 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. Message-ID: I don't know why *print-circle* is set to T by default in Maxima -- it makes human reading of printed sexpressions much harder, even when there *are* repeated subexpressions -- see examples below. Admittedly this makes life easier for sophisticated users who want to look at assume's data structures (often found in symbol property lists), but it makes this more complicated for the beginner who simply wants to see what the Lisp representation of a Maxima expression is. You should probably set *print-circle* to nil, unless you're planning to be creating circular expressions (which are almost never appropriate in Maxima expressions). (x+1)^3 <<< Maxima linear form ((MEXPT SIMP) ((MPLUS SIMP) 1 $X) 3) <<< Lisp print with *print-circle* = NIL ((MEXPT . #0=(SIMP)) ((MPLUS . #0#) 1 $X) 3) <<< Lisp print with *print-circle* = T rat((x+1)^3) ((MRAT SIMP ($X) (#:X34080)) (#:X34080 3 1 2 3 1 3 0 1) . 1) ((MRAT SIMP ($X) (#0=#:X34080)) (#0# 3 1 2 3 1 3 0 1) . 1) 3*cos(x)^2*sin(x)-sin(x)^3 ((MPLUS SIMP) ((MTIMES SIMP) 3 ((MEXPT SIMP) ((%COS SIMP) $X) 2) ((%SIN SIMP) $X)) ((MTIMES SIMP) -1 ((MEXPT SIMP) ((%SIN SIMP) $X) 3))) ((MPLUS . #0=(SIMP)) (#1=(MTIMES . #0#) 3 (#2=(MEXPT . #0#) ((%COS . #3=(SIMP)) $X) 2) #4=((%SIN . #3#) $X)) (#1# -1 (#2# #4# 3))) The main reason to use *print-circle* in Maxima is probably when looking at the property lists of atoms which have 'assume' (+LABS) properties, which use a circular Lisp representation. It's unfortunate that Common Lisp doesn't support some version of *print-circle* which does not use the #0= syntax for common subexpressions which are *not* circular (I know, it's slightly harder to implement, but...). -s On Wed, Feb 9, 2011 at 04:34, Michel Talon wrote: > Hello, > > i am trying to write a grind variant to convert expressions so that they > can > be embedded in Gnu GMP programs. In the course of doing that, i have, of > course, consulted forta.lisp, grind.lisp and mactex.lisp, but i see that > some expressions are of the following form: > niobe% maxima > (%i1) x:y*(z+t^2)$ > > (%i2) :lisp $X > > ((MTIMES . #1=(SIMP)) $Y ((MPLUS . #1#) ((MEXPT . #1#) $T 2) $Z)) > > I am puzzled by the #1=(SIMP) ... #1# > I suppose that #1 has to be replaced by SIMP but would someone be kind > enough to explain how this syntax can be understood from lisp? > > Well, grind.lisp is not the most obvious thing to understand, i see > that prof Fateman has lifted some parts to texmacs.lisp and added some > comments, but does someone know what msize is supposed to do? I am puzzled > by such stuff: > (%i2) :lisp (msize $X nil nil 'mparen 'mparen) > > (9 (1 y) (8 (3 * ( z) (5 (2 + t) (3 ^ 2 ))))) > > From Fateman's comments i see that in > defun msize (x l r lop rop) > l and r are supposed to be stuff at the left and right of x, while > lop and rop are left and right "parenthesis", here true parenthesis, > but if somebody remembers what is this left and right stuff, and what > these numbers 9 8 etc. mean, i would be grateful. > > By the way, at first sight, 9 is the total number of characters in the > expansion of x, in (1 y) y has 1 character, in (8 ( ...)) there are 8 > characters after the *, but at (3 * i don't understand precisely ... > > Of course i suppose the aim is to be able to cut long lines by counting > characters but how exactly? > > Thanks a lot > > -- > 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 toy.raymond at gmail.com Wed Feb 9 09:43:40 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 09 Feb 2011 10:43:40 -0500 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: References: Message-ID: <4D52B62C.10109@gmail.com> On 2/9/11 10:01 AM, Stavros Macrakis wrote: > I don't know why *print-circle* is set to T by default in Maxima -- it > makes human reading of printed sexpressions much harder, even when > there *are* repeated subexpressions -- see examples below. > Admittedly this makes life easier for sophisticated users who want to > look at assume's data structures (often found in symbol property > lists), but it makes this more complicated for the beginner who simply > wants to see what the Lisp representation of a Maxima expression is. It was changed sometime in 2009 by Robert. I guess he was working with the assume database which apparently has circular structures. I normally just turn it off now (by hand) when I print the Lisp rep. I ought to be able to read them, but I find it rather hard to read. Ray > > You should probably set *print-circle* to nil, unless you're planning > to be creating circular expressions (which are almost never > appropriate in Maxima expressions). > > (x+1)^3 <<< Maxima linear form > > ((MEXPT SIMP) ((MPLUS SIMP) 1 $X) 3) <<< Lisp print with > *print-circle* = NIL > > ((MEXPT . #0=(SIMP)) ((MPLUS . #0#) 1 $X) 3) <<< Lisp print with > *print-circle* = T > > rat((x+1)^3) > > ((MRAT SIMP ($X) (#:X34080)) (#:X34080 3 1 2 3 1 3 0 1) . 1) > > ((MRAT SIMP ($X) (#0=#:X34080)) (#0# 3 1 2 3 1 3 0 1) . 1) > > 3*cos(x)^2*sin(x)-sin(x)^3 > > ((MPLUS SIMP) > ((MTIMES SIMP) 3 ((MEXPT SIMP) ((%COS SIMP) $X) 2) ((%SIN SIMP) $X)) > ((MTIMES SIMP) -1 ((MEXPT SIMP) ((%SIN SIMP) $X) 3))) > > ((MPLUS . #0=(SIMP)) > (#1=(MTIMES . #0#) 3 (#2=(MEXPT . #0#) ((%COS . #3=(SIMP)) $X) 2) > #4=((%SIN . #3#) $X)) > (#1# -1 (#2# #4# 3))) > > The main reason to use *print-circle* in Maxima is probably when > looking at the property lists of atoms which have 'assume' (+LABS) > properties, which use a circular Lisp representation. It's > unfortunate that Common Lisp doesn't support some version of > *print-circle* which does not use the #0= syntax for common > subexpressions which are *not* circular (I know, it's slightly harder > to implement, but...). > > -s > > On Wed, Feb 9, 2011 at 04:34, Michel Talon > wrote: > > Hello, > > i am trying to write a grind variant to convert expressions so > that they can > be embedded in Gnu GMP programs. In the course of doing that, i > have, of > course, consulted forta.lisp, grind.lisp and mactex.lisp, but i > see that > some expressions are of the following form: > niobe% maxima > (%i1) x:y*(z+t^2)$ > > (%i2) :lisp $X > > ((MTIMES . #1=(SIMP)) $Y ((MPLUS . #1#) ((MEXPT . #1#) $T 2) $Z)) > > I am puzzled by the #1=(SIMP) ... #1# > I suppose that #1 has to be replaced by SIMP but would someone be kind > enough to explain how this syntax can be understood from lisp? > > Well, grind.lisp is not the most obvious thing to understand, i see > that prof Fateman has lifted some parts to texmacs.lisp and added some > comments, but does someone know what msize is supposed to do? I am > puzzled > by such stuff: > (%i2) :lisp (msize $X nil nil 'mparen 'mparen) > > (9 (1 y) (8 (3 * ( z) (5 (2 + t) (3 ^ 2 ))))) > > >From Fateman's comments i see that in > defun msize (x l r lop rop) > l and r are supposed to be stuff at the left and right of x, while > lop and rop are left and right "parenthesis", here true parenthesis, > but if somebody remembers what is this left and right stuff, and what > these numbers 9 8 etc. mean, i would be grateful. > > By the way, at first sight, 9 is the total number of characters in the > expansion of x, in (1 y) y has 1 character, in (8 ( ...)) there are 8 > characters after the *, but at (3 * i don't understand precisely ... > > Of course i suppose the aim is to be able to cut long lines by > counting > characters but how exactly? > > Thanks a lot > > -- > Michel Talon > > _______________________________________________ > 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 Wed Feb 9 10:06:28 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 9 Feb 2011 09:06:28 -0700 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: References: Message-ID: *print-circle* is set to T because circular lists are stuck onto the symbol property list by the assume mechanism. Various Lisps barf on that (endless printing or stack overflow). e.g. with Clisp 2.42: assume (x > 0); :lisp (let ((*print-circle* nil)) (print (symbol-plist '$x))) => stack overflow CMUCL 19a: assume (x > 0); :lisp (let ((*print-circle* nil)) (print (symbol-plist '$x))) => endless mess The problem is that the bad behavior isn't limited to the assume system. You could be looking at something else. FWIW Robert Dodier From macrakis at alum.mit.edu Wed Feb 9 10:14:21 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 9 Feb 2011 11:14:21 -0500 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: References: Message-ID: I would guess that we have at least an order of magnitude more users who simply want to use ?print to print out the Lisp representation of a Maxima expression than we have users who know enough to look at the property list of a symbol (which may well contain assume data structures). And the latter users are probably savvy enough to know about *print-circle*. Maybe the solution is just to provide a function lisp_print at the Maxima level (binding *print-circle* to NIL) for those users who want to see the Lisp representation of Maxima expressions? For that matter, we can surely come up with a friendlier display of symbol property lists.... -s On Wed, Feb 9, 2011 at 11:06, Robert Dodier wrote: > *print-circle* is set to T because circular lists are stuck onto > the symbol property list by the assume mechanism. > Various Lisps barf on that (endless printing or stack overflow). > > e.g. with Clisp 2.42: > > assume (x > 0); > :lisp (let ((*print-circle* nil)) (print (symbol-plist '$x))) > => stack overflow > > CMUCL 19a: > > assume (x > 0); > :lisp (let ((*print-circle* nil)) (print (symbol-plist '$x))) > => endless mess > > The problem is that the bad behavior isn't limited to > the assume system. You could be looking at something else. > > FWIW > > Robert Dodier > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Wed Feb 9 10:20:33 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 09 Feb 2011 08:20:33 -0800 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: References: Message-ID: <4D52BED1.2040506@eecs.berkeley.edu> I think the proper solution is to set *print-circle* to nil, but *print-level* to some modest number, like 5 or even 10. Sublists below level 10 then are printed as # . If you have reason to believe that the data below that level is useful and not a loop, you can use lisp's pprint function to see it all. That's what I do, anyway. Setting *print-circle* to t is probably more expensive and definitely harder to read with shared substructure, and something I do only if I expect circular structures or want to see sharing, which is nice to know about sometimes. Try it. RJF On 2/9/2011 8:06 AM, Robert Dodier wrote: > *print-circle* is set to T because circular lists are stuck onto > the symbol property list by the assume mechanism. > Various Lisps barf on that (endless printing or stack overflow). > > e.g. with Clisp 2.42: > > assume (x> 0); > :lisp (let ((*print-circle* nil)) (print (symbol-plist '$x))) > => stack overflow > > CMUCL 19a: > > assume (x> 0); > :lisp (let ((*print-circle* nil)) (print (symbol-plist '$x))) > => endless mess > > The problem is that the bad behavior isn't limited to > the assume system. You could be looking at something else. > > FWIW > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From talon at lpthe.jussieu.fr Wed Feb 9 10:40:06 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 09 Feb 2011 17:40:06 +0100 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. References: Message-ID: Stavros Macrakis wrote: > I don't know why *print-circle* is set to T by default in Maxima -- it > makes human reading of printed sexpressions much harder, even when there > *are* > repeated subexpressions -- see examples below. Indeed doing that allows to always see the pair (operator SIMP) in the correct place, and thus reconstruct a formula appropriate for C evaluation, by locating the operator and its arguments. With x:y*(z + t^2 ) i had (as in your example) : MAXIMA> #$x^2$ ((MTIMES . #1=(SIMP)) (#2=(MEXPT . #1#) $Y 2) (#2# ((MPLUS . #1#) (#2# $T 2) $Z) 2)) and the #2 was even more worrisome for my purpose than the #1. Here the expression is "simplified" to y^2*(z+t^2)^2 so now we have three (MEXPT SIMP) which are shared under #2, not that obvious to the beginner. Grind doesn't mess with print-circle, but from what i have tested when picking sufficiently small parts of the above expression with car cdr cddr etc. the #n automatically get substituted at some point. -- Michel Talon From macrakis at alum.mit.edu Wed Feb 9 10:56:15 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 9 Feb 2011 11:56:15 -0500 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: References: Message-ID: Michel, The problems you describe below go away if you set *print-circle* to NIL. As for creating a formula suitable for evaluation by C, I don't understand why you're looking at grind or print at all: I'd think that you'd want to start with the code of the fortran command and modify it as necessary. (I'd have thought someone has already written a Maxima-to-C printer.) -s On Wed, Feb 9, 2011 at 11:40, Michel Talon wrote: > Stavros Macrakis wrote: > > > I don't know why *print-circle* is set to T by default in Maxima -- it > > makes human reading of printed sexpressions much harder, even when there > > *are* > > repeated subexpressions -- see examples below. > > Indeed doing that allows to always see the pair (operator SIMP) in the > correct place, and thus reconstruct a formula appropriate for > C evaluation, by locating the operator and its arguments. > With x:y*(z + t^2 ) i had (as in your example) : > > MAXIMA> #$x^2$ > > ((MTIMES . #1=(SIMP)) (#2=(MEXPT . #1#) $Y 2) > (#2# ((MPLUS . #1#) (#2# $T 2) $Z) 2)) > > and the #2 was even more worrisome for my purpose than the #1. Here the > expression is "simplified" to y^2*(z+t^2)^2 so now we have three > (MEXPT SIMP) which are shared under #2, not that obvious to the beginner. > > > Grind doesn't mess with print-circle, but from what i have tested when > picking sufficiently small parts of the above expression with car cdr cddr > etc. the #n automatically get substituted at some point. > > -- > 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 Wed Feb 9 11:15:48 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 9 Feb 2011 10:15:48 -0700 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: References: Message-ID: I agree that *print-circle* = T is probably more generally preferable. I agree w/ Fateman's suggestion to modify other printing parameters. Let's change those and set *print-circle* back to nil. best Robert Dodier On 2/9/11, Stavros Macrakis wrote: > Michel, > > The problems you describe below go away if you set *print-circle* to NIL. > As for creating a formula suitable for evaluation by C, I don't understand > why you're looking at grind or print at all: I'd think that you'd want to > start with the code of the fortran command and modify it as necessary. (I'd > have thought someone has already written a Maxima-to-C printer.) > > -s > > On Wed, Feb 9, 2011 at 11:40, Michel Talon wrote: > >> Stavros Macrakis wrote: >> >> > I don't know why *print-circle* is set to T by default in Maxima -- it >> > makes human reading of printed sexpressions much harder, even when there >> > *are* >> > repeated subexpressions -- see examples below. >> >> Indeed doing that allows to always see the pair (operator SIMP) in the >> correct place, and thus reconstruct a formula appropriate for >> C evaluation, by locating the operator and its arguments. >> With x:y*(z + t^2 ) i had (as in your example) : >> >> MAXIMA> #$x^2$ >> >> ((MTIMES . #1=(SIMP)) (#2=(MEXPT . #1#) $Y 2) >> (#2# ((MPLUS . #1#) (#2# $T 2) $Z) 2)) >> >> and the #2 was even more worrisome for my purpose than the #1. Here the >> expression is "simplified" to y^2*(z+t^2)^2 so now we have three >> (MEXPT SIMP) which are shared under #2, not that obvious to the beginner. >> >> >> Grind doesn't mess with print-circle, but from what i have tested when >> picking sufficiently small parts of the above expression with car cdr cddr >> etc. the #n automatically get substituted at some point. >> >> -- >> Michel Talon >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > From drdieterkaiser at web.de Wed Feb 9 12:29:16 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 09 Feb 2011 19:29:16 +0100 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: References: Message-ID: <1297276156.1734.18.camel@dieter> Am Mittwoch, den 09.02.2011, 10:15 -0700 schrieb Robert Dodier: > I agree that *print-circle* = T is probably more generally preferable. > I agree w/ Fateman's suggestion to modify other printing parameters. > Let's change those and set *print-circle* back to nil. Yes, I think it is a good idea to change the value of *print-circle* back to nil, too. It is always my first command to set *print-circle* to nil, when I am debugging code. Dieter Kaiser From robert.dodier at gmail.com Wed Feb 9 14:31:10 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 9 Feb 2011 13:31:10 -0700 Subject: [Maxima] grinding, etc. In-Reply-To: References: Message-ID: On 2/9/11, Michel Talon wrote: > Hello, > > i am trying to write a grind variant to convert expressions so that they can > be embedded in Gnu GMP programs. In the course of doing that, i have, of > course, consulted forta.lisp, grind.lisp and mactex.lisp, but i see that > some expressions are of the following form: > niobe% maxima > (%i1) x:y*(z+t^2)$ > > (%i2) :lisp $X > > ((MTIMES . #1=(SIMP)) $Y ((MPLUS . #1#) ((MEXPT . #1#) $T 2) $Z)) > > I am puzzled by the #1=(SIMP) ... #1# > I suppose that #1 has to be replaced by SIMP but would someone be kind > enough to explain how this syntax can be understood from lisp? > > Well, grind.lisp is not the most obvious thing to understand, i see > that prof Fateman has lifted some parts to texmacs.lisp and added some > comments, but does someone know what msize is supposed to do? I am puzzled > by such stuff: > (%i2) :lisp (msize $X nil nil 'mparen 'mparen) > > (9 (1 y) (8 (3 * ( z) (5 (2 + t) (3 ^ 2 ))))) > > From Fateman's comments i see that in > defun msize (x l r lop rop) > l and r are supposed to be stuff at the left and right of x, while > lop and rop are left and right "parenthesis", here true parenthesis, > but if somebody remembers what is this left and right stuff, and what > these numbers 9 8 etc. mean, i would be grateful. > > By the way, at first sight, 9 is the total number of characters in the > expansion of x, in (1 y) y has 1 character, in (8 ( ...)) there are 8 > characters after the *, but at (3 * i don't understand precisely ... > > Of course i suppose the aim is to be able to cut long lines by counting > characters but how exactly? Writing a custom grind function ex nihilo probably isn't worth the trouble. What are you trying to do? Probably it's easier to adapt some existing code. Take a look at the f90 function. The output is somewhat closer to C than Fortran. HTH Robert Dodier From shorne at energetiq.com Wed Feb 9 14:38:45 2011 From: shorne at energetiq.com (shorne at energetiq.com) Date: Wed, 9 Feb 2011 15:38:45 -0500 Subject: [Maxima] grinding, etc. In-Reply-To: Message-ID: On 2/9/11, Michel Talon wrote: > Hello, > > i am trying to write a grind variant to convert expressions so that they can > be embedded in Gnu GMP programs. I recall somewhere in this thread that you were looking for C output. The old f2c program is certainly still available for free download; http://en.wikipedia.org/wiki/F2c It's extremely robust - "industrial strength" - I used it heavily -- gee-- decades? ago... If you don't care what the C looks like, just that it works -- this may be a solution - just pipe maxima's fortran output through the converter. Good luck - Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Wed Feb 9 16:28:10 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 9 Feb 2011 15:28:10 -0700 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: <1297276156.1734.18.camel@dieter> References: <1297276156.1734.18.camel@dieter> Message-ID: Sorry, I meant to say *print-circle* = nil is probably more generally preferable. best Robert Dodier On 2/9/11, Dieter Kaiser wrote: > Am Mittwoch, den 09.02.2011, 10:15 -0700 schrieb Robert Dodier: >> I agree that *print-circle* = T is probably more generally preferable. >> I agree w/ Fateman's suggestion to modify other printing parameters. >> Let's change those and set *print-circle* back to nil. > > Yes, I think it is a good idea to change the value of *print-circle* > back to nil, too. It is always my first command to set *print-circle* to > nil, when I am debugging code. > > Dieter Kaiser > > > From yaalekseev at rambler.ru Wed Feb 9 17:52:08 2011 From: yaalekseev at rambler.ru (Yaroslav Alekseev) Date: Thu, 10 Feb 2011 02:52:08 +0300 Subject: [Maxima] itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis In-Reply-To: <01f401cbc7c7$db6f87d0$924e9770$@vttoth.com> References: <01f401cbc7c7$db6f87d0$924e9770$@vttoth.com> Message-ID: Viktor T. Toth ?????(?) ? ????? ?????? Tue, 08 Feb 2011 22:39:04 +0300: > I think the only step missing is an evaluation of ifb before converting > to a > ctensor expression. Try this: > > load(itensor); > load(ctensor); > iframe_flag:true; > cframe_flag:true; > ct_coordsys(polar)$ > depends([V,ifg,ifr,ifri],ct_coords)$ > ishow(covdiff(V([],[j]),j))$ > ishow(ev(%,icc2,ifc2,ifc1,ifb))$ > eqn:eq=%$ > ceqn:ic_convert(eqn)$ > ev(ceqn); > > A word of warning: Presently, ic_convert has no explicit knowledge about > the > meaning of the symbols ifg, ifr, and ifri. It just treats them as it > would > treat any other indexed objects. In the present example, it is not > relevant > as the symbols cancel; in other cases, however, you may need to take > steps > to identify the itensor symbols ifr, ifri, and ifg with the corresponding > ctensor matrices fri, ifri, and lfg/ufg as appropriate. > > > Viktor Ok, thank you for response. I have to define symbols ifr, ifri, and ifg. So, I've tried this: load(itensor); load(ctensor); iframe_flag:true; cframe_flag:true; ct_coordsys(polar)$ depends(V,ct_coords)$ ishow(covdiff(V([],[j]),j))$ ishow(ev(%,icc2,ifc2,ifc1,ifb))$ eqn:eq=%$ ceqn:ic_convert(eqn)$ ifg:matrix([1,0],[0,1]); fri:matrix([1,0],[0,1/r]); ifri:matrix([1,0],[0,r]); ev(ceqn); But I've got very strange answer: (%i14) ev(ceqn); d d (%o14) ---- (V ) + -- (V ) dphi 2 dr 1 It seems to me that the answer should be something like this (ordinary divergence): dV2 ---- dphi dV1 V1 (%o21) ---- + --- + -- r dr r > > > > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] > On Behalf Of Yaroslav Alekseev > Sent: Tuesday, February 08, 2011 2:38 PM > To: maxima at math.utexas.edu > Subject: [Maxima] itensor and ctensor: indexed objects in moving frames > in > specific coordinate systems and frame basis > > > Hi to all! I need to learn how to compute various expressions with > indexed > objects in moving frames > in specific coordinate systems and frame basis. For example: to compute > contract(covdiff(V([],[j]),j)) > in polar coordinate and frame > basis:matrix([a(r,phi),b(r,phi)],[c(r,phi),d(r,phi)]). In Maxima: > > Maxima 5.23.2 http://maxima.sourceforge.net > using Lisp SBCL 1.0.43 > 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) kill(all); > (%o0) done > (%i1) load(itensor); > STYLE-WARNING: redefining MAXIMA::$NAME in DEFUN > STYLE-WARNING: redefining MAXIMA::DERIV in DEFUN > STYLE-WARNING: redefining MAXIMA::SDIFF in DEFUN > STYLE-WARNING: redefining MAXIMA::I-$DEPENDENCIES in DEFUN > STYLE-WARNING: redefining MAXIMA::$DECSYM in DEFUN > STYLE-WARNING: redefining MAXIMA::$CANFORM in DEFUN > (%o1) /usr/local/share/maxima/5.23.2/share/tensor/itensor.lisp > (%i2) load(ctensor); > (%o2) /usr/local/share/maxima/5.23.2/share/tensor/ctensor.mac > (%i3) iframe_flag:true; > (%o3) true > (%i4) ishow(covdiff(V([],[j]),j)); > j j %1 > (%t4) V + icc2 V > ,j %1 j > (%o4) V([], [j], j) + icc2([%1, j], [j]) V([], [%1]) > (%i5) ishow(ev(%,icc2)); > %1 j j > (%t5) V ifc2 + V > %1 j ,j > (%o5) V([], [%1]) ifc2([%1, j], [j]) + V([], [j], j) > (%i6) ishow(ev(%,ifc2,ifc1)); > %1 j %2 > V ifg (ifb - ifb + ifb ) > j %2 %1 %2 %1 j %1 j %2 j > (%t6) -------------------------------------------------- + V > 2 ,j > (%o6) (V([], [%1]) ifg([], [j, %2]) (ifb([j, %2, %1]) - ifb([%2, %1, j]) > + ifb([%1, j, %2])))/2 + V([], > [j], j) > (%i7) expr:contract(ratexpand(%)); > V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) > (%o7) ------------------------------------------------- > 2 > V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) > - ------------------------------------------------- > 2 > V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) > + ------------------------------------------------- + V([], [j], j) > 2 > (%i8) ishow(expr); > %1 j %2 %1 j %2 %1 j %2 > V ifg ifb V ifg ifb V ifg ifb > j %2 %1 %2 %1 j > %1 > j %2 > (%t8) ---------------------- - ---------------------- + > ---------------------- > 2 2 2 > j > + > > V > ,j > V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) > (%o8) ------------------------------------------------- > 2 > V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) > - ------------------------------------------------- > 2 > V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) > + ------------------------------------------------- + V([], [j], j) > 2 > (%i9) eqn:ishow(eq=expr); > %1 j %2 %1 j %2 > V ifg ifb V ifg ifb > j %2 %1 %2 %1 j > (%t9) eq = ---------------------- - ---------------------- > 2 2 > %1 j %2 > V ifg ifb > %1 j > %2 j > + > ---------------------- > + V > 2 > > ,j > V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) > (%o9) eq = ------------------------------------------------- > 2 > V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) > - ------------------------------------------------- > 2 > V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) > + ------------------------------------------------- + V([], [j], j) > 2 > (%i10) ceqn:ic_convert(eqn); > STYLE-WARNING: redefining MAXIMA::$IC_CONVERT in DEFUN > STYLE-WARNING: redefining MAXIMA::$MAKEBOX in DEFUN > STYLE-WARNING: redefining MAXIMA::$CONMETDERIV in DEFUN > STYLE-WARNING: redefining MAXIMA::$IGEODESIC_COORDS in DEFUN > (%o10) eq : > sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, 1, > dim) > %1 j, %2 j, %2, %1 > --------------------------------------------------------------------------- > 2 > sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, > 1, > dim) > %1 j, %2 %2, %1, j > - > --------------------------------------------------------------------------- > 2 > sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, > 1, > dim) > %1 j, %2 %1, j, %2 > + > --------------------------------------------------------------------------- > 2 > + sum(diff(V , ct_coords ), j, 1, dim) > j j > (%i11) ct_coordsys(polar); > (%o11) done > (%i12) depends(V,ct_coords); > (%o12) [V(r, phi)] > (%i13) ev(ceqn); > d d > (%o13) ---- (V ) + -- (V ) + (V ifg ifb + V ifg ifb > dphi 2 dr 1 2 2, 2 2, 2, 2 1 2, 2 2, > 2, 1 > + V ifg ifb + V ifg ifb + ifg ifb V > 2 2, 1 2, 1, 2 1 2, 1 2, 1, 1 1, 2 1, 2, 2 2 > + ifg ifb V + V ifg ifb + V ifg ifb > )/2 > 1, 1 1, 1, 2 2 1 1, 2 1, 2, 1 1 1, 1 1, 1, 1 > + (V ifg ifb + V ifg ifb + V ifb ifg > 2 2, 2 2, 2, 2 2 2, 1 2, 2, 1 1 1, 2, 2 2, > 2 > + ifg V ifb + ifg V ifb + V ifb ifg > 1, 2 2 2, 1, 2 1, 1 2 2, 1, 1 1 1, 2, 1 2, 1 > + V ifb ifg + V ifg ifb )/2 > 1 1, 1, 2 1, 2 1 1, 1 1, 1, 1 > - (V ifg ifb + ifg V ifb + V ifb ifg > 2 2, 2 2, 2, 2 1, 2 2 2, 2, 1 1 2, 1, 2 2, > 2 > + V ifg ifb + ifb V ifg + V ifb ifg > 1 1, 2 2, 1, 1 1, 2, 2 2 2, 1 1 1, 1, 2 2, 1 > + ifg ifb V + V ifg ifb )/2 > 1, 1 1, 2, 1 2 1 1, 1 1, 1, 1 > (%i14) > > What should I do next ? > -- Yaroslav From pip at iszf.irk.ru Wed Feb 9 16:58:38 2011 From: pip at iszf.irk.ru (Valery Pipin) Date: Wed, 09 Feb 2011 14:58:38 -0800 Subject: [Maxima] itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis In-Reply-To: References: <01f401cbc7c7$db6f87d0$924e9770$@vttoth.com> Message-ID: <4D531C1E.1040303@iszf.irk.ru> 09.02.2011 15:52, Yaroslav Alekseev ?????: > Viktor T. Toth ?????(?) ? ????? ?????? Tue, 08 Feb > 2011 22:39:04 +0300: > >> I think the only step missing is an evaluation of ifb before >> converting to a >> ctensor expression. Try this: >> >> load(itensor); >> load(ctensor); >> iframe_flag:true; >> cframe_flag:true; >> ct_coordsys(polar)$ >> depends([V,ifg,ifr,ifri],ct_coords)$ >> ishow(covdiff(V([],[j]),j))$ >> ishow(ev(%,icc2,ifc2,ifc1,ifb))$ >> eqn:eq=%$ >> ceqn:ic_convert(eqn)$ >> ev(ceqn); >> >> A word of warning: Presently, ic_convert has no explicit knowledge >> about the >> meaning of the symbols ifg, ifr, and ifri. It just treats them as it >> would >> treat any other indexed objects. In the present example, it is not >> relevant >> as the symbols cancel; in other cases, however, you may need to take >> steps >> to identify the itensor symbols ifr, ifri, and ifg with the >> corresponding >> ctensor matrices fri, ifri, and lfg/ufg as appropriate. >> >> >> Viktor > > Ok, thank you for response. > I have to define symbols ifr, ifri, and ifg. So, I've tried this: > > load(itensor); > load(ctensor); > iframe_flag:true; > cframe_flag:true; > ct_coordsys(polar)$ > depends(V,ct_coords)$ > ishow(covdiff(V([],[j]),j))$ > ishow(ev(%,icc2,ifc2,ifc1,ifb))$ > eqn:eq=%$ > ceqn:ic_convert(eqn)$ > ifg:matrix([1,0],[0,1]); > fri:matrix([1,0],[0,1/r]); > ifri:matrix([1,0],[0,r]); > ev(ceqn); > > But I've got very strange answer: > > > (%i14) ev(ceqn); > d d > (%o14) ---- (V ) + -- (V ) > dphi 2 dr 1 > > It seems to me that the answer should be something like this (ordinary > divergence): > > > dV2 > ---- > dphi dV1 V1 > (%o21) ---- + --- + -- > r dr r > > Seems you are mixing the co-variant (or con-travariant) components with ones for orthonormal but non-coordinate basis. (I mean you can not get the basis component via differentiation) Rgds From vttoth at vttoth.com Wed Feb 9 18:31:01 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Wed, 9 Feb 2011 19:31:01 -0500 Subject: [Maxima] itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis In-Reply-To: References: <01f401cbc7c7$db6f87d0$924e9770$@vttoth.com> Message-ID: <008301cbc8b9$d114b010$733e1030$@vttoth.com> OK, I think I understand the problem. At the root is the fact that ic_convert uses noun forms of ifg, ifr, and ifri. Then, we run into something that may or may not be a Maxima buglet: (%i1) depends(y,x); (%o1) [y(x)] (%i2) diff(y,x); dy (%o2) -- dx (%i3) diff(y[0],x); d (%o3) -- (y ) dx 0 (%i4) diff('y,x); dy (%o4) -- dx (%i5) diff('y[0],x); (%o5) 0 Personally I think this is a bug, but fortunately, there is a way to work around it within the confines of the tensor libraries. Your example could be written thus: load(itensor); load(ctensor); iframe_flag:true; cframe_flag:true; ct_coordsys(polar)$ depends([V,ifg,ifr,ifri],ct_coords)$ ishow(covdiff(V([],[j]),j))$ ishow(ev(%,icc2,ifc2,ifc1,ifb))$ eqn:eq=%$ ceqn:ic_convert(rename(expand(eqn)))$ ceqn:subst(ifri,nounify(ifri),ceqn)$ ifg:matrix([1,0],[0,1]); ifr:matrix([1,0],[0,1/r]); ifri:matrix([1,0],[0,r]); ceqn,'ifr,'ifg; V 1 d d (%o15) -- + ---- (V ) + -- (V ) r dphi 2 dr 1 The critical line is the ceqn:subst(...) line, which substitutes the verb form of ifri before diff is evaluated. Viktor -----Original Message----- From: Yaroslav Alekseev [mailto:yaalekseev at rambler.ru] Sent: Wednesday, February 09, 2011 6:52 PM To: maxima at math.utexas.edu; Viktor T. Toth Subject: Re: [Maxima] itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis Viktor T. Toth ?????(?) ? ????? ?????? Tue, 08 Feb 2011 22:39:04 +0300: > I think the only step missing is an evaluation of ifb before converting > to a > ctensor expression. Try this: > > load(itensor); > load(ctensor); > iframe_flag:true; > cframe_flag:true; > ct_coordsys(polar)$ > depends([V,ifg,ifr,ifri],ct_coords)$ > ishow(covdiff(V([],[j]),j))$ > ishow(ev(%,icc2,ifc2,ifc1,ifb))$ > eqn:eq=%$ > ceqn:ic_convert(eqn)$ > ev(ceqn); > > A word of warning: Presently, ic_convert has no explicit knowledge about > the > meaning of the symbols ifg, ifr, and ifri. It just treats them as it > would > treat any other indexed objects. In the present example, it is not > relevant > as the symbols cancel; in other cases, however, you may need to take > steps > to identify the itensor symbols ifr, ifri, and ifg with the corresponding > ctensor matrices fri, ifri, and lfg/ufg as appropriate. > > > Viktor Ok, thank you for response. I have to define symbols ifr, ifri, and ifg. So, I've tried this: load(itensor); load(ctensor); iframe_flag:true; cframe_flag:true; ct_coordsys(polar)$ depends(V,ct_coords)$ ishow(covdiff(V([],[j]),j))$ ishow(ev(%,icc2,ifc2,ifc1,ifb))$ eqn:eq=%$ ceqn:ic_convert(eqn)$ ifg:matrix([1,0],[0,1]); fri:matrix([1,0],[0,1/r]); ifri:matrix([1,0],[0,r]); ev(ceqn); But I've got very strange answer: (%i14) ev(ceqn); d d (%o14) ---- (V ) + -- (V ) dphi 2 dr 1 It seems to me that the answer should be something like this (ordinary divergence): dV2 ---- dphi dV1 V1 (%o21) ---- + --- + -- r dr r > > > > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] > On Behalf Of Yaroslav Alekseev > Sent: Tuesday, February 08, 2011 2:38 PM > To: maxima at math.utexas.edu > Subject: [Maxima] itensor and ctensor: indexed objects in moving frames > in > specific coordinate systems and frame basis > > > Hi to all! I need to learn how to compute various expressions with > indexed > objects in moving frames > in specific coordinate systems and frame basis. For example: to compute > contract(covdiff(V([],[j]),j)) > in polar coordinate and frame > basis:matrix([a(r,phi),b(r,phi)],[c(r,phi),d(r,phi)]). In Maxima: > > Maxima 5.23.2 http://maxima.sourceforge.net > using Lisp SBCL 1.0.43 > 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) kill(all); > (%o0) done > (%i1) load(itensor); > STYLE-WARNING: redefining MAXIMA::$NAME in DEFUN > STYLE-WARNING: redefining MAXIMA::DERIV in DEFUN > STYLE-WARNING: redefining MAXIMA::SDIFF in DEFUN > STYLE-WARNING: redefining MAXIMA::I-$DEPENDENCIES in DEFUN > STYLE-WARNING: redefining MAXIMA::$DECSYM in DEFUN > STYLE-WARNING: redefining MAXIMA::$CANFORM in DEFUN > (%o1) /usr/local/share/maxima/5.23.2/share/tensor/itensor.lisp > (%i2) load(ctensor); > (%o2) /usr/local/share/maxima/5.23.2/share/tensor/ctensor.mac > (%i3) iframe_flag:true; > (%o3) true > (%i4) ishow(covdiff(V([],[j]),j)); > j j %1 > (%t4) V + icc2 V > ,j %1 j > (%o4) V([], [j], j) + icc2([%1, j], [j]) V([], [%1]) > (%i5) ishow(ev(%,icc2)); > %1 j j > (%t5) V ifc2 + V > %1 j ,j > (%o5) V([], [%1]) ifc2([%1, j], [j]) + V([], [j], j) > (%i6) ishow(ev(%,ifc2,ifc1)); > %1 j %2 > V ifg (ifb - ifb + ifb ) > j %2 %1 %2 %1 j %1 j %2 j > (%t6) -------------------------------------------------- + V > 2 ,j > (%o6) (V([], [%1]) ifg([], [j, %2]) (ifb([j, %2, %1]) - ifb([%2, %1, j]) > + ifb([%1, j, %2])))/2 + V([], > [j], j) > (%i7) expr:contract(ratexpand(%)); > V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) > (%o7) ------------------------------------------------- > 2 > V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) > - ------------------------------------------------- > 2 > V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) > + ------------------------------------------------- + V([], [j], j) > 2 > (%i8) ishow(expr); > %1 j %2 %1 j %2 %1 j %2 > V ifg ifb V ifg ifb V ifg ifb > j %2 %1 %2 %1 j > %1 > j %2 > (%t8) ---------------------- - ---------------------- + > ---------------------- > 2 2 2 > j > + > > V > ,j > V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) > (%o8) ------------------------------------------------- > 2 > V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) > - ------------------------------------------------- > 2 > V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) > + ------------------------------------------------- + V([], [j], j) > 2 > (%i9) eqn:ishow(eq=expr); > %1 j %2 %1 j %2 > V ifg ifb V ifg ifb > j %2 %1 %2 %1 j > (%t9) eq = ---------------------- - ---------------------- > 2 2 > %1 j %2 > V ifg ifb > %1 j > %2 j > + > ---------------------- > + V > 2 > > ,j > V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) > (%o9) eq = ------------------------------------------------- > 2 > V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) > - ------------------------------------------------- > 2 > V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) > + ------------------------------------------------- + V([], [j], j) > 2 > (%i10) ceqn:ic_convert(eqn); > STYLE-WARNING: redefining MAXIMA::$IC_CONVERT in DEFUN > STYLE-WARNING: redefining MAXIMA::$MAKEBOX in DEFUN > STYLE-WARNING: redefining MAXIMA::$CONMETDERIV in DEFUN > STYLE-WARNING: redefining MAXIMA::$IGEODESIC_COORDS in DEFUN > (%o10) eq : > sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, 1, > dim) > %1 j, %2 j, %2, %1 > --------------------------------------------------------------------------- > 2 > sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, > 1, > dim) > %1 j, %2 %2, %1, j > - > --------------------------------------------------------------------------- > 2 > sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, > 1, > dim) > %1 j, %2 %1, j, %2 > + > --------------------------------------------------------------------------- > 2 > + sum(diff(V , ct_coords ), j, 1, dim) > j j > (%i11) ct_coordsys(polar); > (%o11) done > (%i12) depends(V,ct_coords); > (%o12) [V(r, phi)] > (%i13) ev(ceqn); > d d > (%o13) ---- (V ) + -- (V ) + (V ifg ifb + V ifg ifb > dphi 2 dr 1 2 2, 2 2, 2, 2 1 2, 2 2, > 2, 1 > + V ifg ifb + V ifg ifb + ifg ifb V > 2 2, 1 2, 1, 2 1 2, 1 2, 1, 1 1, 2 1, 2, 2 2 > + ifg ifb V + V ifg ifb + V ifg ifb > )/2 > 1, 1 1, 1, 2 2 1 1, 2 1, 2, 1 1 1, 1 1, 1, 1 > + (V ifg ifb + V ifg ifb + V ifb ifg > 2 2, 2 2, 2, 2 2 2, 1 2, 2, 1 1 1, 2, 2 2, > 2 > + ifg V ifb + ifg V ifb + V ifb ifg > 1, 2 2 2, 1, 2 1, 1 2 2, 1, 1 1 1, 2, 1 2, 1 > + V ifb ifg + V ifg ifb )/2 > 1 1, 1, 2 1, 2 1 1, 1 1, 1, 1 > - (V ifg ifb + ifg V ifb + V ifb ifg > 2 2, 2 2, 2, 2 1, 2 2 2, 2, 1 1 2, 1, 2 2, > 2 > + V ifg ifb + ifb V ifg + V ifb ifg > 1 1, 2 2, 1, 1 1, 2, 2 2 2, 1 1 1, 1, 2 2, 1 > + ifg ifb V + V ifg ifb )/2 > 1, 1 1, 2, 1 2 1 1, 1 1, 1, 1 > (%i14) > > What should I do next ? > -- Yaroslav From talon at lpthe.jussieu.fr Wed Feb 9 18:38:16 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Thu, 10 Feb 2011 01:38:16 +0100 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. References: Message-ID: Stavros Macrakis wrote: > Michel, > > The problems you describe below go away if you set *print-circle* to NIL. > As for creating a formula suitable for evaluation by C, I don't > understand > why you're looking at grind or print at all: I'd think that you'd want to > start with the code of the fortran command and modify it as necessary. > (I'd have thought someone has already written a Maxima-to-C printer.) > Indeed these problems disappear. As to why i cannot start from the fortran command, or f90, it is because i want to produce formulas for multiprecision computation which have awkward syntax such as pow(x, expnt) but also add(x, y, z,...) instead of x+y+z, and similarly for all operations. This is for using by some java program, and java doesn't allow overloading of operators +, *, ... so that only awkward syntax is available. I also need to write for Gnu GMP under C++, which has some nasty notations. Moreover i want to do these computations for complex numbers, so i have to promote reals to complex numbers when they appear in the expressions, etc. So it is very necessary to somewhat analyze the expressions. Second i look at grind because i have discovered reading fortra.lisp that the bulk of work is indeed hidden in grind.lisp. In fact fortran does very little, sets some global variables and then delegates all work to grind. Grind is complicated because it has to cut long lines, which is not really necessary here. But i have observed that things may be quite tricky since Fateman has found useful to lift large parts of grind to write the tex command. Of course i want to follow this example but don't have the talent to hack grind without understanding anything to how it works. Finally it is true that maxima doesn't have a command to produce C syntax formulas, and this appears to be a major obstacle to maxima adoption by the people around me. Of course f2c is not a solution. For example it will never solve the multiprecision problem. I think it is a valuable aim to try to close this gap. You may say, why not directly use maxima or the underlying lisp to do the multiprecision computations? The people most involved in that around me say that writing their programs in C++ with GMP allowed them to get order of magnitude more speed that computing directly with maple (their tool of choice) and that this allowed them to gain an edge in their research against their colleagues. So if i want to be useful, there is no chance to proceed in another direction ... An example of typical necessary computation is diagonalizing 1000x1000 matrix with 150 digits. Lapack does that quickly but with double precision. For the problems at hand (Bethe ansatz problems) this is akin to completely random Bethe roots. Maxima with bfloats has the precision but saturates at far smaller matrices. The problem is not to compute the roots of charpoly, in fact bfallroots is able to do that. But getting charpoly is a major problem. The command charpoly() saturates very quickly. By computing the traces of powers of the matrix one gets indirectly the charpoly through Newton sums, but one cannot get far more than 100x100 matrices (with bfloat entries). But these Bethe ansatz problems grow ultra quickly, so at this point you have explored almost nothing. Another example is iteration of birational maps. By computing in C++ with many decimals you can iterate millions of times and still get reliable results. This allows to compute so-called "algebraic entropy" in cases unavailable to people using exclusively maple or similar tools to do their iterations. -- Michel Talon From fateman at eecs.berkeley.edu Wed Feb 9 19:23:55 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 09 Feb 2011 17:23:55 -0800 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: References: Message-ID: <4D533E2B.2060207@eecs.berkeley.edu> On 2/9/2011 4:38 PM, Michel Talon wrote: > Stavros Macrakis wrote: > >> Michel, >> >> The problems you describe below go away if you set *print-circle* to NIL. >> As for creating a formula suitable for evaluation by C, I don't >> understand >> why you're looking at grind or print at all: I'd think that you'd want to >> start with the code of the fortran command and modify it as necessary. >> (I'd have thought someone has already written a Maxima-to-C printer.) >> > Indeed these problems disappear. As to why i cannot start from the fortran > command, or f90, it is because i want to produce formulas for multiprecision > computation which have awkward syntax such as pow(x, expnt) but also > add(x, y, z,...) instead of x+y+z, and similarly for all operations. This > is for using by some java program, and java doesn't allow overloading of > operators +, *, ... so that only awkward syntax is available. I also need to > write for Gnu GMP under C++, which has some nasty notations. Moreover i want > to do these computations for complex numbers, so i have to promote reals to > complex numbers when they appear in the expressions, etc. So it is very > necessary to somewhat analyze the expressions. There is another approach possible, but may be impractical for you to use. GMP or MPFR or similar code can be called directly from lisp via foreign function calls. Lisp allows plus, times etc to be overloaded. MPFR is much faster than bfloats. This suggestion means you don't need C++ or Java. An old paper.. http://www.cs.berkeley.edu/~fateman/generic/overload-small.pdf code in here http://www.cs.berkeley.edu/~fateman/generic/ Depends on how much more lisp you want to learn and whether you would just use it for all your computing (with suitable libraries) RJF From robert.dodier at gmail.com Thu Feb 10 00:26:56 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 9 Feb 2011 23:26:56 -0700 Subject: [Maxima] generating C or Java, was: Why is *print-circle* set to T by default? WAS: grinding, etc. Message-ID: My general advice is to modify the expressions of interest via Maxima expression-hacking functions, and then output the result with grind. On 2/9/11, Michel Talon wrote: > Indeed these problems disappear. As to why i cannot start from the fortran > command, or f90, it is because i want to produce formulas for multiprecision > computation which have awkward syntax such as pow(x, expnt) but also > add(x, y, z,...) instead of x+y+z, and similarly for all operations. foo : x^2 + y^2; foo1 : subst ("+" = add, foo); foo2 : subst ("^" = pow, foo1); foo2; => add(pow(x, 2), pow(y, 2)) > This is for using by some java program, and java doesn't allow overloading of > operators +, *, ... so that only awkward syntax is available. If some function needs to be a method of some class, we can probably do something like this (for instance methods) matchdeclare ([xx, yy], all); defrule (r1, pow (xx, yy), xx . pow (yy)); apply1 (foo2, r1); => add(x . pow(2), y . pow(2)) or this (for static methods) matchdeclare ([xx, yy], all); defrule (r2, pow (xx, yy), FooClass . pow (xx, yy)); applyb1 (foo2, r2); => add(FooClass . pow(x, 2), FooClass . pow(y, 2)) (NB. applyb1 works bottom up, apply1 works top down. So apply1 has the wrong effect on r2 because r2's output matches r2.) > I also need to write for Gnu GMP under C++, which has > some nasty notations. Yeah, it's quite a disaster, isn't it ... but tell us what you want and I'll give it a try. > Moreover i want to do these computations for complex numbers, > so i have to promote reals to > complex numbers when they appear in the expressions, etc. matchdeclare (xx, lambda ([e], atom (e) and featurep (e, real))); defrule (r3, xx, complex (xx, 0)); declare (a, real); featurep (a, real); => true featurep (b, real); => false bar : 1 + baz (%pi, %i) + quux (mumble (1), a, b); applyb1 (bar, r3); => quux(mumble(complex(1, 0)), complex(a, 0), b) + baz(complex(%pi, 0), %i) + complex(1, 0) > So it is very necessary to somewhat analyze the expressions. Agreed; you should do that using Maxima functions. Maybe after completing this exercise we will have some rules & other mogrifications which we can package as a Maxima -> C or Maxima -> Java conversion function. Just a thought. HTH Robert Dodier From robert.dodier at gmail.com Thu Feb 10 00:48:41 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 9 Feb 2011 23:48:41 -0700 Subject: [Maxima] announcement: Maxima 5.23 release Message-ID: Please distribute this message as you see fit. Announcing Maxima 5.23 Maxima is a GPL'd branch of Macsyma, the venerable symbolic computation system. Maxima 5.23 is a bug fix and feature enhancement release. The current version is 5.23.2. 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, .... 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.23 release. Regards, Robert Dodier Maxima developer and 5.23 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/project/showfiles.php?group_id=4933 Ports page: http://apps.sourceforge.net/mediawiki/maxima/index.php?title=Maxima_ports Project home page: http://maxima.sourceforge.net Change log: http://maxima.cvs.sourceforge.net/*checkout*/maxima/maxima/ChangeLog-5.23 From renekaelin at gmx.ch Thu Feb 10 01:50:19 2011 From: renekaelin at gmx.ch (=?iso-8859-1?Q?=22Ren=E9_K=E4lin=22?=) Date: Thu, 10 Feb 2011 08:50:19 +0100 Subject: [Maxima] sqrt(x)*sqrt(x) Message-ID: <20110210075019.58470@gmx.net> Hello I tried this (with Maxima 5.21.1): domain:real$ t:x^(1/2)*x^(1/2); assume(x<0); t; forget(x<0)$ assume(x>=0); t; with the output: (%o2) x (%o3) [x<0] (%o4) x (%o6) [x>=0] (%o7) x I only want to consider some real numbers. Because the squareroot of x is not defined for x<0, %o4 is wrong, isn't it? The Problem seems to be that t:x^(1/2)*x^(1/2) is simplified immediately to x in any case. (I sent this post 2 days ago with a wrong title. Sorry if you received it twice.) -- GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit gratis Handy-Flat! http://portal.gmx.net/de/go/dsl From leon.magiera at wp.pl Thu Feb 10 02:49:52 2011 From: leon.magiera at wp.pl (leon.magiera at wp.pl) Date: Thu, 10 Feb 2011 09:49:52 +0100 Subject: [Maxima] simplification Message-ID: <4d53a6b0dcf973.23658254@wp.pl> Hi List Given assume( a>0, b>0 )$ sqrt(a^2 - 2*a*b + b^2) + sqrt(a^2 - 2*a*b+b^2); How to simplify the above expression to the form a+b+abs(a-b) Thanks in advance Leon From talon at lpthe.jussieu.fr Thu Feb 10 04:16:09 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Thu, 10 Feb 2011 11:16:09 +0100 Subject: [Maxima] generating C or Java, was: Why is *print-circle* set to T by default? WAS: grinding, etc. References: Message-ID: Robert Dodier wrote: > My general advice is to modify the expressions of interest > via Maxima expression-hacking functions, and then output > the result with grind. I thank you very much for this explanation, and i forward it immediately to my interested colleague. This is certainly the way to get a quick "hack" for solving the problem at hand immediately. It is also very interesting as examples of use for the substitution commands, which remain, at least for me, quite mysterious. I will try to write some modification of grind which directly outputs the appropriate code, because it seems to me this is the most simple and logic way to do it, since the expressions are fully parsed at the lisp level, and only require potentially simple transformations. -- Michel Talon From sangwinc at for.mat.bham.ac.uk Thu Feb 10 04:42:39 2011 From: sangwinc at for.mat.bham.ac.uk (Chris Sangwin) Date: Thu, 10 Feb 2011 10:42:39 +0000 (GMT) Subject: [Maxima] simplification In-Reply-To: <4d53a6b0dcf973.23658254@wp.pl> References: <4d53a6b0dcf973.23658254@wp.pl> Message-ID: Leon, First, I think your expression should be sqrt(a^2 - 2*a*b + b^2) + sqrt(a^2 + 2*a*b+b^2); What you need to do is get "inside the square roots", and to factor. The following code does this. factor_bits(ex):=if atom(ex) then ex else apply(op(ex),maplist(lambda([ex2],factor_bits(factor(ex2))),args(ex))); Chris On Thu, 10 Feb 2011, leon.magiera at wp.pl wrote: > Hi List > > Given > > assume( a>0, b>0 )$ > > sqrt(a^2 - 2*a*b + b^2) + sqrt(a^2 - 2*a*b+b^2); > > How to simplify the above expression to the form > > a+b+abs(a-b) > > Thanks in advance > Leon > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From toy.raymond at gmail.com Thu Feb 10 06:53:48 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 10 Feb 2011 07:53:48 -0500 Subject: [Maxima] simplification In-Reply-To: References: <4d53a6b0dcf973.23658254@wp.pl> Message-ID: <4D53DFDC.6000502@gmail.com> On 2/10/11 5:42 AM, Chris Sangwin wrote: > > Leon, > > First, I think your expression should be > > sqrt(a^2 - 2*a*b + b^2) + sqrt(a^2 + 2*a*b+b^2); > > What you need to do is get "inside the square roots", and to factor. > The following code does this. I learned the following from Stavros: scanmap(factor, sqrt(a^2-2*a*b+b^2)+sqrt(a^2+2*a*b+b^2)); abs(b-a)+b+a. Ray From l.butler at ed.ac.uk Thu Feb 10 07:02:39 2011 From: l.butler at ed.ac.uk (Leo T Butler) Date: Thu, 10 Feb 2011 13:02:39 +0000 Subject: [Maxima] generating C or Java, was: Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: References: Message-ID: <20110210130239.19206ojzx5ciyl4w@www.staffmail.ed.ac.uk> >> I also need to write for Gnu GMP under C++, which has >> some nasty notations. > > Yeah, it's quite a disaster, isn't it ... but tell us what you want > and I'll give it a try. Jon Wilkening at Berkeley has written a nice C++ wrapper around GMP, so that the code can look quite natural unlike C code using GMP. http://math.berkeley.edu/~wilken/code/gmpfrxx/ I seem to recall I persuaded him to release the code under GPL, as I used it in a project a few years ago and we corresponded then. > >> Moreover i want to do these computations for complex numbers, >> so i have to promote reals to >> complex numbers when they appear in the expressions, etc. I am not sure if the wrapper handles complex numbers at this point, though. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From fateman at eecs.berkeley.edu Thu Feb 10 08:41:57 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 10 Feb 2011 06:41:57 -0800 Subject: [Maxima] accessing GMP, MPFR, was Re: generating C or Java, In-Reply-To: <20110210130239.19206ojzx5ciyl4w@www.staffmail.ed.ac.uk> References: <20110210130239.19206ojzx5ciyl4w@www.staffmail.ed.ac.uk> Message-ID: <4D53F935.5020100@eecs.berkeley.edu> On 2/10/2011 5:02 AM, Leo T Butler wrote: ... > > Jon Wilkening at Berkeley has written a nice C++ wrapper around GMP, > so that the code can look quite natural unlike C code using GMP. > > http://math.berkeley.edu/~wilken/code/gmpfrxx/ > ... This might be useful, but I will mention once again, the possibility of just using lisp. Loading in the generic arithmetic package (which could be loaded into Maxima, though not the GCL/Windows version), and loading the appropriate mpfr.dll , one can do this in Lisp... (use-package :mpfr) (set-prec 100) (setf r (into 1/3)) 3.3333333333333333333333333333346^-1 ; I've indented the output (+ r r r) 1. (sin r) 3.2719469679615224417334408526792^-1 ; yes, sine, etc is there. etc. That is, the "wrapping" is done rather completely. The cost of calling mpfr from lisp is a small percentage of the cost of the mpfr calculation itself. If there is considerable "other" code written in Java or C, then this is not a good idea. If, however, most of the code is being "automatically generated" then this might be quite feasible. In case you haven't encountered it, Lisp has features like (loop for i from 1 to n do (print (* i i)) and arrays etc. Though the array referencing and setting code looks like (setf (aref b i) (+ (aref c j)(aref c k))) this can be easily covered over by writing a few macros; if everything is properly declared, it should be not much different from Fortran or C in speed. I'm not saying this would be trivial for you to do; I don't know enough about your calculation and your environment, and obviously you'd need to learn more about lisps and find a suitable one for your setup. I'm guessing you really want bigfloats (MPFR), but if you want integers (GMP) , that's written out, too, since the lisp I was using has its own different bignum integer package. Some lisps already use GMP and you need to do nothing special to access them. RJF From macrakis at alum.mit.edu Thu Feb 10 08:57:07 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 10 Feb 2011 09:57:07 -0500 Subject: [Maxima] generating C or Java, was: Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: <20110210130239.19206ojzx5ciyl4w@www.staffmail.ed.ac.uk> References: <20110210130239.19206ojzx5ciyl4w@www.staffmail.ed.ac.uk> Message-ID: If you don't care about formatting (the main function of grind), wouldn't it be simpler to just do it all in Maxima, something like this: /* kill c_op to remove any memoized values */ kill(c_op)$ c_op["+"]: myplus$ c_op["/"]: mydivide$ c_op["^"]: myexp$ c_op["["]: mylist$ c_op[x] := x$ m_to_c1(ex) := if atom(ex) then ex elseif subvarp(ex) then m_to_c1(apply('mysubscript,cons(part(ex,0),args(ex)))) /* Cases that one might want to add: * subscripted functions like f[i](x) * special case for rationals like 2/3 * special case for bigfloats like 2.3b3 */ else block([op,ar], ex: de_nary(ex), concat(c_op[op(ex)],"(",m_to_cn(args(ex)),")"))$ m_to_cn(l) := if l=[] then "" elseif length(l)=1 then m_to_c1(l[1]) else concat(m_to_c1(l[1]),",",m_to_cn(rest(l)))$ de_nary(ex) := if member(op(ex),["+","*"]) then lreduce(op(ex),args(ex)) else ex$ m_to_c(ex):= block([simp:false, inflag:false], /* use inflag: true here if a/b should be treated as a*b^-1 */ m_to_c1(totaldisrep(ex)))$ /* Example m_to_c([23,a[i]/(sin(x)+g(23)+1/2)]) => mylist(23,mydivide(mysubscript(a,i),myplus(myplus(sin(x),g(23)),mydivide(1,2)))) */ On Thu, Feb 10, 2011 at 08:02, Leo T Butler wrote: > I also need to write for Gnu GMP under C++, which has >>> some nasty notations. >>> >> >> Yeah, it's quite a disaster, isn't it ... but tell us what you want >> and I'll give it a try. >> > > Jon Wilkening at Berkeley has written a nice C++ wrapper around GMP, > so that the code can look quite natural unlike C code using GMP. > > http://math.berkeley.edu/~wilken/code/gmpfrxx/ > > I seem to recall I persuaded him to release the code under GPL, > as I used it in a project a few years ago and we corresponded then. > > > >> Moreover i want to do these computations for complex numbers, >>> so i have to promote reals to >>> complex numbers when they appear in the expressions, etc. >>> >> > I am not sure if the wrapper handles complex numbers at this point, > though. > > Leo > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > > _______________________________________________ > 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 nathaniel.cunningham at gmail.com Thu Feb 10 09:57:40 2011 From: nathaniel.cunningham at gmail.com (Nathaniel Cunningham) Date: Thu, 10 Feb 2011 09:57:40 -0600 Subject: [Maxima] anonymous CVS access broken? Message-ID: I cannot view the maxima CVS repository either via link http://maxima.cvs.sourceforge.net/maxima or via terminal access with command cvs -d:pserver:anonymous at maxima.cvs.sourceforge.net:/cvsroot/maxima login ... with [RETURN] at password prompt Is something broken? Thanks, Nathaniel -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Thu Feb 10 14:13:14 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 10 Feb 2011 13:13:14 -0700 Subject: [Maxima] generating C or Java, was: Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: References: Message-ID: On 2/10/11, Michel Talon wrote: > I thank you very much for this explanation, and i forward it immediately to > my interested colleague. This is certainly the way to get a quick "hack" > for solving the problem at hand immediately. But, um, if it solves the problem immediately, then it solves the problem ... in what sense is it lacking? > I will try to write some modification of grind which > directly outputs the appropriate code, because it seems to me this is the > most simple and logic way to do it, since the expressions are fully parsed > at the lisp level, and only require potentially simple transformations. I don't see how modifying grind could be any simpler than the examples I gave, but I guess that's for you to decide. best Robert Dodier From l.butler at ed.ac.uk Thu Feb 10 14:30:05 2011 From: l.butler at ed.ac.uk (Leo T Butler) Date: Thu, 10 Feb 2011 20:30:05 +0000 Subject: [Maxima] anonymous CVS access broken? In-Reply-To: References: Message-ID: <20110210203005.13690abnhi7teeog@www.staffmail.ed.ac.uk> Quoting Nathaniel Cunningham : > I cannot view the maxima CVS repository either via link > http://maxima.cvs.sourceforge.net/maxima > > or via terminal access with command > cvs -d:pserver:anonymous at maxima.cvs.sourceforge.net:/cvsroot/maxima login > ... with [RETURN] at password prompt > > Is something broken? Yes, the sourceforge site was hacked a while ago and the cvs service has been very slow to come back online. You'll find some recent posts on the situation midway down this page: http://sourceforge.net/blog/2011/02/ Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From willisb at unk.edu Thu Feb 10 15:15:33 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 10 Feb 2011 15:15:33 -0600 Subject: [Maxima] integration using z =tan(x/2) sub In-Reply-To: <20110210203005.13690abnhi7teeog@www.staffmail.ed.ac.uk> References: <20110210203005.13690abnhi7teeog@www.staffmail.ed.ac.uk> Message-ID: Apparently, Maxima sometimes tries a z =tan(x/2) substitution (expunged from calculus books in the 1980s?); examples: (%i9) integrate(exp(sin(x)),x); 1" Enter "integrate[%e^sin(x),x] .2" Enter "integrate[%e^((2*x)/(x^2+1))/(x^2+1),x] (%i10) integrate(abs(sin(x)),x); 1" Enter "integrate[abs(sin(x)),x] .2" Enter "integrate[(x*(x/(2*x^2+2)-(%i*(log(%i*x+1)-log(1-%i*x)))/4))/abs(x),x] Loading abs_integrate allows Maxima to find an antiderivative of abs(sin(x)) that is discontinuous at odd multiples of pi. Using *simplification* and Richard Fateman's partitions2deep and abs_integrate, I can get Maxima to give an antiderivative of abs(sin(x)) that is continuous on the reals--something like 'integrate(abs(sin(x)),x) = 2*floor(x/%pi)-cos(%pi*floor(x/%pi)-x) but integrate(abs(sin(x)),x) --> big ugly mess that isn't continuous on the reals. It's unsatisfactory for simplification and evaluation to give such different results. Of course, a user could get call intfudu directly, but that's inconvenient. I'm not sure that the z =tan(x/2) substitution is such a good thing to try--it leads to spurious poles (at least for integrate(abs(sin(x)),x). Maybe the z =tan(x/2) method works OK for integrate(abs(sin(x)),x) but some of the atan need to be changed to atan2? --Barton From vi5u0-maxima at yahoo.co.uk Thu Feb 10 17:09:34 2011 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Thu, 10 Feb 2011 23:09:34 +0000 (GMT) Subject: [Maxima] integration using z =tan(x/2) sub In-Reply-To: References: <20110210203005.13690abnhi7teeog@www.staffmail.ed.ac.uk> Message-ID: On Thu, 10 Feb 2011, Barton Willis wrote: > Apparently, Maxima sometimes tries a z =tan(x/2) substitution (expunged > from calculus books in the 1980s?) I don't know if you count as a "calculus book", but it's right there on page 14 of the 2005 edition. From toy.raymond at gmail.com Thu Feb 10 21:01:40 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 10 Feb 2011 22:01:40 -0500 Subject: [Maxima] anonymous CVS access broken? In-Reply-To: <20110210203005.13690abnhi7teeog@www.staffmail.ed.ac.uk> References: <20110210203005.13690abnhi7teeog@www.staffmail.ed.ac.uk> Message-ID: <4D54A694.3080506@gmail.com> On 2/10/11 3:30 PM, Leo T Butler wrote: > Quoting Nathaniel Cunningham : > >> I cannot view the maxima CVS repository either via link >> http://maxima.cvs.sourceforge.net/maxima >> >> or via terminal access with command >> cvs -d:pserver:anonymous at maxima.cvs.sourceforge.net:/cvsroot/maxima >> login >> ... with [RETURN] at password prompt >> >> Is something broken? > > Yes, the sourceforge site was hacked a while ago > and the cvs service has been very slow to come back > online. You'll find some recent posts on the situation > midway down this page: http://sourceforge.net/blog/2011/02/ I see that http://sourceforge.net/blog says that CVS is back, with some caveats. Ray From dlakelan at street-artists.org Fri Feb 11 01:10:16 2011 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 10 Feb 2011 23:10:16 -0800 Subject: [Maxima] altering tex output of derivatives? Message-ID: <4D54E0D8.4040705@street-artists.org> I am working on deriving a partial differential equation for a physical model. The expression is long and has partial derivatives of all sorts of things, typesetting it by hand is a pain. I've used "texput" to describe the tex output for all the various variables, but I want a different format for derivatives. Specifically I want diff(a,b,1) to be typeset as "\del{a}{b}" which is a macro defined in my LaTeX file that automatically sets up a partial derivative for the two variables. I tried using texput to change the output of diff but it doesn't work: texconvdiff(arg) := block([a,b,c],[a,b,c]: args(arg), concat("\\del{",tex1(a),"}{",tex1(b),"}")); texput(diff,texconvdiff); tex('diff(a,b)); <<<<< doesn't output modified derivative notation*************** Instead I've set up a pattern rule to replace diff(a,b,1) with del(a,b) and diff(a,b,2) with delsq(a,b) and then set the texput for those functions, but I wonder why it is not possible to change the way that maxima outputs derivatives? From talon at lpthe.jussieu.fr Fri Feb 11 03:37:01 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 11 Feb 2011 10:37:01 +0100 Subject: [Maxima] integration using z =tan(x/2) sub References: <20110210203005.13690abnhi7teeog@www.staffmail.ed.ac.uk> Message-ID: Dan wrote: > On Thu, 10 Feb 2011, Barton Willis wrote: > >> Apparently, Maxima sometimes tries a z =tan(x/2) substitution (expunged >> from calculus books in the 1980s?) > > I don't know if you count > as a > "calculus book", but it's right there on page 14 of the 2005 edition. It would be unfortunate to expunge this substitution from books since this is the one which reveal that the circle is a genus 0 curve, isomorphic to a line. Geometrically this rational parametrisation is obtained by cutting the circle by a line through one point of the circle, so the second point depends rationally on the slope. This slope is obviously the tangent of the half angle, and the fixed point becomes the point at infinity on the line, hence the "spurious" infinities in question. Hence showing this parametrization is an introduction to most interesting subjects about curves and also points to the futility of classical trigonometry. -- Michel Talon From talon at lpthe.jussieu.fr Fri Feb 11 04:06:05 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 11 Feb 2011 11:06:05 +0100 Subject: [Maxima] generating C or Java, was: Why is *print-circle* set to T by default? WAS: grinding, etc. References: Message-ID: Robert Dodier wrote: > > But, um, if it solves the problem immediately, then it solves the problem > ... in what sense is it lacking? > It is not lacking at all, it is in fact so direct and simple that it should indeed be integrated in maxima, because a command to output C code should be appreciated by many people. Anyways i thank you very much, Robert, and i also thank Stavros Macrakis for his (quite sophisticated for me) solution to the same problem, and prof. Richard Fateman for his alternative route to the solution. This, combined with fortra.lisp, f90.lisp, shows that there are "many ways to skin a cat" I have read some of Fateman's papers on multiprecision computations with lisp and co. so i see that it is one of his subjects of interest. By the way, for reference, here are the URLS for the necessary software he is speaking about: http://www.mpfr.org/ http://www.cs.berkeley.edu/~fateman/generic/mpfr.lisp http://www.cs.berkeley.edu/~fateman/generic/ga.lisp >From my experience speaking with colleagues, there is very little hope people in the physics community may be attracted by lisp programming, if only because the language is far too gigantic, nobody wants to learn several hundred pages (*) of stuff. Python has gained a lot of momentum in the same community because you learn it very fast, still it is not that different from lisp. All this to say that the solution he advocates may have practical use probably only if combined with a wrapper which hides it behind simple maxima commands. (*) same punishment for C++, but more generally, as coauthor of a big book on my subject, i know that big books are always a failure, nobody reads them, and it is even difficult to find information inside - either the index is too small and lacks half the interesting words, or too big, the relevant page is hidden among myriads irrelevant ones. -- Michel Talon From eric.reyssat at unicaen.fr Fri Feb 11 00:17:12 2011 From: eric.reyssat at unicaen.fr (Eric Reyssat) Date: Fri, 11 Feb 2011 07:17:12 +0100 Subject: [Maxima] integration using z =tan(x/2) sub In-Reply-To: References: <20110210203005.13690abnhi7teeog@www.staffmail.ed.ac.uk> Message-ID: <4D54D468.1050609@unicaen.fr> Le 11/02/2011 00:09, Dan a ?crit : > On Thu, 10 Feb 2011, Barton Willis wrote: > >> Apparently, Maxima sometimes tries a z =tan(x/2) substitution (expunged >> from calculus books in the 1980s?) > > I don't know if you count > as a > "calculus book", but it's right there on page 14 of the 2005 edition. This reference seems to restrict the use of tan(x/2) substitution to the case of rational functions of sin(x) and cos(x), which is not the case of exp(sin(x)) and abs(sin(x)). I am not sure, but the ghost poles introduced via the substitution may be much more difficult to treat correctly in the case of non rational trig expressions. Eric > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From willisb at unk.edu Fri Feb 11 06:14:00 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 11 Feb 2011 06:14:00 -0600 Subject: [Maxima] integration using z =tan(x/2) sub In-Reply-To: <4D54D468.1050609@unicaen.fr> References: <20110210203005.13690abnhi7teeog@www.staffmail.ed.ac.uk> , <4D54D468.1050609@unicaen.fr> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >This?reference?seems?to?restrict?the?use?of?tan(x/2)?substitution?to?the? >case?of?rational?functions?of?sin(x)?and?cos(x),?which?is?not?the?case? >of?exp(sin(x))?and?abs(sin(x)).?I?am?not?sure,?but?the?ghost?poles? >introduced?via?the?substitution?may?be?much?more?difficult?to?treat? >correctly?in?the?case?of?non?rational?trig?expressions. I agree with Eric, the ghost poles are difficult to treat correctly for integrate(abs(sin(x)),x) and integrate(abs(sin(x)),x). I wish the Maxima integrator was more circumspect about introducing ghost poles. Maybe there is a option variable that turns of this off (at least partially)? Here is the Maxima output (minus some error messages about log(0) in failed computations) (%i1) load("abs_integrate.mac")$ (%i2) load("partitions2deep.mac")$ In this case, the antiderivative is not continuous at odd integer multiples of pi, making it poorly suited for definite integration. The ghost poles show up in the arguments of signum (not atan) (%i3) integrate(abs(cos(x)),x); (%o3) 2*((1/2-sin(x)/((cos(x)+1)*(sin(x)^2/(cos(x)+1)^2+1)))*signum(sin(x)/(cos(x)+1)-1)+1)*signum(sin(x)/(cos(x)+1)+1) Integrate using simplification (and partitions2deep): (%i4) 'integrate(abs(cos(x)),x); (%o4) 2*floor(x/%pi+1/2)-cos(%pi*floor(x/%pi+1/2)-x-%pi/2) With integrate(abs(sin(x)),x), the ghost poles show up in the arguments of log, atan, and signum. It's a big mess, but correct between odd integer multiples of pi, I think: (%i5) integrate(abs(sin(x)),x); (%o5) 4*((abs(sin(x))*(atan(sin(x)/(cos(x)+1))/2+sin(x)/((cos(x)+1)*((2*sin(x)^2)/(cos(x)+1)^2+2))))/abs(cos(x)+1)-(signum(sin(x)/(cos(x)+1))*log((2*sin(x)^2)/(cos(x)+1)^2+2)-signum(sin(x)/(cos(x)+1))*log(sin(x)^2/(cos(x)+1)^2+1)+((2*sin(x)*atan(sin(x)/(cos(x)+1)))/(cos(x)+1)-log(2))*signum(sin(x)/(cos(x)+1)))/4) The antiderivative by simplification: (%i6) 'integrate(abs(sin(x)),x); (%o6) 2*floor(x/%pi)-cos(%pi*floor(x/%pi)-x) I sometimes wonder if a purely pattern matching / lookup integration would be superior to what we have; for example http://www.apmaths.uwo.ca/~arich/ . --Barton From fateman at eecs.berkeley.edu Fri Feb 11 09:10:39 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 11 Feb 2011 07:10:39 -0800 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: <20110210075019.58470@gmx.net> References: <20110210075019.58470@gmx.net> Message-ID: <4D55516F.5040105@eecs.berkeley.edu> On 2/9/2011 11:50 PM, "Ren? K?lin" wrote: > Hello > > I tried this (with Maxima 5.21.1): > > domain:real$ > t:x^(1/2)*x^(1/2); > assume(x<0); > t; > forget(x<0)$ > assume(x>=0); > t; > > with the output: > > (%o2) x > (%o3) [x<0] > (%o4) x > (%o6) [x>=0] > (%o7) x > > I only want to consider some real numbers. Because the squareroot of x is not defined for x<0, %o4 is wrong, isn't it? > > The Problem seems to be that t:x^(1/2)*x^(1/2) is simplified immediately to x in any case. > > (I sent this post 2 days ago with a wrong title. Sorry if you received it twice.) It seems hopeless to point out that x>0 does not mean that sqrt(x)>0, mathematically. There are 2 square roots. For example sqrt(16) is {-4, 4}, even though 16>0. The square root of x, for x<0 IS defined. It just happens to be imaginary. There is no simple way of making Maxima forget about complex numbers, even if you decide that certain of the inputs represent real numbers. What you seem to be insisting on is not that x>0, but that sqrt(x)>=0. Perhaps you should define a new function positive_sqrt(x):= .... if (x<0) then error else .... Yes, I know that in Maxima sqrt(z^2) comes out abs(z), but if you do assume(z>0), then abs(z) comes out as z. This first step, sqrt(z^2) to abs(z) is, in general, wrong, so there you are, with the subsequent step propagating the questionable result. From yhonda at mac.com Fri Feb 11 10:30:55 2011 From: yhonda at mac.com (Yasuaki Honda) Date: Sat, 12 Feb 2011 01:30:55 +0900 Subject: [Maxima] Greek letter gamma in tex() Message-ID: <403E8008-7579-44F7-BF44-17A2B7B37983@mac.com> Dear Maxima developers, I happened to notice that the treatment of greek letter gamma in tex() can be improved easily. Today, to accomodate the gamma function, (%i1) tex(gamma); $$\Gamma$$ (%i2) tex(gamma(n)); $$\Gamma\left(n\right)$$ (%i3) is the behavior. With the following patch, this can changed to: (%i1) tex(gamma); $$\gamma$$ (%i2) tex(gamma(n)); $$\Gamma\left(n\right)$$ (%i3) This is much nicer and natural, isn't it? Actually, if you put the following lines in your ~/maxima-init.mac texput(gamma,"\\gamma"); texput(gamma,lambda([arglist],block([vx],[vx]:args(arglist),concat("\\Gamma\\left(",tex1(vx),"\\right)"))))$ then above can be achieved. So I translated it into lisp code and put it into mactex.lisp, with slight modification to the original defprop statement for %gamma, I obtained the following patch. I have tested this change on GCL, SBCL, CMUCL, and Clozure CL. I would like to check in this code, so I welcome any comments on this change. Thanks and best regards, Yasuaki Honda RCS file: /cvsroot/maxima/maxima/src/mactex.lisp,v retrieving revision 1.74 diff -r1.74 mactex.lisp 469c469 < (defprop %gamma "\\Gamma" texword) ; THIS IS UNFORTUNATE ... --- > (defprop %gamma "\\gamma" texword) ; THIS IS UNFORTUNATE ... 1173a1174,1192 > > (eval-when (:load-toplevel :execute) > (simplify > (mfunction-call $texput > (trd-msymeval %gamma '%gamma) > (m-tlambda ($arglist) > (declare (special $arglist)) > ((lambda ($vx) > (declare (special $vx)) > (mset '((mlist (3 "tex-gamma.mac" src)) $vx) > (simplify ($args $arglist))) > (simplify > (mfunction-call $concat > '"\\Gamma\\left(" > (simplify > (mfunction-call $tex1 $vx)) > '"\\right)"))) > '$vx)))) > ) From robert.dodier at gmail.com Fri Feb 11 10:41:42 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 11 Feb 2011 09:41:42 -0700 Subject: [Maxima] Greek letter gamma in tex() In-Reply-To: <403E8008-7579-44F7-BF44-17A2B7B37983@mac.com> References: <403E8008-7579-44F7-BF44-17A2B7B37983@mac.com> Message-ID: OK by me to change the way tex handles gamma, but let's do it by simply defining the appropriate properties instead of by calling texput. best Robert Dodier > RCS file: /cvsroot/maxima/maxima/src/mactex.lisp,v > retrieving revision 1.74 > diff -r1.74 mactex.lisp > 469c469 > < (defprop %gamma "\\Gamma" texword) ; THIS IS UNFORTUNATE ... > --- >> (defprop %gamma "\\gamma" texword) ; THIS IS UNFORTUNATE ... > 1173a1174,1192 >> >> (eval-when (:load-toplevel :execute) >> (simplify >> (mfunction-call $texput >> (trd-msymeval %gamma '%gamma) >> (m-tlambda ($arglist) >> (declare (special $arglist)) >> ((lambda ($vx) >> (declare (special $vx)) >> (mset '((mlist (3 "tex-gamma.mac" src)) >> $vx) >> (simplify ($args $arglist))) >> (simplify >> (mfunction-call $concat >> '"\\Gamma\\left(" >> (simplify >> (mfunction-call $tex1 >> $vx)) >> '"\\right)"))) >> '$vx)))) >> ) > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From ronis at ronispc.chem.mcgill.ca Fri Feb 11 11:08:34 2011 From: ronis at ronispc.chem.mcgill.ca (David Ronis) Date: Fri, 11 Feb 2011 12:08:34 -0500 Subject: [Maxima] Greek letter gamma in tex() In-Reply-To: References: <403E8008-7579-44F7-BF44-17A2B7B37983@mac.com> Message-ID: <1297444114.32478.4.camel@montroll.chem.mcgill.ca> Actually this looks like a bug. The behavior should be gamma for lowercase and Gamma for upper. This works for alpha and Alpha, beta and Beta. Gamma is the name of a built-in function, so perhaps there's an issue here. David On Fri, 2011-02-11 at 09:41 -0700, Robert Dodier wrote: > OK by me to change the way tex handles gamma, > but let's do it by simply defining the appropriate properties > instead of by calling texput. > > best > > Robert Dodier > > > > RCS file: /cvsroot/maxima/maxima/src/mactex.lisp,v > > retrieving revision 1.74 > > diff -r1.74 mactex.lisp > > 469c469 > > < (defprop %gamma "\\Gamma" texword) ; THIS IS UNFORTUNATE ... > > --- > >> (defprop %gamma "\\gamma" texword) ; THIS IS UNFORTUNATE ... > > 1173a1174,1192 > >> > >> (eval-when (:load-toplevel :execute) > >> (simplify > >> (mfunction-call $texput > >> (trd-msymeval %gamma '%gamma) > >> (m-tlambda ($arglist) > >> (declare (special $arglist)) > >> ((lambda ($vx) > >> (declare (special $vx)) > >> (mset '((mlist (3 "tex-gamma.mac" src)) > >> $vx) > >> (simplify ($args $arglist))) > >> (simplify > >> (mfunction-call $concat > >> '"\\Gamma\\left(" > >> (simplify > >> (mfunction-call $tex1 > >> $vx)) > >> '"\\right)"))) > >> '$vx)))) > >> ) > > > > _______________________________________________ > > 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 yhonda at mac.com Fri Feb 11 11:13:18 2011 From: yhonda at mac.com (Yasuaki Honda) Date: Sat, 12 Feb 2011 02:13:18 +0900 Subject: [Maxima] Greek letter gamma in tex() In-Reply-To: References: <403E8008-7579-44F7-BF44-17A2B7B37983@mac.com> Message-ID: <4AD7C3D6-D326-4F39-8C9D-EFD4AB0F1ADD@mac.com> Hi Robert, The patch could be simplified to be: RCS file: /cvsroot/maxima/maxima/src/mactex.lisp,v retrieving revision 1.74 diff -r1.74 mactex.lisp 469c469 < (defprop %gamma "\\Gamma" texword) ; THIS IS UNFORTUNATE ... --- > (defprop %gamma "\\gamma" texword) ; THIS IS Now FORTUNATE ... 1173a1174,1201 > > (eval-when (:load-toplevel :execute) > (make-maxima-tex-glue '%gamma > #'(lambda (arglist &aux $vx) > (declare (special $vx)) > (mset '((mlist) $vx) ($args arglist)) > ($concat "\\Gamma\\left(" ($tex1 $vx) "\\right)"))) The function make-maxima-tex-glue is defined in the file mactex.lisp and used in the function texput internally. This function seems to be a good interface for this purpose. Otherwise I need to re-invent make-maxima-tex-glue again,,,. Do you think this is acceptable? On 2011/02/12, at 1:41, Robert Dodier wrote: > OK by me to change the way tex handles gamma, > but let's do it by simply defining the appropriate properties > instead of by calling texput. > > best > > Robert Dodier > > >> RCS file: /cvsroot/maxima/maxima/src/mactex.lisp,v >> retrieving revision 1.74 >> diff -r1.74 mactex.lisp >> 469c469 >> < (defprop %gamma "\\Gamma" texword) ; THIS IS UNFORTUNATE ... >> --- >>> (defprop %gamma "\\gamma" texword) ; THIS IS UNFORTUNATE ... >> 1173a1174,1192 >>> >>> (eval-when (:load-toplevel :execute) >>> (simplify >>> (mfunction-call $texput >>> (trd-msymeval %gamma '%gamma) >>> (m-tlambda ($arglist) >>> (declare (special $arglist)) >>> ((lambda ($vx) >>> (declare (special $vx)) >>> (mset '((mlist (3 "tex-gamma.mac" src)) >>> $vx) >>> (simplify ($args $arglist))) >>> (simplify >>> (mfunction-call $concat >>> '"\\Gamma\\left(" >>> (simplify >>> (mfunction-call $tex1 >>> $vx)) >>> '"\\right)"))) >>> '$vx)))) >>> ) >> >> _______________________________________________ >> 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 yhonda at mac.com Fri Feb 11 11:30:50 2011 From: yhonda at mac.com (Yasuaki Honda) Date: Sat, 12 Feb 2011 02:30:50 +0900 Subject: [Maxima] Greek letter gamma in tex() In-Reply-To: <1297444114.32478.4.camel@montroll.chem.mcgill.ca> References: <403E8008-7579-44F7-BF44-17A2B7B37983@mac.com> <1297444114.32478.4.camel@montroll.chem.mcgill.ca> Message-ID: <6847640D-25A8-46D4-A451-8E696B389273@mac.com> Dear David, I believe the original author wanted function gamma() to be formatted as Gamma() by tex(). As the side effect, the small letter gamma is also formatted as Gamma. That is why the comment "THIS IS UNFORTUNATE .." appears, I guess. Since function gamma() has been defined as gamma(), it may be difficult to change the function name to Gamma(). Rather, what I propose is to keep the function name as is, while the tex() function changes its behavior to format the function gamma() as \Gamma. Yasuaki Honda On 2011/02/12, at 2:08, David Ronis wrote: > Actually this looks like a bug. The behavior should be gamma for > lowercase and Gamma for upper. This works for alpha and Alpha, beta > and Beta. Gamma is the name of a built-in function, so perhaps there's > an issue here. > > David > > > On Fri, 2011-02-11 at 09:41 -0700, Robert Dodier wrote: >> OK by me to change the way tex handles gamma, >> but let's do it by simply defining the appropriate properties >> instead of by calling texput. >> >> best >> >> Robert Dodier >> >> >>> RCS file: /cvsroot/maxima/maxima/src/mactex.lisp,v >>> retrieving revision 1.74 >>> diff -r1.74 mactex.lisp >>> 469c469 >>> < (defprop %gamma "\\Gamma" texword) ; THIS IS UNFORTUNATE ... >>> --- >>>> (defprop %gamma "\\gamma" texword) ; THIS IS UNFORTUNATE ... >>> 1173a1174,1192 >>>> >>>> (eval-when (:load-toplevel :execute) >>>> (simplify >>>> (mfunction-call $texput >>>> (trd-msymeval %gamma '%gamma) >>>> (m-tlambda ($arglist) >>>> (declare (special $arglist)) >>>> ((lambda ($vx) >>>> (declare (special $vx)) >>>> (mset '((mlist (3 "tex-gamma.mac" src)) >>>> $vx) >>>> (simplify ($args $arglist))) >>>> (simplify >>>> (mfunction-call $concat >>>> '"\\Gamma\\left(" >>>> (simplify >>>> (mfunction-call $tex1 >>>> $vx)) >>>> '"\\right)"))) >>>> '$vx)))) >>>> ) >>> >>> _______________________________________________ >>> 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 robert.dodier at gmail.com Fri Feb 11 12:10:41 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 11 Feb 2011 11:10:41 -0700 Subject: [Maxima] altering tex output of derivatives? In-Reply-To: <4D54E0D8.4040705@street-artists.org> References: <4D54E0D8.4040705@street-artists.org> Message-ID: I didn't try it but maybe this has the expected effect: texput (nounify (diff), ...); HTH Robert Dodier On 2/11/11, dlakelan wrote: > I am working on deriving a partial differential equation for a physical > model. The expression is long and has partial derivatives of all sorts > of things, typesetting it by hand is a pain. I've used "texput" to > describe the tex output for all the various variables, but I want a > different format for derivatives. Specifically I want diff(a,b,1) to be > typeset as "\del{a}{b}" which is a macro defined in my LaTeX file that > automatically sets up a partial derivative for the two variables. > > I tried using texput to change the output of diff but it doesn't work: > > texconvdiff(arg) := block([a,b,c],[a,b,c]: args(arg), > concat("\\del{",tex1(a),"}{",tex1(b),"}")); > > texput(diff,texconvdiff); > > tex('diff(a,b)); <<<<< doesn't output modified derivative > notation*************** > > Instead I've set up a pattern rule to replace diff(a,b,1) with del(a,b) > and diff(a,b,2) with delsq(a,b) and then set the texput for those > functions, but I wonder why it is not possible to change the way that > maxima outputs derivatives? > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From fateman at eecs.berkeley.edu Fri Feb 11 13:51:57 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 11 Feb 2011 11:51:57 -0800 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> Message-ID: <4D55935D.3020404@eecs.berkeley.edu> On 2/11/2011 10:26 AM, Gary Pajer wrote: > > > On Fri, Feb 11, 2011 at 10:10 AM, Richard Fateman > > wrote: > > ... > It seems hopeless to point out that x>0 does not mean that > sqrt(x)>0, mathematically. > There are 2 square roots. For example sqrt(16) is {-4, 4}, even > though 16>0. > > > Perhaps that is true maxima-tically. No, there are 2 square roots of 16, mathematically. Maxima chooses one of them, 4, and thus it is not true maxima-tically that there are 2 roots. > And perhaps 16 has two real roots. There is nothing "perhaps" about it, unless you do not believe in negative numbers. S^2-16=0 defines the value(s) for S, corresponding to the square root of 16. By some obscure theorem, the so-called "fundamental theorem of algebra" there are 2 roots. > But as a mathematical *function* sqrt(16) = +4. > Nope. You mean "as a program written by one or more people, the conjunction of circumstances leads the Maxima system to return 4 when you type sqrt(16)." Your statement probably misuses at least one technical term, and maybe three. "mathematical" "function" and maybe "sqrt". The computer programming term "function" in common usage does not correspond really to the mathematical concept "function" except superficially. Why am I bothering to comment on this? Because failing to make such distinctions leads to subtle but very bad consequences, even though it may seem harmless enough for the moment. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From richhen2008 at gmail.com Fri Feb 11 14:15:51 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Fri, 11 Feb 2011 15:15:51 -0500 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: <4D55935D.3020404@eecs.berkeley.edu> References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> Message-ID: <24B41D4109CF45FDAEE63394DA8B9EF9@RichsLaptop> I don?t know why I jump in to say anything on this, but a function can have only one value. If it has more than one it is not a function, by definition of mathematical functions. So sqrt(16)=4, not 4 and ?4 too. So sqrt(-16) = 4*%i I take the positive imaginary axis as the preferred answer for completely arbitrary reasons. You know what positive imaginary means right? The part of the imaginary axis ABOVE the real axis. I say it thus because I like it better. R From: Richard Fateman Sent: Friday, February 11, 2011 2:51 PM To: Gary Pajer ; Maxima - list Subject: Re: [Maxima] sqrt(x)*sqrt(x) On 2/11/2011 10:26 AM, Gary Pajer wrote: On Fri, Feb 11, 2011 at 10:10 AM, Richard Fateman wrote: ... It seems hopeless to point out that x>0 does not mean that sqrt(x)>0, mathematically. There are 2 square roots. For example sqrt(16) is {-4, 4}, even though 16>0. Perhaps that is true maxima-tically. No, there are 2 square roots of 16, mathematically. Maxima chooses one of them, 4, and thus it is not true maxima-tically that there are 2 roots. And perhaps 16 has two real roots. There is nothing "perhaps" about it, unless you do not believe in negative numbers. S^2-16=0 defines the value(s) for S, corresponding to the square root of 16. By some obscure theorem, the so-called "fundamental theorem of algebra" there are 2 roots. But as a mathematical *function* sqrt(16) = +4. Nope. You mean "as a program written by one or more people, the conjunction of circumstances leads the Maxima system to return 4 when you type sqrt(16)." Your statement probably misuses at least one technical term, and maybe three. "mathematical" "function" and maybe "sqrt". The computer programming term "function" in common usage does not correspond really to the mathematical concept "function" except superficially. Why am I bothering to comment on this? Because failing to make such distinctions leads to subtle but very bad consequences, even though it may seem harmless enough for the moment. RJF _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From gary.pajer at gmail.com Fri Feb 11 14:47:53 2011 From: gary.pajer at gmail.com (Gary Pajer) Date: Fri, 11 Feb 2011 15:47:53 -0500 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: <4D55935D.3020404@eecs.berkeley.edu> References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> Message-ID: On Fri, Feb 11, 2011 at 2:51 PM, Richard Fateman wrote: > On 2/11/2011 10:26 AM, Gary Pajer wrote: > > > > On Fri, Feb 11, 2011 at 10:10 AM, Richard Fateman < > fateman at eecs.berkeley.edu> wrote: > >> ... >> It seems hopeless to point out that x>0 does not mean that sqrt(x)>0, >> mathematically. >> There are 2 square roots. For example sqrt(16) is {-4, 4}, even though >> 16>0. >> > > Perhaps that is true maxima-tically. > > No, there are 2 square roots of 16, mathematically. Maxima chooses one > of them, 4, > and thus it is not true maxima-tically that there are 2 roots. > > > And perhaps 16 has two real roots. > > There is nothing "perhaps" about it, unless you do not believe in negative > numbers. > > S^2-16=0 defines the value(s) for S, corresponding to the square root of > 16. > > By some obscure theorem, the so-called "fundamental theorem of algebra" > there are 2 roots. > > > But as a mathematical *function* sqrt(16) = +4. > > Nope. You mean "as a program written by one or more people, the > conjunction of > circumstances leads the Maxima system to return 4 when you type sqrt(16)." > Your > statement probably misuses at least one technical term, and maybe three. > "mathematical" "function" and maybe "sqrt". > You are probably not aware, but every response you have written has been very rude. Seek professional help. Recall that the OP specifically says that he is restricting consideration to real numbers. So for him, x<0 is not in the domain of the function he or she wants (or perhaps it's not in the domain of the function he or she expects). A real mathematical function must be single valued. To construct a proper function that we can call "square root", we choose by convention the "principle square root", the positive number. Hence in many cases we tend to write \pm\sqrt{16}, where \sqrt{16} is a positive number, but the negative of that number will work just as well for whatever we are doing. Also, it's not defined for x<0. And the OP has questions... I'll agree: the word "function" has slightly different meanings in computer science, math, maxima, and even physics. A useful response is to recognize that there can be confusion and misinterpretation, and help to straighten out the difficulties of interpretation. Sage has an alternate CAS, doesn't it? And it has lots of "rings". I wonder if sqrt has the desired/expected behavior over the ring of reals? > > The computer programming term "function" in common usage does not > correspond really to > the mathematical concept "function" except superficially. > > Why am I bothering to comment on this? > > Because failing to make such distinctions leads to > subtle but very bad consequences, even though it may seem harmless enough > for the > moment. > > RJF > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri Feb 11 15:28:36 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 11 Feb 2011 13:28:36 -0800 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> Message-ID: <4D55AA04.60007@eecs.berkeley.edu> On 2/11/2011 12:47 PM, Gary Pajer wrote: > > > On Fri, Feb 11, 2011 at 2:51 PM, Richard Fateman > > wrote: > > On 2/11/2011 10:26 AM, Gary Pajer wrote: >> >> >> On Fri, Feb 11, 2011 at 10:10 AM, Richard Fateman >> > wrote: >> >> ... >> It seems hopeless to point out that x>0 does not mean that >> sqrt(x)>0, mathematically. >> There are 2 square roots. For example sqrt(16) is {-4, 4}, >> even though 16>0. >> >> >> Perhaps that is true maxima-tically. > No, there are 2 square roots of 16, mathematically. Maxima > chooses one of them, 4, > and thus it is not true maxima-tically that there are 2 roots. > > >> And perhaps 16 has two real roots. > There is nothing "perhaps" about it, unless you do not believe in > negative numbers. > > S^2-16=0 defines the value(s) for S, corresponding to the square > root of 16. > > By some obscure theorem, the so-called "fundamental theorem of > algebra" there are 2 roots. > > >> But as a mathematical *function* sqrt(16) = +4. >> > Nope. You mean "as a program written by one or more people, the > conjunction of > circumstances leads the Maxima system to return 4 when you type > sqrt(16)." Your > statement probably misuses at least one technical term, and maybe > three. > "mathematical" "function" and maybe "sqrt". > > > > > You are probably not aware, but every response you have written has > been very rude. Seek professional help. Very rude? I would have thought merely somewhat rude, perhaps abrupt. > > Recall that the OP specifically says that he is restricting > consideration to real numbers. Well, that is in the OP's mind. There is no convenient way of telling Maxima that it should consider only real numbers. I suppose one could go through the system and every place it might consider generating a complex or imaginary constant that it should produce an error message. This would still not make the system halt when it was, in some sense, considering results that MIGHT not be real, but MIGHT not be. for example, in solving a quadratic a*x^2+b*x+c, the solve program would have to consider the sign of b^2-4*a*c. Given that a,b,c are unknown, it is not possible to tell if this quadratic has real roots or not. Therefore how can one instruct Maxima to "restrict your consideration to real numbers"? > So for him, x<0 is not in the domain of the function he or she wants > (or perhaps it's not in the domain of the function he or she expects). Well, then that is a consideration that he (or she) must impose in some other fashion than saying assume(x>0). > > A real mathematical function must be single valued. That would be part of the usual definition. There's usually a domain and range. > To construct a proper function that we can call "square root", we > choose by convention the "principle square root", the positive number. Sure. That defines sqrt of a particular non-negative real. It does not deal with sqrt(). Since Maxima allows one to type sqrt(x^2-1) and manipulate it, what is the relationship of that expression with the sqrt function from R+ to R+? > Hence in many cases we tend to write \pm\sqrt{16}, where \sqrt{16} > is a positive number, but the negative of that number will work just > as well for whatever we are doing. Also, it's not defined for x<0. Most people beyond high school would find the extension of sqrt to negative numbers to be unremarkable, and useful. Without extending sqrt to symbols, a computer algebra system would be fairly weak. > And the OP has questions... > > I'll agree: the word "function" has slightly different meanings in > computer science, math, maxima, and even physics. Quite different. to a Fortran programmer, a function is a subroutine that returns a value. To a "functional programming" fan, it means something else. > A useful response is to recognize that there can be confusion and > misinterpretation, and help to straighten out the difficulties of > interpretation. Well, there are at least 2 ways of doing that. 1. Fixing the program to do the right thing, if that can be determined. 2. Educating the user so that he/she can understand how to pose his/her question in an unambiguous fashion. > > Sage has an alternate CAS, doesn't it? Actually, it calls Maxima for bunches of things. > And it has lots of "rings". Some of the other systems Sage also includes are more specific about algebraic structures, yes. > I wonder if sqrt has the desired/expected behavior over the ring of > reals? Well, the reals form a FIELD not a RING. They are also, in general, not computable. We could talk about the field of rational numbers, perhaps more explicitly. Or the representable floating point numbers, but they are not quite a field. And what Sage does, I think, is punt to whatever semantics are available in the programs that it calls, and that means that it is difficult to assign particular meanings to some of its answers, even apparently easy ones. Like is there a difference between 2 and 2/1 ? Yes, if one is an integer and the other is a rational. But that is not the issue here. sqrt(x^2-1) is not sqrt of a real. Even if x is declared to be real, x^2-1 is still an expression in the indeterminate x, and IS NOT A REAL. For example one could ask here, if sqrt(x^2-1) = sqrt(x-1)*sqrt(x+1) ? Sometimes? Always? how does assume(x>0) affect this, if at all? > > > > The computer programming term "function" in common usage does not > correspond really to > the mathematical concept "function" except superficially. > > Why am I bothering to comment on this? > > Because failing to make such distinctions leads to > subtle but very bad consequences, even though it may seem harmless > enough for the > moment. > Again. > > > 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 richhen2008 at gmail.com Fri Feb 11 15:59:44 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Fri, 11 Feb 2011 16:59:44 -0500 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: <4D55AA04.60007@eecs.berkeley.edu> References: <20110210075019.58470@gmx.net><4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> <4D55AA04.60007@eecs.berkeley.edu> Message-ID: ?There is no convenient way of telling Maxima that it should consider only real numbers . . .? Inconvenience is not an excuse. On a related issue. It is complete inexcusable that Maxima does not know that integrate(x,x) = x^2/2+C. Maxima always forgets to add the C. I can live with it working that way. Rich From: Richard Fateman Sent: Friday, February 11, 2011 4:28 PM To: Gary Pajer Cc: Maxima - list Subject: Re: [Maxima] sqrt(x)*sqrt(x) On 2/11/2011 12:47 PM, Gary Pajer wrote: On Fri, Feb 11, 2011 at 2:51 PM, Richard Fateman wrote: On 2/11/2011 10:26 AM, Gary Pajer wrote: On Fri, Feb 11, 2011 at 10:10 AM, Richard Fateman wrote: ... It seems hopeless to point out that x>0 does not mean that sqrt(x)>0, mathematically. There are 2 square roots. For example sqrt(16) is {-4, 4}, even though 16>0. Perhaps that is true maxima-tically. No, there are 2 square roots of 16, mathematically. Maxima chooses one of them, 4, and thus it is not true maxima-tically that there are 2 roots. And perhaps 16 has two real roots. There is nothing "perhaps" about it, unless you do not believe in negative numbers. S^2-16=0 defines the value(s) for S, corresponding to the square root of 16. By some obscure theorem, the so-called "fundamental theorem of algebra" there are 2 roots. But as a mathematical *function* sqrt(16) = +4. Nope. You mean "as a program written by one or more people, the conjunction of circumstances leads the Maxima system to return 4 when you type sqrt(16)." Your statement probably misuses at least one technical term, and maybe three. "mathematical" "function" and maybe "sqrt". You are probably not aware, but every response you have written has been very rude. Seek professional help. Very rude? I would have thought merely somewhat rude, perhaps abrupt. Recall that the OP specifically says that he is restricting consideration to real numbers. Well, that is in the OP's mind. There is no convenient way of telling Maxima that it should consider only real numbers. I suppose one could go through the system and every place it might consider generating a complex or imaginary constant that it should produce an error message. This would still not make the system halt when it was, in some sense, considering results that MIGHT not be real, but MIGHT not be. for example, in solving a quadratic a*x^2+b*x+c, the solve program would have to consider the sign of b^2-4*a*c. Given that a,b,c are unknown, it is not possible to tell if this quadratic has real roots or not. Therefore how can one instruct Maxima to "restrict your consideration to real numbers"? So for him, x<0 is not in the domain of the function he or she wants (or perhaps it's not in the domain of the function he or she expects). Well, then that is a consideration that he (or she) must impose in some other fashion than saying assume(x>0). A real mathematical function must be single valued. That would be part of the usual definition. There's usually a domain and range. To construct a proper function that we can call "square root", we choose by convention the "principle square root", the positive number. Sure. That defines sqrt of a particular non-negative real. It does not deal with sqrt(). Since Maxima allows one to type sqrt(x^2-1) and manipulate it, what is the relationship of that expression with the sqrt function from R+ to R+? Hence in many cases we tend to write \pm\sqrt{16}, where \sqrt{16} is a positive number, but the negative of that number will work just as well for whatever we are doing. Also, it's not defined for x<0. Most people beyond high school would find the extension of sqrt to negative numbers to be unremarkable, and useful. Without extending sqrt to symbols, a computer algebra system would be fairly weak. And the OP has questions... I'll agree: the word "function" has slightly different meanings in computer science, math, maxima, and even physics. Quite different. to a Fortran programmer, a function is a subroutine that returns a value. To a "functional programming" fan, it means something else. A useful response is to recognize that there can be confusion and misinterpretation, and help to straighten out the difficulties of interpretation. Well, there are at least 2 ways of doing that. 1. Fixing the program to do the right thing, if that can be determined. 2. Educating the user so that he/she can understand how to pose his/her question in an unambiguous fashion. Sage has an alternate CAS, doesn't it? Actually, it calls Maxima for bunches of things. And it has lots of "rings". Some of the other systems Sage also includes are more specific about algebraic structures, yes. I wonder if sqrt has the desired/expected behavior over the ring of reals? Well, the reals form a FIELD not a RING. They are also, in general, not computable. We could talk about the field of rational numbers, perhaps more explicitly. Or the representable floating point numbers, but they are not quite a field. And what Sage does, I think, is punt to whatever semantics are available in the programs that it calls, and that means that it is difficult to assign particular meanings to some of its answers, even apparently easy ones. Like is there a difference between 2 and 2/1 ? Yes, if one is an integer and the other is a rational. But that is not the issue here. sqrt(x^2-1) is not sqrt of a real. Even if x is declared to be real, x^2-1 is still an expression in the indeterminate x, and IS NOT A REAL. For example one could ask here, if sqrt(x^2-1) = sqrt(x-1)*sqrt(x+1) ? Sometimes? Always? how does assume(x>0) affect this, if at all? The computer programming term "function" in common usage does not correspond really to the mathematical concept "function" except superficially. Why am I bothering to comment on this? Because failing to make such distinctions leads to subtle but very bad consequences, even though it may seem harmless enough for the moment. Again. RJF _______________________________________________ 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 willisb at unk.edu Fri Feb 11 16:47:23 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 11 Feb 2011 16:47:23 -0600 Subject: [Maxima] constants of integration (was Re: sqrt(x)*sqrt(x)) In-Reply-To: References: <20110210075019.58470@gmx.net><4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> <4D55AA04.60007@eecs.berkeley.edu>, Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >?Maxima?does?not?know?that?integrate(x,x)?=?x^2/2+C.?? There is an obscure way to get a constant of integration, but it's not all that useful or robust, I think: (%i1) integrate(x = 1,x); (%o1) x^2/2=x+%c1 Bugs: (%i2) integrate(%c2 = 1,%c2); (%o2) %c2^2/2=2*%c2 (%i3) integrate(x = 0,x); (%o3) x^2/2=%c3+integrate(0,x) (%i4) expand(%,0,0); (%o4) x^2/2=%c3 --Barton From richhen2008 at gmail.com Fri Feb 11 16:48:55 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Fri, 11 Feb 2011 17:48:55 -0500 Subject: [Maxima] sqrt(x)*sqrt(x) Message-ID: <0FA4BAE7F1164EDCBCA717C806CF33D7@RichsLaptop> ?There is no convenient way of telling Maxima that it should consider only real numbers . . .? Inconvenience is not an excuse. On a related issue. It is complete inexcusable that Maxima does not know that integrate(x,x) = x^2/2+C. Maxima always forgets to add the C. I can live with it working that way. Rich From: Richard Fateman Sent: Friday, February 11, 2011 4:28 PM To: Gary Pajer Cc: Maxima - list Subject: Re: [Maxima] sqrt(x)*sqrt(x) On 2/11/2011 12:47 PM, Gary Pajer wrote: On Fri, Feb 11, 2011 at 2:51 PM, Richard Fateman wrote: On 2/11/2011 10:26 AM, Gary Pajer wrote: On Fri, Feb 11, 2011 at 10:10 AM, Richard Fateman wrote: ... It seems hopeless to point out that x>0 does not mean that sqrt(x)>0, mathematically. There are 2 square roots. For example sqrt(16) is {-4, 4}, even though 16>0. Perhaps that is true maxima-tically. No, there are 2 square roots of 16, mathematically. Maxima chooses one of them, 4, and thus it is not true maxima-tically that there are 2 roots. And perhaps 16 has two real roots. There is nothing "perhaps" about it, unless you do not believe in negative numbers. S^2-16=0 defines the value(s) for S, corresponding to the square root of 16. By some obscure theorem, the so-called "fundamental theorem of algebra" there are 2 roots. But as a mathematical *function* sqrt(16) = +4. Nope. You mean "as a program written by one or more people, the conjunction of circumstances leads the Maxima system to return 4 when you type sqrt(16)." Your statement probably misuses at least one technical term, and maybe three. "mathematical" "function" and maybe "sqrt". You are probably not aware, but every response you have written has been very rude. Seek professional help. Very rude? I would have thought merely somewhat rude, perhaps abrupt. Recall that the OP specifically says that he is restricting consideration to real numbers. Well, that is in the OP's mind. There is no convenient way of telling Maxima that it should consider only real numbers. I suppose one could go through the system and every place it might consider generating a complex or imaginary constant that it should produce an error message. This would still not make the system halt when it was, in some sense, considering results that MIGHT not be real, but MIGHT not be. for example, in solving a quadratic a*x^2+b*x+c, the solve program would have to consider the sign of b^2-4*a*c. Given that a,b,c are unknown, it is not possible to tell if this quadratic has real roots or not. Therefore how can one instruct Maxima to "restrict your consideration to real numbers"? So for him, x<0 is not in the domain of the function he or she wants (or perhaps it's not in the domain of the function he or she expects). Well, then that is a consideration that he (or she) must impose in some other fashion than saying assume(x>0). A real mathematical function must be single valued. That would be part of the usual definition. There's usually a domain and range. To construct a proper function that we can call "square root", we choose by convention the "principle square root", the positive number. Sure. That defines sqrt of a particular non-negative real. It does not deal with sqrt(). Since Maxima allows one to type sqrt(x^2-1) and manipulate it, what is the relationship of that expression with the sqrt function from R+ to R+? Hence in many cases we tend to write \pm\sqrt{16}, where \sqrt{16} is a positive number, but the negative of that number will work just as well for whatever we are doing. Also, it's not defined for x<0. Most people beyond high school would find the extension of sqrt to negative numbers to be unremarkable, and useful. Without extending sqrt to symbols, a computer algebra system would be fairly weak. And the OP has questions... I'll agree: the word "function" has slightly different meanings in computer science, math, maxima, and even physics. Quite different. to a Fortran programmer, a function is a subroutine that returns a value. To a "functional programming" fan, it means something else. A useful response is to recognize that there can be confusion and misinterpretation, and help to straighten out the difficulties of interpretation. Well, there are at least 2 ways of doing that. 1. Fixing the program to do the right thing, if that can be determined. 2. Educating the user so that he/she can understand how to pose his/her question in an unambiguous fashion. Sage has an alternate CAS, doesn't it? Actually, it calls Maxima for bunches of things. And it has lots of "rings". Some of the other systems Sage also includes are more specific about algebraic structures, yes. I wonder if sqrt has the desired/expected behavior over the ring of reals? Well, the reals form a FIELD not a RING. They are also, in general, not computable. We could talk about the field of rational numbers, perhaps more explicitly. Or the representable floating point numbers, but they are not quite a field. And what Sage does, I think, is punt to whatever semantics are available in the programs that it calls, and that means that it is difficult to assign particular meanings to some of its answers, even apparently easy ones. Like is there a difference between 2 and 2/1 ? Yes, if one is an integer and the other is a rational. But that is not the issue here. sqrt(x^2-1) is not sqrt of a real. Even if x is declared to be real, x^2-1 is still an expression in the indeterminate x, and IS NOT A REAL. For example one could ask here, if sqrt(x^2-1) = sqrt(x-1)*sqrt(x+1) ? Sometimes? Always? how does assume(x>0) affect this, if at all? The computer programming term "function" in common usage does not correspond really to the mathematical concept "function" except superficially. Why am I bothering to comment on this? Because failing to make such distinctions leads to subtle but very bad consequences, even though it may seem harmless enough for the moment. Again. RJF _______________________________________________ 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 richhen2008 at gmail.com Fri Feb 11 17:01:51 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Fri, 11 Feb 2011 18:01:51 -0500 Subject: [Maxima] constants of integration (was Re: sqrt(x)*sqrt(x)) In-Reply-To: References: <20110210075019.58470@gmx.net><4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu><4D55AA04.60007@eecs.berkeley.edu>, Message-ID: I don't think this is a good way to do it. If I need the c, I add it to the answer with %+c. If there is more than one integration I would make up a new name for each constant. I don't know how hard it would be to fix, but it is a Maxima quirk that fell between the cracks somehow. I don't know the history, was there ever a conscious decision to drop the + C? I don't know. Rich -----Original Message----- From: Barton Willis Sent: Friday, February 11, 2011 5:47 PM To: Rich Hennessy Cc: Maxima List Subject: constants of integration (was Re: [Maxima] sqrt(x)*sqrt(x)) -----maxima-bounces at math.utexas.edu wrote: ----- > Maxima does not know that integrate(x,x) = x^2/2+C. There is an obscure way to get a constant of integration, but it's not all that useful or robust, I think: (%i1) integrate(x = 1,x); (%o1) x^2/2=x+%c1 Bugs: (%i2) integrate(%c2 = 1,%c2); (%o2) %c2^2/2=2*%c2 (%i3) integrate(x = 0,x); (%o3) x^2/2=%c3+integrate(0,x) (%i4) expand(%,0,0); (%o4) x^2/2=%c3 --Barton From talon at lpthe.jussieu.fr Fri Feb 11 17:41:07 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sat, 12 Feb 2011 00:41:07 +0100 Subject: [Maxima] sqrt(x)*sqrt(x) References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> <24B41D4109CF45FDAEE63394DA8B9EF9@RichsLaptop> Message-ID: Rich Hennessy wrote: > I don?t know why I jump in to say anything on this, but a function can > have > only one value. If it has more than one it is not a function, by > definition > of mathematical functions. So sqrt(16)=4, not 4 and ?4 too. > > So sqrt(-16) = 4*%i > > I take the positive imaginary axis as the preferred answer for completely > arbitrary reasons. You know what positive imaginary means right? The > part > of the imaginary axis ABOVE the real axis. I say it thus because I like > it better. > Rich, i must say i agree completely with prof Fateman discussion on this point and thus disagree with you. The notion of a function having just one value on a given domain to a given range is certainly the notion commonly used in elementary courses, but so-called multivalued functions have been used continuously by most great mathematicians since at least 19^th century up to now, particularly in algebraic geometry. For example sqrt(-16) is 4*%i if you continue analytically from sqrt(16)=4 through the upper half plane, but -4*%i if you continue through the lower half plane. It jumps abruptly on the (x<0) axis. Since in a CAS when you consider a square root, it is generally the square root of some complicated expression of x it is basically impossible to enforce the rules that students learn in elementary courses. To reconcile single valuedness and the obvious multivaluedness of the sqrt, one considers "Riemann surfaces" where basically you duplicate the x plane into two planes touching at 0 and infinity. So a point in this surface is a couple (x ,sqrt(x)), and (x, -sqrt(x)) is another point. Now you can define a single valued sqrt on *that surface* which is simply the projection (x,sqrt(x)) -> sqrt(x). This is a bona fide function in the Bourbaki sense, or in the elementary school sense. The other projection (x,sqrt(x)) -> x is called a branched covering of the complex plane. Whether this sort of ratiocination is able to clarify your objection, i don't know, but basically Fateman's argument that a degree N equation has N roots is all that is really to understand. By analytic continuation in parameters of the polynomial these roots exchange (this is related to Galois theory) so there is no way for a CAS to really distinguish them. In particular, as Fateman says, this rule of elementary school sqrt(x^2)=abs(x) which is true for x real, is false when you go to complex x. I would be much happier with sqrt(x^2)=x which is always true, provided you understand that sqrt has two values and you have expressed one of them. -- Michel Talon From gary.pajer at gmail.com Fri Feb 11 18:03:00 2011 From: gary.pajer at gmail.com (Gary Pajer) Date: Fri, 11 Feb 2011 19:03:00 -0500 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> <24B41D4109CF45FDAEE63394DA8B9EF9@RichsLaptop> Message-ID: On Fri, Feb 11, 2011 at 6:41 PM, Michel Talon wrote: > Rich Hennessy wrote: > > > I don?t know why I jump in to say anything on this, but a function can > > have > > only one value. If it has more than one it is not a function, by > > definition > > of mathematical functions. So sqrt(16)=4, not 4 and ?4 too. > > > > So sqrt(-16) = 4*%i > > > > I take the positive imaginary axis as the preferred answer for completely > > arbitrary reasons. You know what positive imaginary means right? The > > part > > of the imaginary axis ABOVE the real axis. I say it thus because I like > > it better. > > > > > Rich, i must say i agree completely with prof Fateman discussion on this > point and thus disagree with you. The notion of a function having just one > value on a given domain to a given range is certainly the notion commonly > used in elementary courses, but so-called multivalued functions have been > used continuously by most great mathematicians since at least 19^th century > up to now, particularly in algebraic geometry. For example sqrt(-16) is > 4*%i if you continue analytically from sqrt(16)=4 through the upper half > plane, but -4*%i if you continue through the lower half plane. It jumps > abruptly on the (x<0) axis. Since in a CAS when you consider a square root, > it is generally the square root of some complicated expression of x it is > basically impossible to enforce the rules that students learn in elementary > courses. To reconcile single valuedness and the obvious multivaluedness of > the sqrt, one considers "Riemann surfaces" where basically you duplicate > the x plane into two planes touching at 0 and infinity. So a point in this > surface is a couple (x ,sqrt(x)), and (x, -sqrt(x)) is another point. > Now you can define a single valued sqrt on *that surface* which is simply > the projection (x,sqrt(x)) -> sqrt(x). This is a bona fide function in the > Bourbaki sense, or in the elementary school sense. The other projection > (x,sqrt(x)) -> x is called a branched covering of the complex plane. > Whether > this sort of ratiocination is able to clarify your objection, i don't know, > but basically Fateman's argument that a degree N equation has N roots is > all that is really to understand. By analytic continuation in parameters of > the polynomial these roots exchange (this is related to Galois theory) so > there is no way for a CAS to really distinguish them. In particular, as > Fateman says, this rule of elementary school sqrt(x^2)=abs(x) which is true > for x real, is false when you go to complex x. I would be much happier > with sqrt(x^2)=x which is always true, provided you understand that sqrt > has > two values and you have expressed one of them. > > > -- > Michel Talon > I think we can all accept that. The semantic question comes up in a practical discussion: What do you expect your CAS system to do? sqrt(16) = 4 or {4, -4} ? sqrt(-16) = #error# or +4%i or -4% ? ... and I admit that I lost sight of the question of symbolic manipulations, at which point I stopped thinking about it. I'm sure this is all worked out in some consistent way in maxima. One needs to RTFM or ask on the forum, and accept the answer. Don't we have better things to discuss, like revolution in Egypt or basketball losing streaks? Bye for now! -gary -------------- next part -------------- An HTML attachment was scrubbed... URL: From richhen2008 at gmail.com Fri Feb 11 18:23:19 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Fri, 11 Feb 2011 19:23:19 -0500 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu><4D55935D.3020404@eecs.berkeley.edu><24B41D4109CF45FDAEE63394DA8B9EF9@RichsLaptop> Message-ID: <15E38587182449238A9249B242FABCBD@RichsLaptop> I am a computer programmer, not a mathematician. I know one simple fact. In school I am taking a programming course right now so let's put it in this light. x=sqrt(-16); The computer will not let you put in two values for x. I x is a floating point register then it just will not fit. You can have structures in computer science that can hold a complex number so I can handle the idea that x=sqrt(-16) yields an x with two parts. x.realpart, x.imagpart. This is sort of like a record. In practical terms you can't have two physical values in the same place. It is a law of physics that complex numbers cannot be the result of any measurement. Even in quantum mechanics you have a complex wave form, but only when you take the conjugate(psi)*psi do you get something that can be called a possible result of a measurement, because the answer must be real. Maybe in some abstract sense mathematicians feel that complex numbers are just as real as real numbers. I don't know much about that. I do know that you can't put a square peg in round hole. I also know that all of this is moot when you have things like this. assume(x>0)$ x:-16$ sqrt(x); [-4*%i, 4*%i] At least be consistent. Maxima should spit out an error when it see's that x is -16 in line 2. But what happens when you try this, nothing. Maxima ignores it's inputs and does one thing. There is no way you can choose among two different results when you allow contradictions to squeak through without any complaints. Math is supposed to be based on axioms. This is not math, if it was the above might be okay for some people. This is computer science though. In computer science you want facts, not arbitrary rules and arguments that can be tailored to fit just about any proposed hypothesis. I never call myself a mathematician because of this. I am a computer science major. If I get my way I would be a computer scientist. I believe in science, which is based on facts. Math is just conjecture that sometimes coincides with reality, sometime not. So you have to pick one or the other, there is no third possibility. I challenge you to find a third possibility that can actually work and make sense too. Rich -----Original Message----- From: Michel Talon Sent: Friday, February 11, 2011 6:41 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] sqrt(x)*sqrt(x) Rich Hennessy wrote: > I don?t know why I jump in to say anything on this, but a function can > have > only one value. If it has more than one it is not a function, by > definition > of mathematical functions. So sqrt(16)=4, not 4 and ?4 too. > > So sqrt(-16) = 4*%i > > I take the positive imaginary axis as the preferred answer for completely > arbitrary reasons. You know what positive imaginary means right? The > part > of the imaginary axis ABOVE the real axis. I say it thus because I like > it better. > Rich, i must say i agree completely with prof Fateman discussion on this point and thus disagree with you. The notion of a function having just one value on a given domain to a given range is certainly the notion commonly used in elementary courses, but so-called multivalued functions have been used continuously by most great mathematicians since at least 19^th century up to now, particularly in algebraic geometry. For example sqrt(-16) is 4*%i if you continue analytically from sqrt(16)=4 through the upper half plane, but -4*%i if you continue through the lower half plane. It jumps abruptly on the (x<0) axis. Since in a CAS when you consider a square root, it is generally the square root of some complicated expression of x it is basically impossible to enforce the rules that students learn in elementary courses. To reconcile single valuedness and the obvious multivaluedness of the sqrt, one considers "Riemann surfaces" where basically you duplicate the x plane into two planes touching at 0 and infinity. So a point in this surface is a couple (x ,sqrt(x)), and (x, -sqrt(x)) is another point. Now you can define a single valued sqrt on *that surface* which is simply the projection (x,sqrt(x)) -> sqrt(x). This is a bona fide function in the Bourbaki sense, or in the elementary school sense. The other projection (x,sqrt(x)) -> x is called a branched covering of the complex plane. Whether this sort of ratiocination is able to clarify your objection, i don't know, but basically Fateman's argument that a degree N equation has N roots is all that is really to understand. By analytic continuation in parameters of the polynomial these roots exchange (this is related to Galois theory) so there is no way for a CAS to really distinguish them. In particular, as Fateman says, this rule of elementary school sqrt(x^2)=abs(x) which is true for x real, is false when you go to complex x. I would be much happier with sqrt(x^2)=x which is always true, provided you understand that sqrt has two values and you have expressed one of them. -- Michel Talon _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From richhen2008 at gmail.com Fri Feb 11 18:30:34 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Fri, 11 Feb 2011 19:30:34 -0500 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: <15E38587182449238A9249B242FABCBD@RichsLaptop> References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu><4D55935D.3020404@eecs.berkeley.edu><24B41D4109CF45FDAEE63394DA8B9EF9@RichsLaptop> <15E38587182449238A9249B242FABCBD@RichsLaptop> Message-ID: <90872584872144C3BDF1408E6DDBB2F9@RichsLaptop> To put it another way, I am afraid I completely disagree with both of you. -----Original Message----- From: Rich Hennessy Sent: Friday, February 11, 2011 7:23 PM To: maxima at math.utexas.edu ; Michel Talon Subject: Re: [Maxima] sqrt(x)*sqrt(x) I am a computer programmer, not a mathematician. I know one simple fact. In school I am taking a programming course right now so let's put it in this light. x=sqrt(-16); The computer will not let you put in two values for x. I x is a floating point register then it just will not fit. You can have structures in computer science that can hold a complex number so I can handle the idea that x=sqrt(-16) yields an x with two parts. x.realpart, x.imagpart. This is sort of like a record. In practical terms you can't have two physical values in the same place. It is a law of physics that complex numbers cannot be the result of any measurement. Even in quantum mechanics you have a complex wave form, but only when you take the conjugate(psi)*psi do you get something that can be called a possible result of a measurement, because the answer must be real. Maybe in some abstract sense mathematicians feel that complex numbers are just as real as real numbers. I don't know much about that. I do know that you can't put a square peg in round hole. I also know that all of this is moot when you have things like this. assume(x>0)$ x:-16$ sqrt(x); [-4*%i, 4*%i] At least be consistent. Maxima should spit out an error when it see's that x is -16 in line 2. But what happens when you try this, nothing. Maxima ignores it's inputs and does one thing. There is no way you can choose among two different results when you allow contradictions to squeak through without any complaints. Math is supposed to be based on axioms. This is not math, if it was the above might be okay for some people. This is computer science though. In computer science you want facts, not arbitrary rules and arguments that can be tailored to fit just about any proposed hypothesis. I never call myself a mathematician because of this. I am a computer science major. If I get my way I would be a computer scientist. I believe in science, which is based on facts. Math is just conjecture that sometimes coincides with reality, sometime not. So you have to pick one or the other, there is no third possibility. I challenge you to find a third possibility that can actually work and make sense too. Rich -----Original Message----- From: Michel Talon Sent: Friday, February 11, 2011 6:41 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] sqrt(x)*sqrt(x) Rich Hennessy wrote: > I don?t know why I jump in to say anything on this, but a function can > have > only one value. If it has more than one it is not a function, by > definition > of mathematical functions. So sqrt(16)=4, not 4 and ?4 too. > > So sqrt(-16) = 4*%i > > I take the positive imaginary axis as the preferred answer for completely > arbitrary reasons. You know what positive imaginary means right? The > part > of the imaginary axis ABOVE the real axis. I say it thus because I like > it better. > Rich, i must say i agree completely with prof Fateman discussion on this point and thus disagree with you. The notion of a function having just one value on a given domain to a given range is certainly the notion commonly used in elementary courses, but so-called multivalued functions have been used continuously by most great mathematicians since at least 19^th century up to now, particularly in algebraic geometry. For example sqrt(-16) is 4*%i if you continue analytically from sqrt(16)=4 through the upper half plane, but -4*%i if you continue through the lower half plane. It jumps abruptly on the (x<0) axis. Since in a CAS when you consider a square root, it is generally the square root of some complicated expression of x it is basically impossible to enforce the rules that students learn in elementary courses. To reconcile single valuedness and the obvious multivaluedness of the sqrt, one considers "Riemann surfaces" where basically you duplicate the x plane into two planes touching at 0 and infinity. So a point in this surface is a couple (x ,sqrt(x)), and (x, -sqrt(x)) is another point. Now you can define a single valued sqrt on *that surface* which is simply the projection (x,sqrt(x)) -> sqrt(x). This is a bona fide function in the Bourbaki sense, or in the elementary school sense. The other projection (x,sqrt(x)) -> x is called a branched covering of the complex plane. Whether this sort of ratiocination is able to clarify your objection, i don't know, but basically Fateman's argument that a degree N equation has N roots is all that is really to understand. By analytic continuation in parameters of the polynomial these roots exchange (this is related to Galois theory) so there is no way for a CAS to really distinguish them. In particular, as Fateman says, this rule of elementary school sqrt(x^2)=abs(x) which is true for x real, is false when you go to complex x. I would be much happier with sqrt(x^2)=x which is always true, provided you understand that sqrt has two values and you have expressed one of them. -- Michel Talon _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From dbmaxima at gmail.com Fri Feb 11 18:54:15 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Sat, 12 Feb 2011 11:54:15 +1100 Subject: [Maxima] pattern matching / lookup integration (was Re: integration using z =tan(x/2) sub) In-Reply-To: References: <20110210203005.13690abnhi7teeog@www.staffmail.ed.ac.uk> , <4D54D468.1050609@unicaen.fr> Message-ID: <4D55DA37.6090604@gmail.com> On 11/02/2011 11:14 PM, Barton Willis wrote: > I sometimes wonder if a purely pattern matching / lookup integration would be superior to what we have; for > examplehttp://www.apmaths.uwo.ca/~arich/ . > > --Barton Yes. I think this would be a good project. I looked at Richard Fateman's TILU code. I did get parts of it working under CLISP but my lisp-fu was inadequate. I was thinking along the lines of: * using the TILU integral database (and seeing if there were others we could steal^H^H^H^H use). * using maxima infrastructure - simplifiers, pattern matchers, etc * writing new hash / lookup code using the TILU algorithms but my lisp-fu was inadequate. If we could get it working then adding new integrals to the database would be quite simple. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Fri Feb 11 18:57:35 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sat, 12 Feb 2011 00:57:35 +0000 Subject: [Maxima] constants of integration (was Re: sqrt(x)*sqrt(x)) References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> <4D55AA04.60007@eecs.berkeley.edu> Message-ID: "Rich Hennessy" writes: > I don't think this is a good way to do it. If I need the c, I add it > to the answer with %+c. If there is more than one integration I > would make up a new name for each constant. I don't know how hard it > would be to fix, but it is a Maxima quirk that fell between the cracks > somehow. I don't know the history, was there ever a conscious > decision to drop the + C? I don't know. > > Rich AAAARGH! I think before you continue this line of discussion you should make sure that you're very certain you know what you mean by "an integral". I presume that maxima attempts to return an antiderivative when called to do indefinite integration. For example, an antiderivative of cos(x) is sin(x). So is sin(x)+2 and sin(x)+3. But I don't really understand what makes you think that maxima should return "sin(x)+c". Maybe you could explain what you're trying to do, mathematically? I think you might be confused. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From smh at franz.com Fri Feb 11 20:37:10 2011 From: smh at franz.com (Steve Haflich) Date: Fri, 11 Feb 2011 18:37:10 -0800 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> <24B41D4109CF45FDAEE63394DA8B9EF9@RichsLaptop> Message-ID: <30075.1297478230@gemini.franz.com> Gary Pajer wrote: Don't we have better things to discuss, like revolution in Egypt or basketball losing streaks?? Bye for now! But to keep discussion within the realm of Maxima, I was intrigued with Richard's earlier comment: "It depends on whether you believe in negative numbers." Richard: Do you really think it might be practical to disbelieve negative numbers? That belief would obviously simplify and unclutter huge swaths of the Maxima implementation. Indeed, it would also simplify and unclutter huge swaths of mathematics itself, at least those small parts of mathematics that would remain. I need to think more deeply about this notion. From richhen2008 at gmail.com Fri Feb 11 22:23:38 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Fri, 11 Feb 2011 23:23:38 -0500 Subject: [Maxima] coolest identity competition WAS sqrt(x)*sqrt(x) In-Reply-To: <30075.1297478230@gemini.franz.com> References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu><4D55935D.3020404@eecs.berkeley.edu><24B41D4109CF45FDAEE63394DA8B9EF9@RichsLaptop> <30075.1297478230@gemini.franz.com> Message-ID: <42B8B7CB8D374E2AA5E5DE2165CF2B1F@RichsLaptop> Maybe we should have a coolest identity competition. I have one that I like. It comes from pw.mac. I worked it out one day and it's enshrined in pw.mac. I know it is lame but at least I can follow it. I can usually follow stuff I think of myself. between(x, a, b) = ((signum(b - a) + 1) * unit_pulse(x/(b-a) + a/(a-b)))/2 That is really lame because you have to know that between() is 1 when x >= a or x <= b and zero otherwise. unit_pulse(x) is 1 from 0 to 1 and 0 everywhere else. Well, I like it. Rvh -----Original Message----- From: Steve Haflich Sent: Friday, February 11, 2011 9:37 PM To: Gary Pajer Cc: maxima at math.utexas.edu ; Michel Talon Subject: Re: [Maxima] sqrt(x)*sqrt(x) Gary Pajer wrote: Don't we have better things to discuss, like revolution in Egypt or basketball losing streaks? Bye for now! But to keep discussion within the realm of Maxima, I was intrigued with Richard's earlier comment: "It depends on whether you believe in negative numbers." Richard: Do you really think it might be practical to disbelieve negative numbers? That belief would obviously simplify and unclutter huge swaths of the Maxima implementation. Indeed, it would also simplify and unclutter huge swaths of mathematics itself, at least those small parts of mathematics that would remain. I need to think more deeply about this notion. _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From toy.raymond at gmail.com Fri Feb 11 22:30:51 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 11 Feb 2011 23:30:51 -0500 Subject: [Maxima] Constant of integration (Was Re: sqrt(x)*sqrt(x)) In-Reply-To: <0FA4BAE7F1164EDCBCA717C806CF33D7@RichsLaptop> References: <0FA4BAE7F1164EDCBCA717C806CF33D7@RichsLaptop> Message-ID: <4D560CFB.6050906@gmail.com> On 2/11/11 5:48 PM, Rich Hennessy wrote: > ?There is no convenient way of telling Maxima that it should consider > only real numbers . . .? > > Inconvenience is not an excuse. On a related issue. It is complete > inexcusable that Maxima does Sure it is. It's inconvenient for you to fix the things you don't like because it's inconvenient for you to learn the necessary stuff to do it. Well, that's the excuse I use, anyway. Works for me. :-) > not know that integrate(x,x) = x^2/2+C. Maxima always forgets to add > the C. > Why is this important? Does any other CAS do that? No table of integrals I know of does this. I vaguely remember it being mentioned in high school calculus, but I don't think we were expected to answer every integration question with a + C term added. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From richhen2008 at gmail.com Sat Feb 12 01:13:07 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Sat, 12 Feb 2011 02:13:07 -0500 Subject: [Maxima] Constant of integration (Was Re: sqrt(x)*sqrt(x)) In-Reply-To: <4D560CFB.6050906@gmail.com> References: <0FA4BAE7F1164EDCBCA717C806CF33D7@RichsLaptop> <4D560CFB.6050906@gmail.com> Message-ID: <307C69CFF401406DB0A7C42A5FD83DCB@RichsLaptop> Well, you are right. I am the same way. I don?t know Lisp so I would have a very hard time fixing anything that I see as wrong with Maxima. I can extend it with Maxima code, but that is as good as I can do. I would like to be taught Lisp. You can?t read minds, programming languages are invented, so you need someone already trained by the original writers of Lisp or one of their disciples to translate for you until you can understand on your own. Then you become a disciple too and can train others and so on . . . As far as the + C is concerned. Actually I was not really criticizing the + C but the thread that has been going on forever it seems about sqrt(x^2) = abs(x). I think I should say I like the absolute value function, some people don't. They are not right, they just don't like it. Maybe because it's not invented by them I guess. I think abs_integrate and pw are cool. I like being able to use abs(), signum(), iif(), %if(), unit_spike(), between() and unit_pulse() to represent piecewise functions. They are like building blocks, you can make any piecewise continuous function from these basic building blocks. You don't even need all of them. Just one or two suffices in most cases. pw.mac allows you to use any of the above. So what? It is just a truth. I don't like Maxima's prejudice against using these functions even when the answer is clearly an unexpected or expected piecewise continuous function. Why is the following not just equal to %pi*exp(-abs(2*%pi*t))? I can make it so but not with Lisp. By the way, who taught me Maxima. I don't really know. I watched coding in Maxima being presented to the list and I caught on. Total immersion maybe, I guess :) (%i2) integrate(1/(x^2+1)*exp(-2*%i*%pi*x*t),x,minf,inf); Is t positive, negative, or zero?p; - 2 %pi t (out2) %pi %e (%i3) integrate(1/(x^2+1)*exp(-2*%i*%pi*x*t),x,minf,inf); Is t positive, negative, or zero? n; 2 %pi t (out3) %pi %e Rich From: Raymond Toy Sent: Friday, February 11, 2011 11:30 PM To: maxima at math.utexas.edu Subject: [Maxima] Constant of integration (Was Re: sqrt(x)*sqrt(x)) On 2/11/11 5:48 PM, Rich Hennessy wrote: ?There is no convenient way of telling Maxima that it should consider only real numbers . . .? Inconvenience is not an excuse. On a related issue. It is complete inexcusable that Maxima does Sure it is. It's inconvenient for you to fix the things you don't like because it's inconvenient for you to learn the necessary stuff to do it. Well, that's the excuse I use, anyway. Works for me. :-) not know that integrate(x,x) = x^2/2+C. Maxima always forgets to add the C. Why is this important? Does any other CAS do that? No table of integrals I know of does this. I vaguely remember it being mentioned in high school calculus, but I don't think we were expected to answer every integration question with a + C term added. Ray _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rswarbrick at gmail.com Sat Feb 12 05:23:08 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sat, 12 Feb 2011 11:23:08 +0000 Subject: [Maxima] Constant of integration (Was Re: sqrt(x)*sqrt(x)) References: <0FA4BAE7F1164EDCBCA717C806CF33D7@RichsLaptop> <4D560CFB.6050906@gmail.com> Message-ID: Raymond Toy writes: > Why is this important? Does any other CAS do that? No table of > integrals I know of does this. I vaguely remember it being mentioned in > high school calculus, but I don't think we were expected to answer every > integration question with a + C term added. Depressingly, secondary schools in Britain have that on the syllabus. One extra mark if you write "+ c". More depressingly, the undergraduate maths students I teach never understood 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 rswarbrick at gmail.com Sat Feb 12 05:32:15 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sat, 12 Feb 2011 11:32:15 +0000 Subject: [Maxima] Constant of integration (Was Re: sqrt(x)*sqrt(x)) References: <0FA4BAE7F1164EDCBCA717C806CF33D7@RichsLaptop> <4D560CFB.6050906@gmail.com> <307C69CFF401406DB0A7C42A5FD83DCB@RichsLaptop> Message-ID: "Rich Hennessy" writes: > Well, you are right. I am the same way. I don?t know Lisp so I would > have a very hard time fixing anything that I see as wrong with Maxima. > I can extend it with Maxima code, but that is as good as I can do. I > would like to be taught Lisp. You can?t read minds, programming > languages are invented, so you need someone already trained by the > original writers of Lisp or one of their disciples to translate for > you until you can understand on your own. Then you become a disciple > too and can train others and so on . . . The wonderful news is that people write books. And you can read them, gaining knowledge. It's a very exciting experience. Sadly, I never had a 9th-Dan lisp master as a personal trainer, but I like to think I learnt the language anyway. > > As far as the + C is concerned. Actually I was not really criticizing > the + C but the thread that has been going on forever it seems about > sqrt(x^2) = abs(x). I think I should say I like the absolute value > function, some people don't. They are not right, they just don't like > it. Maybe because it's not invented by them I guess. The reason Dr. Fateman and others are talking about the identity sqrt(x^2) = abs(x) is that there are two definitions of sqrt. The one that you are using is that "sqrt(x) is the positive real number y such that y^2 = x". The problem is that this doesn't make any sense over the complex numbers. How can you extend the definition you want to the complex plane? Note that you do have to do this, since many algorithms in Maxima use complex numbers internally, even if the inputs and outputs are real. The other option is that you say "sqrt(x) is the pair of numbers whose squares are x" (well, it might be a singleton if x=0). But then the identity above is nonsense. Even if you say that abs should apply to each element of the set, sqrt(2^2) = sqrt(4) = {-2, 2} != {2} = abs (2) Have you any good ideas for how to deal with this? Rupert P.S. Incidentally, please please don't top-post. It makes it a lot more effort to read your replies. See http://daringfireball.net/2007/07/on_top -------------- 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 Feb 12 05:48:27 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 12 Feb 2011 05:48:27 -0600 Subject: [Maxima] rootsof (was Re: sqrt(x)*sqrt(x)) In-Reply-To: <30075.1297478230@gemini.franz.com> References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> <24B41D4109CF45FDAEE63394DA8B9EF9@RichsLaptop> , <30075.1297478230@gemini.franz.com> Message-ID: It might be fun for somebody to extend Maxima's use of rootsof (see integrate_use_rootsof). Maxima could do things such as rootsof(x^2-5) + rootsof(y^2-3) --> rootsof(q^4-16*q^2+4). The four roots of q^4-16*q^2+4 are (+/-) sqrt(5) + sqrt(3), sqrt(5) (+/-) sqrt(3). One problem would be to prevent Maxima from simplifying rootsof(x^2-5) - rootsof(x^2-3) --> 0. Maybe we need a general scheme for preventing the general simplifier from doing xxx - xxx --> 0. And what would be a simple representation for rootsof(sum((1)^(k + 1/2) / k,k,1,inf), by the way? --Barton From macrakis at alum.mit.edu Sat Feb 12 06:52:09 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 12 Feb 2011 07:52:09 -0500 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> <4D55AA04.60007@eecs.berkeley.edu> Message-ID: Well, it would be wrong to have it be literally +C for each antiderivative a.k.a. indefinite integral. It would have to be +%c for each integration (which is what the +C notation is supposed to suggest), meaning that the antiderivative is only defined up to a constant. It would be trivial to have integrate return ... + %c23 etc. For that matter, it would be equally trivial for you to define rich_integrate to do that. What would be considerably less trivial would be doing something intelligent with things like %c23+%c56 or for that matter %c23+4*(log(%c56)-1). You might want to say that expressions involving %cs simplify to %c, but that isn't right, either, since %c23-%c23 really does equal 0, but if you do %c23+%c45 => %c51, then how do you know that %c51-%c45 = %c23? etc. This brings us to more 'philosophical' questions like: if the expression integrate(f(x)) appears twice in a list, should the result have the same constant of integration? i.e. is it the 'same integral'? Well, it depends on the larger context, which Maxima doesn't know. -s On Fri, Feb 11, 2011 at 16:59, Rich Hennessy wrote: > ?There is no convenient way of telling Maxima that it should consider > only real numbers . . .? > > Inconvenience is not an excuse. On a related issue. It is complete > inexcusable that Maxima does not know that integrate(x,x) = x^2/2+C. Maxima > always forgets to add the C. > > I can live with it working that way. > > Rich > > *From:* Richard Fateman > *Sent:* Friday, February 11, 2011 4:28 PM > *To:* Gary Pajer > *Cc:* Maxima - list > *Subject:* Re: [Maxima] sqrt(x)*sqrt(x) > > On 2/11/2011 12:47 PM, Gary Pajer wrote: > > > > On Fri, Feb 11, 2011 at 2:51 PM, Richard Fateman < > fateman at eecs.berkeley.edu> wrote: > >> On 2/11/2011 10:26 AM, Gary Pajer wrote: >> >> >> >> On Fri, Feb 11, 2011 at 10:10 AM, Richard Fateman < >> fateman at eecs.berkeley.edu> wrote: >> >>> ... >>> It seems hopeless to point out that x>0 does not mean that sqrt(x)>0, >>> mathematically. >>> There are 2 square roots. For example sqrt(16) is {-4, 4}, even though >>> 16>0. >>> >> >> Perhaps that is true maxima-tically. >> >> No, there are 2 square roots of 16, mathematically. Maxima chooses one >> of them, 4, >> and thus it is not true maxima-tically that there are 2 roots. >> >> >> And perhaps 16 has two real roots. >> >> There is nothing "perhaps" about it, unless you do not believe in negative >> numbers. >> >> S^2-16=0 defines the value(s) for S, corresponding to the square root of >> 16. >> >> By some obscure theorem, the so-called "fundamental theorem of algebra" >> there are 2 roots. >> >> >> But as a mathematical *function* sqrt(16) = +4. >> >> Nope. You mean "as a program written by one or more people, the >> conjunction of >> circumstances leads the Maxima system to return 4 when you type >> sqrt(16)." Your >> statement probably misuses at least one technical term, and maybe three. >> "mathematical" "function" and maybe "sqrt". >> > > > > You are probably not aware, but every response you have written has been > very rude. Seek professional help. > > Very rude? I would have thought merely somewhat rude, perhaps abrupt. > > > Recall that the OP specifically says that he is restricting consideration > to real numbers. > > Well, that is in the OP's mind. There is no convenient way of telling > Maxima that it should > consider only real numbers. I suppose one could go through the system and > every place > it might consider generating a complex or imaginary constant that it should > produce > an error message. This would still not make the system halt when it was, > in some sense, > considering results that MIGHT not be real, but MIGHT not be. > > for example, in solving a quadratic a*x^2+b*x+c, the solve program would > have to > consider the sign of b^2-4*a*c. Given that a,b,c are unknown, it is not > possible to > tell if this quadratic has real roots or not. Therefore how can one > instruct Maxima to > "restrict your consideration to real numbers"? > > So for him, x<0 is not in the domain of the function he or she wants (or > perhaps it's not in the domain of the function he or she expects). > > Well, then that is a consideration that he (or she) must impose in some > other fashion than saying > assume(x>0). > > > A real mathematical function must be single valued. > > That would be part of the usual definition. There's usually a domain and > range. > > To construct a proper function that we can call "square root", we choose > by convention the "principle square root", the positive number. > > Sure. That defines sqrt of a particular non-negative real. It does not > deal with sqrt(). Since Maxima > allows one to type sqrt(x^2-1) and manipulate it, what is the > relationship of that expression with the sqrt function from R+ to R+? > > Hence in many cases we tend to write \pm\sqrt{16}, where \sqrt{16} is a > positive number, but the negative of that number will work just as well for > whatever we are doing. Also, it's not defined for x<0. > > Most people beyond high school would find the extension of sqrt to > negative numbers to be unremarkable, and useful. > Without extending sqrt to symbols, a computer algebra system would be > fairly weak. > > And the OP has questions... > > I'll agree: the word "function" has slightly different meanings in > computer science, math, maxima, and even physics. > > Quite different. to a Fortran programmer, a function is a subroutine that > returns a value. To a "functional programming" > fan, it means something else. > > A useful response is to recognize that there can be confusion and > misinterpretation, and help to straighten out the difficulties of > interpretation. > > Well, there are at least 2 ways of doing that. 1. Fixing the program to do > the right thing, if that can be determined. > 2. Educating the user so that he/she can understand how to pose his/her > question in an unambiguous fashion. > > > Sage has an alternate CAS, doesn't it? > > Actually, it calls Maxima for bunches of things. > > And it has lots of "rings". > > Some of the other systems Sage also includes are more specific about > algebraic structures, yes. > > I wonder if sqrt has the desired/expected behavior over the ring of > reals? > > Well, the reals form a FIELD not a RING. They are also, in general, not > computable. > We could talk about the field of rational numbers, perhaps more > explicitly. Or the representable > floating point numbers, but they are not quite a field. And what Sage > does, I think, is > punt to whatever semantics are available in the programs that it calls, and > that means > that it is difficult to assign particular meanings to some of its answers, > even apparently > easy ones. Like is there a difference between 2 and 2/1 ? Yes, if one is > an integer and > the other is a rational. > > But that is not the issue here. sqrt(x^2-1) is not sqrt of a real. Even > if x is declared to be > real, x^2-1 is still an expression in the indeterminate x, and IS NOT A > REAL. > > For example one could > ask here, if sqrt(x^2-1) = sqrt(x-1)*sqrt(x+1) ? > Sometimes? Always? how does assume(x>0) affect this, if at all? > > > > > > > >> >> The computer programming term "function" in common usage does not >> correspond really to >> the mathematical concept "function" except superficially. >> >> Why am I bothering to comment on this? >> >> Because failing to make such distinctions leads to >> subtle but very bad consequences, even though it may seem harmless enough >> for the >> moment. >> > Again. > > >> RJF >> >> > > _______________________________________________ > 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 > > > _______________________________________________ > 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 Sat Feb 12 07:05:15 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 12 Feb 2011 08:05:15 -0500 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> <4D55AA04.60007@eecs.berkeley.edu> Message-ID: Hennessy, Though you often bring up interesting issues, you don't seem to want to engage the real difficulties in solving them, but prefer to think that simplistic fixes are the answer. What's more, you are going from being naive, eccentric, and logorrheic to being aggressively obnoxious. Some very experienced people here have been trying to be helpful to you over the years (though I admit that they sometimes lose their cool) and you seem not to want to listen and learn. A good way to get on people's autofile-as-junk lists. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From richhen2008 at gmail.com Sat Feb 12 08:30:56 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Sat, 12 Feb 2011 09:30:56 -0500 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: References: <20110210075019.58470@gmx.net><4D55516F.5040105@eecs.berkeley.edu><4D55935D.3020404@eecs.berkeley.edu><4D55AA04.60007@eecs.berkeley.edu> Message-ID: ?you are going from being naive, eccentric, and logorrheic to being aggressively obnoxious.? I guess my frustration was evident, sorry. My view of sqrt(x) is a special case of the more general definition. I am not trying to reinvent mathematics. Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From richhen2008 at gmail.com Sat Feb 12 09:05:16 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Sat, 12 Feb 2011 10:05:16 -0500 Subject: [Maxima] Constant of integration (Was Re: sqrt(x)*sqrt(x)) In-Reply-To: <4D560CFB.6050906@gmail.com> References: <0FA4BAE7F1164EDCBCA717C806CF33D7@RichsLaptop> <4D560CFB.6050906@gmail.com> Message-ID: Okay, I take back my statement that the missing + c should be an error. I was being disrespectful. As far as my attitude is concerned I think it is getting better since I am going to school again so my life is not as bad as it was. I make less posts than I used to. I don't have the time. It is true that some of my posts were disrespectful. I am sorry for that. I am in school now which is something real and positive in my life which I take very seriously. Sorry about my general frustration level with this subject of sqrt(x). It is due to my limited experience. I have only written one thing for Maxima, and that is pw.mac. When I wrote pw.mac I only cared about real inputs. If it ever works for complex numbers it is an accident or due to other people's efforts on getting Maxima to work with complex inputs and outputs. I certainly was not thinking along those lines. So proper credit is due here. I did not make the sqrt(x) function and my preferences are obviously not the final word. I am only talking about how I would like it to work. It does not have to work that way, just because I like it to work that way obviously. Additionally I only have ideas about how sqrt(x) should work when x is real. I have not put much thought into the complex case. Someone pointed out that I was dumb or lazy or something like that for not learning Lisp. I completely agree. I learned Maxima's programming language easily enough. I had motivation to learn it I guess since I always liked it. I don't have such motivation to learn Lisp, I guess because I don't like it. I am not saying it is a bad language. I don't know enough about languages to understand how to judge them. Same for people too by the way. Rich From richhen2008 at gmail.com Sat Feb 12 09:16:50 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Sat, 12 Feb 2011 10:16:50 -0500 Subject: [Maxima] Constant of integration (Was Re: sqrt(x)*sqrt(x)) In-Reply-To: References: <0FA4BAE7F1164EDCBCA717C806CF33D7@RichsLaptop><4D560CFB.6050906@gmail.com><307C69CFF401406DB0A7C42A5FD83DCB@RichsLaptop> Message-ID: <36FDDBC5632145418609560803C783E1@RichsLaptop> "there are two definitions of sqrt. The one that you are using is that 'sqrt(x) is the positive real number y such that y^2 = x'". Well not exactly. I was using the definition that sqrt(x) = positive real number y such that y^2 = x when x >= 0 and sqrt(x) is a positive real number (y * %i) such that (y*%i)^2 = x when x < 0. It is a special case. If it causes problems then it is something I have not thought through enough. I can't figure out what is wrong with my special case definition. I am a total klutz. I now know what the problem is, I am a total klutz. I should go do homework or something else. Sorry, Rich From A.G.Grozin at inp.nsk.su Sat Feb 12 09:35:28 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Sat, 12 Feb 2011 21:35:28 +0600 (NOVT) Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: References: <20110210075019.58470@gmx.net><4D55516F.5040105@eecs.berkeley.edu><4D55935D.3020404@eecs.berkeley.edu><4D55AA04.60007@eecs.berkeley.edu> Message-ID: On Sat, 12 Feb 2011, Rich Hennessy wrote: > My view of sqrt(x) is a special case of the more > general definition.? I am not trying to reinvent mathematics. Then take a serious maths book (not for kids). You are right, according to Bourbaki, there is no such thing as a multi-valued function (many good mathematitians strongly dislike bourbakism, but still...). Then, what's the domain of sqrt? Unsurprisingly, it's the Riemann surface of sqrt. It has 2 branch points, 0 and \infty. In a small neighbourhood of any regular point z, it consists of two sheets; but they are globally connected in a non-trivial way. So, there are two distinct points "16" in the domain of sqrt (on two sheets of its Riemann surface). For one of them, sqrt(16)=4. Let's rotate it around 0: z = 16 exp(i*alpha) When alpha varies from 0 to 2*pi, we arrive to a *different* point - at the other sheet of the Riemann surface. sqrt(z) becomes -4. Only after the next resolution (when alpha becomes 4*pi) do we return to the original point (and sqrt(z) returns to +4). Maxima works with sqrt's of symbolic expressions. One newer knows what will be substituted for all variables. When values of variables vary, analytical continuation can easily transform +4 to -4. Andrey From renekaelin at gmx.ch Sat Feb 12 09:55:03 2011 From: renekaelin at gmx.ch (=?iso-8859-1?Q?rene_k=E4lin?=) Date: Sat, 12 Feb 2011 16:55:03 +0100 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: References: <20110210075019.58470@gmx.net><4D55516F.5040105@eecs.berkeley.edu><4D55935D.3020404@eecs.berkeley.edu><4D55AA04.60007@eecs.berkeley.edu> Message-ID: <4DA0B611-15CE-478F-9406-76796CD6FF0B@gmx.ch> A lot of interesting things were written in the last two days. It's all a question of the definition, isn't it. As Richard Fateman suggested it, I did a few trials with a "positive sqrt" function. I'd like to understand what Maxima does. But first of all "my" definition of the sqrt. It only considers REAL numbers! The square root of a non-negative real number a (sqrt(a)) is the non-negative real number whose square (the result of multiplying the number by itself) is a. Now I'd like to "force Maxima to think only in real numbers". Look at this, please (I know a few forgets and assumes are not necessary): pos_sqrt(z):= block(if is(z>=0)=true then return(sqrt(z)) else throw(error()))$ assume(x<=0); ex(x):=pos_sqrt(x)*pos_sqrt(x); errcatch(ex(x)); forget(x<=0)$ assume(x<=0); ex(x):=pos_sqrt(x^2); errcatch(ex(x)); forget(x<=0)$ assume(x<=0,y<0); ex(x,y):=pos_sqrt(x*y)*pos_sqrt(x*y); errcatch(ex(x,y)); forget(x<=0,y<0)$ assume(x<=0,y<=0); ex(x,y):=pos_sqrt(x*y)*pos_sqrt(x*y); errcatch(ex(x,y)); (%o2) [x<=0] (%o3) ex(x):=pos_sqrt(x)*pos_sqrt(x) (%o4) [] (%o6) [x<=0] (%o7) ex(x):=pos_sqrt(x^2) (%o8) [-x] (%o10) [x<=0,y<0] (%o11) ex(x,y):=pos_sqrt(x*y)*pos_sqrt(x*y) (%o12) [x*y] (%o14) [x<=0,y<=0] (%o15) ex(x,y):=pos_sqrt(x*y)*pos_sqrt(x*y) (%o16) [] %o4 is true. The square root isn't defined (according to "my" definition). The solution set is empty. %o8 is true since in this case (x<=0) -x is equal to abs(x) and so non-negative. %o12 is true. In this case (x<=0 and y<0) the square root of x*y does exist. %o16 is false. This case should be treated as %o12. It is x*y>=0 and so the square root of x*y exists. Compare %o12 and %o14 and look at this, please: assume(x<=0,y<0); sign(x*y); forget(x<=0,y<0)$ assume(x<=0,y<=0); sign(x*y); (%o1) [x<=0,y<0] (%o2) pz (%o4) [x<=0,y<=0] (%o5) nz Can you explain this to me please? From richhen2008 at gmail.com Sat Feb 12 10:15:05 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Sat, 12 Feb 2011 11:15:05 -0500 Subject: [Maxima] Constant of integration (Was Re: sqrt(x)*sqrt(x)) In-Reply-To: <36FDDBC5632145418609560803C783E1@RichsLaptop> References: <0FA4BAE7F1164EDCBCA717C806CF33D7@RichsLaptop><4D560CFB.6050906@gmail.com><307C69CFF401406DB0A7C42A5FD83DCB@RichsLaptop> <36FDDBC5632145418609560803C783E1@RichsLaptop> Message-ID: <7040DE1568524616A4372F9B37E3D160@RichsLaptop> I did not say this right. Let me try again. "there are two definitions of sqrt. The one that you are using is that 'sqrt(x) is the positive real number y such that y^2 = x'". Well not exactly. I was using this definition. When x >= 0 the sqrt(x) = some positive real number y such that y^2 = x When x<0 then the sqrt(x) is an imaginary number (y * %i) such that (y*%i)^2 = x where y is a real number and y > 0. It is a special case. If it causes problems then it is something I have not seen yet. I don't see anything wrong with this special case definition. I think I do know what the real problem is, I am just a total klutz. I don't know what I am talking about. I don't even know why this definition is wrong. I should go do homework or something else. Sorry, Rich From korte at lite.msu.edu Sat Feb 12 10:21:58 2011 From: korte at lite.msu.edu (Gerd Kortemeyer) Date: Sat, 12 Feb 2011 11:21:58 -0500 Subject: [Maxima] LON-CAPA and Maxima in Online Homework Message-ID: Hi, Yesterday, I gave a talk about how to use LON-CAPA (including MAXIMA) for randomized, automatically graded online homework. Maybe this is of some interest to the list: http://www.lon-capa.org/presentations/loncapamath.pdf Sorry, it's 10 MB. - Gerd. From sangwinc at for.mat.bham.ac.uk Sat Feb 12 11:09:11 2011 From: sangwinc at for.mat.bham.ac.uk (Chris Sangwin) Date: Sat, 12 Feb 2011 17:09:11 +0000 (GMT) Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> <24B41D4109CF45FDAEE63394DA8B9EF9@RichsLaptop> Message-ID: Yes, I agree with you Michel, and Prof. Fateman. This is a very interesting and useful thread. I'm glad things have calmed down a little. It all begs the question, "What is a function"! The usual modern definition of a function $f$ is a rule, which takes each element of the domain $X$, and assigns a unique element in the range $Y$. It is perhaps surprising to learn that this particular definition of function is a relatively recent innovation. Even more interesting I would argue that some older notions might still have a place in the design of a CAS, (or any other *mathematical* software which needs functions). Just over one hundred years G. H. Hardy, in his "Pure Mathematics", made the following remarks about functions. "We must point out that the simple examples of functions mentioned above possess three characteristics which are by no means involved in the general idea of a function, viz: * $y$ is determined for every value of $x$; * to each value of $x$ for which $y$ is given corresponds one and only one value of $y$; * the relation between $x$ and $y$ is expressed by means of an analytical formula. [...] All that is essential is that there should be some relation between $x$ and $y$ such that to some values of $x$ at any rate correspond values of $y$." Hardy then goes on to give a number of further examples to illustrate these ideas which can be broadly separated into two groups. Firstly are those which involve a formula, equation or algebraic expression in $x$ and $y$. This might include an infinite sum such as a series. Maxima, being a CAS concentrates on these kinds of functions. The second class of examples of functions given by Hardy are when the relationship between $x$ and $y$ follow from some geometrical construction. Even further back Leonhard Euler makes the same distinction in the two volumes of Introduction to Analysis of the Infinite. "\S4. A function of a variable quantity is an analytic expression composed in any way whatsoever of the variable quantity and numbers or constant quantities. Hence every analytic expression, in which all component quantities except the variable $z$ are constants, will be a function of that $z$; thus $a+3z$; $az-4z^2$; $az+\sqrt{a^2-z^2}$; $c^z$; etc.~are functions of $z$. (Vol 1)" It is important to realize in connection with this statement that the *same algebraic expression* represents the function. For example, if we think about $y=x^3$ again, for Euler, this is as much a function of $y$ as it is a function of $x$. It all depends on how you are thinking about it at any moment. This is quite neat, and avoids the sqrt(x)^2 discussion we are having. A result of this is that functions can be multiple valued: "\S10. Finally we make a distinction between single-valued and multiple-valued functions." In particular, Euler gives $\sqrt{2z+z^2}$ as an example of a two-valued function. "Whatever value is assigned to $z$, the expression $\sqrt{2z+z^2}$ has a twofold significance, either positive or negative." If we look at the next volume there is quite a different notion. "\S6 Thus any function of $x$ is translated into geometry and determines a line, either straight or curved, whose nature is dependent on the nature of the function. [...] a curve can define a function. (Vol 2)" But Euler really means *implicit* functions which are *MULTIVALUED*! Quite different from the Weierstrass modern single-valued version we have now. "\S16. If $y$ is any kind of function of $z$, then likewise, $z$ will be a function of $y$." I think that implicit functions really should have a stronger place, especially with modern techniques like Grobner bases. Enough of history! Furthermore, in my view, education has a lot to answer for with the damage done when people have to "unlearn" the square root algebra trick later. Chris From obsessivemathsfreak at obsessivemathsfreak.org Sat Feb 12 12:04:19 2011 From: obsessivemathsfreak at obsessivemathsfreak.org (ObsessiveMathsFreak) Date: Sat, 12 Feb 2011 18:04:19 +0000 Subject: [Maxima] Defining file_type extensions Message-ID: <4D56CBA3.1090505@obsessivemathsfreak.org> Hello, I've encountered a problem in the latest versions of maxima. Specially, the load function no longer works on my code because I have given the .mxs extension to all my code files. So now I have (%i3) load("weightingmatrix.mxs"); Load failed for weightingmatrix.mxs -- an error. To debug this try: debugmode(true); Simply renaming individual files solves this issue (%i4) load("weightingmatrix.mac"); 0 errors, 0 warnings (%o4) weightingmatrix.mac But I have many dozens of mxs files which all contain mxs calls in their code. Rather than re-write everything, I would like to define mxs as a maxima file type so that file_type recognises it as maxima code. How can this best be done? Is there a way to do it in a maximarc file or the like? OMF From robert.dodier at gmail.com Sat Feb 12 12:53:53 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 12 Feb 2011 11:53:53 -0700 Subject: [Maxima] LON-CAPA and Maxima in Online Homework In-Reply-To: References: Message-ID: Hi Gerd, thanks for the update. LON-CAPA looks really interesting. I wonder if you have any comments about using Maxima in such a system. If you have any wish-list items that would make life easier for you, I'd be interested to hear about it. best, Robert Dodier From rswarbrick at gmail.com Sat Feb 12 12:55:24 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sat, 12 Feb 2011 18:55:24 +0000 Subject: [Maxima] Defining file_type extensions References: <4D56CBA3.1090505@obsessivemathsfreak.org> Message-ID: ObsessiveMathsFreak writes: > Hello, > > I've encountered a problem in the latest versions of > maxima. Specially, the load function no longer works on my code > because I have given the .mxs extension to all my code files. So now I > have > > (%i3) load("weightingmatrix.mxs"); > Load failed for weightingmatrix.mxs > -- an error. To debug this try: debugmode(true); > > Simply renaming individual files solves this issue > > (%i4) load("weightingmatrix.mac"); > 0 errors, 0 warnings > (%o4) weightingmatrix.mac > > But I have many dozens of mxs files which all contain mxs calls in > their code. Rather than re-write everything, I would like to define > mxs as a maxima file type so that file_type recognises it as maxima > code. The problem comes from the fact that load() can either load in lisp code or Maxima code. To decide which it's getting, it seems to check for the file extension, defaulting to lisp. So the errors you get come from it trying to read weightingmatrix.mxs as lisp, which it isn't! A solution/workaround is to use batchload() instead, which seems to work the same, but assume that you're giving it Maxima code. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From korte at lite.msu.edu Sat Feb 12 13:44:50 2011 From: korte at lite.msu.edu (Gerd Kortemeyer) Date: Sat, 12 Feb 2011 14:44:50 -0500 Subject: [Maxima] LON-CAPA and Maxima in Online Homework In-Reply-To: References: Message-ID: Hi, On Feb 12, 2011, at 1:53 PM, Robert Dodier wrote: > > > thanks for the update. LON-CAPA looks really interesting. > I wonder if you have any comments about using Maxima > in such a system. If you have any wish-list items that would > make life easier for you, I'd be interested to hear about it. Well, yes, I have a wish list, but I feel bad presenting it, as we have no time or resources to work on it. Being responsible for an open source system myself, I know what it feels like to get wish lists that come with no offer for helping out. Essentially, we would love to have MAXIMA as a true kernel that we can talk to. Currently, we do glorified screen scraping, i.e., we have a demon process talking to a number of running MAXIMAs like through a terminal, see http://www.lon-capa.org/maximaasserver.html As we are having high student numbers and lots of transactions, we need scalability. In order to use less duct-tape, we would need: * MAXIMA itself managing a number of running child process (like Apache, etc) * Providing a port to send requests to these child processes (like Apache, etc) * A highly predictable command-reply sequence. We really struggle with MAXIMA having questions back for LON-CAPA (like "Is x positive?"), which of course are unanswerable. If an expression given by a student is not completely defined, we just need an error message back, and MAXIMA should not wait for an answer. Ideally: one line in, one line out, always. * A way to run MAXIMA safely, i.e., without any file or operating system access * A way to cleanly and quickly reset MAXIMA between requests: all variables, definitions, assumptions, etc. - Gerd. -- Gerd Kortemeyer, Ph.D. Michigan State University http://www.lite.msu.edu/kortemeyer/ From dbmaxima at gmail.com Sat Feb 12 17:25:48 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Sun, 13 Feb 2011 10:25:48 +1100 Subject: [Maxima] Defining file_type extensions In-Reply-To: References: <4D56CBA3.1090505@obsessivemathsfreak.org> Message-ID: <4D5716FC.1090009@gmail.com> On 13/02/2011 5:55 AM, Rupert Swarbrick wrote: > ObsessiveMathsFreak > writes: >> Hello, >> >> I've encountered a problem in the latest versions of >> maxima. Specially, the load function no longer works on my code >> because I have given the .mxs extension to all my code files. So now I >> have >> >> (%i3) load("weightingmatrix.mxs"); >> Load failed for weightingmatrix.mxs >> -- an error. To debug this try: debugmode(true); >> >> Simply renaming individual files solves this issue >> >> (%i4) load("weightingmatrix.mac"); >> 0 errors, 0 warnings >> (%o4) weightingmatrix.mac >> >> But I have many dozens of mxs files which all contain mxs calls in >> their code. Rather than re-write everything, I would like to define >> mxs as a maxima file type so that file_type recognises it as maxima >> code. > The problem comes from the fact that load() can either load in lisp code > or Maxima code. To decide which it's getting, it seems to check for the > file extension, defaulting to lisp. So the errors you get come from it > trying to read weightingmatrix.mxs as lisp, which it isn't! > > A solution/workaround is to use batchload() instead, which seems to work > the same, but assume that you're giving it Maxima code. > > Rupert The file suffixes used by load are hard coded in function $file_type in mload.lisp. (defun $file_type (fil) (let ((typ ($pathname_type fil))) (cond ((member typ '("l" "lsp" "lisp") :test #'string=) '$lisp) ((member typ '("mac" "mc" "demo" "dem" "dm1" "dm2" "dm3" "dmt") :test #'string=) '$maxima) (t '$object)))) You could put a modified version of this function in your maxima-init.lisp file - see http://maxima.sourceforge.net/ui-tips.html || -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sat Feb 12 18:39:59 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 12 Feb 2011 19:39:59 -0500 Subject: [Maxima] Defining file_type extensions In-Reply-To: <4D5716FC.1090009@gmail.com> References: <4D56CBA3.1090505@obsessivemathsfreak.org> <4D5716FC.1090009@gmail.com> Message-ID: <4D57285F.7070603@gmail.com> On 2/12/11 6:25 PM, David Billinghurst wrote: > On 13/02/2011 5:55 AM, Rupert Swarbrick wrote: >> ObsessiveMathsFreak >> writes: >>> Hello, >>> >>> I've encountered a problem in the latest versions of >>> maxima. Specially, the load function no longer works on my code >>> because I have given the .mxs extension to all my code files. So now I >>> have >>> >>> (%i3) load("weightingmatrix.mxs"); >>> Load failed for weightingmatrix.mxs >>> -- an error. To debug this try: debugmode(true); >>> >>> Simply renaming individual files solves this issue >>> >>> (%i4) load("weightingmatrix.mac"); >>> 0 errors, 0 warnings >>> (%o4) weightingmatrix.mac >>> >>> But I have many dozens of mxs files which all contain mxs calls in >>> their code. Rather than re-write everything, I would like to define >>> mxs as a maxima file type so that file_type recognises it as maxima >>> code. >> The problem comes from the fact that load() can either load in lisp code >> or Maxima code. To decide which it's getting, it seems to check for the >> file extension, defaulting to lisp. So the errors you get come from it >> trying to read weightingmatrix.mxs as lisp, which it isn't! >> >> A solution/workaround is to use batchload() instead, which seems to work >> the same, but assume that you're giving it Maxima code. >> >> Rupert > > The file suffixes used by load are hard coded in function $file_type > in mload.lisp. > > (defun $file_type (fil) > (let ((typ ($pathname_type fil))) > (cond > ((member typ '("l" "lsp" "lisp") :test #'string=) > '$lisp) > ((member typ '("mac" "mc" "demo" "dem" "dm1" "dm2" "dm3" "dmt") > :test #'string=) > '$maxima) > (t > '$object)))) > > You could put a modified version of this function in your > maxima-init.lisp file - see > http://maxima.sourceforge.net/ui-tips.html This has come up several times now. Perhaps it's time to allow the user to change this easily. I propose adding two new variables $file_type_lisp and $file_type_maxima, defaulting to the values above. Then the user can change them however they want. (Of course, you solution works nicely too.) Ray From robert.dodier at gmail.com Sat Feb 12 20:30:15 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 12 Feb 2011 19:30:15 -0700 Subject: [Maxima] LON-CAPA and Maxima in Online Homework In-Reply-To: References: Message-ID: On 2/12/11, Gerd Kortemeyer wrote: > Well, yes, I have a wish list, but I feel bad presenting it, as we have no > time or resources to work on it. Well, for my part, it is valuable to the project to get the opinions of well-informed outsiders, even if those people don't have the time to work on stuff. > Essentially, we would love to have MAXIMA as a true kernel that we can talk to. There has been some work in that direction; see below. I would be interested to know what more could be done. > * MAXIMA itself managing a number of running child process (like Apache, > etc) > > * Providing a port to send requests to these child processes (like Apache, > etc) There is share/contrib/maxima-server.lisp which implements a simple-minded Unixish server: server listens on a port, accepts connections from clients, and forks a new instance for each client. Forking the server is, I hope, more efficient than launching a new instance. Anything loaded into the server is present in the forked processes. The connected socket just transmits all the stuff that would otherwise go to a terminal. Note that there are command line options to make Maxima quieter (suppressing the banner and input/output labels). maxima-server.lisp only works w/ SBCL, but I guess you are using SBCL already so that's good news. > * A highly predictable command-reply sequence. We really struggle with > MAXIMA having questions back for LON-CAPA (like "Is x positive?"), which of > course are unanswerable. If an expression given by a student is not > completely defined, we just need an error message back, and MAXIMA should > not wait for an answer. Ideally: one line in, one line out, always. Yes, this is quite a problem. There is an experimental add-on package named noninteractive which attempts to intercept such questions and throw the expression being considered instead of waiting for input. Unfortunately noninteractive is rather fragile; it is not too hard to come up with examples which trigger bugs. But with some prodding, I could be inspired to work on it some more (or anyone else can, of course). There are some examples (working or buggy) in the comment header for share/contrib/noninteractive/noninteractive.mac. > * A way to run MAXIMA safely, i.e., without any file or operating system > access My advice is to use chroot to change the file system visible to Maxima. Trying to plug all the holes by disallowing a certain set of functions is probably defeatable. Beyond chroot, you might consider using some virtualization software so Maxima runs in its own instance of the OS. > * A way to cleanly and quickly reset MAXIMA between requests: all variables, > definitions, assumptions, etc. As you know, reset and kill don't clean up everything, and trying to fix those is probably not worth the trouble. I think your best bet is to use maxima-server and just create a new instance when you want a clean slate. Hope this helps in some way. It appears that you're using an old version of Maxima. We have been making a lot of progress in the past several years, so I'll encourage you to use a newer version. The stuff I've mentioned might or might not exist in old versions. best Robert Dodier From robert.dodier at gmail.com Sat Feb 12 20:52:25 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 12 Feb 2011 19:52:25 -0700 Subject: [Maxima] pattern matching / lookup integration (was Re: integration using z =tan(x/2) sub) In-Reply-To: <4D55DA37.6090604@gmail.com> References: <20110210203005.13690abnhi7teeog@www.staffmail.ed.ac.uk> <4D54D468.1050609@unicaen.fr> <4D55DA37.6090604@gmail.com> Message-ID: > On 11/02/2011 11:14 PM, Barton Willis wrote: >> I sometimes wonder if a purely pattern matching / lookup integration would >> be superior to what we have; for >> example http://www.apmaths.uwo.ca/~arich/ . I'm all for it. I am not too mathematically sophisticated but I am pretty good at look up tables and pattern matching ... maybe I can help in some way. best Robert Dodier From robert.dodier at gmail.com Sat Feb 12 21:32:38 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 12 Feb 2011 20:32:38 -0700 Subject: [Maxima] Greek letter gamma in tex() In-Reply-To: <4AD7C3D6-D326-4F39-8C9D-EFD4AB0F1ADD@mac.com> References: <403E8008-7579-44F7-BF44-17A2B7B37983@mac.com> <4AD7C3D6-D326-4F39-8C9D-EFD4AB0F1ADD@mac.com> Message-ID: On 2/11/11, Yasuaki Honda wrote: >> (defprop %gamma "\\gamma" texword) ; THIS IS Now FORTUNATE ... OK so far ... >> (eval-when (:load-toplevel :execute) >> (make-maxima-tex-glue '%gamma >> #'(lambda (arglist &aux $vx) >> (declare (special $vx)) >> (mset '((mlist) $vx) ($args arglist)) >> ($concat "\\Gamma\\left(" ($tex1 $vx) "\\right)"))) Well, MAKE-MAXIMA-TEX-GLUE just constructs a function and assigns it to the TEX property. Other functions are set up like that. So using TEX-SQRT as an example, I think it should be something like: (defprop %gamma tex-gamma tex) (defun tex-gamma (x l r) (tex (cadr x) (append l '("\\Gamma\\(")) (append '("\\)") r) 'mparen 'mparen)) best Robert Dodier From robert.dodier at gmail.com Sat Feb 12 21:47:29 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 12 Feb 2011 20:47:29 -0700 Subject: [Maxima] simplifying predicates In-Reply-To: References: <4D48E8A6.7010109@street-artists.org> <1296671803.1720.5.camel@dieter> Message-ID: On 2/2/11, Barton Willis wrote: > We could define simplifications for the nounforms of integerp and friends. I dunno. I kind of like that idea, but it might be a little too subtle for anybody who hasn't fully absorbed the arcana minor of Maxima's evaluation / simplification \cross noun / verb systems ... Feel free to convince me, I don't have a strong opinion about it yet. Hmm, what about operator predicates? (<, =, > etc) There isn't an obvious way to distinguish nouns and verbs for them; how do they fit into this scheme? I'd like to see simplifying predicates in some form, I just don't know yet what form that would be. best Robert Dodier From yhonda at mac.com Sat Feb 12 22:57:57 2011 From: yhonda at mac.com (Yasuaki Honda) Date: Sun, 13 Feb 2011 13:57:57 +0900 Subject: [Maxima] Greek letter gamma in tex() In-Reply-To: References: <403E8008-7579-44F7-BF44-17A2B7B37983@mac.com> <4AD7C3D6-D326-4F39-8C9D-EFD4AB0F1ADD@mac.com> Message-ID: <6A1B55BA-E02A-4E5A-81A3-43A6F747585C@mac.com> Thanks, Robert, I understand. Here is the patch that I will apply to mactex.lisp as suggested by Robert, RCS file: /cvsroot/maxima/maxima/src/mactex.lisp,v retrieving revision 1.74 diff -r1.74 mactex.lisp 469c469,474 < (defprop %gamma "\\Gamma" texword) ; THIS IS UNFORTUNATE ... --- > (defprop %gamma "\\gamma" texword) ; fix by yhonda Feb/13/2011 > > (defprop %gamma tex-gamma tex) ; added by yhonda Feb/13/2011 > (defun tex-gamma (x l r) > (tex (cadr x) (append l '("\\Gamma\\left(")) (append '("\\right)") r) 'mparen 'mparen)) > Thanks and best regards, Yasuaki Honda On 2011/02/13, at 12:32, Robert Dodier wrote: > On 2/11/11, Yasuaki Honda wrote: > >>> (defprop %gamma "\\gamma" texword) ; THIS IS Now FORTUNATE ... > > OK so far ... > >>> (eval-when (:load-toplevel :execute) >>> (make-maxima-tex-glue '%gamma >>> #'(lambda (arglist &aux $vx) >>> (declare (special $vx)) >>> (mset '((mlist) $vx) ($args arglist)) >>> ($concat "\\Gamma\\left(" ($tex1 $vx) "\\right)"))) > > Well, MAKE-MAXIMA-TEX-GLUE just constructs a function and > assigns it to the TEX property. > Other functions are set up like that. So using TEX-SQRT as an > example, I think it should be something like: > > (defprop %gamma tex-gamma tex) > > (defun tex-gamma (x l r) > (tex (cadr x) (append l '("\\Gamma\\(")) (append '("\\)") r) 'mparen 'mparen)) > > best > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From andre.maute at gmx.de Sun Feb 13 04:34:11 2011 From: andre.maute at gmx.de (andre maute) Date: Sun, 13 Feb 2011 11:34:11 +0100 Subject: [Maxima] Defining file_type extensions In-Reply-To: <4D57285F.7070603@gmail.com> References: <4D56CBA3.1090505@obsessivemathsfreak.org> <4D5716FC.1090009@gmail.com> <4D57285F.7070603@gmail.com> Message-ID: <4D57B3A3.3090207@gmx.de> On 02/13/2011 01:39 AM, Raymond Toy wrote: > On 2/12/11 6:25 PM, David Billinghurst wrote: >> >> The file suffixes used by load are hard coded in function $file_type >> in mload.lisp. >> >> (defun $file_type (fil) >> (let ((typ ($pathname_type fil))) >> (cond >> ((member typ '("l" "lsp" "lisp") :test #'string=) >> '$lisp) >> ((member typ '("mac" "mc" "demo" "dem" "dm1" "dm2" "dm3" "dmt") >> :test #'string=) >> '$maxima) >> (t >> '$object)))) >> >> You could put a modified version of this function in your >> maxima-init.lisp file - see >> http://maxima.sourceforge.net/ui-tips.html > This has come up several times now. Perhaps it's time to allow the user > to change this easily. > > I propose adding two new variables $file_type_lisp and > $file_type_maxima, defaulting to the values above. Then the user can > change them however they want. Yes please. That would be great. Andre From rroa at azti.es Sun Feb 13 07:20:39 2011 From: rroa at azti.es (=?iso-8859-1?Q?Rub=E9n_Roa?=) Date: Sun, 13 Feb 2011 14:20:39 +0100 Subject: [Maxima] wxMaxima-Maxima connection failure Message-ID: <5CD78996B8F8844D963C875D3159B94A01112104@dsrcorreo> Hello Maxima users and experts, My first post to the list. I've searched this mail list and others and I realized that the problem I am about to describe is fairly recurrent in Windows systems, but none of the suggested solutions that I read worked for me (nor for the user posting the message). The problem is that wxMaxima does not connect to Maxima ever, after installation, so nothing gets done. I have tried this in two systems Problem in System 1. No firewall. No anti-virus. Windows firewall off. Windows XP Home Edition version 2002 Service Pack 3 Maxima 5.23.2 wxMaxima 0.8.7 Message after start (on bottom right) : "Maxima started. Waiting for connection ..." Error Message after any calculation : "Not connected to Maxima!" Problem in System 2. Zone Alarm (with permissions for Maxima, wxMaxima, and Tcl/Tk, and also with firewall turned off) Windows Vista Home Premium Service Pack 2 Maxima 5.23.2 wxMaxima 0.8.7 Message after start (on bottom right) : "Maxima process terminated" Error Message after any calculation : "Not connected to Maxima!" The problems persists after giving Maxima and Tcl/Tk permission to avoid DEP. I tried setting different ports for wxMaxima-Maxima connection and that didn't work either. I tried installing old Maxima version, from 5.17.1 up, and in all of them the same problem rendered the software totally useless. I have another Windows XP system at work and there wxMaxima-Maxima work fine (details of that system set up are not available to me now). So are there any new clues on how to remedy the connection failure? Alternatively (but not so good), how can I use Maxima directly, without calling it from the Tcl/Tk GUI? (that will no connect to the algebraic engine anyways) Thanks in advance, Ruben -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sun Feb 13 10:07:08 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 13 Feb 2011 10:07:08 -0600 Subject: [Maxima] simplifying predicates In-Reply-To: References: <4D48E8A6.7010109@street-artists.org> <1296671803.1720.5.camel@dieter> , Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >On?2/2/11,?Barton?Willis??wrote: > >>?We?could?define?simplifications?for?the?nounforms?of?integerp?and >friends. > >I?dunno.?I?kind?of?like?that?idea,?but?it?might?be?a?little >too?subtle?for?anybody?who?hasn't?fully?absorbed?the >arcana?minor?of?Maxima's?evaluation?/?simplification?\cross >noun?/?verb?systems?...?Feel?free?to?convince?me, >I?don't?have?a?strong?opinion?about?it?yet. I'm not wed to the idea--it's one of several possibilities that I've considered. Putting simplification functions onto various predicates would be be easy enough to do and might not break all that much. But from what I've recently learned about evaluation / simplification from abs_integrate, I think all this could be confusing. >Hmm,?what?about?operator?predicates??(<,?=,?>?etc) >There?isn't?an?obvious?way?to?distinguish?nouns?and?verbs >for?them;?how?do?they?fit?into?this?scheme? Yeah, I thought about that too--maybe a simplifying "is" applied to a blob of inequations would be the way to go? The individual operator predicates would not simplify. >I'd?like?to?see?simplifying?predicates?in?some?form, >I?just?don't?know?yet?what?form?that?would?be. > >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 Sun Feb 13 10:30:08 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 13 Feb 2011 09:30:08 -0700 Subject: [Maxima] Greek letter gamma in tex() In-Reply-To: <6A1B55BA-E02A-4E5A-81A3-43A6F747585C@mac.com> References: <403E8008-7579-44F7-BF44-17A2B7B37983@mac.com> <4AD7C3D6-D326-4F39-8C9D-EFD4AB0F1ADD@mac.com> <6A1B55BA-E02A-4E5A-81A3-43A6F747585C@mac.com> Message-ID: On 2/12/11, Yasuaki Honda wrote: >> (defprop %gamma "\\gamma" texword) ; fix by yhonda Feb/13/2011 >> >> (defprop %gamma tex-gamma tex) ; added by yhonda Feb/13/2011 Please, in the name of all that is good, let's not get in the habit of putting ";; I changed something today" cruft onto the code. Please bear in mind that every single line of every file was changed or created by someone at some time. If we put ";; Kilgore was here" comments on every commit, pretty soon all of the source code would be encrusted with it. I know there is some of that stuff in mactex.lisp already. Let's not make the problem any worse. On rare occasions, it might be useful. But those times are few and far between. If someone wants to see who changed what, that's what CVS is for. best Robert Dodier From yaalekseev at rambler.ru Sun Feb 13 12:09:15 2011 From: yaalekseev at rambler.ru (Yaroslav Alekseev) Date: Sun, 13 Feb 2011 21:09:15 +0300 Subject: [Maxima] itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis In-Reply-To: <008301cbc8b9$d114b010$733e1030$@vttoth.com> References: <01f401cbc7c7$db6f87d0$924e9770$@vttoth.com> <008301cbc8b9$d114b010$733e1030$@vttoth.com> Message-ID: Viktor T. Toth ?????(?) ? ????? ?????? Thu, 10 Feb 2011 03:31:01 +0300: > OK, I think I understand the problem. At the root is the fact that > ic_convert uses noun forms of ifg, ifr, and ifri. Then, we run into > something that may or may not be a Maxima buglet: > > (%i1) depends(y,x); > (%o1) [y(x)] > (%i2) diff(y,x); > dy > (%o2) -- > dx > (%i3) diff(y[0],x); > d > (%o3) -- (y ) > dx 0 > (%i4) diff('y,x); > dy > (%o4) -- > dx > (%i5) diff('y[0],x); > (%o5) 0 > > Personally I think this is a bug, but fortunately, there is a way to > work around it within the confines of the tensor libraries. Your example > could be written thus: > > load(itensor); > load(ctensor); > iframe_flag:true; > cframe_flag:true; > ct_coordsys(polar)$ > depends([V,ifg,ifr,ifri],ct_coords)$ > ishow(covdiff(V([],[j]),j))$ > ishow(ev(%,icc2,ifc2,ifc1,ifb))$ > eqn:eq=%$ > ceqn:ic_convert(rename(expand(eqn)))$ > ceqn:subst(ifri,nounify(ifri),ceqn)$ > ifg:matrix([1,0],[0,1]); > ifr:matrix([1,0],[0,1/r]); > ifri:matrix([1,0],[0,r]); > ceqn,'ifr,'ifg; > V > 1 d d > (%o15) -- + ---- (V ) + -- (V ) > r dphi 2 dr 1 But V_1 and V_2 should have equal physical dimension (since ifg:matrix([1,0],[0,1])). It seems to me that the correct answer should be: d ---- (V ) V dphi 2 1 d --------- + -- + -- (V ) r r dr 1 > > The critical line is the ceqn:subst(...) line, which substitutes the > verb form of ifri before diff is evaluated. > > > Viktor > > > > > > > -----Original Message----- > From: Yaroslav Alekseev [mailto:yaalekseev at rambler.ru] > Sent: Wednesday, February 09, 2011 6:52 PM > To: maxima at math.utexas.edu; Viktor T. Toth > Subject: Re: [Maxima] itensor and ctensor: indexed objects in moving > frames in specific coordinate systems and frame basis > > Viktor T. Toth ?????(?) ? ????? ?????? Tue, 08 Feb > 2011 22:39:04 +0300: > >> I think the only step missing is an evaluation of ifb before converting >> to a >> ctensor expression. Try this: >> >> load(itensor); >> load(ctensor); >> iframe_flag:true; >> cframe_flag:true; >> ct_coordsys(polar)$ >> depends([V,ifg,ifr,ifri],ct_coords)$ >> ishow(covdiff(V([],[j]),j))$ >> ishow(ev(%,icc2,ifc2,ifc1,ifb))$ >> eqn:eq=%$ >> ceqn:ic_convert(eqn)$ >> ev(ceqn); >> >> A word of warning: Presently, ic_convert has no explicit knowledge about >> the >> meaning of the symbols ifg, ifr, and ifri. It just treats them as it >> would >> treat any other indexed objects. In the present example, it is not >> relevant >> as the symbols cancel; in other cases, however, you may need to take >> steps >> to identify the itensor symbols ifr, ifri, and ifg with the >> corresponding >> ctensor matrices fri, ifri, and lfg/ufg as appropriate. >> >> >> Viktor > > Ok, thank you for response. > I have to define symbols ifr, ifri, and ifg. So, I've tried this: > > load(itensor); > load(ctensor); > iframe_flag:true; > cframe_flag:true; > ct_coordsys(polar)$ > depends(V,ct_coords)$ > ishow(covdiff(V([],[j]),j))$ > ishow(ev(%,icc2,ifc2,ifc1,ifb))$ > eqn:eq=%$ > ceqn:ic_convert(eqn)$ > ifg:matrix([1,0],[0,1]); > fri:matrix([1,0],[0,1/r]); > ifri:matrix([1,0],[0,r]); > ev(ceqn); > > But I've got very strange answer: > > > (%i14) ev(ceqn); > d d > (%o14) ---- (V ) + -- (V ) > dphi 2 dr 1 > > It seems to me that the answer should be something like this (ordinary > divergence): > > > dV2 > ---- > dphi dV1 V1 > (%o21) ---- + --- + -- > r dr r > > > >> >> >> >> -----Original Message----- >> From: maxima-bounces at math.utexas.edu >> [mailto:maxima-bounces at math.utexas.edu] >> On Behalf Of Yaroslav Alekseev >> Sent: Tuesday, February 08, 2011 2:38 PM >> To: maxima at math.utexas.edu >> Subject: [Maxima] itensor and ctensor: indexed objects in moving frames >> in >> specific coordinate systems and frame basis >> >> >> Hi to all! I need to learn how to compute various expressions with >> indexed >> objects in moving frames >> in specific coordinate systems and frame basis. For example: to compute >> contract(covdiff(V([],[j]),j)) >> in polar coordinate and frame >> basis:matrix([a(r,phi),b(r,phi)],[c(r,phi),d(r,phi)]). In Maxima: >> >> Maxima 5.23.2 http://maxima.sourceforge.net >> using Lisp SBCL 1.0.43 >> 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) kill(all); >> (%o0) done >> (%i1) load(itensor); >> STYLE-WARNING: redefining MAXIMA::$NAME in DEFUN >> STYLE-WARNING: redefining MAXIMA::DERIV in DEFUN >> STYLE-WARNING: redefining MAXIMA::SDIFF in DEFUN >> STYLE-WARNING: redefining MAXIMA::I-$DEPENDENCIES in DEFUN >> STYLE-WARNING: redefining MAXIMA::$DECSYM in DEFUN >> STYLE-WARNING: redefining MAXIMA::$CANFORM in DEFUN >> (%o1) /usr/local/share/maxima/5.23.2/share/tensor/itensor.lisp >> (%i2) load(ctensor); >> (%o2) /usr/local/share/maxima/5.23.2/share/tensor/ctensor.mac >> (%i3) iframe_flag:true; >> (%o3) true >> (%i4) ishow(covdiff(V([],[j]),j)); >> j j %1 >> (%t4) V + icc2 V >> ,j %1 j >> (%o4) V([], [j], j) + icc2([%1, j], [j]) V([], [%1]) >> (%i5) ishow(ev(%,icc2)); >> %1 j j >> (%t5) V ifc2 + V >> %1 j ,j >> (%o5) V([], [%1]) ifc2([%1, j], [j]) + V([], [j], j) >> (%i6) ishow(ev(%,ifc2,ifc1)); >> %1 j %2 >> V ifg (ifb - ifb + ifb ) >> j %2 %1 %2 %1 j %1 j %2 j >> (%t6) -------------------------------------------------- + V >> 2 ,j >> (%o6) (V([], [%1]) ifg([], [j, %2]) (ifb([j, %2, %1]) - ifb([%2, %1, j]) >> + ifb([%1, j, %2])))/2 + V([], >> [j], j) >> (%i7) expr:contract(ratexpand(%)); >> V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) >> (%o7) ------------------------------------------------- >> 2 >> V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) >> - ------------------------------------------------- >> 2 >> V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) >> + ------------------------------------------------- + V([], [j], j) >> 2 >> (%i8) ishow(expr); >> %1 j %2 %1 j %2 %1 j %2 >> V ifg ifb V ifg ifb V ifg ifb >> j %2 %1 %2 %1 j >> %1 >> j %2 >> (%t8) ---------------------- - ---------------------- + >> ---------------------- >> 2 2 2 >> j >> + >> >> V >> ,j >> V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) >> (%o8) ------------------------------------------------- >> 2 >> V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) >> - ------------------------------------------------- >> 2 >> V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) >> + ------------------------------------------------- + V([], [j], j) >> 2 >> (%i9) eqn:ishow(eq=expr); >> %1 j %2 %1 j %2 >> V ifg ifb V ifg ifb >> j %2 %1 %2 %1 j >> (%t9) eq = ---------------------- - ---------------------- >> 2 2 >> %1 j %2 >> V ifg ifb >> %1 j >> %2 j >> + >> ---------------------- >> + V >> 2 >> >> ,j >> V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) >> (%o9) eq = ------------------------------------------------- >> 2 >> V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) >> - ------------------------------------------------- >> 2 >> V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) >> + ------------------------------------------------- + V([], [j], j) >> 2 >> (%i10) ceqn:ic_convert(eqn); >> STYLE-WARNING: redefining MAXIMA::$IC_CONVERT in DEFUN >> STYLE-WARNING: redefining MAXIMA::$MAKEBOX in DEFUN >> STYLE-WARNING: redefining MAXIMA::$CONMETDERIV in DEFUN >> STYLE-WARNING: redefining MAXIMA::$IGEODESIC_COORDS in DEFUN >> (%o10) eq : >> sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, 1, >> dim) >> %1 j, %2 j, %2, %1 >> --------------------------------------------------------------------------- >> 2 >> sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, >> 1, >> dim) >> %1 j, %2 %2, %1, j >> - >> --------------------------------------------------------------------------- >> 2 >> sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, >> 1, >> dim) >> %1 j, %2 %1, j, %2 >> + >> --------------------------------------------------------------------------- >> 2 >> + sum(diff(V , ct_coords ), j, 1, dim) >> j j >> (%i11) ct_coordsys(polar); >> (%o11) done >> (%i12) depends(V,ct_coords); >> (%o12) [V(r, phi)] >> (%i13) ev(ceqn); >> d d >> (%o13) ---- (V ) + -- (V ) + (V ifg ifb + V ifg ifb >> dphi 2 dr 1 2 2, 2 2, 2, 2 1 2, 2 2, >> 2, 1 >> + V ifg ifb + V ifg ifb + ifg ifb V >> 2 2, 1 2, 1, 2 1 2, 1 2, 1, 1 1, 2 1, 2, 2 >> 2 >> + ifg ifb V + V ifg ifb + V ifg ifb >> )/2 >> 1, 1 1, 1, 2 2 1 1, 2 1, 2, 1 1 1, 1 1, 1, >> 1 >> + (V ifg ifb + V ifg ifb + V ifb ifg >> 2 2, 2 2, 2, 2 2 2, 1 2, 2, 1 1 1, 2, 2 2, >> 2 >> + ifg V ifb + ifg V ifb + V ifb ifg >> 1, 2 2 2, 1, 2 1, 1 2 2, 1, 1 1 1, 2, 1 2, >> 1 >> + V ifb ifg + V ifg ifb )/2 >> 1 1, 1, 2 1, 2 1 1, 1 1, 1, 1 >> - (V ifg ifb + ifg V ifb + V ifb ifg >> 2 2, 2 2, 2, 2 1, 2 2 2, 2, 1 1 2, 1, 2 2, >> 2 >> + V ifg ifb + ifb V ifg + V ifb ifg >> 1 1, 2 2, 1, 1 1, 2, 2 2 2, 1 1 1, 1, 2 2, >> 1 >> + ifg ifb V + V ifg ifb )/2 >> 1, 1 1, 2, 1 2 1 1, 1 1, 1, 1 >> (%i14) >> >> What should I do next ? >> > > -- Yaroslav From mathew.gwynne at gmail.com Sun Feb 13 13:19:34 2011 From: mathew.gwynne at gmail.com (Matthew Gwynne) Date: Sun, 13 Feb 2011 19:19:34 +0000 Subject: [Maxima] Can't set linel to large value? Message-ID: Hi, We are trying to generate files with very large line lengths and so, at some point, we set linel to 10001, and then print using redirected ouput. However, we get this error: > linel : 10001; assignment: cannot assign 10001 to linel Does anyone have any idea why this is? Is there any way we can prevent this? Is is something at the lisp level? Thanks! Matthew Gwynne http://cs.swan.ac.uk/~csmg/ From vttoth at vttoth.com Sun Feb 13 13:42:27 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Sun, 13 Feb 2011 14:42:27 -0500 Subject: [Maxima] itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis In-Reply-To: References: <01f401cbc7c7$db6f87d0$924e9770$@vttoth.com> <008301cbc8b9$d114b010$733e1030$@vttoth.com> Message-ID: <01c801cbcbb6$2828a5b0$7879f110$@vttoth.com> Please don't hesitate to correct me if I am wrong, but it seems to me that you are expecting the result to be expressed in the coordinate base, when in fact it is expressed in the frame base. To go to the coordinate base, you need to spell out the components of V in the coordinate base. Modifying your example below, I added the symbol W to represent the vector in the coordinate base: load(itensor); load(ctensor); iframe_flag:true; cframe_flag:true; ct_coordsys(polar)$ depends([V,ifg,ifr,ifri],ct_coords)$ ishow(covdiff(V([],[j]),j))$ ishow(ev(%,icc2,ifc2,ifc1,ifb))$ eqn:eq=%$ ceqn:ic_convert(rename(expand(eqn)))$ ceqn:subst(ifri,nounify(ifri),ceqn)$ ifg:matrix([1,0],[0,1]); ifr:matrix([1,0],[0,1/r]); ifri:matrix([1,0],[0,r]); ceqn,'ifr,'ifg; depends(W,ct_coords); %th(2),V=([W[1],W[2]].transpose(ifr))[1]$ %,diff; d ---- (W ) W dphi 2 1 d (%o18) --------- + -- + -- (W ) r r dr 1 Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Yaroslav Alekseev Sent: Sunday, February 13, 2011 1:09 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis Viktor T. Toth ?????(?) ? ????? ?????? Thu, 10 Feb 2011 03:31:01 +0300: > OK, I think I understand the problem. At the root is the fact that > ic_convert uses noun forms of ifg, ifr, and ifri. Then, we run into > something that may or may not be a Maxima buglet: > > (%i1) depends(y,x); > (%o1) [y(x)] > (%i2) diff(y,x); > dy > (%o2) -- > dx > (%i3) diff(y[0],x); > d > (%o3) -- (y ) > dx 0 > (%i4) diff('y,x); > dy > (%o4) -- > dx > (%i5) diff('y[0],x); > (%o5) 0 > > Personally I think this is a bug, but fortunately, there is a way to > work around it within the confines of the tensor libraries. Your example > could be written thus: > > load(itensor); > load(ctensor); > iframe_flag:true; > cframe_flag:true; > ct_coordsys(polar)$ > depends([V,ifg,ifr,ifri],ct_coords)$ > ishow(covdiff(V([],[j]),j))$ > ishow(ev(%,icc2,ifc2,ifc1,ifb))$ > eqn:eq=%$ > ceqn:ic_convert(rename(expand(eqn)))$ > ceqn:subst(ifri,nounify(ifri),ceqn)$ > ifg:matrix([1,0],[0,1]); > ifr:matrix([1,0],[0,1/r]); > ifri:matrix([1,0],[0,r]); > ceqn,'ifr,'ifg; > V > 1 d d > (%o15) -- + ---- (V ) + -- (V ) > r dphi 2 dr 1 But V_1 and V_2 should have equal physical dimension (since ifg:matrix([1,0],[0,1])). It seems to me that the correct answer should be: d ---- (V ) V dphi 2 1 d --------- + -- + -- (V ) r r dr 1 > > The critical line is the ceqn:subst(...) line, which substitutes the > verb form of ifri before diff is evaluated. > > > Viktor > > > > > > > -----Original Message----- > From: Yaroslav Alekseev [mailto:yaalekseev at rambler.ru] > Sent: Wednesday, February 09, 2011 6:52 PM > To: maxima at math.utexas.edu; Viktor T. Toth > Subject: Re: [Maxima] itensor and ctensor: indexed objects in moving > frames in specific coordinate systems and frame basis > > Viktor T. Toth ?????(?) ? ????? ?????? Tue, 08 Feb > 2011 22:39:04 +0300: > >> I think the only step missing is an evaluation of ifb before converting >> to a >> ctensor expression. Try this: >> >> load(itensor); >> load(ctensor); >> iframe_flag:true; >> cframe_flag:true; >> ct_coordsys(polar)$ >> depends([V,ifg,ifr,ifri],ct_coords)$ >> ishow(covdiff(V([],[j]),j))$ >> ishow(ev(%,icc2,ifc2,ifc1,ifb))$ >> eqn:eq=%$ >> ceqn:ic_convert(eqn)$ >> ev(ceqn); >> >> A word of warning: Presently, ic_convert has no explicit knowledge about >> the >> meaning of the symbols ifg, ifr, and ifri. It just treats them as it >> would >> treat any other indexed objects. In the present example, it is not >> relevant >> as the symbols cancel; in other cases, however, you may need to take >> steps >> to identify the itensor symbols ifr, ifri, and ifg with the >> corresponding >> ctensor matrices fri, ifri, and lfg/ufg as appropriate. >> >> >> Viktor > > Ok, thank you for response. > I have to define symbols ifr, ifri, and ifg. So, I've tried this: > > load(itensor); > load(ctensor); > iframe_flag:true; > cframe_flag:true; > ct_coordsys(polar)$ > depends(V,ct_coords)$ > ishow(covdiff(V([],[j]),j))$ > ishow(ev(%,icc2,ifc2,ifc1,ifb))$ > eqn:eq=%$ > ceqn:ic_convert(eqn)$ > ifg:matrix([1,0],[0,1]); > fri:matrix([1,0],[0,1/r]); > ifri:matrix([1,0],[0,r]); > ev(ceqn); > > But I've got very strange answer: > > > (%i14) ev(ceqn); > d d > (%o14) ---- (V ) + -- (V ) > dphi 2 dr 1 > > It seems to me that the answer should be something like this (ordinary > divergence): > > > dV2 > ---- > dphi dV1 V1 > (%o21) ---- + --- + -- > r dr r > > > >> >> >> >> -----Original Message----- >> From: maxima-bounces at math.utexas.edu >> [mailto:maxima-bounces at math.utexas.edu] >> On Behalf Of Yaroslav Alekseev >> Sent: Tuesday, February 08, 2011 2:38 PM >> To: maxima at math.utexas.edu >> Subject: [Maxima] itensor and ctensor: indexed objects in moving frames >> in >> specific coordinate systems and frame basis >> >> >> Hi to all! I need to learn how to compute various expressions with >> indexed >> objects in moving frames >> in specific coordinate systems and frame basis. For example: to compute >> contract(covdiff(V([],[j]),j)) >> in polar coordinate and frame >> basis:matrix([a(r,phi),b(r,phi)],[c(r,phi),d(r,phi)]). In Maxima: >> >> Maxima 5.23.2 http://maxima.sourceforge.net >> using Lisp SBCL 1.0.43 >> 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) kill(all); >> (%o0) done >> (%i1) load(itensor); >> STYLE-WARNING: redefining MAXIMA::$NAME in DEFUN >> STYLE-WARNING: redefining MAXIMA::DERIV in DEFUN >> STYLE-WARNING: redefining MAXIMA::SDIFF in DEFUN >> STYLE-WARNING: redefining MAXIMA::I-$DEPENDENCIES in DEFUN >> STYLE-WARNING: redefining MAXIMA::$DECSYM in DEFUN >> STYLE-WARNING: redefining MAXIMA::$CANFORM in DEFUN >> (%o1) /usr/local/share/maxima/5.23.2/share/tensor/itensor.lisp >> (%i2) load(ctensor); >> (%o2) /usr/local/share/maxima/5.23.2/share/tensor/ctensor.mac >> (%i3) iframe_flag:true; >> (%o3) true >> (%i4) ishow(covdiff(V([],[j]),j)); >> j j %1 >> (%t4) V + icc2 V >> ,j %1 j >> (%o4) V([], [j], j) + icc2([%1, j], [j]) V([], [%1]) >> (%i5) ishow(ev(%,icc2)); >> %1 j j >> (%t5) V ifc2 + V >> %1 j ,j >> (%o5) V([], [%1]) ifc2([%1, j], [j]) + V([], [j], j) >> (%i6) ishow(ev(%,ifc2,ifc1)); >> %1 j %2 >> V ifg (ifb - ifb + ifb ) >> j %2 %1 %2 %1 j %1 j %2 j >> (%t6) -------------------------------------------------- + V >> 2 ,j >> (%o6) (V([], [%1]) ifg([], [j, %2]) (ifb([j, %2, %1]) - ifb([%2, %1, j]) >> + ifb([%1, j, %2])))/2 + V([], >> [j], j) >> (%i7) expr:contract(ratexpand(%)); >> V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) >> (%o7) ------------------------------------------------- >> 2 >> V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) >> - ------------------------------------------------- >> 2 >> V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) >> + ------------------------------------------------- + V([], [j], j) >> 2 >> (%i8) ishow(expr); >> %1 j %2 %1 j %2 %1 j %2 >> V ifg ifb V ifg ifb V ifg ifb >> j %2 %1 %2 %1 j >> %1 >> j %2 >> (%t8) ---------------------- - ---------------------- + >> ---------------------- >> 2 2 2 >> j >> + >> >> V >> ,j >> V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) >> (%o8) ------------------------------------------------- >> 2 >> V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) >> - ------------------------------------------------- >> 2 >> V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) >> + ------------------------------------------------- + V([], [j], j) >> 2 >> (%i9) eqn:ishow(eq=expr); >> %1 j %2 %1 j %2 >> V ifg ifb V ifg ifb >> j %2 %1 %2 %1 j >> (%t9) eq = ---------------------- - ---------------------- >> 2 2 >> %1 j %2 >> V ifg ifb >> %1 j >> %2 j >> + >> ---------------------- >> + V >> 2 >> >> ,j >> V([], [%1]) ifg([], [j, %2]) ifb([j, %2, %1], []) >> (%o9) eq = ------------------------------------------------- >> 2 >> V([], [%1]) ifg([], [j, %2]) ifb([%2, %1, j], []) >> - ------------------------------------------------- >> 2 >> V([], [%1]) ifg([], [j, %2]) ifb([%1, j, %2], []) >> + ------------------------------------------------- + V([], [j], j) >> 2 >> (%i10) ceqn:ic_convert(eqn); >> STYLE-WARNING: redefining MAXIMA::$IC_CONVERT in DEFUN >> STYLE-WARNING: redefining MAXIMA::$MAKEBOX in DEFUN >> STYLE-WARNING: redefining MAXIMA::$CONMETDERIV in DEFUN >> STYLE-WARNING: redefining MAXIMA::$IGEODESIC_COORDS in DEFUN >> (%o10) eq : >> sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, 1, >> dim) >> %1 j, %2 j, %2, %1 >> --------------------------------------------------------------------------- >> 2 >> sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, >> 1, >> dim) >> %1 j, %2 %2, %1, j >> - >> --------------------------------------------------------------------------- >> 2 >> sum(sum(sum(V ifg ifb , %1, 1, dim), %2, 1, dim), j, >> 1, >> dim) >> %1 j, %2 %1, j, %2 >> + >> --------------------------------------------------------------------------- >> 2 >> + sum(diff(V , ct_coords ), j, 1, dim) >> j j >> (%i11) ct_coordsys(polar); >> (%o11) done >> (%i12) depends(V,ct_coords); >> (%o12) [V(r, phi)] >> (%i13) ev(ceqn); >> d d >> (%o13) ---- (V ) + -- (V ) + (V ifg ifb + V ifg ifb >> dphi 2 dr 1 2 2, 2 2, 2, 2 1 2, 2 2, >> 2, 1 >> + V ifg ifb + V ifg ifb + ifg ifb V >> 2 2, 1 2, 1, 2 1 2, 1 2, 1, 1 1, 2 1, 2, 2 >> 2 >> + ifg ifb V + V ifg ifb + V ifg ifb >> )/2 >> 1, 1 1, 1, 2 2 1 1, 2 1, 2, 1 1 1, 1 1, 1, >> 1 >> + (V ifg ifb + V ifg ifb + V ifb ifg >> 2 2, 2 2, 2, 2 2 2, 1 2, 2, 1 1 1, 2, 2 2, >> 2 >> + ifg V ifb + ifg V ifb + V ifb ifg >> 1, 2 2 2, 1, 2 1, 1 2 2, 1, 1 1 1, 2, 1 2, >> 1 >> + V ifb ifg + V ifg ifb )/2 >> 1 1, 1, 2 1, 2 1 1, 1 1, 1, 1 >> - (V ifg ifb + ifg V ifb + V ifb ifg >> 2 2, 2 2, 2, 2 1, 2 2 2, 2, 1 1 2, 1, 2 2, >> 2 >> + V ifg ifb + ifb V ifg + V ifb ifg >> 1 1, 2 2, 1, 1 1, 2, 2 2 2, 1 1 1, 1, 2 2, >> 1 >> + ifg ifb V + V ifg ifb )/2 >> 1, 1 1, 2, 1 2 1 1, 1 1, 1, 1 >> (%i14) >> >> What should I do next ? >> > > -- Yaroslav _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From richhen2008 at gmail.com Sun Feb 13 13:53:02 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Sun, 13 Feb 2011 14:53:02 -0500 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: <4D55516F.5040105@eecs.berkeley.edu> References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> Message-ID: To satisfy everybody there is the following way. I defined two functions. "|" and nth_roots(), | is a infix operator which performs multiplication when both arguments are lists. Here is the output. (%i1) n_roots(-3,3); 5/6 1/3 5/6 1/3 3 %i - 3 3 %i + 3 1/3 (%o1) [- --------------, --------------, - 3 ] 2 2 (%i2) display2d:false; (%o2) false (%i3) n_roots(2,2); (%o3) [-sqrt(2),sqrt(2)] (%i4) n_roots(3,5) | n_roots(-2,3); (%o4) [-2^(1/3)*3^(1/5),3^(1/5)*(2^(1/3)*sqrt(3)*%i+2^(1/3))/2,-3^(1/5)*(2^(1/3)*sqrt(3)*%i-2^(1/3))/2,-2^(1/3)*3^(1/5)*%e^-(2*%i*%pi/5),3^(1/5)*(2^(1/3)*sqrt(3)*%i+2^(1/3))*%e^-(2*%i*%pi/5)/2, -3^(1/5)*(2^(1/3)*sqrt(3)*%i-2^(1/3))*%e^-(2*%i*%pi/5)/2,-2^(1/3)*3^(1/5)*%e^-(4*%i*%pi/5),3^(1/5)*(2^(1/3)*sqrt(3)*%i+2^(1/3))*%e^-(4*%i*%pi/5)/2, -3^(1/5)*(2^(1/3)*sqrt(3)*%i-2^(1/3))*%e^-(4*%i*%pi/5)/2,-2^(1/3)*3^(1/5)*%e^(4*%i*%pi/5),3^(1/5)*(2^(1/3)*sqrt(3)*%i+2^(1/3))*%e^(4*%i*%pi/5)/2,-3^(1/5)*(2^(1/3)*sqrt(3)*%i-2^(1/3))*%e^(4*%i*%pi/5)/2, -2^(1/3)*3^(1/5)*%e^(2*%i*%pi/5),3^(1/5)*(2^(1/3)*sqrt(3)*%i+2^(1/3))*%e^(2*%i*%pi/5)/2,-3^(1/5)*(2^(1/3)*sqrt(3)*%i-2^(1/3))*%e^(2*%i*%pi/5)/2] (%i5) Here is the code. The multiplication or addition of all of the roots of the two numbers can be a very complicated expression. In this case the list length = 5*3 = 15. That is why you need |. You can't overload * directly, I tried but got an error about * is a built in operator. You would need to handle + to when both sides are lists. Here is the code, it is very simple. It allows for multiple answers to a root calculation and comes very close to the definition that x^(1/n) = solve([y^(1/n)=x], y); n_roots(__c,__n):= block( [_x], map(lambda([_z], rhs(_z)), solve(_x^__n=__c,_x)) ); infix("|", 135, 135); infix("++", 101,101); "|"(_l1,_l2):= block ( [_ans:[]], if listp(_l1) and listp(_l2) then ( for _p in _l1 do ( for _q in _l2 do ( _ans : cons(_p*_q, _ans) ) ) ) elseif listp(_l1) and not listp(_l2) or listp(_l2) and not listp(_l1) then ( _ans : _l2 * _l1 ) else ( _ans : _l2 * _l1 ), _ans )$ "++"(_l1,_l2):= block ( [_ans:[]], if listp(_l1) and listp(_l2) then ( for _p in _l1 do ( for _q in _l2 do ( _ans : cons(_p+_q, _ans) ) ) ) elseif listp(_l1) and not listp(_l2) or listp(_l2) and not listp(_l1) then ( _ans : _l2 + _l1 ) else ( _ans : _l2 + _l1 ), _ans )$ This is possible to do in Maxima 5.23.2 so you don't need to worry about sqrt(x^2) = abs(x) if you use n_roots(x^2,2). I am not sure I like the name n_roots(), I was calling it nth_root() at some point but that is not so great either. The multitude of all possible answers is explicit in this case, you can get very long lists when multiplication or addition is involved. n_roots(x^2,2); [- x, x] Rich ----Original Message----- From: Richard Fateman Sent: Friday, February 11, 2011 10:10 AM To: Ren? K?lin Cc: maxima at math.utexas.edu Subject: Re: [Maxima] sqrt(x)*sqrt(x) On 2/9/2011 11:50 PM, "Ren? K?lin" wrote: > Hello > > I tried this (with Maxima 5.21.1): > > domain:real$ > t:x^(1/2)*x^(1/2); > assume(x<0); > t; > forget(x<0)$ > assume(x>=0); > t; > > with the output: > > (%o2) x > (%o3) [x<0] > (%o4) x > (%o6) [x>=0] > (%o7) x > > I only want to consider some real numbers. Because the squareroot of x is > not defined for x<0, %o4 is wrong, isn't it? > > The Problem seems to be that t:x^(1/2)*x^(1/2) is simplified immediately > to x in any case. > > (I sent this post 2 days ago with a wrong title. Sorry if you received it > twice.) It seems hopeless to point out that x>0 does not mean that sqrt(x)>0, mathematically. There are 2 square roots. For example sqrt(16) is {-4, 4}, even though 16>0. The square root of x, for x<0 IS defined. It just happens to be imaginary. There is no simple way of making Maxima forget about complex numbers, even if you decide that certain of the inputs represent real numbers. What you seem to be insisting on is not that x>0, but that sqrt(x)>=0. Perhaps you should define a new function positive_sqrt(x):= .... if (x<0) then error else .... Yes, I know that in Maxima sqrt(z^2) comes out abs(z), but if you do assume(z>0), then abs(z) comes out as z. This first step, sqrt(z^2) to abs(z) is, in general, wrong, so there you are, with the subsequent step propagating the questionable result. _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Sun Feb 13 14:30:52 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 13 Feb 2011 13:30:52 -0700 Subject: [Maxima] Can't set linel to large value? In-Reply-To: References: Message-ID: On 2/13/11, Matthew Gwynne wrote: > We are trying to generate files with very large line lengths and so, > at some point, we set linel to 10001, and then print using redirected > ouput. However, we get this error: > >> linel : 10001; > assignment: cannot assign 10001 to linel Well, I see that MSETCHK in src/mlisp.lisp has this hard-coded limit in it ... seems pointless. Anyway you can work around it like this: :lisp (setq $linel 10001 linel 10001) HTH Robert Dodier From dbmaxima at gmail.com Sun Feb 13 14:40:55 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Mon, 14 Feb 2011 07:40:55 +1100 Subject: [Maxima] wxMaxima-Maxima connection failure In-Reply-To: <5CD78996B8F8844D963C875D3159B94A01112104@dsrcorreo> References: <5CD78996B8F8844D963C875D3159B94A01112104@dsrcorreo> Message-ID: <4D5841D7.1020502@gmail.com> On 14/02/2011 12:20 AM, Rub?n Roa wrote: > > Alternatively (but not so good), how can I use Maxima directly, > without calling it from the Tcl/Tk GUI? (that will no connect to the > algebraic engine anyways) > There should be a shortcut "Command line maxima" in the same group as xmaxima and wxmaxima. If not, look in C:\Program Files\Maxima-5.x.y\bin\ See if this works. If not, then it may well point to a deeper problem. -------------- next part -------------- An HTML attachment was scrubbed... URL: From yaalekseev at rambler.ru Sun Feb 13 15:58:21 2011 From: yaalekseev at rambler.ru (Yaroslav Alekseev) Date: Mon, 14 Feb 2011 00:58:21 +0300 Subject: [Maxima] defcon in itensor Message-ID: Hi to all! How to define the property: contarct(V([],[j])*V([j],[]))=1 ? I get from Maxima: Maxima 5.23.2 http://maxima.sourceforge.net using Lisp SBCL 1.0.43 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) load(itensor); STYLE-WARNING: redefining MAXIMA::$NAME in DEFUN STYLE-WARNING: redefining MAXIMA::DERIV in DEFUN STYLE-WARNING: redefining MAXIMA::SDIFF in DEFUN STYLE-WARNING: redefining MAXIMA::I-$DEPENDENCIES in DEFUN STYLE-WARNING: redefining MAXIMA::$DECSYM in DEFUN STYLE-WARNING: redefining MAXIMA::$CANFORM in DEFUN (%o1) /usr/local/share/maxima/5.23.2/share/tensor/itensor.lisp (%i2) imetric(g); (%o2) done (%i3) defcon(V,V,1); (%o3) done (%i4) contract(V([],[j])*V([j],[])); apply: found 1 where a function was expected. -- an error. To debug this try: debugmode(true); (%i5) -- Yaroslav From vttoth at vttoth.com Sun Feb 13 15:01:33 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Sun, 13 Feb 2011 16:01:33 -0500 Subject: [Maxima] defcon in itensor In-Reply-To: References: Message-ID: <01d901cbcbc1$3533b960$9f9b2c20$@vttoth.com> This is one way: components(ONE([],[]),1); defcon(V,V,ONE); Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Yaroslav Alekseev Sent: Sunday, February 13, 2011 4:58 PM To: maxima at math.utexas.edu Subject: [Maxima] defcon in itensor Hi to all! How to define the property: contarct(V([],[j])*V([j],[]))=1 ? I get from Maxima: Maxima 5.23.2 http://maxima.sourceforge.net using Lisp SBCL 1.0.43 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) load(itensor); STYLE-WARNING: redefining MAXIMA::$NAME in DEFUN STYLE-WARNING: redefining MAXIMA::DERIV in DEFUN STYLE-WARNING: redefining MAXIMA::SDIFF in DEFUN STYLE-WARNING: redefining MAXIMA::I-$DEPENDENCIES in DEFUN STYLE-WARNING: redefining MAXIMA::$DECSYM in DEFUN STYLE-WARNING: redefining MAXIMA::$CANFORM in DEFUN (%o1) /usr/local/share/maxima/5.23.2/share/tensor/itensor.lisp (%i2) imetric(g); (%o2) done (%i3) defcon(V,V,1); (%o3) done (%i4) contract(V([],[j])*V([j],[])); apply: found 1 where a function was expected. -- an error. To debug this try: debugmode(true); (%i5) -- Yaroslav _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From yaalekseev at rambler.ru Sun Feb 13 16:09:19 2011 From: yaalekseev at rambler.ru (Yaroslav Alekseev) Date: Mon, 14 Feb 2011 01:09:19 +0300 Subject: [Maxima] defcon in itensor In-Reply-To: <01d901cbcbc1$3533b960$9f9b2c20$@vttoth.com> References: <01d901cbcbc1$3533b960$9f9b2c20$@vttoth.com> Message-ID: Thanks a lot! > This is one way: > > components(ONE([],[]),1); > defcon(V,V,ONE); > > > Viktor > > > > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] > On Behalf Of Yaroslav Alekseev > Sent: Sunday, February 13, 2011 4:58 PM > To: maxima at math.utexas.edu > Subject: [Maxima] defcon in itensor > > > Hi to all! > How to define the property: contarct(V([],[j])*V([j],[]))=1 ? > I get from Maxima: > > Maxima 5.23.2 http://maxima.sourceforge.net > using Lisp SBCL 1.0.43 > 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) load(itensor); > STYLE-WARNING: redefining MAXIMA::$NAME in DEFUN > STYLE-WARNING: redefining MAXIMA::DERIV in DEFUN > STYLE-WARNING: redefining MAXIMA::SDIFF in DEFUN > STYLE-WARNING: redefining MAXIMA::I-$DEPENDENCIES in DEFUN > STYLE-WARNING: redefining MAXIMA::$DECSYM in DEFUN > STYLE-WARNING: redefining MAXIMA::$CANFORM in DEFUN > (%o1) /usr/local/share/maxima/5.23.2/share/tensor/itensor.lisp > (%i2) imetric(g); > (%o2) done > (%i3) defcon(V,V,1); > (%o3) done > (%i4) contract(V([],[j])*V([j],[])); > > apply: found 1 where a function was expected. > -- an error. To debug this try: debugmode(true); > (%i5) > > -- Yaroslav From pip at iszf.irk.ru Sun Feb 13 15:25:32 2011 From: pip at iszf.irk.ru (Valery Pipin) Date: Sun, 13 Feb 2011 13:25:32 -0800 Subject: [Maxima] itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis In-Reply-To: <01c801cbcbb6$2828a5b0$7879f110$@vttoth.com> References: <01c801cbcbb6$2828a5b0$7879f110$@vttoth.com> Message-ID: <201102131325.32567.pip@iszf.irk.ru> I would say > Please don't hesitate to correct me if I am wrong, but it seems to me that > you are expecting the result to be expressed in the coordinate base, the text books (unfortunately not Landay -Lifshitz, you can look to Mizner Torn, Wheeler, or B Schutz) call this orthonormal but non-coordinate basis. For this basis, product of the basis components is the unit matrix. While the answer in this basis looks, sometimes, simplier, it is not good for the calculus purpose. For example, the curl of the velocity flow in the spherical coordinates load("itensor.lisp"); if get('ctensor, 'version) = false then load(ctensor); /* define dimension and the name for the metric */ idim(3); remcomps(g); imetric(g); /*define the components of the curl using the Levi-Chevitta symbol*/ remcomps(curlc); components(curlc([],[i]),'levi_civita([],[i,n,m])*covdiff(V([m],[]),n)); /* show them */ eqn :ishow(curl([],[i]) =canform(rename(expand(curlc([],[i])))))$ /* convert itensor's curl ctensor format*/ display2d:false; eqnc : ic_convert(eqn); /* define coordinates */ ct_coords:[r,th,ph]; depends([Vr,Vt,Om],[r,th]); /* NB! the proper factors for covariant basis, which is used by ctensor*/ V:[Vr,Vt*r,Om*r^2*sin(th)^2]; /*define the metric and compute connectivity componentets of the metrics*/ lg:matrix([1,0,0],[0,r^2,0],[0,0,r^2*sin(th)^2])$ dlt:matrix([1,0,0],[0,1,0],[0,0,1])$ ug:invert(lg)$ christof(all); /*NB! this a metric factor for the curl! */ sgdet:r^2*sin(th); /* Below is ctensor loop to compute components */ /* I replace 'levi_civita[%1,%2,i] -> lc0([%1,%2,i])/sgdet */ /* This should be implemented somehow in a future */ for i thru dim do curl[i]:sum(sum(lc0([%1,%2,i])/sgdet*diff(V[%2],ct_coords[%1]),%1, 1,dim),%2,1,dim) -sum(sum(sum(lc0([%1,%2,i])/sgdet*mcs[%1,%2,%3]*V[%3],%1, 1,dim),%2,1,dim),%3,1,dim) display2d:true; ratexpand(trigsimp(ratexpand(curl[1]))); /* gives*/ 'diff(Om,th,1)*sin(th)+2*Om*cos(th) ratexpand(trigsimp(ratexpand(r*curl[2]))); /* gives*/ -'diff(Om,r,1)*r*sin(th)-2*Om*sin(th) ratexpand(trigsimp(ratexpand(r*sin(th)*curl[3]))); /* gives*/ 'diff(Vt,r,1)+Vt/r-'diff(Vr,th,1)/r FWIW Valery From vi5u0-maxima at yahoo.co.uk Sun Feb 13 16:39:16 2011 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Sun, 13 Feb 2011 22:39:16 +0000 (GMT) Subject: [Maxima] Applying Boundary Conditions at Infinity? In-Reply-To: References: Message-ID: On Sun, 30 Jan 2011, Chris Nassar wrote: > I'm trying to solve the differential equation A*p''(x)-p(x)/B=0 with the > boundary conditions that p(infinity)=0 and p(xn)=pn. > Maxima easily finds the general solution. > ode2(A*'diff(p,x,2)-p/B,p,x); > Is A B positive or negative? > p > x x > --------------- - --------------- > sqrt(A) sqrt(B) sqrt(A) sqrt(B) > (%o1) p = %k1 %e + %k2 %e > Applying the boundary conditions does not give the expected result > bc2(%o1,x=inf,p=0,x=xn,p=pn); > Maxima treats infinity as just another variable. Can I make maxima figure > out that for p(infinity)=0 %k1 must be 0? Since I know the answer I can > just set %k1 to zero, but it does not seem like a satisfactory solution. > I couldn't find anything in the manual about it. > Any help would be appreciated. No other takers? Have you considered a change of independent variable to something like u = 1-exp(xn-x) , to map the problem onto a finite domain? Now a question of my own: could one do something equivalent to this if the homogeneous far-field condition were on the first derivative of p, rather than on p itself? -- HTH, and thanks, Dan From willisb at unk.edu Sun Feb 13 17:02:14 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 13 Feb 2011 17:02:14 -0600 Subject: [Maxima] Applying Boundary Conditions at Infinity? In-Reply-To: References: , Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >>?I'm?trying?to?solve?the?differential?equation?A*p''(x)-p(x)/B=0?with?the >>?boundary?conditions?that?p(infinity)=0?and?p(xn)=pn. I don't know anything about how bc2 works--maybe it a boundary at infinity is outside its ability. Maybe this works: --> ode2(A*'diff(p,x,2)-p/B,p,x); "Is "A*B" positive or negative?"pos; (%o35) p=%k1*%e^(x/(sqrt(A)*sqrt(B)))+%k2*%e^(-x/(sqrt(A)*sqrt(B))) (%i36) sol : bc2(%,x=xxx,p=0,x=xn,p=pn); (%o36) p=(pn*%e^((2*xxx)/(sqrt(A)*sqrt(B))+xn/(sqrt(A)*sqrt(B))-x/(sqrt(A)*sqrt(B))))/(%e^((2*xxx)/(sqrt(A)*sqrt(B)))-%e^((2*xn)/(sqrt(A)*sqrt(B))))-(pn*%e^(xn/(sqrt(A)*sqrt(B))+x/(sqrt(A)*sqrt(B))))/(%e^((2*xxx)/(sqrt(A)*sqrt(B)))-%e^((2*xn)/(sqrt(A)*sqrt(B)))) (%i38) lhs(sol) = gruntz(rhs(sol),xxx,inf); (%o38) p=pn*%e^(xn/(sqrt(A)*sqrt(B))-x/(sqrt(A)*sqrt(B))) Replacing gruntz with limit or tlimit fails, I think. --Barton From drdieterkaiser at web.de Sun Feb 13 18:09:19 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 14 Feb 2011 01:09:19 +0100 Subject: [Maxima] Can't set linel to large value? In-Reply-To: References: Message-ID: <1297642159.624.15.camel@dieter> Am Sonntag, den 13.02.2011, 13:30 -0700 schrieb Robert Dodier: > On 2/13/11, Matthew Gwynne wrote: > > > We are trying to generate files with very large line lengths and so, > > at some point, we set linel to 10001, and then print using redirected > > ouput. However, we get this error: > > > >> linel : 10001; > > assignment: cannot assign 10001 to linel > > Well, I see that MSETCHK in src/mlisp.lisp has this hard-coded > limit in it ... seems pointless. Anyway you can work around it > like this: > > :lisp (setq $linel 10001 linel 10001) It was possible to crash Maxima, when assigning a very big value to linel. We had a posting from a user about this topic on the mailing list and a bug report. This was the reason, I had introduced an upper limit for the assignment to linel. The chosen upper limit of 10,000 is somewhat arbitrary. An upper limit of 10^5 and perhaps 10^6 will work for SBCL, too. Dieter Kaiser From l.butler at ed.ac.uk Sun Feb 13 18:27:31 2011 From: l.butler at ed.ac.uk (Leo T Butler) Date: Mon, 14 Feb 2011 00:27:31 +0000 Subject: [Maxima] build-index, cl-ppcre and github Message-ID: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> Hello, I have put together a version of Maxima that incorporates cl-ppcre and a new way of building info indexes, as discussed in December (http://www.math.utexas.edu/pipermail/maxima/2010/023435.html). 1. info indexes: Amongst the changes, I have exposed two user-level functions -setup_help_database & -print_help_database The former takes an optional list of master info files; the default behaviour is to use the default master info file as previously. The latter prints out a lisp file of the current info hashtables. The invocation: setup_help_database(); print_help_database("maxima-index.lisp"); emulates the old build_index.pl script (and is idempotent). This exposes the opportunity to: -use multiple master info files (i.e. use documentation in several languages) -add third party info documentation to the online help -rebuild+reload the online documentation during a maxima session By my computations, it takes about 5.5sec to execute setup_help_database() on an Atom-based netbook with the english info files; this is about 1/3 the time of the Perl script. 2. I have included a testsuite for this code, but it is not run during the normal testsuite. 3. I have mirrored Maxima's sourceforge CVS repository on GitHUB. You can pick up the above code by (install git, then...) git clone git://github.com/leo-butler/Maxima-CAS.git git checkout build-index+cl-ppcre Then build Maxima as you normally would from HEAD. Alternatively, you can visit the repository at https://github.com/leo-butler/Maxima-CAS and peruse the branches there (HEAD=master). In light of the recent prolonged outage at sourceforge, I'm going to try to maintain this as a mirror, in addition to using it as a public scratchpad for my own stuff. 4. REQUEST: please checkout and test the above code. I am especially interested in hearing about bugs or feature requests. At the moment, the code appears to work for me with clisp+cmucl+sbcl, but it may need tweaking for other lisps, so I am interested in hearing about how it works on other lisps, too. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From fateman at eecs.berkeley.edu Sun Feb 13 19:40:46 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 13 Feb 2011 17:40:46 -0800 Subject: [Maxima] mockmma for maxima Message-ID: <4D58881E.7010909@eecs.berkeley.edu> I've been fiddling with getting "MockMMA" working within the limitations of GCL / Windows / Maxima, as well as fixing up features generally so that Albert Rich's RUBI program can run. MockMMA is a program that looks like Mathematica syntactically. RUBI is a rule-based integration program. Here's what you can do now: load the programs in the directory http://www.cs.berkeley.edu/~fateman/lisp/mma4max into your computer. I put them in c:\lisp\mma4max on mine, and you'll see that in the instructions... usingfrommax.txt You can then run the commands shown there from the COMMAND LINE Maxima. (I ran that in EMACS so I could retain the transcript easily) I assume that with some minor changes it can be run in wxmaxima, but this is not something I know enough about. Maybe Andrej V will look at it. It is possible to type in many commands that look just like Mathematica, and get answers out that look just like Mathematica. It is also possible to write programs in Lisp (or MockMMA) that call Maxima commands.. It is also possible to write Maxima commands that call MockMMA, though about the only reason to do that would be to use pattern matching, which takes quite a different approach from pattern matching in Maxima. There are bunches of other facilities in MockMMA, but they tend to be less thoroughly implemented than in Maxima. The exception may be RUBI, work for the future. You can also run the mma4max stuff in other lisps, and generally it will work better than in GCL because identifiers etc will have 2 cases without any hackery. I tried CCL and Allegro. There is a rudimentary README file; I have not checked out any of the instructions from the perspective of someone without some knowledge of Lisp; if you have comments, questions, corrections, etc. I will try to respond as appropriate. You can send email to me directly, but please put Mockmma + something descriptive ... in the subject line. Richard Fateman From vttoth at vttoth.com Sun Feb 13 20:35:51 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Sun, 13 Feb 2011 21:35:51 -0500 Subject: [Maxima] itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis In-Reply-To: <201102131325.32567.pip@iszf.irk.ru> References: <01c801cbcbb6$2828a5b0$7879f110$@vttoth.com> <201102131325.32567.pip@iszf.irk.ru> Message-ID: <01e801cbcbef$e9573560$bc05a020$@vttoth.com> Valery, I think your example can actually take better advantage of the built-in features of ctensor/itensor. For instance, here is one way: load(itensor); load(ctensor); imetric(g); E:subst(lc(i,n,m),'levi_civita[i,n,m],ic_convert(ishow(curl([],[i])='levi_ci vita([],[i,n,m])*covdiff(V([m],[]),n))))$ ct_coordsys(spherical); cmetric(); christof(false); depends([Vr,Vt,Om],[r,theta]); V:transpose(lg.[Vr,Vt/r,Om])[1]; assume(sin(theta)>0); lc(i,j,k):=lc0([i,j,k]); curl:[0,0,0]; ev(E); expand(trigsimp(curl.lg/sqrt(determinant(lg)))); Note that it was not necessary to explicitly write in metric components, or to rewrite the ic_convert expression "by hand". Also, it is possible to side-step the lc0/levi_civita issue by defining the function lc(). Alternatively, albeit it's a bit longer, it is perhaps slightly more elegant to make explicit use of frame base support to obtain the same result: load(itensor); load(ctensor); iframe_flag:true; cframe_flag:true; ishow(curl([],[i])='levi_civita([],[i,n,m])*covdiff(V([m],[]),n))$ ishow(ev(%,icc2,ifc2,ifc1,ifb))$ E:subst(lc(i,n,m),'levi_civita[i,n,m],ic_convert(%))$ ct_coordsys(spherical); cmetric(); christof(false); depends([Vr,Vt,Om],[r,theta]); depends([ifg,ifr,ifri],ct_coords)$ V:transpose(lg.[Vr,Vt/r,Om])[1]; lc(i,j,k):=lc0([i,j,k]); curl:[0,0,0]; ifg:lfg; ifr:fri; ifri:fri^^-1; ev(E); expand(trigsimp(curl.lg/determinant(fri))); Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Valery Pipin Sent: Sunday, February 13, 2011 4:26 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] itensor and ctensor: indexed objects in moving frames in specific coordinate systems and frame basis I would say > Please don't hesitate to correct me if I am wrong, but it seems to me that > you are expecting the result to be expressed in the coordinate base, the text books (unfortunately not Landay -Lifshitz, you can look to Mizner Torn, Wheeler, or B Schutz) call this orthonormal but non-coordinate basis. For this basis, product of the basis components is the unit matrix. While the answer in this basis looks, sometimes, simplier, it is not good for the calculus purpose. For example, the curl of the velocity flow in the spherical coordinates load("itensor.lisp"); if get('ctensor, 'version) = false then load(ctensor); /* define dimension and the name for the metric */ idim(3); remcomps(g); imetric(g); /*define the components of the curl using the Levi-Chevitta symbol*/ remcomps(curlc); components(curlc([],[i]),'levi_civita([],[i,n,m])*covdiff(V([m],[]),n)); /* show them */ eqn :ishow(curl([],[i]) =canform(rename(expand(curlc([],[i])))))$ /* convert itensor's curl ctensor format*/ display2d:false; eqnc : ic_convert(eqn); /* define coordinates */ ct_coords:[r,th,ph]; depends([Vr,Vt,Om],[r,th]); /* NB! the proper factors for covariant basis, which is used by ctensor*/ V:[Vr,Vt*r,Om*r^2*sin(th)^2]; /*define the metric and compute connectivity componentets of the metrics*/ lg:matrix([1,0,0],[0,r^2,0],[0,0,r^2*sin(th)^2])$ dlt:matrix([1,0,0],[0,1,0],[0,0,1])$ ug:invert(lg)$ christof(all); /*NB! this a metric factor for the curl! */ sgdet:r^2*sin(th); /* Below is ctensor loop to compute components */ /* I replace 'levi_civita[%1,%2,i] -> lc0([%1,%2,i])/sgdet */ /* This should be implemented somehow in a future */ for i thru dim do curl[i]:sum(sum(lc0([%1,%2,i])/sgdet*diff(V[%2],ct_coords[%1]),%1, 1,dim),%2,1,dim) -sum(sum(sum(lc0([%1,%2,i])/sgdet*mcs[%1,%2,%3]*V[%3],%1, 1,dim),%2,1,dim),%3,1,dim) display2d:true; ratexpand(trigsimp(ratexpand(curl[1]))); /* gives*/ 'diff(Om,th,1)*sin(th)+2*Om*cos(th) ratexpand(trigsimp(ratexpand(r*curl[2]))); /* gives*/ -'diff(Om,r,1)*r*sin(th)-2*Om*sin(th) ratexpand(trigsimp(ratexpand(r*sin(th)*curl[3]))); /* gives*/ 'diff(Vt,r,1)+Vt/r-'diff(Vr,th,1)/r FWIW Valery _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From pip at iszf.irk.ru Sun Feb 13 20:44:25 2011 From: pip at iszf.irk.ru (Valery Pipin) Date: Sun, 13 Feb 2011 18:44:25 -0800 Subject: [Maxima] =?windows-1252?q?itensor_and_ctensor=3A_indexed_objects_?= =?windows-1252?q?in_moving_frames=09in_specific_coordinate_systems_and_fr?= =?windows-1252?q?ame_basis?= In-Reply-To: <01e801cbcbef$e9573560$bc05a020$@vttoth.com> References: <201102131325.32567.pip@iszf.irk.ru> <01e801cbcbef$e9573560$bc05a020$@vttoth.com> Message-ID: <201102131844.25519.pip@iszf.irk.ru> Many thanks! I did it in old fashion. You program is much more elegant! On Sunday 13 February 2011 18:35:51 Viktor T. Toth wrote: > Valery, > > I think your example can actually take better advantage of the built-in > features of ctensor/itensor. For instance, here is one way: > > load(itensor); > load(ctensor); > imetric(g); > E:subst(lc(i,n,m),'levi_civita[i,n,m],ic_convert(ishow(curl([],[i])='levi_c > i vita([],[i,n,m])*covdiff(V([m],[]),n))))$ > ct_coordsys(spherical); > cmetric(); > christof(false); > depends([Vr,Vt,Om],[r,theta]); > V:transpose(lg.[Vr,Vt/r,Om])[1]; > assume(sin(theta)>0); > lc(i,j,k):=lc0([i,j,k]); > curl:[0,0,0]; > ev(E); > expand(trigsimp(curl.lg/sqrt(determinant(lg)))); > > Note that it was not necessary to explicitly write in metric components, or > to rewrite the ic_convert expression "by hand". Also, it is possible to > side-step the lc0/levi_civita issue by defining the function lc(). > > Alternatively, albeit it's a bit longer, it is perhaps slightly more > elegant to make explicit use of frame base support to obtain the same > result: > > load(itensor); > load(ctensor); > iframe_flag:true; > cframe_flag:true; > ishow(curl([],[i])='levi_civita([],[i,n,m])*covdiff(V([m],[]),n))$ > ishow(ev(%,icc2,ifc2,ifc1,ifb))$ > E:subst(lc(i,n,m),'levi_civita[i,n,m],ic_convert(%))$ > ct_coordsys(spherical); > cmetric(); > christof(false); > depends([Vr,Vt,Om],[r,theta]); > depends([ifg,ifr,ifri],ct_coords)$ > V:transpose(lg.[Vr,Vt/r,Om])[1]; > lc(i,j,k):=lc0([i,j,k]); > curl:[0,0,0]; > ifg:lfg; > ifr:fri; > ifri:fri^^-1; > ev(E); > expand(trigsimp(curl.lg/determinant(fri))); > > > Viktor > > > > > > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Valery Pipin > Sent: Sunday, February 13, 2011 4:26 PM > To: maxima at math.utexas.edu > Subject: Re: [Maxima] itensor and ctensor: indexed objects in moving frames > in specific coordinate systems and frame basis > > I would say > > > Please don't hesitate to correct me if I am wrong, but it seems to me > > that you are expecting the result to be expressed in the coordinate > > base, > > the text books (unfortunately not Landay -Lifshitz, you can look to Mizner > Torn, Wheeler, or B Schutz) call this orthonormal but non-coordinate basis. > For this basis, product of the basis components is the unit matrix. While > the answer in this basis looks, sometimes, simplier, it is not good for the > calculus purpose. > For example, the curl of the velocity flow in the spherical coordinates > > > load("itensor.lisp"); > if get('ctensor, 'version) = false then load(ctensor); > > /* define dimension and the name for the metric */ > idim(3); > remcomps(g); > imetric(g); > /*define the components of the curl using the Levi-Chevitta symbol*/ > remcomps(curlc); > components(curlc([],[i]),'levi_civita([],[i,n,m])*covdiff(V([m],[]),n)); > > /* show them */ > eqn :ishow(curl([],[i]) =canform(rename(expand(curlc([],[i])))))$ > > /* convert itensor's curl ctensor format*/ > display2d:false; > eqnc : ic_convert(eqn); > > /* define coordinates */ > ct_coords:[r,th,ph]; > depends([Vr,Vt,Om],[r,th]); > /* NB! the proper factors for covariant basis, which is used by ctensor*/ > V:[Vr,Vt*r,Om*r^2*sin(th)^2]; > > /*define the metric and compute connectivity componentets of the metrics*/ > lg:matrix([1,0,0],[0,r^2,0],[0,0,r^2*sin(th)^2])$ > dlt:matrix([1,0,0],[0,1,0],[0,0,1])$ > ug:invert(lg)$ > christof(all); > /*NB! this a metric factor for the curl! */ > sgdet:r^2*sin(th); > > /* Below is ctensor loop to compute components */ > /* I replace 'levi_civita[%1,%2,i] -> lc0([%1,%2,i])/sgdet */ > /* This should be implemented somehow in a future */ > for i thru dim do > > curl[i]:sum(sum(lc0([%1,%2,i])/sgdet*diff(V[%2],ct_coords[%1]),%1, > 1,dim),%2,1,dim) > > -sum(sum(sum(lc0([%1,%2,i])/sgdet*mcs[%1,%2,%3]*V[%3],%1, > 1,dim),%2,1,dim),%3,1,dim) > display2d:true; > ratexpand(trigsimp(ratexpand(curl[1]))); > /* gives*/ > 'diff(Om,th,1)*sin(th)+2*Om*cos(th) > > ratexpand(trigsimp(ratexpand(r*curl[2]))); > /* gives*/ > -'diff(Om,r,1)*r*sin(th)-2*Om*sin(th) > ratexpand(trigsimp(ratexpand(r*sin(th)*curl[3]))); > /* gives*/ > 'diff(Vt,r,1)+Vt/r-'diff(Vr,th,1)/r > > FWIW > Valery > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From dlakelan at street-artists.org Sun Feb 13 21:53:05 2011 From: dlakelan at street-artists.org (dlakelan) Date: Sun, 13 Feb 2011 19:53:05 -0800 Subject: [Maxima] Applying Boundary Conditions at Infinity? In-Reply-To: References: , Message-ID: <4D58A721.7060807@street-artists.org> On 02/13/2011 03:02 PM, Barton Willis wrote: > Replacing gruntz with limit or tlimit fails, I think. I see that gruntz is a real actual function but has no documentation when I do ? gruntz and can not be found in the maxima manual by googling. What is gruntz and where does it come from, and how do you find out how it works? It looks useful. From robert.dodier at gmail.com Sun Feb 13 23:06:25 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 13 Feb 2011 22:06:25 -0700 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> Message-ID: On 2/13/11, Leo T Butler wrote: > -setup_help_database & > -print_help_database print_help_database suggests it's going to display the help db on the console. Maybe store_help_database is more accurate. FWIW I'd change setup_help_database to build_help_index. Hmm, also store_help_index. Does the constructed index work OK with multibyte character encodings? I seem to recall some byte versus character subtleties. > 3. I have mirrored Maxima's sourceforge CVS repository on GitHUB. You > can pick up the above code by (install git, then...) Hmm, I don't have anything against you maintaining whatever you want but I wonder if we as a group want to put the source code on Github or on Sourceforge. (SF has Git I'm pretty sure.) It appears you were able to import branches from CVS but not tags. Or maybe you didn't try to import tags? Were there any gotchas in the Git import? best Robert Dodier From renekaelin at gmx.ch Mon Feb 14 02:18:14 2011 From: renekaelin at gmx.ch (=?iso-8859-1?Q?rene_k=E4lin?=) Date: Mon, 14 Feb 2011 09:18:14 +0100 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> Message-ID: <9C66AC3A-D131-4774-9CC2-892B64EA6379@gmx.ch> Dear Rich Thanks for your work. But have you read my last post (if not please do it, at least "my" definition of the squareroot and what my aim is)? I don't think your code it's what I'm looking for. The inputs n_roots(-9,2); or assume(x<0); n_roots(x,2); or assume(x<0); n_roots(x,2) ++ n_roots(x,2); should all lead to an empty output (or an error). Because these cases are not defined according to "my" definition. Please believe me, I don't want to get on someones nerves with this (seemingly) simple sqrt-problem. Am 13.02.2011 um 20:53 schrieb Rich Hennessy: > To satisfy everybody there is the following way. I defined two functions. "|" and nth_roots(), | is a infix operator which performs multiplication when both arguments are lists. Here is the output. > > (%i1) n_roots(-3,3); > 5/6 1/3 5/6 1/3 > 3 %i - 3 3 %i + 3 1/3 > (%o1) [- --------------, --------------, - 3 ] > 2 2 > (%i2) display2d:false; > (%o2) false > (%i3) n_roots(2,2); > (%o3) [-sqrt(2),sqrt(2)] > (%i4) n_roots(3,5) | n_roots(-2,3); > > (%o4) [-2^(1/3)*3^(1/5),3^(1/5)*(2^(1/3)*sqrt(3)*%i+2^(1/3))/2,-3^(1/5)*(2^(1/3)*sqrt(3)*%i-2^(1/3))/2,-2^(1/3)*3^(1/5)*%e^-(2*%i*%pi/5),3^(1/5)*(2^(1/3)*sqrt(3)*%i+2^(1/3))*%e^-(2*%i*%pi/5)/2, > -3^(1/5)*(2^(1/3)*sqrt(3)*%i-2^(1/3))*%e^-(2*%i*%pi/5)/2,-2^(1/3)*3^(1/5)*%e^-(4*%i*%pi/5),3^(1/5)*(2^(1/3)*sqrt(3)*%i+2^(1/3))*%e^-(4*%i*%pi/5)/2, > -3^(1/5)*(2^(1/3)*sqrt(3)*%i-2^(1/3))*%e^-(4*%i*%pi/5)/2,-2^(1/3)*3^(1/5)*%e^(4*%i*%pi/5),3^(1/5)*(2^(1/3)*sqrt(3)*%i+2^(1/3))*%e^(4*%i*%pi/5)/2,-3^(1/5)*(2^(1/3)*sqrt(3)*%i-2^(1/3))*%e^(4*%i*%pi/5)/2, > -2^(1/3)*3^(1/5)*%e^(2*%i*%pi/5),3^(1/5)*(2^(1/3)*sqrt(3)*%i+2^(1/3))*%e^(2*%i*%pi/5)/2,-3^(1/5)*(2^(1/3)*sqrt(3)*%i-2^(1/3))*%e^(2*%i*%pi/5)/2] > (%i5) > > > Here is the code. The multiplication or addition of all of the roots of the two numbers can be a very complicated expression. In this case the list length = 5*3 = 15. That is why you need |. You can't overload * directly, I tried but got an error about * is a built in operator. You would need to handle + to when both sides are lists. > > Here is the code, it is very simple. It allows for multiple answers to a root calculation and comes very close to the definition that x^(1/n) = solve([y^(1/n)=x], y); > > n_roots(__c,__n):= > block( > [_x], > map(lambda([_z], rhs(_z)), solve(_x^__n=__c,_x)) > ); > > infix("|", 135, 135); > infix("++", 101,101); > > "|"(_l1,_l2):= > block > ( > [_ans:[]], > if listp(_l1) and listp(_l2) then > ( > for _p in _l1 do ( > for _q in _l2 do ( > _ans : cons(_p*_q, _ans) > ) > ) > ) > elseif listp(_l1) and not listp(_l2) or listp(_l2) and not listp(_l1) then > ( > _ans : _l2 * _l1 > ) > else > ( > _ans : _l2 * _l1 > ), > _ans > )$ > > "++"(_l1,_l2):= > block > ( > [_ans:[]], > if listp(_l1) and listp(_l2) then > ( > for _p in _l1 do ( > for _q in _l2 do ( > _ans : cons(_p+_q, _ans) > ) > ) > ) > elseif listp(_l1) and not listp(_l2) or listp(_l2) and not listp(_l1) then > ( > _ans : _l2 + _l1 > ) > else > ( > _ans : _l2 + _l1 > ), > _ans > )$ > > This is possible to do in Maxima 5.23.2 so you don't need to worry about sqrt(x^2) = abs(x) if you use n_roots(x^2,2). I am not sure I like the name n_roots(), I was calling it nth_root() at some point but that is not so great either. The multitude of all possible answers is explicit in this case, you can get very long lists when multiplication or addition is involved. > > n_roots(x^2,2); > [- x, x] > > Rich > > ----Original Message----- From: Richard Fateman > Sent: Friday, February 11, 2011 10:10 AM > To: Ren? K?lin > Cc: maxima at math.utexas.edu > Subject: Re: [Maxima] sqrt(x)*sqrt(x) > > On 2/9/2011 11:50 PM, "Ren? K?lin" wrote: >> Hello >> >> I tried this (with Maxima 5.21.1): >> >> domain:real$ >> t:x^(1/2)*x^(1/2); >> assume(x<0); >> t; >> forget(x<0)$ >> assume(x>=0); >> t; >> >> with the output: >> >> (%o2) x >> (%o3) [x<0] >> (%o4) x >> (%o6) [x>=0] >> (%o7) x >> >> I only want to consider some real numbers. Because the squareroot of x is not defined for x<0, %o4 is wrong, isn't it? >> >> The Problem seems to be that t:x^(1/2)*x^(1/2) is simplified immediately to x in any case. >> >> (I sent this post 2 days ago with a wrong title. Sorry if you received it twice.) > It seems hopeless to point out that x>0 does not mean that sqrt(x)>0, > mathematically. > There are 2 square roots. For example sqrt(16) is {-4, 4}, even though > 16>0. > > > The square root of x, for x<0 IS defined. It just happens to be imaginary. > There is no simple way of making Maxima forget about complex numbers, > even if you decide that certain of the inputs represent real numbers. > > > What you seem to be insisting on is > not that x>0, but that sqrt(x)>=0. > > Perhaps you should > define a new function positive_sqrt(x):= .... if (x<0) then error else > .... > > Yes, I know that in Maxima sqrt(z^2) comes out abs(z), but if you do > assume(z>0), then abs(z) comes out as z. > > This first step, sqrt(z^2) to abs(z) is, in general, wrong, so there > you are, with the subsequent step propagating the questionable result. > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From mathew.gwynne at gmail.com Mon Feb 14 06:06:09 2011 From: mathew.gwynne at gmail.com (Matthew Gwynne) Date: Mon, 14 Feb 2011 12:06:09 +0000 Subject: [Maxima] Why is maxima file output so slow? Message-ID: Hi, I've just been running some tests as some computations we were doing were taking a long time to output their results to file. In Maxima, to generate a file with 100,000 lines of length 500, it takes around 8s for me, and yet it seems this should take less than a second? For example: (%i12) A : apply(sconcat,create_list("1",i,1,500))$ Evaluation took 0.0000 seconds (0.0070 elapsed) (%i13) with_stdout("test.txt", for i : 1 thru 100000 do print(A))$ Evaluation took 7.1600 seconds (7.4840 elapsed) while with the following python script (test.py): fh = open("test.txt", "w") testline = "1" * 500 + "\n" for i in range(0,100000): fh.write(testline) fh.close() we get: ~> time python test.py real 0m0.186s user 0m0.030s sys 0m0.150s This is using Maxima 5.23.2 and ECL 11.1.1 . I understand that python is perhaps not the best example as it's probably using native C libraries underneath, but is there any way to speed things up? When one generates files with many many more lines, this becomes a big problem, and otherwise the computation is not a problem. Thanks! Matthew Gwynne http://cs.swan.ac.uk/~csmg/ From mathew.gwynne at gmail.com Mon Feb 14 06:12:51 2011 From: mathew.gwynne at gmail.com (Matthew Gwynne) Date: Mon, 14 Feb 2011 12:12:51 +0000 Subject: [Maxima] Fwd: Can't set linel to large value? In-Reply-To: References: <1297642159.624.15.camel@dieter> Message-ID: Hi, > Well, I see that MSETCHK in src/mlisp.lisp has this hard-coded > limit in it ... seems pointless. Anyway you can work around it > like this: > > :lisp (setq $linel 10001 linel 10001) Is there any way I can run this from a loaded Maxima file? The manual says I can only use ":lisp" on the interactive prompt? > It was possible to crash Maxima, when assigning a very big value to > linel. We had a posting from a user about this topic on the mailing list > and a bug report. This was the reason, I had introduced an upper limit > for the assignment to linel. The chosen upper limit of 10,000 is > somewhat arbitrary. ?An upper limit of 10^5 and perhaps 10^6 will work > for SBCL, too. Does anyone have any idea why this crash occurs? Surely, for a lot of users, having their output computation crash (even if Maxima doesn't crash) is still very irritating. For example, I ran a computation for several hours, only to have the whole thing error because of this :(. Thanks! Matthew Gwynne http://cs.swan.ac.uk/~csmg/ P.S Apologies to Dieter if he gets this twice, I forgot to reply to all! From toy.raymond at gmail.com Mon Feb 14 06:43:55 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 14 Feb 2011 07:43:55 -0500 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> Message-ID: <4D59238B.5070906@gmail.com> On 2/14/11 12:06 AM, Robert Dodier wrote: > > Hmm, I don't have anything against you maintaining whatever > you want but I wonder if we as a group want to put the source > code on Github or on Sourceforge. (SF has Git I'm pretty sure.) Yes, SF has git (as well as subversion, mercurial, and bazaar). Ray From toy.raymond at gmail.com Mon Feb 14 06:51:32 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 14 Feb 2011 07:51:32 -0500 Subject: [Maxima] Why is maxima file output so slow? In-Reply-To: References: Message-ID: <4D592554.8010503@gmail.com> On 2/14/11 7:06 AM, Matthew Gwynne wrote: > Hi, > > I've just been running some tests as some computations we were doing > were taking a long time to output their results to file. In Maxima, to > generate a file with 100,000 lines of length 500, it takes around 8s > for me, and yet it seems this should take less than a second? > > For example: > > (%i12) A : apply(sconcat,create_list("1",i,1,500))$ > Evaluation took 0.0000 seconds (0.0070 elapsed) > (%i13) with_stdout("test.txt", for i : 1 thru 100000 do print(A))$ > Evaluation took 7.1600 seconds (7.4840 elapsed) > > while with the following python script (test.py): > > fh = open("test.txt", "w") > testline = "1" * 500 + "\n" > for i in range(0,100000): > fh.write(testline) > fh.close() > I do not know if this is cause, but Maxima's print is not the same as Python's write. Print has to convert the internal format of the list to a suitable output form, possibly also checking to see how to do a nice 2D display. Ray From toy.raymond at gmail.com Mon Feb 14 06:54:00 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 14 Feb 2011 07:54:00 -0500 Subject: [Maxima] Fwd: Can't set linel to large value? In-Reply-To: References: <1297642159.624.15.camel@dieter> Message-ID: <4D5925E8.6060609@gmail.com> On 2/14/11 7:12 AM, Matthew Gwynne wrote: > Hi, > >> Well, I see that MSETCHK in src/mlisp.lisp has this hard-coded >> limit in it ... seems pointless. Anyway you can work around it >> like this: >> >> :lisp (setq $linel 10001 linel 10001) > > Is there any way I can run this from a loaded Maxima file? The manual > says I can only use ":lisp" on the interactive prompt? In this case, create a lisp file, say, setlinel.lisp, containing the setq form above. Then just say load("setlinel.lisp"). Ray From mathew.gwynne at gmail.com Mon Feb 14 06:58:24 2011 From: mathew.gwynne at gmail.com (Matthew Gwynne) Date: Mon, 14 Feb 2011 12:58:24 +0000 Subject: [Maxima] Why is maxima file output so slow? In-Reply-To: <4D592554.8010503@gmail.com> References: <4D592554.8010503@gmail.com> Message-ID: Hi, On Mon, Feb 14, 2011 at 12:51 PM, Raymond Toy wrote: >> > I do not know if this is cause, but Maxima's print is not the same as > Python's write. ?Print has to convert the internal format of the list to > a suitable output form, possibly also checking to see how to do a nice > 2D display. In that case, is there something else we should be using if we have the strings anyway? Is there any way we can temporary turn off a lot of checking? Thanks! Matthew Gwynne http://cs.swan.ac.uk/~csmg/ From toy.raymond at gmail.com Mon Feb 14 08:26:00 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 14 Feb 2011 09:26:00 -0500 Subject: [Maxima] Defining file_type extensions In-Reply-To: <4D57B3A3.3090207@gmx.de> References: <4D56CBA3.1090505@obsessivemathsfreak.org> <4D5716FC.1090009@gmail.com> <4D57285F.7070603@gmail.com> <4D57B3A3.3090207@gmx.de> Message-ID: <4D593B78.6000803@gmail.com> On 2/13/11 5:34 AM, andre maute wrote: > On 02/13/2011 01:39 AM, Raymond Toy wrote: >> On 2/12/11 6:25 PM, David Billinghurst wrote: >>> >>> The file suffixes used by load are hard coded in function $file_type >>> in mload.lisp. >>> >>> (defun $file_type (fil) >>> (let ((typ ($pathname_type fil))) >>> (cond >>> ((member typ '("l" "lsp" "lisp") :test #'string=) >>> '$lisp) >>> ((member typ '("mac" "mc" "demo" "dem" "dm1" "dm2" "dm3" >>> "dmt") >>> :test #'string=) >>> '$maxima) >>> (t >>> '$object)))) >>> >>> You could put a modified version of this function in your >>> maxima-init.lisp file - see >>> http://maxima.sourceforge.net/ui-tips.html >> This has come up several times now. Perhaps it's time to allow the user >> to change this easily. >> >> I propose adding two new variables $file_type_lisp and >> $file_type_maxima, defaulting to the values above. Then the user can >> change them however they want. > Yes please. That would be great. Done. file_type_lisp and file_type_maxima are lists that the user can change to add whatever extension he wants. No checking is done on the elements, or if there are duplicates, but file_type_lisp is checked first for a match, as before. Ray From dlakelan at street-artists.org Mon Feb 14 09:14:47 2011 From: dlakelan at street-artists.org (dlakelan) Date: Mon, 14 Feb 2011 07:14:47 -0800 Subject: [Maxima] altering tex output of derivatives? In-Reply-To: References: <4D54E0D8.4040705@street-artists.org> Message-ID: <4D5946E7.1050309@street-artists.org> On 02/11/2011 10:10 AM, Robert Dodier wrote: > I didn't try it but maybe this has the expected effect: > > texput (nounify (diff), ...); it does look like this works. Thanks. From toy.raymond at gmail.com Mon Feb 14 09:41:13 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 14 Feb 2011 10:41:13 -0500 Subject: [Maxima] Why is maxima file output so slow? In-Reply-To: References: <4D592554.8010503@gmail.com> Message-ID: <4D594D19.4080802@gmail.com> On 2/14/11 7:58 AM, Matthew Gwynne wrote: > Hi, > > On Mon, Feb 14, 2011 at 12:51 PM, Raymond Toy wrote: >> I do not know if this is cause, but Maxima's print is not the same as >> Python's write. Print has to convert the internal format of the list to >> a suitable output form, possibly also checking to see how to do a nice >> 2D display. > In that case, is there something else we should be using if we have > the strings anyway? You can punt to a Lisp function. This seems to run much faster. Perhaps not as fast as Python, but maybe fast enough for you. with_stdout("test.txt", for i : 1 thru 100000 do (?princ(A), ?terpri()))$ If this is still not fast enough, I'm sure we can come up with something better, perhaps resorting to a simple Lisp function. Ray From gary.pajer at gmail.com Mon Feb 14 09:47:32 2011 From: gary.pajer at gmail.com (Gary Pajer) Date: Mon, 14 Feb 2011 10:47:32 -0500 Subject: [Maxima] sqrt(x)*sqrt(x) In-Reply-To: References: <20110210075019.58470@gmx.net> <4D55516F.5040105@eecs.berkeley.edu> <4D55935D.3020404@eecs.berkeley.edu> <4D55AA04.60007@eecs.berkeley.edu> Message-ID: On Sat, Feb 12, 2011 at 10:35 AM, Andrey G. Grozin wrote: > On Sat, 12 Feb 2011, Rich Hennessy wrote: > >> My view of sqrt(x) is a special case of the more >> general definition. I am not trying to reinvent mathematics. >> > Then take a serious maths book (not for kids). > > You are right, according to Bourbaki, there is no such thing as a > multi-valued function (many good mathematitians strongly dislike bourbakism, > but still...). > > Then, what's the domain of sqrt? Unsurprisingly, it's the Riemann surface > of sqrt. It has 2 branch points, 0 and \infty. In a small neighbourhood of > any regular point z, it consists of two sheets; but they are globally > connected in a non-trivial way. > > So, there are two distinct points "16" in the domain of sqrt (on two sheets > of its Riemann surface). For one of them, sqrt(16)=4. Let's rotate it around > 0: > > z = 16 exp(i*alpha) > I thought for sure that I'd no longer add to this learned discussion. I certainly have little more of value to add. But ... Yes indeed. sqrt(z) = sqrt( |z| ) exp(i * alpha/2) So even in the realm of complex numbers, you can think of it as a single - valued function if you take the domain to be |z| = [0, inf) and alpha = [0, 4 pi). And it's periodic in 4 pi. As a function of two variables, this makes good sense. But as a function of one complex variable it may be bogus because exp(0) and exp(i 2 pi) are the same number, I think. This is the same as the Riemann sheet idea ... but it looks more analytical. Ok, I think I'm done for good now. There is a branch of this discussion that has something to do with maxima, but this ain't it. -gary > > When alpha varies from 0 to 2*pi, we arrive to a *different* point - at the > other sheet of the Riemann surface. sqrt(z) becomes -4. Only after the next > resolution (when alpha becomes 4*pi) do we return to the original point (and > sqrt(z) returns to +4). > > Maxima works with sqrt's of symbolic expressions. One newer knows what will > be substituted for all variables. When values of variables vary, analytical > continuation can easily transform +4 to -4. > > 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 robert.dodier at gmail.com Mon Feb 14 10:03:00 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 14 Feb 2011 09:03:00 -0700 Subject: [Maxima] Fwd: Can't set linel to large value? In-Reply-To: References: <1297642159.624.15.camel@dieter> Message-ID: On 2/14/11, Matthew Gwynne wrote: >> :lisp (setq $linel 10001 linel 10001) > > Is there any way I can run this from a loaded Maxima file? The manual > says I can only use ":lisp" on the interactive prompt? You can put (setq ...) in a file named maxima-init.lisp in $HOME/.maxima and it will be loaded when Maxima is launched. Maybe some kind soul wants to adjust the batch file processing so that :lisp is recognized .... Robert Dodier From l.butler at ed.ac.uk Mon Feb 14 11:30:42 2011 From: l.butler at ed.ac.uk (Leo T Butler) Date: Mon, 14 Feb 2011 17:30:42 +0000 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> Message-ID: <20110214173042.41862qc0me3e0rsw@www.staffmail.ed.ac.uk> Quoting Robert Dodier : > On 2/13/11, Leo T Butler wrote: > >> -setup_help_database & >> -print_help_database > > print_help_database suggests it's going to display the > help db on the console. Maybe store_help_database is > more accurate. The default behaviour is to print to the console; it will print to a file is a filename is given it. Also, there is a third hashtable that is saved, which contains the info filenames. So I think the name is accurate. > > Does the constructed index work OK with multibyte character > encodings? I seem to recall some byte versus character subtleties. I believe that I have sidestepped all the perl-ish problems by using Lisp, and I have written a short testsuite (see tests/rtest-build-index.lisp), that includes tests with the english, german and spanish info files. But, this is why I am interested in users of trying this out. > >> 3. I have mirrored Maxima's sourceforge CVS repository on GitHUB. You >> can pick up the above code by (install git, then...) > > Hmm, I don't have anything against you maintaining whatever > you want but I wonder if we as a group want to put the source > code on Github or on Sourceforge. (SF has Git I'm pretty sure.) I think that we want to migrate the CVS repository to a Git repository on Sourceforge, but definitely we want to keep the *definitive* repository on Sourceforge. I put the *mirror* on Github for 3 reasons: 1/ the re-write of build-index was more sweeping than I originally expected and I would like to have feedback before committing it to the `official' repository; 2/ I am a git newbie and I was curious to see how difficult it would be to migrate; 3/ the recent SF outage affected CVS services the most, but it affected all services, so a public mirror seems like a reasonable idea, and git gives us the flexibility to switch between repos quite painlessly (or even pushing to both at the same time). > > It appears you were able to import branches from CVS > but not tags. Or maybe you didn't try to import tags? > Were there any gotchas in the Git import? I just imported the branches, that's correct. It was absolutely painless: I imported the CVS repo, added my branch, then I setup the github repo and pushed all the branches to github. I think there were a couple that git balked at, because they were out of historical order and there were implied deletions of files, but if I re-ran the push with the --force flag, git will push those branches, too. I didn't try to import tags to the github repo, but I can see that git did import tags from the CVS repo to my git repo. Apparently there are issues with cvs->git and tags, so I won't swear that the job is done correctly. The git-tag manpage suggests trying cvs2git (in cvs2svn) if tags are an issue. ---- Out of the box, git was much nicer to use than mercurial (I use the latter on a googlecode project, and I find it really pretty bearish at times). Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From toy.raymond at gmail.com Mon Feb 14 11:56:12 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 14 Feb 2011 12:56:12 -0500 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> Message-ID: <4D596CBC.3070702@gmail.com> On 2/13/11 7:27 PM, Leo T Butler wrote: > Hello, > > > 4. REQUEST: please checkout and test the above code. I am especially > interested in hearing about bugs or feature requests. > At the moment, the code appears to work for me with clisp+cmucl+sbcl, > but it may need tweaking for other lisps, so I am interested in > hearing about how it works on other lisps, too. This looks really interesting but whatever you have is not what's in the actual git repo. :-) I cloned the repo according to your instructions and tried to build it as usual. Your repo is missing src/sharefiles.mk. I just grabbed the version from CVS. Now bootstrap and configure work as usual. Make also runs, but I get an error about not knowing how to make the target build_index.pl. At this point, none of the info files are made, so I can't test the results yet. Ray From pip at iszf.irk.ru Mon Feb 14 14:38:42 2011 From: pip at iszf.irk.ru (Valery Pipin) Date: Mon, 14 Feb 2011 12:38:42 -0800 Subject: [Maxima] 64-bit maxima-sbcl on old RH mashines Message-ID: <201102141238.42579.pip@iszf.irk.ru> Dear List, I encontered with a puzzle. Could you give an advice? I have access to high perfomance mashines which I want to use to run maxima They have "uname -a" Linux sunshine.Stanford.EDU 2.6.18-164.9.1.el5 #1 SMP Tue Dec 15 20:57:57 EST 2009 x86_64 x86_64 x86_64 GNU/Linux and maxima : (%i1) build_info(); Maxima version: 5.20.1 Maxima build date: 17:49 5/11/2010 Host type: x86_64-redhat-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.38-2.el5 RAM=12G The problem is that I meet "the greetings" from ldb (%i3) batchload("er-et.mc") Welcome to LDB, a low-level debugger for the Lisp runtime environment. ldb> Meanwhile I can do this run easily on my laptop which is Macbookpro5.6 running 64bit linux. It has 4G RAM, kernel-2.6.36, maxima-5.23.2, sbcl-1.0.45 So the differences in program are as follows server has the old kernel :2.6.18, sbcl is not very old,1.0.38, the version of maxima-5.20 should not be a problem, beacause I used that version for the same problem. What can be a reason? May servers has some patches that don't allow to use more RAM freely for everyone? Thanks! Valery From l.butler at ed.ac.uk Mon Feb 14 16:14:56 2011 From: l.butler at ed.ac.uk (Leo T Butler) Date: Mon, 14 Feb 2011 22:14:56 +0000 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <4D596CBC.3070702@gmail.com> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D596CBC.3070702@gmail.com> Message-ID: <20110214221456.99535p27eyovrz2o@www.staffmail.ed.ac.uk> Quoting Raymond Toy : > On 2/13/11 7:27 PM, Leo T Butler wrote: >> Hello, >> >> >> 4. REQUEST: please checkout and test the above code. I am especially >> interested in hearing about bugs or feature requests. >> At the moment, the code appears to work for me with clisp+cmucl+sbcl, >> but it may need tweaking for other lisps, so I am interested in >> hearing about how it works on other lisps, too. > This looks really interesting but whatever you have is not what's in the > actual git repo. :-) > > I cloned the repo according to your instructions and tried to build it > as usual. Your repo is missing src/sharefiles.mk. I just grabbed the > version from CVS. Now bootstrap and configure work as usual. > > Make also runs, but I get an error about not knowing how to make the > target build_index.pl. At this point, none of the info files are made, > so I can't test the results yet. Thanks, Ray. I pushed a couple updates, and a clone builds cleanly in a fresh directory. Would you try pulling the updates from that branch, please: git pull ought to do it (otherwise, there is help here: http://help.github.com/remotes/). Btw, the src/*.mk files are all built during the build process, so it doesn't make sense to have them under VC, imo. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From toy.raymond at gmail.com Mon Feb 14 16:19:49 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 14 Feb 2011 17:19:49 -0500 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <20110214221456.99535p27eyovrz2o@www.staffmail.ed.ac.uk> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D596CBC.3070702@gmail.com> <20110214221456.99535p27eyovrz2o@www.staffmail.ed.ac.uk> Message-ID: <4D59AA85.6000807@gmail.com> On 2/14/11 5:14 PM, Leo T Butler wrote: > Quoting Raymond Toy : > >> On 2/13/11 7:27 PM, Leo T Butler wrote: >>> Hello, >>> >>> >>> 4. REQUEST: please checkout and test the above code. I am especially >>> interested in hearing about bugs or feature requests. >>> At the moment, the code appears to work for me with clisp+cmucl+sbcl, >>> but it may need tweaking for other lisps, so I am interested in >>> hearing about how it works on other lisps, too. >> This looks really interesting but whatever you have is not what's in the >> actual git repo. :-) >> >> I cloned the repo according to your instructions and tried to build it >> as usual. Your repo is missing src/sharefiles.mk. I just grabbed the >> version from CVS. Now bootstrap and configure work as usual. >> >> Make also runs, but I get an error about not knowing how to make the >> target build_index.pl. At this point, none of the info files are made, >> so I can't test the results yet. > > Thanks, Ray. I pushed a couple updates, and a clone builds cleanly in > a fresh directory. Would you try pulling the updates from that branch, > please: > git pull Ok. I just hacked something to get past these issues. Seems to work nicely, and building the index is pretty fast. (A few second on the fastest machine I have.) I'm trying to look at the old messages and see if I can break it. :-) > ought to do it (otherwise, there is help here: > http://help.github.com/remotes/). > > Btw, the src/*.mk files are all built during the build process, so it > doesn't > make sense to have them under VC, imo. I agree, but bootstrap needs sharefiles.mk to exist. Perhaps we can work around this so that an empty file is created that satisfies bootstrap. If that works, then that should be removed. Ray From toy.raymond at gmail.com Mon Feb 14 18:40:52 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 14 Feb 2011 19:40:52 -0500 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> Message-ID: <4D59CB94.1010002@gmail.com> On 2/13/11 7:27 PM, Leo T Butler wrote: > > 4. REQUEST: please checkout and test the above code. I am especially > interested in hearing about bugs or feature requests. > At the moment, the code appears to work for me with clisp+cmucl+sbcl, > but it may need tweaking for other lisps, so I am interested in > hearing about how it works on other lisps, too. Works ok with ccl. I didn't too any real testing other than to run setup_help_database() and ask for documentation for a few random functions. Ecl doesn't work. It seems to have compiled everything, but setup_help_database eventually causes some unspecific Lisp error about invalid or protected memory error. Gcl won't even compile. This is a showstopper until we decide that gcl is not the main Lisp anymore. Ray From smh at franz.com Mon Feb 14 18:54:17 2011 From: smh at franz.com (Steve Haflich) Date: Mon, 14 Feb 2011 16:54:17 -0800 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <4D59CB94.1010002@gmail.com> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D59CB94.1010002@gmail.com> Message-ID: <21536.1297731257@gemini.franz.com> Raymond Toy wrote: Ecl doesn't work. It seems to have compiled everything, but setup_help_database eventually causes some unspecific Lisp error about invalid or protected memory error. Gcl won't even compile. This is a showstopper until we decide that gcl is not the main Lisp anymore. Just a not-very-informed guess: Does this code try to modify any string (or other) constants that appear in source code? This has unspecified consequences according to the ANS for CL. Some implementations enforce it and signal error, others do not, but it is never something code ought do. Leads to undebuggable buggables. From willisb at unk.edu Mon Feb 14 19:43:33 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 14 Feb 2011 19:43:33 -0600 Subject: [Maxima] Applying Boundary Conditions at Infinity? In-Reply-To: <4D58A721.7060807@street-artists.org> References: , , <4D58A721.7060807@street-artists.org> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >>?Replacing?gruntz?with?limit?or?tlimit?fails,?I?think. > >I?see?that?gruntz?is?a?real?actual?function?but?has?no?documentation? >when?I?do???gruntz?and?can?not?be?found?in?the?maxima?manual?by? >googling.?What?is?gruntz?and?where?does?it?come?from,?and?how?do?you? >find?out?how?it?works??It?looks?useful. For a description of the Gruntz method for computing limits, try a web search on "gruntz limit". Dan Gildea wrote the Maxima code for this method. Sometimes limit calls gruntz, sometimes not apparently. Maybe gruntz isn't intended to be a user-level function. I don't know if Maxima has a full implementation of the method. Barton From l.butler at ed.ac.uk Mon Feb 14 21:58:25 2011 From: l.butler at ed.ac.uk (Leo T Butler) Date: Tue, 15 Feb 2011 03:58:25 +0000 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <4D59CB94.1010002@gmail.com> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D59CB94.1010002@gmail.com> Message-ID: <20110215035825.81510p0w9rc1qwv4@www.staffmail.ed.ac.uk> Quoting Raymond Toy : > On 2/13/11 7:27 PM, Leo T Butler wrote: >> >> 4. REQUEST: please checkout and test the above code. I am especially >> interested in hearing about bugs or feature requests. >> At the moment, the code appears to work for me with clisp+cmucl+sbcl, >> but it may need tweaking for other lisps, so I am interested in >> hearing about how it works on other lisps, too. > Works ok with ccl. I didn't too any real testing other than to run > setup_help_database() and ask for documentation for a few random functions. > > Ecl doesn't work. It seems to have compiled everything, but > setup_help_database eventually causes some unspecific Lisp error about > invalid or protected memory error. > > Gcl won't even compile. This is a showstopper until we decide that gcl > is not the main Lisp anymore. Thanks, Ray. Could you post the error messages for these Lisps, please. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From rroa at azti.es Tue Feb 15 01:30:10 2011 From: rroa at azti.es (=?iso-8859-1?Q?Rub=E9n_Roa?=) Date: Tue, 15 Feb 2011 08:30:10 +0100 Subject: [Maxima] Maxima on Windows XP Home and Vista Home: was: wxMaXIMA-maxima connection failure Message-ID: <5CD78996B8F8844D963C875D3159B94A01112106@dsrcorreo> Hi, This is a follow up on my previous post : wxMaxima-Maxima connection failure, to which David Billinghurst replied indicating how to run Maxima from console instead of from wxMaxima. I run Maxima from a DOS console and it didn't work. In the DOS console of my Windows XP Home and Windows Vista Home systems I run maxima.bat and instead of starting Maxima, the DOS console just jumped to next line and nothing happened. I did the same on my Windows XP Pro edition and everything was fine. Thus my problem that wxMaxima does not connect to Maxima in a Windows XP Home system and a Windows Vista Home system seems not to be a connection failure between wxMaxima and Maxima, rather it is that Maxima itself does not work for Windows XP and Vista Home editions. I can easily be disproved and would like to know if anybody has a working installation of Maxima on a Windows XP Home Edition or Windows Vista Home Edition. Thanks in advance Ruben Dr. Rub?n Roa-Ureta AZTI - Tecnalia / Marine Research Unit Txatxarramendi Ugartea z/g 48395 Sukarrieta (Bizkaia) SPAIN -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.kirkby at onetel.net Tue Feb 15 06:23:20 2011 From: david.kirkby at onetel.net (Dr. David Kirkby) Date: Tue, 15 Feb 2011 12:23:20 +0000 Subject: [Maxima] Can we build Maxima without needing makeinfo? Message-ID: <4D5A7038.1000405@onetel.net> Maxima is used in Sage, but texinfo is not a requirement for building Sage. As such, it has been reported that the Maxima failed to build on a system where makeinfo (part http://www.gnu.org/software/texinfo/) of was not installed. It is possible to build Maxima without requiring the texinfo package to be installed? If so how. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? Dave From toy.raymond at gmail.com Tue Feb 15 06:54:36 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 15 Feb 2011 07:54:36 -0500 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <20110215035825.81510p0w9rc1qwv4@www.staffmail.ed.ac.uk> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D59CB94.1010002@gmail.com> <20110215035825.81510p0w9rc1qwv4@www.staffmail.ed.ac.uk> Message-ID: <4D5A778C.40503@gmail.com> On 2/14/11 10:58 PM, Leo T Butler wrote: > Quoting Raymond Toy : > >> On 2/13/11 7:27 PM, Leo T Butler wrote: >>> >>> 4. REQUEST: please checkout and test the above code. I am especially >>> interested in hearing about bugs or feature requests. >>> At the moment, the code appears to work for me with clisp+cmucl+sbcl, >>> but it may need tweaking for other lisps, so I am interested in >>> hearing about how it works on other lisps, too. >> Works ok with ccl. I didn't too any real testing other than to run >> setup_help_database() and ask for documentation for a few random >> functions. >> >> Ecl doesn't work. It seems to have compiled everything, but >> setup_help_database eventually causes some unspecific Lisp error about >> invalid or protected memory error. >> >> Gcl won't even compile. This is a showstopper until we decide that gcl >> is not the main Lisp anymore. > > Thanks, Ray. Could you post the error messages for these Lisps, please. With ecl, setup_help_database() takes a bit of time (over 60 sec) and gives this: Detected access to an invalid or protected memory address. Available restarts: 1. (CONTINUE) Ignore signal 2. (MACSYMA-QUIT) Maxima top-level The backtrace isn't particularly helpful. It just lists (run). Note that one this machine, clisp will setup the data base in 10 sec; cmucl, 1.3 sec. Oh, wait. ecl just succeeded after 75 sec. That's first time I've seen it, in some 5-10 attempts. And now it's consistently succeeding (3 more tests). I didn't change anything because I just ran it and copied the message above just now. Bizarre. Ah. It's because the failed runs use -g (enable debugging). Without -g, setup_help_database works fine with ecl. (Ecl 11.1.1, for the record.) But given that it takes 75 sec for ecl to build this, I hope that setup_help_database is run during compilation so that the user doesn't need to build the database at startup. For gcl, gcl cannot compile cl-ppcre: Compiling /apps2/src/sourceforge/Maxima-CAS/src/cl-ppcre/errors.lisp. Invalid DEFINE-CONDITION option: (:DEFAULT-INITARGS :POS NIL :STRING *SYNTAX-ERROR-STRING*) Fast links are on: do (use-fast-links nil) for debugging Broken at FUNCALL. Type :H for Help. Ray From LindnerW at t-online.de Tue Feb 15 07:27:34 2011 From: LindnerW at t-online.de (Wolfgang Lindner) Date: Tue, 15 Feb 2011 14:27:34 +0100 Subject: [Maxima] Maxima on Windows XP Home and Vista Home: was:wxMaXIMA-maxima connection failure Message-ID: <007501cbcd16$090fdc00$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> <> I installed Maxima (with wxMaxima GIU) via the normal automatic setup-exe-process. No problem. <> YES, I use Windows XP Home. Wolfgang From robert.dodier at gmail.com Tue Feb 15 11:01:58 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 15 Feb 2011 10:01:58 -0700 Subject: [Maxima] Can we build Maxima without needing makeinfo? In-Reply-To: <4D5A7038.1000405@onetel.net> References: <4D5A7038.1000405@onetel.net> Message-ID: Here are a couple of ideas. One is to build Maxima from a tar.gz as provided on the SF file manager. Tarballs are built via make dist-gzip and they contain the generated .info files so makeinfo isn't needed afterwards. Another idea is to build Maxima via the Lisp-only build procedure, which doesn't build the .info files. Just some ideas. Hope this helps. Robert Dodier On 2/15/11, Dr. David Kirkby wrote: > Maxima is used in Sage, but texinfo is not a requirement for building Sage. > As > such, it has been reported that the Maxima failed to build on a system where > makeinfo (part http://www.gnu.org/software/texinfo/) of was not installed. > > It is possible to build Maxima without requiring the texinfo package to be > installed? If so how. > > -- > A: Because it messes up the order in which people normally read text. > Q: Why is top-posting such a bad thing? > A: Top-posting. > Q: What is the most annoying thing in e-mail? > > Dave > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From david.kirkby at onetel.net Tue Feb 15 12:15:33 2011 From: david.kirkby at onetel.net (Dr. David Kirkby) Date: Tue, 15 Feb 2011 18:15:33 +0000 Subject: [Maxima] Can we build Maxima without needing makeinfo? In-Reply-To: References: <4D5A7038.1000405@onetel.net> Message-ID: <4D5AC2C5.3090602@onetel.net> On 02/15/11 05:01 PM, Robert Dodier wrote: > Here are a couple of ideas. > One is to build Maxima from a tar.gz as provided on > the SF file manager. > Tarballs are built via make dist-gzip and they contain > the generated .info files so makeinfo isn't needed afterwards. That's basically what is done. The file was downloaded from sourceforge: drkirkby at hawk:~$ digest -a md5 maxima-5.23.2.tar.gz ae2f2eaca33de95636e36652ed281902 then configured with ./configure --prefix="$SAGE_LOCAL" --enable-ecl But I'm told by someone else that it failed since he did not have makeinfo. Have I mis-understood you? > Another idea is to build Maxima via the Lisp-only build > procedure, which doesn't build the .info files. I'd rather avoid that as I don't understand that. > Just some ideas. Hope this helps. > Robert Dodier Thank you Robert, but I'm still lost. Dave > On 2/15/11, Dr. David Kirkby wrote: >> Maxima is used in Sage, but texinfo is not a requirement for building Sage. >> As >> such, it has been reported that the Maxima failed to build on a system where >> makeinfo (part http://www.gnu.org/software/texinfo/) of was not installed. >> >> It is possible to build Maxima without requiring the texinfo package to be >> installed? If so how. >> >> -- >> A: Because it messes up the order in which people normally read text. >> Q: Why is top-posting such a bad thing? >> A: Top-posting. >> Q: What is the most annoying thing in e-mail? >> >> Dave >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? Dave From david.kirkby at onetel.net Tue Feb 15 12:36:01 2011 From: david.kirkby at onetel.net (Dr. David Kirkby) Date: Tue, 15 Feb 2011 18:36:01 +0000 Subject: [Maxima] Can we build Maxima without needing makeinfo? In-Reply-To: References: <4D5A7038.1000405@onetel.net> Message-ID: <4D5AC791.9000804@onetel.net> On 02/15/11 05:01 PM, Robert Dodier wrote: > Here are a couple of ideas. > One is to build Maxima from a tar.gz as provided on > the SF file manager. > Tarballs are built via make dist-gzip and they contain > the generated .info files so makeinfo isn't needed afterwards. > Another idea is to build Maxima via the Lisp-only build > procedure, which doesn't build the .info files. > > Just some ideas. Hope this helps. > Robert Dodier I just checked the tarball and the .info files are present drkirkby at hawk:~/sage-4.6.2.alpha4/spkg/standard$ find . -name '*.info' ./maxima-5.23.2/src/doc/info/pt_BR/maxima.info ./maxima-5.23.2/src/doc/info/pt/maxima.info ./maxima-5.23.2/src/doc/info/pt_BR.utf8/maxima.info ./maxima-5.23.2/src/doc/info/maxima.info ./maxima-5.23.2/src/doc/info/pt.utf8/maxima.info ./maxima-5.23.2/src/doc/info/es/maxima.info ./maxima-5.23.2/src/doc/info/es.utf8/maxima.info ./maxima-5.23.2/src/interfaces/xmaxima/doc/xmaxima.info ./maxima-5.23.2/src/interfaces/emacs/imaxima/imaxima.info The problem was reported by someone else - personally I had no issues on my Solaris machine. But when I renamed the 'makeinfo' program to something else, so the build of Maxima failed, despite the info files being present. make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/export/home/drkirkby/sage-4.6.2.alpha4/spkg/build/maxima-5.23.2/src/tests' Making all in doc make[1]: Entering directory `/export/home/drkirkby/sage-4.6.2.alpha4/spkg/build/maxima-5.23.2/src/doc' Making all in info make[2]: Entering directory `/export/home/drkirkby/sage-4.6.2.alpha4/spkg/build/maxima-5.23.2/src/doc/info' make[3]: Entering directory `/export/home/drkirkby/sage-4.6.2.alpha4/spkg/build/maxima-5.23.2/src/doc/info' makeinfo --split-size=1000000 maxima.texi make[3]: makeinfo: Command not found make[3]: *** [maxima.info] Error 127 make[3]: Leaving directory `/export/home/drkirkby/sage-4.6.2.alpha4/spkg/build/maxima-5.23.2/src/doc/info' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/export/home/drkirkby/sage-4.6.2.alpha4/spkg/build/maxima-5.23.2/src/doc/info' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/export/home/drkirkby/sage-4.6.2.alpha4/spkg/build/maxima-5.23.2/src/doc' make: *** [all-recursive] Error 1 -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? Dave From toy.raymond at gmail.com Tue Feb 15 13:39:10 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 15 Feb 2011 14:39:10 -0500 Subject: [Maxima] Can we build Maxima without needing makeinfo? In-Reply-To: <4D5AC2C5.3090602@onetel.net> References: <4D5A7038.1000405@onetel.net> <4D5AC2C5.3090602@onetel.net> Message-ID: <4D5AD65E.8040406@gmail.com> On 2/15/11 1:15 PM, Dr. David Kirkby wrote: > On 02/15/11 05:01 PM, Robert Dodier wrote: >> Here are a couple of ideas. >> One is to build Maxima from a tar.gz as provided on >> the SF file manager. >> Tarballs are built via make dist-gzip and they contain >> the generated .info files so makeinfo isn't needed afterwards. > > That's basically what is done. The file was downloaded from sourceforge: > > drkirkby at hawk:~$ digest -a md5 maxima-5.23.2.tar.gz > ae2f2eaca33de95636e36652ed281902 > > then configured with > > ./configure --prefix="$SAGE_LOCAL" --enable-ecl > > But I'm told by someone else that it failed since he did not have > makeinfo. I think you can just cd to src and then run "make ecl". This will just make maxima with ecl. No attempt will be made to build the info files or anything else. Ray From l.butler at ed.ac.uk Tue Feb 15 15:19:01 2011 From: l.butler at ed.ac.uk (Leo T Butler) Date: Tue, 15 Feb 2011 21:19:01 +0000 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <4D5A778C.40503@gmail.com> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D59CB94.1010002@gmail.com> <20110215035825.81510p0w9rc1qwv4@www.staffmail.ed.ac.uk> <4D5A778C.40503@gmail.com> Message-ID: <20110215211901.199905jyl303noas@www.staffmail.ed.ac.uk> Quoting Raymond Toy : > On 2/14/11 10:58 PM, Leo T Butler wrote: >> Quoting Raymond Toy : >> >>> On 2/13/11 7:27 PM, Leo T Butler wrote: >>>> >>>> 4. REQUEST: please checkout and test the above code. I am especially >>>> interested in hearing about bugs or feature requests. >>>> At the moment, the code appears to work for me with clisp+cmucl+sbcl, >>>> but it may need tweaking for other lisps, so I am interested in >>>> hearing about how it works on other lisps, too. >>> Works ok with ccl. I didn't too any real testing other than to run >>> setup_help_database() and ask for documentation for a few random >>> functions. >>> >>> Ecl doesn't work. It seems to have compiled everything, but >>> setup_help_database eventually causes some unspecific Lisp error about >>> invalid or protected memory error. >>> >>> Gcl won't even compile. This is a showstopper until we decide that gcl >>> is not the main Lisp anymore. >> >> Thanks, Ray. Could you post the error messages for these Lisps, please. > With ecl, setup_help_database() takes a bit of time (over 60 sec) and > gives this: > > Detected access to an invalid or protected memory address. > > Available restarts: > > 1. (CONTINUE) Ignore signal > 2. (MACSYMA-QUIT) Maxima top-level > > The backtrace isn't particularly helpful. It just lists (run). Note > that one this machine, clisp will setup the data base in 10 sec; cmucl, > 1.3 sec. > > Oh, wait. ecl just succeeded after 75 sec. That's first time I've seen > it, in some 5-10 attempts. And now it's consistently succeeding (3 more > tests). I didn't change anything because I just ran it and copied the > message above just now. Bizarre. Ah. It's because the failed runs use > -g (enable debugging). Without -g, setup_help_database works fine with > ecl. (Ecl 11.1.1, for the record.) I guess you are seeing a bug in ecl when run in debugger mode. > > But given that it takes 75 sec for ecl to build this, I hope that > setup_help_database is run during compilation so that the user doesn't > need to build the database at startup. Yes, in the git branch I pointed you to, the setup_help_database is run at build time in place of the perl script, and the info hashes ought to be autoloaded when describe or apropos are called for the first time. It's my suspicion that ecl is doing some sub-optimal things with the cl-ppcre code. I inquired on the cl-ppcre list if they were aware of the situation with ecl, and one of the ecl devs replied that he would be interested in finding some good test cases where ecl runs slowly. > > For gcl, gcl cannot compile cl-ppcre: > > Compiling /apps2/src/sourceforge/Maxima-CAS/src/cl-ppcre/errors.lisp. > Invalid DEFINE-CONDITION option: (:DEFAULT-INITARGS :POS NIL :STRING > *SYNTAX-ERROR-STRING*) > > Fast links are on: do (use-fast-links nil) for debugging > Broken at FUNCALL. Type :H for Help. Edi Weitiz pointed out this is a bug in gcl; at least the bit that gcl barfs on is valid cl a la the hyperspec. To be honest, I haven't been able to build HEAD with gcl for more than a year. I don't know how others manage. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From toy.raymond at gmail.com Tue Feb 15 15:24:40 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 15 Feb 2011 16:24:40 -0500 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <20110215211901.199905jyl303noas@www.staffmail.ed.ac.uk> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D59CB94.1010002@gmail.com> <20110215035825.81510p0w9rc1qwv4@www.staffmail.ed.ac.uk> <4D5A778C.40503@gmail.com> <20110215211901.199905jyl303noas@www.staffmail.ed.ac.uk> Message-ID: <4D5AEF18.6000609@gmail.com> On 2/15/11 4:19 PM, Leo T Butler wrote: > > Edi Weitiz pointed out this is a bug in gcl; at least the bit that gcl > barfs on is valid cl a la the hyperspec. To be honest, I haven't been > able to build HEAD with gcl for more than a year. I don't know how > others manage. I haven't built gcl in quite some time. I did succeed about a year ago, with some hacking on Solaris machine. the same hacks were not enough to get gcl built on a Linux machine (!). At that point, I gave up. Since ccl works nicely on Windows, Linux, and Mac OSX (which probably covers 99% of all maxima users), I think that would be a candidate. And ccl has commercial support, which is a bonus for those who might need it. And it's open source for those who want to hack on it. Ray From ferriste at gmail.com Tue Feb 15 16:23:58 2011 From: ferriste at gmail.com (Stefano Ferri) Date: Tue, 15 Feb 2011 23:23:58 +0100 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <4D5AEF18.6000609@gmail.com> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D59CB94.1010002@gmail.com> <20110215035825.81510p0w9rc1qwv4@www.staffmail.ed.ac.uk> <4D5A778C.40503@gmail.com> <20110215211901.199905jyl303noas@www.staffmail.ed.ac.uk> <4D5AEF18.6000609@gmail.com> Message-ID: 2011/2/15 Raymond Toy > On 2/15/11 4:19 PM, Leo T Butler wrote: > > > > Edi Weitiz pointed out this is a bug in gcl; at least the bit that gcl > > barfs on is valid cl a la the hyperspec. To be honest, I haven't been > > able to build HEAD with gcl for more than a year. I don't know how > > others manage. > I haven't built gcl in quite some time. I did succeed about a year ago, > with some hacking on Solaris machine. the same hacks were not enough to > get gcl built on a Linux machine (!). At that point, I gave up. > > Since ccl works nicely on Windows, Linux, and Mac OSX (which probably > covers 99% of all maxima users), I think that would be a candidate. And > ccl has commercial support, which is a bonus for those who might need > it. And it's open source for those who want to hack on it. > > Ray > > I have succesfully built both gcl and maxima against it on my Slackware 13.1 . The only problem I had at the beginning (some months ago) was the readline support, but this was due to a ./configure problem, in fact gcl was assuming that libreadline.so was dynamically linked to libncurses, but this not true for Slackware, altough it is for Debian/Ubuntu. Camm Maguire helped me a lot with this issue by modifying the configure script, and now the build process works fine. Maybe you can retry now, I don't know if this was your problem. I'm using gcl because of its speeed. Before I was using clisp, but it is really slow compared to gcl. Stefano -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.kirkby at onetel.net Tue Feb 15 16:29:28 2011 From: david.kirkby at onetel.net (Dr. David Kirkby) Date: Tue, 15 Feb 2011 22:29:28 +0000 Subject: [Maxima] Can we build Maxima without needing makeinfo? In-Reply-To: <4D5AD65E.8040406@gmail.com> References: <4D5A7038.1000405@onetel.net> <4D5AC2C5.3090602@onetel.net> <4D5AD65E.8040406@gmail.com> Message-ID: <4D5AFE48.70707@onetel.net> On 02/15/11 07:39 PM, Raymond Toy wrote: > On 2/15/11 1:15 PM, Dr. David Kirkby wrote: >> On 02/15/11 05:01 PM, Robert Dodier wrote: >>> Here are a couple of ideas. >>> One is to build Maxima from a tar.gz as provided on >>> the SF file manager. >>> Tarballs are built via make dist-gzip and they contain >>> the generated .info files so makeinfo isn't needed afterwards. >> >> That's basically what is done. The file was downloaded from sourceforge: >> >> drkirkby at hawk:~$ digest -a md5 maxima-5.23.2.tar.gz >> ae2f2eaca33de95636e36652ed281902 >> >> then configured with >> >> ./configure --prefix="$SAGE_LOCAL" --enable-ecl >> >> But I'm told by someone else that it failed since he did not have >> makeinfo. > I think you can just cd to src and then run "make ecl". This will just > make maxima with ecl. No attempt will be made to build the info files > or anything else. > > Ray Thank you. This seems like a bug, since the .info files are in the source tree. I "touched" the info file to ensure the time stamps are later than the files they are generated from, and still the problem persists. I would like to install maxima too, but no doubt if I type "make install" it will start trying to create the .info files again. So it's hard to know exactly what to do. --- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? Dave From l.butler at ed.ac.uk Tue Feb 15 17:07:09 2011 From: l.butler at ed.ac.uk (Leo T Butler) Date: Tue, 15 Feb 2011 23:07:09 +0000 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D59CB94.1010002@gmail.com> <20110215035825.81510p0w9rc1qwv4@www.staffmail.ed.ac.uk> <4D5A778C.40503@gmail.com> <20110215211901.199905jyl303noas@www.staffmail.ed.ac.uk> <4D5AEF18.6000609@gmail.com> Message-ID: <20110215230709.828473fapdkcjack@www.staffmail.ed.ac.uk> Quoting Stefano Ferri : > 2011/2/15 Raymond Toy > >> On 2/15/11 4:19 PM, Leo T Butler wrote: >> > >> > Edi Weitiz pointed out this is a bug in gcl; at least the bit that gcl >> > barfs on is valid cl a la the hyperspec. To be honest, I haven't been >> > able to build HEAD with gcl for more than a year. I don't know how >> > others manage. >> I haven't built gcl in quite some time. I did succeed about a year ago, >> with some hacking on Solaris machine. the same hacks were not enough to >> get gcl built on a Linux machine (!). At that point, I gave up. >> >> Since ccl works nicely on Windows, Linux, and Mac OSX (which probably >> covers 99% of all maxima users), I think that would be a candidate. And >> ccl has commercial support, which is a bonus for those who might need >> it. And it's open source for those who want to hack on it. >> >> Ray >> >> > I have succesfully built both gcl and maxima against it on my Slackware 13.1 > . The only problem I had at the beginning (some months ago) was the readline > support, but this was due to a ./configure problem, in fact gcl was assuming > that libreadline.so was dynamically linked to libncurses, but this not true > for Slackware, altough it is for Debian/Ubuntu. > Camm Maguire helped me a lot with this issue by modifying the configure > script, and now the build process works fine. > Maybe you can retry now, I don't know if this was your problem. > I'm using gcl because of its speeed. Before I was using clisp, but it is > really slow compared to gcl. I just built gcl from HEAD, which worked fine on debian testing. What does not work at all for me is building Maxima HEAD from gcl. Perhaps Camm is using a custom build script for Maxima, but our build process barfs immediately. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From willisb at unk.edu Tue Feb 15 17:14:05 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 15 Feb 2011 17:14:05 -0600 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <4D5AEF18.6000609@gmail.com> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D59CB94.1010002@gmail.com> <20110215035825.81510p0w9rc1qwv4@www.staffmail.ed.ac.uk> <4D5A778C.40503@gmail.com> <20110215211901.199905jyl303noas@www.staffmail.ed.ac.uk>, <4D5AEF18.6000609@gmail.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Since?ccl?works?nicely?on?Windows,?Linux,?and?Mac?OSX?(which?probably >covers?99%?of?all?maxima?users),?I?think?that?would?be?a?candidate.?? Some time ago (year or more) I reported several Maxima testsuite failures (Windows) to the ccl developers. The developers fixed the bugs in a few days--I helped just a little with some testing. --Barton From ferriste at gmail.com Tue Feb 15 17:29:36 2011 From: ferriste at gmail.com (Stefano Ferri) Date: Wed, 16 Feb 2011 00:29:36 +0100 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <20110215230709.828473fapdkcjack@www.staffmail.ed.ac.uk> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D59CB94.1010002@gmail.com> <20110215035825.81510p0w9rc1qwv4@www.staffmail.ed.ac.uk> <4D5A778C.40503@gmail.com> <20110215211901.199905jyl303noas@www.staffmail.ed.ac.uk> <4D5AEF18.6000609@gmail.com> <20110215230709.828473fapdkcjack@www.staffmail.ed.ac.uk> Message-ID: I just built gcl from HEAD, which worked fine on debian testing. > What does not work at all for me is building Maxima HEAD from gcl. > Perhaps Camm is using a custom build script for Maxima, but our > build process barfs immediately. > > > Leo > > Well, I've built gcl from head, but maxima is the 5.23.2 version. 5.22 was working, too. I'm using scripts to generate Slackware packages and upload them on a repository. I use no particular options, except for --enable-ansi --enable-readline for gcl --enable-gcl for maxima Can I ask you what kind of error stops the compilation on your machine? Tomorrow I'll try with the head version of maxima. Stefano -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbowyer at olynet.com Tue Feb 15 18:53:56 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Tue, 15 Feb 2011 16:53:56 -0800 Subject: [Maxima] Question regarding git/gcl/maxima Message-ID: <4D5B2024.7030302@olynet.com> Leo: I've been following the thread "[Maxima] build-index, cl-ppcre and github" and I would like to experiment a little. You mentioned in one of your posts that you built GCL from HEAD (which I assumed to mean that you used 'git') and I wonder if you would provide a brief tutorial on the steps necessary to use 'git' to retrieve GCL? I have already done this successfully using CVS to retrieve gcl-2.6.8pre, but I would like to know how to achieve it using 'git'. I'm curious to see if I can successfully build maxima from HEAD also (using 'git' and your repository), but I wanted start with GCL first to see if I can do that properly. Thanks in advance, Paul From toy.raymond at gmail.com Tue Feb 15 19:28:42 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 15 Feb 2011 20:28:42 -0500 Subject: [Maxima] Can we build Maxima without needing makeinfo? In-Reply-To: <4D5AFE48.70707@onetel.net> References: <4D5A7038.1000405@onetel.net> <4D5AC2C5.3090602@onetel.net> <4D5AD65E.8040406@gmail.com> <4D5AFE48.70707@onetel.net> Message-ID: <4D5B284A.1030902@gmail.com> On 2/15/11 5:29 PM, Dr. David Kirkby wrote: > On 02/15/11 07:39 PM, Raymond Toy wrote: >> On 2/15/11 1:15 PM, Dr. David Kirkby wrote: >>> On 02/15/11 05:01 PM, Robert Dodier wrote: >>>> Here are a couple of ideas. >>>> One is to build Maxima from a tar.gz as provided on >>>> the SF file manager. >>>> Tarballs are built via make dist-gzip and they contain >>>> the generated .info files so makeinfo isn't needed afterwards. >>> >>> That's basically what is done. The file was downloaded from >>> sourceforge: >>> >>> drkirkby at hawk:~$ digest -a md5 maxima-5.23.2.tar.gz >>> ae2f2eaca33de95636e36652ed281902 >>> >>> then configured with >>> >>> ./configure --prefix="$SAGE_LOCAL" --enable-ecl >>> >>> But I'm told by someone else that it failed since he did not have >>> makeinfo. >> I think you can just cd to src and then run "make ecl". This will just >> make maxima with ecl. No attempt will be made to build the info files >> or anything else. >> >> Ray > > Thank you. > > This seems like a bug, since the .info files are in the source tree. Speaking for just for me, I think that Sage is already a huge agglomeration of "stuff" that making one more small additional requirement of having makeinfo available is not too onerous. I'm guessing, since I've never tried building Sage let alone looked at the code. This is one reason why I have one build of gcl available to build maxima. It's easy to make changes that will fail to compile with gcl, so I test with gcl once in a while. It's a hassle, but I don't won't to break the windows build of maxima because gcl won't compile maxima. Ray From maclair at gamma.ttk.pte.hu Tue Feb 15 09:50:30 2011 From: maclair at gamma.ttk.pte.hu (M. M.) Date: Tue, 15 Feb 2011 15:50:30 +0000 (UTC) Subject: [Maxima] integrate(1/x,x,0,1) Message-ID: Dear All, Is there a way to get the correct answer from Maxima to "integrate(1/x,x,0,1)"? (I mean infinity.) Best regards, Matyas From villate at fe.up.pt Wed Feb 16 03:06:55 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 16 Feb 2011 09:06:55 +0000 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <4D5AEF18.6000609@gmail.com> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D59CB94.1010002@gmail.com> <20110215035825.81510p0w9rc1qwv4@www.staffmail.ed.ac.uk> <4D5A778C.40503@gmail.com> <20110215211901.199905jyl303noas@www.staffmail.ed.ac.uk> <4D5AEF18.6000609@gmail.com> Message-ID: <1297847215.1960.3.camel@wigner> On Tue, 2011-02-15 at 16:24 -0500, Raymond Toy wrote: > I haven't built gcl in quite some time. I did succeed about a year > ago, with some hacking on Solaris machine. the same hacks were not > enough to get gcl built on a Linux machine (!). At that point, I gave > up. I also gave up on gcl some time ago. > Since ccl works nicely on Windows, Linux, and Mac OSX (which probably > covers 99% of all maxima users), I think that would be a candidate. > And ccl has commercial support, which is a bonus for those who might > need it. And it's open source for those who want to hack on it. I usually build Maxima in Ubuntu with clisp, sbcl and ccl and from those 3, ccl is my favorite. Jaime From villate at fe.up.pt Wed Feb 16 03:10:58 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 16 Feb 2011 09:10:58 +0000 Subject: [Maxima] Can we build Maxima without needing makeinfo? In-Reply-To: <4D5AFE48.70707@onetel.net> References: <4D5A7038.1000405@onetel.net> <4D5AC2C5.3090602@onetel.net> <4D5AD65E.8040406@gmail.com> <4D5AFE48.70707@onetel.net> Message-ID: <1297847458.1960.6.camel@wigner> On Tue, 2011-02-15 at 22:29 +0000, Dr. David Kirkby wrote: > I would like to install maxima too, but no doubt if I type "make > install" it will start trying to create the .info files again. So it's > hard to know exactly what to do. Try "make install" from inside the src/ subdirectory. That should install just the core Maxima. You might also have to do "make; make install" from inside the share/ and interfaces/xmaxima subdirectories, to make the additional packages work too. Regards, Jaime From david.kirkby at onetel.net Wed Feb 16 06:05:11 2011 From: david.kirkby at onetel.net (Dr. David Kirkby) Date: Wed, 16 Feb 2011 12:05:11 +0000 Subject: [Maxima] Can we build Maxima without needing makeinfo? In-Reply-To: <4D5B284A.1030902@gmail.com> References: <4D5A7038.1000405@onetel.net> <4D5AC2C5.3090602@onetel.net> <4D5AD65E.8040406@gmail.com> <4D5AFE48.70707@onetel.net> <4D5B284A.1030902@gmail.com> Message-ID: <4D5BBD77.2090602@onetel.net> On 02/16/11 01:28 AM, Raymond Toy wrote: > Speaking for just for me, I think that Sage is already a huge > agglomeration of "stuff"that making one more small additional > requirement of having makeinfo available is not too onerous. We don't want to add extra stuff if we can, but in this case it seems to be unnecessary. We can get around the problem with the following. ./configure --prefix="$SAGE_LOCAL" --enable-ecl # Touching html and info file to avoid to regenerate them. # This must be done after configuration since the timestamp need # to be later than include-maxima.texi which is generated at # configuration time for i in doc/info/*.html ; do touch "${i}" done touch doc/info/maxima.info* make Now we don't need makeinfo. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? Dave From fmaltey at nerim.fr Wed Feb 16 08:23:44 2011 From: fmaltey at nerim.fr (Francois Maltey) Date: Wed, 16 Feb 2011 15:23:44 +0100 Subject: [Maxima] Why this recent change about (-1)^(1/3) ? Message-ID: <4D5BDDF0.1040701@nerim.fr> Hello, I discover Maxima and compare it to Sage or Maple. I feel that Maxima changes about (-1)^(1/3). My old maxima is 5.13.0 from an Ubuntu box and is fine, but a more recent maxima in Sage is less nice. Is there a reason ? First the (-1)^(1/3)=-1 in the old maxima, and the solve after is right. (%i2) (-1)^(1/3) ; (%o2) - 1 (%i4) solve (3*x^3-9*x+10, x) ; sqrt(3) %i 1 - ---------- - - 1/3 sqrt(3) %i 1 2 2 (%o4) [x = - 3 (---------- - -) - ----------------, 2 2 1/3 3 sqrt(3) %i 1 ---------- - - 2 2 1/3 sqrt(3) %i 1 1/3 1 x = - -------------- - 3 (- ---------- - -), x = - 3 - ----] 1/3 2 2 1/3 3 3 Now I call a more recent maxima built in Sage 4.6.1 at 2011-01-11 This maxima seems to be a 5.22.1 but I'm not sure. I don't know how Sage works, I only find this library in Sage. The (-1)^(1/3) remains and the solve result is a little too long. sage: maxima ('(-1)^(1/3)') (-1)^(1/3) sage: maxima ('solve (3*x^3-9*x+10,x)') [ x=3^(1/3)*(sqrt(3)*%i/2-1/2)/(-1)^(1/3) + (-1)^(1/3)*(-sqrt(3)*%i/2-1/2)/3^(1/3), x=(-1)^(1/3)*(sqrt(3)*%i/2-1/2)/3^(1/3) + 3^(1/3)*(-sqrt(3)*%i/2-1/2)/(-1)^(1/3), x=3^(1/3)/(-1)^(1/3)+(-1)^(1/3)/3^(1/3)] Is there a reason ? F. from France. From l.butler at ed.ac.uk Wed Feb 16 09:23:52 2011 From: l.butler at ed.ac.uk (Leo T Butler) Date: Wed, 16 Feb 2011 15:23:52 +0000 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D59CB94.1010002@gmail.com> <20110215035825.81510p0w9rc1qwv4@www.staffmail.ed.ac.uk> <4D5A778C.40503@gmail.com> <20110215211901.199905jyl303noas@www.staffmail.ed.ac.uk> <4D5AEF18.6000609@gmail.com> <20110215230709.828473fapdkcjack@www.staffmail.ed.ac.uk> Message-ID: <20110216152352.13244vgt6ez9vgu8@www.staffmail.ed.ac.uk> Quoting Stefano Ferri : > I just built gcl from HEAD, which worked fine on debian testing. > >> What does not work at all for me is building Maxima HEAD from gcl. >> Perhaps Camm is using a custom build script for Maxima, but our >> build process barfs immediately. >> >> >> Leo >> >> > Well, I've built gcl from head, but maxima is the 5.23.2 version. 5.22 was > working, too. > I'm using scripts to generate Slackware packages and upload them on a > repository. > > I use no particular options, except for > > --enable-ansi --enable-readline for gcl > --enable-gcl for maxima > > Can I ask you what kind of error stops the compilation on your machine? > > Tomorrow I'll try with the head version of maxima. Sure, the first problem is that gcl complains that the package user is undefined; if I add (defpackage :user), then compilation proceeds until I get ; - Compiling module "declarations" ; - Loading binary file "binary-gcl/lmdcls.o" ;; Loading binary-gcl/lmdcls.o check_type_symbol is undefined Since there is a line in the lmdcls.lisp which looks like it does define check_type_symbol, I'm lost. gcl is compiled with --enable-ansi. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From l.butler at ed.ac.uk Wed Feb 16 09:46:17 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 16 Feb 2011 15:46:17 +0000 (GMT) Subject: [Maxima] Question regarding git/gcl/maxima In-Reply-To: <4D5B2024.7030302@olynet.com> References: <4D5B2024.7030302@olynet.com> Message-ID: On Tue, 15 Feb 2011, Paul Bowyer wrote: < Leo: < < I've been following the thread "[Maxima] build-index, cl-ppcre and github" and < I would like to experiment a little. < < You mentioned in one of your posts that you built GCL from HEAD (which I < assumed to mean that you used 'git') and I wonder if you would provide a brief < tutorial on the steps necessary to use 'git' to retrieve GCL? I have already < done this successfully using CVS to retrieve gcl-2.6.8pre, but I would like to < know how to achieve it using 'git'. Hi Paul, I build gcl from HEAD on the savannah cvs repository. No need for git, although you can use the git cvsimport command to clone the cvs repo as a git repo, and you can even pull updates from the cvs repo into your git clone, provided you don't fiddle with the branches (i.e. do all your hacking on new branches). The manpage explains this better than I can. < < I'm curious to see if I can successfully build maxima from HEAD also (using < 'git' and your repository), but I wanted start with GCL first to see if I can < do that properly. If I can help, please do ask. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From talon at lpthe.jussieu.fr Wed Feb 16 10:06:56 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 16 Feb 2011 17:06:56 +0100 Subject: [Maxima] Why this recent change about (-1)^(1/3) ? References: <4D5BDDF0.1040701@nerim.fr> Message-ID: Francois Maltey wrote: > Hello, > > I discover Maxima and compare it to Sage or Maple. > > I feel that Maxima changes about (-1)^(1/3). > > My old maxima is 5.13.0 from an Ubuntu box and is fine, > but a more recent maxima in Sage is less nice. > Is there a reason ? > > First the (-1)^(1/3)=-1 in the old maxima, and the solve after is right. > > (%i2) (-1)^(1/3) ; > (%o2) - 1 > > (%i4) solve (3*x^3-9*x+10, x) ; > sqrt(3) %i 1 > - ---------- - - > 1/3 sqrt(3) %i 1 2 2 > (%o4) [x = - 3 (---------- - -) - ----------------, > 2 2 1/3 > 3 > sqrt(3) %i 1 > ---------- - - > 2 2 1/3 sqrt(3) %i 1 1/3 > 1 > x = - -------------- - 3 (- ---------- - -), x = - 3 > - ----] > 1/3 2 > 2 1/3 > 3 > 3 > > Now I call a more recent maxima built in Sage 4.6.1 at 2011-01-11 > This maxima seems to be a 5.22.1 but I'm not sure. Here i have maxima 5.22.1 (not from sage) and i get the same as you: (%i1) solve(3*x^3-9*x+10, x) ; sqrt(3) %i 1 - ---------- - - 1/3 sqrt(3) %i 1 2 2 (%o1) [x = - 3 (---------- - -) - ----------------, 2 2 1/3 3 sqrt(3) %i 1 ---------- - - 2 2 1/3 sqrt(3) %i 1 1/3 1 x = - -------------- - 3 (- ---------- - -), x = - 3 - ----] 1/3 2 2 1/3 3 3 (%i2) (-1)^(1/3) ; (%o2) - 1 -- Michel Talon From macrakis at alum.mit.edu Wed Feb 16 10:32:06 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 16 Feb 2011 11:32:06 -0500 Subject: [Maxima] Why this recent change about (-1)^(1/3) ? In-Reply-To: <4D5BDDF0.1040701@nerim.fr> References: <4D5BDDF0.1040701@nerim.fr> Message-ID: Francois, Thanks for your email and your interest in Maxima. I am not sure what exactly the problem is you're having. Are the roots incorrect in some versions of Maxima? Keep in mind that there are many ways of expressing the same number, e.g. 2*(sqrt(2)-1) == 2^(3/2)-2 == 2/(sqrt(2)+1), and many tools within Maxima for changing the form of expressions, including ratsimp, radcan, factor, block([algebraic:true],ratsimp(...)), etc. By the way, when showing algebraic results in email, please use display2d:false -- the 2-diimensional display in general isn't legible, and is cannot be re-entered into Maxima for testing. Thanks, -s On Wed, Feb 16, 2011 at 09:23, Francois Maltey wrote: > Hello, > > I discover Maxima and compare it to Sage or Maple. > > I feel that Maxima changes about (-1)^(1/3). > > My old maxima is 5.13.0 from an Ubuntu box and is fine, > but a more recent maxima in Sage is less nice. > Is there a reason ? > > First the (-1)^(1/3)=-1 in the old maxima, and the solve after is right. > > (%i2) (-1)^(1/3) ; > (%o2) - 1 > > (%i4) solve (3*x^3-9*x+10, x) ; > sqrt(3) %i 1 > - ---------- - - > 1/3 sqrt(3) %i 1 2 2 > (%o4) [x = - 3 (---------- - -) - ----------------, > 2 2 1/3 > 3 > sqrt(3) %i 1 > ---------- - - > 2 2 1/3 sqrt(3) %i 1 1/3 1 > x = - -------------- - 3 (- ---------- - -), x = - 3 - > ----] > 1/3 2 2 > 1/3 > 3 3 > > Now I call a more recent maxima built in Sage 4.6.1 at 2011-01-11 > This maxima seems to be a 5.22.1 but I'm not sure. > I don't know how Sage works, I only find this library in Sage. > The (-1)^(1/3) remains and the solve result is a little too long. > > sage: maxima ('(-1)^(1/3)') > (-1)^(1/3) > sage: maxima ()') > [ x=3^(1/3)*(sqrt(3)*%i/2-1/2)/(-1)^(1/3) + > (-1)^(1/3)*(-sqrt(3)*%i/2-1/2)/3^(1/3), > x=(-1)^(1/3)*(sqrt(3)*%i/2-1/2)/3^(1/3) + > 3^(1/3)*(-sqrt(3)*%i/2-1/2)/(-1)^(1/3), > x=3^(1/3)/(-1)^(1/3)+(-1)^(1/3)/3^(1/3)] > > Is there a reason ? > F. from France. > > _______________________________________________ > 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 andrej.vodopivec at gmail.com Wed Feb 16 10:53:48 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Wed, 16 Feb 2011 17:53:48 +0100 Subject: [Maxima] Why this recent change about (-1)^(1/3) ? In-Reply-To: <4D5BDDF0.1040701@nerim.fr> References: <4D5BDDF0.1040701@nerim.fr> Message-ID: Sage sets the option variable domain to complex. This makes the results in Sage different from results in Maxima: (%i1) domain:complex$ (%i2) (-1)^(1/3); (%o2) (-1)^(1/3) (%i3) solve(3*x^3-9*x+10, x); (%o3) [x=(3^(1/3)*((sqrt(3)*%i)/2-1/2))/(-1)^(1/3)+((-1)^(1/3)*(-(sqrt(3)*%i)/2-1/2))/3^(1/3),x=((-1)^(1/3)*((sqrt(3)*%i)/2-1/2))/3^(1/3)+(3^(1/3)*(-(sqrt(3)*%i)/2-1/2))/(-1)^(1/3),x=3^(1/3)/(-1)^(1/3)+(-1)^(1/3)/3^(1/3)] (%i4) domain:real$ (%i5) (-1)^(1/3); (%o5) -1 (%i6) solve(3*x^3-9*x+10, x); (%o6) [x=-3^(1/3)*((sqrt(3)*%i)/2-1/2)-(-(sqrt(3)*%i)/2-1/2)/3^(1/3),x=-((sqrt(3)*%i)/2-1/2)/3^(1/3)-3^(1/3)*(-(sqrt(3)*%i)/2-1/2),x=-3^(1/3)-1/3^(1/3)] HTH, Andrej On Wed, Feb 16, 2011 at 3:23 PM, Francois Maltey wrote: > Hello, > > I discover Maxima and compare it to Sage or Maple. > > I feel that Maxima changes about (-1)^(1/3). > > My old maxima is 5.13.0 from an Ubuntu box and is fine, > but a more recent maxima in Sage is less nice. > Is there a reason ? > > First the (-1)^(1/3)=-1 in the old maxima, and the solve after is right. > > (%i2) (-1)^(1/3) ; > (%o2) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - 1 > > (%i4) solve (3*x^3-9*x+10, x) ; > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?sqrt(3) %i ? 1 > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ---------- - - > ? ? ? ? ? ? 1/3 ?sqrt(3) %i ? 1 ? ? ? ? ?2 ? ? ? ?2 > (%o4) [x = - 3 ? ?(---------- - -) - ----------------, > ? ? ? ? ? ? ? ? ? ? ?2 ? ? ? ?2 ? ? ? ? ? 1/3 > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?3 > ? ? ? ? ? ? ? ? ?sqrt(3) %i ? 1 > ? ? ? ? ? ? ? ? ?---------- - - > ? ? ? ? ? ? ? ? ? ? ?2 ? ? ? ?2 ? ?1/3 ? ?sqrt(3) %i ? 1 ? ? ? ? ?1/3 ? ?1 > ? ? ? ? ? ?x = - -------------- - 3 ? ?(- ---------- - -), x = - 3 ? ?- > ----] > ? ? ? ? ? ? ? ? ? ? ? ?1/3 ? ? ? ? ? ? ? ? ? ?2 ? ? ? ?2 ? ? ? ? ? ? ? ? 1/3 > ? ? ? ? ? ? ? ? ? ? ? 3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 3 > > Now I call a more recent maxima built in Sage 4.6.1 at 2011-01-11 > This maxima seems to be a 5.22.1 but I'm not sure. > I don't know how Sage works, I only find this library in Sage. > The (-1)^(1/3) remains and the solve result is a little too long. > > sage: maxima ('(-1)^(1/3)') > (-1)^(1/3) > sage: maxima ('solve (3*x^3-9*x+10,x)') > [ x=3^(1/3)*(sqrt(3)*%i/2-1/2)/(-1)^(1/3) + > (-1)^(1/3)*(-sqrt(3)*%i/2-1/2)/3^(1/3), > x=(-1)^(1/3)*(sqrt(3)*%i/2-1/2)/3^(1/3) + > 3^(1/3)*(-sqrt(3)*%i/2-1/2)/(-1)^(1/3), > x=3^(1/3)/(-1)^(1/3)+(-1)^(1/3)/3^(1/3)] > > Is there a reason ? > F. from France. > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From mhw at netris.org Wed Feb 16 12:15:07 2011 From: mhw at netris.org (Mark H Weaver) Date: Wed, 16 Feb 2011 13:15:07 -0500 Subject: [Maxima] integrate(1/x,x,0,1) In-Reply-To: (M. M.'s message of "Tue, 15 Feb 2011 15:50:30 +0000 (UTC)") References: Message-ID: <87hbc34zis.fsf@netris.org> M. M. writes: > Is there a way to get the correct answer from Maxima to > "integrate(1/x,x,0,1)"? > (I mean infinity.) You could ask for the limit of the integral as the lower bound approaches zero from the right: (%i2) assume(e>0, e<1); (%o2) [e > 0,e < 1] (%i3) limit(integrate(1/x,x,e,1),e,0,plus); (%o3) inf Mark From pbowyer at olynet.com Wed Feb 16 14:29:32 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Wed, 16 Feb 2011 12:29:32 -0800 Subject: [Maxima] Question regarding git/gcl/maxima In-Reply-To: References: <4D5B2024.7030302@olynet.com> Message-ID: <4D5C33AC.7030703@olynet.com> On 02/16/2011 07:46 AM, Leo Butler wrote: > > On Tue, 15 Feb 2011, Paul Bowyer wrote: > > < Leo: > < > < I've been following the thread "[Maxima] build-index, cl-ppcre and github" and > < I would like to experiment a little. > < > < You mentioned in one of your posts that you built GCL from HEAD (which I > < assumed to mean that you used 'git') and I wonder if you would provide a brief > < tutorial on the steps necessary to use 'git' to retrieve GCL? I have already > < done this successfully using CVS to retrieve gcl-2.6.8pre, but I would like to > < know how to achieve it using 'git'. > > Hi Paul, > I build gcl from HEAD on the savannah cvs repository. No need for git, > although you can use the git cvsimport command to clone the cvs repo as > a git repo, and you can even pull updates from the cvs repo into your > git clone, provided you don't fiddle with the branches (i.e. do all your > hacking on new branches). The manpage explains this better than I can. > > < > < I'm curious to see if I can successfully build maxima from HEAD also (using > < 'git' and your repository), but I wanted start with GCL first to see if I can > < do that properly. > > If I can help, please do ask. > Leo > Leo: Apparently you are doing similar to what I have already done for GCL so there's no advantage in migrating from cvs to git for building GCL. --------------------------------------------------------------------------------------------------------------------------------------------------------- For those who are having difficulty with GCL builds, I got the following from Camm Maguire on how to download her recommended version of GCL: cvs -d :pserver:anonymous at cvs.sv.gnu.org:/sources/gcl co -d gcl-2.6.8pre -r Version_2_6_8pre gcl I build RPM files for use with my personal software repository (instead of uploading to the PCLinuxOS distribution's public repository) so I also do: cd gcl-2.6.8pre make tar cd .. cp ngcl-2.6.8-beta.tgz /src/rpm/SOURCES/gcl-2.6.8.tgz I would be happy to include my RPM build spec (which I copied and modified) if anyone wants it, but here are the configure options I use: %configure2_5x --enable-notify=no --enable-ansi --enable-emacsdir=%{_datadir}/emacs/site-lisp \ --enable-readline \ --enable-dynsysgmp \ --enable-maxpage=128*1024 After the rpm file is completed and installed, GCL identifies itself as GCL 2.6.8 and I am able to build maxima-5.23.2 against it without problems ( I also make RPM files for maxima). --------------------------------------------------------------------------------------------------------------------------------------------------------- When I have opportunity, I'll try using git to download maxima from your repository and see if I can build it against my GCL. Do you have particular process you use for the build? Paul From xbenchi at gmail.com Wed Feb 16 14:57:00 2011 From: xbenchi at gmail.com (Chi Ben) Date: Wed, 16 Feb 2011 15:57:00 -0500 Subject: [Maxima] Problem with evaluation of integration Message-ID: Hi all, I guess this is a professional group working with Maxima, so my inquiry for basic knowledge of Maxima may not be very attractive for you to explore. But I will really appreciate your help. My question is: When I'm using the integrate function to evaluate an expression, sometimes Maxima gives me a value after calculation. But sometimes it just gives me a formal mathematical expression. For example, when I enter this: integrate(e^(-x),x,1,5); I get an expression with the integration symbol, the limits and everything, instead of the evaluation result. Can you please tell me how to get the numbers I'm looking for? Thanks, Chi Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From ferriste at gmail.com Wed Feb 16 15:30:00 2011 From: ferriste at gmail.com (Stefano Ferri) Date: Wed, 16 Feb 2011 22:30:00 +0100 Subject: [Maxima] Segmentation fault with Maxima's "length" and gcl Message-ID: I was playing with two different Maxima builds, one made against gcl, the other one compiled against clisp. The following command: length("string"); that must produce an error, if repeated twice, causes gcl to produce a segmentation fault and Maxima to exit. Moreover, the first time takes about 2 seconds to get the error, while with clisp the error message is displayed immediately, and no segfault is produced by further errors. Maxima and Gcl (%i2) length("string"); 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. (%i3) length("string"); Segmentation fault ste at localhost:~/build/maxima-5.23.2$ Maxima and Clisp: (%i4) length("string"); Maxima encountered a Lisp error: CAR: #1="string" is not a list Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. I'm using the latest cvs version of gcl and Maxima 5.23.2, on Slackware Gnu/Linux 13.1. Stefano -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed Feb 16 15:39:31 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 16 Feb 2011 16:39:31 -0500 Subject: [Maxima] Problem with evaluation of integration In-Reply-To: References: Message-ID: Thanks for your question. By "e", I assume you intend Euler's constant 2.718... Maxima uses %e to represent that constant, and indeed integrate(%e^(-x),x,1,5) returns %e^-1-%e^-5 . You can get the numerical value of that with float(...) or ..., numer. But Maxima should actually be able to calculate integrate(a^(-x),x,1,5) with the parameter x, which is of course 1/(a*log(a))-1/(a^5*log(a)). This seems like a bug. It even fails on integrate(2^(-x),x,1,5) -- so it's not some subtle question relating to the sign of a or whatever. After all, it is perfectly happy to calculate the indefinite integral integrate(a^(-x),x) => -1/(a^x*log(a)) . Sorry about that! -s On Wed, Feb 16, 2011 at 15:57, Chi Ben wrote: > Hi all, > I guess this is a professional group working with Maxima, so my inquiry for > basic knowledge of Maxima may not be very attractive for you to explore. But > I will really appreciate your help. > My question is: > When I'm using the integrate function to evaluate an expression, sometimes > Maxima gives me a value after calculation. But sometimes it just gives me a > formal mathematical expression. For example, when I enter this: > integrate(e^(-x),x,1,5); > I get an expression with the integration symbol, the limits and everything, > instead of the evaluation result. > Can you please tell me how to get the numbers I'm looking for? > Thanks, > Chi Ben > > > _______________________________________________ > 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 Wed Feb 16 15:47:30 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Thu, 17 Feb 2011 08:47:30 +1100 Subject: [Maxima] Problem with evaluation of integration In-Reply-To: References: Message-ID: <4D5C45F2.1090306@gmail.com> On 17/02/2011 7:57 AM, Chi Ben wrote: > When I'm using the integrate function to evaluate an expression, > sometimes Maxima gives me a value after calculation. But sometimes it > just gives me a formal mathematical expression. For example, when I > enter this: > integrate(e^(-x),x,1,5); Strange, because maxima knows the indefinite integral (%i7) integrate(e^(-x),x); (%o7) -1/(e^x*log(e)) However, if your e - which is %e in maxima - is the base of the natural logarithm ~ 2.718... then all is not lost (%i8) integrate(%e^(-x),x,1,5); (%o8) %e^-1-%e^-5 From xbenchi at gmail.com Wed Feb 16 15:59:43 2011 From: xbenchi at gmail.com (Chi Ben) Date: Wed, 16 Feb 2011 16:59:43 -0500 Subject: [Maxima] Problem with evaluation of integration In-Reply-To: <4D5C45F2.1090306@gmail.com> References: <4D5C45F2.1090306@gmail.com> Message-ID: Thank you very much, I used %e and it works! Sincerely, Chi Ben On Wed, Feb 16, 2011 at 4:47 PM, David Billinghurst wrote: > On 17/02/2011 7:57 AM, Chi Ben wrote: > >> When I'm using the integrate function to evaluate an expression, sometimes >> Maxima gives me a value after calculation. But sometimes it just gives me a >> formal mathematical expression. For example, when I enter this: >> integrate(e^(-x),x,1,5); >> > > Strange, because maxima knows the indefinite integral > > (%i7) integrate(e^(-x),x); > (%o7) -1/(e^x*log(e)) > > However, if your e - which is %e in maxima - is the base of the natural > logarithm ~ 2.718... then all is not lost > > (%i8) integrate(%e^(-x),x,1,5); > (%o8) %e^-1-%e^-5 > > > > _______________________________________________ > 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 vttoth at vttoth.com Wed Feb 16 17:00:32 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Wed, 16 Feb 2011 18:00:32 -0500 Subject: [Maxima] Compilation failure due to missing maxima.system.in Message-ID: <02ec01cbce2d$533fa040$f9bee0c0$@vttoth.com> When I try to compile from CVS, compilation fails due to the file src/maxima.system.in missing. If I copy src/maxima.system to src/maxima.system.in, I can compile fine. Is this a regression in CVS or am I missing something obvious? Viktor From toy.raymond at gmail.com Wed Feb 16 17:29:22 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 16 Feb 2011 18:29:22 -0500 Subject: [Maxima] Compilation failure due to missing maxima.system.in In-Reply-To: <02ec01cbce2d$533fa040$f9bee0c0$@vttoth.com> References: <02ec01cbce2d$533fa040$f9bee0c0$@vttoth.com> Message-ID: <4D5C5DD2.1070401@gmail.com> On 2/16/11 6:00 PM, Viktor T. Toth wrote: > When I try to compile from CVS, compilation fails due to the file > src/maxima.system.in missing. If I copy src/maxima.system to > src/maxima.system.in, I can compile fine. Is this a regression in CVS or am > I missing something obvious? Dang. I was making some local changes and somehow I guess emacs decided to commit the change to the repo instead of my local repo. I will fix that right away. Ray From toy.raymond at gmail.com Wed Feb 16 17:43:38 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 16 Feb 2011 18:43:38 -0500 Subject: [Maxima] Maxima commit list is broken Message-ID: <4D5C612A.5010800@gmail.com> While reverting a change I made by accident, I see that the maxima commit list is broken. First, I never saw the commit being sent to the commit list. And now, when I have reverted the changes, I get an error that /bin/mail does not exist. Can someone look in to that? I don't think I have enough access to do anything about it. Ray From vttoth at vttoth.com Wed Feb 16 18:41:44 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Wed, 16 Feb 2011 19:41:44 -0500 Subject: [Maxima] Maxima commit list is broken In-Reply-To: <4D5C612A.5010800@gmail.com> References: <4D5C612A.5010800@gmail.com> Message-ID: <02f801cbce3b$76e8c630$64ba5290$@vttoth.com> Hmmm, the list appears to have disappeared just after the SF.net security breach. I wonder if it is something we need to ask SF about. Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Raymond Toy Sent: Wednesday, February 16, 2011 6:44 PM To: Maxima Mailing List Subject: [Maxima] Maxima commit list is broken While reverting a change I made by accident, I see that the maxima commit list is broken. First, I never saw the commit being sent to the commit list. And now, when I have reverted the changes, I get an error that /bin/mail does not exist. Can someone look in to that? I don't think I have enough access to do anything about it. Ray _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From willisb at unk.edu Thu Feb 17 06:01:03 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 17 Feb 2011 06:01:03 -0600 Subject: [Maxima] Problem with evaluation of integration In-Reply-To: References: <4D5C45F2.1090306@gmail.com>, Message-ID: By the way: (%i1) load(abs_integrate)$ (%i2) integrate(a^x,x); (%o2) a^x/log(a) (%i3) integrate(x*a^x,x); (%o3) ((log(a)*x-1)*%e^(log(a)*x))/log(a)^2 --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >When?I'm?using?the?integrate?function?to?evaluate?an?expression,?sometimes >Maxima?gives?me?a?value?after?calculation.?But?sometimes?it?just?gives?me >a?formal?mathematical?expression.?For?example,?when?I?enter?this: >integrate(e^(-x),x,1,5); From willisb at unk.edu Thu Feb 17 11:34:10 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 17 Feb 2011 11:34:10 -0600 Subject: [Maxima] Problem with evaluation of integration In-Reply-To: References: <4D5C45F2.1090306@gmail.com>, Message-ID: Thanks to a reader of this list, I now see that my post missed the mark on several points--loading abs_integrate does nothing for the problem. Sorry. --Barton maxima-bounces at math.utexas.edu wrote on 02/17/2011 06:01:03 AM: > > By the way: > > (%i1) load(abs_integrate)$ > (%i2) integrate(a^x,x); > (%o2) a^x/log(a) > > (%i3) integrate(x*a^x,x); > (%o3) ((log(a)*x-1)*%e^(log(a)*x))/log(a)^2 > > --Barton > > -----maxima-bounces at math.utexas.edu wrote: ----- > > >When I'm using the integrate function to evaluate an expression, sometimes > >Maxima gives me a value after calculation. But sometimes it just gives me > >a formal mathematical expression. For example, when I enter this: > > >integrate(e^(-x),x,1,5); > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From stefanveeser at gmx.net Thu Feb 17 11:45:56 2011 From: stefanveeser at gmx.net (Stefan Veeser) Date: Thu, 17 Feb 2011 17:45:56 -0000 Subject: [Maxima] function inversion In-Reply-To: References: <4D5C45F2.1090306@gmail.com>, Message-ID: <41E927F1664141C1B5F2217591C7B04A@StarwakePC> Hi, I defined a function giving a set of points with linearinterpol then I added another function, which I defined with a simple formula. The resulting function is still strictly rising in value, so mathematically it can be inverted, so I wanted to invert the function, but I could not find an operator for that anywere, I tried simplify([y=f(x)],x), which produced some expression, but not what I needed and funcsimplify([y=f(x(y)),x(y)), which failed (division by zero). Is there a standard way to do this ? it seems something pretty basic. for any help I would be very grateful, Stefan From macrakis at alum.mit.edu Thu Feb 17 13:23:50 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 17 Feb 2011 14:23:50 -0500 Subject: [Maxima] function inversion In-Reply-To: <41E927F1664141C1B5F2217591C7B04A@StarwakePC> References: <4D5C45F2.1090306@gmail.com> <41E927F1664141C1B5F2217591C7B04A@StarwakePC> Message-ID: The general way to invert a function is solve, e.g. ex: x^2 + x$ solve(ex = y, x); => [x = -(sqrt(4*y+1)+1)/2,x = (sqrt(4*y+1)-1)/2] However, for more than two points, linearinterpol returns a result involving charfun2, which Maxima's solve function doesn't know how to deal with. In general, Maxima is rather weak in dealing with piecewise-defined functions. Not sure what your intention is with 'simplify' and 'funcsimplify' -- as far as I know Maxima doesn't have functions by those names. Maxima performs basic simplifications without any special command, e.g. 2*x/4 => x/2. Other useful transformations, like (x-1)/(x^2-1) => 1/(x+1) (ratsimp) or 1/(x^2-1) => 1/2*(1/(x-1)-1/(x+1)) (1/2*multthru( partfrac(expr,x) / (1/2)) require more explicit commands. -s On Thu, Feb 17, 2011 at 12:45, Stefan Veeser wrote: > Hi, > > I defined a function giving a set of points with linearinterpol then I > added another function, which I defined with a simple formula. The resulting > function is still strictly rising in value, so mathematically it can be > inverted, so I wanted to invert the function, but I could not find an > operator for that anywere, I tried > > simplify([y=f(x)],x), which produced some expression, but not what I needed > and funcsimplify([y=f(x(y)),x(y)), which failed (division by zero). > > Is there a standard way to do this ? it seems something pretty basic. > > for any help I would be very grateful, > > Stefan > > > _______________________________________________ > 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 Feb 17 13:31:12 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 17 Feb 2011 13:31:12 -0600 Subject: [Maxima] function inversion In-Reply-To: <41E927F1664141C1B5F2217591C7B04A@StarwakePC> References: <4D5C45F2.1090306@gmail.com>, <41E927F1664141C1B5F2217591C7B04A@StarwakePC> Message-ID: maxima-bounces at math.utexas.edu wrote on 02/17/2011 11:45:56 AM: > I defined a function giving a set of points with linearinterpol then I added > another function, which I defined with a simple formula. The resulting > function is still strictly rising in value, so mathematically it can be > inverted, so I wanted to invert the function, but I could not find an > operator for that anywere, I tried > > simplify([y=f(x)],x), which produced some expression, but not what I needed Instead of simplify, maybe you need to use solve; try something like (%i8) solve(y = 5 * x + 7,x); (%o8) [x=(y-7)/5] Thus the inverse of f(x) = 5 x + 7 is g(y) = (y-7)/5. --Barton From robert.dodier at gmail.com Thu Feb 17 16:09:45 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 17 Feb 2011 15:09:45 -0700 Subject: [Maxima] Maxima commit list is broken In-Reply-To: <02f801cbce3b$76e8c630$64ba5290$@vttoth.com> References: <4D5C612A.5010800@gmail.com> <02f801cbce3b$76e8c630$64ba5290$@vttoth.com> Message-ID: For the record, I saw the error message about /bin/mail too and I don't know what that's about. Not sure what to do at this point. best Robert Dodier On 2/16/11, Viktor T. Toth wrote: > Hmmm, the list appears to have disappeared just after the SF.net security > breach. I wonder if it is something we need to ask SF about. > > > Viktor > > > -----Original Message----- > From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] > On Behalf Of Raymond Toy > Sent: Wednesday, February 16, 2011 6:44 PM > To: Maxima Mailing List > Subject: [Maxima] Maxima commit list is broken > > While reverting a change I made by accident, I see that the maxima > commit list is broken. First, I never saw the commit being sent to the > commit list. And now, when I have reverted the changes, I get an error > that /bin/mail does not exist. > > Can someone look in to that? I don't think I have enough access to do > anything about it. > > 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 > From macrakis at alum.mit.edu Thu Feb 17 16:25:59 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 17 Feb 2011 17:25:59 -0500 Subject: [Maxima] function inversion In-Reply-To: References: <4D5C45F2.1090306@gmail.com> <41E927F1664141C1B5F2217591C7B04A@StarwakePC> Message-ID: Maxima is a pretty good rapid-prototyping environment and includes much useful infrastructure, so I'd think you could code this up much faster in Maxima than in C++ -- at least once you're familiar with Maxima. You could certainly manipulate a list of intervals easily enough. If you know that f is monotonic, then once you find the breakpoints, you can do piecewise inversion easily enough. No time now to elaborate, sorry. -s On Thu, Feb 17, 2011 at 16:08, Stefan Veeser wrote: > thanks - at least I had the right approach as I meant solve, which is the > solution you suggest, when I said simplify. I wonder whether there is a way > to just work with sets of points, I.e. are there ways of having lists of > pairs of values, swapping the elements in the pairs, and given two lists of > pairs, form a new list of pairs, which merges the pairs from the two lists, > for example simulating the addition of two functions by matching pairs with > the same x value and add the two y values as the new y value... > Not sure whether that makes sense to you, probably a shot in the dark. I > was just hoping to get a quick answer I have about a certain problem, a > system which could invert, add and otherwise manipulate functions would be > very useful to me. I was hoping maxima would do that quicker than me having > to program it all out in C++. > > thanks, > > Stefan > > > *From:* Stavros Macrakis > *Sent:* Thursday, February 17, 2011 7:23 PM > *To:* Stefan Veeser > *Cc:* maxima at math.utexas.edu > *Subject:* Re: [Maxima] function inversion > > The general way to invert a function is solve, e.g. > > ex: x^2 + x$ > solve(ex = y, x); > => [x = -(sqrt(4*y+1)+1)/2,x = (sqrt(4*y+1)-1)/2] > > However, for more than two points, linearinterpol returns a result > involving charfun2, which Maxima's solve function doesn't know how to deal > with. In general, Maxima is rather weak in dealing with piecewise-defined > functions. > > Not sure what your intention is with 'simplify' and 'funcsimplify' -- as > far as I know Maxima doesn't have functions by those names. Maxima performs > basic simplifications without any special command, e.g. 2*x/4 => x/2. Other > useful transformations, like (x-1)/(x^2-1) => 1/(x+1) (ratsimp) or 1/(x^2-1) > => 1/2*(1/(x-1)-1/(x+1)) (1/2*multthru( partfrac(expr,x) / (1/2)) require > more explicit commands. > > -s > > On Thu, Feb 17, 2011 at 12:45, Stefan Veeser wrote: > >> Hi, >> >> I defined a function giving a set of points with linearinterpol then I >> added another function, which I defined with a simple formula. The resulting >> function is still strictly rising in value, so mathematically it can be >> inverted, so I wanted to invert the function, but I could not find an >> operator for that anywere, I tried >> >> simplify([y=f(x)],x), which produced some expression, but not what I >> needed and funcsimplify([y=f(x(y)),x(y)), which failed (division by zero). >> >> Is there a standard way to do this ? it seems something pretty basic. >> >> for any help I would be very grateful, >> >> Stefan >> >> >> _______________________________________________ >> 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 richhen2008 at gmail.com Thu Feb 17 16:42:19 2011 From: richhen2008 at gmail.com (Rich Hennessy) Date: Thu, 17 Feb 2011 17:42:19 -0500 Subject: [Maxima] Problem with evaluation of integration In-Reply-To: References: <4D5C45F2.1090306@gmail.com>, Message-ID: <647DBD866D464296A84DCB0E9972F27B@RichsLaptop> -----Original Message----- From: Barton Willis Sent: Thursday, February 17, 2011 7:01 AM To: Chi Ben Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Problem with evaluation of integration By the way: (%i1) load(abs_integrate)$ (%i2) integrate(a^x,x); (%o2) a^x/log(a) (%i3) integrate(x*a^x,x); (%o3) ((log(a)*x-1)*%e^(log(a)*x))/log(a)^2 --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >When I'm using the integrate function to evaluate an expression, sometimes >Maxima gives me a value after calculation. But sometimes it just gives me >a formal mathematical expression. For example, when I enter this: >integrate(e^(-x),x,1,5); That got me thinking about pwint() since it basically computes antidiff's and subtracts. So pwint() works, pw.mac's integrate command. (%i1) (load(pw), display2d:false)$ (%i2) pwint(e^(-x),x,1,5); (%o2) 1/(e*log(e))-1/(e^5*log(e)) (%i3) pwint(%e^(-x),x,1,5); (%o3) %e^-1-%e^-5 Rich From toy.raymond at gmail.com Thu Feb 17 16:58:59 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 17 Feb 2011 17:58:59 -0500 Subject: [Maxima] Maxima commit list is broken In-Reply-To: References: <4D5C612A.5010800@gmail.com> <02f801cbce3b$76e8c630$64ba5290$@vttoth.com> Message-ID: <4D5DA833.3080206@gmail.com> On 2/17/11 5:09 PM, Robert Dodier wrote: > For the record, I saw the error message about /bin/mail too > and I don't know what that's about. > Not sure what to do at this point. Complain to Sourceforge I guess. I tried to login and look around, but I don't really know how to admin the cvs repo on SF. I don't even know where the repo is. I guess you're supposed to use admin-repo, but that's been disabled. Ray From leon.magiera at wp.pl Fri Feb 18 02:05:31 2011 From: leon.magiera at wp.pl (leon.magiera at wp.pl) Date: Fri, 18 Feb 2011 09:05:31 +0100 Subject: [Maxima] integration Message-ID: <4d5e284bd2cab3.88102803@wp.pl> Hi All, Given: assume(a>0,b>0); ex:(1-y/b)/(x^2+y^2+z0^2)^(3/2); integrate(integrate(ex,y,-b,b),x,-a,a); Is this integration to hard? Leon From villate at fe.up.pt Fri Feb 18 06:02:15 2011 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 18 Feb 2011 12:02:15 +0000 Subject: [Maxima] function inversion In-Reply-To: <41E927F1664141C1B5F2217591C7B04A@StarwakePC> References: <4D5C45F2.1090306@gmail.com> , <41E927F1664141C1B5F2217591C7B04A@StarwakePC> Message-ID: <1298030535.1971.1.camel@wigner> On Thu, 2011-02-17 at 17:45 +0000, Stefan Veeser wrote: > I defined a function giving a set of points with linearinterpol then I > added another function, which I defined with a simple formula. The > resulting function is still strictly rising in value, so > mathematically it can be inverted, so I wanted to invert the function, > but I could not find an operator for that anywere, Try inverting the coordinates of the set of points and using linearinterpol again. Regards, Jaime From villate at fe.up.pt Fri Feb 18 06:49:46 2011 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 18 Feb 2011 12:49:46 +0000 Subject: [Maxima] integration In-Reply-To: <4d5e284bd2cab3.88102803@wp.pl> References: <4d5e284bd2cab3.88102803@wp.pl> Message-ID: <1298033386.1971.15.camel@wigner> On Fri, 2011-02-18 at 09:05 +0100, leon.magiera at wp.pl wrote: > Given: > assume(a>0,b>0); > ex:(1-y/b)/(x^2+y^2+z0^2)^(3/2); > integrate(integrate(ex,y,-b,b),x,-a,a); > > Is this integration to hard? Hi, to investigate why Maxima is failing, let's include a partial fraction expansion before the x integration is done: (%i1) display2d:false$ (%i2) assume(a>0,b>0,notequal(z0,0)); (%o2) [a > 0,b > 0,notequal(z0,0)] (%i3) ex: (1-y/b)/(x^2+y^2+z0^2)^(3/2)$ (%i4) integrate( ex,y,-b,b ); (%o4) 2*b*sqrt(z0^2+x^2+b^2)/(z0^4+(2*x^2+b^2)*z0^2+x^4 +b^2*x^2) (%i5) partfrac( %,x ); (%o5) 2*sqrt(z0^2+x^2+b^2)/(b*(z0^2+x^2)) -2/(b*sqrt(z0^2+x^2+b^2)) (%i6) integrate( %, x); (%o6) 2*('integrate(sqrt(z0^2+x^2+b^2)/(z0^2+x^2),x))/b -2*asinh(x/sqrt(z0^2+b^2))/b The second fraction was integrated, but we were left with an integral of the type: (%i5) integrate( sqrt(x^2+4)/(x^2+1), x ); (%o5) 'integrate(sqrt(x^2+4)/(x^2+1),x) which seems easy, but it is not. Maxima does not have any method to find that integral. Regards, Jaime From macrakis at alum.mit.edu Fri Feb 18 08:59:33 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 18 Feb 2011 09:59:33 -0500 Subject: [Maxima] integration In-Reply-To: <1298033386.1971.15.camel@wigner> References: <4d5e284bd2cab3.88102803@wp.pl> <1298033386.1971.15.camel@wigner> Message-ID: Hmm. Mathematica (integrals.wolfram.com) gets asin(x/2)+sqrt(3)*atan((sqrt(3)*x)/sqrt(4+x^2)), but that is not correct according to Maxima: ex0: sqrt(x^2+4)/(x^2+1)$ ex1: asin(x/2)+sqrt(3)*atan(sqrt(3)*x/sqrt(4+x^2))$ The difference d: diff(ex1,x)-ex0 is messy and hard to simplify to something simple. Plotting d shows that it is non-constant and taylor agrees that the difference is non-constant: taylor(diff(ex1,x)-ex0,x,0,10); => x^2/8+5*x^6/1024+63*x^10/262144 Have I made some blunder, or is the Mathematica result incorrect? -s On Fri, Feb 18, 2011 at 07:49, Jaime Villate wrote: > sqrt(x^2+4)/(x^2+1) -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre.maute at gmx.de Fri Feb 18 09:04:33 2011 From: andre.maute at gmx.de (andre maute) Date: Fri, 18 Feb 2011 16:04:33 +0100 Subject: [Maxima] integration In-Reply-To: References: <4d5e284bd2cab3.88102803@wp.pl> <1298033386.1971.15.camel@wigner> Message-ID: <4D5E8A81.8040106@gmx.de> On 02/18/2011 03:59 PM, Stavros Macrakis wrote: > Hmm. Mathematica > (integrals.wolfram.com) > gets > asin(x/2)+sqrt(3)*atan((sqrt(3)*x)/sqrt(4+x^2)), but that is not correct > according to Maxima: > > ex0: sqrt(x^2+4)/(x^2+1)$ > ex1: asin(x/2)+sqrt(3)*atan(sqrt(3)*x/sqrt(4+x^2))$ > > The difference d: diff(ex1,x)-ex0 is messy and hard to simplify to something > simple. > > Plotting d shows that it is non-constant and taylor agrees that the > difference is non-constant: > > taylor(diff(ex1,x)-ex0,x,0,10); > => x^2/8+5*x^6/1024+63*x^10/262144 > > Have I made some blunder, or is the Mathematica result incorrect? I have (%i1) display2d : false; (%o1) false (%i2) diff(sqrt(p-1)*atan(sqrt(p-1)*x/sqrt(x^2+p)) + asinh(x/sqrt(p)),x); (%o2) sqrt(p-1)*(sqrt(p-1)/sqrt(x^2+p)-sqrt(p-1)*x^2/(x^2+p)^(3/2)) /((p-1)*x^2/(x^2+p)+1) +1/(sqrt(p)*sqrt(x^2/p+1)) (%i3) radcan(%); (%o3) sqrt(x^2+p)/(x^2+1) you have a typo asin should read asinh Andre From macrakis at alum.mit.edu Fri Feb 18 09:19:41 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 18 Feb 2011 10:19:41 -0500 Subject: [Maxima] integration In-Reply-To: <4D5E8A81.8040106@gmx.de> References: <4d5e284bd2cab3.88102803@wp.pl> <1298033386.1971.15.camel@wigner> <4D5E8A81.8040106@gmx.de> Message-ID: Ah! Thanks for catching that. It turns out that Maxima can do this integral "by hand", but the result form is ugly: sqrt(x^2+4)/(x^2+1)$ gfactor(%); => sqrt(x^2+4)/((x-%i)*(x+%i)) partfrac(%,x); =>%i*sqrt(x^2+4)/(2*(x+%i))-%i*sqrt(x^2+4)/(2*(x-%i)) integrate(%,x); => %i*(sqrt(3)*asinh(%i*x/(2*abs(x+%i))-2/abs(x+%i))-%i*asinh(x/2)+sqrt(x^2+4))/2-%i*(-sqrt(3)*asinh(%i*x/(2*abs(x-%i))+2/abs(x-%i))+%i*asinh(x/2)+sqrt(x^2+4))/2 Not sure this result is useful. Also, the abs's in there are ugly -- are they correct? -s On Fri, Feb 18, 2011 at 10:04, andre maute wrote: > On 02/18/2011 03:59 PM, Stavros Macrakis wrote: > >> Hmm. Mathematica >> (integrals.wolfram.com< >> http://integrals.wolfram.com/index.jsp?expr=+sqrt(x^2%2B4)/(x^2%2B1)>) >> >> gets >> asin(x/2)+sqrt(3)*atan((sqrt(3)*x)/sqrt(4+x^2)), but that is not correct >> according to Maxima: >> >> ex0: sqrt(x^2+4)/(x^2+1)$ >> ex1: asin(x/2)+sqrt(3)*atan(sqrt(3)*x/sqrt(4+x^2))$ >> >> The difference d: diff(ex1,x)-ex0 is messy and hard to simplify to >> something >> simple. >> >> Plotting d shows that it is non-constant and taylor agrees that the >> difference is non-constant: >> >> taylor(diff(ex1,x)-ex0,x,0,10); >> => x^2/8+5*x^6/1024+63*x^10/262144 >> >> Have I made some blunder, or is the Mathematica result incorrect? >> > I have > > (%i1) display2d : false; > > (%o1) false > (%i2) diff(sqrt(p-1)*atan(sqrt(p-1)*x/sqrt(x^2+p)) + asinh(x/sqrt(p)),x); > > (%o2) sqrt(p-1)*(sqrt(p-1)/sqrt(x^2+p)-sqrt(p-1)*x^2/(x^2+p)^(3/2)) > /((p-1)*x^2/(x^2+p)+1) > +1/(sqrt(p)*sqrt(x^2/p+1)) > (%i3) radcan(%); > > (%o3) sqrt(x^2+p)/(x^2+1) > > you have a typo asin should read asinh > > Andre > > _______________________________________________ > 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 rob_g_burns at yahoo.co.uk Fri Feb 18 10:58:06 2011 From: rob_g_burns at yahoo.co.uk (Rob Burns) Date: Fri, 18 Feb 2011 16:58:06 +0000 (GMT) Subject: [Maxima] plot3d and space curves Message-ID: <724938.5437.qm@web26008.mail.ukl.yahoo.com> Until recently I have been using Maxima 5.18.1, In this I could use plot3d to plot curves in 3D by having expr1, expr2, expr3 all as functions of x. Now I have upgraded to Maxima 5.23.2, plot3d does not seem to have these operands. Could someone explain to me how to plot space curves in 3D? I have looked at draw biut am no wiser, Regards, Rob. From villate at fe.up.pt Fri Feb 18 11:37:53 2011 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 18 Feb 2011 17:37:53 +0000 Subject: [Maxima] plot3d and space curves In-Reply-To: <724938.5437.qm@web26008.mail.ukl.yahoo.com> References: <724938.5437.qm@web26008.mail.ukl.yahoo.com> Message-ID: <1298050673.6279.1.camel@wigner> On Fri, 2011-02-18 at 16:58 +0000, Rob Burns wrote: > Until recently I have been using Maxima 5.18.1, In this I could use plot3d to > plot curves in 3D by having expr1, expr2, expr3 all as functions of x. > > Now I have upgraded to Maxima 5.23.2, plot3d does not seem to have these > operands. > > Could someone explain to me how to plot space curves in 3D? Hi, perhaps you are referring to this?: http://www.ma.utexas.edu/pipermail/maxima/2010/021424.html If not, please give me an example of the plot3d command you are trying to use. Regards, Jaime Villate From pbowyer at olynet.com Fri Feb 18 12:35:33 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Fri, 18 Feb 2011 10:35:33 -0800 Subject: [Maxima] Trying to build maxima from CVS Message-ID: <4D5EBBF5.80809@olynet.com> Hello: I'm trying to build maxima from CVS using: "cvs -d :pserver:anonymous at maxima.cvs.sourceforge.net:/cvsroot/maxima co maxima" #which seems to download maxima source properly. I then did from the maxima source directory: "bootstrap" #which completed successfully "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-gcl --with-gcl=/usr/bin/gcl" #which failed with "config.status: error: cannot find input file: `Makefile.in'" I did this earlier this morning (because I didn't get the error message then) with a copy of maxima's source I downloaded yesterday (or the day before) and I was able to successfully build maxima, using: "make" "make check" "make install" I ran the newly installed version of xmaxima from the install directory, but the help file identified itself as "maxima-5.21post" from within xmaxima so I deleted the maxima source directory and started over by again downloading the source from CVS in an attempt to make certain I was getting the proper source and now I'm getting the error message shown above. Should I be using a different CVS command to obtain the source, or is there a problem with maxima's source that needs attention? Thanks in advance, Paul Bowyer From dlakelan at street-artists.org Fri Feb 18 13:22:01 2011 From: dlakelan at street-artists.org (dlakelan) Date: Fri, 18 Feb 2011 11:22:01 -0800 Subject: [Maxima] restarting maxima from scratch Message-ID: <4D5EC6D9.90806@street-artists.org> It would be useful to be able to COMPLETELY clear Maxima back to initial conditions. kill(all); and reset(); help a lot if you're doing casual calculations, but if you want things completely cleared out, as far as I can tell the only way to do this reliably is to quit and re-start maxima. It could be useful instead to have a function "restart();" which just calls "exec" on the maxima executable. I see that in Linux at least the maxima executable is actually a shell script that calls exec on the appropriate lisp runtime so perhaps it is a bit tricky to do this. SBCL certainly supports exec if I remember correctly, I'm not sure if GCL does or any of the other Lisps Maxima supports. In any case, the "restart" function could call exec when supported, and throw an error with a message like "this lisp does not provide support for the restart function, please quit maxima manually and start it again" otherwise. What do you all think? Is this worthwhile, or just a potential maintenance headache? From piminusmeson at bk.ru Fri Feb 18 13:23:54 2011 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Fri, 18 Feb 2011 22:23:54 +0300 Subject: [Maxima] assumptions in solve() Message-ID: Hello list, i am solving the simple system of the equations: # (%i2) solve([pasquare*pbsquare*costhetavkv=((-ma^2-mb^2+mc^2)/2 + Ea*Eb)^2,pasquare=Ea^2-ma^2,pbsquare=Eb^2-mb^2],[Eb,pbsquare,pasquare]); # In the output there is the factor sqrt(ma-Ea), but in my task Ea>ma, so this factor does not have any sense. It seems that when maxima encounters expression sqrt(a*b) it returns sqrt(a)*sqrt(b). But in case of a<0 and b<0 the answer is sqrt(-a)*sqrt(-b). Is it possible to make maxima to hold sqrt(a*b) and not divide in into sqrt(a)*sqrt(b)? P.S. sorry for my rough english -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri Feb 18 13:42:20 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 18 Feb 2011 14:42:20 -0500 Subject: [Maxima] Trying to build maxima from CVS In-Reply-To: <4D5EBBF5.80809@olynet.com> References: <4D5EBBF5.80809@olynet.com> Message-ID: <4D5ECB9C.40705@gmail.com> On 2/18/11 1:35 PM, Paul Bowyer wrote: > Hello: > > I'm trying to build maxima from CVS using: > "cvs -d :pserver:anonymous at maxima.cvs.sourceforge.net:/cvsroot/maxima > co maxima" > #which seems to download maxima source properly. > > I then did from the maxima source directory: > "bootstrap" > #which completed successfully > > "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-gcl > --with-gcl=/usr/bin/gcl" > #which failed with "config.status: error: cannot find input file: > `Makefile.in'" > You mean maxima.system.in? I inadvertently checked in something by accident. I thought I had reverted this change yesterday, but I didn't. It should be fixed in CVS now. (This is where having the commit log emails would be really beneficial.) Ray From toy.raymond at gmail.com Fri Feb 18 13:45:08 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 18 Feb 2011 14:45:08 -0500 Subject: [Maxima] restarting maxima from scratch In-Reply-To: <4D5EC6D9.90806@street-artists.org> References: <4D5EC6D9.90806@street-artists.org> Message-ID: <4D5ECC44.8090701@gmail.com> On 2/18/11 2:22 PM, dlakelan wrote: > It would be useful to be able to COMPLETELY clear Maxima back to > initial conditions. kill(all); and reset(); help a lot if you're doing > casual calculations, but if you want things completely cleared out, as > far as I can tell the only way to do this reliably is to quit and > re-start maxima. > > It could be useful instead to have a function "restart();" which just > calls "exec" on the maxima executable. I see that in Linux at least > the maxima executable is actually a shell script that calls exec on > the appropriate lisp runtime so perhaps it is a bit tricky to do this. > SBCL certainly supports exec if I remember correctly, I'm not sure if > GCL does or any of the other Lisps Maxima supports. In any case, the > "restart" function could call exec when supported, and throw an error > with a message like "this lisp does not provide support for the > restart function, please quit maxima manually and start it again" > otherwise. > How is restart() different from quitting maxima and starting maxima again? If there is none, the why spend any time adding this code and testing it? A line not added is a line debugged. :-) Ray From toy.raymond at gmail.com Fri Feb 18 13:47:05 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 18 Feb 2011 14:47:05 -0500 Subject: [Maxima] Maxima commit list is broken In-Reply-To: <4D5DA833.3080206@gmail.com> References: <4D5C612A.5010800@gmail.com> <02f801cbce3b$76e8c630$64ba5290$@vttoth.com> <4D5DA833.3080206@gmail.com> Message-ID: On 2/17/11 5:58 PM, Raymond Toy wrote: > On 2/17/11 5:09 PM, Robert Dodier wrote: >> For the record, I saw the error message about /bin/mail too >> and I don't know what that's about. >> Not sure what to do at this point. > Complain to Sourceforge I guess. Apparently this has already been reported. Ray From l.butler at ed.ac.uk Fri Feb 18 14:12:13 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 18 Feb 2011 20:12:13 +0000 (GMT) Subject: [Maxima] restarting maxima from scratch In-Reply-To: <4D5ECC44.8090701@gmail.com> References: <4D5EC6D9.90806@street-artists.org> <4D5ECC44.8090701@gmail.com> Message-ID: On Fri, 18 Feb 2011, Raymond Toy wrote: < On 2/18/11 2:22 PM, dlakelan wrote: < > It would be useful to be able to COMPLETELY clear Maxima back to < > initial conditions. kill(all); and reset(); help a lot if you're doing < > casual calculations, but if you want things completely cleared out, as < > far as I can tell the only way to do this reliably is to quit and < > re-start maxima. < > < > It could be useful instead to have a function "restart();" which just < > calls "exec" on the maxima executable. I see that in Linux at least < > the maxima executable is actually a shell script that calls exec on < > the appropriate lisp runtime so perhaps it is a bit tricky to do this. < > SBCL certainly supports exec if I remember correctly, I'm not sure if < > GCL does or any of the other Lisps Maxima supports. In any case, the < > "restart" function could call exec when supported, and throw an error < > with a message like "this lisp does not provide support for the < > restart function, please quit maxima manually and start it again" < > otherwise. < > < How is restart() different from quitting maxima and starting maxima < again? If there is none, the why spend any time adding this code and < testing it? This might be useful if you have users whose login shell is /usr/bin/maxima and whose permissions prevent them from accessing a shell. In that situation, quitting+restarting would probably mean re-authentication, etc. Besides, other CAS offer this feature. < < A line not added is a line debugged. :-) rm -fr * All problems sorted. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From dlakelan at street-artists.org Fri Feb 18 14:30:55 2011 From: dlakelan at street-artists.org (dlakelan) Date: Fri, 18 Feb 2011 12:30:55 -0800 Subject: [Maxima] restarting maxima from scratch In-Reply-To: <4D5ECC44.8090701@gmail.com> References: <4D5EC6D9.90806@street-artists.org> <4D5ECC44.8090701@gmail.com> Message-ID: <4D5ED6FF.7040807@street-artists.org> On 02/18/2011 11:45 AM, Raymond Toy wrote: > How is restart() different from quitting maxima and starting maxima > again? If there is none, the why spend any time adding this code and > testing it? restart is programmatic, whereas quitting and restarting is not. So for example if you want to derive some results under say varying assumptions, you might want a single batch file which first makes assumptions A and then does some derivation and outputs the results, and then resets the whole system and makes assumptions B and then does the alternative derivation. As I said, kill(all) and reset() goes a long way, but it's not as much of a sure thing as re-execing maxima from scratch. Also I am using maxima normally from within emacs, but sometimes I want a stand-alone batch file so that for example I can include it in a makefile and have maxima generate TeX output that is included into a document. From ferriste at gmail.com Fri Feb 18 15:20:15 2011 From: ferriste at gmail.com (Stefano Ferri) Date: Fri, 18 Feb 2011 22:20:15 +0100 Subject: [Maxima] build-index, cl-ppcre and github In-Reply-To: <20110216152352.13244vgt6ez9vgu8@www.staffmail.ed.ac.uk> References: <20110214002731.92403akfmu4iml8g@www.staffmail.ed.ac.uk> <4D59CB94.1010002@gmail.com> <20110215035825.81510p0w9rc1qwv4@www.staffmail.ed.ac.uk> <4D5A778C.40503@gmail.com> <20110215211901.199905jyl303noas@www.staffmail.ed.ac.uk> <4D5AEF18.6000609@gmail.com> <20110215230709.828473fapdkcjack@www.staffmail.ed.ac.uk> <20110216152352.13244vgt6ez9vgu8@www.staffmail.ed.ac.uk> Message-ID: 2011/2/16 Leo T Butler > Sure, the first problem is that gcl complains that the package > user is undefined; if I add (defpackage :user), then compilation proceeds > until I get > > ; - Compiling module "declarations" > ; - Loading binary file "binary-gcl/lmdcls.o" > ;; Loading binary-gcl/lmdcls.o > check_type_symbol is undefined > > Since there is a line in the lmdcls.lisp which looks like it does define > check_type_symbol, I'm lost. > > gcl is compiled with --enable-ansi. > > > Leo > > > I cannot be helpful here... I never saw an error like that. My problems, solved thanks to Camm Maguire, were different. I am still wondering why this happens... I don't know if it can be useful, anyway I have attached the script I'm using to compile gcl and create the slackware package. After commenting some lines where "requiredbuilder", "makepkg" "cat slack-desc" (and maybe other slackware-related words) are present, the resulting binaries should be the same as mine. But there is nothing particular in the script, I don't know... Stefano -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: gcl.SlackBuild Type: application/octet-stream Size: 3854 bytes Desc: not available URL: From pbowyer at olynet.com Fri Feb 18 15:42:15 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Fri, 18 Feb 2011 13:42:15 -0800 Subject: [Maxima] Trying to build maxima from CVS In-Reply-To: <4D5ECB9C.40705@gmail.com> References: <4D5EBBF5.80809@olynet.com> <4D5ECB9C.40705@gmail.com> Message-ID: <4D5EE7B7.3000601@olynet.com> On 02/18/2011 11:42 AM, Raymond Toy wrote: > On 2/18/11 1:35 PM, Paul Bowyer wrote: >> Hello: >> >> I'm trying to build maxima from CVS using: >> "cvs -d :pserver:anonymous at maxima.cvs.sourceforge.net:/cvsroot/maxima >> co maxima" >> #which seems to download maxima source properly. >> >> I then did from the maxima source directory: >> "bootstrap" >> #which completed successfully >> >> "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-gcl >> --with-gcl=/usr/bin/gcl" >> #which failed with "config.status: error: cannot find input file: >> `Makefile.in'" >> > You mean maxima.system.in? > > I inadvertently checked in something by accident. I thought I had > reverted this change yesterday, but I didn't. It should be fixed in CVS > now. > > (This is where having the commit log emails would be really beneficial.) > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Ray: Whatever you did made it so I could download source from CVS and build maxima against GCL-2.6.8pre which now identifies itself properly in the help file from xmaxima as "Maxima 5.23post". (%i1) build_info (); Maxima version: 5.23.2 Maxima build date: 21:3 1/21/2011 Host type: i586-mandriva-linux-gnu Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 My build process was: "sh bootstrap" "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-gcl --with-gcl=/usr/bin/gcl" "make" "make check" "make install" Does this qualify as building maxima from HEAD as mentioned in the thread "[Maxima] build-index, cl-ppcre and github" and if not, how do I go about doing that? Attempting to build maxima using the same process for maxima downloaded via "git" (in a different source directory) according to the directions given by Leo Butler fails with: "Compiling $HOME/my-maxima-git-sandbox/Maxima-CAS/src/cl-ppcre/errors.lisp. Invalid DEFINE-CONDITION option: (:DEFAULT-INITARGS :POS NIL :STRING *SYNTAX-ERROR-STRING*)" as mentioned similarly in the thread "[Maxima] build-index, cl-ppcre and github". Since I'm able to build the CVS version of maxima against GCL and I cannot build the "git" version against GCL, does it seem reasonable to assume the problem might not be GCL, or is my thinking fouled up? Thanks for your help getting the CVS build functioning, Paul From toy.raymond at gmail.com Fri Feb 18 21:41:36 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 18 Feb 2011 22:41:36 -0500 Subject: [Maxima] restarting maxima from scratch In-Reply-To: References: <4D5EC6D9.90806@street-artists.org> <4D5ECC44.8090701@gmail.com> Message-ID: <4D5F3BF0.8010906@gmail.com> On 2/18/11 3:12 PM, Leo Butler wrote: > > On Fri, 18 Feb 2011, Raymond Toy wrote: > > < On 2/18/11 2:22 PM, dlakelan wrote: > < > It would be useful to be able to COMPLETELY clear Maxima back to > < > initial conditions. kill(all); and reset(); help a lot if you're doing > < > casual calculations, but if you want things completely cleared out, as > < > far as I can tell the only way to do this reliably is to quit and > < > re-start maxima. > < > > < > It could be useful instead to have a function "restart();" which just > < > calls "exec" on the maxima executable. I see that in Linux at least > < > the maxima executable is actually a shell script that calls exec on > < > the appropriate lisp runtime so perhaps it is a bit tricky to do this. > < > SBCL certainly supports exec if I remember correctly, I'm not sure if > < > GCL does or any of the other Lisps Maxima supports. In any case, the > < > "restart" function could call exec when supported, and throw an error > < > with a message like "this lisp does not provide support for the > < > restart function, please quit maxima manually and start it again" > < > otherwise. > < > > < How is restart() different from quitting maxima and starting maxima > < again? If there is none, the why spend any time adding this code and > < testing it? > > This might be useful if you have users whose login shell is > /usr/bin/maxima and whose permissions prevent them from accessing > a shell. In that situation, quitting+restarting would probably mean > re-authentication, etc. Do users really have maxima as their login shell? > > < > < A line not added is a line debugged. :-) > > rm -fr * > > All problems sorted. I suggested that once at work when the powers that be kept complaining that we must have absolutely no lint warnings or errors in our code. I just said it was easy: rm -rf *. We do the best we can, but you can't have it both ways. :-) Ray > Leo > From toy.raymond at gmail.com Fri Feb 18 21:44:42 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 18 Feb 2011 22:44:42 -0500 Subject: [Maxima] restarting maxima from scratch In-Reply-To: <4D5ED6FF.7040807@street-artists.org> References: <4D5EC6D9.90806@street-artists.org> <4D5ECC44.8090701@gmail.com> <4D5ED6FF.7040807@street-artists.org> Message-ID: <4D5F3CAA.3070601@gmail.com> On 2/18/11 3:30 PM, dlakelan wrote: > On 02/18/2011 11:45 AM, Raymond Toy wrote: > >> How is restart() different from quitting maxima and starting maxima >> again? If there is none, the why spend any time adding this code and >> testing it? > > restart is programmatic, whereas quitting and restarting is not. So > for example if you want to derive some results under say varying > assumptions, you might want a single batch file which first makes > assumptions A and then does some derivation and outputs the results, > and then resets the whole system and makes assumptions B and then does > the alternative derivation. As I said, kill(all) and reset() goes a > long way, but it's not as much of a sure thing as re-execing maxima > from scratch. > > Also I am using maxima normally from within emacs, but sometimes I > want a stand-alone batch file so that for example I can include it in > a makefile and have maxima generate TeX output that is included into a > document. Well, there you go. Write an elisp function that kills your maxima session and restarts it. Slime does this nicely for me with Lisp. I'll think about how this can be done. One issue is that I'm not sure the running lisp knows where the executable/shell script is. Configure might have to tell it. Ray From robert.dodier at gmail.com Sat Feb 19 01:31:18 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 19 Feb 2011 00:31:18 -0700 Subject: [Maxima] Trying to build maxima from CVS In-Reply-To: <4D5EE7B7.3000601@olynet.com> References: <4D5EBBF5.80809@olynet.com> <4D5ECB9C.40705@gmail.com> <4D5EE7B7.3000601@olynet.com> Message-ID: On 2/18/11, Paul Bowyer wrote: > "Compiling $HOME/my-maxima-git-sandbox/Maxima-CAS/src/cl-ppcre/errors.lisp. > Invalid DEFINE-CONDITION option: (:DEFAULT-INITARGS :POS NIL :STRING > *SYNTAX-ERROR-STRING*)" > as mentioned similarly in the thread "[Maxima] build-index, cl-ppcre and > github". > > Since I'm able to build the CVS version of maxima against GCL and I > cannot build the "git" version against GCL, does it seem reasonable to > assume the problem might not be GCL, or is my thinking fouled up? Paul, somebody mentioned that GCL cannot compile CL-PPCRE. My advice is to try SBCL or Clisp. Probably you can install one or the other or both via your Linux distribution's update mechanism (yum or apt-get or something like that). best Robert Dodier From leon.magiera at wp.pl Sat Feb 19 01:49:19 2011 From: leon.magiera at wp.pl (leon.magiera at wp.pl) Date: Sat, 19 Feb 2011 08:49:19 +0100 Subject: [Maxima] integration with DERIVE Message-ID: <4d5f75ffe5f137.55645663@wp.pl> Hi All, Given: ex:(1-y/b)/(x^2+y^2+z0^2)^(3/2); integrate(integrate(ex,y,-b,b),x,-a,a); Program DERIVE has no problem with the above integration. Regards Leon -------------- next part -------------- A non-text attachment was scrubbed... Name: lm_int_new.doc Type: application/msword Size: 25088 bytes Desc: not available URL: From marco.rofei at gmail.com Sat Feb 19 03:46:11 2011 From: marco.rofei at gmail.com (Marco Rofei) Date: Sat, 19 Feb 2011 10:46:11 +0100 Subject: [Maxima] Could not find maxima-index.lisp In-Reply-To: <4d5f75ffe5f137.55645663@wp.pl> References: <4d5f75ffe5f137.55645663@wp.pl> Message-ID: <1298108771.1971.6.camel@UL80VT> Hi everyone, I got an error when I to use the built-in help of maxima: (%i1) ?? diff Maxima encountered a Lisp error: Couldn't load #P"/usr/share/info/./maxima-index.lisp": file does not exist. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. ; ; compilation unit aborted ; caught 1 fatal ERROR condition (%i2) Am I wrong in something? Above there are my system informations (%i2) build_info(); Maxima version: 5.23.2 Maxima build date: 14:11 1/18/2011 Host type: x86_64-unknown-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.40.0.debian (%o2) I'm using Ubuntu. MR -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.rofei at gmail.com Sat Feb 19 04:56:51 2011 From: marco.rofei at gmail.com (Marco Rofei) Date: Sat, 19 Feb 2011 11:56:51 +0100 Subject: [Maxima] Could not find maxima-index.lisp Message-ID: <1298113011.1971.7.camel@UL80VT> Hi everyone, I got an error when I to use the built-in help of maxima: (%i1) ?? diff Maxima encountered a Lisp error: Couldn't load #P"/usr/share/info/./maxima-index.lisp": file does not exist. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. ; ; compilation unit aborted ; caught 1 fatal ERROR condition (%i2) Am I wrong in something? Above there are my system informations (%i2) build_info(); Maxima version: 5.23.2 Maxima build date: 14:11 1/18/2011 Host type: x86_64-unknown-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.40.0.debian (%o2) I'm using Ubuntu. MR -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sat Feb 19 06:07:20 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 19 Feb 2011 06:07:20 -0600 Subject: [Maxima] assumptions in solve() In-Reply-To: References: Message-ID: Although the term sqrt(ma-Ea) is purely imaginary, for some parameters the solution is purely real: (%i26) sol:solve([pasquare*pbsquare*costhetavkv=((-ma^2-mb^2+mc^2)/2 + Ea*Eb)^2,pasquare=Ea^2-ma^2,pbsquare=Eb^2-mb^2], [Eb,pbsquare,pasquare])$ (%i29) subst([Ea=2,ma=1,costhetavkv=0],sol); (%o29) [[Eb=(-2*mc^2+2*mb^2+2)/8,pbsquare=-(-4*mc^4+(8*mb^2+8)*mc^2-4*mb^4+56*mb^2-4)/64,pasquare=3],[Eb=-(2*mc^2-2*mb^2-2)/8,pbsquare=-(-4*mc^4+(8*mb^2+8)*mc^2-4*mb^4+56*mb^2-4)/64,pasquare=3]] That looks real to me. You might try using the function 'rootscontract.' The Maxima function radcan does sqrt(a*b) --> sqrt(a)*sqrt(b), but the general simplifier does not (maybe some option variables control this). --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >Hello??list,??i?am?solving?the?simple?system?of?the?equations: ># >(%i2)??solve([pasquare*pbsquare*costhetavkv=((-ma^2-mb^2+mc^2)/2?+ >Ea*Eb)^2,pasquare=Ea^2-ma^2,pbsquare=Eb^2-mb^2],[Eb,pbsquare,pasquare]); ># >In?the?output?there?is?the?factor?sqrt(ma-Ea),?but?in?my?task?Ea>ma,?so >this?factor?does?not?have?any?sense.?It?seems?that??when?maxima?encounters >expression?sqrt(a*b)?it?returns?sqrt(a)*sqrt(b).?But?in?case?of?a<0?and >b<0?the?answer?is?sqrt(-a)*sqrt(-b). >Is?it?possible?to?make?maxima?to?hold?sqrt(a*b)?and?not?divide?in?into >sqrt(a)*sqrt(b)? >P.S.?sorry?for?my?rough?english > > >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From rob_g_burns at yahoo.co.uk Sat Feb 19 06:46:05 2011 From: rob_g_burns at yahoo.co.uk (Rob Burns) Date: Sat, 19 Feb 2011 12:46:05 +0000 (GMT) Subject: [Maxima] plot3d discrete problem Message-ID: <584490.18853.qm@web26001.mail.ukl.yahoo.com> This plot used to work in maxima 5.18.1 but does not now work. (%i1) M: matrix([2, 2, 3, 5], [2, 1, 3, 2], [2, 2, 3, 4], ?????? [2, 2, 3, 3], [1,1,1,4])$ (%i2) M; (%o2) matrix([2,2,3,5],[2,1,3,2],[2,2,3,4],[2,2,3,3],[1,1,1,4]) (%i3) f(x, y) := float (M [?round(x), ?round(y)])$ (%i4) plot3d (f, [x, 1, 5], [y, 1, 4], ['grid, 4, 4], ['xlabel, "x-axis"], [plot_format, openmath])$ Thanks for the workaround for my previous post, is there one for this as well? Regards, Rob. From rob_g_burns at yahoo.co.uk Sat Feb 19 06:57:19 2011 From: rob_g_burns at yahoo.co.uk (Rob Burns) Date: Sat, 19 Feb 2011 12:57:19 +0000 (GMT) Subject: [Maxima] plot3d and space curves In-Reply-To: <1298050673.6279.1.camel@wigner> References: <724938.5437.qm@web26008.mail.ukl.yahoo.com> <1298050673.6279.1.camel@wigner> Message-ID: <31385.25439.qm@web26007.mail.ukl.yahoo.com> Jaime, That is exactly my problem and the workaround works in both versions. Regards,Rob. ----- Original Message ---- From: Jaime Villate To: Rob Burns Cc: maxima at math.utexas.edu Sent: Fri, 18 February, 2011 17:37:53 Subject: Re: [Maxima] plot3d and space curves On Fri, 2011-02-18 at 16:58 +0000, Rob Burns wrote: > Until recently I have been using Maxima 5.18.1, In this I could use plot3d to > plot curves in 3D by having expr1, expr2, expr3 all as functions of x. > > Now I have upgraded to Maxima 5.23.2, plot3d does not seem to have these > operands. > > Could someone explain to me how to plot space curves in 3D? Hi, perhaps you are referring to this?: http://www.ma.utexas.edu/pipermail/maxima/2010/021424.html If not, please give me an example of the plot3d command you are trying to use. Regards, Jaime Villate From villate at fe.up.pt Sat Feb 19 07:18:10 2011 From: villate at fe.up.pt (Jaime Villate) Date: Sat, 19 Feb 2011 13:18:10 +0000 Subject: [Maxima] Could not find maxima-index.lisp In-Reply-To: <1298113011.1971.7.camel@UL80VT> References: <1298113011.1971.7.camel@UL80VT> Message-ID: <1298121490.3066.17.camel@wigner> On Sat, 2011-02-19 at 11:56 +0100, Marco Rofei wrote: > Hi everyone, I got an error when I to use the built-in help of maxima: > (%i1) ?? diff > Maxima encountered a Lisp error: > Couldn't load #P"/usr/share/info/./maxima-index.lisp": file does not > exist. > Maxima version: 5.23.2 > Maxima build date: 14:11 1/18/2011 > Host type: x86_64-unknown-linux-gnu > Lisp implementation type: SBCL > Lisp implementation version: 1.0.40.0.debian > > I'm using Ubuntu. If the package you installed is named "maxima", try the following: dpkg -s maxima It will show you something similar to this: Package: maxima ... Recommends: maxima-share, gv, maxima-emacs Suggests: texmacs, maxima-doc, wish Which is a very unhappy choice of suggestions and recommendations. If you have not installed maxima-doc, you will not have any built-in help. Several other commands that you find in the manual will not work either unless you install maxima-share; and there are also a few other commands in the manual that will not work without xmaxima, which has not been mentioned in the recommendations or suggestions. In fact, I don't see why wish is recommended if xmaxima is not. Regards, Jaime From piminusmeson at bk.ru Sat Feb 19 08:48:09 2011 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Sat, 19 Feb 2011 17:48:09 +0300 Subject: [Maxima] =?koi8-r?b?YXNzdW1wdGlvbnMgaW4gc29sdmUoKQ==?= Message-ID: >Although the term sqrt(ma-Ea) is purely imaginary, for some parameters the solution is purely real: > >(%i26) sol:solve([pasquare*pbsquare*costhetavkv=((-ma^2-mb^2+mc^2)/2 + Ea*Eb)^2,pasquare=Ea^2- >ma^2,pbsquare=Eb^2-mb^2], > [Eb,pbsquare,pasquare])$ > >(%i29) subst([Ea=2,ma=1,costhetavkv=0],sol); > >(%o29)[[Eb=(-2*mc^2+2*mb^2+2)/8,pbsquare=-(-4*mc^4+(8*mb^2+8)*mc^2-4*mb^4+56*mb^2-4)/64,pasquare=3], >[Eb=-(2*mc^2-2*mb^2-2)/8,pbsquare=-(-4*mc^4+(8*mb^2+8)*mc^2-4*mb^4+56*mb^2-4)/64,pasquare=3]] > >That looks real to me. You might try using the function 'rootscontract.' Thanks, rootscontract solved problem, but i think that disabling of sqrt(a*b) --> sqrt(a)*sqrt(b) in solve() is better solution. may be it is possible? -------------- next part -------------- An HTML attachment was scrubbed... URL: From piminusmeson at bk.ru Sat Feb 19 08:55:56 2011 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Sat, 19 Feb 2011 17:55:56 +0300 Subject: [Maxima] assume() in texmacs Message-ID: Hello everybody, i just installed latest version of texmacs to work with maxima(version of Maxima is 5.23.2) But i texmacs does not work function assume() I typed: assume(a-b<0) Texmacs replies: "incorrect syntax: Found logical expression where algebraic expression expected" In terminal (xterm) all works fine. What is wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: From l.butler at ed.ac.uk Sat Feb 19 10:05:37 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sat, 19 Feb 2011 16:05:37 +0000 (GMT) Subject: [Maxima] Could not find maxima-index.lisp In-Reply-To: <1298121490.3066.17.camel@wigner> References: <1298113011.1971.7.camel@UL80VT> <1298121490.3066.17.camel@wigner> Message-ID: On Sat, 19 Feb 2011, Jaime Villate wrote: < On Sat, 2011-02-19 at 11:56 +0100, Marco Rofei wrote: < > Hi everyone, I got an error when I to use the built-in help of maxima: < > (%i1) ?? diff < > Maxima encountered a Lisp error: < > Couldn't load #P"/usr/share/info/./maxima-index.lisp": file does not < > exist. < < > Maxima version: 5.23.2 < > Maxima build date: 14:11 1/18/2011 < > Host type: x86_64-unknown-linux-gnu < > Lisp implementation type: SBCL < > Lisp implementation version: 1.0.40.0.debian < > < > I'm using Ubuntu. < < If the package you installed is named "maxima", try the following: < dpkg -s maxima < It will show you something similar to this: < < Package: maxima < ... < < Recommends: maxima-share, gv, maxima-emacs < Suggests: texmacs, maxima-doc, wish < < Which is a very unhappy choice of suggestions and recommendations. If < you have not installed maxima-doc, you will not have any built-in help. < Several other commands that you find in the manual will not work either < unless you install maxima-share; and there are also a few other commands < in the manual that will not work without xmaxima, which has not been < mentioned in the recommendations or suggestions. In fact, I don't see < why wish is recommended if xmaxima is not. @Jaime, maybe you could file a bug report against this packaging? @Marco, judging from your build_info output, you have built Maxima from source or installed it from outwith the Ubuntu repos. In Maxima, could you enter :lisp (print-directories) and in a shell could you enter ls /usr/local/share/info Please post the output to this list. The default installation directory is /usr/local/share/info for this file. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From marco.rofei at gmail.com Sat Feb 19 10:32:16 2011 From: marco.rofei at gmail.com (Marco Rofei) Date: Sat, 19 Feb 2011 17:32:16 +0100 Subject: [Maxima] Could not find maxima-index.lisp In-Reply-To: References: <1298113011.1971.7.camel@UL80VT> <1298121490.3066.17.camel@wigner> Message-ID: <1298133136.18166.3.camel@UL80VT> > :lisp (print-directories) (%i2) :lisp (print-directories); maxima-prefix=/usr maxima-imagesdir=/usr/lib/maxima/5.23.2/binary-sbcl maxima-sharedir=/usr/share/maxima/5.23.2/share maxima-srcdir=/usr/share/maxima/5.23.2/src maxima-demodir=/usr/share/maxima/5.23.2/demo maxima-testsdir=/usr/share/maxima/5.23.2/tests maxima-docdir=/usr/share/maxima/5.23.2/doc maxima-infodir=/usr/share/info maxima-htmldir=/usr/share/maxima/5.23.2/doc/html maxima-plotdir=/usr/lib/maxima/5.23.2 maxima-layout-autotools=T maxima-userdir=/home/maegras/.maxima maxima-tempdir=/home/maegras maxima-lang-subdir=NIL maxima-objdir=/home/maegras/.maxima/binary/binary-sbcl NIL (%i2) > and in a shell could you enter > ls /usr/local/share/info Dir does not exist I've installed maxima frop Ubuntu-ppa MR -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sat Feb 19 10:53:39 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 19 Feb 2011 10:53:39 -0600 Subject: [Maxima] assumptions in solve() In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Thanks,??rootscontract??solved?problem,?but?i?think?that??disabling?of? >sqrt(a*b)?-->?sqrt(a)*sqrt(b)?in?solve()?is?better?solution. Assuming that powers are the principal powers, rootscontract does simplifications that are not valid in the entire complex plane. In the context of the solution to a polynomial system, I would generally expect rootscontract to map a solution into another solution--nevertheless, be careful using rootscontract. I think you have not given any evidence that solve is changing sqrt(a*b) to sqrt(a) * sqrt(b). Neither have you given any evidence that Maxima returns an incorrect solution to your equations. --Barton From l.butler at ed.ac.uk Sat Feb 19 11:39:39 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sat, 19 Feb 2011 17:39:39 +0000 (GMT) Subject: [Maxima] Could not find maxima-index.lisp In-Reply-To: <1298133136.18166.3.camel@UL80VT> References: <1298113011.1971.7.camel@UL80VT> <1298121490.3066.17.camel@wigner> <1298133136.18166.3.camel@UL80VT> Message-ID: On Sat, 19 Feb 2011, Marco Rofei wrote: < < :lisp (print-directories) < < < (%i2) :lisp (print-directories); < maxima-prefix=/usr < maxima-imagesdir=/usr/lib/maxima/5.23.2/binary-sbcl < maxima-sharedir=/usr/share/maxima/5.23.2/share < maxima-srcdir=/usr/share/maxima/5.23.2/src < maxima-demodir=/usr/share/maxima/5.23.2/demo < maxima-testsdir=/usr/share/maxima/5.23.2/tests < maxima-docdir=/usr/share/maxima/5.23.2/doc < maxima-infodir=/usr/share/info < maxima-htmldir=/usr/share/maxima/5.23.2/doc/html < maxima-plotdir=/usr/lib/maxima/5.23.2 < maxima-layout-autotools=T < maxima-userdir=/home/maegras/.maxima < maxima-tempdir=/home/maegras < maxima-lang-subdir=NIL < maxima-objdir=/home/maegras/.maxima/binary/binary-sbcl < NIL < (%i2) < < and in a shell could you enter < ls /usr/local/share/info < < < Dir does not exist < < I've installed maxima frop Ubuntu-ppa Ok, the configuration of Maxima and its installation are inconsistent. It appears that Istvan Blahota has chosen /usr/share/doc/maxima-doc/ as the doc directory and the maxima-infodir is /usr/share/doc/maxima-doc/info/info What you can do to fix this is to execute the following in a shell [ -d ~/.maxima ] || mkdir ~/.maxima #make the .maxima dir And with your favourite text editor, open ~/.maxima/maxima-init.lisp and add :lisp (setq *maxima-docdir* "/usr/share/doc/maxima-doc/") :lisp (setq *maxima-infodir* (concatenate 'string *maxima-docdir* "info/") :lisp (setq *maxima-htmldir* (concatenate 'string *maxima-docdir* "html/") Restart Maxima and this file should be autoloaded and the correct directories set. Note that the other directories are printed above are likely incorrect and will need to be set. You can find where these directories are by looking in /var/lib/dpkg/info/ and looking in the various maxima*.list files that list all the files that are installed by the given package. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From pip at iszf.irk.ru Sat Feb 19 11:56:36 2011 From: pip at iszf.irk.ru (Valery Pipin) Date: Sat, 19 Feb 2011 09:56:36 -0800 Subject: [Maxima] restarting maxima from scratch In-Reply-To: <4D5F3CAA.3070601@gmail.com> References: <4D5EC6D9.90806@street-artists.org> <4D5ED6FF.7040807@street-artists.org> <4D5F3CAA.3070601@gmail.com> Message-ID: <201102190956.36957.pip@iszf.irk.ru> > On 2/18/11 3:30 PM, dlakelan wrote: > > On 02/18/2011 11:45 AM, Raymond Toy wrote: > >> How is restart() different from quitting maxima and starting maxima > >> again? If there is none, the why spend any time adding this code and > >> testing it? > > > > restart is programmatic, whereas quitting and restarting is not. So > > for example if you want to derive some results under say varying > > assumptions, you might want a single batch file which first makes > > assumptions A and then does some derivation and outputs the results, > > and then resets the whole system and makes assumptions B and then does > > the alternative derivation. As I said, kill(all) and reset() goes a > > long way, but it's not as much of a sure thing as re-execing maxima > > from scratch. > > > > Also I am using maxima normally from within emacs, but sometimes I > > want a stand-alone batch file so that for example I can include it in > > a makefile and have maxima generate TeX output that is included into a > > document. > > Well, there you go. Write an elisp function that kills your maxima > session and restarts it. Slime does this nicely for me with Lisp. > > I'll think about how this can be done. One issue is that I'm not sure > the running lisp knows where the executable/shell script is. Configure > might have to tell it. While this may be usefull. It is a not right way to do. If the kill(all) and reset() do not clean the memory and garbage then this is a bug in these functions From fateman at eecs.berkeley.edu Sat Feb 19 12:20:58 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 19 Feb 2011 10:20:58 -0800 Subject: [Maxima] restarting maxima from scratch In-Reply-To: <201102190956.36957.pip@iszf.irk.ru> References: <4D5EC6D9.90806@street-artists.org> <4D5ED6FF.7040807@street-artists.org> <4D5F3CAA.3070601@gmail.com> <201102190956.36957.pip@iszf.irk.ru> Message-ID: <4D600A0A.7020009@eecs.berkeley.edu> On 2/19/2011 9:56 AM, Valery Pipin wrote: > > While this may be usefull. It is a not right way to do. > If the kill(all) and reset() do not clean the memory and garbage > then this is a bug in these functions > _______________________________________________ Unfortunately it is possible that you read in arbitrary lisp functions using load(..) which can change the maxima system in ways that the system does not know about, and which kill() cannot revert to the previous state. Also, some lisp systems will have irrevocably made changes (for example, allocating all available address space for numbers, and permanently leaving no more for lists) -- changes that cannot be undone. RJF From piminusmeson at bk.ru Sat Feb 19 13:01:07 2011 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Sat, 19 Feb 2011 22:01:07 +0300 Subject: [Maxima] =?koi8-r?b?YXNzdW1wdGlvbnMgaW4gc29sdmUoKQ==?= Message-ID: >I think you have not given any evidence that solve is changing sqrt(a*b) to sqrt(a) * sqrt(b). I think that i have such evidence. Let's consider system of the equations: solve([a*b=(-ma^2/2+Ea*Eb)^2,a=Ea^2-ma^2,b=Eb^2-mb^2],[Eb,a,b]); (1) a*b=(-ma^2/2+Ea*Eb)^2 (2) a=Ea^2-ma^2 (3) b=Eb^2-mb^2 (sorry, but i can not give more simple example) To solve this system one need to substitute (2) and (3) into (1). It gives quadratic equation. From this equation one can easy get Eb. It has term sqrt((Ea^2-ma^2)*(ma^2-4*mb^2)) (maxima gives right answer for Eb). Now, to get b one need to substitute Eb into (3). It is easy to see that b should have the term sqrt((Ea^2-ma^2)*(ma^2-4*mb^2)). But maxima says that there is the term sqrt(ma - Ea)*sqrt(ma + Ea)*sqrt(2 mb - ma)*sqrt(2 mb + ma) So, i think that maxima divides sqrt((Ea^2-ma^2)*(ma^2-4*mb^2)) into sqrt(ma - Ea)*sqrt(ma + Ea)*sqrt(2 mb - ma)*sqrt(2 mb + ma) -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbowyer at olynet.com Sat Feb 19 13:38:55 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sat, 19 Feb 2011 11:38:55 -0800 Subject: [Maxima] Trying to build maxima from CVS Message-ID: <4D601C4F.9000506@olynet.com> Forgot to include maxima list so I'm forwarding this. -------- Original Message -------- Subject: Re: [Maxima] Trying to build maxima from CVS Date: Sat, 19 Feb 2011 11:18:08 -0800 From: Paul Bowyer To: Robert Dodier On 02/18/2011 11:31 PM, Robert Dodier wrote: > On 2/18/11, Paul Bowyer wrote: > >> "Compiling $HOME/my-maxima-git-sandbox/Maxima-CAS/src/cl-ppcre/errors.lisp. >> Invalid DEFINE-CONDITION option: (:DEFAULT-INITARGS :POS NIL :STRING >> *SYNTAX-ERROR-STRING*)" >> as mentioned similarly in the thread "[Maxima] build-index, cl-ppcre and >> github". >> >> Since I'm able to build the CVS version of maxima against GCL and I >> cannot build the "git" version against GCL, does it seem reasonable to >> assume the problem might not be GCL, or is my thinking fouled up? > Paul, somebody mentioned that GCL cannot compile CL-PPCRE. > > My advice is to try SBCL or Clisp. Probably you can install one > or the other or both via your Linux distribution's update > mechanism (yum or apt-get or something like that). > > best > > Robert Dodier > Robert: The reason I asked the question was that some people were reporting that they could not build maxima from HEAD using GCL, so in my previous message I also asked if my build process for maxima using GCL qualified as a build from HEAD. I'm fairly ignorant of some of the terminology used so please forgive me if I ask questions that seem to make no sense. If GCL cannot compile CL-PPCRE, would it make sense to report this problem to Camm Maguire camm at maguirefamily.org so a fix can be made to GCL? Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From smh at franz.com Sat Feb 19 14:52:42 2011 From: smh at franz.com (Steve Haflich) Date: Sat, 19 Feb 2011 12:52:42 -0800 Subject: [Maxima] restarting maxima from scratch In-Reply-To: <4D600A0A.7020009@eecs.berkeley.edu> References: <4D5EC6D9.90806@street-artists.org> <4D5ED6FF.7040807@street-artists.org> <4D5F3CAA.3070601@gmail.com> <201102190956.36957.pip@iszf.irk.ru> <4D600A0A.7020009@eecs.berkeley.edu> Message-ID: <7482.1298148762@gemini.franz.com> On *nix systems exec() might be useful to restart, although exec() preserves open file descriptors and it might be appropriate to close fd's opened after the original execution started. The situation on Windows is slightly different, but probably workable. But everything is more confusing if Maxima has been opened under some socket-based interface. From toy.raymond at gmail.com Sat Feb 19 14:55:19 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 19 Feb 2011 15:55:19 -0500 Subject: [Maxima] Trying to build maxima from CVS In-Reply-To: <4D601C4F.9000506@olynet.com> References: <4D601C4F.9000506@olynet.com> Message-ID: <4D602E37.7090302@gmail.com> On 2/19/11 2:38 PM, Paul Bowyer wrote: > > The reason I asked the question was that some people were reporting that > they could not build maxima from HEAD using GCL, so in my previous > message I also asked if my build process for maxima using GCL qualified > as a build from HEAD. I'm fairly ignorant of some of the terminology > used so please forgive me if I ask questions that seem to make no sense. > > If GCL cannot compile CL-PPCRE, would it make sense to report this > problem to Camm Maguire camm at maguirefamily.org so a fix can be made to > GCL? That's a good idea. However, cl-ppcre is not officially part of maxima. This is a branch where Leo is trying to replace our system using perl with one using cl-ppcre to build the info files. Ray From fateman at eecs.berkeley.edu Sat Feb 19 14:55:27 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 19 Feb 2011 12:55:27 -0800 Subject: [Maxima] assumptions in solve() In-Reply-To: References: Message-ID: <4D602E3F.6080108@eecs.berkeley.edu> On 2/19/2011 11:01 AM, Dmitry Shkirmanov wrote: > >I think you have not given any evidence that solve is changing > sqrt(a*b) to sqrt(a) * sqrt(b). > > I think that i have such evidence. Let's consider system of the equations: > > solve([a*b=(-ma^2/2+Ea*Eb)^2,a=Ea^2-ma^2,b=Eb^2-mb^2],[Eb,a,b]); > > (1) a*b=(-ma^2/2+Ea*Eb)^2 > (2) a=Ea^2-ma^2 > (3) b=Eb^2-mb^2 > (sorry, but i can not give more simple example) > To solve this system one need to substitute (2) and (3) into (1). It > gives quadratic equation. From this equation one can easy get Eb. It > has term sqrt((Ea^2-ma^2)*(ma^2-4*mb^2)) (maxima gives right answer > for Eb). Now, to get b one need to substitute Eb into (3). It is easy > to see that b should have the term sqrt((Ea^2-ma^2)*(ma^2-4*mb^2)). > But maxima says that there is the term sqrt(ma - Ea)*sqrt(ma + > Ea)*sqrt(2 mb - ma)*sqrt(2 mb + ma) So, i think that maxima divides > sqrt((Ea^2-ma^2)*(ma^2-4*mb^2)) into sqrt(ma - Ea)*sqrt(ma + > Ea)*sqrt(2 mb - ma)*sqrt(2 mb + ma) > I'm not sure what you are objecting to. solve produces two subsystems. Each subsystem has a value for Eb and a value for b. given that sqrt() really is two values, and you can choose one of them for one Eb and the other value for the other Eb, and depending again on choice of sign, you have two distinct values of b, I think both of the two values for b are covered. Now you may not know which of the two values for b is the one of interest to you, but one of them is right. It is, I think, irrelevant whether you write sqrt(a*b) or sqrt(a)*sqrt(b), since either one has 2 distinct values, i.e. + or -. If all these parameters other than a b and Eb were numeric, you could try to make a default assertion that sqrt(3) means that number n >0 such that n^2=3, and the other root of n^2=3 is -sqrt(3). But if your equation is n^2= q^2-r^2, then there is no way of telling which is positive without external information. That information is ignored by solve, but you can mess around with the results of solve and try to find whatever is meaningful to you. So far as I can tell, the set of answers produced by solve was ok. RJF From willisb at unk.edu Sat Feb 19 15:22:53 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 19 Feb 2011 15:22:53 -0600 Subject: [Maxima] assumptions in solve() In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >>I?think?you?have?not?given?any?evidence?that?solve?is?changing?sqrt(a*b) >to?sqrt(a)?*?sqrt(b).? > >I?think?that?i?have?such?evidence.?Let's?consider?system?of?the?equations: > >solve([a*b=(-ma^2/2+Ea*Eb)^2,a=Ea^2-ma^2,b=Eb^2-mb^2],[Eb,a,b]); > >(1)?a*b=(-ma^2/2+Ea*Eb)^2 >(2)?a=Ea^2-ma^2 >(3)?b=Eb^2-mb^2 I see--the functions solve and algsys call radcan; the function radcan does radcan(sqrt(a*b) --> sqrt(a)*sqrt(b). As far as I know, in both cases you gave, the solutions are correct but not in the form that you would like. That's not unusual for a computer algebra system. --Barton From pbowyer at olynet.com Sat Feb 19 17:24:24 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sat, 19 Feb 2011 15:24:24 -0800 Subject: [Maxima] Trying to build maxima from CVS In-Reply-To: <4D602E37.7090302@gmail.com> References: <4D601C4F.9000506@olynet.com> <4D602E37.7090302@gmail.com> Message-ID: <4D605128.8030300@olynet.com> On 02/19/2011 12:55 PM, Raymond Toy wrote: > On 2/19/11 2:38 PM, Paul Bowyer wrote: >> The reason I asked the question was that some people were reporting that >> they could not build maxima from HEAD using GCL, so in my previous >> message I also asked if my build process for maxima using GCL qualified >> as a build from HEAD. I'm fairly ignorant of some of the terminology >> used so please forgive me if I ask questions that seem to make no sense. >> >> If GCL cannot compile CL-PPCRE, would it make sense to report this >> problem to Camm Maguire camm at maguirefamily.org so a fix can be made to >> GCL? > That's a good idea. However, cl-ppcre is not officially part of > maxima. This is a branch where Leo is trying to replace our system > using perl with one using cl-ppcre to build the info files. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Ray: I understand that Leo's branch is different than the official maxima project. My main reason for responding initially was to try to determine if the problem was with GCL or if the problem was with Leo's CL-PPCRE code which GCL chokes on. I went through the process of building maxima from CVS against GCL successfully so I think GCL seems to work where some people were saying GCL didn't work when doing the same thing. Keep in mind that I may not be using the same version of GCL as those people were using, which is why I gave my version of GCL as release 2.6.8pre (which chokes on CL-PPCRE code downloaded via "git"). Reporting it to Camm Maguire should be done if there is consensus that there is a problem with GCL, but maybe Leo should actually be the one to report it since it is his code that has the problem. I'll do what is decided to be the best course of action by all concerned. Paul From l.butler at ed.ac.uk Sat Feb 19 18:42:14 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sun, 20 Feb 2011 00:42:14 +0000 (GMT) Subject: [Maxima] Trying to build maxima from CVS In-Reply-To: <4D605128.8030300@olynet.com> References: <4D601C4F.9000506@olynet.com> <4D602E37.7090302@gmail.com> <4D605128.8030300@olynet.com> Message-ID: > < Ray: < < I understand that Leo's branch is different than the official maxima project. < < My main reason for responding initially was to try to determine if the problem < was with GCL or if the problem was with Leo's CL-PPCRE code which GCL chokes < on. I went through the process of building maxima from CVS against GCL < successfully so I think GCL seems to work where some people were saying GCL < didn't work when doing the same thing. Keep in mind that I may not be using < the same version of GCL as those people were using, which is why I gave my < version of GCL as release 2.6.8pre (which chokes on CL-PPCRE code downloaded < via "git"). < < Reporting it to Camm Maguire should be done if there is consensus that there < is a problem with GCL, but maybe Leo should actually be the one to report it < since it is his code that has the problem. Paul, I think that it would be easier to try to compile cl-ppcre with gcl, if your intent is to troubleshoot that end of things. However, I think that cl-ppcre simply uses features of common lisp that gcl does not support. Rather than try to shoehorn cl-ppcre into an ill fitting gcl shoe, I've been working on extending the nregex code so that more modern lisps can use cl-ppcre+build-index while gcl can use nregex+build-index. This seems quite feasible--and with a few tweaks, the nregex regexes can be quite fast in gcl. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From pbowyer at olynet.com Sat Feb 19 19:19:41 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sat, 19 Feb 2011 17:19:41 -0800 Subject: [Maxima] Trying to build maxima from CVS In-Reply-To: References: <4D601C4F.9000506@olynet.com> <4D602E37.7090302@gmail.com> <4D605128.8030300@olynet.com> Message-ID: <4D606C2D.8080001@olynet.com> On 02/19/2011 04:42 PM, Leo Butler wrote: > > > < Ray: > < > < I understand that Leo's branch is different than the official maxima project. > < > < My main reason for responding initially was to try to determine if the problem > < was with GCL or if the problem was with Leo's CL-PPCRE code which GCL chokes > < on. I went through the process of building maxima from CVS against GCL > < successfully so I think GCL seems to work where some people were saying GCL > < didn't work when doing the same thing. Keep in mind that I may not be using > < the same version of GCL as those people were using, which is why I gave my > < version of GCL as release 2.6.8pre (which chokes on CL-PPCRE code downloaded > < via "git"). > < > < Reporting it to Camm Maguire should be done if there is consensus that there > < is a problem with GCL, but maybe Leo should actually be the one to report it > < since it is his code that has the problem. > > Paul, > I think that it would be easier to try to compile cl-ppcre with gcl, if > your intent is to troubleshoot that end of things. > > However, I think that cl-ppcre simply uses features of common lisp that > gcl does not support. Rather than try to shoehorn cl-ppcre into an ill > fitting gcl shoe, I've been working on extending the nregex code so > that more modern lisps can use cl-ppcre+build-index while gcl can use > nregex+build-index. This seems quite feasible--and with a few tweaks, > the nregex regexes can be quite fast in gcl. > > Leo > Leo: Troubleshooting cl-ppcre would be quite an adventure for me because I'd have to spend a lot of time learning lisp (which is on my list of things to do --- someday). I like learning programming languages, but I've not yet had the time to tackle lisp because of some other things I've been attempting. Do you think Camm would be interested in extending GCL to handle the features found in more modern lisps or is that unlikely. I ask because of all the lisps I've tried with maxima, GCL is the fastest and seems to work properly for anything I have enough mathematical expertise to use. Paul From jalaludn at gmail.com Sun Feb 20 05:08:35 2011 From: jalaludn at gmail.com (Jalaluddin Morris) Date: Sun, 20 Feb 2011 19:08:35 +0800 Subject: [Maxima] Division by Zero Message-ID: <4D60F633.1010001@gmail.com> Dear Developers, (i) Isabelle/Hol has x / 0 = 0, (for 0 and x both real numbers); have you considered the same for Maxima, or being able to set this option in preferences? (ii) Proof-General provides a nice environment to work within, including unicode tokens - have you considered this environment for Maxima, or at least some of the Proof General idiom for WxMaxima? Regards, Jalaluddin From qophs59588 at mypacks.net Sat Feb 19 20:19:10 2011 From: qophs59588 at mypacks.net (qophs59588 at mypacks.net) Date: Sat, 19 Feb 2011 18:19:10 -0800 (GMT-08:00) Subject: [Maxima] Installation problem with Maxima-5.23.2 Message-ID: <13802661.1298168350817.JavaMail.root@elwamui-milano.atl.sa.earthlink.net> Hello: I've had older Maxima version on my computer (about 2 years back) and it worked with ZoneAlarm free firewall and Norton Antivirus/Internet security. My system: WinXP 32-bit Home Edition service pack 3; AMD Athlon 64 X2 Dual Core 4200+, 2.2 GHz, 3 GB RAM. Unfortunately, I've uninstalled it in order to try the latest 5.23.2 version. Now, wxMaxima and XMaxima can not connect to Maxima. I've uninstalled ZoneAlarm and changed the DEP settings, but it didn't help. However, another CAS, Euler, which uses Maxima, started to connect with it's own Maxima - ZoneAlarm removal had helped. I've returned the DEP settings to default. I installed the newest Euler version to be able to use Maxima, but it is not the latest Maxima. Whatever the reason for not be able to connect to Maxima, there is another serious problem: wxMaxima creates 21 temporary files in c:/Temp directory, when it tries to connect to Maxima. Norton antivirus detects the attempts of the program modules to connect to the Internet and asks for permission. The problem is that the temporary files have different names every time you run wxMaxima (file names are like this: TCLXXX.tmp, where XXX are digits or A,B,C,D). It will be always a problem. It is very time consuming to manually remove all those temporary file names from the Norton's trusted submodules list, as you can do it only one-by-one, clicking on the file name and waiting ~3-4 seconds to delete it. If you run wxMaxima several times, the list grows very quickly. The temporary files disappear from the C:/Temp directory after wxMaxima is closed. Therefore, I suppose, it is easy to fix the problem by using fixed file names every time. DG From dan.stanger at ieee.org Sun Feb 20 08:17:18 2011 From: dan.stanger at ieee.org (Dan Stanger) Date: Sun, 20 Feb 2011 09:17:18 -0500 Subject: [Maxima] integration In-Reply-To: References: <4d5e284bd2cab3.88102803@wp.pl> <1298033386.1971.15.camel@wigner> Message-ID: <4D61226E.4070209@ieee.org> Integrals like this can often be done more easily with the Euler substitution, here is a link: http://eom.springer.de/e/e036590.htm . i:'integrate( sqrt(x^2+4)/(x^2+1), x ); assume(t>0) i1:apply_nouns(scanmap(factor,changevar(i,(x+t)^2=(x^2+4),t,x))); returns: - ((3 * atan(((t^2 - 2)/(2 * sqrt(3)))))/(sqrt(3))) - log(t) and: subst(second(solve((x+t)^2=(x^2+4),t)),i1) returns: i2:((3 * atan((((sqrt(x^2 + 4) - x)^2 - 2)/(2 * sqrt(3)))))/(sqrt(3))) - log(sqrt(x^2 + 4) - x) ratsimp(diff(i2,x)-(sqrt(x^2+4)/(x^2+1))) returns 0. To simplify the derivative: i2d:ratsimp(diff(i2,x)) p:partition(denom(i2d),sqrt(x^2+4)) radcan(expand(num(i2d)*(second(p)-first(p)))/expand(multthru(denom(i2d)*(second(p)-first(p))))) returns the original. The Euler substitution seems to be another variable change that is missing from many calc books. Dan Stanger Stavros Macrakis wrote: > Hmm. Mathematica (integrals.wolfram.com > ) gets > asin(x/2)+sqrt(3)*atan((sqrt(3)*x)/sqrt(4+x^2)), but that is not > correct according to Maxima: > > ex0: sqrt(x^2+4)/(x^2+1)$ > ex1: asin(x/2)+sqrt(3)*atan(sqrt(3)*x/sqrt(4+x^2))$ > > From villate at fe.up.pt Sun Feb 20 09:37:21 2011 From: villate at fe.up.pt (Jaime Villate) Date: Sun, 20 Feb 2011 15:37:21 +0000 Subject: [Maxima] plot3d discrete problem In-Reply-To: <584490.18853.qm@web26001.mail.ukl.yahoo.com> References: <584490.18853.qm@web26001.mail.ukl.yahoo.com> Message-ID: <1298216241.2711.3.camel@wigner> On Sat, 2011-02-19 at 12:46 +0000, Rob Burns wrote: > This plot used to work in maxima 5.18.1 but does not now work. > > (%i1) M: matrix([2, 2, 3, 5], [2, 1, 3, 2], [2, 2, 3, 4], > > [2, 2, 3, 3], [1,1,1,4])$ > (%i2) M; > (%o2) matrix([2,2,3,5],[2,1,3,2],[2,2,3,4],[2,2,3,3],[1,1,1,4]) > (%i3) f(x, y) := float (M [?round(x), ?round(y)])$ > (%i4) plot3d (f, [x, 1, 5], [y, 1, 4], ['grid, 4, 4], ['xlabel, "x-axis"], > [plot_format, openmath])$ Hi Rob, as explained in the manual, this example should be like this: (%i1) M: matrix([1, 2, 3, 4], [1, 2, 3, 2], [1, 2, 3, 4],[1, 2, 3, 3])$ (%i2) f(x, y) := float('M [round(x round(y)])$ (%i3) plot3d (f(x,y), [x, 1, 4], [y, 1, 4], [grid, 4, 4], ['xlabel, "x-axis"], [plot_format, openmath])$ you have to quote M in the definition of f and you can not call f(x,y) just by its name in this case. There is now a round function defined in Maxima, so you no longer have to use the lisp roud function. Regards, Jaime From rob_g_burns at yahoo.co.uk Sun Feb 20 11:02:18 2011 From: rob_g_burns at yahoo.co.uk (Rob Burns) Date: Sun, 20 Feb 2011 17:02:18 +0000 (GMT) Subject: [Maxima] plot3d discrete problem In-Reply-To: <1298216241.2711.3.camel@wigner> References: <584490.18853.qm@web26001.mail.ukl.yahoo.com> <1298216241.2711.3.camel@wigner> Message-ID: <814906.38552.qm@web26002.mail.ukl.yahoo.com> Hi Jaime, I had not realised this was an example from the manual (it was a long time ago). There seems to be a typo in your message but I have copied the code from the new manual and it works with both versions. Many thanks fro your help. Regards, Rob. ----- Original Message ---- From: Jaime Villate To: Rob Burns Cc: maxima at math.utexas.edu Sent: Sun, 20 February, 2011 15:37:21 Subject: Re: [Maxima] plot3d discrete problem On Sat, 2011-02-19 at 12:46 +0000, Rob Burns wrote: > This plot used to work in maxima 5.18.1 but does not now work. > > (%i1) M: matrix([2, 2, 3, 5], [2, 1, 3, 2], [2, 2, 3, 4], > >? ? ? ? [2, 2, 3, 3], [1,1,1,4])$ > (%i2) M; > (%o2) matrix([2,2,3,5],[2,1,3,2],[2,2,3,4],[2,2,3,3],[1,1,1,4]) > (%i3) f(x, y) := float (M [?round(x), ?round(y)])$ > (%i4) plot3d (f, [x, 1, 5], [y, 1, 4], ['grid, 4, 4], ['xlabel, "x-axis"], > [plot_format, openmath])$ Hi Rob, as explained in the manual, this example should be like this: (%i1) M: matrix([1, 2, 3, 4], [1, 2, 3, 2], [1, 2, 3, 4],[1, 2, 3, 3])$ (%i2) f(x, y) := float('M [round(x round(y)])$ (%i3) plot3d (f(x,y), [x, 1, 4], [y, 1, 4], [grid, 4, 4], ['xlabel, "x-axis"], [plot_format, openmath])$ you have to quote M in the definition of f and you can not call f(x,y) just by its name in this case. There is now a round function defined in Maxima, so you no longer have to use the lisp roud function. Regards, Jaime From robert.dodier at gmail.com Sun Feb 20 11:23:49 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 20 Feb 2011 10:23:49 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch Message-ID: I've attached a patch for the build-index+cl-ppcre branch in Git. >From what I can tell, characters in languages other than English aren't displayed correctly by ? and ??; the problem is that the code reads bytes instead of characters from the .info files. This patch fixes that problem, I hope. Also there are some related changes to the build machinery (makefiles). I'm working on Xubuntu (Hardy). I tested these changes like this: ./configure --enable-clisp --enable-sbcl --enable-lang-es-utf8 --enable-lang-pt-utf8 make LC_ALL=es_ES.UTF-8 konsole or LC_ALL=pt_PT.UTF-8 konsole and in the konsole thus opened sh maxima-local -l clisp or sh maxima-local -l sbcl and tried various ? and ?? queries. HTH Robert Dodier -------------- next part -------------- A non-text attachment was scrubbed... Name: build-index-diff-2010-02-20 Type: application/octet-stream Size: 11730 bytes Desc: not available URL: From drdieterkaiser at web.de Sun Feb 20 12:02:05 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 20 Feb 2011 19:02:05 +0100 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: <1298224925.1749.0.camel@dieter> Am Sonntag, den 20.02.2011, 10:23 -0700 schrieb Robert Dodier: > I've attached a patch for the build-index+cl-ppcre branch in Git. > > >From what I can tell, characters in languages other than > English aren't displayed correctly by ? and ??; > the problem is that the code reads bytes instead of > characters from the .info files. > This patch fixes that problem, I hope. Also there are some > related changes to the build machinery (makefiles). > > I'm working on Xubuntu (Hardy). > I tested these changes like this: > > ./configure --enable-clisp --enable-sbcl --enable-lang-es-utf8 > --enable-lang-pt-utf8 > make > > LC_ALL=es_ES.UTF-8 konsole > > or > > LC_ALL=pt_PT.UTF-8 konsole > > and in the konsole thus opened > > sh maxima-local -l clisp > > or > > sh maxima-local -l sbcl > > and tried various ? and ?? queries. I have not followed the discussion in detail. Therefore, I do not know an easy way, to check the improvements. But because, I am working on the German translation, which becomes more and more complete, I am interested in a working command describe. Sorry, that I cannot to be more helpful. Dieter Kaiser From drdieterkaiser at web.de Sun Feb 20 12:11:15 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 20 Feb 2011 19:11:15 +0100 Subject: [Maxima] Missing mailings from commits Message-ID: <1298225475.1749.8.camel@dieter> Is there some work in progress, to solve the problem, that we do not get a mailing after a commit. Furthermore, I have observed that we have no entries on Sourceforge.net under the menu maxima-commits, too. At this time, I only commit changes for the German translation. But I hesitate to commit other work. There is no chance Dieter Kaiser From talon at lpthe.jussieu.fr Sun Feb 20 13:29:37 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sun, 20 Feb 2011 20:29:37 +0100 Subject: [Maxima] integration References: <4d5e284bd2cab3.88102803@wp.pl> <1298033386.1971.15.camel@wigner> <4D61226E.4070209@ieee.org> Message-ID: Dan Stanger wrote: > Integrals like this can often be done more easily with the Euler > substitution, here is a link: http://eom.springer.de/e/e036590.htm . I have looked at the springer link. So this substitution boils down to the fact that every degree 2 curve is of genus 0 and thus has rational parametrization. It is another instance of the fact that any function rational in sin and cos can be reduced to purely rational by using the tangent of the half angle, as we discussed recently. There also exists an Euler trick for genus 1 curves (cubics) which has to do with the natural addition on the cubic, and also with square roots but i don't remember exactly what it is. There is a big discussion of this trick in a paper by van Moerbeke and Horozov called "The full Geometry of Kowalewski's top and (1, 2)-abelian surfaces". -- Michel Talon From fateman at eecs.berkeley.edu Sun Feb 20 16:01:01 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 20 Feb 2011 14:01:01 -0800 Subject: [Maxima] integration In-Reply-To: References: <4d5e284bd2cab3.88102803@wp.pl> <1298033386.1971.15.camel@wigner> <4D61226E.4070209@ieee.org> Message-ID: <4D618F1D.9020200@eecs.berkeley.edu> On 2/20/2011 11:29 AM, Michel Talon wrote: > Dan Stanger wrote: > >> Integrals like this can often be done more easily with the Euler >> substitution, here is a link: http://eom.springer.de/e/e036590.htm . > I have looked at the springer link. So this substitution boils down to the > fact that every degree 2 curve is of genus 0 and thus has rational > parametrization. It is another instance of the fact that any function > rational in sin and cos can be reduced to purely rational by using > the tangent of the half angle, as we discussed recently. > > There also exists an Euler trick for genus 1 curves (cubics) which > has to do with the natural addition on the cubic, and also with square roots > but i don't remember exactly what it is. There is a big discussion of this > trick in a paper by van Moerbeke and Horozov called "The full Geometry of > Kowalewski's top and (1, 2)-abelian surfaces". > Joel Moses' 1967 MIT Phd thesis (LCS-TR-047) has, on page 84, a description of one of the methods in his stage 2, "Notes - In the case where the integrand is a rational function of trigonometric functions of x all the problems can be reduced to rational functions. The choice of the transformation [ several are proposed, but transformation VI is the tan of half angle] governs the simplicity of the resulting rational function and the final answer. The transformation in Step VI above which is always applicable in these situations frequently leads to a great deal of work and to complex results. Fortunately, a number of simpler transformations such as those of steps III, IV, and V are easily recognized and are usually applicable. ... SAINT included all of the transformations given above. ..." Moses' thesis work was included in Macsyma and hence Maxima. I don't know if this method is still used. RJF reference: http://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-047.pdf From jalaludn at gmail.com Sun Feb 20 19:24:51 2011 From: jalaludn at gmail.com (Jalaluddin Morris) Date: Mon, 21 Feb 2011 09:24:51 +0800 Subject: [Maxima] Fwd: Re: Division by Zero Message-ID: <4D61BEE3.6020400@gmail.com> Dear Developers, Alice laughed: "There's no use trying," she said; "one can't believe impossible things." "I daresay you haven't had much practice," said the Queen. "When I was younger, I always did it for half an hour a day. Why, sometimes I've believed as many as six impossible things before breakfast." ~ Lewis Carroll from Alice in Wonderland The truth is out there, somewhere. :) Regards, Jalaluddin ***************************************************************************************************** On 21/02/11 01:00 AM, Richard Fateman wrote: \ > Why is this a good idea? *It is not mathematically true.* It could > probably be set up with "tellsimp". \ ***************************************************************************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon Feb 21 00:29:59 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 20 Feb 2011 23:29:59 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: <1298224925.1749.0.camel@dieter> References: <1298224925.1749.0.camel@dieter> Message-ID: On 2/20/11, Dieter Kaiser wrote: > I have not followed the discussion in detail. Therefore, I do not know > an easy way, to check the improvements. But because, I am working on the > German translation, which becomes more and more complete, I am > interested in a working command describe. Hi Dieter, the branch in question has a reimplementation of build_index.pl (Perl) as a Lisp program which uses CL-PPCRE (regular expressions). Also I think it is possible to hook in additional .info files (e.g. for share packages). Anyway I find that in a German locale e.g. LC_ALL=de_DE Maxima reads doc/info/de/maxima.info as expected. However, I had to build maxima-index.lisp in that same locale -- when it was built in my default locale (en_US.UTF-8) some characters were displayed incorrectly. I guess that is a problem; it seems that the current locale should be ignored when building the .info indices. I didn't notice that problem after building the Spanish and Portuguese indices. Perhaps that's because I used UTF-8 locales for those and my default is also a UTF-8 locale. Just a guess. Thanks a lot for working on the German translation, and all your work on Maxima. best Robert Dodier From rroa at azti.es Mon Feb 21 02:07:59 2011 From: rroa at azti.es (=?iso-8859-1?Q?Rub=E9n_Roa?=) Date: Mon, 21 Feb 2011 09:07:59 +0100 Subject: [Maxima] Installation problem with Maxima-5.23.2 In-Reply-To: <13802661.1298168350817.JavaMail.root@elwamui-milano.atl.sa.earthlink.net> References: <13802661.1298168350817.JavaMail.root@elwamui-milano.atl.sa.earthlink.net> Message-ID: <5CD78996B8F8844D963C875D3159B94A01FE83FB@dsrcorreo> I had the same problem in a Windows XP Home edition, and a Windows Vista Home edition. In contrast, I do not have this problem in a Windows XP Professional edition. The Windows XP Home system didn't even have a firewall nor an anti-virus and the DEP privileges were in place for Maxima, wxMaxima, and Tcl/Tk. I also tried installing Euler with Maxima in the Windows Vista Home system and Euler's numerical engine works but Maxima still does not work. I run Maxima from a DOS console (thus avoiding the use of wxMaxima) and still Maxima does not work. You should try that to rule out that your problem isn't Maxima itself. Open a DOS shell and go to c:\program files\maxima-X.Y.Z\bin. Then run the maxima.bat file and see what happens. If Maxima starts in console mode, then you have a wxMaxima issue or a Maxima-wxMaxima connections issue. But if maxima itself does not start on the DOS shell, then the problem lies in Maxima, not in its connection to wxMaxima. HTH Rub?n ____________________________________________________________________________________ Dr. Rub?n Roa-Ureta AZTI - Tecnalia / Marine Research Unit Txatxarramendi Ugartea z/g 48395 Sukarrieta (Bizkaia) SPAIN > -----Mensaje original----- > De: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] En nombre de > qophs59588 at mypacks.net > Enviado el: domingo, 20 de febrero de 2011 3:19 > Para: maxima at math.utexas.edu > Asunto: [Maxima] Installation problem with Maxima-5.23.2 > > Hello: > > I've had older Maxima version on my computer (about 2 years > back) and it worked with ZoneAlarm free firewall and Norton > Antivirus/Internet security. My system: WinXP 32-bit Home > Edition service pack 3; AMD Athlon 64 X2 Dual Core 4200+, 2.2 > GHz, 3 GB RAM. > Unfortunately, I've uninstalled it in order to try the latest > 5.23.2 version. > Now, wxMaxima and XMaxima can not connect to Maxima. > I've uninstalled ZoneAlarm and changed the DEP settings, but > it didn't help. However, another CAS, Euler, which uses > Maxima, started to connect with it's own Maxima - ZoneAlarm > removal had helped. I've returned the DEP settings to > default. I installed the newest Euler version to be able to > use Maxima, but it is not the latest Maxima. > Whatever the reason for not be able to connect to Maxima, > there is another serious problem: > wxMaxima creates 21 temporary files in c:/Temp directory, > when it tries to connect to Maxima. Norton antivirus detects > the attempts of the program modules to connect to the > Internet and asks for permission. The problem is that the > temporary files have different names every time you run > wxMaxima (file names are like this: TCLXXX.tmp, where XXX > are digits or A,B,C,D). It will be always a problem. It is > very time consuming to manually remove all those temporary > file names from the Norton's trusted submodules list, as you > can do it only one-by-one, clicking on the file name and > waiting ~3-4 seconds to delete it. If you run wxMaxima > several times, the list grows very quickly. > The temporary files disappear from the C:/Temp directory > after wxMaxima is closed. Therefore, I suppose, it is easy > to fix the problem by using fixed file names every time. > > DG > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From villate at fe.up.pt Mon Feb 21 02:18:35 2011 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 21 Feb 2011 08:18:35 +0000 Subject: [Maxima] plot3d discrete problem In-Reply-To: <814906.38552.qm@web26002.mail.ukl.yahoo.com> References: <584490.18853.qm@web26001.mail.ukl.yahoo.com> <1298216241.2711.3.camel@wigner> <814906.38552.qm@web26002.mail.ukl.yahoo.com> Message-ID: <1298276315.2173.1.camel@wigner> On Sun, 2011-02-20 at 17:02 +0000, Rob Burns wrote: > There seems to be a typo in your message but I have copied the code > from the new manual and it works with both versions. Ups, sorry. For the record, the correct example from the manual is: (%i1) M: matrix([1, 2, 3, 4], [1, 2, 3, 2], [1, 2, 3, 4],[1, 2, 3, 3])$ (%i2) f(x, y) := float('M [round(x), round(y)])$ (%i3) plot3d (f(x,y), [x, 1, 4], [y, 1, 4], [grid, 4, 4])$ Jaime From rjwiltsh at gmail.com Mon Feb 21 04:04:24 2011 From: rjwiltsh at gmail.com (rjwiltsh at gmail.com) Date: Mon, 21 Feb 2011 10:04:24 +0000 Subject: [Maxima] Greek fonts In-Reply-To: References: Message-ID: <443209735-1298282376-cardhu_decombobulator_blackberry.rim.net-1108928945-@b1.c7.bise7.blackberry> Dear Sir I am running wxMaxima 0.8.5 (Maxima 5.21.1) but cannot get all the greek fonts (eg lambda and small case gamma). Please can you help me out? Thanks - Ron Wiltshire Sent from my BlackBerry? wireless device -----Original Message----- From: maxima-request at math.utexas.edu Sender: maxima-bounces at math.utexas.edu Date: Fri, 18 Feb 2011 13:47:19 To: Reply-To: maxima at math.utexas.edu Subject: Maxima Digest, Vol 55, Issue 36 Send Maxima mailing list submissions to maxima at math.utexas.edu To subscribe or unsubscribe via the World Wide Web, visit http://www.math.utexas.edu/mailman/listinfo/maxima or, via email, send a message with subject or body 'help' to maxima-request at math.utexas.edu You can reach the person managing the list at maxima-owner at math.utexas.edu When replying, please edit your Subject line so it is more specific than "Re: Contents of Maxima digest..." Today's Topics: 1. plot3d and space curves (Rob Burns) 2. Re: plot3d and space curves (Jaime Villate) 3. Re: Trying to build maxima from CVS (Paul Bowyer) 4. restarting maxima from scratch (dlakelan) 5. assumptions in solve() (Dmitry Shkirmanov) 6. Re: Trying to build maxima from CVS (Raymond Toy) 7. Re: restarting maxima from scratch (Raymond Toy) 8. Re: Maxima commit list is broken (Raymond Toy) ---------------------------------------------------------------------- Message: 1 Date: Fri, 18 Feb 2011 16:58:06 +0000 (GMT) From: Rob Burns To: maxima at math.utexas.edu Subject: [Maxima] plot3d and space curves Message-ID: <724938.5437.qm at web26008.mail.ukl.yahoo.com> Content-Type: text/plain; charset=utf-8 Until recently I have been using Maxima 5.18.1, In this I could use plot3d to plot curves in 3D by having expr1, expr2, expr3 all as functions of x. Now I have upgraded to Maxima 5.23.2, plot3d does not seem to have these operands. Could someone explain to me how to plot space curves in 3D? I have looked at draw biut am no wiser, Regards, Rob. ------------------------------ Message: 2 Date: Fri, 18 Feb 2011 17:37:53 +0000 From: Jaime Villate To: Rob Burns Cc: maxima at math.utexas.edu Subject: Re: [Maxima] plot3d and space curves Message-ID: <1298050673.6279.1.camel at wigner> Content-Type: text/plain; charset="UTF-8" On Fri, 2011-02-18 at 16:58 +0000, Rob Burns wrote: > Until recently I have been using Maxima 5.18.1, In this I could use plot3d to > plot curves in 3D by having expr1, expr2, expr3 all as functions of x. > > Now I have upgraded to Maxima 5.23.2, plot3d does not seem to have these > operands. > > Could someone explain to me how to plot space curves in 3D? Hi, perhaps you are referring to this?: http://www.ma.utexas.edu/pipermail/maxima/2010/021424.html If not, please give me an example of the plot3d command you are trying to use. Regards, Jaime Villate ------------------------------ Message: 3 Date: Fri, 18 Feb 2011 10:35:33 -0800 From: Paul Bowyer To: maxima at math.utexas.edu Subject: Re: [Maxima] Trying to build maxima from CVS Message-ID: <4D5EBBF5.80809 at olynet.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hello: I'm trying to build maxima from CVS using: "cvs -d :pserver:anonymous at maxima.cvs.sourceforge.net:/cvsroot/maxima co maxima" #which seems to download maxima source properly. I then did from the maxima source directory: "bootstrap" #which completed successfully "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-gcl --with-gcl=/usr/bin/gcl" #which failed with "config.status: error: cannot find input file: `Makefile.in'" I did this earlier this morning (because I didn't get the error message then) with a copy of maxima's source I downloaded yesterday (or the day before) and I was able to successfully build maxima, using: "make" "make check" "make install" I ran the newly installed version of xmaxima from the install directory, but the help file identified itself as "maxima-5.21post" from within xmaxima so I deleted the maxima source directory and started over by again downloading the source from CVS in an attempt to make certain I was getting the proper source and now I'm getting the error message shown above. Should I be using a different CVS command to obtain the source, or is there a problem with maxima's source that needs attention? Thanks in advance, Paul Bowyer ------------------------------ Message: 4 Date: Fri, 18 Feb 2011 11:22:01 -0800 From: dlakelan To: Maxima Mailing List Subject: [Maxima] restarting maxima from scratch Message-ID: <4D5EC6D9.90806 at street-artists.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed It would be useful to be able to COMPLETELY clear Maxima back to initial conditions. kill(all); and reset(); help a lot if you're doing casual calculations, but if you want things completely cleared out, as far as I can tell the only way to do this reliably is to quit and re-start maxima. It could be useful instead to have a function "restart();" which just calls "exec" on the maxima executable. I see that in Linux at least the maxima executable is actually a shell script that calls exec on the appropriate lisp runtime so perhaps it is a bit tricky to do this. SBCL certainly supports exec if I remember correctly, I'm not sure if GCL does or any of the other Lisps Maxima supports. In any case, the "restart" function could call exec when supported, and throw an error with a message like "this lisp does not provide support for the restart function, please quit maxima manually and start it again" otherwise. What do you all think? Is this worthwhile, or just a potential maintenance headache? ------------------------------ Message: 5 Date: Fri, 18 Feb 2011 22:23:54 +0300 From: Dmitry Shkirmanov To: maxima at math.utexas.edu Subject: [Maxima] assumptions in solve() Message-ID: Content-Type: text/plain; charset="koi8-r" Hello list, i am solving the simple system of the equations: # (%i2) solve([pasquare*pbsquare*costhetavkv=((-ma^2-mb^2+mc^2)/2 + Ea*Eb)^2,pasquare=Ea^2-ma^2,pbsquare=Eb^2-mb^2],[Eb,pbsquare,pasquare]); # In the output there is the factor sqrt(ma-Ea), but in my task Ea>ma, so this factor does not have any sense. It seems that when maxima encounters expression sqrt(a*b) it returns sqrt(a)*sqrt(b). But in case of a<0 and b<0 the answer is sqrt(-a)*sqrt(-b). Is it possible to make maxima to hold sqrt(a*b) and not divide in into sqrt(a)*sqrt(b)? P.S. sorry for my rough english -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 6 Date: Fri, 18 Feb 2011 14:42:20 -0500 From: Raymond Toy To: maxima at math.utexas.edu Subject: Re: [Maxima] Trying to build maxima from CVS Message-ID: <4D5ECB9C.40705 at gmail.com> Content-Type: text/plain; charset=ISO-8859-1 On 2/18/11 1:35 PM, Paul Bowyer wrote: > Hello: > > I'm trying to build maxima from CVS using: > "cvs -d :pserver:anonymous at maxima.cvs.sourceforge.net:/cvsroot/maxima > co maxima" > #which seems to download maxima source properly. > > I then did from the maxima source directory: > "bootstrap" > #which completed successfully > > "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-gcl > --with-gcl=/usr/bin/gcl" > #which failed with "config.status: error: cannot find input file: > `Makefile.in'" > You mean maxima.system.in? I inadvertently checked in something by accident. I thought I had reverted this change yesterday, but I didn't. It should be fixed in CVS now. (This is where having the commit log emails would be really beneficial.) Ray ------------------------------ Message: 7 Date: Fri, 18 Feb 2011 14:45:08 -0500 From: Raymond Toy To: maxima at math.utexas.edu Subject: Re: [Maxima] restarting maxima from scratch Message-ID: <4D5ECC44.8090701 at gmail.com> Content-Type: text/plain; charset=ISO-8859-1 On 2/18/11 2:22 PM, dlakelan wrote: > It would be useful to be able to COMPLETELY clear Maxima back to > initial conditions. kill(all); and reset(); help a lot if you're doing > casual calculations, but if you want things completely cleared out, as > far as I can tell the only way to do this reliably is to quit and > re-start maxima. > > It could be useful instead to have a function "restart();" which just > calls "exec" on the maxima executable. I see that in Linux at least > the maxima executable is actually a shell script that calls exec on > the appropriate lisp runtime so perhaps it is a bit tricky to do this. > SBCL certainly supports exec if I remember correctly, I'm not sure if > GCL does or any of the other Lisps Maxima supports. In any case, the > "restart" function could call exec when supported, and throw an error > with a message like "this lisp does not provide support for the > restart function, please quit maxima manually and start it again" > otherwise. > How is restart() different from quitting maxima and starting maxima again? If there is none, the why spend any time adding this code and testing it? A line not added is a line debugged. :-) Ray ------------------------------ Message: 8 Date: Fri, 18 Feb 2011 14:47:05 -0500 From: Raymond Toy To: maxima at math.utexas.edu Subject: Re: [Maxima] Maxima commit list is broken Message-ID: Content-Type: text/plain; charset=ISO-8859-1 On 2/17/11 5:58 PM, Raymond Toy wrote: > On 2/17/11 5:09 PM, Robert Dodier wrote: >> For the record, I saw the error message about /bin/mail too >> and I don't know what that's about. >> Not sure what to do at this point. > Complain to Sourceforge I guess. Apparently this has already been reported. Ray ------------------------------ _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima End of Maxima Digest, Vol 55, Issue 36 ************************************** From l.butler at ed.ac.uk Mon Feb 21 08:15:34 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 21 Feb 2011 14:15:34 +0000 (GMT) Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <1298224925.1749.0.camel@dieter> Message-ID: On Sun, 20 Feb 2011, Robert Dodier wrote: < On 2/20/11, Dieter Kaiser wrote: < < > I have not followed the discussion in detail. Therefore, I do not know < > an easy way, to check the improvements. But because, I am working on the < > German translation, which becomes more and more complete, I am < > interested in a working command describe. < < Hi Dieter, the branch in question has a reimplementation of < build_index.pl (Perl) as a Lisp program which uses CL-PPCRE < (regular expressions). Also I think it is possible to hook in < additional .info files (e.g. for share packages). < < Anyway I find that in a German locale e.g. LC_ALL=de_DE < Maxima reads doc/info/de/maxima.info as expected. < However, I had to build maxima-index.lisp in that same < locale -- when it was built in my default locale (en_US.UTF-8) < some characters were displayed incorrectly. < I guess that is a problem; it seems that the current locale < should be ignored when building the .info indices. Robert, what if you use the info files in de.utf8? Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From marco.rofei at gmail.com Mon Feb 21 09:16:39 2011 From: marco.rofei at gmail.com (Marco Rofei) Date: Mon, 21 Feb 2011 16:16:39 +0100 Subject: [Maxima] Superscript Message-ID: <1298301399.2005.14.camel@UL80VT> Hi, is there a way to get a superscript or subscript before the variable letter, like the 0 in the attached image, using the ' operator? eg (%i1) 'superscript(0)A[1]; MR -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: a_01.png Type: image/png Size: 2408 bytes Desc: not available URL: From l.butler at ed.ac.uk Mon Feb 21 09:57:12 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 21 Feb 2011 15:57:12 +0000 (GMT) Subject: [Maxima] Could not find maxima-index.lisp In-Reply-To: References: <1298113011.1971.7.camel@UL80VT> <1298121490.3066.17.camel@wigner> <1298133136.18166.3.camel@UL80VT> Message-ID: On Mon, 21 Feb 2011, Blahota Istv?n wrote: < Dear Leo, < < thank you for your report! You are welcome, Istvan. < < > ?Ok, the configuration of Maxima and its installation are inconsistent. < > ?It appears that Istvan Blahota has chosen < > < > ?/usr/share/doc/maxima-doc/ < > < > ?as the doc directory and the maxima-infodir is < > < > ?/usr/share/doc/maxima-doc/info/info < < I just want to mention that I haven't changed anything, my debs were built from < the official Maxima source without any modification. (Aside: Perhaps we ought to be publishing the md5sums+sha*sums of the tarballs and other 'official' releases, so that folks can verify these things are un-adulterated.) I may be repeating the obvious, but: When you run the configure script, you will need to set the correct installation locations for the various bits. At the moment, it looks like your configure script is using the default locations, whereas your debs' installation scripts are not installing in default locations. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From willisb at unk.edu Mon Feb 21 10:37:36 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 21 Feb 2011 10:37:36 -0600 Subject: [Maxima] Missing mailings from commits In-Reply-To: <1298225475.1749.8.camel@dieter> References: <1298225475.1749.8.camel@dieter> Message-ID: maxima-bounces at math.utexas.edu wrote on 02/20/2011 12:11:15 PM: > Is there some work in progress, to solve the problem, that we do not get > a mailing after a commit. Furthermore, I have observed that we have no > entries on Sourceforge.net under the menu maxima-commits, too. The Maxima commits show up on ohloh.net ( http://www.ohloh.net/p/maxima/commits), but not on Sourceforge. --Barton From fateman at eecs.berkeley.edu Mon Feb 21 10:48:05 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 21 Feb 2011 08:48:05 -0800 Subject: [Maxima] Superscript In-Reply-To: <1298301399.2005.14.camel@UL80VT> References: <1298301399.2005.14.camel@UL80VT> Message-ID: <4D629745.5070403@eecs.berkeley.edu> On 2/21/2011 7:16 AM, Marco Rofei wrote: > Hi, > is there a way to get a superscript or subscript before the variable > letter, like the *0* in the attached image, using the ' operator? > > eg > > (%i1) 'superscript(0)A[1]; > > MR > > > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Is this only for TeX output, or regular display? They would require augmenting the Tex or the display, and they are probably different. Or here's an idea: we create an object that has no display form, and do this: {}^u*A[v]. Unfortunately we have the case in hand that u=0. So maybe one has to hack this more. while we are at it, consider all 4 positions, pre-sub-script, pre-super-script, as well as post-super-script and post-sub-script. then one could define display formats via displayform (A(a,b,c,d)) := subsuperscript_form(A,a,b,c,d) for the 4 positions.. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon Feb 21 12:18:20 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 21 Feb 2011 11:18:20 -0700 Subject: [Maxima] Superscript In-Reply-To: <1298301399.2005.14.camel@UL80VT> References: <1298301399.2005.14.camel@UL80VT> Message-ID: On 2/21/11, Marco Rofei wrote: > is there a way to get a superscript or subscript before the variable > letter, like the 0 in the attached image, using the ' operator? Here's a way to get the pre-superscript in TeX output. Define a new operator "+^" such that a +^ b means put b as a superscript before a. infix ("+^"); texfoo (e) := block ([a, b], [a, b] : args (e), concat ("{}^{", tex1 (b), "}\\!{", tex1 (a), "}")); texput ("+^", texfoo); Then we get stuff like this: tex (A[1] +^ 0); => $${}^{0}\!{A_{1}}$$ (I don't any better way to make a pre-superscript in TeX.) The Maxima console pretty-printer looks for a function to handle each operator, so we could, with a little Lisp hacking, define a function for "+^". If you're interested we can get into it. I think this same topic came up a year or two ago. I don't remember what anyone might have said about it at the time. Probably you could search the message archives. See: http://maxima.sourceforge.net/maximalist.html best Robert Dodier From robert.dodier at gmail.com Mon Feb 21 12:25:36 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 21 Feb 2011 11:25:36 -0700 Subject: [Maxima] Superscript In-Reply-To: <4D629745.5070403@eecs.berkeley.edu> References: <1298301399.2005.14.camel@UL80VT> <4D629745.5070403@eecs.berkeley.edu> Message-ID: On 2/21/11, Richard Fateman wrote: > we create an object that has no display form, and do this: > > {}^u*A[v]. Unfortunately we have the case in hand that u=0. For the record, it is easy enough to create this invisible object. The Maxima parser already recognizes \ (i.e. backslash preceding a space) as the symbol which has the name " ". So we could do this (although I don't know that it's useful in the present context). texput (\ , "{}"); tex (\ ^u); => $${}^{u}$$ FWIW Robert Dodier From ronis at ronispc.chem.mcgill.ca Mon Feb 21 12:31:01 2011 From: ronis at ronispc.chem.mcgill.ca (David Ronis) Date: Mon, 21 Feb 2011 13:31:01 -0500 Subject: [Maxima] Superscript In-Reply-To: References: <1298301399.2005.14.camel@UL80VT> Message-ID: <1298313061.28648.1.camel@ronispc.chem.mcgill.ca> Here's another way: \ ^1_2 A^3_4 gets all 4 positions. David On Mon, 2011-02-21 at 11:18 -0700, Robert Dodier wrote: > On 2/21/11, Marco Rofei wrote: > > > is there a way to get a superscript or subscript before the variable > > letter, like the 0 in the attached image, using the ' operator? > > Here's a way to get the pre-superscript in TeX output. > Define a new operator "+^" such that a +^ b means > put b as a superscript before a. > > infix ("+^"); > texfoo (e) := block ([a, b], [a, b] : args (e), concat ("{}^{", tex1 > (b), "}\\!{", tex1 (a), "}")); > texput ("+^", texfoo); > > Then we get stuff like this: > > tex (A[1] +^ 0); > => $${}^{0}\!{A_{1}}$$ > > (I don't any better way to make a pre-superscript in TeX.) > > The Maxima console pretty-printer looks for a function to handle > each operator, so we could, with a little Lisp hacking, define a > function for "+^". If you're interested we can get into it. > > I think this same topic came up a year or two ago. I don't > remember what anyone might have said about it at the time. > Probably you could search the message archives. > See: http://maxima.sourceforge.net/maximalist.html > > best > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From marco.rofei at gmail.com Mon Feb 21 12:43:32 2011 From: marco.rofei at gmail.com (Marco Rofei) Date: Mon, 21 Feb 2011 19:43:32 +0100 Subject: [Maxima] Superscript In-Reply-To: <4D629745.5070403@eecs.berkeley.edu> References: <1298301399.2005.14.camel@UL80VT> <4D629745.5070403@eecs.berkeley.edu> Message-ID: <1298313812.2005.42.camel@UL80VT> > Is this only for TeX output, or regular display? They would require > augmenting > the Tex or the display, and they are probably different. Or here's an > idea: > we create an object that has no display form, and do this: > > {}^u*A[v]. Unfortunately we have the case in hand that u=0. > > So maybe one has to hack this more. It is for display only. I notice that: (%i1) '{}^2*A[1]; 2 (%o1) set () A 1 That is not what i want. Thanks all for help, but i don't need it in tex environment. My target is a readable code for explaining it to my colleagues. I'm going to use wxMaxima. MR -------------- next part -------------- An HTML attachment was scrubbed... URL: From l.butler at ed.ac.uk Mon Feb 21 12:44:58 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 21 Feb 2011 18:44:58 +0000 (GMT) Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: On Sun, 20 Feb 2011, Robert Dodier wrote: < I've attached a patch for the build-index+cl-ppcre branch in Git. < < From what I can tell, characters in languages other than < English aren't displayed correctly by ? and ??; < the problem is that the code reads bytes instead of < characters from the .info files. < This patch fixes that problem, I hope. Also there are some < related changes to the build machinery (makefiles). Thanks for the patches, Robert. I committed the patches to the Makefiles and build-index.lisp separately, and pushed the changes to that branch. I am not sure that this patch is correct, though: it seems to me that it might be better to handle the info files as byte streams and let Maxima/Lisp handle the display/encoding in the info and info-exact functions (at the moment, these are using format to print the info). As always, I am keen to hear feedback. Leo ----- How to get the patches 1. if you have already cloned the git repo, then cd to the top dir of your local repo and do git pull git checkout build-index+cl-ppcre 2. otherwise, git clone git://github.com/leo-butler/Maxima-CAS.git git checkout build-index+cl-ppcre Then build Maxima as you normally would from HEAD. -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From robert.dodier at gmail.com Mon Feb 21 12:49:19 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 21 Feb 2011 11:49:19 -0700 Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits Message-ID: On 2/20/11, Dieter Kaiser wrote: > Is there some work in progress, to solve the problem, that we do not get > a mailing after a commit. Furthermore, I have observed that we have no > entries on Sourceforge.net under the menu maxima-commits, too. > > At this time, I only commit changes for the German translation. But I > hesitate to commit other work. There is no chance >From what I can tell, CVS still functions as it is supposed to, it's just that the emails are not generated. But this really isn't very comforting. I think it's time to stop using CVS and switch over to Git. This recent message from an SF admin suggests that they aren't going to fix the problem, and they are going to drop CVS anyway. http://sourceforge.net/apps/trac/sourceforge/ticket/11248 (See the comment at the end of the page.) I know there are other systems we could use, other than Git, but Git is the only one that has gotten any traction with the Maxima developers, from what I can tell. Can somebody figure out how to change over from CVS to Git and explain the plan to us and then carry it out? I'd like to carry over the entire CVS history including the commit log, branches, and tags. The explanation part has to include a Rosetta Stone to translate CVS operations to Git. That should probably go on a wiki or something to make it easier to find. best Robert Dodier From robert.dodier at gmail.com Mon Feb 21 13:14:06 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 21 Feb 2011 12:14:06 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: On 2/21/11, Leo Butler wrote: > I am not sure that this patch is correct, though: it seems > to me that it might be better to handle the info files as > byte streams and let Maxima/Lisp handle the display/encoding > in the info and info-exact functions (at the moment, these are > using format to print the info). Well, I dunno. Maybe there's a way to get string coercion to collapse successive bytes in an array into characters, but as it happens the implementation in src/build-index.lisp namely (map 'string #'code-char code-vec) didn't do it. As it stands, non-English characters are displayed correctly and before they weren't. I don't know what else to say. best Robert Dodier From robert.dodier at gmail.com Mon Feb 21 13:25:44 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 21 Feb 2011 12:25:44 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <1298224925.1749.0.camel@dieter> Message-ID: On 2/21/11, Leo Butler wrote: > Robert, what if you use the info files in de.utf8? Looks like maxima-index.lisp is generated correctly in de.utf8, es.utf8, and pt.utf8. Conversely maxima-index.lisp is generated incorrectly (special characters are replaced by literal '?' characters) in de, es, and pt, when the ambient locale is UTF-8 (specifically en_US.UTF-8). If I'm not mistaken, the current scheme which uses build_index.pl generates correct maxima-index.lisp for non-UTF-8 locales even if the ambient locale is UTF-8. FWIW Robert Dodier From marco.rofei at gmail.com Mon Feb 21 13:42:58 2011 From: marco.rofei at gmail.com (Marco Rofei) Date: Mon, 21 Feb 2011 20:42:58 +0100 Subject: [Maxima] Superscript In-Reply-To: References: <1298301399.2005.14.camel@UL80VT> Message-ID: <1298317378.2005.49.camel@UL80VT> > I think this same topic came up a year or two ago. I don't > remember what anyone might have said about it at the time. > Probably you could search the message archives. > See: http://maxima.sourceforge.net/maximalist.html > > best > > Robert Dodier I find, in ML archive, a similar post for superscript function. Here there's your code attached to it /* make x`y act like a superscripted variable * copyright 2010 by Robert Dodier * I release this work under terms of the GNU General Public License. */ infix ("`"); :lisp (setf (get '$\` 'dimension) (get 'mexpt 'dimension)) texput ("`", "^", 'infix); :lisp (setf (get '$\` 'mset_extension_operator) 'superscript-assign) :lisp (defun superscript-assign (expr value) (let* ((x (second expr)) (y (third expr)) (z (or (get x 'superscript-values) (setf (get x 'superscript-values) (make-hash-table))))) (setf (gethash y z) value))) :lisp (defun $\` (x y) (or (and (get x 'superscript-values) (gethash y (get x 'superscript-values))) `(($\`) ,x ,y))) Here the thread http://www.math.utexas.edu/pipermail/maxima/2010/021139.html I don't know lisp language, but I think shouldn't be too hard to modify it. MR -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon Feb 21 13:44:54 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 21 Feb 2011 12:44:54 -0700 Subject: [Maxima] Division by Zero In-Reply-To: <4D60F633.1010001@gmail.com> References: <4D60F633.1010001@gmail.com> Message-ID: On 2/20/11, Jalaluddin Morris wrote: > (i) Isabelle/Hol has x / 0 = 0, (for 0 and x both real numbers); have > you considered the same for Maxima, or being able to set this option in > preferences? On the whole it is not easy to revert or replace Maxima's built-in simplifications; this is a serious architectural difficulty. But at least superficially, one can tell Maxima to handle division by 0 like this: matchdeclare (xx, all); simp : false; tellsimp (xx/0, 0); simp : true; [0/0, 1/0, 2/0, x/0, (1 - x)/0]; => [0, 0, 0, 0, 0] > (ii) Proof-General provides a nice environment to work within, including > unicode tokens - have you considered this environment for Maxima, or at > least some of the Proof General idiom for WxMaxima? I don't know what Proof-General is about. Can you be more specific? best Robert Dodier From l.butler at ed.ac.uk Mon Feb 21 13:47:19 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 21 Feb 2011 19:47:19 +0000 (GMT) Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <1298224925.1749.0.camel@dieter> Message-ID: On Mon, 21 Feb 2011, Robert Dodier wrote: < On 2/21/11, Leo Butler wrote: < < > Robert, what if you use the info files in de.utf8? < < Looks like maxima-index.lisp is generated correctly in < de.utf8, es.utf8, and pt.utf8. < < Conversely maxima-index.lisp is generated incorrectly < (special characters are replaced by literal '?' characters) < in de, es, and pt, when the ambient locale is UTF-8 < (specifically en_US.UTF-8). < < If I'm not mistaken, the current scheme which uses < build_index.pl generates correct maxima-index.lisp < for non-UTF-8 locales even if the ambient locale is UTF-8. Robert, what do you mean by 'incorrect'? Do you mean the text is displayed incorrectly or do you mean that the displayed text is incorrect? Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From toy.raymond at gmail.com Mon Feb 21 14:05:53 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 21 Feb 2011 15:05:53 -0500 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: <4D62C5A1.7070003@gmail.com> On 2/21/11 1:44 PM, Leo Butler wrote: > > On Sun, 20 Feb 2011, Robert Dodier wrote: > > < I've attached a patch for the build-index+cl-ppcre branch in Git. > < > < From what I can tell, characters in languages other than > < English aren't displayed correctly by ? and ??; > < the problem is that the code reads bytes instead of > < characters from the .info files. > < This patch fixes that problem, I hope. Also there are some > < related changes to the build machinery (makefiles). > > Thanks for the patches, Robert. > > I committed the patches to the Makefiles and build-index.lisp > separately, and pushed the changes to that branch. > > I am not sure that this patch is correct, though: it seems > to me that it might be better to handle the info files as > byte streams and let Maxima/Lisp handle the display/encoding > in the info and info-exact functions (at the moment, these are > using format to print the info). I think that if you treat the info files as byte streams and then just output the bytes as read from the info file, you'll get the correct result. This assumes that the user has set up his environment and terminal to use the correct encoding. If we were trying to process the contents of the info file, this is not so nice, but we just want to output a part of the info file, so this works just fine. This allows the info files to work even with a lisp that doesn't support unicode. Ray From toy.raymond at gmail.com Mon Feb 21 15:24:54 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 21 Feb 2011 16:24:54 -0500 Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits In-Reply-To: References: Message-ID: <4D62D826.2030400@gmail.com> On 2/21/11 1:49 PM, Robert Dodier wrote: > > I know there are other systems we could use, other than Git, > but Git is the only one that has gotten any traction with the > Maxima developers, from what I can tel > > Can somebody figure out how to change over from CVS to Git > and explain the plan to us and then carry it out? Since Leo has already done it, perhaps he is in the best position. I recently converted a cvs repo on sourceforge to git using "git cvsimport". Worked pretty well and preserved the logs, branches, and tags. Using gitk --all on Leo's git repo seems to show that everything is preserved. Didn't check in detail, though. The only thing I would like to see is that real names and emails be imported into git, at least for the currently "active" developers. > I'd like to carry over the entire CVS history including the > commit log, branches, and tags. > The explanation part has to include a Rosetta Stone to > translate CVS operations to Git. That should probably go > on a wiki or something to make it easier to find. I used the git tutorial to get started. The Pro Git book is nice too, especially Chapter 2. I assume that whatever dvc is used, the official code is whatever is in the git repo on sourceforge, not on someone's random clone somewhere. Ray From blahota at gmail.com Mon Feb 21 01:35:26 2011 From: blahota at gmail.com (=?ISO-8859-1?Q?Blahota_Istv=E1n?=) Date: Mon, 21 Feb 2011 08:35:26 +0100 Subject: [Maxima] Could not find maxima-index.lisp In-Reply-To: References: <1298113011.1971.7.camel@UL80VT> <1298121490.3066.17.camel@wigner> <1298133136.18166.3.camel@UL80VT> Message-ID: Dear Leo, thank you for your report! > ?Ok, the configuration of Maxima and its installation are inconsistent. > ?It appears that Istvan Blahota has chosen > > ?/usr/share/doc/maxima-doc/ > > ?as the doc directory and the maxima-infodir is > > ?/usr/share/doc/maxima-doc/info/info I just want to mention that I haven't changed anything, my debs were built from the official Maxima source without any modification. Regards, Istv?n From rjwiltsh at glam.ac.uk Mon Feb 21 03:42:27 2011 From: rjwiltsh at glam.ac.uk (Wiltshire R J (AT)) Date: Mon, 21 Feb 2011 09:42:27 +0000 Subject: [Maxima] Greek fonts Message-ID: <874DBF00-1082-4331-9C8C-ED1B96C31B2A@glam.ac.uk> Hi, I am running wxMaxima 0.8.5 (Maxima 5.21.1) but cannot get all the greek fonts ( eg lambda and small case gamma). Please can you help me out? Thanks - Ron Wiltshire From andrej.vodopivec at gmail.com Mon Feb 21 16:19:12 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Mon, 21 Feb 2011 23:19:12 +0100 Subject: [Maxima] Greek fonts In-Reply-To: <874DBF00-1082-4331-9C8C-ED1B96C31B2A@glam.ac.uk> References: <874DBF00-1082-4331-9C8C-ED1B96C31B2A@glam.ac.uk> Message-ID: Try with %gamma and %lambda. Andrej On Mon, Feb 21, 2011 at 10:42 AM, Wiltshire R J (AT) wrote: > Hi, > > I am running wxMaxima 0.8.5 (Maxima 5.21.1) but cannot get all the greek fonts ( eg lambda and small case gamma). Please can you help me out? > > > Thanks - Ron Wiltshire > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From l.butler at ed.ac.uk Mon Feb 21 21:09:05 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 22 Feb 2011 03:09:05 +0000 (GMT) Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits In-Reply-To: <4D62D826.2030400@gmail.com> References: <4D62D826.2030400@gmail.com> Message-ID: On Mon, 21 Feb 2011, Raymond Toy wrote: < On 2/21/11 1:49 PM, Robert Dodier wrote: < > < > I know there are other systems we could use, other than Git, < > but Git is the only one that has gotten any traction with the < > Maxima developers, from what I can tel < > < > Can somebody figure out how to change over from CVS to Git < > and explain the plan to us and then carry it out? < Since Leo has already done it, perhaps he is in the best position. I < recently converted a cvs repo on sourceforge to git using "git < cvsimport". Worked pretty well and preserved the logs, branches, and < tags. Using gitk --all on Leo's git repo seems to show that everything < is preserved. Didn't check in detail, though. < < The only thing I would like to see is that real names and emails be < imported into git, at least for the currently "active" developers. < < > I'd like to carry over the entire CVS history including the < > commit log, branches, and tags. < > The explanation part has to include a Rosetta Stone to < > translate CVS operations to Git. That should probably go < > on a wiki or something to make it easier to find. < I used the git tutorial < to < get started. The Pro Git book is nice too, < especially Chapter 2. < < I assume that whatever dvc is used, the official code is whatever is in < the git repo on sourceforge, not on someone's random clone somewhere. Here is what I propose (sorry for the length): 1. Agree a date & time T to make the CVS repo read-only, but leave it online for the time being; 2. Put a new git clone of the CVS repo in place at time T-1, with read-only access for all but the creator, and at time T the current CVS developers can be given write access. At the same time, the CVS HEAD will be retired as a separate branch CVS-HEAD, and development can continue on a new HEAD. From time T-1 to T, developers ought to hold-off committing to the CVS repo, and they ought to clone the git repo. After time T, the git repo becomes the official project repo, and developers have write access to it. 3. A few links to tutorials and maybe some of the most frequently used commands can be added to our wiki. Git is quite well documented, and there are tutorial/cheatsheets for CVS users to adapt. The bog-standard vc-mode in Emacs also works quite nicely with git when working on the local repo; I've not yet tried it for pushing or pulling. 4. The project webpages will need to be cleaned up and references to the CVS repo changed to the git repo. ----- 1-3 can be done within a week, so I suggest the switch-over be made at T = 00:00:01 27 Feb 2011 GMT and T-1 be one day earlier. ----- A few notes: -the commit logs, branches and tags from the CVS repo are now on my git clone; casual inspection shows all have been preserved. I have also successfully updated the git master to today's CVS HEAD. -the original commit logs do not contain email addresses, just the sourceforge user id of the committer, and these are preserved in the git repo. -I don't have sufficient rights on sourceforge to create a git repo from the Maxima CVS repo, nor can I clone a github repo hosted outside sourceforge. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From toy.raymond at gmail.com Mon Feb 21 22:21:47 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 21 Feb 2011 23:21:47 -0500 Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits In-Reply-To: References: <4D62D826.2030400@gmail.com> Message-ID: <4D6339DB.6060708@gmail.com> On 2/21/11 10:09 PM, Leo Butler wrote: > > [snip plan] > ----- > > 1-3 can be done within a week, so I suggest the switch-over be made > at T = 00:00:01 27 Feb 2011 GMT and T-1 be one day earlier. > I think the plan is good, except for the T-1 part. I think one day to make the switch over is a bit too short. It takes time to verify things are working and to get everything in place (I'd like commit message to be sent out still), and to make sure at least a couple of developers can actually use the git repo before going live. A week seems more realistic, and not overly long. After all, maxima cvs has been out for longer than that already. Ray From robert.dodier at gmail.com Tue Feb 22 00:02:05 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 21 Feb 2011 23:02:05 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: <4D62C5A1.7070003@gmail.com> References: <4D62C5A1.7070003@gmail.com> Message-ID: On 2/21/11, Raymond Toy wrote: > I think that if you treat the info files as byte streams and then just > output the bytes as read from the info file, you'll get the correct > result. This assumes that the user has set up his environment and > terminal to use the correct encoding. I'm pretty sure that's not so. The code replaced by the patch I posted in this thread did just that, and the characters were displayed incorrectly. I changed the code and now they are displayed correctly. I'm willing to be convinced otherwise if you have some working code. FWIW Robert Dodier From robert.dodier at gmail.com Tue Feb 22 00:34:35 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 21 Feb 2011 23:34:35 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <1298224925.1749.0.camel@dieter> Message-ID: On 2/21/11, Leo Butler wrote: > Robert, what do you mean by 'incorrect'? > > Do you mean the text is displayed incorrectly or do > you mean that the displayed text is incorrect? In doc/info/{es,pt}/maxima-index.lisp (i.e. non-UTF-8) special characters are replaced by '?' (ascii 077). best Robert Dodier From jalaludn at gmail.com Tue Feb 22 06:25:35 2011 From: jalaludn at gmail.com (Jalaluddin Morris) Date: Tue, 22 Feb 2011 20:25:35 +0800 Subject: [Maxima] Setting Divide by Zero Equal to Zero in Maxima Message-ID: <4D63AB3F.5030501@gmail.com> Dear List Members, I have attached a pdf addressing the question as to why one might wish to have the option of x / 0 = 0 in Maxima. On the subject of Isabelle/Hol, members may wish to download the software from http://www.cl.cam.ac.uk/research/hvg/Isabelle/ and familiarize themselves with the GUI, despite the steep learning curve. Regards, Jalaluddin -------------- next part -------------- A non-text attachment was scrubbed... Name: discreet_charm.pdf Type: application/pdf Size: 27551 bytes Desc: not available URL: From toy.raymond at gmail.com Tue Feb 22 08:11:28 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 22 Feb 2011 09:11:28 -0500 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <4D62C5A1.7070003@gmail.com> Message-ID: <4D63C410.8090806@gmail.com> On 2/22/11 1:02 AM, Robert Dodier wrote: > On 2/21/11, Raymond Toy wrote: > >> I think that if you treat the info files as byte streams and then just >> output the bytes as read from the info file, you'll get the correct >> result. This assumes that the user has set up his environment and >> terminal to use the correct encoding. > I'm pretty sure that's not so. The code replaced by the patch > I posted in this thread did just that, and the characters were > displayed incorrectly. I changed the code and now they are > displayed correctly. > > I'm willing to be convinced otherwise if you have some working code. Because this is how the old system worked? At least I think this is how the old system worked. I confess the only time I really looked at it was when Leo was first starting this work and was building on the existing system using nregex instead of cl-ppcre. Ray From robert.dodier at gmail.com Tue Feb 22 10:21:07 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 22 Feb 2011 09:21:07 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: <4D63C410.8090806@gmail.com> References: <4D62C5A1.7070003@gmail.com> <4D63C410.8090806@gmail.com> Message-ID: On 2/22/11, Raymond Toy wrote: > Because this is how the old system worked? At least I think this is how > the old system worked. I confess the only time I really looked at it > was when Leo was first starting this work and was building on the > existing system using nregex instead of cl-ppcre. Well, despite the name of the variable BYTE-COUNT in READ-INFO-TEXT, it's actually reading characters. I wrote that code so you can blame me for the confusion ... sorry about that. The BYTE-OFFSET variable really is a byte offset, as far as I know. best Robert Dodier From amundson at users.sourceforge.net Tue Feb 22 10:25:31 2011 From: amundson at users.sourceforge.net (James Amundson) Date: Tue, 22 Feb 2011 10:25:31 -0600 Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits In-Reply-To: <4D62D826.2030400@gmail.com> References: <4D62D826.2030400@gmail.com> Message-ID: <4D63E37B.8070905@users.sourceforge.net> On 02/21/2011 03:24 PM, Raymond Toy wrote: > On 2/21/11 1:49 PM, Robert Dodier wrote: >> I know there are other systems we could use, other than Git, >> but Git is the only one that has gotten any traction with the >> Maxima developers, from what I can tel >> >> Can somebody figure out how to change over from CVS to Git >> and explain the plan to us and then carry it out? > Since Leo has already done it, perhaps he is in the best position. I > recently converted a cvs repo on sourceforge to git using "git > cvsimport". Worked pretty well and preserved the logs, branches, and > tags. Using gitk --all on Leo's git repo seems to show that everything > is preserved. Didn't check in detail, though. > > The only thing I would like to see is that real names and emails be > imported into git, at least for the currently "active" developers. Caution is required here. I have converted several different CVS repositories to git over the past few years. I found that git-cvsimport always *appeared* to work, but *often* produced git checkouts that were subtly different from the cvs versions. In fact, I think I was experimenting with the Maxima repository when I first noticed that my git version didn't match up with the cvs version. The last time I tried to use git-cvsimport was a couple of years ago, so it may be that it has been substantially improved in the meantime. However, I looked into fixing it myself at the time and learned that the extraction of historical cvs data from a cvs repository is much more complicated than I had ever dreamed. In the end, I used the git-ized version of cvs2svn to do conversions. I have found that to be much more reliable, even though I have had to tweak it a little from time to time. I sent Robert a private email volunteering to help with the maxima cvs-git conversion a little while ago, but haven't found time to follow up. (Sorry about that, Robert.) It appears that the time is now, however. Here is what I suggest: 1) Carefully check that the current CVS version is identical to the git-cvsimport version. I.e., do a recursive diff on checked-out copies of both. 2) Repeat (1) for the past n-releases, where n is limited by patience. If (1) and (2) pass, git-cvsimport has been greatly improved and you should carry on with the plan. If not, somebody should try using cvs2svn to do the conversion. I would be happy to do it if someone can point me to the tarball of the cvs files (the repository, not just a checkout.) (Obviously, I used to know how to get that, but it's been a while.) --Jim From robert.dodier at gmail.com Tue Feb 22 10:33:02 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 22 Feb 2011 09:33:02 -0700 Subject: [Maxima] Trying to build maxima from CVS In-Reply-To: References: <4D601C4F.9000506@olynet.com> <4D602E37.7090302@gmail.com> <4D605128.8030300@olynet.com> Message-ID: On 2/19/11, Leo Butler wrote: > However, I think that cl-ppcre simply uses features of common lisp that > gcl does not support. Rather than try to shoehorn cl-ppcre into an ill > fitting gcl shoe, I've been working on extending the nregex code so > that more modern lisps can use cl-ppcre+build-index while gcl can use > nregex+build-index. This seems quite feasible--and with a few tweaks, > the nregex regexes can be quite fast in gcl. Well, I can't tell you what to work on, but I have to say I'm not really happy about having two implementations of a large blob of code. Frankly I'm inclined to just forge ahead and if some new code doesn't suit GCL, then that's a reason not to use GCL. I guess if you want to extend nregex, then that's great, we can use nregex for all Lisp implementations. But let's avoid having two regex implementations. best Robert Dodier From marco.rofei at gmail.com Tue Feb 22 13:48:43 2011 From: marco.rofei at gmail.com (Marco Rofei) Date: Tue, 22 Feb 2011 20:48:43 +0100 Subject: [Maxima] Superscript In-Reply-To: <1298313812.2005.42.camel@UL80VT> References: <1298301399.2005.14.camel@UL80VT> <4D629745.5070403@eecs.berkeley.edu> <1298313812.2005.42.camel@UL80VT> Message-ID: <1298404123.1939.5.camel@UL80VT> After a bit of tries, I got this: (%i1) '\ ^"0"*A[5]; 0 (%o1) A 5 where 0 is zero, but I can't order them in order to have ^0 before A[..] Is there a way to reorder the expression? MR -------------- next part -------------- An HTML attachment was scrubbed... URL: From rjwiltsh at glam.ac.uk Tue Feb 22 02:02:59 2011 From: rjwiltsh at glam.ac.uk (Wiltshire R J (AT)) Date: Tue, 22 Feb 2011 08:02:59 +0000 Subject: [Maxima] Greek fonts In-Reply-To: References: <874DBF00-1082-4331-9C8C-ED1B96C31B2A@glam.ac.uk> Message-ID: <2944EE52-CB8D-42F9-9470-D13DFCC77771@glam.ac.uk> Thank you - it works fine! I did not realise it was necessary to use %. Ron On 21 Feb 2011, at 22:19, Andrej Vodopivec wrote: > Try with %gamma and %lambda. > > Andrej > > > > On Mon, Feb 21, 2011 at 10:42 AM, Wiltshire R J (AT) > wrote: >> Hi, >> >> I am running wxMaxima 0.8.5 (Maxima 5.21.1) but cannot get all the greek fonts ( eg lambda and small case gamma). Please can you help me out? >> >> >> Thanks - Ron Wiltshire >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> From ferriste at gmail.com Tue Feb 22 17:34:02 2011 From: ferriste at gmail.com (Stefano Ferri) Date: Wed, 23 Feb 2011 00:34:02 +0100 Subject: [Maxima] "rank" leads to a quotient by zero Message-ID: I have a matrix, called K and listed below, and I need to compute its rank. Here a strange thing happens: (%i3) rank(K); `quotient' by `zero' -- an error. To debug this try: debugmode(true); while (%i4) rank(ratsimp(K)); (%o4) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 12 (%i5) as it should be, 12 is the correct answer. I would always expect a result from rank, not an error, therefore I think this is a bug in some matrix-related subroutine, since the same error is present when I try to use K to solve a linear system (that do has a solution) with linsolve, on a system of equations generated starting from the same matrix. I'm using Maxima 5.23.2, compiled against the latest gcl, on Slackware 13.1. I'm sorry, the copy & paste for the following matrix (if somebody kindly wants to try) only works in wxMaxima, and not in a Maxima shell, due to the text format. Here is the matrix: K : matrix([1,0,0,0,0,0,0,0,0,0,0,0],[0,1,0,0,0,0,0,0,0,0,0,0], ? ? ? ? ? ? [0,0,1,0,0,0,0,0,0,0,0,0], ? ? ? ? ? ? [0,0,0, ? ? ? ? ? ? ?6*l^2*E*I/((sqrt(2)*l-l/sqrt(2))^2 ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? +6*E*I/l^3 ? ? ? ? ? ? ? +A*E/((l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2))+A*E/(2*l), ? ? ? ? ? ? ?3*2^(3/2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? -6*E*I/l^3 ? ? ? ? ? ? ? -l*A*E/(sqrt(2)*(sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2))+A*E/(2*l), ? ? ? ? ? ? ?3*sqrt(2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? +3*sqrt(2)*E*I/l^2, ? ? ? ? ? ? ?-6*l^2*E*I/((sqrt(2)*l-l/sqrt(2))^2 ? ? ? ? ? ? ? ? ? ? ? ? *(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? *((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? -A*E/((l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2)), ? ? ? ? ? ? ?l*A*E/(sqrt(2)*(sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? -3*2^(3/2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)), ? ? ? ? ? ? ?3*sqrt(2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)),0,0,0], ? ? ? ? ? ? [0,0,0, ? ? ? ? ? ? ?3*2^(3/2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? -6*E*I/l^3 ? ? ? ? ? ? ? -l*A*E/(sqrt(2)*(sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2))+A*E/(2*l), ? ? ? ? ? ? ?12*E*I/((l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? *((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? +6*E*I/l^3 ? ? ? ? ? ? ? +l^2*A*E/(2*(sqrt(2)*l-l/sqrt(2))^2 ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2))+A*E/(2*l), ? ? ? ? ? ? ?6*E*I/(sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? -3*sqrt(2)*E*I/l^2, ? ? ? ? ? ? ?l*A*E/(sqrt(2)*(sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? -3*2^(3/2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)), ? ? ? ? ? ? ?-12*E*I/((l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? -l^2*A*E/(2*(sqrt(2)*l-l/sqrt(2))^2 ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2)), ? ? ? ? ? ? ?6*E*I/(sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)),0,0,0], ? ? ? ? ? ? [0,0,0, ? ? ? ? ? ? ?3*sqrt(2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? +3*sqrt(2)*E*I/l^2, ? ? ? ? ? ? ?6*E*I/(sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? -3*sqrt(2)*E*I/l^2, ? ? ? ? ? ? ?4*E*I/sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2)+4*E*I/l, ? ? ? ? ? ? ?-3*sqrt(2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? *sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? *((sqrt(2)*l-l/sqrt(2))^2+l^2/2)), ? ? ? ? ? ? ?-6*E*I/(sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? *((sqrt(2)*l-l/sqrt(2))^2+l^2/2)), ? ? ? ? ? ? ?2*E*I/sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2),0,0,0], ? ? ? ? ? ? [0,0,0, ? ? ? ? ? ? ?-6*l^2*E*I/((sqrt(2)*l-l/sqrt(2))^2 ? ? ? ? ? ? ? ? ? ? ? ? *(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? *((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? -A*E/((l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2)), ? ? ? ? ? ? ?l*A*E/(sqrt(2)*(sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? -3*2^(3/2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)), ? ? ? ? ? ? ?-3*sqrt(2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? *sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? *((sqrt(2)*l-l/sqrt(2))^2+l^2/2)), ? ? ? ? ? ? ?6*l^2*E*I/((sqrt(2)*l-l/sqrt(2))^2 ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? +6*l^2*E*I/((l/sqrt(2)-sqrt(2)*l)^2 ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(l/sqrt(2)-sqrt(2)*l)^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ?*((l/sqrt(2)-sqrt(2)*l)^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? +A*E/((l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? +A*E/((l^2/(2*(l/sqrt(2)-sqrt(2)*l)^2)+1) ? ? ? ? ? ? ? ? ? ?*sqrt((l/sqrt(2)-sqrt(2)*l)^2+l^2/2)), ? ? ? ? ? ? ?3*2^(3/2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? +3*2^(3/2)*l*E*I/((l/sqrt(2)-sqrt(2)*l) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(l/sqrt(2)-sqrt(2)*l)^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((l/sqrt(2)-sqrt(2)*l)^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? -l*A*E/(sqrt(2)*(sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? -l*A*E/(sqrt(2)*(l/sqrt(2)-sqrt(2)*l) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(l/sqrt(2)-sqrt(2)*l)^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((l/sqrt(2)-sqrt(2)*l)^2+l^2/2)), ? ? ? ? ? ? ?-3*sqrt(2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? *sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? *((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? -3*sqrt(2)*l*E*I/((l/sqrt(2)-sqrt(2)*l) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt(l^2/(2*(l/sqrt(2)-sqrt(2)*l)^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((l/sqrt(2)-sqrt(2)*l)^2+l^2/2)),0,0,0], ? ? ? ? ? ? [0,0,0, ? ? ? ? ? ? ?l*A*E/(sqrt(2)*(sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? -3*2^(3/2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)), ? ? ? ? ? ? ?-12*E*I/((l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? -l^2*A*E/(2*(sqrt(2)*l-l/sqrt(2))^2 ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2)), ? ? ? ? ? ? ?-6*E*I/(sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? *((sqrt(2)*l-l/sqrt(2))^2+l^2/2)), ? ? ? ? ? ? ?3*2^(3/2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? +3*2^(3/2)*l*E*I/((l/sqrt(2)-sqrt(2)*l) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(l/sqrt(2)-sqrt(2)*l)^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((l/sqrt(2)-sqrt(2)*l)^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? -l*A*E/(sqrt(2)*(sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? -l*A*E/(sqrt(2)*(l/sqrt(2)-sqrt(2)*l) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(l/sqrt(2)-sqrt(2)*l)^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((l/sqrt(2)-sqrt(2)*l)^2+l^2/2)), ? ? ? ? ? ? ?12*E*I/((l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? *((sqrt(2)*l-l/sqrt(2))^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? +12*E*I/((l^2/(2*(l/sqrt(2)-sqrt(2)*l)^2)+1) ? ? ? ? ? ? ? ? ? ? ? *((l/sqrt(2)-sqrt(2)*l)^2+l^2/2)^(3/2)) ? ? ? ? ? ? ? +l^2*A*E/(2*(sqrt(2)*l-l/sqrt(2))^2 ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? +l^2*A*E/(2*(l/sqrt(2)-sqrt(2)*l)^2 ? ? ? ? ? ? ? ? ? ? ? ? ?*(l^2/(2*(l/sqrt(2)-sqrt(2)*l)^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt((l/sqrt(2)-sqrt(2)*l)^2+l^2/2)), ? ? ? ? ? ? ?-6*E*I/(sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? *((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? -6*E*I/(sqrt(l^2/(2*(l/sqrt(2)-sqrt(2)*l)^2)+1) ? ? ? ? ? ? ? ? ? ? ?*((l/sqrt(2)-sqrt(2)*l)^2+l^2/2)),0,0,0], ? ? ? ? ? ? [0,0,0, ? ? ? ? ? ? ?3*sqrt(2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)), ? ? ? ? ? ? ?6*E*I/(sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ?*((sqrt(2)*l-l/sqrt(2))^2+l^2/2)), ? ? ? ? ? ? ?2*E*I/sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2), ? ? ? ? ? ? ?-3*sqrt(2)*l*E*I/((sqrt(2)*l-l/sqrt(2)) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? *sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? *((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? -3*sqrt(2)*l*E*I/((l/sqrt(2)-sqrt(2)*l) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*sqrt(l^2/(2*(l/sqrt(2)-sqrt(2)*l)^2)+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?*((l/sqrt(2)-sqrt(2)*l)^2+l^2/2)), ? ? ? ? ? ? ?-6*E*I/(sqrt(l^2/(2*(sqrt(2)*l-l/sqrt(2))^2)+1) ? ? ? ? ? ? ? ? ? ? *((sqrt(2)*l-l/sqrt(2))^2+l^2/2)) ? ? ? ? ? ? ? -6*E*I/(sqrt(l^2/(2*(l/sqrt(2)-sqrt(2)*l)^2)+1) ? ? ? ? ? ? ? ? ? ? ?*((l/sqrt(2)-sqrt(2)*l)^2+l^2/2)), ? ? ? ? ? ? ?4*E*I/sqrt((sqrt(2)*l-l/sqrt(2))^2+l^2/2) ? ? ? ? ? ? ? +4*E*I/sqrt((l/sqrt(2)-sqrt(2)*l)^2+l^2/2),0,0,0], ? ? ? ? ? ? [0,0,0,0,0,0,0,0,0,1,0,0],[0,0,0,0,0,0,0,0,0,0,1,0], ? ? ? ? ? ? [0,0,0,0,0,0,0,0,0,0,0,1]); Thanks Stefano From ferriste at gmail.com Tue Feb 22 17:39:25 2011 From: ferriste at gmail.com (Stefano Ferri) Date: Wed, 23 Feb 2011 00:39:25 +0100 Subject: [Maxima] Segmentation fault with Maxima's "length" and gcl In-Reply-To: References: Message-ID: The same problem happens with: (%i1) submatrix(foo); 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. (%i2) submatrix(foo); Segmentation fault Stefano 2011/2/16 Stefano Ferri : > I was playing with two different Maxima builds, one made against gcl, the > other one compiled against clisp. > The following command: > > length("string"); > > that must produce an error, if repeated twice, causes gcl to produce a > segmentation fault and Maxima to exit. Moreover, the first time takes about > 2 seconds to get the error, while with clisp the error message is displayed > immediately, and no segfault is produced by further errors. > > > Maxima and Gcl > > (%i2) length("string"); > > 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. > > (%i3) length("string"); > Segmentation fault > ste at localhost:~/build/maxima-5.23.2$ > > > > Maxima and Clisp: > > (%i4) length("string"); > Maxima encountered a Lisp error: > > > CAR: #1="string" is not a list > > Automatically continuing. > To enable the Lisp debugger set *debugger-hook* to nil. > > > I'm using the latest cvs version of gcl and Maxima 5.23.2, on Slackware > Gnu/Linux 13.1. > > > Stefano > > From pbowyer at olynet.com Tue Feb 22 18:55:04 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Tue, 22 Feb 2011 16:55:04 -0800 Subject: [Maxima] Trying to build maxima from CVS In-Reply-To: References: <4D601C4F.9000506@olynet.com> <4D602E37.7090302@gmail.com> <4D605128.8030300@olynet.com> Message-ID: <4D645AE8.6090104@olynet.com> On 02/22/2011 08:33 AM, Robert Dodier wrote: > On 2/19/11, Leo Butler wrote: > >> However, I think that cl-ppcre simply uses features of common lisp that >> gcl does not support. Rather than try to shoehorn cl-ppcre into an ill >> fitting gcl shoe, I've been working on extending the nregex code so >> that more modern lisps can use cl-ppcre+build-index while gcl can use >> nregex+build-index. This seems quite feasible--and with a few tweaks, >> the nregex regexes can be quite fast in gcl. > Well, I can't tell you what to work on, but I have to say I'm > not really happy about having two implementations of a large > blob of code. > > Frankly I'm inclined to just forge ahead and if some new code > doesn't suit GCL, then that's a reason not to use GCL. > > I guess if you want to extend nregex, then that's great, > we can use nregex for all Lisp implementations. > But let's avoid having two regex implementations. > > best > > Robert Dodier > Robert: I, for one, am pleased that Leo is putting the effort into keeping GCL viable with Maxima even if it's not the mainstream distribution. From my standpoint as a not-so-capable Maxima user, I find GCL the fastest of the lisps I've used with Maxima and I think it would be a loss to see it phased out. I'm not knowledgeable enough to know the intricacies of what it would take to keep GCL up to date with other lisps, but maybe if some of the experts on the Maxima mailing list were to ask Camm Maguire nicely, some progress could be made in that direction. In general, I've found that where there's a need, there's usually a solution forthcoming... By the way, I've begun to look at the lisp programming language by installing 'slime' for use with 'emacs' to go through a lisp tutorial I've discovered. The language looks intriguing, but quite different from other languages I've tried. I wonder how long it will take me to get somewhat proficient with lisp so I can actually do something usable. Emacs seems to be the most complex editor I've ever used and that's a learning experience all by itself. Paul From l.butler at ed.ac.uk Tue Feb 22 21:07:40 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 23 Feb 2011 03:07:40 +0000 (GMT) Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch Message-ID: < Robert Dodier Tue Feb 22 00:34:35 CST 2011 wrote: < On 2/21/11, Leo Butler wrote: < < > Robert, what do you mean by 'incorrect'? < > < > Do you mean the text is displayed incorrectly or do < > you mean that the displayed text is incorrect? < < In doc/info/{es,pt}/maxima-index.lisp (i.e. non-UTF-8) < special characters are replaced by '?' (ascii 077). < Robert, I think what you are seeing there is that your lisp is using a utf-8 external format (encoding), and #\? is the replacement char for non-printables. Based on this hunch, I've pushed a patch for build-index.lisp that uses the external format in the master info file to read the info files and write the hash tables. Does this fix the issue you see? Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From leon.magiera at wp.pl Wed Feb 23 01:41:01 2011 From: leon.magiera at wp.pl (leon.magiera at wp.pl) Date: Wed, 23 Feb 2011 08:41:01 +0100 Subject: [Maxima] equation Message-ID: <4d64ba0d694c71.50880611@wp.pl> Hi All, Given: solve((abs(q)*abs(4*Q+(2^(3/2)+1)*q))/(8*%pi*a^2*abs(eps0)),Q) Is the above eq. to hard ? Regards L. From villate at fe.up.pt Wed Feb 23 05:39:01 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 23 Feb 2011 11:39:01 +0000 Subject: [Maxima] Superscript In-Reply-To: <1298404123.1939.5.camel@UL80VT> References: <1298301399.2005.14.camel@UL80VT> <4D629745.5070403@eecs.berkeley.edu> <1298313812.2005.42.camel@UL80VT> <1298404123.1939.5.camel@UL80VT> Message-ID: <1298461141.1981.3.camel@wigner> On Tue, 2011-02-22 at 20:48 +0100, Marco Rofei wrote: > After a bit of tries, I got this: > > (%i1) '\ ^"0"*A[5]; > 0 > (%o1) A > 5 > > where 0 is zero, but I can't order them in order to have ^0 before > A[..] > > Is there a way to reorder the expression? If it is for display only, try this: (%i3) prefix("?"); (%o3) ? (%i4) ?A[5]; (%o4) ? A 5 Assuming you are using UTF8. In my keyboard I obtain the superscript 0 unicode character by pressing ^ followed by 0. You might also look up a Unicode table and cut and paste the superscript you need. Regards, Jaime From willisb at unk.edu Wed Feb 23 05:56:02 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 23 Feb 2011 05:56:02 -0600 Subject: [Maxima] equation Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >?????solve((abs(q)*abs(4*Q+(2^(3/2)+1)*q))/(8*%pi*a^2*abs(eps0)),Q) > >Is?the?above?eq.?to?hard?? The optional package to_poly_solver has a function that will solve this equation: ?(%i1) load(to_poly_solver)$ ??Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:49 $ ?(%i2) sol : %solve((abs(q)*abs(4*Q+(2^(3/2)+1)*q))/(8*%pi*a^2*abs(eps0)),Q)$ The solution is lengthy and has (redundant) conditions on the parameters. Let's tell Maxima that eps0 # 0, q # 0 and re-simplify: ?(%i3) assume(notequal(eps0,0),notequal(q,0)); ?(%o3) [notequal(eps0,0),notequal(q,0)] To re-simplify, use the (undocumented, I think) trick ? ?(%i4) expand(sol,0,0); ?(%o4) %union([Q=-((2^(3/2)+1)*q)/4]) Your equation is equivalent to 4*Q+(2^(3/2)+1)*q = 0. Since this equation is linear in Q, all the conditionals in sol should simplify to true automatically, I think. We should alert the author of to_poly_solve (and that would be me). --Barton ?? From jalaludn at gmail.com Wed Feb 23 07:09:25 2011 From: jalaludn at gmail.com (Jalaluddin Morris) Date: Wed, 23 Feb 2011 21:09:25 +0800 Subject: [Maxima] The Discreet Charm of Setting Divide by Zero Equal to Zero (II) Message-ID: <4D650705.2090008@gmail.com> Dear List Members, First, thanks to Robert Dodier for a solution to my problem. As for General Proof I have attached a picture, so that you will be able to recognize him if you ever run across him. Note that, as with many other general officers, he likes to smoke cigars. Regards, Jalaluddin -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ProofGeneral.jpg Type: image/jpeg Size: 16123 bytes Desc: not available URL: From villate at fe.up.pt Wed Feb 23 08:04:18 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 23 Feb 2011 14:04:18 +0000 Subject: [Maxima] equation In-Reply-To: References: Message-ID: <1298469858.3161.5.camel@wigner> On Wed, 2011-02-23 at 05:56 -0600, Barton Willis wrote: > (%i1) load(to_poly_solver)$ > Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:49 $ > > (%i2) sol : %solve((abs(q)*abs(4*Q+(2^(3/2)+1)*q))/(8*% > pi*a^2*abs(eps0)),Q)$ Hi Barton, I had tried that, but unfortunately, I wrote, instead of %i1: load(topoly_solver)$ which lead to no solutions. I then corrected the mistake and loaded to_poly_solver, but then I got only one solution: (%o4) [[Q = -(2^(3/2)+1)*q/4]] To get the solution you got, I had to restart Maxima and load only to_poly_solver. Shouldn't topoly_solver be removed or renamed to avoid confusion? The fact that they are not documented in the manual do not help either. Cheers, Jaime From doug.dastew at gmail.com Wed Feb 23 09:56:56 2011 From: doug.dastew at gmail.com (Doug Stewart) Date: Wed, 23 Feb 2011 10:56:56 -0500 Subject: [Maxima] plotting data that is in an array Message-ID: Hi I have an array that is holding some bfloat numbers and I want to plot them. I tried: plot2d(difar[x],[x,1,200]); plot2d: expression evaluates to non-numeric value somewhere in plotting range. but no plot shows up. difar has made with array(difar,270); and was filled in a for loop with difar[k]:ar[k]-z, How do you plot this array? Doug Stewart -------------- next part -------------- An HTML attachment was scrubbed... URL: From l.butler at ed.ac.uk Wed Feb 23 10:56:02 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 23 Feb 2011 16:56:02 +0000 (GMT) Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits Message-ID: < On 02/21/2011 03:24 PM, Raymond Toy wrote: < > On 2/21/11 1:49 PM, Robert Dodier wrote: < >> I know there are other systems we could use, other than Git, < >> but Git is the only one that has gotten any traction with the < >> Maxima developers, from what I can tel < >> < >> Can somebody figure out how to change over from CVS to Git < >> and explain the plan to us and then carry it out? < > Since Leo has already done it, perhaps he is in the best position. I < > recently converted a cvs repo on sourceforge to git using "git < > cvsimport". Worked pretty well and preserved the logs, branches, and < > tags. Using gitk --all on Leo's git repo seems to show that < > everything < > is preserved. Didn't check in detail, though. < > < > The only thing I would like to see is that real names and emails be < > imported into git, at least for the currently "active" developers. < < Caution is required here. I have converted several different CVS < repositories to git over the past few years. I found that git-cvsimport < always *appeared* to work, but *often* produced git checkouts that were < subtly different from the cvs versions. In fact, I think I was < experimenting with the Maxima repository when I first noticed that my < git version didn't match up with the cvs version. < < The last time I tried to use git-cvsimport was a couple of years ago, so < it may be that it has been substantially improved in the meantime. < However, I looked into fixing it myself at the time and learned that the < extraction of historical cvs data from a cvs repository is much more < complicated than I had ever dreamed. In the end, I used the git-ized < version of cvs2svn to do conversions. I have found that to be much more < reliable, even though I have had to tweak it a little from time to time. < < I sent Robert a private email volunteering to help with the maxima < cvs-git conversion a little while ago, but haven't found time to follow < up. (Sorry about that, Robert.) It appears that the time is now, < however. Here is what I suggest: < < 1) Carefully check that the current CVS version is identical to the < git-cvsimport version. I.e., do a recursive diff on checked-out copies < of both. < 2) Repeat (1) for the past n-releases, where n is limited by patience. < < If (1) and (2) pass, git-cvsimport has been greatly improved and you < should carry on with the plan. If not, somebody should try using cvs2svn < to do the conversion. I would be happy to do it if someone can point me < to the tarball of the cvs files (the repository, not just a checkout.) < (Obviously, I used to know how to get that, but it's been a while.) < < --Jim < Following Jim's advice, I wrote a little script that implements (1-2) to check the faithfulness of git cvsimport. I ran the script on the latest release, and the diff file is attached along with the script. Essentially, cvsimport changed 4 files by changing header info in 2 and adding \015 and \032 characters in two other files. No files were added or deleted. I don't know, but this seems minor and easily fixed (copy and commit). I am running the test over all branches at the moment. It would be useful if a few other folks would take a look at the script to see if I've missed something, and to run the test. Leo I ran the test as follows: in $PWD, there are subdirectories cvs-maxima-temp and git-maxima-temp holding the respective repositories, and the script check-repos.sh. I ran the script with the command line: BRANCH=version-5_23_2 ./check-repos.sh ./cvs-maxima-temp ./git-maxima-temp to check an individual branch; to check all branches do ./check-repos.sh ./cvs-maxima-temp ./git-maxima-temp -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. -------------- next part -------------- A non-text attachment was scrubbed... Name: check-repos.sh Type: application/x-sh Size: 2376 bytes Desc: script URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: repos-version-5_23_2.diff Type: text/x-diff Size: 3484 bytes Desc: URL: From leon.magiera at wp.pl Wed Feb 23 11:36:09 2011 From: leon.magiera at wp.pl (leon.magiera at wp.pl) Date: Wed, 23 Feb 2011 18:36:09 +0100 Subject: [Maxima] equation In-Reply-To: References: Message-ID: <4d6545896d7335.22435271@wp.pl> Barton, thanks for help, Leon P.S. In the attached file are solutions returned by Mathematica and DERIVE Dnia 23-02-2011 o godz. 12:56 Barton Willis napisa?(a): > -----maxima-bounces at math.utexas.edu wrote: ----- > > >?????solve((abs(q)*abs(4*Q+(2^(3/2)+1)*q))/(8*%pi*a^2*abs(eps0)),Q) > > > >Is?the?above?eq.?to?hard?? > > The optional package to_poly_solver has a function that will solve this > equation: > > ?(%i1) load(to_poly_solver)$ > ??Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:49 $ > > ?(%i2) sol : > %solve((abs(q)*abs(4*Q+(2^(3/2)+1)*q))/(8*%pi*a^2*abs(eps0)),Q)$ > > The solution is lengthy and has (redundant) conditions on the > parameters. Let's > tell Maxima that eps0 # 0, q # 0 and re-simplify: > > ?(%i3) assume(notequal(eps0,0),notequal(q,0)); > ?(%o3) [notequal(eps0,0),notequal(q,0)] > > To re-simplify, use the (undocumented, I think) trick > ? > ?(%i4) expand(sol,0,0); > ?(%o4) %union([Q=-((2^(3/2)+1)*q)/4]) > > Your equation is equivalent to 4*Q+(2^(3/2)+1)*q = 0. Since this > equation is linear in Q, all the > conditionals in sol should simplify to true automatically, I think. We > should alert the author of > to_poly_solve (and that would be me). > > > --Barton > ?? -------------- next part -------------- A non-text attachment was scrubbed... Name: LM_sol.doc Type: application/msword Size: 27136 bytes Desc: not available URL: From l.butler at ed.ac.uk Wed Feb 23 14:21:44 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 23 Feb 2011 20:21:44 +0000 (GMT) Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits In-Reply-To: References: Message-ID: < < < Caution is required here. I have converted several different CVS < < repositories to git over the past few years. I found that git-cvsimport < < always *appeared* to work, but *often* produced git checkouts that were < < subtly different from the cvs versions. In fact, I think I was < experimenting < with the Maxima repository when I first noticed that my < git version didn't < match up with the cvs version. < Following Jim's advice, I wrote a little script that implements (1-2) < to check the faithfulness of git cvsimport. I ran the script on the < latest release, and the diff file is attached along with the script. < I am running the test over all branches at the moment. I have put the diff files in http://www.maths.ed.ac.uk/~lbutler/cvs-git/ You will see that Jim's cautious words are borne out. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From jalaludn at gmail.com Wed Feb 23 18:30:44 2011 From: jalaludn at gmail.com (Jalaluddin Morris) Date: Thu, 24 Feb 2011 08:30:44 +0800 Subject: [Maxima] Setting Divide by Zero Equal to Zero in Maxima In-Reply-To: <4D6524DF.2050601@eecs.berkeley.edu> References: <4D63AB3F.5030501@gmail.com> <4D63D3FE.2010409@eecs.berkeley.edu> <4D64FD77.8010500@gmail.com> <4D6524DF.2050601@eecs.berkeley.edu> Message-ID: <4D65A6B4.4010208@gmail.com> Dear Professor, Are you suggesting that Isabelle/HOL, Moore and Penrose have gone " "... off the tracks without notice". " ? Where is the wreckage? Regards, Jalaluddin --------------------------------------------------------------------------------------------- The following correspondence is in reverse chronological order: --------------------------------------------------------------------------------------------- On 23/02/11 23:16 PM, Richard Fateman wrote: > On 2/23/2011 4:28 AM, Jalaluddin Morris wrote: >> Dear Professor, >> >> I deny saying that "... the following theorem a/b + c/d = (a ? d + b >> ? c)/(b ? d) becomes false." - in fact I used word "inoperative". > Substituting the word "inoperative" for "false" in my statement does > not change the fact that this is quite a loss. > >> As for "quite a loss", where is the relative gain from (1 / 0 >> undefined) causing Maxima to stop dead in its tracks, or (1 / 0 = >> infinity) - > If you wish to redefine division so that 1/0 becomes infinity, that > can be tolerated in some models of arithmetic. (See for example, > discussion of the IEEE floating-point system!) That does not imply 0/0 > is infinity. To change x/0 to 0 is to provide an alternative > to "stop dead in its tracks" that is "to go off the tracks without > notice". > >> useful if we wish to compactify the reals > If you said x/0 is changed to infinity for x>0, or perhaps any > non-zero x, that's possibly ok. for x/0 -> 0, that's news to me. >> (but does Maxima need to?)? > Who knows. One can also carry around (x/0) in one's calculations > like a raisin in a cookie, at least for a while. > If someone multiplies it by zero, it will probably go away. > RJF >> >> Regards, >> >> Jalaluddin >> >> ************************************************************************** >> >> >> On 22/02/11 23:19 PM, Richard Fateman wrote: >>> On 2/22/2011 4:25 AM, Jalaluddin Morris wrote: >>>> Dear List Members, >>>> >>>> I have attached a pdf addressing the question as to why one might wish >>>> to have the option of x / 0 = 0 in Maxima. >>>> >>>> On the subject of Isabelle/Hol, members may wish to download the >>>> software from >>>> http://www.cl.cam.ac.uk/research/hvg/Isabelle/ >>>> and familiarize themselves with the GUI, despite the steep learning >>>> curve. >>>> >>>> Regards, >>>> >>>> Jalaluddin >>>> >>> >>> As your paper says, the following theorem >>> >>> a/b + c/d = (a ? d + b ? c)/(b ? d) >>> >>> becomes false. That is quite a loss. My suggestion is that you change >>> your computation and not use "/" but some other notation, and then >>> define what you means by it through programs and perhaps tellsimp. >>> >>> RJF >>> >>> >> ************************************************************************** >> > > -------------------------------------------------------------------- from: Jalaluddin Morris 23/02/11 20:28 PM Re: [Maxima] Setting Divide by Zero Equal to Zero in Maxima Dear Professor, I deny saying that "... the following theorem a/b + c/d = (a ? d + b ? c)/(b ? d) becomes false." - in fact I used word "inoperative". As for "quite a loss", where is the relative gain from (1 / 0 undefined) causing Maxima to stop dead in its tracks, or (1 / 0 = infinity) - useful if we wish to compactify the reals (but does Maxima need to?)? Regards, Jalaluddin -------------------------------------------------------------------- from: Richard Fateman 22/02/11 23:19 PM subject: Re: [Maxima] Setting Divide by Zero Equal to Zero in Maxima On 2/22/2011 4:25 AM, Jalaluddin Morris wrote: > Dear List Members, > > I have attached a pdf addressing the question as to why one might wish > to have the option of x / 0 = 0 in Maxima. > > On the subject of Isabelle/Hol, members may wish to download the > software from > http://www.cl.cam.ac.uk/research/hvg/Isabelle/ > and familiarize themselves with the GUI, despite the steep learning > curve. > > Regards, > > Jalaluddin > As your paper says, the following theorem a/b + c/d = (a ? d + b ? c)/(b ? d) becomes false. That is quite a loss. My suggestion is that you change your computation and not use "/" but some other notation, and then define what you means by it through programs and perhaps tellsimp. RJF From fateman at eecs.berkeley.edu Wed Feb 23 18:48:23 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 23 Feb 2011 16:48:23 -0800 Subject: [Maxima] Setting Divide by Zero Equal to Zero in Maxima In-Reply-To: <4D65A6B4.4010208@gmail.com> References: <4D63AB3F.5030501@gmail.com> <4D63D3FE.2010409@eecs.berkeley.edu> <4D64FD77.8010500@gmail.com> <4D6524DF.2050601@eecs.berkeley.edu> <4D65A6B4.4010208@gmail.com> Message-ID: <4D65AAD7.3000703@eecs.berkeley.edu> On 2/23/2011 4:30 PM, Jalaluddin Morris wrote: > Dear Professor, > > Are you suggesting that Isabelle/HOL, Moore and Penrose have gone " > "... off the tracks without notice". " ? It is far more plausible, in my opinion, that you are mischaracterizing these programs or systems. For example, from the Isabelle documentation, "Isabelle comes with a large theory library of formally verified mathematics, including elementary number theory (for example, Gauss's law of quadratic reciprocity), analysis (basic properties of limits, derivatives and integrals), algebra (up to Sylow's theorem) ..." Now if Isabelle cannot add a/b+c/d correctly, that seems to me to be a serious issue. > > Where is the wreckage? Maybe under the bridge, next to you and the troll? RJF From amundson at users.sourceforge.net Wed Feb 23 22:03:24 2011 From: amundson at users.sourceforge.net (James Amundson) Date: Wed, 23 Feb 2011 22:03:24 -0600 Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits In-Reply-To: References: Message-ID: <4D65D88C.4090401@users.sourceforge.net> On 02/23/2011 02:21 PM, Leo Butler wrote: > > > < < < Caution is required here. I have converted several different CVS< > < repositories to git over the past few years. I found that git-cvsimport< > < always *appeared* to work, but *often* produced git checkouts that were< > < subtly different from the cvs versions. In fact, I think I was< experimenting > < with the Maxima repository when I first noticed that my< git version didn't > < match up with the cvs version. > > < Following Jim's advice, I wrote a little script that implements (1-2) > < to check the faithfulness of git cvsimport. I ran the script on the > < latest release, and the diff file is attached along with the script. > < I am running the test over all branches at the moment. > > I have put the diff files in > > http://www.maths.ed.ac.uk/~lbutler/cvs-git/ > > You will see that Jim's cautious words are borne out. Thank you for doing all the detailed testing. I'm glad to see, at least, that I didn't send you on a wild goose chase. I did the cvs2git translation of a maxima cvs tarball that Ray pointed me to. He said: > I think this was > my monthly backup done on 2011-01-15. But for playing around, it > doesn't matter the exact date as long as it's fairly recent. Also, I didn't attempt to get the email addresses right in this conversion. If we decide that the cvs2git translation produces otherwise satisfactory results the addresses can be fixed. Please apply your tests to this git repository: http://amundson-long.net/maxima.git.tar.bz2 and let us know what happens. --Jim From robert.dodier at gmail.com Thu Feb 24 01:01:16 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 24 Feb 2011 00:01:16 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: On 2/22/11, Leo Butler wrote: > Robert, I think what you are seeing there is that your lisp is > using a utf-8 external format (encoding), and #\? > is the replacement char for non-printables. > > Based on this hunch, I've pushed a patch for build-index.lisp > that uses the external format in the master info file to > read the info files and write the hash tables. Does this > fix the issue you see? As it stands it fails to build maxima-index.lisp, with different error messages for SBCL and Clisp. I've pasted the messages for doc/info/es below. Same error in doc/info/pt. In es.utf8 and pt.utf8, I guess it could succeed w/ SBCL but Clisp is the default for maxima-local so that's what gets called by the Makefile and it fails since Clisp doesn't recognize :UTF-8. What Lisp are you using and what OS ? Does the current code work as expected? best Robert Dodier PS. error message for SBCL: robert at robert-laptop:~/maxima/maxima-ppcre-index-branch/Maxima-CAS/doc/info/es$ ../../../maxima-local -l sbcl --very-quiet --init=/dev/null --batch-string='setup_help_database();print_help_database("maxima-index.lisp");' setup_help_database() Maxima encountered a Lisp error: Error during processing of --eval option "(cl-user::run)": decoding error on stream # (:EXTERNAL-FORMAT :UTF-8): the octet sequence (243 110 32 84) cannot be decoded. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. print_help_database(maxima-index.lisp) WARNING: Info files have multiple external formats. Info database may be corrupted. Maxima encountered a Lisp error: Error during processing of --eval option "(cl-user::run)": The value :UTF-8 is not of type LIST. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. PPS. error message for Clisp: robert at robert-laptop:~/maxima/maxima-ppcre-index-branch/Maxima-CAS/doc/info/es$ ../../../maxima-local -l clisp --very-quiet --init=/dev/null --batch-string='setup_help_database();print_help_database("maxima-index.lisp");' setup_help_database() Maxima encountered a Lisp error: OPEN: illegal :EXTERNAL-FORMAT argument :UTF-8 Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. print_help_database(maxima-index.lisp) WARNING: Info files have multiple external formats. Info database may be corrupted. Maxima encountered a Lisp error: CAR: :UTF-8 is not a list Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. From maceditor at softpedia.com Wed Feb 23 19:09:02 2011 From: maceditor at softpedia.com (Softpedia Editorial Team) Date: Wed, 23 Feb 2011 20:09:02 -0500 (EST) Subject: [Maxima] Maxima included in the Softpedia Mac OS software database Message-ID: <20110224010902.9046C1B76494@ipdmjg0035atl2.pubip.peer1.net> Hello, As you may already know, Maxima, one of your products, is part of Softpedia's database of software programs for Mac OS. It is featured with a description text, screenshots, download links and technical details on this page: http://mac.softpedia.com/get/Math-Scientific/Maxima.shtml The description text was created by our editors, using sources such as text from your product's homepage, information from its help system, the PAD file (if available) and the editor's own opinions on the program itself. "Maxima" has been tested in the Softpedia labs using several industry-leading security solutions and found to be completely clean of adware/spyware components. We are impressed with the quality of your product and encourage you to keep these high standards in the future. To assure our visitors that Maxima is clean, we have granted it with the "100% FREE" Softpedia award. To let your users know about this certification, you may display this award on your website, on software boxes or inside your product. More information about your product's certification and the award is available on this page: http://mac.softpedia.com/progClean/Maxima-Clean-24761.html Feel free to link to us using the URLs above. If you choose to link to the clean award page for your product, you may use the award graphic or a text link: "100% FREE award granted by Softpedia". If you feel that having your product listed on Softpedia is not a benefit for you or simply need something changed or updated, please contact us via email at webmaster at softpedia.com and we will work with you to fix any problem you may have found with the product's listing. -- Sincerely, The Softpedia Team ----------------------------------------------------------------------- Softpedia is a library of over 400,000 free and free-to-try software programs for Windows, Mac OS and Linux, games and gaming tools, Windows device drivers, mobile devices and IT-related articles. ----------------------------------------------------------------------- Softpedia - the encyclopedia of free software downloads http://www.softpedia.com/ From icnc-fskd-cfp at dhu.edu.cn Wed Feb 23 05:30:57 2011 From: icnc-fskd-cfp at dhu.edu.cn (Bing Li) Date: Wed, 23 Feb 2011 19:30:57 +0800 Subject: [Maxima] (IEEE Xplore/Ei Compendex) ICNC'11-FSKD'11 Extended Submission Deadline 10 March: Shanghai, China Message-ID: <498461391.31649@eyou.net> Dear Colleague, Topics of the FSKD 2011 Special Track on Information Technology for Knowledge Discovery include (but are not limited to): data engineering, automation, software engineering, communications and networking, computer applications, etc.. Upon numerous requests, the 7th International Conference on Natural Computation (ICNC'11) and the 8th International Conference on Fuzzy Systems and Knowledge Discovery (FSKD'11) extend the submission deadline to 10 March 2011. We cordially invite you to submit a paper or invited session proposal to the conferences, to be jointly held from 26-28 July 2011, in Shanghai, China. Shanghai is the largest city in China, with famous historical and cultural heritage. Attractions include Yuyuan Garden ("Happy Garden" built in Ming Dynasty), Shanghai Museum with 120,000 pieces of rare relics, Shanghai World Financial Center, Jade Buddha Temple (Song Dynasty), Oriental Pearl TV Tower, Zhujiajiao Water Town, and Expo 2010 site. All papers in conference proceedings will be indexed by both EI Compendex and ISTP, as well as included in the IEEE Xplore (IEEE Conference Record Number for ICNC?11: 18082; IEEE Conference Record Number for FSKD?11: 18083). Extended versions of selected best papers will appear in an ICNC-FSKD special issue of International Journal of Intelligent Systems, an SCI-indexed journal (Impact Factor: 1.194). ICNC-FSKD is a premier international forum for scientists and researchers to present the state of the art of data mining and intelligent methods inspired from nature, particularly biological, linguistic, and physical systems, with applications to signal processing, design, and more. Previously, the joint conferences in 2005 through 2010 each attracted over 3000 submissions from around the world. ICNC'11-FSKD'11 is technically co-sponsored by the IEEE Circuits and Systems Society. The registration fee of US*D 390 includes proceedings, lunches, dinners, banquet, coffee breaks, and all technical sessions. To promote international participation of researchers from outside the country/region where the conference is held (i.e., China?s mainland), researchers outside of China?s mainland are encouraged to propose invited sessions. The first author of each paper in an invited session must not be affiliated with an organization in China?s mainland. All papers in the invited sessions can be marked as "Invited Paper". One organizer for each invited session with at least 6 registered papers will enjoy an honorarium of US*D 400. Invited session organizers will solicit submissions, conduct reviews and recommend accept/reject decisions on the submitted papers. Invited session organizers will be able to set their own submission and review schedules, as long as a list of recommended papers is determined by 30 March 2010. Each invited session proposal should include: (1) the name, bio, and contact information of each organizer of the invited session; (2) the title and a short synopsis of the invited session. Please send your proposal to icnc-fskd at dhu.edu.cn For more information, visit the conference web page: http://icnc-fskd.dhu.edu.cn If you have any questions after visiting the conference web page, please email the secretariat at icnc-fskd at dhu.edu.cn Join us at this major event in exciting Shanghai !!! Organizing Committee icnc-fskd at dhu.edu.cn P.S.: Kindly forward to your colleagues and students in your school/department. If you wish to unsubscribe, in which case we apologize, please reply with " unsubscribe maxima at math.utexas.edu " in your email subject. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlakelan at street-artists.org Thu Feb 24 11:24:08 2011 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 24 Feb 2011 09:24:08 -0800 Subject: [Maxima] Matching and dropping terms Message-ID: <4D669438.30305@street-artists.org> I often use Maxima to evaluate equations designed to model physical systems. In this process, I derive some equation, choose some signficant scales for the dimensional variables, and nondimensionalize the equation. At this point it is convenient to drop out lots of very small things when the known numerical constants indicate that they are purely small perturbations to a more important effect. A typical thing I'd like to do is take the equation which is expressed as a sum of various terms, and check each term to see if it has something of the form: stuff*(nonsense + tinything * X + othersmallthing * Y) where "stuff" might contain derivatives of X or Y but will not contain X or Y by themselves. I'd like to write a matching function which would match this type of thing but I can't figure out how to make it work. here's an example: 'diff(X,t)*(3*gamma+6*beta + epsilon1 * X ) this should match as [stuff='diff(X,t), nonsense=3*gamma+6*beta, tinything = epsilon1, othersmallthing=0] or something like that. any hints on how to get this sort of thing to work? Everything I've tried tends to simply return false except in very simple test cases that have nothing to do with the real world application.. From dlakelan at street-artists.org Thu Feb 24 11:31:32 2011 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 24 Feb 2011 09:31:32 -0800 Subject: [Maxima] Matching and dropping terms In-Reply-To: <4D669438.30305@street-artists.org> References: <4D669438.30305@street-artists.org> Message-ID: <4D6695F4.8090902@street-artists.org> On 02/24/2011 09:24 AM, dlakelan wrote: > or something like that. any hints on how to get this sort of thing to > work? Everything I've tried tends to simply return false except in very > simple test cases that have nothing to do with the real world application.. ARGH of course I just restarted maxima and used a blank file to do some testing and found the following worked, which didn't work before (here it's a rule instead of a matching but it's the same concept). I suspect that my Maxima was simply polluted with some extra variables that were evaluating to something I didn't expect. (%i2) matchdeclare(a,true,[b,c], lambda([x],freeof(X,Y,x) or not(freeof('diff(X,y),'diff(Y,y),x)))); (%o2) done (%i3) defrule(dropsmall,b*X + c*Y+a,a); (%o3) dropsmall : c Y + b X + a -> a (%i4) dropsmall('diff(X,y)*(1+5*q + (3+a)*X)); dX (%o4) (5 q + 1) -- dy (%i5) dropsmall('diff(X,y)*'diff(Y,y)*(1+5*q+(3+a)*X + (3+b)*Y)); dX dY (%o5) (5 q + 1) -- -- dy dy From ferriste at gmail.com Thu Feb 24 11:32:15 2011 From: ferriste at gmail.com (Stefano Ferri) Date: Thu, 24 Feb 2011 18:32:15 +0100 Subject: [Maxima] linsolve_by_lu not documented Message-ID: I have just noticed that the function linsolve_by_lu is not documented. Can somebody fix this please? Thanks, Stefano From macrakis at alum.mit.edu Thu Feb 24 12:10:38 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 24 Feb 2011 13:10:38 -0500 Subject: [Maxima] Matching and dropping terms In-Reply-To: <4D669438.30305@street-artists.org> References: <4D669438.30305@street-artists.org> Message-ID: Depending on the form of your expressions, you may want to try taylor or the ratweight scheme to do this sort of thing. Those would both allow you to straightforwardly keep (for example) first-order tiny1 and tiny2 terms, but reduce tiny1^2 or tiny1*tiny2 to 0. -s On Thu, Feb 24, 2011 at 12:24, dlakelan wrote: > I often use Maxima to evaluate equations designed to model physical > systems. In this process, I derive some equation, choose some signficant > scales for the dimensional variables, and nondimensionalize the equation. > > At this point it is convenient to drop out lots of very small things when > the known numerical constants indicate that they are purely small > perturbations to a more important effect. > > A typical thing I'd like to do is take the equation which is expressed as a > sum of various terms, and check each term to see if it has something of the > form: > > stuff*(nonsense + tinything * X + othersmallthing * Y) > > where "stuff" might contain derivatives of X or Y but will not contain X or > Y by themselves. > > I'd like to write a matching function which would match this type of thing > but I can't figure out how to make it work. here's an example: > > 'diff(X,t)*(3*gamma+6*beta + epsilon1 * X ) > > this should match as > > [stuff='diff(X,t), nonsense=3*gamma+6*beta, tinything = epsilon1, > othersmallthing=0] > > or something like that. any hints on how to get this sort of thing to work? > Everything I've tried tends to simply return false except in very simple > test cases that have nothing to do with the real world application.. > > _______________________________________________ > 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 Feb 24 12:22:04 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 24 Feb 2011 19:22:04 +0100 Subject: [Maxima] plotting data that is in an array In-Reply-To: References: Message-ID: <1298571724.2743.4.camel@pc> El mi?, 23-02-2011 a las 10:56 -0500, Doug Stewart escribi?: > > Hi > > > I have an array that is holding some bfloat numbers and I want to plot > them. > > > I tried: > plot2d(difar[x],[x,1,200]); > plot2d: expression evaluates to non-numeric value somewhere in > plotting range. > > > but no plot shows up. > > > difar has made with > array(difar,270); > > > and was filled in a for loop with > difar[k]:ar[k]-z, > Hello, With graphic object 'points' of package draw you can plot lisp arrays, those created by 'make_array'. In case you are interested, describe(points) will show you some examples. -- Mario From dlakelan at street-artists.org Thu Feb 24 12:28:39 2011 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 24 Feb 2011 10:28:39 -0800 Subject: [Maxima] Matching and dropping terms In-Reply-To: References: <4D669438.30305@street-artists.org> Message-ID: <4D66A357.8060700@street-artists.org> On 02/24/2011 10:10 AM, Stavros Macrakis wrote: > Depending on the form of your expressions, you may want to try taylor or > the ratweight scheme to do this sort of thing. Those would both allow > you to straightforwardly keep (for example) first-order tiny1 and tiny2 > terms, but reduce tiny1^2 or tiny1*tiny2 to 0. In this case I am only interested in dropping things which are perturbations to a larger effect. so for example: stuff*(BIG + small*X + small2*Y) -> stuff*BIG but stuff*(small*X + small2*Y) -> stuff*(small*X + small2*Y) In general, I'm determining whether there exists a big constant effect by subbing in some estimates of the numerical constants and seeing if abs(BIG/small) > 100 (for example) hence, in general the need for a match so that I can grab the pieces and evaluate their numerical size. I don't think the ratweight and taylor solutions could do this particular task since whether to drop the perturbations depends on the existence and numerical size of the constant term. From l.butler at ed.ac.uk Thu Feb 24 12:29:02 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 24 Feb 2011 18:29:02 +0000 (GMT) Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits In-Reply-To: <4D65D88C.4090401@users.sourceforge.net> References: <4D65D88C.4090401@users.sourceforge.net> Message-ID: On Wed, 23 Feb 2011, James Amundson wrote: < On 02/23/2011 02:21 PM, Leo Butler wrote: < > < > > < > I have put the diff files in < > < > http://www.maths.ed.ac.uk/~lbutler/cvs-git/ < > < > You will see that Jim's cautious words are borne out. < < Thank you for doing all the detailed testing. I'm glad to see, at least, that < I didn't send you on a wild goose chase. I did the cvs2git translation of a < maxima cvs tarball that Ray pointed me to. He said: < < > I think this was < > my monthly backup done on 2011-01-15. But for playing around, it < > doesn't matter the exact date as long as it's fairly recent. < < Also, I didn't attempt to get the email addresses right in this conversion. If < we decide that the cvs2git translation produces otherwise satisfactory results < the addresses can be fixed. < < Please apply your tests to this git repository: < http://amundson-long.net/maxima.git.tar.bz2 < and let us know what happens. Jim, I've put the results in http://erdelyi.maths.ed.ac.uk/~lbutler/cvs2git/ You can see that cvs2git does a rather bad job in comparison to git-cvsimport: the diff file sizes are Release 5.22 5.23 git cvsimport 3.3K 3.3K cvs2git 363K 691K I've not bothered with more testing on earlier branches. Note that cvs2git doesn't like $Id$ tags, and it has lost files (including in the Attic). Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From doug.dastew at gmail.com Thu Feb 24 13:49:59 2011 From: doug.dastew at gmail.com (Doug Stewart) Date: Thu, 24 Feb 2011 14:49:59 -0500 Subject: [Maxima] plotting data that is in an array In-Reply-To: <1298571724.2743.4.camel@pc> References: <1298571724.2743.4.camel@pc> Message-ID: On Thu, Feb 24, 2011 at 1:22 PM, Mario Rodriguez wrote: > El mi?, 23-02-2011 a las 10:56 -0500, Doug Stewart escribi?: > > > > Hi > > > > > > I have an array that is holding some bfloat numbers and I want to plot > > them. > > > > > > I tried: > > plot2d(difar[x],[x,1,200]); > > plot2d: expression evaluates to non-numeric value somewhere in > > plotting range. > > > > > > but no plot shows up. > > > > > > difar has made with > > array(difar,270); > > > > > > and was filled in a for loop with > > difar[k]:ar[k]-z, > > > > Hello, > > With graphic object 'points' of package draw you can plot lisp arrays, > those created by 'make_array'. > > In case you are interested, describe(points) will show you some > examples. > > -- > Mario > > Thank you Mario. plot2d(points(ar)); No range given. Must supply range of the form [variable,min,max] -- an error. Entering the Maxima debugger. Enter ':h' for help. plot2d(points(float(ar)),[x,1,30]); plot2d: expression evaluates to non-numeric value everywhere in plotting range. plot2d: nothing to plot. ar[1]; (%o31542) 0 (%i31543) ar[1]; (%o31543) 9.69153261428502821625790129965230188038979037207623497686b-1 (%i31544) ar[30]; (%o31544) 9.281877359682097494138780654461907159196579018188414951339355563575969b-1 (%i31545) float(ar[30]); (%o31545) 0.92818773596821 (%i31546) The ar array has numbers in it and should plot but I am still confused. Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Thu Feb 24 14:59:40 2011 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 24 Feb 2011 20:59:40 +0000 Subject: [Maxima] plotting data that is in an array In-Reply-To: References: Message-ID: <1298581180.2468.3.camel@wigner> On Wed, 2011-02-23 at 10:56 -0500, Doug Stewart wrote: > I tried: plot2d(difar[x],[x,1,200]); plot2d: expression evaluates to > non-numeric value somewhere in plotting range. The form plot2d(difar[x], [x,1,200]); would only work if difar[x] existed for any value of x between 1 and 200, for instance difar[2.345409689]. To make a plot with points, look at the examples of plot2d with the "discrete" option in the manual (? plot2d). Regards, Jaime From l.butler at ed.ac.uk Thu Feb 24 15:10:30 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 24 Feb 2011 21:10:30 +0000 (GMT) Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: On Thu, 24 Feb 2011, Robert Dodier wrote: < On 2/22/11, Leo Butler wrote: < < > Robert, I think what you are seeing there is that your lisp is < > using a utf-8 external format (encoding), and #\? < > is the replacement char for non-printables. < > < > Based on this hunch, I've pushed a patch for build-index.lisp < > that uses the external format in the master info file to < > read the info files and write the hash tables. Does this < > fix the issue you see? < < As it stands it fails to build maxima-index.lisp, < with different error messages for SBCL and Clisp. < I've pasted the messages for doc/info/es below. < Same error in doc/info/pt. In es.utf8 and pt.utf8, < I guess it could succeed w/ SBCL but Clisp is the default < for maxima-local so that's what gets called by the Makefile < and it fails since Clisp doesn't recognize :UTF-8. < < What Lisp are you using and what OS ? < Does the current code work as expected? Apologies, I noticed this after I realised that I could make those info files without having the locales. I was erroneously opening the master info file with the default encoding of utf-8, hence the errors. I now open it as a binary file, find the encoding, then re-open it with the correct encoding. I've pushed a patch that fixes this issue for sbcl, clisp and cmucl (debian testing). All the maxima-index.lisp files are made, and I don't see any non-printable characters. Since each lisp deals with external formats differently, and there are potentially os-related snafus, I've added two helper functions to set and retrieve the external format. These will need to be patched for other lisps, but since I don't have any other lisps lying around, I will need help on that. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From doug.dastew at gmail.com Thu Feb 24 15:15:20 2011 From: doug.dastew at gmail.com (Doug Stewart) Date: Thu, 24 Feb 2011 16:15:20 -0500 Subject: [Maxima] plotting data that is in an array In-Reply-To: <1298581180.2468.3.camel@wigner> References: <1298581180.2468.3.camel@wigner> Message-ID: On Thu, Feb 24, 2011 at 3:59 PM, Jaime Villate wrote: > On Wed, 2011-02-23 at 10:56 -0500, Doug Stewart wrote: > > I tried: plot2d(difar[x],[x,1,200]); plot2d: expression evaluates to > > non-numeric value somewhere in plotting range. > > The form plot2d(difar[x], [x,1,200]); > would only work if difar[x] existed for any value of x between 1 and > 200, for instance difar[2.345409689]. > To make a plot with points, look at the examples of plot2d with the > "discrete" option in the manual (? plot2d). > Regards, > Jaime > > I guess i'm not smart enough to use maxima, because I still don't get it. I have an array made with array(difar,270); I have put numbers in the array. I want to plot the array. Could someone give me an exact line that will plot this array? Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Thu Feb 24 15:37:39 2011 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 24 Feb 2011 21:37:39 +0000 Subject: [Maxima] plotting data that is in an array In-Reply-To: References: <1298581180.2468.3.camel@wigner> Message-ID: <1298583459.2468.17.camel@wigner> On Thu, 2011-02-24 at 16:15 -0500, Doug Stewart wrote: > I have an array made with array(difar,270); I have put numbers in the > array. I want to plot the array. Could someone give me an exact line > that will plot this array? If you want to plot points in 2d, you need two values (x and y coordinates) for each point. Assuming that you mean to use the values of the array for the y coordinates of 270 points, and that you want the x coordinates to be 1, 2, 3, ..., 270, you would then do: points: makelist( [i, difar[i]], i, 1, 270 ); plot2d( [discrete, points] ); Regards, Jaime From doug.dastew at gmail.com Thu Feb 24 15:42:28 2011 From: doug.dastew at gmail.com (Doug Stewart) Date: Thu, 24 Feb 2011 16:42:28 -0500 Subject: [Maxima] plotting data that is in an array In-Reply-To: <1298583459.2468.17.camel@wigner> References: <1298581180.2468.3.camel@wigner> <1298583459.2468.17.camel@wigner> Message-ID: On Thu, Feb 24, 2011 at 4:37 PM, Jaime Villate wrote: > On Thu, 2011-02-24 at 16:15 -0500, Doug Stewart wrote: > > I have an array made with array(difar,270); I have put numbers in the > > array. I want to plot the array. Could someone give me an exact line > > that will plot this array? > If you want to plot points in 2d, you need two values (x and y > coordinates) for each point. Assuming that you mean to use the values of > the array for the y coordinates of 270 points, and that you want the x > coordinates to be 1, 2, 3, ..., 270, you would then do: > > points: makelist( [i, difar[i]], i, 1, 270 ); > plot2d( [discrete, points] ); > > Regards, > Jaime > > > Thank you Jaime--- It works!!!! Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Thu Feb 24 16:00:40 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 24 Feb 2011 23:00:40 +0100 Subject: [Maxima] plotting data that is in an array In-Reply-To: References: <1298581180.2468.3.camel@wigner> Message-ID: <1298584840.2766.20.camel@pc> El jue, 24-02-2011 a las 16:15 -0500, Doug Stewart escribi?: > > > On Thu, Feb 24, 2011 at 3:59 PM, Jaime Villate > wrote: > On Wed, 2011-02-23 at 10:56 -0500, Doug Stewart wrote: > > I tried: plot2d(difar[x],[x,1,200]); plot2d: expression > evaluates to > > non-numeric value somewhere in plotting range. > > > The form plot2d(difar[x], [x,1,200]); > would only work if difar[x] existed for any value of x between > 1 and > 200, for instance difar[2.345409689]. > To make a plot with points, look at the examples of plot2d > with the > "discrete" option in the manual (? plot2d). > Regards, > Jaime > > I guess i'm not smart enough to use maxima, because I still don't get > it. > > > I have an array made with > array(difar,270); > I have put numbers in the array. > I want to plot the array. Could someone give me an exact line that > will plot this array? (%i2) array(a,5) $ (%i3) for i:0 thru 5 do a[i]: bfloat(random(1.0))$ (%i4) plot2d( [discrete, listarray (a)] ) $ or: (%i5) load(draw)$ (%i6) draw2d( points_joined=true, points(listarray(a))) $ -- Mario From doug.dastew at gmail.com Thu Feb 24 17:05:10 2011 From: doug.dastew at gmail.com (Doug Stewart) Date: Thu, 24 Feb 2011 18:05:10 -0500 Subject: [Maxima] plotting data that is in an array In-Reply-To: <1298584840.2766.20.camel@pc> References: <1298581180.2468.3.camel@wigner> <1298584840.2766.20.camel@pc> Message-ID: On Thu, Feb 24, 2011 at 5:00 PM, Mario Rodriguez wrote: > El jue, 24-02-2011 a las 16:15 -0500, Doug Stewart escribi?: > > > > > > On Thu, Feb 24, 2011 at 3:59 PM, Jaime Villate > > wrote: > > On Wed, 2011-02-23 at 10:56 -0500, Doug Stewart wrote: > > > I tried: plot2d(difar[x],[x,1,200]); plot2d: expression > > evaluates to > > > non-numeric value somewhere in plotting range. > > > > > > The form plot2d(difar[x], [x,1,200]); > > would only work if difar[x] existed for any value of x between > > 1 and > > 200, for instance difar[2.345409689]. > > To make a plot with points, look at the examples of plot2d > > with the > > "discrete" option in the manual (? plot2d). > > Regards, > > Jaime > > > > I guess i'm not smart enough to use maxima, because I still don't get > > it. > > > > > > I have an array made with > > array(difar,270); > > I have put numbers in the array. > > I want to plot the array. Could someone give me an exact line that > > will plot this array? > > > > (%i2) array(a,5) $ > (%i3) for i:0 thru 5 do a[i]: bfloat(random(1.0))$ > (%i4) plot2d( [discrete, listarray (a)] ) $ > > or: > > (%i5) load(draw)$ > (%i6) draw2d( > points_joined=true, > points(listarray(a))) $ > > -- > Mario > > > Thanks Mario. In display(points) I saw : Array with ordinates. (%i1) load(draw)$ (%i2) a: make_array (flonum, 100) $ (%i3) for i:0 thru 99 do a[i]: random(1.0) $ (%i4) draw2d(points(a)) $ but when I try plot2d(points(ar)); I got: No range given. Must supply range of the form [variable,min,max] -- an error. Entering the Maxima debugger. So from my point of view the info in display(points) must be wrong. I see that your example you used listarray but this was not in that help section that I saw. Any way thanks and all is well now. Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Thu Feb 24 17:09:48 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 24 Feb 2011 18:09:48 -0500 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: <4D66E53C.3070409@gmail.com> On 2/24/11 4:10 PM, Leo Butler wrote: > I've pushed a patch that fixes this issue for > sbcl, clisp and cmucl (debian testing). All the > maxima-index.lisp files are made, and I don't see > any non-printable characters. > Mostly works for me with cmucl, but I had to apply the following patch, basically adding with-standard-io-syntax, which is a good idea for all Lisps. For some reason I have non-NIL values for *print-length* and *print-level*, so maxima-index.lisp had ... characters in there. One other thing that needs to be solved for cmucl is that when I used LANG=de_DE, maxima somehow decides to use utf8 encoding. That's fine, but when the documentation is printed, cmucl uses it's default encoding of iso8859-1, so ? is used in quite a few places. For example, ? additive gives question marks in various places. I'll need to look around to see where to hook these together. If it still matters, I don't think gcl has any kind of external format support. In many ways, it would be good to treat the info files as binary files of octets and use octet offsets. Then when we read and display the documentation, we don't need any special support. Just output the octets assuming the user has done the right magic so that the terminal/wxmaxima/etc. have the correct encoding. (The terminal setting has to be set correctly no matter whether we use octets or characters.) Ray diff --git a/src/build-index.lisp b/src/build-index.lisp index 6a807f1..22ed42b 100644 --- a/src/build-index.lisp +++ b/src/build-index.lisp @@ -384,8 +384,12 @@ before adding new contents." (car efs)))))) (cond (file (setf ef (get-external-format ef)) - (with-open-file (out file :direction :output :if-exists :supersede :if-does-not - (dump-hashes out))) + (with-open-file (out file :direction :output + :if-exists :supersede + :if-does-not-exist :create + :external-format ef) + (with-standard-io-syntax + (dump-hashes out)))) (t (dump-hashes *standard-output*))))) diff --git a/src/gcl-depends.mk b/src/gcl-depends.mk From biomates at telefonica.net Thu Feb 24 17:31:50 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 25 Feb 2011 00:31:50 +0100 Subject: [Maxima] plotting data that is in an array In-Reply-To: References: <1298581180.2468.3.camel@wigner> <1298584840.2766.20.camel@pc> Message-ID: <1298590310.3930.23.camel@pc> El jue, 24-02-2011 a las 18:05 -0500, Doug Stewart escribi?: > > but when I try > plot2d(points(ar)); > I got: > No range given. Must supply range of the form [variable,min,max] > -- an error. Entering the Maxima debugger. > Hello, plot2d doesn't recognise graphic object 'points'. It's part of package draw: http://www.telefonica.net/web2/biomates/maxima/gpdraw > So from my point of view the info in display(points) must be wrong. The syntax of plot2d and draw2d are different, you shouldn't mix them. > > I see that your example you used listarray but this was not in that > help section that I saw. There are two types of arrays, those created by 'array', and those created by 'make_array' (Lisp arrays). The draw package can plot directly Lisp arrays, therefore you don't need to use 'listarray'. Since draw can't plot arrays of the first type, you have to transform them into lists before plotting your data, that's why we have to use 'listarray'. Another alternative is to create the list of values via 'makelist', as in Jaime's example. -- Mario From l.butler at ed.ac.uk Thu Feb 24 18:26:40 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 25 Feb 2011 00:26:40 +0000 (GMT) Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: <4D66E53C.3070409@gmail.com> References: <4D66E53C.3070409@gmail.com> Message-ID: On Thu, 24 Feb 2011, Raymond Toy wrote: < On 2/24/11 4:10 PM, Leo Butler wrote: < > I've pushed a patch that fixes this issue for < > sbcl, clisp and cmucl (debian testing). All the < > maxima-index.lisp files are made, and I don't see < > any non-printable characters. < > < Mostly works for me with cmucl, but I had to apply the following patch, < basically adding with-standard-io-syntax, which is a good idea for all < Lisps. For some reason I have non-NIL values for *print-length* and < *print-level*, so maxima-index.lisp had ... characters in there. Ok, this is good to know. I will patch the slurp function, too. < < One other thing that needs to be solved for cmucl is that when I used < LANG=de_DE, maxima somehow decides to use utf8 encoding. That's fine, < but when the documentation is printed, cmucl uses it's default encoding < of iso8859-1, so ? is used in quite a few places. For example, ? < additive gives question marks in various places. This is built from doc/info/de/maxima.info, correct? Could you check what this file says on the line coding: ... near the bottom? The coding should be iso-8859-1 and it should be picked up by Maxima (it is for me). I have chosen the default external format to be utf-8, but the default could be set at build time, too. < < I'll need to look around to see where to hook these together. < < If it still matters, I don't think gcl has any kind of external format < support. < < In many ways, it would be good to treat the info files as binary files < of octets and use octet offsets. Then when we read and display the < documentation, we don't need any special support. Just output the < octets assuming the user has done the right magic so that the < terminal/wxmaxima/etc. have the correct encoding. (The terminal setting < has to be set correctly no matter whether we use octets or characters.) Yes, this was my preconception, too. We do not need to use an encoding to read, categorise or search the info files. *But* when it comes to to outputting the stuff, I think you are wrong: the de.utf8 online help is displayed correctly in emacs when output as a utf8 encoded string, but not without the encoding. I can patch build-index.lisp so that you can compare the results with encodings vs. octets. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From toy.raymond at gmail.com Thu Feb 24 19:24:31 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 24 Feb 2011 20:24:31 -0500 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <4D66E53C.3070409@gmail.com> Message-ID: <4D6704CF.5030609@gmail.com> On 2/24/11 7:26 PM, Leo Butler wrote: > > On Thu, 24 Feb 2011, Raymond Toy wrote: > > < On 2/24/11 4:10 PM, Leo Butler wrote: > < > I've pushed a patch that fixes this issue for > < > sbcl, clisp and cmucl (debian testing). All the > < > maxima-index.lisp files are made, and I don't see > < > any non-printable characters. > < > > < Mostly works for me with cmucl, but I had to apply the following patch, > < basically adding with-standard-io-syntax, which is a good idea for all > < Lisps. For some reason I have non-NIL values for *print-length* and > < *print-level*, so maxima-index.lisp had ... characters in there. > > Ok, this is good to know. I will patch the slurp function, too. Possibly. I have not looked at the slurp function. > < > < One other thing that needs to be solved for cmucl is that when I used > < LANG=de_DE, maxima somehow decides to use utf8 encoding. That's fine, > < but when the documentation is printed, cmucl uses it's default encoding > < of iso8859-1, so ? is used in quite a few places. For example, ? > < additive gives question marks in various places. > > This is built from doc/info/de/maxima.info, correct? Could you check > what this file says on the line > > coding: ... > > near the bottom? The coding should be iso-8859-1 and it should be > picked up by Maxima (it is for me). It does say iso-8859-1. > I have chosen the default external format to be utf-8, but the default > could be set at build time, too. Ah, but default for whom? There are many defaults. I have not studied your code, so I don't know what default external format you are talking about. I'll need to see how you write out the documentation and get back to you on this. I was just hacking something to make the output look correct. > < > < I'll need to look around to see where to hook these together. > < > < If it still matters, I don't think gcl has any kind of external format > < support. > < > < In many ways, it would be good to treat the info files as binary files > < of octets and use octet offsets. Then when we read and display the > < documentation, we don't need any special support. Just output the > < octets assuming the user has done the right magic so that the > < terminal/wxmaxima/etc. have the correct encoding. (The terminal setting > < has to be set correctly no matter whether we use octets or characters.) > > Yes, this was my preconception, too. We do not need to use an encoding > to read, categorise or search the info files. *But* when it comes to > to outputting the stuff, I think you are wrong: the de.utf8 online > help is displayed correctly in emacs when output as a utf8 encoded > string, but not without the encoding. Are you using maxima in a shell window in emacs? There are many places where the octets can be misinterpreted, anywhere from maxima reading the info file to emacs reading the octets. > > > I can patch build-index.lisp so > that you can compare the results with encodings vs. octets. Only if you think this is a worthwhile choice. It could solve the issue of everyone's favorite lisp using different ways of specifying the external format. Ray From amundson at users.sourceforge.net Thu Feb 24 19:26:24 2011 From: amundson at users.sourceforge.net (James Amundson) Date: Thu, 24 Feb 2011 19:26:24 -0600 Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits In-Reply-To: References: <4D65D88C.4090401@users.sourceforge.net> Message-ID: <4D670540.1030604@users.sourceforge.net> On 02/24/2011 12:29 PM, Leo Butler wrote: > You can see that cvs2git does a rather bad job in > comparison to git-cvsimport: the diff file sizes > are > > Release 5.22 5.23 > git cvsimport 3.3K 3.3K > cvs2git 363K 691K > > I've not bothered with more testing on earlier branches. > Note that cvs2git doesn't like $Id$ tags, and it has lost > files (including in the Attic). OK, it looks like I made the wrong choice in resolving attic problems. Let's try this version: http://amundson-long.net/maximav2.git.tar.bz2 Some notes: 1) We should ignore special RCS comments, e.g., -# $Id: texi2html,v 1.5 2007/04/14 21:56:43 robert_dodier Exp $ +# $Id$ They don't have any real meaning in the git repository. 2) Since I'm using a cvs snapshot from Ray, we should be comparing against that, not the current CVS. I put a copy of the snapshot here: http://amundson-long.net/maxima-cvs-2011-15.tar.bz2 --Jim From robert.dodier at gmail.com Fri Feb 25 00:53:08 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 24 Feb 2011 23:53:08 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: <4D66E53C.3070409@gmail.com> References: <4D66E53C.3070409@gmail.com> Message-ID: On 2/24/11, Raymond Toy wrote: > If it still matters, I don't think gcl has any kind of external format > support. I don't care what GCL does or doesn't, anymore. FWIW Robert Dodier From robert.dodier at gmail.com Fri Feb 25 01:08:45 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 25 Feb 2011 00:08:45 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: <4D66E53C.3070409@gmail.com> References: <4D66E53C.3070409@gmail.com> Message-ID: On 2/24/11, Raymond Toy wrote: > In many ways, it would be good to treat the info files as binary files > of octets and use octet offsets. Then when we read and display the > documentation, we don't need any special support. Just output the > octets assuming the user has done the right magic so that the > terminal/wxmaxima/etc. have the correct encoding. (The terminal setting > has to be set correctly no matter whether we use octets or characters.) Why are you saying this? The code in the build-index+cl-ppcre branch was written on that theory, and it didn't work. Now there is some different code in place, which does work (when Maxima/Lisp's idea of the encoding matches the actual encoding). That seems like pretty strong evidence that the theory is incorrect. best Robert Dodier From robert.dodier at gmail.com Fri Feb 25 01:23:53 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 25 Feb 2011 00:23:53 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: On 2/24/11, Leo Butler wrote: > I've pushed a patch that fixes this issue for > sbcl, clisp and cmucl (debian testing). All the > maxima-index.lisp files are made, and I don't see > any non-printable characters. After building from the tip of the branch, maxima-index.lisp files (de, de.utf8, es, es.utf8, pt, pt.utf8) are built successfully, and they appear to have correct characters in them (no '?' or other substitutions). Titles and content are both displayed correctly in ISO-8859 locales (de_DE, es_ES, pt_PT). Titles (i.e. the strings in maxima-index.lisp) are displayed correctly in UTF-8 locales, but in the content, special characters are messed up -- they are displayed as garbled characters. I notice that all of the maxima.info* files have coding: iso-8859-1 at the end, even in the *.utf8 directories. I'm sorry to ask, but wouldn't it be more efficient if you test your changes before asking others to do so? All I'm doing is building Maxima and then launching LC_ALL=$whatever konsole and running Maxima in that. FWIW Robert Dodier From ferriste at gmail.com Fri Feb 25 03:35:35 2011 From: ferriste at gmail.com (Stefano Ferri) Date: Fri, 25 Feb 2011 10:35:35 +0100 Subject: [Maxima] linsolve_by_lu not documented In-Reply-To: <4D66E50C.8030107@ieee.org> References: <4D66E50C.8030107@ieee.org> Message-ID: Well, I would certainly do that, but since I don't know the details of the implementation I couldn't give more than an example... Stefano 2011/2/25 Dan Stanger : > Hello Stefano, > That somebody would be you;) > Dan > > Stefano Ferri wrote: >> >> I have just noticed that the function linsolve_by_lu is not documented. >> Can somebody fix this please? >> >> Thanks, >> Stefano >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> > > From pbowyer at olynet.com Fri Feb 25 11:03:19 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Fri, 25 Feb 2011 09:03:19 -0800 Subject: [Maxima] Obtaining current source code Message-ID: <4D67E0D7.30207@olynet.com> Robert: With all of the activity concerning the changeover from cvs to git and the modifications to Maxima due to cl-ppcre, I'm kind of lost concerning how to go about obtaining the current Maxima source code. Where should I be looking to find the current source code and what is the incantation I should use to acquire it please? Thanks, Paul From toy.raymond at gmail.com Fri Feb 25 11:56:08 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 25 Feb 2011 12:56:08 -0500 Subject: [Maxima] Obtaining current source code In-Reply-To: <4D67E0D7.30207@olynet.com> References: <4D67E0D7.30207@olynet.com> Message-ID: <4D67ED38.6030803@gmail.com> On 2/25/11 12:03 PM, Paul Bowyer wrote: > Robert: > > With all of the activity concerning the changeover from cvs to git and > the modifications to Maxima due to cl-ppcre, I'm kind of lost > concerning how to go about obtaining the current Maxima source code. > > Where should I be looking to find the current source code and what is > the incantation I should use to acquire it please? The official code is still in CVS at sourceforge.net. Ray From toy.raymond at gmail.com Fri Feb 25 11:59:08 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 25 Feb 2011 12:59:08 -0500 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <4D66E53C.3070409@gmail.com> Message-ID: <4D67EDEC.7030200@gmail.com> On 2/25/11 1:53 AM, Robert Dodier wrote: > On 2/24/11, Raymond Toy wrote: > >> If it still matters, I don't think gcl has any kind of external format >> support. > I don't care what GCL does or doesn't, anymore. You keep saying this. So make it official instead of making snarky remarks about not caring about gcl. Announce the fact that maxima no longer supports running with GCL and be done with it. People will know what to do then. Ray From toy.raymond at gmail.com Fri Feb 25 12:07:42 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 25 Feb 2011 13:07:42 -0500 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <4D66E53C.3070409@gmail.com> Message-ID: <4D67EFEE.1070502@gmail.com> On 2/25/11 2:08 AM, Robert Dodier wrote: > On 2/24/11, Raymond Toy wrote: > >> In many ways, it would be good to treat the info files as binary files >> of octets and use octet offsets. Then when we read and display the >> documentation, we don't need any special support. Just output the >> octets assuming the user has done the right magic so that the >> terminal/wxmaxima/etc. have the correct encoding. (The terminal setting >> has to be set correctly no matter whether we use octets or characters.) > Why are you saying this? The code in the build-index+cl-ppcre branch > was written on that theory, and it didn't work. Now there is some You need to separate the implementation from the theory. The theory could very well be wrong. But the implementation could be wrong too. (No offense to Leo. I just think tried to make it work but decided on a slightly different approach.) I know I was confused on some of the conversions being done in the original build-index method. I have never written an localized/internationalized C program, but my understand is that C programs really do just suck in octets and spit them out. No internal conversion from the external format to internal wide-chars (or whatever) and the conversion back to whatever the external format is for output. Ray From greenbreen at yahoo.com Fri Feb 25 12:14:08 2011 From: greenbreen at yahoo.com (Paul Breen) Date: Fri, 25 Feb 2011 10:14:08 -0800 (PST) Subject: [Maxima] if x*(y+z)=x*y+x*z then print(true) else print(false); yields false Message-ID: <500538.90592.qm@web34306.mail.mud.yahoo.com> Hello, I'm just getting started with Maxima, so maybe my confusion is a result of my lack of familiarity with the system, but it seems to me that the statement: if x*(y+z)=x*y+x*z then print(true) else print(false); ought to return true. Is Maxima just trying to be extremely general by not assuming that the "+" operator is normal addition, or is this a bug? --Paul Breen From macrakis at alum.mit.edu Fri Feb 25 12:18:24 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 25 Feb 2011 13:18:24 -0500 Subject: [Maxima] if x*(y+z)=x*y+x*z then print(true) else print(false); yields false In-Reply-To: <500538.90592.qm@web34306.mail.mud.yahoo.com> References: <500538.90592.qm@web34306.mail.mud.yahoo.com> Message-ID: The operator "=" in Maxima denotes syntactic equality. Use equal(...) for semantic equality: (%o1) if equal(x*(y+z),x*y+x*z) then print(true) else print(false); true (%o2) true (%i3) is( equal(x*(y+z),x*y+x*z) ); (%o3) true On Fri, Feb 25, 2011 at 13:14, Paul Breen wrote: > Hello, > > I'm just getting started with Maxima, so maybe my confusion is a result of > my lack of familiarity with the system, but it seems to me that the > statement: > > if x*(y+z)=x*y+x*z then print(true) else print(false); > > ought to return true. Is Maxima just trying to be extremely general by not > assuming that the "+" operator is normal addition, or is this a bug? > > --Paul Breen > _______________________________________________ > 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 Feb 25 12:45:41 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 25 Feb 2011 13:45:41 -0500 Subject: [Maxima] Shouldn't is/equal use more powerful techniques? WAS: if x*(y+z)=x*y+x*z then print(true) else print(false); yields false Message-ID: That said, Maxima doesn't (and can't) guarantee that is( equal( a , b ) ) will always give a complete answer, for example: is(equal(1-sin(x)^2,cos(x)^2)); => unknown It turns out that is/equal is basically using ratsimp and some other techniques, probably to avoid 'expensive' operations. Nowadays (given how much faster and larger computers are), it might make sense for it to try ratsimp(exponentialize(logarc(...))) if ratsimp returns unknown. (Probably shouldn't use radcan, which may be over-eager in its simplifications.) -s On Fri, Feb 25, 2011 at 13:18, Stavros Macrakis wrote: > The operator "=" in Maxima denotes syntactic equality. Use equal(...) for > semantic equality: > > (%o1) if equal(x*(y+z),x*y+x*z) then print(true) else print(false); > true > (%o2) true > (%i3) is( equal(x*(y+z),x*y+x*z) ); > (%o3) true > > > On Fri, Feb 25, 2011 at 13:14, Paul Breen wrote: > >> Hello, >> >> I'm just getting started with Maxima, so maybe my confusion is a result of >> my lack of familiarity with the system, but it seems to me that the >> statement: >> >> if x*(y+z)=x*y+x*z then print(true) else print(false); >> >> ought to return true. Is Maxima just trying to be extremely general by >> not assuming that the "+" operator is normal addition, or is this a bug? >> >> --Paul Breen >> _______________________________________________ >> 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 Fri Feb 25 12:47:16 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 25 Feb 2011 10:47:16 -0800 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <4D66E53C.3070409@gmail.com> Message-ID: <4D67F934.5060900@eecs.berkeley.edu> On 2/24/2011 10:53 PM, Robert Dodier wrote: > On 2/24/11, Raymond Toy wrote: > >> If it still matters, I don't think gcl has any kind of external format >> support. > I don't care what GCL does or doesn't, anymore. > > FWIW > > Robert Dodier > _______________________________________________ > It seems to me that if you want to push for a transition to another lisp on windows that it be done in parallel, so that at least initially there is a GCL version AND the alternative version, so results etc can be compared. And these would have to be pre-built binary easily-installed one-step downloads. RJF From fateman at eecs.berkeley.edu Fri Feb 25 13:06:21 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 25 Feb 2011 11:06:21 -0800 Subject: [Maxima] Shouldn't is/equal use more powerful techniques? WAS: if x*(y+z)=x*y+x*z then print(true) else print(false); yields false In-Reply-To: References: Message-ID: <4D67FDAD.9060204@eecs.berkeley.edu> On 2/25/2011 10:45 AM, Stavros Macrakis wrote: > That said, Maxima doesn't (and can't) guarantee that is( equal( a , b > ) ) will always give a complete answer, for example: > > is(equal(1-sin(x)^2,cos(x)^2)); > => unknown > > It turns out that is/equal is basically using ratsimp and some other > techniques, probably to avoid 'expensive' operations. Nowadays (given > how much faster and larger computers are), it might make sense for it > to try ratsimp(exponentialize(logarc(...))) if ratsimp returns > unknown. (Probably shouldn't use radcan, which may be over-eager in > its simplifications.) > > Lisp has programs like member which have optional arguments to specific what kind of equality test to use.. (member 3 '(3.0 4.0) :test 'eq) is false (i.e. nil) (member 3 '(3.0 4.0) :test '=) is true (actually, (3.0 4.0) which being non-nil can be used as true). So Maxima could have something like equal(x, y, transformations=[ratsimp, trigsimp]) This is not really so useful as in the case of membership, because one could do this, too is (ratsimp(x-y)=0) ... From macrakis at alum.mit.edu Fri Feb 25 13:15:12 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 25 Feb 2011 14:15:12 -0500 Subject: [Maxima] Which Lisp for Windows if not GCL? WAS: foreign language patch for build-index+cl-ppcre branch Message-ID: On Fri, Feb 25, 2011 at 01:53, Robert Dodier wrote: > I don't care what GCL does or doesn't, anymore. > What Lisp do you propose for the Windows distribution? I thought that the last time we discussed this, there was a fatal flaw with every other Lisp for Windows. Am I remembering incorrectly, or has something changed? -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Fri Feb 25 14:01:05 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 25 Feb 2011 13:01:05 -0700 Subject: [Maxima] Which Lisp for Windows if not GCL? WAS: foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: Clozure CL runs on Windows, can compile & run Maxima on Windows (I've done that myself), is under active development, and reasonably fast. So I'll suggest CCL. best Robert Dodier On 2/25/11, Stavros Macrakis wrote: > On Fri, Feb 25, 2011 at 01:53, Robert Dodier wrote: > >> I don't care what GCL does or doesn't, anymore. >> > > What Lisp do you propose for the Windows distribution? I thought that the > last time we discussed this, there was a fatal flaw with every other Lisp > for Windows. Am I remembering incorrectly, or has something changed? > > -s > From macrakis at alum.mit.edu Fri Feb 25 14:11:29 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 25 Feb 2011 15:11:29 -0500 Subject: [Maxima] Which Lisp for Windows if not GCL? WAS: foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: As of June last year (see your message below), there were cases (stack overflow?) where Clozure could not recover from errors, and terminated instead. If I remember correctly, RJF and I considered that a fatal flaw for an interactive system, but you were willing to live with it. Has this problem been fixed? Or do you simply consider it less important than other issues? -s ---------- Forwarded message ---------- From: Robert Dodier Date: Sat, Jun 5, 2010 at 13:32 Subject: Re: [Maxima] Lisp stack overflow To: Barton Willis Cc: maxima at math.utexas.edu, Alejandro Morales On 6/4/10, Barton Willis wrote: > This is a bug; here is a related example: > > (%i1) dpart(sin(a+b),1); > Maxima encountered a Lisp error: Seems to be a bug of recent origin; works OK in Maxima 5.20.0, not in 5.21.0. The problem might or might not be in dpart, I can't tell; I can't get a useful stack trace out of GCL (no relevant info), Clisp (crash), or Clozure CL (crash). best Robert Dodier _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima On Fri, Feb 25, 2011 at 15:01, Robert Dodier wrote: > Clozure CL runs on Windows, can compile & run Maxima on Windows > (I've done that myself), is under active development, and reasonably fast. > So I'll suggest CCL. > > best > > Robert Dodier > > On 2/25/11, Stavros Macrakis wrote: > > On Fri, Feb 25, 2011 at 01:53, Robert Dodier >wrote: > > > >> I don't care what GCL does or doesn't, anymore. > >> > > > > What Lisp do you propose for the Windows distribution? I thought that > the > > last time we discussed this, there was a fatal flaw with every other Lisp > > for Windows. Am I remembering incorrectly, or has something changed? > > > > -s > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xlogo at free.fr Sat Feb 26 04:51:42 2011 From: xlogo at free.fr (=?ISO-8859-1?Q?Lo=EFc?=) Date: Sat, 26 Feb 2011 11:51:42 +0100 Subject: [Maxima] radcan behaviour Message-ID: <4D68DB3E.8050401@free.fr> Hi list I don't understand some simplifications with radcan: (%i5) radcan(sqrt((x+1)^2)); (%o5) abs(x + 1) (%i6) radcan(sqrt(x^2+2*x+1)); (%o6) x + 1 Seems to be a bug, no? Best From willisb at unk.edu Sat Feb 26 07:06:04 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 26 Feb 2011 07:06:04 -0600 Subject: [Maxima] bigfloat package + tocl In-Reply-To: <4D67ED38.6030803@gmail.com> References: <4D67E0D7.30207@olynet.com>, <4D67ED38.6030803@gmail.com> Message-ID: I thought this was fun; maybe it is useful too. tocl (share/contrib/tocl.lisp) is a Maxima to Common Lisp translator. By changing symbol properties for mtimes, mplus, ..., tocl will generate code appropriate for the bigfloat package. An example: the trapezoid rule using rational, binary64, and bigfloat numbers (%i4) trap_bigfloat(lambda([x], 1/x),1,2,10); (%o4) 161504821/232792560 (%i5) trap_bigfloat(lambda([x], asin(x)),1,2,100); (%o5) 1.570796326794894-0.90157583206333*%i (%i6) trap_bigfloat(lambda([x], asin(x)),1.0b0,2,100),fpprec : 42; (%o6) 1.57079632679489661892515999185291314779206b0-9.01575832063334506308235596167851968757257b-1*%i The file trap.lisp (mostly untested): (in-package :maxima) ($load "tocl") (setf (get '%asin 'cl-function) 'bigfloat::asin) (setf (get '%acos 'cl-function) 'bigfloat::acos) (setf (get '%cos 'cl-function) 'bigfloat::cos) (setf (get '%sin 'cl-function) 'bigfloat::sin) (setf (get 'mplus 'cl-function) 'bigfloat::+) (setf (get 'mminus 'cl-function) 'bigfloat::-) (setf (get 'mtimes 'cl-function) 'bigfloat::*) (setf (get 'mquotient 'cl-function) 'bigfloat::/) (setf (get 'mexpt 'cl-function) 'bigfloat::expt) (defun $trap_bigfloat (f a b n) (maxima::to (bigfloat::trap-bigfloat (expr-to-cl f) (bigfloat::to a) (bigfloat::to b) (bigfloat::to n)))) (in-package #-gcl #:bigfloat #+gcl "BIGFLOAT") (defun trap-bigfloat (f a b n) (let ((s (/ (+ (funcall f a) (funcall f b)) 2)) (h (/ (- b a) n))) (do ((k 1 (+ k 1))) ((>= k n) (* h s)) (setq s (+ s (funcall f (+ a (* h k)))))))) (in-package :maxima) --Barton From fateman at eecs.berkeley.edu Sat Feb 26 08:26:30 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 26 Feb 2011 06:26:30 -0800 Subject: [Maxima] bigfloat package + tocl In-Reply-To: References: <4D67E0D7.30207@olynet.com>, <4D67ED38.6030803@gmail.com> Message-ID: <4D690D96.90506@eecs.berkeley.edu> On 2/26/2011 5:06 AM, Barton Willis wrote: > I thought this was fun; maybe it is useful too. Could be useful. A more ambitious approach is via overloaded ops as in http://www.cs.berkeley.edu/~fateman/generic . You could also make lisp programs into symbolic programs by replacing (+ a b) by (list '(mplus) a b) etc. :) RJF From l.butler at ed.ac.uk Sat Feb 26 08:31:24 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sat, 26 Feb 2011 14:31:24 +0000 (GMT) Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits In-Reply-To: <4D670540.1030604@users.sourceforge.net> References: <4D65D88C.4090401@users.sourceforge.net> <4D670540.1030604@users.sourceforge.net> Message-ID: On Thu, 24 Feb 2011, James Amundson wrote: < On 02/24/2011 12:29 PM, Leo Butler wrote: < < > You can see that cvs2git does a rather bad job in < > comparison to git-cvsimport: the diff file sizes < > are < > < > Release 5.22 5.23 < > git cvsimport 3.3K 3.3K < > cvs2git 363K 691K < > < > I've not bothered with more testing on earlier branches. < > Note that cvs2git doesn't like $Id$ tags, and it has lost < > files (including in the Attic). < < OK, it looks like I made the wrong choice in resolving attic problems. Let's < try this version: < < http://amundson-long.net/maximav2.git.tar.bz2 < < Some notes: < 1) We should ignore special RCS comments, e.g., < -# $Id: texi2html,v 1.5 2007/04/14 21:56:43 robert_dodier Exp < $ < +# $Id$ < They don't have any real meaning in the git repository. < < 2) Since I'm using a cvs snapshot from Ray, we should be comparing < against that, not the current CVS. I put a copy of the snapshot here: < < http://amundson-long.net/maxima-cvs-2011-15.tar.bz2 Jim, I redid the tests using your git repo, and ignoring diffs caused by: -RCS-type headers in all files; -case changes in .li?sp , .el files the results look quite good. You can find the results at http://www.maths.ed.ac.uk/~lbutler/cvs2git-v2/ I put the script used to do the tests in there, too. I note though, that the tags+branches of each are not exactly the same. I didn't understand your comment (2), because I wanted to check how well the git repo's tags+branches compared to the cvs repo's and I (think I) need access to the cvs repo for that, not just a snapshot. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From leon.magiera at wp.pl Sat Feb 26 10:42:51 2011 From: leon.magiera at wp.pl (leon.magiera at wp.pl) Date: Sat, 26 Feb 2011 17:42:51 +0100 Subject: [Maxima] simplify Message-ID: <4d692d8b34f8a6.02546708@wp.pl> Hi All Given: assume(a>0)$ (2/sqrt(((sqrt(3)*a)/2+a/sqrt(2))^2+a^2/4)+ 2/sqrt((a/sqrt(2)-(sqrt(3)*a)/2)^2+a^2/4)+ 2^(3/2)/(sqrt(3)*a)); How to get simpler form of the above expression? Regards Leon From willisb at unk.edu Sat Feb 26 12:40:46 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 26 Feb 2011 12:40:46 -0600 Subject: [Maxima] simplify In-Reply-To: <4d692d8b34f8a6.02546708@wp.pl> References: <4d692d8b34f8a6.02546708@wp.pl> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >assume(a>0)$ >(2/sqrt(((sqrt(3)*a)/2+a/sqrt(2))^2+a^2/4)+ >2/sqrt((a/sqrt(2)-(sqrt(3)*a)/2)^2+a^2/4)+ >2^(3/2)/(sqrt(3)*a)); > >How?to?get?simpler?form?of?the?above?expression? Try: (%i1) assume(a>0)$ (%i2) (2/sqrt(((sqrt(3)*a)/2+a/sqrt(2))^2+a^2/4)+2/sqrt((a/sqrt(2)-(sqrt(3)*a)/2)^2+a^2/4)+2^(3/2)/(sqrt(3)*a))$ (%i3) ratsimp(%), algebraic : true; (%o3) -((4*sqrt(3)-3*2^(3/2))*sqrt(sqrt(2)*sqrt(3)+3)+(-4*sqrt(3)-3*2^(3/2))*sqrt(3-sqrt(2)*sqrt(3))-2^(3/2)*sqrt(3))/(3*a) (%i4) rootscontract(%); (%o4) -((4*sqrt(3)-3*2^(3/2))*sqrt(sqrt(6)+3)-2*sqrt(6)+(-4*sqrt(3)-3*2^(3/2))*sqrt(3-sqrt(6)))/(3*a) --Barton From macrakis at alum.mit.edu Sat Feb 26 14:49:45 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 26 Feb 2011 15:49:45 -0500 Subject: [Maxima] bigfloat package + tocl In-Reply-To: <4D690D96.90506@eecs.berkeley.edu> References: <4D67E0D7.30207@olynet.com> <4D67ED38.6030803@gmail.com> <4D690D96.90506@eecs.berkeley.edu> Message-ID: On Sat, Feb 26, 2011 at 09:26, Richard Fateman wrote: > ...You could also make lisp programs into symbolic programs by > replacing (+ a b) by (list '(mplus) a b) etc. (add a b) -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Feb 26 16:26:56 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 26 Feb 2011 15:26:56 -0700 Subject: [Maxima] Which Lisp for Windows if not GCL? WAS: foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: On 2/25/11, Stavros Macrakis wrote: > As of June last year (see your message below), there were cases (stack > overflow?) where Clozure could not recover from errors, and terminated > instead. If I remember correctly, RJF and I considered that a fatal flaw > for an interactive system, but you were willing to live with it. > > Has this problem been fixed? Or do you simply consider it less important > than other issues? I tried this w/ CCL 1.7 (current development version). Last time I tried was CCL 1.4; I haven't tried any of the intervening versions. C:\temp\clozure-svn\ccl>wx86cl.exe Welcome to Clozure Common Lisp Version 1.7-dev-r14645M-trunk (WindowsX8632)! ? (defun f (n) (if (> n 0) (1+ (f (1- n))) 0)) F ? (f 10000) 10000 ? (f 100000) > Error: Stack overflow on value stack. > While executing: F, in process listener(1). > Type :POP to abort, :R for a list of available restarts. > Type :? for other options. 1 > So I guess CCL is better behaved about stack overflow now. Robert Dodier From robert.dodier at gmail.com Sat Feb 26 16:28:41 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 26 Feb 2011 15:28:41 -0700 Subject: [Maxima] Which Lisp for Windows if not GCL? WAS: foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: On 2/25/11, Stavros Macrakis wrote: > As of June last year (see your message below), there were cases (stack > overflow?) where Clozure could not recover from errors, and terminated > instead. If I remember correctly, RJF and I considered that a fatal flaw > for an interactive system, but you were willing to live with it. > > Has this problem been fixed? Or do you simply consider it less important > than other issues? I tried this w/ CCL 1.7 (current development version). Last time I tried was CCL 1.4; I haven't tried any of the intervening versions. C:\temp\clozure-svn\ccl>wx86cl.exe Welcome to Clozure Common Lisp Version 1.7-dev-r14645M-trunk (WindowsX8632)! ? (defun f (n) (if (> n 0) (1+ (f (1- n))) 0)) F ? (f 10000) 10000 ? (f 100000) > Error: Stack overflow on value stack. > While executing: F, in process listener(1). > Type :POP to abort, :R for a list of available restarts. > Type :? for other options. 1 > So I guess CCL is better behaved about stack overflow now. Robert Dodier From robert.dodier at gmail.com Sat Feb 26 16:56:05 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 26 Feb 2011 15:56:05 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: <4D67EFEE.1070502@gmail.com> References: <4D66E53C.3070409@gmail.com> <4D67EFEE.1070502@gmail.com> Message-ID: On 2/25/11, Raymond Toy wrote: > I have never written an localized/internationalized C program, but my > understand is that C programs really do just suck in octets and spit > them out. No internal conversion from the external format to internal > wide-chars (or whatever) and the conversion back to whatever the > external format is for output. Yeah, good point. My guess at this point is that the standard output stream converts bytes to characters without trying to merge successive bytes. If we could bypass the standard output stream and write "directly" to the console (for some value of "directly") then we might see multibyte characters displayed correctly. best Robert Dodier From robert.dodier at gmail.com Sat Feb 26 17:04:08 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 26 Feb 2011 16:04:08 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: <4D67EDEC.7030200@gmail.com> References: <4D66E53C.3070409@gmail.com> <4D67EDEC.7030200@gmail.com> Message-ID: On 2/25/11, Raymond Toy wrote: > On 2/25/11 1:53 AM, Robert Dodier wrote: >> I don't care what GCL does or doesn't, anymore. > You keep saying this. So make it official instead of making snarky > remarks about not caring about gcl. > > Announce the fact that maxima no longer supports running with GCL and be > done with it. People will know what to do then. I don't have, and don't want, the authority to decide it myself. Remarks like the one above are an attempt to get others to say what they want -- either "me neither" or "Well, I still care" or whatever. Or they might say nothing, in which care I'll probably go ahead with my own plan, but at least nobody can claim to be surprised. FWIW Robert Dodier From macrakis at alum.mit.edu Sat Feb 26 17:05:34 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 26 Feb 2011 18:05:34 -0500 Subject: [Maxima] Rational powers and simplification In-Reply-To: <1251662281.28493.13.camel@dieter-laptop> References: <200908301458.36792.ferriste@gmail.com> <1251640456.3455.28.camel@dieter-laptop> <58928e4b0908300825i55290d2fu5a3951845c7ce146@mail.gmail.com> <1251647097.3455.39.camel@dieter-laptop> <1251649901.3455.45.camel@dieter-laptop> <58928e4b0908301236p73ede5ccxb81c3a4046d6d86@mail.gmail.com> <1251662281.28493.13.camel@dieter-laptop> Message-ID: Dieter, I recall that you've worked on the simplification of products of radicals in the past. On the other hand, I don't remember if there was ever any discussion of the case sqrt(6)/sqrt(2). In current Maxima, this isn't simplified by the general simplifier or by ratsimp -- you have to use rootscontract or radcan. I don't know if it's always been like this or not, but it is a surprise nonetheless. I think it would be desirable for x^a*y^-a (where x and y are integer constants) to simplify in the general simplifier to the same thing as (x/y)^a. For that matter, the more general cases 18^(3/5)*48^(-4/5) => 3^(2/5)/2^(13/5) and even 18^(3/5)*48^(-3/7) => 3^(27/35)/2^(39/35) are straightforward enough to handle (cf. radcan). There may be an argument that this last case is too radical change in form, and it will surprise our users, but then 18^3/48^4 already gets simplified to 9/8192. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sat Feb 26 17:13:49 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 26 Feb 2011 18:13:49 -0500 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <4D66E53C.3070409@gmail.com> <4D67EDEC.7030200@gmail.com> Message-ID: I have no particular preference for the Lisp used for Maxima, and CCL appears to have many attractive features. Your test shows that the stack-overflow crash issue is resolved (at least for that simple test case), and that seemed to be the main problem with CCL. As Fateman suggests, can we build a CCL Windows installer for the current release (in addition to the existing GCL installer) so that users can bang on the CCL implementation for a couple of months to help find bugs or performance problems before we take the plunge? Better that it be the same version so as not to confuse the evaluation. -s On Sat, Feb 26, 2011 at 18:04, Robert Dodier wrote: > On 2/25/11, Raymond Toy wrote: > > > On 2/25/11 1:53 AM, Robert Dodier wrote: > >> I don't care what GCL does or doesn't, anymore. > > > You keep saying this. So make it official instead of making snarky > > remarks about not caring about gcl. > > > > Announce the fact that maxima no longer supports running with GCL and be > > done with it. People will know what to do then. > > I don't have, and don't want, the authority to decide it myself. > Remarks like the one above are an attempt to get others to > say what they want -- either "me neither" or "Well, I still care" > or whatever. Or they might say nothing, in which care I'll > probably go ahead with my own plan, but at least nobody > can claim to be surprised. > > FWIW > > 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 fateman at eecs.berkeley.edu Sat Feb 26 17:22:29 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 26 Feb 2011 15:22:29 -0800 Subject: [Maxima] Which Lisp for Windows if not GCL? WAS: foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: <4D698B35.5020607@eecs.berkeley.edu> I suppose it may be better behaved, but not really satisfactory.. consider this: In GCL, (handler-case (f 100000)(error (x)(format t "~% handler-case caught error ~s" x) 'boohoo)) results in this: handler-case caught error # BOOHOO In Allegro CL, it results in this: handler-case caught error # boohoo but in CCL we get this... (handler-case (f 100000)(error (x)(format t "~% handler-case caught error ~s" x) 'boohoo)) > Error: Stack overflow on value stack. > While executing: F, in process listener(1). > Type :POP to abort, :R for a list of available restarts. > Type :? for other options So CCL does not have error handling for this kind of error. I don't know how this would affect the top-level listener loop, but I think it would be bad. There are many lisps that may not be quite ready for prime time... RJF From macrakis at alum.mit.edu Sat Feb 26 17:26:25 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 26 Feb 2011 18:26:25 -0500 Subject: [Maxima] Which Lisp for Windows if not GCL? WAS: foreign language patch for build-index+cl-ppcre branch In-Reply-To: <4D698B35.5020607@eecs.berkeley.edu> References: <4D698B35.5020607@eecs.berkeley.edu> Message-ID: That's unfortunate. Especially unfortunate as we try to clean up Maxima to be more usable as a component of larger systems... which I think is one of *your* hot buttons, Robert.... -s On Sat, Feb 26, 2011 at 18:22, Richard Fateman wrote: > I suppose it may be better behaved, but not really satisfactory.. > > consider this: > > In GCL, > > (handler-case (f 100000)(error (x)(format t "~% handler-case caught error > ~s" x) 'boohoo)) > > results in this: > > handler-case caught error # > BOOHOO > > In Allegro CL, it > results in this: > > > handler-case caught error # #x221524ca> > boohoo > > but in CCL we get this... > > (handler-case (f 100000)(error (x)(format t "~% handler-case caught error > ~s" x) 'boohoo)) > > > Error: Stack overflow on value stack. > > While executing: F, in process listener(1). > > Type :POP to abort, :R for a list of available restarts. > > Type :? for other options > > So CCL does not have error handling for this kind of error. > > I don't know how this would affect the top-level listener loop, but I think > it would be bad. > > There are many lisps that may not be quite ready for prime time... > > RJF > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sat Feb 26 17:33:28 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 26 Feb 2011 18:33:28 -0500 Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits In-Reply-To: References: <4D65D88C.4090401@users.sourceforge.net> <4D670540.1030604@users.sourceforge.net> Message-ID: <4D698DC8.5020807@gmail.com> On 2/26/11 9:31 AM, Leo Butler wrote: > > On Thu, 24 Feb 2011, James Amundson wrote: > > < On 02/24/2011 12:29 PM, Leo Butler wrote: > < > < > You can see that cvs2git does a rather bad job in > < > comparison to git-cvsimport: the diff file sizes > < > are > < > > < > Release 5.22 5.23 > < > git cvsimport 3.3K 3.3K > < > cvs2git 363K 691K > < > > < > I've not bothered with more testing on earlier branches. > < > Note that cvs2git doesn't like $Id$ tags, and it has lost > < > files (including in the Attic). > < > < OK, it looks like I made the wrong choice in resolving attic problems. Let's > < try this version: > < > < http://amundson-long.net/maximav2.git.tar.bz2 > < > < Some notes: > < 1) We should ignore special RCS comments, e.g., > < -# $Id: texi2html,v 1.5 2007/04/14 21:56:43 robert_dodier Exp > < $ > < +# $Id$ > < They don't have any real meaning in the git repository. > < > < 2) Since I'm using a cvs snapshot from Ray, we should be comparing > < against that, not the current CVS. I put a copy of the snapshot here: > < > < http://amundson-long.net/maxima-cvs-2011-15.tar.bz2 > > > [snip] > I didn't understand your comment (2), because I wanted to > check how well the git repo's tags+branches compared to the > cvs repo's and I (think I) need access to the cvs repo > for that, not just a snapshot. The snapshot I sent to Jim is a complete backup of the cvs repo. I backup maxima to my machine at home once a month and the backup includes everything, including the full cvs repo. I keep the backups for at least 6 mo, but sometimes more, depending on when I remember to purge old backup data. Ray From drdieterkaiser at web.de Sat Feb 26 17:43:42 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 27 Feb 2011 00:43:42 +0100 Subject: [Maxima] Rational powers and simplification In-Reply-To: References: <200908301458.36792.ferriste@gmail.com> <1251640456.3455.28.camel@dieter-laptop> <58928e4b0908300825i55290d2fu5a3951845c7ce146@mail.gmail.com> <1251647097.3455.39.camel@dieter-laptop> <1251649901.3455.45.camel@dieter-laptop> <58928e4b0908301236p73ede5ccxb81c3a4046d6d86@mail.gmail.com> <1251662281.28493.13.camel@dieter-laptop> Message-ID: <1298763822.1702.10.camel@dieter> Am Samstag, den 26.02.2011, 18:05 -0500 schrieb Stavros Macrakis: > Dieter, > > > I recall that you've worked on the simplification of products of > radicals in the past. > > > On the other hand, I don't remember if there was ever any discussion > of the case sqrt(6)/sqrt(2). In current Maxima, this isn't simplified > by the general simplifier or by ratsimp -- you have to use > rootscontract or radcan. I don't know if it's always been like this > or not, but it is a surprise nonetheless. > > > I think it would be desirable for x^a*y^-a (where x and y are integer > constants) to simplify in the general simplifier to the same thing as > (x/y)^a. For that matter, the more general cases 18^(3/5)*48^(-4/5) > => 3^(2/5)/2^(13/5) and even 18^(3/5)*48^(-3/7) => 3^(27/35)/2^(39/35) > are straightforward enough to handle (cf. radcan). There may be an > argument that this last case is too radical change in form, and it > will surprise our users, but then 18^3/48^4 already gets simplified to > 9/8192. Yes, I have written code to simplify expressions like sqrt(6)/sqrt(2). This can be done in the main simplifier. I have done it because of the bug report ID: 1639678 "3*sqrt(2)/sqrt(3)/sqrt(6) != 1" I will have a look to find the piece of code again. Dieter Kaiser From toy.raymond at gmail.com Sat Feb 26 17:46:28 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 26 Feb 2011 18:46:28 -0500 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <4D66E53C.3070409@gmail.com> <4D67EDEC.7030200@gmail.com> Message-ID: <4D6990D4.2070406@gmail.com> On 2/26/11 6:04 PM, Robert Dodier wrote: > On 2/25/11, Raymond Toy wrote: > >> On 2/25/11 1:53 AM, Robert Dodier wrote: >>> I don't care what GCL does or doesn't, anymore. >> You keep saying this. So make it official instead of making snarky >> remarks about not caring about gcl. >> >> Announce the fact that maxima no longer supports running with GCL and be >> done with it. People will know what to do then. > I don't have, and don't want, the authority to decide it myself. I think that not everyone reads every message. But I think the discussion will be a bit more focused if we just had one thread about dropping gcl because it is becoming more and more difficult to maintain maxima with gcl. And whether you want it or not, you are the de facto leader, if for no other reason than that you set the release dates and set the release labels and do the release engineering. Dropping gcl makes my life easier. I do build with gcl once in a while just to make sure, but I don't use maxima and gcl, and don't run maxima on Windows. Ray From toy.raymond at gmail.com Sat Feb 26 17:51:15 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 26 Feb 2011 18:51:15 -0500 Subject: [Maxima] Which Lisp for Windows if not GCL? WAS: foreign language patch for build-index+cl-ppcre branch In-Reply-To: <4D698B35.5020607@eecs.berkeley.edu> References: <4D698B35.5020607@eecs.berkeley.edu> Message-ID: <4D6991F3.5030501@gmail.com> On 2/26/11 6:22 PM, Richard Fateman wrote: > > So CCL does not have error handling for this kind of error. This should be raised on the CCL bug tracker. They've been quite responsive on fixing bugs, and fixed the cl:expt bug that affects maxima in a matter of a few days. Of course, that's only useful if you build ccl from sources yourself, but it does speak well of them. Ray From drdieterkaiser at web.de Sat Feb 26 18:38:30 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 27 Feb 2011 01:38:30 +0100 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: <4D6990D4.2070406@gmail.com> References: <4D66E53C.3070409@gmail.com> <4D67EDEC.7030200@gmail.com> <4D6990D4.2070406@gmail.com> Message-ID: <1298767110.1702.25.camel@dieter> Am Samstag, den 26.02.2011, 18:46 -0500 schrieb Raymond Toy: > On 2/26/11 6:04 PM, Robert Dodier wrote: > > On 2/25/11, Raymond Toy wrote: > > > >> On 2/25/11 1:53 AM, Robert Dodier wrote: > >>> I don't care what GCL does or doesn't, anymore. > >> You keep saying this. So make it official instead of making snarky > >> remarks about not caring about gcl. > >> > >> Announce the fact that maxima no longer supports running with GCL and be > >> done with it. People will know what to do then. > > I don't have, and don't want, the authority to decide it myself. > I think that not everyone reads every message. But I think the > discussion will be a bit more focused if we just had one thread about > dropping gcl because it is becoming more and more difficult to maintain > maxima with gcl. > > And whether you want it or not, you are the de facto leader, if for no > other reason than that you set the release dates and set the release > labels and do the release engineering. > > Dropping gcl makes my life easier. I do build with gcl once in a while > just to make sure, but I don't use maxima and gcl, and don't run maxima > on Windows. I develop Maxima on a Linux system. Sometimes I do a Lisp-built on a Windows system. I use a pre-built version of GCL. I have never managed it to build GCL on Windows. I would prefer any other Lisp, which will work on a Windows system and which is easy to install. Dieter Kaiser From macrakis at alum.mit.edu Sat Feb 26 20:28:39 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 26 Feb 2011 21:28:39 -0500 Subject: [Maxima] radcan behaviour In-Reply-To: <4D68DB3E.8050401@free.fr> References: <4D68DB3E.8050401@free.fr> Message-ID: In the first case, the general simplifier has already simplified the expression by the time radcan sees it: (%i5) sqrt((x+1)^2); (%o5) abs(x + 1) radcan intentionally treats sqrt(x) as meaning *either* the positive or negative square root, so doesn't return abs. But in this case, the abs has already been introduced by the general simplifier. -s On Sat, Feb 26, 2011 at 05:51, Lo?c wrote: > Hi list > > I don't understand some simplifications with radcan: > > (%i5) radcan(sqrt((x+1)^2)); > (%o5) abs(x + 1) > (%i6) radcan(sqrt(x^2+2*x+1)); > (%o6) x + 1 > > Seems to be a bug, no? > > Best > > > _______________________________________________ > 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 joseph.tiao.cheung at gmail.com Sat Feb 26 22:43:53 2011 From: joseph.tiao.cheung at gmail.com (Joseph Cheung) Date: Sat, 26 Feb 2011 23:43:53 -0500 Subject: [Maxima] Need instruction to install Maxima 5.23.2 in Kubuntu 10.10 Message-ID: <201102262343.53579.joseph.tiao.cheung@gmail.com> Hello, I need to get the instruction to install Maxima 5.23.2 in Kubuntu 10.10 for my Netbook. Can anyone please let me know how? I've downloaded the tar.gz file from Maxima webpage. Thanks, -- Joseph Cheung From tomdean at speakeasy.org Sat Feb 26 23:09:52 2011 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Sat, 26 Feb 2011 21:09:52 -0800 Subject: [Maxima] Need instruction to install Maxima 5.23.2 in Kubuntu 10.10 In-Reply-To: <201102262343.53579.joseph.tiao.cheung@gmail.com> References: <201102262343.53579.joseph.tiao.cheung@gmail.com> Message-ID: <1298783392.2201.80.camel@asus> On Sat, 2011-02-26 at 23:43 -0500, Joseph Cheung wrote: > Hello, > > I need to get the instruction to install Maxima 5.23.2 in Kubuntu 10.10 for my > Netbook. Can anyone please let me know how? I've downloaded the tar.gz file > from Maxima webpage. > > Thanks, > I installed clisp with 'sudo apt-get instal clisp' Then, unpacked the tarball. cd to maxima-5.23.2 ./configure --enable-clisp make make check sudo make install tomdean From drdieterkaiser at web.de Sun Feb 27 04:07:13 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 27 Feb 2011 11:07:13 +0100 Subject: [Maxima] radcan behaviour In-Reply-To: References: <4D68DB3E.8050401@free.fr> Message-ID: <1298801233.1666.16.camel@dieter> Am Samstag, den 26.02.2011, 21:28 -0500 schrieb Stavros Macrakis: > In the first case, the general simplifier has already simplified the > expression by the time radcan sees it: > > (%i5) sqrt((x+1)^2); > (%o5) abs(x + 1) > > radcan intentionally treats sqrt(x) as meaning *either* the positive > or negative square root, so doesn't return abs. But in this case, the > abs has already been introduced by the general simplifier. > > -s > > On Sat, Feb 26, 2011 at 05:51, Lo?c wrote: > Hi list > > I don't understand some simplifications with radcan: > > (%i5) radcan(sqrt((x+1)^2)); > (%o5) abs(x + 1) > (%i6) radcan(sqrt(x^2+2*x+1)); > (%o6) x + 1 > > Seems to be a bug, no? The simplification sqrt(x^2) -> abs(x) is switched on by default. This is controlled by the global option variable radexpand. The default value is true. At a lot of places in the code, this simplification is not the desired behavior and the option variable radexpand is bound to false. With this setting the simplification is more correct in general. Furthermore, the documentation of radexpand must be improved. The flag controls in general the simplification of expressions like (x^a)^b. There are some hacks, which influence the simplification of (x^a)^b in addition. This is necessary to get some pieces of code to work. A more correct implementation might be, to switch off the default behavior, that sqrt(x^2) simplifies to abs(x). In Sage this is done by setting the option variable domain to complex. A more consistent behavior could be achieved by setting the variable radexpand to the value false by default. Dieter Kaiser From willisb at unk.edu Sun Feb 27 08:20:50 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 27 Feb 2011 08:20:50 -0600 Subject: [Maxima] Which Lisp for Windows if not GCL? WAS: foreign language patch for build-index+cl-ppcre branch In-Reply-To: <4D6991F3.5030501@gmail.com> References: <4D698B35.5020607@eecs.berkeley.edu>, <4D6991F3.5030501@gmail.com> Message-ID: Is Allegro CL a possibility for Windows? If the free Express Edition isn't up to the task, why not the full version of Allegro? Or would a Maxima compiled with Allegro CL be illegal to distribute (due to the way that Maxima gives the user access to CL)? --Barton From fateman at eecs.berkeley.edu Sun Feb 27 08:34:00 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 27 Feb 2011 06:34:00 -0800 Subject: [Maxima] Which Lisp for Windows if not GCL? WAS: foreign language patch for build-index+cl-ppcre branch In-Reply-To: <4D698B35.5020607@eecs.berkeley.edu> References: <4D698B35.5020607@eecs.berkeley.edu> Message-ID: <4D6A60D8.8030003@eecs.berkeley.edu> response from CCL (promptly).... after a little further experimentation .... (handler-case (f 100000)(condition (x)(format t "~% handler-case caught error ~s" x) 'boohoo)) ;; ^^^^^^^^^^ works. storage-condition is not a subclass of error, but of "serious-condition". The handler-case catches that. On 2/26/2011 3:22 PM, Richard Fateman wrote: > I suppose it may be better behaved, but not really satisfactory.. > > consider this: > > In GCL, > > (handler-case (f 100000)(error (x)(format t "~% handler-case caught > error ~s" x) 'boohoo)) > > results in this: > > handler-case caught error # > BOOHOO > > In Allegro CL, it > results in this: > > > handler-case caught error # #x221524ca> > boohoo > > but in CCL we get this... > > (handler-case (f 100000)(error (x)(format t "~% handler-case caught > error ~s" x) 'boohoo)) > > Error: Stack overflow on value stack. > > While executing: F, in process listener(1). > > Type :POP to abort, :R for a list of available restarts. > > Type :? for other options > > So CCL does not have error handling for this kind of error. > > I don't know how this would affect the top-level listener loop, but I > think it would be bad. > > There are many lisps that may not be quite ready for prime time... > > RJF > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at eecs.berkeley.edu Sun Feb 27 08:43:55 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 27 Feb 2011 06:43:55 -0800 Subject: [Maxima] Which Lisp for Windows if not GCL? WAS: foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <4D698B35.5020607@eecs.berkeley.edu>, <4D6991F3.5030501@gmail.com> Message-ID: <4D6A632B.6050306@eecs.berkeley.edu> On 2/27/2011 6:20 AM, Barton Willis wrote: > Is Allegro CL a possibility for Windows? Technically, I think so. At least it was pretty easy last time I tried it. It would also have the advantage of allowing the same implementation (or same brand of implementation) on Linux, Mac, and other platforms. Politically, it would not be GPL. But then, Windows isn't GPL either :) Financially/legally -- Franz Inc would have to weigh in if someone needs the full version of Allegro. > If the free Express Edition Last I looked the free edition could run Maxima, so it would be necessary to get the full version only if the (rather generous) limits on the free version are exceeded. The only difficulty I recall encountering was the somewhat mysterious situation that the compiler was not able to compile some of the converted-from-FORTRAN programs in the free edition; no problem compiling in the full version and then loading into the free version. I've personally been using the free version for years. > isn't up to the task, why not the full version of Allegro? Or would a > Maxima compiled with Allegro CL be illegal to distribute (due to the > way that Maxima gives the user access to CL)? Someone distributing Maxima on top of full Allegro would indeed have to have permission to distribute Allegro, which would have to be reconciled with Franz Inc's business model. Distributing on top of the free version might require some kind of registration. Perhaps SMH who reads this mail would make inquiries / chime in. (Maybe significant is that the number of copies of Maxima of August 2010 version exceeds 219,000, and from the recent release of Feb 4, already 26,000. Just counting Windows. ) From maxima at etherjones.us Sun Feb 27 10:19:24 2011 From: maxima at etherjones.us (Ether Jones) Date: Sun, 27 Feb 2011 08:19:24 -0800 (PST) Subject: [Maxima] numerical integration of IF() function Message-ID: <262686.60167.qm@web161820.mail.bf1.yahoo.com> How do I tell maxima that I want a numerical answer to this? -------------begin---------------- pulse: IF(x<0.1,1,0)$ quad_qags(pulse,x,0,1); quad_qags(IF(x<0.1,1,0),x,0,1,epsrel=1.0*10^-8,epsabs=0.0,limit=200) -----------end-------------------- From drdieterkaiser at web.de Sun Feb 27 11:19:59 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 27 Feb 2011 18:19:59 +0100 Subject: [Maxima] radcan behaviour In-Reply-To: <4D6A8409.3000702@free.fr> References: <4D68DB3E.8050401@free.fr> <1298801233.1666.16.camel@dieter> <4D6A8409.3000702@free.fr> Message-ID: <1298827199.2082.3.camel@dieter> Am Sonntag, den 27.02.2011, 18:04 +0100 schrieb Lo?c: > Thanks for your detailled answer, > > If I understand, there's no way to get "abs(x+1)" > as result of "radan(sqrt(x^2+2*x+1))" > > In my opinion , it's a real problem. > Perhaps, I missed something and there is another command than "radcan" > to allow radical simplifications.... The only way I know to do this simplification is (%i1) scanmap(factor, sqrt(x^2+2*x+1)); (%o1) abs(x + 1) By the way, the function factor alone does not work (%i4) factor(sqrt(x^2+2*x+1)); (%o4) sqrt(x^2+2*x+1) This is a known problem, too. Dieter Kaiser From robert.dodier at gmail.com Sun Feb 27 11:32:40 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 27 Feb 2011 10:32:40 -0700 Subject: [Maxima] Which Lisp for Windows if not GCL? WAS: foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <4D698B35.5020607@eecs.berkeley.edu> <4D6991F3.5030501@gmail.com> Message-ID: On 2/27/11, Barton Willis wrote: > Is Allegro CL a possibility for Windows? If the free Express Edition > isn't up to the task, why not the full version of Allegro? Or would a > Maxima compiled with Allegro CL be illegal to distribute (due to the > way that Maxima gives the user access to CL)? I'm not interested in pursuing it. Express Edition won't compile the SLATEC stuff (functions too big, some limitation exceeded), full version costs money, for either the free or full version there are license problems. As ever, you or anyone else is free to build packages with Allegro and distribute them as you wish. FWIW Robert Dodier From fateman at eecs.berkeley.edu Sun Feb 27 12:30:39 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 27 Feb 2011 10:30:39 -0800 Subject: [Maxima] Which Lisp for Windows if not GCL? WAS: foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: <4D698B35.5020607@eecs.berkeley.edu> <4D6991F3.5030501@gmail.com> Message-ID: <4D6A984F.6060302@eecs.berkeley.edu> On 2/27/2011 9:32 AM, Robert Dodier wrote: > On 2/27/11, Barton Willis wrote: > >> Is Allegro CL a possibility for Windows? If the free Express Edition >> isn't up to the task, why not the full version of Allegro? Or would a >> Maxima compiled with Allegro CL be illegal to distribute (due to the >> way that Maxima gives the user access to CL)? > I'm not interested in pursuing it. I think it is pretty clear that Franz Inc would have to do something to change the situation. Just off the top of my head -- if they chose to do so, they could take a copy of the current release, make an Allegro Maxima installer , or executable, (or a dll or whatever it might be called) and post it for download on sourceforge or somewhere else. (Technically they could have done so at any time in the past few decades.) The only technical issues I am aware of have to do with interfacing with plotting and graphical front ends, and I suspect that those would be simple for someone who understood the issues at all.) If Franz pursues it, it presumably would be done. If not, I agree that it is not sufficiently interesting for others to distribute Maxima on Allegro. Just to be clear -- there are lots of other facets of Allegro that could be used with Maxima to assist programmers, users, etc that go beyond what is available in GCL -- including foreign function stuff, web stuff, database stuff , IDE, unicode, ---etc etc. But that is probably not compelling for most people, and to some extent CCL or other non-GCL lisps provide a step up from GCL in some respects, too. > Express Edition won't compile the SLATEC stuff (functions > too big, some limitation exceeded), full version costs money, > for either the free or full version there are license problems. > > As ever, you or anyone else is free to build packages > with Allegro and distribute them as you wish. > > FWIW > > Robert Dodier From mhw at netris.org Sun Feb 27 13:34:15 2011 From: mhw at netris.org (Mark H Weaver) Date: Sun, 27 Feb 2011 14:34:15 -0500 Subject: [Maxima] numerical integration of IF() function In-Reply-To: <262686.60167.qm@web161820.mail.bf1.yahoo.com> (Ether Jones's message of "Sun, 27 Feb 2011 08:19:24 -0800 (PST)") References: <262686.60167.qm@web161820.mail.bf1.yahoo.com> Message-ID: <87wrkltgp4.fsf@netris.org> Ether Jones writes: > How do I tell maxima that I want a numerical answer to this? > > -------------begin---------------- > pulse: IF(x<0.1,1,0)$ > quad_qags(pulse,x,0,1); > quad_qags(IF(x<0.1,1,0),x,0,1,epsrel=1.0*10^-8,epsabs=0.0,limit=200) > -----------end-------------------- In Maxima, the syntax you want is: if x<0.1 then 1 else 0 (%i1) display2d:false$ (%i2) pulse(x) := if x<0.1 then 1 else 0; (%o2) pulse(x):=if x < 0.1 then 1 else 0 (%i3) quad_qags(pulse,x,0,1); (%o3) [0.1,1.1102230246251565E-16,441,0] (%i4) quad_qags(if x<0.1 then 1 else 0,x,0,1,epsrel=1.0*10^-8,epsabs=0.0,limit=200); (%o4) [0.1,1.1102230246251565E-16,441,0] Alternatively, if you define pulse in terms of the unit_step function, then with the help of the abs_integrate package, you can integrate pulse symbolically: (%i5) load(abs_integrate); (%o5) "/usr/local/share/maxima/5.23.2/share/contrib/integration/abs_integrate.mac" (%i6) pulse(x) := unit_step(x) - unit_step(x-0.1); (%o6) pulse(x):=unit_step(x)-unit_step(x-0.1) (%i7) integrate(pulse(x),x,0,1); rat: replaced -0.1 by -1/10 = -0.1 rat: replaced -0.1 by -1/10 = -0.1 rat: replaced -0.1 by -1/10 = -0.1 rat: replaced 0.0 by 0/1 = 0.0 rat: replaced 0.9 by 9/10 = 0.9 (%o7) 1/10 Mark From andrej.vodopivec at gmail.com Sun Feb 27 15:26:47 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Sun, 27 Feb 2011 22:26:47 +0100 Subject: [Maxima] installer for maxima with ccl on windows Message-ID: I have uploaded an installer for maxima compiled with ccl to http://dl.dropbox.com/u/3305126/maxima-5.23.2.exe Please try it so that we can see if ccl is a possible alternative for gcl on Windows. The documentation is not built correctly but this is not related to ccl. Andrej From fateman at eecs.berkeley.edu Sun Feb 27 16:18:25 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 27 Feb 2011 14:18:25 -0800 Subject: [Maxima] installer for maxima with ccl on windows In-Reply-To: References: Message-ID: <4D6ACDB1.4020309@eecs.berkeley.edu> On 2/27/2011 1:26 PM, Andrej Vodopivec wrote: > I have uploaded an installer for maxima compiled with ccl to > http://dl.dropbox.com/u/3305126/maxima-5.23.2.exe > > Please try it so that we can see if ccl is a possible alternative for > gcl on Windows. The documentation is not built correctly but this is > not related to ccl. > > Andrej > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Seems to recover from stack overflow about the same as GCL. (good!) I assume the test suite runs OK, and a simple plot worked as well. How about speed?... showtime:all; x:0; g(n):= for i from 1 thru n do x:x+1; g(100000) takes 2.18 seconds on CCL 0.87 seconds on GCL on some multivariate polynomial arithmetic, CCL seems to be about 2.5 times slower. on integrate(x^14*sin(x),x) CCL is about 3 times slower. Perhaps the compiler optimization settings are not equivalent? This test doesn't show CCL's superiority, just equivalence [but slower]. This would not matter except for people writing papers comparing speeds of computer algebra systems. RJF From richhen2008 at gmail.com Sun Feb 27 17:09:29 2011 From: richhen2008 at gmail.com (Richard Hennessy) Date: Sun, 27 Feb 2011 18:09:29 -0500 Subject: [Maxima] numerical integration of IF() function In-Reply-To: <87wrkltgp4.fsf@netris.org> References: <262686.60167.qm@web161820.mail.bf1.yahoo.com> <87wrkltgp4.fsf@netris.org> Message-ID: -----Original Message----- From: Mark H Weaver Sent: Sunday, February 27, 2011 2:34 PM To: maxima at etherjones.us Cc: maxima at math.utexas.edu Subject: Re: [Maxima] numerical integration of IF() function Ether Jones writes: > How do I tell maxima that I want a numerical answer to this? > > -------------begin---------------- > pulse: IF(x<0.1,1,0)$ > quad_qags(pulse,x,0,1); > quad_qags(IF(x<0.1,1,0),x,0,1,epsrel=1.0*10^-8,epsabs=0.0,limit=200) > -----------end-------------------- In Maxima, the syntax you want is: if x<0.1 then 1 else 0 (%i1) display2d:false$ (%i2) pulse(x) := if x<0.1 then 1 else 0; (%o2) pulse(x):=if x < 0.1 then 1 else 0 (%i3) quad_qags(pulse,x,0,1); (%o3) [0.1,1.1102230246251565E-16,441,0] (%i4) quad_qags(if x<0.1 then 1 else 0,x,0,1,epsrel=1.0*10^-8,epsabs=0.0,limit=200); (%o4) [0.1,1.1102230246251565E-16,441,0] Alternatively, if you define pulse in terms of the unit_step function, then with the help of the abs_integrate package, you can integrate pulse symbolically: There is another alternative. If you are working with pulse functions, there is a third party package available from the Maxima web site that has a unit_pulse() function which can be integrated, differentiated and etc... The package is called pw.mac. It can handle math for piecewise functions hence the name pw. In pw.mac you could do it this way without having to define the pulse function. load(pw); pwint(piecewise([0,1,.1], x),x); Admittedly this requires learning the piecewise() function in pw.mac (pwint() is just piecewise integrate) but there is help available. you could also use the unit_pulse() function directly like this load(pw); pwint(unit_pulse(x/10), x),x); Try this site. It has links to the help and source code of pw.mac. http://maxima-project.org/wiki/index.php?title=Pw.mac Rich From amundson at users.sourceforge.net Sun Feb 27 19:23:34 2011 From: amundson at users.sourceforge.net (James Amundson) Date: Sun, 27 Feb 2011 19:23:34 -0600 Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits In-Reply-To: References: <4D65D88C.4090401@users.sourceforge.net> <4D670540.1030604@users.sourceforge.net> Message-ID: <4D6AF916.1080107@users.sourceforge.net> On 02/26/2011 08:31 AM, Leo Butler wrote: > > > On Thu, 24 Feb 2011, James Amundson wrote: > < 2) Since I'm using a cvs snapshot from Ray, we should be comparing > < against that, not the current CVS. I put a copy of the snapshot here: > < > < http://amundson-long.net/maxima-cvs-2011-15.tar.bz2 > > > Jim, I redid the tests using your git repo, and ignoring diffs > caused by: > -RCS-type headers in all files; > -case changes in .li?sp , .el files > the results look quite good. OK. Great. > You can find the results at > > http://www.maths.ed.ac.uk/~lbutler/cvs2git-v2/ > > I put the script used to do the tests in there, too. > I note though, that the tags+branches of each are not > exactly the same. > > I didn't understand your comment (2), because I wanted to > check how well the git repo's tags+branches compared to the > cvs repo's and I (think I) need access to the cvs repo > for that, not just a snapshot. I'm sorry for using confusing terminology. What I really meant is that I'm using an old backup of the entire CVS repository, which is in the tarball at the url above. We should compare against that. --Jim From l.butler at ed.ac.uk Sun Feb 27 19:32:00 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 28 Feb 2011 01:32:00 +0000 (GMT) Subject: [Maxima] time to switch from CVS to Git, was: Missing mailings from commits In-Reply-To: <4D6AF916.1080107@users.sourceforge.net> References: <4D65D88C.4090401@users.sourceforge.net> <4D670540.1030604@users.sourceforge.net> <4D6AF916.1080107@users.sourceforge.net> Message-ID: On Sun, 27 Feb 2011, James Amundson wrote: < On 02/26/2011 08:31 AM, Leo Butler wrote: < > < > < > On Thu, 24 Feb 2011, James Amundson wrote: < < > < 2) Since I'm using a cvs snapshot from Ray, we should be comparing < > < against that, not the current CVS. I put a copy of the snapshot here: < > < < > < http://amundson-long.net/maxima-cvs-2011-15.tar.bz2 < > < > < > Jim, I redid the tests using your git repo, and ignoring diffs < > caused by: < > -RCS-type headers in all files; < > -case changes in .li?sp , .el files < > the results look quite good. < < OK. Great. < < > You can find the results at < > < > http://www.maths.ed.ac.uk/~lbutler/cvs2git-v2/ < > < > I put the script used to do the tests in there, too. < > I note though, that the tags+branches of each are not < > exactly the same. < > < > I didn't understand your comment (2), because I wanted to < > check how well the git repo's tags+branches compared to the < > cvs repo's and I (think I) need access to the cvs repo < > for that, not just a snapshot. < < I'm sorry for using confusing terminology. What I really meant is that I'm < using an old backup of the entire CVS repository, which is in the tarball at < the url above. We should compare against that. See the results here: http://www.maths.ed.ac.uk/~lbutler/cvs2git-v3/ I am not sure why, but there are several files where the RCS headers are reported as (spurious) diffs consistently, and this does not happen when checking against the SF repo. Otherwise, my comments above apply. Perhaps we should come to a consensus on where to go from here. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From l.butler at ed.ac.uk Sun Feb 27 20:19:24 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 28 Feb 2011 02:19:24 +0000 (GMT) Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: On Fri, 25 Feb 2011, Robert Dodier wrote: < On 2/24/11, Leo Butler wrote: < < > I've pushed a patch that fixes this issue for < > sbcl, clisp and cmucl (debian testing). All the < > maxima-index.lisp files are made, and I don't see < > any non-printable characters. < < After building from the tip of the branch, < maxima-index.lisp files (de, de.utf8, es, es.utf8, pt, pt.utf8) < are built successfully, and they appear to have correct < characters in them (no '?' or other substitutions). < < Titles and content are both displayed correctly < in ISO-8859 locales (de_DE, es_ES, pt_PT). < < Titles (i.e. the strings in maxima-index.lisp) are displayed < correctly in UTF-8 locales, but in the content, special < characters are messed up -- they are displayed as < garbled characters. < < I notice that all of the maxima.info* files have coding: iso-8859-1 < at the end, even in the *.utf8 directories. Try the tip again, please. The problem you saw was due to the Makefile script not correctly setting the encoding in those directories. I am dimwitted enough to assume that the make rules would have been written correctly. At the moment, what I see is: all index files are built with clisp, cmucl and sbcl; my test script passes without error; characters appear to be displayed correctly; and an index file written by one lisp is read correctly by another. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From dan.stanger at ieee.org Sun Feb 27 20:39:51 2011 From: dan.stanger at ieee.org (Dan Stanger) Date: Sun, 27 Feb 2011 21:39:51 -0500 Subject: [Maxima] installer for maxima with ccl on windows In-Reply-To: References: Message-ID: <4D6B0AF7.7010602@ieee.org> Hello Andrej, I have tried to install on a Acer netbook I just bought, which runs Windows 7 starter. xMaxima started but failed to start maxima. When I ran the command line version I got the following: > Error: File "../bin/win_signals.lisp" does not exist. > While executing: CCL::%LOAD, in process listener(1). > Type :GO to continue, :POP to abort, :R for a list of available restarts. > If continued: Skip evaluation of (blockn (load "../bin/win_signals.lisp") (cl- user::run)) > Type :? for other options. 1 > :go Welcome to Clozure Common Lisp Version 1.7-dev-r14645M-trunk (WindowsX8632)! The command (pwd) returns Windows/System32, so it is starting from the wrong place. Also, when I tried to add the maxima image to the list of DEP programs to ignore, since the file is named maxima.image, (doesn't end with an .exe) the Windows browser does not find it. Would you remind me what the command line maxima is trying to execute, and I can continue to debug this. Thanks, Dan Andrej Vodopivec wrote: > I have uploaded an installer for maxima compiled with ccl to > http://dl.dropbox.com/u/3305126/maxima-5.23.2.exe > > Please try it so that we can see if ccl is a possible alternative for > gcl on Windows. The documentation is not built correctly but this is > not related to ccl. > > Andrej > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > From dan.stanger at ieee.org Sun Feb 27 21:29:11 2011 From: dan.stanger at ieee.org (Dan Stanger) Date: Sun, 27 Feb 2011 22:29:11 -0500 Subject: [Maxima] installer for maxima with ccl on windows In-Reply-To: <4D6B0AF7.7010602@ieee.org> References: <4D6B0AF7.7010602@ieee.org> Message-ID: <4D6B1687.701@ieee.org> Hello Andrej, I modified the command line maxima shortcut, which now starts the command line maxima correctly, but xMaxima is not able to connect. I will try to look at this more tomorrow. Dan Stanger From andrej.vodopivec at gmail.com Sun Feb 27 23:42:49 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Mon, 28 Feb 2011 06:42:49 +0100 Subject: [Maxima] installer for maxima with ccl on windows In-Reply-To: <4D6B0AF7.7010602@ieee.org> References: <4D6B0AF7.7010602@ieee.org> Message-ID: On Mon, Feb 28, 2011 at 3:39 AM, Dan Stanger wrote: > Hello Andrej, > I have tried to install on a Acer netbook I just bought, which runs Windows > 7 starter. xMaxima started but failed to start maxima. When I ran the > command line version I got the following: >> Error: File "../bin/win_signals.lisp" does not exist. >> While executing: CCL::%LOAD, in process listener(1). >> Type :GO to continue, :POP to abort, :R for a list of available restarts. >> If continued: Skip evaluation of (blockn (load "../bin/win_signals.lisp") >> (cl- > user::run)) >> Type :? for other options. > 1 > :go > Welcome to Clozure Common Lisp Version 1.7-dev-r14645M-trunk > ?(WindowsX8632)! > > The command (pwd) returns Windows/System32, so it is starting from the wrong > place. Also, when I tried to add the maxima image to the list of DEP > programs to ignore, since the file is named maxima.image, (doesn't end with > an .exe) the Windows browser does not find it. > Would you remind me what the command line maxima is trying to execute, and I > can continue to debug this. > Thanks, > Dan Hm, I think you did not download the latest version of the installer. I guess my dropbox did not sync the files correctly. Please download the installer again, this should be fixed now. Andrej From robert.dodier at gmail.com Mon Feb 28 00:21:48 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 27 Feb 2011 23:21:48 -0700 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: I;ve updated my sandbox with git pull origin git checkout origin/build-index+cl-ppcre nuked all maxima-index.lisp files, and ran make. maxima-index.lisp all look OK. In ISO-8859 locales, titles and content look OK. In UTF-8 locales, same behavior as before; titles look OK, content has garbled characters. I am launching a UTF-8 session via LC_ALL=foo.UTF-8 LANG=foo.UTF-8 konsole & and running maxima in that. If someone else is seeing special characters displayed correctly in UTF-8 locales -- how are you launching Maxima? FWIW Robert Dodier From LindnerW at t-online.de Mon Feb 28 04:48:31 2011 From: LindnerW at t-online.de (Wolfgang Lindner) Date: Mon, 28 Feb 2011 11:48:31 +0100 Subject: [Maxima] installer for maxima with ccl on windows Message-ID: <002d01cbd735$0d2d4420$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> hello Andrej, . no problems installing maxima-5.23.2.exe /ccl on Windows XP Home. . wxMaxima works as usual (thanks for working on it :) . calculating and plotting works as before beste Wolfgang -----Urspr?ngliche Nachricht----- Von: Andrej Vodopivec An: Maxima - list Datum: Sonntag, 27. Februar 2011 22:26 Betreff: [Maxima] installer for maxima with ccl on windows |I have uploaded an installer for maxima compiled with ccl to |http://dl.dropbox.com/u/3305126/maxima-5.23.2.exe | |Please try it so that we can see if ccl is a possible alternative for |gcl on Windows. The documentation is not built correctly but this is |not related to ccl. | |Andrej |_______________________________________________ |Maxima mailing list |Maxima at math.utexas.edu |http://www.math.utexas.edu/mailman/listinfo/maxima From andrej.vodopivec at gmail.com Mon Feb 28 05:38:31 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Mon, 28 Feb 2011 12:38:31 +0100 Subject: [Maxima] RE : installer for maxima with ccl on windows In-Reply-To: References: Message-ID: On Mon, Feb 28, 2011 at 11:28 AM, laurent couraud wrote: > > >> -----Message d'origine----- >> De?: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] De la part de >> Andrej Vodopivec >> Envoy??: lundi 28 f?vrier 2011 06:43 >> ??: Dan Stanger >> Cc?: Maxima - list >> Objet?: Re: [Maxima] installer for maxima with ccl on windows >> >> On Mon, Feb 28, 2011 at 3:39 AM, Dan Stanger wrote: >> > Hello Andrej, >> > I have tried to install on a Acer netbook I just bought, which runs Windows >> > 7 starter. xMaxima started but failed to start maxima. When I ran the >> > command line version I got the following: >> >> Error: File "../bin/win_signals.lisp" does not exist. >> >> While executing: CCL::%LOAD, in process listener(1). >> >> Type :GO to continue, :POP to abort, :R for a list of available restarts. >> >> If continued: Skip evaluation of (blockn (load "../bin/win_signals.lisp") >> >> (cl- >> > user::run)) >> >> Type :? for other options. >> > 1 > :go >> > Welcome to Clozure Common Lisp Version 1.7-dev-r14645M-trunk >> > ?(WindowsX8632)! >> > >> > The command (pwd) returns Windows/System32, so it is starting from the wrong >> > place. Also, when I tried to add the maxima image to the list of DEP >> > programs to ignore, since the file is named maxima.image, (doesn't end with >> > an .exe) the Windows browser does not find it. >> > Would you remind me what the command line maxima is trying to execute, and I >> > can continue to debug this. >> > Thanks, >> > Dan >> >> Hm, I think you did not download the latest version of the installer. >> I guess my dropbox did not sync the files correctly. Please download >> the installer again, this should be fixed now. >> >> Andrej > > Hello, > I try it too, > Executing maxima.bat I saw this: > > C:\Program Files\Maxima-ccl-5.23.2\bin>maxima.bat > This CPU doesn't support the SSE2 instruction set > CPU doesn't support required features > > It seems CCL can be executed only on sufficiently new computer. Yes, ccl requires a CPU with SSE2 support. I don't know how critical this is. How old is your computer? Andrej From dtc-maxima at scieneer.com Mon Feb 28 05:39:59 2011 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Mon, 28 Feb 2011 22:39:59 +1100 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: <4D6B898F.5090909@scieneer.com> > Try the tip again, please. > > The problem you saw was due to the Makefile script not correctly > setting the encoding in those directories. I am dimwitted enough > to assume that the make rules would have been written correctly. > > At the moment, what I see is: all index files are built with > clisp, cmucl and sbcl; my test script passes without error; > characters appear to be displayed correctly; and an index file > written by one lisp is read correctly by another. The maxima.info files appear to be double converted from ISO-8859-1 to UTF-8 which corrupts them. They are generated in UTF-8 and then converted to UTF-8 again. Possible patch attached. Regards Douglas Crosher -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: maxima-patch URL: From talon at lpthe.jussieu.fr Mon Feb 28 09:20:12 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Mon, 28 Feb 2011 16:20:12 +0100 Subject: [Maxima] linsolve_by_lu not documented References: <4D66E50C.8030107@ieee.org> Message-ID: Stefano Ferri wrote: > Well, I would certainly do that, but since I don't know the details of > the implementation I couldn't give more than an example... > > There is a small text announcement.txt in share/linearalgebra which explains what all this is about. It says: 5) LU factorization There is code for LU factorization. It uses partial pivoting when the matrix is numeric. Recall M=LU where L is lower triangular with 1 on the diagonal, and U is upper triangular. Then det(M) is easy to compute as the product of the diagonal U elements, and inversion is also easier: To solve MX=B one solves first LY=B, then UX=Y, both being triangular hence easy. Of course vanishing diagonal U elements cause problems, hence the "pivot" property. In the above announcement, such inversion is described with the example: niobe% maxima (%i1) m : hilbert_matrix(5)$ (%i2) m : lu_factor(m)$ (%i3) lu_backsub(m, matrix([1],[1],[1],[1],[1])); [ 5 ] [ ] [ - 120 ] [ ] (%o3) [ 630 ] [ ] [ - 1120 ] [ ] [ 630 ] (%i4) hilbert_matrix(5) . %; [ 1 ] [ ] [ 1 ] [ ] (%o4) [ 1 ] [ ] [ 1 ] [ ] [ 1 ] As you see applying m on %o3 reproduces b that is matrix([1],[1],[1],[1], [1]), hence %o3 is the solution of mx=b. Finally linsolve_by_lu defined in lu.lisp, just checks its arguments and calls lu_factor and lu_backsub as above. You can also specify a field for computations. (%i11) m : hilbert_matrix(5)$ (%i12) linsolve_by_lu(m,matrix([1],[1],[1],[1],[1])); [ 5 ] [ ] [ - 120 ] [ ] (%o12) [[ 630 ], false] [ ] [ - 1120 ] [ ] [ 630 ] Hope that helps documenting the function in question. In general for big inversion or determinant problems, doing firts the LU factorization seems to help keeping the problem manageable. -- Michel Talon From drdieterkaiser at web.de Mon Feb 28 12:33:34 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 28 Feb 2011 19:33:34 +0100 Subject: [Maxima] installer for maxima with ccl on windows In-Reply-To: References: Message-ID: <1298918014.1737.19.camel@dieter> Am Sonntag, den 27.02.2011, 22:26 +0100 schrieb Andrej Vodopivec: > I have uploaded an installer for maxima compiled with ccl to > http://dl.dropbox.com/u/3305126/maxima-5.23.2.exe > > Please try it so that we can see if ccl is a possible alternative for > gcl on Windows. The documentation is not built correctly but this is > not related to ccl. > > Andrej Hello Andrej, I have successfully downloaded and installed the CCL version of Maxima. I have run the testsuite and the share_testsuite. One testfile in the share_testsuite had a problem. Most of the tests failed. Furthermore, the output of the summary looked very strange. I have not the the output on my current computer. I will try to post the output later. Dieter Kaiser From drdieterkaiser at web.de Mon Feb 28 13:42:55 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 28 Feb 2011 20:42:55 +0100 Subject: [Maxima] installer for maxima with ccl on windows In-Reply-To: <1298918014.1737.19.camel@dieter> References: <1298918014.1737.19.camel@dieter> Message-ID: <1298922175.1737.23.camel@dieter> Am Montag, den 28.02.2011, 19:33 +0100 schrieb Dieter Kaiser: > Am Sonntag, den 27.02.2011, 22:26 +0100 schrieb Andrej Vodopivec: > > I have uploaded an installer for maxima compiled with ccl to > > http://dl.dropbox.com/u/3305126/maxima-5.23.2.exe > > > > Please try it so that we can see if ccl is a possible alternative for > > gcl on Windows. The documentation is not built correctly but this is > > not related to ccl. > > > > Andrej > > Hello Andrej, > > I have successfully downloaded and installed the CCL version of Maxima. > I have run the testsuite and the share_testsuite. One testfile in the > share_testsuite had a problem. Most of the tests failed. Furthermore, > the output of the summary looked very strange. I have not the the output > on my current computer. I will try to post the output later. I have tried to install the CCL version on a second Windows system. But I have got the message "This CPU doesn't support the SSE2 instruction set". Dieter Kaiser From andrej.vodopivec at gmail.com Mon Feb 28 14:02:42 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Mon, 28 Feb 2011 21:02:42 +0100 Subject: [Maxima] installer for maxima with ccl on windows In-Reply-To: <1298918014.1737.19.camel@dieter> References: <1298918014.1737.19.camel@dieter> Message-ID: On Mon, Feb 28, 2011 at 7:33 PM, Dieter Kaiser wrote: > Am Sonntag, den 27.02.2011, 22:26 +0100 schrieb Andrej Vodopivec: >> I have uploaded an installer for maxima compiled with ccl to >> http://dl.dropbox.com/u/3305126/maxima-5.23.2.exe >> >> Please try it so that we can see if ccl is a possible alternative for >> gcl on Windows. The documentation is not built correctly but this is >> not related to ccl. >> >> Andrej > > Hello Andrej, > > I have successfully downloaded and installed the CCL version of Maxima. > I have run the testsuite and the share_testsuite. One testfile in the > share_testsuite had a problem. Most of the tests failed. Furthermore, > the output of the summary looked very stranger. I have not the the output > on my current computer. I will try to post the output later. > > Dieter Kaiser I only get three errors in share_testsuite: Running tests in rtestprintf: ********************** Problem 27 *************** Input: printf(false, |~30|) Result: |foo bar baz| This differed from the expected result: |foo bar baz| ********************** Problem 54 *************** Input: printf(false, ~d ~v,v^~f , 0, 1, 2, 3) Result: 0 3.0S0 This differed from the expected result: 0 3.0 Running tests in rtest_hg: ********************** Problem 124 *************** Input: is(abs(nfloat(id, [a = %i + 1.67, b = - 56.5, x = 11.88 %i + 10.42], 15)) < 5.0E-14) Result: error-catch This differed from the expected result: true Andrej From alzerkong at gmail.com Tue Mar 1 08:51:19 2011 From: alzerkong at gmail.com (Alzer Kong) Date: Tue, 1 Mar 2011 14:51:19 +0000 Subject: [Maxima] Chebyshev Integration Message-ID: I was wondering how to use Maxima to integrate a Normal Distribution Function (1.0/sqrt(2.0*PI))*exp(-0.5*x*x), under the Clenshaw-Curtis or Chebyshev Integration Schema, WITHOUT any weight function. I'm using the above example to get used to Maxima in order to tackle a more protracted problem.. Namely, ideally I want to integrate a Chebyshev Fit for a set of points of a histogram distribution. i.e. calculate P( x <= b ), given that I already have the Chebyshev curve (and coefficients) that interpolates the data. There seems to be 2 approaches (a) compute the moments of the fitted curve and calculate the integral (b) Follow the suggestions albeit unclear in Numerical Recipies in C pp 196 - Clenshaw-Curtis Quatrature - paragraph 1. I'd like to use Maxima to benchmark my implementation. Any ideas on how I might solve this second problem in Maxima - namely integrating Chebyshev fitted PDFs ? Any if anybody has any pointers wrt it's implementation, I'd very much appreciate it. Kind regards, Alan -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Tue Mar 1 09:09:00 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 01 Mar 2011 07:09:00 -0800 Subject: [Maxima] Chebyshev Integration In-Reply-To: References: Message-ID: <4D6D0C0C.3060408@eecs.berkeley.edu> On 3/1/2011 6:51 AM, Alzer Kong wrote: > I was wondering how to use Maxima to integrate a Normal Distribution > Function > > (1.0/sqrt(2.0*PI))*exp(-0.5*x*x), > > under the Clenshaw-Curtis or Chebyshev Integration Schema, WITHOUT > any weight function. > > I'm using the above example to get used to Maxima in order to tackle a > more protracted problem.. > > Namely, ideally I want to integrate a Chebyshev Fit for a set of > points of a histogram distribution. i.e. calculate P( x <= b ), given > that I already have the Chebyshev curve (and coefficients) that > interpolates the data. There seems to be 2 approaches (a) compute the > moments of the fitted curve and calculate the integral (b) Follow the > suggestions albeit unclear in Numerical Recipies in C pp 196 - > Clenshaw-Curtis Quatrature - paragraph 1. > > I'd like to use Maxima to benchmark my implementation. Any ideas on > how I might solve this second problem in Maxima - namely integrating > Chebyshev fitted PDFs ? Any if anybody has any pointers wrt it's > implementation, I'd very much appreciate it. > > Kind regards, > Alan > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima 1. In maxima you'd better use %pi instead of PI. 2. If you want to compute a chebyshev approximation for your data, you presumably have some finite interval in mind. Computing via a discrete cosine transform is the fastest way, and can probably be done with the FFT in some fashion. I wrote some programs that use some pre-packaged DCT and are maybe 75 times faster. 3. Integrating a chebyshev series is pretty easy. 4. If you are benchmarking because speed is important, you may find Maxima slow. If you are benchmarking because programming time is important, not clear. I will send you a file (not to whole list..) RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Tue Mar 1 13:45:06 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 01 Mar 2011 14:45:06 -0500 Subject: [Maxima] Chebyshev Integration In-Reply-To: References: Message-ID: ?I was wondering how to use Maxima to integrate a Normal Distribution Function (1.0/sqrt(2.0*PI))*exp(-0.5*x*x), under the Clenshaw-Curtis or Chebyshev Integration Schema, WITHOUT any weight function. I'm using the above example to get used to Maxima in order to tackle a more protracted problem.. Namely, ideally I want to integrate a Chebyshev Fit for a set of points of a histogram distribution. i.e. calculate P( x <= b ), given that I already have the Chebyshev curve (and coefficients) that interpolates the data. There seems to be 2 approaches (a) compute the moments of the fitted curve and calculate the integral (b) Follow the suggestions albeit unclear in Numerical Recipies in C pp 196 - Clenshaw-Curtis Quatrature - paragraph 1. I'd like to use Maxima to benchmark my implementation. Any ideas on how I might solve this second problem in Maxima - namely integrating Chebyshev fitted PDFs ? Any if anybody has any pointers wrt it's implementation, I'd very much appreciate it. Kind regards, Alan? I am guessing that you have something like a series of functions fitting the points at different intervals. Taking an example from interpol.mac which can do cubic splines. You can do this. You will need pw.mac too. (%i6) load(interpol); (out6) C:/Maxima-5.23.2/share/maxima/5.23.2/share/numeric/interpol.mac (%i7) load(pw); (out7) C:/Maxima-5.23.2/share/maxima/5.23.2/share/contrib/pw.mac (%i8) P:[[2,4],[4,8],[5,8],[6,4]]; (out8) [[2, 4], [4, 8], [5, 8], [6, 4]] (%i9) cspline(P)$ (%i10) pwint(%,x,2,6); 618 --- 23 In your case you would want to use pw.mac?s between() function instead of charfun2. for example. f1(x)*between(x,minf,2)+f2(x)*between(x,2,3)+f3(x)*between(x,3,6) pwint(%,x,a,b); where f1, f2 and f3 are Chebyshev polynomials. Rich pw.mac is available from here. http://maxima-project.org/wiki/index.php?title=Pw.mac -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdieterkaiser at web.de Tue Mar 1 14:59:30 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 01 Mar 2011 21:59:30 +0100 Subject: [Maxima] installer for maxima with ccl on windows In-Reply-To: References: <1298918014.1737.19.camel@dieter> Message-ID: <1299013170.1673.6.camel@dieter> This is my result for the testsuite. The tests run without an error, but at the end I get an unexpected output. (%i2) build_info(); Maxima version: 5.23.2 Maxima build date: 20:27 2/27/2011 Host type: i686-pc-mingw32 Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.7-dev-r14645M-trunk (WindowsX8632) (%o2) (%i3) run_testsuite(); [...] No unexpected errors found out of 8,720 tests. (LOOP WITH ERRS = 'NIL FOR TESTENTRY IN TESTS-TO-RUN DO (IF (ATOM TESTENTRY) (PR OGN (SETF TEST-FILE TESTENTRY) (SETF EXPECTED-FAILURES NIL)) (PROGN (SETF TEST-F ILE (SECOND TESTENTRY)) (SETF EXPECTED-FAILURES (CDDR TESTENTRY)))) (FORMAT T (I NTL:GETTEXT "Running tests in ~a: ") (IF (SYMBOLP TEST-FILE) (SUBSEQ (PRINT-INVE RT-CASE TEST-FILE) 1) TEST-FILE)) (OR (ERRSET (PROGN (MULTIPLE-VALUE-SETQ (TESTR ESULT TEST-COUNT) (TEST-BATCH ($FILE_SEARCH TEST-FILE $FILE_SEARCH_TESTS) EXPECT ED-FAILURES :SHOW-EXPECTED DISPLAY_KNOWN_BUGS :SHOW-ALL DISPLAY_ALL :SHOWTIME TI ME)) (SETF TESTRESULT (REST TESTRESULT)) (INCF TOTAL-COUNT TEST-COUNT) (WHEN TES TRESULT (INCF ERROR-COUNT (LENGTH (CDR TESTRESULT))) (SETQ ERRS (APPEND ERRS (LI ST TESTRESULT)))))) (PROGN (SETQ ERROR-BREAK-FILE (FORMAT NIL "~a" TEST-FILE)) ( SETQ ERRS (APPEND ERRS (LIST (LIST ERROR-BREAK-FILE "error break")))) (FORMAT T (INTL:GETTEXT "~%Caused an error break: ~a~%") TEST-FILE))) FINALLY (COND ((NULL ERRS) (FORMAT T (INTL:GETTEXT "~%~%No unexpected errors found out of ~:D tests. ~%") TOTAL-COUNT)) (T (FORMAT T (INTL:GETTEXT "~%Error summary:~%")) (MAPCAR #'( LAMBDA (X) (LET ((S (IF (> (LENGTH (REST X)) 1) "s" ""))) (FORMAT T (INTL:GETTEX T "Error~a found in ~a, problem~a:~%~a~%") S (FIRST X) S (SORT (REST X) #'<)))) ERRS) (FORMAT T (INTL:GETTEXT "~&~:D test~P failed out of ~:D total tests.~%") E RROR-COUNT ERROR-COUNT TOTAL-COUNT)))) took 1,007,172 milliseconds (1007.172 sec onds) to run with 2 available CPU cores. During that period, 953,984 milliseconds (953.984 seconds) were spent in user mo de 8,265 milliseconds (8.265 seconds) were spent in system mode 47,625 milliseconds (47.625 seconds) was spent in GC. 9,501,617,839 bytes of memory allocated. (%o0) done --------------------------------------------------------------------- And this is my result for the share_testsuite: Error summary: Error#1=s found in d:/Programme/Maxima-5.23.2/share/maxima/5.23.2/share/contrib/ stringproc/rtestprintf.mac, problem#1#: (27 54) Error#1=s found in d:/Programme/Maxima-5.23.2/share/maxima/5.23.2/share/contrib/ graphs/rtest_graphs.mac, problem#1#: (1 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 67 68 70 71 72 74 75 76 78 79 80 81 82 84 85 86 87 89 90 9 1) 85 tests failed out of 3,151 total tests. (LOOP WITH ERRS = 'NIL FOR TESTENTRY IN TESTS-TO-RUN DO (IF (ATOM TESTENTRY) (PR OGN (SETF TEST-FILE TESTENTRY) (SETF EXPECTED-FAILURES NIL)) (PROGN (SETF TEST-F ILE (SECOND TESTENTRY)) (SETF EXPECTED-FAILURES (CDDR TESTENTRY)))) (FORMAT T (I NTL:GETTEXT "Running tests in ~a: ") (IF (SYMBOLP TEST-FILE) (SUBSEQ (PRINT-INVE RT-CASE TEST-FILE) 1) TEST-FILE)) (OR (ERRSET (PROGN (MULTIPLE-VALUE-SETQ (TESTR ESULT TEST-COUNT) (TEST-BATCH ($FILE_SEARCH TEST-FILE $FILE_SEARCH_TESTS) EXPECT ED-FAILURES :SHOW-EXPECTED DISPLAY_KNOWN_BUGS :SHOW-ALL DISPLAY_ALL :SHOWTIME TI ME)) (SETF TESTRESULT (REST TESTRESULT)) (INCF TOTAL-COUNT TEST-COUNT) (WHEN TES TRESULT (INCF ERROR-COUNT (LENGTH (CDR TESTRESULT))) (SETQ ERRS (APPEND ERRS (LI ST TESTRESULT)))))) (PROGN (SETQ ERROR-BREAK-FILE (FORMAT NIL "~a" TEST-FILE)) ( SETQ ERRS (APPEND ERRS (LIST (LIST ERROR-BREAK-FILE "error break")))) (FORMAT T (INTL:GETTEXT "~%Caused an error break: ~a~%") TEST-FILE))) FINALLY (COND ((NULL ERRS) (FORMAT T (INTL:GETTEXT "~%~%No unexpected errors found out of ~:D tests. ~%") TOTAL-COUNT)) (T (FORMAT T (INTL:GETTEXT "~%Error summary:~%")) (MAPCAR #'( LAMBDA (X) (LET ((S (IF (> (LENGTH (REST X)) 1) "s" ""))) (FORMAT T (INTL:GETTEX T "Error~a found in ~a, problem~a:~%~a~%") S (FIRST X) S (SORT (REST X) #'<)))) ERRS) (FORMAT T (INTL:GETTEXT "~&~:D test~P failed out of ~:D total tests.~%") E RROR-COUNT ERROR-COUNT TOTAL-COUNT)))) took 1,364,329 milliseconds (1364.329 sec onds) to run with 2 available CPU cores. During that period, 1,330,703 milliseconds (1330.703 seconds) were spent in user mode 6,984 milliseconds (6.984 seconds) were spent in system mode 54,657 milliseconds (54.657 seconds) was spent in GC. 10,898,409,889 bytes of memory allocated. (%o0) d:/Programme/Maxima-5.23.2/share/maxima/5.23.2/share/share_testsuite.mac Dieter Kaiser From toy.raymond at gmail.com Tue Mar 1 15:23:07 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 01 Mar 2011 16:23:07 -0500 Subject: [Maxima] installer for maxima with ccl on windows In-Reply-To: <1299013170.1673.6.camel@dieter> References: <1298918014.1737.19.camel@dieter> <1299013170.1673.6.camel@dieter> Message-ID: <4D6D63BB.5090807@gmail.com> On 3/1/11 3:59 PM, Dieter Kaiser wrote: > This is my result for the testsuite. The tests run without an error, but > at the end I get an unexpected output. > > (%i2) build_info(); > > Maxima version: 5.23.2 > Maxima build date: 20:27 2/27/2011 > Host type: i686-pc-mingw32 > Lisp implementation type: Clozure Common Lisp > Lisp implementation version: Version 1.7-dev-r14645M-trunk > (WindowsX8632) > > (%o2) > (%i3) run_testsuite(); > > [...] > > No unexpected errors found out of 8,720 tests. > (LOOP WITH ERRS = 'NIL FOR TESTENTRY IN TESTS-TO-RUN DO (IF (ATOM If you're talking about this part, this is expected. It seems that the TIME macro in ccl will print out the form that is being timed. And since the pretty printer is disabled, the form is displayed in way that's really hard to read. This happens on my Mac as well. Ray From l.butler at ed.ac.uk Tue Mar 1 15:31:09 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 1 Mar 2011 21:31:09 +0000 (GMT) Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: On Sun, 27 Feb 2011, Robert Dodier wrote: < I;ve updated my sandbox with < < git pull origin < git checkout origin/build-index+cl-ppcre < < nuked all maxima-index.lisp files, and ran make. < < maxima-index.lisp all look OK. < < In ISO-8859 locales, titles and content look OK. < < In UTF-8 locales, same behavior as before; < titles look OK, content has garbled characters. < < I am launching a UTF-8 session via < < LC_ALL=foo.UTF-8 LANG=foo.UTF-8 konsole & < < and running maxima in that. < If someone else is seeing special characters displayed < correctly in UTF-8 locales -- how are you launching Maxima? Perhaps I was running the wrong/incomparable test: Non utf8: inside an xterm. Utf8: inside an emacs shell running in an xterm. I do not set the locale, my locale is en_GB.iso88591. --- Following Doug Crosher's suggestion, I added a flag to cut-out the recoding of utf8 info files, and checked this in. In a cloned repo, after making all the info and index files, when I run the script tests/rtest-build-index.sh in tests/ with LISPS="cmucl clisp sbcl" VERBOSE=1 bash ./rtest-build-index.sh I see the special characters displayed in what appears to be a correct fashion for all encodings and all lisps listed on the command line in both an xterm and a gnome-terminal. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From toy.raymond at gmail.com Tue Mar 1 15:40:53 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 01 Mar 2011 16:40:53 -0500 Subject: [Maxima] foreign language patch for build-index+cl-ppcre branch In-Reply-To: References: Message-ID: <4D6D67E5.4010303@gmail.com> On 2/28/11 1:21 AM, Robert Dodier wrote: > I am launching a UTF-8 session via > > LC_ALL=foo.UTF-8 LANG=foo.UTF-8 konsole & > > and running maxima in that. > If someone else is seeing special characters displayed > correctly in UTF-8 locales -- how are you launching Maxima? It seems to be working for me. In OSX Terminal, I do export LANG=de.UTF-8 maxima-local :lisp (stream:set-system-external-format :utf8) ; cmucl fix ? additive It looks like the correct German characters. At least it's not just a ? as before. The cmucl fix is to tell cmucl that we want to output the strings using utf8. Otherwise it will default to iso8859-1 and the output would be messed up. Ray From nbruin at cecm.sfu.ca Tue Mar 1 19:29:37 2011 From: nbruin at cecm.sfu.ca (Nils Bruin) Date: Tue, 1 Mar 2011 17:29:37 -0800 (PST) Subject: [Maxima] Progressive slowdown Message-ID: Dear maxima developers, This was observed with Maxima 5.23.2 on ECL 11.1.1 on 64bit linux: The following code shows a progressive slowdown: assume(y>1); while true do block([t,I,j], t: absolute_real_time(), for j: 1 step 1 thru 100 do I: integrate(log(x^2+y^2),x,0,1), print(absolute_real_time()-t)); Typical output is something like: 13 17 24 30 But this doesn't occur for all integrals, for instance for: while true do block([t,I,j], t: absolute_real_time(), for j: 1 step 1 thru 1000 do I: integrate(cos(x^2)*sin(x),x), print(absolute_real_time()-t)); we get the flat behaviour one would hope for: 24 25 26 25 25 Is there a good reason for this behaviour? Is this only for ECL? Does it point to a leak somewhere? Kind regards, Nils Bruin From dlakelan at street-artists.org Tue Mar 1 20:35:45 2011 From: dlakelan at street-artists.org (dlakelan) Date: Tue, 01 Mar 2011 18:35:45 -0800 Subject: [Maxima] Chebyshev Integration In-Reply-To: References: Message-ID: <4D6DAD01.1030606@street-artists.org> On 03/01/2011 06:51 AM, Alzer Kong wrote: > I was wondering how to use Maxima to integrate a Normal Distribution > Function > > (1.0/sqrt(2.0*PI))*exp(-0.5*x*x), > > under the Clenshaw-Curtis or Chebyshev Integration Schema, WITHOUT any > weight function. > > I'm using the above example to get used to Maxima in order to tackle a > more protracted problem.. > > Namely, ideally I want to integrate a Chebyshev Fit for a set of points > of a histogram distribution. i.e. calculate P( x <= b ), given that I > already have the Chebyshev curve (and coefficients) that interpolates > the data. There is nothing that prevents your chebyshev approximation from having negative values which is meaningless for a PDF. You may prefer to model the logarithm of the density as a chebyshev, and then use e^x to get the pdf. From O.Kullmann at swansea.ac.uk Wed Mar 2 04:13:04 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Wed, 2 Mar 2011 10:13:04 +0000 Subject: [Maxima] Progressive slowdown In-Reply-To: References: Message-ID: <20110302101304.GC2772@cs-wsok.swansea.ac.uk> Hi, I also observed such slowdown over time, with completely different computations (I'm also using Ecl; don't know whether it has to do with that). Oliver P.S. The slowdown can become very drastic, a factor of 10 or so. On Tue, Mar 01, 2011 at 05:29:37PM -0800, Nils Bruin wrote: > Dear maxima developers, > > This was observed with Maxima 5.23.2 on ECL 11.1.1 on 64bit linux: > > The following code shows a progressive slowdown: > > assume(y>1); > while true do block([t,I,j], > t: absolute_real_time(), > for j: 1 step 1 thru 100 do I: integrate(log(x^2+y^2),x,0,1), > print(absolute_real_time()-t)); > > Typical output is something like: > > 13 > 17 > 24 > 30 > > But this doesn't occur for all integrals, for instance for: > > while true do block([t,I,j], > t: absolute_real_time(), > for j: 1 step 1 thru 1000 do I: integrate(cos(x^2)*sin(x),x), > print(absolute_real_time()-t)); > > we get the flat behaviour one would hope for: > > 24 > 25 > 26 > 25 > 25 > > Is there a good reason for this behaviour? Is this only for ECL? Does it > point to a leak somewhere? > > Kind regards, > > Nils Bruin > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From rswarbrick at gmail.com Wed Mar 2 05:33:49 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 02 Mar 2011 11:33:49 +0000 Subject: [Maxima] Progressive slowdown References: Message-ID: Nils Bruin writes: > Dear maxima developers, > > This was observed with Maxima 5.23.2 on ECL 11.1.1 on 64bit linux: > > The following code shows a progressive slowdown: > > assume(y>1); > while true do block([t,I,j], > t: absolute_real_time(), > for j: 1 step 1 thru 100 do I: integrate(log(x^2+y^2),x,0,1), > print(absolute_real_time()-t)); > > Typical output is something like: > > 13 > 17 > 24 > 30 It seems to also happen on SBCL: Maxima 5.23post http://maxima.sourceforge.net using Lisp SBCL 1.0.46.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) assume(y>1); (%o1) [y > 1] (%i2) while true do block([t,I,j], t: absolute_real_time(), for j: 1 step 1 thru 100 do I: integrate(log(x^2+y^2),x,0,1), print(absolute_real_time()-t)); 9 11 13 14 16 18 22 24 25 (this is on a not-very-fast laptop. If you're worried about the speed of some of your calculations, it looks like a short-term cheat might be to switch lisps!) Running a garbage collection didn't seem to make much difference, so I presume it's not exactly a memory *leak*, but maybe we're storing some state in the integrator we don't need. Hmm. (%i3) :lisp (sb-ext:gc :full t) NIL (%i3) while true do block([t,I,j], t: absolute_real_time(), for j: 1 step 1 thru 100 do I: integrate(log(x^2+y^2),x,0,1), print(absolute_real_time()-t)); 26 29 Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From eric.reyssat at unicaen.fr Wed Mar 2 05:48:20 2011 From: eric.reyssat at unicaen.fr (Eric Reyssat) Date: Wed, 02 Mar 2011 12:48:20 +0100 Subject: [Maxima] Progressive slowdown In-Reply-To: References: Message-ID: <4D6E2E84.6010803@unicaen.fr> CLISP looks ok in maxima 5.20.1 : (%i4) build_info(); 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) (%o4) (%i5) while true do block([t,I,j], t: absolute_real_time(), for j: 1 step 1 thru 100 do I: integrate(log(x^2+y^2),x,0,1), print(absolute_real_time()-t)); 19 19 19 19 19 19 18 Eric From macrakis at alum.mit.edu Wed Mar 2 06:22:08 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 2 Mar 2011 07:22:08 -0500 Subject: [Maxima] Progressive slowdown In-Reply-To: <4D6E2E84.6010803@unicaen.fr> References: <4D6E2E84.6010803@unicaen.fr> Message-ID: No problem in Maxima 5.21.1 on GCL 2.6.8. (see below) Maybe garbage collector bugs in ECL and SBCL? -- but why would two independent implementations have this strange bug? BTW, are ECL and CLISP really that much slower than GCL, or are you using slow computers? Mine is an E8400 chip (3 years old, 3GHz). Not that speed matters much for Maxima in the common usage scenarios. -s Maxima 5.21.1 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) assume(y>1); while true do block([t,I,j], t: absolute_real_time(), for j: 1 step 1 thru 100 do I: integrate(log(x^2+y^2),x,0,1), print(absolute_real_time()-t)); (%o1) [y > 1] (%i2) 4 4 3 4 3 4 4 3 3 4 3 4 3 4 3 4 4 3 4 3 4 3 4 3 4 3 4 3 4 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 4 3 3 4 3 4 3 4 3 4 3 4 4 3 4 3 3 4 4 3 4 3 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 4 3 3 4 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 4 3 3 4 4 3 4 3 4 4 3 3 4 3 4 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 3 4 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 3 4 4 3 4 Maxima encountered a Lisp error: Console interrupt. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i3) On Wed, Mar 2, 2011 at 06:48, Eric Reyssat wrote: > CLISP looks ok in maxima 5.20.1 : > > (%i4) build_info(); > 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) > > (%o4) > (%i5) while true do block([t,I,j], > > t: absolute_real_time(), > for j: 1 step 1 thru 100 do I: integrate(log(x^2+y^2),x,0,1), > print(absolute_real_time()-t)); > > 19 > 19 > 19 > 19 > 19 > 19 > 18 > Eric > > _______________________________________________ > 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 andrej.vodopivec at gmail.com Wed Mar 2 06:46:54 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Wed, 2 Mar 2011 13:46:54 +0100 Subject: [Maxima] Progressive slowdown In-Reply-To: References: <4D6E2E84.6010803@unicaen.fr> Message-ID: On Wed, Mar 2, 2011 at 1:22 PM, Stavros Macrakis wrote: > No problem in Maxima 5.21.1 on GCL 2.6.8. (see below) ?Maybe garbage > collector bugs in ECL and SBCL? -- but why would two independent > implementations have this strange bug? > BTW, are ECL and CLISP really that much slower than GCL, or are you using > slow computers??Mine is an E8400 chip (3 years old, 3GHz). ?Not that speed > matters much for Maxima in the common usage scenarios. > ?? ? ? ? ? ? ? ? ?-s > > Maxima 5.21.1 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) assume(y>1); > while true do block([t,I,j], > ?t: absolute_real_time(), > ?for j: 1 step 1 thru 100 do I: integrate(log(x^2+y^2),x,0,1), > ?print(absolute_real_time()-t)); > (%o1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?[y > 1] > (%i2) > 4 > 4 > 3 This is more likely a regression in maxima. I get very different results with maxima 5.20 (ccl 1.4) and 5.23 (ccl 1.7-svn) on the same computer. Andrej ------------------------------------------------------------ (%i1) assume(y>1); while true do block([t,I,j], t: absolute_real_time(), for j: 1 step 1 thru 100 do I: integrate(log(x^2+y^2),x,0,1), print(absolute_real_time()-t)); (%o1) [y>1] 7 7 7 8 7 7 7 7 7 7 8 7 7 7 interrupt -- an error. To debug this try: debugmode(true); (%i3) build_info(); Maxima version: 5.20.0 Maxima build date: 1:1 12/13/2009 Host type: i686-pc-mingw32 Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.4-r13122 (WindowsX8632) ------------------------------------------------------------ (%i1) assume(y>1); while true do block([t,I,j], t: absolute_real_time(), for j: 1 step 1 thru 100 do I: integrate(log(x^2+y^2),x,0,1), print(absolute_real_time()-t)); (%o1) [y>1] 15 22 30 37 45 52 Maxima encountered a Lisp error: interrupt signal Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i3) build_info(); Maxima version: 5.23.2 Maxima build date: 20:27 2/27/2011 Host type: i686-pc-mingw32 Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.7-dev-r14645M-trunk (WindowsX8632) (%o3) From robert.dodier at gmail.com Wed Mar 2 09:48:57 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 2 Mar 2011 08:48:57 -0700 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings Message-ID: I've updated my sandbox to revision 9c49048 and built Maxima. I'm seeing the same behavior today as I did a day or two ago; titles & content is displayed correctly in ISO-8859 locales, in UTF-8 locales, titles are correct and content is messed up. I guess that the encoding for the content is set incorrectly. I don't know how the encoding for the titles could be correct and the content incorrect. As it happens, the code for the existing describe system in src/cl-info.lisp doesn't bother with encodings at all; it falls on the Lisp implementation to figure out the encoding. That scheme displays titles & content correctly in ISO-8859 and UTF-8 locales so far as I know. That suggests that the encoding stuff in src/build-index.lisp could be simplified. Just a guess. FWIW Robert Dodier From l.butler at ed.ac.uk Wed Mar 2 11:12:43 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 2 Mar 2011 17:12:43 +0000 (GMT) Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: Message-ID: On Wed, 2 Mar 2011, Robert Dodier wrote: < I've updated my sandbox to revision 9c49048 and built Maxima. < I'm seeing the same behavior today as I did a day or two ago; < titles & content is displayed correctly in ISO-8859 locales, < in UTF-8 locales, titles are correct and content is messed up. < < I guess that the encoding for the content is set incorrectly. < I don't know how the encoding for the titles could be correct < and the content incorrect. Because they use differenct functions to write their output. The output to *standard-output* is being written with the wrong encoding for you (but not me). Could you try Ray's cmucl fix, please. < < As it happens, the code for the existing describe system < in src/cl-info.lisp doesn't bother with encodings at all; < it falls on the Lisp implementation to figure out the encoding. < That scheme displays titles & content correctly in ISO-8859 < and UTF-8 locales so far as I know. It would be nice if you would test this supposition, so we can know for certain. < That suggests that the encoding stuff in src/build-index.lisp < could be simplified. Just a guess. And now we go full circle back to Ray's initial idea. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From talon at lpthe.jussieu.fr Wed Mar 2 11:42:52 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 02 Mar 2011 18:42:52 +0100 Subject: [Maxima] Outputting C code from maxima Message-ID: Hello, as an exercise in learning some lisp i have written lisp code outputting C translations of lisp expressions, modelled after the fortran command (and having the same limitations, that is less powerful than the analogous command in maple). It can be downloaded from http://www.lpthe.jussieu.fr/~talon/cgrind.lisp I have tested the C generation on the various code paths i can imagine, but i would be happy of feedback, and eventually of inclusion in maxima, if it works OK. By the way, i have gained some understanding of the main grind function (msize x l r lop rop) that i can share if someone is interested. -- Michel Talon From nbruin at cecm.sfu.ca Wed Mar 2 13:51:54 2011 From: nbruin at cecm.sfu.ca (Nils Bruin) Date: Wed, 2 Mar 2011 11:51:54 -0800 (PST) Subject: [Maxima] Progressive slowdown In-Reply-To: <20110302101304.GC2772@cs-wsok.swansea.ac.uk> References: <20110302101304.GC2772@cs-wsok.swansea.ac.uk> Message-ID: On Wed, 2 Mar 2011, Oliver Kullmann wrote: > I also observed such slowdown over time, with completely > different computations (I'm also using Ecl; don't know whether > it has to do with that). That might be due to the fact that with interactive use, there is always a slowdown by default due to the label generation and the storing of previous results: python < References: Message-ID: OK, when I launch xterm with LC_ALL=foo LANG=foo xterm and then run Maxima 5.21.1 in that, describe text (titles and content) is displayed correctly in both ISO-8859 and UTF-8 locales. What was Ray's original proposal? I don't remember. At any rate, it occurs to me now that it seems possible to use CL-PPCRE to construct the index, but use the existing code to display stuff. The one wrinkle is that the existing index has a byte offset + character length (i.e. not both byte counts nor both character counts). That's to accomodate Lisp -- FILE-POSITION wants a byte count, and READ wants a character count. FWIW Robert Dodier On 3/2/11, Leo Butler wrote: > > > On Wed, 2 Mar 2011, Robert Dodier wrote: > > < I've updated my sandbox to revision 9c49048 and built Maxima. > < I'm seeing the same behavior today as I did a day or two ago; > < titles & content is displayed correctly in ISO-8859 locales, > < in UTF-8 locales, titles are correct and content is messed up. > < > < I guess that the encoding for the content is set incorrectly. > < I don't know how the encoding for the titles could be correct > < and the content incorrect. > > Because they use differenct functions to write their output. > The output to *standard-output* is being written with the > wrong encoding for you (but not me). Could you try Ray's > cmucl fix, please. > > < > < As it happens, the code for the existing describe system > < in src/cl-info.lisp doesn't bother with encodings at all; > < it falls on the Lisp implementation to figure out the encoding. > < That scheme displays titles & content correctly in ISO-8859 > < and UTF-8 locales so far as I know. > > It would be nice if you would test this supposition, so we > can know for certain. > > < That suggests that the encoding stuff in src/build-index.lisp > < could be simplified. Just a guess. > > And now we go full circle back to Ray's initial idea. > > Leo > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > From fateman at eecs.berkeley.edu Wed Mar 2 15:36:52 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 02 Mar 2011 13:36:52 -0800 Subject: [Maxima] Progressive slowdown In-Reply-To: References: <20110302101304.GC2772@cs-wsok.swansea.ac.uk> Message-ID: <4D6EB874.1080109@eecs.berkeley.edu> I think it may be important to take note of the front end in use. For some situations, the length of the transcript of the session so far can affect the time. I hope this has not affected the current question/answer thread. \begin{speculation} It is possible that several lisps have the same style of garbage collector and that the particular operations being timed play into a good or bad situation for that style. For example, the 'conservative' garbage collector may suffer sometimes if memory-in-use gets scattered, since it does not compact storage. Generation scavenging / compacting garbage collectors are often much superior though they too can be put in a disadvantageous situation. Since many people don't run Lisp systems for very very long times, the differences don't show up, and so the performance seems the same in benchmarks, even though one system may be "asymptotically" quite different from another. If someone could identify the styles of GC for each of the tested lisps, and also make sure that they are running the same exact version of Maxima, that might help. \end{speculation} RJF From dtc-maxima at scieneer.com Wed Mar 2 16:59:56 2011 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Thu, 03 Mar 2011 09:59:56 +1100 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: Message-ID: <4D6ECBEC.6090700@scieneer.com> Using a byte offset to position in a character file, exploiting broken implementations of 'file-offset, does not seem a good approach. At any time the broken implementations could correct 'file-offset and Maxima would then look up the wrong location. The SCL, and it would also seem CMUCL, do correctly position in a character file so currently return text from the wrong location. It is frustrating that 'file-position is inconsistent with the number of characters read in some CL implementations. It would seem like a bug, but is easy to work around. Leo's code reads the entire file into a string and then extracts characters from the string using a character offset, avoiding 'file-position. Alternatively are 'read-char loop could be used for broken implementations. I note that CLISP and SBCL seem to have issues here, while the SCL and it would also seem CMUCL can correctly position in a character file. Here's a test: (let ((text1 (make-string 100)) (text2 (make-string 100)) (file "doc/info/es.utf8/maxima.info-1") (pos 22071)) (with-open-file (in file :direction :input :external-format #+clisp "utf-8" #-clisp :utf-8) (file-position in 22071) (read-sequence text1 in :start 0 :end 100)) (with-open-file (in file :direction :input :external-format #+clisp "utf-8" #-clisp :utf-8) (dotimes (i pos) (read-char in)) (read-sequence text2 in :start 0 :end 100)) (if (string= text1 text2) "OK" "Broken")) SCL: OK CMUCL: OK CLISP: Broken SBCL: Broken Separate documents and indexes are being generated for each codeset (iso-8859-1, utf-8), but I assume that most CL implementations could read in a utf-8 file and then write out the text in the current codeset, and this would make the build smaller and easier, and also allow the user more flexibility. If all the supported languages could use iso-8859-1 then this could also be used to store the info documents. Were there any issues in doing this? Regards Douglas Crosher On 03/03/11 08:29, Robert Dodier wrote: > OK, when I launch xterm with > LC_ALL=foo LANG=foo xterm > and then run Maxima 5.21.1 in that, describe text > (titles and content) is displayed correctly in both > ISO-8859 and UTF-8 locales. > > What was Ray's original proposal? I don't remember. > > At any rate, it occurs to me now that it seems possible to use > CL-PPCRE to construct the index, but use the existing > code to display stuff. The one wrinkle is that the existing > index has a byte offset + character length (i.e. not both byte counts > nor both character counts). That's to accomodate Lisp -- FILE-POSITION wants > a byte count, and READ wants a character count. > > FWIW > > Robert Dodier > > On 3/2/11, Leo Butler wrote: >> >> >> On Wed, 2 Mar 2011, Robert Dodier wrote: >> >> < I've updated my sandbox to revision 9c49048 and built Maxima. >> < I'm seeing the same behavior today as I did a day or two ago; >> < titles& content is displayed correctly in ISO-8859 locales, >> < in UTF-8 locales, titles are correct and content is messed up. >> < >> < I guess that the encoding for the content is set incorrectly. >> < I don't know how the encoding for the titles could be correct >> < and the content incorrect. >> >> Because they use differenct functions to write their output. >> The output to *standard-output* is being written with the >> wrong encoding for you (but not me). Could you try Ray's >> cmucl fix, please. >> >> < >> < As it happens, the code for the existing describe system >> < in src/cl-info.lisp doesn't bother with encodings at all; >> < it falls on the Lisp implementation to figure out the encoding. >> < That scheme displays titles& content correctly in ISO-8859 >> < and UTF-8 locales so far as I know. >> >> It would be nice if you would test this supposition, so we >> can know for certain. >> >> < That suggests that the encoding stuff in src/build-index.lisp >> < could be simplified. Just a guess. >> >> And now we go full circle back to Ray's initial idea. >> >> Leo >> >> -- >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From toy.raymond at gmail.com Wed Mar 2 19:56:50 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 02 Mar 2011 20:56:50 -0500 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: Message-ID: <4D6EF562.5010303@gmail.com> On 3/2/11 4:29 PM, Robert Dodier wrote: > OK, when I launch xterm with > LC_ALL=foo LANG=foo xterm > and then run Maxima 5.21.1 in that, describe text > (titles and content) is displayed correctly in both > ISO-8859 and UTF-8 locales. > > What was Ray's original proposal? I don't remember. I think Leo is referring to my comment about treating the info files as streams of octets. You mentioned earlier that this is how the existing system works. Ray From toy.raymond at gmail.com Wed Mar 2 20:52:08 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 02 Mar 2011 21:52:08 -0500 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: <4D6ECBEC.6090700@scieneer.com> References: <4D6ECBEC.6090700@scieneer.com> Message-ID: <4D6F0258.4060009@gmail.com> On 3/2/11 5:59 PM, Douglas Crosher wrote: > > Using a byte offset to position in a character file, exploiting broken > implementations of 'file-offset, does not seem a good approach. At > any time the broken implementations could correct 'file-offset and > Maxima would then look up the wrong location. > > The SCL, and it would also seem CMUCL, do correctly position in a > character file so currently return text from the wrong location. I'm surprised this works in cmucl. FILE-POSITION in cmucl is the octet position, not the character position. For variable length encodings, how do you position by character other than by, more or less, reading every character? Could be a bug in CMUCL. > > It is frustrating that 'file-position is inconsistent with the number > of characters read in some CL implementations. It would seem like a > bug, but is easy to work around. Leo's code reads the entire file > into a string and then extracts characters from the string using a > character offset, avoiding 'file-position. Alternatively are > 'read-char loop could be used for broken implementations. I have a vague memory that the original info system did read in the entire file. This was the version before Robert created the current system. Ray From smh at franz.com Wed Mar 2 20:55:22 2011 From: smh at franz.com (Steve Haflich) Date: Wed, 02 Mar 2011 18:55:22 -0800 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: <4D6F0258.4060009@gmail.com> References: <4D6ECBEC.6090700@scieneer.com> <4D6F0258.4060009@gmail.com> Message-ID: <4433.1299120922@gemini.franz.com> Please read the ANS about file position. There are good reasons it is defined the way it is. If it were strictly defined to operate on character position rather than allowing monotonic octet position, it would be impossible to seek to a particular place on a variable-width-character stream without rereading the entire stream (or maintaining some complex binary tables). From robert.dodier at gmail.com Wed Mar 2 20:59:35 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 2 Mar 2011 19:59:35 -0700 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: <4D6EF562.5010303@gmail.com> References: <4D6EF562.5010303@gmail.com> Message-ID: On 3/2/11, Raymond Toy wrote: > On 3/2/11 4:29 PM, Robert Dodier wrote: >> OK, when I launch xterm with >> LC_ALL=foo LANG=foo xterm >> and then run Maxima 5.21.1 in that, describe text >> (titles and content) is displayed correctly in both >> ISO-8859 and UTF-8 locales. >> >> What was Ray's original proposal? I don't remember. > I think Leo is referring to my comment about treating the info files as > streams of octets. You mentioned earlier that this is how the existing > system works. OK, I remember now. For the record, the current implementation does not treat the info text as a byte stream. First it seeks to a byte offset, then it reads a number of characters. The business about seeking to a byte offset works because some Lisps interpret the argument of FILE-POSITION as a byte offset even if the stream is a character stream. There is no guarantee in the CLHS that FILE-POSITION is obliged to interpret its argument as a byte offset, although there is some suggestive language to that effect. At any rate, the Lisps that I've tried act that way. best Robert Dodier From toy.raymond at gmail.com Wed Mar 2 21:08:52 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 02 Mar 2011 22:08:52 -0500 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: <4D6ECBEC.6090700@scieneer.com> References: <4D6ECBEC.6090700@scieneer.com> Message-ID: <4D6F0644.4030807@gmail.com> On 3/2/11 5:59 PM, Douglas Crosher wrote: > > Using a byte offset to position in a character file, exploiting broken > implementations of 'file-offset, does not seem a good approach. At > any time the broken implementations could correct 'file-offset and > Maxima would then look up the wrong location. > > The SCL, and it would also seem CMUCL, do correctly position in a > character file so currently return text from the wrong location. Are you using the 8-bit version of cmucl or the unicode version? The unicode version fails your test, which is what I was expecting. (Took me a while to test this because I didn't build the es.utf8 files, and then there were a couple of bugs in the build system itself that I had to fix.) I'm not sure what the 8-bit version will do with utf-8 encodings that don't fit in an 8-bit character. Ray From toy.raymond at gmail.com Wed Mar 2 21:15:23 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 02 Mar 2011 22:15:23 -0500 Subject: [Maxima] A couple of issues with the cl-ppcre version Message-ID: <4D6F07CB.9020404@gmail.com> I ran into a couple of issues building the maxima using the cl-ppcre branch. First, in doc/info/common-lang-utf8.mk there is the line sed -i -e "s|^@documentencoding $(fcharset)|@documentencoding $(tcharset)|ig" *.texi The ig is a GNU extension that doesn't work on OSX. I think just making it g instead of ig should work everywhere. Second, common-lang-utf8.mk by default wants to use recode because urecode=true. I don't have recode, so the build fails. I do have iconv, so setting urecode=false makes things work. I suspect common-lang-utf8.mk needs to be built by configure so urecode has the correct value. Ray From robert.dodier at gmail.com Wed Mar 2 21:15:30 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 2 Mar 2011 20:15:30 -0700 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: <4433.1299120922@gemini.franz.com> References: <4D6ECBEC.6090700@scieneer.com> <4D6F0258.4060009@gmail.com> <4433.1299120922@gemini.franz.com> Message-ID: On 3/2/11, Steve Haflich wrote: > Please read the ANS about file position. There are good reasons it is > defined the way it is. If it were strictly defined to operate on > character position rather than allowing monotonic octet position, it > would be impossible to seek to a particular place on a > variable-width-character stream without rereading the entire stream (or > maintaining some complex binary tables). I agree that it's useful for a file position to be just a byte offset, but is that really required by the spec? The glossary says only that file position increases monotonically for character streams. There is a remark in the description of FILE-POSITION, "An integer returned by file-position of one argument should be acceptable as position-spec for use with the same file." which, if your exegesis-fu is strong enough, might imply that file positions are byte offsets, since it seems to say that a file position is a property of the file, not the stream, therefore all streams have the same file positions ... I dunno. FWIW Robert Dodier From robert.dodier at gmail.com Wed Mar 2 21:20:29 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 2 Mar 2011 20:20:29 -0700 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: <4D6F0644.4030807@gmail.com> References: <4D6ECBEC.6090700@scieneer.com> <4D6F0644.4030807@gmail.com> Message-ID: On 3/2/11, Raymond Toy wrote: > On 3/2/11 5:59 PM, Douglas Crosher wrote: >> >> Using a byte offset to position in a character file, exploiting broken >> implementations of 'file-offset, does not seem a good approach. At >> any time the broken implementations could correct 'file-offset and >> Maxima would then look up the wrong location. >> >> The SCL, and it would also seem CMUCL, do correctly position in a >> character file so currently return text from the wrong location. > Are you using the 8-bit version of cmucl or the unicode version? The > unicode version fails your test, which is what I was expecting. (Took > me a while to test this because I didn't build the es.utf8 files, and > then there were a couple of bugs in the build system itself that I had > to fix.) How can one tell the character version? I don't see anything about it in *FEATURES*. best Robert Dodier From toy.raymond at gmail.com Wed Mar 2 21:23:43 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 02 Mar 2011 22:23:43 -0500 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: <4D6ECBEC.6090700@scieneer.com> <4D6F0644.4030807@gmail.com> Message-ID: <4D6F09BF.4000901@gmail.com> On 3/2/11 10:20 PM, Robert Dodier wrote: > On 3/2/11, Raymond Toy wrote: >> >> Are you using the 8-bit version of cmucl or the unicode version? The >> unicode version fails your test, which is what I was expecting. (Took >> me a while to test this because I didn't build the es.utf8 files, and >> then there were a couple of bugs in the build system itself that I had >> to fix.) > How can one tell the character version? > I don't see anything about it in *FEATURES*. *FEATURES* should contain :UNICODE. The startup banner should also mention the unicode data base version. The 8bit versions don't have any of this. Ray From dtc-maxima at scieneer.com Wed Mar 2 21:40:11 2011 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Thu, 03 Mar 2011 14:40:11 +1100 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: <4D6F0258.4060009@gmail.com> References: <4D6ECBEC.6090700@scieneer.com> <4D6F0258.4060009@gmail.com> Message-ID: <4D6F0D9B.70001@scieneer.com> Hi Ray, Yes, you are right, I was not using the Unicode version which explains it. Guess it's just an implementation decision and not 'broken'. Douglas On 03/03/11 13:52, Raymond Toy wrote: > On 3/2/11 5:59 PM, Douglas Crosher wrote: >> >> Using a byte offset to position in a character file, exploiting broken >> implementations of 'file-offset, does not seem a good approach. At >> any time the broken implementations could correct 'file-offset and >> Maxima would then look up the wrong location. >> >> The SCL, and it would also seem CMUCL, do correctly position in a >> character file so currently return text from the wrong location. > I'm surprised this works in cmucl. FILE-POSITION in cmucl is the octet > position, not the character position. For variable length encodings, > how do you position by character other than by, more or less, reading > every character? > > Could be a bug in CMUCL. >> >> It is frustrating that 'file-position is inconsistent with the number >> of characters read in some CL implementations. It would seem like a >> bug, but is easy to work around. Leo's code reads the entire file >> into a string and then extracts characters from the string using a >> character offset, avoiding 'file-position. Alternatively are >> 'read-char loop could be used for broken implementations. > I have a vague memory that the original info system did read in the > entire file. This was the version before Robert created the current system. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From dtc-maxima at scieneer.com Wed Mar 2 22:48:26 2011 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Thu, 03 Mar 2011 15:48:26 +1100 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: <4433.1299120922@gemini.franz.com> References: <4D6ECBEC.6090700@scieneer.com> <4D6F0258.4060009@gmail.com> <4433.1299120922@gemini.franz.com> Message-ID: <4D6F1D9A.6020109@scieneer.com> Hello Steve, Yes, you are right, sorry, so it's not broken. The SCL uses the character position for the convenience of allowing the file to be recoded while still using the same offsets, and also to support file-position on file encodings that do not increase monotonically such as compressed and encrypted formats. Positioning is very fast when within the buffer, perhaps faster than a byte-offset implementation, but may require some or all of a file to be re-read which could be very slow. If speed is critical then it is only a small extra step to open a binary stream, seek to the location, and then encapsulate it in a character stream. The SCL optimizes fixed width encodings, and avoids re-reading if the buffer can be used. A fixed width encoding may be a good choice, and necessary if randomly writing. Using a byte offset also makes buffering problematic. For example: (with-open-file (ostream "ctest.txt" :direction :output :external-format #+clisp "utf-8" #-clisp :utf-8) (dotimes (i 1000) (write-char (code-char #x1234) ostream))) (with-open-file (stream "ctest.txt" :direction :input :external-format #+clisp "utf-8" #-clisp :utf-8) (let ((p0 (file-position stream)) (ch (read-char stream))) (unread-char ch stream) (let ((p0* (file-position stream))) (if (eql p0* p0) "Ok" "Broken")))) SCL: Ok CLISP: Broken CMUCL (Unicode): Broken Needless to say the use of a character offset for the Maxima info documents suits the SCL, but it could also work with byte offsets, by opening a binary stream and then positioning and encapsulating in a character stream, or just reading a chunk of bytes and converting them to characters. Regards Douglas Crosher On 03/03/11 13:55, Steve Haflich wrote: > Please read the ANS about file position. There are good reasons it is > defined the way it is. If it were strictly defined to operate on > character position rather than allowing monotonic octet position, it > would be impossible to seek to a particular place on a > variable-width-character stream without rereading the entire stream (or > maintaining some complex binary tables). > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From robert.dodier at gmail.com Thu Mar 3 00:18:56 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 2 Mar 2011 23:18:56 -0700 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: <4D6F1D9A.6020109@scieneer.com> References: <4D6ECBEC.6090700@scieneer.com> <4D6F0258.4060009@gmail.com> <4433.1299120922@gemini.franz.com> <4D6F1D9A.6020109@scieneer.com> Message-ID: On 3/2/11, Douglas Crosher wrote: > Needless to say the use of a character offset for the Maxima info documents > suits the SCL, but it could also work with byte offsets, [...] > just reading a chunk of bytes and converting them to characters. How can that be implemented? Is there a CL function for it? I don't think CODE-CHAR is enough, and I don't know anything else to try. best Robert Dodier From redneb at gmx.com Thu Mar 3 00:43:05 2011 From: redneb at gmx.com (redneb at gmx.com) Date: Thu, 3 Mar 2011 01:43:05 -0500 Subject: [Maxima] nouns of infix operators Message-ID: <20110303064305.GA31446@epicurus> Hello all, When I enter "factor(6)" in maxima it returns "2*3" (with display2d set to false). I am trying to write a function that does the same thing, ie it returns a product as a noun. But when I define for example f(x,y) := '"*"(x,y) then f(2,3) returns '?mtimes(2,3) and not 2*3. How does factor do it? Thanks From fateman at eecs.berkeley.edu Thu Mar 3 00:57:57 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 02 Mar 2011 22:57:57 -0800 Subject: [Maxima] nouns of infix operators In-Reply-To: <20110303064305.GA31446@epicurus> References: <20110303064305.GA31446@epicurus> Message-ID: <4D6F3BF5.4020600@eecs.berkeley.edu> On 3/2/2011 10:43 PM, redneb at gmx.com wrote: > Hello all, > > When I enter "factor(6)" in maxima it returns "2*3" (with display2d > set to false). I am trying to write a function that does the same > thing, ie it returns a product as a noun. But when I define for example > > f(x,y) := '"*"(x,y) > > then f(2,3) returns > > '?mtimes(2,3) no, it should return 6. It does that for me. > > and not 2*3. How does factor do it? type factor(6); ?print(%) The factor program puts a "simp" indicator on the result, i.e. ((mtimes simp) 2 3) even though the expression is not really simplified. From redneb at gmx.com Thu Mar 3 01:51:14 2011 From: redneb at gmx.com (redneb at gmx.com) Date: Thu, 3 Mar 2011 02:51:14 -0500 Subject: [Maxima] nouns of infix operators In-Reply-To: <4D6F3BF5.4020600@eecs.berkeley.edu> References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> Message-ID: <20110303075113.GA32016@epicurus> On Wed, Mar 02, 2011 at 10:57:57PM -0800, Richard Fateman wrote: >On 3/2/2011 10:43 PM, redneb at gmx.com wrote: >> Hello all, >> >> When I enter "factor(6)" in maxima it returns "2*3" (with display2d >> set to false). I am trying to write a function that does the same >> thing, ie it returns a product as a noun. But when I define for example >> >> f(x,y) := '"*"(x,y) >> >> then f(2,3) returns >> >> '?mtimes(2,3) > >no, it should return 6. It does that for me. There is a (single) quote in front of "*". >> >> and not 2*3. How does factor do it? > >type >factor(6); >?print(%) > > >The factor program puts a "simp" indicator on the result, i.e. ((mtimes >simp) 2 3) >even though the expression is not really simplified. > Ok, so is there a way I can insert a simp indicator just like factor does? Do I have to do it lisp? From nbruin at cecm.sfu.ca Thu Mar 3 01:56:31 2011 From: nbruin at cecm.sfu.ca (Nils Bruin) Date: Wed, 2 Mar 2011 23:56:31 -0800 (PST) Subject: [Maxima] Progressive slowdown In-Reply-To: References: <4D6E2E84.6010803@unicaen.fr> Message-ID: On Wed, 2 Mar 2011, Andrej Vodopivec wrote: > This is more likely a regression in maxima. I get very different > results with maxima 5.20 (ccl 1.4) and 5.23 (ccl 1.7-svn) on the same > computer. I can confirm that. maxima 5.20.1 on ECL 10.2.1: flat maxima 5.23.2 on ECL 11.1.1: increasing The behaviour of integrate(log(x^2+y^2),x,0,1) did change between these two maxima versions (5.20 did not need assume(y>1) ). From wilhelm.haager at htlstp.ac.at Thu Mar 3 03:27:05 2011 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Thu, 03 Mar 2011 10:27:05 +0100 Subject: [Maxima] Maxima Graphics Tutorial Message-ID: Hi, I have updated my Maxima Graphics tutorial (originally in German) and have written an English translation. The manuals reside at www.austromath.at, their URLS are: http://www.austromath.at/daten/maxima/zusatz/Graphics_with_Maxima.pdf http://www.austromath.at/daten/maxima/zusatz/Grafiken_mit_Maxima.pdf If appropriate, I would appreciate refererring to them on the Maxima documentation page. Mario Rodriguez: Thanks for your comments on the tutorial (quite a long time ago, sorry for the delay), I have taken them into account. I have also regarded the changed graphics options "dimensions" and "view". I hope the new tutorial is up-to-date now and correct. Best regards Wilhelm Haager From dtc-maxima at scieneer.com Thu Mar 3 04:16:03 2011 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Thu, 03 Mar 2011 21:16:03 +1100 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: <4D6ECBEC.6090700@scieneer.com> <4D6F0258.4060009@gmail.com> <4433.1299120922@gemini.franz.com> <4D6F1D9A.6020109@scieneer.com> Message-ID: <4D6F6A63.2000403@scieneer.com> It would require implementation specific support but there is already the 'octets-to-string function within src/intl.lisp. The SCL can use the following to position to the byte-offset and then read characters: (with-open-file (bin path+filename :direction :input :element-type '(unsigned-byte 8)) (file-position bin byte-offset) (let ((in (ext:make-character-conversion-stream bin :input t))) (read-sequence text in :start 0 :end byte-count))) Regards Douglas Crosher On 03/03/11 17:18, Robert Dodier wrote: > On 3/2/11, Douglas Crosher wrote: > >> Needless to say the use of a character offset for the Maxima info documents >> suits the SCL, but it could also work with byte offsets, > [...] >> just reading a chunk of bytes and converting them to characters. > > How can that be implemented? Is there a CL function for it? > I don't think CODE-CHAR is enough, and I don't know anything else to try. > > best > > Robert Dodier > From toy.raymond at gmail.com Thu Mar 3 08:02:21 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 03 Mar 2011 09:02:21 -0500 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: <4D6ECBEC.6090700@scieneer.com> <4D6F0258.4060009@gmail.com> <4433.1299120922@gemini.franz.com> <4D6F1D9A.6020109@scieneer.com> Message-ID: <4D6F9F6D.9000606@gmail.com> On 3/3/11 1:18 AM, Robert Dodier wrote: > On 3/2/11, Douglas Crosher wrote: > >> Needless to say the use of a character offset for the Maxima info documents >> suits the SCL, but it could also work with byte offsets, > [...] >> just reading a chunk of bytes and converting them to characters. > How can that be implemented? Is there a CL function for it? > I don't think CODE-CHAR is enough, and I don't know anything else to try. But we're not trying to process the string so using code-char to convert an octet to iso8859-1 is ok. If you really want the string, most lisps have some form of the function octets-to-string. Cmucl has octets-to-string, ccl has decode-string-from-octets, clisp has convert-string-from-bytes. Ray From kcrisman at gmail.com Thu Mar 3 08:38:16 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Thu, 3 Mar 2011 09:38:16 -0500 Subject: [Maxima] Update Sourceforge site? Message-ID: When I go (with a Mac), I see "Looking for the latest version? Download wxMaxima-0.8.5-Maxima-5.21.1.dmg (36.0 MB)" I was hoping to download a binary to check something out in 5.23.2, but now I'll have to compile... sigh :( From Bart.Vandewoestyne at telenet.be Thu Mar 3 08:59:00 2011 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Thu, 3 Mar 2011 15:59:00 +0100 Subject: [Maxima] getting axis equal? Message-ID: <20110303145900.GA17733@simba> Hello all, I am plotting some vectors in 3D space with the draw3d command, but somehow the data units on the x, y and z-axis are not equal. I would like to get them equal so that it is easier to see which vectors are perpendicular to each other. So what I basically need is a Maxima equivalent for Matlab's 'axis equal' command. I have tried adding the proportional_axes=xyz option, but this didn't seem to help. My .wxm file (for wxMaxima 0.8.5) is online at http://www.kuleuven-kortrijk.be/~bartv/silver_mueller.wxm I'm not using Maxima that often, so any other comments on my Maxima coding style and improvements on my code are welcome. Regards, Bart -- "Share what you know. Learn what you don't." From adammaj1 at o2.pl Thu Mar 3 09:15:29 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Thu, 3 Mar 2011 15:15:29 +0000 (UTC) Subject: [Maxima] Maxima Graphics Tutorial References: Message-ID: Dnia Thu, 03 Mar 2011 10:27:05 +0100, Wilhelm Haager napisa?(a): > Hi, > > I have updated my Maxima Graphics tutorial (originally in German) and > have written an English translation. > The manuals reside at www.austromath.at, their URLS are: > > > http://www.austromath.at/daten/maxima/zusatz/Graphics_with_Maxima.pdf > http://www.austromath.at/daten/maxima/zusatz/Grafiken_mit_Maxima.pdf > > If appropriate, I would appreciate refererring to them on the Maxima > documentation page. > > > Mario Rodriguez: > Thanks for your comments on the tutorial (quite a long time ago, sorry > for the delay), > I have taken them into account. I have also regarded the changed > graphics options > "dimensions" and "view". I hope the new tutorial is up-to-date now and > correct. > > Best regards > Wilhelm Haager Thx for intresting tutorial. I have added link here http://maxima-project.org/wiki/index.php?title=Gallery#See_also Best regards Adam From fateman at eecs.berkeley.edu Thu Mar 3 09:29:32 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 03 Mar 2011 07:29:32 -0800 Subject: [Maxima] nouns of infix operators In-Reply-To: <20110303075113.GA32016@epicurus> References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> Message-ID: <4D6FB3DC.5060102@eecs.berkeley.edu> On 3/2/2011 11:51 PM, redneb at gmx.com wrote: > On Wed, Mar 02, 2011 at 10:57:57PM -0800, Richard Fateman wrote: >> On 3/2/2011 10:43 PM, redneb at gmx.com wrote: >>> Hello all, >>> >>> When I enter "factor(6)" in maxima it returns "2*3" (with display2d >>> set to false). I am trying to write a function that does the same >>> thing, ie it returns a product as a noun. But when I define for example >>> >>> f(x,y) := '"*"(x,y) >>> >>> then f(2,3) returns >>> >>> '?mtimes(2,3) >> >> no, it should return 6. It does that for me. > > There is a (single) quote in front of "*". > > >>> >>> and not 2*3. How does factor do it? >> >> type >> factor(6); >> ?print(%) >> >> >> The factor program puts a "simp" indicator on the result, i.e. ((mtimes >> simp) 2 3) >> even though the expression is not really simplified. >> > > Ok, so is there a way I can insert a simp indicator just like factor > does? Do I have to do it lisp? If you use this idea, I think you probably need a one-line lisp program. You can use the ide you propose, which is equivalent to q: nounify(?mtimes) q(1,2,3) %,eval which uses a different mechanism, which is a noun form of "*". I did not realize it existed. But a function like q, above, seems to be what you need. RJF From macrakis at alum.mit.edu Thu Mar 3 09:51:49 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 3 Mar 2011 10:51:49 -0500 Subject: [Maxima] nouns of infix operators In-Reply-To: <20110303075113.GA32016@epicurus> References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> Message-ID: The noun form doesn't prevent simplification, only evaluation. The simplifying package has a function which allows you to construct expressions tagged as simplified. I don't currently have access to Maxima to check the exact name, but it's something like make_simp("*", [2,3,5]). Of course, if it is *re*simplified, eg by multiplying by something, then it is no longer "protected". What exactly are you trying to accomplish? -s On 2011-03-03, redneb at gmx.com wrote: > On Wed, Mar 02, 2011 at 10:57:57PM -0800, Richard Fateman wrote: >>On 3/2/2011 10:43 PM, redneb at gmx.com wrote: >>> Hello all, >>> >>> When I enter "factor(6)" in maxima it returns "2*3" (with display2d >>> set to false). I am trying to write a function that does the same >>> thing, ie it returns a product as a noun. But when I define for example >>> >>> f(x,y) := '"*"(x,y) >>> >>> then f(2,3) returns >>> >>> '?mtimes(2,3) >> >>no, it should return 6. It does that for me. > > There is a (single) quote in front of "*". > > >>> >>> and not 2*3. How does factor do it? >> >>type >>factor(6); >>?print(%) >> >> >>The factor program puts a "simp" indicator on the result, i.e. ((mtimes >>simp) 2 3) >>even though the expression is not really simplified. >> > > Ok, so is there a way I can insert a simp indicator just like factor > does? Do I have to do it lisp? > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Sent from my mobile device From macrakis at alum.mit.edu Thu Mar 3 09:53:49 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 3 Mar 2011 10:53:49 -0500 Subject: [Maxima] nouns of infix operators In-Reply-To: <20110303075113.GA32016@epicurus> References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> Message-ID: The noun form doesn't prevent simplification, only evaluation. The simplifying package has a function which allows you to construct expressions tagged as simplified. I don't currently have access to Maxima to check the exact name, but it's something like make_simp("*", [2,3,5]). Of course, if it is *re*simplified, eg by multiplying by something, then it is no longer "protected". What exactly are you trying to accomplish? -s On 2011-03-03, redneb at gmx.com wrote: > On Wed, Mar 02, 2011 at 10:57:57PM -0800, Richard Fateman wrote: >>On 3/2/2011 10:43 PM, redneb at gmx.com wrote: >>> Hello all, >>> >>> When I enter "factor(6)" in maxima it returns "2*3" (with display2d >>> set to false). I am trying to write a function that does the same >>> thing, ie it returns a product as a noun. But when I define for example >>> >>> f(x,y) := '"*"(x,y) >>> >>> then f(2,3) returns >>> >>> '?mtimes(2,3) >> >>no, it should return 6. It does that for me. > > There is a (single) quote in front of "*". > > >>> >>> and not 2*3. How does factor do it? >> >>type >>factor(6); >>?print(%) >> >> >>The factor program puts a "simp" indicator on the result, i.e. ((mtimes >>simp) 2 3) >>even though the expression is not really simplified. >> > > Ok, so is there a way I can insert a simp indicator just like factor > does? Do I have to do it lisp? > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Sent from my mobile device From macrakis at alum.mit.edu Thu Mar 3 09:55:49 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 3 Mar 2011 10:55:49 -0500 Subject: [Maxima] nouns of infix operators In-Reply-To: <20110303075113.GA32016@epicurus> References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> Message-ID: The noun form doesn't prevent simplification, only evaluation. The simplifying package has a function which allows you to construct expressions tagged as simplified. I don't currently have access to Maxima to check the exact name, but it's something like make_simp("*", [2,3,5]). Of course, if it is *re*simplified, eg by multiplying by something, then it is no longer "protected". What exactly are you trying to accomplish? -s On 2011-03-03, redneb at gmx.com wrote: > On Wed, Mar 02, 2011 at 10:57:57PM -0800, Richard Fateman wrote: >>On 3/2/2011 10:43 PM, redneb at gmx.com wrote: >>> Hello all, >>> >>> When I enter "factor(6)" in maxima it returns "2*3" (with display2d >>> set to false). I am trying to write a function that does the same >>> thing, ie it returns a product as a noun. But when I define for example >>> >>> f(x,y) := '"*"(x,y) >>> >>> then f(2,3) returns >>> >>> '?mtimes(2,3) >> >>no, it should return 6. It does that for me. > > There is a (single) quote in front of "*". > > >>> >>> and not 2*3. How does factor do it? >> >>type >>factor(6); >>?print(%) >> >> >>The factor program puts a "simp" indicator on the result, i.e. ((mtimes >>simp) 2 3) >>even though the expression is not really simplified. >> > > Ok, so is there a way I can insert a simp indicator just like factor > does? Do I have to do it lisp? > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Sent from my mobile device From villate at fe.up.pt Thu Mar 3 10:01:29 2011 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 03 Mar 2011 16:01:29 +0000 Subject: [Maxima] Maxima Graphics Tutorial In-Reply-To: References: Message-ID: <1299168089.2114.22.camel@wigner> On Thu, 2011-03-03 at 10:27 +0100, Wilhelm Haager wrote: > I have updated my Maxima Graphics tutorial (originally in German) and > have written an English translation. > The manuals reside at www.austromath.at, their URLS are: > http://www.austromath.at/daten/maxima/zusatz/Graphics_with_Maxima.pdf > http://www.austromath.at/daten/maxima/zusatz/Grafiken_mit_Maxima.pdf Thanks for your tutorial. I have a couple of comments. On page 4 you say: "The routines of the package Draw are admittedly slightly more complicated concerning their usage, but they are more flexible than the standard routines and offer much more possibilities to adapt the graphics with the aid of options to particular requirements. Furthermore it is possible, to set output format (eps, png, jpg, etc.) and output target (i. e. the filename) in the gnuplot console after the graphic has been produced, which is appearently not possible when using the standard routines of the Gnuplot interface Plot". using plot2d or plot3d you can give those options in the command: plot2d(x^2, [x,-2,2], [gnuplot_term,gif], [gnuplot_out_file, "funcao1.gif"]) plot2d(x^2, [x,-2,2], [gnuplot_term,jpg], [gnuplot_out_file, "funcao1.jpg"]); plot2d(x^2, [x,-2,2], [gnuplot_term,postscript], [gnuplot_out_file, "funcao1.eps"]); or any other terminal supported by Gnuplot. Also, your documentation of plot3d is for an old version. Regards, Jaime From macrakis at alum.mit.edu Thu Mar 3 10:34:18 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 3 Mar 2011 11:34:18 -0500 Subject: [Maxima] nouns of infix operators In-Reply-To: <20110303075113.GA32016@epicurus> References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> Message-ID: The noun form doesn't prevent simplification, only evaluation. The simplifying package has a function which allows you to construct expressions tagged as simplified. I don't currently have access to Maxima to check the exact name, but it's something like make_simp("*", [2,3,5]). Of course, if it is *re*simplified, eg by multiplying by something, then it is no longer "protected". What exactly are you trying to accomplish? -s On 2011-03-03, redneb at gmx.com wrote: > On Wed, Mar 02, 2011 at 10:57:57PM -0800, Richard Fateman wrote: >>On 3/2/2011 10:43 PM, redneb at gmx.com wrote: >>> Hello all, >>> >>> When I enter "factor(6)" in maxima it returns "2*3" (with display2d >>> set to false). I am trying to write a function that does the same >>> thing, ie it returns a product as a noun. But when I define for example >>> >>> f(x,y) := '"*"(x,y) >>> >>> then f(2,3) returns >>> >>> '?mtimes(2,3) >> >>no, it should return 6. It does that for me. > > There is a (single) quote in front of "*". > > >>> >>> and not 2*3. How does factor do it? >> >>type >>factor(6); >>?print(%) >> >> >>The factor program puts a "simp" indicator on the result, i.e. ((mtimes >>simp) 2 3) >>even though the expression is not really simplified. >> > > Ok, so is there a way I can insert a simp indicator just like factor > does? Do I have to do it lisp? > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Sent from my mobile device From toy.raymond at gmail.com Thu Mar 3 11:51:39 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 03 Mar 2011 12:51:39 -0500 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: <4D6EF562.5010303@gmail.com> Message-ID: <4D6FD52B.60306@gmail.com> On 3/2/11 9:59 PM, Robert Dodier wrote: > On 3/2/11, Raymond Toy wrote: >> On 3/2/11 4:29 PM, Robert Dodier wrote: >>> OK, when I launch xterm with >>> LC_ALL=foo LANG=foo xterm >>> and then run Maxima 5.21.1 in that, describe text >>> (titles and content) is displayed correctly in both >>> ISO-8859 and UTF-8 locales. >>> >>> What was Ray's original proposal? I don't remember. >> I think Leo is referring to my comment about treating the info files as >> streams of octets. You mentioned earlier that this is how the existing >> system works. > OK, I remember now. Also, Leo mentioned to me that if you set cl-info::*info-default-external-format* to NIL, then the new build-index code will use octets. I think you need to modify build-index and recompile for this to work. I've done a few tests with this using utf8 and latin1. The output is what I expect, once I remember to set my terminal emulator to use the right encoding. Ray From willisb at unk.edu Thu Mar 3 11:52:15 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 3 Mar 2011 11:52:15 -0600 Subject: [Maxima] nouns of infix operators In-Reply-To: References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> Message-ID: maxima-bounces at math.utexas.edu wrote on 03/03/2011 10:34:18 AM: > The simplifying package has a function which allows you to construct > expressions tagged as simplified. I didn't try all that hard, but I wasn't able to do this using the simplifying package. Maybe something like the following will work: (%i26) :lisp(defun $mult_nosimp (&rest l) (cons '(mtimes simp) (sort l '$orderlessp))) $MULT_NOSIMP (%i26) mult_nosimp(2,3,p,q); (%o26) 2*3*p*q Don't expect Maxima to work correctly with the output of mult_nosimp--subverting simplification has bad consequences; example: (%i33) mult_nosimp(2,3,p,rat(x)); (%o33)/R/ 2*3*p*x (%i34) %/x; Maxima encountered a Lisp error: value #:X3118 is not of the expected type LIST. --Barton From biomates at telefonica.net Thu Mar 3 12:00:34 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 03 Mar 2011 19:00:34 +0100 Subject: [Maxima] getting axis equal? In-Reply-To: <20110303145900.GA17733@simba> References: <20110303145900.GA17733@simba> Message-ID: <1299175234.1740.9.camel@trasno> El jue, 03-03-2011 a las 15:59 +0100, Bart Vandewoestyne escribi?: > Hello all, > > I am plotting some vectors in 3D space with the draw3d command, > but somehow the data units on the x, y and z-axis are not equal. > I would like to get them equal so that it is easier to see which > vectors are perpendicular to each other. So what I basically > need is a Maxima equivalent for Matlab's 'axis equal' command. > Bart, Your example worked as expected here and units are of equal length on the three axes. This feature has been recently added to Gnuplot. You need version 4.4. -- Mario From redneb at gmx.com Thu Mar 3 13:26:58 2011 From: redneb at gmx.com (redneb at gmx.com) Date: Thu, 3 Mar 2011 14:26:58 -0500 Subject: [Maxima] nouns of infix operators In-Reply-To: References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> Message-ID: <20110303192629.GA7097@epicurus> On Thu, Mar 03, 2011 at 11:34:18AM -0500, Stavros Macrakis wrote: >The noun form doesn't prevent simplification, only evaluation. > >The simplifying package has a function which allows you to construct >expressions tagged as simplified. I don't currently have access to >Maxima to check the exact name, but it's something like make_simp("*", >[2,3,5]). Of course, if it is *re*simplified, eg by multiplying by >something, then it is no longer "protected". > >What exactly are you trying to accomplish? Here's an example of what I am trying to do: I am writing a function that expands a rational function to a particular form of a sum. It expects a rational function as input and returns the expansion of that rational function. Right it now, I have written it so that it returns the list of terms of the expansion but it would be nice to have it return a sum instead. But I don't want maxima to rearrange the terms of the sum or simplify it in any other way (unless of course the user requests that explicitly). From toy.raymond at gmail.com Thu Mar 3 16:29:34 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 03 Mar 2011 17:29:34 -0500 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: <4D6F1D9A.6020109@scieneer.com> References: <4D6ECBEC.6090700@scieneer.com> <4D6F0258.4060009@gmail.com> <4433.1299120922@gemini.franz.com> <4D6F1D9A.6020109@scieneer.com> Message-ID: <4D70164E.1040203@gmail.com> On 3/2/11 11:48 PM, Douglas Crosher wrote: > > Using a byte offset also makes buffering problematic. For example: > > (with-open-file (ostream "ctest.txt" :direction :output > :external-format #+clisp "utf-8" #-clisp :utf-8) > (dotimes (i 1000) > (write-char (code-char #x1234) ostream))) > > (with-open-file (stream "ctest.txt" :direction :input > :external-format #+clisp "utf-8" #-clisp :utf-8) > (let ((p0 (file-position stream)) > (ch (read-char stream))) > (unread-char ch stream) > (let ((p0* (file-position stream))) > (if (eql p0* p0) "Ok" "Broken")))) > > SCL: Ok > CLISP: Broken > CMUCL (Unicode): Broken This is a bug in cmucl. Fixed now. Ray From willisb at unk.edu Thu Mar 3 19:40:07 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 3 Mar 2011 19:40:07 -0600 Subject: [Maxima] nouns of infix operators In-Reply-To: <20110303192629.GA7097@epicurus> References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> , <20110303192629.GA7097@epicurus> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Here's?an?example?of?what?I?am?trying?to?do:?I?am?writing?a?function? >that?expands?a?rational?function?to?a?particular?form?of?a?sum.?It? >expects?a?rational?function?as?input?and?returns?the?expansion?of?that? >rational?function. Such schemes exist, I think; you might examine the source code for cf and cfdisrep: (%i6) cfdisrep(cf(1/3 + sqrt(5))); (%o6) 2+1/(1+1/(1+1/(2+1/2))) (%i7) ?print(%); ((MPLUS SIMP CF) 2 ((MEXPT SIMP) ((MPLUS SIMP CF) 1 ((MEXPT SIMP) ((MPLUS SIMP CF) 1 ((MEXPT SIMP) ((MPLUS SIMP CF) 2 ((RAT SIMP) 1 2)) -1)) -1)) -1)) (%o7) 2+1/(1+1/(1+1/(2+1/2))) You would also need to investigate how the cf flag alters simplification (maybe the cf flag is ignored when it shouldn't be. I don't know.) --Barton From redneb at gmx.com Thu Mar 3 22:30:34 2011 From: redneb at gmx.com (redneb at gmx.com) Date: Thu, 3 Mar 2011 23:30:34 -0500 Subject: [Maxima] nouns of infix operators In-Reply-To: References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> <20110303192629.GA7097@epicurus> Message-ID: <20110304043033.GA14820@epicurus> On Thu, Mar 03, 2011 at 07:40:07PM -0600, Barton Willis wrote: > >Such schemes exist, I think; you might examine the source code for cf and cfdisrep: > >(%i6) cfdisrep(cf(1/3 + sqrt(5))); >(%o6) 2+1/(1+1/(1+1/(2+1/2))) > >(%i7) ?print(%); >((MPLUS SIMP CF) 2 ((MEXPT SIMP) ((MPLUS SIMP CF) 1 ((MEXPT SIMP) ((MPLUS SIMP CF) 1 ((MEXPT SIMP) ((MPLUS SIMP CF) 2 ((RAT SIMP) 1 2)) -1)) -1)) -1)) >(%o7) 2+1/(1+1/(1+1/(2+1/2))) > >You would also need to investigate how the cf flag alters simplification (maybe the cf flag is >ignored when it shouldn't be. I don't know.) > Yes, cfdisrep is another example similar to what I am trying to do. So it seems that there many functions such as cfdisrep, factor and taylor that return expressions in a particular form which is not automatically simplified or evaluated unless the user explicitly requests that. But there are also some other functions that don't do that. For example, for some square matrix A get_lu_factors(lu_factor(A)) returns a list of matrices [P,L,U] such that A=P.L.U. It would be nice if get_lu_factors returned the 3 matrices as product that would not get automatically simplified or evaluated. The purpose of my original post was to ask if there is a general mechanism that allows you to do that. It would be nice if there was such a general mechanism, and it would be even better if this could be accomplished without having to write any lisp code. Maybe a solution would be to output nouns of infix operators in a way better than '?mtimes(2,3) Maybe 2 '* 3 or even 2 * 3. From fateman at eecs.berkeley.edu Fri Mar 4 00:09:21 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 03 Mar 2011 22:09:21 -0800 Subject: [Maxima] nouns of infix operators In-Reply-To: <20110304043033.GA14820@epicurus> References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> <20110303192629.GA7097@epicurus> <20110304043033.GA14820@epicurus> Message-ID: <4D708211.7040001@eecs.berkeley.edu> On 3/3/2011 8:30 PM, redneb at gmx.com wrote: .. > > The purpose of my original post was to ask if there is a general > mechanism that allows you to do that. It would be nice if there was > such a general mechanism, and it would be even better if this could be > accomplished without having to write any lisp code. To introduce a new form F to Maxima, you have to consider how it will work in EVERY circumstance. Will the behavior that "automatically falls out" be acceptable, or do you have to write special programs. e.g. What do you want to do with integrate(F...) or taylor(F ...) or diff(F ..) or save( )... etc etc. We don't even have a laundry list of "etc". Another special form is Poisson series... RJF From robert.dodier at gmail.com Fri Mar 4 00:48:05 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 3 Mar 2011 23:48:05 -0700 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: <4D6FD52B.60306@gmail.com> References: <4D6EF562.5010303@gmail.com> <4D6FD52B.60306@gmail.com> Message-ID: On 3/3/11, Raymond Toy wrote: > Also, Leo mentioned to me that if you set > cl-info::*info-default-external-format* to NIL, then the new build-index > code will use octets. I think you need to modify build-index and > recompile for this to work. > > I've done a few tests with this using utf8 and latin1. The output is > what I expect, once I remember to set my terminal emulator to use the > right encoding. I can't confirm this. I've modified src/build-index.lisp so that the default value of CL-INFO::*INFO-DEFAULT-EXTERNAL-FORMAT* is NIL, nuked any build-index.lisp files, and rebuilt Maxima. I launch an xterm, LC_ALL=pt_PT.UTF-8 LANG=pt_PT.UTF-8 xterm and run Maxima in that xterm. I see that both titles and content are messed up. What exactly are the commands that you are issuing? For the record, when I run Maxima built from CVS head in that same xterm, both titles and content are displayed correctly. I'm working on Xubuntu 8.04 (Hardy Heron) with Clisp and SBCL. best Robert Dodier From robert.dodier at gmail.com Fri Mar 4 00:56:17 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 3 Mar 2011 23:56:17 -0700 Subject: [Maxima] release branch 5.24 scheduled for April 1 Message-ID: We got somewhat off the release schedule due to packaging problems, and I'd like to get back on it. I am planning to make a 5.24 release branch on April 1 or thereabouts, with a release to follow that. The main issue I see at this point is whether the Windows package can be built with CCL instead of GCL. I'll start a separate thread about that. best Robert Dodier From robert.dodier at gmail.com Fri Mar 4 01:03:08 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 4 Mar 2011 00:03:08 -0700 Subject: [Maxima] Windows package built w/ CCL Message-ID: So there is a Windows package built with CCL now. The one problem that's unresolved is that the CCL binary uses instructions (SSE2) which don't exist on some old CPU's. How big a problem is that? Can we recompile CCL to not use those instructions? or is there some other workaround? I am hoping that we can use CCL for the Windows package in the near future so I'd like to get any problems straightened out. best Robert Dodier From robert.dodier at gmail.com Fri Mar 4 01:09:16 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 4 Mar 2011 00:09:16 -0700 Subject: [Maxima] Update Sourceforge site? In-Reply-To: References: Message-ID: On 3/3/11, Karl-Dieter Crisman wrote: > When I go (with a Mac), I see > > "Looking for the latest version? Download > wxMaxima-0.8.5-Maxima-5.21.1.dmg (36.0 MB)" > > I was hoping to download a binary to check something out in 5.23.2, > but now I'll have to compile... sigh :( Packages are built when somebody cares to do so. Sorry for the bother, but really the only way to fix it is to find someone who is willing to do it. You may volunteer if you wish. best Robert Dodier From redneb at gmx.com Fri Mar 4 02:31:08 2011 From: redneb at gmx.com (redneb at gmx.com) Date: Fri, 4 Mar 2011 03:31:08 -0500 Subject: [Maxima] nouns of infix operators In-Reply-To: <4D708211.7040001@eecs.berkeley.edu> References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> <20110303192629.GA7097@epicurus> <20110304043033.GA14820@epicurus> <4D708211.7040001@eecs.berkeley.edu> Message-ID: <20110304083107.GA19480@epicurus> On Thu, Mar 03, 2011 at 10:09:21PM -0800, Richard Fateman wrote: >On 3/3/2011 8:30 PM, redneb at gmx.com wrote: > >To introduce a new form F to Maxima, you have to consider how it will >work in EVERY circumstance. Will the behavior that >"automatically falls out" be acceptable, or do you have to write special >programs. e.g. What do you want to do >with integrate(F...) or taylor(F ...) or diff(F ..) or save( )... >etc etc. > >We don't even have a laundry list of "etc". > >Another special form is Poisson series... I think that what I propose (i.e. changing the way maxima outputs noun forms of infix operators) is simple and doesn't cause problems like that. For example, suppose that you have a function that does LU decomposition for matrices. Then this function could return a product of the form P.L.U but with matrix multiplication as noun. If the user wishes to extract one of the 3 matrices from the product, they could just do something like part(%,3). If they want to evaluate the product then they could just do a ev(%,nouns). So you get the benefits of both lists and expressions. This seems like a better idea than inserting the simp flag here and there. As for situations like integrate(...) or taylor(...) that you mention, you just deal with them the way you would deal nouns in general. They only problem with using nouns right now for the above example is that maxima would print the above product as '?mnctimes(P,L,U) which looks very ugly. From working.good at gmail.com Fri Mar 4 03:24:14 2011 From: working.good at gmail.com (alex) Date: Fri, 04 Mar 2011 11:24:14 +0200 Subject: [Maxima] asksign and integrate In-Reply-To: <20110304083107.GA19480@epicurus> References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> <20110303192629.GA7097@epicurus> <20110304043033.GA14820@epicurus> <4D708211.7040001@eecs.berkeley.edu> <20110304083107.GA19480@epicurus> Message-ID: <4D70AFBE.2000007@gmail.com> I cant really understand why assume doesnt work as it should to. Why maxima still asks the question, even though I did answer it with assume()?? (%i23) assume( (y-1)*(y+1) > 0 )$ integrate(log(x^2+y^2),x,0,1); Is (y-1)*(y+1) positive, negative, or zero? But if I ask directly asksign() with this kind of assume it does work: (%i27) assume( (y-1)*(y+1) > 0 )$asksign( (y-1)*(y+1) ); (%o27) pos I suspect it has smth with re-ordering of expression inside maxima before it outputs it, because: (%i4) -1+y; (%o4) y - 1 I assume asksign() does this kind of reorder before outputting the question as well, while internally has different representation of the expression. My question is: can I turn off this reorder somehow so asksign() will write their questions properly, so I can use output of its question in assume() then. Thnx, Alex From kcrisman at gmail.com Fri Mar 4 08:00:14 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Fri, 4 Mar 2011 09:00:14 -0500 Subject: [Maxima] Update Sourceforge site? In-Reply-To: References: Message-ID: On Fri, Mar 4, 2011 at 2:09 AM, Robert Dodier wrote: > On 3/3/11, Karl-Dieter Crisman wrote: > >> When I go (with a Mac), I see >> >> "Looking for the latest version? Download >> wxMaxima-0.8.5-Maxima-5.21.1.dmg (36.0 MB)" >> >> I was hoping to download a binary to check something out in 5.23.2, >> but now I'll have to compile... sigh :( > > Packages are built when somebody cares to do so. > Sorry for the bother, but really the only way to fix it > is to find someone who is willing to do it. > You may volunteer if you wish. > I don't know how to do it. My point is that the website should be updated on a regular basis, at least enough to say that this is NOT the 'latest version' and how to get it if you can't (by pointing to the source page and some instructions). Otherwise (say) a Mac user who knows zero about compiling, or even that there is such a thing as compiling, will have to download Sage 4.7 when it comes out in order to get Maxima 5.23.2. ;-) From jrredford at yahoo.com Fri Mar 4 08:01:00 2011 From: jrredford at yahoo.com (James Redford) Date: Fri, 4 Mar 2011 06:01:00 -0800 (PST) Subject: [Maxima] getting axis equal? Message-ID: <857171.20139.qm@web121807.mail.ne1.yahoo.com> I get the below error when I try Bart Vandewoestyne's example. (%i1) restart; load(vect); load(draw); (%o1) restart (%i2) (%o2) "C:/program1/maxima/share/maxima/5.23.2/share/vector/vect.mac" (%i3) (%o3) "C:/program1/maxima/share/maxima/5.23.2/share/draw/draw.lisp" (%i4) mymax: 8; (%o4) 8 (%i5) n: [0, 0, 1]; (%o5) [0,0,1] (%i6) E: [1, 2, -2]; H: [2, 1, 2]; (%o6) [1,2,-2] (%i7) (%o7) [2,1,2] (%i8) nxE: express(n~E); Exn: express(E~n); Exnxn: express((E~n)~n); (%o8) [-2,1,0] (%i9) (%o9) [2,-1,0] (%i10) (%o10) [-1,-2,0] (%i11) nxH: express(n~H); Hxn: express(H~n); nxnxH: express(n~(n~H)); (%o11) [-1,2,0] (%i12) (%o12) [1,-2,0] (%i13) (%o13) -[-1,2,0] ~ [0,0,1] (%i14) sum1: Exnxn+Hxn; sum2: nxE+nxnxH; (%o14) [0,-4,0] (%i15) (%o15) [-2,1,0]-[-1,2,0] ~ [0,0,1] (%i16) draw3d(proportional_axes=xyz, axis_3d=true, xtics = 1, ytics = 1, ztics = 1, /* xrange=[-mymax, mymax], yrange=[-mymax, mymax], zrange=[-mymax, mymax], */ color=black, vector([0,0,0], n), label(["n", n[1], n[2], n[3]]), color=blue, vector([0,0,0], E), label(["E", E[1], E[2], E[3]]), vector([0,0,0], H), label(["H", H[1], H[2], H[3]]), color=red, vector([0, 0, 0], nxE), label(["nxE", nxE[1], nxE[2], nxE[3]]), vector([0, 0, 0], Exn), label(["Exn", Exn[1], Exn[2], Exn[3]]), vector([0, 0, 0], Exnxn), label(["Exnxn", Exnxn[1], Exnxn[2], Exnxn[3]]), vector([0, 0, 0], nxH), label(["nxH", nxH[1], nxH[2], nxH[3]]), vector([0, 0, 0], nxnxH), label(["nxnxH", nxnxH[1], nxnxH[2], nxnxH[3]]), vector([0, 0, 0], Hxn), label(["Hxn", Hxn[1], Hxn[2], Hxn[3]]), color=green, vector([0,0,0], sum1), label(["sum1", sum1[1], sum1[2], sum1[3]]), vector([0,0,0], sum2), label(["sum2", sum2[1], sum2[2], sum2[3]])); draw (vector): coordinates are not correct -- an error. To debug this try: debugmode(true); (%i17) Below is the Maxima version that I am using: Maxima version: 5.23.2 Maxima build date: 11:22 2/2/2011 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 #################### [Maxima] getting axis equal? Bart Vandewoestyne Bart.Vandewoestyne at telenet.be Thu Mar 3 08:59:00 CST 2011 Hello all, I am plotting some vectors in 3D space with the draw3d command, but somehow the data units on the x, y and z-axis are not equal. I would like to get them equal so that it is easier to see which vectors are perpendicular to each other. So what I basically need is a Maxima equivalent for Matlab's 'axis equal' command. I have tried adding the proportional_axes=xyz option, but this didn't seem to help. My .wxm file (for wxMaxima 0.8.5) is online at http://www.kuleuven-kortrijk.be/~bartv/silver_mueller.wxm I'm not using Maxima that often, so any other comments on my Maxima coding style and improvements on my code are welcome. Regards, Bart -- "Share what you know. Learn what you don't." From biomates at telefonica.net Fri Mar 4 08:29:26 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 04 Mar 2011 15:29:26 +0100 Subject: [Maxima] getting axis equal? In-Reply-To: <857171.20139.qm@web121807.mail.ne1.yahoo.com> References: <857171.20139.qm@web121807.mail.ne1.yahoo.com> Message-ID: <1299248966.1572.9.camel@trasno> El vie, 04-03-2011 a las 06:01 -0800, James Redford escribi?: > (%i8) nxE: express(n~E); Exn: express(E~n); Exnxn: express((E~n)~n); > Try Exnxn: express(express(E~n)~n); > (%o8) [-2,1,0] > (%i9) > (%o9) [2,-1,0] > (%i10) > (%o10) [-1,-2,0] > (%i11) nxH: express(n~H); Hxn: express(H~n); nxnxH: express(n~(n~H)); and nxnxH: express(n~express(n~H)); I also had to fix this in order to reproduce Bart's example. Bart: I have checked your example under Gnuplot 4.4.0 and you are right: the z intervals don't seem to be of equal length compared to the x and y intervals. This is a bug in 4.4.0, which was fixed in 4.4 patchlevel 2. -- Mario From toy.raymond at gmail.com Fri Mar 4 08:30:36 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 04 Mar 2011 09:30:36 -0500 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: <4D6EF562.5010303@gmail.com> <4D6FD52B.60306@gmail.com> Message-ID: <4D70F78C.8040804@gmail.com> On 3/4/11 1:48 AM, Robert Dodier wrote: > On 3/3/11, Raymond Toy wrote: > >> Also, Leo mentioned to me that if you set >> cl-info::*info-default-external-format* to NIL, then the new build-index >> code will use octets. I think you need to modify build-index and >> recompile for this to work. >> >> I've done a few tests with this using utf8 and latin1. The output is >> what I expect, once I remember to set my terminal emulator to use the >> right encoding. > I can't confirm this. I've modified src/build-index.lisp so that > the default value of CL-INFO::*INFO-DEFAULT-EXTERNAL-FORMAT* > is NIL, nuked any build-index.lisp files, and rebuilt Maxima. > I launch an xterm, > > LC_ALL=pt_PT.UTF-8 LANG=pt_PT.UTF-8 xterm > > and run Maxima in that xterm. I see that both titles and > content are messed up. > > What exactly are the commands that you are issuing? Just to be sure, I did a make clean and rebuilt everything. I'm using the Terminal app on OSX. I set LANG=de_DE.UTF-8, and run maxima-local. "? additive" displays as I expect with "?" displayed. This works because I told Terminal to use a UTF-8 encoding. Then I did LANG=de_DE.ISO8859-1 and run maxima-local. I have to tell Terminal to use latin1 and when I do that the info for additive is displayed correctly too. If I then switch LANG back to UTF-8, without changing the terminal encoding, the help text is displayed incorrectly, which is expected, since the terminal is still expecting latin1 encodings. Ray From l.butler at ed.ac.uk Fri Mar 4 08:35:58 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 4 Mar 2011 14:35:58 +0000 (GMT) Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: <4D70F78C.8040804@gmail.com> References: <4D6EF562.5010303@gmail.com> <4D6FD52B.60306@gmail.com> <4D70F78C.8040804@gmail.com> Message-ID: On Fri, 4 Mar 2011, Raymond Toy wrote: < On 3/4/11 1:48 AM, Robert Dodier wrote: < > On 3/3/11, Raymond Toy wrote: < > < >> Also, Leo mentioned to me that if you set < >> cl-info::*info-default-external-format* to NIL, then the new build-index < >> code will use octets. I think you need to modify build-index and < >> recompile for this to work. < >> < >> I've done a few tests with this using utf8 and latin1. The output is < >> what I expect, once I remember to set my terminal emulator to use the < >> right encoding. < > I can't confirm this. I've modified src/build-index.lisp so that < > the default value of CL-INFO::*INFO-DEFAULT-EXTERNAL-FORMAT* < > is NIL, nuked any build-index.lisp files, and rebuilt Maxima. < > I launch an xterm, < > < > LC_ALL=pt_PT.UTF-8 LANG=pt_PT.UTF-8 xterm < > < > and run Maxima in that xterm. I see that both titles and < > content are messed up. < > < > What exactly are the commands that you are issuing? < Just to be sure, I did a make clean and rebuilt everything. I'm using < the Terminal app on OSX. I set LANG=de_DE.UTF-8, and run maxima-local. < "? additive" displays as I expect with "?" displayed. This works < because I told Terminal to use a UTF-8 encoding. < < Then I did LANG=de_DE.ISO8859-1 and run maxima-local. I have to tell < Terminal to use latin1 and when I do that the info for additive is < displayed correctly too. < < If I then switch LANG back to UTF-8, without changing the terminal < encoding, the help text is displayed incorrectly, which is expected, < since the terminal is still expecting latin1 encodings. Ray, I have a few questions: -what encoding is set when you build the index files originally? -did you rebuild the index files when you switched encodings? My guess is iso88591 and no, respectively. I won't elaborate til I hear back. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From Bart.Vandewoestyne at telenet.be Fri Mar 4 08:38:16 2011 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Fri, 4 Mar 2011 15:38:16 +0100 Subject: [Maxima] getting axis equal? In-Reply-To: <857171.20139.qm@web121807.mail.ne1.yahoo.com> References: <857171.20139.qm@web121807.mail.ne1.yahoo.com> Message-ID: <20110304143816.GA24668@simba> On Fri, Mar 04, 2011 at 06:01:00AM -0800, James Redford wrote: > I get the below error when I try Bart Vandewoestyne's example. > > [...] > > draw (vector): coordinates are not correct > -- an error. To debug this try: debugmode(true); > (%i17) > > Below is the Maxima version that I am using: > > Maxima version: 5.23.2 > Maxima build date: 11:22 2/2/2011 > Host type: i686-pc-mingw32 > Lisp implementation type: GNU Common Lisp (GCL) > Lisp implementation version: GCL 2.6.8 For the record, I just double-checked and I am using the Maxima and wxMaxima version that come packaged in Ubuntu 10.10 (32-bit). The versioning information is as follows according to Help->About in wxMaxima: wxMaxima 0.8.5 wxWidgets: 2.8.10 Unicode support: yes Maxima version: 5.21.1 Lisp: GNU Common Lisp (GCL) GCL 2.6.7 (a.k.a. GCL) It seems like you are using a later version of Maxima and GCL. So this would mean something stopped working your newer version??? Or do I have bad/unrecommended syntax/commands in my file? Regards, Bart -- "Share what you know. Learn what you don't." From l.butler at ed.ac.uk Fri Mar 4 08:41:41 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 4 Mar 2011 14:41:41 +0000 (GMT) Subject: [Maxima] release branch 5.24 scheduled for April 1 In-Reply-To: References: Message-ID: On Thu, 3 Mar 2011, Robert Dodier wrote: < We got somewhat off the release schedule due to < packaging problems, and I'd like to get back on it. < I am planning to make a 5.24 release branch on April 1 < or thereabouts, with a release to follow that. < < The main issue I see at this point is whether the Windows < package can be built with CCL instead of GCL. < I'll start a separate thread about that. It would be desirable to stabilise our repo before the next release, no? Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From jrredford at yahoo.com Fri Mar 4 08:52:11 2011 From: jrredford at yahoo.com (James Redford) Date: Fri, 4 Mar 2011 06:52:11 -0800 (PST) Subject: [Maxima] getting axis equal? In-Reply-To: <1299248966.1572.9.camel@trasno> Message-ID: <399723.34942.qm@web121816.mail.ne1.yahoo.com> --- On Fri, 3/4/11, Mario Rodriguez wrote: > From: Mario Rodriguez > Subject: Re: [Maxima] getting axis equal? > To: "James Redford" > Cc: maxima at math.utexas.edu, Bart.Vandewoestyne at telenet.be > Date: Friday, March 4, 2011, 8:29 AM > El vie, 04-03-2011 a las 06:01 -0800, > James Redford escribi?: > > (%i8) nxE: express(n~E);? Exn: > express(E~n);? Exnxn: express((E~n)~n); > > > > Try > > Exnxn: express(express(E~n)~n); > > > > (%o8) [-2,1,0] > > (%i9) > > (%o9) [2,-1,0] > > (%i10) > > (%o10) [-1,-2,0] > > (%i11) nxH: express(n~H);? Hxn: express(H~n); > nxnxH: express(n~(n~H)); > > and > > nxnxH: express(n~express(n~H)); > > I also had to fix this in order to reproduce Bart's > example. > > Bart: > > I have checked your example under Gnuplot 4.4.0 and you are > right: the z > intervals don't seem to be of equal length compared to the > x and y > intervals. > > This is a bug in 4.4.0, which was fixed in 4.4 patchlevel > 2. > > -- > Mario I get the below error with your modified example. (%i1) restart; load(vect); load(draw); (%o1) restart (%i2) (%o2) "C:/program1/maxima/share/maxima/5.23.2/share/vector/vect.mac" (%i3) (%o3) "C:/program1/maxima/share/maxima/5.23.2/share/draw/draw.lisp" (%i4) mymax: 8; (%o4) 8 (%i5) n: [0, 0, 1]; (%o5) [0,0,1] (%i6) E: [1, 2, -2]; H: [2, 1, 2]; (%o6) [1,2,-2] (%i7) (%o7) [2,1,2] (%i8) Exnxn: express(express(E~n)~n); (%o8) [-1,-2,0] (%i9) nxnxH: express(n~express(n~H)); (%o9) [-2,-1,0] (%i10) sum1: Exnxn+Hxn; sum2: nxE+nxnxH; (%o10) [Hxn-1,Hxn-2,Hxn] (%i11) (%o11) [nxE-2,nxE-1,nxE] (%i12) draw3d(proportional_axes=xyz, axis_3d=true, xtics = 1, ytics = 1, ztics = 1, /* xrange=[-mymax, mymax], yrange=[-mymax, mymax], zrange=[-mymax, mymax], */ color=black, vector([0,0,0], n), label(["n", n[1], n[2], n[3]]), color=blue, vector([0,0,0], E), label(["E", E[1], E[2], E[3]]), vector([0,0,0], H), label(["H", H[1], H[2], H[3]]), color=red, vector([0, 0, 0], nxE), label(["nxE", nxE[1], nxE[2], nxE[3]]), vector([0, 0, 0], Exn), label(["Exn", Exn[1], Exn[2], Exn[3]]), vector([0, 0, 0], Exnxn), label(["Exnxn", Exnxn[1], Exnxn[2], Exnxn[3]]), vector([0, 0, 0], nxH), label(["nxH", nxH[1], nxH[2], nxH[3]]), vector([0, 0, 0], nxnxH), label(["nxnxH", nxnxH[1], nxnxH[2], nxnxH[3]]), vector([0, 0, 0], Hxn), label(["Hxn", Hxn[1], Hxn[2], Hxn[3]]), color=green, vector([0,0,0], sum1), label(["sum1", sum1[1], sum1[2], sum1[3]]), vector([0,0,0], sum2), label(["sum2", sum2[1], sum2[2], sum2[3]])); draw (vector): coordinates are not correct -- an error. To debug this try: debugmode(true); (%i13) From fateman at eecs.berkeley.edu Fri Mar 4 08:55:34 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 04 Mar 2011 06:55:34 -0800 Subject: [Maxima] nouns of infix operators In-Reply-To: <20110304083107.GA19480@epicurus> References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> <20110303192629.GA7097@epicurus> <20110304043033.GA14820@epicurus> <4D708211.7040001@eecs.berkeley.edu> <20110304083107.GA19480@epicurus> Message-ID: <4D70FD66.8010809@eecs.berkeley.edu> On 3/4/2011 12:31 AM, redneb at gmx.com wrote: ... > If they want to evaluate the product then they could just do a > ev(%,nouns). So you get the benefits of both lists and expressions. And if they do NOT do ev(%,nouns), then what are programs supposed to do with it? For example, what does expand, integrate, factor, ... do with a %mtimes? Even if you just said, "In that case, the programs should do an ev(..)", you would need to change each program to do that :(. This is a pretty standard kind of situation. People have to go back and do things over when (say) bigfloats were introduced. Or Taylor series, or Poisson series , ... Supposedly object-oriented programming helps address such problems; it tells you what programs you have to fix, but not necessarily how to fix them. RJF From jrredford at yahoo.com Fri Mar 4 09:04:38 2011 From: jrredford at yahoo.com (James Redford) Date: Fri, 4 Mar 2011 07:04:38 -0800 (PST) Subject: [Maxima] Windows package built w/ CCL Message-ID: <762030.69671.qm@web121801.mail.ne1.yahoo.com> Hello. Can somebody please tell me what using CCL instead of GCL is intended to accomplish? I followed some of the recent discussions on this, but they make reference to previous issues and discussions which I don't know about. Thank you for help on this matter. #################### [Maxima] Windows package built w/ CCL Robert Dodier robert.dodier at gmail.com Fri Mar 4 01:03:08 CST 2011 So there is a Windows package built with CCL now. The one problem that's unresolved is that the CCL binary uses instructions (SSE2) which don't exist on some old CPU's. How big a problem is that? Can we recompile CCL to not use those instructions? or is there some other workaround? I am hoping that we can use CCL for the Windows package in the near future so I'd like to get any problems straightened out. best Robert Dodier From toy.raymond at gmail.com Fri Mar 4 10:02:08 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 04 Mar 2011 11:02:08 -0500 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: <4D6EF562.5010303@gmail.com> <4D6FD52B.60306@gmail.com> <4D70F78C.8040804@gmail.com> Message-ID: <4D710D00.7090802@gmail.com> On 3/4/11 9:35 AM, Leo Butler wrote: > > On Fri, 4 Mar 2011, Raymond Toy wrote: > > < On 3/4/11 1:48 AM, Robert Dodier wrote: > < > On 3/3/11, Raymond Toy wrote: > < > > < >> Also, Leo mentioned to me that if you set > < >> cl-info::*info-default-external-format* to NIL, then the new build-index > < >> code will use octets. I think you need to modify build-index and > < >> recompile for this to work. > < >> > < >> I've done a few tests with this using utf8 and latin1. The output is > < >> what I expect, once I remember to set my terminal emulator to use the > < >> right encoding. > < > I can't confirm this. I've modified src/build-index.lisp so that > < > the default value of CL-INFO::*INFO-DEFAULT-EXTERNAL-FORMAT* > < > is NIL, nuked any build-index.lisp files, and rebuilt Maxima. > < > I launch an xterm, > < > > < > LC_ALL=pt_PT.UTF-8 LANG=pt_PT.UTF-8 xterm > < > > < > and run Maxima in that xterm. I see that both titles and > < > content are messed up. > < > > < > What exactly are the commands that you are issuing? > < Just to be sure, I did a make clean and rebuilt everything. I'm using > < the Terminal app on OSX. I set LANG=de_DE.UTF-8, and run maxima-local. > < "? additive" displays as I expect with "?" displayed. This works > < because I told Terminal to use a UTF-8 encoding. > < > < Then I did LANG=de_DE.ISO8859-1 and run maxima-local. I have to tell > < Terminal to use latin1 and when I do that the info for additive is > < displayed correctly too. > < > < If I then switch LANG back to UTF-8, without changing the terminal > < encoding, the help text is displayed incorrectly, which is expected, > < since the terminal is still expecting latin1 encodings. > > Ray, I have a few questions: > > -what encoding is set when you build the index files originally? Good question. I'm don't remember. Is this taken from LANG? > -did you rebuild the index files when you switched encodings? No, that I know for a fact that I did not rebuild anything. > My guess is iso88591 and no, respectively. I won't elaborate til But let me rebuild everything using iso8859-1.... Ok. Did a make clean, and set LANG=en_US.ISO8859-1, and then make clean. LANG=de_DE.UTF-8 maxima-local works, if I set the terminal coding to utf-8. LANG=de_DE.ISO8859-1 maxima-local doesn't, because the terminal is still set for utf8. Change the terminal encoding to iso8859-1 makes it work. Someone else should try this an confirm that it works. Ray From toy.raymond at gmail.com Fri Mar 4 10:06:59 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 04 Mar 2011 11:06:59 -0500 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: <762030.69671.qm@web121801.mail.ne1.yahoo.com> References: <762030.69671.qm@web121801.mail.ne1.yahoo.com> Message-ID: <4D710E23.80800@gmail.com> On 3/4/11 10:04 AM, James Redford wrote: > Hello. Can somebody please tell me what using CCL instead of GCL is intended to accomplish? Basically, gcl does not support some of the things we want to use. Currently it's ok, but the proposed change to use cl-ppcre for building the help database will not work with gcl. Gcl does not support enough of Common Lisp. However, gcl is one of the fastest lisps running gcl. Ccl is slower, I think. (I don't have any machine that runs both gcl and ccl so I cannot say for sure.) Ray From robert.dodier at gmail.com Fri Mar 4 10:27:06 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 4 Mar 2011 09:27:06 -0700 Subject: [Maxima] release branch 5.24 scheduled for April 1 In-Reply-To: References: Message-ID: On 3/4/11, Leo Butler wrote: > It would be desirable to stabilise our repo before the > next release, no? If there is a working Git repo by April 1, we can use it. Otherwise, I don't see the point of waiting; it will get done when someone has the time & motivation to do it, and I don't see the point of telling everyone else to wait while that happens. best Robert Dodier From robert.dodier at gmail.com Fri Mar 4 10:33:53 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 4 Mar 2011 09:33:53 -0700 Subject: [Maxima] Update Sourceforge site? In-Reply-To: References: Message-ID: On 3/4/11, Karl-Dieter Crisman wrote: > I don't know how to do it. My point is that the website should be > updated on a regular basis, at least enough to say that this is NOT > the 'latest version' and how to get it if you can't (by pointing to > the source page and some instructions). The message is generated automatically by Sourceforge. I don't know any way to change it. Sorry for the bother. best Robert Dodier From fateman at eecs.berkeley.edu Fri Mar 4 10:47:54 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 04 Mar 2011 08:47:54 -0800 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: <4D710E23.80800@gmail.com> References: <762030.69671.qm@web121801.mail.ne1.yahoo.com> <4D710E23.80800@gmail.com> Message-ID: <4D7117BA.3070804@eecs.berkeley.edu> On 3/4/2011 8:06 AM, Raymond Toy wrote: > On 3/4/11 10:04 AM, James Redford wrote: >> Hello. Can somebody please tell me what using CCL instead of GCL is intended to accomplish? > Basically, gcl does not support some of the things we want to use. > Currently it's ok, but the proposed change to use cl-ppcre for building > the help database will not work with gcl. Gcl does not support enough > of Common Lisp. > > However, gcl is one of the fastest lisps running gcl. Ccl is slower, I > think. (I don't have any machine that runs both gcl and ccl so I cannot > say for sure.) > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima I think it really boils down to the fact that Bill Schelter used to support GCL and Maxima, and when he viewed it necessary to do something to the supporting lisp to make Maxima run better or faster, he was interested and able to make GCL changes. Bill Schelter is, sadly, no longer available. People doing more development on Maxima have changing needs as they become more ambitious in terms of features or in terms of supported platforms of hardware and software. They are a different group from the current GCL support and are finding that GCL is not keeping pace with other Common Lisp systems in responding to their needs. This includes, I think, support for other character sets (though I admit to not reading the slew of related messages). I personally find the deficiencies of GCL have to do with (a) outmoded upper/lower case stuff. But this is an ANSI Common Lisp issue, and except for maybe Scieneer and Allegro, all the lisps share this problem. Including CCL. (b) GCL doesn't do foreign function calls, I think. Some of the other lisps do this, though this is not part of the ANSI standard and may or may not fall under UFFI or some other attempt to create a standard. I would not mind if someone who knows about this would comment on whether we could actually use FFI in the Maxima distribution, e.g. to link C programs in Linux, Windows, Mac etc in a neat way, if we used CCL. Personally, I experiment with foreign function libraries and lisp, but I can't do it with GCL. (c) There may be deficiencies in support of errors, handler-case -- these have, I think, been papered over, but I'm not sure if there are remaining issues. (d) I am guessing that GCL isn't going to work in 64-bit mode. I don't mind this at the moment, but maybe it will matter sometime. ............... I HAVE tested GCL and CCL on Windows, running Maxima 5.23.2, and there is a very significant difference between the two in terms of running speed. It could be that CCL optimization flags could be changed or there is some global inefficiency that could be fixed, but CCL seems to run substantially slower, as I have previously reported. *Frankly, a slow-down of a factor of 3 is severe enough that some people might consider it unacceptable. * To someone downloading a binary file of Maxima, the only visible consequence seems to be this slowdown. (Or is there something else??) CCL might break other things, or have advantages I am unaware of? For the developers, the immediate tradeoff is easier generation of the help files in non-English text. There are other further positive aspects for the future, if compatibility with GCL's peculiarities go away. (Or is there something else?) I would love to hear that CCL can be sped up to be close to GCL in speed and make the lives of developers easier. But, given a choice of downloading-- where there are two otherwise indistinguishable systems-- I would pick the one that runs 3X faster :) I hope others will elaborate on the advantages of CCL and/or speed it up!!! RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Fri Mar 4 11:03:27 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 04 Mar 2011 18:03:27 +0100 Subject: [Maxima] getting axis equal? In-Reply-To: <20110304143816.GA24668@simba> References: <857171.20139.qm@web121807.mail.ne1.yahoo.com> <20110304143816.GA24668@simba> Message-ID: <1299258207.2425.26.camel@trasno> El vie, 04-03-2011 a las 15:38 +0100, Bart Vandewoestyne escribi?: > For the record, I just double-checked and I am using the Maxima > and wxMaxima version that come packaged in Ubuntu 10.10 (32-bit). > The versioning information is as follows according to Help->About > in wxMaxima: > > wxMaxima 0.8.5 > wxWidgets: 2.8.10 > Unicode support: yes > Maxima version: 5.21.1 > Lisp: GNU Common Lisp (GCL) GCL 2.6.7 (a.k.a. GCL) > The important fact is that in the Ubuntu repositories you have Gnuplot 4.4.0, and proportional xyz coordinates don't work as claimed in Gnuplot's documentation. This bug was fixed in 4.4.2, which is the current official version released on september 2010. > It seems like you are using a later version of Maxima and GCL. Yes, but it doesn't matter. In fact, I don't make use of GCL at all. > So this would mean something stopped working your newer > version??? No. > Or do I have bad/unrecommended syntax/commands in my > file? No, your 'draw' code is ok. All you need :( John Lennon crossed my mind at this moment) is a newer version of Gnuplot in order this option to work. Try to install 4.4 patchlevel 2 and you are done. -- Mario From toy.raymond at gmail.com Fri Mar 4 11:08:33 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 04 Mar 2011 12:08:33 -0500 Subject: [Maxima] release branch 5.24 scheduled for April 1 In-Reply-To: References: Message-ID: <4D711C91.9080409@gmail.com> On 3/4/11 11:27 AM, Robert Dodier wrote: > On 3/4/11, Leo Butler wrote: > >> It would be desirable to stabilise our repo before the >> next release, no? > If there is a working Git repo by April 1, we can use it. > Otherwise, I don't see the point of waiting; it will get > done when someone has the time & motivation to do it, > and I don't see the point of telling everyone else to > wait while that happens. I would prefer to wait until after the release, which is now less than one month away. After all, Leo said there are differences between the git repo and the cvs repo. Are we willing to live with these differences? (I confess on not having looked at them.) Also is every developer comfortable enough with git now to do everything needed to get a release out in a few weeks? I'm not. I'm just now learning to use git. Ray From robert.dodier at gmail.com Fri Mar 4 11:18:24 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 4 Mar 2011 10:18:24 -0700 Subject: [Maxima] asksign and integrate In-Reply-To: <4D70AFBE.2000007@gmail.com> References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> <20110303192629.GA7097@epicurus> <20110304043033.GA14820@epicurus> <4D708211.7040001@eecs.berkeley.edu> <20110304083107.GA19480@epicurus> <4D70AFBE.2000007@gmail.com> Message-ID: After trace(?asksign01); (internal function) I see that the expression being tested is actually 1 - y^2. Try assume(1 - y^2); I think that will answer the question for the integral. The assume stuff is, unfortunately, not very strong. If you'd like to work on it, we would certainly appreciate the help. best Robert Dodier On 3/4/11, alex wrote: > I cant really understand why assume doesnt work as it should to. > > Why maxima still asks the question, even though I did answer it with > assume()?? > > (%i23) assume( (y-1)*(y+1) > 0 )$ integrate(log(x^2+y^2),x,0,1); > Is (y-1)*(y+1) positive, negative, or zero? > > > But if I ask directly asksign() with this kind of assume it does work: > > (%i27) assume( (y-1)*(y+1) > 0 )$asksign( (y-1)*(y+1) ); > (%o27) pos > > > I suspect it has smth with re-ordering of expression inside maxima > before it outputs it, because: > > (%i4) -1+y; > (%o4) y - 1 > > I assume asksign() does this kind of reorder before outputting the > question as well, while internally has different representation of the > expression. > > My question is: can I turn off this reorder somehow so asksign() will > write their questions properly, so I can use output of its question in > assume() then. > > Thnx, > Alex > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From willisb at unk.edu Fri Mar 4 12:03:23 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 4 Mar 2011 12:03:23 -0600 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: <4D7117BA.3070804@eecs.berkeley.edu> References: <762030.69671.qm@web121801.mail.ne1.yahoo.com> <4D710E23.80800@gmail.com> <4D7117BA.3070804@eecs.berkeley.edu> Message-ID: maxima-bounces at math.utexas.edu wrote on 03/04/2011 10:47:54 AM: > I HAVE tested GCL and CCL on Windows, running Maxima 5.23.2, and > there is a very significant difference between the two in > terms of running speed. For the testsuite (using a Core 2 6400 (2.13 GHz) and 2 GB RAM), CCL is about 30% slower than GCL. Likely the testsuite is a poor speed benchmark. I also ran the testsuite on an i3 380M + 4 GB RAM + 64 bit Windows. I don't recall the numbers, but the good news is that the 32 bit CCL Maxima does run under 64 bit Windows. I think it's only recent that 32 bit CCL would run under 64 bit Windows. ----Using CCL------------------------------- took 325,092 milliseconds (325.092 seconds) to run with 2 available CPU cores. During that period, 324,515 milliseconds (324.515 seconds) were spent in user mode 4,078 milliseconds (4.078 seconds) were spent in system mode 22,591 milliseconds (22.591 seconds) was spent in GC. 9,014,949,251 bytes of memory allocated. --- Using GCL----------------------------- No unexpected errors found out of 8,490 tests. real time : 250.210 secs run-gbc time : 233.800 secs child run time : 0.000 secs gbc time : 16.410 secs --Barton From A.G.Grozin at inp.nsk.su Fri Mar 4 13:24:08 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Sat, 5 Mar 2011 01:24:08 +0600 (NOVT) Subject: [Maxima] Windows package built w/ CCL In-Reply-To: References: <762030.69671.qm@web121801.mail.ne1.yahoo.com> <4D710E23.80800@gmail.com> <4D7117BA.3070804@eecs.berkeley.edu> Message-ID: On Fri, 4 Mar 2011, Barton Willis wrote: > maxima-bounces at math.utexas.edu wrote on 03/04/2011 10:47:54 AM: >> I HAVE tested GCL and CCL on Windows, running Maxima 5.23.2, and >> there is a very significant difference between the two in >> terms of running speed. > For the testsuite (using a Core 2 6400 (2.13 GHz) and 2 GB RAM), CCL is > about 30% slower > than GCL. Likely the testsuite is a poor speed benchmark. My results differ (ASUS eeePC netbook, 1.66GHz Atom N450, 2Gb RAM, 32-bit Gentoo Linux): sbcl-1.0.45 165 cmucl-20b 172 gcl-2.6.8_pre 172 clozurecl-1.6 322 ecl-11.1.1 344 clisp-2.49 552 (this is real time in seconds). So, ccl is nearly 2 times slower than gcl. Of course, the testsuite is not a universal benchmark. The speed for some problem depends on how much work is about multiple-precision arithmetics, and how much work is pure symbolic. Different lisps have different implementations of long-integer and high-precision float arithmetics, and the speed of this implementation is an independent parameter, nearly unrelated to the speed of ordinary list processing (used for symbolic calculations). Andrey From willisb at unk.edu Fri Mar 4 13:59:41 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 4 Mar 2011 13:59:41 -0600 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: References: <762030.69671.qm@web121801.mail.ne1.yahoo.com> <4D710E23.80800@gmail.com> <4D7117BA.3070804@eecs.berkeley.edu> Message-ID: "Andrey G. Grozin" wrote on 03/04/2011 01:24:08 PM: > My results differ (ASUS eeePC netbook, 1.66GHz Atom N450, 2Gb RAM, 32-bit > Gentoo Linux): > > sbcl-1.0.45 165 > cmucl-20b 172 > gcl-2.6.8_pre 172 > clozurecl-1.6 322 > ecl-11.1.1 344 > clisp-2.49 552 My test used Lisp used CCL Version 1.7-dev-r14645M-trunk (WindowsX8632) + Windows XP on a CPU with a Passmark CPU Mark of 1271. Your Atom earns a Passmark CPU Mark of 319, but it runs the testsuite in about the same time (322 seconds compare to my 325 seconds). If speed matters, Windows is a very poor choice for Maxima? Or is the speed difference mostly due to something that is peculiar to the testsuite? --Barton From A.G.Grozin at inp.nsk.su Fri Mar 4 14:10:48 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Sat, 5 Mar 2011 02:10:48 +0600 (NOVT) Subject: [Maxima] Windows package built w/ CCL In-Reply-To: References: <762030.69671.qm@web121801.mail.ne1.yahoo.com> <4D710E23.80800@gmail.com> <4D7117BA.3070804@eecs.berkeley.edu> Message-ID: On Fri, 4 Mar 2011, Barton Willis wrote: > "Andrey G. Grozin" wrote on 03/04/2011 01:24:08 PM: >> My results differ (ASUS eeePC netbook, 1.66GHz Atom N450, 2Gb RAM, 32-bit >> Gentoo Linux): >> >> sbcl-1.0.45 165 >> cmucl-20b 172 >> gcl-2.6.8_pre 172 >> clozurecl-1.6 322 >> ecl-11.1.1 344 >> clisp-2.49 552 > > My test used Lisp used CCL Version 1.7-dev-r14645M-trunk > (WindowsX8632) + Windows XP on a CPU with a Passmark CPU Mark of > 1271. Your Atom earns a Passmark CPU Mark of 319, but it runs the > testsuite in about the same time (322 seconds compare to my 325 > seconds). Sorry for confusion. By mistake, I inserted the numbers not from my netbook, but from my office desktop. Its parameters are: 2.60GHz Intel Pentium E5300, 2Gb RAM, 32-bit Gentoo Linux Sorry once more, Andrey From rmodesi at msn.com Fri Mar 4 15:19:31 2011 From: rmodesi at msn.com (RONALD F MODESITT) Date: Fri, 4 Mar 2011 14:19:31 -0700 Subject: [Maxima] wxMaxima and C type comments Message-ID: It appears to me that C type comments (/* .... */) are not allowed in wxMaxima. Is this a correct observation? many thanks Ronald F. Modesitt -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri Mar 4 16:07:26 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 04 Mar 2011 14:07:26 -0800 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: References: <762030.69671.qm@web121801.mail.ne1.yahoo.com> <4D710E23.80800@gmail.com> <4D7117BA.3070804@eecs.berkeley.edu> Message-ID: <4D71629E.8080300@eecs.berkeley.edu> On 3/4/2011 10:03 AM, Barton Willis wrote: > > For the testsuite (using a Core 2 6400 (2.13 GHz) and 2 GB RAM), CCL is > about 30% slower > than GCL. Likely the testsuite is a poor speed benchmark. I think that using profiling tools one could try to figure out what is taking the bulk of the time. Perhaps it is doing a relatively large percentage of input and output compared to computing. My benchmarks had essentially no I/O. I ran my tests on a 3 GHz Pentium D with 3GB of RAM running Windows XP The profiling tools for CCL look very difficult to use -- see http://ccl.clozure.com/ccl-documentation.html#Profiling and appear to be available only for Linux and Mac, not windows. also, in response to the question by Robert Dodier on 3/3 -- I found this statement-- "32-bit x86 versions of Clozure CL depend on the presence of the SSE2 instruction set extensions." See http://trac.clozure.com/ccl/wiki/SystemRequirements so for some people with older computers this would definitely be a problem. I found no mention of a workaround. And incidentally, the use of SSE2 instructions should give CCL a boost over GCL; if somehow CCL could be compiled without SSE2 it might be much more than 3X slower on the tests I used. Just trying to keep track of the issues. From willisb at unk.edu Fri Mar 4 19:46:20 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 4 Mar 2011 19:46:20 -0600 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: <4D71629E.8080300@eecs.berkeley.edu> References: <762030.69671.qm@web121801.mail.ne1.yahoo.com> <4D710E23.80800@gmail.com> <4D7117BA.3070804@eecs.berkeley.edu> , <4D71629E.8080300@eecs.berkeley.edu> Message-ID: Maxima sometimes works around slowness in GCL. Maybe the following has been improved in GCL (but not in 2.6.8). In short, GCL is sometimes slow with rational addition, but the same calculation in Maxima is much faster. First with GCL: (%i1) showtime : all$ (%i2) :lisp(defun $hsum_cl (n) (let ((s 0)) (while (> n 0) (setq s (+ s (/ 1 n))) (decf n)) (to s))) $HSUM_CL Super slow: (%i2) hsum_cl(10000)$ Evaluation took 136.2400 seconds (136.2400 elapsed) (%i3) hsum_max(n) := block([s : 0], while n > 0 do (s : s + 1/n, n : n-1),s)$ Much faster: (%i4) hsum_max(10000)$ Evaluation took 0.4800 seconds (0.4800 elapsed) (%i5) build_info(); Maxima version: 5.23.2 Maxima build date: 11:22 2/2/2011 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 Evaluation took 0.0000 seconds (0.0000 elapsed) (%o5) Second with CCL--the CL version and the Maxima version run in about the same time. (%i1) showtime : all$ (%i2) :lisp(defun $hsum_cl (n) (let ((s 0)) (while (> n 0) (setq s (+ s (/ 1 n))) (decf n)) (to s))) $HSUM_CL (%i2) hsum_cl(10000)$ Evaluation took 0.4850 seconds (0.4890 elapsed) (%i3) hsum_max(n) := block([s : 0], while n > 0 do (s : s + 1/n, n : n-1),s)$ (%i4) hsum_max(10000)$ Evaluation took 0.8740 seconds (0.8800 elapsed) (%i5) build_info(); Maxima version: 5.23.2 Maxima build date: 20:27 2/27/2011 Host type: i686-pc-mingw32 Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.7-dev-r14645M-trunk (WindowsX8632) --Barton From toy.raymond at gmail.com Fri Mar 4 20:55:19 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 04 Mar 2011 21:55:19 -0500 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: References: <762030.69671.qm@web121801.mail.ne1.yahoo.com> <4D710E23.80800@gmail.com> <4D7117BA.3070804@eecs.berkeley.edu> , <4D71629E.8080300@eecs.berkeley.edu> Message-ID: <4D71A617.7050809@gmail.com> On 3/4/11 8:46 PM, Barton Willis wrote: > Maxima sometimes works around slowness in GCL. Maybe the following has > been improved in GCL (but not in 2.6.8). In short, GCL is sometimes > slow with rational addition, but the same calculation in Maxima is > much faster. > > First with GCL: > > (%i1) showtime : all$ > > (%i2) :lisp(defun $hsum_cl (n) (let ((s 0)) (while (> n 0) (setq s (+ s (/ 1 n))) (decf n)) (to s))) > $HSUM_CL > > Super slow: > > (%i2) hsum_cl(10000)$ > Evaluation took 136.2400 seconds (136.2400 elapsed) > Mostly like because you're running intepreted code, not compiled. Try :lisp (compile '$hsum_cl) before running the test. > Second with CCL--the CL version and the Maxima version run in about the same time. Very likely because ccl is a compiler-only Lisp. I think it has no interpreter and compiles everything. I did not test this, but cmucl has an interpreter so $hsum_cl would probably be quite slow too, but it might be dominated by the big rational arithmetic instead of the interpreter. Ray From willisb at unk.edu Sat Mar 5 06:34:12 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 5 Mar 2011 06:34:12 -0600 Subject: [Maxima] Windows package built w/ CCL Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Mostly?like?because?you're?running?intepreted?code,?not?compiled.??Try >:lisp?(compile?'$hsum_cl)?before?running?the?test. Using GCL, hsum_cl is slow with or without compiling. I discovered this years ago. Maybe this has been fixed in GCL, but apparently the fix isn't in the GCL version used by Maxima. I think Maxima has its own function for rational number addition that is (sometimes) much faster than GCL's addition--for my test about 200 times faster. What this all means for deciding on CCL vs GCL for Windows is unclear. Maxima and GCL grew up together, so it's not surprising that they often work well together. (%i1) showtime : all$ (%i2) :lisp(defun $hsum_cl (n) (let ((s 0)) (while (> n 0) (setq s (+ s (/ 1 n))) (decf n)) (to s))) $HSUM_CL (%i2) hsum_cl(10000)$ Evaluation took 147.4300 seconds (147.4300 elapsed) (%i3) :lisp (compile '$hsum_cl) (%i3) hsum_cl(10000)$ Evaluation took 100.4800 seconds (100.4800 elapsed) (%i4) hsum_max(n) := block([s : 0], while n > 0 do (s : s + 1/n, n : n-1),s)$ (%i5) hsum_max(10000)$ Evaluation took 0.5100 seconds (0.5100 elapsed) From jwmixon at bellsouth.net Sat Mar 5 08:09:31 2011 From: jwmixon at bellsouth.net (Wilson Mixon) Date: Sat, 5 Mar 2011 09:09:31 -0500 Subject: [Maxima] Comments in wxMaxima References: Message-ID: Not so. A comment cannot be the last entry in a cell. If you want a comment at the end of a set of commands, add something like "end;" as the last entry in the cell. Wilson Mixon > > Message: 5 > Date: Fri, 4 Mar 2011 14:19:31 -0700 > From: RONALD F MODESITT > To: Maxima Maxima > Subject: [Maxima] wxMaxima and C type comments > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > > It appears to me that C type comments (/* .... */) are not allowed in > wxMaxima. Is this a correct observation? > > many thanks > > > Ronald F. Modesitt > From toy.raymond at gmail.com Sat Mar 5 09:12:36 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 05 Mar 2011 10:12:36 -0500 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: References: Message-ID: <4D7252E4.7080403@gmail.com> On 3/5/11 7:34 AM, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > >> Mostly like because you're running intepreted code, not compiled. Try >> :lisp (compile '$hsum_cl) before running the test. > Using GCL, hsum_cl is slow with or without compiling. I discovered this > years ago. Maybe this has been fixed in GCL, but apparently the fix isn't > in the GCL version used by Maxima. I think Maxima has its own function for > rational number addition that is (sometimes) much faster than > GCL's addition--for my test about 200 times faster. You're right. I apologize for not testing it myself. The result is surprising. I wonder what makes gcl so slow. Do you know how maxima does rational addition? Maybe gcl's gcd algorithm is slow? Ray From fateman at eecs.berkeley.edu Sat Mar 5 09:27:39 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 05 Mar 2011 07:27:39 -0800 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: References: Message-ID: <4D72566B.6060207@eecs.berkeley.edu> On 3/5/2011 4:34 AM, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > >> Mostly like because you're running intepreted code, not compiled. Try >> :lisp (compile '$hsum_cl) before running the test. > Using GCL, hsum_cl is slow with or without compiling. I discovered this > years ago. Maybe this has been fixed in GCL, but apparently the fix isn't > in the GCL version used by Maxima. I think Maxima has its own function for > rational number addition that is (sometimes) much faster than > GCL's addition--for my test about 200 times faster. > > What this all means for deciding on CCL vs GCL for Windows is unclear. Maxima > and GCL grew up together, so it's not surprising that they often work well > together. > > (%i1) showtime : all$ > > (%i2) :lisp(defun $hsum_cl (n) (let ((s 0)) (while (> n 0) (setq s (+ s (/ 1 n))) (decf n)) (to s))) > $HSUM_CL > > (%i2) hsum_cl(10000)$ > Evaluation took 147.4300 seconds (147.4300 elapsed) > (%i3) :lisp (compile '$hsum_cl) > > (%i3) hsum_cl(10000)$ > Evaluation took 100.4800 seconds (100.4800 elapsed) > > (%i4) hsum_max(n) := block([s : 0], while n> 0 do (s : s + 1/n, n : n-1),s)$ > > (%i5) hsum_max(10000)$ > Evaluation took 0.5100 seconds (0.5100 elapsed) > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima In Allegro CL on a 3GHz windows machine, I ran the equivalent (defun hsum(n)(do((i n (1- i))(s 0 (+ s (/ 1 i))))((= i 0) s))) hsum interpreted, (hsum 10000) took 0.828 sec, compiled, 0.734 sec. compiled, it uses 0 cons cells. With some declarations it runs a little faster. RJF From l.butler at ed.ac.uk Sat Mar 5 09:26:57 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sat, 5 Mar 2011 15:26:57 +0000 (GMT) Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: Message-ID: On Wed, 2 Mar 2011, Robert Dodier wrote: < I've updated my sandbox to revision 9c49048 and built Maxima. < I'm seeing the same behavior today as I did a day or two ago; < titles & content is displayed correctly in ISO-8859 locales, < in UTF-8 locales, titles are correct and content is messed up. Ok, I can confirm this: with revision 9c49048, when I set export LC_ALL and LANG in the xterm, then the utf-8 locales are not displayed correctly. I believe this is due print-info-hashes not setting the external-format correctly. (When I view es.utf8/maxima-index.lisp in emacs, the variable buffer-file-coding-system is set to iso-latin-1-unix, the default encoding on my system. After patching, it is utf-8-unix.) I've patched that, and a few things Ray mentioned in this thread. I now see what appears to be the correct characters for both encodings and all languages and lisps in clisp, cmucl and sbcl and on both an xterm and gnome-terminal (debian testing & ubuntu 10.04 less cmucl). To be clear, with revision b5805315e8 in a freshly cloned repo, I execute: ./bootstrap && \ ./configure --enable-sbcl --enable-clisp --with-default-lisp=sbcl \ --program-suffix=-post-5.23 --enable-all-lang && \ make && \ cd tests && \ perl ./rtest-build-index.pl -verbose=1 -run_rtest_build_index=true \ -lisps=sbcl:clisp #:cmucl Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From willisb at unk.edu Sat Mar 5 09:52:37 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 5 Mar 2011 09:52:37 -0600 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: <4D7252E4.7080403@gmail.com> References: , <4D7252E4.7080403@gmail.com> Message-ID: ----maxima-bounces at math.utexas.edu wrote: ----- >??Do?you?know?how?maxima does?rational?addition???Maybe?gcl's?gcd?algorithm?is?slow?? The function addk (src/simp.lisp) does rational number addition. The function addk has several calls to truncate. I don't know what truncate does, but try tracing addk, timeskl, truncate and add 1/2 + 1/2. Why does addk call truncate with with such weird arguments? (example (TRUNCATE 8112052 10000) and (TRUNCATE 7488048 10000)). Huh? --Barton From fateman at eecs.berkeley.edu Sat Mar 5 17:57:29 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 05 Mar 2011 15:57:29 -0800 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: References: , <4D7252E4.7080403@gmail.com> Message-ID: <4D72CDE9.8040004@eecs.berkeley.edu> On 3/5/2011 7:52 AM, Barton Willis wrote: > ----maxima-bounces at math.utexas.edu wrote: ----- > >> Do you know how maxima does rational addition? Maybe gcl's gcd algorithm is slow? > The function addk (src/simp.lisp) does rational number addition. The function addk > has several calls to truncate. Not when I tried it. > I don't know what truncate does, but try tracing > addk, timeskl, truncate and add 1/2 + 1/2. Why does addk call truncate with > with such weird arguments? (example (TRUNCATE 8112052 10000) and (TRUNCATE 7488048 10000)). Huh indeed. Not when I tried tracing etc. No call to truncate. Maybe because I was using wxmaxima, and you were not, and those calls had to do with display?? addk is a pretty bad program for adding 1/2 + 1/2. If Maxima used common lisp rational numbers for 1/2 etc instead of making up its own kind of rational number that looks like ((rat simp) 1 2), it would be many times faster on most lisps. On GCL, the built-in rationals are surprisingly slow. Note that when Macsyma was written in Maclisp, Common Lisp did not exist, and Maclisp had only integers and floats, so the ((rat) 1 2) construction made up for that lack. > Huh? > > --Barton > RJF From willisb at unk.edu Sat Mar 5 18:56:46 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 5 Mar 2011 18:56:46 -0600 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: <4D72CDE9.8040004@eecs.berkeley.edu> References: , <4D7252E4.7080403@gmail.com> , <4D72CDE9.8040004@eecs.berkeley.edu> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >On?3/5/2011?7:52?AM,?Barton?Willis?wrote: >>?----maxima-bounces at math.utexas.edu?wrote:?----- >>?The?function?addk?(src/simp.lisp)?does?rational?number?addition.?The >function?addk has?several?calls?to?truncate. >Not?when?I?tried?it. Oh, I used CCL; let me guess you tried with GCL. Maybe the odd looking calls to truncate (for example (TRUNCATE 16068103 10000) are coming from i/o? For 1/2 + 1/2, GCL doesn't make these same calls to truncate. --Barton From drdieterkaiser at web.de Sat Mar 5 19:11:16 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 06 Mar 2011 02:11:16 +0100 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: References: , <4D7252E4.7080403@gmail.com> , <4D72CDE9.8040004@eecs.berkeley.edu> Message-ID: <1299373876.23668.7.camel@dieter> Am Samstag, den 05.03.2011, 18:56 -0600 schrieb Barton Willis: > -----maxima-bounces at math.utexas.edu wrote: ----- > > >On 3/5/2011 7:52 AM, Barton Willis wrote: > >> ----maxima-bounces at math.utexas.edu wrote: ----- > > >> The function addk (src/simp.lisp) does rational number addition. The > >function addk has several calls to truncate. > > >Not when I tried it. > > Oh, I used CCL; let me guess you tried with GCL. Maybe the odd looking calls > to truncate (for example (TRUNCATE 16068103 10000) are coming from i/o? For 1/2 + 1/2, > GCL doesn't make these same calls to truncate. Yes, most of the calls of TRUNCATE are coming from the parser and the display functions. This is a trace, which shows the calls when adding two rational numbers: 0: (SIMPLUS ((MPLUS) (#1=(RAT SIMP) 1 2) (#1# 1 2)) 1 NIL) 1: (ADDK (#1=(RAT SIMP) 1 2) (#1# 1 2)) 2: (TRUNCATE 2 2) 2: TRUNCATE returned 1 0 2: (TRUNCATE 2 2) 2: TRUNCATE returned 1 0 2: (TRUNCATE 2 2) 2: TRUNCATE returned 1 0 2: (TRUNCATE 2 2) 2: TRUNCATE returned 1 0 1: ADDK returned 1 0: SIMPLUS returned 1 We have always four calls, when adding two rational numbers. Dieter Kaiser From rmodesi at msn.com Sun Mar 6 12:13:59 2011 From: rmodesi at msn.com (RONALD F MODESITT) Date: Sun, 6 Mar 2011 11:13:59 -0700 Subject: [Maxima] wxMaxima and C type (/*...*/)comments Message-ID: Are C type comments (/* ... */) acceptable in wxMaxima? I get error messages when trying to use them. I assume that F6 is the only way to include comments. Thanks, Ronald F. Modesitt -------------- next part -------------- An HTML attachment was scrubbed... URL: From brlinnell at verizon.net Sun Mar 6 06:29:03 2011 From: brlinnell at verizon.net (Bruce Linnell) Date: Sun, 06 Mar 2011 07:29:03 -0500 Subject: [Maxima] Using "get" inside a function Message-ID: <000901cbdbfa$14cbd240$2f01a8c0@brlajdkp0nwqjo> Hi - I am trying to use "get" inside a function in order to make decisions based on the properties of the variable I've passed to the function. I've used LISP as well as various versions of Macsyma/Maxima in the dim and distant past, but I've just started to use it again recently. I'm using version 5.23.2 of XMaxima in Windows. I am doing the following at the command line : g_ll:matrix([-1,0,0,0],[0,A^2/(1-K*r^2),0,0],[0,0,A^2*r^2,0],[0,0,0,A^2*r^2*sin(theta)^2]); put(' g_ll,' Trank2LL,' Trank); NOTE : I've intentionally put spaces after every ' in this email so that they can be seen (the ' is hard to see as 'T on my screen). My actual code has no spaces. My function is currently (stripped down for testing, and to match the manual's example) : TensorTrace (T) := block ( [temp], temp:get(' T,' Trank) )$ And the function call is : TensorTrace(g_ll); My problem is this : WITH a ' before the T (as shown), the debugger says that T is a 4x4 matrix with the correct terms, but T only has the properties [value], whereas (also within the debugger) g_ll has the properties [value, [user properties, Trank]]. And WITHOUT a ' before the T, when I call the function I get a "get: argument must be a symbol or a string; found: errexp1" error message. But the example on (Adobe's) page 514 of the manual under get shows : get(expr,'type) where expr is the variable passed to the function! I'm so confused! Is there some other option besides ' T and T ? Why doesn't it work without a ' like the example in the manual? Thanks in advance to all who reply. Bruce Linnell, PhD -------------- next part -------------- An HTML attachment was scrubbed... URL: From l.butler at ed.ac.uk Sun Mar 6 12:54:55 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sun, 6 Mar 2011 18:54:55 +0000 (GMT) Subject: [Maxima] Using "get" inside a function In-Reply-To: <000901cbdbfa$14cbd240$2f01a8c0@brlajdkp0nwqjo> References: <000901cbdbfa$14cbd240$2f01a8c0@brlajdkp0nwqjo> Message-ID: On Sun, 6 Mar 2011, Bruce Linnell wrote: Bruce, The problem you are struggling with is this: when does the argument to a function get evaluated? Before the function looks at it: (%i1) g(x) := block([], get(x,'Trank)); (%o1) g(x) := block([], get(x, 'Trank)) (%i2) put(X,true,'Trank); (%o2) true (%i3) g(x); (%o3) false (%i4) g(X); (%o4) true That looked good, now assign a value to X: (%i5) X:1; (%o5) 1 (%i6) g(X); get: argument must be a symbol or a string; found: 1 #0: g(x=1) -- an error. To debug this try: debugmode(true); (%i7) g('X); (%o7) true In %i6, X evaluates to 1 before g sees it, hence the error. In %i7, 'X evaluates to X, which is a symbol. %i4 is similar, because an unbound symbol evaluates to itself. If you want to stuff stuff into a symbol, I suggest using hashhes: (%i8) H[Trank] := true ; (%o8) H[Trank]:=true (%i9) H[metric] := matrix([2,1],[1,2]); (%o9) H[metric]:=matrix([2,1],[1,2]) (%i10) H[Trank]; (%o10) true (%i11) H[metric]; (%o11) matrix([2,1],[1,2]) Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From fateman at eecs.berkeley.edu Sun Mar 6 13:53:02 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 06 Mar 2011 11:53:02 -0800 Subject: [Maxima] Using "get" inside a function In-Reply-To: <000901cbdbfa$14cbd240$2f01a8c0@brlajdkp0nwqjo> References: <000901cbdbfa$14cbd240$2f01a8c0@brlajdkp0nwqjo> Message-ID: <4D73E61E.6080000@eecs.berkeley.edu> On 3/6/2011 4:29 AM, Bruce Linnell wrote: > I'm so confused! Is there some other option besides ' T and T ? Why > doesn't it work without a ' like the example in the manual? I don't know about the manual, but when you define a function f(T):= blahblah(T), the semantics of function binding mean that you could alternatively define f(Txyz):=blahblah(Txyz). that is, you should not expect to be able to use get(T, ..) any more than get(Txyz ..). I can think of 3 ways around this. Define TensorTrace():= .... with the understanding that TensorTrace always computes the TensorTrace of the matrix T. (I don't like that..) Another is to define TensorTrace(T, TrankProperty) .... and call it by TensorTrace(T, get(T,Trank)) (I prefer that). Perhaps another way is to define your objects like T in bundles say TO for Tensor Object like this.. defstruct(TO(theMatrix,theTrank)) Then TensorTrace(H):= block ( [ m: H at theMatrix, tk: H at theTrank] ...) should work. The method suggested by Leo also works because function names like sin, cos, H, .. are not obscured by bindings. e.g. f(cos):= cos(cos)+cos returns for f(1), the expression cos(1)+1 RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sun Mar 6 14:23:01 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 6 Mar 2011 14:23:01 -0600 Subject: [Maxima] Windows package built w/ CCL Message-ID: (1) Apparently, gcl 2.7 has a fix; see http://www.mail-archive.com/gcl-devel at gnu.org/msg01867.html (2) The function addk calls timeslk, but timeslk sends its arguments through *red. That's a bit inefficient, I think. Likely, there should be a test for the g = 1 case too. (3) This discussion is far removed from the CCL or GCL question for Windows. I don't have much of an opinion about that. But if I were trying to get cl-ppcre to work with Windows, likely I would favor CCL. --Barton (defun addk (xx yy) (cond ((equal xx 0) yy) ((equal yy 0) xx) ((and (numberp xx) (numberp yy)) (+ xx yy)) ((or ($bfloatp xx) ($bfloatp yy)) ($bfloat (list '(mplus) xx yy))) (t (prog (g a b (x xx)(y yy)) (cond ((numberp x) (cond ((floatp x) (return (+ x (fpcofrat y)))) (t (setq x (list '(rat) x 1))))) ((numberp y) (cond ((floatp y) (return (+ y (fpcofrat x)))) (t (setq y (list '(rat) y 1)))))) (setq g (gcd (caddr x) (caddr y))) (setq a (truncate (caddr x) g) b (truncate (caddr y) g)) (setq g (timeskl (list '(rat) 1 g) (list '(rat) (+ (* (cadr x) b) (* (cadr y) a)) (* a b)))) (return (cond ((numberp g) g) ((equal (caddr g) 1) (cadr g)) ($float (fpcofrat g)) (t g))))))) From fateman at eecs.berkeley.edu Sun Mar 6 16:00:13 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 06 Mar 2011 14:00:13 -0800 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: References: Message-ID: <4D7403ED.8010102@eecs.berkeley.edu> On 3/6/2011 12:23 PM, Barton Willis wrote: > (1) Apparently, gcl 2.7 has a fix; see http://www.mail-archive.com/gcl-devel at gnu.org/msg01867.html > > (2) The function addk calls timeslk, but timeslk sends its arguments through *red. That's > a bit inefficient, I think. Likely, there should be a test for the g = 1 case too. > > (3) This discussion is far removed from the CCL or GCL question for Windows. > I don't have much of an opinion about that. But if I were trying to get > cl-ppcre to work with Windows, likely I would favor CCL. > > --Barton There are 2 things possible to do to fix addk. One requires no change to addk. Just change Maxima's representation of 1/2 from ((rat) 1 2) to the lisp rational number 1/2. Then the test for numberp on line 4 will just add the numbers. This should be done anyway, but may be tedious to check out. Or add line 5 (or do both, just to be safe) > (defun addk (xx yy) > (cond ((equal xx 0) yy) > ((equal yy 0) xx) > ((and (numberp xx) (numberp yy)) (+ xx yy)) (( and (ratnump xx)(ratnump yy)) (/(+ (* (third xx)(second yy))* (third yy)(second xx)))(* (third yy)(third xx)))) > ((or ($bfloatp xx) ($bfloatp yy)) ($bfloat (list '(mplus) xx yy))) > (t (prog (g a b (x xx)(y yy)) > (cond ((numberp x) > (cond ((floatp x) (return (+ x (fpcofrat y)))) > (t (setq x (list '(rat) x 1))))) > ((numberp y) > (cond ((floatp y) (return (+ y (fpcofrat x)))) > (t (setq y (list '(rat) y 1)))))) > (setq g (gcd (caddr x) (caddr y))) > (setq a (truncate (caddr x) g) > b (truncate (caddr y) g)) > (setq g (timeskl (list '(rat) 1 g) > (list '(rat) > (+ (* (cadr x) b) > (* (cadr y) a)) > (* a b)))) > (return (cond ((numberp g) g) > ((equal (caddr g) 1) (cadr g)) > ($float (fpcofrat g)) > (t g))))))) (defun ratp(r)(and (consp r)(eq (caar r) 'rat))) From fateman at eecs.berkeley.edu Sun Mar 6 16:04:08 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 06 Mar 2011 14:04:08 -0800 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: <4D7403ED.8010102@eecs.berkeley.edu> References: <4D7403ED.8010102@eecs.berkeley.edu> Message-ID: <4D7404D8.6010904@eecs.berkeley.edu> On 3/6/2011 2:00 PM, Richard Fateman wrote: (program for addk ..) Oh, 2 things. It PRODUCES common lisp rational numbers, not ((rat) ...). This would make it even faster the next time around, but might break other things. Also, if GCL is slow doing rational arithmetic, it is just playing into that weakness. Lisps should generally be faster using their built-in facilities.. RJF From l.butler at ed.ac.uk Sun Mar 6 17:09:55 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sun, 6 Mar 2011 23:09:55 +0000 (GMT) Subject: [Maxima] Using "get" inside a function In-Reply-To: <4D73E61E.6080000@eecs.berkeley.edu> References: <000901cbdbfa$14cbd240$2f01a8c0@brlajdkp0nwqjo> <4D73E61E.6080000@eecs.berkeley.edu> Message-ID: < Another is to define < TensorTrace(T, TrankProperty) .... < < and call it by < TensorTrace(T, get(T,Trank)) < < (I prefer that). Richard, I think that this won't work for the example Bruce supplied, because he put something in the plist of X and then assigned something to X. That's why I suggested using hashes: he can think of X as being a metric, even if X is a just a hash with a 'metric' slot, amongst others. Of course, a structure is a more systematic way to do the same thing. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From rmodesi at msn.com Sun Mar 6 21:31:36 2011 From: rmodesi at msn.com (RONALD F MODESITT) Date: Sun, 6 Mar 2011 20:31:36 -0700 Subject: [Maxima] Comparing list and matrix elements Message-ID: I have the following code I need help debugging. I would appreciate your review. I suspect that my comparrison statements are incorrect as noted below. load(descriptive)$ L:read_matrix("e:\\spacetimemath\\data.txt",space)$ ut: length(L)$ s:zeromatrix(ut,1)$ for i: 1 thru ut step 1 do s[i,1]: lsum(j,j,L[i]); ub: mean(s) + std(s), numer; lb: mean(s) - std(s), numer; Lstd: matrix([0,0,0,0,0,0]); for i: 1 thru 10 step 1 do (x0: s[i], display(x0), - this line executes if(x0 > lb) then display(lb), - this comparrison statement provides no output if ((x0 > lb) and (x0 < ub)) then Lstd: addrow(Lstd, L[i])); - this comparrison also fails, Lstd has no additional rows. Many thanks in advance for the help. Ronald F. Modesitt -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Mar 7 01:28:29 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 7 Mar 2011 09:28:29 +0200 Subject: [Maxima] Using "get" inside a function In-Reply-To: <000901cbdbfa$14cbd240$2f01a8c0@brlajdkp0nwqjo> References: <000901cbdbfa$14cbd240$2f01a8c0@brlajdkp0nwqjo> Message-ID: Hi, there seem to be two issues here: 1) the semantics of variable quoting and 2) the semantics of properties. Both of them hinge on the difference between a *variable* (container) and its *value* (thing contained). With put('foo,...), you have given the *container* a value. If you now pass the contents of that container to a function, the function has no way of knowing the properties of the container. Maxima does not give users the possibility of giving values properties, so there are several possibilities: 1) you could pass the container itself (e.g. myfunc('foo) ), but then to get its value within the function you would have to write ev(foo), not just foo. 2) you could have a separate array of properties, e.g. you say myprop[foo] : 234$ 3) you could define your own objects of the form, e.g., [val, [prop1,val1], [prop2,val2]...] etc. I believe there is also an object system for Maxima, but I haven't used it myself. -s On Sun, Mar 6, 2011 at 14:29, Bruce Linnell wrote: > Hi - > > I am trying to use "get" inside a function in order to make decisions based > on the properties of the variable I've passed to the function. I've used > LISP as well as various versions of Macsyma/Maxima in the dim and distant > past, but I've just started to use it again recently. I'm using version > 5.23.2 of XMaxima in Windows. I am doing the following at the command line > : > > > g_ll:matrix([-1,0,0,0],[0,A^2/(1-K*r^2),0,0],[0,0,A^2*r^2,0],[0,0,0,A^2*r^2*sin(theta)^2]); > put(' g_ll,' Trank2LL,' Trank); > NOTE : I've intentionally put spaces after every ' in this email so that > they can be seen (the ' is hard to see as 'T on my screen). My actual code > has no spaces. > > My function is currently (stripped down for testing, and to match the > manual's example) : > > TensorTrace (T) := > block > ( > [temp], > temp:get(' T,' Trank) > )$ > > And the function call is : TensorTrace(g_ll); > > > My problem is this : WITH a ' before the T (as shown), the debugger says > that T is a 4x4 matrix with the correct terms, but T only has the properties > [value], whereas (also within the debugger) g_ll has the properties [value, > [user properties, Trank]]. > > And WITHOUT a ' before the T, when I call the function I get a "get: > argument must be a symbol or a string; found: errexp1" error message. But > the example on (Adobe's) page 514 of the manual under get shows : > get(expr,'type) > where expr is the variable passed to the function! > > I'm so confused! Is there some other option besides ' T and T ? Why > doesn't it work without a ' like the example in the manual? > > Thanks in advance to all who reply. > Bruce Linnell, PhD > > > _______________________________________________ > 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 mhw at netris.org Mon Mar 7 06:28:54 2011 From: mhw at netris.org (Mark H Weaver) Date: Mon, 07 Mar 2011 07:28:54 -0500 Subject: [Maxima] Comparing list and matrix elements In-Reply-To: (RONALD F. MODESITT's message of "Sun, 6 Mar 2011 20:31:36 -0700") References: Message-ID: <87r5ajyv09.fsf@netris.org> RONALD F MODESITT writes: > I have the following code I need help debugging. I would appreciate your > review. I suspect that my comparrison statements are incorrect as noted below. > > load(descriptive)$ > L:read_matrix("e:\\spacetimemath\\data.txt",space)$ > ut: length(L)$ > s:zeromatrix(ut,1)$ > for i: 1 thru ut step 1 do > s[i,1]: lsum(j,j,L[i]); > ub: mean(s) + std(s), numer; > lb: mean(s) - std(s), numer; > Lstd: matrix([0,0,0,0,0,0]); > for i: 1 thru 10 step 1 do > (x0: s[i], The last line above is incorrect. s[i] yields a row of the matrix s, which in this case is a list of length 1. A list cannot be compared using > or <. The s[i] should be changed to s[i,1] to yield a scalar. Best, Mark > display(x0), - this line executes > if(x0 > lb) then display(lb), - this comparrison statement provides no > output > if ((x0 > lb) and (x0 < ub)) then Lstd: addrow(Lstd, L[i])); - this > comparrison also fails, Lstd has no additional rows. > > Many thanks in advance for the help. > > Ronald F. Modesitt From robert.dodier at gmail.com Mon Mar 7 09:31:11 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 7 Mar 2011 08:31:11 -0700 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: Message-ID: On 3/5/11, Leo Butler wrote: > I've patched that, and a few things Ray mentioned in this > thread. I now see what appears to be the correct characters > for both encodings and all languages and lisps in clisp, cmucl > and sbcl and on both an xterm and gnome-terminal (debian testing > & ubuntu 10.04 less cmucl). > > To be clear, with revision b5805315e8 in a freshly cloned > repo, I execute: > > ./bootstrap && \ > ./configure --enable-sbcl --enable-clisp --with-default-lisp=sbcl \ > --program-suffix=-post-5.23 --enable-all-lang && \ > make && \ > cd tests && \ > perl ./rtest-build-index.pl -verbose=1 -run_rtest_build_index=true \ > -lisps=sbcl:clisp #:cmucl Works for me, but I had to update makeinfo (texinfo package) to 4.13, which generates UTF-8 characters when the documentencoding is UTF-8. (Makeinfo from texinfo 4.11 generates ASCII approximations such as c, for cedilla.) I'm not too crazy about updating makeinfo. I suspect the existing Makefile machinery in doc/info/* which calls recode or iconv after generating ISO-8859 maxima.info files is a workaround for the inability of pre-4.13 makeinfo versions to actually generate UTF-8. Maybe instead of fudging the documentencoding in maxima.texi, we could s/coding: iso-8859-1/coding: utf-8/ in maxima.info* instead. That would make the declared encoding match the actual without requiring an update for makeinfo. I like the idea of using a Lisp-based system to generate the help index, although I'm not convinced that the extra gyrations to explicitly track the encoding for an ordinary Maxima session are an improvement. (It is necessary to track the encoding when generating the indices since the maxima.info files have different encodings.) FWIW Robert Dodier From rmodesi at msn.com Mon Mar 7 11:30:11 2011 From: rmodesi at msn.com (RONALD F MODESITT) Date: Mon, 7 Mar 2011 10:30:11 -0700 Subject: [Maxima] Comparing list and matrix elements In-Reply-To: <87r5ajyv09.fsf@netris.org> References: , <87r5ajyv09.fsf@netris.org> Message-ID: Mark, Thanks for the help I understand my error for i: 1 thru 10 step 1 do (x0: s[i], -- The s[i] should be changed to s[i,1] to yield a scalar. however I still am unable to add rows to Lstd display(x0), - this line executes display(lb), - new line added for comparrison see output below if(x0 > lb) then display(lb), - this comparrison statement provides no output - no change if ((x0 > lb) and (x0 < ub)) then Lstd: addrow(Lstd, L[i])); - this comparrison also fails, Lstd has no additional rows. - no change I get the following: x0 = 117 lb = [102.16.....] . . . x0 = 154 lb = [102.16....] Lstd; [0,0,0,0,0,0] length(Lstd); 1 Obviously x0 is a scalar being compared to a list (lb), but I am not certain this is an issue. I've tried declaring ub, and lb as scalars without success. Any other ideas? Thanks again, Ron -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhw at netris.org Mon Mar 7 12:39:11 2011 From: mhw at netris.org (Mark H Weaver) Date: Mon, 07 Mar 2011 13:39:11 -0500 Subject: [Maxima] Comparing list and matrix elements In-Reply-To: (RONALD F. MODESITT's message of "Mon, 7 Mar 2011 10:30:11 -0700") References: <87r5ajyv09.fsf@netris.org> Message-ID: <87mxl6zsfk.fsf@netris.org> RONALD F MODESITT writes: > Obviously x0 is a scalar being compared to a list (lb), but I am not > certain this is an issue. Maxima cannot compare a scalar to a list using ">" or "<". What do you think Maxima should do when asked, for example: if (50 > [40,60]) ... If you can answer that question, then I can probably suggest how to fix your code. > I've tried declaring ub, and lb as scalars without success. Do you mean with `declare'? Such properties are only consulted when `ub' or 'lb' are actually seen as _unknowns_ in an expression that is being manipulated by Maxima. In this case, specific list values have been assigned to `ub' and 'lb', such that "(x0 > lb)" evaluates to something like (50 > [40,60]), and that's what the ">" operator now sees. What you have declared about `ub' or `lb' are now irrelevant, because those variables are no longer present. Best, Mark From brlinnell at verizon.net Mon Mar 7 04:32:41 2011 From: brlinnell at verizon.net (Bruce Linnell) Date: Mon, 07 Mar 2011 05:32:41 -0500 Subject: [Maxima] Using "get" inside a function References: <000901cbdbfa$14cbd240$2f01a8c0@brlajdkp0nwqjo> Message-ID: <002c01cbdcb2$fd93ea90$2f01a8c0@brlajdkp0nwqjo> I saw Leo's first email and experimented in XMaxima before I saw the other emails, so I just sent Leo a reply I'd like to repeat here, because I think it's in-line with what Stavros is saying : I think the ultimate problem is that due to the nature of GET and PUT, within the function I'm not going to be able to access *both* the value of the variable (1 in your example), and the value that I put on it (true in your example) at the same time, because one requires that I pass X and the other requires that I pass 'X. I've also tried using declare/feature : declare([Trank1U,Trank1L,Trank2UU,Trank2LL,Trank2UL,Trank2LU],feature)$ declare(g_ll,Trank2LL)$ featurep('g_ll,Trank2LL); --> true But it also seems to suffer from the same problems (passing container vs. contents to a function). I haven't had a chance to digest what Richard said yet (or Leo's hashing suggestion), and I have to get ready to go to work, so I won't be able to do any more with this until tomorrow morning (USA/EST). Thank you all for your thoughtful input! Bruce ----- Original Message ----- From: Stavros Macrakis To: Bruce Linnell Cc: maxima at math.utexas.edu Sent: Monday, March 07, 2011 2:28 AM Subject: Re: [Maxima] Using "get" inside a function Hi, there seem to be two issues here: 1) the semantics of variable quoting and 2) the semantics of properties. Both of them hinge on the difference between a *variable* (container) and its *value* (thing contained). With put('foo,...), you have given the *container* a value. If you now pass the contents of that container to a function, the function has no way of knowing the properties of the container. Maxima does not give users the possibility of giving values properties, so there are several possibilities: 1) you could pass the container itself (e.g. myfunc('foo) ), but then to get its value within the function you would have to write ev(foo), not just foo. 2) you could have a separate array of properties, e.g. you say myprop[foo] : 234$ 3) you could define your own objects of the form, e.g., [val, [prop1,val1], [prop2,val2]...] etc. I believe there is also an object system for Maxima, but I haven't used it myself. -s On Sun, Mar 6, 2011 at 14:29, Bruce Linnell wrote: Hi - I am trying to use "get" inside a function in order to make decisions based on the properties of the variable I've passed to the function. I've used LISP as well as various versions of Macsyma/Maxima in the dim and distant past, but I've just started to use it again recently. I'm using version 5.23.2 of XMaxima in Windows. I am doing the following at the command line : g_ll:matrix([-1,0,0,0],[0,A^2/(1-K*r^2),0,0],[0,0,A^2*r^2,0],[0,0,0,A^2*r^2*sin(theta)^2]); put(' g_ll,' Trank2LL,' Trank); NOTE : I've intentionally put spaces after every ' in this email so that they can be seen (the ' is hard to see as 'T on my screen). My actual code has no spaces. My function is currently (stripped down for testing, and to match the manual's example) : TensorTrace (T) := block ( [temp], temp:get(' T,' Trank) )$ And the function call is : TensorTrace(g_ll); My problem is this : WITH a ' before the T (as shown), the debugger says that T is a 4x4 matrix with the correct terms, but T only has the properties [value], whereas (also within the debugger) g_ll has the properties [value, [user properties, Trank]]. And WITHOUT a ' before the T, when I call the function I get a "get: argument must be a symbol or a string; found: errexp1" error message. But the example on (Adobe's) page 514 of the manual under get shows : get(expr,'type) where expr is the variable passed to the function! I'm so confused! Is there some other option besides ' T and T ? Why doesn't it work without a ' like the example in the manual? Thanks in advance to all who reply. Bruce Linnell, PhD _______________________________________________ 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 Mar 7 17:24:56 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 7 Mar 2011 16:24:56 -0700 Subject: [Maxima] Using "get" inside a function In-Reply-To: <002c01cbdcb2$fd93ea90$2f01a8c0@brlajdkp0nwqjo> References: <000901cbdbfa$14cbd240$2f01a8c0@brlajdkp0nwqjo> <002c01cbdcb2$fd93ea90$2f01a8c0@brlajdkp0nwqjo> Message-ID: I haven't been following this carefully, but as mentioned elsewhere in this thread, maybe you can use Maxima's defstruct to get what you want. defstruct allows you to bundle things together. defstruct (trank (U1, L1, UU2, LL2, UL2, LU2)); mytrank : new (trank); mytrank at U1 : ; mytrank at LU2 : ; foo (x) := x at LU2 - x at UL2; /* or some other operation */ foo (mytrank); => Sorry, defstruct isn't documented; I guess you can blame me for that. It is really pretty simple-minded -- like C structs, if you're familiar with that, and not like C++ or Java classes. HTH, Robert Dodier From l.couraud at gmail.com Tue Mar 8 07:20:27 2011 From: l.couraud at gmail.com (laurent couraud) Date: Tue, 8 Mar 2011 14:20:27 +0100 Subject: [Maxima] TR : Windows package built w/ CCL Message-ID: <8E0608C2A1AF42F9A84B16132F8705FE@PASSERELLE> > -----Message d'origine----- > De?: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] De la part de > Robert Dodier > Envoy??: vendredi 4 mars 2011 08:03 > ??: Maxima Mailing List > Objet?: [Maxima] Windows package built w/ CCL > > So there is a Windows package built with CCL now. > The one problem that's unresolved is that the CCL > binary uses instructions (SSE2) which don't exist > on some old CPU's. How big a problem is that? > Can we recompile CCL to not use those instructions? > or is there some other workaround? > > I am hoping that we can use CCL for the Windows > package in the near future so I'd like to get any > problems straightened out. > > best > > Robert Dodier At least for my part it is not a big problem. I can avoid updating Maxima until I buy a new computer. Best Laurent. > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From talon at lpthe.jussieu.fr Tue Mar 8 09:20:48 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 08 Mar 2011 16:20:48 +0100 Subject: [Maxima] grinding to C, colnew Message-ID: Hello, I have slightly modified the cgrind program for grinding maxima expressions to a form acceptable by C, so that when complex numbers appear in the expression an error message is produced. Last version at: http://www.lpthe.jussieu.fr/~talon/cgrind.html or below signature. I doing that i have seen what i beleive is a bug in fortra.lisp, the lack of a progn below unwind-protect which seems to nullify the protection. cgrind works like that: niobe% maxima (%i1) load(cgrind); (%o1) /home/michel/.maxima/cgrind.sse2f (%i2) cgrind(integrate((x^3+7*x)/sqrt(x^2+1),x)); pow(x,2)*sqrt(pow(x,2)+1)/3.0e+0+1.9e+1*sqrt(pow(x,2)+1)/3.0e+0; (%o2) done (%i3) m:matrix([x, x^2], [x^(-2),9]); [ 2 ] [ x x ] [ ] (%o3) [ 1 ] [ -- 9 ] [ 2 ] [ x ] (%i4) cgrind(m); M[0][0] = x; M[0][1] = pow(x,2); M[1][0] = 1/pow(x,2); M[1][1] = 9; (%o4) done Now i am working on colnew, which has been ported to maxima by R. Toy. In fact it works remarkably well. I cannot see much to be done to improve stuff except some dumbing down pre parametrizations. But i see at least one problem, if one wants to do continuations, the way in which colnew:colnew is called under a lot of flet, let, etc. stuff makes it hard to modify the call. Let me recall that continuations consist in doing further calls to colnew keeping the old fspace and ispace, but moving slowly an optional parameter. This way the old solution serves as a guess for the new one. This is a very powerful feature very well exemplified in http://www.mathworks.com/help/techdoc/math/f1-713877.html#brfhdqp-2 Colnew has provisions to do that by setting ipar(9)= 2 or 3 except for the first computation where ipar(9)=1 and a guess is provided. Well, i dont see easy way to do that with the way the wrapper is presently formulated. I wonder if it would not be more expedient to put the wrapper in the colnew package, so that names don't need any more to be hidden under flets and lets, add another parameter (the continuation parameter) to differential equations and boundary conditions, and write a smaller wrapper in the maxima package. Anyaways, in doing that, i have seen two small problems. First, there is a function "push" documented in maxima manual, but it doesn't work: niobe% maxima (%i1) push(1,[]); (%o1) push(1, []) Second, there exists on maxima CVS a file called colnew.mac under share/colnew, which contains /* Compile and load the colnew routines (in lisp) */ load("load-colnew.lisp"); At least in my installation this file is missing. But it is useful for loading colnew easily like: niobe% maxima (%i1) load(colnew); ;; Loading #P"/home/michel/.maxima/binary/binary-cmucl/share/colnew/binary- cmucl/colnew-package.sse2f". ...... ;; Loading #P"/home/michel/.maxima/binary/binary-cmucl/share/colnew/binary- cmucl/colnew-if.sse2f". (%o2) /usr/local/share/maxima/5.22.1/share/colnew/colnew.mac With my best regards -- Michel Talon http://www.lpthe.jussieu.fr/~talon/cgrind.lisp (in-package :maxima) (macsyma-module cgrind) ;; This is heavily lifted from grind.lisp and fortra.lisp, and should have the ;; same features as the fortran command. In order to work it needs to be compiled and ;; then loaded, as in (for the case of cmucl): ;; :lisp (compile-file "cgrind.lisp"), copy cgrind.sse2f to ~/.maxima ;; load(cgrind) ;; Then one can run cgrind(expression) or cgrind(matrix). ;; M. Talon (2011) (declare-top ($loadprint ;If NIL, no load message gets printed. )) ;; This function is called from Macsyma toplevel. First the arguments is ;; checked to be a single expression. Then if the argument is a ;; symbol, and the symbol is bound to a matrix, the matrix is printed ;; using an array assignment notation. (defmspec $cgrind (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)) ($cgrindmx l value)) ((and (not (atom value)) (eq (caar value) 'mequal) (symbolp (cadr value)) ($matrixp (caddr value))) ($cgrindmx (cadr value) (caddr value))) (t (c-print value))))) (defun c-print (x &optional (stream *standard-output*)) ;; Restructure the expression for displaying. ;; Mainly sanitizes exponentials, notably exp(2/3) becomes ;; exp(2.0/3.0) (setq x (scanforc x)) ;; Protects the modifications to mexpt from creeping out. (unwind-protect (progn (defprop mexpt msz-cmexpt grind) ;; This means basic printing for atoms, grind does fancy things. (setq *fortran-print* t) ;; Prints using the usual grind mechanisms (mgrind x stream)(write-char #\; stream)(write-char #\Newline stream)) ;; Restore usual mexpt property etc. before exiting this frame. (defprop mexpt msz-mexpt grind) (setq *fortran-print* nil)) '$done) ;; The only modification to grind, converts a^b to pow(a,b), but taking ;; care of appropriate bracketing. The argument l to the left of (MEXPT) ;; has to be composed backwards. Finally a^-b has special treatment. (defun msz-cmexpt (x l r) (setq l (msize (cadr x) (revappend '(#\p #\o #\w #\() l) (list #\,) 'mparen 'mparen) r (if (mmminusp (setq x (nformat (caddr x)))) (msize (cadr x) (list #\-) (cons #\) r) 'mexpt rop) (msize x nil (cons #\) r ) 'mparen 'mparen))) (list (+ (car l) (car r)) l r)) ;; Takes a name and a matrix and prints a sequence of C assignment ;; statements of the form ;; NAME[I][J] = ;; This requires some formatting work unnecessary for the fortran case. (defmfun $cgrindmx (name mat &optional (stream *standard-output*) &aux ($loadprint nil)) (cond ((not (symbolp name)) (merror (intl:gettext "cgrindmx: first argument must be a symbol; found: ~M") name)) ((not ($matrixp mat)) (merror (intl:gettext "cgrindmx: 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)) (format stream "~a[~a][~a] = " (string-left-trim "$" name) (1- i) (1- j) ) (c-print (car m) stream))) '$done) ;; This C scanning function is similar to fortscan. Prepare an expression ;; for printing by converting x^(1/2) to sqrt(x), etc. Since C has no ;; support for complex numbers, contrary to Fortran, ban them. (defun scanforc (e) (cond ((atom e) (cond ((eq e '$%i) ;; ban complex numbers (merror (intl:gettext "Take real and imaginary parts"))) (t e))) ;; %e^a -> exp(a) ((and (eq (caar e) 'mexpt) (eq (cadr e) '$%e)) (list '(%exp simp) (scanforc (caddr e)))) ;; a^1/2 -> sqrt(a) 1//2 is defined as ((rat simp) 1 2) ((and (eq (caar e) 'mexpt) (alike1 (caddr e) 1//2)) (list '(%sqrt simp) (scanforc (cadr e)))) ;; a^-1/2 -> 1/sqrt(a) ((and (eq (caar e) 'mexpt) (alike1 (caddr e) -1//2)) (list '(mquotient simp) 1 (list '(%sqrt simp) (scanforc (cadr e))))) ;; (1/3)*b -> b/3.0 and (-1/3)*b -> -b/3.0 ((and (eq (caar e) 'mtimes) (ratnump (cadr e)) (member (cadadr e) '(1 -1) :test #'equal)) (cond ((equal (cadadr e) 1) (scanforc-mtimes e)) (t (list '(mminus simp) (scanforc-mtimes e))))) ;; 1/3 -> 1.0/3.0 ((eq (caar e) 'rat) (list '(mquotient simp) (float (cadr e)) (float (caddr e)))) ;; rat(a/b) -> a/b via ratdisrep ((eq (caar e) 'mrat) (scanforc (ratdisrep e))) ;; ban complex numbers ((and (member (caar e) '(mtimes mplus) :test #'eq) (let ((a (simplify ($bothcoef e '$%i)))) (and (numberp (cadr a)) (numberp (caddr a)) (not (zerop1 (cadr a))) (merror (intl:gettext "Take real and imaginary parts")))))) ;; in general do nothing, recurse (t (cons (car e) (mapcar 'scanforc (cdr e)))))) ;; This is used above 1/3*b*c -> b*c/3.0 (defun scanforc-mtimes (e) (list '(mquotient simp) (cond ((null (cdddr e)) (scanforc (caddr e))) (t (cons (car e) (mapcar 'scanforc (cddr e))))) (float (caddr (cadr e))))) From working.good at gmail.com Tue Mar 8 09:39:25 2011 From: working.good at gmail.com (alex) Date: Tue, 08 Mar 2011 17:39:25 +0200 Subject: [Maxima] grinding to C, colnew In-Reply-To: References: Message-ID: <4D764DAD.20607@gmail.com> On 03/08/2011 05:20 PM, Michel Talon wrote: > > Anyaways, in doing that, i have seen two small problems. > > First, there is a function "push" documented in maxima manual, but > it doesn't work: > niobe% maxima > (%i1) push(1,[]); > (%o1) push(1, []) > > load(basic)$ will help. Also second argument must be a symbol, which references a list. Alex From working.good at gmail.com Tue Mar 8 09:40:51 2011 From: working.good at gmail.com (alex) Date: Tue, 08 Mar 2011 17:40:51 +0200 Subject: [Maxima] grinding to C, colnew In-Reply-To: References: Message-ID: <4D764E03.6020509@gmail.com> On 03/08/2011 05:20 PM, Michel Talon wrote: > First, there is a function "push" documented in maxima manual, but > it doesn't work: > niobe% maxima > (%i1) push(1,[]); > (%o1) push(1, []) > you can use endcons() to mimick push() in the way you want it: (%i4) endcons(1,[]); (%o4) [1] Alex From toy.raymond at gmail.com Tue Mar 8 12:01:07 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 08 Mar 2011 13:01:07 -0500 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: References: Message-ID: <4D766EE3.3000409@gmail.com> On 3/4/11 2:03 AM, Robert Dodier wrote: > So there is a Windows package built with CCL now. > The one problem that's unresolved is that the CCL > binary uses instructions (SSE2) which don't exist > on some old CPU's. How big a problem is that? > Can we recompile CCL to not use those instructions? > or is there some other workaround? I think it would be a big effort to get CCL to run without SSE2 instructions. I think all the internal operations need to be changed to use x87 instructions; you can't just recompile CCL to enable what doesn't exist, unfortunately. (Wouldn't that be really cool, though? :-) ) Ray From toy.raymond at gmail.com Tue Mar 8 12:03:59 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 08 Mar 2011 13:03:59 -0500 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: <4D71629E.8080300@eecs.berkeley.edu> References: <762030.69671.qm@web121801.mail.ne1.yahoo.com> <4D710E23.80800@gmail.com> <4D7117BA.3070804@eecs.berkeley.edu> <4D71629E.8080300@eecs.berkeley.edu> Message-ID: <4D766F8F.9060800@gmail.com> On 3/4/11 5:07 PM, Richard Fateman wrote: > > And incidentally, the use of SSE2 instructions should give CCL a boost > over GCL; > if somehow CCL could be compiled without SSE2 it might be much more than > 3X slower on the tests I used. Since gcl compiles by converting Lisp to C and calling the C compiler, it seems fairly easy to make gcl use sse2 if the C compiler can use sse2. I suspect that gcl needs to be built this way though. That is, you can't change the compiler options in gcl to use sse2 and expect the resulting compiled files to work in a gcl that doesn't already use sse2. Calling conventions could be different. Ray From willisb at unk.edu Tue Mar 8 12:09:16 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 8 Mar 2011 12:09:16 -0600 Subject: [Maxima] Windows package built w/ CCL In-Reply-To: <4D7403ED.8010102@eecs.berkeley.edu> References: <4D7403ED.8010102@eecs.berkeley.edu> Message-ID: maxima-bounces at math.utexas.edu wrote on 03/06/2011 04:00:13 PM: > > (2) The function addk calls timeslk, but timeslk sends its > arguments through *red. That's a bit inefficient, I think. Oh, I see...yes timeslk has two calls to *red, but timeslk assumes that its arguments are simplified (so *red isn't called on the *arguments* to timeslk.) The code in addk (setq g (timeskl (list '(rat) 1 g) (list '(rat) (+ (* (cadr x) b) (* (cadr y) a)) (* a b)))) is fast because it makes use of the fact (+ (* (cadr x) b) (* (cadr y) a)) and (* a b) are relatively prime. Maybe gcl doesn't use the fact that these numbers are relatively prime? A check for the g = 1 case probably isn't worth it. Switching Maxima to use CL rationals isn't something that I'm not going to attempt. I'd make a mess of things for years to come, I think. --Barton From toy.raymond at gmail.com Tue Mar 8 12:11:35 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 08 Mar 2011 13:11:35 -0500 Subject: [Maxima] Colnew (Was Re: grinding to C, colnew) In-Reply-To: References: Message-ID: <4D767157.5040307@gmail.com> On 3/8/11 10:20 AM, Michel Talon wrote: > Now i am working on colnew, which has been ported to maxima by R. Toy. In > fact it works remarkably well. I cannot see much to be done to improve stuff > except some dumbing down pre parametrizations. But i see at least one > problem, if one wants to do continuations, the way in which colnew:colnew is > called under a lot of flet, let, etc. stuff makes it hard to modify the > call. Let me recall that continuations consist in doing further calls to > colnew keeping the old fspace and ispace, but moving slowly an optional > parameter. This way the old solution serves as a guess for the new one. This > is a very powerful feature very well exemplified in > http://www.mathworks.com/help/techdoc/math/f1-713877.html#brfhdqp-2 Thanks for this link. I'll take a look at it and see how to use this feature. I previously had not tried this because I couldn't find a simple and readable example (using a language that I knew). > Colnew has provisions to do that by setting ipar(9)= 2 or 3 > except for the first computation where ipar(9)=1 and a guess is provided. > Well, i dont see easy way to do that with the way the wrapper is presently > formulated. I wonder if it would not be more expedient to put the wrapper > in the colnew package, so that names don't need any more to be hidden under > flets and lets, add another parameter (the continuation parameter) to > differential equations and boundary conditions, and write a smaller wrapper > in the maxima package. If you have some simple examples, can you send them to me? It will help me understand how to use colnew in this way and how a user would want to interact with colnew from maxima. I made the interface to colnew to support basic operations easily or at least what I thought would be "natural". We could also provide a more advance "expert" interface that exposes more of the colnew interface for expert users to control. > > Second, there exists on maxima CVS a file called colnew.mac under > share/colnew, which contains > /* Compile and load the colnew routines (in lisp) */ > load("load-colnew.lisp"); > At least in my installation this file is missing. But it is useful for > This is a bug. You're expected to use load("colnew") to load up the colnew package. I'll look into seeing that it gets installed. Ray From l.butler at ed.ac.uk Tue Mar 8 14:42:40 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 8 Mar 2011 20:42:40 +0000 (GMT) Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: Message-ID: On Mon, 7 Mar 2011, Robert Dodier wrote: < On 3/5/11, Leo Butler wrote: < < > I've patched that, and a few things Ray mentioned in this < > thread. I now see what appears to be the correct characters < > for both encodings and all languages and lisps in clisp, cmucl < > and sbcl and on both an xterm and gnome-terminal (debian testing < > & ubuntu 10.04 less cmucl). < > < > To be clear, with revision b5805315e8 in a freshly cloned < > repo, I execute: < > < > ./bootstrap && \ < > ./configure --enable-sbcl --enable-clisp --with-default-lisp=sbcl \ < > --program-suffix=-post-5.23 --enable-all-lang && \ < > make && \ < > cd tests && \ < > perl ./rtest-build-index.pl -verbose=1 -run_rtest_build_index=true \ < > -lisps=sbcl:clisp #:cmucl < < Works for me, That's good to hear. < but I had to update makeinfo (texinfo package) < to 4.13, which generates UTF-8 characters when the < documentencoding is UTF-8. (Makeinfo from texinfo 4.11 < generates ASCII approximations such as c, for cedilla.) < < I'm not too crazy about updating makeinfo. I don't know: Makeinfo 4.11 is 3.5 years old and 4.13 is 2.5 years old. I think it is reasonable to expect folks to have reasonably up-to-date kit. < I suspect the < existing Makefile machinery in doc/info/* which calls recode or < iconv after generating ISO-8859 maxima.info files is a < workaround for the inability of pre-4.13 makeinfo versions to < actually generate UTF-8. < Maybe instead of fudging the < documentencoding in maxima.texi, we could < s/coding: iso-8859-1/coding: utf-8/ in maxima.info* instead. < That would make the declared encoding match the actual < without requiring an update for makeinfo. I'll look into this possibility. < < I like the idea of using a Lisp-based system to generate the < help index, although I'm not convinced that the extra gyrations < to explicitly track the encoding for an ordinary Maxima < session are an improvement. (It is necessary to track the < encoding when generating the indices since the maxima.info < files have different encodings.) I think that there is a better way to do this, while still making it possible to set the encoding and generate index files from different info files. I'll see what I can do. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From talon at lpthe.jussieu.fr Tue Mar 8 15:05:50 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 08 Mar 2011 22:05:50 +0100 Subject: [Maxima] Colnew (Was Re: grinding to C, colnew) References: <4D767157.5040307@gmail.com> Message-ID: Raymond Toy wrote: >> exemplified in >> http://www.mathworks.com/help/techdoc/math/f1-713877.html#brfhdqp-2 > Thanks for this link. I'll take a look at it and see how to use this > feature. I previously had not tried this because I couldn't find a > simple and readable example (using a language that I knew). I had not found this example previously. So here we have a boundary layer problem, we may think the parameter is viscosity, for large viscosity, the boundary layer is smooth and easy to solve, so continue from that to small viscosity where the problems becomes very steep and hard to compute. The example i have is the quantum Neumann problem. It illustrates the fact that colnew can be used to find eigenvalues of boundary problems. The trick is to add a new equation (lambda)'=0 for each eigenvalue appearing in the equation and having of course as many equations as unknowns. The problem is discussed in details here: http://arxiv.org/pdf/hep-th/0407005 http://arxiv.org/pdf/hep-th/0507207 It is a Schrodinger equation on a sphere of radius R. When R -> 0 the problem reduces to spheroidal harmonics, which in the coordinates in question are polynomials with roots satisfying a known equation (see Whittaker and Watson, last chapter). This serves as guess for small R. Then one performs continuation up to large values of R. This means of the order of 50 computations for each eigenvalue followed from small R to large R. In the above papers 36 eigenvalues are followed which means solving 36*50 differential equations and boundary problems. There is the further niceness that one can compute the eigenvalues for large R by perturbation theory, and check the numerical computation. Anyways the computation took of the order of 5 mn with scilab running directly the fortran colnew, on a P4 uniprocessor at 3Ghz. I will report the time needed to do the same with the lispified colnew. > interact with colnew from maxima. I made the interface to colnew to > support basic operations easily or at least what I thought would be > "natural". As far as i can see your interface supports absolutely everything except continuation. > > We could also provide a more advance "expert" interface that exposes > more of the colnew interface for expert users to control. I think what could be useful is a dumbed down version where ipar array is automatically filled and so on. On can compute the size of ispace and fspace automatically, check that the data obey the appropriate constraints etc. With some ingeniosity one can determine the z vector from the equations and write automatically everything in terms of the z vector. This is what the python wrapper does and i am working on. I will also try to provide a sufficiently extensive documentation and examples. By the way the python wrapper and more examples are here: http://pav.iki.fi/software/bvp/ Example 2 here is also a continuation example. >> >> Second, there exists on maxima CVS a file called colnew.mac under >> share/colnew, which contains >> /* Compile and load the colnew routines (in lisp) */ >> load("load-colnew.lisp"); >> At least in my installation this file is missing. But it is useful for >> > This is a bug. You're expected to use load("colnew") to load up the > colnew package. I'll look into seeing that it gets installed. In fact i don't remember if it is colnew.mac or load-colnew.lisp which is missing, but one of the two is not here. > > Ray -- Michel Talon From talon at lpthe.jussieu.fr Tue Mar 8 15:25:15 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 08 Mar 2011 22:25:15 +0100 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings References: Message-ID: Robert Dodier wrote: > > I like the idea of using a Lisp-based system to generate the > help index, although I'm not convinced that the extra gyrations > to explicitly track the encoding for an ordinary Maxima > session are an improvement. (It is necessary to track the > encoding when generating the indices since the maxima.info > files have different encodings.) > One may wonder if problems will not be generated by the need of such "gyrations" when using non english locales. This is because some systems, like Linux, are naturally utf-8, while others, like FreeBSD use ISO8859-1. I suspect there is a potential of confusion here. I know i have to filter TeX files with iconv when exchanging them with these sorts of machines. Presumably Windows uses some sort of codepage and MacOS still other stuff. -- Michel Talon From talon at lpthe.jussieu.fr Tue Mar 8 15:28:29 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 08 Mar 2011 22:28:29 +0100 Subject: [Maxima] Windows package built w/ CCL References: <4D7403ED.8010102@eecs.berkeley.edu> Message-ID: Richard Fateman wrote: > Just change Maxima's representation of 1/2 from ((rat) 1 2) to the > lisp rational number 1/2. As i have looked this 1//2 stuff yesterday, i have seen that the representation ((rat) 1 2) is assumed in a lot of places, and changing that will break a lot of code (example fortra.lisp) -- Michel Talon From lan1967 at mail.ru Tue Mar 8 23:49:27 2011 From: lan1967 at mail.ru (t t) Date: Wed, 09 Mar 2011 08:49:27 +0300 Subject: [Maxima] histogram saving Message-ID: Good day, dear users! I got a question. I am using Maxima 5.32.2 I need to save histogram after using histogram(x) but have no clue how to do that. I tried to find it in the manual but failed to do it in reasonable time. Thank you for your attention. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Wed Mar 9 00:40:30 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 8 Mar 2011 23:40:30 -0700 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: Message-ID: On 3/8/11, Michel Talon wrote: > Robert Dodier wrote: >> I like the idea of using a Lisp-based system to generate the >> help index, although I'm not convinced that the extra gyrations >> to explicitly track the encoding for an ordinary Maxima >> session are an improvement. > One may wonder if problems will not be generated by the need of such > "gyrations" when using non english locales. This is because some systems, > like Linux, are naturally utf-8, while others, like FreeBSD use > ISO8859-1. The key point is whether or not the encoding is specified by Maxima, or it is determined by the Lisp implementation without Maxima's assistance. The current implementation of the help system relies on the Lisp implementation and we haven't gotten any complaints about encoding problems. If you know of specific encoding problems with Maxima, I would be interested to hear about it. best Robert Dodier From robert.dodier at gmail.com Wed Mar 9 00:44:09 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 8 Mar 2011 23:44:09 -0700 Subject: [Maxima] more about build-index+cl-ppcre branch & encodings In-Reply-To: References: Message-ID: On 3/8/11, Leo Butler wrote: > < I'm not too crazy about updating makeinfo. > > I don't know: Makeinfo 4.11 is 3.5 years old and 4.13 is 2.5 > years old. I think it is reasonable to expect folks to have > reasonably up-to-date kit. I guess it's not a big deal. Using makeinfo 4.13 would obviate the need for recode / iconv (by directly generating UTF-8) & therefore allow for a simpler build process. best Robert Dodier From biomates at telefonica.net Wed Mar 9 03:37:00 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 09 Mar 2011 10:37:00 +0100 Subject: [Maxima] histogram saving In-Reply-To: References: Message-ID: <1299663420.1726.2.camel@trasno> El mi?, 09-03-2011 a las 08:49 +0300, t t escribi?: > Good day, dear users! > I got a question. > I am using Maxima 5.32.2 > I need to save histogram after using histogram(x) but have no clue how > to do that. > I tried to find it in the manual but failed to do it in reasonable > time. > Thank you for your attention. Try histogram(s1, terminal=eps); Take a look at ? terminal to see what other output formats are supported. -- Mario From lan1967 at mail.ru Wed Mar 9 04:36:24 2011 From: lan1967 at mail.ru (t t) Date: Wed, 09 Mar 2011 13:36:24 +0300 Subject: [Maxima] =?koi8-r?b?RndkOiBoaXN0b2dyYW0gc2F2aW5n?= Message-ID: Thanks a lot. It worked. Wed, 09 Mar 2011 08:49:27 +0300 ?????? ?? t t : Good day, dear users! I got a question. I am using Maxima 5.32.2 I need to save histogram after using histogram(x) but have no clue how to do that. I tried to find it in the manual but failed to do it in reasonable time. Thank you for your attention. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aksber at gmail.com Wed Mar 9 06:14:25 2011 From: aksber at gmail.com (Aksel Bertelsen) Date: Wed, 9 Mar 2011 13:14:25 +0100 Subject: [Maxima] load(distrib) Message-ID: There is a problem with load(distrib) on some computers using windows XP.? I get something like this: load (distrib); Load failed for C:/Programme/Maxima- 5.23.2/share/maxima/5.23.2/share/contrib/distrib/numdistrib.lisp -- an error. To debug this try debugmode(true); I can fix the problem replacing 1.7976931348623157E308 by most-positive-flonum in numdistrib.lisp, but it is annoying having to do this everytime there is a computer with this problem. Aksel Bertelsen From toy.raymond at gmail.com Wed Mar 9 06:51:22 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 09 Mar 2011 07:51:22 -0500 Subject: [Maxima] load(distrib) In-Reply-To: References: Message-ID: <4D7777CA.3060701@gmail.com> On 3/9/11 7:14 AM, Aksel Bertelsen wrote: > There is a problem with load(distrib) on some computers using > windows XP. I get something like this: > > load (distrib); > Load failed for C:/Programme/Maxima- > 5.23.2/share/maxima/5.23.2/share/contrib/distrib/numdistrib.lisp > -- an error. To debug this try debugmode(true); > > I can fix the problem replacing 1.7976931348623157E308 by > most-positive-flonum in > numdistrib.lisp, but it is annoying having to do this everytime there > is a computer with > this problem. Sounds like an issue with gcl (?). Yes, that's a good idea. And some of the other constants in that file could probably be replaced with other constants too. Ray From talon at lpthe.jussieu.fr Wed Mar 9 08:42:31 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 09 Mar 2011 15:42:31 +0100 Subject: [Maxima] Colnew (Was Re: grinding to C, colnew) References: <4D767157.5040307@gmail.com> Message-ID: Raymond Toy wrote: > If you have some simple examples, can you send them to me? There is a very simple example of general interest. Take the Schroedinger equation (also called Sturm Liouville problem) f'' +(E-V(x))f = 0 with e.g. boundary conditions f(0)=f(%pi)=0 Since this is a second order equation, it depends on 2 constants, that one can fix by asking f(0)=0 f'(0)=1 for example. In general the solution f does not satisfy f(%pi)=0 except for specific values E_n of the energy, the eigenvalues. This problem is amenable to colnew by adding the differential equation E'= 0 The system becomes non linear, since we have the product E.f but now it depends on 3 constants, and we have 3 equations f(0)=1, f'(0)=1, f(%pi)=0. The number of equations, equal to the number of unknowns is called mstar in colnew. When the potential V(x) is 0 the solution is trivial: f(x)=1/n sin(nx) for n=1,2,... and so E_n=n^2. Hence we can solve the general case by introducing a continuation parameter t and replacing V(x) by tV(x) for 0 Hi, I committed today a package share/dynamics/visualization.lisp that sends its output to Xmaxima, in a similar fashion as plot2d(...[plot_option,xmaxima]) does. It uses the Tcl version of VTK to create 3D scenes. Something similar to what Mario has proposed in a previous message but it also makes animations. In Ubuntu, the package vtk-tcl is required. Here are some examples: Example 1 (a cone) scene([cone]); Example 2 (sphere and cone) ball: [sphere,[position,0.8,0,0], [thetaresolution,40], [phiresolution,40], [color,1,0.3882,0.2784]]$ cone: [cone,[color,1,1,0.5],[resolution,12],[capping,0]]$ scene([ball, cone], [background, 0.1, 0.2, 0.4]); Example 3 (bouncing ball) pos: makelist([0,0,2.1-9.8*(0.01*i)^2/2],i,0,64)$ pos: append(pos, reverse(pos))$ ball:[sphere,[radius,0.1],[thetaresolution,20],[phiresolution,20], [position,0,0,2.1],[color,1,0,0],[animate,position,pos]]$ ground:[cube,[xlength,2],[ylength,2],[zlength,0.2],[position,0,0,-0.1], [color,0.8,1.0,0.6]]$ scene([ball, ground],[restart,1]); While I work in documenting it, you can look at share/dynamics/visualization.lisp to see the VTK classes and Methods implemented at this time. Regards, Jaime From biomates at telefonica.net Wed Mar 9 14:22:28 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 09 Mar 2011 21:22:28 +0100 Subject: [Maxima] New visualization package In-Reply-To: <1299686818.1988.21.camel@wigner> References: <1299686818.1988.21.camel@wigner> Message-ID: <1299702148.2775.5.camel@pc> El mi?, 09-03-2011 a las 16:06 +0000, Jaime Villate escribi?: > Hi, > I committed today a package share/dynamics/visualization.lisp that sends > its output to Xmaxima, in a similar fashion as > plot2d(...[plot_option,xmaxima]) does. > > It uses the Tcl version of VTK to create 3D scenes. Something similar to > what Mario has proposed in a previous message but it also makes > animations. In Ubuntu, the package vtk-tcl is required. > Here are some examples: > > Example 1 (a cone) > scene([cone]); > Jaime, 1 > Example 2 (sphere and cone) > ball: [sphere,[position,0.8,0,0], [thetaresolution,40], > [phiresolution,40], [color,1,0.3882,0.2784]]$ > cone: [cone,[color,1,1,0.5],[resolution,12],[capping,0]]$ > scene([ball, cone], [background, 0.1, 0.2, 0.4]); > > Example 3 (bouncing ball) > pos: makelist([0,0,2.1-9.8*(0.01*i)^2/2],i,0,64)$ > pos: append(pos, reverse(pos))$ > ball:[sphere,[radius,0.1],[thetaresolution,20],[phiresolution,20], > [position,0,0,2.1],[color,1,0,0],[animate,position,pos]]$ > ground:[cube,[xlength,2],[ylength,2],[zlength,0.2],[position,0,0,-0.1], > [color,0.8,1.0,0.6]]$ > scene([ball, ground],[restart,1]); > > While I work in documenting it, you can look at > share/dynamics/visualization.lisp to see the VTK classes and Methods > implemented at this time. > > Regards, > Jaime > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From biomates at telefonica.net Wed Mar 9 15:12:10 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 09 Mar 2011 22:12:10 +0100 Subject: [Maxima] New visualization package In-Reply-To: <1299686818.1988.21.camel@wigner> References: <1299686818.1988.21.camel@wigner> Message-ID: <1299705130.2795.14.camel@pc> El mi?, 09-03-2011 a las 16:06 +0000, Jaime Villate escribi?: > Hi, > I committed today a package share/dynamics/visualization.lisp that sends > its output to Xmaxima, in a similar fashion as > plot2d(...[plot_option,xmaxima]) does. > > It uses the Tcl version of VTK to create 3D scenes. Something similar to > what Mario has proposed in a previous message but it also makes > animations. In Ubuntu, the package vtk-tcl is required. > > Here are some examples: > > Example 1 (a cone) > scene([cone]); Jaime, I've tried to check your package, but got the following error in ubuntu: (%i8) scene([cone]); Error in startup script: invoked "break" outside of a loop while executing "if { [llength $maxima_priv(plotfile)] > 0 } { set fptr [open [lindex $maxima_priv(plotfile) 0] r] regsub -all -- {/\*.*?\*/} [read $fptr] {} i..." (file "/usr/local/bin/xmaxima" line 15516) (%o8) 1 One of the problems I've seen with vtk is that rendering is slower than with Gnuplot. Probably this is due to tcl. (Sorry for my previous blank message. Somehow I removed part of the text before clicking on the "send" button.) Thanks for sharing your work. -- Mario From woollett at charter.net Wed Mar 9 15:22:08 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 9 Mar 2011 13:22:08 -0800 Subject: [Maxima] test file with matrix Message-ID: How can I use a test file item containing the Maxima matrix object? my test file dgintro2-test.mac has, for problems 151-156 the lines: ------------------------------- up1 : UU(E,E,0,0,1); matrix([0],[0],[sqrt(2*E)],[0]); vp2b : sbar (VV (E,E,%pi,0,-1)); matrix([0,-sqrt(2*E),0,0]); a12 : vp2b . Gam[mu] . up1; matrix([0,-sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[sqrt(2*E)],[0]); up3b : sbar (UU (E,E,th,0,1)); matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]); vp4 : VV (E,E,%pi-th,%pi,-1); matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)], [sin((%pi-th)/2)*sqrt(2*E)]); a34 : up3b . Gam[mu] . vp4; matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)], [sin((%pi-th)/2)*sqrt(2*E)]); --------------------------- and the batch file run batch ("dgintro2-test.mac",test) gives, for these problems the output: ----------------------- ********************** Problem 151 *************** Input: up1:UU(E,E,0,0,1) Result: matrix([0],[0],[sqrt(2*E)],[0]) This differed from the expected result: matrix([0],[0],[sqrt(2*E)],[0]) ********************** Problem 152 *************** Input: vp2b:sbar(VV(E,E,%pi,0,-1)) Result: matrix([0,-sqrt(2*E),0,0]) This differed from the expected result: matrix([0,-sqrt(2*E),0,0]) ********************** Problem 153 *************** Input: a12:vp2b . Gam[mu] . up1 Result: matrix([0,-sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[sqrt(2*E)],[0]) This differed from the expected result: matrix([0,-sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[sqrt(2*E)],[0]) ********************** Problem 154 *************** Input: up3b:sbar(UU(E,E,th,0,1)) Result: matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) This differed from the expected result: matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) ********************** Problem 155 *************** Input: vp4:VV(E,E,%pi-th,%pi,-1) Result: matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)],[sin((%pi-th)/2)*sqrt(2*E)]) This differed from the expected result: matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)],[sin((%pi-th)/2)*sqrt(2*E)]) ********************** Problem 156 *************** Input: a34:up3b . Gam[mu] . vp4 Result: matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)],[sin((%pi-th)/2)*sqrt(2*E)]) This differed from the expected result: matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)], [sin((%pi-th)/2)*sqrt(2*E)]) ------------------------------------------ Is there a way I can get around this behavior?? ( am using display2d:false, ver 5.23.2 with windows xp with xmaxima interface) Ted Woollett From drdieterkaiser at web.de Wed Mar 9 15:56:02 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 09 Mar 2011 22:56:02 +0100 Subject: [Maxima] A Closer Look at Maxima Message-ID: <1299707762.4475.5.camel@dieter> Perhaps it is of interest, there is a nice article about Maxima: A Closer Look at Maxima posted by John F. McGwan, Ph. D. in Applied Math on Februar 21st, 2011. http://math-blog.com/2011/02/21/a-closer-look-at-maxima/ Dieter Kaiser From drdieterkaiser at web.de Wed Mar 9 16:05:31 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 09 Mar 2011 23:05:31 +0100 Subject: [Maxima] test file with matrix In-Reply-To: References: Message-ID: <1299708331.4475.12.camel@dieter> Am Mittwoch, den 09.03.2011, 13:22 -0800 schrieb Edwin Woollett: > How can I use a test file item containing > the Maxima matrix object? > > my test file dgintro2-test.mac has, for problems > 151-156 the lines: > ------------------------------- > > up1 : UU(E,E,0,0,1); > matrix([0],[0],[sqrt(2*E)],[0]); > vp2b : sbar (VV (E,E,%pi,0,-1)); > matrix([0,-sqrt(2*E),0,0]); > a12 : vp2b . Gam[mu] . up1; > matrix([0,-sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[sqrt(2*E)],[0]); > up3b : sbar (UU (E,E,th,0,1)); > matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]); > vp4 : VV (E,E,%pi-th,%pi,-1); > matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)], > [sin((%pi-th)/2)*sqrt(2*E)]); > a34 : up3b . Gam[mu] . vp4; > matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) > . Gam[mu] > . matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)], > [sin((%pi-th)/2)*sqrt(2*E)]); > > --------------------------- > and the batch file run > batch ("dgintro2-test.mac",test) gives, for > these problems the output: > > ----------------------- > ********************** Problem 151 *************** > Input: > up1:UU(E,E,0,0,1) > > > Result: > matrix([0],[0],[sqrt(2*E)],[0]) > > This differed from the expected result: > matrix([0],[0],[sqrt(2*E)],[0]) > > ********************** Problem 152 *************** > Input: > vp2b:sbar(VV(E,E,%pi,0,-1)) > > > Result: > matrix([0,-sqrt(2*E),0,0]) > > This differed from the expected result: > matrix([0,-sqrt(2*E),0,0]) > > ********************** Problem 153 *************** > Input: > a12:vp2b . Gam[mu] . up1 > > > Result: > matrix([0,-sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[sqrt(2*E)],[0]) > > This differed from the expected result: > matrix([0,-sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[sqrt(2*E)],[0]) > > ********************** Problem 154 *************** > Input: > up3b:sbar(UU(E,E,th,0,1)) > > > Result: > matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) > > This differed from the expected result: > matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) > > ********************** Problem 155 *************** > Input: > vp4:VV(E,E,%pi-th,%pi,-1) > > > Result: > matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)],[sin((%pi-th)/2)*sqrt(2*E)]) > > This differed from the expected result: > matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)],[sin((%pi-th)/2)*sqrt(2*E)]) > > ********************** Problem 156 *************** > Input: > a34:up3b . Gam[mu] . vp4 > > > Result: > matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) > . Gam[mu] > . matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)],[sin((%pi-th)/2)*sqrt(2*E)]) > > This differed from the expected result: > matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) > . Gam[mu] . matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)], > [sin((%pi-th)/2)*sqrt(2*E)]) > ------------------------------------------ > > Is there a way I can get around this behavior?? > > ( am using display2d:false, > ver 5.23.2 with windows xp with > xmaxima interface) It is often a problem, that the output looks identically for the result and the test. But often there are subtle differences, because the test input is simplified before it is compared with the result. I do not know the problem for your examples. Perhaps you can send me your complete batch file, and I will have a look at it. One workaround I often use is to subtract and simplify the expressions to check for a zero result. Dieter Kaiser From woollett at charter.net Wed Mar 9 17:31:02 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 9 Mar 2011 15:31:02 -0800 Subject: [Maxima] test file with matrix References: <1299708331.4475.12.camel@dieter> Message-ID: <2A17AD5839D14A2880261B7E19B0CD59@edwinc367e16bd> On March 9, 2011, Dieter Kaiser wrote: ------------------------------ It is often a problem, that the output looks identically for the result and the test. But often there are subtle differences, because the test input is simplified before it is compared with the result. I do not know the problem for your examples. Perhaps you can send me your complete batch file, and I will have a look at it. One workaround I often use is to subtract and simplify the expressions to check for a zero result. ----------------------------------------- Hi Dieter, thanks for the suggestion to try an alternative approach. What seems to work is using is (equal (up1, explicit matrix object)). With the following test file input all my tests passed: ...................................................................... (up1:UU(E,E,0,0,1), is (equal (up1,matrix([0],[0],[sqrt(2*E)],[0])))); true; (vp2b : sbar (VV (E,E,%pi,0,-1)), is (equal (vp2b,matrix([0,-sqrt(2*E),0,0])))); true; (a12 : vp2b . Gam[mu] . up1, is (equal (a12, matrix([0,-sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[sqrt(2*E)],[0])))); true; (up3b : sbar (UU (E,E,th,0,1)), is (equal (up3b, matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0])))); true; (vp4 : VV (E,E,%pi-th,%pi,-1), is (equal (vp4, matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)], [sin((%pi-th)/2)*sqrt(2*E)])))); true; (a34 : up3b . Gam[mu] . vp4, is (equal (a34, matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)], [sin((%pi-th)/2)*sqrt(2*E)])))); true; ...................................................................... thanks again, ted ----- Original Message ----- From: Dieter Kaiser To: Edwin Woollett Cc: maxima mailing list Sent: Wednesday, March 09, 2011 2:05 PM Subject: Re: [Maxima] test file with matrix Am Mittwoch, den 09.03.2011, 13:22 -0800 schrieb Edwin Woollett: > How can I use a test file item containing > the Maxima matrix object? > > my test file dgintro2-test.mac has, for problems > 151-156 the lines: > ------------------------------- > > up1 : UU(E,E,0,0,1); > matrix([0],[0],[sqrt(2*E)],[0]); > vp2b : sbar (VV (E,E,%pi,0,-1)); > matrix([0,-sqrt(2*E),0,0]); > a12 : vp2b . Gam[mu] . up1; > matrix([0,-sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[sqrt(2*E)],[0]); > up3b : sbar (UU (E,E,th,0,1)); > matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]); > vp4 : VV (E,E,%pi-th,%pi,-1); > matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)], > [sin((%pi-th)/2)*sqrt(2*E)]); > a34 : up3b . Gam[mu] . vp4; > matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) > . Gam[mu] > . matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)], > [sin((%pi-th)/2)*sqrt(2*E)]); > > --------------------------- > and the batch file run > batch ("dgintro2-test.mac",test) gives, for > these problems the output: > > ----------------------- > ********************** Problem 151 *************** > Input: > up1:UU(E,E,0,0,1) > > > Result: > matrix([0],[0],[sqrt(2*E)],[0]) > > This differed from the expected result: > matrix([0],[0],[sqrt(2*E)],[0]) > > ********************** Problem 152 *************** > Input: > vp2b:sbar(VV(E,E,%pi,0,-1)) > > > Result: > matrix([0,-sqrt(2*E),0,0]) > > This differed from the expected result: > matrix([0,-sqrt(2*E),0,0]) > > ********************** Problem 153 *************** > Input: > a12:vp2b . Gam[mu] . up1 > > > Result: > matrix([0,-sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[sqrt(2*E)],[0]) > > This differed from the expected result: > matrix([0,-sqrt(2*E),0,0]) . Gam[mu] . matrix([0],[0],[sqrt(2*E)],[0]) > > ********************** Problem 154 *************** > Input: > up3b:sbar(UU(E,E,th,0,1)) > > > Result: > matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) > > This differed from the expected result: > matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) > > ********************** Problem 155 *************** > Input: > vp4:VV(E,E,%pi-th,%pi,-1) > > > Result: > matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)],[sin((%pi-th)/2)*sqrt(2*E)]) > > This differed from the expected result: > matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)],[sin((%pi-th)/2)*sqrt(2*E)]) > > ********************** Problem 156 *************** > Input: > a34:up3b . Gam[mu] . vp4 > > > Result: > matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) > . Gam[mu] > . > matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)],[sin((%pi-th)/2)*sqrt(2*E)]) > > This differed from the expected result: > matrix([cos(th/2)*sqrt(2*E),sin(th/2)*sqrt(2*E),0,0]) > . Gam[mu] . matrix([0],[0],[-cos((%pi-th)/2)*sqrt(2*E)], > [sin((%pi-th)/2)*sqrt(2*E)]) > ------------------------------------------ > > Is there a way I can get around this behavior?? > > ( am using display2d:false, > ver 5.23.2 with windows xp with > xmaxima interface) From rmodesi at msn.com Wed Mar 9 17:49:09 2011 From: rmodesi at msn.com (RONALD F MODESITT) Date: Wed, 9 Mar 2011 16:49:09 -0700 Subject: [Maxima] Comparing list and matrix elements In-Reply-To: <87mxl6zsfk.fsf@netris.org> References: , <87r5ajyv09.fsf@netris.org>, , <87mxl6zsfk.fsf@netris.org> Message-ID: Mark, Many thanks for the help. You gave me the aha moment I needed. I have everything working now that I am thinking about entities (Lists, Matricies, etc) properly. Ronald F. Modesitt -------------- next part -------------- An HTML attachment was scrubbed... URL: From mira at um.es Thu Mar 10 01:21:38 2011 From: mira at um.es (=?ISO-8859-1?Q?Jos=E9_Manuel_Mira?=) Date: Thu, 10 Mar 2011 08:21:38 +0100 Subject: [Maxima] Disable the command system Message-ID: <4D787C02.1070505@um.es> Hello everyone I have the project to put maxima on my page in order to my students use it from a web interface. But, I need to disable the command system of maxima, which gives access to execute commands in the system. I have not found documentation on the subject. Any suggestions? Thanks -- Jos? Manuel Mira Departamento de Matem?ticas Universidad de Murcia http://webs.um.es/mira From villate at fe.up.pt Thu Mar 10 02:40:29 2011 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 10 Mar 2011 08:40:29 +0000 Subject: [Maxima] New visualization package In-Reply-To: <1299705130.2795.14.camel@pc> References: <1299686818.1988.21.camel@wigner> <1299705130.2795.14.camel@pc> Message-ID: <1299746429.1868.4.camel@wigner> On Wed, 2011-03-09 at 22:12 +0100, Mario Rodriguez wrote: > I've tried to check your package, but got the following error in ubuntu: > (%i8) scene([cone]); > Error in startup script: invoked "break" outside of a loop > while executing > "if { [llength $maxima_priv(plotfile)] > 0 } { > set fptr [open [lindex $maxima_priv(plotfile) 0] r] > regsub -all -- {/\*.*?\*/} [read $fptr] {} i..." > (file "/usr/local/bin/xmaxima" line 15516) > (%o8) 1 Hi Mario, did you update Xmaxima to the latest CVS version from yesterday? Did you try that command from console maxima, wxmaxima or xmaxima? > One of the problems I've seen with vtk is that rendering is slower than > with Gnuplot. Probably this is due to tcl. I've tried it with C++ and tcl and I don't see much difference. The problem is that it uses OpenGL so its rendering is highly dependent on your graphics card. In some of the laptops where I have tried it it works very fast. Cheers, Jaime From BIOMATES at telefonica.net Thu Mar 10 02:50:38 2011 From: BIOMATES at telefonica.net (BIOMATES at telefonica.net) Date: Thu, 10 Mar 2011 09:50:38 +0100 (CET) Subject: [Maxima] New visualization package In-Reply-To: <1299746429.1868.4.camel@wigner> References: <1299686818.1988.21.camel@wigner> <1299705130.2795.14.camel@pc> <1299746429.1868.4.camel@wigner> Message-ID: <24108019.2657091299747038367.JavaMail.root@wm3> Hello, > did you update Xmaxima to the latest CVS version from yesterday? Ok, that's probably the problem. I'll check it later. Thanks -- 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: From villate at fe.up.pt Thu Mar 10 03:01:56 2011 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 10 Mar 2011 09:01:56 +0000 Subject: [Maxima] Disable the command system In-Reply-To: <4D787C02.1070505@um.es> References: <4D787C02.1070505@um.es> Message-ID: <1299747716.1868.13.camel@wigner> On Thu, 2011-03-10 at 08:21 +0100, Jos? Manuel Mira wrote: > I have the project to put maxima on my page in order to my students use > it from a web interface. But, I need to disable the command system of > maxima, which gives access to execute commands in the system. I have not > found documentation on the subject. > > Any suggestions? Hi, here is a suggestion: (%i1) system("date"); Thu Mar 10 08:50:33 WET 2011 (%o1) # (%i2) system([a]):=print("Hola!"); define: warning: redefining the built-in function system (%o2) system([a]) := print("Hello!") (%i3) system("date"); Hola! (%o3) Hello! If you put that definition in the system's maxima-init.mac file, it will be active in every session. Even safer, you could also remove the definition of system from the source code and recompile Maxima. In any case, I advise you to put your Maxima inside a "chroot" environment, which are easy to set up in Debian. Cheers, Jaime From l.butler at ed.ac.uk Thu Mar 10 03:38:50 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 10 Mar 2011 09:38:50 +0000 (GMT) Subject: [Maxima] Disable the command system In-Reply-To: <4D787C02.1070505@um.es> References: <4D787C02.1070505@um.es> Message-ID: On Thu, 10 Mar 2011, Jos? Manuel Mira wrote: < Hello everyone < < I have the project to put maxima on my page in order to my students use it < from a web interface. But, I need to disable the command system of maxima, < which gives access to execute commands in the system. I have not found < documentation on the subject. < < Any suggestions? Hello, This is a very sticky problem, I think. A Maxima shell permits restricted access to the underlying Lisp, which has some 'system' call. So I don't think that disabling commands but enabling access to a Maxima shell is a good idea -- at best you have a false sense of security. As I see it, you have three alternatives: -provide an interface that allows only access to a limited command set (this has problems, because Maxima evaluates its function arguments, so you are back in the situation above unless you turn off more stuff...); -allow full access to a Maxima shell but run the shell under very restrictive conditions. For example, you could run your webserver and Maxima inside a virtual machine. -use the Sage web interface, which gives you access to Maxima. This topic has been discussed several times in the last few years. See http://www.math.utexas.edu/pipermail/maxima/2006/002157.html It would be helpful, if you come up with a successful setup, to document it on the Maxima wiki and/or report back here. One last thing: I wouldn't permit unrestricted access. I would create password protected accounts for the students. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From david.kirkby at onetel.net Thu Mar 10 05:03:22 2011 From: david.kirkby at onetel.net (Dr. David Kirkby) Date: Thu, 10 Mar 2011 11:03:22 +0000 Subject: [Maxima] Disable the command system In-Reply-To: References: <4D787C02.1070505@um.es> Message-ID: <4D78AFFA.6010209@onetel.net> On 03/10/11 09:38 AM, Leo Butler wrote: > > > On Thu, 10 Mar 2011, Jos? Manuel Mira wrote: > > < Hello everyone > < > < I have the project to put maxima on my page in order to my students use it > < from a web interface. But, I need to disable the command system of maxima, > < which gives access to execute commands in the system. I have not found > < documentation on the subject. > < > < Any suggestions? > > Hello, > This is a very sticky problem, I think. > A Maxima shell permits restricted access > to the underlying Lisp, which has some > 'system' call. So I don't think that > disabling commands but enabling access to > a Maxima shell is a good idea -- at best > you have a false sense of security. > > As I see it, you have three alternatives: > -provide an interface that allows only > access to a limited command set (this > has problems, because Maxima evaluates its > function arguments, so you are back in the > situation above unless you turn off > more stuff...); > -allow full access to a Maxima shell but run > the shell under very restrictive conditions. > For example, you could run your webserver and > Maxima inside a virtual machine. > -use the Sage web interface, which gives you > access to Maxima. Using Sage would not solve the problem - that too has the ability to escape to the python shell. For the web interface to Sage at http://t2nb.math.washington.edu:8080/ that is run in a Solaris zone. Even if one escapes to a shell, and uses a hack to get root access, you still can't do anything outside the zone. FreeBSD has jails, which like Solaris zones were designed for security. I'm not sure how secure virtual machines are. Unlike FreeBSD jails and Solaris zones, they are not designed with security in mind, though I suspect they do create a big barrier for hackers. Of course, if Unix file permissions are set correct, this can help a lot. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? Dave From l.butler at ed.ac.uk Thu Mar 10 06:21:11 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 10 Mar 2011 12:21:11 +0000 (GMT) Subject: [Maxima] Disable the command system In-Reply-To: <4D78AFFA.6010209@onetel.net> References: <4D787C02.1070505@um.es> <4D78AFFA.6010209@onetel.net> Message-ID: On Thu, 10 Mar 2011, Dr. David Kirkby wrote: < On 03/10/11 09:38 AM, Leo Butler wrote: < > -allow full access to a Maxima shell but run < > the shell under very restrictive conditions. < > For example, you could run your webserver and < > Maxima inside a virtual machine. < > -use the Sage web interface, which gives you < > access to Maxima. < < Using Sage would not solve the problem - that too has the ability to escape to < the python shell. < < For the web interface to Sage at < < http://t2nb.math.washington.edu:8080/ I wasn't clear enough: let the students use Sage project's web interface above. If one of them hacks it, then that is a security lesson for the Sage folks. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From carbajal at ifi.uzh.ch Thu Mar 10 06:32:15 2011 From: carbajal at ifi.uzh.ch (Juan Pablo Carbajal) Date: Thu, 10 Mar 2011 13:32:15 +0100 Subject: [Maxima] Bug in diff? Message-ID: Hi everybody, Can anybody tell me if there is something wrong here (%i0) kill(all); (%i1) 'diff(p,t,1); 'diff(%theta,t,1); 'diff(r,t,1); 'diff(%phi,t,1); (%o1) 'diff(p,t,1) (%o2) 'diff(%theta,t,1) (%o3) 'diff(r,t,1) (%o4) 0 Why is %04 zero? Thank you very much -- M. Sc. Juan Pablo Carbajal ----- PhD Student University of Z?rich www.ailab.ch/carbajal From carbajal at ifi.uzh.ch Thu Mar 10 06:37:41 2011 From: carbajal at ifi.uzh.ch (Juan Pablo Carbajal) Date: Thu, 10 Mar 2011 13:37:41 +0100 Subject: [Maxima] Bug in diff? In-Reply-To: References: Message-ID: Ok, I understood, Everytime one ask for 'diff(X,Y,N) if X is a predefined constant then it gives 0. Isn't the " ' " at the beginig saying "do not evaluate"? On Thu, Mar 10, 2011 at 1:32 PM, Juan Pablo Carbajal wrote: > Hi everybody, > > Can anybody tell me if there is something wrong here > (%i0) kill(all); > (%i1) 'diff(p,t,1); 'diff(%theta,t,1); 'diff(r,t,1); 'diff(%phi,t,1); > > (%o1) 'diff(p,t,1) > (%o2) 'diff(%theta,t,1) > (%o3) 'diff(r,t,1) > (%o4) 0 > > Why is %04 zero? > > Thank you very much > > > -- > M. Sc. Juan Pablo Carbajal > ----- > PhD Student > University of Z?rich > www.ailab.ch/carbajal > -- M. Sc. Juan Pablo Carbajal ----- PhD Student University of Z?rich www.ailab.ch/carbajal From willisb at unk.edu Thu Mar 10 06:42:41 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 10 Mar 2011 06:42:41 -0600 Subject: [Maxima] Bug in diff? In-Reply-To: References: Message-ID: The derivative of %phi is zero because %phi is represents the number (1 + sqrt(5))/2 (the golden mean). --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >Hi?everybody, > >Can?anybody?tell?me?if?there?is?something?wrong?here >(%i0)?kill(all); >(%i1)?'diff(p,t,1);?'diff(%theta,t,1);?'diff(r,t,1);?'diff(%phi,t,1); > >(%o1)?'diff(p,t,1) >(%o2)?'diff(%theta,t,1) >(%o3)?'diff(r,t,1) >(%o4)?0 > >Why?is?%04?zero? > >Thank?you?very?much > From l.butler at ed.ac.uk Thu Mar 10 10:51:37 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 10 Mar 2011 16:51:37 +0000 (GMT) Subject: [Maxima] Bug in diff? In-Reply-To: References: Message-ID: On Thu, 10 Mar 2011, Barton Willis wrote: < The derivative of %phi is zero because %phi is represents the number (1 + sqrt(5))/2 (the golden mean). < < --Barton < If you look at the online help for ', you will see this statement: "The single quote does not prevent simplification." As Barton indicates, Maxima considers diff(%phi,t) --> 0 to be a simplification not an evaluation. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From willisb at unk.edu Thu Mar 10 11:42:16 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 10 Mar 2011 11:42:16 -0600 Subject: [Maxima] Bug in diff? In-Reply-To: References: Message-ID: --Barton Leo Butler wrote on 03/10/2011 10:51:37 AM: > If you look at the online help for ', you will see this statement: > > "The single quote does not prevent simplification." > > As Barton indicates, Maxima considers diff(%phi,t) --> 0 to be a > simplification not an evaluation. There isn't much way for a user to know that. Some functions such as limit, sum, product, .. have both simplify and evaluate, I think. (%i2) :lisp(get '%derivative 'operators) SIMPDERIV (%i2) :lisp(trace simpderiv) NIL (%i5) 'diff(%phi,x); 0> Calling (SIMPDERIV ((%DERIVATIVE) $%PHI $X) 1 NIL) <0 SIMPDERIV returned 0 (%o5) 0 --Barton From l.butler at ed.ac.uk Thu Mar 10 11:50:00 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 10 Mar 2011 17:50:00 +0000 (GMT) Subject: [Maxima] Bug in diff? In-Reply-To: References: Message-ID: On Thu, 10 Mar 2011, Barton Willis wrote: < --Barton < < Leo Butler wrote on 03/10/2011 10:51:37 AM: < < < > If you look at the online help for ', you will see this statement: < > < > "The single quote does not prevent simplification." < > < > As Barton indicates, Maxima considers diff(%phi,t) --> 0 to be a < > simplification not an evaluation. < < There isn't much way for a user to know that. Some functions such as < limit, sum, < product, .. have both simplify and evaluate, I think. Perhaps this example can be in the relevant section? < < (%i2) :lisp(get '%derivative 'operators) < SIMPDERIV < < (%i2) :lisp(trace simpderiv) < NIL < < (%i5) 'diff(%phi,x); < 0> Calling (SIMPDERIV ((%DERIVATIVE) $%PHI $X) 1 NIL) < <0 SIMPDERIV returned 0 < (%o5) 0 < < < --Barton < < -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From dlakelan at street-artists.org Thu Mar 10 13:13:24 2011 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 10 Mar 2011 11:13:24 -0800 Subject: [Maxima] orthopoly and derivatives Message-ID: <4D7922D4.40009@street-artists.org> I'm expanding a function in chebyshev polynomials and then substituting it into a differential equation. I get an expression that has noun forms for the derivatives. I would like to expand the derivatives without having maxima expand the chebyshev polynomials into their basic form. How can I make it do this? Example, I want to get %o199 where the derivatives have been evaluated according to the gradef properties of the chebyshev polynomials, not into a form that's a basic polynomial in x (apologies for the word wrapping in the last expression). ---- (%i196) depends(foo,x); (%o196) [foo(x)] (%i197) foo = sum(A[i]*funmake(chebyshev_t,[i,x]),i,0,3); (%o197) foo = A T (x) + A T (x) + A T (x) + A T (x) 3 3 2 2 1 1 0 0 (%i198) 'diff(foo,x)-3*'diff(foo,x,2) = 0; 2 dfoo d foo (%o198) ---- - 3 ----- = 0 dx 2 dx (%i199) subst(%th(2),%th(1)); d (%o199) -- (A T (x) + A T (x) + A T (x) + A T (x)) dx 3 3 2 2 1 1 0 0 2 d - 3 (--- (A T (x) + A T (x) + A T (x) + A T (x))) = 0 2 3 3 2 2 1 1 0 0 dx (%i200) From pip at iszf.irk.ru Thu Mar 10 16:46:00 2011 From: pip at iszf.irk.ru (Valery Pipin) Date: Thu, 10 Mar 2011 14:46:00 -0800 Subject: [Maxima] orthopoly and derivatives In-Reply-To: <4D7922D4.40009@street-artists.org> References: <4D7922D4.40009@street-artists.org> Message-ID: <201103101446.00825.pip@iszf.irk.ru> Why not to make differentiation in spectral space? I don't see a problem in if maxima will differentiate directrly as well. You will need go to numbers in any case either following to Galerkin procedure, or estimating polynomials in collocation points (pseudospectral) > I'm expanding a function in chebyshev polynomials and then substituting > it into a differential equation. I get an expression that has noun forms > for the derivatives. I would like to expand the derivatives without > having maxima expand the chebyshev polynomials into their basic form. > How can I make it do this? > > Example, I want to get %o199 where the derivatives have been evaluated > according to the gradef properties of the chebyshev polynomials, not > into a form that's a basic polynomial in x (apologies for the word > wrapping in the last expression). > > ---- > > (%i196) depends(foo,x); > (%o196) [foo(x)] > (%i197) foo = sum(A[i]*funmake(chebyshev_t,[i,x]),i,0,3); > (%o197) foo = A T (x) + A T (x) + A T (x) + A T (x) > 3 3 2 2 1 1 0 0 > (%i198) 'diff(foo,x)-3*'diff(foo,x,2) = 0; > 2 > dfoo d foo > (%o198) ---- - 3 ----- = 0 > dx 2 > dx > (%i199) subst(%th(2),%th(1)); > d > (%o199) -- (A T (x) + A T (x) + A T (x) + A T (x)) > dx 3 3 2 2 1 1 0 0 > 2 > d > - 3 (--- (A T (x) + A T (x) + A T (x) + A T > (x))) = 0 > 2 3 3 2 2 1 1 0 0 > dx > (%i200) > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From dlakelan at street-artists.org Thu Mar 10 17:13:32 2011 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 10 Mar 2011 15:13:32 -0800 Subject: [Maxima] orthopoly and derivatives In-Reply-To: <201103101446.00825.pip@iszf.irk.ru> References: <4D7922D4.40009@street-artists.org> <201103101446.00825.pip@iszf.irk.ru> Message-ID: <4D795B1C.1030902@street-artists.org> On 03/10/2011 02:46 PM, Valery Pipin wrote: > Why not to make differentiation in spectral space? > I don't see a problem in if maxima will differentiate directrly as well. > You will need go to numbers in any case either following to Galerkin > procedure, or estimating polynomials in collocation points (pseudospectral) Yes, I could go to an entirely numerical procedure. In maxima, doing collocation points would probably not be too difficult. My problem is simple enough that if I am willing to wait a long time the Galerkin projections can be done exactly via maxima's integrate. I thought perhaps if I can keep it from expanding things into basic polynomials then I can use the orthogonal properties and much simplify the calculation of the Galerkin projection. I will do numerical procedures next if I can not get a symbolic form for the Galerkin projections. From pip at iszf.irk.ru Thu Mar 10 23:15:36 2011 From: pip at iszf.irk.ru (Valery Pipin) Date: Thu, 10 Mar 2011 21:15:36 -0800 Subject: [Maxima] orthopoly and derivatives In-Reply-To: <4D795B1C.1030902@street-artists.org> References: <4D7922D4.40009@street-artists.org> <201103101446.00825.pip@iszf.irk.ru> <4D795B1C.1030902@street-artists.org> Message-ID: <201103102115.36977.pip@iszf.irk.ru> ? ????????? ?? 10 ????? 2011 15:13:32 ????? dlakelan ???????: > On 03/10/2011 02:46 PM, Valery Pipin wrote: > > Why not to make differentiation in spectral space? > > I don't see a problem in if maxima will differentiate directrly as well. > > You will need go to numbers in any case either following to Galerkin > > procedure, or estimating polynomials in collocation points > > (pseudospectral) > > Yes, I could go to an entirely numerical procedure. In maxima, doing > collocation points would probably not be too difficult. > > My problem is simple enough that if I am willing to wait a long time the > Galerkin projections can be done exactly via maxima's integrate. I > thought perhaps if I can keep it from expanding things into basic > polynomials then I can use the orthogonal properties and much simplify > the calculation of the Galerkin projection. > > I will do numerical procedures next if I can not get a symbolic form for > the Galerkin projections. Ok, I have no time to wait. I do Galerkin via Gauss integration(just summation). Calculation of matrices for the eigen-value mean-field solar dynamo model takes about 1day(24H) on 4core 2.53Gz linux mashine. The matrix rank is 500x500. From talon at lpthe.jussieu.fr Fri Mar 11 04:18:48 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 11 Mar 2011 11:18:48 +0100 Subject: [Maxima] Colnew, etc. Message-ID: To understand the colnew wrapper i have written a small program, and i am puzzled by a small glitch in the interface between maxima and lisp (if it is relevant, my maxima is compiled with cmucl) The problem is that the same call works in (%i3) below, doesn't work in (%i4) but works in (%i5) after having compiled f. What is the explanantion of this behaviour, please? niobe% maxima (%i1) f(x):=[x^2,x^3]; 2 3 (%o1) f(x) := [x , x ] (%i2) load("essai.lisp"); (%o2) essai.lisp (%i3) ?conversion(f); (%o3) {Array: #(25.0 125.0)} (%i4) :lisp(conversion #'$f) Maxima encountered a Lisp error: Error in FDEFINITION: the function $F is undefined. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i4) compile(f); (%o4) [f] (%i5) :lisp(conversion #'$f) #(25.0 125.0) NIL niobe% cat essai.lisp ;; reduced version of the colnew wrapper (in-package :maxima) (defun conversion (f) (flet ((fsub ($x f-array) (let ((res (mcall f $x))) (loop for k from 0 for ff in (cdr res) do (setf (aref f-array k) ($float ff))) (values f-array nil)))) (let (($x 5.0)(f-array (make-array 2 :initial-element 0.0 ))) (fsub $x f-array)))) -- Michel Talon From willisb at unk.edu Fri Mar 11 05:18:15 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 11 Mar 2011 05:18:15 -0600 Subject: [Maxima] 10.0^6.0 in GCL, CCL, and Allegro In-Reply-To: References: Message-ID: By the way: In GCL (expt 10.0d0 6.0d0) --> 1000000.0000000013, but both CCL and Allegro give 1000000.0. For GCL, the relative difference between the true and floating point value is about 10 times the machine epsilon. I don't know what the IEEE standard says about the accuracy of floating point exponentiation, but ten times the machine epsilon seems too big. --Barton From talon at lpthe.jussieu.fr Fri Mar 11 06:42:08 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 11 Mar 2011 13:42:08 +0100 Subject: [Maxima] 10.0^6.0 in GCL, CCL, and Allegro References: Message-ID: Barton Willis wrote: > By the way: In GCL (expt 10.0d0 6.0d0) --> 1000000.0000000013, but both > CCL and Allegro give 1000000.0. For GCL, the relative difference between > the true and floating point value is about 10 times the machine epsilon. cmucl and sbcl also give 1000000.0d0 -- Michel Talon From aksel.bertelsen at mail.dk Wed Mar 9 03:38:45 2011 From: aksel.bertelsen at mail.dk (Aksel Bertelsen) Date: Wed, 9 Mar 2011 10:38:45 +0100 Subject: [Maxima] load(distrib) Message-ID: <000601cbde3d$ca8f6e80$0300a8c0@akselceeb0132c> There is a problem with load(distrib) on some computers using windows XP. I get something like this: load (distrib); Load failed for C:/Programme/Maxima- 5.23.2/share/maxima/5.23.2/share/contrib/distrib/numdistrib.lisp -- an error. To debug this try debugmode(true); I can fix the problem replacing 1.7976931348623157E308 by most-positive-flonum in numdistrib.lisp, but it is annoying having to do this everytime there is a computer with this problem. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- No virus found in this outgoing message. Checked by AVG - www.avg.com Version: 8.5.406 / Virus Database: 271.1.1/3492 - Release Date: 03/08/11 17:49:00 From brlinnell at verizon.net Wed Mar 9 09:19:49 2011 From: brlinnell at verizon.net (Bruce Linnell) Date: Wed, 09 Mar 2011 10:19:49 -0500 Subject: [Maxima] Results from trying to use "get" inside a Maxima function References: <000901cbdbfa$14cbd240$2f01a8c0@brlajdkp0nwqjo> <002c01cbdcb2$fd93ea90$2f01a8c0@brlajdkp0nwqjo> Message-ID: <001101cbde6d$6f0dfba0$2f01a8c0@brlajdkp0nwqjo> I thought I'd pass along the results of everybody's suggestions, in case anything like this is ever needed or comes up again. My original goal was to attach a "quality" to a variable that has a value, so that when the variable was passed to a function, the function could take the appropriate steps based on the quality. In particular, I'm trying to add to the CTensor package functionality, which requires knowing whether a tensor has upper and/or lower indices. My goal is to be able to manipulate vectors, matrices, and arrays containing equations in order to multiply tensors, take the covariant derivative of them, raise/lower indices, etc. I would like to again thank everybody who replied to my original email, comments from every email I received were needed to be able to put all of the following together. Bruce Tests were done with XMaxima 5.23.2 in Windows XP. The format is as follows : Method ----------- Definition of the test function, to see if I can access both the value of the passed variable and its quality at the same time Command-line statements used to set things up and call the test function Results get,put (quality passed attached to var) ---------------------------------------- Test1(T):=block([temp],temp:[T,get(T,'Trank)])$ tensor:matrix([1,2],[2,1]); put('tensor,'Trank2LL,'Trank); Test1(tensor); Does not work : I tried all combinations of 'T and T in the function, and 'tensor and tensor in the function call. declare/feature (quality passed attached to var) ------------------------------------------------ Test1(T):=block([temp],temp:[T,featurep('T,Trank2LL)])$ declare([Trank1U,Trank1L,Trank2UU,Trank2LL,Trank2UL,Trank2LU],feature); tensor:matrix([1,2],[2,1]); declare(tensor,Trank2LL); Test1(tensor); Does not work : I tried all combinations of 'T and T in featurep. get,put (quality passed attached to var) ---------------------------------------- Test1(T):=block([temp],temp:[ev(T),get(T,'Trank)])$ tensor:matrix([1,2],[2,1]); put('tensor,'Trank2LL,'Trank); Test1('tensor); This works, but you have to pass the variable as 'var in ALL function calls declare/feature (quality passed attached to var) ------------------------------------------------ Test1(T):=block([temp],temp:[ev(T),featurep(T,Trank2LL)])$ declare([Trank1U,Trank1L,Trank2UU,Trank2LL,Trank2UL,Trank2LU],feature); tensor:matrix([1,2],[2,1]); declare(tensor,Trank2LL); Test1('tensor); This works, but you have to pass the variable as 'var in ALL function calls quality passed explicitly ------------------------- Test1(T,rank):=block([temp],temp:[T,rank])$ put('tensor,'Trank2LL,'Trank); tensor:matrix([1,2],[2,1]); Test1(tensor,get('tensor,'Trank)); This works, but you have to include the get() in ALL function calls This almost always hangs after returning the result - I'm not sure why (just FYI, no reply needed) Create a structure with value+quality ------------------------------------- Test1(T):=block([temp],temp:[T at val,T at rank])$ defstruct(Tensor(val,rank)); tensor:new(Tensor); tensor at val:matrix([1,2],[2,1]); tensor at rank:'Trank2LL; Test1(tensor); This works! Hashed array containing value+quality ------------------------------------- Test1(T):=block([temp,val,rank],temp:[T[val],T[rank]])$ tensor[val]:matrix([1,2],[2,1]); tensor[rank]:'Trank2LL; Test1(tensor); This works! -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri Mar 11 08:50:04 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 11 Mar 2011 09:50:04 -0500 Subject: [Maxima] 10.0^6.0 in GCL, CCL, and Allegro In-Reply-To: References: Message-ID: <4D7A369C.7020407@gmail.com> On 3/11/11 6:18 AM, Barton Willis wrote: > By the way: In GCL (expt 10.0d0 6.0d0) --> 1000000.0000000013, but both CCL and Allegro give > 1000000.0. For GCL, the relative difference between the true and floating point value is > about 10 times the machine epsilon. I don't know what the IEEE standard says about the > accuracy of floating point exponentiation, but ten times the machine epsilon seems too big. In cmucl, (exp (* 6d0 (log 10d0))) -> 1000000.0000000013. I think we can guess how gcl implement expt. Ray From toy.raymond at gmail.com Fri Mar 11 09:11:55 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 11 Mar 2011 10:11:55 -0500 Subject: [Maxima] Colnew, etc. In-Reply-To: References: Message-ID: <4D7A3BBB.5060703@gmail.com> On 3/11/11 5:18 AM, Michel Talon wrote: > To understand the colnew wrapper i have written a small program, and i am > puzzled by a small glitch in the interface between maxima and lisp (if it is > relevant, my maxima is compiled with cmucl) The problem is that the same > call works in (%i3) below, doesn't work in (%i4) but works in (%i5) > after having compiled f. What is the explanantion of this behaviour, > please? > > niobe% maxima > (%i1) f(x):=[x^2,x^3]; > 2 3 > (%o1) f(x) := [x , x ] > (%i2) load("essai.lisp"); > (%o2) essai.lisp > (%i3) ?conversion(f); > (%o3) {Array: #(25.0 125.0)} > (%i4) :lisp(conversion #'$f) > > Maxima encountered a Lisp error: > > Error in FDEFINITION: the function $F is undefined. > That's because f(x) is not a Lisp function yet. You can see by using :lisp (symbol-plist '$f) The mexpr property is the definition. When you compile it, it becomes a lisp function. Ray From kingsley at loaner.com Fri Mar 11 17:31:27 2011 From: kingsley at loaner.com (Kingsley G. Morse Jr.) Date: Fri, 11 Mar 2011 15:31:27 -0800 Subject: [Maxima] How to stop (x)maxima from autowrapping long lines? Message-ID: <20110311233127.GB25364@loaner.com> Hello, Does anyone here happen to know how to output long lines, without wrapping at word breaks? Here's an example of wrapped output... $ maxima Maxima 5.22.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (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) -147.290396009325 - 1248.09045065048 * x1 + ((x2 * x3 - x4/x2 - (x3 + x5)/(54.12364270278 * (x1 - (x6 - x6 - x3)) * ((1721.55606461374 + x2) * x1/(x2 - x7) * x1)) - (x7 - x1 - (1311.78000784658 + x4) - (x5 - x4)/(x2 - x3)) + ((x1 + x5) * (x4 * x1) + 1174.80162968000 * x6 - 1673.30672571545 * (x3 * x1 - (x2 - (x1 - x7 * x3/(x4 - x6) + x1)))))/(1354.57589944100 - x6 + x3/x7 - (-422.991700166543 - x5 - (x2 - x6)) + (x4 + -442.170624039503 + (x2 - x6)) * ((x5 - x4) * (x4 - -20.6778428817466)) + ((x5 - -854.88695081961/820.286253119727) * x6 + (x4 - x6 * x5 - x7 * x2/(1210.91655557564/x2)))) - 1155.31388363267) * x6 + ((x2/x5/(x1/x1) + (x4 + x5)/(413.678785140003 * x1))/((x1 * x6 + 1060.51162252673/x3) * (x5/1455.61480307574 * x7/(x4/587.483244396782 * x3))) - (x1/-1449.25329679940 - (x4 - x3) - (2708.01225368258 - x3)/(x2/613.088918575835))/((-1150.11248510372/x4 + (x6 - 795.42339229826))/(x5 + x5 - 189.107286324547 * x7)))/x6; x3 x7 (%o1) x6 ((- 1673.30672571545 (- ------- + x1 x3 - x2 + 2 x1) - x7 x4 - x6 0.018476213906952 (- x5 - x3) (x2 - x7) + --------------------------------------- + 1174.80162968 x6 + x1 x4 (x5 + x1) 2 x1 (x2 + 1721.55606461374) (x3 + x1) x4 - x5 x4 - ------- - -- + x4 + x2 x3 + x1 + 1311.78000784658) x2 - x3 x2 2 x3 /(- 8.2582073504199852E-4 x2 x7 + -- + (x5 + 1.042181247787939) x6 - x5 x6 x7 - 2 x6 + (x4 + 20.6778428817466) (x5 - x4) (- x6 + x4 + x2 - 442.170624039503) + x5 + x4 + x2 + 1777.567599607543) - 1155.31388363267) 0.0024173345018444 (x5 + x4) x2 2.477712882807987 x3 x4 (---------------------------- + --) x1 x5 + (----------------------------------------------------------- 1060.51162252673 x5 (x1 x6 + ----------------) x7 x3 613.088918575835 (x3 - 2708.01225368258) - ((- x4 + x3 + ---------------------------------------- x2 - 6.9001050555375491E-4 x1) (2 x5 - 189.107286324547 x7)) 1150.11248510372 /(x6 - ---------------- - 795.42339229826))/x6 - 1248.09045065048 x1 x4 - 147.290396009325 (%i2) Do you happen to know how to disable autowrapping, so the pretty printed math expression is revealed as a whole? Thanks, Kingsley From mpc20 at aapt.net.au Fri Mar 11 23:57:02 2011 From: mpc20 at aapt.net.au (Michael Carey) Date: Sat, 12 Mar 2011 16:57:02 +1100 Subject: [Maxima] no longer getting emails Message-ID: <1299909422.1721.0.camel@mickpc-G41MT-ES2L> I am no longer getting emails and am wanting to make a post. Thanks Michael C From andreas_eder at gmx.net Sat Mar 12 01:43:29 2011 From: andreas_eder at gmx.net (Andreas Eder) Date: Sat, 12 Mar 2011 08:43:29 +0100 Subject: [Maxima] bessel-j-integral-2 Message-ID: <87tyf8ss0u.fsf@eder.homelinux.net> Hi, when looking at compiler messages I found something in bessel.lisp that might be a bug, or I just don't understand it :-) The code in bessel-j-integral-2 looks like: '((mtimes) ((rat) 1 2) z ((mplus) ((mtimes) $%pi ((%bessel_j) 1 z) ((%struve_h) 0 z)) ((mtimes) ((%bessel_j) 0 z) ((mplus) 2 ((mtimes) -1 $%pi ((%struve_h) 1 z))))))) where z is one of the functions arguments. Shouldn't that be using a backtick and comma like: `((mtimes) ((rat) 1 2) ,z I don't know the code, but as it is i looks very suspicious to me. Someone in the know wants to comment? 'Andreas -- ceterum censeo redmondinem esse delendam. From dbmaxima at gmail.com Sat Mar 12 03:29:59 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Sat, 12 Mar 2011 20:29:59 +1100 Subject: [Maxima] bessel-j-integral-2 In-Reply-To: <87tyf8ss0u.fsf@eder.homelinux.net> References: <87tyf8ss0u.fsf@eder.homelinux.net> Message-ID: <4D7B3D17.6000705@gmail.com> On 12/03/2011 6:43 PM, Andreas Eder wrote: > Hi, > > when looking at compiler messages I found something in bessel.lisp > that might be a bug, or I just don't understand it :-) > > The code in bessel-j-integral-2 looks like: > > '((mtimes) ((rat) 1 2) z > ((mplus) > ((mtimes) $%pi > ((%bessel_j) 1 z) > ((%struve_h) 0 z)) > ((mtimes) > ((%bessel_j) 0 z) > ((mplus) 2 ((mtimes) -1 $%pi ((%struve_h) 1 z))))))) > > where z is one of the functions arguments. > Shouldn't that be using a backtick and comma like: > > `((mtimes) ((rat) 1 2) ,z > > I don't know the code, but as it is i looks very suspicious to me. > > Someone in the know wants to comment? > > 'Andreas A good question. OK. I wrote this. It is correct (or at least gives the correct answer), but arguably poor style. The argument z is unused, which is presumably the source of the compiler warning. The code returns an expression containing the symbol z that is used in the calling function. I think you would get an equivalent expression if you used a backtick and a comma to substitute the value of argument z into the expression here. I will think about the cleanest way to clarify the code in question. Perhaps just declare that argument z is unused to kill the warning. There is similar usage in a couple of other integrals. David From working.good at gmail.com Sat Mar 12 08:26:24 2011 From: working.good at gmail.com (alex) Date: Sat, 12 Mar 2011 16:26:24 +0200 Subject: [Maxima] How to stop (x)maxima from autowrapping long lines? In-Reply-To: <20110311233127.GB25364@loaner.com> References: <20110311233127.GB25364@loaner.com> Message-ID: <4D7B8290.8040509@gmail.com> On 03/12/2011 01:31 AM, Kingsley G. Morse Jr. wrote: > Hello, > > Does anyone here happen to know how to output long > lines, without wrapping at word breaks? > (%i1) linel:1000; (%o1) 1000 Still I woud rather use* stringout()* to get full unwrapped expressions into file. Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbmaxima at gmail.com Sat Mar 12 08:35:09 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Sun, 13 Mar 2011 01:35:09 +1100 Subject: [Maxima] bessel-j-integral-2 In-Reply-To: <4D7B3D17.6000705@gmail.com> References: <87tyf8ss0u.fsf@eder.homelinux.net> <4D7B3D17.6000705@gmail.com> Message-ID: <4D7B849D.1070207@gmail.com> On 12/03/2011 8:29 PM, David Billinghurst wrote: > On 12/03/2011 6:43 PM, Andreas Eder wrote: >> Hi, >> >> when looking at compiler messages I found something in bessel.lisp >> that might be a bug, or I just don't understand it :-) >> >> The code in bessel-j-integral-2 looks like: >> >> '((mtimes) ((rat) 1 2) z >> ((mplus) >> ((mtimes) $%pi >> ((%bessel_j) 1 z) >> ((%struve_h) 0 z)) >> ((mtimes) >> ((%bessel_j) 0 z) >> ((mplus) 2 ((mtimes) -1 $%pi ((%struve_h) 1 z))))))) >> >> where z is one of the functions arguments. >> Shouldn't that be using a backtick and comma like: >> >> `((mtimes) ((rat) 1 2) ,z >> >> I don't know the code, but as it is i looks very suspicious to me. >> >> Someone in the know wants to comment? >> >> 'Andreas > A good question. > > OK. I wrote this. It is correct (or at least gives the correct > answer), but arguably poor style. > > The argument z is unused, which is presumably the source of the > compiler warning. The code returns an expression containing the > symbol z that is used in the calling function. I think you would get > an equivalent expression if you used a backtick and a comma to > substitute the value of argument z into the expression here. > > I will think about the cleanest way to clarify the code in question. > Perhaps just declare that argument z is unused to kill the warning. > There is similar usage in a couple of other integrals. > > David > I had already fixed the other Bessel functions, but missed bessel_j. Fixed thusly. --- bessel.lisp 25 Jan 2011 08:14:19 -0000 1.86 +++ bessel.lisp 12 Mar 2011 14:32:39 -0000 @@ -95,7 +95,8 @@ grad) ;; Integral of the Bessel function wrt z -(defun bessel-j-integral-2 (v z) +(defun bessel-j-integral-2 (v unused) + (declare (ignore unused)) (case v (0 ;; integrate(bessel_j(0,z) From mpc20 at aapt.net.au Sat Mar 12 21:26:03 2011 From: mpc20 at aapt.net.au (Michael Carey) Date: Sun, 13 Mar 2011 14:26:03 +1100 Subject: [Maxima] how to simplify Message-ID: <1299986763.1891.2.camel@mickpc-G41MT-ES2L> Dear group, I have an equation: -(%e^(-log(e)*x-x)*((log(e)-1)*%e^x*sin(2*x)+2*%e^x*cos(2*x)+(-% c*log(e)^2+2*%c*log(e)-5*%c)*%e^(log(e)*x)))/((log(e)^2-2*log(e)+5)*x) I am hoping it is equal to a much smaller equation, how do I simplify it? I have already used ratsim() and completeratsimp() (names?) Thank you Michael Carey From dbmaxima at gmail.com Sat Mar 12 22:32:37 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Sun, 13 Mar 2011 15:32:37 +1100 Subject: [Maxima] how to simplify In-Reply-To: <1299986763.1891.2.camel@mickpc-G41MT-ES2L> References: <1299986763.1891.2.camel@mickpc-G41MT-ES2L> Message-ID: <4D7C48E5.1070908@gmail.com> On 13/03/2011 2:26 PM, Michael Carey wrote: > Dear group, I have an equation: > > -(%e^(-log(e)*x-x)*((log(e)-1)*%e^x*sin(2*x)+2*%e^x*cos(2*x)+(-% > c*log(e)^2+2*%c*log(e)-5*%c)*%e^(log(e)*x)))/((log(e)^2-2*log(e)+5)*x) > > I am hoping it is equal to a much smaller equation, how do I simplify > it? I have already used ratsim() and completeratsimp() (names?) radcan() may help here. (%i1) display2d:false; (%o1) false (%i2) ex:-(%e^(-log(e)*x-x)*((log(e)-1)*%e^x*sin(2*x)+2*%e^x*cos(2*x)+(-%c*log(e)^+2*%c*log(e)-5*%c)*%e^(log(e)*x)))/((log(e)^2-2*log(e)+5)*x); (%o2) -%e^(-log(e)*x-x)*((log(e)-1)*%e^x*sin(2*x)+2*%e^x*cos(2*x) +(-%c*log(e)^(2*%c*log(e)) -5*%c) *%e^(log(e)*x)) /((log(e)^2-2*log(e)+5)*x) (%i3) radcan(ex); (%o3) -%e^-x*((log(e)-1)*%e^x*sin(2*x)+2*%e^x*cos(2*x) +e^x*(-%c*e^(2*%c*log(log(e)))-5*%c)) /(e^x*(log(e)^2-2*log(e)+5)*x) You may also want to pull this result apart and work on the pieces. (%i4) num(%); (%o4) -%e^-x*((log(e)-1)*%e^x*sin(2*x)+2*%e^x*cos(2*x) +e^x*(-%c*e^(2*%c*log(log(e)))-5*%c)) (%i5) expand(%); (%o5) -log(e)*sin(2*x)+sin(2*x)-2*cos(2*x)+%c*e^(x+2*%c*log(log(e)))*%e^-x +5*%c*e^x*%e^-x I would rename variable e, as e and %e are easily confused. You might also consider substituting for log(e) rather than e. From kingsley at loaner.com Sun Mar 13 00:06:07 2011 From: kingsley at loaner.com (Kingsley G. Morse Jr.) Date: Sat, 12 Mar 2011 22:06:07 -0800 Subject: [Maxima] How to stop (x)maxima from autowrapping long lines? In-Reply-To: <4D7B8290.8040509@gmail.com> References: <20110311233127.GB25364@loaner.com> <4D7B8290.8040509@gmail.com> Message-ID: <20110313060607.GA24428@loaner.com> Hi Alex, I'm happy to report that I tried your suggestion of using (%i1) linel:1000; and it worked fine. Thanks, Kingsley PS: I also tried stringout(), although at least for me, it reverted beautiful formulas, with divisors and numerators on separate lines like abc --- def into code-like one-liners, like abc/def On 03/12/11 16:26, alex wrote: > On 03/12/2011 01:31 AM, Kingsley G. Morse Jr. wrote: > >Hello, > > > >Does anyone here happen to know how to output long > >lines, without wrapping at word breaks? > > > > (%i1) linel:1000; > (%o1) > 1000 > > > Still I woud rather use* stringout()* to get full unwrapped expressions > into file. > > > Alex From macrakis at alum.mit.edu Sun Mar 13 00:18:04 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 13 Mar 2011 08:18:04 +0200 Subject: [Maxima] Results from trying to use "get" inside a Maxima function In-Reply-To: <001101cbde6d$6f0dfba0$2f01a8c0@brlajdkp0nwqjo> References: <000901cbdbfa$14cbd240$2f01a8c0@brlajdkp0nwqjo> <002c01cbdcb2$fd93ea90$2f01a8c0@brlajdkp0nwqjo> <001101cbde6d$6f0dfba0$2f01a8c0@brlajdkp0nwqjo> Message-ID: Instead of Test1(T):=block([temp,val,rank],temp:[T[val],T[rank]])$ tensor[val]:matrix([1,2],[2,1]); tensor[rank]:'Trank2LL; Test1(tensor); I would recommend: Test1(T):=block([temp],temp:[T['val],T['rank]])$ tensor['val]:matrix([1,2],[2,1]); tensor['rank]:'Trank2LL; Test1(tensor); So that if val or rank are used as variables, there will be no conflict. -s On Wed, Mar 9, 2011 at 17:19, Bruce Linnell wrote: > I thought I'd pass along the results of everybody's suggestions, in case > anything like this is ever needed or comes up again. > > My original goal was to attach a "quality" to a variable that has a value, > so that when the variable was passed to a function, the function could take > the appropriate steps based on the quality. In particular, I'm trying to > add to the CTensor package functionality, which requires knowing whether a > tensor has upper and/or lower indices. My goal is to be able to manipulate > vectors, matrices, and arrays containing equations in order to multiply > tensors, take the covariant derivative of them, raise/lower indices, etc. > > I would like to again thank everybody who replied to my original email, > comments from *every* email I received were needed to be able to put all > of the following together. > > Bruce > > > Tests were done with XMaxima 5.23.2 in Windows XP. The format is as > follows : > > Method > ----------- > Definition of the test function, to see if I can access both the value of > the passed variable and its quality at the same time > Command-line statements used to set things up and call the test > function > Results > > > get,put (quality passed attached to var) > ---------------------------------------- > Test1(T):=block([temp],temp:[T,get(T,'Trank)])$ > tensor:matrix([1,2],[2,1]); > put('tensor,'Trank2LL,'Trank); > Test1(tensor); > Does not work : I tried all combinations of 'T and T in the function, and > 'tensor and tensor in the function call. > > > declare/feature (quality passed attached to var) > ------------------------------------------------ > Test1(T):=block([temp],temp:[T,featurep('T,Trank2LL)])$ > declare([Trank1U,Trank1L,Trank2UU,Trank2LL,Trank2UL,Trank2LU],feature); > tensor:matrix([1,2],[2,1]); > declare(tensor,Trank2LL); > Test1(tensor); > Does not work : I tried all combinations of 'T and T in featurep. > > > get,put (quality passed attached to var) > ---------------------------------------- > Test1(T):=block([temp],temp:[ev(T),get(T,'Trank)])$ > tensor:matrix([1,2],[2,1]); > put('tensor,'Trank2LL,'Trank); > Test1('tensor); > This works, but you have to pass the variable as 'var in ALL function calls > > > declare/feature (quality passed attached to var) > ------------------------------------------------ > Test1(T):=block([temp],temp:[ev(T),featurep(T,Trank2LL)])$ > declare([Trank1U,Trank1L,Trank2UU,Trank2LL,Trank2UL,Trank2LU],feature); > tensor:matrix([1,2],[2,1]); > declare(tensor,Trank2LL); > Test1('tensor); > This works, but you have to pass the variable as 'var in ALL function calls > > > quality passed explicitly > ------------------------- > Test1(T,rank):=block([temp],temp:[T,rank])$ > put('tensor,'Trank2LL,'Trank); > tensor:matrix([1,2],[2,1]); > Test1(tensor,get('tensor,'Trank)); > This works, but you have to include the get() in ALL function calls > This almost always hangs after returning the result - I'm not sure why > (just FYI, no reply needed) > > > Create a structure with value+quality > ------------------------------------- > Test1(T):=block([temp],temp:[T at val,T at rank])$ > defstruct(Tensor(val,rank)); > tensor:new(Tensor); > tensor at val:matrix([1,2],[2,1]); > tensor at rank:'Trank2LL; > Test1(tensor); > This works! > > > Hashed array containing value+quality > ------------------------------------- > Test1(T):=block([temp,val,rank],temp:[T[val],T[rank]])$ > tensor[val]:matrix([1,2],[2,1]); > tensor[rank]:'Trank2LL; > Test1(tensor); > This works! > > > _______________________________________________ > 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 working.good at gmail.com Sun Mar 13 08:53:07 2011 From: working.good at gmail.com (alex) Date: Sun, 13 Mar 2011 15:53:07 +0200 Subject: [Maxima] How to stop (x)maxima from autowrapping long lines? In-Reply-To: <20110313060607.GA24428@loaner.com> References: <20110311233127.GB25364@loaner.com> <4D7B8290.8040509@gmail.com> <20110313060607.GA24428@loaner.com> Message-ID: <4D7CCC43.1000608@gmail.com> On 03/13/2011 08:06 AM, Kingsley G. Morse Jr. wrote: > PS: I also tried stringout(), although at least for > me, it reverted beautiful formulas, with > divisors and numerators on separate lines like > > abc > --- > def > > into code-like one-liners, like > > abc/def > didnt know you want them in 2d. You can try smth like this: linel:2000$with_stdout( "/tmp/formulas", print( expand( (x+1)^30 ) ), print( diff( expand( (x+1)^30 ), x ) ) ); Just enlist your print() statements inside block *with_stdout()*... Good luck! Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From cacs at cacs2010.org Sat Mar 12 13:51:48 2011 From: cacs at cacs2010.org (Jane Lew) Date: Sun, 13 Mar 2011 03:51:48 +0800 Subject: [Maxima] [UTEXAS: SUSPECTED SPAM] Congress on Computer Applications and Computational Science, Bali, 15-17 Nov 2011 [EI Compendex, ISTP, IEEE Xplore] Message-ID: 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 Author, Please forward to those who may be interested. Thank you. The 2011 2nd International Congress on Computer Applications and Computational Science (CACS 2011) http://irast.net/conferences/CACS/2011 15-17 November 2011, Bali, Indonesia CACS 2010 aims to bring together researchers and scientists from academia, industry, and government laboratories to present new results and identify future research directions in computer applications and computational science. All papers published in the CACS 2011 proceedings will be included in the IEEE Xplore and indexed in both Ei Compendex and ISTP. CACS 2011 has appeared in the IEEE Conferences (Conference Record # 18959, IEEE Catalog Number: CFP1175N-CDR, ISBN: 978-1-61284-995-9). Topics of interest include, but are not limited to: ? Computer Architecture and VLSI ? Computer Control and Robotics ? Computers in Education and Learning Technologies ? Computer Networks and Data Communications ? Data Mining and Data Engineering ? Energy and Power Systems ? Intelligent Systems and Autonomous Agents ? Internet and Web Systems ? Scientific Computing and Modeling ? Signal, Image and Multimedia Processing ? Software Engineering Bali is a favorite vacation destination for many nationalities. Bali's natural attractions include miles of sandy beaches, picturesque rice terraces, towering active volcanoes over 3,000 meters high, fast flowing rivers, deep ravines, pristine crater lakes, sacred caves, and lush tropical forests full of exotic wildlife. The island's rich cultural heritage is visible everywhere - in over 20,000 temples and palaces, in many colorful festivals and ceremonies, in drama, music, and dance. Bali is also well-known for its night life. Come to Bali enjoying the beautiful environment and fun here! Paper Submission Deadline: 15 May 2011 Review Decision Notifications: 15 August 2011 Final Papers and Author Registration Deadline: 9 September 2011 To unsubscribe, reply with ?unsubscribe maxima at math.utexas.edu ? in your email subject or the first line of the email body. With kind regards, Jane Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: From bor_fies at mail.ru Sun Mar 13 08:16:26 2011 From: bor_fies at mail.ru (=?koi8-r?Q?=E1=CC=C5=CB=D3=C1=CE=C4=D2.?=) Date: Sun, 13 Mar 2011 16:16:26 +0300 Subject: [Maxima] (no subject) Message-ID: Good day. I need to simplify large expression in finite field (F2, i.e. boolean algebra) I have a question. How can I get this result in Maxima? for example: (%i1) rat (3*(y+z)^2) (%o1) z+y -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Sun Mar 13 12:07:40 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sun, 13 Mar 2011 17:07:40 +0000 Subject: [Maxima] no longer getting emails References: <1299909422.1721.0.camel@mickpc-G41MT-ES2L> Message-ID: Michael Carey writes: > I am no longer getting emails and am wanting to make a post. > > Thanks Michael C I've just logged into the admin interface and the address mpc20 at aapt.net.au is subscribed and mail delivery is not disabled. Have a look in your spam mailbox? 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 Sun Mar 13 12:16:14 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sun, 13 Mar 2011 17:16:14 +0000 Subject: [Maxima] (no subject) References: Message-ID: ?????????. writes: > Good day. > I need to simplify large expression in finite field (F2, i.e. boolean > algebra) I have a question. How can I get this result in Maxima? > for example: > (%i1) rat (3*(y+z)^2) > (%o1) z+y Try the modulus variable: (%i1) rat (3*(y+z)^2); 2 2 (%o1)/R/ 3 z + 6 y z + 3 y (%i2) modulus: 2; (%o2) 2 (%i3) rat (3*(y+z)^2); 2 2 (%o3)/R/ z + y (I presume you want the squares... :-) Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From lut.mentz at zen.co.uk Sun Mar 13 20:57:53 2011 From: lut.mentz at zen.co.uk (Lut Mentz) Date: Mon, 14 Mar 2011 01:57:53 -0000 Subject: [Maxima] Problem with subst() after diff() Message-ID: <000901cbe1eb$42030750$5d484552@albert2> This little script assume(l>0); assume(t>0); Q:G*M*l*v*t/(2*(l^2+(v*t)^2)^(3/2)); depends(v,t); D2Q:diff(Q,t,2); subst(0,t,D2Q); crashes on the last line ... .. .. (%i4) depends(v,t) (%o4) [v(t)] (%i5) D2Q:diff(Q,t,2) (%o5) [ snipped long expression] (%i6) subst(0,t,D2Q) Attempt to differentiate with respect to a number: 0 -- an error. To debug this try debugmode(true); I'm baffled. I thought the differentiating was done. Any help appreciated. Lut Mentz From lut.mentz at zen.co.uk Sun Mar 13 21:08:40 2011 From: lut.mentz at zen.co.uk (Lut Mentz) Date: Mon, 14 Mar 2011 02:08:40 -0000 Subject: [Maxima] Fw: Problem with subst() after diff() - FIXED Message-ID: <000901cbe1ec$bea70760$5d484552@albert2> I realized it is the 'diffs in the expression that cause the problem. ----- Original Message ----- From: "Lut Mentz" To: Sent: Monday, March 14, 2011 1:57 AM Subject: Problem with subst() after diff() > This little script > > assume(l>0); > assume(t>0); > Q:G*M*l*v*t/(2*(l^2+(v*t)^2)^(3/2)); > depends(v,t); > D2Q:diff(Q,t,2); > subst(0,t,D2Q); > > crashes on the last line ... > > .. > .. > (%i4) depends(v,t) > (%o4) [v(t)] > (%i5) D2Q:diff(Q,t,2) > (%o5) [ snipped long expression] > (%i6) subst(0,t,D2Q) > Attempt to differentiate with respect to a number: > 0 > -- an error. To debug this try debugmode(true); > > I'm baffled. I thought the differentiating was done. Any help appreciated. > > Lut Mentz From rene.grothmann at ku-eichstaett.de Mon Mar 14 06:12:46 2011 From: rene.grothmann at ku-eichstaett.de (Rene Grothmann) Date: Mon, 14 Mar 2011 12:12:46 +0100 Subject: [Maxima] Prevent evaluation Message-ID: <000001cbe238$bf254d90$3d6fe8b0$@grothmann@ku-eichstaett.de> Is it possible to output an expression like 2^3 as 2^3 without it being evaluated to 8? I tried '(2^3), but that does not work. Then I tried print(2^3) which just prints 8. Thanks for hints, R.G. From drdieterkaiser at web.de Mon Mar 14 12:04:07 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 14 Mar 2011 18:04:07 +0100 Subject: [Maxima] Prevent evaluation In-Reply-To: <000001cbe238$bf254d90$3d6fe8b0$@grothmann@ku-eichstaett.de> References: <000001cbe238$bf254d90$3d6fe8b0$@grothmann@ku-eichstaett.de> Message-ID: <1300122247.1619.6.camel@dieter> Am Montag, den 14.03.2011, 12:12 +0100 schrieb Rene Grothmann: > Is it possible to output an expression like 2^3 as 2^3 without it being > evaluated to 8? I tried '(2^3), but that does not work. Then I tried > print(2^3) which just prints 8. > > Thanks for hints, R.G. The arithmetic operations in Maxima are simplifications and not evaluations. Simplification can be switched off with option variable SIMP. See the documentation about SIMP. (%i1) simp:false; (%o1) false (%i2) 2^8; (%o2) 2^8 In general it is not very useful to switch off simplification. It might be interesting to hear something about your desired application. Dieter Kaiser From kcrisman at gmail.com Mon Mar 14 16:03:07 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Mon, 14 Mar 2011 17:03:07 -0400 Subject: [Maxima] Question about temporary variables Message-ID: I know that sometimes in the solving code (esp. Barton's stuff) we can get temporary integer or real or whatever variables that look like i3 or r55. But what the heck are the g things here? This comes from Sage ticket http://trac.sagemath.org/sage_trac/ticket/9825 x1(t)=ilt(-((3*laplace(x2(t)^2,t,?g1811)-x1(0))*?g1811-3)/?g1811^2,?g1811,t) This comes from a desolve command, but tracking down exactly what Sage has sent to Maxima to get this would be tedious. Needless to say, trying to search the manuals for this wasn't so helpful, e.g. http://maxima.sourceforge.net/docs/manual/en/maxima_22.html has examples that work, not ones that don't. But we'd be grateful for the help so we can properly parse Maxima answers even more accurately. Thanks! From robert.dodier at gmail.com Mon Mar 14 16:07:28 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 14 Mar 2011 15:07:28 -0600 Subject: [Maxima] Question about temporary variables In-Reply-To: References: Message-ID: Short answer is that ?g1234 etc are so-called gensyms, that is, generated Lisp symbols. Looks like ?g1811 is a dummy variable in the Laplace transform. On the face of it, it looks correct, but desolve could pick a less confusing name. best Robert Dodier On 3/14/11, Karl-Dieter Crisman wrote: > I know that sometimes in the solving code (esp. Barton's stuff) we can > get temporary integer or real or whatever variables that look like i3 > or r55. > > But what the heck are the g things here? This comes from Sage ticket > http://trac.sagemath.org/sage_trac/ticket/9825 > > x1(t)=ilt(-((3*laplace(x2(t)^2,t,?g1811)-x1(0))*?g1811-3)/?g1811^2,?g1811,t) > > This comes from a desolve command, but tracking down exactly what Sage > has sent to Maxima to get this would be tedious. Needless to say, > trying to search the manuals for this wasn't so helpful, e.g. > http://maxima.sourceforge.net/docs/manual/en/maxima_22.html has > examples that work, not ones that don't. > > But we'd be grateful for the help so we can properly parse Maxima > answers even more accurately. Thanks! > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From macrakis at alum.mit.edu Mon Mar 14 17:10:28 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 14 Mar 2011 18:10:28 -0400 Subject: [Maxima] Question about temporary variables In-Reply-To: References: Message-ID: This is a bug: Maxima output should never include bare Lisp symbols (unless of course the user entered them), and should never include Lisp gensyms (which cannot be input by the user). Apparently desolve uses Lisp gensyms in the expectation that ilt/laplace will eliminate them Of course, if Sage allowed initial "?" in symbol names, this particular problem would go away. (Though it does seem weird that Sage is using the stringout form of expressions rather than the s-expressions to communicate with Maxima.) -s PS It would help if the actual call to Maxima were included in reports like this, rather than the Sage form. In particular, I don't quite get the x1=function('x1',t) construction. I reproduced the problem with de1: diff(x1(t),t)=-3*(x2(t)^2-1); de2: diff(x2(t),t)=1; desolve([de1,de2],[x1(t),x2(t)]); A simpler example: desolve([diff(f(x),x)=f(x^2)],[f(x)]); On Mon, Mar 14, 2011 at 17:07, Robert Dodier wrote: > Short answer is that ?g1234 etc are so-called gensyms, > that is, generated Lisp symbols. > > Looks like ?g1811 is a dummy variable in the Laplace transform. > On the face of it, it looks correct, but desolve could > pick a less confusing name. > > best > > Robert Dodier > > On 3/14/11, Karl-Dieter Crisman wrote: > > I know that sometimes in the solving code (esp. Barton's stuff) we can > > get temporary integer or real or whatever variables that look like i3 > > or r55. > > > > But what the heck are the g things here? This comes from Sage ticket > > http://trac.sagemath.org/sage_trac/ticket/9825 > > > > > x1(t)=ilt(-((3*laplace(x2(t)^2,t,?g1811)-x1(0))*?g1811-3)/?g1811^2,?g1811,t) > > > > This comes from a desolve command, but tracking down exactly what Sage > > has sent to Maxima to get this would be tedious. Needless to say, > > trying to search the manuals for this wasn't so helpful, e.g. > > http://maxima.sourceforge.net/docs/manual/en/maxima_22.html has > > examples that work, not ones that don't. > > > > But we'd be grateful for the help so we can properly parse Maxima > > answers even more accurately. 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Mon Mar 14 17:26:44 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 14 Mar 2011 17:26:44 -0500 Subject: [Maxima] Question about temporary variables In-Reply-To: References: , Message-ID: The to_poly_solver introduces dummy variables using function new_variable. The new_variable function automatically alters the global environment by appending facts and by placing a symbol property onto each dummy variable. The symbol property is what allows the function nicedummies to work. Further some of the objects that the to_poly_solver creates (%union objects, for example), have simplification properties. For these reasons, using the output of to_poly_solve is much harder than simply parsing the output. Unlike using ?gensym, the output of new_variable is a "normal" Maxima variable (internally looks like $xxxx). (%i1) load(to_poly_solver)$ Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:4 (%i2) sol : %solve(sin(x)=1/2,x); (%o2) %union([x=2*%pi*%z2+%pi/6],[x=2*%pi*%z3+(5*%pi)/6]) %z2 is a declared integer: (%i3) facts(%z2); (%o3) [kind(%z2,integer)] Checking the solution works because Maxima knows that %z2 is an integer (%i4) subst(first(sol), sin(x)=1/2); (%o4) 1/2=1/2 The possible arguments to new_variable: (%i12) new_variable('integer); (%o12) %z21 (%i13) new_variable('real); (%o13) %r21 (%i14) new_variable('complex); (%o14) %c22 (%i15) new_variable('general); (%o15) %g22 --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >Short?answer?is?that??g1234?etc?are?so-called?gensyms, >that?is,?generated?Lisp?symbols. > >Looks?like??g1811?is?a?dummy?variable?in?the?Laplace?transform. >On?the?face?of?it,?it?looks?correct,?but?desolve?could >pick?a?less?confusing?name. > >best > >Robert?Dodier > >On?3/14/11,?Karl-Dieter?Crisman??wrote: >>?I?know?that?sometimes?in?the?solving?code?(esp.?Barton's?stuff)?we?can >>?get?temporary?integer?or?real?or?whatever?variables?that?look?like?i3 >>?or?r55. >> >>?But?what?the?heck?are?the?g?things?here????This?comes?from?Sage?ticket >>?http://trac.sagemath.org/sage_trac/ticket/9825 >> >> >x1(t)=ilt(-((3*laplace(x2(t)^2,t,?g1811)-x1(0))*?g1811-3)/?g1811^2,?g1811, >t) >> >>?This?comes?from?a?desolve?command,?but?tracking?down?exactly?what?Sage >>?has?sent?to?Maxima?to?get?this?would?be?tedious.??Needless?to?say, >>?trying?to?search?the?manuals?for?this?wasn't?so?helpful,?e.g. >>?http://maxima.sourceforge.net/docs/manual/en/maxima_22.html?has >>?examples?that?work,?not?ones?that?don't. >> >>?But?we'd?be?grateful?for?the?help?so?we?can?properly?parse?Maxima >>?answers?even?more?accurately.??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 renegrothmann at gmail.com Mon Mar 14 15:17:36 2011 From: renegrothmann at gmail.com (Rene Grothmann) Date: Mon, 14 Mar 2011 21:17:36 +0100 Subject: [Maxima] Prevent evaluation In-Reply-To: <1300122247.1619.6.camel@dieter> References: <000001cbe238$bf254d90$3d6fe8b0$@grothmann@ku-eichstaett.de> <1300122247.1619.6.camel@dieter> Message-ID: <000001cbe284$df5bd8d0$9e138a70$@com> The reason I want this is the following: I am the author of Euler (see euler.rene-grothmann.de), which uses Maxima for symbolic computation. A symbolic expression in Euler is entered as >&diff(x^x,x) x x (log(x) + 1) The result is a string, which is stored for Euler, and used in many Euler functions, as you will find out by checking the examples. But the output prints in Maxima's 2D display. How am I achieving this? Currently, I get Maxima to return the string simply by switching of display2d before I send the string to Maxima for evaluation. Next, I send the resulting string back to Maxima just for printing in 2D, turning on display2d beforehand. This works fine most of the time. However, things like >&factor(1000) do not work. The string "2^3*5^3" is OK, but if I send it to printing, it is "simplified" to 1000. I already discovered, and you told me, how to switch that off. Doing it, prints the result correctly. However, I have the next problem with >&ev(invert(matrix([3,4],[5,6])),detout) [ - 3 2 ] [ ] [ 5 3 ] [ - - - ] [ 2 2 ] This returns a matrix statement devided by the determinant in the string. In fact, it returns >@&ev(invert(matrix([3,4],[5,6])),detout) -matrix([6,-4],[-5,3])/2 If I pass that for printing, the determinant is multiplied inside as shown above. If I prevent simplification, it never prints in matrix 2D form. So there is no nice way to do this. This, by the way, is strange to me: What is this matrix form which prints in 2D? I wish, I could fix a little bit more inside Maxima. I would change a lot of things to fit Euler more closely. However, I am just communication with this mighty system using pipes. Thanks for your response, R.G. From villate at fe.up.pt Mon Mar 14 21:04:55 2011 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 15 Mar 2011 02:04:55 +0000 Subject: [Maxima] Prevent evaluation In-Reply-To: <000001cbe284$df5bd8d0$9e138a70$@com> References: <000001cbe238$bf254d90$3d6fe8b0$@grothmann@ku-eichstaett.de> <1300122247.1619.6.camel@dieter> <000001cbe284$df5bd8d0$9e138a70$@com> Message-ID: <1300154695.3388.7.camel@wigner> On Mon, 2011-03-14 at 21:17 +0100, Rene Grothmann wrote: > If I pass that for printing, the determinant is multiplied inside as > shown above. > > If I prevent simplification, it never prints in matrix 2D form. So > there is no nice way to do this. > > This, by the way, is strange to me: What is this matrix form which > prints in 2D? Instead of sending the result back to Maxima for 2D printing, why don't you send the input again? Namely, set display2d to false, send factor(1000), save the result, set display2d to true and send factor(1000) again. Or you could also keep display2d alwaus true and do: send factor(1000) to Maxima, send grind(%) to get the same result in 1D form and save it. Regards, Jaime From kcrisman at gmail.com Mon Mar 14 21:50:29 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Mon, 14 Mar 2011 22:50:29 -0400 Subject: [Maxima] Question about temporary variables In-Reply-To: References: Message-ID: >> Short answer is that ?g1234 etc are so-called gensyms, >> that is, generated Lisp symbols. >> >> Looks like ?g1811 is a dummy variable in the Laplace transform. >> On the face of it, it looks correct, but desolve could >> pick a less confusing name. >> Thanks, that helps greatly. I figured it was the case, but had never seen this before. We can try to catch those in our Maxima 'parser' (I use quotes because it's just some very basic string stuff). On Mon, Mar 14, 2011 at 6:10 PM, Stavros Macrakis wrote: > This is a bug: Maxima output should never include bare Lisp symbols (unless > of course the user entered them), and should never include Lisp gensyms > (which cannot be input by the user). ?Apparently desolve uses Lisp gensyms > in the expectation that ilt/laplace will eliminate them Ah, but in this case apparently could not, since the function was symbolic. Is that correct? > Of course, if Sage allowed initial "?" in symbol names, this particular Sorry, that's a limitation of Python, as far as I know. See http://www.python.org/dev/peps/pep-3131/, in particular "ID_Start is defined as all characters having one of the general categories uppercase letters (Lu), lowercase letters (Ll), titlecase letters (Lt), modifier letters (Lm), other letters (Lo), letter numbers (Nl), the underscore, and characters carrying the Other_ID_Start property. XID_Start then closes this set under normalization, by removing all characters whose NFKC normalization is not of the form ID_Start ID_Continue* anymore." > problem would go away. ?(Though it does seem weird that Sage is using the > stringout form of expressions rather than the s-expressions to communicate > with Maxima.) I don't know what s-expressions are, but the original Sage interface was done lightning fast a number of years ago simply to provide calculus functionality from the Sage command line, hence passing strings back and forth via "pexpect". Things have developed a lot since then, but moving from strings to Lisp expressions or trees is non-trivial. There has been a lot of movement on this as of late - see http://trac.sagemath.org/sage_trac/ticket/7377 - with the hope of using ECL expressions for most the communicating in the future. > ?? ? ? ? ? ? -s > PS It would help if the actual call to Maxima were included in reports like > this, rather than the Sage form. ?In particular, I don't quite get the Oh, I was only asking what the ?g symbols were; I wasn't reporting a bug in Maxima by any means. I'm sorry if that wasn't clear. Because of the string business, getting at the Maxima command involved would have taken me more time than I had. > x1=function('x1',t) construction. I reproduced the problem with This is how Sage constructs a symbolic dummy function. > ?? de1: diff(x1(t),t)=-3*(x2(t)^2-1); > ?? de2: diff(x2(t),t)=1; > ?? desolve([de1,de2],[x1(t),x2(t)]); > A simpler example: > ??desolve([diff(f(x),x)=f(x^2)],[f(x)]); Thanks, that is very helpful. Barton's comment suggests that maybe new_variable could fix this? Thank you all for the clarifications. From willisb at unk.edu Mon Mar 14 22:05:27 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 14 Mar 2011 22:05:27 -0500 Subject: [Maxima] Question about temporary variables In-Reply-To: References: , Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Barton's?comment?suggests?that?maybe?new_variable?could?fix?this? Maxima now has a user-level gensym function. Given that new_variable is in /share/contrib, the Maxima gensym way is the better choice. --Barton From A.G.Grozin at inp.nsk.su Tue Mar 15 02:51:16 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Tue, 15 Mar 2011 13:51:16 +0600 (NOVT) Subject: [Maxima] Prevent evaluation In-Reply-To: <1300154695.3388.7.camel@wigner> References: <000001cbe238$bf254d90$3d6fe8b0$@grothmann@ku-eichstaett.de> <1300122247.1619.6.camel@dieter> <000001cbe284$df5bd8d0$9e138a70$@com> <1300154695.3388.7.camel@wigner> Message-ID: On Tue, 15 Mar 2011, Jaime Villate wrote: > Instead of sending the result back to Maxima for 2D printing, why don't > you send the input again? Namely, set display2d to false, send > factor(1000), save the result, set display2d to true and send > factor(1000) again. This is not a good idea if the calculation takes a long time. Andrey From drdieterkaiser at web.de Tue Mar 15 03:26:13 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 15 Mar 2011 09:26:13 +0100 Subject: [Maxima] Prevent evaluation In-Reply-To: <000001cbe284$df5bd8d0$9e138a70$@com> References: <000001cbe238$bf254d90$3d6fe8b0$@grothmann@ku-eichstaett.de> <1300122247.1619.6.camel@dieter> <000001cbe284$df5bd8d0$9e138a70$@com> Message-ID: <1300177573.1702.4.camel@dieter> Am Montag, den 14.03.2011, 21:17 +0100 schrieb Rene Grothmann: > The reason I want this is the following: > > I am the author of Euler (see euler.rene-grothmann.de), which uses Maxima for symbolic computation. A symbolic expression in Euler is entered as > > >&diff(x^x,x) > x > x (log(x) + 1) > > The result is a string, which is stored for Euler, and used in many Euler functions, as you will find out by checking the examples. But the output prints in Maxima's 2D display. How am I achieving this? Currently, I get Maxima to return the string simply by switching of display2d before I send the string to Maxima for evaluation. Next, I send the resulting string back to Maxima just for printing in 2D, turning on display2d beforehand. This works fine most of the time. > > However, things like > > >&factor(1000) > > do not work. The string "2^3*5^3" is OK, but if I send it to printing, it is "simplified" to 1000. I already discovered, and you told me, how to switch that off. Doing it, prints the result correctly. > > However, I have the next problem with > > >&ev(invert(matrix([3,4],[5,6])),detout) > > [ - 3 2 ] > [ ] > [ 5 3 ] > [ - - - ] > [ 2 2 ] > > This returns a matrix statement devided by the determinant in the string. In fact, it returns > > >@&ev(invert(matrix([3,4],[5,6])),detout) > > -matrix([6,-4],[-5,3])/2 > > > If I pass that for printing, the determinant is multiplied inside as shown above. > > If I prevent simplification, it never prints in matrix 2D form. So there is no nice way to do this. > > This, by the way, is strange to me: What is this matrix form which prints in 2D? > > I wish, I could fix a little bit more inside Maxima. I would change a lot of things to fit Euler more closely. However, I am just communication with this mighty system using pipes. > > Thanks for your response, This behavior is a known bug. The output for a matrix is always linear, when setting the simp flag to false. It is easy to correct this bug, but I have never done it. I can correct this for the next release. Dieter Kaiser From drdieterkaiser at web.de Tue Mar 15 04:13:00 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 15 Mar 2011 10:13:00 +0100 Subject: [Maxima] Prevent evaluation In-Reply-To: <1300177573.1702.4.camel@dieter> References: <000001cbe238$bf254d90$3d6fe8b0$@grothmann@ku-eichstaett.de> <1300122247.1619.6.camel@dieter> <000001cbe284$df5bd8d0$9e138a70$@com> <1300177573.1702.4.camel@dieter> Message-ID: <1300180380.1702.17.camel@dieter> Am Dienstag, den 15.03.2011, 09:26 +0100 schrieb Dieter Kaiser: > Am Montag, den 14.03.2011, 21:17 +0100 schrieb Rene Grothmann: > > The reason I want this is the following: > > > > I am the author of Euler (see euler.rene-grothmann.de), which uses Maxima for symbolic computation. A symbolic expression in Euler is entered as > > > > >&diff(x^x,x) > > x > > x (log(x) + 1) > > > > The result is a string, which is stored for Euler, and used in many Euler functions, as you will find out by checking the examples. But the output prints in Maxima's 2D display. How am I achieving this? Currently, I get Maxima to return the string simply by switching of display2d before I send the string to Maxima for evaluation. Next, I send the resulting string back to Maxima just for printing in 2D, turning on display2d beforehand. This works fine most of the time. > > > > However, things like > > > > >&factor(1000) > > > > do not work. The string "2^3*5^3" is OK, but if I send it to printing, it is "simplified" to 1000. I already discovered, and you told me, how to switch that off. Doing it, prints the result correctly. > > > > However, I have the next problem with > > > > >&ev(invert(matrix([3,4],[5,6])),detout) > > > > [ - 3 2 ] > > [ ] > > [ 5 3 ] > > [ - - - ] > > [ 2 2 ] > > > > This returns a matrix statement devided by the determinant in the string. In fact, it returns > > > > >@&ev(invert(matrix([3,4],[5,6])),detout) > > > > -matrix([6,-4],[-5,3])/2 > > > > > > If I pass that for printing, the determinant is multiplied inside as shown above. > > > > If I prevent simplification, it never prints in matrix 2D form. So there is no nice way to do this. > > > > This, by the way, is strange to me: What is this matrix form which prints in 2D? > > > > I wish, I could fix a little bit more inside Maxima. I would change a lot of things to fit Euler more closely. However, I am just communication with this mighty system using pipes. > > > > Thanks for your response, > > This behavior is a known bug. The output for a matrix is always linear, > when setting the simp flag to false. It is easy to correct this bug, but > I have never done it. I can correct this for the next release. A further remark: I do not know the details of your implementation, but a lot of things can be done more directly using the underlying Lisp functions. E. G. it is possible to use the Lisp function DISPLA to get 2D-output: (%i1) display2d:false$ We assign a value to the variable a: (%i2) a : 99; (%o2) 99 The Lisp function DISPLAY does linear and 2D-display of an expression. The argument is evaluated, not simplified: (%i4) ?displa(a^2); 99^2 (%o4) false Quoting the argument prevents evaluation: (%i5) ?displa('(a^2)); a^2 (%o5) false This is your example: (%i6) ?displa(2^3*5^3); 2^3*5^3 (%o6) false It is possible to do execute a Lisp line the following way: (%i7) :lisp (displa '((mexpt) 2 5)) 2^5 NIL This works for a 2D-output too. These are only simple examples, which uses the Lisp function DISPLA. Dieter Kaiser From drdieterkaiser at web.de Tue Mar 15 04:47:35 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 15 Mar 2011 10:47:35 +0100 Subject: [Maxima] Prevent evaluation In-Reply-To: <1300180380.1702.17.camel@dieter> References: <000001cbe238$bf254d90$3d6fe8b0$@grothmann@ku-eichstaett.de> <1300122247.1619.6.camel@dieter> <000001cbe284$df5bd8d0$9e138a70$@com> <1300177573.1702.4.camel@dieter> <1300180380.1702.17.camel@dieter> Message-ID: <1300182455.1702.29.camel@dieter> Am Dienstag, den 15.03.2011, 10:13 +0100 schrieb Dieter Kaiser: The following patch of the function DIM-$MATRIX corrects the display for matrices. Matrices are displayed in 2D-form independent from the setting of the simp-flag. The code can be put into the file maxima-init.lisp. Then it is loaded when starting Maxima. (defun dim-$matrix (form result) (prog (dmstr rstr cstr consp) (if (or (null (cdr form)) ; (not (member 'simp (cdar form) :test #'eq)) (memalike '((mlist simp)) (cdr form)) (dolist (row (cdr form)) (if (not ($listp row)) (return t)))) (return (dimension-function form result))) (do ((l (cdadr form) (cdr l))) ((null l)) (setq dmstr (cons nil dmstr) cstr (cons 0 cstr))) (do ((r (cdr form) (cdr r)) (h1 0) (d1 0)) ((or consp (null r)) (setq width 0) (do ((cs cstr (cdr cs))) ((null cs)) (setq width (+ 2 (car cs) width))) (setq h1 (1- (+ h1 d1)) depth (truncate h1 2) height (- h1 depth))) (do ((c (cdar r) (cdr c)) (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) 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))) (rplaca cs (max width (car cs)))))) (setq rstr (cons d1 rstr))) (if (> (+ height depth) (length linearray)) (setq consp t)) (return (cond ((and (not consp) (checkfit (+ 2 width))) (matout dmstr cstr rstr result)) ((and (not consp) (<= level 2)) (colout dmstr cstr result)) (t (dimension-function form result)))))) Dieter Kaiser From drdieterkaiser at web.de Tue Mar 15 06:20:45 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 15 Mar 2011 12:20:45 +0100 Subject: [Maxima] Prevent evaluation In-Reply-To: <000301cbe2fb$0b6d4410$2247cc30$@com> References: <000001cbe238$bf254d90$3d6fe8b0$@grothmann@ku-eichstaett.de> <1300122247.1619.6.camel@dieter> <000001cbe284$df5bd8d0$9e138a70$@com> <1300177573.1702.4.camel@dieter> <000301cbe2fb$0b6d4410$2247cc30$@com> Message-ID: <1300188045.1702.58.camel@dieter> Am Dienstag, den 15.03.2011, 11:23 +0100 schrieb Rene Grothmann: > You are giving me the kind of information, I need. However, I still have to figure out a lot of things myself. I would love to search for this myself, if you give me a hint, where to look for. > > Can ?displa be configured to center its output? It does obey the line length, it seems. This might solve a lot of problems I have with Maxima. By the way, how to change the line length? > > Here is what I need: > > (1) A way to evaluate a command in Maxima and get the result as a string. > (2) A way to find out, if there is was an error in the command, and a way to print that error to the user. > (3) A way to print the result string in 2D. > > Currently, I am doing (1) and (2) by parsing the output of Maxima. I use the input prompt for a sign, that the output is over. I am doing (3) by setting display2D to true and sending the result string once more. > > Yours, thankfully, First, some possibilities: (%i1) display2d:false$ The function string evaluates its argument and converts the result into a string: (%i2) string(a + 2^3 + sin(0.5)); (%o2) "a+8.479425538604204" (%i3) string(a + 2^3 + sin(0.5) + 'diff(cos(x),x)); (%o3) "'diff(cos(x),x,1)+a+8.479425538604204" Maxima knows the function errcatch and the option variable errormsg. If we set errormsg to false, we no longer get an error message. (%i4) errormsg:false$ The function errcatch evaluates its argument and return the result as a list: (%i5) errcatch(string(2/3)); (%o5) ["2/3"] If Maxima encounters an error the return value of errcatch is an empty list: (%i6) errcatch(string(2/0)); (%o6) [] In this case you can check the option variable error. It holds the last error message in a list: (%i7) error; (%o7) ["expt: undefined: 0 to a negative exponent."] I think you need both the string and the symbolic expression: (%i1) errormsg:false$ (%i2) result : errcatch(factor(1000)); (%o2) [2^3*5^3] (%i3) str : string(first(result)); (%o3) 2^3*5^3 (%i5) ?displa(first(result)); 2^3*5^3 (%o5) false Remark: I have not checked in detail, if the above scheme causes problems with multiple evaluation. At least at the Lisp level all this problems can be solved. The length of a display line is changed with the option variable linel. I had no detail look at the code of DISPLA. We might have some variants which will give a centered output too. Dieter Kaiser From rene.grothmann at ku-eichstaett.de Tue Mar 15 01:31:21 2011 From: rene.grothmann at ku-eichstaett.de (Rene Grothmann) Date: Tue, 15 Mar 2011 07:31:21 +0100 Subject: [Maxima] Prevent evaluation In-Reply-To: <1300154695.3388.7.camel@wigner> References: <000001cbe238$bf254d90$3d6fe8b0$@grothmann@ku-eichstaett.de> <1300122247.1619.6.camel@dieter> <000001cbe284$df5bd8d0$9e138a70$@com> <1300154695.3388.7.camel@wigner> Message-ID: <000601cbe2da$9a24c500$ce6e4f00$@grothmann@ku-eichstaett.de> Thanks for your tips. I hesitate from the first solution, because Maxima would have to compute everything twice. I already thought of the second solution (as soon as I discovered "grind"), but did not find the time to try it. It requires some rearrangements in the code, and the Maxima code is already quite involved due to the preprocessor stuff I am doing, and the postprocessing necessary to remove the output labels and catch Maxima errors. Thanks in any case. I would love to keep the Maxima community informed about the things I do with their child. May I add a few questions: (1) Can I tell Maxima not to print (%o...)? It does not make sense in my notebook environment. (2) Can I interrupt Maxima computations via pipes? I did a lot of investigation on that point, but did not find a way to achieve it. (3) How can I get Maxima to accept my style of matrices [1,2;3,4] with rows separated by semicolons? This can be solved by a text preprocessor, but might be easy in Maxima itself. Yours, R.G. From renegrothmann at gmail.com Tue Mar 15 02:01:33 2011 From: renegrothmann at gmail.com (Rene Grothmann) Date: Tue, 15 Mar 2011 08:01:33 +0100 Subject: [Maxima] Prevent evaluation In-Reply-To: <1300154695.3388.7.camel@wigner> References: <000001cbe238$bf254d90$3d6fe8b0$@grothmann@ku-eichstaett.de> <1300122247.1619.6.camel@dieter> <000001cbe284$df5bd8d0$9e138a70$@com> <1300154695.3388.7.camel@wigner> Message-ID: <000001cbe2de$d2c4c8c0$784e5a40$@com> I remember now why the "grind" solution does not work for me. I am evaluating so-called symbolic expressions anywhere in Euler. The code calls Maxima to return a string. The actual output is much later at the time, when I print the result of the Euler command. One of the possible results is a symbolic expression (which is a specially marked string). At that time I output the result in 2D. This logic makes it impossible to first evaluate and output in 2D, then call "grind" to get a string version of the result. I think the correct solution would be a function print2D, which handles the two cases mentioned in the previous posting. Thanks for your assstance, R.G. From macrakis at alum.mit.edu Tue Mar 15 12:06:37 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 15 Mar 2011 13:06:37 -0400 Subject: [Maxima] nouns of infix operators In-Reply-To: References: <20110303064305.GA31446@epicurus> <4D6F3BF5.4020600@eecs.berkeley.edu> <20110303075113.GA32016@epicurus> Message-ID: I've been away from my computer on vacation, so I'm only now getting back to this. The simplifying package can in fact handle the case mentioned if the string operator is explicitly converted to a verb: load(simplifying)$ simpfunmake(verbify("*"),[2,3,p,q]) => 2*3*p*q But I've created an updated version of simplifying.lisp (attached) which takes care of converting operators like this and also does some additional checking to make it harder to create invalid expressions. As Fateman points out, expressions like this which are *marked* as simplified but are in fact not simplified may give unsimplified, peculiar, and occasionally even incorrect results when operated on, since from Maxima's perspective they are malformed. For example: t: simpfunmake(verbify("*"),[2,p,q,p,3])$ t/3 => 2*p*q*p*3/3 -- unsimplified t/t => (p*3)/(3*p) -- unsimplified coeff(t,p,1) => 6*p*q -- wrong? But that is presumably unsurprising. To force simplification of one of these expressions, use expand(...,0,0). What may be more surprising is that sometimes things are resimplified even when they're marked as simplified, e.g. part(factor(120),1,1) => 2 -- as expected part(factor(120),1) => 8 -- not 2^3, as you might expect I noticed also that there is a small bug in Maxima's display routines in a particular case of unsimplified expressions (reported in SourceForge ): ex: simpfunmake("-",[a,b,c]) displays as -a, but expand(ex) correctly => -c-b+a Please let me know of any additional issues around simplifying.lisp. -s ------------------------------------------------------- On Thu, Mar 3, 2011 at 12:52, Barton Willis wrote: > maxima-bounces at math.utexas.edu wrote on 03/03/2011 10:34:18 AM: > > > The simplifying package has a function which allows you to construct > > expressions tagged as simplified. > > I didn't try all that hard, but I wasn't able to do this using the > simplifying package. > Maybe something like the following will work: > > (%i26) :lisp(defun $mult_nosimp (&rest l) (cons '(mtimes simp) (sort l > '$orderlessp))) > $MULT_NOSIMP > > (%i26) mult_nosimp(2,3,p,q); > (%o26) 2*3*p*q > > Don't expect Maxima to work correctly with the output of > mult_nosimp--subverting > simplification has bad consequences; example: > > (%i33) mult_nosimp(2,3,p,rat(x)); > (%o33)/R/ 2*3*p*x > > (%i34) %/x; > Maxima encountered a Lisp error: value #:X3118 is not of the expected > type LIST. > > --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: -------------- next part -------------- A non-text attachment was scrubbed... Name: simplifying.lisp Type: application/octet-stream Size: 5100 bytes Desc: not available URL: From kcrisman at gmail.com Tue Mar 15 12:20:11 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Tue, 15 Mar 2011 13:20:11 -0400 Subject: [Maxima] Can revisions also have approximate version # on SF? Message-ID: I made a duplicate bug report on the SF site, unknowingly (well, it's hard to search for math operators). No big deal - I closed it; but when I see that the original problem is fixed, all that bug report says is "Fixed in sin.lisp rev 1.82." That's not too helpful for someone wondering in what 'official' version of Maxima that might appear in. Might it be possible for people to put that in their descriptions? E.g., "Fixed in sin.lisp rev 1.82, part of development branch x.y.z." That would be immensely helpful for our (Sage) use, since we are depending on upstream for functionality, but perhaps even for the casual observer who sees a bug, wants it fixed, but then doesn't know when to download it (let's assume that our observer does not know how to use CVS or whatever, as many mathematical software users won't). Thanks for thinking about it! From robert.dodier at gmail.com Tue Mar 15 14:07:56 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 15 Mar 2011 13:07:56 -0600 Subject: [Maxima] Can revisions also have approximate version # on SF? In-Reply-To: References: Message-ID: Makes sense to me. I'll try to remember to do it, maybe others will too. best Robert Dodier On 3/15/11, Karl-Dieter Crisman wrote: > I made a duplicate bug report on the SF site, unknowingly (well, it's > hard to search for math operators). No big deal - I closed it; but > when I see that the original problem is fixed, all that bug report > says is "Fixed in sin.lisp rev 1.82." > > That's not too helpful for someone wondering in what 'official' > version of Maxima that might appear in. Might it be possible for > people to put that in their descriptions? E.g., "Fixed in sin.lisp > rev 1.82, part of development branch x.y.z." > > That would be immensely helpful for our (Sage) use, since we are > depending on upstream for functionality, but perhaps even for the > casual observer who sees a bug, wants it fixed, but then doesn't know > when to download it (let's assume that our observer does not know how > to use CVS or whatever, as many mathematical software users won't). > > Thanks for thinking about it! > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From kcrisman at gmail.com Tue Mar 15 14:43:22 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Tue, 15 Mar 2011 15:43:22 -0400 Subject: [Maxima] Can revisions also have approximate version # on SF? In-Reply-To: References: Message-ID: Thanks, that would help us a lot. With a 'commit group' it's harder to police that, obviously, but it would be much appreciated. On Tue, Mar 15, 2011 at 3:07 PM, Robert Dodier wrote: > Makes sense to me. I'll try to remember to do it, > maybe others will too. > > best > > Robert Dodier > > On 3/15/11, Karl-Dieter Crisman wrote: >> I made a duplicate bug report on the SF site, unknowingly (well, it's >> hard to search for math operators). ?No big deal - I closed it; but >> when I see that the original problem is fixed, all that bug report >> says is "Fixed in sin.lisp rev 1.82." >> >> That's not too helpful for someone wondering in what 'official' >> version of Maxima that might appear in. ?Might it be possible for >> people to put that in their descriptions? ?E.g., "Fixed in sin.lisp >> rev 1.82, part of development branch x.y.z." >> >> That would be immensely helpful for our (Sage) use, since we are >> depending on upstream for functionality, but perhaps even for the >> casual observer who sees a bug, wants it fixed, but then doesn't know >> when to download it (let's assume that our observer does not know how >> to use CVS or whatever, as many mathematical software users won't). >> >> Thanks for thinking about it! >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > From willisb at unk.edu Tue Mar 15 17:48:09 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 15 Mar 2011 17:48:09 -0500 Subject: [Maxima] How to untellrat? In-Reply-To: References: , Message-ID: To remove a tellrat fact, the function untellrat needs the kernel. How is a user to know the kernel? I was considering using tellrat in a little program for computing eigenvectors, but I can't figure out how to remove tellrat facts. (%i14) tellrat(x^2-x-13); (%o14) [x^2-x-13] (%i15) properties(x); (%o15) [] (%i16) algebraic : true; (%o16) true (%i17) ratsimp(x^2-x-13); (%o17) 0 The kernel *isn't x^2-x-13: (%i18) untellrat(x^2-x-13); (%o18) [x^2-x-13] (%i19) ratsimp(x^2-x-13); (%o19) 0 The kernel is x. But how is the user to know that? (%i20) untellrat(x); (%o20) [] (%i21) ratsimp(x^2-x-13); (%o21) x^2-x-13 --Barton From daniele.tampieri at ieee.org Wed Mar 16 03:02:12 2011 From: daniele.tampieri at ieee.org (Daniele Tampieri) Date: Wed, 16 Mar 2011 09:02:12 +0100 Subject: [Maxima] A few questions about Maxima Message-ID: Dear Sirs, I started to use Maxima inside Emacs a few time ago, and I would like to ask a few questions on how contribute to the project at best. 1)What are the basic steps a supporter/contributor should take (inscription to comunity/newsgroup and so on...)? a)Do there exists a manual for the developer advicing on the best way to write code for the project? b)Do Maxima rely on particular libraries for its development? What are those libraries? 2)Is there any project aimed to implement the chain rule of order n>1 in Maxima by using the Fa? di Bruno Formula? Thank you for your kind attention. Best regards Daniele Tampieri From l.butler at ed.ac.uk Wed Mar 16 07:10:41 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 16 Mar 2011 12:10:41 +0000 (GMT) Subject: [Maxima] Can revisions also have approximate version # on SF? In-Reply-To: References: Message-ID: On Tue, 15 Mar 2011, Karl-Dieter Crisman wrote: < I made a duplicate bug report on the SF site, unknowingly (well, it's < hard to search for math operators). No big deal - I closed it; but < when I see that the original problem is fixed, all that bug report < says is "Fixed in sin.lisp rev 1.82." < < That's not too helpful for someone wondering in what 'official' < version of Maxima that might appear in. Might it be possible for < people to put that in their descriptions? E.g., "Fixed in sin.lisp < rev 1.82, part of development branch x.y.z." The vcs already does most of this for you, and you don't need to have checked out the CVS repo. You can view this information online by going to http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/ choose the src folder, then sin.lisp. This brings you to a page with all the information you want. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From kcrisman at gmail.com Wed Mar 16 07:23:47 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Wed, 16 Mar 2011 08:23:47 -0400 Subject: [Maxima] Can revisions also have approximate version # on SF? In-Reply-To: References: Message-ID: On Wed, Mar 16, 2011 at 8:10 AM, Leo Butler wrote: > > > On Tue, 15 Mar 2011, Karl-Dieter Crisman wrote: > > < I made a duplicate bug report on the SF site, unknowingly (well, it's > < hard to search for math operators). ?No big deal - I closed it; but > < when I see that the original problem is fixed, all that bug report > < says is "Fixed in sin.lisp rev 1.82." > < > < That's not too helpful for someone wondering in what 'official' > < version of Maxima that might appear in. ?Might it be possible for > < people to put that in their descriptions? ?E.g., "Fixed in sin.lisp > < rev 1.82, part of development branch x.y.z." > > The vcs already does most of this for you, and you don't > need to have checked out the CVS repo. > > You can view this information online by going to > http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/ > > choose the src folder, then sin.lisp. This brings you to > a page with all the information you want. > I understand that I can view this if I want to dig far enough and understand how revision systems work. My points are: 1) It's a nontrivial amount of work to find this until one has done it several times (and even there it's not clear exactly what is going on with 5.23 versus 5.23.1 or 5.23.2, one would have to know how the Maxima numbering scheme works, which I don't) 2) For someone unacquainted with the concept of a repository or source changes - presumably a nontrivial number of users - there is no way they will have a clue when to expect this to show up in a binary they can download. Maybe there is a way to tell SF to automatically create a link to the revision log for a given file whenever it sees "Fixed in ... foo.lisp"? Anyway, just food for thought. Thanks! From willisb at unk.edu Wed Mar 16 07:37:15 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 16 Mar 2011 07:37:15 -0500 Subject: [Maxima] A few questions about Maxima In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >2)Is?there?any?project?aimed?to?implement?the?chain?rule >???of?order?n>1?in?Maxima?by?using?the?Fa??di?Bruno >???Formula? I'm unaware of any such project (of course that doesn't mean all that much). More generally, Maxima doesn't have a function that simplifies an arbitrary order derivative. At one time, there was an optional package gendiff, but as I recall, gendiff was full of bugs. A (new?) package for arbitrary order derivatives would be nice contribution to Maxima. --Barton From dbmaxima at gmail.com Wed Mar 16 09:04:18 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Thu, 17 Mar 2011 01:04:18 +1100 Subject: [Maxima] A few questions about Maxima In-Reply-To: References: Message-ID: <4D80C362.50205@gmail.com> On 16/03/2011 7:02 PM, Daniele Tampieri wrote: > Dear Sirs, > I started to use Maxima inside Emacs a few time ago, > and I would like to ask a few questions on how contribute > to the project at best. > 1)What are the basic steps a supporter/contributor should > take (inscription to comunity/newsgroup and so on...)? I suggest: * subscribe to the mailing list * build maxima from cvs source using at least two different lisps. This is quite easy on many linux distributions. It is more difficult on windows, but even I can do it now. ;-) * roll up your sleeves and start somewhere o look through the bug database or the mailing list archives, find some bugs that look simple to fix or that you find interesting, debug them and try and fix them. This is the hard at first. o post any bug fixes to the list for discussion. If they look OK then a maintainer will commit them for you o you could also try and understand how some part of maxima works, then add some comments to the code describing the algorithms used o there are undocumented packages and functions. A beginner can make a contribution here as little knowledge of the internals is required. google "site:www.math.utexas.edu/pipermail/maxima undocumented" for a few examples. o additions to the testsuite are welcome, but please discuss before going to a significant effort * build up some credibility with the maxima community, then if you are still interested you can request to become a maintainer yourself. The barriers are fairly low, but we want to know that you won't do anything stupid. > a)Do there exists a manual for the developer advicing > on the best way to write code for the project? No. I can only suggest you look at code, read the mailing list archive and ask questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Wed Mar 16 09:30:18 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 16 Mar 2011 10:30:18 -0400 Subject: [Maxima] Can revisions also have approximate version # on SF? In-Reply-To: (Karl-Dieter Crisman's message of "Wed, 16 Mar 2011 08:23:47 -0400") References: Message-ID: >>>>> "KD" == Karl-Dieter Crisman writes: KD> I understand that I can view this if I want to dig far enough KD> and understand how revision systems work. My points are: KD> 1) It's a nontrivial amount of work to find this until one has KD> done it KD> several times (and even there it's not clear exactly what is KD> going on with 5.23 versus 5.23.1 or 5.23.2, one would have to KD> know how the Maxima numbering scheme works, which I don't) The maxima version numbers are fairly easy and typical for open source. Major revision 5, minor revision 23. The final 1 (or 2) are just updates to the release to fix relatively (?) minor fixes for the release. KD> 2) For someone unacquainted with the concept of a repository KD> or source KD> changes - presumably a nontrivial number of users - there is KD> no way they will have a clue when to expect this to show up in KD> a binary they can download. Basically if someone says fixed in rev x.y, it will be in the next release. If it says fixed in x.y.z.w, that's a CVS branch and you won't know if that will make it into the release. I think branches have been relatively rare in maxima, so if it says fixed, it will be in the next release. KD> Maybe there is a way to tell SF to automatically create a link KD> to the revision log for a given file whenever it sees "Fixed KD> in ... foo.lisp"? I don't know if that's possible with the current SF setup with CVS. If maxima should move to git or hg, and also enables Trac, then it's possible to even update the bug ticket with such information and also create a link in the ticket to the revision that fixes it. The link could even show you a diff of the corresponding changes. Trac can also provide a timeline of when things were checked in or the wiki updated. For an example, you can browse through trac.clozure.com/ccl to see this in action. See trac.clozuer.com/ccl/ticket/828, for example. Having said that, I think it takes a fair bit of work to set this all up and I don't know if sourceforge allows for all of this integration to happen. Would be nice, but the old bug reports won't be linked and I suspect new users won't know to use the trac ticket system. Ray From kcrisman at gmail.com Wed Mar 16 09:37:27 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Wed, 16 Mar 2011 10:37:27 -0400 Subject: [Maxima] Can revisions also have approximate version # on SF? In-Reply-To: References: Message-ID: > > The maxima version numbers are fairly easy and typical for open > source. ?Major revision 5, minor revision 23. ?The final 1 (or 2) are > just updates to the release to fix relatively (?) minor fixes for the > release. Okay, I thought perhaps, but since the log only had the major and minor I didn't know what the .z part would stand for - in particular, whether release x.y.z would have any bugfixes made up to then, or only the most pressing ones, with other left for x.(y+1). Thanks for that clarification. > Basically if someone says fixed in rev x.y, it will be in the next > release. ?If it says fixed in x.y.z.w, that's a CVS branch and you > I don't know if that's possible with the current SF setup with CVS. > If maxima should move to git or hg, and also enables Trac, then it's > > Having said that, I think it takes a fair bit of work to set this all > up and I don't know if sourceforge allows for all of this integration Yup - we use Trac with Sage. It's not perfect, but I do like some of those sorts of options. However, I am a mathematician, not a professional programmer, so I'm not interested in telling anyone to switch revision systems or anything - that leads to flamewars :) I just wondered whether SF made it easy to do this. Thanks much. From hbaker1 at pipeline.com Wed Mar 16 11:01:21 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Wed, 16 Mar 2011 09:01:21 -0700 Subject: [Maxima] 'trigsign' and signum function Message-ID: Bill Gosper just sent me this message about how 'trigsign' works in Macsyma (not Maxima!). Is there any chance that Maxima could get smarter about the ability to move 'signum()' in and out of odd functions? Maxima seems to know a lot about abs(), but relatively little about signum(), which is amazing, since they are so closely related. If x is real, then x*signum(x) => abs(x) abs(x)*signum(x) => x Also, if x/=0, then signum(x)^2=1. Here's what Gosper sent me: In Macsyma 2.4, (c16) TRIGSIGN; (d16) true (c17) ASINH(SIGNUM(A)*B); (d17) signum(a) asinh(b) (c18) BLOCK([TRIGSIGN : FALSE],ASINH(SIGNUM(A)*B)); (d18) asinh(signum(a) b) (c19) ASINH(SIGNUM(A)*B*(-1)^INTEGER); integer (d19) signum(a) asinh(b) (- 1) From villate at fe.up.pt Wed Mar 16 12:19:04 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 16 Mar 2011 17:19:04 +0000 Subject: [Maxima] Bug/feature of integrate Message-ID: <1300295944.3075.7.camel@wigner> Hi, consider: (%i1) integrate(3,t); (%o1) 3*t (%i2) integrate(0,t); (%o2) 0 (%i3) integrate([3,0],t); (%o3) [3*t,'integrate(0,t)] I'd rather have that last result evaluated/simplified. Any objections? Any takers for that task? It seems useless, but since my students represent vectors by lists, sometimes they have to integrate a vector with one of the components null and it is confusing having to force the evaluation with ev(%,integrate). Cheers, Jaime From macrakis at alum.mit.edu Wed Mar 16 12:26:59 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 16 Mar 2011 13:26:59 -0400 Subject: [Maxima] Bug/feature of integrate In-Reply-To: <1300295944.3075.7.camel@wigner> References: <1300295944.3075.7.camel@wigner> Message-ID: Agreed. Current behavior is a bug. -s On Wed, Mar 16, 2011 at 13:19, Jaime Villate wrote: > Hi, > consider: > > (%i1) integrate(3,t); > (%o1) 3*t > (%i2) integrate(0,t); > (%o2) 0 > (%i3) integrate([3,0],t); > (%o3) [3*t,'integrate(0,t)] > > I'd rather have that last result evaluated/simplified. Any objections? > Any takers for that task? > > It seems useless, but since my students represent vectors by lists, > sometimes they have to integrate a vector with one of the components > null and it is confusing having to force the evaluation with > ev(%,integrate). > 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 petrosez at gmail.com Thu Mar 17 01:03:10 2011 From: petrosez at gmail.com (petrosez at gmail.com) Date: Thu, 17 Mar 2011 08:03:10 +0200 Subject: [Maxima] A few questions about Maxima References: Message-ID: <03C1E7E52D2C40CBAAB0267A35E42878@ZminiQ> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - || From : "Daniele Tampieri" || To : || Sent : Wednesday, March 16, 2011 10:02 AM || Subject: [Maxima] A few questions about Maxima || || Dear Sirs, || || I started to use Maxima inside Emacs a few time ago, || and I would like to ask a few questions on how contribute || to the project at best. || || 1)What are the basic steps a supporter/contributor should || take (inscription to comunity/newsgroup and so on...)? || || a)Do there exists a manual for the developer advicing || on the best way to write code for the project? || || b)Do Maxima rely on particular libraries for its || development? What are those libraries? || || 2)Is there any project aimed to implement the chain rule || of order n>1 in Maxima by using the Fa? di Bruno Formula? || || Thank you for your kind attention. || || Best regards || Daniele Tampieri - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - || From : "David Billinghurst" || To : ; || Sent : Wednesday, March 16, 2011 4:04 PM || Subject: Re: [Maxima] A few questions about Maxima || || On 16/03/2011 7:02 PM, Daniele Tampieri wrote: ||> ||> Dear Sirs, ||> ||> I started to use Maxima inside Emacs a few time ago, ||> and I would like to ask a few questions on how contribute ||> to the project at best. ||> ||> 1) What are the basic steps a supporter/contributor should ||> take (inscription to comunity/newsgroup and so on...)? || || I suggest: || || * subscribe to the mailing list || || * build maxima from cvs source using at least two different || lisps. This is quite easy on many linux distributions. || It is more difficult on windows, but even I can do it || now. ;-) || || * roll up your sleeves and start somewhere || || o look through the bug database or the mailing list archives, || find some bugs that look simple to fix or that you find || interesting, debug them and try and fix them. This is the || hard at first. || || o post any bug fixes to the list for discussion. If they || look OK then a maintainer will commit them for you || || o you could also try and understand how some part of maxima || works, then add some comments to the code describing the || algorithms used || || o there are undocumented packages and functions. A beginner || can make a contribution here as little knowledge of the || internals is required. || google || "site:www.math.utexas.edu/pipermail/maxima undocumented" || for a few examples. || || o additions to the testsuite are welcome, but please discuss || before going to a significant effort || || * build up some credibility with the maxima community, then || if you are still interested you can request to become a || maintainer yourself. The barriers are fairly low, but we || want to know that you won't do anything stupid. || ||> a) Do there exists a manual for the developer advicing ||> on the best way to write code for the project? || || No. I can only suggest you look at code, read the mailing || list archive and ask questions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% || || From : "David Billinghurst" || ... || I suggest: || ... ||* build maxima from cvs source using at least two different || lisps. This is quite easy on many linux distributions. || It is more difficult on windows, but even I can do it || now. ;-) Dear Mr. Billinghurst, Would you, please, give to an absolute beginner, like myself, some advice to try the Windows build? Sincerely, Petros Zimourtopoulos http://www.antennas.gr From dbmaxima at gmail.com Thu Mar 17 02:34:16 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Thu, 17 Mar 2011 18:34:16 +1100 Subject: [Maxima] Windows build (was: A few questions about Maxima) In-Reply-To: <03C1E7E52D2C40CBAAB0267A35E42878@ZminiQ> References: <03C1E7E52D2C40CBAAB0267A35E42878@ZminiQ> Message-ID: <4D81B978.8050705@gmail.com> On 17/03/2011 5:03 PM, petrosez at gmail.com wrote: > Would you, please, give to an absolute beginner, like myself, > some advice to try the Windows build? Petros, The full instructions to build an installable package are in the INSTALL.win32 file http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/INSTALL.win32?revision=1.12 You don't need all the software listed in "External Requirements" if allyou want is to build a maxima executable. Some of it is required for documentation and some for the installer. There are several ways to build under windows. a) You need to choose a lisp system, including gcl, ccl and clisp. b) You can use a make under a unix shell - msys or cygwin - or try a lisp-based build. I personally use: * clisp under cygwin. All the dependencies are available as cygwin packages and the unix build instructions just work. However, maxima under clisp is relatively slow and you also have the overhead of cygwin. * gcl under msys. Getting a gcl working under windows is a problem, as only specific versions of gcc work. The resulting maxima is much faster and this is used for the current windows distribution. Once your system is set up correctly then subsequent builds are easy. There are recent reports of success using ccl. I haven't tried it. This should get you started. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From petrosez at gmail.com Thu Mar 17 04:34:35 2011 From: petrosez at gmail.com (petrosez at gmail.com) Date: Thu, 17 Mar 2011 11:34:35 +0200 Subject: [Maxima] Windows build (was: A few questions about Maxima) References: <03C1E7E52D2C40CBAAB0267A35E42878@ZminiQ> <4D81B978.8050705@gmail.com> Message-ID: <423897E30CCD4F5894728B1462DEB076@ZminiQ> | Sent: Thursday, March 17, 2011 9:34 AM | Subject: Windows build (was: A few questions about Maxima) Thank you very much David. I will try my best. Kind regards, Petros. From andrej.vodopivec at gmail.com Thu Mar 17 05:46:54 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Thu, 17 Mar 2011 11:46:54 +0100 Subject: [Maxima] Windows build (was: A few questions about Maxima) In-Reply-To: <4D81B978.8050705@gmail.com> References: <03C1E7E52D2C40CBAAB0267A35E42878@ZminiQ> <4D81B978.8050705@gmail.com> Message-ID: 2011/3/17 David Billinghurst : > On 17/03/2011 5:03 PM, petrosez at gmail.com wrote: > > Would you, please, give to an absolute beginner, like myself, > some advice to try the Windows build? > > Petros, > > The full instructions to build an installable package are in the > INSTALL.win32 file > http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/INSTALL.win32?revision=1.12 > You don't need all the software listed in "External Requirements" if allyou > want is to build a maxima executable. Some of it is required for > documentation and some for the installer. > > There are several ways to build under windows. > a) You need to choose a lisp system, including gcl, ccl and clisp. > b) You can use a make under a unix shell - msys or cygwin - or try a > lisp-based build. > > I personally use: > > clisp under cygwin.? All the dependencies are available as cygwin packages > and the unix build instructions just work.? However, maxima under clisp is > relatively slow and you also have the overhead of cygwin. > gcl under msys.? Getting a gcl working? under windows is a problem, as only > specific versions of gcc work.? The resulting maxima is much faster and this > is used for the current windows distribution.? Once your system is set up > correctly then subsequent builds are easy. > > There are recent reports of success using ccl.? I haven't tried it. The instructions for building maxima with gcl are really useless. It is true that specific versions of gcc and binutils are required. However, these versions of gcc and binutils are no longer available for download at the mingw sourceforge site. I have not been able to compile gcl with gcc 4.5.2, which is the latest version available with mingw. It is almost impossible to create a mingw environment in which you can build gcl from scratch on windows (well, can't do it, maybe others will have more luck). This is in my opinion the most important reason why maxima should not be using gcl windows. I have created a branch on github for building a windows maxima installer with ccl on github: https://github.com/andrejv/Maxima-CAS The instructions for building are also updated for ccl: https://github.com/andrejv/Maxima-CAS/blob/windows-ccl/INSTALL.win32 Andrej From fateman at eecs.berkeley.edu Thu Mar 17 09:14:42 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 17 Mar 2011 07:14:42 -0700 Subject: [Maxima] A few questions about Maxima In-Reply-To: <4D80C362.50205@gmail.com> References: <4D80C362.50205@gmail.com> Message-ID: <4D821752.90406@eecs.berkeley.edu> On 3/16/2011 7:04 AM, David Billinghurst wrote: > I suggest: > > * subscribe to the mailing list > * build maxima from cvs source using at least two different lisps. > Sorry David, I quite disagree with this. If you want to write a Lisp program that adds a feature to Maxima, you should start with some entirely working distribution, and install it on your computer. You can write a Lisp program $foo which can be called from Maxima as foo( ...). Or you can write programs entirely in Maxima's own language. I also suspect that writing documentation for programs that you have not written and are just learning about is not a good idea. Here's why: 1. Assume you don't know what is going on, and just read the program and think you've figured it out. What are the chances that you are wrong, and your "comments" will in fact be, to some extent incorrect. 2. Subsequent viewers/ debuggers of the code will not only have to overcome the bugs in the code, but the bugs in the COMMENTS. There is no "developer's manual" but there's lots of information. Some of it is in the code and some of it is in published papers, and some of it is in on-line documents, and some is in textbooks, and some in course notes, e.g. cs282 at Berkeley, when I taught it. If you are messing with the simplifier, see also http://www.cs.berkeley.edu/~fateman/papers/simplifier.txt The biggest mistake made by people trying to contribute to computer algebra systems is, I think, to jump in without doing some research about what has been done and what needs to be done. One of the simplest things to do is to compare a different CAS to Maxima and note how they differ. If the other one is "better" can one make Maxima just as good or even better?? Especially if you have a working version of the other system, you can see it in "action". For example, if you have Mathematica available, look through the commands. One that is missing from Maxima that would be interesting is its "Reduce" command. Or find something in the literature that is not in any CAS but is neat. (I looked at putting chebfun ideas into Maxima.) Approximately the last thing I would suggest is struggling with building Maxima from scratch, since for a novice it is either trivial or impossible. It is trivial if the instructions are correct and work. It is impossible if, well, if it doesn't work and you don't know how to make it work because you are a novice.:) And it is entirely unnecessary since you should have at your fingertips a working version to download. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Mar 17 09:41:40 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 17 Mar 2011 10:41:40 -0400 Subject: [Maxima] A few questions about Maxima In-Reply-To: <4D80C362.50205@gmail.com> References: <4D80C362.50205@gmail.com> Message-ID: David, Thanks for your suggestions to Tampieri. I certainly agree that a new contributor should subscribe to the mailing list and study the source. Some will want to work from the bug list, others will have their own ideas of areas they want to develop. Another suggestion I'd make is that if the contributor is thinking of doing something major which will touch many parts of the system (e.g. add numeric intervals as first-class objects), it would probably be a good idea to first discuss on the mailing list. But I don't understand why you suggest "build maxima from cvs source using at least two different lisps." That seems like an unnecessary burden on *any* developer, let alone a new developer -- I NEVER do that, and I've been working on Maxima for 40 years. What is the point of either the building part or the two Lisps part? Someone can be very good at math and at writing Lisp code without mastering the build system and the ins and outs of the various Lisp systems around. One of the beauties of Maxima (and Lisp-based systems in general) is that it is easy to add code (interpreted or compiled) dynamically, without the heavy burden of rebuilding the whole system as in static languages like C. Yes, before the code goes to production, it should be tested on all the Lisps we support in case of obscure incompatibilities (which shouldn't arise with normal math code, but may arise with I/O etc.), but I don't think any individual developer is in a position to do that. A new contributor can work on new Maxima or Lisp code, or revise existing Maxima or Lisp code and in either case simply load it in using load( ) with none of the time and trouble of rebuilding the whole system. That is certainly what I do, starting with the Windows binaries. There may be parts of the system that have weird dependencies on load order or whatever, but I'd hope that most math-oriented code (as opposed to systemsy stuff) is not affected by that. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbaker1 at pipeline.com Thu Mar 17 09:51:40 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Thu, 17 Mar 2011 07:51:40 -0700 Subject: [Maxima] "Upgrade" to Maxima 5.23.2 kills integration Message-ID: I upgraded yesterday from 5.19.1 to 5.23.2, and Maxima can no longer integrate ! (%i1) sqrt(1/(BdotB*t^2+2*AdotB*t+AdotA)); 1 (%o1) sqrt(----------------------------) 2 BdotB t + 2 AdotB t + AdotA (%i2) integrate(%,t); / [ 1 (%o2) I sqrt(----------------------------) dt ] 2 / BdotB t + 2 AdotB t + AdotA (%i3) (Hint: asinh) From macrakis at alum.mit.edu Thu Mar 17 10:37:18 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 17 Mar 2011 11:37:18 -0400 Subject: [Maxima] "Upgrade" to Maxima 5.23.2 kills integration In-Reply-To: References: Message-ID: This appears to be related to the recent adoption of stricter simplification rules for sqrt -- 1/sqrt(x) and sqrt(1/x) are no longer considered equivalent, since the principal value of 1/sqrt(-1) = -%i and sqrt(1/-1) = %i. integrate(sqrt(1/(x^2+x)),x) => 'integrate(sqrt(1/(x^2+x)),x) integrate(1/sqrt(x^2+x),x) => log(2*sqrt(x^2+x)+2*x+1) The workaround is to set radexpand:all : integrate(sqrt(1/(x^2+x)),x),radexpand:all => log(2*sqrt(x^2+x)+2*x+1) Fateman has pointed out many times that trying to manipulate symbolic expressions in such a way that principal value is preserved is a fool's errand unless we get *much* more sophisticated in their handling (with a significant burden in usability). But even naive users are confused when sqrt(x^2) simplifies to x and not abs(x).... So it's not clear what the solution is. -s On Thu, Mar 17, 2011 at 10:51, Henry Baker wrote: > sqrt(1/(BdotB*t^2+2*AdotB*t+AdotA)); > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbaker1 at pipeline.com Thu Mar 17 11:16:54 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Thu, 17 Mar 2011 09:16:54 -0700 Subject: [Maxima] "Upgrade" to Maxima 5.23.2 kills integration In-Reply-To: References: Message-ID: Thanks, Stavros, radexpandall:all is the answer! Yes, I agree with Fateman about fool's errands. You'll have to see my thread on math-fun re "signs/signum" to see that I'm willing to set up a test "harness" and mechanically check all combinations of signs when necessary. I'm not relying on Maxima as a mathematical proof -- particularly on integration -- but for insight as to the possible range of answers, so Maxima's primness in this regard is counter-productive. In this case, for example, I might conclude that the integral can't be done in closed form, without realizing that a very minor change would make it integrable. Unless this is a question on a math exam, there are usually many ways to engineer the problem to make it more soluble. At 08:37 AM 3/17/2011, Stavros Macrakis wrote: >This appears to be related to the recent adoption of stricter simplification rules for sqrt -- 1/sqrt(x) and sqrt(1/x) are no longer considered equivalent, since the principal value of 1/sqrt(-1) = -%i and sqrt(1/-1) = %i. > > integrate(sqrt(1/(x^2+x)),x) => 'integrate(sqrt(1/(x^2+x)),x) > integrate(1/sqrt(x^2+x),x) => log(2*sqrt(x^2+x)+2*x+1) > >The workaround is to set radexpand:all : > > integrate(sqrt(1/(x^2+x)),x),radexpand:all => log(2*sqrt(x^2+x)+2*x+1) > >Fateman has pointed out many times that trying to manipulate symbolic expressions in such a way that principal value is preserved is a fool's errand unless we get *much* more sophisticated in their handling (with a significant burden in usability). But even naive users are confused when sqrt(x^2) simplifies to x and not abs(x).... So it's not clear what the solution is. > > -s > >On Thu, Mar 17, 2011 at 10:51, Henry Baker wrote: >sqrt(1/(BdotB*t^2+2*AdotB*t+AdotA)); From l.butler at ed.ac.uk Thu Mar 17 11:17:25 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 17 Mar 2011 16:17:25 +0000 (GMT) Subject: [Maxima] encoding in non-utf8 infodirs Message-ID: What is the encoding supposed to be for the info files in de, es, etc.? I.e., in de is it always de_DE.ISO-8859-1 or does the encoding depend on the user's locale (e.g. if my locale a UTF-8 locale, should the encoding be UTF-8 when I build the info files in de?). Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From robert.dodier at gmail.com Thu Mar 17 12:07:59 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 17 Mar 2011 11:07:59 -0600 Subject: [Maxima] encoding in non-utf8 infodirs In-Reply-To: References: Message-ID: On 3/17/11, Leo Butler wrote: > What is the encoding supposed to be for the info files > in de, es, etc.? > > I.e., in de is it always de_DE.ISO-8859-1 or does the > encoding depend on the user's locale (e.g. if my locale > a UTF-8 locale, should the encoding be UTF-8 when I > build the info files in de?). >From what I can tell, by default makeinfo generates ISO-8859-1 in any locale, or (with makeinfo >= 4.13) UTF-8 if that's specified on the command line. So the output is insensitive to the environment -- I think that is just how it should be. The build environment has to generate info files for all targets. best, Robert Dodier From pmagunia at sharpermath.com Thu Mar 17 13:06:50 2011 From: pmagunia at sharpermath.com (Parag Magunia) Date: Thu, 17 Mar 2011 14:06:50 -0400 Subject: [Maxima] Web Interface to Maxima Message-ID: Maxima Subscribers, Recently, I created a web interface to maxima. The two applications I have running are a computational textfield which can express output as Tex and also a limit evaluator which outputs Tex as well. I have incorporated some of Bowo Prasetyo's MaximaPHP code (he is developing the project again seems like) and added some of my own. The query is sent via a jQuery AJAX instance so you can see the result without page refresh. I am planning to add additional applications as I have time. I am hoping the Maxima community will find them useful. http://sharpermath.com/content/maxima-limit-evaluate Best, Parag Parag S. Magunia Member, Sharper Math LLC 130 Filly Dr N Wales, Pennsylvania 19454 http://sharpermath.com pmagunia at sharpermath.com 215-909-0485 From brlinnell at verizon.net Wed Mar 16 10:44:07 2011 From: brlinnell at verizon.net (Bruce Linnell) Date: Wed, 16 Mar 2011 10:44:07 -0500 Subject: [Maxima] Follow-up to : trying to use "get" inside a Maxima function - problem using hashed arrays (FYI) Message-ID: <000601cbe3f0$fd043a40$2f01a8c0@brlajdkp0nwqjo> Recap : my original goal was to attach a "quality" to a variable that has a value, so that when the variable was passed to a function, the function could take the appropriate steps based on the quality. In particular, I'm trying to add to the CTensor package functionality, which requires knowing whether a tensor has upper and/or lower indices. My goal is to be able to manipulate vectors, matrices, and arrays containing equations in order to multiply tensors, take the covariant derivative of them, raise/lower indices, etc. I have since found a problem with using hashed arrays. The following code ------------------------------ kill(all)$ test_ll[val]:matrix([1,2],[2,1])$ test_ll[rank]:'Trank2LL$ print("Made in-line : ")$ test_ll; properties(test_ll); arrayinfo(test_ll); test_ll[val]; test_ll[rank]; MakeTensor():=block([temp], temp[val]:matrix([5,5],[5,5]), temp[rank]:'Trank2UU, temp)$ test_uu:MakeTensor()$ print("Made by function : ")$ test_uu; properties(test_uu); arrayinfo(test_uu); test_uu[val]; test_uu[rank]; ------------------------------ Produces the following output : Made in-line : test_ll [hashed array] [hashed, 1, [rank], [val]] [ 1 2 ] [ ] [ 2 1 ] Trank2LL Made by function : temp [value] arrayinfo: test_uu is not an array. -- an error. To debug this try: debugmode(true); [ 5 5 ] [ ] [ 5 5 ] Trank2UU ------------------------------ Note in particular that despite the fact that the [val] and [rank] values are correct, the variable made by the MakeTensor function is NOT a hashed array, and has a "name" (sorry, I don't know all the Maxima terminology yet) of 'temp' instead of 'test_uu'. The following variations on MakeTensor made no difference : MakeTensor():=block([temp,rank,val], temp[val]:matrix([5,5],[5,5]), temp[rank]:'Trank2UU, temp)$ MakeTensor():=block([temp], temp['val]:matrix([5,5],[5,5]), temp['rank]:'Trank2UU, temp)$ This causes problems when a variable from MakeTensor is passed to a function that takes a tensor as an argument and returns a tensor : ------------------------------ Convert(T):=block([temp], temp[val]:T[val]-1, temp[rank]:'Trank2UL, temp)$ test_ul:Convert(test_uu)$ test_ul[val]; test_ul[rank]; test_uu[val]; test_uu[rank]; ------------------------------ Resulting in : [ 4 4 ] [ ] [ 4 4 ] Trank2UL [ 4 4 ] [ ] [ 4 4 ] Trank2UL ------------------------------ Because test_uu's "name" is 'temp', its [rank] and [val] values ALSO GET CHANGED!!! I can think of several potential work-arounds, such as declaring the variables globally, or using different local variable names inside the functions, but none of these can provide the functionality, ease-of-use, and guaranteed error-free performance that I want. However, I have tried all of the above with the (undocumented) "defstruct" feature (examples in my previous email), and it has none of these problems. It also avoids any potential problems should the user assign values to the symbols 'val' or 'rank'. Unless someone knows a quick and easy fix to the hashed-array method, it appears that defstruct is the only way to go. I just wanted to pass this information along so others wouldn't get bitten by the same problem. Bruce -------------- next part -------------- An HTML attachment was scrubbed... URL: From brlinnell at verizon.net Wed Mar 16 11:38:45 2011 From: brlinnell at verizon.net (Bruce Linnell) Date: Wed, 16 Mar 2011 11:38:45 -0500 Subject: [Maxima] Follow-up #2 to : trying to use "get" inside a Maxima function - question about defstruct's Message-ID: <000601cbe3f8$9f207490$2f01a8c0@brlajdkp0nwqjo> So I just converted all my code over to the defstruct method, when I discovered that once I do this : defstruct(Tensor(val,rank)); test:new(Tensor); test at val:matrix([1,1],[1,1]); test at rank:'Trank2LL; When I try to access an array element (which I have to do a lot of) : test at val[1,1]; IT DOESN'T WORK! Am I *really* going to have to do t:test at val; ...t[1,1]... Everywhere in my code??? Thanks, Bruce -------------- next part -------------- An HTML attachment was scrubbed... URL: From cacs at cacs2010.org Wed Mar 16 12:18:05 2011 From: cacs at cacs2010.org (Jane Lew) Date: Thu, 17 Mar 2011 01:18:05 +0800 Subject: [Maxima] [UTEXAS: SUSPECTED SPAM] Congress on Computer Applications and Computational Science, Bali, 15-17 Nov 2011 [EI Compendex, ISTP, IEEE Xplore] Message-ID: 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 Author, Please forward to those who may be interested. Thank you. The 2011 2nd International Congress on Computer Applications and Computational Science (CACS 2011) http://irast.net/conferences/CACS/2011 15-17 November 2011, Bali, Indonesia CACS 2010 aims to bring together researchers and scientists from academia, industry, and government laboratories to present new results and identify future research directions in computer applications and computational science. All papers published in the CACS 2011 proceedings will be included in the IEEE Xplore and indexed in both Ei Compendex and ISTP. CACS 2011 has appeared in the IEEE Conferences (Conference Record # 18959, IEEE Catalog Number: CFP1175N-CDR, ISBN: 978-1-61284-995-9). Topics of interest include, but are not limited to: ? Computer Architecture and VLSI ? Computer Control and Robotics ? Computers in Education and Learning Technologies ? Computer Networks and Data Communications ? Data Mining and Data Engineering ? Energy and Power Systems ? Intelligent Systems and Autonomous Agents ? Internet and Web Systems ? Scientific Computing and Modeling ? Signal, Image and Multimedia Processing ? Software Engineering Bali is a favorite vacation destination for many nationalities. Bali's natural attractions include miles of sandy beaches, picturesque rice terraces, towering active volcanoes over 3,000 meters high, fast flowing rivers, deep ravines, pristine crater lakes, sacred caves, and lush tropical forests full of exotic wildlife. The island's rich cultural heritage is visible everywhere - in over 20,000 temples and palaces, in many colorful festivals and ceremonies, in drama, music, and dance. Bali is also well-known for its night life. Come to Bali enjoying the beautiful environment and fun here! Paper Submission Deadline: 15 May 2011 Review Decision Notifications: 15 August 2011 Final Papers and Author Registration Deadline: 9 September 2011 To unsubscribe, reply with ?unsubscribe maxima at math.utexas.edu ? in your email subject or the first line of the email body. With kind regards, Jane Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Mar 17 16:13:02 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 17 Mar 2011 17:13:02 -0400 Subject: [Maxima] Follow-up #2 to : trying to use "get" inside a Maxima function - question about defstruct's In-Reply-To: <000601cbe3f8$9f207490$2f01a8c0@brlajdkp0nwqjo> References: <000601cbe3f8$9f207490$2f01a8c0@brlajdkp0nwqjo> Message-ID: This is a parsing problem -- (test at val)[1,1] works. I suspect that the parsing of subscripts is hard-wired and can't be adjusted just by changing parser parameters, but perhaps someone else knows that code better. -s On Wed, Mar 16, 2011 at 12:38, Bruce Linnell wrote: > test:new(Tensor); > test at val:matrix([1,1],[1,1]); > test at rank:'Trank2LL; > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Mar 17 16:32:39 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 17 Mar 2011 17:32:39 -0400 Subject: [Maxima] Follow-up to : trying to use "get" inside a Maxima function - problem using hashed arrays (FYI) In-Reply-To: <000601cbe3f0$fd043a40$2f01a8c0@brlajdkp0nwqjo> References: <000601cbe3f0$fd043a40$2f01a8c0@brlajdkp0nwqjo> Message-ID: Bruce, I think there is a confusion here. You said you wanted to attach a quality to a *variable*. But I don't think that's what you wanted to do. You want a *value* which includes both the matrix and some additional properties. After all, if you attach a quality to a variable, that quality won't be assigned or bound to a different variable when you assign or bind the *value* of that variable to *another* variable. Back to the container vs. the contents. If you put a green apple in a red box, it doesn't become red, and if you transfer the contents of the red box to a blue box, it is no longer in a red box (and of course it remains green). There is yet another possibility. If the qualities you're assigning are not *additional* annotations which vary from case to case, but in fact properties of the value itself, you *can* use hashed arrays, but instead of something like variable['property_name]: property_value, you'd use property_name[object_value]: property_value. For example, you could have prime[3]:true or factors[12]:[2,3,4,6]. In the matrix case, this could be useful for (e.g.) annotating a matrix as upper-diagonal or not. But it would *not* be useful to attach the basis, since the same matrix value can be used with different bases. -s On Wed, Mar 16, 2011 at 11:44, Bruce Linnell wrote: > Recap : my original goal was to attach a "quality" to a > variable that has a value, so that when the variable was passed to a > function, the function could take the appropriate steps based on the > quality. In particular, I'm trying to add to the CTensor package > functionality, which requires knowing whether a tensor has upper and/or > lower indices. My goal is to be able to manipulate vectors, matrices, and > arrays containing equations in order to multiply tensors, take the covariant > derivative of them, raise/lower indices, etc. > > I have since found a problem with using hashed arrays. The following code > ------------------------------ > kill(all)$ > > test_ll[val]:matrix([1,2],[2,1])$ > test_ll[rank]:'Trank2LL$ > print("Made in-line : ")$ > test_ll; > properties(test_ll); > arrayinfo(test_ll); > test_ll[val]; > test_ll[rank]; > > MakeTensor():=block([temp], temp[val]:matrix([5,5],[5,5]), > temp[rank]:'Trank2UU, temp)$ > test_uu:MakeTensor()$ > print("Made by function : ")$ > test_uu; > properties(test_uu); > arrayinfo(test_uu); > test_uu[val]; > test_uu[rank]; > ------------------------------ > Produces the following output : > > Made in-line : > test_ll > [hashed array] > [hashed, 1, [rank], [val]] > > [ 1 2 ] > [ ] > [ 2 1 ] > > Trank2LL > Made by function : > temp > [value] > arrayinfo: test_uu is not an array. -- an error. To debug this try: > debugmode(true); > > [ 5 5 ] > [ ] > [ 5 5 ] > > Trank2UU > ------------------------------ > Note in particular that despite the fact that the [val] and [rank] values > are correct, the variable made by the MakeTensor function is NOT a hashed > array, and has a "name" (sorry, I don't know all the Maxima terminology yet) > of 'temp' instead of 'test_uu'. The following variations on MakeTensor made > no difference : > MakeTensor():=block([temp,rank,val], temp[val]:matrix([5,5],[5,5]), > temp[rank]:'Trank2UU, temp)$ > MakeTensor():=block([temp], temp['val]:matrix([5,5],[5,5]), > temp['rank]:'Trank2UU, temp)$ > This causes problems when a variable from MakeTensor is passed to a > function that takes a tensor as an argument and returns a tensor : > ------------------------------ > Convert(T):=block([temp], temp[val]:T[val]-1, temp[rank]:'Trank2UL, temp)$ > test_ul:Convert(test_uu)$ > test_ul[val]; > test_ul[rank]; > test_uu[val]; > test_uu[rank]; > ------------------------------ > Resulting in : > [ 4 4 ] > [ ] > [ 4 4 ] > > Trank2UL > > [ 4 4 ] > [ ] > [ 4 4 ] > > Trank2UL > ------------------------------ > Because test_uu's "name" is 'temp', its [rank] and [val] values ALSO GET > CHANGED!!! > > I can think of several potential work-arounds, such as declaring the > variables globally, or using different local variable names inside the > functions, but none of these can provide the functionality, ease-of-use, and > guaranteed error-free performance that I want. > > However, I have tried all of the above with the (undocumented) "defstruct" > feature (examples in my previous email), and it has none of these problems. > It also avoids any potential problems should the user assign values to the > symbols 'val' or 'rank'. > > Unless someone knows a quick and easy fix to the hashed-array method, it > appears that defstruct is the only way to go. > > I just wanted to pass this information along so others wouldn't get bitten > by the same problem. > > Bruce > > > _______________________________________________ > 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 ed.ac.uk Fri Mar 18 05:32:36 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 18 Mar 2011 10:32:36 +0000 (GMT) Subject: [Maxima] Follow-up to : trying to use "get" inside a Maxima function - problem using hashed arrays (FYI) In-Reply-To: References: <000601cbe3f0$fd043a40$2f01a8c0@brlajdkp0nwqjo> Message-ID: On Thu, 17 Mar 2011, Stavros Macrakis wrote: < Bruce, < I think there is a confusion here. ?You said you wanted to attach a quality to a *variable*. ?But I don't think that's what you wanted to do. ?You want a *value* which includes both the matrix and some additional properties. < ?After all, if you attach a quality to a variable, that quality won't be assigned or bound to a different variable when you assign or bind the *value* of that variable to *another* variable. < < Back to the container vs. the contents. ?If you put a green apple in a red box, it doesn't become red, and if you transfer the contents of the red box to a blue box, it is no longer in a red box (and of course it remains < green). < < There is yet another possibility. ?If the qualities you're assigning are not *additional* annotations which vary from case to case, but in fact properties of the value itself, you *can* use hashed arrays, but instead of < something like variable['property_name]: property_value, you'd use property_name[object_value]: property_value. ?For example, you could have prime[3]:true or factors[12]:[2,3,4,6]. ?In the matrix case, this could be useful for < (e.g.) annotating a matrix as upper-diagonal or not. ?But it would *not* be useful to attach the basis, since the same matrix value can be used with different bases. < < ?? ? ? ? ? ?-s < < < < On Wed, Mar 16, 2011 at 11:44, Bruce Linnell wrote: < Recap : my original goal was to attach a "quality" to a variable?that?has?a value, so that when?the variable?was passed to a function, the function could take the appropriate steps based on the quality.? In < particular, I'm trying to add to the CTensor package functionality, which requires knowing whether a tensor has upper and/or lower indices.? My goal is to be able to manipulate vectors, matrices, and arrays < containing equations in order to?multiply tensors, take the covariant derivative of them, raise/lower indices, etc. Bruce, Here is one way to achieve what you want above (and as Stavros says, this is not your original stated goal). mt(T):=block([TensorFactory], TensorFactory:buildq([T:T], lambda([],T[val]:matrix([5,5],[5,5]), T[rank]:'Trank2UU,T)),apply(TensorFactory,[]))$ The key here is that buildq lets you build a TensorFactory each time you call mt with a distinct symbol. Buildq substitutes in the symbol in place of T and voila, you have a custom-built anonymous function (that's the lambda) that takes no arguments. The final step applies that function to do the work. mt(X); ==> X X[val]; ==> matrix([5,5],[5,5]) If you want to see what TensorFactory produces, just remove the last step and have mt return TensorFactory. This business could be hidden from the user (you) by writing a custom macro, since the definition of mt can be mechanically constructed from the contents of lambda([],...). I imagine this is one of the motivations to use structures. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From macrakis at alum.mit.edu Fri Mar 18 09:47:27 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 18 Mar 2011 10:47:27 -0400 Subject: [Maxima] Inconsistency in array referencing Message-ID: In an expression like q[5], Maxima evaluates q before subscripting it: QQQ[5] : 'QQQ5$ q: 'QQQ$ QQQ[5] => QQQ5 q[5] => QQQ5 However, in an assignment like q[5]:'q5, Maxima does *not* evaluate q before subscripting it: q[5]: 'q5$ q[5] => q5 QQQ[5] => QQQ5 This is inconsistent, and means that workarounds (like buildq) are needed to subscript an array passed as an argument. I suggest we change the semantics of subscripting in assignment so that in the above, q[5]:'q5 assigns the value q5 to QQQ[5]. Discussion? -s PS This came up when I tried to rewrite Leo's tensorfactory in a simpler way. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wilhelm.haager at htlstp.ac.at Fri Mar 18 08:44:04 2011 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Fri, 18 Mar 2011 14:44:04 +0100 Subject: [Maxima] COMA Control Engineering Package Message-ID: <494cf350e41e5fa7cf63d5920ac4c0c6@localhost> Hi! I have uploaded a new version of the control engineering package coma.mac, a wxMaxima sample session, as well as documentations in English and German. The files reside at http://sourceforge.net/apps/phpbb/maxima/viewtopic.php?f=3&t=7 Wilhelm Haager From macrakis at alum.mit.edu Fri Mar 18 10:20:44 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 18 Mar 2011 11:20:44 -0400 Subject: [Maxima] Follow-up to : trying to use "get" inside a Maxima function - problem using hashed arrays (FYI) In-Reply-To: References: <000601cbe3f0$fd043a40$2f01a8c0@brlajdkp0nwqjo> Message-ID: A simpler way of doing what Leo suggests is: mtx(T, val, prop):= ( arraymake(T,['val]) :: val, arraymake(T,['rank]) :: prop, T) Not sure why you'd want to do this, though. -s On Fri, Mar 18, 2011 at 06:32, Leo Butler wrote: > > > On Thu, 17 Mar 2011, Stavros Macrakis wrote: > > < Bruce, > < I think there is a confusion here. You said you wanted to attach a > quality to a *variable*. But I don't think that's what you wanted to do. > You want a *value* which includes both the matrix and some additional > properties. > < After all, if you attach a quality to a variable, that quality won't be > assigned or bound to a different variable when you assign or bind the > *value* of that variable to *another* variable. > < > < Back to the container vs. the contents. If you put a green apple in a > red box, it doesn't become red, and if you transfer the contents of the red > box to a blue box, it is no longer in a red box (and of course it remains > < green). > < > < There is yet another possibility. If the qualities you're assigning are > not *additional* annotations which vary from case to case, but in fact > properties of the value itself, you *can* use hashed arrays, but instead of > < something like variable['property_name]: property_value, you'd use > property_name[object_value]: property_value. For example, you could have > prime[3]:true or factors[12]:[2,3,4,6]. In the matrix case, this could be > useful for > < (e.g.) annotating a matrix as upper-diagonal or not. But it would *not* > be useful to attach the basis, since the same matrix value can be used with > different bases. > < > < -s > < > < > < > < On Wed, Mar 16, 2011 at 11:44, Bruce Linnell > wrote: > < Recap : my original goal was to attach a "quality" to a > variable that has a value, so that when the variable was passed to a > function, the function could take the appropriate steps based on the > quality. In > < particular, I'm trying to add to the CTensor package functionality, > which requires knowing whether a tensor has upper and/or lower indices. My > goal is to be able to manipulate vectors, matrices, and arrays > < containing equations in order to multiply tensors, take the > covariant derivative of them, raise/lower indices, etc. > > Bruce, > Here is one way to achieve what you want above (and as Stavros says, > this is not your original stated goal). > > mt(T):=block([TensorFactory], > TensorFactory:buildq([T:T], > lambda([],T[val]:matrix([5,5],[5,5]), > > T[rank]:'Trank2UU,T)),apply(TensorFactory,[]))$ > > The key here is that buildq lets you build a TensorFactory each > time you call mt with a distinct symbol. Buildq substitutes in > the symbol in place of T and voila, you have a custom-built > anonymous function (that's the lambda) that takes no arguments. > The final step applies that function to do the work. > > mt(X); > ==> X > > X[val]; > ==> matrix([5,5],[5,5]) > > If you want to see what TensorFactory produces, just remove the last > step and have mt return TensorFactory. > > This business could be hidden from the user (you) by writing a custom > macro, since the definition of mt can be mechanically constructed from > the contents of lambda([],...). > > I imagine this is one of the motivations to use structures. > > Leo > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri Mar 18 11:24:09 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 18 Mar 2011 09:24:09 -0700 Subject: [Maxima] Follow-up to : trying to use "get" inside a Maxima function - problem using hashed arrays (FYI) In-Reply-To: References: <000601cbe3f0$fd043a40$2f01a8c0@brlajdkp0nwqjo> Message-ID: <4D838729.5060208@eecs.berkeley.edu> I guess there is nothing wrong with having fun with macros, but I think that using defstruct is simply the way to go here, especially since it works. RJF (who recommended defstruct, and who also wrote it initially. Why it didn't make it into the documentation, I don't know. It is not in the index http://maxima.sourceforge.net/docs/manual/en/maxima_85.html#INDEX1_0 in spite of this request / response http://www.math.utexas.edu/pipermail/maxima/2009/019003.html and the provided documentation in the source file itself. ) From talon at lpthe.jussieu.fr Fri Mar 18 13:25:43 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 18 Mar 2011 19:25:43 +0100 Subject: [Maxima] How to untellrat? References: Message-ID: Barton Willis wrote: > To remove a tellrat fact, the function untellrat needs the kernel. How is > a user to know the kernel? I think tellrat adds algebraic integers to the base field. This means solutions of polynomial equations with integer coeffs and monic higher order term. This is perhaps not explained clearly in the doc niobe% maxima (%i1) tellrat(2*y^2 -3*y +1); Minimal polynomial must be monic -- an error. To debug this try: debugmode(true); (%i2) tellrat(y^2 -3*y+1); 2 (%o2) [y - 3 y + 1] (%i3) ratsimp(y^4+5*y^3 +1); 4 3 (%o3) y + 5 y + 1 (%i4) algebraic:true; (%o4) true (%i5) ratsimp(y^4+5*y^3 +1); (%o5) 61 y - 22 So we have added the algebraic integer y which means that polynomials in y are simplified (by writing repeatedly y^2=...) to first order. Conversely it is natural to apply untellrat to the same algebraic integer y which WILL become transcendental again. It seems that tellrat discovers itself its variables which however implies choices if there are several variables. (%i9) tellrat(y^2 -3*y+z^3); 3 2 (%o9) [z + y - 3 y] (%i10) ratsimp(y^5+z^5); 2 2 5 (%o10) (3 y - y ) z + y So it has clearly chosen to say that z is an algebraic integer over the field obtained by adjoining the transcendental y to the rationals. I think that says what is the "kernel". -- Michel Talon From willisb at unk.edu Fri Mar 18 13:48:10 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 18 Mar 2011 13:48:10 -0500 Subject: [Maxima] How to untellrat? In-Reply-To: References: Message-ID: Thanks for the information; maybe some of your answer should be in the user documentation. As for a user determining the so called kernel, maybe something like this works: (%i2) tellrat(x^2 + x*y + z); (%o2) [z+x*y+x^2] (%i3) :lisp(print tellratlist) (($Z 1 1 0 ((MPLUS RATSIMP) ((MTIMES RATSIMP) $X $Y) ((MEXPT RATSIMP) $X 2)))) (($Z 1 1 0 ((MPLUS RATSIMP) ((MTIMES RATSIMP) $X $Y) ((MEXPT RATSIMP) $X 2)))) (%i3) :lisp(defun $tellrat_kernel () (caar tellratlist)) $TELLRAT_KERNEL (%i3) tellrat_kernel(); (%o3) z (%i4) untellrat(tellrat_kernel()); (%o4) [] (%i5) ratsimp(x^2 + x*y + z); (%o5) z+x*y+x^2 Hours ago, I found a better way to do what I wanted without tellrat. --Barton maxima-bounces at math.utexas.edu wrote on 03/18/2011 01:25:43 PM: > [image removed] > > Re: [Maxima] How to untellrat? > > Michel Talon > > to: > > maxima > > 03/18/2011 01:26 PM > > Sent by: > > maxima-bounces at math.utexas.edu > > Barton Willis wrote: > > > To remove a tellrat fact, the function untellrat needs the kernel. How is > > a user to know the kernel? > > I think tellrat adds algebraic integers to the base field. This means > solutions of polynomial equations with integer coeffs and monic higher order > term. This is perhaps not explained clearly in the doc > niobe% maxima > (%i1) tellrat(2*y^2 -3*y +1); > > Minimal polynomial must be monic > -- an error. To debug this try: debugmode(true); > (%i2) tellrat(y^2 -3*y+1); > 2 > (%o2) [y - 3 y + 1] > (%i3) ratsimp(y^4+5*y^3 +1); > 4 3 > (%o3) y + 5 y + 1 > (%i4) algebraic:true; > (%o4) true > (%i5) ratsimp(y^4+5*y^3 +1); > (%o5) 61 y - 22 > > So we have added the algebraic integer y which means that polynomials in y > are simplified (by writing repeatedly y^2=...) to first order. Conversely > it is natural to apply untellrat to the same algebraic integer y which > WILL become transcendental again. > > It seems that tellrat discovers itself its variables which however implies > choices if there are several variables. > > (%i9) tellrat(y^2 -3*y+z^3); > 3 2 > (%o9) [z + y - 3 y] > (%i10) ratsimp(y^5+z^5); > 2 2 5 > (%o10) (3 y - y ) z + y > > So it has clearly chosen to say that z is an algebraic integer over the > field obtained by adjoining the transcendental y to the rationals. I think > that says what is the "kernel". > > > -- > Michel Talon > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From adammaj1 at o2.pl Sun Mar 20 07:14:40 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Sun, 20 Mar 2011 12:14:40 +0000 (UTC) Subject: [Maxima] draw package - point_size Message-ID: Hi, What is minimal point size ? It is not described in help or www. If I'm not wrong it is 0.2 Smaller sizes give no points. Best regards Adam ------------- Maxima version: 5.23.2 Maxima build date: 14:58 1/18/2011 Host type: x86_64-unknown-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.29.11.debian code : draw2d( terminal = 'png, file_name = "u", dimensions = [1900,1300], title = "Bifurcation diagram, x[i+1] = r*x[i]*(1 - x[i])", point_type = filled_circle, point_size = 0.2, color = black, points(pts)); From willisb at unk.edu Sun Mar 20 07:58:45 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 20 Mar 2011 07:58:45 -0500 Subject: [Maxima] ratsubst vs fullratsubst In-Reply-To: References: Message-ID: I was a bit surprised that ratsubst didn't crunch %i80 to zero: (%i80) ratsubst(6*z^2+37*z-170,z^3,-6*z^4+33*z^3+240*z^2-909*z-510); (%o80) -36*z^3+216*z^2+1332*z-6120 (%i82) load ("lrats")$ (%i83) fullratsubst(6*z^2+37*z-170,z^3,-6*z^4+33*z^3+240*z^2-909*z-510); (%o83) 0 Maybe the user documentation for ratsubst should mention that ratsubst might need to be applied more than once? --Barton From biomates at telefonica.net Sun Mar 20 08:16:33 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 20 Mar 2011 14:16:33 +0100 Subject: [Maxima] draw package - point_size In-Reply-To: References: Message-ID: <1300626993.2814.7.camel@pc> El dom, 20-03-2011 a las 12:14 +0000, Adam Majewski escribi?: > Hi, > > What is minimal point size ? > It is not described in help or www. > If I'm not wrong it is 0.2 > Smaller sizes give no points. > > Best regards > > Adam Draw admits any non negative number as point size. The Gnuplot manual does not give much more information, but it seems that the behavior depends on the default values for each terminal. -- Mario From sol.lederman at gmail.com Sun Mar 20 13:23:52 2011 From: sol.lederman at gmail.com (Sol Lederman) Date: Sun, 20 Mar 2011 12:23:52 -0600 Subject: [Maxima] Seeking areas of little or weak documentation Message-ID: Hi, I've been a techie for lots of years and I love Math although I'm new to Maxima. I'm looking to make a career change to becoming a tech writer and it's been suggested to me that I document a piece of an Open Source package to demonstrate my ability to do technical writing. So, here I am. Can list members point me to areas of Maxima that could most use documentation help? Thanks. Sol -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbaker1 at pipeline.com Sun Mar 20 19:20:16 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Sun, 20 Mar 2011 17:20:16 -0700 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: Message-ID: As a new/old occasional user, I would say that the standard manual leaves a lot to be desired. Part of the problem is the organization of the manual -- things that are closely related aren't even in the same chapter together. Another part of the problem is that the searching mechanism isn't "fuzzy" enough to pick up the things that you might need. Yet another problem is that there are lots of 3rd party applications that might be useful in solving your problem, but they aren't searched or indexed, so you have to go through and read the documentation for all of them. Much of the information for how to use a feature is located in the "examples" for that feature, including the examples used to make sure that Maxima is working correctly (i.e., these examples are normally part of the manual). Another problem is that there are typically several completely different mechanisms to do the same thing, and it isn't entirely obvious until lots of experimentation which mechanism will work for you. I've been trying to understand the multiple different databases of information about functions & variables, including the various internal properties, the various user modifiable properties, the assumption database, etc. I would like to see an entry on every single constant, variable and function that Maxima knows anything about, showing exactly what Maxima knows about it. For example, Maxima seems to know that cosh(x) (x real) is always positive, and cosh(x)=cosh(-x) (i.e., cosh is an "evenfun"). However, I haven't been able to determine if Maxima can routinely figure out that cosh(x)-1>=0. [For the benefit of Maxima's deduction machinery, it might be useful to have a function called 'cosh1(x)' = cosh(x)-1; such a function might also be useful for getting high precision results when x~0, a la exp1(x)=exp(x)-1, which comes in very handy for the same purposes.] As another example, I said 'declare(od,odd)', but couldn't get signum(x)^od to simplify to signum(x). The huge number of various flags in Maxima is very difficult to understand. Any documentation of a function _has_ to indicate _exactly which_ flags will affect its behavior. This process could be mechanized in the Maxima test suite: every function can be laboriously tested with every combination of flags. Maxima can use the transitive closure of the function calling graph to mechanically compute from the source code which flags affect which functions. At 11:23 AM 3/20/2011, Sol Lederman wrote: >Hi, > >I've been a techie for lots of years and I love Math although I'm new to Maxima. I'm looking to make a career change to becoming a tech writer and it's been suggested to me that I document a piece of an Open Source package to demonstrate my ability to do technical writing. So, here I am. > >Can list members point me to areas of Maxima that could most use documentation help? > >Thanks. > >Sol From fateman at eecs.berkeley.edu Sun Mar 20 19:46:14 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 20 Mar 2011 17:46:14 -0700 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: Message-ID: <4D869FD6.2020800@eecs.berkeley.edu> On 3/20/2011 5:20 PM, Henry Baker wrote: > As a new/old occasional user, I would say that the standard manual leaves a lot to be desired. I agree entirely. There are examples (like the Mathematica manual) to use as a guide, though people complain about that too. Maybe the Maxima by Example stuff could be used as a model, also. There are also a few pieces of manual that could use English copy-editing, like the translated-from-German plotting stuff. {It is entirely understandable, but not in conventional idiomatic English} I also have periodically suggested that an alphabetized listing of error messages and what they mean would be a service. On the other hand, the idea that someone who doesn't know much about a program can write documentation for that program tends to leave me cold. In my experience, copy-editing by an experienced professional makes some tech stuff much much better to read. Unfortunately it tends to occasionally change the meaning, sometimes by 180 degrees, and so must be examined carefully. From maxima at etherjones.us Sun Mar 20 20:50:08 2011 From: maxima at etherjones.us (Ether Jones) Date: Sun, 20 Mar 2011 18:50:08 -0700 (PDT) Subject: [Maxima] unresolved constants in DE solution Message-ID: <432722.95981.qm@web161807.mail.bf1.yahoo.com> Why do I have the 2 unresolved constants %k2 and %k1 at %o5 below? I can't think of any other initial conditions beside 'diff(x,t)=0 and x=0 at t=0 Thank you. 'diff(x,t,2) + A*'diff(x,t)^2 + B*'diff(x,t) + D = 0; ode2(%,x,t); p; ic2(%,t=0,x=0,'diff(x,t)=0); 2 dx dx 2 d x (%o1) D + -- B + (--) A + --- = 0 dt dt 2 dt (%i2) 2 Is 4 A D - B positive or negative? 2 (t + %k1) sqrt(4 A D - B ) 2 log(sec(--------------------------)) + t B 2 (%o2) x = %k2 - -------------------------------------------- 2 A From michael.kogan at gmx.net Mon Mar 21 08:25:55 2011 From: michael.kogan at gmx.net (Michael Kogan) Date: Mon, 21 Mar 2011 14:25:55 +0100 Subject: [Maxima] implicit_plot gives an error Message-ID: Hello all, I'm trying to make a plot of an implicit function containing an integral but get following error: Input: implicit_plot(1=integrate(1/sqrt(1+(1/z-1)*x+(z^2-1)*y),z,0,1),[x,-5,5],[y,-5,5]); Output Maxima encountered a Lisp error: Error in >= [or a callee]: (#0=(MPLUS . #1=(SIMP)) -1.0 ((%INTEGRATE . #2=(SIMP)) (#3=(MTIMES . #1#) ((%COS . #2#) (#3# 0.5 (#0# (#3# -1.0 (($ATAN2 . #2#) 0.0 $Z)) (($ATAN2 . #2#) 0.0 (#0# -5.0 (#3# 11.0 $Z) (#3# -5.0 (#4=(MEXPT . #1#) $Z 3))))))) (#4# ((MABS . #2#) $Z) ((RAT SIMP) 1 2)) (#4# ((MABS . #2#) (#0# 5.0 (#3# -11.0 $Z) (#3# 5.0 (#4# $Z 3)))) ((RAT SIMP) -1 2))) $Z 0.0 1.0)) is not of type (OR RATIONAL LISP:FLOAT). Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. Unfortunately I'm quite new to Maxima and don't know what to do with such an error. Since the output seems to mention some "rational" problem, I tried to remove the fraction 1/z from the integral. It seems to work, so following input implicit_plot(1=integrate(1/sqrt(1+(z-1)*x+(z^2-1)*y),z,0,1),[x,-5,5],[y,-5,5]); produces a plot. Of course I need a plot of the function containing the fraction, so any help would be greatly appreciated. Michael P.S.: Using Maxima 5.21.1 with wxMaxima on Linux. From robert.dodier at gmail.com Mon Mar 21 10:47:45 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 21 Mar 2011 09:47:45 -0600 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: Message-ID: Maxima is somewhat disorganized internally, so it is not easy to comprehend. I suspect that it would take a long time to come up to speed on the internals in order to write new documentation for the core stuff or to fix deficiencies in the existing documentation. Given that, there are a couple of documentation projects I can suggest. One is to write documentation for one or more of the share packages, since it could be pretty much a stand-alone document that doesn't rely too much on other stuff (i.e., you mostly need to understand the package, not all of Maxima). There is no list of packages in need of documentation. My advice is to look in the various maxima/share directories in the source code and the already-documented share packages, http://maxima.sourceforge.net/docs/manual/en/maxima_99.html#Category_003a-Share-packages to see what's lacking documentation (doubtless the existing documentation could probably be improved). Share packages are bundled into the software distribution, so you can just look at whatever was installed on your machine. Hope this helps, & welcome to Maxima. Robert Dodier From villate at fe.up.pt Mon Mar 21 11:01:28 2011 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 21 Mar 2011 16:01:28 +0000 Subject: [Maxima] implicit_plot gives an error In-Reply-To: References: Message-ID: <1300723288.1886.2.camel@wigner> On Mon, 2011-03-21 at 14:25 +0100, Michael Kogan wrote: > implicit_plot(1=integrate(1/sqrt(1+(1/z-1)*x > +(z^2-1)*y),z,0,1),[x,-5,5],[y,-5,5]); > > Output > > Maxima encountered a Lisp error: Hi, the problem is not with implicit_plot, but with integrate which cannot solve that integral. Even using one of the numerical methods in Maxima that integral will fail, because in z=0 the term 1/z gives you an overflow. Regards, Jaime From sol.lederman at gmail.com Sun Mar 20 21:38:04 2011 From: sol.lederman at gmail.com (Sol Lederman) Date: Sun, 20 Mar 2011 20:38:04 -0600 Subject: [Maxima] Seeking areas of little or weak documentation Message-ID: Henry and Richard, Thank you for taking the time to respond so thoroughly to my post. I see a common thread in your responses -- that there are areas of Maxima where information is not well organized/catalogued. As a person completely new to Maxima I don't have any bearings to tell me where I could make a significant contribution given a reasonable amount of effort. I'm certainly willing to put in the time to learn the software and to gain experience in what I'm going to write about. I aim to be one of those technical writers who writes with sufficient depth to distinguish himself from those who don't. So, it's in my best interest to contribute something of value. At the same time I don't want to take on something bigger than I can chew. Richard Fateman writes: > I also have periodically suggested that an alphabetized listing of error > messages and what they mean would be a service. What is the effort involved in cataloguing all the error messages? Is it a matter of scraping the source code and then figuring out what each error means? Henry Baker writes: > I would like to see an entry on every single constant, variable and function that Maxima knows anything > about, showing exactly what Maxima knows about it. How would one go about finding that information? Henry also writes: > The huge number of various flags in Maxima is very difficult to understand. Any documentation of a > function _has_ to indicate _exactly which_ flags will affect its behavior. This process could be > mechanized in the Maxima test suite: every function can be laboriously tested with every combination > of flags. Maxima can use the transitive closure of the function calling graph to mechanically compute > from the source code which flags affect which functions. Again, I'm interested to know the scope of the effort to catalog functions and their flags. I appreciate the dialog. Sol -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.kogan at gmx.net Mon Mar 21 14:56:42 2011 From: michael.kogan at gmx.net (Michael Kogan) Date: Mon, 21 Mar 2011 20:56:42 +0100 Subject: [Maxima] implicit_plot gives an error In-Reply-To: <1300723288.1886.2.camel@wigner> References: <1300723288.1886.2.camel@wigner> Message-ID: Thanks for your reply! Is there any possibility to find a workaround here? Or maybe to report it as a bug? I know for sure that this function can be plotted, see here: http://dl.dropbox.com/u/1507406/Determination%20of%20cosmological%20parameters%20for%20non-specialists.pdf (Figure 1 on the 3. page). Also there is another representation of this function which doesn't contain a 1/z term and still fails in Maxima (it's equation 3.9, whereas the original expression is equation 3.6). Thanks again, Michael 2011/3/21 Jaime Villate : > Hi, > the problem is not with implicit_plot, but with integrate which cannot > solve that integral. Even using one of the numerical methods in Maxima > that integral will fail, because in z=0 the term 1/z gives you an > overflow. > Regards, > Jaime From talon at lpthe.jussieu.fr Mon Mar 21 15:21:13 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Mon, 21 Mar 2011 21:21:13 +0100 Subject: [Maxima] Seeking areas of little or weak documentation References: Message-ID: Sol Lederman wrote: > Henry and Richard, > > Thank you for taking the time to respond so thoroughly to my post. > > I see a common thread in your responses -- that there are areas of Maxima > where information is not well organized/catalogued. > One of the areas which would benefit from a better documentation is the part 36, Rules and patterns. This is a difficult subject, and frequently questions about it appear in this forum. By collecting all this information, and playing with the program, perhaps one could enhance this documentation. This is a set of features which work very well in Mathematica and are very well documented in the Mathematica book. This perhaps could help as example. Robert Dodier is the expert on these features, he certainly could also help. In another department, R. Toy has recently added lbfgs to the share directory. I suppose this is related to http://en.wikipedia.org/wiki/BFGS_method http://en.wikipedia.org/wiki/L-BFGS but there is zero documentation. this would be a target for experimentation and documentation on a limited domain. I would say the same for colnew but i am working on it, because i have special interest on this program. There are other interesting programs which are presently broken such as share/gentran. Dan Stanger is working on that, probably it will be an interesting target of documentation because gentran functionality is nice. -- Michel Talon From macrakis at alum.mit.edu Mon Mar 21 15:24:54 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 21 Mar 2011 16:24:54 -0400 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: Message-ID: I think just about any topic in Maxima could benefit from intelligent documentation. Today, each section (e.g. polynomials) is organized alphabetically by function. That is fine if you know what function you want, but very hard to use if you're trying to get something accomplished and don't know how. The problem is that it's not clear what resources a tech writer could use to write this up in a goal-oriented way. There is lots of useful information in the mailing list archives, but it is *a lot* of material. -s On Mon, Mar 21, 2011 at 16:21, Michel Talon wrote: > Sol Lederman wrote: > > > Henry and Richard, > > > > Thank you for taking the time to respond so thoroughly to my post. > > > > I see a common thread in your responses -- that there are areas of Maxima > > where information is not well organized/catalogued. > > > > One of the areas which would benefit from a better documentation is the > part > 36, Rules and patterns. This is a difficult subject, and frequently > questions about it appear in this forum. By collecting all this > information, > and playing with the program, perhaps one could enhance this documentation. > This is a set of features which work very well in Mathematica and are very > well documented in the Mathematica book. This perhaps could help as > example. > Robert Dodier is the expert on these features, he certainly could also > help. > > In another department, R. Toy has recently added lbfgs to the share > directory. I suppose this is related to > http://en.wikipedia.org/wiki/BFGS_method > http://en.wikipedia.org/wiki/L-BFGS > but there is zero documentation. this would be a target for experimentation > and documentation on a limited domain. > > I would say the same for colnew but i am working on it, because i have > special interest on this program. > > There are other interesting programs which are presently broken such as > share/gentran. Dan Stanger is working on that, probably it will be an > interesting target of documentation because gentran functionality is nice. > > > > -- > 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 hbaker1 at pipeline.com Mon Mar 21 15:44:42 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Mon, 21 Mar 2011 13:44:42 -0700 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: Message-ID: I would hate to see YAMM (Yet Another Maxima Manual). In this day & age, paper isn't where it's at; you want everything to on-line. It should be possible _within Maxima itself_ to bring up one or more web pages in your web browser which include function definitions, examples, source code, etc. Javascript is sufficiently powerful to do a lot, and with HTML5 becoming available momentarily, a web-based interface will allow real-time hardware-accelerated shaded animated graphics from within Maxima. The newest generation of browsers have just-in-time compilers for Javascript, so javascript is actually pretty zippy. Check out Microsoft's beta browser, for example. If you want to look at better on-line documentation, look at the Javascript pages at http://www.w3schools.com/js/ They aren't perfect, but they're pretty good, and they're Google searchable, which helps enormously. P.S., I would love to replace the existing Maxima front-end with a browser-based one, so that I could utilize some of the interactive javascript graphical tools -- e.g., JSXGraph. At 01:24 PM 3/21/2011, Stavros Macrakis wrote: >I think just about any topic in Maxima could benefit from intelligent documentation. > >Today, each section (e.g. polynomials) is organized alphabetically by function. That is fine if you know what function you want, but very hard to use if you're trying to get something accomplished and don't know how. The problem is that it's not clear what resources a tech writer could use to write this up in a goal-oriented way. There is lots of useful information in the mailing list archives, but it is *a lot* of material. > > -s > >On Mon, Mar 21, 2011 at 16:21, Michel Talon wrote: >Sol Lederman wrote: > >> Henry and Richard, >> >> Thank you for taking the time to respond so thoroughly to my post. >> >> I see a common thread in your responses -- that there are areas of Maxima >> where information is not well organized/catalogued. > >One of the areas which would benefit from a better documentation is the part >36, Rules and patterns. This is a difficult subject, and frequently >questions about it appear in this forum. By collecting all this information, >and playing with the program, perhaps one could enhance this documentation. >This is a set of features which work very well in Mathematica and are very >well documented in the Mathematica book. This perhaps could help as example. >Robert Dodier is the expert on these features, he certainly could also help. > >In another department, R. Toy has recently added lbfgs to the share >directory. I suppose this is related to >http://en.wikipedia.org/wiki/BFGS_method >http://en.wikipedia.org/wiki/L-BFGS >but there is zero documentation. this would be a target for experimentation >and documentation on a limited domain. > >I would say the same for colnew but i am working on it, because i have >special interest on this program. > >There are other interesting programs which are presently broken such as >share/gentran. Dan Stanger is working on that, probably it will be an >interesting target of documentation because gentran functionality is nice. > >-- >Michel Talon From macrakis at alum.mit.edu Mon Mar 21 15:54:53 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 21 Mar 2011 16:54:53 -0400 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: Message-ID: Oh, I just *assumed* that whatever Sol came up with would be designed for on-line use, not for paper. Don't we all hate reading page-formatted PDFs online? -s On Mon, Mar 21, 2011 at 16:44, Henry Baker wrote: > I would hate to see YAMM (Yet Another Maxima Manual). In this day & age, > paper isn't where it's at; you want everything to on-line. > > It should be possible _within Maxima itself_ to bring up one or more web > pages in your web browser which include function definitions, examples, > source code, etc. Javascript is sufficiently powerful to do a lot, and with > HTML5 becoming available momentarily, a web-based interface will allow > real-time hardware-accelerated shaded animated graphics from within Maxima. > The newest generation of browsers have just-in-time compilers for > Javascript, so javascript is actually pretty zippy. Check out Microsoft's > beta browser, for example. > > If you want to look at better on-line documentation, look at the Javascript > pages at > > http://www.w3schools.com/js/ > > They aren't perfect, but they're pretty good, and they're Google > searchable, which helps enormously. > > P.S., I would love to replace the existing Maxima front-end with a > browser-based one, so that I could utilize some of the interactive > javascript graphical tools -- e.g., JSXGraph. > > At 01:24 PM 3/21/2011, Stavros Macrakis wrote: > >I think just about any topic in Maxima could benefit from intelligent > documentation. > > > >Today, each section (e.g. polynomials) is organized alphabetically by > function. That is fine if you know what function you want, but very hard to > use if you're trying to get something accomplished and don't know how. The > problem is that it's not clear what resources a tech writer could use to > write this up in a goal-oriented way. There is lots of useful information > in the mailing list archives, but it is *a lot* of material. > > > > -s > > > >On Mon, Mar 21, 2011 at 16:21, Michel Talon > wrote: > >Sol Lederman wrote: > > > >> Henry and Richard, > >> > >> Thank you for taking the time to respond so thoroughly to my post. > >> > >> I see a common thread in your responses -- that there are areas of > Maxima > >> where information is not well organized/catalogued. > > > >One of the areas which would benefit from a better documentation is the > part > >36, Rules and patterns. This is a difficult subject, and frequently > >questions about it appear in this forum. By collecting all this > information, > >and playing with the program, perhaps one could enhance this > documentation. > >This is a set of features which work very well in Mathematica and are very > >well documented in the Mathematica book. This perhaps could help as > example. > >Robert Dodier is the expert on these features, he certainly could also > help. > > > >In another department, R. Toy has recently added lbfgs to the share > >directory. I suppose this is related to > >http://en.wikipedia.org/wiki/BFGS_method > >http://en.wikipedia.org/wiki/L-BFGS > >but there is zero documentation. this would be a target for > experimentation > >and documentation on a limited domain. > > > >I would say the same for colnew but i am working on it, because i have > >special interest on this program. > > > >There are other interesting programs which are presently broken such as > >share/gentran. Dan Stanger is working on that, probably it will be an > >interesting target of documentation because gentran functionality is > nice. > > > >-- > >Michel Talon > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Mon Mar 21 16:01:41 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Mon, 21 Mar 2011 21:01:41 +0000 Subject: [Maxima] unresolved constants in DE solution References: <432722.95981.qm@web161807.mail.bf1.yahoo.com> Message-ID: Ether Jones writes: > Why do I have the 2 unresolved constants %k2 and %k1 > at %o5 below? > > I can't think of any other initial conditions > beside 'diff(x,t)=0 and x=0 at t=0 I think that you may have omitted some of the output you get when running the command. Your transcript follows: > 'diff(x,t,2) + A*'diff(x,t)^2 + B*'diff(x,t) + D = 0; > > ode2(%,x,t); > > p; > > ic2(%,t=0,x=0,'diff(x,t)=0); > 2 > dx dx 2 d x > (%o1) D + -- B + (--) A + --- = 0 > dt dt 2 > dt > (%i2) > 2 > Is 4 A D - B positive or negative? > > 2 > (t + %k1) sqrt(4 A D - B ) > 2 log(sec(--------------------------)) + t B > 2 > (%o2) x = %k2 - -------------------------------------------- > 2 A and mine: Maxima 5.23post http://maxima.sourceforge.net using Lisp SBCL 1.0.46.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) 'diff(x,t,2) + A*'diff(x,t)^2 + B*'diff(x,t) + D = 0; 2 dx dx 2 d x (%o1) D + -- B + (--) A + --- = 0 dt dt 2 dt (%i3) ode2(%o1, x, t); 2 Is 4 A D - B positive or negative? pos; 2 (t + %k1) sqrt(4 A D - B ) 2 log(sec(--------------------------)) + t B 2 (%o3) x = %k2 - -------------------------------------------- 2 A (%i4) ic2(%,t=0,x=0,'diff(x,t)=0); (%o4) [] (%i5) The good news is that you can actually solve for %k1 and %k2 yourself. Substituting in zeros for t in %o3 and its derivative, I get the following pair of equations: (%i11) ics: [rhs(%o5) = 0, %o10 = 0]; 2 %k1 sqrt(4 A D - B ) log(sec(--------------------)) 2 (%o11) [%k2 - ------------------------------ = 0, A 2 2 %k1 sqrt(4 A D - B ) sqrt(4 A D - B ) tan(--------------------) + B = 0] 2 Note that the second is free of %k2. Let d = sqrt(4*A*D-B^2)/2 and then solve: (%i15) ratsubst(d, sqrt(4*A*D-B^2)/2, second(ics)); (%o15) B + 2 d tan(%k1 d) = 0 (%i16) solve(%, %k1); solve: using arc-trig functions to get a solution. Some solutions will be lost. B atan(---) 2 d (%o16) [%k1 = - ---------] d (%i17) Now, notice that (%i12) sec(atan(x)), trigreduce; 2 (%o12) sqrt(x + 1) and, since, (%i27) ratsubst(d, sqrt(4*A*D-B^2)/2, first(ics)); %k2 A - log(sec(%k1 d)) (%o27) ----------------------- = 0 A this is going to be quite nice. The displayed form on substituting in is massive and ugly, but solving you get: (%i28) solve(%o26, %k2); 2 B log(---- + 1) 2 4 d (%o28) [%k2 = -------------] 2 A 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 toy.raymond at gmail.com Mon Mar 21 16:14:51 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 21 Mar 2011 17:14:51 -0400 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: Message-ID: <4D87BFCB.1000702@gmail.com> On 3/21/11 4:21 PM, Michel Talon wrote: > Sol Lederman wrote: > >> Henry and Richard, >> >> Thank you for taking the time to respond so thoroughly to my post. >> >> I see a common thread in your responses -- that there are areas of Maxima >> where information is not well organized/catalogued. >> > One of the areas which would benefit from a better documentation is the part > 36, Rules and patterns. This is a difficult subject, and frequently > questions about it appear in this forum. By collecting all this information, > and playing with the program, perhaps one could enhance this documentation. > This is a set of features which work very well in Mathematica and are very > well documented in the Mathematica book. This perhaps could help as example. > Robert Dodier is the expert on these features, he certainly could also help. > > In another department, R. Toy has recently added lbfgs to the share > directory. I suppose this is related to > http://en.wikipedia.org/wiki/BFGS_method > http://en.wikipedia.org/wiki/L-BFGS > but there is zero documentation. this would be a target for experimentation > and documentation on a limited domain. While, I'd love to take credit for that, that was actually done by Robert Dodier. And it is documented. "? lbfgs" gives enough information to figure out how to use it. Ray From drdieterkaiser at web.de Mon Mar 21 16:40:30 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 21 Mar 2011 22:40:30 +0100 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: Message-ID: <1300743630.2999.10.camel@dieter> Am Montag, den 21.03.2011, 16:54 -0400 schrieb Stavros Macrakis: > Oh, I just *assumed* that whatever Sol came up with would be designed > for on-line use, not for paper. Don't we all hate reading > page-formatted PDFs online? > > > -s > > On Mon, Mar 21, 2011 at 16:44, Henry Baker > wrote: > I would hate to see YAMM (Yet Another Maxima Manual). In this > day & age, paper isn't where it's at; you want everything to > on-line. > > It should be possible _within Maxima itself_ to bring up one > or more web pages in your web browser which include function > definitions, examples, source code, etc. Javascript is > sufficiently powerful to do a lot, and with HTML5 becoming > available momentarily, a web-based interface will allow > real-time hardware-accelerated shaded animated graphics from > within Maxima. The newest generation of browsers have > just-in-time compilers for Javascript, so javascript is > actually pretty zippy. Check out Microsoft's beta browser, > for example. > > If you want to look at better on-line documentation, look at > the Javascript pages at > > http://www.w3schools.com/js/ > > They aren't perfect, but they're pretty good, and they're > Google searchable, which helps enormously. > > P.S., I would love to replace the existing Maxima front-end > with a browser-based one, so that I could utilize some of the > interactive javascript graphical tools -- e.g., JSXGraph. > > > At 01:24 PM 3/21/2011, Stavros Macrakis wrote: > >I think just about any topic in Maxima could benefit from > intelligent documentation. > > > >Today, each section (e.g. polynomials) is organized > alphabetically by function. That is fine if you know what > function you want, but very hard to use if you're trying to > get something accomplished and don't know how. The problem is > that it's not clear what resources a tech writer could use to > write this up in a goal-oriented way. There is lots of useful > information in the mailing list archives, but it is *a lot* of > material. > > > > -s > > > >On Mon, Mar 21, 2011 at 16:21, Michel Talon > wrote: > >Sol Lederman wrote: > > > >> Henry and Richard, > >> > >> Thank you for taking the time to respond so thoroughly to > my post. > >> > >> I see a common thread in your responses -- that there are > areas of Maxima > >> where information is not well organized/catalogued. > > > >One of the areas which would benefit from a better > documentation is the part > >36, Rules and patterns. This is a difficult subject, and > frequently > >questions about it appear in this forum. By collecting all > this information, > >and playing with the program, perhaps one could enhance this > documentation. > >This is a set of features which work very well in Mathematica > and are very > >well documented in the Mathematica book. This perhaps could > help as example. > >Robert Dodier is the expert on these features, he certainly > could also help. > > > >In another department, R. Toy has recently added lbfgs to the > share > >directory. I suppose this is related to > >http://en.wikipedia.org/wiki/BFGS_method > >http://en.wikipedia.org/wiki/L-BFGS > >but there is zero documentation. this would be a target for > experimentation > >and documentation on a limited domain. > > > >I would say the same for colnew but i am working on it, > because i have > >special interest on this program. > > > >There are other interesting programs which are presently > broken such as > >share/gentran. Dan Stanger is working on that, probably it > will be an > >interesting target of documentation because gentran > functionality is nice. > > > >-- > >Michel Talon Since several month I am working on a German translation and it is like Stavros has written in one of the last postings, every chapter could benefit from more documentation. This work is not finished, but I have an online version of the German translation which might be interesting to compare with the actual English version http://crategus.users.sourceforge.net/maxima.html I have opened some new chapters, closed other chapters and collected the functions in a more logical order. I have added more documentation of functions and more examples, and I tried to describe the functions less technical, but more user friendly. One point is that I started to collect all option variables, which control the simplification of functions, see e. g. the trigonometric functions or the Exponential function in the German translation. Furthermore, I have added a lot of cross references in the online version, and started to add more verbose introductions to every chapter, which gives the user an overview. Dieter Kaiser From O.Kullmann at swansea.ac.uk Mon Mar 21 16:48:33 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Mon, 21 Mar 2011 21:48:33 +0000 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: <1300743630.2999.10.camel@dieter> References: <1300743630.2999.10.camel@dieter> Message-ID: <20110321214833.GT14491@cs-wsok.swansea.ac.uk> I think a great thing for Maxima would be if one could teach Doxygen (http://www.stack.nl/~dimitri/doxygen/) to understand the Maxima language (and/or Lisp). This would be a meta-tool, potentially extremely helpful. Oliver P.S. Doxygen doesn't have great support for new languages, but it suports quite a lot, and as far as I know, basic support for Lisp-like languages shouldn't be too hard to add (there are language-templates). -- 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 smh at franz.com Mon Mar 21 16:49:58 2011 From: smh at franz.com (Steve Haflich) Date: Mon, 21 Mar 2011 14:49:58 -0700 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: Message-ID: <20216.1300744198@gemini.franz.com> Stavros Macrakis wrote: Today, each section (e.g. polynomials) is organized alphabetically by function. ?That is fine if you know what function you want, but very hard to use if you're trying to get something accomplished and don't know how. ?The problem is that it's not clear what resources a tech writer could use to write this up in a goal-oriented way. Perhaps one useful approach would be creation of a permuted index of the functions. There may be software available on the web for creating a permuted index, but if not, this is a problem that can be solved by practice of that arcane skill known as "computer programming." Years ago I wrote the permuted-index generator used for the Allegro CL html documentation set. Perhaps I could shake it loose and make it open source, but be aware that any permuted index generator needs lots of twisty scrape-and-glue code to extract the names and locations out of some preexisting documentation set. But if this project makes sense and would be useful, then it could be accomplished by someone knowing almost nothing about Maxima... From rswarbrick at gmail.com Mon Mar 21 17:34:30 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Mon, 21 Mar 2011 22:34:30 +0000 Subject: [Maxima] Seeking areas of little or weak documentation References: <1300743630.2999.10.camel@dieter> <20110321214833.GT14491@cs-wsok.swansea.ac.uk> Message-ID: Oliver Kullmann writes: > I think a great thing for Maxima would be if one could > teach Doxygen (http://www.stack.nl/~dimitri/doxygen/) > to understand the Maxima language (and/or Lisp). > > This would be a meta-tool, potentially extremely helpful. > > Oliver > > P.S. Doxygen doesn't have great support for new languages, > but it suports quite a lot, and as far as I know, basic > support for Lisp-like languages shouldn't be too hard to > add (there are language-templates). Hmm, I'm not convinced. I think that most of Maxima's internal functions could be documented via docstrings in the lisp code: the fact that they aren't isn't due to a tooling problem! The user-level documentation should definitely not be written with doxygen: the results are invariably hard to read as a "manual", rather than a reference / list of function prototypes. Maybe this comes across as dogmatic, but I can't think of any open source project with nice doxygen-genarated documentation and I know that my first reaction when I see the characteristic blue tabs along the top is to groan out loud... Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From talon at lpthe.jussieu.fr Mon Mar 21 17:51:43 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Mon, 21 Mar 2011 23:51:43 +0100 Subject: [Maxima] Seeking areas of little or weak documentation References: <4D87BFCB.1000702@gmail.com> Message-ID: Raymond Toy wrote: > On 3/21/11 4:21 PM, Michel Talon wrote: > While, I'd love to take credit for that, that was actually done by > Robert Dodier. And it is documented. "? lbfgs" gives enough > information to figure out how to use it. Sorry for my error. -- Michel Talon From villate at fe.up.pt Mon Mar 21 17:56:25 2011 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 21 Mar 2011 22:56:25 +0000 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: <1300743630.2999.10.camel@dieter> References: <1300743630.2999.10.camel@dieter> Message-ID: <1300748185.4600.2.camel@wigner> On Mon, 2011-03-21 at 22:40 +0100, Dieter Kaiser wrote: > I have opened some new chapters, closed other chapters and collected > the functions in a more logical order. > > I have added more documentation of functions and more examples, and I > tried to describe the functions less technical, but more user > friendly. > One point is that I started to collect all option variables, which > control the simplification of functions, see e. g. the trigonometric > functions or the Exponential function in the German translation. > > Furthermore, I have added a lot of cross references in the online > version, and started to add more verbose introductions to every > chapter, which gives the user an overview. Hi, yes, I've noticed in ohloh.net that you have been working very hard. I just hope that you introduce your improvements in the English version too. Keep up the good work. Cheers, Jaime From villate at fe.up.pt Mon Mar 21 19:33:22 2011 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 22 Mar 2011 00:33:22 +0000 Subject: [Maxima] Bug in plot2d/coerce-float-fun Message-ID: <1300754002.5852.3.camel@wigner> Hi, (%i4) f(x):= sin(x)/x$ (%i5) plot2d(f(x), [x,-8,8]); plot2d: expression evaluates to non-numeric value somewhere in plotting range. (%o5) (%i6) plot2d(f, [x,-8,8]); expt: undefined: 0 to a negative exponent. #0: f(x=0.0) %i5 shows the plot correctly but %i6 does not. The expression sin(x)/x gives no problem for x=0, but when the function is called bay name it fails. Regards, Jaime From dan.stanger at ieee.org Mon Mar 21 20:24:06 2011 From: dan.stanger at ieee.org (Dan Stanger) Date: Mon, 21 Mar 2011 21:24:06 -0400 Subject: [Maxima] Gentran Message-ID: <4D87FA36.5000809@ieee.org> Hello All, I have been working on gentran, and have some new files. They are not ready to check in, but I can send my changes out on request. The code now runs, but doesn't write to output files. Dan Stanger From toy.raymond at gmail.com Mon Mar 21 21:24:17 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 21 Mar 2011 22:24:17 -0400 Subject: [Maxima] Bug in plot2d/coerce-float-fun In-Reply-To: <1300754002.5852.3.camel@wigner> References: <1300754002.5852.3.camel@wigner> Message-ID: <4D880851.9060708@gmail.com> On 3/21/11 8:33 PM, Jaime Villate wrote: > Hi, > > (%i4) f(x):= sin(x)/x$ > (%i5) plot2d(f(x), [x,-8,8]); > plot2d: expression evaluates to non-numeric value somewhere in plotting > range. > (%o5) > (%i6) plot2d(f, [x,-8,8]); > expt: undefined: 0 to a negative exponent. > #0: f(x=0.0) > > %i5 shows the plot correctly but %i6 does not. > The expression sin(x)/x gives no problem for x=0, but when the function Nice. The problem is in coerce-maxima-function-or-maxima-lambda. It needs an (catch 'errorsw foo) like what is done in %coerce-float-fun. With this change, we don't get the error and the plot comes out the same. Ray From pip at iszf.irk.ru Mon Mar 21 23:00:29 2011 From: pip at iszf.irk.ru (Valery Pipin) Date: Mon, 21 Mar 2011 21:00:29 -0700 Subject: [Maxima] Gentran In-Reply-To: <4D87FA36.5000809@ieee.org> References: <4D87FA36.5000809@ieee.org> Message-ID: <4D881EDD.9010407@iszf.irk.ru> > Hello All, > I have been working on gentran, and have some new files. They are not > ready to check in, but I can send my changes out on request. > The code now runs, but doesn't write to output files. Does it have any output. The generated code is for finite-differences schemes, is'nt it? I'm interesting to see. Thanks! Valery From toy.raymond at gmail.com Tue Mar 22 08:09:18 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 22 Mar 2011 09:09:18 -0400 Subject: [Maxima] Bug in plot2d/coerce-float-fun References: <1300754002.5852.3.camel@wigner> <4D880851.9060708@gmail.com> Message-ID: >>>>> "Raymond" == Raymond Toy writes: Raymond> On 3/21/11 8:33 PM, Jaime Villate wrote: >> Hi, >> >> (%i4) f(x):= sin(x)/x$ (%i5) plot2d(f(x), [x,-8,8]); plot2d: >> expression evaluates to non-numeric value somewhere in plotting >> range. (%o5) (%i6) plot2d(f, [x,-8,8]); expt: undefined: 0 to >> a negative exponent. >> #0: f(x=0.0) >> >> %i5 shows the plot correctly but %i6 does not. >> The expression sin(x)/x gives no problem for x=0, but when the >> function Raymond> Nice. The problem is in Raymond> coerce-maxima-function-or-maxima-lambda. It needs an Raymond> (catch 'errorsw foo) like what is done in Raymond> %coerce-float-fun. With this change, we don't get the Raymond> error and the plot comes out the same. Here is a possible patch. Ray --- plot.lisp 07 Jan 2011 09:14:53 -0500 1.169 +++ plot.lisp 22 Mar 2011 09:07:58 -0400 @@ -708,11 +708,20 @@ (let* (($ratprint nil) ($numer t) (*nounsflag* t) - (result (maybe-realpart (mapply ',expr (list , at gensym-args) t)))) - ;; Just always try to convert the result to a float, which - ;; handles things like $%pi. See also BUG #2880115 - ;; http://sourceforge.net/tracker/?func=detail&atid=104933&aid=2880115&group_id=4933 - (,float-fun result))) + (errorsw t) + (errcatch t)) + (declare (special errcatch)) + ;; Just always try to convert the result to a float, + ;; which handles things like $%pi. See also BUG + ;; #2880115 + ;; http://sourceforge.net/tracker/?func=detail&atid=104933&aid=2880115&group_id=4933 + ;; + ;; Should we use HANDLER-CASE like we do above in + ;; %coerce-float-fun? Seems not necessary for what we want + ;; to do. + (catch 'errorsw + (,float-fun + (maybe-realpart (mapply ',expr (list , at gensym-args) t)))))) 'function))) ;; Same as above, but call APPLY instead of MAPPLY. From hbaker1 at pipeline.com Tue Mar 22 09:05:35 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Tue, 22 Mar 2011 07:05:35 -0700 Subject: [Maxima] Javascript front-end for Maxima In-Reply-To: <4D882D18.2090805@eecs.berkeley.edu> References: <4D882D18.2090805@eecs.berkeley.edu> Message-ID: Javascript (JS) is the programming language with arguably the largest number of programmers in the world. Maxima might as well take advantage of all the effort that tens of millions of people have put into this language. Javascript may be ugly (at least to a Lisp eye) to look at, but it uses widely understood C-style syntax, has an incredibly flexible run-time typing system, garbage collection, and *** full lambda closures *** (which weren't even part of MacLisp at the time much of Maxima was written; full closures are included in Common Lisp, however). Good news: JS assumes 64-bit IEEE double floats; bad news: no (standard) bignums, although there are several slow bignum libraries. But I'm not recommending Javascript to replace Lisp -- I'm recommending using Javascript/HTML5 to implement the front-end interface to the user. The Firefox web browser is fully supported on Linux & is free. I would suspect that nearly 100% of Linux users use Firefox as their preferred web browser. Firefox fully supports Javascript. http://www.mozilla.com/en-US/firefox/all.html Javascript is an international standard aka "ECMAScript": http://en.wikipedia.org/wiki/ECMAScript http://www.ecma-international.org/publications/standards/Ecma-262.htm To see Javascript in action on cool 2D math-related graphics, turn on Javascript in your browser & go to: http://jsxgraph.uni-bayreuth.de/wp/ I'm not the biggest fan of Microsoft, but Internet Explorer 9 w/HTML5 has some impressive capabilities, including a pretty darn good Just-In_Time (JIT) compiler for Javascript: http://ie.microsoft.com/testdrive/Benchmarks/SunSpider/Default.html http://ie.microsoft.com/testdrive/ I'm sure that Firefox will be catching up to IE9 in terms of performance as time goes on. HTML5 graphics will take advantage of the shaded graphics & RT animation capabilities of your hardware graphics cards (nVidia/ATI/AMD/etc.): http://en.wikipedia.org/wiki/Canvas_element http://blogs.msdn.com/b/tims/archive/2010/11/02/pdc10-introducing-html5-vector-graphics.aspx Once again, I think it would behoove the Maxima community to provide a Web (i.e., Javascript) front-end for Maxima. At 10:01 PM 3/21/2011, Richard Fateman wrote: >On 3/21/2011 1:44 PM, Henry Baker wrote: >>... > >>http://www.w3schools.com/js/ >> >>They aren't perfect, but they're pretty good, and they're Google searchable, which helps enormously. >> >>P.S., I would love to replace the existing Maxima front-end with a browser-based one, so that I could utilize some of the interactive javascript graphical tools -- e.g., JSXGraph. > >there seems to be a commitment on the part of some people to run on the lowest common denominator >of hardware, OS, and lisp implementation. I don't know how much support there is for javascript on >various linux systems; I have been thwarted in using foreign function interfaces in Maxima because >I don't care to bring up 4 different systems, and GCL seems to be lacking any realistic prospect >at all of a FFI. > >The wxmaxima front end is pretty good, I think, and seems to run on linux, windows, and Mac. > >the xmaxima front end is, in fact, a primitive browser with two windows, one window being maxima. > >RJF From fateman at eecs.berkeley.edu Tue Mar 22 09:27:51 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 22 Mar 2011 07:27:51 -0700 Subject: [Maxima] Javascript front-end for Maxima In-Reply-To: References: <4D882D18.2090805@eecs.berkeley.edu> Message-ID: <4D88B1E7.6060805@eecs.berkeley.edu> On 3/22/2011 7:05 AM, Henry Baker wrote: > Javascript (JS) is the programming language with arguably the largest number of programmers in the world. Maxima might as well take advantage of all the effort that tens of millions of people have put into this language. There is a program called jsmath ... see.. http://www.math.union.edu/~dpvc/jsMath/jsMath-lab.html which appears to do a superb job for display of 2-d math. Unknown to me if it satisfies two requirements for serious consideration: The display program must be able to do line-splitting for long lines [something that can in some cases be done by pre-formatting calculations prior to sending to the display] and it needs tools for selecting sub-expressions from the display. I don't know if jsmath supports this. The support for 2-D color plotting and other graphics seems to be well-developed and quite separate from equation display, and I'm not able to comment on that. I have used Javascript to access voice input of commands and math (using Windows .net stuff). Attaching this to Maxima would be fun. Not attaching it is fun too. (Some Lisps can access .net without javascript..) RJF > Javascript may be ugly (at least to a Lisp eye) to look at, but it uses widely understood C-style syntax, has an incredibly flexible run-time typing system, garbage collection, and *** full lambda closures *** (which weren't even part of MacLisp at the time much of Maxima was written; full closures are included in Common Lisp, however). Good news: JS assumes 64-bit IEEE double floats; bad news: no (standard) bignums, although there are several slow bignum libraries. But I'm not recommending Javascript to replace Lisp -- I'm recommending using Javascript/HTML5 to implement the front-end interface to the user. > > The Firefox web browser is fully supported on Linux& is free. I would suspect that nearly 100% of Linux users use Firefox as their preferred web browser. Firefox fully supports Javascript. > > http://www.mozilla.com/en-US/firefox/all.html > > Javascript is an international standard aka "ECMAScript": > > http://en.wikipedia.org/wiki/ECMAScript > > http://www.ecma-international.org/publications/standards/Ecma-262.htm > > To see Javascript in action on cool 2D math-related graphics, turn on Javascript in your browser& go to: > > http://jsxgraph.uni-bayreuth.de/wp/ > > I'm not the biggest fan of Microsoft, but Internet Explorer 9 w/HTML5 has some impressive capabilities, including a pretty darn good Just-In_Time (JIT) compiler for Javascript: > > http://ie.microsoft.com/testdrive/Benchmarks/SunSpider/Default.html > > http://ie.microsoft.com/testdrive/ > > I'm sure that Firefox will be catching up to IE9 in terms of performance as time goes on. > > HTML5 graphics will take advantage of the shaded graphics& RT animation capabilities of your hardware graphics cards (nVidia/ATI/AMD/etc.): > > http://en.wikipedia.org/wiki/Canvas_element > > http://blogs.msdn.com/b/tims/archive/2010/11/02/pdc10-introducing-html5-vector-graphics.aspx > > Once again, I think it would behoove the Maxima community to provide a Web (i.e., Javascript) front-end for Maxima. > > At 10:01 PM 3/21/2011, Richard Fateman wrote: >> On 3/21/2011 1:44 PM, Henry Baker wrote: >>> ... >>> http://www.w3schools.com/js/ >>> >>> They aren't perfect, but they're pretty good, and they're Google searchable, which helps enormously. >>> >>> P.S., I would love to replace the existing Maxima front-end with a browser-based one, so that I could utilize some of the interactive javascript graphical tools -- e.g., JSXGraph. >> there seems to be a commitment on the part of some people to run on the lowest common denominator >> of hardware, OS, and lisp implementation. I don't know how much support there is for javascript on >> various linux systems; I have been thwarted in using foreign function interfaces in Maxima because >> I don't care to bring up 4 different systems, and GCL seems to be lacking any realistic prospect >> at all of a FFI. >> >> The wxmaxima front end is pretty good, I think, and seems to run on linux, windows, and Mac. >> >> the xmaxima front end is, in fact, a primitive browser with two windows, one window being maxima. >> >> RJF From hbaker1 at pipeline.com Tue Mar 22 09:41:04 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Tue, 22 Mar 2011 07:41:04 -0700 Subject: [Maxima] Javascript front-end for Maxima In-Reply-To: <4D88B1E7.6060805@eecs.berkeley.edu> References: <4D882D18.2090805@eecs.berkeley.edu> <4D88B1E7.6060805@eecs.berkeley.edu> Message-ID: Oh, I see what you mean re "2D display": you mean actually displaying pretty (TeX-like) math! That would be very nice, eventually, but I'd be happy for a long time with current ASCII 2D display, so long as Javascript could talk to Maxima for doing more graphical animations, a la JSXGraph: http://jsxgraph.uni-bayreuth.de/wp/ "Pretty" math expression layout (i.e., nearly TeX-typeset appearance) as an option might be nice for demos & especially Powerpoint-type presentations, but might be too slow (currently) for everyday usage. However, with the increase in speed of Javascript & "pretty" layout stuff in HTML5, pretty math display on a consistent basis might become usable. At 07:27 AM 3/22/2011, Richard Fateman wrote: >On 3/22/2011 7:05 AM, Henry Baker wrote: >>Javascript (JS) is the programming language with arguably the largest number of programmers in the world. Maxima might as well take advantage of all the effort that tens of millions of people have put into this language. > >There is a program called jsmath ... see.. >http://www.math.union.edu/~dpvc/jsMath/jsMath-lab.html > >which appears to do a superb job for display of 2-d math. >Unknown to me if it satisfies two requirements for serious consideration: >The display program must be able to do line-splitting for long >lines [something that can in some cases be done by pre-formatting >calculations prior to sending to the display] and it needs tools for >selecting sub-expressions from the display. I don't know if jsmath >supports this. > >The support for 2-D color plotting and other graphics seems to be >well-developed and quite separate from equation display, and I'm >not able to comment on that. > >I have used Javascript to access voice input of commands and math >(using Windows .net stuff). Attaching this to Maxima would be fun. >Not attaching it is fun too. (Some Lisps can access .net without >javascript..) > >RJF > >>Javascript may be ugly (at least to a Lisp eye) to look at, but it uses widely understood C-style syntax, has an incredibly flexible run-time typing system, garbage collection, and *** full lambda closures *** (which weren't even part of MacLisp at the time much of Maxima was written; full closures are included in Common Lisp, however). Good news: JS assumes 64-bit IEEE double floats; bad news: no (standard) bignums, although there are several slow bignum libraries. But I'm not recommending Javascript to replace Lisp -- I'm recommending using Javascript/HTML5 to implement the front-end interface to the user. >> >>The Firefox web browser is fully supported on Linux& is free. I would suspect that nearly 100% of Linux users use Firefox as their preferred web browser. Firefox fully supports Javascript. >> >>http://www.mozilla.com/en-US/firefox/all.html >> >>Javascript is an international standard aka "ECMAScript": >> >>http://en.wikipedia.org/wiki/ECMAScript >> >>http://www.ecma-international.org/publications/standards/Ecma-262.htm >> >>To see Javascript in action on cool 2D math-related graphics, turn on Javascript in your browser& go to: >> >>http://jsxgraph.uni-bayreuth.de/wp/ >> >>I'm not the biggest fan of Microsoft, but Internet Explorer 9 w/HTML5 has some impressive capabilities, including a pretty darn good Just-In_Time (JIT) compiler for Javascript: >> >>http://ie.microsoft.com/testdrive/Benchmarks/SunSpider/Default.html >> >>http://ie.microsoft.com/testdrive/ >> >>I'm sure that Firefox will be catching up to IE9 in terms of performance as time goes on. >> >>HTML5 graphics will take advantage of the shaded graphics& RT animation capabilities of your hardware graphics cards (nVidia/ATI/AMD/etc.): >> >>http://en.wikipedia.org/wiki/Canvas_element >> >>http://blogs.msdn.com/b/tims/archive/2010/11/02/pdc10-introducing-html5-vector-graphics.aspx >> >>Once again, I think it would behoove the Maxima community to provide a Web (i.e., Javascript) front-end for Maxima. >> >>At 10:01 PM 3/21/2011, Richard Fateman wrote: >>>On 3/21/2011 1:44 PM, Henry Baker wrote: >>>>... >>>>http://www.w3schools.com/js/ >>>> >>>>They aren't perfect, but they're pretty good, and they're Google searchable, which helps enormously. >>>> >>>>P.S., I would love to replace the existing Maxima front-end with a browser-based one, so that I could utilize some of the interactive javascript graphical tools -- e.g., JSXGraph. >>>there seems to be a commitment on the part of some people to run on the lowest common denominator >>>of hardware, OS, and lisp implementation. I don't know how much support there is for javascript on >>>various linux systems; I have been thwarted in using foreign function interfaces in Maxima because >>>I don't care to bring up 4 different systems, and GCL seems to be lacking any realistic prospect >>>at all of a FFI. >>> >>>The wxmaxima front end is pretty good, I think, and seems to run on linux, windows, and Mac. >>> >>>the xmaxima front end is, in fact, a primitive browser with two windows, one window being maxima. >>> >>>RJF From toy.raymond at gmail.com Tue Mar 22 11:15:19 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 22 Mar 2011 12:15:19 -0400 Subject: [Maxima] implicit_plot gives an error In-Reply-To: <1300723288.1886.2.camel@wigner> References: <1300723288.1886.2.camel@wigner> Message-ID: <4D88CB17.4010705@gmail.com> On 3/21/11 12:01 PM, Jaime Villate wrote: > On Mon, 2011-03-21 at 14:25 +0100, Michael Kogan wrote: >> implicit_plot(1=integrate(1/sqrt(1+(1/z-1)*x >> +(z^2-1)*y),z,0,1),[x,-5,5],[y,-5,5]); >> >> Output >> >> Maxima encountered a Lisp error: > Hi, > the problem is not with implicit_plot, but with integrate which cannot > solve that integral. Even using one of the numerical methods in Maxima > that integral will fail, because in z=0 the term 1/z gives you an > overflow. Agree with the part about maxima not being able to do the symbolic integration. The integrand is the square root of a cubic, which leads to elliptic integrals, which maxima doesn't know how to do. However, the 1/z term is no problem. quad_qags easily evaluates the integral once values for x and y are substituted. I thought that perhaps changing the call to implicit plot to something like f(x,y):= quad_qags(,z,0,1)[1]; implicit_plot(f(x,y)-1,[x-5,5],[y,-5,5]) would work, but it doesn't. Ray From robert.dodier at gmail.com Tue Mar 22 11:39:06 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 22 Mar 2011 10:39:06 -0600 Subject: [Maxima] implicit_plot gives an error In-Reply-To: <4D88CB17.4010705@gmail.com> References: <1300723288.1886.2.camel@wigner> <4D88CB17.4010705@gmail.com> Message-ID: Ray's idea about quad_qags helps. I found the following adhockery useful to work around a bug in listofvars (which is called by plotting code to determine the free variables in the plotting expression). foo (x, y) := quag_qags (...) [1]; matchdeclare ([xx, yy], numberp); tellsimpafter (%foo (xx, yy), foo (xx, yy)); contour_plot (%foo (x, y), [x, ...], [y, ...]); which is just postponing any mention of quad_qags until the arguments are bound to numbers. Interested parties will probably need to experiment with the number of grid points and contour levels and other parameters. HTH Robert Dodier On 3/22/11, Raymond Toy wrote: > On 3/21/11 12:01 PM, Jaime Villate wrote: >> On Mon, 2011-03-21 at 14:25 +0100, Michael Kogan wrote: >>> implicit_plot(1=integrate(1/sqrt(1+(1/z-1)*x >>> +(z^2-1)*y),z,0,1),[x,-5,5],[y,-5,5]); >>> >>> Output >>> >>> Maxima encountered a Lisp error: >> Hi, >> the problem is not with implicit_plot, but with integrate which cannot >> solve that integral. Even using one of the numerical methods in Maxima >> that integral will fail, because in z=0 the term 1/z gives you an >> overflow. > Agree with the part about maxima not being able to do the symbolic > integration. The integrand is the square root of a cubic, which leads > to elliptic integrals, which maxima doesn't know how to do. > > However, the 1/z term is no problem. quad_qags easily evaluates the > integral once values for x and y are substituted. I thought that > perhaps changing the call to implicit plot to something like > > f(x,y):= quad_qags(,z,0,1)[1]; > > implicit_plot(f(x,y)-1,[x-5,5],[y,-5,5]) > > would work, but it doesn't. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From hbaker1 at pipeline.com Tue Mar 22 13:42:22 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Tue, 22 Mar 2011 11:42:22 -0700 Subject: [Maxima] abs & asinh Message-ID: assume(x>0); How come abs(sinh(x)) => sinh(x) but abs(asinh(x)) => abs(asinh(x)) SHOULD BE asinh(x) ??? asinh(x) is a perfectly good 1-1/onto real increasing odd function of x. From kcrisman at gmail.com Tue Mar 22 14:12:20 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Tue, 22 Mar 2011 15:12:20 -0400 Subject: [Maxima] Javascript front-end for Maxima Message-ID: Just as a data point, the Sage notebook (and similar projects like codenode) essentially are Web 2.0 AJAX things relying very heavily on JS. People love it. There are some people working with the UTMOST NSF grant to try to create something that would allow interactive behavior without even logging in as well. So in some sense there already IS such an interface for Maxima (use %maxima, or just pull down Maxima from the language choices). But more to the point, this is definitely possible, though one would need people who know a lot about those sort of web apps to do it. I already like Robert M.'s http://wood.mendelu.cz/math/maw-html/?lang=en a lot, turning this into something a little more JS-menu-y sounds quite possible. You may also want to look at how Maple does its 'Clickable Calculus' - I mean concept, obviously not code, and that is Java, if I recall correctly. Also, jsmath is being superseded by MathJax - same developers, but better long-term infrastructure and support. MathSciNet already uses MathJax. Sage doesn't yet, but will eventually; the license is GPL-compatible. Karl-Dieter From michael.kogan at gmx.net Wed Mar 23 06:57:24 2011 From: michael.kogan at gmx.net (michael.kogan at gmx.net) Date: Wed, 23 Mar 2011 12:57:24 +0100 Subject: [Maxima] implicit_plot gives an error In-Reply-To: References: <1300723288.1886.2.camel@wigner> <4D88CB17.4010705@gmail.com> Message-ID: <20110323125724.00d6ebd0@photon-desktop> Ray, Robert, thanks for your suggestions! Unfortunaly I'm quite new to Maxima and currently I'm able to use it as a kind of a big calculator and plotter only. I've tried to find out how your code works, but didn't make much progress in this. As I see "quad_qags" is some kind of alternative to "integrate" with different integration mechanisms and a bit different output. But what is the [1] after it? "matchdeclare" seems to ensure that xx and yy are numbers and not variables and "tellsimpafter" seems to make some simplification rule but I don't understand how it works since the rule is just foo itself. contour_plot seems to plot the simplified integral. I suppose that I should replace something to make it work since it doesn't work by copy&pasting: foo (x, y) := quag_qags (1/sqrt(1+(1/z-1)*x+(z^2-1)*y),z,0,1) [1]; ## foo(x,y):=(quag_qags(1/sqrt(1+(1/z-1)*x+(z^2-1)*y),z,0,1))[1] matchdeclare ([xx, yy], numberp); ## done tellsimpafter (%foo (xx, yy), foo (xx, yy)); ## [%foorule1,false] contour_plot (%foo (x, y), [x, -5, 5], [y, -5, 5]); ## false But unfortunately I don't know what to replace... Could you explain how it is supposed to work or show a working example, please? Thanks, Michael On Tue, 22 Mar 2011 10:39:06 -0600 Robert Dodier schrieb: > Ray's idea about quad_qags helps. > I found the following adhockery useful to work around > a bug in listofvars (which is called by plotting code to > determine the free variables in the plotting expression). > > foo (x, y) := quag_qags (...) [1]; > matchdeclare ([xx, yy], numberp); > tellsimpafter (%foo (xx, yy), foo (xx, yy)); > contour_plot (%foo (x, y), [x, ...], [y, ...]); > > which is just postponing any mention of quad_qags until > the arguments are bound to numbers. > > Interested parties will probably need to experiment with > the number of grid points and contour levels and other parameters. > > HTH > > Robert Dodier > > On 3/22/11, Raymond Toy wrote: > > On 3/21/11 12:01 PM, Jaime Villate wrote: > >> On Mon, 2011-03-21 at 14:25 +0100, Michael Kogan wrote: > >>> implicit_plot(1=integrate(1/sqrt(1+(1/z-1)*x > >>> +(z^2-1)*y),z,0,1),[x,-5,5],[y,-5,5]); > >>> > >>> Output > >>> > >>> Maxima encountered a Lisp error: > >> Hi, > >> the problem is not with implicit_plot, but with integrate which > >> cannot solve that integral. Even using one of the numerical > >> methods in Maxima that integral will fail, because in z=0 the term > >> 1/z gives you an overflow. > > Agree with the part about maxima not being able to do the symbolic > > integration. The integrand is the square root of a cubic, which > > leads to elliptic integrals, which maxima doesn't know how to do. > > > > However, the 1/z term is no problem. quad_qags easily evaluates the > > integral once values for x and y are substituted. I thought that > > perhaps changing the call to implicit plot to something like > > > > f(x,y):= quad_qags(,z,0,1)[1]; > > > > implicit_plot(f(x,y)-1,[x-5,5],[y,-5,5]) > > > > would work, but it doesn't. > > > > 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 From eb at civil.aau.dk Wed Mar 23 08:42:39 2011 From: eb at civil.aau.dk (Esben Byskov) Date: Wed, 23 Mar 2011 14:42:39 +0100 Subject: [Maxima] A very small error in float? In-Reply-To: <20110323125724.00d6ebd0@photon-desktop> References: <1300723288.1886.2.camel@wigner> <4D88CB17.4010705@gmail.com> <20110323125724.00d6ebd0@photon-desktop> Message-ID: <4D89F8CF.3080003@civil.aau.dk> *Hi maxima list, The outcome of the session below is somewhat disturbing, I think. Maybe there is a valid explanation. * Maxima 5.23.2 http://maxima.sourceforge.net using Lisp CLISP 2.44.1 (2008-02-23) 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) r: 735/25; 147 (%o1) --- 5 (%i2) float(r); (%o2) 29.4 (%i3) fr: factor(r); 2 3 7 (%o3) ---- 5 (%i4) ffr: float(fr); (%o4) 29.40000000000001 *Best regards, Esben Byskov * Esben Byskov, Ph.D., Dr.Techn. Professor Emeritus of Structural Analysis Department of Civil Engineering Aalborg University Sohngaardsholmsvej 57 DK-9000 Aalborg Denmark Phone: +45 3963 7328 e-mail: eb at civil.aau.dk -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Wed Mar 23 09:30:01 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 23 Mar 2011 10:30:01 -0400 Subject: [Maxima] A very small error in float? In-Reply-To: <4D89F8CF.3080003@civil.aau.dk> References: <1300723288.1886.2.camel@wigner> <4D88CB17.4010705@gmail.com> <20110323125724.00d6ebd0@photon-desktop> <4D89F8CF.3080003@civil.aau.dk> Message-ID: <4D8A03E9.6070401@gmail.com> On 3/23/11 9:42 AM, Esben Byskov wrote: > *Hi maxima list, > > The outcome of the session below is somewhat disturbing, > I think. Maybe there is a valid explanation. > * > Maxima 5.23.2 http://maxima.sourceforge.net > using Lisp CLISP 2.44.1 (2008-02-23) > 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) r: 735/25; > 147 > (%o1) --- > 5 > (%i2) float(r); > (%o2) 29.4 > (%i3) fr: factor(r); > 2 > 3 7 > (%o3) ---- > 5 > (%i4) ffr: float(fr); > (%o4) 29.40000000000001 I think this is because float(fr) computes the result in pieces. So float(fr) is computed as float(1/5)*float(3)*float(7^2), which does, in fact, return the result in %o4. How did I choose this decomposition? I looked at how maxima expressed %o3 by using :lisp $%o3 and saw that it represented it as, essentially (1/5)*3*(7^2). Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Wed Mar 23 09:36:15 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 23 Mar 2011 10:36:15 -0400 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: <4D52BED1.2040506@eecs.berkeley.edu> References: <4D52BED1.2040506@eecs.berkeley.edu> Message-ID: <4D8A055F.607@gmail.com> On 2/9/11 11:20 AM, Richard Fateman wrote: > I think the proper solution is to set *print-circle* to nil, but > *print-level* to some modest number, like 5 or even 10. I want to see this get into the upcoming release. So in summary, we want *print-circle* be NIL again. And we want *print-level* to be set. Shall we say 10? Should we leave *print-length* alone? (In some of my debugging, *print-level* of 10 is too small; I sometimes make it 20 or even 50, because the part I want to see is nested pretty deeply. But it's ok if the default is 10.) Ray From macrakis at alum.mit.edu Wed Mar 23 09:46:37 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 23 Mar 2011 10:46:37 -0400 Subject: [Maxima] A very small error in float? In-Reply-To: <4D89F8CF.3080003@civil.aau.dk> References: <1300723288.1886.2.camel@wigner> <4D88CB17.4010705@gmail.com> <20110323125724.00d6ebd0@photon-desktop> <4D89F8CF.3080003@civil.aau.dk> Message-ID: The explanation is that floating-point arithmetic is not associative in general. This is a property of floating-point arithmetic, not a property of Maxima. When you factor a number, you reorganize its calculation. For example, factor(3/5) is represented as (1/5)*3 instead of 3/5, just as factor(10/21) is represented as (1/3)*(1/7)*2*5. And float(1/5)*float(3) - float(3/5) => -1e-16. I suppose it could equally well represent factor(10/21) as (2*5)/(3*7) (mquotient internally), but for most applications it doesn't matter. And in any case you will still run into the non-associativity problem, even for integers: float(23^12*37^30) - float(factor(23^12*37^30)) => 3.7e47 to see that it's not *factor* that's the problem: float(23^12*37^30) - float(23^12)*float(37^30) => 3.7e47 -s On Wed, Mar 23, 2011 at 09:42, Esben Byskov wrote: > *Hi maxima list, > > The outcome of the session below is somewhat disturbing, > I think. Maybe there is a valid explanation. > * > Maxima 5.23.2 http://maxima.sourceforge.net > using Lisp CLISP 2.44.1 (2008-02-23) > 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) r: 735/25; > 147 > (%o1) --- > 5 > (%i2) float(r); > (%o2) 29.4 > (%i3) fr: factor(r); > 2 > 3 7 > (%o3) ---- > 5 > (%i4) ffr: float(fr); > (%o4) 29.40000000000001 > > *Best regards, > > Esben Byskov > * > > Esben Byskov, Ph.D., Dr.Techn. > Professor Emeritus of Structural Analysis > Department of Civil Engineering > Aalborg University > Sohngaardsholmsvej 57 > DK-9000 Aalborg > Denmark > > Phone: +45 3963 7328 > e-mail: eb at civil.aau.dk > > > _______________________________________________ > 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 Mar 23 09:49:15 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 23 Mar 2011 07:49:15 -0700 Subject: [Maxima] A very small error in float? In-Reply-To: <4D89F8CF.3080003@civil.aau.dk> References: <1300723288.1886.2.camel@wigner> <4D88CB17.4010705@gmail.com> <20110323125724.00d6ebd0@photon-desktop> <4D89F8CF.3080003@civil.aau.dk> Message-ID: <4D8A086B.7080805@eecs.berkeley.edu> On 3/23/2011 6:42 AM, Esben Byskov wrote: (objecting to round-off in 29.40000000000001) Note that 1/10 cannot be represented exactly in a finite binary expansion. If we carry more digits and convert 0.1 as a single-precision float into decimal, it look like approximately .1000000000000000055511151231257827021182.... (and 1/5, which is twice that, also cannot be represented exactly) You may argue that the display should have rounded the number so that 29.400000000...1 comes up 29.4, but then, how did you know that the intended answer wasn't 29.40000...1? You could get that same number by adding 294/10 + 1/10....0, in which case you might object (correctly) that Maxima was displaying the result accurately. There is another way around this, sometimes used, which is to do all arithmetic in decimal. But some numbers cannot be represented exactly in a finite decimal expansion. Like 1/3. So the improvement is an illusion. * ** * -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed Mar 23 09:50:23 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 23 Mar 2011 10:50:23 -0400 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: <4D8A055F.607@gmail.com> References: <4D52BED1.2040506@eecs.berkeley.edu> <4D8A055F.607@gmail.com> Message-ID: I would recommend setting *print-length* and *print-level* pretty high. After all, the point here is simply to avoid infinite output, not to make it more readable. Real algebraic expressions easily hit even those limits. Say 100 and 20? -s On Wed, Mar 23, 2011 at 10:36, Raymond Toy wrote: > On 2/9/11 11:20 AM, Richard Fateman wrote: > > I think the proper solution is to set *print-circle* to nil, but > > *print-level* to some modest number, like 5 or even 10. > I want to see this get into the upcoming release. > > So in summary, we want *print-circle* be NIL again. And we want > *print-level* to be set. Shall we say 10? Should we leave > *print-length* alone? > > (In some of my debugging, *print-level* of 10 is too small; I sometimes > make it 20 or even 50, because the part I want to see is nested pretty > deeply. But it's ok if the default is 10.) > > 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 robert.dodier at gmail.com Wed Mar 23 10:01:47 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 23 Mar 2011 09:01:47 -0600 Subject: [Maxima] implicit_plot gives an error In-Reply-To: <20110323125724.00d6ebd0@photon-desktop> References: <1300723288.1886.2.camel@wigner> <4D88CB17.4010705@gmail.com> <20110323125724.00d6ebd0@photon-desktop> Message-ID: On 3/23/11, michael.kogan at gmx.net wrote: > foo (x, y) := quag_qags (1/sqrt(1+(1/z-1)*x+(z^2-1)*y),z,0,1) [1]; I think you want quad_qags here, not quag_qags. best Robert Dodier From toy.raymond at gmail.com Wed Mar 23 10:08:04 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 23 Mar 2011 11:08:04 -0400 Subject: [Maxima] implicit_plot gives an error In-Reply-To: <20110323125724.00d6ebd0@photon-desktop> References: <1300723288.1886.2.camel@wigner> <4D88CB17.4010705@gmail.com> <20110323125724.00d6ebd0@photon-desktop> Message-ID: <4D8A0CD4.9040600@gmail.com> On 3/23/11 7:57 AM, michael.kogan at gmx.net wrote: > Ray, Robert, thanks for your suggestions! > > Unfortunaly I'm quite new to Maxima and currently I'm able to use it as > a kind of a big calculator and plotter only. I've tried to find out how > your code works, but didn't make much progress in this. > > As I see "quad_qags" is some kind of alternative to "integrate" with > different integration mechanisms and a bit different output. But what > is the [1] after it? quad_qags returns a list, and the first element of the list is the estimated value of the integral. "? quad_qags" will give you more information. Ray From willisb at unk.edu Wed Mar 23 10:11:55 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 23 Mar 2011 10:11:55 -0500 Subject: [Maxima] A very small error in float? In-Reply-To: <4D8A086B.7080805@eecs.berkeley.edu> References: <1300723288.1886.2.camel@wigner> <4D88CB17.4010705@gmail.com> <20110323125724.00d6ebd0@photon-desktop> <4D89F8CF.3080003@civil.aau.dk>, <4D8A086B.7080805@eecs.berkeley.edu> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- ? >????On?3/23/2011?6:42?AM,?Esben?Byskov?wrote: >????(objecting?to?round-off?in?29.40000000000001) One more thing: The function rationalize converts a floating point number to its exact rational value; for example (%i1) rationalize(29.4); (%o1) 4137682157646643/140737488355328 Thus the binary64 number 29.4 does not equal 735/25: (%i3) is(equal(735/25, rationalize(29.4))); (%o3) false Finally, the binary64 number 10.0 does equal 10: (%i6) is(equal(10, rationalize(10.0))); (%o6) true --Barton From robert.dodier at gmail.com Wed Mar 23 10:25:29 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 23 Mar 2011 09:25:29 -0600 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: <4D869FD6.2020800@eecs.berkeley.edu> References: <4D869FD6.2020800@eecs.berkeley.edu> Message-ID: On 3/20/11, Richard Fateman wrote: > I also have periodically suggested that an alphabetized listing of error > messages and what they mean would be a service. I dunno. I'm not convinced it's worth the trouble. "What it means" isn't well-defined in general. There are practical problems too. Every time a message is created, modified, or removed, the list has to be updated. And I suppose all translations of it as well. Seems like a tremendous bother with no great benefit. best Robert Dodier From toy.raymond at gmail.com Wed Mar 23 10:30:54 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 23 Mar 2011 11:30:54 -0400 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: <4D869FD6.2020800@eecs.berkeley.edu> Message-ID: <4D8A122E.6000103@gmail.com> On 3/23/11 11:25 AM, Robert Dodier wrote: > On 3/20/11, Richard Fateman wrote: > >> I also have periodically suggested that an alphabetized listing of error >> messages and what they mean would be a service. > I dunno. I'm not convinced it's worth the trouble. > "What it means" isn't well-defined in general. > > There are practical problems too. Every time a message > is created, modified, or removed, the list has to be updated. > And I suppose all translations of it as well. I agree. But, if the error message itself is not clear, then it is definitely worth the effort to fix the message to make it clearer. Ray From robert.dodier at gmail.com Wed Mar 23 10:35:27 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 23 Mar 2011 09:35:27 -0600 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: Message-ID: On 3/20/11, Sol Lederman wrote: >> I would like to see an entry on every single constant, variable and >> function that Maxima knows anything about, >> showing exactly what Maxima knows about it. > > How would one go about finding that information? There isn't really any way to do it except by deriving it from the source code: for every user-visible function, scan the code to see which user-visible special (i.e., global) variables are referenced. That much could be automated. Determining the effect of each special variable can only accomplished by reading the code. The good news is that Lisp isn't all that complicated a programming language. Code = data and everything is an expression (more or less). HTH, & thanks for your interest. Robert Dodier From robert.dodier at gmail.com Wed Mar 23 10:42:07 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 23 Mar 2011 09:42:07 -0600 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: Message-ID: On 3/21/11, Stavros Macrakis wrote: > Today, each section (e.g. polynomials) is organized alphabetically by > function. That is fine if you know what function you want, but very hard to > use if you're trying to get something accomplished and don't know how. Well, about organization, the HTML version of the manual has each item tagged by keywords, so that all of the items with a certain tag (e.g. Expressions) can be easily located. I don't know how to implement that idea in the describe system within Maxima. best Robert Dodier From fateman at eecs.berkeley.edu Wed Mar 23 10:44:22 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 23 Mar 2011 08:44:22 -0700 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: <4D869FD6.2020800@eecs.berkeley.edu> Message-ID: <4D8A1556.6010900@eecs.berkeley.edu> On 3/23/2011 8:25 AM, Robert Dodier wrote: > On 3/20/11, Richard Fateman wrote: > >> I also have periodically suggested that an alphabetized listing of error >> messages and what they mean would be a service. > I dunno. I'm not convinced it's worth the trouble. A first pass could be largely automated. Assuming all error/warning/ messages sent to the user console goes through one or two standard procedures, use a program like grep to find them all. You can then produce a listing > "What it means" isn't well-defined in general. True. But we could probably start to divide them up into categories like > There are practical problems too. Every time a message > is created, modified, or removed, the list has to be updated. I thought you had all this under control for the help (etc) system. :) > And I suppose all translations of it as well. ditto:) > Seems like a tremendous bother with no great benefit. 1. The obvious benefit is for the person who gets an error message and doesn't understand it, but would understand a slightly more detailed explanation. 2. The less obvious benefit for the person writing new code who calls the procedure to report an error -- the programmer would be encouraged by example (or constrained!) by the reporting process to (for example) start the error message with a fixed string so that it could be alphabetized. (What I mean is that an error message "x^2+y was divided by zero" cannot be found in an alphabetized list, whereas Division by zero: x^2+y / 0 in <....>. A constraint might be even better, where the error-message reporting insisted on a fixed error name and number, then followed by arbitrary stuff. 3. It might prompt examination of the reporting mechanism to maybe make better use of handler-case etc. One could, for example, try to locate errors in user code instead of lisp code (meval, simplifier, ...) > best > > Robert Dodier From fateman at eecs.berkeley.edu Wed Mar 23 10:53:20 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 23 Mar 2011 08:53:20 -0700 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: Message-ID: <4D8A1770.90206@eecs.berkeley.edu> On 3/23/2011 8:35 AM, Robert Dodier wrote: > > There isn't really any way to do it except by deriving it from > the source code: for every user-visible function, > scan the code to see which user-visible special (i.e., global) > variables are referenced. That much could be automated. It is called a cross-reference, and has been a standard feature of some lisp systems for many years. (50?) For example, Allegro describes this.. http://www.franz.com/support/documentation/6.0/doc/cross-reference.htm it appears that CMU CL (and SBCL) have cross reference programs, but I was unable to find detailed instructions on how to use them in a brief Google search. RJF From smh at franz.com Wed Mar 23 10:59:16 2011 From: smh at franz.com (Steve Haflich) Date: Wed, 23 Mar 2011 08:59:16 -0700 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: References: <4D52BED1.2040506@eecs.berkeley.edu> <4D8A055F.607@gmail.com> Message-ID: <30023.1300895956@gemini.franz.com> Stavros Macrakis wrote: I would recommend setting *print-length* and *print-level* pretty high. ?After all, the point here is simply to avoid infinite output, not to make it more readable. ?Real algebraic expressions easily hit even those limits. Say 100 and 20? You might be suprised. Try this experiment: (let ((*print-length* 10) (*print-level* 10) (*print-pretty* nil)) (write '#1=(#1# . #1#)) (values)) Let me know what you think after it finishes printing. If you care to repeat the experiment with values 100 and 20, perhaps your grandchildren would be willing someday to report the result back to the Maxima list, which I'm sure will still be in business. :-) cl-user(24): (loop for lim from 1 to 8 do (format t "~d: ~10:d~%" lim (length (with-output-to-string (s) (let ((*print-length* lim) (*print-level* lim) (*print-circle* nil) (*print-pretty* nil)) (write '#1=(#1# . #1#) :stream s)))))) 1: 7 2: 25 3: 131 4: 1,021 5: 10,935 6: 149,297 7: 2,470,627 8: 47,934,901 Now, this experiment exploits an unlikely pathological case, but it shows that sometimes there is not a big difference between "infinite" and "large". From macrakis at alum.mit.edu Wed Mar 23 11:26:05 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 23 Mar 2011 12:26:05 -0400 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: <30023.1300895956@gemini.franz.com> References: <4D52BED1.2040506@eecs.berkeley.edu> <4D8A055F.607@gmail.com> <30023.1300895956@gemini.franz.com> Message-ID: Of course it is possible to create bad cases. But in realistic Maxima use, the only commonly-encountered circular list structure is the 'assume' database (data property). A little experimentation shows that *print-level* = 14 gives a fairly reasonable (though somewhat redundant) display, and *print-length* = 100 is fine. What other circular list structures are users like to encounter? -s On Wed, Mar 23, 2011 at 11:59, Steve Haflich wrote: > Stavros Macrakis wrote: > > I would recommend setting *print-length* and *print-level* pretty > high. After all, the point here is simply to avoid infinite output, > not to make it more readable. Real algebraic expressions easily hit > even those limits. > > Say 100 and 20? > > You might be suprised. Try this experiment: > > (let ((*print-length* 10) > (*print-level* 10) > (*print-pretty* nil)) > (write '#1=(#1# . #1#)) > (values)) > > Let me know what you think after it finishes printing. If you care to > repeat the experiment with values 100 and 20, perhaps your grandchildren > would be willing someday to report the result back to the Maxima list, > which I'm sure will still be in business. :-) > > cl-user(24): (loop for lim from 1 to 8 > do (format t "~d: ~10:d~%" > lim > (length > (with-output-to-string (s) > (let ((*print-length* lim) > (*print-level* lim) > (*print-circle* nil) > (*print-pretty* nil)) > (write '#1=(#1# . #1#) :stream s)))))) > 1: 7 > 2: 25 > 3: 131 > 4: 1,021 > 5: 10,935 > 6: 149,297 > 7: 2,470,627 > 8: 47,934,901 > > Now, this experiment exploits an unlikely pathological case, but it > shows that sometimes there is not a big difference between "infinite" > and "large". > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.kogan at gmx.net Wed Mar 23 12:18:25 2011 From: michael.kogan at gmx.net (Michael Kogan) Date: Wed, 23 Mar 2011 18:18:25 +0100 Subject: [Maxima] implicit_plot gives an error In-Reply-To: <4D8A0CD4.9040600@gmail.com> References: <1300723288.1886.2.camel@wigner> <4D88CB17.4010705@gmail.com> <20110323125724.00d6ebd0@photon-desktop> <4D8A0CD4.9040600@gmail.com> Message-ID: Thanks, I already wondered how to get the integral out of the quad_qags output but didn't realize how to get a particular element of a list. It seems like the problem is some kind of a bug though: The output is always the same but sometimes the gnuplot window containing the plot appears while sometimes (in by far most of the cases) it doesn't. However, on an other machine it appears every time, so it is working so far now. The plots look a bit strange though: http://dl.dropbox.com/u/13402100/screenshot_01.png Beginning with the black line the plots are non-continuous (the violet one is even a single point) and they have a strange break on the left side. Since I still don't fully understand what the particular commands do, I've no clue whether anything can be done to solve these problems... Maybe the "resolution" (some kind of iteration number during the integration) can be increased somehow to make the graphs smoother? Big thanks, Michael 2011/3/23 Raymond Toy : > On 3/23/11 7:57 AM, michael.kogan at gmx.net wrote: >> Ray, Robert, thanks for your suggestions! >> >> Unfortunaly I'm quite new to Maxima and currently I'm able to use it as >> a kind of a big calculator and plotter only. I've tried to find out how >> your code works, but didn't make much progress in this. >> >> As I see "quad_qags" is some kind of alternative to "integrate" with >> different integration mechanisms and a bit different output. But what >> is the [1] after it? > quad_qags returns a list, and the first element of the list is the > estimated value of the integral. ?"? quad_qags" will give you more > information. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From hbaker1 at pipeline.com Wed Mar 23 12:19:32 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Wed, 23 Mar 2011 10:19:32 -0700 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: <4D8A1770.90206@eecs.berkeley.edu> References: <4D8A1770.90206@eecs.berkeley.edu> Message-ID: How about at least making it easy to pull up the source code for a particular function to examine? This was a very nice feature of the Lisp Machine, which I don't think has made it into the twenty-first century. Xmaxima or wxmaxima should be able to find (or be told) where the maxima sources are located in your file system, and then be able to pull up the source code for any function in the system. Modern systems are neither address-space-constrained, nor file-system-space-constrained, so this capability should be a slam-dunk. From fateman at eecs.berkeley.edu Wed Mar 23 12:51:38 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 23 Mar 2011 10:51:38 -0700 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: <4D8A1770.90206@eecs.berkeley.edu> Message-ID: <4D8A332A.4030806@eecs.berkeley.edu> On 3/23/2011 10:19 AM, Henry Baker wrote: > How about at least making it easy to pull up the source code for a particular function to examine? This was a very nice feature of the Lisp Machine, which I don't think has made it into the twenty-first century. > > Xmaxima or wxmaxima should be able to find (or be told) where the maxima sources are located in your file system, and then be able to pull up the source code for any function in the system. Writing in Lisp (or C), I would expect emacs to do this for me via a tags file created by the etags program. Presumably a lisp program in Maxima could also use a tags file, if it were told its location. Creating a tags file for Maxima source should require very little effort. I assume there is a way of defining a template for Maxima definitions that could index code in the "share" or other directories. > Modern systems are neither address-space-constrained, nor file-system-space-constrained, so this capability should be a slam-dunk. > Certainly for many values of "modern". RJF From villate at fe.up.pt Wed Mar 23 13:12:22 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 23 Mar 2011 18:12:22 +0000 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: References: <4D8A1770.90206@eecs.berkeley.edu> Message-ID: <1300903942.5581.9.camel@wigner> On Wed, 2011-03-23 at 10:19 -0700, Henry Baker wrote: > How about at least making it easy to pull up the source code for a > particular function to examine? This was a very nice feature of the > Lisp Machine, which I don't think has made it into the twenty-first > century. > > Xmaxima or wxmaxima should be able to find (or be told) where the > maxima sources are located in your file system, and then be able to > pull up the source code for any function in the system. In fact, that should not be very difficult in Xmaxima. These days that I've been doing a drastic face-lift to it I might explore that. A good place to start would be the list of Maxima operators in: /share/builtins-list.txt which is currently used in rmaxima for doing command name completion. It is not complete, but could be updated. Another feature that seems to have become out of fashion among developers is example() / demo(). It would be nice to recover it. Cheers, Jaime From toy.raymond at gmail.com Wed Mar 23 13:14:27 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 23 Mar 2011 14:14:27 -0400 Subject: [Maxima] Seeking areas of little or weak documentation In-Reply-To: <4D8A1770.90206@eecs.berkeley.edu> References: <4D8A1770.90206@eecs.berkeley.edu> Message-ID: <4D8A3883.1070702@gmail.com> On 3/23/11 11:53 AM, Richard Fateman wrote: > On 3/23/2011 8:35 AM, Robert Dodier wrote: >> >> There isn't really any way to do it except by deriving it from >> the source code: for every user-visible function, >> scan the code to see which user-visible special (i.e., global) >> variables are referenced. That much could be automated. > It is called a cross-reference, and has been a standard feature of > some lisp systems for many years. (50?) For example, Allegro describes > this.. > > http://www.franz.com/support/documentation/6.0/doc/cross-reference.htm > > it appears that CMU CL (and SBCL) have cross reference programs, but > I was unable to find detailed instructions on how to use them in a brief > Google search. Google search for "cmucl xref" provides this link: http://common-lisp.net/project/cmucl/doc/cmu-user/cross-referencing.html A long time ago, some did turn on cmucl's xref facility and built maxima with it. It took a long time and the result was huge. I vaguely remember he produced a few graphs of some call trees, but they were a huge mess. Ray From dlakelan at street-artists.org Wed Mar 23 13:23:29 2011 From: dlakelan at street-artists.org (dlakelan) Date: Wed, 23 Mar 2011 11:23:29 -0700 Subject: [Maxima] A very small error in float? In-Reply-To: <4D8A086B.7080805@eecs.berkeley.edu> References: <1300723288.1886.2.camel@wigner> <4D88CB17.4010705@gmail.com> <20110323125724.00d6ebd0@photon-desktop> <4D89F8CF.3080003@civil.aau.dk> <4D8A086B.7080805@eecs.berkeley.edu> Message-ID: <4D8A3AA1.3070503@street-artists.org> On 03/23/2011 07:49 AM, Richard Fateman wrote: > On 3/23/2011 6:42 AM, Esben Byskov wrote: > > (objecting to round-off in 29.40000000000001) > > Note that 1/10 cannot be represented exactly in a finite binary expansion. I am always surprised by how often this floating point roundoff stuff comes up. Isn't this like the first chapter in every numerical analysis or scientific programming textbook? I would think most people interested in Maxima would be familiar with it. Even though I know that it's possible to get more precision in IEEE double floating point, I always assume that floating point numbers are off in the 12th decimal place just in principle (in reality it's usually the 14th or 15th for a single operation). Since my input values to any floating point calculation are rarely accurate to more than 3 or 5 decimal places, I generally use fpprintprec to limit the displayed precision. often the start of my maxima scripts looks like; kill(all); reset(); fpprintprec:5; I'm glad that people on the list look carefully at the floating point evaluation of various functions and try to get full precision internally, but when I do Newton's method I often set newtonepsilon:1e-5; For the sort of thing I do it's rarely necessary to get more precision than this (especially since the quadratic convergence of newton's method usually means that if you converge, after this threshold is exceeded you usually have about 10 decimal places of accuracy) floating point is all about trading off speed and accuracy in a reasonable way. From eb at civil.aau.dk Wed Mar 23 14:21:23 2011 From: eb at civil.aau.dk (Esben Byskov) Date: Wed, 23 Mar 2011 20:21:23 +0100 Subject: [Maxima] A very small error in float? In-Reply-To: <4D8A3AA1.3070503@street-artists.org> References: <1300723288.1886.2.camel@wigner> <4D88CB17.4010705@gmail.com> <20110323125724.00d6ebd0@photon-desktop> <4D89F8CF.3080003@civil.aau.dk> <4D8A086B.7080805@eecs.berkeley.edu> <4D8A3AA1.3070503@street-artists.org> Message-ID: <4D8A4833.8000904@civil.aau.dk> *To the list, Many thanks to the people who took the time to explain the reason(s) for the result regarding float. Of course, I did know about the different ways to represent a number, so the comment about reorganization due to factoring cleared up things. Regards, Esben Byskov * Esben Byskov, Ph.D., Dr.Techn. Professor Emeritus of Structural Analysis Department of Civil Engineering Aalborg University Sohngaardsholmsvej 57 DK-9000 Aalborg Denmark Phone: +45 3963 7328 e-mail: eb at civil.aau.dk -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Wed Mar 23 15:56:26 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 23 Mar 2011 16:56:26 -0400 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. In-Reply-To: References: <4D52BED1.2040506@eecs.berkeley.edu> <4D8A055F.607@gmail.com> <30023.1300895956@gemini.franz.com> Message-ID: <4D8A5E7A.40008@gmail.com> On 3/23/11 12:26 PM, Stavros Macrakis wrote: > Of course it is possible to create bad cases. But in realistic Maxima > use, the only commonly-encountered circular list structure is the > 'assume' database (data property). > > A little experimentation shows that *print-level* = 14 gives a fairly > reasonable (though somewhat redundant) display, and *print-length* = > 100 is fine. > Ok, let's say 100 and 15, as reasonable values for *print-length* and *print-level*. Ray From scratchboom at gmail.com Wed Mar 23 12:57:11 2011 From: scratchboom at gmail.com (Andrew A) Date: Wed, 23 Mar 2011 20:57:11 +0300 Subject: [Maxima] Is it possible to set zero-based indexing in maxima? Message-ID: Default one-based indexing is not?suitable for me =( From toy.raymond at gmail.com Thu Mar 24 06:57:55 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 24 Mar 2011 07:57:55 -0400 Subject: [Maxima] Bug in plot2d/coerce-float-fun In-Reply-To: (Raymond Toy's message of "Tue, 22 Mar 2011 09:09:18 -0400") References: <1300754002.5852.3.camel@wigner> <4D880851.9060708@gmail.com> Message-ID: >>>>> "Raymond" == Raymond Toy writes: >>>>> "Raymond" == Raymond Toy writes: Raymond> On 3/21/11 8:33 PM, Jaime Villate wrote: >>> Hi, >>> >>> (%i4) f(x):= sin(x)/x$ (%i5) plot2d(f(x), [x,-8,8]); plot2d: >>> expression evaluates to non-numeric value somewhere in >>> plotting range. (%o5) (%i6) plot2d(f, [x,-8,8]); expt: >>> undefined: 0 to a negative exponent. >>> #0: f(x=0.0) >>> >>> %i5 shows the plot correctly but %i6 does not. >>> The expression sin(x)/x gives no problem for x=0, but when the >>> function Raymond> Nice. The problem is in Raymond> coerce-maxima-function-or-maxima-lambda. It needs an Raymond> (catch 'errorsw foo) like what is done in Raymond> %coerce-float-fun. With this change, we don't get the Raymond> error and the plot comes out the same. Raymond> Here is a possible patch. Patch applied. Ray From toy.raymond at gmail.com Fri Mar 25 08:48:42 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 25 Mar 2011 09:48:42 -0400 Subject: [Maxima] Why is *print-circle* set to T by default? WAS: grinding, etc. References: <4D52BED1.2040506@eecs.berkeley.edu> <4D8A055F.607@gmail.com> <30023.1300895956@gemini.franz.com> <4D8A5E7A.40008@gmail.com> Message-ID: >>>>> "Raymond" == Raymond Toy writes: Raymond> On 3/23/11 12:26 PM, Stavros Macrakis wrote: >> Of course it is possible to create bad cases. But in realistic >> Maxima use, the only commonly-encountered circular list >> structure is the 'assume' database (data property). >> >> A little experimentation shows that *print-level* = 14 gives a >> fairly reasonable (though somewhat redundant) display, and >> *print-length* = 100 is fine. >> Raymond> Ok, let's say 100 and 15, as reasonable values for Raymond> *print-length* and *print-level*. Done. If someone wants to change these defaults to something else, go ahead. The important part (*print-circle* nil) is done. :-) Ray From toy.raymond at gmail.com Fri Mar 25 08:49:11 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 25 Mar 2011 09:49:11 -0400 Subject: [Maxima] Is it possible to set zero-based indexing in maxima? References: Message-ID: >>>>> "Andrew" == Andrew A writes: Andrew> Default one-based indexing is not?suitable for me =( Not that I know of. Ray From macrakis at alum.mit.edu Fri Mar 25 09:16:06 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 25 Mar 2011 10:16:06 -0400 Subject: [Maxima] Is it possible to set zero-based indexing in maxima? In-Reply-To: References: Message-ID: What exactly are the cases you care about? If you use undeclared (hashed) arrays, you can index by anything you want, and there is no concept of "origin": a[3] : 5$ a["test"] : 23$ a[x^2-1] : 1/sin(y)$ a[-23.5] : '[negative,halfinteger]$ a[-47/2] ; "My heart belongs to daddy"$ /* note this is distinct from -23.5 */ a[ sin ] : lambda([q],q^2/(1-q^2)) $ If you use declared arrays, they are 0-origin and go from 0..n (not 0 .. n-1): array(foo,3)$ foo[-1] => error foo[0] => no problem foo[3] => no problem foo[4] => error On the other hand, indexing of lists and matrices is 1-origin: Indexing of lists? e.g. [a,b,c][2] => c rather than b Indexing of matrices e.g. matrix([a,b],[c,d])[1,1] => d rather than a Changing list and array indexing to 0-origin would surely break lots of Maxima code. But you can easily enough define, e.g. idx(l,i) := l[i-1]$ setidx(l,i,val):= l[i-1]: val$ etc. -s On Wed, Mar 23, 2011 at 13:57, Andrew A wrote: > Default one-based indexing is not suitable for me =( > _______________________________________________ > 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 Mar 25 09:35:19 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 25 Mar 2011 10:35:19 -0400 Subject: [Maxima] abs & asinh References: Message-ID: >>>>> "Henry" == Henry Baker writes: Henry> assume(x>0); Henry> How come Henry> abs(sinh(x)) => sinh(x) Henry> but Henry> abs(asinh(x)) => abs(asinh(x)) SHOULD BE asinh(x) Henry> ??? Henry> asinh(x) is a perfectly good 1-1/onto real increasing odd Henry> function of x. Exactly, but no one told maxima that fact. :-) This will be fixed soon. Maxima also didn't know that atanh is an increasing odd function either. Not sure what to do about acosh since the real-valued function is only defined for non-negative x, so maxima doesn't know that abs(acosh(x)) = acosh(x) for x>=0. Ray From hbaker1 at pipeline.com Fri Mar 25 10:12:54 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Fri, 25 Mar 2011 08:12:54 -0700 Subject: [Maxima] abs & asinh In-Reply-To: References: Message-ID: Raymond: Are you talking below about something other than minimal changes? If there is a project that is doing something more fundamental about these issues, please let me know more about it. I'm looking into various things, including: 1. Propagation of type/range (see Common Lisp declarations) info across argument/function results, which would take care of most of these issues below. 2. Partial function info, including functions whose domain is not the entire complex plane or the entire real line. 3. if-then-else simplification, which allows the extension of the less-than-total domains of #2 -- e.g., the if-then-else nature of atan2. At 07:35 AM 3/25/2011, Raymond Toy wrote: >>>>>> "Henry" == Henry Baker writes: > > Henry> assume(x>0); > Henry> How come > > Henry> abs(sinh(x)) => sinh(x) > > Henry> but > > Henry> abs(asinh(x)) => abs(asinh(x)) SHOULD BE asinh(x) > > Henry> ??? > > Henry> asinh(x) is a perfectly good 1-1/onto real increasing odd > Henry> function of x. > >Exactly, but no one told maxima that fact. :-) > >This will be fixed soon. Maxima also didn't know that atanh is an >increasing odd function either. Not sure what to do about acosh since >the real-valued function is only defined for non-negative x, so maxima >doesn't know that abs(acosh(x)) = acosh(x) for x>=0. > >Ray From toy.raymond at gmail.com Fri Mar 25 11:29:43 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 25 Mar 2011 12:29:43 -0400 Subject: [Maxima] abs & asinh References: Message-ID: >>>>> "Henry" == Henry Baker writes: Henry> Raymond: Are you talking below about something other than Henry> minimal changes? The current fix is very minimal and just brings those functions in line with what maxima already knows about sinh. Nothing really fancy. Henry> If there is a project that is doing something more Henry> fundamental about these issues, please let me know more Henry> about it. I'm looking into various things, including: Henry> 1. Propagation of type/range (see Common Lisp Henry> declarations) info across argument/function results, Henry> which would take care of most of these issues below. Henry> 2. Partial function info, including functions whose domain Henry> is not the entire complex plane or the entire real Henry> line. Ah, these would be very cool to have. Long ago, I did something like that for CMUCL's compiler so that it could derive the types for basic arithmetic operators and some of the special functions. Henry> 3. if-then-else simplification, which allows the extension Henry> of the less-than-total domains of #2 -- e.g., the Henry> if-then-else nature of atan2. Hmm. Isn't there some contrib package that can do some kinds of if-then-else simplification? Ray From hbaker1 at pipeline.com Fri Mar 25 11:46:02 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Fri, 25 Mar 2011 09:46:02 -0700 Subject: [Maxima] bad interaction of rassociative and tellsimp Message-ID: Consider the following: declare(zand,rassociative); matchdeclare(var1,true); matchdeclare(var2,true); matchdeclare(var3,true); tellsimp(zand(var1,zor(var2,var3)),zor(zand(var1,var2),zand(var1,var3))); (%i1) zand(zor(a,b),c); (%o1) zand(zor(a, b), c) (%i2) zand(a,zor(b,c)); (%o2) zand(zand(a, b), zand(a, c)) (%i3) Note that "zor" became "zand" ????? From villate at fe.up.pt Fri Mar 25 12:46:11 2011 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 25 Mar 2011 17:46:11 +0000 Subject: [Maxima] Bug in plot2d/coerce-float-fun In-Reply-To: References: <1300754002.5852.3.camel@wigner> <4D880851.9060708@gmail.com> Message-ID: <1301075171.9048.0.camel@wigner> On Thu, 2011-03-24 at 07:57 -0400, Raymond Toy wrote: > Patch applied. It works fine. Thanks for fixing it. Jaime From willisb at unk.edu Sat Mar 26 09:32:34 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 26 Mar 2011 09:32:34 -0500 Subject: [Maxima] unsimplifed result from expand In-Reply-To: <1301075171.9048.0.camel@wigner> References: <1300754002.5852.3.camel@wigner> <4D880851.9060708@gmail.com> , <1301075171.9048.0.camel@wigner> Message-ID: I thought that expand returned a simplified expression; maybe it does not: (%i241) (1-sqrt(5))^3-4*(1-sqrt(5))^2+8; (%o241) (1-sqrt(5))^3-4*(1-sqrt(5))^2+8 (%i242) expand(%); (%o242) 5^(3/2)-5^(3/2) (%i243) expand(%,0,0); (%o243) 0 Ratexpand crunches this to zero without the additional simplification: (%i244) ratexpand((1-sqrt(5))^3-4*(1-sqrt(5))^2+8); (%o244) 0 --Barton From drdieterkaiser at web.de Sat Mar 26 10:07:35 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 26 Mar 2011 16:07:35 +0100 Subject: [Maxima] unsimplifed result from expand In-Reply-To: References: <1300754002.5852.3.camel@wigner> <4D880851.9060708@gmail.com> , <1301075171.9048.0.camel@wigner> Message-ID: <1301152055.1867.5.camel@dieter> Am Samstag, den 26.03.2011, 09:32 -0500 schrieb Barton Willis: > I thought that expand returned a simplified expression; maybe it does not: > > (%i241) (1-sqrt(5))^3-4*(1-sqrt(5))^2+8; > (%o241) (1-sqrt(5))^3-4*(1-sqrt(5))^2+8 > > (%i242) expand(%); > (%o242) 5^(3/2)-5^(3/2) > > (%i243) expand(%,0,0); > (%o243) 0 > > Ratexpand crunches this to zero without the additional simplification: > > (%i244) ratexpand((1-sqrt(5))^3-4*(1-sqrt(5))^2+8); > (%o244) 0 > > --Barton This problem might be related to a further bug I have observed some time ago: (%i4) sqrt(2)+sqrt(2)+sqrt(2); (%o4) 2^(3/2)+sqrt(2) (%i6) ratsimp(%); (%o6) 3*sqrt(2) The problem is in simplus and related functions. We have code in simptimes to simplify powers of integers. simplus has to be extended accordingly. I have already tested some algorithm, which works for the case above, but it is not general enough. Dieter Kaiser From willisb at unk.edu Sat Mar 26 11:40:27 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 26 Mar 2011 11:40:27 -0500 Subject: [Maxima] unsimplifed result from expand In-Reply-To: <1301152055.1867.5.camel@dieter> References: <1300754002.5852.3.camel@wigner> <4D880851.9060708@gmail.com> , <1301075171.9048.0.camel@wigner> , <1301152055.1867.5.camel@dieter> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >This?problem?might?be?related?to?a?further?bug?I?have?observed?some?timeago: > >(%i4)?sqrt(2)+sqrt(2)+sqrt(2); >(%o4)?2^(3/2)+sqrt(2) > >(%i6)?ratsimp(%); >(%o6)?3*sqrt(2) I reported these bugs to the buglist. --Barton From willisb at unk.edu Sat Mar 26 13:45:38 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 26 Mar 2011 13:45:38 -0500 Subject: [Maxima] unsimplifed result from expand In-Reply-To: References: <1300754002.5852.3.camel@wigner> <4D880851.9060708@gmail.com> , <1301075171.9048.0.camel@wigner> , <1301152055.1867.5.camel@dieter>, Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >-----maxima-bounces at math.utexas.edu?wrote:?----- >? >>This?problem?might?be?related?to?a?further?bug?I?have?observed?some >timeago: >> >>(%i4)?sqrt(2)+sqrt(2)+sqrt(2); >>(%o4)?2^(3/2)+sqrt(2) >> >>(%i6)?ratsimp(%); >>(%o6)?3*sqrt(2) Here is an expression that ratexpand doesn't crunch to zero: (%i575) (-5^(3/2)/8+5^(3/2)/8-sqrt(5)/2-1/2)/5+(-5^(3/2)/8+sqrt(5)/8+1/2)/5+1/sqrt(5); (%o575) (-5^(3/2)/8+sqrt(5)/8+1/2)/5+(-sqrt(5)/2-1/2)/5+1/sqrt(5) (%i576) ratexpand(%); (%o576) sqrt(5)/8-sqrt(5)/8 (%i577) ratexpand(%); (%o577) 0 --Barton From skranz at uni-bonn.de Sat Mar 26 10:47:17 2011 From: skranz at uni-bonn.de (Sebastian Kranz) Date: Sat, 26 Mar 2011 16:47:17 +0100 Subject: [Maxima] Changing signs of terms like (x-1) after factor or simplification Message-ID: <4D8E0A85.4090602@uni-bonn.de> Hi, I use Maxima often to simplify terms or equations that have a lot terms of the form (1-x) with variables x in [0,1]. The simplifying functions of Maxima tend to transform the terms (1-x) in the less intuitive form -(x-1) and I have to convert them back manually. For example, (%i231) factor(a-x*a); (%o231) - a (x - 1) Does anybody know an automatic way to tell Maxima that it shall tranform terms like (x-1) into -(1-x) and multiply the minus sign with all other minus signs in the product? E.g. I would like factor(a-x*a); a (1-x) or factor(-a+x*a); - a (1-x) Alternatively, is it complicated to write a general function that does this transformation? E.g. a function nicesign(expr), yielding: nicesign(factor(a-x*a)); a (1-x) Perhaps creating such a function is not too complciated, but I really have no knowledge of maxima programming. Thanks for any help, Sebastian From macrakis at alum.mit.edu Sat Mar 26 15:23:30 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 26 Mar 2011 16:23:30 -0400 Subject: [Maxima] Changing signs of terms like (x-1) after factor or simplification In-Reply-To: <4D8E0A85.4090602@uni-bonn.de> References: <4D8E0A85.4090602@uni-bonn.de> Message-ID: How about something like this: pullsign(ex) := if member(sign(ex), '[neg, nz]) then [-1, -ex] else [1, ex]$ postrans(ex):= block([inflag:true,pull], if mapatom(ex) then ex elseif op(ex)="*" then (pull:maplist(pullsign,ex), apply("*",map('first,pull))*apply("*",map('second,pull))) elseif op(ex)="^" then (pull:pullsign(part(ex,1)), pull[1]^part(ex,2)*pull[2]^part(ex,2)) else map(postrans,ex))$ Example: assume(x>0,x<1)$ postrans((1-x)*(x-1)^3) => -(1-x)^4 Note that this won't work for a single term: postrans(-(1-x)) => x-1 Is this what you had in mind? -s On Sat, Mar 26, 2011 at 11:47, Sebastian Kranz wrote: > Hi, > > I use Maxima often to simplify terms or equations that have a lot terms of > the form (1-x) with variables x in [0,1]. The simplifying functions of > Maxima tend to transform the terms (1-x) in the less intuitive form -(x-1) > and I have to convert them back manually. For example, > > (%i231) factor(a-x*a); > (%o231) - a (x - 1) > > Does anybody know an automatic way to tell Maxima that it shall tranform > terms like (x-1) into -(1-x) and multiply the minus sign with all other > minus signs in the product? E.g. I would like > > factor(a-x*a); > a (1-x) > > or > > factor(-a+x*a); > - a (1-x) > > Alternatively, is it complicated to write a general function that does this > transformation? E.g. a function nicesign(expr), yielding: > > nicesign(factor(a-x*a)); > a (1-x) > > Perhaps creating such a function is not too complciated, but I really have > no knowledge of maxima programming. > > Thanks for any help, > Sebastian > > > _______________________________________________ > 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 Sat Mar 26 20:30:57 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 26 Mar 2011 21:30:57 -0400 Subject: [Maxima] Changing signs of terms like (x-1) after factor or simplification In-Reply-To: <4D8E8DBD.2080708@uni-bonn.de> References: <4D8E0A85.4090602@uni-bonn.de> <4D8E8DBD.2080708@uni-bonn.de> Message-ID: Sorry! I sent you the wrong version of my code. Try: pullsign(ex) := (ex: postrans(ex), if member(sign(ex), '[neg, nz]) then [-1, -ex] else [1, ex])$ postrans(ex):= block([inflag:true,pull], if mapatom(ex) then ex elseif op(ex)="*" then (pull:maplist(pullsign,ex), apply("*",map('first,pull))*apply("*",map('second,pull))) elseif op(ex)="^" then (pull:pullsign(part(ex,1)), pull[1]^part(ex,2)*pull[2]^part(ex,2)) else map(postrans,ex))$ By the way, you may want to update to the current version of Maxima -- I am testing on 5.23.2. -s On Sat, Mar 26, 2011 at 21:07, Sebastian Kranz wrote: > Dear Stavros, > > thanks a lot, I was indeed looking for such a function. It worked very nice > on example factorizations that I tested. E.g. > > > assume(x>=0,x<=1)$ > postrans(factor(a*x-a)); > > yields as desired > - a (1 - x) > > even though I just have weak inequalities in assume(...). Interestingly, > however, I could not replicate your example. This means > > > assume(x>0,x<1)$ > postrans((1-x)*(x-1)^3); > > yields on my Computer without any change > > > (1-x)*(x-1)^3 > > and > > > assume(x>0,x<1)$ > postrans(5*factor((1-x)*(x-1)^3)); > > yields > > - 5 (x - 1)^4 > > Maybe some of my global settings are different than yours (I have got > Maxima 5.18.1 for Windows). Still the function will be very helpful, as it > works in a lot of cases. > > Many thanks, > Sebastian > > > > Am 26.3.2011 21:23, schrieb Stavros Macrakis: > > How about something like this: > > pullsign(ex) := > if member(sign(ex), '[neg, nz]) > then [-1, -ex] > else [1, ex]$ > > postrans(ex):= > block([inflag:true,pull], > if mapatom(ex) then ex > elseif op(ex)="*" then > (pull:maplist(pullsign,ex), > apply("*",map('first,pull))*apply("*",map('second,pull))) > elseif op(ex)="^" then > (pull:pullsign(part(ex,1)), > pull[1]^part(ex,2)*pull[2]^part(ex,2)) > else map(postrans,ex))$ > > Example: > > assume(x>0,x<1)$ > > postrans((1-x)*(x-1)^3) => -(1-x)^4 > > Note that this won't work for a single term: > > postrans(-(1-x)) => x-1 > > Is this what you had in mind? > > -s > > > On Sat, Mar 26, 2011 at 11:47, Sebastian Kranz wrote: > >> Hi, >> >> I use Maxima often to simplify terms or equations that have a lot terms >> of the form (1-x) with variables x in [0,1]. The simplifying functions of >> Maxima tend to transform the terms (1-x) in the less intuitive form -(x-1) >> and I have to convert them back manually. For example, >> >> (%i231) factor(a-x*a); >> (%o231) - a (x - 1) >> >> Does anybody know an automatic way to tell Maxima that it shall tranform >> terms like (x-1) into -(1-x) and multiply the minus sign with all other >> minus signs in the product? E.g. I would like >> >> factor(a-x*a); >> a (1-x) >> >> or >> >> factor(-a+x*a); >> - a (1-x) >> >> Alternatively, is it complicated to write a general function that does >> this transformation? E.g. a function nicesign(expr), yielding: >> >> nicesign(factor(a-x*a)); >> a (1-x) >> >> Perhaps creating such a function is not too complciated, but I really have >> no knowledge of maxima programming. >> >> Thanks for any help, >> Sebastian >> >> >> _______________________________________________ >> 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 bmguerrieri at gmail.com Sat Mar 26 20:36:04 2011 From: bmguerrieri at gmail.com (Bruno Guerrieri) Date: Sat, 26 Mar 2011 21:36:04 -0400 Subject: [Maxima] double_integral_draw() References: <4D8E0A85.4090602@uni-bonn.de> Message-ID: <85A6572E92FD42BD9C8FB0284C39400C@XPS> A while back I ran across the following function: double_integral_draw (z, x, x0, x1, y, y0, y1) := block([xval, yval, cur, lin1, lin2, opt1, opt2, opt3, u, n: 50], cur: makelist( (yval: float(k/n)*(y1-y0) + y0, parametric(u, yval, subst([x=u, y=yval], z), u, subst(y=yval, x0), subst(y=yval, x1))), k, 1, n), lin1: makelist( (yval: float(k/n)*(y1-y0) + y0, xval: subst(y=yval, x0), points([[xval, yval, 0], [xval, yval, subst([x=xval, y=yval], z)]])), k, 1, n), lin2: makelist( (yval: float(k/n)*(y1-y0) + y0, xval: subst(y=yval, x1), points([[xval,yval,0], [xval,yval,subst([x=xval, y=yval], z)]])), k, 1, n), opt1: [xlabel="x",ylabel="y",color=blue, xyplane=0], opt2: [points_joined=true, point_size=0,color=red], opt3: [color=green] , apply(draw3d, append(opt1, cur, opt2, lin1, opt3, lin2)) ) $ Having loaded the "draw" function, one could then invoke the double_integral_draw function shown above, via a command such as double_integral_draw (2-y, x, 0, 4-y^2, y, 0, 2) $ and get a nice 3D pic of the "situation". This process does not seem to work anymore under the new Maxima version and probably needs a very simple tweak. Could someone help? Sincerely Guerrieri -------------- next part -------------- An HTML attachment was scrubbed... URL: From bmguerrieri at gmail.com Sat Mar 26 21:07:00 2011 From: bmguerrieri at gmail.com (Bruno Guerrieri) Date: Sat, 26 Mar 2011 22:07:00 -0400 Subject: [Maxima] Forgive and Forget!!! [double_integral_draw()] Message-ID: I updated to the new Maxima version and the function double_integral_draw() is working fine. Please forgive me. Sincerely, Guerrieri -------------- next part -------------- An HTML attachment was scrubbed... URL: From skranz at uni-bonn.de Sat Mar 26 20:07:09 2011 From: skranz at uni-bonn.de (Sebastian Kranz) Date: Sun, 27 Mar 2011 03:07:09 +0200 Subject: [Maxima] Changing signs of terms like (x-1) after factor or simplification In-Reply-To: References: <4D8E0A85.4090602@uni-bonn.de> Message-ID: <4D8E8DBD.2080708@uni-bonn.de> Dear Stavros, thanks a lot, I was indeed looking for such a function. It worked very nice on example factorizations that I tested. E.g. assume(x>=0,x<=1)$ postrans(factor(a*x-a)); yields as desired - a (1 - x) even though I just have weak inequalities in assume(...). Interestingly, however, I could not replicate your example. This means assume(x>0,x<1)$ postrans((1-x)*(x-1)^3); yields on my Computer without any change (1-x)*(x-1)^3 and assume(x>0,x<1)$ postrans(5*factor((1-x)*(x-1)^3)); yields - 5 (x - 1)^4 Maybe some of my global settings are different than yours (I have got Maxima 5.18.1 for Windows). Still the function will be very helpful, as it works in a lot of cases. Many thanks, Sebastian Am 26.3.2011 21:23, schrieb Stavros Macrakis: > How about something like this: > > pullsign(ex) := > if member(sign(ex), '[neg, nz]) > then [-1, -ex] > else [1, ex]$ > > postrans(ex):= > block([inflag:true,pull], > if mapatom(ex) then ex > elseif op(ex)="*" then > (pull:maplist(pullsign,ex), > apply("*",map('first,pull))*apply("*",map('second,pull))) > elseif op(ex)="^" then > (pull:pullsign(part(ex,1)), > pull[1]^part(ex,2)*pull[2]^part(ex,2)) > else map(postrans,ex))$ > > Example: > > assume(x>0,x<1)$ > > postrans((1-x)*(x-1)^3) => -(1-x)^4 > > Note that this won't work for a single term: > > postrans(-(1-x)) => x-1 > > Is this what you had in mind? > > -s > > > On Sat, Mar 26, 2011 at 11:47, Sebastian Kranz > wrote: > > Hi, > > I use Maxima often to simplify terms or equations that have a lot > terms of the form (1-x) with variables x in [0,1]. The simplifying > functions of Maxima tend to transform the terms (1-x) in the less > intuitive form -(x-1) and I have to convert them back manually. > For example, > > (%i231) factor(a-x*a); > (%o231) - a (x - 1) > > Does anybody know an automatic way to tell Maxima that it shall > tranform terms like (x-1) into -(1-x) and multiply the minus sign > with all other minus signs in the product? E.g. I would like > > factor(a-x*a); > a (1-x) > > or > > factor(-a+x*a); > - a (1-x) > > Alternatively, is it complicated to write a general function that > does this transformation? E.g. a function nicesign(expr), yielding: > > nicesign(factor(a-x*a)); > a (1-x) > > Perhaps creating such a function is not too complciated, but I > really have no knowledge of maxima programming. > > Thanks for any help, > Sebastian > > > _______________________________________________ > 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 skranz at uni-bonn.de Sat Mar 26 21:31:31 2011 From: skranz at uni-bonn.de (Sebastian Kranz) Date: Sun, 27 Mar 2011 04:31:31 +0200 Subject: [Maxima] Changing signs of terms like (x-1) after factor or simplification In-Reply-To: References: <4D8E0A85.4090602@uni-bonn.de> <4D8E8DBD.2080708@uni-bonn.de> Message-ID: <4D8EA183.7060701@uni-bonn.de> Great! The new function works perfectly so far on all my examples. Thanks for the hint that there is a new Maxima version. The "News" on the Maxima website: http://maxima.sourceforge.net/ seem to be a bit outdatet as it currently states version 5.18.1 from 2009 to be the newest version. (I was already wondering a bit whether development of Maxima had stopped). Is there some website that lists the changes in the new versions? (In particular, I wonder whether with a new version, it is possible to have an external program send input to Maxima via a named pipe in Windows. I have actually started to write a, very unelegant, interface that allows to copy math into the clipboard from Lyx, press on a button in a Tcl/Tk window created by an R program that reads these Latex strings, does a lot of string replacements and writes the resulting Maxima code into a file, starts a new instance of Maxima to run this file, reads the resulting file, transforms it back to nice Latex math readable by Lyx and copies it back to the clipboard so that the user can paste the modified mathematical expression whereever he likes in Lyx. Sounds completely inrobust, but it actually seems to work surprisingly decent in a very raw first version. It just takes some time to restart Maxima every time one wants to perform some math operation in Lyx, as I could not figure out how to pipe to a running instance of Maxima...) Best wishes, Sebastian Am 27.3.2011 03:30, schrieb Stavros Macrakis: > Sorry! I sent you the wrong version of my code. > > Try: > > pullsign(ex) := > (ex: postrans(ex), > if member(sign(ex), '[neg, nz]) > then [-1, -ex] > else [1, ex])$ > > postrans(ex):= > block([inflag:true,pull], > if mapatom(ex) then ex > elseif op(ex)="*" then > (pull:maplist(pullsign,ex), > apply("*",map('first,pull))*apply("*",map('second,pull))) > elseif op(ex)="^" then > (pull:pullsign(part(ex,1)), > pull[1]^part(ex,2)*pull[2]^part(ex,2)) > else map(postrans,ex))$ > > By the way, you may want to update to the current version of Maxima -- > I am testing on 5.23.2. > > -s > > On Sat, Mar 26, 2011 at 21:07, Sebastian Kranz > wrote: > > Dear Stavros, > > thanks a lot, I was indeed looking for such a function. It worked > very nice on example factorizations that I tested. E.g. > > > assume(x>=0,x<=1)$ > postrans(factor(a*x-a)); > > yields as desired > - a (1 - x) > > even though I just have weak inequalities in assume(...). > Interestingly, however, I could not replicate your example. This > means > > > assume(x>0,x<1)$ > postrans((1-x)*(x-1)^3); > > yields on my Computer without any change > > > (1-x)*(x-1)^3 > > and > > > assume(x>0,x<1)$ > postrans(5*factor((1-x)*(x-1)^3)); > > yields > > - 5 (x - 1)^4 > > Maybe some of my global settings are different than yours (I have > got Maxima 5.18.1 for Windows). Still the function will be very > helpful, as it works in a lot of cases. > > Many thanks, > Sebastian > > > > Am 26.3.2011 21:23, schrieb Stavros Macrakis: >> How about something like this: >> >> pullsign(ex) := >> if member(sign(ex), '[neg, nz]) >> then [-1, -ex] >> else [1, ex]$ >> >> postrans(ex):= >> block([inflag:true,pull], >> if mapatom(ex) then ex >> elseif op(ex)="*" then >> (pull:maplist(pullsign,ex), >> apply("*",map('first,pull))*apply("*",map('second,pull))) >> elseif op(ex)="^" then >> (pull:pullsign(part(ex,1)), >> pull[1]^part(ex,2)*pull[2]^part(ex,2)) >> else map(postrans,ex))$ >> >> Example: >> >> assume(x>0,x<1)$ >> >> postrans((1-x)*(x-1)^3) => -(1-x)^4 >> >> Note that this won't work for a single term: >> >> postrans(-(1-x)) => x-1 >> >> Is this what you had in mind? >> >> -s >> >> >> On Sat, Mar 26, 2011 at 11:47, Sebastian Kranz >> > wrote: >> >> Hi, >> >> I use Maxima often to simplify terms or equations that have >> a lot terms of the form (1-x) with variables x in [0,1]. The >> simplifying functions of Maxima tend to transform the terms >> (1-x) in the less intuitive form -(x-1) and I have to convert >> them back manually. For example, >> >> (%i231) factor(a-x*a); >> (%o231) - a (x - 1) >> >> Does anybody know an automatic way to tell Maxima that it >> shall tranform terms like (x-1) into -(1-x) and multiply the >> minus sign with all other minus signs in the product? E.g. I >> would like >> >> factor(a-x*a); >> a (1-x) >> >> or >> >> factor(-a+x*a); >> - a (1-x) >> >> Alternatively, is it complicated to write a general function >> that does this transformation? E.g. a function >> nicesign(expr), yielding: >> >> nicesign(factor(a-x*a)); >> a (1-x) >> >> Perhaps creating such a function is not too complciated, but >> I really have no knowledge of maxima programming. >> >> Thanks for any help, >> Sebastian >> >> >> _______________________________________________ >> 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 Mar 27 14:40:35 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 27 Mar 2011 13:40:35 -0600 Subject: [Maxima] bad interaction of rassociative and tellsimp In-Reply-To: References: Message-ID: On 3/25/11, Henry Baker wrote: > declare(zand,rassociative); > > matchdeclare(var1,true); > matchdeclare(var2,true); > matchdeclare(var3,true); > > tellsimp(zand(var1,zor(var2,var3)),zor(zand(var1,var2),zand(var1,var3))); > > (%i1) zand(zor(a,b),c); > (%o1) zand(zor(a, b), c) > (%i2) zand(a,zor(b,c)); > (%o2) zand(zand(a, b), zand(a, c)) > (%i3) I think I;ve fixed this. Committed r1.38 src/asum.lisp, to appear in Maxima 5.24. Thanks for the bug report. best Robert Dodier From jcsantos at fc.up.pt Sun Mar 27 17:13:47 2011 From: jcsantos at fc.up.pt (=?ISO-8859-1?Q?Jos=E9_Carlos_Santos?=) Date: Sun, 27 Mar 2011 23:13:47 +0100 Subject: [Maxima] Newbie question about Maxima under Windows Message-ID: <4D8FB69B.904@fc.up.pt> Hi, I am a new Maxima user and I work under Windows XP. How do I save a Maxima session? I would to be able to do that even if all I get is a text file that cannot be re-opened by Maxima. Best regards, Jose Carlos Santos From hbaker1 at pipeline.com Sun Mar 27 18:36:59 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Sun, 27 Mar 2011 16:36:59 -0700 Subject: [Maxima] bad interaction of rassociative and tellsimp In-Reply-To: References: Message-ID: Wow! Fast response! Was the problem something trivial, or was it something more fundamental? I'm going to be nosing around quite a bit using tellsimp & tellsimpafter, so I may find a number of additional bugs/misfeatures of this type. At 12:40 PM 3/27/2011, Robert Dodier wrote: >On 3/25/11, Henry Baker wrote: > >> declare(zand,rassociative); >> >> matchdeclare(var1,true); >> matchdeclare(var2,true); >> matchdeclare(var3,true); >> >> tellsimp(zand(var1,zor(var2,var3)),zor(zand(var1,var2),zand(var1,var3))); >> >> (%i1) zand(zor(a,b),c); >> (%o1) zand(zor(a, b), c) >> (%i2) zand(a,zor(b,c)); >> (%o2) zand(zand(a, b), zand(a, c)) >> (%i3) > >I think I;ve fixed this. Committed r1.38 src/asum.lisp, >to appear in Maxima 5.24. Thanks for the bug report. > >best > >Robert Dodier From villate at fe.up.pt Sun Mar 27 19:47:23 2011 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 28 Mar 2011 01:47:23 +0100 Subject: [Maxima] Newbie question about Maxima under Windows In-Reply-To: <4D8FB69B.904@fc.up.pt> References: <4D8FB69B.904@fc.up.pt> Message-ID: <1301273243.5880.3.camel@wigner> On Sun, 2011-03-27 at 23:13 +0100, Jos? Carlos Santos wrote: > I am a new Maxima user and I work under Windows XP. How do I save a > Maxima session? I would to be able to do that even if all I get is a > text file that cannot be re-opened by Maxima. Hello, you can find an answer in section A.12 in this apendix: http://def.fe.up.pt/moodle/course/view.php?id=3 Cumprimentos, Jaime Villate From robert.dodier at gmail.com Sun Mar 27 23:31:33 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 27 Mar 2011 22:31:33 -0600 Subject: [Maxima] bad interaction of rassociative and tellsimp In-Reply-To: References: Message-ID: On 3/27/11, Henry Baker wrote: > Was the problem something trivial, or was it something more fundamental? It was pretty trivial -- the code to handle rassociative assumed that the operator of an expression after simplification is the same as it was before. That's not true for the zand/zor rule. > I'm going to be nosing around quite a bit using tellsimp & tellsimpafter, so > I may find a number of additional bugs/misfeatures of this type. OK. My advice is to spend only a little time trying to figure out strange behavior -- chances are good that there are some known limitations that you will run into -- so feel free to post a message on the mailing list when you run into problems. best Robert Dodier From tony.mason at generaldynamics.uk.com Mon Mar 28 05:36:03 2011 From: tony.mason at generaldynamics.uk.com (tony.mason at generaldynamics.uk.com) Date: Mon, 28 Mar 2011 11:36:03 +0100 Subject: [Maxima] Maxima license restrictions from DOE-MACSYMA Message-ID: <46956B9592C82C4AB14C77C85260E4DD056D985C@GDUKADH850.uk1.r-org.net> Within the company I work for there is interest in using the Maxima software, however the web site identifies Maxima as being derived from DOE-MACSYMA software. While the Maxima software is released under the GNU GPL license, there is a reference in the original permission from 1998 to release the DOE-MACSYMA software: "Distribution of such derivative works is subject to the U.S. Export Administration Regulations (Title 15 CFR 768-799), which implements the Export Administration Act of 1979, as amended, and/or the International Traffic in Arms Regulation, of 12-6-84, (Title 22 CFR 121-130), which implements the Arms Export Control Act (22 U.S.C. 2728) and may require license for export." Is there a contact who could provide advice on the export restrictions before we begin using the software? thanks Tony This email and any files attached are intended for the addressee and may contain information of a confidential nature. If you are not the intended recipient, be aware that this email was sent to you in error and you should not disclose, distribute, print, copy or make other use of this email or its attachments. Such actions, in fact, may be unlawful. In compliance with the various Regulations and Acts, General Dynamics United Kingdom Limited reserves the right to monitor (and examine for viruses) all emails and email attachments, both inbound and outbound. Email communications and their attachments may not be secure or error- or virus-free and the company does not accept liability or responsibility for such matters or the consequences thereof. General Dynamics United Kingdom Limited, Registered Office: 21 Holborn Viaduct, London EC1A 2DY. Registered in England and Wales No: 1911653. -------------- next part -------------- An HTML attachment was scrubbed... URL: From beroset at mindspring.com Mon Mar 28 07:03:23 2011 From: beroset at mindspring.com (Ed Beroset) Date: Mon, 28 Mar 2011 08:03:23 -0400 (GMT-04:00) Subject: [Maxima] Maxima license restrictions from DOE-MACSYMA Message-ID: <2561041.1301313803550.JavaMail.root@elwamui-huard.atl.sa.earthlink.net> An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Mar 28 08:23:27 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 28 Mar 2011 09:23:27 -0400 Subject: [Maxima] Maxima license restrictions from DOE-MACSYMA In-Reply-To: <46956B9592C82C4AB14C77C85260E4DD056D985C@GDUKADH850.uk1.r-org.net> References: <46956B9592C82C4AB14C77C85260E4DD056D985C@GDUKADH850.uk1.r-org.net> Message-ID: Keep in mind that local (UK and European) export regulations may also apply, even though they are not mentioned in the header. -s On Mon, Mar 28, 2011 at 06:36, wrote: > U.S. Export Administration Regulations (Title 15 CFR 768-799), -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Mon Mar 28 08:29:25 2011 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 28 Mar 2011 14:29:25 +0100 Subject: [Maxima] Maxima license restrictions from DOE-MACSYMA In-Reply-To: <46956B9592C82C4AB14C77C85260E4DD056D985C@GDUKADH850.uk1.r-org.net> References: <46956B9592C82C4AB14C77C85260E4DD056D985C@GDUKADH850.uk1.r-org.net> Message-ID: <1301318965.3250.14.camel@wigner> On Mon, 2011-03-28 at 11:36 +0100, tony.mason at generaldynamics.uk.com wrote: > While the Maxima software is released under the GNU GPL license, there > is a reference in the original permission from 1998 to release the > DOE-MACSYMA software: > > ?Distribution of such derivative works is subject to the U.S. Export > Administration Regulations (Title 15 CFR 768-799), which implements > the Export Administration Act of 1979, as amended, and/or the > International Traffic in Arms Regulation, of 12-6-84, (Title 22 CFR > 121-130), which implements the Arms Export Control Act (22 U.S.C. > 2728) and may require license for export.? > > Is there a contact who could provide advice on the export restrictions > before we begin using the software? Hi, if you are going to use Maxima and recommend it to your customers, you do not have to worry about that. Your company is not going to distribute Maxima directly, is it? If your customers get the software from Maxima's site or from a software distribution such as Ubuntu, your company will not be bound by those restrictions. We at Maxima do not have any lawyers to give us advice but Ubuntu, Debian and FSF do, and they say that the distribution of Maxima is not restricted by any U.S. Export Regulations ("may require license for export" does not apply in this case). Regards, Jaime Villate From fateman at eecs.berkeley.edu Mon Mar 28 09:36:57 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 28 Mar 2011 07:36:57 -0700 Subject: [Maxima] Maxima license restrictions from DOE-MACSYMA In-Reply-To: References: <46956B9592C82C4AB14C77C85260E4DD056D985C@GDUKADH850.uk1.r-org.net> Message-ID: <4D909D09.2060809@eecs.berkeley.edu> http://www.pmddtc.state.gov/regulations_laws/itar_official.html has the rules. I don't know if it addresses the question of whether someone is distributing Maxima and violating ITAR by posting it on the internet. Or if perhaps the violator is the one who downloads it. From dtc-maxima at scieneer.com Mon Mar 28 10:24:36 2011 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Tue, 29 Mar 2011 02:24:36 +1100 Subject: [Maxima] Maxima license restrictions from DOE-MACSYMA In-Reply-To: <4D909D09.2060809@eecs.berkeley.edu> References: <46956B9592C82C4AB14C77C85260E4DD056D985C@GDUKADH850.uk1.r-org.net> <4D909D09.2060809@eecs.berkeley.edu> Message-ID: <4D90A834.3030708@scieneer.com> Many countries have no law against importing such software, just exporting. There are probably lots of other broad laws too. Getting an export license and complying with the conditions may be prudent for a business. On 29/03/11 01:36, Richard Fateman wrote: > http://www.pmddtc.state.gov/regulations_laws/itar_official.html > has the rules. > > I don't know if it addresses the question of whether someone is distributing Maxima and violating ITAR by posting it on the internet. > > Or if perhaps the violator is the one who downloads it. > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From hbaker1 at pipeline.com Mon Mar 28 10:19:03 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Mon, 28 Mar 2011 08:19:03 -0700 Subject: [Maxima] tellsimp: can a pattern match the "rest" of a list? Message-ID: I tried matchdeclare([a,b],true); tellsimp(cons(a,b),foo(a,b)); [1,2,3]; I wanted to get foo(1,[2,3]), but still got [1,2,3]. Is there any way to achieve this? [It probably isn't critical to my application, but was merely curious.] From hbaker1 at pipeline.com Mon Mar 28 12:10:44 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Mon, 28 Mar 2011 10:10:44 -0700 Subject: [Maxima] infeval:true v. ev(%,infeval) Message-ID: Is there any reason why ev(...expression...,infeval) should be strictly more powerful than infeval:true; ...expression...; For some reason, merely assigning infeval:true didn't produce the fully eval'ed expression, but ev(...expression...,infeval) did. From fateman at eecs.berkeley.edu Mon Mar 28 15:18:59 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 28 Mar 2011 13:18:59 -0700 Subject: [Maxima] tellsimp: can a pattern match the "rest" of a list? In-Reply-To: References: Message-ID: <4D90ED33.9090601@eecs.berkeley.edu> On 3/28/2011 8:19 AM, Henry Baker wrote: > I tried > > matchdeclare([a,b],true); > tellsimp(cons(a,b),foo(a,b)); > > [1,2,3]; > > I wanted to get foo(1,[2,3]), but still got [1,2,3]. > > Is there any way to achieve this? > > [It probably isn't critical to my application, but was merely curious.] > probably not possible.. RJF From fateman at eecs.berkeley.edu Mon Mar 28 15:57:54 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 28 Mar 2011 13:57:54 -0700 Subject: [Maxima] tellsimp: can a pattern match the "rest" of a list? In-Reply-To: References: Message-ID: <4D90F652.5080005@eecs.berkeley.edu> On 3/28/2011 8:19 AM, Henry Baker wrote: > I tried > > matchdeclare([a,b],true); > tellsimp(cons(a,b),foo(a,b)); > > [1,2,3]; > > I wanted to get foo(1,[2,3]), but still got [1,2,3]. > > Is there any way to achieve this? > > [It probably isn't critical to my application, but was merely curious.] > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Consider this .... k(a,b,c,d), k =lambda([[a]], if a=[] then nil else foo(first(a),apply(k,rest(a)))); this produces foo(a,foo(b,foo(c,foo(d,nil)))) From willisb at unk.edu Mon Mar 28 16:05:38 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 28 Mar 2011 16:05:38 -0500 Subject: [Maxima] subres vs spmod In-Reply-To: References: Message-ID: Some years ago we found bugs in subres, so we changed the default for gcd from subres to spmod. Here is an example where subres is better than spmod: (%i567) p : z^3-2*sqrt(sqrt(3)*%i-37)*z^2-56*z+16*sqrt(sqrt(3)*%i-37); (%o567) z^3-2*sqrt(sqrt(3)*%i-37)*z^2-56*z+16*sqrt(sqrt(3)*%i-37) (%i568) (algebraic : true, load(hypergeometric))$ Wrong! p has a double root: (%i569) gcd(p,diff(p,z),z), gcd : spmod; (%o569) 1 Correct: (%i594) gcd(p,diff(p,z),z), gcd : subres; (%o594) 7*z+sqrt(sqrt(3)*%i-37)*(sqrt(3)*%i-5) Verify: (%i595) solve(%,z); (%o595) [z=-(sqrt(sqrt(3)*%i-37)*(sqrt(3)*%i-5))/7] (%i597) expand(float(%)); (%o597) [z=4.310800997988466*%i+1.607173059834678] (%i598) solve(p,z); (%o598) [z=((-(sqrt(3)*%i)/2-1/2)*(sqrt(3)*%i-37)^(1/6)*(8*sqrt(3)*%i-8)^(1/3))/3+(((sqrt(3)*%i)/2-1/2)*(4*sqrt(3)*%i+20))/(3*(sqrt(3)*%i-37)^(1/6)*(8*sqrt(3)*%i-8)^(1/3))+(2*sqrt(sqrt(3)*%i-37))/3,z=(((sqrt(3)*%i)/2-1/2)*(sqrt(3)*%i-37)^(1/6)*(8*sqrt(3)*%i-8)^(1/3))/3+((-(sqrt(3)*%i)/2-1/2)*(4*sqrt(3)*%i+20))/(3*(sqrt(3)*%i-37)^(1/6)*(8*sqrt(3)*%i-8)^(1/3))+(2*sqrt(sqrt(3)*%i-37))/3,z=((sqrt(3)*%i-37)^(1/6)*(8*sqrt(3)*%i-8)^(1/3))/3+(4*sqrt(3)*%i+20)/(3*(sqrt(3)*%i-37)^(1/6)*(8*sqrt(3)*%i-8)^(1/3))+(2*sqrt(sqrt(3)*%i-37))/3] (%i599) map(lambda([s], nfloat(rhs(s),[],25)),%); (%o599) [4.310800997988466918092507b0*%i+1.607173059834678277266274b0,3.547253197089032487662952b0*%i-2.929676644999984014789875b0,4.310800997988466918092507b0*%i+1.607173059834678277266274b0] The first and last entries are apparently the same. Maybe solve should only two solutions. With the nested square root, I wasn't sure that gcd(p,diff(p,z),z), gcd : subres would be correct. --Barton From wsw1wsw2 at gmail.com Mon Mar 28 19:47:06 2011 From: wsw1wsw2 at gmail.com (Shaowei Wang (wsw)) Date: Tue, 29 Mar 2011 08:47:06 +0800 Subject: [Maxima] How to load maxima as a asdf package? (sbcl) In-Reply-To: References: Message-ID: When i use defsystem.lisp (maxima.system), SBCL can compile f2cl-lib.lisp without any error. Why ASDF package can't compile it under SBCL ? Is asdf package of maxima only for ECL ? On Sat, Dec 25, 2010 at 10:36 AM, Shaowei Wang (wsw) wrote: > Hi ,all > ?I found maxima.asd file in maxima/src/. So I want to load maxima as > a asdf package using sbcl. But I have some issues. > > $ cd maxima/src > $ sbcl > This is SBCL 1.0.45.4, an implementation of ANSI Common Lisp. > More information about SBCL is available at . > > SBCL is free software, provided as is, with absolutely no warranty. > It is mostly in the public domain; some portions are provided under > BSD-style licenses. ?See the CREDITS and COPYING files in the > distribution for more information. > * (require :asdf) > > ("ASDF") > * (asdf:load-system :maxima) > . > . > . > > ; compilation finished in 0:00:00.192 > ; compiling file > "/home/wsw/Sources/maxima/src/numerical/slatec/derfc.lisp" (written 08 > APR 2009 08:04:22 AM): > ; compiling (IN-PACKAGE :SLATEC) > ; compiling (LET (# # ...) ...) > ; file: /home/wsw/Sources/maxima/src/numerical/slatec/derfc.lisp > ; in: DEFUN DERFC > ; ? ? (F2CL-LIB:FSQRT (* 2.0d0 (F2CL-LIB:D1MACH 3))) > ; --> BLOCK TYPECASE LET COND IF PROGN SQRT COERCE THE > ; ==> > ; ? (SB-KERNEL:%SINGLE-FLOAT SB-C::X) > ; > ; caught STYLE-WARNING: > ; ? Result is a (VALUES (SINGLE-FLOAT 0.0f0) &OPTIONAL), not a DOUBLE-FLOAT. > ; ? See also: > ; ? ? The SBCL Manual, Node "Handling of Types" > > ; ? ? (SETF SLATEC::TXMAX (F2CL-LIB:FSQRT (- (F2CL-LIB:FLOG #)))) > ; --> SETQ > ; ==> > ; ? (THE # > ; ? ? ? ?(F2CL-LIB:FSQRT (- (F2CL-LIB:FLOG (* SLATEC::SQRTPI #))))) > ; > ; caught WARNING: > ; ? Asserted type DOUBLE-FLOAT conflicts with derived type > ; ? (VALUES (OR (COMPLEX SINGLE-FLOAT) (COMPLEX DOUBLE-FLOAT) > (SINGLE-FLOAT 0.0f0)) > ; ? ? ? ? ? &OPTIONAL). > ; ? See also: > ; ? ? The SBCL Manual, Node "Handling of Types" > > ; compiling (IN-PACKAGE #:CL-USER) > > ; /home/wsw/Sources/maxima/src/binary-ecl/numerical/slatec/ASDF-TMP-derfc.fasl > written > ; compilation finished in 0:00:00.130 > WARNING: > ? COMPILE-FILE warned while performing # on > ? #. > > debugger invoked on a ASDF:COMPILE-FAILED in thread # ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?"initial thread" RUNNING > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{1002BBB0D1}>: > ?erred while invoking # on > ?# > > Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. > > restarts (invokable by number or by possibly-abbreviated name): > ?0: [TRY-RECOMPILING] Try recompiling derfc > ?1: [RETRY ? ? ? ? ?] Retry > ? ? ? ? ? ? ? ? ? ? ? compiling component ("maxima" "numerical" > "slatec" "derfc"). > ?2: [ACCEPT ? ? ? ? ] Continue, treating > ? ? ? ? ? ? ? ? ? ? ? compiling component ("maxima" "numerical" > "slatec" "derfc") > ? ? ? ? ? ? ? ? ? ? ? as having been successful. > ?3: [ABORT ? ? ? ? ?] Exit debugger, returning to top level. > > ((SB-PCL::FAST-METHOD ASDF:PERFORM (ASDF:COMPILE-OP ASDF:CL-SOURCE-FILE)) > ?# > ?# > ?# > ?#) > 0] > ============================================================ > > There is a error come up. > But clisp and ecl do the job just OK. > > Any idea? > Thanks a lot! > From macrakis at alum.mit.edu Tue Mar 29 22:52:10 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 29 Mar 2011 23:52:10 -0400 Subject: [Maxima] infeval:true v. ev(%,infeval) In-Reply-To: References: Message-ID: ev(xxx,yyy) can mean many things. It can be (more or less) equivalent to block([yyy:true],xxx) or to yyy(xxx) or various other things. In the case of infeval, it is just an option setting to ev, and *not* equivalent to xxx,infeval:true or infeval(xxx). Ev is just a hodgepodge of functionality, some of which (alas!) is only accessible through it, e.g. infeval. -s On Mon, Mar 28, 2011 at 13:10, Henry Baker wrote: > Is there any reason why > > ev(...expression...,infeval) > > should be strictly more powerful than > > infeval:true; > ...expression...; > > For some reason, merely assigning infeval:true didn't produce the fully > eval'ed expression, but ev(...expression...,infeval) did. > > _______________________________________________ > 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 thomas at geogebra.org Wed Mar 30 04:29:49 2011 From: thomas at geogebra.org (thomas) Date: Wed, 30 Mar 2011 11:29:49 +0200 Subject: [Maxima] intfudu ignores logabs Message-ID: <4D92F80D.6010906@geogebra.org> Hi there! I'm using the "intfudu" function from the "partition.mac" file for my integrals (as it sometimes yields "nicer" results, see http://www.math.utexas.edu/pipermail/maxima/2011/023943.html), but it seems to ignore the value of the logabs-setting: (%i1) integrate(1/x, x); (%o1) log(x) (%i2) logabs:true; (%o2) true (%i3) integrate(1/x, x); (%o3) log(abs(x)) (%i4) load("partition.mac"); (%o4) /usr/share/maxima/5.22.1/share/contrib/integration/partition.mac (%i5) intfudu(1/x, x); (%o5) log(x) (%i6) Is there any chance that this could be fixed, or is there any way around that? Cheers Thomas From willisb at unk.edu Wed Mar 30 06:30:58 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 30 Mar 2011 06:30:58 -0500 Subject: [Maxima] intfudu ignores logabs In-Reply-To: <4D92F80D.6010906@geogebra.org> References: <4D92F80D.6010906@geogebra.org> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I'm?using?the?"intfudu"?function?from?the?"partition.mac"?file?for?my? >integrals?(as?it?sometimes?yields?"nicer"?results,?see? >http://www.math.utexas.edu/pipermail/maxima/2011/023943.html),?but?it? >seems?to?ignore?the?value?of?the?logabs-setting: intfudu stores antiderivatives in a Maxima hashtable, so it's possible to modify intfudu at a command line. (%i7) load(partition)$ Find the name of the Maxima hashtable (%i8) arrays; (%o8) [intable,intable2] We need to modify intable; look at intable["^"] (%i9) intable["^"]; (%o9) lambda([u,v],if freeof(%voi,u) then [u^v/log(u),diff(v,%voi)] else if freeof(%voi,v) then if v#-1 then [u^(1+v)/(1+v),diff(u,%voi)] else [log(u),diff(u,%voi)] ) Cut and paste a new value for intable["^"] (%i10) intable["^"] : lambda([u,v],if freeof(%voi,u) then [u^v/log(u),diff(v,%voi)] else if freeof(%voi,v) then if v#-1 then [u^(1+v)/(1+v),diff(u,%voi)] else [log(if logabs then abs(u) else u),diff(u,%voi)] ); Finally, check your work: (%i11) intfudu(1/x, x), logabs : false; (%o11) log(x) (%i12) intfudu(1/x,x), logabs : true; (%o12) log(abs(x)) --Barton Willis From thomas at geogebra.org Wed Mar 30 07:48:30 2011 From: thomas at geogebra.org (thomas) Date: Wed, 30 Mar 2011 14:48:30 +0200 Subject: [Maxima] intfudu ignores logabs In-Reply-To: References: <4D92F80D.6010906@geogebra.org> Message-ID: <4D93269E.1080202@geogebra.org> Thanks for the quick help, this seems to do the trick :) On 03/30/2011 01:30 PM, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > >> I'm using the "intfudu" function from the "partition.mac" file for my >> integrals (as it sometimes yields "nicer" results, see >> http://www.math.utexas.edu/pipermail/maxima/2011/023943.html), but it >> seems to ignore the value of the logabs-setting: > intfudu stores antiderivatives in a Maxima hashtable, so it's possible to modify > intfudu at a command line. > > (%i7) load(partition)$ > > Find the name of the Maxima hashtable > > (%i8) arrays; > (%o8) [intable,intable2] > > We need to modify intable; look at intable["^"] > > (%i9) intable["^"]; > (%o9) lambda([u,v],if freeof(%voi,u) then [u^v/log(u),diff(v,%voi)] else if freeof(%voi,v) then if v#-1 then [u^(1+v)/(1+v),diff(u,%voi)] else [log(u),diff(u,%voi)] ) > > Cut and paste a new value for intable["^"] > > (%i10) intable["^"] : lambda([u,v],if freeof(%voi,u) then [u^v/log(u),diff(v,%voi)] else if freeof(%voi,v) then if v#-1 then [u^(1+v)/(1+v),diff(u,%voi)] else [log(if logabs then abs(u) else u),diff(u,%voi)] ); > > Finally, check your work: > > (%i11) intfudu(1/x, x), logabs : false; > (%o11) log(x) > > (%i12) intfudu(1/x,x), logabs : true; > (%o12) log(abs(x)) > > --Barton Willis > From toy.raymond at gmail.com Wed Mar 30 09:03:22 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 30 Mar 2011 10:03:22 -0400 Subject: [Maxima] Creating a function? Message-ID: I've been working a little with Michel Talon on enhancing colnew. One of the steps is defining a function to return each row of the Jacobian of the boundary conditions. In Michel's example, the boundary conditions are expressed as the vector function g(z) := [z[2] - 2.0d0*z[1]*(v-z[3]-z[4]), z[2] - 2.0d0*z[1]*z[3], z[1] - 1.0d0, z[2] - 2.0d0*z[1]*z[4]]; The function we want is then dg:jacobian(g(z), [z[1],z[2],z[3],z[4]]); dgsub(i, z) := row(dg, i)[1]; However dgsub doesn't work as we need: dgsub(1, w) -> [-2.0*(-z[4]-z[3]+0.1),1,2.0*z[1],2.0*z[1]] What is the correct way to define the function dgsub? I did find that the following definition does what we need: dgsub(i,z) := ev(row(dg, i)[1]); dgsub(1,w) -> [-2.0*(-w[4]-w[3]+0.1),1,2.0*w[1],2.0*w[1]]$ dgsub(1,[1,2,3,4]) -> [13.8, 1, 2.0, 2.0] Ray From macrakis at alum.mit.edu Wed Mar 30 09:22:45 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 30 Mar 2011 10:22:45 -0400 Subject: [Maxima] Creating a function? In-Reply-To: References: Message-ID: Could we rename colnew to something more intuitive? colnew sounds like it has something to do with new columns (e.g. in a matrix). I realize that it is an existing Fortran library, but we don't need to be restricted by IBM 7090 conventions (six BCD characters ). If it is important that the name be preserved because people are familiar with the Fortran package, how about something like netlib_colnew (telling the user where it came from) or, better, ode_colnew (telling the user what it does). But I'd think it would be even better if the name told us that it solves boundary-value problems for ODEs numerically, e.g. ode_bv_num or something. -s On Wed, Mar 30, 2011 at 10:03, Raymond Toy wrote: > > I've been working a little with Michel Talon on enhancing colnew. One > of the steps is defining a function to return each row of the Jacobian > of the boundary conditions. > > In Michel's example, the boundary conditions are expressed as the > vector function > > g(z) := [z[2] - 2.0d0*z[1]*(v-z[3]-z[4]), z[2] - 2.0d0*z[1]*z[3], > z[1] - 1.0d0, z[2] - 2.0d0*z[1]*z[4]]; > > The function we want is then > > dg:jacobian(g(z), [z[1],z[2],z[3],z[4]]); > dgsub(i, z) := row(dg, i)[1]; > > However dgsub doesn't work as we need: > > dgsub(1, w) -> [-2.0*(-z[4]-z[3]+0.1),1,2.0*z[1],2.0*z[1]] > > What is the correct way to define the function dgsub? > > I did find that the following definition does what we need: > > dgsub(i,z) := ev(row(dg, i)[1]); > > dgsub(1,w) -> [-2.0*(-w[4]-w[3]+0.1),1,2.0*w[1],2.0*w[1]]$ > > dgsub(1,[1,2,3,4]) -> [13.8, 1, 2.0, 2.0] > > > 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 willisb at unk.edu Wed Mar 30 11:11:02 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 30 Mar 2011 11:11:02 -0500 Subject: [Maxima] Creating a function? In-Reply-To: References: Message-ID: maxima-bounces at math.utexas.edu wrote on 03/30/2011 09:03:22 AM: > In Michel's example, the boundary conditions are expressed as the > vector function > > g(z) := [z[2] - 2.0d0*z[1]*(v-z[3]-z[4]), z[2] - 2.0d0*z[1]*z[3], > z[1] - 1.0d0, z[2] - 2.0d0*z[1]*z[4]]; > It's tempting to use z[1], z[2], ... as subscripted variables, but doing this will cause bugs. Example: What if a user does the perfectly reasonable: (%i1) z[1,2] : 42; (%o1) 42 (%i2) g(z) := [z[2] - 2.0d0*z[1]*(v-z[3]-z[4]), z[2] - 2.0d0*z[1]*z[3], z[1] - 1.0d0, z[2] - 2.0d0*z[1]*z[4]]$ (%i3) g(z); evaluation: array z must have 2 indices; found: z[2] Or suppose (%i1) is z[1] : 42? I'd guess this would cause an error that the user might not notice. Also, xxx[i] is a bug waiting to happen: (%i1) x[1] : %pi; (%o1) %pi (%i2) x : [a,b,c]; (%o2) [a,b,c] (%i3) x[1]; (%o3) %pi It's much much better to use inpart. > The function we want is then > > dg:jacobian(g(z), [z[1],z[2],z[3],z[4]]); > dgsub(i, z) := row(dg, i)[1]; The free variable (z) in dgsub looks like a bug waiting to happen. Should dgsub have another argument? But I'm not sure what dgsub is suppose to do. Sorry to be so negative, nonhelpful, and grumpy. --Barton From hbaker1 at pipeline.com Wed Mar 30 12:14:00 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Wed, 30 Mar 2011 10:14:00 -0700 Subject: [Maxima] infeval:true v. ev(%,infeval) In-Reply-To: References: Message-ID: Perhaps the manual could indicate the difference between the two? The manual seems to indicate that abc,flag1,flag2,flag3; is equivalent to ev(abc,flag1,flag2,flag3); At 08:52 PM 3/29/2011, Stavros Macrakis wrote: >ev(xxx,yyy) can mean many things. It can be (more or less) equivalent to block([yyy:true],xxx) or to yyy(xxx) or various other things. > >In the case of infeval, it is just an option setting to ev, and *not* equivalent to xxx,infeval:true or infeval(xxx). > >Ev is just a hodgepodge of functionality, some of which (alas!) is only accessible through it, e.g. infeval. > > -s > >On Mon, Mar 28, 2011 at 13:10, Henry Baker wrote: >Is there any reason why > >ev(...expression...,infeval) > >should be strictly more powerful than > >infeval:true; >...expression...; > >For some reason, merely assigning infeval:true didn't produce the fully eval'ed expression, but ev(...expression...,infeval) did. From toy.raymond at gmail.com Wed Mar 30 12:39:11 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 30 Mar 2011 13:39:11 -0400 Subject: [Maxima] Creating a function? References: Message-ID: >>>>> "Stavros" == Stavros Macrakis writes: Stavros> Could we rename colnew to something more intuitive? Stavros> ?colnew sounds like it has something to do with new Stavros> columns (e.g. in a matrix). ?I realize that it is an Stavros> existing Fortran library, but we don't need to be Stavros> restricted by IBM 7090 conventions (six BCD characters). Yeah, we can easily change the name to something else like say bvp_colnew since it solves boundary value problems. While colnew (Fortran) might be excellent quality, the interface from maxima still needs lots of work. I'll change the name after the interface is updated. Ray From toy.raymond at gmail.com Wed Mar 30 12:47:15 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 30 Mar 2011 13:47:15 -0400 Subject: [Maxima] Creating a function? References: Message-ID: >>>>> "Barton" == Barton Willis writes: Barton> maxima-bounces at math.utexas.edu wrote on 03/30/2011 Barton> 09:03:22 AM: >> In Michel's example, the boundary conditions are expressed as >> the vector function >> >> g(z) := [z[2] - 2.0d0*z[1]*(v-z[3]-z[4]), z[2] - >> 2.0d0*z[1]*z[3], z[1] - 1.0d0, z[2] - 2.0d0*z[1]*z[4]]; >> Barton> It's tempting to use z[1], z[2], ... as subscripted Barton> variables, but doing this will cause bugs. Example: What Barton> if a user does the perfectly reasonable: [snip other issues] >> The function we want is then >> >> dg:jacobian(g(z), [z[1],z[2],z[3],z[4]]); dgsub(i, z) := >> row(dg, i)[1]; Yeah, these are all good issues that need to be dealt with. This was done this way because that's how the original Fortran code is arranged and matching it made it much easier to verify that the interface worked. It shouldn't be hard to expect a zk instead of z[k]. Barton> The free variable (z) in dgsub looks like a bug waiting to Barton> happen. Should dgsub have another argument? But I'm not Barton> sure what dgsub is suppose to do. dgsub(i, z) is supposed compute the i'th row of the Jabobian of the boundary conditions vector g(z) (or g(z1,z2,z3,z4) in your new world). The Fortran code expects a function dgsub to compute this. Of course, in maxima interface, we could just ask the user to supply g(z) and have maxima compute the jacobian, although that's not so good if g(z) is a piecewise function. The interface could just supply the Jacobian itself and have an internal function dgsub that extracts the appropriate row. Actually, I think this is a nicer interface. Barton> Sorry to be so negative, nonhelpful, and grumpy. I will think about changing the colnew interface to take into account your comments, once Michel (mostly) and I have a new version that supports the continuation feature of colnew. Ray From macrakis at alum.mit.edu Wed Mar 30 13:21:50 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 30 Mar 2011 14:21:50 -0400 Subject: [Maxima] infeval:true v. ev(%,infeval) In-Reply-To: References: Message-ID: Sorry, I got this wrong. ev(..., infeval) is in fact equivalent to ev(..., infeval=true), which is equivalent to block([infeval:true], ev(...) ). It is simply not equivalent to block([infeval:true], ... ). In this case, the documentation is actually fairly clear: infeval is a flag that controls the behavior of ev, not of regular evaluation. Thus, we have: ev(a,a=b,b=c) => b ev(a,a=b,b=c,infeval) => c ev(a,a=b,b=c,infeval=true) => c infeval: true$ ev(a,a=b,b=c) => c <<< infeval changes the behavior of ev Do I think any of this is sensible? No. 'ev' is a disaster.... -s On Wed, Mar 30, 2011 at 13:14, Henry Baker wrote: > Perhaps the manual could indicate the difference between the two? > > The manual seems to indicate that > > abc,flag1,flag2,flag3; > > is equivalent to > > ev(abc,flag1,flag2,flag3); > > At 08:52 PM 3/29/2011, Stavros Macrakis wrote: > >ev(xxx,yyy) can mean many things. It can be (more or less) equivalent to > block([yyy:true],xxx) or to yyy(xxx) or various other things. > > > >In the case of infeval, it is just an option setting to ev, and *not* > equivalent to xxx,infeval:true or infeval(xxx). > > > >Ev is just a hodgepodge of functionality, some of which (alas!) is only > accessible through it, e.g. infeval. > > > > -s > > > >On Mon, Mar 28, 2011 at 13:10, Henry Baker wrote: > >Is there any reason why > > > >ev(...expression...,infeval) > > > >should be strictly more powerful than > > > >infeval:true; > >...expression...; > > > >For some reason, merely assigning infeval:true didn't produce the fully > eval'ed expression, but ev(...expression...,infeval) did. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Wed Mar 30 14:00:44 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 30 Mar 2011 21:00:44 +0200 Subject: [Maxima] Creating a function? References: Message-ID: Stavros Macrakis wrote: > Could we rename colnew to something more intuitive? colnew sounds like it > has something to do with new columns (e.g. in a matrix). I realize that In scilab it is called bvode, if it may help. Unfortunately this does not solve the complexity of the interface. See for example the inline manual here: http://help.scilab.org/docs/5.3.0/en_US/bvode.html By the way i see they have worked on trying to provide a simplified interface and more examples. -- Michel Talon From hbaker1 at pipeline.com Wed Mar 30 18:28:03 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Wed, 30 Mar 2011 16:28:03 -0700 Subject: [Maxima] Does 'freeof' have any friends? Message-ID: I'm looking for a function (perhaps called 'freevars') that does much of the same work as 'freeof', but simply returns a list of all the free variables in an expression. Obviously, 'x' is not free in integrate(x^2,x,0,t), but 't' is. Thus, every element v in freevars(exp) has not(freeof(v,exp)), and there are no other variables vext not in freevars(exp) such that not(freeof(vext,exp)). Does such a function exist in Maxima/Macsyma? (It may only be a Lisp function, not a Maxima function; this is ok -- I'll figure out how to call the Lisp function.) From willisb at unk.edu Wed Mar 30 19:13:26 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 30 Mar 2011 19:13:26 -0500 Subject: [Maxima] Does 'freeof' have any friends? In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I'm?looking?for?a?function?(perhaps?called?'freevars')?that?does?much?of >the?same?work?as?'freeof',?but?simply?returns?a?list?of?all?the?free >variables?in?an?expression.?? Maybe you can build what you need using the option variable listdummyvars. Here is a start: (%i12) free_vars(e) := block([listdummyvars : false, listconstvars : false], listofvars(e))$ (%i15) free_vars(integrate(%pi * f(x + h),x,p,q+w)); (%o15) [h,p,q,w] You might search the bug list for bugs associated with listdummyvars : false. --Barton From hbaker1 at pipeline.com Wed Mar 30 19:29:05 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Wed, 30 Mar 2011 17:29:05 -0700 Subject: [Maxima] Does 'freeof' have any friends? In-Reply-To: References: Message-ID: If the function listofvars(expression) & associated switches is documented and supported, then it should work for my needs. Thanks! At 05:13 PM 3/30/2011, Barton Willis wrote: >-----maxima-bounces at math.utexas.edu wrote: ----- > >>I'm looking for a function (perhaps called 'freevars') that does much of >>the same work as 'freeof', but simply returns a list of all the free >>variables in an expression. > >Maybe you can build what you need using the option variable listdummyvars. Here is >a start: > > (%i12) free_vars(e) := block([listdummyvars : false, listconstvars : false], listofvars(e))$ > > (%i15) free_vars(integrate(%pi * f(x + h),x,p,q+w)); > (%o15) [h,p,q,w] > >You might search the bug list for bugs associated with listdummyvars : false. > >--Barton From robert.dodier at gmail.com Thu Mar 31 01:11:55 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 31 Mar 2011 00:11:55 -0600 Subject: [Maxima] Creating a function? In-Reply-To: References: Message-ID: On 3/30/11, Raymond Toy wrote: > dg:jacobian(g(z), [z[1],z[2],z[3],z[4]]); > dgsub(i, z) := row(dg, i)[1]; > > However dgsub doesn't work as we need: > > dgsub(1, w) -> [-2.0*(-z[4]-z[3]+0.1),1,2.0*z[1],2.0*z[1]] I don't see anything wrong here, for the record. > What is the correct way to define the function dgsub? I would suggest dgsub(i, z) := subst('z = z, row(dg, i)[1]). > I did find that the following definition does what we need: > > dgsub(i,z) := ev(row(dg, i)[1]); ev has the right effect in this case, but it is easy for unintended side effects to creep in. subst('z = ...) affects only z, while ev can affect all variables and function calls. HTH Robert Dodier From willisb at unk.edu Thu Mar 31 06:16:07 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 31 Mar 2011 06:16:07 -0500 Subject: [Maxima] unsimplifed result from expand In-Reply-To: <1301152055.1867.5.camel@dieter> References: <1300754002.5852.3.camel@wigner> <4D880851.9060708@gmail.com> , <1301075171.9048.0.camel@wigner> , <1301152055.1867.5.camel@dieter> Message-ID: Another example: (%i32) p : z^3-2^(3/2)*%i*z^2-4*z^2+2^(5/2)*%i*z+2*z; (%o32) z^3-2^(3/2)*%i*z^2-4*z^2+2^(5/2)*%i*z+2*z (%i33) divide(p, (z-2-sqrt(2)*%i),z); (%o33) [z^2+((sqrt(2)-2^(3/2))*%i-2)*z,-(2^(3/2)-2^(5/2))*%i-2^(3/2)*%i] We need to apply expand twice to simplify the remainder to zero: (%i34) expand(%); (%o34) [z^2-2^(3/2)*%i*z+sqrt(2)*%i*z-2*z,2^(5/2)*%i-2^(5/2)*%i] (%i35) expand(%); (%o35) [z^2-2^(3/2)*%i*z+sqrt(2)*%i*z-2*z,0] Also: (%i37) gcd(p, diff(p,z),z), gcd : spmod, algebraic : true; (%o37) 1 (%i38) gcd(p, diff(p,z),z), gcd : subres, algebraic : true; (%o38) z-sqrt(2)*%i-2 --Barton From toy.raymond at gmail.com Thu Mar 31 08:27:17 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 31 Mar 2011 09:27:17 -0400 Subject: [Maxima] Creating a function? References: Message-ID: >>>>> "Robert" == Robert Dodier writes: >> What is the correct way to define the function dgsub? Robert> I would suggest dgsub(i, z) := subst('z = z, row(dg, Robert> i)[1]). dgsub(1,[1,2,3,4]) -> [-2.0*(-[1,2,3,4][4]-[1,2,3,4][3]+0.1),1,2.0*[1,2,3,4][1],2.0*[1,2,3,4][1]] The only way I could get that to evaluate down to a number was to use (gasp!) ev. Robert> ev has the right effect in this case, but it is easy for Robert> unintended side effects to creep in. subst('z = ...) Robert> affects only z, while ev can affect all variables and Robert> function calls. Yeah, I was hestitating to use ev here, but nothing else I tried worked. Anyway, I think it's time to use Barton's suggestions and get rid of the subscripted variables. Ray From shinabe.munehiro at hotmail.co.jp Fri Apr 1 06:27:30 2011 From: shinabe.munehiro at hotmail.co.jp (=?iso-2022-jp?B?GyRCSUpJdBsoQiAbJEI9IUduGyhC?=) Date: Fri, 1 Apr 2011 20:27:30 +0900 Subject: [Maxima] a package of functions for vector analysis. Message-ID: we have two questions. 1)I loaded the package of ("vect") .but the dot operator "." was not a commutative operator as the following mentioned below. Documentation Categories tell "Warning: the vect package declares the dot operator . to be a commutative operator." Please teach me the reason. (%i1)kill(all)$ load(vect)$ declare([ f, g,p,q], nonscalar) $ f .g-g .f ; declare(".",commutative); f .g-g .f ; (%o3) f . g-g . f (%o4) done (%o5) 0 2) I try "demo(vect);",but that didn't operate.Why? demo(vect); read and interpret file: #pC:/PROGRA~1/MAXIMA~1.2/share/maxima/5.23.2/share/vector/vect.dem At the '_' prompt, type ';' and to get next demonstration. (%i2) if get('vect,'version)=false then load("vect") _ ******************************************************************************** 5.23.2 Manual:25 Documentation Categories 25. Matrices and Linear Algebra 25.1.2 Vectors vect is a package of functions for vector analysis. load ("vect") loads this package, and demo ("vect") displays a demonstration. The vector analysis package can combine and simplify symbolic expressions including dot products and cross products, together with the gradient, divergence, curl, and Laplacian operators. The distribution of these operators over sums or products is governed by several flags, as are various other expansions, including expansion into components in any specific orthogonal coordinate systems. There are also functions for deriving the scalar or vector potential of a field. The vect package contains these functions: vectorsimp, scalefactors, express, potential, and vectorpotential. Warning: the vect package declares the dot operator . to be a commutative operator. -------------- next part -------------- An HTML attachment was scrubbed... URL: From shinabe.munehiro at hotmail.co.jp Fri Apr 1 08:30:41 2011 From: shinabe.munehiro at hotmail.co.jp (=?iso-2022-jp?B?GyRCSUpJdBsoQiAbJEI9IUduGyhC?=) Date: Fri, 1 Apr 2011 22:30:41 +0900 Subject: [Maxima] a package of functions for vector analysis. In-Reply-To: References: Message-ID: we have two questions. 1)I loaded the package of ("vect") .but the dot operator "." was not a commutative operator as the following mentioned below. Documentation Categories tell "Warning: the vect package declares the dot operator . to be a commutative operator." Please teach me the reason. (%i1)kill(all)$ load(vect)$ declare([ f, g,p,q], nonscalar) $ f .g-g .f ; declare(".",commutative); f .g-g .f ; (%o3) f . g-g . f (%o4) done (%o5) 0 2) I try "demo(vect);",but that didn't operate.Why? demo(vect); read and interpret file: #pC:/PROGRA~1/MAXIMA~1.2/share/maxima/5.23.2/share/vector/vect.dem At the '_' prompt, type ';' and to get next demonstration. (%i2) if get('vect,'version)=false then load("vect") _ ******************************************************************************** 5.23.2 Manual:25 Documentation Categories 25. Matrices and Linear Algebra 25.1.2 Vectors vect is a package of functions for vector analysis. load ("vect") loads this package, and demo ("vect") displays a demonstration. The vector analysis package can combine and simplify symbolic expressions including dot products and cross products, together with the gradient, divergence, curl, and Laplacian operators. The distribution of these operators over sums or products is governed by several flags, as are various other expansions, including expansion into components in any specific orthogonal coordinate systems. There are also functions for deriving the scalar or vector potential of a field. The vect package contains these functions: vectorsimp, scalefactors, express, potential, and vectorpotential. Warning: the vect package declares the dot operator . to be a commutative operator. -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdieterkaiser at web.de Fri Apr 1 16:40:44 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 01 Apr 2011 23:40:44 +0200 Subject: [Maxima] a package of functions for vector analysis. In-Reply-To: References: Message-ID: <1301694044.1626.6.camel@dieter> Am Freitag, den 01.04.2011, 22:30 +0900 schrieb ?? ??: > we have two questions. > > 1)I loaded the package of ("vect") .but the dot operator "." was not > a commutative operator as the following mentioned below. > Documentation Categories tell "Warning: the vect package declares the > dot operator . to be a commutative operator." > Please teach me the reason. Some times ago, the declaration of the dot operator to be commutative has been cut out, because loading the package with this declaration causes unexpected bugs. But the documentation has not been updated. I will commit an update of the documentation soon. > > (%i1)kill(all)$ > load(vect)$ > declare([ f, g,p,q], nonscalar) $ > f .g-g .f ; > declare(".",commutative); > f .g-g .f ; > > (%o3) f . g-g . f > (%o4) done > (%o5) 0 > > 2) I try "demo(vect);",but that didn't operate.Why? > demo(vect); > read and interpret file: > #pC:/PROGRA~1/MAXIMA~1.2/share/maxima/5.23.2/share/vector/vect.dem > At the '_' prompt, type ';' and (%i2) if get('vect,'version)=false then load("vect") > _ You have to press the enter button each time the input prompt "_" appears to get the demos step by step. Dieter Kaiser From rene.grothmann at ku-eichstaett.de Sat Apr 2 00:20:21 2011 From: rene.grothmann at ku-eichstaett.de (Rene Grothmann) Date: Sat, 2 Apr 2011 07:20:21 +0200 Subject: [Maxima] Integration Problem Message-ID: <000001cbf0f5$aab73be0$0025b3a0$@grothmann@ku-eichstaett.de> On of the previous versions of Maxima knew how to find integrate(sqrt(x^5)*sqrt(1-x),x) But the current version cannot do this. Is there a way to get it? R.G. From hbaker1 at pipeline.com Sat Apr 2 10:31:53 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Sat, 02 Apr 2011 08:31:53 -0700 Subject: [Maxima] Integration Problem In-Reply-To: <000001cbf0f5$aab73be0$0025b3a0$@grothmann@ku-eichstaett.de > References: <000001cbf0f5$aab73be0$0025b3a0$@grothmann@ku-eichstaett.de> Message-ID: Do examples like this find their way into the regression test suite? I'd love to think that squashed bugs will remain squashed in the future... At 10:20 PM 4/1/2011, Rene Grothmann wrote: >On of the previous versions of Maxima knew how to find > >integrate(sqrt(x^5)*sqrt(1-x),x) > >But the current version cannot do this. Is there a way to get it? > >R.G. From drdieterkaiser at web.de Sat Apr 2 10:39:43 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 02 Apr 2011 17:39:43 +0200 Subject: [Maxima] Integration Problem In-Reply-To: <000001cbf0f5$aab73be0$0025b3a0$@grothmann@ku-eichstaett.de> References: <000001cbf0f5$aab73be0$0025b3a0$@grothmann@ku-eichstaett.de> Message-ID: <1301758783.1863.25.camel@dieter> Am Samstag, den 02.04.2011, 07:20 +0200 schrieb Rene Grothmann: > On of the previous versions of Maxima knew how to find > > integrate(sqrt(x^5)*sqrt(1-x),x) > > But the current version cannot do this. Is there a way to get it? I think this has changed because expression like sqrt(1/x) and 1/sqrt(x) are no longer treated as equivalent. It is the flag radexpand, which switches on simplifications like sqrt(1/x) -> 1/sqrt(x). Therefore we get: (%i1) integrate(sqrt(x^5)*sqrt(1-x),x), radexpand:all; (%o1) -(-15*sqrt(1-x)/sqrt(x)+73*(1-x)^(3/2)/x^(3/2)+55*(1-x)^(5/2)/x^(5/2) +15*(1-x)^(7/2)/x^(7/2)) /(768*(1-x)/x+1152*(1-x)^2/x^2+768*(1-x)^3/x^3+192*(1-x)^4/x^4 +192) -5*atan(sqrt(1-x)/sqrt(x))/64 Another possibility is to assume the variable x to be positive: (%i1) assume(x>0); (%o1) [x > 0] (%i2) integrate(sqrt(x^5)*sqrt(1-x),x); (%o2) -(-15*sqrt(1-x)/sqrt(x)+73*(1-x)^(3/2)/x^(3/2)+55*(1-x)^(5/2)/x^(5/2) +15*(1-x)^(7/2)/x^(7/2)) /(768*(1-x)/x+1152*(1-x)^2/x^2+768*(1-x)^3/x^3+192*(1-x)^4/x^4 +192) -5*atan(sqrt(1-x)/sqrt(x))/64 Dieter Kaiser From fateman at eecs.berkeley.edu Sat Apr 2 11:01:40 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 02 Apr 2011 09:01:40 -0700 Subject: [Maxima] Integration Problem In-Reply-To: <1301758783.1863.25.camel@dieter> References: <000001cbf0f5$aab73be0$0025b3a0$@grothmann@ku-eichstaett.de> <1301758783.1863.25.camel@dieter> Message-ID: <4D974864.9080801@eecs.berkeley.edu> Commercial Macsyma asks "is x positive or negative". If positive, returns a large answer. If negative, returns the expression unintegrated. Mathematica 7.0 does not ask for the sign of x. I do not know if its answer is correct for all x. RJF From macrakis at alum.mit.edu Sat Apr 2 11:28:03 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 2 Apr 2011 12:28:03 -0400 Subject: [Maxima] Integration Problem In-Reply-To: <1301758783.1863.25.camel@dieter> References: <1301758783.1863.25.camel@dieter> Message-ID: Don't the expressions sqrt(1/x) and 1/sqrt(x) denote the same analytic function over C-{0}? It is only when we try to restrict to a particular sheet that we run into problems, right? So shouldn't the default be radexpand:all? -s On Sat, Apr 2, 2011 at 11:39, Dieter Kaiser wrote: > Am Samstag, den 02.04.2011, 07:20 +0200 schrieb Rene Grothmann: > > On of the previous versions of Maxima knew how to find > > > > integrate(sqrt(x^5)*sqrt(1-x),x) > > > > But the current version cannot do this. Is there a way to get it? > > I think this has changed because expression like sqrt(1/x) and 1/sqrt(x) > are no longer treated as equivalent. > > It is the flag radexpand, which switches on simplifications like > sqrt(1/x) -> 1/sqrt(x). Therefore we get: > > (%i1) integrate(sqrt(x^5)*sqrt(1-x),x), radexpand:all; > > (%o1) > -(-15*sqrt(1-x)/sqrt(x)+73*(1-x)^(3/2)/x^(3/2)+55*(1-x)^(5/2)/x^(5/2) > +15*(1-x)^(7/2)/x^(7/2)) > /(768*(1-x)/x+1152*(1-x)^2/x^2+768*(1-x)^3/x^3+192*(1-x)^4/x^4 > +192) > -5*atan(sqrt(1-x)/sqrt(x))/64 > > Another possibility is to assume the variable x to be positive: > > (%i1) assume(x>0); > (%o1) [x > 0] > > (%i2) integrate(sqrt(x^5)*sqrt(1-x),x); > (%o2) > -(-15*sqrt(1-x)/sqrt(x)+73*(1-x)^(3/2)/x^(3/2)+55*(1-x)^(5/2)/x^(5/2) > +15*(1-x)^(7/2)/x^(7/2)) > /(768*(1-x)/x+1152*(1-x)^2/x^2+768*(1-x)^3/x^3+192*(1-x)^4/x^4 > +192) > -5*atan(sqrt(1-x)/sqrt(x))/64 > > Dieter Kaiser > > > _______________________________________________ > 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 drdieterkaiser at web.de Sat Apr 2 12:11:01 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 02 Apr 2011 19:11:01 +0200 Subject: [Maxima] Integration Problem In-Reply-To: <4D974864.9080801@eecs.berkeley.edu> References: <000001cbf0f5$aab73be0$0025b3a0$@grothmann@ku-eichstaett.de> <1301758783.1863.25.camel@dieter> <4D974864.9080801@eecs.berkeley.edu> Message-ID: <1301764261.4065.17.camel@dieter> Am Samstag, den 02.04.2011, 09:01 -0700 schrieb Richard Fateman: > Commercial Macsyma asks "is x positive or negative". If positive, > returns a large answer. If negative, > returns the expression unintegrated. > > Mathematica 7.0 does not ask for the sign of x. I do not know if its > answer is correct for all x. > > RJF integrate(sqrt(x^5)*sqrt(1-x),x) This type of integral is done in the routine chebyf which is called from the integrator. It should be possible to generalize the routine chebyf to handle these integrals more complete. Dieter Kaiser From toy.raymond at gmail.com Sat Apr 2 12:30:14 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 02 Apr 2011 13:30:14 -0400 Subject: [Maxima] Integration Problem References: <000001cbf0f5$aab73be0$0025b3a0$@grothmann@ku-eichstaett.de> <000001cbf0f5$aab73be0$0025b3a0$@grothmann@ku-eichstaett.de > Message-ID: >>>>> "Henry" == Henry Baker writes: Henry> Do examples like this find their way into the regression Henry> test suite? I'd love to think that squashed bugs will Henry> remain squashed in the future... It depends, but I see that most developers who fix a bug like this will add it to the testsuite so it stays fixed. Same for bugs that are listed in the bug tracker on sourceforge. Ray From leon.magiera at wp.pl Sat Apr 2 13:23:16 2011 From: leon.magiera at wp.pl (leon.magiera at wp.pl) Date: Sat, 02 Apr 2011 20:23:16 +0200 Subject: [Maxima] Integration Problem In-Reply-To: <000001cbf0f5$aab73be0$0025b3a0$@grothmann@ku-eichstaett.de> <1301758783.1863.25.camel@dieter> <4D974864.9080801@eecs.berkeley.edu> <1301764261.4065.17.camel@dieter> References: <000001cbf0f5$aab73be0$0025b3a0$@grothmann@ku-eichstaett.de> <1301758783.1863.25.camel@dieter> <4D974864.9080801@eecs.berkeley.edu> <1301764261.4065.17.camel@dieter> Message-ID: <4d976994b77ec1.48955464@wp.pl> Derive 6.1 does not ask for the sign of x. Its answer is 5??ASIN(??x)/64 + ??x????(1 - x)??(48??x^3 - 8??x^2 - 10??x - 15)/192 Leon Dnia 2-04-2011 o godz. 19:11 Dieter Kaiser napisa??(a): > Am Samstag, den 02.04.2011, 09:01 -0700 schrieb Richard Fateman: > > Commercial Macsyma asks "is x positive or negative". If positive, > > returns a large answer. If negative, > > returns the expression unintegrated. > > > > Mathematica 7.0 does not ask for the sign of x. I do not know if its > > answer is correct for all x. > > > > RJF > > integrate(sqrt(x^5)*sqrt(1-x),x) > > This type of integral is done in the routine chebyf which is called from > the integrator. It should be possible to generalize the routine chebyf > to handle these integrals more complete. > > Dieter Kaiser > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From leon.magiera at wp.pl Sat Apr 2 13:45:27 2011 From: leon.magiera at wp.pl (leon.magiera at wp.pl) Date: Sat, 02 Apr 2011 20:45:27 +0200 Subject: [Maxima] Integration Problem In-Reply-To: <000001cbf0f5$aab73be0$0025b3a0$@grothmann@ku-eichstaett.de> <1301758783.1863.25.camel@dieter> <4D974864.9080801@eecs.berkeley.edu> <1301764261.4065.17.camel@dieter> <4d976994b77ec1.48955464@wp.pl> References: <000001cbf0f5$aab73be0$0025b3a0$@grothmann@ku-eichstaett.de> <1301758783.1863.25.camel@dieter> <4D974864.9080801@eecs.berkeley.edu> <1301764261.4065.17.camel@dieter> <4d976994b77ec1.48955464@wp.pl> Message-ID: <4d976ec775aea0.42255795@wp.pl> My mistake. Derive 6.1 does not ask for the sign of x. Its correct answer is 5*asin(sqrt(x))/64 + sqrt(x)*sqrt(1 - x)*(48*x^3 - 8*x^2 - 10*x - 15)/192 Leon Dnia 2-04-2011 o godz. 20:23 leon.magiera at wp.pl napisa?(a): > Derive 6.1 does not ask for the sign of x. Its answer is > > 5??ASIN(??x)/64 + ??x????(1 - x)??(48??x^3 - 8??x^2 - 10??x - 15)/192 > > Leon > > Dnia 2-04-2011 o godz. 19:11 Dieter Kaiser napisa??(a): > > Am Samstag, den 02.04.2011, 09:01 -0700 schrieb Richard Fateman: > > > Commercial Macsyma asks "is x positive or negative". If positive, > > > returns a large answer. If negative, > > > returns the expression unintegrated. > > > > > > Mathematica 7.0 does not ask for the sign of x. I do not know if its > > > answer is correct for all x. > > > > > > RJF > > > > integrate(sqrt(x^5)*sqrt(1-x),x) > > > > This type of integral is done in the routine chebyf which is called from > > the integrator. It should be possible to generalize the routine chebyf > > to handle these integrals more complete. > > > > Dieter Kaiser > > > > > > > > > > _______________________________________________ > > 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 talon at lpthe.jussieu.fr Sat Apr 2 17:24:41 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sun, 03 Apr 2011 00:24:41 +0200 Subject: [Maxima] Integration Problem References: <1301758783.1863.25.camel@dieter> Message-ID: Stavros Macrakis wrote: > Don't the expressions sqrt(1/x) and 1/sqrt(x) denote the same analytic > function over C-{0}? > > It is only when we try to restrict to a particular sheet that we run into > problems, right? > > So shouldn't the default be radexpand:all? I agree completely to that. They agree on x>0 and thus by analytic continuation they agree on a common sector of definition. It is when trying to define a particular determination on the sector C - {x<0} that one encounters problems, which are of conventional origin. When using a CAS one expects the computer to find "simplifications" one is not aware of, and these conventions get in the way of such simplifications, which is a pity. In particular maple has the simplify(***,symbolic) to simplify expressions without any regards to branches of multivalued functions and it is very useful. -- Michel Talon From hbaker1 at pipeline.com Sat Apr 2 18:50:05 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Sat, 02 Apr 2011 16:50:05 -0700 Subject: [Maxima] quote doesn't seem to work anymore Message-ID: I seem to recall that 'integrate(x^2,x); used to return the _un_ integrated form, while integrate(x^2,x); would return the integrated form, if possible. It appears that the quoted form no longer works. From hbaker1 at pipeline.com Sat Apr 2 19:23:13 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Sat, 02 Apr 2011 17:23:13 -0700 Subject: [Maxima] sign/compare/maybe/is/rectform inconsistencies Message-ID: kill(all); done; sign(x); pnz; compare(x,0); unknown; maybe(x>0); unknown; rectform(x); x; /* x is assumed real by default. */ declare(x,complex); done; sign(x); pnz; compare(x,0); unknown; maybe(x>0); unknown; rectform(x); realpart(x) + %i imagpart(x); assume(x>0); [x > 0]; sign(x); pos; /* assume seems to have forced imagpart(x)=0. */ compare(x,0); >; /* assume seems to have forced imagpart(x)=0. */ maybe(x>0); unknown: /* ???? */ rectform(x); realpart(x) + %i imagpart(x); /* ???? */ From willisb at unk.edu Sat Apr 2 19:51:01 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 2 Apr 2011 19:51:01 -0500 Subject: [Maxima] quote doesn't seem to work anymore In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I?seem?to?recall?that > >'integrate(x^2,x); > >used?to?return?the?_un_?integrated?form,?while > >integrate(x^2,x); > >would?return?the?integrated?form,?if?possible. > >It?appears?that?the?quoted?form?no?longer?works. It works for me: (%i1) 'integrate(x^2,x); (%o1) integrate(x^2,x) Have you loaded abs_integrate or have you put any tellsimp rules on integrate? (%i2) load(abs_integrate)$ (%i3) 'integrate(x^2,x); (%o3) x^3/3 (%i4) build_info(); Maxima version: 5.23.2 Maxima build date: 20:27 2/27/2011 Host type: i686-pc-mingw32 Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.7-dev-r14645M-trunk (WindowsX8632) --Barton From shinabe.munehiro at hotmail.co.jp Sat Apr 2 20:22:38 2011 From: shinabe.munehiro at hotmail.co.jp (Part Marty) Date: Sun, 3 Apr 2011 10:22:38 +0900 Subject: [Maxima] a package of functions for vector analysis. In-Reply-To: <1301694044.1626.6.camel@dieter> References: , , <1301694044.1626.6.camel@dieter> Message-ID: > Some times ago, the declaration of the dot operator to be commutative > has been cut out, because loading the package with this declaration > causes unexpected bugs. But the documentation has not been updated. I > will commit an update of the documentation soon. > I understood it. > > 2) I try "demo(vect);",but that didn't operate.Why? > > demo(vect); > > read and interpret file: > > #pC:/PROGRA~1/MAXIMA~1.2/share/maxima/5.23.2/share/vector/vect.dem > > At the '_' prompt, type ';' and > (%i2) if get('vect,'version)=false then load("vect") > > _ > > You have to press the enter button each time the input prompt "_" > appears to get the demos step by step. > I pressed the enter button .but I can't anything. Please explain the detail. -------------- next part -------------- An HTML attachment was scrubbed... URL: From shinabe.munehiro at hotmail.co.jp Sat Apr 2 20:55:13 2011 From: shinabe.munehiro at hotmail.co.jp (Part Marty) Date: Sun, 3 Apr 2011 10:55:13 +0900 Subject: [Maxima] a package of functions for vector analysis. In-Reply-To: <1301694044.1626.6.camel@dieter> References: , , <1301694044.1626.6.camel@dieter> Message-ID: Dear Dieter Kaiser > You have to press the enter button each time the input prompt "_" > appears to get the demos step by step. > I see that I have to press the Shift+Enter button each time the input prompt "_" appears to get the demos step by step. I set "Shift+Enter evaluate cell" in wxMaxima configuration. Am I right? -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.dalton47 at gmail.com Sun Apr 3 00:51:30 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Sun, 3 Apr 2011 15:51:30 +1000 Subject: [Maxima] Using maxima for high school mathematics Message-ID: <20110403055130.GA13712@gwsc.vic.edu.au> Hi, I'm a blind student in Australia using maxima to complete the year 11 "math methods" course, as the standard touch screen devices are totally inaccessible for me. Maxima has served me very well and I'm enjoying using it. I have a couple of queries though. 1) Is it possible with maxima to find the local minimums/maximums of a graph, along with the absolute/global minimum and maximum? I'm using the command line interface... 2) When graphing with maxima, what is the best way to choose a suitable x range for the plot2d argument? Is it possible to mark the major points of my graphs (tp, min/max, end points, intercepts intersections etc.?) Is there anyway to permanently set some variables like gnuplot_term so I don't have to type so many arguments for the plot2d command? 3) Suppose I have 5 (x,y) coordinates. On the standard casio devices at school these points can be punched in and the user may trial a linear, quadratic or cubic equation to see which is the best fit for the points. The calculator provides a number of how successful the equation was eg. linear, quadratic or cubic. Is it possible to find the equation for a set of points with maxima? 4) Finally, I'm having trouble solving some more complicated equations with maxima. According to my text book there is real solutions. How can I find the real solution for the below equation? Input/output is below. (Note, I'm not familiar with complex numbers.) (%i2) float(solve(x^3-17*x^2-56*x+1153=0)); (%o2) [x = (- 0.86602540378444 %i - 0.5) 1/3 (274.3897100165438 %i - 235.8703703703704) 50.77777777777778 (0.86602540378444 %i - 0.5) + --------------------------------------------- + 5.666666666666667, 1/3 (274.3897100165438 %i - 235.8703703703704) 1/3 x = (0.86602540378444 %i - 0.5) (274.3897100165438 %i - 235.8703703703704) 50.77777777777778 (- 0.86602540378444 %i - 0.5) + ----------------------------------------------- + 5.666666666666667, 1/3 (274.3897100165438 %i - 235.8703703703704) 1/3 x = (274.3897100165438 %i - 235.8703703703704) 50.77777777777778 + --------------------------------------------- + 5.666666666666667] 1/3 (274.3897100165438 %i - 235.8703703703704) If anyone can address any of my questions I would greatly appreciated. Please let me know if I need to provide any more information. Thanks very much. Dan From dbmaxima at gmail.com Sun Apr 3 03:08:15 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Sun, 03 Apr 2011 18:08:15 +1000 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <20110403055130.GA13712@gwsc.vic.edu.au> References: <20110403055130.GA13712@gwsc.vic.edu.au> Message-ID: <4D982AEF.8090204@gmail.com> On 3/04/2011 3:51 PM, Daniel Dalton wrote: > 4) Finally, I'm having trouble solving some more complicated equations > with maxima. According to my text book there is real solutions. How can > I find the real solution for the below equation? Input/output is > below. (Note, I'm not familiar with complex numbers.) Hi Dan, There are at least two ways to attack 4) 1. Float isn't always sufficient with complex numbers. Try rectform(float(expression))). You are left with a small imaginary part due to rounding errors. 2. Use the realroots() function to extract the real roots. It returns rational approximations to the real solution, which can be converted to floating point using float(). Try realroots(x^2-2=0). Do you understand that maxima approximating the irrational number sqrt(2)? (%i1) display2d:false; (%o1) false (%i2) expr:x^3-17*x^2-56*x+1153=0; (%o2) x^3-17*x^2-56*x+1153 = 0 (%i3) rectform(float(solve(expr,x))); (%o3) [x = 1.7763568394002505E-15*%i+9.008409308902849, x = -8.8817841970012523E-16*%i-8.002450376978054, x = 15.99404106807521-8.8817841970012523E-16*%i] (%i4) realroots(expr); (%o4) [x = -268517677/33554432,x = 302272057/33554432,x = 536670963/33554432] (%i5) float(%); (%o5) [x = -8.002450376749039,x = 9.008409291505814,x = 15.9940410554409] David From eric.reyssat at unicaen.fr Sun Apr 3 03:15:43 2011 From: eric.reyssat at unicaen.fr (Eric Reyssat) Date: Sun, 03 Apr 2011 10:15:43 +0200 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <20110403055130.GA13712@gwsc.vic.edu.au> References: <20110403055130.GA13712@gwsc.vic.edu.au> Message-ID: <4D982CAF.40702@unicaen.fr> Hi Daniel, Le 03/04/2011 07:51, Daniel Dalton a ?crit : > 4) Finally, I'm having trouble solving some more complicated equations > with maxima. According to my text book there is real solutions. How can > I find the real solution for the below equation? Input/output is > below. (Note, I'm not familiar with complex numbers.) > > (%i2) float(solve(x^3-17*x^2-56*x+1153=0)); > solve looks for exact solutions of the equation. In case of polynomial of degree three, the solutions may be expressed by radicals, but in some cases we cannot avoid complex radical even to express real roots. Unfortunately, float keeps these "ghost" complex numbers as in your example. When dealing with polynomials, you can use the functions allroots or realroots. The first one gives you a floating point approximation of the roots, the second one a rational approximation (you can then use float). (%i41) p:x^3-17*x^2-56*x+1153; (%o41) x^3-17*x^2-56*x+1153 (%i42) allroots(p); (%o42) [x = 9.008409308902849,x = -8.002450376978056,x = 15.99404106807521] (%i43) float(realroots(p)); (%o43) [x = -8.002450376749039,x = 9.008409291505814,x = 15.9940410554409] Since the values do not agree with good precision, you can use find_root to compute the value of a root in an interval if the function takes values of opposite signs at the endpoints : (%i46) find_root(p,8,10); (%o46) 9.008409308902849 This function find_root is not restricted to polynomial equations. In the same way, the function newton computes the root from a starting approximation ; it is fast and precise if you start from a sufficiently good approximation, but not guaranteed to converge in general. You can use bigfloats to get better approximation. Load the package newton first : (%i47) load(newton)$ (%i48) fpprec:50; (%o48) 50 (%i49) newton(p,9); (%o49) 9.0084093089028481369232506708486782757538026517567b0 Last comment : in the case of polynomials of degree 3, you can usually replace complex radicals by trig functions, using the functions rectform and trigsimp. Then float looks ok : (%i53) float(trigsimp(rectform(solve(p)))); (%o53) [x = 9.00840930890285,x = -8.002450376978054,x = 15.9940410680752] Eric From rswarbrick at gmail.com Sun Apr 3 03:20:44 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sun, 03 Apr 2011 09:20:44 +0100 Subject: [Maxima] a package of functions for vector analysis. References: <1301694044.1626.6.camel@dieter> Message-ID: Part Marty writes: > Dear Dieter Kaiser > > > You have to press the enter button each time the input prompt "_" >> appears to get the demos step by step. >> > > I see that I have to press the Shift+Enter button each time the input > prompt "_" appears to get the demos step by step. > I set "Shift+Enter evaluate cell" in wxMaxima configuration. > Am I right? > Yes. Not many of the core developers use wxMaxima and wxMaxima is the only maxima frontend that requires Shift+Enter to send a command. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From toy.raymond at gmail.com Sun Apr 3 10:11:53 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 03 Apr 2011 11:11:53 -0400 Subject: [Maxima] Using maxima for high school mathematics References: <20110403055130.GA13712@gwsc.vic.edu.au> Message-ID: >>>>> "Daniel" == Daniel Dalton writes: Daniel> 1) Is it possible with maxima to find the local minimums/maximums of a Daniel> graph, along with the absolute/global minimum and maximum? I'm using the Daniel> command line interface... If you have a symbolic expression, can't you compute the derivative and use a numerical method to find the zeroes? You can try solve or mnewton or minpack_solve to find the zeroes. Daniel> 2) When graphing with maxima, what is the best way to choose a suitable Daniel> x range for the plot2d argument? Is it possible to mark the major points Daniel> of my graphs (tp, min/max, end points, intercepts intersections etc.?) Daniel> Is there anyway to permanently set some variables like gnuplot_term so I Daniel> don't have to type so many arguments for the plot2d command? Look at set_plot_option. You can set things like gnuplot_term there. Daniel> 3) Suppose I have 5 (x,y) coordinates. On the standard casio devices at Daniel> school these points can be punched in and the user may trial a linear, Daniel> quadratic or cubic equation to see which is the best fit for the Daniel> points. The calculator provides a number of how successful the equation Daniel> was eg. linear, quadratic or cubic. Is it possible to find the equation Daniel> for a set of points with maxima? Sure, but it looks like there's nothing completely builtin. You can do a least-squares fit using lbfgs or minpack_lsquares to produce the equation. But you'll have to set up the equations appropriately before calling these routines. Ray From l.butler at ed.ac.uk Sun Apr 3 13:02:36 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sun, 3 Apr 2011 19:02:36 +0100 (BST) Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: References: <20110403055130.GA13712@gwsc.vic.edu.au> Message-ID: On Sun, 3 Apr 2011, Raymond Toy wrote: < >>>>> "Daniel" == Daniel Dalton writes: < < Daniel> 1) Is it possible with maxima to find the local minimums/maximums of a < Daniel> graph, along with the absolute/global minimum and maximum? I'm using the < Daniel> command line interface... < < If you have a symbolic expression, can't you compute the derivative < and use a numerical method to find the zeroes? You can try solve or < mnewton or minpack_solve to find the zeroes. < < Daniel> 2) When graphing with maxima, what is the best way to choose a suitable < Daniel> x range for the plot2d argument? Is it possible to mark the major points < Daniel> of my graphs (tp, min/max, end points, intercepts intersections etc.?) < Daniel> Is there anyway to permanently set some variables like gnuplot_term so I < Daniel> don't have to type so many arguments for the plot2d command? < < Look at set_plot_option. You can set things like gnuplot_term there. < < Daniel> 3) Suppose I have 5 (x,y) coordinates. On the standard casio devices at < Daniel> school these points can be punched in and the user may trial a linear, < Daniel> quadratic or cubic equation to see which is the best fit for the < Daniel> points. The calculator provides a number of how successful the equation Btw, a cubic always fits at least as good as a quadratic which fits in turn at least as good as a linear model. If your calculator tells you a linear model fits better than a cubic one, this is because it is using some measuring stick other than goodness-of-fit. < Daniel> was eg. linear, quadratic or cubic. Is it possible to find the equation < Daniel> for a set of points with maxima? < < Sure, but it looks like there's nothing completely builtin. You can < do a least-squares fit using lbfgs or minpack_lsquares to produce the < equation. But you'll have to set up the equations appropriately < before calling these routines. Here is a function that does the job, using the lsquares package. (%i2) load(lsquares); (%o2) "/home/work/maxima/sandbox/git/maxima-git/share/contrib/lsquares.mac" (%i3) lsqn(data,n):=block([poly,a,coeffs,x,est,mse,model], poly:sum(x^i*a[i],i,0,n),coeffs:delete(x,listofvars(poly)), est:lsquares_estimates(data,[x,y],y = poly,coeffs), model:subst(est[1],poly), mse:sum((data[i,2]-subst(x = data[i,1],model))^2,i,1,length(data)) /length(data), [model,mse])$ (%i4) data : genmatrix(lambda([x,y], if y=1 then x else (1+2*x+3*x^2)),6,2); (%o4) matrix([1,6],[2,17],[3,34],[4,57],[5,86],[6,121]) (%i5) lsqn(data,2); (%o5) [3*x^2+2*x+1,0] Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From drdieterkaiser at web.de Sun Apr 3 14:46:27 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 03 Apr 2011 21:46:27 +0200 Subject: [Maxima] Simplifation of v*a^(x+n)+w*a^(x+m) Message-ID: <1301859987.22440.37.camel@dieter> We have a bug report ID: 3247367 "expand returns unsimplified". Two examples are: (%i1) (1-sqrt(5))^3-4*(1-sqrt(5))^2+8, expand; (%o1) 5^(3/2)-5^(3/2) (%i2) 1/sqrt(2)+1/sqrt(2)+1/sqrt(2); (%o2) sqrt(2)+1/sqrt(2) The last result should be 3/sqrt(2). The problem is that we have simplifications for powers of integers like 2/sqrt(2) -> sqrt(2). This type of simplifications causes problems in the routine plusin. The general expression we have to simplify more complete is v*a^(x+n) + w*a^(x+m) -> (v*a^n + w*a^m) * a^x The symbols v, w, n, m, a must be integers. x is any expression. Because of this the factor (v*a^n+w*a^m) is an integer too. I have done an implementation of this type of simplification. The algorithm is a bit tricky, when x+n and x+m are rational numbers. The following shows the complete routine plusin. The additional code can be further optimized, but at first I have tried to get a working algorithm. ; -------------------------------------------------------------------- (defun plusin (x fm) (prog (x1 flag check w xnew n m a x2 v) (setq w 1) (setq v 1) (cond ((mtimesp x) (setq check x) (if (mnump (cadr x)) (setq w (cadr x) x (cddr x)) (setq x (cdr x)))) (t (setq x (ncons x)))) (setq x1 (if (null (cdr x)) (car x) (cons '(mtimes) x)) xnew (list* '(mtimes) w x)) start (cond ((null (cdr fm))) ((and (alike1 x1 (cadr fm)) (null (cdr x))) (go equ)) ;; Implement the simplification of ;; (v*a^(x+n)+w*a^(x+m) -> (v*a^n+w*a^m)*a^x ((and (or (mexptp (setq x2 (cadr fm))) (and (mtimesp x2) (null (cadddr x2)) (integerp (setq v (cadr x2))) (mexptp (setq x2 (caddr x2))))) (integerp (setq a (cadr x2))) (mexptp x1) (equal a (cadr x1)) (integerp (sub (caddr x2) (caddr x1)))) (setq n (if (and (mplusp (caddr x2)) (mnump (cadr (caddr x2)))) (cadr (caddr x2)) (if (mnump (caddr x2)) (caddr x2) 0))) (setq m (if (and (mplusp (caddr x1)) (mnump (cadr (caddr x1)))) (cadr (caddr x1)) (if (mnump (caddr x1)) (caddr x1) 0))) (cond ((integerp n) (setq x1 (mul (addk (mul v (power a n)) (mul w (power a m))) (muln (cons (power a (- m)) x) t))) (go equt2)) (t (multiple-value-bind (n1 d1) (truncate (num1 n) (denom1 n)) (multiple-value-bind (n2 d2) (truncate (num1 m) (denom1 m)) (cond ((equal d1 d2) (setq x1 (mul (add (mul v (power a n1)) (mul w (power a n2))) (power a (div d1 (denom1 n))))) (go equt2)) ((equal d2 -1) (setq n1 (add n1 (div (sub d1 d2) (denom1 n)))) (setq d1 d2) (setq x1 (mul (add (mul v (power a n1)) (mul w (power a n2))) (power a (div d1 (denom1 n))))) (go equt2)) ((equal d1 -1) (setq n2 (add n2 (div (sub d2 d1) (denom1 n)))) (setq d2 d1) (setq x1 (mul (add (mul v (power a n1)) (mul w (power a n2))) (power a (div d1 (denom1 n))))) (go equt2)) (t (merror "Internal error in simplus."))) ))))) ((mtimesp (cadr fm)) (cond ((alike1 x1 (cadr fm)) (go equt)) ((and (mnump (cadadr fm)) (alike x (cddadr fm))) (setq flag t) ; found common factor (go equt)) ((great xnew (cadr fm)) (go gr)))) ((great x1 (cadr fm)) (go gr))) (setq xnew (eqtest (testt xnew) (or check '((foo))))) (return (cdr (rplacd fm (cons xnew (cdr fm))))) gr (setq fm (cdr fm)) (go start) equ (when *debug-simplus* (format t "~&in PLUSIN - equ~%")) (rplaca (cdr fm) (if (equal w -1) (list* '(mtimes simp) 0 x) ;; Call muln to get a simplified product. (if (mtimesp (setq x1 (muln (cons (addk 1 w) x) t))) (testtneg x1) x1))) del (cond ((not (mtimesp (cadr fm))) (go check)) ((onep (cadadr fm)) ;; Do this simplification for an integer 1, not for 1.0 and 1.0b0 (rplacd (cadr fm) (cddadr fm)) (return (cdr fm))) ((not (zerop1 (cadadr fm))) (return (cdr fm))) ;; Handle the multiplication with a zero. ((and (or (not $listarith) (not $doallmxops)) (mxorlistp (caddr (cadr fm)))) (return (rplacd fm (cons (constmx 0 (caddr (cadr fm))) (cddr fm)))))) ;; (cadadr fm) is zero. If the first term of fm is a number, ;; add it to preserve the type. (when (mnump (car fm)) (rplaca fm (addk (car fm) (cadadr fm)))) (return (rplacd fm (cddr fm))) equt (when *debug-simplus* (format t "~&in PLUSIN - equt~%")) ;; Call muln to get a simplified product. (setq x1 (muln (cons (addk w (if flag (cadadr fm) 1)) x) t)) equt2 (rplaca (cdr fm) (if (zerop1 x1) (list* '(mtimes) x1 x) (if (mtimesp x1) (testtneg x1) x1))) (if (not (mtimesp (cadr fm))) (go check)) (when (and (onep (cadadr fm)) flag (null (cdddr (cadr fm)))) ;; Do this simplification for an integer 1, not for 1.0 and 1.0b0 (rplaca (cdr fm) (caddr (cadr fm))) (go check)) (go del) check (if (mplusp (cadr fm)) (setq *plusflag* t)) ; A nested mplus expression (return (cdr fm)))) ; -------------------------------------------------------------------- With this implementation I get the following results. The examples give the expected results. (%i1) (1-sqrt(5))^3-4*(1-sqrt(5))^2+8, expand; (%o1) 0 (%i2) 1/sqrt(2)+1/sqrt(2)+1/sqrt(2); (%o2) 3/sqrt(2) (%i3) 2^(9/5)+2^(4/5); (%o3) 3*2^(4/5) (%i4) 3*sqrt(2)+2*sqrt(2); (%o4) 5*sqrt(2) (%i5) 2*sqrt(2)+3*sqrt(2); (%o5) 5*sqrt(2) (%i6) (1-sqrt(5))^3, expand; (%o6) 16-8*sqrt(5) (%i7) p : z^3-2^(3/2)*%i*z^2-4*z^2+2^(5/2)*%i*z+2*z; (%o7) z^3-2^(3/2)*%i*z^2-4*z^2+2^(5/2)*%i*z+2*z (%i8) divide(p, (z-2-sqrt(2)*%i),z); (%o8) [z^2+(-sqrt(2)*%i-2)*z,0] An example with a symbolic power: (%i9) 2^a + 3*2^(a+1); (%o9) 7*2^a The testsuite and share_testsuite have no problems. I am looking more systematic for further examples and possible errors of the code. Dieter Kaiser From daniel.dalton47 at gmail.com Sun Apr 3 15:58:07 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Mon, 4 Apr 2011 06:58:07 +1000 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: References: <20110403055130.GA13712@gwsc.vic.edu.au> Message-ID: <20110403205807.GA3664@gwsc.vic.edu.au> On Sun, Apr 03, 2011 at 11:11:53AM -0400, Raymond Toy wrote: > Daniel> graph, along with the absolute/global minimum and maximum? I'm using the > Daniel> command line interface... > > If you have a symbolic expression, can't you compute the derivative > and use a numerical method to find the zeroes? You can try solve or > mnewton or minpack_solve to find the zeroes. I suppose so, but our course has not covered any of this yet. The other students are using their CAS calculators to find the min/max for this reason... So I was hoping there was a similar function in maxima. I'll run it by my maths teacher and see what he thinks... > Daniel> 2) When graphing with maxima, what is the best way to choose a suitable > Daniel> x range for the plot2d argument? Is it possible to mark the major points > Daniel> of my graphs (tp, min/max, end points, intercepts intersections etc.?) > Daniel> Is there anyway to permanently set some variables like gnuplot_term so I > Daniel> don't have to type so many arguments for the plot2d command? > > Look at set_plot_option. You can set things like gnuplot_term there. Will have a look, thanks. > Daniel> points. The calculator provides a number of how successful the equation > Daniel> was eg. linear, quadratic or cubic. Is it possible to find the equation > Daniel> for a set of points with maxima? > > Sure, but it looks like there's nothing completely builtin. You can > do a least-squares fit using lbfgs or minpack_lsquares to produce the > equation. But you'll have to set up the equations appropriately > before calling these routines. OK -- is this the same process outlined by Leo? Thanks for your help, Dan From daniel.dalton47 at gmail.com Sun Apr 3 16:02:47 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Mon, 4 Apr 2011 07:02:47 +1000 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: References: <20110403055130.GA13712@gwsc.vic.edu.au> Message-ID: <20110403210247.GB3664@gwsc.vic.edu.au> On Sun, Apr 03, 2011 at 07:02:36PM +0100, Leo Butler wrote: > < Daniel> 1) Is it possible with maxima to find the local minimums/maximums of a > < Daniel> graph, along with the absolute/global minimum and maximum? I'm using the > < Daniel> command line interface... > < > < If you have a symbolic expression, can't you compute the derivative > < and use a numerical method to find the zeroes? You can try solve or > < mnewton or minpack_solve to find the zeroes. We haven't covered this in our course yet. I was hoping their was a function available like to the other students just to return the points... I'll run this by my teacher anyway. > < Daniel> 2) When graphing with maxima, what is the best way to choose a suitable > < Daniel> x range for the plot2d argument? Is it possible to mark the major points > < Daniel> of my graphs (tp, min/max, end points, intercepts intersections etc.?) > < Daniel> Is there anyway to permanently set some variables like gnuplot_term so I > < Daniel> don't have to type so many arguments for the plot2d command? > < > < Look at set_plot_option. You can set things like gnuplot_term there. That sounds like what I was looking for, thanks. > < Daniel> 3) Suppose I have 5 (x,y) coordinates. On the standard casio devices at > < Daniel> school these points can be punched in and the user may trial a linear, > < Daniel> quadratic or cubic equation to see which is the best fit for the > < Daniel> points. The calculator provides a number of how successful the equation > > Btw, a cubic always fits at least as good as a quadratic which fits in > turn at least as good as a linear model. If your calculator tells you a > linear model fits better than a cubic one, this is because it is using > some measuring stick other than goodness-of-fit. So for examination purposes there is no point trying any other fit than a cubic? > < Daniel> was eg. linear, quadratic or cubic. Is it possible to find the equation > < Daniel> for a set of points with maxima? > < > < Sure, but it looks like there's nothing completely builtin. You can > < do a least-squares fit using lbfgs or minpack_lsquares to produce the > < equation. But you'll have to set up the equations appropriately > < before calling these routines. > > Here is a function that does the job, using the lsquares package. > > (%i2) load(lsquares); > > (%o2) > "/home/work/maxima/sandbox/git/maxima-git/share/contrib/lsquares.mac" > Thanks very much, when I get home I'll play with this...:) I suppose your defining the function here? Is there any way to put this into a file or something so it doesn't need to be done each time? Anyway, I'll have a go at it when I get home this afternoon. Thanks very much for your help, Dan From daniel.dalton47 at gmail.com Sun Apr 3 16:05:56 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Mon, 4 Apr 2011 07:05:56 +1000 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <4D982AEF.8090204@gmail.com> References: <20110403055130.GA13712@gwsc.vic.edu.au> <4D982AEF.8090204@gmail.com> Message-ID: <20110403210556.GC3664@gwsc.vic.edu.au> On Sun, Apr 03, 2011 at 06:08:15PM +1000, David Billinghurst wrote: > On 3/04/2011 3:51 PM, Daniel Dalton wrote: > >4) Finally, I'm having trouble solving some more complicated equations > >with maxima. According to my text book there is real solutions. How can > >I find the real solution for the below equation? Input/output is > >below. (Note, I'm not familiar with complex numbers.) > Hi Dan, Hi David, > > There are at least two ways to attack 4) > > 1. Float isn't always sufficient with complex numbers. Try > rectform(float(expression))). You are left with a small imaginary > part due to rounding errors. > > 2. Use the realroots() function to extract the real roots. It > returns rational approximations to the real solution, which can be > converted to floating point using float(). Try realroots(x^2-2=0). This does the job perfectly! Thank you. > Do you understand that maxima approximating the irrational number > sqrt(2)? Yes. Thanks for your help, Dan From daniel.dalton47 at gmail.com Sun Apr 3 16:09:00 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Mon, 4 Apr 2011 07:09:00 +1000 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <4D982CAF.40702@unicaen.fr> References: <20110403055130.GA13712@gwsc.vic.edu.au> <4D982CAF.40702@unicaen.fr> Message-ID: <20110403210900.GD3664@gwsc.vic.edu.au> On Sun, Apr 03, 2011 at 10:15:43AM +0200, Eric Reyssat wrote: > Hi Daniel, Hi Eric, > When dealing with polynomials, you can use the functions allroots or > realroots. The first one gives you a floating point approximation of > the roots, the second one a rational approximation (you can then use > float). Both these functions work well, and the answers match those found in the text book! Thanks! Dan From l.butler at ed.ac.uk Sun Apr 3 17:02:33 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sun, 3 Apr 2011 23:02:33 +0100 (BST) Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <20110403210247.GB3664@gwsc.vic.edu.au> References: <20110403055130.GA13712@gwsc.vic.edu.au> <20110403210247.GB3664@gwsc.vic.edu.au> Message-ID: On Mon, 4 Apr 2011, Daniel Dalton wrote: > < < < Thanks very much, when I get home I'll play with this...:) < < I suppose your defining the function here? Is there any way to put this < into a file or something so it doesn't need to be done each time? < Anyway, I'll have a go at it when I get home this afternoon. Yes, just copy the input lines without the input labels into a file (it is usual to end the file name with a .mac ending). In Maxima: batch("file.mac"); load("file.mac"); will execute the code in the file. Ted Woollett's Maxima by Example is a good introduction. http://www.csulb.edu/~woollett/ Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From dan.stanger at ieee.org Sun Apr 3 19:06:56 2011 From: dan.stanger at ieee.org (Dan Stanger) Date: Sun, 03 Apr 2011 20:06:56 -0400 Subject: [Maxima] gentran Message-ID: <4D990BA0.7030209@ieee.org> Hello All, I have checked in my changes to gentran. Basic functionality including file output is working. The problems that I am currently seeing are some lines not terminated properly, and some numbers are floats rather than integers. I have been testing my changes using clisp on ms windows, and have done other testing on linux using sbcl. Let me know if you find any problems. Dan Stanger From eric.reyssat at unicaen.fr Mon Apr 4 01:10:28 2011 From: eric.reyssat at unicaen.fr (Eric Reyssat) Date: Mon, 04 Apr 2011 08:10:28 +0200 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <20110403210247.GB3664@gwsc.vic.edu.au> References: <20110403055130.GA13712@gwsc.vic.edu.au> <20110403210247.GB3664@gwsc.vic.edu.au> Message-ID: <4D9960D4.5050006@unicaen.fr> Le 03/04/2011 23:02, Daniel Dalton a ?crit : > On Sun, Apr 03, 2011 at 07:02:36PM +0100, Leo Butler wrote: > > ... >> < Daniel> 3) Suppose I have 5 (x,y) coordinates. On the standard casio devices at >> < Daniel> school these points can be punched in and the user may trial a linear, >> < Daniel> quadratic or cubic equation to see which is the best fit for the >> < Daniel> points. The calculator provides a number of how successful the equation >> >> Btw, a cubic always fits at least as good as a quadratic which fits in >> turn at least as good as a linear model. If your calculator tells you a >> linear model fits better than a cubic one, this is because it is using >> some measuring stick other than goodness-of-fit. >> > So for examination purposes there is no point trying any other fit than > a cubic? > > Examination or not, there may be many reasons to try linear or quadratic fit : - the computation runs faster - the solution is more readable, may be more easily interpreted geometrically, or used for further computations - you may want to compare how much you improve the fit between linear and cubic results - your teacher may want you to show your understanding of different kinds of approximations and of course you may try to fit by a polynomial curve of degree 4 or 5 which is usually even better than cubic (but more complicated), or using other functions than polynomials (trigonometric, exponentials, ...) more appropriate in some problems. Cubic fit is nothing else than a good balance in some cases between simplicity, generality and goodness of fit. Eric From rswarbrick at gmail.com Mon Apr 4 02:50:25 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Mon, 04 Apr 2011 08:50:25 +0100 Subject: [Maxima] Using maxima for high school mathematics References: <20110403055130.GA13712@gwsc.vic.edu.au> <20110403210247.GB3664@gwsc.vic.edu.au> Message-ID: Daniel Dalton writes: > On Sun, Apr 03, 2011 at 07:02:36PM +0100, Leo Butler wrote: >> < Daniel> 1) Is it possible with maxima to find the local minimums/maximums of a >> < Daniel> graph, along with the absolute/global minimum and maximum? I'm using the >> < Daniel> command line interface... >> < >> < If you have a symbolic expression, can't you compute the derivative >> < and use a numerical method to find the zeroes? You can try solve or >> < mnewton or minpack_solve to find the zeroes. > > We haven't covered this in our course yet. I was hoping their was a > function available like to the other students just to return the > points... I'll run this by my teacher anyway. > Unless the calculators the other students are using do this by working out a derivative "behind-the-scenes", what they probably do is the following: Take an evenly spaced list of numbers across the interval in which you're interested and evaluate the function at each of them. Then you have an idea of where it's largest. If you want more precision, you can then choose points closer together near where you think the minima/maxima are. Obviously this gets done magically behind the scenes, but it basically works in the same way as drawing a graph and finding the minima/maxima by eye. Before other users of the list point it out, this is a lot less efficient than it could be: if you know the function is smooth (say) then you can guess a numerical derivative and use that to help you do Leo's original suggestion. But anyway, if you ask your teacher about this, try and find out exactly what method he or she wants you to understand. If he or she just wants you to get a numerical approximation to the answer, maybe so you get a feel for a certain function, you could just look at the graph and do it by eye! 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 Tue Apr 5 09:45:41 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 5 Apr 2011 08:45:41 -0600 Subject: [Maxima] Maxima 5.24 and development issues Message-ID: Hi, I've tagged RELEASE-5_24-BRANCH in CVS and built tar.gz and rpms and posted them to the SF file manager: http://sourceforge.net/projects/maxima/files As always, give it a try, and it would be great if someone can build and upload a Windows installer. A couple of issues related to recent discussions: (1) I would be interested to know if we can have a workable alternative to GCL on Windows. I know that there was a Windows installer built with CCL, but I don't remember what was the final assessment of that. It seems like an appropriate time to try it with this release, so if someone wants to build and upload a package built with CCL or any other alternative, that would be great. (2) Perhaps this is an appropriate time to put the wheels in motion to switch over from CVS to Git. I suggest that we take the tag release-5_24-base as the target; after we get everything up to that tag converted to GIt, we can apply any patches that have accumulated since then. About converting to Git, I am aware that it's not entirely straightforward. If there are problems, I suggest that instead of trying to convert the entire history, that we omit any branches. Maybe that will simplify the problem enough. Anyone interested in branches can host a read-only copy of CVS. Many thanks for all the work that goes into every release. best Robert Dodier From toy.raymond at gmail.com Tue Apr 5 12:01:26 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 05 Apr 2011 13:01:26 -0400 Subject: [Maxima] Maxima 5.24 and development issues In-Reply-To: (Robert Dodier's message of "Tue, 5 Apr 2011 08:45:41 -0600") References: Message-ID: >>>>> "Robert" == Robert Dodier writes: Robert> (2) Perhaps this is an appropriate time to put the wheels in Robert> motion to switch over from CVS to Git. I suggest that we Robert> take the tag release-5_24-base as the target; after we get Robert> everything up to that tag converted to GIt, we can apply Robert> any patches that have accumulated since then. Does that mean you're going to have both CVS and git running at the same time? If so, it seems to me that a better point would be the actual release 5.24 tag, using CVS. Merge whatever went into that branch back to the main, and make a final tag for CVS. Declare a freeze on development, and convert the CVS repo to git. Then we're sure to a have known good starting point for git. Of course, this doesn't preclude someone doing test conversions up to that point. Just the "official" conversion should be done from scratch from that final CVS tag. Anyway, my 2 cents. I'm don't expect to be the one doing the conversion; the one doing the conversion gets the final say, I think. Robert> About converting to Git, I am aware that it's not entirely Robert> straightforward. If there are problems, I suggest that Robert> instead of trying to convert the entire history, that we Robert> omit any branches. Maybe that will simplify the problem I hope it doesn't come to that; we shouldn't actively try to forgot our history unless absolutely necessary. It seems, however, that the Maxima-CAS git repo has the branches, and they look ok to me. Ray From mxue at vroomlab.com Tue Apr 5 12:15:36 2011 From: mxue at vroomlab.com (mxue at vroomlab.com) Date: Tue, 05 Apr 2011 10:15:36 -0700 Subject: [Maxima] Joined Maxima Mailing Message-ID: <20110405101535.b7b3fc7d0c6ca0d100c8a34890539092.39372c23c6.wbe@email06.secureserver.net> An HTML attachment was scrubbed... URL: From ccooper at pct.edu Tue Apr 5 13:58:05 2011 From: ccooper at pct.edu (Charles Cooper) Date: Tue, 5 Apr 2011 18:58:05 +0000 Subject: [Maxima] Windows 7 64-bit compatability Message-ID: <4FAC91470A20334DBFBFF325BBED670201A284F5@EXCH-MBX4.pct.edu> Hello All, I am doing research for a possible upgrade in our systems here @ Pennsylvania College of Technology. We are looking to go to Windows 7 64-bit on all our systems since they are all heavily used for CAD applications. We are trying to determine if the software we are currently using is known to be compatible or not with this OS. I have tested by installing but was hoping to see if anyone had any more in-depth experience on this platform? Thanks in advance, Charles Cooper Technical Support Analyst Computing Services SASC 2083, DIF # 104 EXT 5333 -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Apr 5 14:14:29 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 5 Apr 2011 15:14:29 -0400 Subject: [Maxima] Windows 7 64-bit compatability In-Reply-To: <4FAC91470A20334DBFBFF325BBED670201A284F5@EXCH-MBX4.pct.edu> References: <4FAC91470A20334DBFBFF325BBED670201A284F5@EXCH-MBX4.pct.edu> Message-ID: I run the normal prebuilt Maxima for Windows (32-bit) on Windows 7 (64-bit) with no problem. Normal users should not need a 64-bit build of Maxima. I use the xmaxima front end. I don't normally use the wxMaxima front end or command line Maxima, but I just tried them out, and they seem to work fine. -s On Tue, Apr 5, 2011 at 14:58, Charles Cooper wrote: > Hello All, > > > > I am doing research for a possible upgrade in our systems here @ > Pennsylvania College of Technology. We are looking to go to Windows 7 > 64-bit on all our systems since they are all heavily used for CAD > applications. We are trying to determine if the software we are currently > using is known to be compatible or not with this OS. I have tested by > installing but was hoping to see if anyone had any more in-depth experience > on this platform? > > > > Thanks in advance, > > > > *Charles Cooper* > > *Technical Support Analyst* > > *Computing Services* > > *SASC 2083, DIF # 104* > > *EXT 5333* > > > > _______________________________________________ > 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 Tue Apr 5 14:27:57 2011 From: mxue at vroomlab.com (mxue at vroomlab.com) Date: Tue, 05 Apr 2011 12:27:57 -0700 Subject: [Maxima] Message 9 - Maxima Digest, Vol 57, Issue 5 Message-ID: <20110405122757.b7b3fc7d0c6ca0d100c8a34890539092.140d49c03f.wbe@email06.secureserver.net> An HTML attachment was scrubbed... URL: From xbenchi at gmail.com Tue Apr 5 14:29:31 2011 From: xbenchi at gmail.com (Chi Ben) Date: Tue, 5 Apr 2011 15:29:31 -0400 Subject: [Maxima] Windows 7 64-bit compatability In-Reply-To: <4FAC91470A20334DBFBFF325BBED670201A284F5@EXCH-MBX4.pct.edu> References: <4FAC91470A20334DBFBFF325BBED670201A284F5@EXCH-MBX4.pct.edu> Message-ID: Hi Mr. Cooper, I'm running wxMaxima on my Windows-7 64-bit OS. I have not had any problem with it. Sincerely, Chi Ben On Tue, Apr 5, 2011 at 2:58 PM, Charles Cooper wrote: > Hello All, > > > > I am doing research for a possible upgrade in our systems here @ > Pennsylvania College of Technology. We are looking to go to Windows 7 > 64-bit on all our systems since they are all heavily used for CAD > applications. We are trying to determine if the software we are currently > using is known to be compatible or not with this OS. I have tested by > installing but was hoping to see if anyone had any more in-depth experience > on this platform? > > > > Thanks in advance, > > > > *Charles Cooper* > > *Technical Support Analyst* > > *Computing Services* > > *SASC 2083, DIF # 104* > > *EXT 5333* > > > > _______________________________________________ > 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 Tue Apr 5 14:36:43 2011 From: mxue at vroomlab.com (mxue at vroomlab.com) Date: Tue, 05 Apr 2011 12:36:43 -0700 Subject: [Maxima] Maxima Digest, Vol 57, Issue 6 Message-ID: <20110405123643.b7b3fc7d0c6ca0d100c8a34890539092.63bcc6d730.wbe@email06.secureserver.net> An HTML attachment was scrubbed... URL: From hiisi at fedoraproject.org Tue Apr 5 15:50:55 2011 From: hiisi at fedoraproject.org (Hiisi) Date: Wed, 06 Apr 2011 00:50:55 +0400 Subject: [Maxima] remote maxima Message-ID: <1302036655.14483.14.camel@kello.ru> Hi! I've found a project called remote-maxima: https://code.google.com/p/remote-maxima/ I would like to use it in my program however the site lacks of good documentation. Actually it lacks of any reasonable documentation. Is there anybody on this list who used it or know a better way to contact maxima from C++ code? TIA Hiisi -- We are MicroSoft. You will be assimilated. Resistance is futile. -- Attributed to B.G., Gill Bates From korte at lite.msu.edu Tue Apr 5 16:07:53 2011 From: korte at lite.msu.edu (Gerd Kortemeyer) Date: Tue, 5 Apr 2011 17:07:53 -0400 Subject: [Maxima] remote maxima In-Reply-To: <1302036655.14483.14.camel@kello.ru> References: <1302036655.14483.14.camel@kello.ru> Message-ID: Hi, On Apr 5, 2011, at 4:50 PM, Hiisi wrote: > > I've found a project called remote-maxima: > https://code.google.com/p/remote-maxima/ > I would like to use it in my program however the site lacks of good > documentation. Actually it lacks of any reasonable documentation. Is > there anybody on this list who used it or know a better way to contact > maxima from C++ code? We are running Maxima as a server for our project: http://www.lon-capa.org/maximaasserver.html The server script (after removing calls to the LONCAPA::Configuration library, which you don't need) should work fine on any Linux. The client script would need to be rewritten in C++. - Gerd. From hiisi at fedoraproject.org Tue Apr 5 16:12:29 2011 From: hiisi at fedoraproject.org (Hiisi) Date: Wed, 06 Apr 2011 01:12:29 +0400 Subject: [Maxima] remote maxima In-Reply-To: References: <1302036655.14483.14.camel@kello.ru> Message-ID: <1302037949.14483.16.camel@kello.ru> ti, 2011-04-05 kello 17:07 -0400, Gerd Kortemeyer kirjoitti: > We are running Maxima as a server for our project: > > http://www.lon-capa.org/maximaasserver.html > > The server script (after removing calls to the LONCAPA::Configuration > library, which you don't need) should work fine on any Linux. The > client script would need to be rewritten in C++. > > - Gerd. > I saw this grate project, thank you. I'll look on it more closely. -- Sorry. I just realized this sentance makes no sense :) -- Ian Main From xbenchi at gmail.com Tue Apr 5 16:18:11 2011 From: xbenchi at gmail.com (Chi Ben) Date: Tue, 5 Apr 2011 17:18:11 -0400 Subject: [Maxima] Sum function evaluation problem Message-ID: Hi All, I was using this sum function: > *sum((tan(1/(2*x))-tan(1/(2*x+1))),x,1,inf),simpsum=true;* > However, the evaluated result is the mathematical expression instead of a float value, even with simpsum=true. How do I get a value? Sincerely, Chi Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrej.vodopivec at gmail.com Tue Apr 5 16:28:57 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Tue, 5 Apr 2011 23:28:57 +0200 Subject: [Maxima] Maxima 5.24 and development issues In-Reply-To: References: Message-ID: On Tue, Apr 5, 2011 at 4:45 PM, Robert Dodier wrote: > Hi, > > I've tagged RELEASE-5_24-BRANCH in CVS and built tar.gz > and rpms and posted them to the SF file manager: > http://sourceforge.net/projects/maxima/files > > As always, give it a try, and it would be great if someone > can build and upload a Windows installer. Windows installers with gcl and ccl are now on sourceforge. Andrej From macrakis at alum.mit.edu Tue Apr 5 17:04:09 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 5 Apr 2011 18:04:09 -0400 Subject: [Maxima] Sum function evaluation problem In-Reply-To: References: Message-ID: 'sum' doesn't evaluate infinite sums numerically. Simpsum tries to find a closed-form *symbolic* solution. On 2011-04-05, Chi Ben wrote: > Hi All, > > I was using this sum function: > >> *sum((tan(1/(2*x))-tan(1/(2*x+1))),x,1,inf),simpsum=true;* >> > > However, the evaluated result is the mathematical expression instead of a > float value, even with simpsum=true. > How do I get a value? > > Sincerely, > > Chi Ben > -- Sent from my mobile device From maxima at etherjones.us Tue Apr 5 18:38:48 2011 From: maxima at etherjones.us (Ether Jones) Date: Tue, 5 Apr 2011 16:38:48 -0700 (PDT) Subject: [Maxima] how to substitute known values Message-ID: <810725.34400.qm@web161812.mail.bf1.yahoo.com> After running the following macro: depends(x,t); depends(y,t); c(t):=sqrt(x^2+y^2); diff(c(t),t); ... I want to substitute specific values of x, y, dx/dt, and dy/dt into the resulting expression for dc/dt. What is the simplest way to do that? Thank you. From willisb at unk.edu Tue Apr 5 19:01:54 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 5 Apr 2011 19:01:54 -0500 Subject: [Maxima] how to substitute known values In-Reply-To: <810725.34400.qm@web161812.mail.bf1.yahoo.com> References: <810725.34400.qm@web161812.mail.bf1.yahoo.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >depends(x,t); >depends(y,t); >c(t):=sqrt(x^2+y^2); >diff(c(t),t); > >...?I?want?to?substitute?specific?values?of?x,?y,?dx/dt,?and?dy/dt?into >the?resulting?expression?for?dc/dt. What?is?the?simplest?way?to?do?that? The function subst can do this, but it's tricky: OK: (%i21) subst([diff(x,t) = 5, diff(y,t)=7, x = 3, y = 4], diff(sqrt(x^2+y^2),t)); (%o21) 43/5 Not OK: (%i16) subst([x=3, y=4, diff(x,t) = 5, diff(y,t)=7], diff(sqrt(x^2+y^2),t)); (%o16) 0 In the last calculation, the substitution x = 3, causes diff(x,t) --> diff(3,t) --> 0. The user documentation for 'subst' does say that the substitutions are made from left to right. There might be another way to do this using atvalue and at, but maybe this will work for you. --bw From maxima at etherjones.us Tue Apr 5 19:37:56 2011 From: maxima at etherjones.us (Ether Jones) Date: Tue, 5 Apr 2011 17:37:56 -0700 (PDT) Subject: [Maxima] why doesn't float(%) work? In-Reply-To: <810725.34400.qm@web161812.mail.bf1.yahoo.com> Message-ID: <201491.73778.qm@web161819.mail.bf1.yahoo.com> I am trying to evaluate the following expression, but float(%) just returns the unevaluated expression: (0.5*(600.0*SIN(0.5235987755983)*(5.0*SIN(0.5235987755983)+1.0)+3000.0*COS(0.5235987755983)^2))/sqrt((5.0*SIN(0.5235987755983)+1.0)^2+25.0*COS(0.5235987755983)^2); float(%); Is this a bug or am I doing something wrong? From macrakis at alum.mit.edu Tue Apr 5 19:54:36 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 5 Apr 2011 20:54:36 -0400 Subject: [Maxima] why doesn't float(%) work? In-Reply-To: <201491.73778.qm@web161819.mail.bf1.yahoo.com> References: <810725.34400.qm@web161812.mail.bf1.yahoo.com> <201491.73778.qm@web161819.mail.bf1.yahoo.com> Message-ID: Perhaps you want sin and not SIN? On 2011-04-05, Ether Jones wrote: > > I am trying to evaluate the following expression, but float(%) just returns > the unevaluated expression: > > (0.5*(600.0*SIN(0.5235987755983)*(5.0*SIN(0.5235987755983)+1.0)+3000.0*COS(0.5235987755983)^2))/sqrt((5.0*SIN(0.5235987755983)+1.0)^2+25.0*COS(0.5235987755983)^2); > > float(%); > > > Is this a bug or am I doing something wrong? > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Sent from my mobile device From robert.dodier at gmail.com Wed Apr 6 01:16:32 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 6 Apr 2011 00:16:32 -0600 Subject: [Maxima] Maxima 5.24 and development issues In-Reply-To: References: Message-ID: On 4/5/11, Raymond Toy wrote: > Does that mean you're going to have both CVS and git running at the > same time? What am proposing is just this. Maybe it's the same as what you were saying. convert CVS history up to and including release-5_24-base to Git freeze the CVS repo activate the Git repo merge whatever has been committed from release-5_24-base forward Instead of release-5_24-base, it could be any tag on the trunk. If the Git conversion takes only a day or two, we could, I guess, freeze the CVS repo while the conversion is taking place; then there wouldn't be anything to merge. Robert Dodier From l.butler at ed.ac.uk Wed Apr 6 05:41:26 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 6 Apr 2011 11:41:26 +0100 (BST) Subject: [Maxima] how to substitute known values In-Reply-To: References: <810725.34400.qm@web161812.mail.bf1.yahoo.com> Message-ID: On Tue, 5 Apr 2011, Barton Willis wrote: < < -----maxima-bounces at math.utexas.edu wrote: ----- < < >depends(x,t); < >depends(y,t); < >c(t):=sqrt(x^2+y^2); < >diff(c(t),t); < > < >...?I?want?to?substitute?specific?values?of?x,?y,?dx/dt,?and?dy/dt?into < >the?resulting?expression?for?dc/dt. What?is?the?simplest?way?to?do?that? < < The function subst can do this, but it's tricky: < < OK: < (%i21) subst([diff(x,t) = 5, diff(y,t)=7, x = 3, y = 4], diff(sqrt(x^2+y^2),t)); < (%o21) 43/5 < < Not OK: < < (%i16) subst([x=3, y=4, diff(x,t) = 5, diff(y,t)=7], diff(sqrt(x^2+y^2),t)); < (%o16) 0 < < In the last calculation, the substitution x = 3, causes diff(x,t) --> diff(3,t) --> 0. < The user documentation for 'subst' does say that the substitutions are made from left < to right. I think the function you want is psubst. psubst([x=3, y=4, diff(x,t) = 5, diff(y,t)=7], diff(sqrt(x^2+y^2),t)); should do what you want. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From toy.raymond at gmail.com Wed Apr 6 07:13:55 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 06 Apr 2011 08:13:55 -0400 Subject: [Maxima] Sum function evaluation problem References: Message-ID: >>>>> "Chi" == Chi Ben writes: Chi> Hi All, Chi> I was using this sum function: Chi> sum((tan(1/(2*x))-tan(1/(2*x+1))),x,1,inf),simpsum=true; Chi> However, the evaluated result is the mathematical expression Chi> instead of a float value, even with simpsum=true. How do I Chi> get a value? Stavros has already explained why you don't get a float value. But if you still want one, you can do sum(float(tan(1/(2*x))-tan(1/(2*x+1))),x,1,1000) -> .3435856189171599 But the terms look like 1/4/x^2 for large x, so the series doesn't converge very fast, so 1000 terms may not be accurate enough for you. However, you can let maxima help you evaluate this sum more accurately. First, taylor(tan(1/(2*x))-tan(1/(2*x+1)),x,inf, 4) -> 1/(4*x^2)-1/(8*x^3)+1/(8*x^4)$ So the terms of the series are approximately that for large x. Rewrite the series as sum((tan(1/(2*x))-tan(1/(2*x+1))-(1/(4*x^2)-1/(8*x^3)+1/(8*x^4)),x,1,inf) + sum(1/(4*x^2),x,1,inf)-sum(1/(8*x^3),x,1,inf)+sum(1/(8*x^4),x,1,inf) These latter sums can be evaluated by maxima: simpsum:true; sum(1/(4*x^2),x,1,inf)-sum(1/(8*x^3),x,1,inf)+sum(1/(8*x^4),x,1,inf); -> -zeta(3)/8+%pi^4/720+%pi^2/24 Then sum((tan(1/(2*x))-tan(1/(2*x+1))-(1/(4*x^2)-1/(8*x^3)+1/(8*x^4)),x,1,inf) can be approximated by summing from 1 to 1000, since 1/1000^5 is about 1e-15. Finally, the sum is sum(float(tan(1/(2*x))-tan(1/(2*x+1))-(1/(4*x^2)-1/(8*x^3)+1/(8*x^4))),x,1,1000) + float(-zeta(3)/8+%pi^4/720+%pi^2/24) -> 0.3438354315628996 I hope I got that all right. Ray From toy.raymond at gmail.com Wed Apr 6 07:16:37 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 06 Apr 2011 08:16:37 -0400 Subject: [Maxima] Maxima 5.24 and development issues References: Message-ID: >>>>> "Robert" == Robert Dodier writes: Robert> On 4/5/11, Raymond Toy wrote: >> Does that mean you're going to have both CVS and git running at the >> same time? Robert> What am proposing is just this. Maybe it's the same as what you were saying. Robert> convert CVS history up to and including release-5_24-base to Git Robert> freeze the CVS repo Robert> activate the Git repo Robert> merge whatever has been committed from release-5_24-base forward Robert> Instead of release-5_24-base, it could be any tag on the trunk. Robert> If the Git conversion takes only a day or two, we could, I guess, Robert> freeze the CVS repo while the conversion is taking place; Robert> then there wouldn't be anything to merge. That was my proposal: no simultaneous CVS and git. Just pick a hard tag (I prefer the final 5.24 release), freeze CVS, do the conversion, do some sanity checks, and use git from then on. Ray, who still needs to learn more about using git effectively. From willisb at unk.edu Wed Apr 6 07:56:09 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 6 Apr 2011 07:56:09 -0500 Subject: [Maxima] how to substitute known values In-Reply-To: References: <810725.34400.qm@web161812.mail.bf1.yahoo.com> , Message-ID: -----Leo Butler wrote: ----- >?I?think?the?function?you?want?is?psubst. > >?psubst([x=3,?y=4,?diff(x,t)?=?5,?diff(y,t)=7],?diff(sqrt(x^2+y^2),t)); > >?should?do?what?you?want. No, isn't the cure: (%i1) depends(x,t,y,t); (%o1) [x(t),y(t)] (%i2) psubst([x=3, y=4, diff(x,t) = 5, diff(y,t)=7], diff(sqrt(x^2+y^2),t)); (%o2) 0 (%i3) psubst([diff(x,t) = 5, diff(y,t)=7,x=3, y=4], diff(sqrt(x^2+y^2),t)); (%o3) 43/5 --Barton From dbmaxima at gmail.com Wed Apr 6 08:00:38 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Wed, 06 Apr 2011 23:00:38 +1000 Subject: [Maxima] Sum function evaluation problem In-Reply-To: References: Message-ID: <4D9C63F6.6090302@gmail.com> On 6/04/2011 10:13 PM, Raymond Toy wrote: >>>>>> "Chi" == Chi Ben writes: > Chi> Hi All, > Chi> I was using this sum function: > > Chi> sum((tan(1/(2*x))-tan(1/(2*x+1))),x,1,inf),simpsum=true; > > Chi> However, the evaluated result is the mathematical expression > Chi> instead of a float value, even with simpsum=true. How do I > Chi> get a value? > > Stavros has already explained why you don't get a float value. But if > you still want one, you can do > > sum(float(tan(1/(2*x))-tan(1/(2*x+1))),x,1,1000) -> .3435856189171599 > > But the terms look like 1/4/x^2 for large x, so the series doesn't > converge very fast, so 1000 terms may not be accurate enough for you. > > However, you can let maxima help you evaluate this sum more > accurately. First, > > taylor(tan(1/(2*x))-tan(1/(2*x+1)),x,inf, 4) -> > 1/(4*x^2)-1/(8*x^3)+1/(8*x^4)$ > > So the terms of the series are approximately that for large x. > Rewrite the series as > > sum((tan(1/(2*x))-tan(1/(2*x+1))-(1/(4*x^2)-1/(8*x^3)+1/(8*x^4)),x,1,inf) > + sum(1/(4*x^2),x,1,inf)-sum(1/(8*x^3),x,1,inf)+sum(1/(8*x^4),x,1,inf) > > These latter sums can be evaluated by maxima: > > simpsum:true; > sum(1/(4*x^2),x,1,inf)-sum(1/(8*x^3),x,1,inf)+sum(1/(8*x^4),x,1,inf); > -> -zeta(3)/8+%pi^4/720+%pi^2/24 > > Then > > sum((tan(1/(2*x))-tan(1/(2*x+1))-(1/(4*x^2)-1/(8*x^3)+1/(8*x^4)),x,1,inf) > > can be approximated by summing from 1 to 1000, since 1/1000^5 is about > 1e-15. Finally, the sum is > > sum(float(tan(1/(2*x))-tan(1/(2*x+1))-(1/(4*x^2)-1/(8*x^3)+1/(8*x^4))),x,1,1000) > + float(-zeta(3)/8+%pi^4/720+%pi^2/24) > -> 0.3438354315628996 > > I hope I got that all right. > You could also try the levin package to accelerate the convergence. This is not documented in the manual. You will need to look at the files in share/contrib/levin/ for more information. See http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/share/contrib/levin/ Levin transforms are neat when they work, and this seems to be the case here. (%i1) load("levin.mac")$ (%i2) fpprec:16$ (%i3) approx:bfloat(bflevin_u_sum(n/((3*n+1)*(2*n+1)^2),n,1)); (%o3) 6.517679613678698b-2 (%i4) (%i1) fpprec; (%o1) 16 (%i2) load("levin.mac")$ (%i3) approx_16:bfloat(bflevin_u_sum((tan(1/(2*x))-tan(1/(2*x+1))),x,1)); (%o3) 3.438354315628762b-1 (%i4) fpprec:50; (%o4) 50 (%i5) approx_50:bfloat(bflevin_u_sum((tan(1/(2*x))-tan(1/(2*x+1))),x,1)); (%o5) 3.4383543156287618385885647034599140840591675991409b-1 From l.butler at ed.ac.uk Wed Apr 6 08:14:51 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 6 Apr 2011 14:14:51 +0100 (BST) Subject: [Maxima] how to substitute known values In-Reply-To: References: <810725.34400.qm@web161812.mail.bf1.yahoo.com> , Message-ID: On Wed, 6 Apr 2011, Barton Willis wrote: < -----Leo Butler wrote: ----- < < >?I?think?the?function?you?want?is?psubst. < > < >?psubst([x=3,?y=4,?diff(x,t)?=?5,?diff(y,t)=7],?diff(sqrt(x^2+y^2),t)); < > < >?should?do?what?you?want. < < No, isn't the cure: < < (%i1) depends(x,t,y,t); < (%o1) [x(t),y(t)] < < (%i2) psubst([x=3, y=4, diff(x,t) = 5, diff(y,t)=7], diff(sqrt(x^2+y^2),t)); < (%o2) 0 < < (%i3) psubst([diff(x,t) = 5, diff(y,t)=7,x=3, y=4], diff(sqrt(x^2+y^2),t)); < (%o3) 43/5 Well, I guess this is a bug, eh? Here is a slightly re-worked version of the example from the documentation: (%i20) psubst ([a^2=b, b=a], sin(a^2) + cos(b)); (%o20) sin(b) + cos(a) (%i21) psubst ([b=a, a^2=b], sin(a^2) + cos(b)); (%o21) sin(b) + cos(a) Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From macrakis at alum.mit.edu Wed Apr 6 09:02:59 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 6 Apr 2011 10:02:59 -0400 Subject: [Maxima] how to substitute known values In-Reply-To: References: <810725.34400.qm@web161812.mail.bf1.yahoo.com> Message-ID: What should psubst( [x=3,f(x)=5,f(3)=10, f=g], f(x) ) be? Should it be f(3) or 5 or g(x)? Should psubst try to find the maximal match? I don't think that's currently part of its specification. Presumably not 10 or g(3), which would require sequential (not parallel) substitutions. Both 'subst' and 'psubst' are very basic *syntactic* operations. It is correct (and useful) behavior that subst([y=x],'diff(y,t)) => 'diff(x,t). 'at' is supposed to be the *semantic* substitution operation, but it can be very clumsy to use and it is not very powerful. In the present case, you might want to say something like at('diff(x,t),[x=3,'at('diff(x,t),x=3)=5]) but that doesn't work. -s On Wed, Apr 6, 2011 at 09:14, Leo Butler wrote: > > > On Wed, 6 Apr 2011, Barton Willis wrote: > > < -----Leo Butler wrote: ----- > < > < > I think the function you want is psubst. > < > > < > psubst([x=3, y=4, diff(x,t) = 5, diff(y,t)=7], diff(sqrt(x^2+y^2),t)); > < > > < > should do what you want. > < > < No, isn't the cure: > < > < (%i1) depends(x,t,y,t); > < (%o1) [x(t),y(t)] > < > < (%i2) psubst([x=3, y=4, diff(x,t) = 5, diff(y,t)=7], > diff(sqrt(x^2+y^2),t)); > < (%o2) 0 > < > < (%i3) psubst([diff(x,t) = 5, diff(y,t)=7,x=3, y=4], > diff(sqrt(x^2+y^2),t)); > < (%o3) 43/5 > > Well, I guess this is a bug, eh? > > Here is a slightly re-worked version of the example from the > documentation: > > (%i20) psubst ([a^2=b, b=a], sin(a^2) + cos(b)); > (%o20) sin(b) + cos(a) > (%i21) psubst ([b=a, a^2=b], sin(a^2) + cos(b)); > (%o21) sin(b) + cos(a) > > > Leo > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > 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 Apr 6 11:22:20 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 06 Apr 2011 12:22:20 -0400 Subject: [Maxima] Sum function evaluation problem References: <4D9C63F6.6090302@gmail.com> Message-ID: >>>>> "David" == David Billinghurst writes: David> On 6/04/2011 10:13 PM, Raymond Toy wrote: [snip] >> >> I hope I got that all right. >> David> You could also try the levin package to accelerate the David> convergence. This is not documented in the manual. You David> will need to look at the files in share/contrib/levin/ for David> more information. See David> http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/share/contrib/levin/ Hey, that's pretty cool. Didn't even know that existed. Ray From robert.dodier at gmail.com Wed Apr 6 13:39:24 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 6 Apr 2011 12:39:24 -0600 Subject: [Maxima] Sum function evaluation problem In-Reply-To: References: <4D9C63F6.6090302@gmail.com> Message-ID: Just a general note -- when simplifying sums, instead of the simpsum flag, my advice is to use the simplify_sum function (in the share package of the same name) since simplify_sum subsumes simpsum and several more powerful methods. HTH Robert Dodier On 4/6/11, Raymond Toy wrote: >>>>>> "David" == David Billinghurst writes: > > David> On 6/04/2011 10:13 PM, Raymond Toy wrote: > > [snip] > > >> > >> I hope I got that all right. > >> > David> You could also try the levin package to accelerate the > David> convergence. This is not documented in the manual. You > David> will need to look at the files in share/contrib/levin/ for > David> more information. See > David> > http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/share/contrib/levin/ > > Hey, that's pretty cool. Didn't even know that existed. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From maxima at etherjones.us Wed Apr 6 16:11:07 2011 From: maxima at etherjones.us (Ether Jones) Date: Wed, 6 Apr 2011 14:11:07 -0700 (PDT) Subject: [Maxima] why doesn't float(%) work? In-Reply-To: Message-ID: <998389.1818.qm@web161802.mail.bf1.yahoo.com> Thank you.? The other CAS I use wants caps, that's why I was blind to it. --- On Tue, 4/5/11, Stavros Macrakis wrote: From: Stavros Macrakis Subject: Re: [Maxima] why doesn't float(%) work? To: maxima at etherjones.us, "maxima at math.utexas.edu" Date: Tuesday, April 5, 2011, 8:54 PM Perhaps you want sin and not SIN? On 2011-04-05, Ether Jones wrote: > > I am trying to evaluate the following expression, but float(%) just returns > the unevaluated expression: > > (0.5*(600.0*SIN(0.5235987755983)*(5.0*SIN(0.5235987755983)+1.0)+3000.0*COS(0.5235987755983)^2))/sqrt((5.0*SIN(0.5235987755983)+1.0)^2+25.0*COS(0.5235987755983)^2); > > float(%); > > > Is this a bug or am I doing something wrong? > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Sent from my mobile device -------------- next part -------------- An HTML attachment was scrubbed... URL: From george.leeman at sbcglobal.net Wed Apr 6 16:11:38 2011 From: george.leeman at sbcglobal.net (George Leeman) Date: Wed, 6 Apr 2011 17:11:38 -0400 Subject: [Maxima] Trigonometric functions with symbolic argument an even multiple of pi Message-ID: <58F03D67C4E8403EB8731F8D20F79A71@Dimension8400> Maxima has an elegant way of handling such evaluations if we know that integer m is even: declare(m,even); cos(m*%pi); The answer is 1, as expected. However, the case where the argument is an even integer raised to a symbolic positive integer power seems more difficult. I wonder if there is a simple solution. One possible attempt is: declare(positive, feature); matchdeclare(ep, lambda([x],is(op(x)="^") and evenp(part(x,1)) and member(part(x,2),propvars(integer)) and member(part(x,2),propvars(positive)))); tellsimpafter(cos(ep*%pi),1); After this sequence the statements kill(m); declare(m,[integer,positive]); cos(4^m*%pi); give an answer of 1, but the approach seems rather complicated. -- George Leeman From l.butler at ed.ac.uk Thu Apr 7 05:37:39 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 7 Apr 2011 11:37:39 +0100 (BST) Subject: [Maxima] how to substitute known values In-Reply-To: References: <810725.34400.qm@web161812.mail.bf1.yahoo.com> Message-ID: On Wed, 6 Apr 2011, Stavros Macrakis wrote: < What should psubst( [x=3,f(x)=5,f(3)=10, f=g], f(x) ) be? ?Should it be f(3) or 5 or g(x)? ?Should psubst try to find the maximal match? ?I don't think that's < currently part of its specification. < Perhaps the documentation could be improved to explain this pitfall. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From macrakis at alum.mit.edu Thu Apr 7 09:40:21 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 7 Apr 2011 10:40:21 -0400 Subject: [Maxima] how to substitute known values In-Reply-To: References: <810725.34400.qm@web161812.mail.bf1.yahoo.com> Message-ID: Corrigendum: g(3) is in fact a parallel substitution, and is what psubst currently returns in this case. On Wed, Apr 6, 2011 at 10:02, Stavros Macrakis wrote: > What should psubst( [x=3,f(x)=5,f(3)=10, f=g], f(x) ) be? Should it be > f(3) or 5 or g(x)? Should psubst try to find the maximal match? I don't > think that's currently part of its specification. > > Presumably not 10 or g(3), which would require sequential (not parallel) > substitutions. > > Both 'subst' and 'psubst' are very basic *syntactic* operations. It is > correct (and useful) behavior that subst([y=x],'diff(y,t)) => 'diff(x,t). > > 'at' is supposed to be the *semantic* substitution operation, but it can be > very clumsy to use and it is not very powerful. In the present case, you > might want to say something like > > at('diff(x,t),[x=3,'at('diff(x,t),x=3)=5]) > > but that doesn't work. > > -s > > On Wed, Apr 6, 2011 at 09:14, Leo Butler wrote: > >> >> >> On Wed, 6 Apr 2011, Barton Willis wrote: >> >> < -----Leo Butler wrote: ----- >> < >> < > I think the function you want is psubst. >> < > >> < > psubst([x=3, y=4, diff(x,t) = 5, diff(y,t)=7], diff(sqrt(x^2+y^2),t)); >> < > >> < > should do what you want. >> < >> < No, isn't the cure: >> < >> < (%i1) depends(x,t,y,t); >> < (%o1) [x(t),y(t)] >> < >> < (%i2) psubst([x=3, y=4, diff(x,t) = 5, diff(y,t)=7], >> diff(sqrt(x^2+y^2),t)); >> < (%o2) 0 >> < >> < (%i3) psubst([diff(x,t) = 5, diff(y,t)=7,x=3, y=4], >> diff(sqrt(x^2+y^2),t)); >> < (%o3) 43/5 >> >> Well, I guess this is a bug, eh? >> >> Here is a slightly re-worked version of the example from the >> documentation: >> >> (%i20) psubst ([a^2=b, b=a], sin(a^2) + cos(b)); >> (%o20) sin(b) + cos(a) >> (%i21) psubst ([b=a, a^2=b], sin(a^2) + cos(b)); >> (%o21) sin(b) + cos(a) >> >> >> Leo >> -- >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> _______________________________________________ >> 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 Apr 7 11:36:41 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 7 Apr 2011 10:36:41 -0600 Subject: [Maxima] how to substitute known values In-Reply-To: References: <810725.34400.qm@web161812.mail.bf1.yahoo.com> Message-ID: Can you explain the reasoning here? I don't understand why f and x are substituted separated rather than together, since f(x) is one of the left hand sides in the list of substitution equations. best Robert Dodier On 4/7/11, Stavros Macrakis wrote: > Corrigendum: g(3) is in fact a parallel substitution, and is what psubst > currently returns in this case. > > On Wed, Apr 6, 2011 at 10:02, Stavros Macrakis wrote: > >> What should psubst( [x=3,f(x)=5,f(3)=10, f=g], f(x) ) be? Should it be >> f(3) or 5 or g(x)? Should psubst try to find the maximal match? I don't >> think that's currently part of its specification. >> >> Presumably not 10 or g(3), which would require sequential (not parallel) >> substitutions. >> >> Both 'subst' and 'psubst' are very basic *syntactic* operations. It is >> correct (and useful) behavior that subst([y=x],'diff(y,t)) => 'diff(x,t). >> >> 'at' is supposed to be the *semantic* substitution operation, but it can >> be >> very clumsy to use and it is not very powerful. In the present case, you >> might want to say something like >> >> at('diff(x,t),[x=3,'at('diff(x,t),x=3)=5]) >> >> but that doesn't work. >> >> -s >> >> On Wed, Apr 6, 2011 at 09:14, Leo Butler wrote: >> >>> >>> >>> On Wed, 6 Apr 2011, Barton Willis wrote: >>> >>> < -----Leo Butler wrote: ----- >>> < >>> < > I think the function you want is psubst. >>> < > >>> < > psubst([x=3, y=4, diff(x,t) = 5, diff(y,t)=7], >>> diff(sqrt(x^2+y^2),t)); >>> < > >>> < > should do what you want. >>> < >>> < No, isn't the cure: >>> < >>> < (%i1) depends(x,t,y,t); >>> < (%o1) [x(t),y(t)] >>> < >>> < (%i2) psubst([x=3, y=4, diff(x,t) = 5, diff(y,t)=7], >>> diff(sqrt(x^2+y^2),t)); >>> < (%o2) 0 >>> < >>> < (%i3) psubst([diff(x,t) = 5, diff(y,t)=7,x=3, y=4], >>> diff(sqrt(x^2+y^2),t)); >>> < (%o3) 43/5 >>> >>> Well, I guess this is a bug, eh? >>> >>> Here is a slightly re-worked version of the example from the >>> documentation: >>> >>> (%i20) psubst ([a^2=b, b=a], sin(a^2) + cos(b)); >>> (%o20) sin(b) + cos(a) >>> (%i21) psubst ([b=a, a^2=b], sin(a^2) + cos(b)); >>> (%o21) sin(b) + cos(a) >>> >>> >>> Leo >>> -- >>> The University of Edinburgh is a charitable body, registered in >>> Scotland, with registration number SC005336. >>> >>> _______________________________________________ >>> Maxima mailing list >>> Maxima at math.utexas.edu >>> http://www.math.utexas.edu/mailman/listinfo/maxima >>> >> >> > From macrakis at alum.mit.edu Thu Apr 7 12:38:03 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 7 Apr 2011 13:38:03 -0400 Subject: [Maxima] how to substitute known values In-Reply-To: References: <810725.34400.qm@web161812.mail.bf1.yahoo.com> Message-ID: psubst appears to be undocumented, so there is no specification of what it *should* do. I'm just describing what it *does* do. I can think of various possible specifications: * Leave behavior unspecified in cases like this (implementation-defined) * Bottom-up (smallest match wins) * Top-down (biggest match wins) * Left-to-right (first match wins) * Throw an error if there is an ambiguity SInce subst doesn't have wildcards and doesn't do anything clever about associative and commutative operators, we at least don't need to worry about overlapping cases like psubst( [x*y=3,y*z=5,x*z=7], x*y*z ) NOT an issue... -s On Thu, Apr 7, 2011 at 12:36, Robert Dodier wrote: > Can you explain the reasoning here? > I don't understand why f and x are substituted separated rather > than together, since f(x) is one of the left hand sides in the > list of substitution equations. > > best > > Robert Dodier > > On 4/7/11, Stavros Macrakis wrote: > > Corrigendum: g(3) is in fact a parallel substitution, and is what psubst > > currently returns in this case. > > > > On Wed, Apr 6, 2011 at 10:02, Stavros Macrakis >wrote: > > > >> What should psubst( [x=3,f(x)=5,f(3)=10, f=g], f(x) ) be? Should it be > >> f(3) or 5 or g(x)? Should psubst try to find the maximal match? I > don't > >> think that's currently part of its specification. > >> > >> Presumably not 10 or g(3), which would require sequential (not parallel) > >> substitutions. > >> > >> Both 'subst' and 'psubst' are very basic *syntactic* operations. It is > >> correct (and useful) behavior that subst([y=x],'diff(y,t)) => > 'diff(x,t). > >> > >> 'at' is supposed to be the *semantic* substitution operation, but it can > >> be > >> very clumsy to use and it is not very powerful. In the present case, > you > >> might want to say something like > >> > >> at('diff(x,t),[x=3,'at('diff(x,t),x=3)=5]) > >> > >> but that doesn't work. > >> > >> -s > >> > >> On Wed, Apr 6, 2011 at 09:14, Leo Butler wrote: > >> > >>> > >>> > >>> On Wed, 6 Apr 2011, Barton Willis wrote: > >>> > >>> < -----Leo Butler wrote: ----- > >>> < > >>> < > I think the function you want is psubst. > >>> < > > >>> < > psubst([x=3, y=4, diff(x,t) = 5, diff(y,t)=7], > >>> diff(sqrt(x^2+y^2),t)); > >>> < > > >>> < > should do what you want. > >>> < > >>> < No, isn't the cure: > >>> < > >>> < (%i1) depends(x,t,y,t); > >>> < (%o1) [x(t),y(t)] > >>> < > >>> < (%i2) psubst([x=3, y=4, diff(x,t) = 5, diff(y,t)=7], > >>> diff(sqrt(x^2+y^2),t)); > >>> < (%o2) 0 > >>> < > >>> < (%i3) psubst([diff(x,t) = 5, diff(y,t)=7,x=3, y=4], > >>> diff(sqrt(x^2+y^2),t)); > >>> < (%o3) 43/5 > >>> > >>> Well, I guess this is a bug, eh? > >>> > >>> Here is a slightly re-worked version of the example from the > >>> documentation: > >>> > >>> (%i20) psubst ([a^2=b, b=a], sin(a^2) + cos(b)); > >>> (%o20) sin(b) + cos(a) > >>> (%i21) psubst ([b=a, a^2=b], sin(a^2) + cos(b)); > >>> (%o21) sin(b) + cos(a) > >>> > >>> > >>> Leo > >>> -- > >>> The University of Edinburgh is a charitable body, registered in > >>> Scotland, with registration number SC005336. > >>> > >>> _______________________________________________ > >>> 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 doug.dastew at gmail.com Thu Apr 7 16:44:18 2011 From: doug.dastew at gmail.com (Doug Stewart) Date: Thu, 7 Apr 2011 17:44:18 -0400 Subject: [Maxima] how to salve this differential? Message-ID: ode2(diff(y)=y/(x-y),y,x); y (%t1) del(y) = ----- y + x msg1 (%o1) false the answer is: dy/dx= y/(x+y) (x+y) dy=ydx xdy+ydy=ydx ydy =ydx-xdy y/y^2 dy =(y dx - x dy)/y^2 1/y dy = d(x/y) ln(y)= x/y y ln(y)=x Maxima seems like it does not know this? Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Apr 7 16:50:42 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 7 Apr 2011 17:50:42 -0400 Subject: [Maxima] how to salve this differential? In-Reply-To: References: Message-ID: In Maxima, you'd express this problem as: ex: 'diff(y,x)=y/(x-y) $ sol: ode2(ex,y,x); which yields the result (y*log(y)+x)/y = %c solving for x: solve(sol,x) => [x = %c*y-y*log(y)]. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From doug.dastew at gmail.com Thu Apr 7 17:59:23 2011 From: doug.dastew at gmail.com (Doug Stewart) Date: Thu, 7 Apr 2011 18:59:23 -0400 Subject: [Maxima] how to salve this differential? In-Reply-To: References: Message-ID: On Thu, Apr 7, 2011 at 5:50 PM, Stavros Macrakis wrote: > In Maxima, you'd express this problem as: > > ex: 'diff(y,x)=y/(x-y) $ > sol: ode2(ex,y,x); > > which yields the result > > (y*log(y)+x)/y = %c > > solving for x: > > solve(sol,x) => [x = %c*y-y*log(y)]. > > -s > Thank you. Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: From mxue at vroomlab.com Fri Apr 8 09:57:00 2011 From: mxue at vroomlab.com (Michael) Date: Fri, 8 Apr 2011 14:57:00 +0000 (UTC) Subject: [Maxima] how to salve this differential? References: Message-ID: Doug: you need to put a quote in front of diff(y,x). Maxima will give you an implicit solution: (y*log(y)-x)/y = %c -michael From doug.dastew at gmail.com Fri Apr 8 10:09:53 2011 From: doug.dastew at gmail.com (Doug Stewart) Date: Fri, 8 Apr 2011 11:09:53 -0400 Subject: [Maxima] how to salve this differential? In-Reply-To: References: Message-ID: On Fri, Apr 8, 2011 at 10:57 AM, Michael wrote: > > Doug: > > you need to put a quote in front of diff(y,x). > > Maxima will give you an implicit solution: > > (y*log(y)-x)/y = %c > > -michael > > > > > Thanks Michael - yes I know that now :-) , all is well! -------------- next part -------------- An HTML attachment was scrubbed... URL: From l.butler at ed.ac.uk Fri Apr 8 11:02:17 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 8 Apr 2011 17:02:17 +0100 (BST) Subject: [Maxima] Maxima's REPL Message-ID: I've been hacking at combining Maxima with AllegroServe. I have a working version, but I am running into a bit of a knowledge shortfall: Could someone describe to me roughly how the Maxima top-level works? I believe that mread -> meval -> displa implements the REPL but there seem to be some flags set that I am missing because that trio produces output with a superfluous 'displayinput' flag. If it helps, I am running Maxima and AllegroServe in the same lisp image, and I am capturing Maxima's input from a get request entity, implementing the REPL and firing back the output string. It's quite naive, but I can see that we can replace displa with a more suitable output parser -- and since meval is spitting out structured Maxima forms, turning that into html or whatever should be quite feasible. With a little JavaScript, we could make pretty near any browser an interactive front-end to Maxima. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From l.butler at ed.ac.uk Fri Apr 8 11:07:40 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 8 Apr 2011 17:07:40 +0100 (BST) Subject: [Maxima] how to salve this differential? In-Reply-To: References: Message-ID: On Fri, 8 Apr 2011, Michael wrote: < < Doug: < < you need to put a quote in front of diff(y,x). < < Maxima will give you an implicit solution: < < (y*log(y)-x)/y = %c < < -michael I would think it is better form, and more self-documenting, to write: depends(y,x); diff(y,x)=.... Here, Maxima will nounify diff in the second line because you have told it on the first that y is a function of x. If you just write 'diff(y,x)=.... the ' will likely be a bit mysterious later when you look at the code. That's my 2p, anyway, Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From macrakis at alum.mit.edu Fri Apr 8 11:10:58 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 8 Apr 2011 12:10:58 -0400 Subject: [Maxima] Maxima's REPL In-Reply-To: References: Message-ID: That's the easy part of a Webified REPL. The harder parts are what to do when Maxima asks questions before returning an answer, e.g. (%i2) integrate(x^a,x); Is a+1 zero or nonzero? n; (%o2) x^(a+1)/(a+1) or gives an error rather than returning an answer: (%i3) 1/0; Division by 0 -- an error. To debug this try: debugmode(true); a bunch of people have banged their heads against these (seemingly trivial) issues. -s On Fri, Apr 8, 2011 at 12:02, Leo Butler wrote: > I've been hacking at combining Maxima with AllegroServe. > I have a working version, but I am running into a bit > of a knowledge shortfall: > > Could someone describe to me roughly how the Maxima top-level > works? I believe that mread -> meval -> displa implements > the REPL but there seem to be some flags set that I am missing > because that trio produces output with a superfluous 'displayinput' > flag. > > If it helps, I am running Maxima and AllegroServe in the same lisp > image, and I am capturing Maxima's input from a get request entity, > implementing the REPL and firing back the output string. It's > quite naive, but I can see that we can replace displa with > a more suitable output parser -- and since meval is spitting out structured > Maxima forms, turning that into html or whatever > should be quite feasible. > > With a little JavaScript, we could make pretty near any browser > an interactive front-end to Maxima. > > > Leo > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > 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 doug.dastew at gmail.com Fri Apr 8 12:06:41 2011 From: doug.dastew at gmail.com (Doug Stewart) Date: Fri, 8 Apr 2011 13:06:41 -0400 Subject: [Maxima] how to salve this differential? In-Reply-To: References: Message-ID: On Fri, Apr 8, 2011 at 12:07 PM, Leo Butler wrote: > > > On Fri, 8 Apr 2011, Michael wrote: > > < > < Doug: > < > < you need to put a quote in front of diff(y,x). > < > < Maxima will give you an implicit solution: > < > < (y*log(y)-x)/y = %c > < > < -michael > > I would think it is better form, and more self-documenting, > to write: > > depends(y,x); > diff(y,x)=.... > > Here, Maxima will nounify diff in the second line because > you have told it on the first that y is a function of x. > If you just write > > 'diff(y,x)=.... > > the ' will likely be a bit mysterious later when you look at > the code. > > That's my 2p, anyway, > Leo > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > I was under the mistaken idea that ode would know that y depends on x, because I set y as the dependent and x as the independent variable. ode2(diff(y)=y/(x+y),y,x); Even so I should have tried: ode2(diff(y,x)=y/(x+y),y,x); and if I had read the help section I would have seen the quote, so this is mostly my fault. this is nice: depends(y,x); solve(ode2(diff(y,x)=y/(x+y),y,x),x); Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: From l.butler at ed.ac.uk Fri Apr 8 12:11:10 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 8 Apr 2011 18:11:10 +0100 (BST) Subject: [Maxima] Maxima's REPL In-Reply-To: References: Message-ID: On Fri, 8 Apr 2011, Stavros Macrakis wrote: < That's the easy part of a Webified REPL. < The harder parts are what to do when Maxima asks questions before returning an answer, e.g. < < (%i2) integrate(x^a,x); < Is ?a+1 ?zero or nonzero? < n; < < (%o2) x^(a+1)/(a+1) < < or gives an error rather than returning an answer: < < (%i3) 1/0; < Division by 0 < ?-- an error. To debug this try: debugmode(true); < < < a bunch of people have banged their heads against these (seemingly trivial) issues. < < ? ? ? ? ? ? -s < Honestly, I don't think that you are correct. In general, yes, but not when running Maxima in the same Lisp image as the server. These are exceptions and the webserver should be able to use the exception handling mechanism to respond appropriately (I am not claiming the current exception handling suffices; I don't know, but I suspect not). This is the inherent superiority of a Lisp-based webserver: it can communicate with Maxima in its own language, or even better, Maxima can be its own webserver. I wouldn't even bother hacking yet another string-based front-end... While I am on it, some commands (e.g. plot2d) are called only for side-effects. These are more of a problem.... Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From mxue at vroomlab.com Fri Apr 8 12:43:56 2011 From: mxue at vroomlab.com (Michael Xue) Date: Fri, 8 Apr 2011 17:43:56 +0000 (UTC) Subject: [Maxima] how to salve this differential? References: Message-ID: Leo Butler ed.ac.uk> writes: Or simply do: ode2(diff(y(x),x)=y(x)/(1+y(x)),y(x),x); This will be consistent with desolve's usage. - Michael From macrakis at alum.mit.edu Fri Apr 8 12:46:19 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 8 Apr 2011 13:46:19 -0400 Subject: [Maxima] Maxima's REPL In-Reply-To: References: Message-ID: Glad to hear you have a solution for these issues. If you have a solution for intercepting all of Maxima's 'spontaneous' output and questions, it should be applicable to the string-based interfaces, too. -s On Fri, Apr 8, 2011 at 13:11, Leo Butler wrote: > > > On Fri, 8 Apr 2011, Stavros Macrakis wrote: > > < That's the easy part of a Webified REPL. > < The harder parts are what to do when Maxima asks questions before > returning an answer, e.g. > < > < (%i2) integrate(x^a,x); > < Is a+1 zero or nonzero? > < n; > < > < (%o2) x^(a+1)/(a+1) > < > < or gives an error rather than returning an answer: > < > < (%i3) 1/0; > < Division by 0 > < -- an error. To debug this try: debugmode(true); > < > < > < a bunch of people have banged their heads against these (seemingly > trivial) issues. > < > < -s > < > > Honestly, I don't think that you are correct. > In general, yes, but not when running > Maxima in the same Lisp image as the server. > > These are exceptions and the webserver should > be able to use the exception handling mechanism > to respond appropriately (I am not claiming the > current exception handling suffices; I don't know, > but I suspect not). This is the inherent > superiority of a Lisp-based webserver: it can communicate > with Maxima in its own language, or even better, > Maxima can be its own webserver. I wouldn't > even bother hacking yet another string-based > front-end... > > While I am on it, some commands (e.g. plot2d) are > called only for side-effects. These are more of a problem.... > > > Leo > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mxue at vroomlab.com Fri Apr 8 12:55:43 2011 From: mxue at vroomlab.com (Michael Xue) Date: Fri, 8 Apr 2011 17:55:43 +0000 (UTC) Subject: [Maxima] Maxima's REPL References: Message-ID: look at this REPL: http://www.vroomlab.com/nhome click on the calculator image to get access without login in. the following link shows solution to 'maxima asks question' for a specific case: http://www.vroomlab.com:8081/xint (try integrate x^n) -Michael From l.butler at ed.ac.uk Fri Apr 8 12:57:01 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 8 Apr 2011 18:57:01 +0100 (BST) Subject: [Maxima] Maxima's REPL In-Reply-To: References: Message-ID: On Fri, 8 Apr 2011, Stavros Macrakis wrote: < Glad to hear you have a solution for these issues. ?If you have a solution for intercepting all of Maxima's 'spontaneous' output and questions, it should be < applicable to the string-based interfaces, too. I'd really like an answer to my original question, concerning the REPL. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From macrakis at alum.mit.edu Fri Apr 8 13:18:55 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 8 Apr 2011 14:18:55 -0400 Subject: [Maxima] Maxima's REPL In-Reply-To: References: Message-ID: Not sure how to answer "roughly how the Maxima top-level works?" other than just looking at the code, which is macsyma-top-level in file macsys.lisp, which is called by cl-user::run in init-cl.lisp. Do you have any specific questions? -s On Fri, Apr 8, 2011 at 13:57, Leo Butler wrote: > > > On Fri, 8 Apr 2011, Stavros Macrakis wrote: > > < Glad to hear you have a solution for these issues. If you have a > solution for intercepting all of Maxima's 'spontaneous' output and > questions, it should be > < applicable to the string-based interfaces, too. > > > I'd really like an answer to my original question, concerning > the REPL. > Leo > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri Apr 8 14:06:39 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 08 Apr 2011 12:06:39 -0700 Subject: [Maxima] Maxima's REPL In-Reply-To: References: Message-ID: <4D9F5CBF.9010000@eecs.berkeley.edu> 1. I think there is indeed a huge advantage in doing the web server in lisp. I wrote one for Tilu, which is either online or I can send to you. The web interface is old and rather simplistic, and does not deal with "is n positive or negative" since that doesn't happen for Tilu. It also just does a simple text display of formulas, and has no plotting. 2. I agree with Stavros that you can look at the code; the meat of it is in that file, in the function "continue". It is surprising how much embroidery there is to what is, essentially.. (loop (displa(meval(mread))) I don't know what displayinput does, but just guessing, I would think it has to do with whether you are doing a batch() input from a file or from a keyboard. If the input is from a file, do you want to display the input as well as the output? Or just quietly chew up the input. And for the web interface, I'm not sure what you would want to do. You could, perhaps with some benefit, display the input nicely. You could display balanced parens and "pretty-print" the command; this might even lead some people to notice bugs in their input. It certainly does the job for me when I write programs in lisp. 3. I think that most people using javascript do it because they don't know lisp. Not that javascript is in any way essential or more convenient. I am quite sure that you can do it all in lisp. 4. There are still issues like -- if you provide a Maxima server, how do you provide security? How do you provide for multiple users? (possible answers: virtual machines; duplicate virtual machines.) RJF On 4/8/2011 9:02 AM, Leo Butler wrote: > I've been hacking at combining Maxima with AllegroServe. > I have a working version, but I am running into a bit > of a knowledge shortfall: > > Could someone describe to me roughly how the Maxima top-level > works? I believe that mread -> meval -> displa implements > the REPL but there seem to be some flags set that I am missing > because that trio produces output with a superfluous 'displayinput' > flag. > > If it helps, I am running Maxima and AllegroServe in the same lisp > image, and I am capturing Maxima's input from a get request entity, > implementing the REPL and firing back the output string. It's > quite naive, but I can see that we can replace displa with > a more suitable output parser -- and since meval is spitting out > structured Maxima forms, turning that into html or whatever > should be quite feasible. > > With a little JavaScript, we could make pretty near any browser > an interactive front-end to Maxima. > > > Leo > From drdieterkaiser at web.de Fri Apr 8 14:41:07 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 08 Apr 2011 21:41:07 +0200 Subject: [Maxima] Maxima's REPL In-Reply-To: <4D9F5CBF.9010000@eecs.berkeley.edu> References: <4D9F5CBF.9010000@eecs.berkeley.edu> Message-ID: <1302291667.1705.14.camel@dieter> Am Freitag, den 08.04.2011, 12:06 -0700 schrieb Richard Fateman: > I don't know what displayinput does, but just guessing, I would think it > has to do with whether you are doing a batch() input from a file or from > a keyboard. If the input is from a file, do you want to display the > input as well as the output? > Or just quietly chew up the input. And for the web interface, I'm not > sure what you would want to do. You could, perhaps with some benefit, > display the input nicely. You could display balanced parens and > "pretty-print" the command; this might even lead some people to notice > bugs in their input. It certainly does the job for me when I write > programs in lisp. The keywords DISPLAYINPUT and NODISPLAYINPUT are the headers of the operators ; and $. The parser - that is the function MREAD - puts these keywords as first operators into the input expression, e.g. (%i3) a+b; 0: (MREAD # (NIL)) 0: MREAD returned ((DISPLAYINPUT) NIL ((MPLUS) $A $B)) (%i4) a+b$ 0: (MREAD # (NIL)) 0: MREAD returned ((NODISPLAYINPUT) NIL ((MPLUS) $A $B)) The main loop CONTINUE calls MREAD to get the input expression R. The display routines check the keywords DISPLAYINPUT and NODISPLAYINPUT to control the output. In the routine CONTINUE the value of (CADDR R) is assigned to the variable $__. Therefore $__ holds the last input without the keywords DISPLAYINPUT and NODISPLAYINPUT. Dieter Kaiser From l.butler at ed.ac.uk Fri Apr 8 14:45:38 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 8 Apr 2011 20:45:38 +0100 (BST) Subject: [Maxima] Maxima's REPL In-Reply-To: <4D9F5CBF.9010000@eecs.berkeley.edu> References: <4D9F5CBF.9010000@eecs.berkeley.edu> Message-ID: On Fri, 8 Apr 2011, Richard Fateman wrote: < 1. I think there is indeed a huge advantage in doing the web server in lisp. Yes, I wouldn't have thought so a while ago, but after I learning a bit about lisp and how maxima represents objects internally, I think it is the prefered route. < I wrote one for Tilu, which is either online or I can send to you. The web < interface is old and < rather simplistic, and does not deal with "is n positive or negative" since < that < doesn't happen for Tilu. It also just does a simple text display of formulas, < and has < no plotting. Yes, please do. I have arrived at a similar interface, which takes a surprisingly small amount of code, given allegroserve. < < 2. I agree with Stavros that you can look at the code; the meat of it is in < that file, in the function "continue". < It is surprising how much embroidery there is to what is, essentially.. < < (loop (displa(meval(mread))) < < I don't know what displayinput does, but just guessing, I would think it has < to do with whether you are doing a batch() input from a file or from a < keyboard. If the input is from a file, do you want to display the input as < well as the output? Yes, this is about what I have picked up from the source. < Or just quietly chew up the input. And for the web interface, I'm not sure < what you would want to do. You could, perhaps with some benefit, display the < input nicely. You could display balanced parens and "pretty-print" the < command; this might even lead some people to notice bugs in their input. It < certainly does the job for me when I write programs in lisp. This is one idea. Syntax highlighting is a natural extension. < < 3. I think that most people using javascript do it because they don't know < lisp. Not that javascript is in any way essential or more convenient. Ok, I hate JS. But for browser scripting, I don't think there is any alternative. And since you don't want the browser <--> server to be retransmitting all the session information, it'll be necessary for that information to be kept by the browser and the page refreshed/redrawn when the server sends new data. < < I am quite sure that you can do it all in lisp. Yes, right up to this last point, I think. < < 4. There are still issues like -- if you provide a Maxima server, how do you < provide security? How do you provide for multiple users? < (possible answers: virtual machines; duplicate virtual machines.) Well, like the gun manufacturers, I am going to say that security is the user's problem, not mine ;-). To be serious, though, allegroserve supports ssl and authentication. So if I can get this working, I see it doing some of the following: -providing a dead-simple front-end for maxima newbies, like the sage notebook (i.e. the network here is just localhost); -providing a secure shared session for online collaboration and/or distance education Ok, enough dreaming. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From l.butler at ed.ac.uk Fri Apr 8 14:48:42 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 8 Apr 2011 20:48:42 +0100 (BST) Subject: [Maxima] Maxima's REPL In-Reply-To: <1302291667.1705.14.camel@dieter> References: <4D9F5CBF.9010000@eecs.berkeley.edu> <1302291667.1705.14.camel@dieter> Message-ID: On Fri, 8 Apr 2011, Dieter Kaiser wrote: < Am Freitag, den 08.04.2011, 12:06 -0700 schrieb Richard Fateman: < < > I don't know what displayinput does, but just guessing, I would think it < > has to do with whether you are doing a batch() input from a file or from < > a keyboard. If the input is from a file, do you want to display the < > input as well as the output? < > Or just quietly chew up the input. And for the web interface, I'm not < > sure what you would want to do. You could, perhaps with some benefit, < > display the input nicely. You could display balanced parens and < > "pretty-print" the command; this might even lead some people to notice < > bugs in their input. It certainly does the job for me when I write < > programs in lisp. < < < The keywords DISPLAYINPUT and NODISPLAYINPUT are the headers of the < operators ; and $. The parser - that is the function MREAD - puts these < keywords as first operators into the input expression, e.g. < < (%i3) a+b; < 0: (MREAD # (NIL)) < 0: MREAD returned ((DISPLAYINPUT) NIL ((MPLUS) $A $B)) < < (%i4) a+b$ < 0: (MREAD # (NIL)) < 0: MREAD returned ((NODISPLAYINPUT) NIL ((MPLUS) $A $B)) < < The main loop CONTINUE calls MREAD to get the input expression R. The < display routines check the keywords DISPLAYINPUT and NODISPLAYINPUT to < control the output. In the routine CONTINUE the value of (CADDR R) is < assigned to the variable $__. Therefore $__ holds the last input without < the keywords DISPLAYINPUT and NODISPLAYINPUT. Dieter, thanks! Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From fateman at eecs.berkeley.edu Fri Apr 8 19:06:25 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 08 Apr 2011 17:06:25 -0700 Subject: [Maxima] Maxima's REPL In-Reply-To: References: <4D9F5CBF.9010000@eecs.berkeley.edu> Message-ID: <4D9FA301.4000509@eecs.berkeley.edu> On 4/8/2011 12:45 PM, Leo Butler wrote: > > On Fri, 8 Apr 2011, Richard Fateman wrote: > > < 1. I think there is indeed a huge advantage in doing the web server in lisp. > > Yes, I wouldn't have thought so a while ago, but after I learning a bit about lisp > and how maxima represents objects internally, I think it is the > prefered route. > > < I wrote one for Tilu, which is either online or I can send to you. The web > < interface is old and > < rather simplistic, and does not deal with "is n positive or negative" since > < that > < doesn't happen for Tilu. It also just does a simple text display of formulas, > < and has > < no plotting. > > Yes, please do. I have arrived at a similar interface, which takes a > surprisingly small amount of code, given allegroserve. The source code is online in http://www.cs.berkeley.edu/~fateman/tilu/ in particular, the internet server code is in the file tilu-iserve.cl I think that iserve and neo were earlier names for allegroserve. (There are other web-hosting-in-lisp software packages. I don't know the relative advantages or disadvantages, but one other that seems to be used by people is huchentoot. ) From willisb at unk.edu Sat Apr 9 04:25:17 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 9 Apr 2011 04:25:17 -0500 Subject: [Maxima] definite integrate sets logabs to true In-Reply-To: <4D9FA301.4000509@eecs.berkeley.edu> References: <4D9F5CBF.9010000@eecs.berkeley.edu> , <4D9FA301.4000509@eecs.berkeley.edu> Message-ID: The definite integrate function sets logabs to true; thus (%i8) assume(r > 0)$ (%i9) integrate(partfrac(gfactor(1/(x^2+1)),x),x,0,r); (%o9) %i*(log(abs(r+%i))/2-log(abs(r-%i))/2) Oops... (%i10) limit(%,r,inf); (%o10) 0 The user documentation for logabs, but not integrate, says that definite integration sets logabs to true--the integrate documentation doesn't mention logabs :( Should the definite integration code allow the user to choose the value for logabs? --Barton From roycstannard at gmail.com Sun Apr 10 18:44:33 2011 From: roycstannard at gmail.com (Roy Stannard) Date: Mon, 11 Apr 2011 09:44:33 +1000 Subject: [Maxima] Does Maxima work on Windows?? Message-ID: Hi, This is my first post to the forum and it's prompted by my having a problem getting Maxima to work on WindowsXP SP3. I get the 'not connected to Maxima' message. I followed the installation instructions to the letter so I'm puzzled!! I've googled the problem and there doesn't seem to be any clearcut solution to this problem (tho I may have missed it). I have previous experience with Maxima on a linux machine (Ubuntu 10.04) and had no problems there at all. Any help would be most welcome -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sun Apr 10 19:38:50 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 10 Apr 2011 19:38:50 -0500 Subject: [Maxima] Does Maxima work on Windows?? In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >This?is?my?first?post?to?the?forum?and?it's?prompted?by?my?having?a >problem?getting?Maxima?to?work?on?WindowsXP?SP3.?I?get?the?'not?connected >to?Maxima'?message.?I?followed?the?installation?instructions?to?the?letter >so?I'm?puzzled!!?I've?googled?the?problem?and?there?doesn't?seem?to?be?any >clearcut?solution?to?this?problem?(tho?I?may?have?missed?it).? Yes, Maxima does work under Windows XP and Windows 7, but some users do have the 'not connected' problem. Try searching the Maxima mailing list for "zone alarm." For example http://www.math.utexas.edu/pipermail/maxima/2011/024238.html More generally, to search the Maxima mailing list, visit http://maxima.sourceforge.net/maximalist.html I don't have any experience with such problems--maybe somebody else on the list can give you better advice. Good luck. --Barton From hbaker1 at pipeline.com Sun Apr 10 19:55:19 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Sun, 10 Apr 2011 17:55:19 -0700 Subject: [Maxima] Does Maxima work on Windows?? In-Reply-To: References: Message-ID: Hi Roy: I use Maxima on XP on a 32-bit laptop all the time. Both xmaxima & wxmaxima work. However, you may get a warning about opening up a path through the firewall. If you didn't get such a message, the firewall may be blocking access to maxima. At 04:44 PM 4/10/2011, Roy Stannard wrote: >Hi, > >This is my first post to the forum and it's prompted by my having a problem getting Maxima to work on WindowsXP SP3. I get the 'not connected to Maxima' message. I followed the installation instructions to the letter so I'm puzzled!! I've googled the problem and there doesn't seem to be any clearcut solution to this problem (tho I may have missed it). > >I have previous experience with Maxima on a linux machine (Ubuntu 10.04) and had no problems there at all. > >Any help would be most welcome From daniel.dalton47 at gmail.com Sun Apr 10 20:43:18 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Mon, 11 Apr 2011 11:43:18 +1000 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: References: <20110403055130.GA13712@gwsc.vic.edu.au> <20110403210247.GB3664@gwsc.vic.edu.au> Message-ID: <20110411014318.GA9991@gwsc.vic.edu.au> On Sun, Apr 03, 2011 at 11:02:33PM +0100, Leo Butler wrote: > < into a file or something so it doesn't need to be done each time? > < Anyway, I'll have a go at it when I get home this afternoon. > > Yes, just copy the input lines without the input labels into a > file (it is usual to end the file name with a .mac ending). > In Maxima: Ok, I get these errors when running the load command in maxima: (%i1) batch (findeq.mac); Maxima encountered a Lisp error: Error in PROGN [or a callee]: ((MNCTIMES SIMP) $FINDEQ $MAC) cannot be coerced to a namestring. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. The file contains the following lines: load(lsquares); lsqn(data,n):=block([poly,a,coeffs,x,est,mse,model], poly:sum(x^i*a[i],i,0,n),coeffs:delete(x,listofvars(poly)), est:lsquares_estimates(data,[x,y],y = poly,coeffs), model:subst(est[1],poly), mse:sum((data[i,2]-subst(x = data[i,1],model))^2,i,1,length(data)) /length(data), [model,mse])$ data : genmatrix(lambda([x,y], if y=1 then x else (1+2*x+3*x^2)),6,2); Once this is actually working how can I put my own data points in? Thanks, Dan From daniel.dalton47 at gmail.com Sun Apr 10 20:45:32 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Mon, 11 Apr 2011 11:45:32 +1000 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <4D9960D4.5050006@unicaen.fr> References: <20110403055130.GA13712@gwsc.vic.edu.au> <20110403210247.GB3664@gwsc.vic.edu.au> <4D9960D4.5050006@unicaen.fr> Message-ID: <20110411014532.GB9991@gwsc.vic.edu.au> On Mon, Apr 04, 2011 at 08:10:28AM +0200, Eric Reyssat wrote: > - the solution is more readable, may be more easily interpreted > geometrically, or used for further computations > - you may want to compare how much you improve the fit between > linear and cubic results > - your teacher may want you to show your understanding of different > kinds of approximations > Can maxima do all of this? (with the code Leo provided)? Thanks, Dan From daniel.dalton47 at gmail.com Sun Apr 10 20:52:07 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Mon, 11 Apr 2011 11:52:07 +1000 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: References: <20110403055130.GA13712@gwsc.vic.edu.au> <20110403210247.GB3664@gwsc.vic.edu.au> Message-ID: <20110411015206.GC9991@gwsc.vic.edu.au> On Mon, Apr 04, 2011 at 08:50:25AM +0100, Rupert Swarbrick wrote: > > We haven't covered this in our course yet. I was hoping their was a > > function available like to the other students just to return the > > points... I'll run this by my teacher anyway. > > > > Unless the calculators the other students are using do this by working > out a derivative "behind-the-scenes", what they probably do is the > following: Take an evenly spaced list of numbers across the interval in > which you're interested and evaluate the function at each of them. Then > you have an idea of where it's largest. If you want more precision, you > can then choose points closer together near where you think the > minima/maxima are. Obviously this gets done magically behind the scenes, > but it basically works in the same way as drawing a graph and finding > the minima/maxima by eye. So if I were to use differentiation would I obtain the same accuracy? This is how I did it: f(x):=my function; float(solve(diff(f(x),x))); float(f(%)); The answer was supposed to be in decimal btw. > But anyway, if you ask your teacher about this, try and find out exactly > what method he or she wants you to understand. If he or she just wants > you to get a numerical approximation to the answer, maybe so you get a > feel for a certain function, you could just look at the graph and do it > by eye! Yes, though I'm blind so I can't look at the graph:) I presume what I said above with differentiation would give me just as accurate if not more accurate answer than looking at the graph? Using differentiation (like I describe above), would I receive an answer as accurate as the other students with their cas calculators? I know they get decimal values... Thanks, Dan From rroa at azti.es Mon Apr 11 02:24:08 2011 From: rroa at azti.es (=?iso-8859-1?Q?Rub=E9n_Roa?=) Date: Mon, 11 Apr 2011 09:24:08 +0200 Subject: [Maxima] Does Maxima work on Windows?? In-Reply-To: References: Message-ID: <5CD78996B8F8844D963C875D3159B94A02241A4F@dsrcorreo> Unfortunately, it appears that the solution is still pending or will not be available at all. Other posters are pointing to a firewall problem but I had the same problem in a Windows XP machine without any firewall. The problem is also there on a Windows Vista machine. I have no such problem though in a Windows XP Professional Edition (and of course it's all right on Linux systems). It seems the problem presents itself on Windows Home editions only, but not on all of them. Try running maxima from the DOS command line (doesn't work for me either). Rub?n ____________________________________________________________________________________ Dr. Rub?n Roa-Ureta AZTI - Tecnalia / Marine Research Unit Txatxarramendi Ugartea z/g 48395 Sukarrieta (Bizkaia) SPAIN ________________________________ De: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] En nombre de Roy Stannard Enviado el: lunes, 11 de abril de 2011 1:45 Para: maxima at math.utexas.edu Asunto: [Maxima] Does Maxima work on Windows?? Hi, This is my first post to the forum and it's prompted by my having a problem getting Maxima to work on WindowsXP SP3. I get the 'not connected to Maxima' message. I followed the installation instructions to the letter so I'm puzzled!! I've googled the problem and there doesn't seem to be any clearcut solution to this problem (tho I may have missed it). I have previous experience with Maxima on a linux machine (Ubuntu 10.04) and had no problems there at all. Any help would be most welcome -------------- next part -------------- An HTML attachment was scrubbed... URL: From l.butler at ed.ac.uk Mon Apr 11 02:39:37 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 11 Apr 2011 08:39:37 +0100 (BST) Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <20110411014318.GA9991@gwsc.vic.edu.au> References: <20110403055130.GA13712@gwsc.vic.edu.au> <20110403210247.GB3664@gwsc.vic.edu.au> <20110411014318.GA9991@gwsc.vic.edu.au> Message-ID: On Mon, 11 Apr 2011, Daniel Dalton wrote: < On Sun, Apr 03, 2011 at 11:02:33PM +0100, Leo Butler wrote: < > < into a file or something so it doesn't need to be done each time? < > < Anyway, I'll have a go at it when I get home this afternoon. < > < > Yes, just copy the input lines without the input labels into a < > file (it is usual to end the file name with a .mac ending). < > In Maxima: < < Ok, I get these errors when running the load command in maxima: < (%i1) batch (findeq.mac); Try batch("findeq.mac"); The arguments to batch and load should generally be strings, so they should be quoted. < < Maxima encountered a Lisp error: < < Error in PROGN [or a callee]: ((MNCTIMES SIMP) $FINDEQ $MAC) cannot be < coerced to a namestring. This error message is telling you that Maxima has parsed the argument to batch not as a string but as a product of the variable findeq and mac ("." is non-commutative multiplication in Maxima, and that cryptic MNCTIMES SIMP is how Maxima represents this internally). < < Automatically continuing. < To enable the Lisp debugger set *debugger-hook* to nil. < < The file contains the following lines: < load(lsquares); < lsqn(data,n):=block([poly,a,coeffs,x,est,mse,model], < poly:sum(x^i*a[i],i,0,n),coeffs:delete(x,listofvars(poly)), < est:lsquares_estimates(data,[x,y],y = poly,coeffs), < model:subst(est[1],poly), < mse:sum((data[i,2]-subst(x = data[i,1],model))^2,i,1,length(data)) < /length(data), < [model,mse])$ < data : genmatrix(lambda([x,y], if y=1 then x else < (1+2*x+3*x^2)),6,2); < < Once this is actually working how can I put my own data points in? You can add something like: mydata : matric([1,2],[2,5], etc. ); if you need to enter the data manually. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From l.butler at ed.ac.uk Mon Apr 11 03:01:08 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 11 Apr 2011 09:01:08 +0100 (BST) Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <20110411015206.GC9991@gwsc.vic.edu.au> References: <20110403055130.GA13712@gwsc.vic.edu.au> <20110403210247.GB3664@gwsc.vic.edu.au> <20110411015206.GC9991@gwsc.vic.edu.au> Message-ID: On Mon, 11 Apr 2011, Daniel Dalton wrote: < On Mon, Apr 04, 2011 at 08:50:25AM +0100, Rupert Swarbrick wrote: < < > > We haven't covered this in our course yet. I was hoping their was a < > > function available like to the other students just to return the < > > points... I'll run this by my teacher anyway. < > > < > < > Unless the calculators the other students are using do this by working < > out a derivative "behind-the-scenes", what they probably do is the < > following: Take an evenly spaced list of numbers across the interval in < > which you're interested and evaluate the function at each of them. Then < > you have an idea of where it's largest. If you want more precision, you < > can then choose points closer together near where you think the < > minima/maxima are. Obviously this gets done magically behind the scenes, < > but it basically works in the same way as drawing a graph and finding < > the minima/maxima by eye. < < So if I were to use differentiation would I obtain the same accuracy? < This is how I did it: < f(x):=my function; < < float(solve(diff(f(x),x))); < float(f(%)); < < The answer was supposed to be in decimal btw. You should be able to do all the calculations symbolically, then convert the final answer to floating point. It is easier to check intermediate steps if you do this. I think, also, when you do eqn : diff(f(x),x) = 0; critical_points : solve(eqn,x); you should get a list of 1 or more critical points. To find the value of f at each of this points, you can do the following: makelist( [ cp, y=f(rhs(cp)) ], cp, critical_points); which will give you a list of pairs list [x=1,y=2], etc. < < > But anyway, if you ask your teacher about this, try and find out exactly < > what method he or she wants you to understand. If he or she just wants < > you to get a numerical approximation to the answer, maybe so you get a < > feel for a certain function, you could just look at the graph and do it < > by eye! < < Yes, though I'm blind so I can't look at the graph:) I presume what I < said above with differentiation would give me just as accurate if not < more accurate answer than looking at the graph? < < Using differentiation (like I describe above), would I receive an answer < as accurate as the other students with their cas calculators? I know < they get decimal values... Differentiation will give a more accurate answer, since the only approximation will be at the final step when you convert the exact symbolic answer to floating point; and even if you do the computations in floating point, it will still be more accurate (the human eye is unable to obtain more than 2 or 3 decimal points of accuracy). Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From talon at lpthe.jussieu.fr Mon Apr 11 08:31:52 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Mon, 11 Apr 2011 15:31:52 +0200 Subject: [Maxima] Problem with chain rule Message-ID: It seems there is a problem here: niobe% maxima (%i1) depends(f,[x,y])$ (%i2) depends(y,x)$ (%i3) diff(f); df df dy df (%o3) -- del(y) + (-- -- + --) del(x) dy dy dx dx (%i4) -- Michel Talon From mxue at vroomlab.com Mon Apr 11 15:44:58 2011 From: mxue at vroomlab.com (Michael Xue) Date: Mon, 11 Apr 2011 20:44:58 +0000 (UTC) Subject: [Maxima] Problem with chain rule References: Message-ID: Michel Talon lpthe.jussieu.fr> writes: > > It seems there is a problem here: > > niobe% maxima > (%i1) depends(f,[x,y])$ > > (%i2) depends(y,x)$ > > (%i3) diff(f); > df df dy df > (%o3) -- del(y) + (-- -- + --) del(x) > dy dy dx dx > (%i4) > try: depends(f, [x,y])$ depends(y,x)$ diff(f,x); - Michael Xue From l.couraud at gmail.com Mon Apr 11 17:47:51 2011 From: l.couraud at gmail.com (laurent couraud) Date: Tue, 12 Apr 2011 00:47:51 +0200 Subject: [Maxima] Bug in XMaxima Message-ID: Hello, I find a small bug in XMaxima. Closing and opening XMaxima browser give the following error: bad window path name ".browser" bad window path name ".browser" while executing "frame $w" (procedure "mkOpenMath" line 17) invoked from within "mkOpenMath [set w $toplevel.t[incr maxima_priv(counter)]] " (procedure "OpenMathOpenUrl" line 95) invoked from within "OpenMathOpenUrl "file:/C:/PROGRA~1/MAXIMA~1.0/share/maxima/524~1.0/xmaxima/html/XMAXIM~1.HTM"" (menu invoke) As you can see there is /maxima/524~1.0/ in the path instead of /maxima/5.24~1.0/ Best. From jeremy.dudley at wrcplc.co.uk Mon Apr 11 19:56:34 2011 From: jeremy.dudley at wrcplc.co.uk (Dudley, Jeremy) Date: Tue, 12 Apr 2011 01:56:34 +0100 Subject: [Maxima] maxima on windowx References: Message-ID: <7FC80E38F8B058449E78B6A7FAF51FCC044D1F6C@EXCHANGESVR.wrcgroup.com> I use windows xp sp3 professional at work and windows vista home edition at home. No problems with maxima with either. When i used to run a firewall I had to put maxima on the allowed list, but the firewall is now handled in router hardware and that has gone away. ------------------------------------------------------------------------------------------- To read our latest newsletter visit http://www.wrcplc.co.uk/default.aspx?item=835 - Keeping our clients up-to-date with WRc's business developments ------------------------------------------------------------------------------------------- Visit our websites www.wrcplc.co.uk and www.wrcnsf.com, as well as www.waterportfolio.com for collaborative research projects. ------------------------------------------------------------------------------------------- The Information in this e-mail is confidential and is intended solely for the addressee. Access to this e-mail by any other party is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on the information contained in this e-mail is prohibited and maybe unlawful. When addressed to WRc Clients, any opinions or advice contained in this e-mail are subject to the terms and conditions expressed in the governing WRc Client Agreement. ------------------------------------------------------------------------------------------- WRc plc is a company registered in England and Wales. Registered office address: Frankland Road, Blagrove, Swindon, Wiltshire SN5 8YF. Company registration number 2262098. VAT number 527 1804 53. ------------------------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 2466 bytes Desc: not available URL: From roycstannard at gmail.com Mon Apr 11 21:54:14 2011 From: roycstannard at gmail.com (Roy Stannard) Date: Tue, 12 Apr 2011 12:54:14 +1000 Subject: [Maxima] Does Maxima work on Windows?? In-Reply-To: References: Message-ID: Thanks for all the replies. I don't think it can be the firewall as it is disabled. I haven't been able to get maxima to run from the command line either but since I was hoping to set maxima up on winxp for a high school student, I hadn't intended to use maxima in that mode anyhow. At the moment, I'm stymied. It seems strange that maxima should run OK on some installations of winxp and not others. Are there any other winxp settings that could be relevant to this problem? Please pardon my questions, I've been using linux for the past five years and I'm pretty rusty on winxp. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbmaxima at gmail.com Mon Apr 11 22:10:15 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Tue, 12 Apr 2011 13:10:15 +1000 Subject: [Maxima] Does Maxima work on Windows? In-Reply-To: References: Message-ID: <4DA3C297.2030603@gmail.com> On 12/04/2011 12:54 PM, Roy Stannard wrote: > Thanks for all the replies. I don't think it can be the firewall as it > is disabled. > > I haven't been able to get maxima to run from the command line either > but since I was hoping to set maxima up on winxp for a high school > student, I hadn't intended to use maxima in that mode anyhow. Lets go right back to basics and tryat a low level Open a cmd window and enter 1. cd "C:\Program Files\Maxima-5.23.2\bin" 2. .\maxima.bat If that doesn't produce something, try 1. cd "C:\Program Files\Maxima-5.23.2 2. lib\maxima\5.23.2\binary-gcl\maxima.exe -eval "(cl-user::run)" -f -- What do you see? In both cases I see: Maxima 5.23.2 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) -------------- next part -------------- An HTML attachment was scrubbed... URL: From roycstannard at gmail.com Mon Apr 11 23:51:03 2011 From: roycstannard at gmail.com (Roy Stannard) Date: Tue, 12 Apr 2011 14:51:03 +1000 Subject: [Maxima] Does Maxima work on Windows?? In-Reply-To: References: Message-ID: In the first case, I get " 'D:\Program' is not recognized as an internal or external command, operable program or batch file " In the second, I get D:\program files\Maxima-5.23.2>lib\maxima\5.23.2\binary-gcl\maxima.exe -eval"(cl -user::run)" -f-- GCL (GNU Common Lisp) 2.6.8 ANSI Apr 12 2008 12:15:14 Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl) Binary License: GPL due to GPL'ed components: (UNEXEC) Modifications of this banner must retain notice of a compatible license Dedicated to the memory of W. Schelter Use (help) to get some basic information on how to use GCL. Temporary directory for compiler files set to C:/DOCUME~1/eve/Local Settings/Tem p/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrej.vodopivec at gmail.com Tue Apr 12 01:06:08 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Tue, 12 Apr 2011 08:06:08 +0200 Subject: [Maxima] Does Maxima work on Windows?? In-Reply-To: References: Message-ID: On Tue, Apr 12, 2011 at 6:51 AM, Roy Stannard wrote: > > In the first case, I get " 'D:\Program' is not recognized as an internal or > external command, operable program or batch file " > > In the second, I get > > D:\program files\Maxima-5.23.2>lib\maxima\5.23.2\binary-gcl\maxima.exe > -eval"(cl > -user::run)" -f-- > GCL (GNU Common Lisp)? 2.6.8 ANSI??? Apr 12 2008 12:15:14 > Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl) > Binary License:? GPL due to GPL'ed components: (UNEXEC) > Modifications of this banner must retain notice of a compatible license > Dedicated to the memory of W. Schelter > > Use (help) to get some basic information on how to use GCL. > Temporary directory for compiler files set to C:/DOCUME~1/eve/Local > Settings/Tem > p/ For version 5.24 there are binaries built with gcl and ccl. Maybe you can try the one built with ccl to see it that one works. Andrej From villate at fe.up.pt Tue Apr 12 02:06:13 2011 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 12 Apr 2011 08:06:13 +0100 Subject: [Maxima] Bug in XMaxima In-Reply-To: References: Message-ID: <1302591973.2015.1.camel@wigner> On Tue, 2011-04-12 at 00:47 +0200, laurent couraud wrote: > "OpenMathOpenUrl > "file:/C:/PROGRA~1/MAXIMA~1.0/share/maxima/524~1.0/xmaxima/html/XMAXIM~1.HTM"" > (menu invoke) > > > As you can see there is /maxima/524~1.0/ in the path instead > of /maxima/5.24~1.0/ Hi, thanks for your report. Something went wrong with the Windows Maxima packaging. I will try to fix it later today. Regards, Jaime From talon at lpthe.jussieu.fr Tue Apr 12 04:18:17 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 12 Apr 2011 11:18:17 +0200 Subject: [Maxima] Problem with chain rule References: Message-ID: Michael Xue wrote: > Michel Talon lpthe.jussieu.fr> writes: > >> >> It seems there is a problem here: >> >> niobe% maxima >> (%i1) depends(f,[x,y])$ >> >> (%i2) depends(y,x)$ >> >> (%i3) diff(f); >> df df dy df >> (%o3) -- del(y) + (-- -- + --) del(x) >> dy dy dx dx >> (%i4) >> > > try: > > depends(f, [x,y])$ > depends(y,x)$ > diff(f,x); > > - Michael Xue Sorry but this is not the point. Answer should be either df/dy del y + df/dx del x according to maxima doc ( del x and del y are not further expanded) or (df/dy dy/dx + df/dx) del x according to sane mathematical rules. Both are correct since the first reduces to the second when expanding del y. On the contrary maxima result is hard to justify. If instead of depends(y,x) there was depends(y,[x,z]) then a correct rule looking a little bit like the above would be: (df/dy dy/dz) del z + (df/dy dy/dx + df/dx) del x and with a lot of hand waving one could justify maxima result by replacing (dy/dz) del z = del y. -- Michel Talon From maxima at etherjones.us Tue Apr 12 14:31:11 2011 From: maxima at etherjones.us (Ether Jones) Date: Tue, 12 Apr 2011 12:31:11 -0700 (PDT) Subject: [Maxima] realonly Message-ID: <604834.87276.qm@web161819.mail.bf1.yahoo.com> realonly: true; assume(C>0); assume(P(t)>0); P(t)*V(t)^1.4=C; solve(%,V(t)); How do I tell Maxima to return only the real solution for V(t) ? Thank you. -------------- next part -------------- A non-text attachment was scrubbed... Name: realonly.gif Type: image/gif Size: 7009 bytes Desc: not available URL: From maxima at etherjones.us Tue Apr 12 16:07:33 2011 From: maxima at etherjones.us (Ether Jones) Date: Tue, 12 Apr 2011 14:07:33 -0700 (PDT) Subject: [Maxima] what is the difference between :, =, and := In-Reply-To: <604834.87276.qm@web161819.mail.bf1.yahoo.com> Message-ID: <971396.96372.qm@web161807.mail.bf1.yahoo.com> Can someone recommend a lucid document that explains what the difference is between ":", "=", and ":=" in Maxima, and under what circumstances each one should be used? Thank you. From l.butler at ed.ac.uk Tue Apr 12 16:36:19 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 12 Apr 2011 22:36:19 +0100 (BST) Subject: [Maxima] what is the difference between :, =, and := In-Reply-To: <971396.96372.qm@web161807.mail.bf1.yahoo.com> References: <971396.96372.qm@web161807.mail.bf1.yahoo.com> Message-ID: On Tue, 12 Apr 2011, Ether Jones wrote: < < Can someone recommend a lucid document that explains what the difference is between ":", "=", and ":=" in Maxima, and under what circumstances each one should be used? : is the assignment operator, so you would write x:1; to store 1 in the variable x. := is the operator to define a function, so you would write f(x) := ....; to define a function f of one variable. = creates an equation, and it is used to test syntactic equality, so you would write solve(sin(x)=0,x); to find the zeros of sin(x) or is(a=b); to test if the expressions a and b are syntactically equal. (These two roles are somewhat inconsistent.) You can find help on X in Maxima by typing: ? X or ?? X Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From roycstannard at gmail.com Tue Apr 12 17:30:33 2011 From: roycstannard at gmail.com (Roy Stannard) Date: Wed, 13 Apr 2011 08:30:33 +1000 Subject: [Maxima] Does Maxima work on Windows?? In-Reply-To: References: Message-ID: Would it be possible to put together a trouble shooting guide for those, like me, who are having difficulties getting Maxima up and running on a winxp platform? Maxima is an excellent application and it is disappointing for some of its wouldbe winxp users that it does not install readily. It would be helpful to have the group wisdom on this issue in the one location, chasing obscure OS settings is not my idea of fun. On 11 April 2011 09:44, Roy Stannard wrote: > Hi, > > This is my first post to the forum and it's prompted by my having a problem > getting Maxima to work on WindowsXP SP3. I get the 'not connected to Maxima' > message. I followed the installation instructions to the letter so I'm > puzzled!! I've googled the problem and there doesn't seem to be any clearcut > solution to this problem (tho I may have missed it). > > I have previous experience with Maxima on a linux machine (Ubuntu 10.04) > and had no problems there at all. > > Any help would be most welcome > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxima at etherjones.us Tue Apr 12 17:51:26 2011 From: maxima at etherjones.us (Ether Jones) Date: Tue, 12 Apr 2011 15:51:26 -0700 (PDT) Subject: [Maxima] Does Maxima work on Windows?? In-Reply-To: Message-ID: <275201.20945.qm@web161809.mail.bf1.yahoo.com> I have Maxima running on XP.?? It took me a while to figure out that you have to disable DEP (Data Execution Prevention) or Maxima will not work. If you need more detail let me know. --- On Tue, 4/12/11, Roy Stannard wrote: From: Roy Stannard Subject: Re: [Maxima] Does Maxima work on Windows?? To: maxima at math.utexas.edu Date: Tuesday, April 12, 2011, 6:30 PM Would it be possible to put together a trouble shooting guide for those, like me, who are having difficulties getting Maxima up and running on a winxp platform? Maxima is an excellent application and it is disappointing for some of its wouldbe winxp users that it does not install readily.? It would be helpful to have the group wisdom on this issue in the one location, chasing obscure OS settings is not my idea of fun. On 11 April 2011 09:44, Roy Stannard wrote: Hi, This is my first post to the forum and it's prompted by my having a problem getting Maxima to work on WindowsXP SP3. I get the 'not connected to Maxima' message. I followed the installation instructions to the letter so I'm puzzled!! I've googled the problem and there doesn't seem to be any clearcut solution to this problem (tho I may have missed it). I have previous experience with Maxima on a linux machine (Ubuntu 10.04) and had no problems there at all. Any help would be most welcome -----Inline Attachment Follows----- _______________________________________________ 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 12 18:37:14 2011 From: maxima at etherjones.us (Ether Jones) Date: Tue, 12 Apr 2011 16:37:14 -0700 (PDT) Subject: [Maxima] Does Maxima work on Windows?? Message-ID: <861324.30619.qm@web161816.mail.bf1.yahoo.com> WinXP Pro SP3 control panel -> system -> advanced -> Performance Settings -> Data Execution Prevention - browse to the maxima executable and add it to the list of exceptions - also add wxmaxima if you are going to use that (requites admin privileges to access & change) From rroa at azti.es Wed Apr 13 02:05:06 2011 From: rroa at azti.es (=?iso-8859-1?Q?Rub=E9n_Roa?=) Date: Wed, 13 Apr 2011 09:05:06 +0200 Subject: [Maxima] Does Maxima work on Windows?? References: <861324.30619.qm@web161816.mail.bf1.yahoo.com> Message-ID: <5CD78996B8F8844D963C875D3159B94A0111211F@dsrcorreo> -----Original Message----- From: maxima-bounces at math.utexas.edu on behalf of Ether Jones Sent: Wed 4/13/2011 1:37 AM To: maxima at math.utexas.edu; Roy Stannard Subject: Re: [Maxima] Does Maxima work on Windows?? WinXP Pro SP3 control panel -> system -> advanced -> Performance Settings -> Data Execution Prevention - browse to the maxima executable and add it to the list of exceptions - also add wxmaxima if you are going to use that (requites admin privileges to access & change) ----- I did that too; it didn't work. The problem lies somewhere in some obscure Winxp Home Edition setting, I'm pretty sure of that. However, I haven't yet tried David Billinghurst's second low level check: Begin quote: Lets go right back to basics and tryat a low level Open a cmd window and enter 1. cd "C:\Program Files\Maxima-5.23.2\bin" 2. .\maxima.bat If that doesn't produce something, try 1. cd "C:\Program Files\Maxima-5.23.2 2. lib\maxima\5.23.2\binary-gcl\maxima.exe -eval "(cl-user::run)" -f -- End quote ... I just did, with a fresh install of Maxima 5.24.0 (gcl), and in both low-level checks there was no result. I mean that nothing happened, the DOS console just jumped to the next line and did nothing. Maxima didn't start. I have downloaded maxima-5.24.0-ccl and will install it after uninstalling the previous maxima-5.24.0 (gcl). Will see what comes out. Details of the system affected: Windows Vista Home Premium SP2 Rub?n -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Thu Apr 14 11:25:44 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Thu, 14 Apr 2011 18:25:44 +0200 Subject: [Maxima] Levin, Hyperint Message-ID: Hello, i have discovered 2 programs included in maxima, but whose function is not very clear to me. One is levin, it has been mentioned recently here. Acccording to the comments it is used to improve convergence of "numerical" sums, such as: levin_u_sum(1/n^2,n,1,10); However i have tried to add a parameter, such as: g: rat(levin_u_sum(t^n/n^2,n,1,10)); which results in something looking like a Pad? approximant in the variable t. I have checked for various values of t like 1/3, 1/5 that this formula reproduces what one gets by directly substituting t=1/3 ... before computing levin, so the formula seems correct. Is this an intended use of levin, and does this produce an alternative way to get Pad? approximants - which would be interesting because the pade command in maxima saturates very fast? The other is hyperint, for which i have not found any documentation. However trying it, i have found very supicious result: niobe% maxima (%i1) load(hyperint); ... (%i3) hyper_int(1/sqrt(x*(x+1)*(x-1)),x); ; ; Warning: This function is undefined: ; GAMMA 1 1 5 2 2 2 hypergeometric([-, -], [-], x ) x sqrt(1 - x ) 4 2 4 (%o3) ------------------------------------------------ 3 sqrt(x - x) First the gamma function is well defined in maxima, and second the integral in question is obviously elliptic, and i have not found formula which reduces incomplete elliptic integral to hypergeometric functions (in contrast with complete integral). Maybe there exists one, but i am not aware. -- Michel Talon From maxima at etherjones.us Thu Apr 14 13:22:21 2011 From: maxima at etherjones.us (Ether Jones) Date: Thu, 14 Apr 2011 11:22:21 -0700 (PDT) Subject: [Maxima] rhs & subst In-Reply-To: <861324.30619.qm@web161816.mail.bf1.yahoo.com> Message-ID: <956435.36719.qm@web161809.mail.bf1.yahoo.com> 1) How to extract the right-hand side on line %o4 below? 2) On line %o5 below, how to get dV/dt = 250/7 instead of 0=250/7? Maxima 5.22.1 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) depends(P,t,V,t); (%o1) [P(t), V(t)] (%i2) P*V^(1.4)=C; 1.4 (%o2) P V = C (%i3) diff(%,t); 0.4 dV dP 1.4 (%o3) 1.4 P V -- + -- V = 0 dt dt (%i4) solve(%,diff(V,t)); dP 5 -- V dV dt (%o4) [-- = - ------] dt 7 P (%i5) subst([diff(P,t)=-10,V=400,P=80],%); 250 (%o5) [0 = ---] 7 From willisb at unk.edu Thu Apr 14 13:47:43 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 14 Apr 2011 13:47:43 -0500 Subject: [Maxima] Levin, Hyperint In-Reply-To: References: Message-ID: --Barton maxima-bounces at math.utexas.edu wrote on 04/14/2011 11:25:44 AM: > (%i3) hyper_int(1/sqrt(x*(x+1)*(x-1)),x); > ; > > ; Warning: This function is undefined: > ; GAMMA > 1 1 5 2 2 > 2 hypergeometric([-, -], [-], x ) x sqrt(1 - x ) > 4 2 4 > (%o3) ------------------------------------------------ > 3 > sqrt(x - x) > > First the gamma function is well defined in maxima, and second the > integral in question is obviously elliptic, and i have not found formula > which reduces incomplete elliptic integral to hypergeometric functions > (in contrast with complete integral). Maybe there exists one, but i am not > aware. There is also inverse_jacobi_int: (%i124) inverse_jacobi_int(1/sqrt(x*(x+1)*(x-1)),x); (%o124) -(2*%i*inverse_jacobi_sn((%i*sqrt(x-1))/sqrt(2),2)*sqrt(x-1)*sqrt(x)*sqrt(x+1))/sqrt(x^3-x) Check: (%i125) ratsimp(diff(%,x)); (%o125) 1/sqrt(x^3-x) (%i126) hyper_int(1/sqrt(x*(x+1)*(x-1)),x); (%o126) (2*hypergeometric([1/4,1/2],[5/4],x^2)*x*sqrt(1-x^2))/sqrt(x^3-x) This might also be correct, but I don't know which recursions to use to show it. Evidence that %o126 might be correct: (%i127) taylor(diff(%,x) - 1/sqrt(x*(x+1)*(x-1)),x,0,128); (%o127)/T/ 0+... I don't get the warning about gamma--maybe this is due to the Maxima version you are using? --bw From javier.arantegui at gmail.com Thu Apr 14 14:01:20 2011 From: javier.arantegui at gmail.com (Javier Arantegui) Date: Thu, 14 Apr 2011 21:01:20 +0200 Subject: [Maxima] rhs & subst In-Reply-To: <956435.36719.qm@web161809.mail.bf1.yahoo.com> References: <861324.30619.qm@web161816.mail.bf1.yahoo.com> <956435.36719.qm@web161809.mail.bf1.yahoo.com> Message-ID: Hi! On Thu, Apr 14, 2011 at 8:22 PM, Ether Jones wrote: > 1) How to extract the right-hand side on line %o4 below? rhs(%[1]); Javier -- Lee mi blog: "Un peque?o paso para Neil" http://up3n.wordpress.com/ ?Ahora tambi?n en Twitter! http://twitter.com/javierarantegui From g7rgtxn at gmx.de Fri Apr 15 00:46:30 2011 From: g7rgtxn at gmx.de (=?iso-8859-1?Q?Dr._Klemens_Waldh=F6r?=) Date: Fri, 15 Apr 2011 07:46:30 +0200 Subject: [Maxima] wxMaxima and ImageMagcik Message-ID: <002c01cbfb30$7898e880$69cab980$@gmx.de> Hi, I am using wxMaxima heavily. I have written a procedure which creates an animation. Now I wanted to save the animation as an animated gif file. When trying this I get the message that I should have ImageMagick installed and that I should ensure that wxMaxima can find the tool. No information is around how to configure wxMaxima. ImageMagic is found on the command line. I have installed the 64bit version of ImageMagick. Any ideas how to solve this problem? Thanks! regards --------------------------------------- Klemens From BIOMATES at telefonica.net Fri Apr 15 02:37:58 2011 From: BIOMATES at telefonica.net (BIOMATES at telefonica.net) Date: Fri, 15 Apr 2011 09:37:58 +0200 (CEST) Subject: [Maxima] Draw and VTK Message-ID: <3526679.182531302853078775.JavaMail.defaultUser@defaultHost> Hello, The next Maxima release will be shipped with an experimental version of the VTK interface. It has been tested with Ubuntu and Windows (both ccl and gcl versions). Since it is experimental, no documentation has been written, and things can be changed in future versions. Here are some examples of use: http://riotorto.users.sourceforge.net/vtk Good luck. -- Mario -------------- next part -------------- An HTML attachment was scrubbed... URL: From BIOMATES at telefonica.net Fri Apr 15 02:39:20 2011 From: BIOMATES at telefonica.net (BIOMATES at telefonica.net) Date: Fri, 15 Apr 2011 09:39:20 +0200 (CEST) Subject: [Maxima] wxMaxima and ImageMagcik Message-ID: <22486809.182651302853160676.JavaMail.defaultUser@defaultHost> El vie, 15-04-2011 a las 07:46 +0200, Dr. Klemens Waldh?r escribi?: > Hi, > > I am using wxMaxima heavily. I have written a procedure which creates an > animation. Now I wanted to save the animation as an animated gif file. When > trying this I get the message that I should have ImageMagick installed and > that I should ensure that wxMaxima can find the tool. No information is > around how to configure wxMaxima. ImageMagic is found on the command line. I > have installed the 64bit version of ImageMagick. Any ideas how to solve this > problem? Thanks! > > regards > > --------------------------------------- > Klemens Hello, You don't need ImageMagick. Gnuplot also writes animated gifs. Here are some examples: http://riotorto.users.sourceforge.net/gnuplot/animation -- Mario -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomdean at speakeasy.org Fri Apr 15 03:05:32 2011 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Fri, 15 Apr 2011 01:05:32 -0700 Subject: [Maxima] Carmichael's Lambda Function Message-ID: <1302854732.8989.41.camel@asus> Is Carmichael's Lambda Function implemented? Sloane's A002322 Reduced totient function psi(n): least k such that x^k == 1 (mod n) for all x prime to n; also Carmichael lambda function (exponent of unit group mod n). http://mathworld.wolfram.com/CarmichaelFunction.html tomdean From andrej.vodopivec at gmail.com Fri Apr 15 04:27:58 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Fri, 15 Apr 2011 11:27:58 +0200 Subject: [Maxima] wxMaxima and ImageMagcik In-Reply-To: <002c01cbfb30$7898e880$69cab980$@gmx.de> References: <002c01cbfb30$7898e880$69cab980$@gmx.de> Message-ID: I guess you are using Windows? Exporting animations does not work on windows yet. I have a patch which fixes this issue and I can send you a patched binary if you wish. Andrej 2011/4/15 Dr. Klemens Waldh?r : > Hi, > > I am using wxMaxima heavily. I have written a procedure which creates an > animation. Now I wanted to save the animation as an animated gif file. When > trying this I get the message that I should have ImageMagick installed and > that I should ensure that wxMaxima can find the tool. ?No information is > around how to configure wxMaxima. ImageMagic is found on the command line. I > have installed the 64bit version of ImageMagick. Any ideas how to solve this > problem? Thanks! > > regards > > --------------------------------------- > Klemens > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From g7rgtxn at gmx.de Fri Apr 15 04:51:05 2011 From: g7rgtxn at gmx.de (=?iso-8859-1?Q?Dr._Klemens_Waldh=F6r?=) Date: Fri, 15 Apr 2011 11:51:05 +0200 Subject: [Maxima] wxMaxima and ImageMagcik In-Reply-To: References: <002c01cbfb30$7898e880$69cab980$@gmx.de> Message-ID: <007301cbfb52$a3705850$ea5108f0$@gmx.de> Yes I am using Windows. Thanks, sending this patch that would be great! Klemens --------------------------------------- Prof. Dr. Klemens Waldh?r -----Urspr?ngliche Nachricht----- Von: Andrej Vodopivec [mailto:andrej.vodopivec at gmail.com] Gesendet: Freitag, 15. April 2011 11:28 An: g7rgtxn at gmx.de Cc: Maxima - list Betreff: Re: [Maxima] wxMaxima and ImageMagcik I guess you are using Windows? Exporting animations does not work on windows yet. I have a patch which fixes this issue and I can send you a patched binary if you wish. Andrej 2011/4/15 Dr. Klemens Waldh?r : > Hi, > > I am using wxMaxima heavily. I have written a procedure which creates > an animation. Now I wanted to save the animation as an animated gif > file. When trying this I get the message that I should have > ImageMagick installed and that I should ensure that wxMaxima can find > the tool. ?No information is around how to configure wxMaxima. > ImageMagic is found on the command line. I have installed the 64bit > version of ImageMagick. Any ideas how to solve this problem? Thanks! > > regards > > --------------------------------------- > Klemens > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From villate at fe.up.pt Fri Apr 15 05:29:56 2011 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 15 Apr 2011 11:29:56 +0100 Subject: [Maxima] what is the difference between :, =, and := In-Reply-To: <971396.96372.qm@web161807.mail.bf1.yahoo.com> References: <971396.96372.qm@web161807.mail.bf1.yahoo.com> Message-ID: <1302863396.2316.6.camel@wigner> On Tue, 2011-04-12 at 14:07 -0700, Ether Jones wrote: > Can someone recommend a lucid document that explains what the > difference is between ":", "=", and ":=" in Maxima, and under what > circumstances each one should be used? http://maxima.sourceforge.net/docs/manual/en/maxima_5.html#SEC19 seems lucid enough to me. If you think it lacks something, please tell us so we can improve it. Regards, Jaime From wilhelm.haager at htlstp.ac.at Fri Apr 15 05:35:23 2011 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Fri, 15 Apr 2011 12:35:23 +0200 Subject: [Maxima] questions to tags /R/ and /T/ Message-ID: <94eec6c6c40998f154ffbc701cdba934@localhost> Hi, Maxima sometimes appends some curious "tags" to the output expressions: e.g. rat(x/y) produces the tag /R/ which obviously means a "canonical rational expression" (whatever that is). taylor(sin(x),x,0,3) produces the tag /T/ which obviously means "taylor series". Those tags, which are assumedly not part of the expession itself, can be removed by apply(op(..),args(...)). Is there a general principle or a deeper mind for those tags? What is the actual effect of them (just appending + ... do the expression (for /T/), or even more)? Where are those tags stored (if not as part of the expression)? Are there more such tags than /R/ and /T/? Thanks in advance for answers Wilhelm Haager From andrej.vodopivec at gmail.com Fri Apr 15 05:46:19 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Fri, 15 Apr 2011 12:46:19 +0200 Subject: [Maxima] wxMaxima and ImageMagcik In-Reply-To: <007301cbfb52$a3705850$ea5108f0$@gmx.de> References: <002c01cbfb30$7898e880$69cab980$@gmx.de> <007301cbfb52$a3705850$ea5108f0$@gmx.de> Message-ID: I have uploaded a zip file to http://dl.dropbox.com/u/3305126/wxMaxima.zip . You can replace wxMaxima directory in your Maxima copy with the one from the archive. Andrej 2011/4/15 Dr. Klemens Waldh?r : > Yes I am using Windows. > > Thanks, sending this patch ?that would be great! > > Klemens > > --------------------------------------- > Prof. Dr. Klemens Waldh?r > > > -----Urspr?ngliche Nachricht----- > Von: Andrej Vodopivec [mailto:andrej.vodopivec at gmail.com] > Gesendet: Freitag, 15. April 2011 11:28 > An: g7rgtxn at gmx.de > Cc: Maxima - list > Betreff: Re: [Maxima] wxMaxima and ImageMagcik > > I guess you are using Windows? Exporting animations does not work on windows > yet. I have a patch which fixes this issue and I can send you a patched > binary if you wish. > > > Andrej > > > > 2011/4/15 Dr. Klemens Waldh?r : >> Hi, >> >> I am using wxMaxima heavily. I have written a procedure which creates >> an animation. Now I wanted to save the animation as an animated gif >> file. When trying this I get the message that I should have >> ImageMagick installed and that I should ensure that wxMaxima can find >> the tool. ?No information is around how to configure wxMaxima. >> ImageMagic is found on the command line. I have installed the 64bit >> version of ImageMagick. Any ideas how to solve this problem? Thanks! >> >> regards >> >> --------------------------------------- >> Klemens >> >> >> >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> From macrakis at alum.mit.edu Fri Apr 15 06:05:50 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 15 Apr 2011 07:05:50 -0400 Subject: [Maxima] questions to tags /R/ and /T/ In-Reply-To: <94eec6c6c40998f154ffbc701cdba934@localhost> References: <94eec6c6c40998f154ffbc701cdba934@localhost> Message-ID: These tags indicate that Maxima is using a special-purpose internal representation. A third one is /P/ for Poisson series. From the user's point of view, they indicate that the expressions behave differently from general representation. Most are contagious, so for example 1/x + x in general representation simplifies to x+1/x, but rat(x)+1/x simplifies to (x^2+1)/x. Why do you ask? -s On 2011-04-15, Wilhelm Haager wrote: > Hi, > > Maxima sometimes appends some curious "tags" to the output > expressions: > > e.g. rat(x/y) produces the tag /R/ which obviously means a > "canonical rational expression" (whatever that is). > > taylor(sin(x),x,0,3) produces the tag /T/ which obviously means > "taylor series". > > Those tags, which are assumedly not part of the expession itself, > can be removed by apply(op(..),args(...)). > > Is there a general principle or a deeper mind for those tags? > > What is the actual effect of them > (just appending + ... do the expression (for /T/), or even more)? > > Where are those tags stored (if not as part of the expression)? > > Are there more such tags than /R/ and /T/? > > Thanks in advance for answers > Wilhelm Haager > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Sent from my mobile device From macrakis at alum.mit.edu Fri Apr 15 08:37:18 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 15 Apr 2011 09:37:18 -0400 Subject: [Maxima] questions to tags /R/ and /T/ In-Reply-To: <94eec6c6c40998f154ffbc701cdba934@localhost> References: <94eec6c6c40998f154ffbc701cdba934@localhost> Message-ID: Definition of canonical rational expression: http://maxima.sourceforge.net/docs/manual/en/backup/maxima_12.html On Fri, Apr 15, 2011 at 06:35, Wilhelm Haager wrote: > Hi, > > Maxima sometimes appends some curious "tags" to the output expressions: > > e.g. rat(x/y) produces the tag /R/ which obviously means a > "canonical rational expression" (whatever that is). > > taylor(sin(x),x,0,3) produces the tag /T/ which obviously means > "taylor series". > > Those tags, which are assumedly not part of the expession itself, > can be removed by apply(op(..),args(...)). > > Is there a general principle or a deeper mind for those tags? > > What is the actual effect of them > (just appending + ... do the expression (for /T/), or even more)? > > Where are those tags stored (if not as part of the expression)? > > Are there more such tags than /R/ and /T/? > > Thanks in advance for answers > 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 talon at lpthe.jussieu.fr Fri Apr 15 09:17:11 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 15 Apr 2011 16:17:11 +0200 Subject: [Maxima] Levin, Hyperint References: Message-ID: Barton Willis wrote: > > (%i126) hyper_int(1/sqrt(x*(x+1)*(x-1)),x); > (%o126) > (2*hypergeometric([1/4,1/2],[5/4],x^2)*x*sqrt(1-x^2))/sqrt(x^3-x) > > This might also be correct, but I don't know which recursions to use to > show it. > Evidence that %o126 might be correct: > > (%i127) taylor(diff(%,x) - 1/sqrt(x*(x+1)*(x-1)),x,0,128); > (%o127)/T/ 0+... > It may be that this elliptic integral is particular because 0 is in the middle of -1, 1, which is invariant by the homographies that preserve infinity. And indeed: (%i2) hyper_int(1/sqrt(x*(x+2)*(x-1)),x); (%o2) false while (%i4) inverse_jacobi_int(1/sqrt(x*(x+1)*(x-1)),x); (%o4) %i sqrt(x - 1) -2 %i inverse_jacobi_sn(--------------, 2) sqrt(x - 1) sqrt(x) sqrt(x + 1) sqrt(2) ------------------------------------------------------------------------- 3 sqrt(x - x) -- Michel Talon From hbaker1 at pipeline.com Fri Apr 15 09:19:54 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Fri, 15 Apr 2011 07:19:54 -0700 Subject: [Maxima] Draw and VTK In-Reply-To: <3526679.182531302853078775.JavaMail.defaultUser@defaultHos t> References: <3526679.182531302853078775.JavaMail.defaultUser@defaultHost> Message-ID: Very cool! Thanks! At 12:37 AM 4/15/2011, BIOMATES at telefonica.net wrote: >Hello, > >The next Maxima release will be shipped with an experimental version of >the VTK interface. It has been tested with Ubuntu and Windows (both ccl >and gcl versions). > >Since it is experimental, no documentation has been written, and things >can be changed in future versions. > >Here are some examples of use: > >http://riotorto.users.sourceforge.net/vtk > >Good luck. > >-- >Mario From adammaj1 at o2.pl Fri Apr 15 11:12:43 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Fri, 15 Apr 2011 16:12:43 +0000 (UTC) Subject: [Maxima] Draw and VTK References: <3526679.182531302853078775.JavaMail.defaultUser@defaultHost> Message-ID: Dnia Fri, 15 Apr 2011 09:37:58 +0200, BIOMATES at telefonica.net napisa?(a): > Hello, > > The next Maxima release will be shipped with an experimental version of > the VTK interface. It has been tested with Ubuntu and Windows (both ccl > and gcl versions). > > Since it is experimental, no documentation has been written, and things > can be changed in future versions. > > Here are some examples of use: > > http://riotorto.users.sourceforge.net/vtk > > Good luck. Hello, Thx for new vtk interface. Do you think that gnuplot should be used for 2d drawings and vtk for 3d ones ? regards Adam From biomates at telefonica.net Fri Apr 15 15:13:52 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 15 Apr 2011 22:13:52 +0200 Subject: [Maxima] Draw and VTK In-Reply-To: References: <3526679.182531302853078775.JavaMail.defaultUser@defaultHost> Message-ID: <1302898432.3478.41.camel@pc> > Hello, > > Thx for new vtk interface. > Do you think that gnuplot should be used for 2d drawings and vtk for 3d > ones ? No, it's just another alternative. The problem with Gnuplot is that it's not a 3D modelling tool, and if you want to render special 3D graphics (polyhedra, molecules, etc.) it's very difficult to plot them with Gnuplot, and sometimes you have to write 'ad hoc' code, and the result is not very nice. Both programs have their own pros and cons. For example, I find Gnuplot's Postscript output much better than VTK's. Regarding 2D plotting, Gnuplot is better at this moment. But this can change in a near future. In short, Maxima-VTK interaction is now possible, and people is free to make use of it or not, depending on their needs and/or preferences. And I don't plan to stop maintaining the draw-Gnuplot interface. But I plan to stop walking in this direction: http://riotorto.users.sourceforge.net/gnuplot/3dmodel which is a torture. Best. -- Mario From andrej.vodopivec at gmail.com Sat Apr 16 01:08:18 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Sat, 16 Apr 2011 08:08:18 +0200 Subject: [Maxima] Fwd: REDUCE In-Reply-To: References: Message-ID: I don't know how to update the web-page so I'm forwarding this to the maxima list. ---------- Forwarded message ---------- From: Date: Fri, Apr 15, 2011 at 5:56 PM Subject: REDUCE To: andrejv at users.sourceforge.net Cc: achearn at users.sourceforge.net You might consider listing REDUCE on http://maxima.sourceforge.net/compalg.html, since it's now a free system. -- This message has been sent to you, a registered SourceForge.net user, by another site user, through the SourceForge.net site. ?This message has been delivered to your SourceForge.net mail alias. ?You may reply to this message using the "Reply" feature of your email client, or using the messaging facility of SourceForge.net at: https://sourceforge.net/sendmessage.php?touser=2332699 From dbmaxima at gmail.com Sat Apr 16 06:50:10 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Sat, 16 Apr 2011 21:50:10 +1000 Subject: [Maxima] Levin, Hyperint In-Reply-To: References: Message-ID: <4DA98272.5000601@gmail.com> On 15/04/2011 2:25 AM, Michel Talon wrote: > Hello, > > i have discovered 2 programs included in maxima, but whose function is not > very clear to me. > > One is levin, it has been mentioned recently here. Acccording to the > comments it is used to improve convergence of "numerical" sums, such as: > levin_u_sum(1/n2,n,1,10); > > However i have tried to add a parameter, such as: > g: rat(levin_u_sum(t^n/n2,n,1,10)); > which results in something looking like a Pad? approximant in the variable > t. I have checked for various values of t like 1/3, 1/5 that this formula > reproduces what one gets by directly substituting t=1/3 ... before computing > levin, so the formula seems correct. Is this an intended use of levin, > and does this produce an alternative way to get Pad? approximants - which > would be interesting because the pade command in maxima saturates very fast? I looked at Levin transforms many years ago for an undergrad project. In his original 1973 paper, Levin [1] briefly discusses rational approximations, and in a later paper [2], which I no longer have, uses the related d-transformation. It seems that the rational approximations generated by the u-transform are not (always?) Pade approximates.[3] There is quite a bit more literature. Referencea 1. D. Levin, Development of Non-Linear Transformations for Improving Convergence of Sequences, Intern. J. Computer Math. B3:371--388, 1973 2. A Sidi, D Levin, Rational Approximations from the d-Transformation IMA J Numer Anal (1982) 2 (2): 153-167. 3. Tarun Sheel, Rational approximants generated by pade approximation and u-transform, M Sc dissertation, University of Dhaka, 1992. http://perso.uclouvain.be/tarun.sheel/docs/Sheel_MS_Thesis.pdf -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sat Apr 16 07:27:28 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 16 Apr 2011 07:27:28 -0500 Subject: [Maxima] Levin, Hyperint In-Reply-To: <4DA98272.5000601@gmail.com> References: , <4DA98272.5000601@gmail.com> Message-ID: I haven't found a Gauss hypergeometric function recursion that shows that hyper_int returns a correct antiderivative. Here is a bug: (%i1) (load(hyperint), load(orthopoly), domain : complex)$ (%i2) hyper_int(1/sqrt(x*(x+1)*(x-1)),x); (%o2) (2*hypergeometric([1/4,1/2],[5/4],x^2)*x*sqrt(1-x^2))/sqrt(x^3-x) (%i3) subst(hypergeometric = hgfred,%); (%o3) (2*hgfred([1/4,1/2],[5/4],x^2)*x*sqrt(1-x^2))/sqrt(x^3-x) (%i4) ev(%); (%o4) (assoc_legendre_p(-1/4,-1/4,sqrt(1-x^2))*gamma(1/4)*x*sqrt(1-x^2))/(2^(3/4)*(x^2)^(1/8)*sqrt(x^3-x)) Wrong--should be 1/sqrt(x*(x+1)*(x-1)) (%i5) ratsimp(diff(%,x)); (%o5) 0 Could be an orthopoly bug, a hgfred bug, a hyper_int bug, a simplification bug, or.. Oh my. --Barton From robert.dodier at gmail.com Sat Apr 16 13:26:05 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 16 Apr 2011 12:26:05 -0600 Subject: [Maxima] Fwd: CVS/Git conversions for Maxima In-Reply-To: References: Message-ID: Leo, thanks a lot for your work. At this point I believe we should go ahead and import the Git repo into Sourceforge, despite the one messed-up historical branch, and freeze CVS. Is anyone opposed to that plan? Maybe someone can copy your Git/CVS notes to the Maxima web pages or wiki or something. Thanks again & all the best. Robert Dodier ---------- Forwarded message ---------- From: Leo Butler Date: Sat, 16 Apr 2011 12:24:15 +0100 (BST) Subject: Re: CVS/Git conversions for Maxima To: Robert Dodier On Fri, 8 Apr 2011, Robert Dodier wrote: < OK, I've enabled the admin bit for you. < Have at it! Robert, I have written up a guide (see https://github.com/leo-butler/git-cheat-sheet) and I have tweaked the script that checks the tags and branches of the converted Git repo against that of the CVS repo. At this point, aside from the branch V5, the only differences appear in the headers of two files (maxima-font-lock.el and a .ps file). In these two files the RCS Id tag differs, and that's it. For V5, there is a huge diff file. The diffs appear to be in files that are auto-generated by for some reason under VC. I think that V5 is of historic interest, but no more. My proposal is to proceed with the creation of the Git repo from this conversion. I will commit, in a separate directory, the diff files produced during the conversion. If you want to forward this to the maxima list, go ahead. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From drdieterkaiser at web.de Sat Apr 16 14:04:55 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 16 Apr 2011 21:04:55 +0200 Subject: [Maxima] Fwd: CVS/Git conversions for Maxima In-Reply-To: References: Message-ID: <1302980695.1968.8.camel@dieter> Am Samstag, den 16.04.2011, 12:26 -0600 schrieb Robert Dodier: > Leo, thanks a lot for your work. > > At this point I believe we should go ahead and import the > Git repo into Sourceforge, despite the one messed-up > historical branch, and freeze CVS. > > Is anyone opposed to that plan? > > Maybe someone can copy your Git/CVS notes to > the Maxima web pages or wiki or something. > > Thanks again & all the best. > > Robert Dodier I would welcome very much the new Git repo. I have no longer committed any code, because of the missing messages and it is very difficult to follow the last changes. When we have a new repo, I would like to work again on bugs. Leo, thank you very much for the work. Dieter Kaiser From woollett at charter.net Sat Apr 16 15:02:06 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 16 Apr 2011 13:02:06 -0700 Subject: [Maxima] Maxima by Example, Ch. 12, Dirac Package Version 2 Message-ID: <4FB9D3412F8C4F8ABB07E198D32A24C0@edwinc367e16bd> Ch. 12 Dirac Package Version 2. http://www.csulb.edu/~woollett/ ============================================ Maxima by Example, Chapter 12: Dirac Algebra and Quantum Electrodynamics, Version 2 A Version 2 Maxima Dirac algebra package is demonstrated using examples from Quantum Electrodynamics. The file dirac2.mac loads the rest of the Dirac package files: simplifying-new.lisp, dgcon2.mac, dgtrace2.mac, dgeval2.mac, and dgmatrix2.mac. The file dgfunctions2.txt has an alphabetical list of the package functions. Eleven batch files carry out typical calculations. Separate sections of Ch. 12 are devoted to a review of high energy physics notation (which agrees with Peskin and Schroeder), trace and contraction theorems, to a review of covariant polarization 4-vectors for physical (external) photons, and to the use of simplifying-new.lisp. A 22 page introduction to typical uses, with examples given in an interactive session context, has been created to allow easier and quicker access to the syntax and abilities of the package. The Dirac package code has been rewritten and the code greatly simplified. The more complicated examples now run about 35% faster. A suite of test files has been added, and is available as either a zip file or a tar.gz file. The author is indebted to Maxima developer Barton Willis for his suggestion to use the recursive simplification lisp code simplifying.lisp, and for his advice in exploiting the power of that code. The following Windows zip file contains all Chapter 12 files (except the test suite), including the pdf. --mbe12dirac2.zip : 4-15-11, Maxima 5.23.2, 488 KB The following tar.gz file contains all Ch. 12 files (except the test suite), including the pdf file. --mbe12dirac2.tar.gz : 4-15-11, Maxima 5.23.2, 476 KB =========================== Three independent methods of calculation are provided by the Dirac package. 1. The symbolic methods are available for the calculation of either unpolarized differential cross sections or polarized differential cross sections.The symbolic methods allow unpolarized differential cross sections to be first expressed in an arbitrary frame in terms of the Mandelstam variables s, t, and u. 2. An alternative path (but frame dependent) to either unpolarized or polarized differential cross sections is the use of explicit Dirac matrices (we use the same conventions as Peskin and Schroeder) and explicit matrix trace and contractions on Lorentz indices. 3. The third path is the use of explcit Dirac spinors and matrices to first calculate all possible polarized amplitudes (ie.,for various helicity choices) and then the sum of the squares reproduces the unpolarized results. ===================================== See the Maxima by Example webpage for individual files and the test suite. Ted Woollett From robert.dodier at gmail.com Sat Apr 16 22:30:11 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 16 Apr 2011 21:30:11 -0600 Subject: [Maxima] any problems w/ 5.24.0 ? Message-ID: Hi, does anyone know about any problems with Maxima 5.24.0 ? If there are none, I'll go ahead and make a general announcement about the release. best, Robert Dodier From razif66 at gmail.com Sun Apr 17 02:29:34 2011 From: razif66 at gmail.com (razif razali) Date: Sun, 17 Apr 2011 15:29:34 +0800 Subject: [Maxima] failed to plot this expression Message-ID: Dear all maxima user, it try to plot this equation, but i failed to...i dunno why i failed to plot this expression, hope someone can look into it here what i done, *(%i1)* ((%e^(- sqrt(sqrt(73) - 10)*(3*%pi/8)*1 - sqrt(- sqrt(73) - 10)*(3*%pi/8)*1)*(sqrt(sqrt(73) - 10)*((- 5*2^(3/2)*sqrt(3)*sqrt(73) - 73*sqrt(2)*sqrt(3))*(%e^(-x/2)*(sqrt(x))^3/sqrt(3!))*%e^(2*sqrt(sqrt(73) - 10)*(3*%pi/8)*1 + sqrt(- sqrt(73) - 10)*(3*%pi/8)*1)+ (5*2^(3/2)*sqrt(3)*sqrt(73) + 73*sqrt(2)*sqrt(3))*(%e^(-x/2)*(sqrt(x))^3/sqrt(3!))*%e^(sqrt(- sqrt(73) - 10)*(3*%pi/8)*1))+sqrt(- sqrt(73) - 10)*((5*2^(3/2)*sqrt(3)*sqrt(73) - 73*sqrt(2)*sqrt(3))*(%e^(-x/2)*(sqrt(x))^3/sqrt(3!))*%e^(2*sqrt(- sqrt(73) - 10)*(3*%pi/8)*1)+ (73*sqrt(2)*sqrt(3)- 5*2^(3/2)*sqrt(3)*sqrt(73))*(%e^(-x/2)*(sqrt(x))^3/sqrt(3!)))*%e^(sqrt(sqrt(73) - 10)*(3*%pi/8)*1)))/1314)^2 *(%i2)* plot2d(%o1,[x,0,10]); and maxima give me this error : plot2d: expression evaluates to non-numeric value somewhere in plotting range. *(%o2)* *(%i3)* Warning: empty y range [0:0], adjusting to [-1:1] can someone explain this to me? -- 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 l.butler at ed.ac.uk Sun Apr 17 04:00:55 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sun, 17 Apr 2011 10:00:55 +0100 (BST) Subject: [Maxima] failed to plot this expression In-Reply-To: References: Message-ID: On Sun, 17 Apr 2011, razif razali wrote: < Dear all maxima user, < it try to plot this equation, but i failed to...i dunno why i failed to plot this expression, hope someone can look into it < < here what i done, < < (%i1)?((%e^(- sqrt(sqrt(73) - 10)*(3*%pi/8)*1 - sqrt(- sqrt(73) - 10)*(3*%pi/8)*1)*(sqrt(sqrt(73) - 10)*((- 5*2^(3/2)*sqrt(3)*sqrt(73) - 73*sqrt(2)*sqrt(3))*(%e^(-x/2)*(sqrt(x))^3/sqrt(3!))*%e^(2*sqrt(sqrt(73) - < 10)*(3*%pi/8)*1 + sqrt(- sqrt(73) - 10)*(3*%pi/8)*1)+ (5*2^(3/2)*sqrt(3)*sqrt(73) + 73*sqrt(2)*sqrt(3))*(%e^(-x/2)*(sqrt(x))^3/sqrt(3!))*%e^(sqrt(- sqrt(73) - 10)*(3*%pi/8)*1))+sqrt(- sqrt(73) - < 10)*((5*2^(3/2)*sqrt(3)*sqrt(73) - 73*sqrt(2)*sqrt(3))*(%e^(-x/2)*(sqrt(x))^3/sqrt(3!))*%e^(2*sqrt(- sqrt(73) - 10)*(3*%pi/8)*1)+ (73*sqrt(2)*sqrt(3)- < 5*2^(3/2)*sqrt(3)*sqrt(73))*(%e^(-x/2)*(sqrt(x))^3/sqrt(3!)))*%e^(sqrt(sqrt(73) - 10)*(3*%pi/8)*1)))/1314)^2 < < (%i2) plot2d(%o1,[x,0,10]); < < and maxima give me this error :? < < plot2d: expression evaluates to non-numeric value somewhere in plotting range. < (%o2)? < (%i3) Warning: empty y range [0:0], adjusting to [-1:1] < < can someone explain this to me? The error message is somewhat cryptic and inaccurate. The problem is that, when you plug-in a floating-point value for x, Maxima computes a float value with a small imaginary part. Try: plot2d(%o1,[x,0,10],[plot_realpart,true]); Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From O.Kullmann at swansea.ac.uk Sun Apr 17 06:32:56 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 17 Apr 2011 12:32:56 +0100 Subject: [Maxima] any problems w/ 5.24.0 ? In-Reply-To: References: Message-ID: <20110417113256.GA3883@cs-wsok.swansea.ac.uk> Hi, no problems for us (with Ecl 11.1.1.1). Oliver On Sat, Apr 16, 2011 at 09:30:11PM -0600, Robert Dodier wrote: > Hi, > > does anyone know about any problems with Maxima 5.24.0 ? > > If there are none, I'll go ahead and make a general announcement > about the release. > > best, > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From drdieterkaiser at web.de Sun Apr 17 07:49:18 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 17 Apr 2011 14:49:18 +0200 Subject: [Maxima] any problems w/ 5.24.0 ? In-Reply-To: <20110417113256.GA3883@cs-wsok.swansea.ac.uk> References: <20110417113256.GA3883@cs-wsok.swansea.ac.uk> Message-ID: <1303044558.1625.2.camel@dieter> Am Sonntag, den 17.04.2011, 12:32 +0100 schrieb Oliver Kullmann: > Hi, > > no problems for us (with Ecl 11.1.1.1). > > Oliver > > On Sat, Apr 16, 2011 at 09:30:11PM -0600, Robert Dodier wrote: > > Hi, > > > > does anyone know about any problems with Maxima 5.24.0 ? > > > > If there are none, I'll go ahead and make a general announcement > > about the release. > > > > best, > > > > Robert Dodier I have no problems with SBCL 1.0.45 on Ubuntu. Dieter Kaiser From vttoth at vttoth.com Sun Apr 17 08:31:02 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Sun, 17 Apr 2011 09:31:02 -0400 Subject: [Maxima] any problems w/ 5.24.0 ? In-Reply-To: References: Message-ID: <014201cbfd03$b70ef0d0$252cd270$@vttoth.com> I see no issues with the tensor code (tests and demos as well as some of my own calculations) using gcl, cmucl, sbcl and clisp. Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Robert Dodier Sent: Saturday, April 16, 2011 11:30 PM To: Maxima Mailing List Subject: [Maxima] any problems w/ 5.24.0 ? Hi, does anyone know about any problems with Maxima 5.24.0 ? If there are none, I'll go ahead and make a general announcement about the release. best, Robert Dodier _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From vttoth at vttoth.com Sun Apr 17 08:32:54 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Sun, 17 Apr 2011 09:32:54 -0400 Subject: [Maxima] Fwd: CVS/Git conversions for Maxima In-Reply-To: <1302980695.1968.8.camel@dieter> References: <1302980695.1968.8.camel@dieter> Message-ID: <014301cbfd03$f9c1ada0$ed4508e0$@vttoth.com> I know that we're planning a switch to Git, but for what it's worth, I was able to fix the CVS commit scripts and we should all be getting commit notifications again. Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Dieter Kaiser Sent: Saturday, April 16, 2011 3:05 PM To: Robert Dodier Cc: Maxima Mailing List Subject: Re: [Maxima] Fwd: CVS/Git conversions for Maxima Am Samstag, den 16.04.2011, 12:26 -0600 schrieb Robert Dodier: > Leo, thanks a lot for your work. > > At this point I believe we should go ahead and import the > Git repo into Sourceforge, despite the one messed-up > historical branch, and freeze CVS. > > Is anyone opposed to that plan? > > Maybe someone can copy your Git/CVS notes to > the Maxima web pages or wiki or something. > > Thanks again & all the best. > > Robert Dodier I would welcome very much the new Git repo. I have no longer committed any code, because of the missing messages and it is very difficult to follow the last changes. When we have a new repo, I would like to work again on bugs. Leo, thank you very much for the work. Dieter Kaiser _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From drdieterkaiser at web.de Sun Apr 17 08:41:04 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 17 Apr 2011 15:41:04 +0200 Subject: [Maxima] Fwd: CVS/Git conversions for Maxima In-Reply-To: <014301cbfd03$f9c1ada0$ed4508e0$@vttoth.com> References: <1302980695.1968.8.camel@dieter> <014301cbfd03$f9c1ada0$ed4508e0$@vttoth.com> Message-ID: <1303047664.1625.3.camel@dieter> Am Sonntag, den 17.04.2011, 09:32 -0400 schrieb Viktor T. Toth: > I know that we're planning a switch to Git, but for what it's worth, I was > able to fix the CVS commit scripts and we should all be getting commit > notifications again. Hello Viktor, it works again. I have got a message from your last commit. Dieter Kaiser From dbmaxima at gmail.com Sun Apr 17 08:46:12 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Sun, 17 Apr 2011 23:46:12 +1000 Subject: [Maxima] Fwd: CVS/Git conversions for Maxima In-Reply-To: <014301cbfd03$f9c1ada0$ed4508e0$@vttoth.com> References: <1302980695.1968.8.camel@dieter> <014301cbfd03$f9c1ada0$ed4508e0$@vttoth.com> Message-ID: <4DAAEF24.5030103@gmail.com> On 17/04/2011 11:32 PM, Viktor T. Toth wrote: > I know that we're planning a switch to Git, but for what it's worth, I was > able to fix the CVS commit scripts and we should all be getting commit > notifications again. > > > Viktor Works for me. Thanks. David From talon at lpthe.jussieu.fr Sun Apr 17 11:26:27 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sun, 17 Apr 2011 18:26:27 +0200 Subject: [Maxima] Levin, Hyperint References: <4DA98272.5000601@gmail.com> Message-ID: David Billinghurst wrote: > I looked at Levin transforms many years ago for an undergrad project. > .... > > There is quite a bit more literature. > > Referencea .... Thanks a lot for all these informations. -- Michel Talon From l.butler at ed.ac.uk Sun Apr 17 13:06:52 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sun, 17 Apr 2011 19:06:52 +0100 (BST) Subject: [Maxima] Fwd: CVS/Git conversions for Maxima In-Reply-To: References: Message-ID: On Sat, 16 Apr 2011, Robert Dodier wrote: < Leo, thanks a lot for your work. < < At this point I believe we should go ahead and import the < Git repo into Sourceforge, despite the one messed-up < historical branch, and freeze CVS. < < Is anyone opposed to that plan? < < Maybe someone can copy your Git/CVS notes to < the Maxima web pages or wiki or something. < < Thanks again & all the best. < < Robert Dodier Barring any last minute objections: I'd like to freeze the CVS repo from 0600 BST (0500 GMT) on Tuesday 19 April. I should have the Git repo in place by 1200 BST. I will email this list when it is up. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From woollett at charter.net Sun Apr 17 14:44:51 2011 From: woollett at charter.net (Edwin Woollett) Date: Sun, 17 Apr 2011 12:44:51 -0700 Subject: [Maxima] any problems w/ 5.24.0 ? Message-ID: <8200CB5B8E324397B8B884ADF37E314D@edwinc367e16bd> On April 16, 2011, Robert Dodier wrote: >does anyone know about any problems with Maxima 5.24.0 ? The new 5.24.0 passes 906 Dirac package tests and fails none. I like the new font + icon in Xmaxima, a nice improvement to an already nice interface. Ted Woollett From alexanderk.hansen at gmail.com Sun Apr 17 15:44:44 2011 From: alexanderk.hansen at gmail.com (Alexander Hansen) Date: Sun, 17 Apr 2011 16:44:44 -0400 Subject: [Maxima] Fwd: CVS/Git conversions for Maxima In-Reply-To: <014301cbfd03$f9c1ada0$ed4508e0$@vttoth.com> References: <1302980695.1968.8.camel@dieter> <014301cbfd03$f9c1ada0$ed4508e0$@vttoth.com> Message-ID: <4DAB513C.6040006@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 4/17/11 9:32 AM, Viktor T. Toth wrote: > I know that we're planning a switch to Git, but for what it's worth, I was > able to fix the CVS commit scripts and we should all be getting commit > notifications again. > > > Viktor > > Can you let me know (offlist) what you did? I maintain maxima for the Fink project on OS X, and we're still on CVS. Thanks. - -- 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/ iEYEARECAAYFAk2rUTwACgkQB8UpO3rKjQ/vFACbBmra8lp1qN2A0LJktzH0VKfb K38An3AmRNB3vnAUvozZ66e9vFg3r0BW =DCFS -----END PGP SIGNATURE----- From robert.dodier at gmail.com Sun Apr 17 20:44:58 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 17 Apr 2011 19:44:58 -0600 Subject: [Maxima] announcement: Maxima 5.24 release Message-ID: Please distribute this message as you see fit. Announcing Maxima 5.24 Maxima is a GPL'd branch of Macsyma, the venerable symbolic computation system. Maxima 5.24 is a bug fix and feature enhancement release. The current version is 5.24.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 default Windows installer (maxima-5.24.0.exe) was compiled with GCL, while maxima-5.24.0-ccl.exe was compiled with Clozure CL. 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, .... 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.24 release. Regards, Robert Dodier Maxima developer and 5.24 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/project/showfiles.php?group_id=4933 Ports page: http://apps.sourceforge.net/mediawiki/maxima/index.php?title=Maxima_ports Project home page: http://maxima.sourceforge.net Change log: http://maxima.cvs.sourceforge.net/*checkout*/maxima/maxima/ChangeLog-5.24 From razif66 at gmail.com Mon Apr 18 01:19:56 2011 From: razif66 at gmail.com (razif razali) Date: Mon, 18 Apr 2011 14:19:56 +0800 Subject: [Maxima] how to change variable with new variable in some functions Message-ID: Dear all maxima users, I paste this code in maxima --------------------------------------------------------- f[n,k] := concat('f_,n,"_",k)(s)$ df[n,k] := if n=0 then 0 else 'diff(f[2*n,k],s)=%psi*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1])$ atvalue(f_4_2(s),s=0,0)$ atvalue(f_4_3(s),s=0,0)$ makelist( df[2,k],k,1,3); desolve(%, makelist(f[4,k],k,1,3) ); nonzero; --------------------------------------------------------- and i get some function which is f_4_1(s) , f_4_2(s) and f_4_3(s)... so when I get this function, how can I change the value s=1 and f_4_1(0) = %e^(-x/2)*x/2 so that i can plot those 3 functions in 3D with the variable %psi(different angle) and x ? -- 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 razif66 at gmail.com Mon Apr 18 03:20:25 2011 From: razif66 at gmail.com (razif razali) Date: Mon, 18 Apr 2011 16:20:25 +0800 Subject: [Maxima] Enhanced Laplace transforms and desolve for Maxima In-Reply-To: <06C749E85D85463BA3D4C6592C580AD9@RichsLaptop> References: <87bp3cvzi4.fsf@yeeloong.netris.org> <878vya6u83.fsf@yeeloong.netris.org> <4D3E10FB.2060907@gmail.com> <8739oh6i5w.fsf@yeeloong.netris.org> <06C749E85D85463BA3D4C6592C580AD9@RichsLaptop> Message-ID: Dear Mark H Weaver, * * I have try your patch but it failed in 64bit architecture but I successfully patch it and run it in 32bit ubuntu10.10. by using your patch I simply paste my code in maxima, ---------------------------------- load(desoln); load(laplac); load(hstep); load(pwilt); load(abs_integrate); f[n,k] := concat('f_,n,"_",k)(s)$ df[n,k] := if n=0 then 0 else 'diff(f[2*n,k],s)=%psi*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1])$ atvalue(f_12_2(s),s=0,0)$ atvalue(f_12_3(s),s=0,0)$ atvalue(f_12_4(s),s=0,0)$ atvalue(f_12_5(s),s=0,0)$ atvalue(f_12_6(s),s=0,0)$ atvalue(f_12_7(s),s=0,0)$ makelist( df[6,k],k,1,7); desolve(%, makelist(f[12,k],k,1,7) ); ----------------------------------------------------------------------------------------------------- and your patch help me get the function for f_12_1(s) till f_12_7(s) ---------( f_n_k(s) )----------|| this patch also true until f_16_9 only. when i try to run for f_18_10 i got ' ilt ' result again..below is the code that give ' ilt ' result ---------------------- load(desoln); load(laplac); load(hstep); load(pwilt); load(abs_integrate); f[n,k] := concat('f_,n,"_",k)(s)$ df[n,k] := if n=0 then 0 else 'diff(f[2*n,k],s)=%psi*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1])$ atvalue(f_18_2(s),s=0,0)$ atvalue(f_18_3(s),s=0,0)$ atvalue(f_18_4(s),s=0,0)$ atvalue(f_18_5(s),s=0,0)$ atvalue(f_18_6(s),s=0,0)$ atvalue(f_18_7(s),s=0,0)$ atvalue(f_18_8(s),s=0,0)$ atvalue(f_18_9(s),s=0,0)$ atvalue(f_18_10(s),s=0,0)$ makelist( df[9,k],k,1,10); desolve(%, makelist(f[18,k],k,1,10) ); -------------------------------------------------------------------- so what should I do if i want to solve this problem until hundreds ' k ' ? On Wed, Jan 26, 2011 at 3:41 AM, Richard Hennessy wrote: > Hi Mark, > > I was working on an inverse Fourier transform function for piecewise > functions for pw.mac (pwift()). I did not know of your work so I will > suspend my work on that. I really don't have the time to work on this stuff > anymore. I think your work is really great BTW. > > It has been a long time since I have had any math courses. Is there a way > to do inverse Fourier transforms using ilt()? I can't remember. > > Good luck, > > Rich > > > > -----Original Message----- From: Mark H Weaver > Sent: Tuesday, January 25, 2011 11:51 AM > To: Hugo Coolens > Cc: maxima at math.utexas.edu > Subject: Re: [Maxima] Enhanced Laplace transforms and desolve for Maxima > > > Hugo Coolens writes: > >> Will the new code also deal with this: >> ilt(exp(-a*s)/s,s,t); >> > > I didn't modify ilt to do this, but my new pwilt does it: > > (%i2) load(pwilt)$ > (%i3) pwilt(exp(-a*s)/s,s,t); > (%o3) hstep(t-a) > (%i4) pwilt(%e^-s*(s*%e^s-s^2-2*s-2)/s^3, s,t), ratsimp; > (%o4) t-t^2*hstep(t-1) > > It is also designed to handle periodic functions > (though currently it fails to detect this in some cases): > > (%i5) assume(a>0); > (%o5) [a > 0] > (%i6) pwilt(1/(s*(1-%e^-(2*a*s)))-%e^-(a*s)/(s*(1-%e^-(2*a*s))), s,t); > (%o6) 'sum(hstep(t-2*%k*a)-hstep(t-2*%k*a-a),%k,0,inf) > > pwilt stands for "piecewise inverse laplace transform". I attached the > code at the beginning of this thread. In the other direction, my > changes to laplac.lisp support taking laplace transforms of piecewise > functions defined in terms of hstep or unit_step. > > Note that this is still a work in progress. > > Best, > Mark > > > This would be great for (electronic) engineering students who want to >> make the shift to Maxima >> >> >> best regards, >> hugo >> > _______________________________________________ > 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 > -- 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 razif66 at gmail.com Mon Apr 18 04:17:04 2011 From: razif66 at gmail.com (razif razali) Date: Mon, 18 Apr 2011 17:17:04 +0800 Subject: [Maxima] latex to maxima code Message-ID: Dear all maxima users, is there any way to convert latex code that produce from Maxima to be converted back to Maxima code? from what I know to convert Maxima result to latex code is just by giving ' tex(%) ' command, but how to reconvert back to maxima code? -- 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 l.butler at ed.ac.uk Mon Apr 18 08:18:46 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 18 Apr 2011 14:18:46 +0100 (BST) Subject: [Maxima] latex to maxima code In-Reply-To: References: Message-ID: On Mon, 18 Apr 2011, razif razali wrote: < Dear all maxima users, < is there any way to convert latex code that produce from Maxima to be converted back to Maxima code? < from what I know to convert Maxima result to latex code is just by giving ' tex(%) ' command, but how to reconvert back to maxima code? If you are looking to put Maxima code inside a LaTeX document, there is an Emacs package in the Maxima distribution called emaxima. You can find documentation for it under doc/emaxima in the Maxima sources. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From l.butler at ed.ac.uk Mon Apr 18 09:35:19 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 18 Apr 2011 15:35:19 +0100 (BST) Subject: [Maxima] latex to maxima code (fwd) Message-ID: < < < ---------- Forwarded message ---------- < Date: Mon, 18 Apr 2011 13:36:57 +0000 < From: razif66 at gmail.com < To: Leo Butler < Subject: Re: [Maxima] latex to maxima code < < no,I have others software that can read latex file generated from maxima...what I try to get is,how can I convert latex file to maxima code back?so that I can reuse the mathematical expression for other work? < < Is there any way for me to save the output from maxima and loaded it back for others work? < ------Original Message------ < From: Leo Butler < To: razif razali < Cc: maxima at math.utexas.edu < Subject: Re: [Maxima] latex to maxima code < Sent: Apr 18, 2011 21:18 < < < < On Mon, 18 Apr 2011, razif razali wrote: < < < Dear all maxima users, < < is there any way to convert latex code that produce from Maxima to be converted back to Maxima code? < < from what I know to convert Maxima result to latex code is just by giving ' tex(%) ' command, but how to reconvert back to maxima code? < < If you are looking to put Maxima code inside a LaTeX document, < there is an Emacs package in the Maxima distribution called < emaxima. You can find documentation for it under doc/emaxima < in the Maxima sources. < < Leo < Please send your replies to the Maxima list if you have asked the question on that list. --- I don't know if there is a function/code, call it untex, such that untex(tex(%)) = %. Isn't it rather silly to ask for such a thing, since % obviously holds the Maxima code you want. However, if you look at the documentation for EMaxima you may find that it does something almost as good: you can embed Maxima code in LaTeX, run that code, and have it inserted into the document as LaTeX code. I believe that wxmaxima has some similar capabilities, but a wxmaxima user is better placed to comment. --- Having said all this, is it possible that you just want some means to save your Maxima code? If so, maybe you want to look at save or stringout Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From mxue at vroomlab.com Mon Apr 18 09:48:58 2011 From: mxue at vroomlab.com (Michael Xue) Date: Mon, 18 Apr 2011 14:48:58 +0000 (UTC) Subject: [Maxima] failed to plot this expression References: Message-ID: razif razali gmail.com> writes: > > > Dear all maxima user, > > it try to plot this equation, but i failed to...i dunno why i failed to plot this expression, hope someone can look into it > > here what i done, > > (%i1)?((%e^(- sqrt(sqrt(73) - 10)*(3*%pi/8)*1 - sqrt(- sqrt(73) - 10)*(3*%pi/8)*1)*(sqrt(sqrt(73) - 10)*((- 5*2^(3/2)*sqrt(3)*sqrt(73) - 73*sqrt(2)*sqrt(3))*(%e^(-x/2)*(sqrt(x))^3/sqrt(3!))*%e^(2*sqrt(sqrt(73) - 10)*(3*%pi/8)*1 + sqrt(- sqrt(73) - 10)*(3*%pi/8)*1)+ (5*2^(3/2)*sqrt(3)*sqrt(73) + 73*sqrt(2)*sqrt(3))*(%e^(-x/2)*(sqrt(x))^3/sqrt(3!))*%e^(sqrt(- sqrt(73) - 10)*(3*%pi/8)*1))+sqrt(- sqrt(73) - 10)*((5*2^(3/2)*sqrt(3)*sqrt(73) - 73*sqrt(2)*sqrt(3))*(%e^(-x/2)*(sqrt(x))^3/sqrt(3!))*%e^(2*sqrt(- sqrt(73) - 10)*(3*%pi/8)*1)+ (73*sqrt(2)*sqrt(3)- 5*2^(3/2)*sqrt(3)*sqrt(73))*(%e^(-x/2)*(sqrt(x))^3/sqrt(3!)))*%e^(sqrt(sqrt(73) - 10)*(3*%pi/8)*1)))/1314)^2 > > > (%i2) plot2d(%o1,[x,0,10]); > > and maxima give me this error :? > > plot2d: expression evaluates to non-numeric value somewhere in plotting range. > (%o2)? > (%i3) Warning: empty y range [0:0], adjusting to [-1:1] > > can someone explain this to me? > > -- Regards,RAZIF RAZALI,Tutor & Master Student,Physics Department,Faculty Of Science,Universiti Teknologi Malaysia(UTM).+60199393606 > > > > _______________________________________________ > Maxima mailing list > Maxima math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Razif, You have terms that are complex in the expression which plot2d can not handle. Yes, %e^(%pi*%i) = -1 but %e^(a*%pi*%i)) could still be complex. You may plot the real part and imaginary part separately. - Michael From razif66 at gmail.com Mon Apr 18 10:47:46 2011 From: razif66 at gmail.com (razif66 at gmail.com) Date: Mon, 18 Apr 2011 15:47:46 +0000 Subject: [Maxima] Fw: latex to maxima code (fwd) Message-ID: <1458465493-1303141666-cardhu_decombobulator_blackberry.rim.net-1304538346-@b1.c3.bise3.blackberry> Sent from my BlackBerry? wireless device via Vodafone-Celcom Mobile. -----Original Message----- From: razif66 at gmail.com Date: Mon, 18 Apr 2011 15:45:46 To: Leo Butler Reply-To: razif66 at gmail.com Subject: Re: [Maxima] latex to maxima code (fwd) Thanks leo,i try used stringout(a,all) command and it save all input command that I gave in maxima...but how to save the output one?so that I can used the output file for next computation? Sent from my BlackBerry? wireless device via Vodafone-Celcom Mobile. -----Original Message----- From: Leo Butler Sender: maxima-bounces at math.utexas.edu Date: Mon, 18 Apr 2011 15:35:19 To: Maxima List Subject: Re: [Maxima] latex to maxima code (fwd) < < < ---------- Forwarded message ---------- < Date: Mon, 18 Apr 2011 13:36:57 +0000 < From: razif66 at gmail.com < To: Leo Butler < Subject: Re: [Maxima] latex to maxima code < < no,I have others software that can read latex file generated from maxima...what I try to get is,how can I convert latex file to maxima code back?so that I can reuse the mathematical expression for other work? < < Is there any way for me to save the output from maxima and loaded it back for others work? < ------Original Message------ < From: Leo Butler < To: razif razali < Cc: maxima at math.utexas.edu < Subject: Re: [Maxima] latex to maxima code < Sent: Apr 18, 2011 21:18 < < < < On Mon, 18 Apr 2011, razif razali wrote: < < < Dear all maxima users, < < is there any way to convert latex code that produce from Maxima to be converted back to Maxima code? < < from what I know to convert Maxima result to latex code is just by giving ' tex(%) ' command, but how to reconvert back to maxima code? < < If you are looking to put Maxima code inside a LaTeX document, < there is an Emacs package in the Maxima distribution called < emaxima. You can find documentation for it under doc/emaxima < in the Maxima sources. < < Leo < Please send your replies to the Maxima list if you have asked the question on that list. --- I don't know if there is a function/code, call it untex, such that untex(tex(%)) = %. Isn't it rather silly to ask for such a thing, since % obviously holds the Maxima code you want. However, if you look at the documentation for EMaxima you may find that it does something almost as good: you can embed Maxima code in LaTeX, run that code, and have it inserted into the document as LaTeX code. I believe that wxmaxima has some similar capabilities, but a wxmaxima user is better placed to comment. --- Having said all this, is it possible that you just want some means to save your Maxima code? If so, maybe you want to look at save or stringout Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at eecs.berkeley.edu Mon Apr 18 11:05:47 2011 From: fateman at eecs.berkeley.edu (R Fateman) Date: Mon, 18 Apr 2011 09:05:47 -0700 Subject: [Maxima] Fw: latex to maxima code (fwd) In-Reply-To: <1458465493-1303141666-cardhu_decombobulator_blackberry.rim.net-1304538346-@b1.c3.bise3.blackberry> References: <1458465493-1303141666-cardhu_decombobulator_blackberry.rim.net-1304538346-@b1.c3.bise3.blackberry> Message-ID: <4DAC615B.7020107@eecs.berkeley.edu> learn about commands that use files, like writefile , From l.butler at ed.ac.uk Mon Apr 18 11:05:07 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 18 Apr 2011 17:05:07 +0100 (BST) Subject: [Maxima] Fw: latex to maxima code (fwd) In-Reply-To: <1458465493-1303141666-cardhu_decombobulator_blackberry.rim.net-1304538346-@b1.c3.bise3.blackberry> References: <1458465493-1303141666-cardhu_decombobulator_blackberry.rim.net-1304538346-@b1.c3.bise3.blackberry> Message-ID: On Mon, 18 Apr 2011, razif66 at gmail.com wrote: < < Sent from my BlackBerry? wireless device via Vodafone-Celcom Mobile. < < -----Original Message----- < From: razif66 at gmail.com < Date: Mon, 18 Apr 2011 15:45:46 < To: Leo Butler < Reply-To: razif66 at gmail.com < Subject: Re: [Maxima] latex to maxima code (fwd) < < Thanks leo,i try used stringout(a,all) command and it save all input command that I gave in maxima...but how to save the output one?so that I can used the output file for next computation? You can find help in Maxima on a topic T by entering ? T E.g. ? save The special form `save (, all)' stores the current state of Maxima. This includes all user-defined variables, functions, arrays, etc., as well as some automatically defined items. The saved items include system variables, such as `file_search_maxima' or `showtime', if they have been assigned new values by the user; see `myoptions'. I think this is what you want. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From daniel.dalton47 at gmail.com Mon Apr 18 21:21:00 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Tue, 19 Apr 2011 12:21:00 +1000 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: References: <20110403055130.GA13712@gwsc.vic.edu.au> <20110403210247.GB3664@gwsc.vic.edu.au> <20110411014318.GA9991@gwsc.vic.edu.au> Message-ID: <20110419022100.GB18845@gwsc.vic.edu.au> On Mon, Apr 11, 2011 at 08:39:37AM +0100, Leo Butler wrote: > > < Ok, I get these errors when running the load command in maxima: > < (%i1) batch (findeq.mac); > > > Try > > batch("findeq.mac"); Thanks, that solves the problem. > < Once this is actually working how can I put my own data points in? > > You can add something like: > > mydata : matric([1,2],[2,5], etc. ); > > if you need to enter the data manually. Thank you, that is very good. Is there any way to get a cubic or linear fit? Or will I need to be happy with the quadratic fit? Thanks for your help, Dan From daniel.dalton47 at gmail.com Mon Apr 18 21:27:09 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Tue, 19 Apr 2011 12:27:09 +1000 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: References: <20110403055130.GA13712@gwsc.vic.edu.au> <20110403210247.GB3664@gwsc.vic.edu.au> <20110411015206.GC9991@gwsc.vic.edu.au> Message-ID: <20110419022709.GC18845@gwsc.vic.edu.au> On Mon, Apr 11, 2011 at 09:01:08AM +0100, Leo Butler wrote: > < float(solve(diff(f(x),x))); > < float(f(%)); > < > < The answer was supposed to be in decimal btw. > > > You should be able to do all the calculations symbolically, then > convert the final answer to floating point. It is easier to check > intermediate steps if you do this. > > I think, also, when you do Fair enough - I just did this to save time... > > eqn : diff(f(x),x) = 0; > critical_points : solve(eqn,x); > > you should get a list of 1 or more critical points. To find the value > of f at each of this points, you can do the following: > > makelist( [ cp, y=f(rhs(cp)) ], cp, critical_points); > > which will give you a list of pairs list [x=1,y=2], etc. Very nice, so just the turning points of the graph? Then I still find x/y intercepts myself with solve and substituting 0 into f(x)? Thanks, Dan From daniel.dalton47 at gmail.com Mon Apr 18 21:37:29 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Tue, 19 Apr 2011 12:37:29 +1000 Subject: [Maxima] Using maxima for high school mathematics Message-ID: <20110419023729.GB19848@gwsc.vic.edu.au> On Mon, Apr 11, 2011 at 06:23:50PM +0200, Mario Rodriguez wrote: > Not sure if the following suggestion can be of some help. > > One of the available terminals in gnuplot is called 'dumb', > where graphics are plotted with ascii characters. > > Perhaps, you can plot the result with a Braille printer or get > a relief drawing from it. Hey Mario, This looks really interesting! Never thought of that, great idea. Can you explain what the different symbols (+-|) etc. represent? I can't see why I couldn't interpret this if I knew that information as all this information is available to me at my finger tips!:) Anyway if you can tell me how it works I'll hopefully make some sense out of it:) Dan ----- End forwarded message ----- From razif66 at gmail.com Mon Apr 18 22:03:35 2011 From: razif66 at gmail.com (razif razali) Date: Tue, 19 Apr 2011 11:03:35 +0800 Subject: [Maxima] Fw: latex to maxima code (fwd) In-Reply-To: References: <1458465493-1303141666-cardhu_decombobulator_blackberry.rim.net-1304538346-@b1.c3.bise3.blackberry> Message-ID: i got this kind of code ----------------------------------- *f[n,k] := concat('f_,n,"_",k)(s)$* *df[n,k] :=* * if n=0 then 0 * * else 'diff(f[2*n,k],s)=%psi*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1])$ * *atvalue(f_4_2(s),s=0,0)$* *atvalue(f_4_3(s),s=0,0)$ * *makelist( df[2,k],k,1,3);* *desolve(%, makelist(f[4,k],k,1,3) );* *nonzero;* *-----------------------*--------------------------- this code give me 3functions which is f_4_1(s) , f_4_2(s) and f_4_3(s) . what I want to do is to plot this functions for different %psi and s. For this small problem I can just rewrite the functions I get in maxima and plot it, but for higher problem, one function give me almost 15lines of equation and its takes time for me to rewrite each function and plot it. to rewrite such functions also not practical because it will have some human error in rewrite those large functions. I try use stringout command but it just give me input command that I invoke in maxima, i try to use writefile but it gives me output that I can't use to reuse to plot or change the %psi and s value. I try to use save command but i failed to understand how to use it..it always give me this error ----------------------- *save(savelaaa,all);* *save: first argument must be a string; found: savelaaa* * -- an error. To debug this try: debugmode(true);* ------------------------ On Tue, Apr 19, 2011 at 9:15 AM, razif razali wrote: > How to use save arguments?when I invoke this command in maxima ' > save(test,all) ' it gives me this > ----------------------- > save(savelaaa,all); > save: first argument must be a string; found: savelaaa > -- an error. To debug this try: debugmode(true); > ------------------------ > how to save my input and output in maxima? > > > On Tue, Apr 19, 2011 at 12:05 AM, Leo Butler wrote: > >> >> >> On Mon, 18 Apr 2011, razif66 at gmail.com wrote: >> >> < >> < Sent from my BlackBerry? wireless device via Vodafone-Celcom Mobile. >> < >> < -----Original Message----- >> < From: razif66 at gmail.com >> < Date: Mon, 18 Apr 2011 15:45:46 >> < To: Leo Butler >> < Reply-To: razif66 at gmail.com >> < Subject: Re: [Maxima] latex to maxima code (fwd) >> < >> < Thanks leo,i try used stringout(a,all) command and it save all input >> command that I gave in maxima...but how to save the output one?so that I can >> used the output file for next computation? >> >> You can find help in Maxima on a topic T by entering >> >> ? T >> >> >> E.g. >> >> ? save >> >> >> >> The special form `save (, all)' stores the current state >> of Maxima. This includes all user-defined variables, functions, >> arrays, etc., as well as some automatically defined items. The >> saved items include system variables, such as `file_search_maxima' >> or `showtime', if they have been assigned new values by the user; >> see `myoptions'. >> >> >> I think this is what you want. >> >> Leo >> -- >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> > > > -- > Regards, > > RAZIF RAZALI, > Tutor & Master Student, > Physics Department, > Faculty Of Science, > Universiti Teknologi Malaysia(UTM). > +60199393606 > > > > -- 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 macrakis at alum.mit.edu Mon Apr 18 22:10:22 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 18 Apr 2011 23:10:22 -0400 Subject: [Maxima] Fw: latex to maxima code (fwd) In-Reply-To: References: <1458465493-1303141666-cardhu_decombobulator_blackberry.rim.net-1304538346-@b1.c3.bise3.blackberry> Message-ID: Not sure I entirely understand your problem. It sounds as though you want to save the expressions *as text* (not as internal objects of some kind) and then re-enter them into Maxima later. You can use string(...) for that. Or do you want to do all this *within the same Maxima session*? In that case, you can do something like this: xxx1 : <> xxx1a: subst(3,P,xxx1)$ xxx1b: subst(23/3,P, xxx1)$ Is that what you need? It isn't very clear.... -s On Mon, Apr 18, 2011 at 23:03, razif razali wrote: > i got this kind of code > ----------------------------------- > > *f[n,k] := concat('f_,n,"_",k)(s)$* > > *df[n,k] :=* > > * if n=0 then 0 * > > * else > 'diff(f[2*n,k],s)=%psi*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1])$ > * > > *atvalue(f_4_2(s),s=0,0)$* > > *atvalue(f_4_3(s),s=0,0)$ * > > *makelist( df[2,k],k,1,3);* > > *desolve(%, makelist(f[4,k],k,1,3) );* > > *nonzero;* > *-----------------------*--------------------------- > this code give me 3functions which is f_4_1(s) , f_4_2(s) and f_4_3(s) . > what I want to do is to plot this functions for different %psi and s. For > this small problem I can just rewrite the functions I get in maxima and plot > it, but for higher problem, one function give me almost 15lines of equation > and its takes time for me to rewrite each function and plot it. to rewrite > such functions also not practical because it will have some human error in > rewrite those large functions. > > I try use stringout command but it just give me input command that I invoke > in maxima, i try to use writefile but it gives me output that I can't use to > reuse to plot or change the %psi and s value. I try to use save command but > i failed to understand how to use it..it always give me this error > > ----------------------- > *save(savelaaa,all);* > *save: first argument must be a string; found: savelaaa* > * -- an error. To debug this try: debugmode(true);* > ------------------------ > > > > On Tue, Apr 19, 2011 at 9:15 AM, razif razali wrote: > >> How to use save arguments?when I invoke this command in maxima ' >> save(test,all) ' it gives me this >> ----------------------- >> save(savelaaa,all); >> save: first argument must be a string; found: savelaaa >> -- an error. To debug this try: debugmode(true); >> ------------------------ >> how to save my input and output in maxima? >> >> >> On Tue, Apr 19, 2011 at 12:05 AM, Leo Butler wrote: >> >>> >>> >>> On Mon, 18 Apr 2011, razif66 at gmail.com wrote: >>> >>> < >>> < Sent from my BlackBerry? wireless device via Vodafone-Celcom Mobile. >>> < >>> < -----Original Message----- >>> < From: razif66 at gmail.com >>> < Date: Mon, 18 Apr 2011 15:45:46 >>> < To: Leo Butler >>> < Reply-To: razif66 at gmail.com >>> < Subject: Re: [Maxima] latex to maxima code (fwd) >>> < >>> < Thanks leo,i try used stringout(a,all) command and it save all input >>> command that I gave in maxima...but how to save the output one?so that I can >>> used the output file for next computation? >>> >>> You can find help in Maxima on a topic T by entering >>> >>> ? T >>> >>> >>> E.g. >>> >>> ? save >>> >>> >>> >>> The special form `save (, all)' stores the current state >>> of Maxima. This includes all user-defined variables, functions, >>> arrays, etc., as well as some automatically defined items. The >>> saved items include system variables, such as `file_search_maxima' >>> or `showtime', if they have been assigned new values by the user; >>> see `myoptions'. >>> >>> >>> I think this is what you want. >>> >>> Leo >>> -- >>> The University of Edinburgh is a charitable body, registered in >>> Scotland, with registration number SC005336. >>> >>> >> >> >> -- >> Regards, >> >> RAZIF RAZALI, >> Tutor & Master Student, >> Physics Department, >> Faculty Of Science, >> Universiti Teknologi Malaysia(UTM). >> +60199393606 >> >> >> >> > > > -- > 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 biomates at telefonica.net Tue Apr 19 00:46:32 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Tue, 19 Apr 2011 07:46:32 +0200 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <20110419023729.GB19848@gwsc.vic.edu.au> References: <20110419023729.GB19848@gwsc.vic.edu.au> Message-ID: <1303191992.2779.64.camel@pc> > Hey Mario, > > This looks really interesting! Never thought of that, great idea. Can > you explain what the different symbols (+-|) etc. represent? I can't see > why I couldn't interpret this if I knew that information as all this > information is available to me at my finger tips!:) > > Anyway if you can tell me how it works I'll hopefully make some sense > out of it:) > Hello, The curve is plotted inside a box, the '-' symbols are used to draw the upper and lower segments of the box, while the '|' symbols are used to draw the lateral segments. There are some plus symbols '+' on these lines. They are tick marks for ordinates and abscissas. Finally, the curve is also plotted with '+' symbols. Depending on the slope of the curve, more than one plus symbol can be written. At this moment, package draw does not support the 'dumb' terminal, but this workaround should work: load(draw) $ set_draw_defaults (user_preamble="set terminal dumb")$ /* a parabola */ draw2d(explicit(x^2,x,-1,1))$ /* the sine */ draw2d(explicit(sin(x),x,0,4*%pi))$ /* two intersecting parabolas */ draw2d( explicit(x^2, x,-2, 2), explicit(-x^2+2, x, -2, 2) )$ (If after plotting, the Maxima prompt is not shown, type CTRL+C. I'll see if I can fix this.) There is also the plot2d function, which might be easier for you. I think something as plot2d(x^2,[x,-1,1], [gnuplot_term, "dumb"]); should work, but I don't get anything. Perhaps someone else can help us with the code. -- Mario From l.butler at ed.ac.uk Tue Apr 19 02:23:50 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 19 Apr 2011 08:23:50 +0100 (BST) Subject: [Maxima] Fw: latex to maxima code (fwd) In-Reply-To: References: <1458465493-1303141666-cardhu_decombobulator_blackberry.rim.net-1304538346-@b1.c3.bise3.blackberry> Message-ID: On Tue, 19 Apr 2011, razif razali wrote: < ----------------------- < save(savelaaa,all); < save: first argument must be a string; found: savelaaa < ?-- an error. To debug this try: debugmode(true); < ------------------------ Try reading the entire documentation for save. The error message tells you that the first argument must be quoted (i.e. a string): save("savelaaa",all); Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From achearn at verizon.net Mon Apr 18 20:08:34 2011 From: achearn at verizon.net (Tony Hearn) Date: Mon, 18 Apr 2011 18:08:34 -0700 Subject: [Maxima] Fwd: REDUCE In-Reply-To: References: Message-ID: <0LJV00BGJKGJW2Z1@vms173009.mailsrvcs.net> At 11:08 PM 4/15/2011, Andrej Vodopivec wrote: >I don't know how to update the web-page so I'm forwarding this to the >maxima list. Thanks. A possible reference would be reduce-algebra.com, or reduce-algebra.sourceforge.net. The latter lists Maxima by the way. From hawe at chefmail.de Mon Apr 18 12:41:42 2011 From: hawe at chefmail.de (Hans W. Hofmann) Date: Mon, 18 Apr 2011 17:41:42 +0000 (UTC) Subject: [Maxima] wxMaxima and ImageMagcik References: <002c01cbfb30$7898e880$69cab980$@gmx.de> <007301cbfb52$a3705850$ea5108f0$@gmx.de> Message-ID: I am using WINK 2.0 (www.debugmode.com) to get animations. Record Screenactivities to Flash *.swf Free, easy, interactive and better quality.... Gruss HW From fateman at eecs.berkeley.edu Tue Apr 19 07:50:23 2011 From: fateman at eecs.berkeley.edu (R Fateman) Date: Tue, 19 Apr 2011 05:50:23 -0700 Subject: [Maxima] Fw: latex to maxima code (fwd) In-Reply-To: References: <1458465493-1303141666-cardhu_decombobulator_blackberry.rim.net-1304538346-@b1.c3.bise3.blackberry> Message-ID: <4DAD850F.7080402@eecs.berkeley.edu> I suspect that the major difficulty could be overcome by NOT defining f stuff with concat.. Just use subscripted variables directly. RJF From drdieterkaiser at web.de Tue Apr 19 11:30:31 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 19 Apr 2011 18:30:31 +0200 Subject: [Maxima] Fwd: CVS/Git conversions for Maxima In-Reply-To: References: Message-ID: <1303230631.1710.11.camel@dieter> Am Sonntag, den 17.04.2011, 19:06 +0100 schrieb Leo Butler: > Barring any last minute objections: > > I'd like to freeze the CVS repo from 0600 BST (0500 GMT) > on Tuesday 19 April. I should have the Git repo in place by > 1200 BST. I will email this list when it is up. I have already got the new git repo. I have successfully built Maxima and I have run the testsuite and the share_testsuite. I have no problems. I use the IDE Eclipse and I have installed the plugin EGit. It is a very comfortable tool. Is it OK to commit already something? I have a lot of changes to the German translation of the Manual. Dieter Kaiser From l.butler at ed.ac.uk Tue Apr 19 11:30:32 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 19 Apr 2011 17:30:32 +0100 (BST) Subject: [Maxima] Announcement: Git conversion Message-ID: Hello, The Maxima repository has now changed over to Git. Below are a few pointers on interacting with the new repository. Developer-only advice is prefixed by [D]. Browse the repository: ====================== Go to http://maxima.git.sourceforge.net/git/gitweb-index.cgi and select repo. To clone the repository: ======================== read-only: git clone git://maxima.git.sourceforge.net/gitroot/maxima/repo developer (read/write): git clone ssh://USERNAME at maxima.git.sourceforge.net/gitroot/maxima/repo The directions on https://sourceforge.net/projects/maxima/develop are incorrect and I have made a request to SF to correct them. To see what you have: ===================== git branch # show your local branches git branch -r # show the remote branches git tag -l # see the tags To work on your repository: =========================== git checkout -b scratch-pad # create a throw-away branch to work in # do some work on existing files, then git commit -a -m 'My first commit' # in your own repository [D] To commit your changes to the SF repository: ================================================ git checkout master git pull # update master branch with any changes from SF git merge scratch-pad # merge your scratch-pad onto master git push origin master # push the changes to SF Additional Git resources: ========================= -http://maxima.sourceforge.net/git-cheat-sheet/ -http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html -http://git-scm.com/documentation -http://www.kernel.org/pub/software/scm/git/docs/user-manual.html [D] Things that remain to be done: ================================== -test and set up the commit hook correctly (in repo/hooks/post-receive) -redirect https://sourceforge.net/scm/?type=cvs&group_id=4933 to https://sourceforge.net/scm/?type=git&group_id=4933 -correct the information on the latter page -update pages like http://maxima.sourceforge.net/download.html Cheers, Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From l.butler at ed.ac.uk Tue Apr 19 11:36:01 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 19 Apr 2011 17:36:01 +0100 (BST) Subject: [Maxima] Fwd: CVS/Git conversions for Maxima In-Reply-To: <1303230631.1710.11.camel@dieter> References: <1303230631.1710.11.camel@dieter> Message-ID: On Tue, 19 Apr 2011, Dieter Kaiser wrote: < Am Sonntag, den 17.04.2011, 19:06 +0100 schrieb Leo Butler: < > Barring any last minute objections: < > < > I'd like to freeze the CVS repo from 0600 BST (0500 GMT) < > on Tuesday 19 April. I should have the Git repo in place by < > 1200 BST. I will email this list when it is up. < < I have already got the new git repo. I have successfully built Maxima < and I have run the testsuite and the share_testsuite. I have no < problems. < < I use the IDE Eclipse and I have installed the plugin EGit. It is a very < comfortable tool. < < Is it OK to commit already something? I have a lot of changes to the < German translation of the Manual. Dieter, you beat me to the punch line ;-). Meetings delayed me from announcing things earlier. Please go ahead and try to push your commits. I put a post-commit hook script in place to email maxima-commits, but I am not sure it is working. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From biomates at telefonica.net Tue Apr 19 13:49:53 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Tue, 19 Apr 2011 20:49:53 +0200 Subject: [Maxima] Fwd: REDUCE In-Reply-To: <0LJV00BGJKGJW2Z1@vms173009.mailsrvcs.net> References: <0LJV00BGJKGJW2Z1@vms173009.mailsrvcs.net> Message-ID: <1303238993.2848.0.camel@pc> El lun, 18-04-2011 a las 18:08 -0700, Tony Hearn escribi?: > At 11:08 PM 4/15/2011, Andrej Vodopivec wrote: > >I don't know how to update the web-page so I'm forwarding this to the > >maxima list. > > Thanks. A possible reference would be reduce-algebra.com, or > reduce-algebra.sourceforge.net. The latter lists Maxima by the way. Done -- Mario From andrej.vodopivec at gmail.com Tue Apr 19 13:52:20 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Tue, 19 Apr 2011 20:52:20 +0200 Subject: [Maxima] Announcement: Git conversion In-Reply-To: References: Message-ID: Hi, I really don't like the layout of the repository. I would expect that cloning the maxima repository would only give me the sources for maxima, but now I also get the webpage, izic and other stuff. These should be in separate repositories. This is especially annoying because in a freshly cloned repository git reports that the files izic/zic/lib/zic_mntG.c and maxima-pre59/src/SYS-PROCLAIM.lisp are modified and I don't know how to fix this. This happens on Windows and OSX, probably because the filesystems are not case sensitive. Andrej On Tue, Apr 19, 2011 at 6:30 PM, Leo Butler wrote: > Hello, > > The Maxima repository has now changed over to Git. > Below are a few pointers on interacting with the new repository. > Developer-only advice is prefixed by [D]. > > > Browse the repository: > ====================== > > Go to > http://maxima.git.sourceforge.net/git/gitweb-index.cgi > and select repo. > > To clone the repository: > ======================== > > read-only: > git clone git://maxima.git.sourceforge.net/gitroot/maxima/repo > > developer (read/write): > git clone ssh://USERNAME at maxima.git.sourceforge.net/gitroot/maxima/repo > > The directions on https://sourceforge.net/projects/maxima/develop are > incorrect and I have made a request to SF to correct them. > > To see what you have: > ===================== > > git branch ? ? ?# show your local branches > git branch -r ? # show the remote branches > git tag -l ? ? ?# see the tags > > To work on your repository: > =========================== > > git checkout -b scratch-pad ? ? ?# create a throw-away branch to work in > # do some work on existing files, then > git commit -a -m 'My first commit' ?# in your own repository > > [D] To commit your changes to the SF repository: > ================================================ > > git checkout master > git pull ? ? ? ? ? ? ? ? ? ?# update master branch with any changes from > SF > git merge scratch-pad ? ? ? # merge your scratch-pad onto master > git push origin master ? ? ?# push the changes to SF > > Additional Git resources: > ========================= > > -http://maxima.sourceforge.net/git-cheat-sheet/ > > -http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html > > -http://git-scm.com/documentation > > -http://www.kernel.org/pub/software/scm/git/docs/user-manual.html > > > [D] Things that remain to be done: > ================================== > > -test and set up the commit hook correctly (in repo/hooks/post-receive) > -redirect https://sourceforge.net/scm/?type=cvs&group_id=4933 > ?to https://sourceforge.net/scm/?type=git&group_id=4933 > -correct the information on the latter page > -update pages like > ?http://maxima.sourceforge.net/download.html > > > Cheers, > Leo > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From biomates at telefonica.net Tue Apr 19 14:11:53 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Tue, 19 Apr 2011 21:11:53 +0200 Subject: [Maxima] Announcement: Git conversion In-Reply-To: References: Message-ID: <1303240313.2848.9.camel@pc> El mar, 19-04-2011 a las 17:30 +0100, Leo Butler escribi?: > > git checkout master > git pull # update master branch with any changes from > SF > git merge scratch-pad # merge your scratch-pad onto master > git push origin master # push the changes to SF Thanks, I have just commited two changes to module site-xml following these steps, and it worked fine. The problem is that my SF username is 'riotorto', and the changes were recorded with my username in my local computer. I usually commit changes from different machines and different local user names. Any hint how to fix this? -- Mario From biomates at telefonica.net Tue Apr 19 14:18:50 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Tue, 19 Apr 2011 21:18:50 +0200 Subject: [Maxima] Announcement: Git conversion In-Reply-To: <1303240313.2848.9.camel@pc> References: <1303240313.2848.9.camel@pc> Message-ID: <1303240730.2848.12.camel@pc> El mar, 19-04-2011 a las 21:11 +0200, Mario Rodriguez escribi?: > I have just commited two changes to module site-xml following these > steps, and it worked fine. The problem is that my SF username is > 'riotorto', and the changes were recorded with my username in my local > computer. > > I usually commit changes from different machines and different local > user names. Any hint how to fix this? I think I've found the answer myself: $ git config --global user.name "riotorto" $ git config --global user.email "biomates at telefonica.net" I'll try it the next time. -- Mario From l.butler at ed.ac.uk Tue Apr 19 14:48:53 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 19 Apr 2011 20:48:53 +0100 (BST) Subject: [Maxima] Announcement: Git conversion In-Reply-To: References: Message-ID: On Tue, 19 Apr 2011, Andrej Vodopivec wrote: < Hi, < < I really don't like the layout of the repository. I would expect that < cloning the maxima repository would only give me the sources for < maxima, but now I also get the webpage, izic and other stuff. These < should be in separate repositories. With git-cvsimport, I could do this. Unfortunately, I couldn't see a way to do this with cvs2git and it produced a more faithful conversion. < < This is especially annoying because in a freshly cloned repository git < reports that the files izic/zic/lib/zic_mntG.c and < maxima-pre59/src/SYS-PROCLAIM.lisp are modified and I don't know how < to fix this. This happens on Windows and OSX, probably because the < filesystems are not case sensitive. In .git/info/exclude, add lines like izic/* maxima-pre59/* and so on. Or if you want to be less drastic, just add the filenames of the offenders. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From andrej.vodopivec at gmail.com Tue Apr 19 15:34:11 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Tue, 19 Apr 2011 22:34:11 +0200 Subject: [Maxima] Announcement: Git conversion In-Reply-To: References: Message-ID: > < This is especially annoying because in a freshly cloned repository git > < reports that the files izic/zic/lib/zic_mntG.c and > < maxima-pre59/src/SYS-PROCLAIM.lisp are modified and I don't know how > < to fix this. This happens on Windows and OSX, probably because the > < filesystems are not case sensitive. > > ?In .git/info/exclude, add lines like > > ?izic/* > ?maxima-pre59/* That did not work. But this did: git update-index --assume-unchanged izic/zic/lib/zic_mntG.c maxima-pre59/src/sys-proclaim.lisp Andrej From l.butler at ed.ac.uk Tue Apr 19 15:56:02 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 19 Apr 2011 21:56:02 +0100 (BST) Subject: [Maxima] Announcement: Git conversion In-Reply-To: References: Message-ID: On Tue, 19 Apr 2011, Andrej Vodopivec wrote: < > < This is especially annoying because in a freshly cloned repository git < > < reports that the files izic/zic/lib/zic_mntG.c and < > < maxima-pre59/src/SYS-PROCLAIM.lisp are modified and I don't know how < > < to fix this. This happens on Windows and OSX, probably because the < > < filesystems are not case sensitive. < > < > ?In .git/info/exclude, add lines like < > < > ?izic/* < > ?maxima-pre59/* < < That did not work. Of course it didn't work since you can only ignore untracked files. Stupid me. If the problem really is related to a case-insensitive filesystem, it may be that you can use git config core.ignorecase true < < That did not work. But this did: < < git update-index --assume-unchanged izic/zic/lib/zic_mntG.c < maxima-pre59/src/sys-proclaim.lisp This is probably more drastic a solution than you want in general, because git will balk at modifying these files. That's not a big deal here, but elsewhere it may give you problems. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From cloos at jhcloos.com Tue Apr 19 18:48:11 2011 From: cloos at jhcloos.com (James Cloos) Date: Tue, 19 Apr 2011 19:48:11 -0400 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <1303191992.2779.64.camel@pc> (Mario Rodriguez's message of "Tue, 19 Apr 2011 07:46:32 +0200") References: <20110419023729.GB19848@gwsc.vic.edu.au> <1303191992.2779.64.camel@pc> Message-ID: >>>>> "MR" == Mario Rodriguez writes: MR> There is also the plot2d function, which might be easier for you. I MR> think something as MR> plot2d(x^2,[x,-1,1], [gnuplot_term, "dumb"]); MR> should work, but I don't get anything. Perhaps someone else can help MR> us with the code. When I try that I get a file called maxplot.dumb in the home directory with the output of the plot. (I got $ marks for the curve. When I use gnuplot interactively I get * marks for the curve.) -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From daniel.dalton47 at gmail.com Tue Apr 19 21:09:47 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Wed, 20 Apr 2011 12:09:47 +1000 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <1303191992.2779.64.camel@pc> References: <20110419023729.GB19848@gwsc.vic.edu.au> <1303191992.2779.64.camel@pc> Message-ID: <20110420020947.GC9120@gwsc.vic.edu.au> On Tue, Apr 19, 2011 at 07:46:32AM +0200, Mario Rodriguez wrote: > > Anyway if you can tell me how it works I'll hopefully make some sense > > out of it:) > > > > Hello, Hi, > > The curve is plotted inside a box, the '-' symbols are used to draw the > upper and lower segments of the box, while the '|' symbols are used to > draw the lateral segments. Ah, ok > > There are some plus symbols '+' on these lines. They are tick marks for > ordinates and abscissas. What are these? I've never come across them do I need to be worried about them? > > Finally, the curve is also plotted with '+' symbols. Depending on the > slope of the curve, more than one plus symbol can be written. Yes indeed, I can now make sense of it all! Very good, this will be very useful indeed. How can I figure out what + signs are part of the curve without getting confused with the other individual + signs? Taking this concept slightly further, does this mean in theory I could convert other images (diagrams for example), to ascii? > > At this moment, package draw does not support the 'dumb' terminal, but > this workaround should work: > > load(draw) $ > set_draw_defaults (user_preamble="set terminal dumb")$ > > /* a parabola */ > draw2d(explicit(x^2,x,-1,1))$ > > /* the sine */ > draw2d(explicit(sin(x),x,0,4*%pi))$ Yes, that's what I did. > There is also the plot2d function, which might be easier for you. I > think something as > > plot2d(x^2,[x,-1,1], [gnuplot_term, "dumb"]); Makes sense. > > should work, but I don't get anything. Perhaps someone else can help us > with the code. Yes, I don't get any output either. Unless the output is being redirected somewhere else? Thanks for your help, Dan From razif66 at gmail.com Tue Apr 19 21:41:11 2011 From: razif66 at gmail.com (razif razali) Date: Wed, 20 Apr 2011 10:41:11 +0800 Subject: [Maxima] how to do simple loop in maxima and save the result in a file? Message-ID: ----------------------------------------- #include #include int main() { double p, x,y,delt; int a, Is, g, l, z, d; FILE *fout; delt=0.001; fout = fopen( "test1.dat", "w"); for (x=0.4; x<1; x=x+delt){ p=(1-x)/(1+x); printf ("%f %f\n",p,x); fprintf(fout, "%f %f\n",p,x); } fclose(fout); return 0; } ------------------------------------ above are C script to generate 'test1.dat' file with 'p' value for each 'x', how can I do similar loop program in Maxima and save the result in a new file like 'test1.dat'? i'm read the manual and came across that Maxima result can be converted to fortran script, is C conversion also available?because I'm not very familiar with fortran. -- 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 willisb at unk.edu Tue Apr 19 22:25:08 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 19 Apr 2011 22:25:08 -0500 Subject: [Maxima] help with ./configure error In-Reply-To: References: <20110419023729.GB19848@gwsc.vic.edu.au> <1303191992.2779.64.camel@pc>, Message-ID: I'm learning git, but due to ./configure failing, I haven't been able to build Maxima using msys. I'm clueless about fixing / debugging such things...all pointers appreciated. I tried both ccl & sbcl with the same bug. Maybe I don't have the correct msys version? How do I know which one I have? $ ./configure --enable-sbcl checking for a BSD-compatible install... /bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for emacs... no checking for xemacs... no checking build system type... i686-pc-mingw32 checking host system type... i686-pc-mingw32 checking for sbcl... true checking for sbcl... (cached) true checking for iconv... true checking for recode... false checking POSIX shell to see that it contains getopts... trying /bin/sh POSIX shell is /bin/sh checking for egrep... grep -E configure: creating ./config.status ./config.status: line 389: syntax error near unexpected token `\"' ./config.status: line 389: ` "\" ) CONFIG_FILES="$CONFIG_FILES \" ;;' --Barton From razif66 at gmail.com Tue Apr 19 22:36:07 2011 From: razif66 at gmail.com (razif razali) Date: Wed, 20 Apr 2011 11:36:07 +0800 Subject: [Maxima] asking on maxima plotting data Message-ID: Dear all maxima user, if I invoke this command in Maxima ' plot2d(2*x+38/x,[x,0,10]); ' Maxima will automatically plot the given function in gnuplot for ' x ' from 0 to 10 how to sampling the data that Maxima calculate before it plot in gnuplot? -- 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 razif66 at gmail.com Tue Apr 19 23:27:33 2011 From: razif66 at gmail.com (razif razali) Date: Wed, 20 Apr 2011 12:27:33 +0800 Subject: [Maxima] asking on maxima plotting data In-Reply-To: References: Message-ID: here what I get so far,by using *with_stdout* *with_stdout ("data4.txt", for x:1 thru 10 do print (x,2.0*x+38.0/x))$* * * I got several problem here 1. is my sampling is only 10 point, so when I want to use this data to plot a graph its not suitable. The increment of *x* is 1 , how can I decrease the increment of *x* around 0.01 maybe? 2. the function *2*x+38/x *can't be used to invoke those command, the result in *data4.txt* can't be used by gnuplot outside Maxima environment. So I need to float this equation first before put it in with_stdout command. 3. if the equation *2*x+38/x *come from several work before I invoke with_stdout, I need to *float*, *string* and paste it in *with_stdout*command, if not *data4.txt* can't be used by gnuplot outside Maxima environment. Here what I'm done (%i1)2*x $ (%i2)38/x $ (%i3)%o1+%o2 $ (%i4)float(%) $ (%i5) string(%) ; I copy manually and paste in(%i6) (%i6)with_stdout ("data4.txt", for x:1 thru 10 do print (x,2.0*x+38.0/x))$ ------------------------------------- with_stdout ("data4.txt", for x:1 thru 10 do print (x,%i3))$ and with_stdout ("data4.txt", for x:1 thru 10 do print (x,%i4))$ can't be used.... On Wed, Apr 20, 2011 at 11:36 AM, razif razali wrote: > Dear all maxima user, > > if I invoke this command in Maxima ' plot2d(2*x+38/x,[x,0,10]); ' Maxima > will automatically plot the given function in gnuplot for ' x ' from 0 to 10 > > how to sampling the data that Maxima calculate before it plot in gnuplot? > > -- > Regards, > > RAZIF RAZALI, > Tutor & Master Student, > Physics Department, > Faculty Of Science, > Universiti Teknologi Malaysia(UTM). > +60199393606 > > > > -- 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 andrej.vodopivec at gmail.com Tue Apr 19 23:42:07 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Wed, 20 Apr 2011 06:42:07 +0200 Subject: [Maxima] help with ./configure error In-Reply-To: References: <20110419023729.GB19848@gwsc.vic.edu.au> <1303191992.2779.64.camel@pc> Message-ID: Are you using msysgit? The problem is probably that it convert unix line endings to dos line endings. You should reinstall git. During the installation, it will ask you what to do with line endings. Choose to leave line endings as they are in the remote repository. Then clone the repository again. Andrej On Wed, Apr 20, 2011 at 5:25 AM, Barton Willis wrote: > I'm learning git, but due to ./configure failing, I haven't been able to build Maxima using msys. > I'm clueless about fixing / debugging such things...all pointers appreciated. I tried both > ccl & sbcl with the same bug. Maybe I don't have the correct msys version? How do I know which > one I have? > > $ ./configure --enable-sbcl > checking for a BSD-compatible install... /bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for emacs... no > checking for xemacs... no > checking build system type... i686-pc-mingw32 > checking host system type... i686-pc-mingw32 > checking for sbcl... true > checking for sbcl... (cached) true > checking for iconv... true > checking for recode... false > checking POSIX shell to see that it contains getopts... trying /bin/sh > POSIX shell is /bin/sh > checking for egrep... grep -E > configure: creating ./config.status > ./config.status: line 389: syntax error near unexpected token `\"' > ./config.status: line 389: ` ?"\" ) CONFIG_FILES="$CONFIG_FILES \" ;;' > > > > > --Barton > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From razif66 at gmail.com Wed Apr 20 00:00:14 2011 From: razif66 at gmail.com (razif razali) Date: Wed, 20 Apr 2011 13:00:14 +0800 Subject: [Maxima] asking on maxima plotting data In-Reply-To: References: Message-ID: just find out the easiest way is to copy from *maxout.gnuplot_pipes *in home folder but is there any way to save plotting data to specific file? On Wed, Apr 20, 2011 at 12:27 PM, razif razali wrote: > here what I get so far,by using *with_stdout* > > *with_stdout ("data4.txt", for x:1 thru 10 do print (x,2.0*x+38.0/x))$* > * > * > I got several problem here > > 1. is my sampling is only 10 point, so when I want to use this data to > plot a graph its not suitable. The increment of *x* is 1 , how can I > decrease the increment of *x* around 0.01 maybe? > > 2. the function *2*x+38/x *can't be used to invoke those command, the > result in *data4.txt* can't be used by gnuplot outside Maxima environment. > So I need to float this equation first before put it in with_stdout command. > > 3. if the equation *2*x+38/x *come from several work before I invoke > with_stdout, I need to *float*, *string* and paste it in *with_stdout*command, if not > *data4.txt* can't be used by gnuplot outside Maxima environment. Here what > I'm done > (%i1)2*x $ > (%i2)38/x $ > (%i3)%o1+%o2 $ > (%i4)float(%) $ > (%i5) string(%) ; > I copy manually and paste in(%i6) > (%i6)with_stdout ("data4.txt", for x:1 thru 10 do print (x,2.0*x+38.0/x))$ > ------------------------------------- > with_stdout ("data4.txt", for x:1 thru 10 do print (x,%i3))$ > and > with_stdout ("data4.txt", for x:1 thru 10 do print (x,%i4))$ > > can't be used.... > > > > > On Wed, Apr 20, 2011 at 11:36 AM, razif razali wrote: > >> Dear all maxima user, >> >> if I invoke this command in Maxima ' plot2d(2*x+38/x,[x,0,10]); ' Maxima >> will automatically plot the given function in gnuplot for ' x ' from 0 to 10 >> >> how to sampling the data that Maxima calculate before it plot in gnuplot? >> >> -- >> Regards, >> >> RAZIF RAZALI, >> Tutor & Master Student, >> Physics Department, >> Faculty Of Science, >> Universiti Teknologi Malaysia(UTM). >> +60199393606 >> >> >> >> > > > -- > Regards, > > RAZIF RAZALI, > Tutor & Master Student, > Physics Department, > Faculty Of Science, > Universiti Teknologi Malaysia(UTM). > +60199393606 > > > > -- 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 andrej.vodopivec at gmail.com Wed Apr 20 00:21:29 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Wed, 20 Apr 2011 07:21:29 +0200 Subject: [Maxima] Announcement: Git conversion In-Reply-To: References: Message-ID: On Tue, Apr 19, 2011 at 9:48 PM, Leo Butler wrote: > > > On Tue, 19 Apr 2011, Andrej Vodopivec wrote: > > < Hi, > < > < I really don't like the layout of the repository. I would expect that > < cloning the maxima repository would only give me the sources for > < maxima, but now I also get the webpage, izic and other stuff. These > < should be in separate repositories. > > With git-cvsimport, I could do this. Unfortunately, I couldn't see a > way to do this with cvs2git and it produced a more faithful conversion. I see. Then I recommend that we remove izic, CVSROOT and htdocs from the repository. Maybe also maxima-pre59 and maximabook since these are also not used anymore. Andrej From l.butler at ed.ac.uk Wed Apr 20 01:54:43 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 20 Apr 2011 07:54:43 +0100 (BST) Subject: [Maxima] help with ./configure error In-Reply-To: References: <20110419023729.GB19848@gwsc.vic.edu.au> <1303191992.2779.64.camel@pc> Message-ID: On Wed, 20 Apr 2011, Andrej Vodopivec wrote: < Are you using msysgit? The problem is probably that it convert unix < line endings to dos line endings. < < You should reinstall git. During the installation, it will ask you < what to do with line endings. Choose to leave line endings as they are < in the remote repository. Then clone the repository again. < < Andrej < There are a couple config flags that control this: core.autocrlf core.safecrlf The first flag, when true, asks git to do LF -> CRLF conversion on update from the repo, and the reverse on pushes. The second setting has git check that a checkin/checkout is idempotent, and if not, it over-rides the first setting. You can check your current setting by git config --get core.autocrlf I think Andrej is suggesting that it should be set to false: git config core.autocrlf false If you haven't already tried Andrej's solution, I would suggest that you try these settings and try building from a fresh clone. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From rme at clozure.com Tue Apr 19 14:58:26 2011 From: rme at clozure.com (R. Matthew Emerson) Date: Tue, 19 Apr 2011 15:58:26 -0400 Subject: [Maxima] Windows package built w/ CCL References: <762030.69671.qm@web121801.mail.ne1.yahoo.com> <4D710E23.80800@gmail.com> <4D7117BA.3070804@eecs.berkeley.edu> Message-ID: Barton Willis writes: > maxima-bounces at math.utexas.edu wrote on 03/04/2011 10:47:54 AM: > > >> I HAVE tested GCL and CCL on Windows, running Maxima 5.23.2, and >> there is a very significant difference between the two in >> terms of running speed. > > For the testsuite (using a Core 2 6400 (2.13 GHz) and 2 GB RAM), CCL > is about 30% slower than GCL. Likely the testsuite is a poor speed > benchmark. If anyone is so inclined, we'd welcome bug reports of CCL performance deficiencies. http://trac.clozure.com/ccl/newticket Test cases in Lisp would be best, of course. From derekcthomas at gmail.com Tue Apr 19 20:30:59 2011 From: derekcthomas at gmail.com (Derek Thomas) Date: Tue, 19 Apr 2011 20:30:59 -0500 Subject: [Maxima] Using pdiff and itensor together Message-ID: I'm trying to use pdiff with itensor and I've observed some strange behavior. If I try to differentiate a function of a tensor where the argument and the differential have the same index, pdiff perfoms as expected: load(pdiff); load(itensor); diff(f(X([i],[])),X([i],[])); output> 'kdelta([i],[i])*pderivop(f,1)(X([i],[])) If the indices are different, then this is what I get: diff(f(X([i],[])),X([j],[])); output> 'diff(f(X([i],[])),X([j],[]),1) Any help in resolving my errors or the inconsistent behavior would be greatly appreciated. Thanks, Derek From l.butler at ed.ac.uk Wed Apr 20 02:38:50 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 20 Apr 2011 08:38:50 +0100 (BST) Subject: [Maxima] Announcement: Git conversion In-Reply-To: References: Message-ID: On Wed, 20 Apr 2011, Andrej Vodopivec wrote: < On Tue, Apr 19, 2011 at 9:48 PM, Leo Butler wrote: < > < > < > On Tue, 19 Apr 2011, Andrej Vodopivec wrote: < > < > < Hi, < > < < > < I really don't like the layout of the repository. I would expect that < > < cloning the maxima repository would only give me the sources for < > < maxima, but now I also get the webpage, izic and other stuff. These < > < should be in separate repositories. < > < > With git-cvsimport, I could do this. Unfortunately, I couldn't see a < > way to do this with cvs2git and it produced a more faithful conversion. < < I see. Then I recommend that we remove izic, CVSROOT and htdocs from < the repository. Maybe also maxima-pre59 and maximabook since these are < also not used anymore. Well, the virtue and curse of a repository is that nothing is ever really deleted from it (btw, htdocs stores all our webpage stuff.) If you don't like having these directories in your working copy, then what you can do is git update-index --assume-unchanged [directories] #and maybe files rm -fr [directories] This removes those files from your working copy and ensures that Git doesn't try to update them. It does not remove them from your repository. ------- I anticipated that there would be feedback on the layout of the repository, and since most of us are newbies who view things through CVS goggles, I didn't want to make drastic changes from the layout beyond what the conversion produced. As you probably already know, when learning some new tool/language one often tries to fit it into a pre-existing mold, only to realize later that the tool had a better, or at least more natural, way of doing things. So, let's get some experience with Git and the SF Maxima repository and then see how things need to be changed. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From michel.gosse at free.fr Wed Apr 20 03:02:07 2011 From: michel.gosse at free.fr (Gosse michel) Date: Wed, 20 Apr 2011 10:02:07 +0200 Subject: [Maxima] bug in function solve Message-ID: <4DAE92FF.9020202@free.fr> Hello Seems very strange : f(t):=-(%e^2*t-5*%e^2)*%e^(-t/10); f(t):=(-(%e^2*t-5*%e^2))*%e^((-t)/10) solve(f(t)=0,t); (%o2) [t=5,%e^(-(t-20)/10)=0] Best regards From drdieterkaiser at web.de Wed Apr 20 04:08:22 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 20 Apr 2011 11:08:22 +0200 Subject: [Maxima] Announcement: Git conversion In-Reply-To: References: Message-ID: <1303290502.8745.4.camel@dieter> Am Mittwoch, den 20.04.2011, 08:38 +0100 schrieb Leo Butler: > I anticipated that there would be feedback on the layout of the > repository, and since most of us are newbies who view things through > CVS goggles, I didn't want to make drastic changes from the layout > beyond what the conversion produced. As you probably already know, > when learning some new tool/language one often tries to fit it > into a pre-existing mold, only to realize later that the tool had > a better, or at least more natural, way of doing things. > > So, let's get some experience with Git and the SF Maxima repository > and then see how things need to be changed. I try to get some experience with git. I am wondering about the extra commits appearing after I push my commits into the repo origin. This additional commits are named: Merge branch 'refs/heads/master' of ssh://crategus at maxima.git.sourceforge.net/gitroot/maxima/repo Do I something wrong? Dieter Kaiser From drdieterkaiser at web.de Wed Apr 20 04:15:00 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 20 Apr 2011 11:15:00 +0200 Subject: [Maxima] Enlistment of Maxima on ohloh Message-ID: <1303290900.8745.10.camel@dieter> By the way, I have changed the enlistment of the project Maxima on the website http://www.ohloh.net/p/maxima to the new repository. Now, all commits are counted double. Perhaps, this will be corrected automatically in the next days. Dieter Kaiser From O.Kullmann at swansea.ac.uk Wed Apr 20 04:20:46 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Wed, 20 Apr 2011 10:20:46 +0100 Subject: [Maxima] Announcement: Git conversion In-Reply-To: <1303290502.8745.4.camel@dieter> References: <1303290502.8745.4.camel@dieter> Message-ID: <20110420092046.GA25301@cs-wsok.swansea.ac.uk> Merges are extra commits (except when it's a fast-forward, just continuing the history): think about it, it's necessary --- there are two (or more) independent histories, both need to be preserved, and a merge, which is not a fast-forward, changes the final results of all sub-histories which led to it. Oliver > I try to get some experience with git. I am wondering about the extra > commits appearing after I push my commits into the repo origin. This > additional commits are named: > > Merge branch 'refs/heads/master' of > ssh://crategus at maxima.git.sourceforge.net/gitroot/maxima/repo > > Do I something wrong? > > Dieter Kaiser > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu From O.Kullmann at swansea.ac.uk Wed Apr 20 04:33:51 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Wed, 20 Apr 2011 10:33:51 +0100 Subject: [Maxima] Announcement: Git conversion In-Reply-To: References: Message-ID: <20110420093351.GB25301@cs-wsok.swansea.ac.uk> > < I see. Then I recommend that we remove izic, CVSROOT and htdocs from > < the repository. Maybe also maxima-pre59 and maximabook since these are > < also not used anymore. > > Well, the virtue and curse of a repository is that nothing is ever > really deleted from it (btw, htdocs stores all our webpage stuff.) > > If you don't like having these directories in your working copy, then what > you can do is > > git update-index --assume-unchanged [directories] #and maybe files > rm -fr [directories] > > This removes those files from your working copy and ensures that Git > doesn't try to update them. It does not remove them from your > repository. > I guess it's clear but just to mention: Of course one can removes files from a repository, I recommend "git rm file(s)-or-directories", but it stays in the history. Normally this is a good thing, and I don't think that space should be a big isue here. However, if really needed, then one can do "history-surgery", and really remove something (but this should only be done in this initial phase, before the repositories go public). Oliver From willisb at unk.edu Wed Apr 20 05:32:56 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 20 Apr 2011 05:32:56 -0500 Subject: [Maxima] help with ./configure error In-Reply-To: References: <20110419023729.GB19848@gwsc.vic.edu.au> <1303191992.2779.64.camel@pc> , Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > References: <1303290502.8745.4.camel@dieter> <20110420092046.GA25301@cs-wsok.swansea.ac.uk> Message-ID: <1303298650.8745.28.camel@dieter> Am Mittwoch, den 20.04.2011, 10:20 +0100 schrieb Oliver Kullmann: > Merges are extra commits (except when it's a fast-forward, just > continuing the history): think about it, it's necessary --- there > are two (or more) independent histories, both need to be preserved, and a merge, > which is not a fast-forward, changes the final results of all > sub-histories which led to it. Thank your very much for your hint. I have read more about merges and I have learned that there is a difference between a true and a fast-forward merge. I have done several commits, but got the additional commit for a true merge only two times. I think the problem is, that I have not worked on a separate branch, but on a local copy of the repository. Dieter Kaiser From vttoth at vttoth.com Wed Apr 20 07:39:19 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Wed, 20 Apr 2011 08:39:19 -0400 Subject: [Maxima] Using pdiff and itensor together In-Reply-To: References: Message-ID: <024301cbff57$fb3c9400$f1b5bc00$@vttoth.com> I don't think there are any errors in what you're doing. It has to do with how Maxima treats (or doesn't treat) differentiation with respect to a function (as opposed to a symbol) and how that changes when certain packages are loaded. Consider the following example: diff(y,x); diff(f(x),f(x)); diff(f(y),f(x)); depends(y,x)$ diff(y,x); diff(f(x),f(x)); diff(f(y),f(x)); The outputs are 0, 1, 0, dy/dx, 1, df(y)/df(x), which makes sense. Now load pdiff and repeat the above. You get 0, 1, 0, dy/dx, 1, 0. This is probably not correct. Now (in a clean session) load itensor, and repeat the above. You get 0, 1, df(y)/df(x), 0, 1, df(y)/df(x). This is important: in itensor, indexed objects (i.e., tensors) look like functions, and the derivative of an indexed object with respect to the same indexed object will not be zero just because the indices differ! E.g., diff(X([i],[]),X([j],[])) is not 0 but a Kronecker-delta. For this reason, itensor actually redefines diff, to ensure that the diff of a function with respect to the same function (with different arguments) is not automatically simplified to zero. Since in standard Maxima, you aren't supposed to be differentiating with respect to a function in the first place, this is not likely to cause too many problems. However, this behavior seems to be incompatible with what pdiff is doing. If you load both packages and rerun the above script, you again get 0, 1, df(y)/df(x), 0, 1, 0. I suspect that this is closely related to, if it's not the actual cause of the problem you are experiencing. Curiously, correct behavior is restored if we make the indices used in the tensor being differentiated depend on something (not necessarily on any particular symbol that appears in the independent variable). For instance, try load(itensor); load(pdiff); diff(f(X([i],[])),X([j],[])); depends(i,XXX); diff(f(X([i],[])),X([j],[])); So I definitely think there's a bug (or two) lurking in here, I'm not sure if it's in pdiff or itensor or both. I suspect pdiff (because of the first example above) but I may be wrong. Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Derek Thomas Sent: Tuesday, April 19, 2011 9:31 PM To: maxima at math.utexas.edu Subject: [Maxima] Using pdiff and itensor together I'm trying to use pdiff with itensor and I've observed some strange behavior. If I try to differentiate a function of a tensor where the argument and the differential have the same index, pdiff perfoms as expected: load(pdiff); load(itensor); diff(f(X([i],[])),X([i],[])); output> 'kdelta([i],[i])*pderivop(f,1)(X([i],[])) If the indices are different, then this is what I get: diff(f(X([i],[])),X([j],[])); output> 'diff(f(X([i],[])),X([j],[]),1) Any help in resolving my errors or the inconsistent behavior would be greatly appreciated. Thanks, Derek _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From biomates at telefonica.net Wed Apr 20 11:23:26 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 20 Apr 2011 18:23:26 +0200 Subject: [Maxima] asking on maxima plotting data In-Reply-To: References: Message-ID: <1303316606.2834.6.camel@pc> El mi?, 20-04-2011 a las 12:27 +0800, razif razali escribi?: > here what I get so far,by using with_stdout > > > with_stdout ("data4.txt", for x:1 thru 10 do print (x,2.0*x+38.0/x))$ > > > I got several problem here Try this: /* change the function and the step amplitude to whatever fits your needs */ sample : makelist(block([x: 1+ i*0.1], [x, 2.0*x+38.0]), i, 1, 10) $ write_data(sample, "yourfile") $ -- Mario From biomates at telefonica.net Wed Apr 20 12:04:43 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 20 Apr 2011 19:04:43 +0200 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <20110420020947.GC9120@gwsc.vic.edu.au> References: <20110419023729.GB19848@gwsc.vic.edu.au> <1303191992.2779.64.camel@pc> <20110420020947.GC9120@gwsc.vic.edu.au> Message-ID: <1303319083.2834.19.camel@pc> El mi?, 20-04-2011 a las 12:09 +1000, Daniel Dalton escribi?: > > > > There are some plus symbols '+' on these lines. They are tick marks for > > ordinates and abscissas. > > What are these? I've never come across them do I need to be worried > about them? > They help you to allocate points on the plane, they mark the coordinates on the axes. > How can I figure out what + signs are part of the curve without getting > confused with the other individual + signs? > Hard to know; see the plot below. Gnuplot makes use of different symbols to draw only one object. For example, the plus symbol in the vertices of the rectangle. > Taking this concept slightly further, does this mean in theory I could > convert other images (diagrams for example), to ascii? > Judge for yourself: load(draw) $ set_draw_defaults (user_preamble="set terminal dumb")$ draw2d( xrange = [0, 15], yrange = [-5, 10], triangle([1, -3],[2, 4],[5, 2]), rectangle([4, 6], [9, 8]), polygon([[6,-3], [6,5], [14,2], [14,0]]), label(["Triangle",3,2.5], ["Rectangle",6,7], ["Trapezium",10,2]) ) $ Hope this helps. -- Mario From biomates at telefonica.net Wed Apr 20 12:13:06 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 20 Apr 2011 19:13:06 +0200 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <20110420020947.GC9120@gwsc.vic.edu.au> References: <20110419023729.GB19848@gwsc.vic.edu.au> <1303191992.2779.64.camel@pc> <20110420020947.GC9120@gwsc.vic.edu.au> Message-ID: <1303319586.2834.24.camel@pc> El mi?, 20-04-2011 a las 12:09 +1000, Daniel Dalton escribi?: > Yes, I don't get any output either. Unless the output is being > redirected somewhere else? Sorry, I forgot to respond this one. Yes, as someone pointed out, the output is sent to a file in the working directory. > > Thanks for your help, > Glad to help. > Dan -- Mario From hbaker1 at pipeline.com Wed Apr 20 12:32:30 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Wed, 20 Apr 2011 10:32:30 -0700 Subject: [Maxima] 64-bit Maxima/Lisp ?? Message-ID: Is there a true 64-bit Common Lisp implementation today? Is there a 64-bit Maxima that runs on it? Also, I have a 3-core CPU. Does Lisp and/or Maxima take advantage of any of this processing power today? Thx for any info. From woollett at charter.net Wed Apr 20 13:53:55 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 20 Apr 2011 11:53:55 -0700 Subject: [Maxima] how to do simple loop in maxima and save the result in a file? Message-ID: <5A57A7A5AAF849B0B17478C51353414E@edwinc367e16bd> On April 20, 2011, RAZIF RAZALI wrote: ============================== ................. delt=0.001; fout = fopen( "test1.dat", "w"); for (x=0.4; x<1; x=x+delt){ p=(1-x)/(1+x); printf ("%f %f\n",p,x); fprintf(fout, "%f %f\n",p,x); ................ how can I do similar loop program in Maxima and save the result in a new file like 'test1.dat'? =============================== Experiment with write_data and printfile. As a simple first step, (%i3) (dataL:[], for x thru 5 do ( px : subst (x,z,(1-z)/(1+z)), dataL : cons ([x,px],dataL)), dataL : reverse (dataL), write_data (dataL,"mydata1.dat"))$ (%i4) printfile ("mydata1.dat")$ 1 0 2 -1/3 3 -1/2 4 -3/5 5 -2/3 note that write_data creates the file if the file does not already exist and overwrites previous file contents if the file already exists. I use windows, and my default app for *.dat is Notepad, which expects CR,LF line endings. Maxima writes with LF line endings, so Notepad will show the single line 1 02 -1/33 -1/24 -3/55 -2/3 To see the expected double column data file you should use Notepad2 (free). To deal with your case, you should include while, as in this simple example: (%i8) (dataL:[], for x: 0.1 step 0.1 while x < 1 do ( px : subst (x,z,(1-z)/(1+z)), dataL : cons ([x,px],dataL)), dataL : reverse (dataL), write_data (dataL,"mydata2.dat"))$ (%i9) printfile("mydata2.dat")$ 0.1 0.81818181818182 0.2 0.66666666666667 0.3 0.53846153846154 0.4 0.42857142857143 0.5 0.33333333333333 0.6 0.25 0.7 0.17647058823529 0.8 0.11111111111111 0.9 0.052631578947368 1.0 5.5511151231257827E-17 In Chapter 2 of Maxima by Example, I show how to import file data into a list inside Maxima, and use it for fits and plots. In light of your query, I should probably add a section related to writing data to a file. Best Wishes, Ted Woollett http://www.csulb.edu/~woollett From A.G.Grozin at inp.nsk.su Wed Apr 20 14:41:28 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Thu, 21 Apr 2011 02:41:28 +0700 (NOVST) Subject: [Maxima] 64-bit Maxima/Lisp ?? In-Reply-To: References: Message-ID: On Wed, 20 Apr 2011, Henry Baker wrote: > Is there a true 64-bit Common Lisp implementation today? Is there a > 64-bit Maxima that runs on it? Yes, 64-bit sbcl. It compiles maxima fine (tested on 64-bit SUSE, works OK). > Also, I have a 3-core CPU. Does Lisp and/or Maxima take advantage of > any of this processing power today? No. Computer-algebra algorithms are difficult to parallelize. Nobody has done this in maxima. Andrey From cloos at jhcloos.com Wed Apr 20 15:24:34 2011 From: cloos at jhcloos.com (James Cloos) Date: Wed, 20 Apr 2011 16:24:34 -0400 Subject: [Maxima] Announcement: Git conversion In-Reply-To: (Andrej Vodopivec's message of "Wed, 20 Apr 2011 07:21:29 +0200") References: Message-ID: [I picked a semi-random mesage in the thread to reply to... -JimC] The easiest way to split to repository into separate repos for maxima, htdocs, et al would be to use fast-export to create a dump of the repo, filter that into separate dumps as desired, and then use fast-import on each of the separated dumps to create new repos. SF supports multiple git repos under the projects git dir, so all of those repos can be put in place under /gitroot/maxima/. And it would be better for the main repo's uri to be /gitroot/maxima/maxima or /gitroot/maxima/maxima.git so that na?ve clones create dir named maxima. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From daniel.dalton47 at gmail.com Wed Apr 20 18:08:46 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Thu, 21 Apr 2011 09:08:46 +1000 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: References: <20110419023729.GB19848@gwsc.vic.edu.au> <1303191992.2779.64.camel@pc> Message-ID: <20110420230846.GB5117@gwsc.vic.edu.au> On Tue, Apr 19, 2011 at 07:48:11PM -0400, James Cloos wrote: > MR> should work, but I don't get anything. Perhaps someone else can help > MR> us with the code. > > When I try that I get a file called maxplot.dumb in the home directory > with the output of the plot. (I got $ marks for the curve. When I use Thanks, that explains it - and the graph produced seems to be a bit cleaner than that from draw:) Thanks, Dan From daniel.dalton47 at gmail.com Wed Apr 20 18:23:05 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Thu, 21 Apr 2011 09:23:05 +1000 Subject: [Maxima] Using maxima for high school mathematics In-Reply-To: <1303319083.2834.19.camel@pc> References: <20110419023729.GB19848@gwsc.vic.edu.au> <1303191992.2779.64.camel@pc> <20110420020947.GC9120@gwsc.vic.edu.au> <1303319083.2834.19.camel@pc> Message-ID: <20110420232305.GA7126@gwsc.vic.edu.au> On Wed, Apr 20, 2011 at 07:04:43PM +0200, Mario Rodriguez wrote: > > What are these? I've never come across them do I need to be worried > > about them? > > > > They help you to allocate points on the plane, they mark the coordinates > on the axes. Ah, ok. > > How can I figure out what + signs are part of the curve without getting > > confused with the other individual + signs? > > > > Hard to know; see the plot below. Gnuplot makes use of different symbols > to draw only one object. For example, the plus symbol in the vertices of > the rectangle. Yep, especially that produced by plot2d is much easier to understand. > > Taking this concept slightly further, does this mean in theory I could > > convert other images (diagrams for example), to ascii? > > > > Judge for yourself: > > > load(draw) $ > set_draw_defaults (user_preamble="set terminal dumb")$ > > draw2d( > xrange = [0, 15], > yrange = [-5, 10], > > triangle([1, -3],[2, 4],[5, 2]), > rectangle([4, 6], [9, 8]), Interesting, will have to play with this a bit more, but looks promising. I'm sure it'd be 100% usable when embossed in Braille onto paper, but with a one line Braille display, takes a bit of getting used to the shapes. The graphs especially are fantastic, thanks very much for your help! This hopefully solves the main problem I was having accessing the CAS:) Cheers, Dan From robert.dodier at gmail.com Wed Apr 20 18:24:49 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 20 Apr 2011 17:24:49 -0600 Subject: [Maxima] Announcement: Git conversion In-Reply-To: References: Message-ID: There is definitely some fossilized stuff in the repo which we can just give the axe. htdocs is the web stuff, so it needs to remain active, although we can consider moving it into its own repo. But izic, maxima-pre59, maybe others, can be simply nuked. (I expect that they will remain in the repo history; that's all well and good.) best, Robert Dodier On 4/20/11, James Cloos wrote: > [I picked a semi-random mesage in the thread to reply to... -JimC] > > The easiest way to split to repository into separate repos for maxima, > htdocs, et al would be to use fast-export to create a dump of the repo, > filter that into separate dumps as desired, and then use fast-import on > each of the separated dumps to create new repos. > > SF supports multiple git repos under the projects git dir, so all of > those repos can be put in place under /gitroot/maxima/. > > And it would be better for the main repo's uri to be /gitroot/maxima/maxima > or /gitroot/maxima/maxima.git so that na?ve clones create dir named maxima. > > -JimC > -- > James Cloos OpenPGP: 1024D/ED7DAEA6 > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From benoit.maisonneuve at uqconnect.edu.au Wed Apr 20 20:04:02 2011 From: benoit.maisonneuve at uqconnect.edu.au (=?utf-8?b?YmVub2l0Lm1haXNvbm5ldXZlQHVxY29ubmVjdC5lZHUuYXU=?=) Date: Thu, 21 Apr 2011 01:04:02 +0000 (UTC) Subject: [Maxima] Other way to a not supported inverse laplace transform with maxima? References: <4BBA6EF3.2040704@math.msu.edu> Message-ID: Hi, I also have to do calculation with the Laplace transform involving the heaviside function. Is it possible to have your code for the lap and ilap functions please? That would be very useful... Thanks a lot. Ben From biomates at telefonica.net Thu Apr 21 03:08:17 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 21 Apr 2011 10:08:17 +0200 Subject: [Maxima] Announcement: Git conversion In-Reply-To: References: Message-ID: <1303373297.1583.6.camel@trasno> El mi?, 20-04-2011 a las 17:24 -0600, Robert Dodier escribi?: > There is definitely some fossilized stuff in the repo which we can > just give the axe. htdocs is the web stuff, What we have to preserve is site-xml, htdocs is the old html version. -- Mario From andrej.vodopivec at gmail.com Thu Apr 21 05:16:15 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Thu, 21 Apr 2011 12:16:15 +0200 Subject: [Maxima] git layout Message-ID: I think it would be better if we had separate repositories for the source code, webpage and other things we want to preserve from cvs. Now that everything is in git, we can use git to make this change. So I suggest that we leave the repo repository as it is now. We can create a repository which contains only the source code with git filter-branch --subdirectory-filter maxima -- --all and put that to the maxima repository. This also makes the generic sourceforge instructions for git correct for the main repository (http://sourceforge.net/scm/?type=git&group_id=4933). Similarly for the website git filter-branch --subdirectory-filter site-xml -- --all and push that to the site-xml repository. Andrej From toy.raymond at gmail.com Thu Apr 21 08:10:07 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 21 Apr 2011 09:10:07 -0400 Subject: [Maxima] Announcement: Git conversion In-Reply-To: References: Message-ID: <4DB02CAF.9090807@gmail.com> On 4/20/11 7:24 PM, Robert Dodier wrote: > There is definitely some fossilized stuff in the repo which we can > just give the axe. htdocs is the web stuff, so it needs to remain active, > although we can consider moving it into its own repo. > But izic, maxima-pre59, maybe others, can be simply nuked. > (I expect that they will remain in the repo history; that's > all well and good.) If they're still in the repo, won't they still be downloaded locally when you clone the repo? Not so nice for people who are on a slow link. I guess they're not big, but still.... Ray From toy.raymond at gmail.com Thu Apr 21 08:11:34 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 21 Apr 2011 09:11:34 -0400 Subject: [Maxima] git layout In-Reply-To: References: Message-ID: <4DB02D06.1000900@gmail.com> On 4/21/11 6:16 AM, Andrej Vodopivec wrote: > I think it would be better if we had separate repositories for the > source code, webpage and other things we want to preserve from cvs. > Now that everything is in git, we can use git to make this change. I would prefer that as well. (izic did some pretty nice graphs, way back when.) Ray From l.butler at ed.ac.uk Thu Apr 21 09:05:37 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 21 Apr 2011 15:05:37 +0100 (BST) Subject: [Maxima] git layout In-Reply-To: References: Message-ID: On Thu, 21 Apr 2011, Andrej Vodopivec wrote: < I think it would be better if we had separate repositories for the < source code, webpage and other things we want to preserve from cvs. Why? I have yet to hear what would be better about splitting the repository into pieces. These things were in a single cvs repository as modules, not in separate repositories. < Now that everything is in git, we can use git to make this change. < < So I suggest that we leave the repo repository as it is now. We can < create a repository which contains only the source code with < < git filter-branch --subdirectory-filter maxima -- --all < < and put that to the maxima repository. This also makes the generic < sourceforge instructions for git correct for the main repository < (http://sourceforge.net/scm/?type=git&group_id=4933). Similarly for < the website < < git filter-branch --subdirectory-filter site-xml -- --all < < and push that to the site-xml repository. I think that it makes sense to maintain the unity of the repository. That is how things were under CVS and I fail to see/have not heard a compelling reason for changing this arrangement under Git. Robert suggested that the historic modules be cut off master. This seems sensible to me; we can create a separate branch containing only those modules. I don't think it is so sensible to separate the webpage and development code, since changes in the latter are often followed by changes in the former. It is easier to cut things apart than stitch them back again. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From l.butler at ed.ac.uk Thu Apr 21 09:40:16 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 21 Apr 2011 15:40:16 +0100 (BST) Subject: [Maxima] Announcement: Git conversion In-Reply-To: <4DB02CAF.9090807@gmail.com> References: <4DB02CAF.9090807@gmail.com> Message-ID: On Thu, 21 Apr 2011, Raymond Toy wrote: < On 4/20/11 7:24 PM, Robert Dodier wrote: < > There is definitely some fossilized stuff in the repo which we can < > just give the axe. htdocs is the web stuff, so it needs to remain active, < > although we can consider moving it into its own repo. < > But izic, maxima-pre59, maybe others, can be simply nuked. < > (I expect that they will remain in the repo history; that's < > all well and good.) < < If they're still in the repo, won't they still be downloaded locally < when you clone the repo? Not so nice for people who are on a slow < link. I guess they're not big, but still.... For comparison, I filtered the maxima directory into a separate Git repo, as Andrej suggested. I was surprised to find that it occupies 175M versus 195M for my clone of 'repo'. 'repo' on SF takes up 80M, which I think by modern standards is a smallish download. I don't see the point of slicing and dicing to save a few megs. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From andrej.vodopivec at gmail.com Thu Apr 21 13:09:43 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Thu, 21 Apr 2011 20:09:43 +0200 Subject: [Maxima] git layout In-Reply-To: References: Message-ID: There of course is a huge difference between modules in a cvs repository and subdirectories in a git repository. You only check out modules which you wish to follow from a cvs repository but you are forced to clone all subdirectories in a git repository. The history is not shared between cvs modules, changes to the webpage did not cause my copy of sources to become outdated. I think that changes to the webpage should not show up when you browse the history of maxima sources. Separate things should go into separate repositories. Also, when people browse the project pages at sourceforge and see the instructions on how to clone our repository, these instructions are not correct. I think the only way to correct this is that we use the standard layout for git repositories on sourceforge. Andrej On Thu, Apr 21, 2011 at 4:05 PM, Leo Butler wrote: > > > On Thu, 21 Apr 2011, Andrej Vodopivec wrote: > > < I think it would be better if we had separate repositories for the > < source code, webpage and other things we want to preserve from cvs. > > Why? > > I have yet to hear what would be better about splitting the repository > into pieces. These things were in a single cvs repository as modules, not in > separate repositories. > > < Now that everything is in git, we can use git to make this change. > < > < So I suggest that we leave the repo repository as it is now. We can > < create a repository which contains only the source code with > < > < ? git filter-branch --subdirectory-filter maxima -- --all > < > < and put that to the maxima repository. This also makes the generic > < sourceforge instructions for git correct for the main repository > < (http://sourceforge.net/scm/?type=git&group_id=4933). Similarly for > < the website > < > < ? git filter-branch --subdirectory-filter site-xml -- --all > < > < and push that to the site-xml repository. > > ?I think that it makes sense to maintain the unity of the repository. > ?That is how things were under CVS and I fail to see/have not heard > ?a compelling reason for changing this arrangement under Git. > > ?Robert suggested that the historic modules be cut off master. This > ?seems sensible to me; we can create a separate branch containing only > ?those modules. I don't think it is so sensible to separate the > ?webpage and development code, since changes in the latter are often > ?followed by changes in the former. It is easier to cut things apart > ?than stitch them back again. > > ?Leo > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > From robert.dodier at gmail.com Thu Apr 21 14:40:29 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 21 Apr 2011 13:40:29 -0600 Subject: [Maxima] git layout In-Reply-To: References: Message-ID: For the record, & for what it's worth, I agree w/ Andrej about the layout of the repo. best Robert Dodier On 4/21/11, Andrej Vodopivec wrote: > There of course is a huge difference between modules in a cvs > repository and subdirectories in a git repository. You only check out > modules which you wish to follow from a cvs repository but you are > forced to clone all subdirectories in a git repository. The history is > not shared between cvs modules, changes to the webpage did not cause > my copy of sources to become outdated. I think that changes to the > webpage should not show up when you browse the history of maxima > sources. Separate things should go into separate repositories. > > Also, when people browse the project pages at sourceforge and see the > instructions on how to clone our repository, these instructions are > not correct. I think the only way to correct this is that we use the > standard layout for git repositories on sourceforge. > > Andrej > > > > On Thu, Apr 21, 2011 at 4:05 PM, Leo Butler wrote: >> >> >> On Thu, 21 Apr 2011, Andrej Vodopivec wrote: >> >> < I think it would be better if we had separate repositories for the >> < source code, webpage and other things we want to preserve from cvs. >> >> Why? >> >> I have yet to hear what would be better about splitting the repository >> into pieces. These things were in a single cvs repository as modules, not >> in >> separate repositories. >> >> < Now that everything is in git, we can use git to make this change. >> < >> < So I suggest that we leave the repo repository as it is now. We can >> < create a repository which contains only the source code with >> < >> < ? git filter-branch --subdirectory-filter maxima -- --all >> < >> < and put that to the maxima repository. This also makes the generic >> < sourceforge instructions for git correct for the main repository >> < (http://sourceforge.net/scm/?type=git&group_id=4933). Similarly for >> < the website >> < >> < ? git filter-branch --subdirectory-filter site-xml -- --all >> < >> < and push that to the site-xml repository. >> >> ?I think that it makes sense to maintain the unity of the repository. >> ?That is how things were under CVS and I fail to see/have not heard >> ?a compelling reason for changing this arrangement under Git. >> >> ?Robert suggested that the historic modules be cut off master. This >> ?seems sensible to me; we can create a separate branch containing only >> ?those modules. I don't think it is so sensible to separate the >> ?webpage and development code, since changes in the latter are often >> ?followed by changes in the former. It is easier to cut things apart >> ?than stitch them back again. >> >> ?Leo >> >> -- >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From mhw at netris.org Thu Apr 21 17:38:57 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 21 Apr 2011 18:38:57 -0400 Subject: [Maxima] Other way to a not supported inverse laplace transform with maxima? In-Reply-To: (benoit's message of "Thu, 21 Apr 2011 01:04:02 +0000 (UTC)") References: <4BBA6EF3.2040704@math.msu.edu> Message-ID: <874o5r1b7i.fsf@netris.org> writes: > I also have to do calculation with the Laplace transform involving the heaviside > function. > Is it possible to have your code for the lap and ilap functions please? That > would be very useful... I have attached a version of my preliminary patches, updated to work with current Maxima (5.24.0). Note that the patch to laplac.lisp will require recompilation of the Maxima executable. The Heaviside step function is named hstep(t), and you should load(hstep) if you wish to manipulate such expressions. hstep(0)=1/2. The included patch enhances laplace(EXPR,t,s) to handle hstep and unit_step. However, to perform inverse laplace transforms involving piecewise functions, you should load(pwilt) and use the new function pwilt(EXPR,s,t) which is an improved version of ilt(EXPR,s,t). (%i2) load(pwilt)$ (%i3) laplace((t-2)^2*hstep(t-2),t,s), ratsimp; (%o3) 2*%e^-(2*s)/s^3 (%i4) pwilt(exp(-a*s)/s,s,t); (%o4) hstep(t-a) (%i5) pwilt(%e^-s*(s*%e^s-s^2-2*s-2)/s^3, s,t), ratsimp; (%o5) t-t^2*hstep(t-1) It is also designed to handle periodic functions (though currently it fails to detect this in some cases): (%i6) assume(a>0); (%o6) [a > 0] (%i7) pwilt(1/(s*(1-%e^-(2*a*s)))-%e^-(a*s)/(s*(1-%e^-(2*a*s))), s,t); (%o7) 'sum(hstep(t-2*%k*a)-hstep(t-2*%k*a-a),%k,0,inf) The patch modifies desolve to use pwilt instead of ilt. It also enhances abs_integrate.mac to support hstep functions. Note that this is a work in progress. I wouldn't be surprised if there are bugs. Good luck! Best, Mark From mhw at netris.org Thu Apr 21 17:46:35 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 21 Apr 2011 18:46:35 -0400 Subject: [Maxima] Other way to a not supported inverse laplace transform with maxima? In-Reply-To: <874o5r1b7i.fsf@netris.org> (Mark H. Weaver's message of "Thu, 21 Apr 2011 18:38:57 -0400") References: <4BBA6EF3.2040704@math.msu.edu> <874o5r1b7i.fsf@netris.org> Message-ID: <87wrinz0hg.fsf@netris.org> I wrote: > I have attached a version of my preliminary patches, updated to work > with current Maxima (5.24.0). Note that the patch to laplac.lisp will > require recompilation of the Maxima executable. > [...] > > Note that this is a work in progress. I wouldn't be surprised if there > are bugs. Good luck! Oops, I forgot to include the patch itself. Here it is. Best, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: laplace-hstep.patch Type: text/x-diff Size: 20211 bytes Desc: Preliminary patch for piecewise laplace transforms URL: From razif66 at gmail.com Thu Apr 21 22:04:11 2011 From: razif66 at gmail.com (razif razali) Date: Fri, 22 Apr 2011 11:04:11 +0800 Subject: [Maxima] Other way to a not supported inverse laplace transform with maxima? In-Reply-To: <87wrinz0hg.fsf@netris.org> References: <4BBA6EF3.2040704@math.msu.edu> <874o5r1b7i.fsf@netris.org> <87wrinz0hg.fsf@netris.org> Message-ID: I have tried this patch. what i got is, patch for sharefiles.mk not loaded into Makefile under '/maxima/5.24.0/share' folder after we type make in maxima folder. i'm not really good in maxima, so what i done is, i invoke ./configure in maxima folder, then I open Makefile under /share folder. I copy line in sharefiles.mk's patch file into /share/Makefile then in maxima folder i give 'make' and 'sudo make install' command. to load the pwilt, type load(desoln) in maxima program and for hstep type load(pdvtr). hope helpful On Fri, Apr 22, 2011 at 6:46 AM, Mark H Weaver wrote: > I wrote: > > I have attached a version of my preliminary patches, updated to work > > with current Maxima (5.24.0). Note that the patch to laplac.lisp will > > require recompilation of the Maxima executable. > > > [...] > > > > Note that this is a work in progress. I wouldn't be surprised if there > > are bugs. Good luck! > > Oops, I forgot to include the patch itself. Here it is. > > Best, > Mark > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Thu Apr 21 22:27:00 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 21 Apr 2011 20:27:00 -0700 Subject: [Maxima] Other way to a not supported inverse laplace transform with maxima? In-Reply-To: <874o5r1b7i.fsf@netris.org> References: <4BBA6EF3.2040704@math.msu.edu> <874o5r1b7i.fsf@netris.org> Message-ID: <4DB0F584.1010001@eecs.berkeley.edu> On 4/21/2011 3:38 PM, Mark H Weaver wrote: > writes: >> I also have to do calculation with the Laplace transform involving the heaviside >> function. >> Is it possible to have your code for the lap and ilap functions please? That >> would be very useful... > I have attached a version of my preliminary patches, updated to work > with current Maxima (5.24.0). Note that the patch to laplac.lisp will > require recompilation of the Maxima executable. If you have written a source file called foo.lisp that you wish to use to change Maxima, all you need to do is load("foo.lisp"). You do not need to recompile maxima. If you have a "diff" file you need another step to create the source file, I suppose. You can compile "foo.lisp", but that is probably not necessary. You can also set things up so that foo.lisp is automatically loaded when you start up maxima. From mhw at netris.org Fri Apr 22 00:46:47 2011 From: mhw at netris.org (Mark H Weaver) Date: Fri, 22 Apr 2011 01:46:47 -0400 Subject: [Maxima] Other way to a not supported inverse laplace transform with maxima? In-Reply-To: <4DB0F584.1010001@eecs.berkeley.edu> (Richard Fateman's message of "Thu, 21 Apr 2011 20:27:00 -0700") References: <4BBA6EF3.2040704@math.msu.edu> <874o5r1b7i.fsf@netris.org> <4DB0F584.1010001@eecs.berkeley.edu> Message-ID: <87ei4uzvlk.fsf@netris.org> Richard Fateman writes: >> I have attached a version of my preliminary patches, updated to work >> with current Maxima (5.24.0). Note that the patch to laplac.lisp will >> require recompilation of the Maxima executable. > > If you have written a source file called foo.lisp that you wish to > use to change Maxima, > all you need to do is load("foo.lisp"). > > You do not need to recompile maxima. This was my expectation as well, but if I load("laplac.lisp"), even the unmodified version of it, this breaks $LAPLACE. Henceforth, any attempt to use it results in the following error: Error in COND [or a callee]: The variable PARM is unbound. PARM is a formal parameter of $LAPLACE, which calls LAPLACE. LAPLACE references PARM, and this only works if PARM is a special variable. This suggests that the (DECLARE-TOP (SPECIAL ... PARM ...)) form at the top of maxima/src/laplac.lisp fails when the file is loaded, but works properly when the file is compiled into the executable. I'm using GCL 2.6.7. I suppose there's a bug in DECLARE-TOP, but I haven't had time to look into it. I've been using Scheme for many years, but am new to Common Lisp. Thanks, Mark From l.butler at ed.ac.uk Fri Apr 22 01:28:33 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 22 Apr 2011 07:28:33 +0100 (BST) Subject: [Maxima] Announcement: Git conversion (Part 2) Message-ID: Hello, In light of discussions, in order to make the Git repository look like CVS I have split 'repo' into separate Git repositories, corresponding to the old CVS modules. These are: htdocs izic maxima maximabook maxima-pre59 site-xml Because of the split, tags will no longer be propagated across the modules, as under CVS. Also, the split is irreversible, as these are now fully fledged repos. For the moment, 'repo' is online. I do not have admin rights to make it read-only, so I will only remind you that you should not push to it. It will be taken down in due course. ---- Let me say one last time: Git is not CVS. There are two ways to learn this fact. The remainder of this message is similar to that posted earlier. Leo Browse the repository: ====================== Go to http://maxima.git.sourceforge.net/git/gitweb-index.cgi and select a repository. To clone the repository MODULE: =============================== read-only: git clone git://maxima.git.sourceforge.net/gitroot/maxima/MODULE developer (read/write): git clone ssh://USERNAME at maxima.git.sourceforge.net/gitroot/maxima/MODULE To see what you have: ===================== git branch # show your local branches git branch -r # show the remote branches git tag -l # see the tags To work on your repository: =========================== git checkout -b scratch-pad # create a throw-away branch to work in # do some work on existing files, then git commit -a -m 'My first commit' # in your own repository [D] To commit your changes to the SF repository: ================================================ git checkout master git pull # update master branch with any changes from SF git merge scratch-pad # merge your scratch-pad onto master git push origin master # push the changes to SF Additional Git resources: ========================= -http://maxima.sourceforge.net/git-cheat-sheet/ -http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html -http://git-scm.com/documentation -http://www.kernel.org/pub/software/scm/git/docs/user-manual.html [D] Things that remain to be done: ================================== -test and set up the commit hook correctly (in repo/hooks/post-receive) -redirect https://sourceforge.net/scm/?type=cvs&group_id=4933 to https://sourceforge.net/scm/?type=git&group_id=4933 -update pages like http://maxima.sourceforge.net/download.html Cheers, Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From cfrangos at telkomsa.net Fri Apr 22 11:42:40 2011 From: cfrangos at telkomsa.net (Constantine Frangos) Date: Fri, 22 Apr 2011 18:42:40 +0200 Subject: [Maxima] Maxima: Plotting error with plot2d(). Message-ID: <201104221842.40384.cfrangos@telkomsa.net> I am getting the error message below with the plot2d() command. Any assistance on what to do would be much appreciated. I am using Maxima 5.19 (32 bit) running under suse linux enterprise desktop 11 sp1 (sled11sp1) on a 64 bit x86 machine: Maxima 5.19.2 http://maxima.sourceforge.net Using Lisp CMU Common Lisp 19d (19D) 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) I recently installed gnuplot (64 bit) on the sled11 machine using: gnuplot-4.2.3-5.34.x86_64.rpm (I first tried installing gnuplot-4.2.3-5.34.i586.rpm (32 bit) but there were error messages indicating missing libraries/files/etc). (The other commands in maxima 5.19 seem to run ok on this machine) Thanks very much. Constantine Frangos. (%i5) plot2d (sin(x), [x, -5, 5]); Maxima encountered a Lisp error: Error in function UNIX::SIGSEGV-HANDLER: Segmentation Violation at #x0. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. (%i6) Maxima encountered a Lisp error: Error in function UNIX::SIGPIPE-HANDLER: SIGPIPE at #xFFFFE430. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. (%i6) From drdieterkaiser at web.de Fri Apr 22 08:20:31 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 22 Apr 2011 15:20:31 +0200 Subject: [Maxima] Announcement: Git conversion (Part 2) In-Reply-To: References: Message-ID: <1303478431.1641.9.camel@dieter> Am Freitag, den 22.04.2011, 07:28 +0100 schrieb Leo Butler: > Hello, > > In light of discussions, in order to make the Git repository > look like CVS I have split 'repo' into separate Git repositories, > corresponding to the old CVS modules. These are: > > htdocs izic maxima maximabook maxima-pre59 site-xml > > Because of the split, tags will no longer be propagated across > the modules, as under CVS. Also, the split is irreversible, > as these are now fully fledged repos. > > For the moment, 'repo' is online. I do not have admin rights to make > it read-only, so I will only remind you that you should not push > to it. It will be taken down in due course. > > ---- > Let me say one last time: Git is not CVS. There are two ways to > learn this fact. > > The remainder of this message is similar to that posted earlier. > > Leo > > > Browse the repository: > ====================== > > Go to > http://maxima.git.sourceforge.net/git/gitweb-index.cgi > and select a repository. > > To clone the repository MODULE: > =============================== > > read-only: > git clone git://maxima.git.sourceforge.net/gitroot/maxima/MODULE > > developer (read/write): > git clone > ssh://USERNAME at maxima.git.sourceforge.net/gitroot/maxima/MODULE > > > To see what you have: > ===================== > > git branch # show your local branches > git branch -r # show the remote branches > git tag -l # see the tags > > To work on your repository: > =========================== > > git checkout -b scratch-pad # create a throw-away branch to work in > # do some work on existing files, then > git commit -a -m 'My first commit' # in your own repository > > [D] To commit your changes to the SF repository: > ================================================ > > git checkout master > git pull # update master branch with any changes from SF > git merge scratch-pad # merge your scratch-pad onto master > git push origin master # push the changes to SF I have checked out the new repository maxima and I have tried to prepare carefully a new commit to the repository. I have created a local branch 'workspace' and then a second local branch 'msize' to work on the function MSIZE. I have merged the changes into 'workspace' to check if I get the expected result. In a second step I have fetched the changes from 'orgin' and I merged the changes into the branch 'master'. At last I have pushed my changes upstream. Now, I see that my local branches 'workspace' and 'msize' appear on sourceforge.net, too. Is there something wrong in my approach. I have not expected to see my local branches in the repository. Dieter Kaiser From andrej.vodopivec at gmail.com Fri Apr 22 08:53:11 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Fri, 22 Apr 2011 15:53:11 +0200 Subject: [Maxima] Announcement: Git conversion (Part 2) In-Reply-To: <1303478431.1641.9.camel@dieter> References: <1303478431.1641.9.camel@dieter> Message-ID: On Fri, Apr 22, 2011 at 3:20 PM, Dieter Kaiser wrote: > I have checked out the new repository maxima and I have tried to prepare > carefully a new commit to the repository. > > I have created a local branch 'workspace' and then a second local branch > 'msize' to work on the function MSIZE. I have merged the changes into > 'workspace' to check if I get the expected result. In a second step I > have fetched the changes from 'orgin' and I merged the changes into the > branch 'master'. At last I have pushed my changes upstream. > > Now, I see that my local branches 'workspace' and 'msize' appear on > sourceforge.net, too. Is there something wrong in my approach. I have > not expected to see my local branches in the repository. I usually specify which branches should be pushed to the remote repository. To push the master branch execute git push origin master If you wish to delete the msize branch from the sourceforge repository execute git push origin :msize HTH, Andrej From drdieterkaiser at web.de Fri Apr 22 09:31:17 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 22 Apr 2011 16:31:17 +0200 Subject: [Maxima] Announcement: Git conversion (Part 2) In-Reply-To: References: <1303478431.1641.9.camel@dieter> Message-ID: <1303482677.1641.16.camel@dieter> Am Freitag, den 22.04.2011, 15:53 +0200 schrieb Andrej Vodopivec: > On Fri, Apr 22, 2011 at 3:20 PM, Dieter Kaiser wrote: > > I have checked out the new repository maxima and I have tried to prepare > > carefully a new commit to the repository. > > > > I have created a local branch 'workspace' and then a second local branch > > 'msize' to work on the function MSIZE. I have merged the changes into > > 'workspace' to check if I get the expected result. In a second step I > > have fetched the changes from 'orgin' and I merged the changes into the > > branch 'master'. At last I have pushed my changes upstream. > > > > Now, I see that my local branches 'workspace' and 'msize' appear on > > sourceforge.net, too. Is there something wrong in my approach. I have > > not expected to see my local branches in the repository. > > I usually specify which branches should be pushed to the remote > repository. To push the master branch execute > > git push origin master > > If you wish to delete the msize branch from the sourceforge repository execute > > git push origin :msize > > HTH, Andrej Thank you very much for your help. I have removed the branches 'workspace' and 'msize'. By the way I am not used to work with branches, but it seems to me very elegant and comfortable to do the changes in different branches. I think the problem is, that I use the plugin Egit with Eclipse. It is a very comfortable tool, but because I do not know Git very well, I have problems to find all the default settings which affect the behavior. Dieter Kaiser From l.butler at ed.ac.uk Fri Apr 22 09:46:56 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 22 Apr 2011 15:46:56 +0100 (BST) Subject: [Maxima] Announcement: Git conversion (Part 2) In-Reply-To: <1303482677.1641.16.camel@dieter> References: <1303478431.1641.9.camel@dieter> <1303482677.1641.16.camel@dieter> Message-ID: On Fri, 22 Apr 2011, Dieter Kaiser wrote: < Am Freitag, den 22.04.2011, 15:53 +0200 schrieb Andrej Vodopivec: < > On Fri, Apr 22, 2011 at 3:20 PM, Dieter Kaiser wrote: < > > I have checked out the new repository maxima and I have tried to prepare < > > carefully a new commit to the repository. < > > < > > I have created a local branch 'workspace' and then a second local branch < > > 'msize' to work on the function MSIZE. I have merged the changes into < > > 'workspace' to check if I get the expected result. In a second step I < > > have fetched the changes from 'orgin' and I merged the changes into the < > > branch 'master'. At last I have pushed my changes upstream. < > > < > > Now, I see that my local branches 'workspace' and 'msize' appear on < > > sourceforge.net, too. Is there something wrong in my approach. I have < > > not expected to see my local branches in the repository. < > < > I usually specify which branches should be pushed to the remote < > repository. To push the master branch execute < > < > git push origin master < > < > If you wish to delete the msize branch from the sourceforge repository execute < > < > git push origin :msize < > < > HTH, Andrej < < Thank you very much for your help. I have removed the branches < 'workspace' and 'msize'. By the way I am not used to work with branches, < but it seems to me very elegant and comfortable to do the changes in < different branches. < < I think the problem is, that I use the plugin Egit with Eclipse. It is a < very comfortable tool, but because I do not know Git very well, I have < problems to find all the default settings which affect the behavior. Dieter, when you pushed your commits, did you see any error message from the SF Git server concerning the hook script hook/post-receive? The script doesn't seem to have fired. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From drdieterkaiser at web.de Fri Apr 22 10:00:17 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 22 Apr 2011 17:00:17 +0200 Subject: [Maxima] Announcement: Git conversion (Part 2) In-Reply-To: References: <1303478431.1641.9.camel@dieter> <1303482677.1641.16.camel@dieter> Message-ID: <1303484418.1641.21.camel@dieter> Am Freitag, den 22.04.2011, 15:46 +0100 schrieb Leo Butler: > Dieter, when you pushed your commits, did you see any error message > from the SF Git server concerning the hook script hook/post-receive? > The script doesn't seem to have fired. Yes, I have seen an error message from the SF Git server concerning the hook script hook/post-receive. Unfortunately, I have not stored the message. Dieter Kaiser From robert.dodier at gmail.com Fri Apr 22 10:06:49 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 22 Apr 2011 09:06:49 -0600 Subject: [Maxima] Announcement: Git conversion (Part 2) In-Reply-To: References: Message-ID: On 4/22/11, Leo Butler wrote: > htdocs izic maxima maximabook maxima-pre59 site-xml Let's hide or disable htdocs, izic, maximabook, and maxima-pre59. Thanks a lot for your continued work on this. best, Robert Dodier From l.butler at ed.ac.uk Fri Apr 22 10:09:29 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 22 Apr 2011 16:09:29 +0100 (BST) Subject: [Maxima] Announcement: Git conversion (Part 2) In-Reply-To: <1303484418.1641.21.camel@dieter> References: <1303478431.1641.9.camel@dieter> <1303482677.1641.16.camel@dieter> <1303484418.1641.21.camel@dieter> Message-ID: On Fri, 22 Apr 2011, Dieter Kaiser wrote: < Am Freitag, den 22.04.2011, 15:46 +0100 schrieb Leo Butler: < < > Dieter, when you pushed your commits, did you see any error message < > from the SF Git server concerning the hook script hook/post-receive? < > The script doesn't seem to have fired. < < Yes, I have seen an error message from the SF Git server concerning the < hook script hook/post-receive. Unfortunately, I have not stored the < message. The next time you, or anyone else, pushes and sees this error, please send the text to me so I can log this as an issue with SF. Thanks, Leo. -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From vttoth at vttoth.com Fri Apr 22 10:19:39 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Fri, 22 Apr 2011 11:19:39 -0400 Subject: [Maxima] Announcement: Git conversion (Part 2) In-Reply-To: References: <1303478431.1641.9.camel@dieter> <1303482677.1641.16.camel@dieter> <1303484418.1641.21.camel@dieter> Message-ID: <005d01cc0100$b5e0d420$21a27c60$@vttoth.com> This is the error that I got moments ago, for what it's worth: error: cannot run hooks/post-receive: No such file or directory Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Leo Butler Sent: Friday, April 22, 2011 11:09 AM To: Dieter Kaiser Cc: Maxima List; Andrej Vodopivec Subject: Re: [Maxima] Announcement: Git conversion (Part 2) On Fri, 22 Apr 2011, Dieter Kaiser wrote: < Am Freitag, den 22.04.2011, 15:46 +0100 schrieb Leo Butler: < < > Dieter, when you pushed your commits, did you see any error message < > from the SF Git server concerning the hook script hook/post-receive? < > The script doesn't seem to have fired. < < Yes, I have seen an error message from the SF Git server concerning the < hook script hook/post-receive. Unfortunately, I have not stored the < message. The next time you, or anyone else, pushes and sees this error, please send the text to me so I can log this as an issue with SF. Thanks, Leo. -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From drdieterkaiser at web.de Fri Apr 22 10:30:32 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 22 Apr 2011 17:30:32 +0200 Subject: [Maxima] Serveral bugs with fast arrays Message-ID: <1303486232.1641.24.camel@dieter> I have worked on the functionality of fast arrays. At first I have solved the following four problems. The bugs are distributed over several functions. More work is possible. I have got no problems with the test_suite and share_testsuite. 1. make_array(hashed) does not work We dot not get a hashed array. But we write values in a structure returned by make_array. (%i1) a:make_array(hashed,1); (%o1) {Array: #(NIL NIL $HASHED NIL NIL G968)} (%i2) a[0]:0$ a[1]:1$ a[2]:2$ a[3]:3$ a[4]:4$ a[5]:5$ (%i8) a; (%o8) {Array: #(0 1 2 3 4 5)} (%i9) a[6]:6; Maxima encountered a Lisp error: Index 6 out of bounds for (SIMPLE-VECTOR 6), should be nonnegative and <6. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. This is the correct behavior. The hash-table works as expected. (%i1) a:make_array(hashed); (%o1) # (%i2) a[100]:100; (%o2) 100 (%i3) a[x]:sin(x); (%o3) sin(x) (%i4) a[x*y]:x^2+y; (%o4) y+x^2 (%i5) arrayinfo(a); (%o5) [hash_table,1,100,x,x*y] (%i6) listarray(a); (%o6) [100,sin(x),y+x^2] 2. make_array(functional, .... ) does not work First the check of the dimensions is not correct for the case of arrays of type functional, but there are more problems. Arrays of type functional allow memoizing functions, e.g. make_array(functional, 'factorial, hashed) will store the factorials in an array. This is an example with already corrected code. The second call f[100000] gets the stored value: (%i1) f:make_array(functional, 'factorial, hashed); (%o1) #S(MGENARRAY :AREF NIL :ASET NIL :TYPE $FUNCTIONAL :NULL NIL :GENERATOR MFACTORIAL :CONTENT #) (%i2) showtime:true$ (%i3) bfloat(f[100000]); Evaluation took 7.5960 seconds (8.3920 elapsed) using 4.743 MB. (%o3) 2.824229407960348b456573 (%i4) bfloat(f[100000]); Evaluation took 0.0040 seconds (0.0030 elapsed) using 925.750 KB. (%o4) 2.824229407960348b456573 3. listarray does not work for multidimensional arrays (%i1) a: make_array(fixnum, 2, 2); (%o1) {Array: #2A((0 0) (0 0))} (%i2) arrayinfo(a); (%o2) [declared, 2, [1, 1]] (%i3) listarray(a); Maxima encountered a Lisp error: #2A((0 0) (0 0)) can't be converted to type LIST. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. 4. array(a, ...) does not work with use_fast_arrays Only untyped arrays are possible if the option variable user_fast_arrays has the value true: (%i1) array(a, 2, 2); (%o1) #2A((NIL NIL NIL) (NIL NIL NIL) (NIL NIL NIL)) (%i2) array(a, any, 2, 2); make_array: dimensions must be integers; found [any + 1, 3, 3] -- an error. To debug this try: debugmode(true); (%i3) array(a, fixnum, 2, 2); make_array: dimensions must be integers; found [fixnum + 1, 3, 3] -- an error. To debug this try: debugmode(true); (%i4) array(a, hashed); make_array: dimensions must be integers; found [hashed + 1] -- an error. To debug this try: debugmode(true); With the corrected code we get the expected behavior: (%i1) array(a, 2, 2); (%o1) #2A((NIL NIL NIL) (NIL NIL NIL) (NIL NIL NIL)) (%i2) array(a, any, 2, 2); (%o2) #2A((NIL NIL NIL) (NIL NIL NIL) (NIL NIL NIL)) (%i3) array(a, fixnum, 2, 2); (%o3) #2A((0 0 0) (0 0 0) (0 0 0)) (%i4) array(a, flonum, 2, 2); (%o4) #2A((0.0 0.0 0.0) (0.0 0.0 0.0) (0.0 0.0 0.0)) (%i5) array(a, hashed); (%o5) # Dieter Kaiser From fateman at eecs.berkeley.edu Fri Apr 22 11:17:32 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 22 Apr 2011 09:17:32 -0700 Subject: [Maxima] Other way to a not supported inverse laplace transform with maxima? In-Reply-To: <87ei4uzvlk.fsf@netris.org> References: <4BBA6EF3.2040704@math.msu.edu> <874o5r1b7i.fsf@netris.org> <4DB0F584.1010001@eecs.berkeley.edu> <87ei4uzvlk.fsf@netris.org> Message-ID: <4DB1AA1C.8030602@eecs.berkeley.edu> On 4/21/2011 10:46 PM, Mark H Weaver wrote: > Richard Fateman writes: >>> I have attached a version of my preliminary patches, updated to work >>> with current Maxima (5.24.0). Note that the patch to laplac.lisp will >>> require recompilation of the Maxima executable. >> If you have written a source file called foo.lisp that you wish to >> use to change Maxima, >> all you need to do is load("foo.lisp"). >> >> You do not need to recompile maxima. > This was my expectation as well, but if I load("laplac.lisp"), even the > unmodified version of it, this breaks $LAPLACE. Henceforth, any attempt > to use it results in the following error: > > Error in COND [or a callee]: The variable PARM is unbound. My guess is the same as yours, that declare-top is not doing what you need to do. I don't know why, or whether it is particular to GCL. This might fix it: (defmfun $laplace (fun var parm) (declare (special parm var)) ;; add this line (setq fun (mratcheck fun)) Thanks for your contributions! RJF From derekcthomas at gmail.com Fri Apr 22 11:26:14 2011 From: derekcthomas at gmail.com (Derek Thomas) Date: Fri, 22 Apr 2011 11:26:14 -0500 Subject: [Maxima] Lambda functions and pderivop Message-ID: I'm trying to use lambda functions to replace instances of pderivop from the pdiff package and I've encountered some inconsistent behavior. Here's my workflow, in > load(pdiff); in > f(x); out> f(x) If I use subst on an operator everything works fine. in > subst(g,f,%); out> g(x) if I use a lambda function to substitute for an operator it works fine too. in > subst(lambda([y], y*h(y)), g,%); out> x * (h(x) Now with pderivop. I can use subst to replace an instance of pderivop with another operator. in > diff(h(x),x); out> pderivop(h,1)(x) in > subst(f, pderivop(h,1),%); out> f(x) If I try to replace an instance of pderivop with a lambda function, the lambda function doesn't get applied correctly. in > diff(g(x),x); out> pderivop(g,1)(x) in > subst(lambda([y],y*k(y)), pderivop(h,1),%); out> lambda([y], y*k(y))(x) I can get around this by using an intermediate function. in > diff(g(x),x); out> pderivop(g,1)(x) in > subst(tempFunction, pderivop(h,1),%); out> tempFunction(x) in > subst(lambda([y],y*k(y)), tempFunction,%); out> x*k(x) If anyone can tell me what I'm doing wrong, or help me understand what's going on here, that would be great. Thanks, Derek From macrakis at alum.mit.edu Fri Apr 22 12:16:01 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 22 Apr 2011 13:16:01 -0400 Subject: [Maxima] Lambda functions and pderivop In-Reply-To: References: Message-ID: Sorry, this is a bug. I don't think I'll be able to look into a fix this weekend, though.... (%i2) subst(lambda([x],x),f,f(x)); (%o2) x (%i3) subst(lambda([x],x),f[1],f[1](x)); (%o3) lambda([x],x)(x) Another bug: (%i5) lambda([x],x)[y]; lambda: cannot apply lambda as an array function. <<< this is correct -- an error. To debug this try: debugmode(true); (%i6) subst(lambda([x],x),f,f[x]); (%o6) x <<< this should give the same error as the above -s On Fri, Apr 22, 2011 at 12:26, Derek Thomas wrote: > I'm trying to use lambda functions to replace instances of pderivop > from the pdiff package and I've encountered some inconsistent > behavior. > Here's my workflow, > > in > load(pdiff); > > in > f(x); > out> f(x) > > If I use subst on an operator everything works fine. > in > subst(g,f,%); > out> g(x) > > if I use a lambda function to substitute for an operator it works fine too. > in > subst(lambda([y], y*h(y)), g,%); > out> x * (h(x) > > Now with pderivop. > I can use subst to replace an instance of pderivop with another operator. > in > diff(h(x),x); > out> pderivop(h,1)(x) > in > subst(f, pderivop(h,1),%); > out> f(x) > > If I try to replace an instance of pderivop with a lambda function, > the lambda function doesn't get applied correctly. > in > diff(g(x),x); > out> pderivop(g,1)(x) > in > subst(lambda([y],y*k(y)), pderivop(h,1),%); > out> lambda([y], y*k(y))(x) > > I can get around this by using an intermediate function. > > in > diff(g(x),x); > out> pderivop(g,1)(x) > in > subst(tempFunction, pderivop(h,1),%); > out> tempFunction(x) > in > subst(lambda([y],y*k(y)), tempFunction,%); > out> x*k(x) > > If anyone can tell me what I'm doing wrong, or help me understand > what's going on here, that would be great. Thanks, > > Derek > _______________________________________________ > 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 Fri Apr 22 13:41:06 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 22 Apr 2011 13:41:06 -0500 Subject: [Maxima] Lambda functions and pderivop In-Reply-To: References: Message-ID: maxima-bounces at math.utexas.edu wrote on 04/22/2011 12:16:01 PM: > Sorry, this is a bug. I don't think I'll be able to look into a fix > this weekend, though.... > > (%i2) subst(lambda([x],x),f,f(x)); > (%o2) x > (%i3) subst(lambda([x],x),f[1],f[1](x)); > (%o3) lambda([x],x)(x) A workaround is (I think) to use ev(XXX, lambda); example (%i17) subst(lambda([x],x),f[1],f[1](x)); (%o17) lambda([x],x)(x) (%i18) ev(%,lambda); (%o18) x This is a workaround, not a suggestion that you should use (or need to use) 'ev' for things like this. Also, I don't know why sublis_apply_lambda is a good thing (%i35) sublis([f = lambda([x],x)],f(x)), sublis_apply_lambda : false; (%o35) lambda([x],x)(x) (%i36) sublis([f = lambda([x],x)],f(x)), sublis_apply_lambda : true; (%o36) x Since sublis doesn't support substitutions for nonatoms (so sublis([f[1] = ... ) doesn't work. Correct me if I'm mistaken, but I think the bugs aren't related to the pdiff package or to pderivop. --Barton (author of pdiff) From cloos at jhcloos.com Fri Apr 22 14:45:24 2011 From: cloos at jhcloos.com (James Cloos) Date: Fri, 22 Apr 2011 15:45:24 -0400 Subject: [Maxima] Announcement: Git conversion In-Reply-To: (Leo Butler's message of "Thu, 21 Apr 2011 15:40:16 +0100 (BST)") References: <4DB02CAF.9090807@gmail.com> Message-ID: >>>>> "LB" == Leo Butler writes: LB> For comparison, I filtered the maxima directory into a separate Git LB> repo, as Andrej suggested. I was surprised to find that it occupies LB> 175M versus 195M for my clone of 'repo'. You have to run git gc (I recommend git gc --aggressive) after running filter-branch to repack the repository. I just tried it on a clone which was last updated Wednesday. The filtered repo has a 62896934 octet pack whereas repo.git has a 77073888 octet pack. So, yes, filtering out maxima only seems to save 13.52 megs. It should be better; a fast-export on the filtered repo shows that the filtering is not complete. It seems that the filtering needs to be done on every branch. That should improve the numbers significantly. htdocs, izic, maxima-pre59, and maximabook should also be filtered out and preserved for history. I can write a script which does it all if desired. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From l.butler at ed.ac.uk Sat Apr 23 04:32:12 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sat, 23 Apr 2011 10:32:12 +0100 (BST) Subject: [Maxima] Announcement: Git conversion (Part 2) In-Reply-To: <005d01cc0100$b5e0d420$21a27c60$@vttoth.com> References: <1303478431.1641.9.camel@dieter> <1303482677.1641.16.camel@dieter> <1303484418.1641.21.camel@dieter> <005d01cc0100$b5e0d420$21a27c60$@vttoth.com> Message-ID: On Fri, 22 Apr 2011, Viktor T. Toth wrote: < This is the error that I got moments ago, for what it's worth: < < error: cannot run hooks/post-receive: No such file or directory < Thanks, Victor. I have filed a bug report with SF about this, as the script is in place with the right privilege set. Leo. -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From pythonfield at gmail.com Sat Apr 23 05:05:18 2011 From: pythonfield at gmail.com (A B) Date: Sat, 23 Apr 2011 18:05:18 +0800 Subject: [Maxima] is it a bug? Message-ID: cf(sqrt(8)) returns 3, even not a list but an integer cf(sqrt(27)) also returns 5 Is this a bug? Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sat Apr 23 14:27:17 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 23 Apr 2011 15:27:17 -0400 Subject: [Maxima] is it a bug? In-Reply-To: References: Message-ID: Yes, it is definitely a bug. Sorry about that. -s On Sat, Apr 23, 2011 at 06:05, A B wrote: > cf(sqrt(8)) returns 3, even not a list but an integer > cf(sqrt(27)) also returns 5 > Is this a bug? > 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 macrakis at alum.mit.edu Sat Apr 23 14:28:21 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 23 Apr 2011 15:28:21 -0400 Subject: [Maxima] is it a bug? In-Reply-To: References: Message-ID: A workaround is to set cflength to 3. But the bug should be fixed.... -s On Sat, Apr 23, 2011 at 15:27, Stavros Macrakis wrote: > Yes, it is definitely a bug. Sorry about that. > > -s > > On Sat, Apr 23, 2011 at 06:05, A B wrote: > >> cf(sqrt(8)) returns 3, even not a list but an integer >> cf(sqrt(27)) also returns 5 >> Is this a bug? >> 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 mhw at netris.org Sat Apr 23 16:24:16 2011 From: mhw at netris.org (Mark H Weaver) Date: Sat, 23 Apr 2011 17:24:16 -0400 Subject: [Maxima] Enhanced Laplace transforms and desolve for Maxima In-Reply-To: (razif razali's message of "Mon, 18 Apr 2011 16:20:25 +0800") References: <87bp3cvzi4.fsf@yeeloong.netris.org> <878vya6u83.fsf@yeeloong.netris.org> <4D3E10FB.2060907@gmail.com> <8739oh6i5w.fsf@yeeloong.netris.org> <06C749E85D85463BA3D4C6592C580AD9@RichsLaptop> Message-ID: <87vcy4y83j.fsf@netris.org> razif razali writes: > I have try your patch but it failed in 64bit architecture but > I?successfully?patch it and run it in 32bit ubuntu10.10. by using your > patch I simply paste my code in maxima, [...] > and your patch help me get the function for f_12_1(s) till f_12_7(s) > ---------( f_n_k(s) )----------|| > > this patch also true until f_16_9 only. when i try to run for f_18_10 > i got ' ilt ' result again..below is the code that give ' ilt ' result [...] > so what should I do if i want to solve this problem until hundreds ' k ' ? desoln uses symbolic methods only, specifically by means of the Laplace transform. Such large systems of differential equations are beyond its capabilities. To analyze such systems, I think you will have to use numerical methods. Best, Mark > ---------------------- > load(desoln); > load(laplac); > load(hstep); > load(pwilt); > load(abs_integrate); > > f[n,k] := concat('f_,n,"_",k)(s)$? > df[n,k] :=? > ? if n=0 then 0? > ? else 'diff(f[2*n,k],s)=%psi*((k-1)*sqrt(n-k+2)*f[2*n,k-1]-k*sqrt(n-k+1)*f[2*n,k+1])$? > > atvalue(f_18_2(s),s=0,0)$? > atvalue(f_18_3(s),s=0,0)$? > atvalue(f_18_4(s),s=0,0)$? > atvalue(f_18_5(s),s=0,0)$? > atvalue(f_18_6(s),s=0,0)$? > atvalue(f_18_7(s),s=0,0)$ > atvalue(f_18_8(s),s=0,0)$ > atvalue(f_18_9(s),s=0,0)$ > atvalue(f_18_10(s),s=0,0)$ > > makelist( df[9,k],k,1,10);? > > desolve(%, makelist(f[18,k],k,1,10) );? > -------------------------------------------------------------------- > > so what should I do if i want to solve this problem until hundreds ' k ' ? From robert.dodier at gmail.com Sun Apr 24 13:14:38 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 24 Apr 2011 12:14:38 -0600 Subject: [Maxima] maxima/repo versus maxima/maxima et al Message-ID: Hi, it looks like this: git://maxima.git.sourceforge.net / maxima/repo is redundant with maxima/maxima, maxima/site-xml, etc. since maxima/repo contains subdirectories maxima, site-xml, etc. In the interest of avoiding confusion, can we nuke maxima/repo? best Robert Dodier From robert.dodier at gmail.com Sun Apr 24 17:01:10 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 24 Apr 2011 16:01:10 -0600 Subject: [Maxima] Announcement: Git conversion (Part 2) In-Reply-To: References: Message-ID: On 4/22/11, Leo Butler wrote: > For the moment, 'repo' is online. I do not have admin rights to make > it read-only, so I will only remind you that you should not push > to it. It will be taken down in due course. Oh, OK. Never mind my question from earlier today about repo. best Robert Dodier From l.butler at ed.ac.uk Mon Apr 25 02:01:28 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 25 Apr 2011 08:01:28 +0100 (BST) Subject: [Maxima] Announcement: Git conversion (Part 2) In-Reply-To: References: Message-ID: On Sun, 24 Apr 2011, Robert Dodier wrote: < On 4/22/11, Leo Butler wrote: < < > For the moment, 'repo' is online. I do not have admin rights to make < > it read-only, so I will only remind you that you should not push < > to it. It will be taken down in due course. < < Oh, OK. Never mind my question from earlier today about repo. I managed to remove it. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From vttoth at vttoth.com Mon Apr 25 12:14:36 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Mon, 25 Apr 2011 13:14:36 -0400 Subject: [Maxima] Announcement: Git conversion (Part 2) In-Reply-To: References: Message-ID: <011201cc036c$43e368b0$cbaa3a10$@vttoth.com> OK, so here is a question: Is it within the capabilities of Git to change the post-commit script parameters (or to whatever other forms of magic it might take to accomplish this) to give a more meaningful subject line? Compare this: [Maxima-commits] maxima/share/tensor tetrad.dem,1.5,1.6 to this: [Maxima-commits] Maxima, A Computer Algebra System branch, master, updated. 6211ffd0300c0cf1f9b4aeaeebeb0b9608f9619c CVS told me precisely what I needed to know: which file was updated. Git tells me what Maxima is, that the "master" branch was updated (d'oh!) and some hex nonsense that I am sure means something to some people but is completely meaningless to me. I must say that I found the CVS message far more informative and helpful (as in, letting me know whether or not I should take a closer look at a particular edit, or being able to search for specific edits in my mail.) The Git subject line might as well be just a random string, as it has no information content. Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Leo Butler Sent: Monday, April 25, 2011 3:01 AM To: Robert Dodier Cc: Maxima List Subject: Re: [Maxima] Announcement: Git conversion (Part 2) On Sun, 24 Apr 2011, Robert Dodier wrote: < On 4/22/11, Leo Butler wrote: < < > For the moment, 'repo' is online. I do not have admin rights to make < > it read-only, so I will only remind you that you should not push < > to it. It will be taken down in due course. < < Oh, OK. Never mind my question from earlier today about repo. I managed to remove it. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From willisb at unk.edu Mon Apr 25 13:34:33 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 25 Apr 2011 13:34:33 -0500 Subject: [Maxima] conjugate of undeclared array In-Reply-To: References: Message-ID: I was looking at a conjugate bug and noticed the following: (%i6) declare(e,imaginary)$ (%i7) conjugate(e[x]); (%o7) -e[x] I'd like to remove this undocumented feature before somebody decides that they like it. Since declare(e[x], imaginary), doesn't work, a user will need to use a tellsimp rule to do things like conjugate(e[x]) --> -e[x]. I'm wobbly using git, but I've used git to build Maxima; the testsuite + share testsuite run with no errors after removing this conjugate feature. Comments? --Barton From l.butler at ed.ac.uk Mon Apr 25 13:44:17 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 25 Apr 2011 19:44:17 +0100 (BST) Subject: [Maxima] Announcement: Git conversion (Part 2) In-Reply-To: <011201cc036c$43e368b0$cbaa3a10$@vttoth.com> References: <011201cc036c$43e368b0$cbaa3a10$@vttoth.com> Message-ID: On Mon, 25 Apr 2011, Viktor T. Toth wrote: < OK, so here is a question: Is it within the capabilities of Git to change < the post-commit script parameters (or to whatever other forms of magic it < might take to accomplish this) to give a more meaningful subject line? < Compare this: < < [Maxima-commits] maxima/share/tensor tetrad.dem,1.5,1.6 < < to this: < < [Maxima-commits] Maxima, A Computer Algebra System branch, master, < updated. 6211ffd0300c0cf1f9b4aeaeebeb0b9608f9619c < < CVS told me precisely what I needed to know: which file was updated. Git < tells me what Maxima is, that the "master" branch was updated (d'oh!) and < some hex nonsense that I am sure means something to some people but is < completely meaningless to me. I must say that I found the CVS message far < more informative and helpful (as in, letting me know whether or not I should < take a closer look at a particular edit, or being able to search for < specific edits in my mail.) The Git subject line might as well be just a < random string, as it has no information content. The short answer is yes. The longer answer is that the post-receive hook script will need to be edited/customised. At the momenet, I am working on scripting an auto-update of the bug tracker from commits, so you will need to put up with the commit emails for the moment. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From hbaker1 at pipeline.com Mon Apr 25 13:56:25 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Mon, 25 Apr 2011 11:56:25 -0700 Subject: [Maxima] conjugate of undeclared array In-Reply-To: References: Message-ID: I don't know how to respond to your question without better understanding how your mental model of "conjugate" is supposed to work. Perhaps you can provide more detail? At 11:34 AM 4/25/2011, Barton Willis wrote: >I was looking at a conjugate bug and noticed the following: > > (%i6) declare(e,imaginary)$ > > (%i7) conjugate(e[x]); > (%o7) -e[x] > > I'd like to remove this undocumented feature before somebody decides >that they like it. > >Since declare(e[x], imaginary), doesn't work, a user will need to use a >tellsimp rule to do things like conjugate(e[x]) --> -e[x]. > >I'm wobbly using git, but I've used git to build Maxima; the testsuite + >share testsuite run with no errors after removing this >conjugate feature. > >Comments? > >--Barton From wilhelm.haager at htlstp.ac.at Mon Apr 25 14:38:24 2011 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Mon, 25 Apr 2011 21:38:24 +0200 Subject: [Maxima] =?utf-8?q?Need_for_subvar_=3F?= Message-ID: <79a89c4c6b0dac5f7d70366e411557fd@localhost> Hi, Is there any difference between subvar(A,i) and just A[i]? Sorry, but I cannot see it. Thanks in advance, Wilhelm Haager From willisb at unk.edu Mon Apr 25 15:02:13 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 25 Apr 2011 15:02:13 -0500 Subject: [Maxima] conjugate of undeclared array In-Reply-To: References: Message-ID: Undeclared arrays print as a subscripted variable, but using them as such causes trouble. Example (%i1) declare(e,imaginary)$ (%i2) conjugate(e[x]); (%o2) -e[x] (%i3) e[42] : 8; (%o3) 8 (%i4) conjugate(e[x]); (%o4) conjugate(e[x]) You might blame a bug in conjugate on this, but it might be due to the kinds of bugs that arise when undeclared arrays get used for a subscripted variable. --Barton Henry Baker wrote on 04/25/2011 01:56:25 PM: > I don't know how to respond to your question without better > understanding how your mental model of "conjugate" is supposed to work. From toy.raymond at gmail.com Mon Apr 25 22:13:29 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 25 Apr 2011 23:13:29 -0400 Subject: [Maxima] Maxima: Plotting error with plot2d(). References: <201104221842.40384.cfrangos@telkomsa.net> Message-ID: >>>>> "Constantine" == Constantine Frangos writes: Constantine> I am getting the error message below with the plot2d() command. Any assistance on what to do would be much appreciated. Constantine> I am using Maxima 5.19 (32 bit) running under suse linux enterprise desktop 11 sp1 (sled11sp1) on a 64 bit x86 machine: Constantine> Maxima 5.19.2 http://maxima.sourceforge.net Constantine> Using Lisp CMU Common Lisp 19d (19D) Constantine> Distributed under the GNU Public License. See the file COPYING. Constantine> Dedicated to the memory of William Schelter. Constantine> The function bug_report() provides bug reporting information. Constantine> (%i1) Constantine> I recently installed gnuplot (64 bit) on the sled11 machine using: Constantine> gnuplot-4.2.3-5.34.x86_64.rpm Constantine> (I first tried installing gnuplot-4.2.3-5.34.i586.rpm (32 bit) but there were error messages indicating missing libraries/files/etc). Constantine> (The other commands in maxima 5.19 seem to run ok on this machine) Does gnuplot run ok by itself (without maxima)? Constantine> (%i5) plot2d (sin(x), [x, -5, 5]); Constantine> Maxima encountered a Lisp error: Constantine> Error in function UNIX::SIGSEGV-HANDLER: Segmentation Violation at #x0. Constantine> Automatically continuing. Constantine> To reenable the Lisp debugger set *debugger-hook* to nil. Constantine> (%i6) Constantine> Maxima encountered a Lisp error: Constantine> Error in function UNIX::SIGPIPE-HANDLER: SIGPIPE at #xFFFFE430. So you try a plot, get a sigsegv, and then immediately get a sigpipe? Could be an issue with cmucl, but I've been running cmucl with maxima for ages without any issues like this. If possible, you may want to upgrade to 5.24. 5.19 is pretty old. Ray From mhw at netris.org Tue Apr 26 12:08:24 2011 From: mhw at netris.org (Mark H Weaver) Date: Tue, 26 Apr 2011 13:08:24 -0400 Subject: [Maxima] Need for subvar ? In-Reply-To: <79a89c4c6b0dac5f7d70366e411557fd@localhost> (Wilhelm Haager's message of "Mon, 25 Apr 2011 21:38:24 +0200") References: <79a89c4c6b0dac5f7d70366e411557fd@localhost> Message-ID: <87k4ehx7nb.fsf@netris.org> Wilhelm Haager writes: > Is there any difference between subvar(A,i) and just A[i]? I know of at least one important difference, shown below: (%i2) robust_first_element(A) := subvar(A,1)$ (%i3) brittle_first_element(A) := A[1]$ (%i4) M[1] : 5$ (%i5) robust_first_element(M); (%o5) 5 (%i6) brittle_first_element(M); (%o6) 5 (%i7) A[1] : 11$ (%i8) robust_first_element(M); (%o8) 5 (%i9) brittle_first_element(M); (%o9) 11 As you can see here, both robust_first_element and brittle_first_element work the same way if there is no global array A[]. However, if A[] exists, then the A[1] in brittle_first_element will refer to the global array, and not to the local parameter A. The names of arrays, functions, and bare variables are each kept in their own namespace. For example, you can use a variable named "exp" to store an expression, and that does not conflict with the built-in exp(x) exponential function. You could also have an array exp[]. In this case, the separation of namespaces implies that the A[1] within the definition of brittle_first_element does not refer to that function's formal parameter A, but instead the array A[]. However, as a convenience feature, if the array A[] does not exist, then Maxima will try looking up A in the normal variable namespace. Unfortunately, this "convenience" feature encourages the creation of brittle code. subvar(A,1), on the other hand, evaluates A as a bare variable, before evaluating the array reference itself. Similarly, consider: (%i10) robust_assign_first_element(A, value) := arraymake(A,[1]) :: value$ (%i11) brittle_assign_first_element(A, value) := A[1] : value$ (%i12) A[1]; (%o12) 11 (%i13) M[1]; (%o13) 5 (%i14) robust_assign_first_element(M, 6); (%o14) 6 (%i15) M[1]; (%o15) 6 (%i16) A[1]; (%o16) 11 (%i17) brittle_assign_first_element(M, 7); (%o17) 7 (%i18) M[1]; (%o18) 6 (%i19) A[1]; (%o19) 7 Best, Mark From macrakis at alum.mit.edu Tue Apr 26 12:43:21 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 26 Apr 2011 13:43:21 -0400 Subject: [Maxima] Need for subvar ? In-Reply-To: <87k4ehx7nb.fsf@netris.org> References: <79a89c4c6b0dac5f7d70366e411557fd@localhost> <87k4ehx7nb.fsf@netris.org> Message-ID: For some historical background on this sort of issue, see Gabriel's 1988 article Technical Issues of Separation in Function Cells and Value Cells, which introduced the terminology Lisp-1 vs. Lisp-2. -s On Tue, Apr 26, 2011 at 13:08, Mark H Weaver wrote: > Wilhelm Haager writes: > > Is there any difference between subvar(A,i) and just A[i]? > > I know of at least one important difference, shown below: > > (%i2) robust_first_element(A) := subvar(A,1)$ > (%i3) brittle_first_element(A) := A[1]$ > (%i4) M[1] : 5$ > (%i5) robust_first_element(M); > (%o5) 5 > (%i6) brittle_first_element(M); > (%o6) 5 > (%i7) A[1] : 11$ > (%i8) robust_first_element(M); > (%o8) 5 > (%i9) brittle_first_element(M); > (%o9) 11 > > As you can see here, both robust_first_element and brittle_first_element > work the same way if there is no global array A[]. However, if A[] > exists, then the A[1] in brittle_first_element will refer to the global > array, and not to the local parameter A. > > The names of arrays, functions, and bare variables are each kept in > their own namespace. For example, you can use a variable named "exp" to > store an expression, and that does not conflict with the built-in exp(x) > exponential function. You could also have an array exp[]. > > In this case, the separation of namespaces implies that the A[1] within > the definition of brittle_first_element does not refer to that > function's formal parameter A, but instead the array A[]. > > However, as a convenience feature, if the array A[] does not exist, then > Maxima will try looking up A in the normal variable namespace. > Unfortunately, this "convenience" feature encourages the creation of > brittle code. > > subvar(A,1), on the other hand, evaluates A as a bare variable, before > evaluating the array reference itself. > > Similarly, consider: > > (%i10) robust_assign_first_element(A, value) := arraymake(A,[1]) :: value$ > (%i11) brittle_assign_first_element(A, value) := A[1] : value$ > (%i12) A[1]; > (%o12) 11 > (%i13) M[1]; > (%o13) 5 > (%i14) robust_assign_first_element(M, 6); > (%o14) 6 > (%i15) M[1]; > (%o15) 6 > (%i16) A[1]; > (%o16) 11 > (%i17) brittle_assign_first_element(M, 7); > (%o17) 7 > (%i18) M[1]; > (%o18) 6 > (%i19) A[1]; > (%o19) 7 > > Best, > Mark > _______________________________________________ > 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 beren.olvar at gmail.com Tue Apr 26 13:20:43 2011 From: beren.olvar at gmail.com (beren olvar) Date: Tue, 26 Apr 2011 19:20:43 +0100 Subject: [Maxima] expand before simplification? In-Reply-To: References: Message-ID: Hi, I'm using tellsimp to write some simple rules to work with some operators (a, ad) acting on some vectors(ket,bra). So far I have something like this: basis:{a,ad}$ basisp(x):=elementp(x,basis)$ ketp(x):=is(equal(op(x),ket))$ matchdeclare(K1,ketp )$ matchdeclare(Z1,basisp)$ matchdeclare (i,integerp)$ simp:false$ tellsimp(Z1[i].K1, evolve(Z1,i,K1))$ /*operator acting over a state (ket)*/ simp:true$ where evolve is a function I have defined before. The problem is that if I use the basis elements "a" or "ad" explicitly it works,for example: a[1].ket(0,0,0,0); gives (%o1) evolve(a,1,ket(0,0,0,0)) but if I do something like r:a[i]$ r.ket(0,0,0,0); it will just write (%o2) a[i] . ket(0,0,0,0) and "evolve" will not be called as it should. Is there a way I can force the last expansion before the simplification is attempted so my rules are used? Do you know of any other way I should try doing this? Thank you very much Regards Fernando -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Tue Apr 26 18:00:17 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 26 Apr 2011 17:00:17 -0600 Subject: [Maxima] expand before simplification? In-Reply-To: References: Message-ID: Well, the problem is that i is not known to be an integer. You could try this: matchdeclare (i, lambda ([e], integerp (e) or featurep (e, integer))); and then after the rule, declare (i, integer); or you relax the matchdeclare for i to accept any symbol: matchdeclare (i, symbolp); and then it will match i without any declaration for i. HTH Robert Dodier On 4/26/11, beren olvar wrote: > Hi, > > I'm using tellsimp to write some simple rules to work with some operators > (a, ad) acting on some vectors(ket,bra). > So far I have something like this: > > basis:{a,ad}$ > basisp(x):=elementp(x,basis)$ > ketp(x):=is(equal(op(x),ket))$ > > matchdeclare(K1,ketp )$ > matchdeclare(Z1,basisp)$ > matchdeclare (i,integerp)$ > > simp:false$ > tellsimp(Z1[i].K1, evolve(Z1,i,K1))$ /*operator acting over a state (ket)*/ > simp:true$ > > where evolve is a function I have defined before. > The problem is that if I use the basis elements "a" or "ad" explicitly it > works,for example: > a[1].ket(0,0,0,0); > gives > (%o1) evolve(a,1,ket(0,0,0,0)) > > but if I do something like > r:a[i]$ > r.ket(0,0,0,0); > > it will just write > (%o2) a[i] . ket(0,0,0,0) > > and "evolve" will not be called as it should. Is there a way I can force the > last expansion before the simplification is attempted so my rules are used? > Do you know of any other way I should try doing this? > > Thank you very much > Regards > Fernando > From beren.olvar at gmail.com Wed Apr 27 03:11:28 2011 From: beren.olvar at gmail.com (Fernando Aguayo) Date: Wed, 27 Apr 2011 09:11:28 +0100 Subject: [Maxima] expand before simplification? In-Reply-To: References: Message-ID: <4DB7CFB0.3050603@gmail.com> Oops! It seems I oversimplified the example, and my mistake of writing an "i" instead of 1 lead me to think it was good enough. Let me show you a more complete (non) working example of what my problem is: I need to use several operators over a "vector", so I make the following: kill(rules)$ dotdistrib:true$ dotscrules:true$ basis:{a,ad}$ basisp(x):=elementp(x,basis)$ ketp(x):=is(equal(op(x),ket))$ matchdeclare (i,integerp)$ matchdeclare([Z1,Z2,Z3],basisp)$ matchdeclare(K1,ketp )$ simp:false$ tellsimp(Z1[i] . K1, ket(evolve(Z1,i,K1)))$ simp:true$ phi:ket(n)$ r:a[1].ad[2]$ a[1].ad[2] . phi; r.phi; So, is basically the same, but now I'm using two operators. The output of this is: (%o33) |evolve(a,1,|evolve(ad,2,|n>)>)> (%o34) a[1] . |evolve(ad,2,|n>)> (I have defined the output of ket(n) as |n>) So If I write the complete expression it will work, but if I use an auxilary variable it will apply the rule correctly once, but not the second time. This happes for any number of operators. How can I make it apply the rules for the whole expression? Thanks! On 4/27/2011 12:00 AM, Robert Dodier wrote: > Well, the problem is that i is not known to be an integer. > You could try this: > matchdeclare (i, lambda ([e], integerp (e) or featurep (e, integer))); > and then after the rule, > declare (i, integer); > or you relax the matchdeclare for i to accept any symbol: > matchdeclare (i, symbolp); > and then it will match i without any declaration for i. > > HTH > > Robert Dodier > > On 4/26/11, beren olvar wrote: >> Hi, >> >> I'm using tellsimp to write some simple rules to work with some operators >> (a, ad) acting on some vectors(ket,bra). >> So far I have something like this: >> >> basis:{a,ad}$ >> basisp(x):=elementp(x,basis)$ >> ketp(x):=is(equal(op(x),ket))$ >> >> matchdeclare(K1,ketp )$ >> matchdeclare(Z1,basisp)$ >> matchdeclare (i,integerp)$ >> >> simp:false$ >> tellsimp(Z1[i].K1, evolve(Z1,i,K1))$ /*operator acting over a state (ket)*/ >> simp:true$ >> >> where evolve is a function I have defined before. >> The problem is that if I use the basis elements "a" or "ad" explicitly it >> works,for example: >> a[1].ket(0,0,0,0); >> gives >> (%o1) evolve(a,1,ket(0,0,0,0)) >> >> but if I do something like >> r:a[i]$ >> r.ket(0,0,0,0); >> >> it will just write >> (%o2) a[i] . ket(0,0,0,0) >> >> and "evolve" will not be called as it should. Is there a way I can force the >> last expansion before the simplification is attempted so my rules are used? >> Do you know of any other way I should try doing this? >> >> Thank you very much >> Regards >> Fernando >> From beren.olvar at gmail.com Tue Apr 26 12:14:12 2011 From: beren.olvar at gmail.com (beren olvar) Date: Tue, 26 Apr 2011 18:14:12 +0100 Subject: [Maxima] expand before simplification? Message-ID: Hi, I'm using tellsimp to write some simple rules to work with some operators (a, ad) acting on some vectors(ket,bra). So far I have something like this: basis:{a,ad}$ basisp(x):=elementp(x,basis)$ ketp(x):=is(equal(op(x),ket))$ matchdeclare(K1,ketp )$ matchdeclare(Z1,basisp)$ matchdeclare (i,integerp)$ simp:false$ tellsimp(Z1[i].K1, evolve(Z1,i,K1))$ /*operator acting over a state (ket)*/ simp:true$ where evolve is a function I have defined before. The problem is that if I use the basis elements "a" or "ad" explicitly it works,for example: a[1].ket(0,0,0,0); gives (%o1) evolve(a,1,ket(0,0,0,0)) but if I do something like r:a[i]$ r.ket(0,0,0,0); it will just write (%o2) a[i] . ket(0,0,0,0) and "evolve" will not be called as it should. Is there a way I can force the last expansion before the simplification is attempted so my rules are used? Do you know of any other way I should try doing this? Thank you very much Regards Fernando -------------- next part -------------- An HTML attachment was scrubbed... URL: From klemens.waldhoer at heartsome.de Tue Apr 26 13:27:18 2011 From: klemens.waldhoer at heartsome.de (=?iso-8859-1?Q?Dr._Klemens_Waldh=F6r?=) Date: Tue, 26 Apr 2011 20:27:18 +0200 Subject: [Maxima] Confused writing a function and its result - depending on reevaluation of the function Message-ID: <00d701cc043f$9313c960$b93b5c20$@heartsome.de> I have written the follwoing function which basically does some function discussion: kurvendiskussion(func) := block( [ab1,ab2,ab3,ab4,N,E,W,l,erg,abl,x,f,xi], f: ratsimp(func), f(x):=''f, ab1:diff(f(x),x), ab2:diff(f(x),x,2), ab3:diff(f(x),x,3), ab4:diff(f(x),x,4), l:realroots(f(x)=0), N: makelist([xi:float(ev(x,l[i])), float(f(xi))], i , 1, length(l)), l:realroots(ab1=0), E: makelist([xi:float(ev(x,l[i])), float(f(xi))], i , 1, length(l)), l:realroots(ab2=0), W: makelist([xi:float(ev(x,l[i])), float(f(xi))], i , 1, length(l)), abl: [ab1,ab2,ab3,ab4], erg: matrix(["Funktion","Ableitung","Nullstellen","Extremwerte","Wendepunkt"], [func, transpose(abl), transpose(N),transpose(E),transpose(W)]), return (erg) )$ I call it in this way: f: (x-3)*(x+4)*(x-7)/20; ergebnis: kurvendiskussion(f)$ disp("","Aufgabe",ergebnis)$ When I call it first I'll get: "Aufgabe" matrix(["Funktion","Ableitung","Nullstellen","Extremwerte","Wendepunkt"],[(( x-7)*(x-3)*(x+4))/20,matrix([(3*x^2-12*x-19)/20],[(6*x-12)/20],[3/10],[0]),m atrix([[-4.0,0.05*(x^3-6.0*x^2-19.0*x+84.0)]],[[3.0,0.05*(x^3-6.0*x^2-19.0*x +84.0)]],[[7.0,0.05*(x^3-6.0*x^2-19.0*x+84.0)]]),matrix([[-1.214550226926804 ,0.05*(x^3-6.0*x^2-19.0*x+84.0)]],[[5.214550226926804,0.05*(x^3-6.0*x^2-19.0 *x+84.0)]]),matrix([[2.0,0.05*(x^3-6.0*x^2-19.0*x+84.0)]])]) Which I do not really want as I want the real values. Now I evaluate the above function definition again and rerun the previous call. Now I get: "Aufgabe" matrix(["Funktion","Ableitung","Nullstellen","Extremwerte","Wendepunkt"],[(( x-7)*(x-3)*(x+4))/20,matrix([((x-3)*(x+4))/20+((x-7)*(x+4))/20+((x-7)*(x-3)) /20],[(x+4)/10+(x-3)/10+(x-7)/10],[3/10],[0]),matrix([[-4.0,0.0]],[[3.0,0.0] ],[[7.0,0.0]]),matrix([[-1.214550226926804,4.821701928786462]],[[5.214550226 926804,-1.821701928786462]]),matrix([[2.0,1.5]])]) That's actually what I like... Any idea what I do wrong? Attached also a file in wxm Format which contains the function definitions. Thanks for help on this. BTW: Does anyone know a good description about Maxima programming? Klemens -------------- next part -------------- A non-text attachment was scrubbed... Name: kurvendiskussion.wxm Type: application/octet-stream Size: 1279 bytes Desc: not available URL: From villate at fe.up.pt Wed Apr 27 05:12:14 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 27 Apr 2011 11:12:14 +0100 Subject: [Maxima] Confused writing a function and its result - depending on reevaluation of the function In-Reply-To: <00d701cc043f$9313c960$b93b5c20$@heartsome.de> References: <00d701cc043f$9313c960$b93b5c20$@heartsome.de> Message-ID: <1303899134.2514.5.camel@wigner> On Tue, 2011-04-26 at 20:27 +0200, Dr. Klemens Waldh?r wrote: > I call it in this way: > > f: (x-3)*(x+4)*(x-7)/20; > ergebnis: kurvendiskussion(f)$ > disp("","Aufgabe",ergebnis)$ > > When I call it first I'll get: ... > Which I do not really want as I want the real values. Now I evaluate > the > above function definition again and rerun the previous call. Now I > get: ... > That's actually what I like... Hi, in fact, if you defined f:... first, before defining kurnvendiskussion(), you would also get the result you want. Your problem here is that you think you are defining a local function f() which will not interfere with the global f, but doing that is very tricky and cannot be done as you tried. I recommend that you stick to expressions and do not use functions (expressions will in fact be local as you expect them to be): kurvendiskussion(func) := block( [ab1,ab2,ab3,ab4,N,E,W,l,erg,abl,xi], ab1:ratsimp(diff(func,x)), ab1:ratsimp(diff(func,x)), ab2:ratsimp(diff(func,x,2)), ab3:ratsimp(diff(func,x,3)), ab4:ratsimp(diff(func,x,4)), l:realroots(func=0), N: makelist(float(ev([x,func],l[i])), i , 1, length(l)), l:realroots(ab1=0), E: makelist(float(ev([x,func],l[i])), i , 1, length(l)), l:realroots(ab2=0), W: makelist(float(ev([x,func],l[i])), i , 1, length(l)), abl: [ab1,ab2,ab3,ab4], erg: matrix(["Funktion","Ableitung","Nullstellen","Extremwerte","Wendepunkt"], [func, transpose(abl), transpose(N),transpose(E),transpose(W)]), return (erg) )$ Cheers, Jaime From villate at fe.up.pt Wed Apr 27 05:15:59 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 27 Apr 2011 11:15:59 +0100 Subject: [Maxima] Confused writing a function and its result - depending on reevaluation of the function In-Reply-To: <1303899134.2514.5.camel@wigner> References: <00d701cc043f$9313c960$b93b5c20$@heartsome.de> <1303899134.2514.5.camel@wigner> Message-ID: <1303899359.2514.6.camel@wigner> On Wed, 2011-04-27 at 11:12 +0100, Jaime Villate wrote: > kurvendiskussion(func) := > block( > [ab1,ab2,ab3,ab4,N,E,W,l,erg,abl,xi], > ab1:ratsimp(diff(func,x)), > ab1:ratsimp(diff(func,x)), > ab2:ratsimp(diff(func,x,2)), > ab3:ratsimp(diff(func,x,3)), > ab4:ratsimp(diff(func,x,4)), > l:realroots(func=0), > N: makelist(float(ev([x,func],l[i])), i , 1, length(l)), > l:realroots(ab1=0), > E: makelist(float(ev([x,func],l[i])), i , 1, length(l)), > l:realroots(ab2=0), > W: makelist(float(ev([x,func],l[i])), i , 1, length(l)), > abl: [ab1,ab2,ab3,ab4], > erg: > matrix(["Funktion","Ableitung","Nullstellen","Extremwerte","Wendepunkt"], > [func, transpose(abl), transpose(N),transpose(E),transpose(W)]), > return (erg) > )$ Sorry for some extra garbage. I meant to say: kurvendiskussion(func) := block( [ab1,ab2,ab3,ab4,N,E,W,l,erg,abl], ab1:ratsimp(diff(func,x)), ab2:ratsimp(diff(func,x,2)), ab3:ratsimp(diff(func,x,3)), ab4:ratsimp(diff(func,x,4)), l:realroots(func=0), N: makelist(float(ev([x,func],l[i])), i , 1, length(l)), l:realroots(ab1=0), E: makelist(float(ev([x,func],l[i])), i , 1, length(l)), l:realroots(ab2=0), W: makelist(float(ev([x,func],l[i])), i , 1, length(l)), abl: [ab1,ab2,ab3,ab4], erg: matrix(["Funktion","Ableitung","Nullstellen","Extremwerte","Wendepunkt"], [func, transpose(abl), transpose(N),transpose(E),transpose(W)]), return (erg) )$ Jaime From willisb at unk.edu Wed Apr 27 05:37:44 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 27 Apr 2011 05:37:44 -0500 Subject: [Maxima] Confused writing a function and its result - depending on reevaluation of the function In-Reply-To: <00d701cc043f$9313c960$b93b5c20$@heartsome.de> References: <00d701cc043f$9313c960$b93b5c20$@heartsome.de> Message-ID: The function f isn't local to the function kurvendiskussion--I think this causes the problem you observed. One way to fix this is to use buildq to define f to be a lambda form. Also, I eliminated your use of ev by mapping a lambda form over a list. Finally, the return statement isn't needed, so I eliminated it. Try something like: kurvendiskussion(func) :=block([ab1,ab2,ab3,ab4,N,E,W,l,erg,abl,f,xi,x], x : first(block([listdummyvars : false, listconstvars : false], listofvars(func))), f : buildq([x,func], lambda([x], func)), ab1:diff(f(x),x), ab2:diff(f(x),x,2), ab3:diff(f(x),x,3), ab4:diff(f(x),x,4), l:realroots(f(x)=0), N : map(lambda([s], [s, float(f(s))]), map('rhs,l)), l:realroots(ab1=0), E : map(lambda([s], [s, float(f(s))]), map('rhs,l)), l:realroots(ab2=0), W : map(lambda([s], [s, float(f(s))]), map('rhs,l)), abl: [ab1,ab2,ab3,ab4], matrix(["Funktion","Ableitung","Nullstellen","Extremwerte","Wendepunkt"], [func, transpose(abl), transpose(N),transpose(E),transpose(W)]))$ --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To:? >From:?"Dr.?Klemens?Waldh?r"? >Sent?by:?maxima-bounces at math.utexas.edu >Date:?04/26/2011?01:27PM >Subject:?[Maxima]?Confused?writing?a?function?and?its?result?-?depending >on reevaluation?of?the?function > >I?have?written?the?follwoing?function?which?basically?does?some?function >discussion: > >kurvendiskussion(func)?:= >block( >[ab1,ab2,ab3,ab4,N,E,W,l,erg,abl,x,f,xi], >f:?ratsimp(func), >f(x):=''f, >ab1:diff(f(x),x), >ab2:diff(f(x),x,2), >ab3:diff(f(x),x,3), >ab4:diff(f(x),x,4), >l:realroots(f(x)=0), >N:?makelist([xi:float(ev(x,l[i])),?float(f(xi))],?i?,?1,?length(l)), >l:realroots(ab1=0), >E:?makelist([xi:float(ev(x,l[i])),?float(f(xi))],?i?,?1,?length(l)), >l:realroots(ab2=0), >W:?makelist([xi:float(ev(x,l[i])),?float(f(xi))],?i?,?1,?length(l)), >abl:?[ab1,ab2,ab3,ab4], >erg: >matrix(["Funktion","Ableitung","Nullstellen","Extremwerte","Wendepunkt"], >[func,?transpose(abl),?transpose(N),transpose(E),transpose(W)]), >return?(erg) >)$ > > >I?call?it?in?this?way: > >f:?(x-3)*(x+4)*(x-7)/20; >ergebnis:?kurvendiskussion(f)$ >disp("","Aufgabe",ergebnis)$ > >When?I?call?it?first?I'll?get: > >"Aufgabe" >matrix(["Funktion","Ableitung","Nullstellen","Extremwerte","Wendepunkt"],[ >(( >x-7)*(x-3)*(x+4))/20,matrix([(3*x^2-12*x-19)/20],[(6*x-12)/20],[3/10],[0]) >,m >atrix([[-4.0,0.05*(x^3-6.0*x^2-19.0*x+84.0)]],[[3.0,0.05*(x^3-6.0*x^2-19.0 >*x >+84.0)]],[[7.0,0.05*(x^3-6.0*x^2-19.0*x+84.0)]]),matrix([[-1.2145502269268 >04 >,0.05*(x^3-6.0*x^2-19.0*x+84.0)]],[[5.214550226926804,0.05*(x^3-6.0*x^2-19 >.0 >*x+84.0)]]),matrix([[2.0,0.05*(x^3-6.0*x^2-19.0*x+84.0)]])]) > >Which?I?do?not?really?want?as?I?want?the?real?values.?Now?I?evaluate?the >above?function?definition?again?and?rerun?the?previous?call.?Now?I?get: >"Aufgabe" >matrix(["Funktion","Ableitung","Nullstellen","Extremwerte","Wendepunkt"],[ >(( >x-7)*(x-3)*(x+4))/20,matrix([((x-3)*(x+4))/20+((x-7)*(x+4))/20+((x-7)*(x-3 >)) >/20],[(x+4)/10+(x-3)/10+(x-7)/10],[3/10],[0]),matrix([[-4.0,0.0]],[[3.0,0. >0] >],[[7.0,0.0]]),matrix([[-1.214550226926804,4.821701928786462]],[[5.2145502 >26 >926804,-1.821701928786462]]),matrix([[2.0,1.5]])]) >That's?actually?what?I?like... > >Any?idea?what?I?do?wrong? > >Attached?also?a?file?in?wxm?Format?which?contains?the?function >definitions. > >Thanks?for?help?on?this. > >BTW:?Does?anyone?know?a?good?description?about?Maxima?programming? > >Klemens > > > >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima [attachment "kurvendiskussion.wxm" removed by Barton Willis/MATH/UNK/UNEBR] From carbajal at ifi.uzh.ch Wed Apr 27 09:19:45 2011 From: carbajal at ifi.uzh.ch (Juan Pablo Carbajal) Date: Wed, 27 Apr 2011 16:19:45 +0200 Subject: [Maxima] Contribution: Adomian decomposition method 1D Message-ID: Dear all, Find attached a simple file with a function that generates the Adomian polynomials of a given nonlinear function around a given argument function. These polynomials are used in the Adomian decomposition method for the solution of nonlinear differential equations, which provides an analytical solution of the equations as a series of the Adomian polynomials. The file AdomianTest.wxm is meant as a test and example. You should change the path to the mac file in your system. I guess the polynomials could be implemented using the built-in taylor function, but I applied directly the recipe from Adomian's book and article. The current implementation is not fast, comments and suggestions are welcome. -- M. Sc. Juan Pablo Carbajal ----- PhD Student University of Z?rich www.ailab.ch/carbajal -------------- next part -------------- A non-text attachment was scrubbed... Name: Adomian.mac Type: application/octet-stream Size: 2686 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: AdomianTest.wxm Type: application/octet-stream Size: 915 bytes Desc: not available URL: From macrakis at alum.mit.edu Wed Apr 27 10:04:23 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 27 Apr 2011 11:04:23 -0400 Subject: [Maxima] Confused writing a function and its result - depending on reevaluation of the function In-Reply-To: <00d701cc043f$9313c960$b93b5c20$@heartsome.de> References: <00d701cc043f$9313c960$b93b5c20$@heartsome.de> Message-ID: As Jaime has said, it is generally better to work with *expressions* than with *named functions* in Maxima. But I just wanted to clarify the semantics of some of the constructs you used in your code: f(x):=... > Function definitions are global, not local. To make them local, you can use local(f) in the function block, but I would recommend you not define a function at all. ...:=''f, > The '' operator takes effect when your function is READ into the system, NOT when it is executed, so this will not have the expected effect. > N: makelist([xi:float(ev(x,l[i])), float(f(xi))], i , 1, length(l)), > I would recommend subst(l[i],x) rather than ev. > return (erg) > The value of the last expression in a function is the returned value, so you don't need return here. -s > > I call it in this way: > > f: (x-3)*(x+4)*(x-7)/20; > ergebnis: kurvendiskussion(f)$ > disp("","Aufgabe",ergebnis)$ > > When I call it first I'll get: > > "Aufgabe" > > matrix(["Funktion","Ableitung","Nullstellen","Extremwerte","Wendepunkt"],[(( > > x-7)*(x-3)*(x+4))/20,matrix([(3*x^2-12*x-19)/20],[(6*x-12)/20],[3/10],[0]),m > > atrix([[-4.0,0.05*(x^3-6.0*x^2-19.0*x+84.0)]],[[3.0,0.05*(x^3-6.0*x^2-19.0*x > +84.0)]],[[7.0,0.05*(x^3-6.0*x^2-19.0*x+84.0)]]),matrix([[-1.2145502269 > 26804 > > ,0.05*(x^3-6.0*x^2-19.0*x+84.0)]],[[5.214550226926804,0.05*(x^3-6.0*x^2-19.0 > *x+84.0)]]),matrix([[2.0,0.05*(x^3-6.0*x^2-19.0*x+84.0)]])]) > > Which I do not really want as I want the real values. Now I evaluate the > above function definition again and rerun the previous call. Now I get: > "Aufgabe" > > matrix(["Funktion","Ableitung","Nullstellen","Extremwerte","Wendepunkt"],[(( > > x-7)*(x-3)*(x+4))/20,matrix([((x-3)*(x+4))/20+((x-7)*(x+4))/20+((x-7)*(x-3)) > > /20],[(x+4)/10+(x-3)/10+(x-7)/10],[3/10],[0]),matrix([[-4.0,0.0]],[[3.0,0.0] > ],[[7.0,0.0]]),matrix([[-1.2145502269 > 26804,4.821701928786462]],[[5.214550226 > 926804,-1.821701928786462]]),matrix([[2.0,1.5]])]) > That's actually what I like... > > Any idea what I do wrong? > > Attached also a file in wxm Format which contains the function definitions. > > Thanks for help on this. > > BTW: Does anyone know a good description about Maxima programming? > > Klemens > > > > > _______________________________________________ > 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 Wed Apr 27 11:40:34 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 27 Apr 2011 10:40:34 -0600 Subject: [Maxima] expand before simplification? In-Reply-To: <4DB7CFB0.3050603@gmail.com> References: <4DB7CFB0.3050603@gmail.com> Message-ID: The problem is that (a . b) . c doesn't match the rule even though a . c or b . c does match the rule. Try extending basisp to recognize products of operators: basisp (x) := op (x) = 'ket or (op (x) = "." and every (basisp, args (x))); I didn't try that; it might be wrong. It turns out the problem doesn't really have anything to do with using intermediate variables, for what it's worth. best Robert Dodier On 4/27/11, Fernando Aguayo wrote: > Oops! > It seems I oversimplified the example, and my mistake of writing an "i" > instead of 1 lead me to think it was good enough. Let me show you a more > complete (non) working example of what my problem is: > > I need to use several operators over a "vector", so I make the following: > > kill(rules)$ > dotdistrib:true$ > dotscrules:true$ > basis:{a,ad}$ > > basisp(x):=elementp(x,basis)$ > ketp(x):=is(equal(op(x),ket))$ > > matchdeclare (i,integerp)$ > matchdeclare([Z1,Z2,Z3],basisp)$ > matchdeclare(K1,ketp )$ > > simp:false$ > tellsimp(Z1[i] . K1, ket(evolve(Z1,i,K1)))$ > simp:true$ > > phi:ket(n)$ > r:a[1].ad[2]$ > a[1].ad[2] . phi; > r.phi; > > So, is basically the same, but now I'm using two operators. The output > of this is: > (%o33) |evolve(a,1,|evolve(ad,2,|n>)>)> > (%o34) a[1] . |evolve(ad,2,|n>)> > > (I have defined the output of ket(n) as |n>) > So If I write the complete expression it will work, but if I use an > auxilary variable it > will apply the rule correctly once, but not the second time. This happes > for any > number of operators. How can I make it apply the rules for the whole > expression? > > Thanks! > > On 4/27/2011 12:00 AM, Robert Dodier wrote: >> Well, the problem is that i is not known to be an integer. >> You could try this: >> matchdeclare (i, lambda ([e], integerp (e) or featurep (e, integer))); >> and then after the rule, >> declare (i, integer); >> or you relax the matchdeclare for i to accept any symbol: >> matchdeclare (i, symbolp); >> and then it will match i without any declaration for i. >> >> HTH >> >> Robert Dodier >> >> On 4/26/11, beren olvar wrote: >>> Hi, >>> >>> I'm using tellsimp to write some simple rules to work with some operators >>> (a, ad) acting on some vectors(ket,bra). >>> So far I have something like this: >>> >>> basis:{a,ad}$ >>> basisp(x):=elementp(x,basis)$ >>> ketp(x):=is(equal(op(x),ket))$ >>> >>> matchdeclare(K1,ketp )$ >>> matchdeclare(Z1,basisp)$ >>> matchdeclare (i,integerp)$ >>> >>> simp:false$ >>> tellsimp(Z1[i].K1, evolve(Z1,i,K1))$ /*operator acting over a state >>> (ket)*/ >>> simp:true$ >>> >>> where evolve is a function I have defined before. >>> The problem is that if I use the basis elements "a" or "ad" explicitly it >>> works,for example: >>> a[1].ket(0,0,0,0); >>> gives >>> (%o1) evolve(a,1,ket(0,0,0,0)) >>> >>> but if I do something like >>> r:a[i]$ >>> r.ket(0,0,0,0); >>> >>> it will just write >>> (%o2) a[i] . ket(0,0,0,0) >>> >>> and "evolve" will not be called as it should. Is there a way I can force >>> the >>> last expansion before the simplification is attempted so my rules are >>> used? >>> Do you know of any other way I should try doing this? >>> >>> Thank you very much >>> Regards >>> Fernando >>> > > From beren.olvar at gmail.com Wed Apr 27 12:42:19 2011 From: beren.olvar at gmail.com (Fernando Aguayo) Date: Wed, 27 Apr 2011 18:42:19 +0100 Subject: [Maxima] expand before simplification? In-Reply-To: References: <4DB7CFB0.3050603@gmail.com> Message-ID: <4DB8557B.6070607@gmail.com> Thanks for your answer, but I think that is not the problem. For instance, if I write a[1].a[2].a[3].ket(1) it works, whereas, if I use r:a[1].a[2].a[3]; r.ket(1) it doesn't. So I think the rule applies. I'll try your suggestion anyways as soon as I can. Regards Fernando On 4/27/2011 5:40 PM, Robert Dodier wrote: > The problem is that (a . b) . c doesn't match the rule even > though a . c or b . c does match the rule. > Try extending basisp to recognize products of operators: > basisp (x) := op (x) = 'ket or (op (x) = "." and every (basisp, args (x))); > I didn't try that; it might be wrong. > It turns out the problem doesn't really have anything to do with > using intermediate variables, for what it's worth. > > best > > Robert Dodier > > On 4/27/11, Fernando Aguayo wrote: >> Oops! >> It seems I oversimplified the example, and my mistake of writing an "i" >> instead of 1 lead me to think it was good enough. Let me show you a more >> complete (non) working example of what my problem is: >> >> I need to use several operators over a "vector", so I make the following: >> >> kill(rules)$ >> dotdistrib:true$ >> dotscrules:true$ >> basis:{a,ad}$ >> >> basisp(x):=elementp(x,basis)$ >> ketp(x):=is(equal(op(x),ket))$ >> >> matchdeclare (i,integerp)$ >> matchdeclare([Z1,Z2,Z3],basisp)$ >> matchdeclare(K1,ketp )$ >> >> simp:false$ >> tellsimp(Z1[i] . K1, ket(evolve(Z1,i,K1)))$ >> simp:true$ >> >> phi:ket(n)$ >> r:a[1].ad[2]$ >> a[1].ad[2] . phi; >> r.phi; >> >> So, is basically the same, but now I'm using two operators. The output >> of this is: >> (%o33) |evolve(a,1,|evolve(ad,2,|n>)>)> >> (%o34) a[1] . |evolve(ad,2,|n>)> >> >> (I have defined the output of ket(n) as |n>) >> So If I write the complete expression it will work, but if I use an >> auxilary variable it >> will apply the rule correctly once, but not the second time. This happes >> for any >> number of operators. How can I make it apply the rules for the whole >> expression? >> >> Thanks! >> >> On 4/27/2011 12:00 AM, Robert Dodier wrote: >>> Well, the problem is that i is not known to be an integer. >>> You could try this: >>> matchdeclare (i, lambda ([e], integerp (e) or featurep (e, integer))); >>> and then after the rule, >>> declare (i, integer); >>> or you relax the matchdeclare for i to accept any symbol: >>> matchdeclare (i, symbolp); >>> and then it will match i without any declaration for i. >>> >>> HTH >>> >>> Robert Dodier >>> >>> On 4/26/11, beren olvar wrote: >>>> Hi, >>>> >>>> I'm using tellsimp to write some simple rules to work with some operators >>>> (a, ad) acting on some vectors(ket,bra). >>>> So far I have something like this: >>>> >>>> basis:{a,ad}$ >>>> basisp(x):=elementp(x,basis)$ >>>> ketp(x):=is(equal(op(x),ket))$ >>>> >>>> matchdeclare(K1,ketp )$ >>>> matchdeclare(Z1,basisp)$ >>>> matchdeclare (i,integerp)$ >>>> >>>> simp:false$ >>>> tellsimp(Z1[i].K1, evolve(Z1,i,K1))$ /*operator acting over a state >>>> (ket)*/ >>>> simp:true$ >>>> >>>> where evolve is a function I have defined before. >>>> The problem is that if I use the basis elements "a" or "ad" explicitly it >>>> works,for example: >>>> a[1].ket(0,0,0,0); >>>> gives >>>> (%o1) evolve(a,1,ket(0,0,0,0)) >>>> >>>> but if I do something like >>>> r:a[i]$ >>>> r.ket(0,0,0,0); >>>> >>>> it will just write >>>> (%o2) a[i] . ket(0,0,0,0) >>>> >>>> and "evolve" will not be called as it should. Is there a way I can force >>>> the >>>> last expansion before the simplification is attempted so my rules are >>>> used? >>>> Do you know of any other way I should try doing this? >>>> >>>> Thank you very much >>>> Regards >>>> Fernando >>>> >> From carbajal at ifi.uzh.ch Wed Apr 27 14:41:24 2011 From: carbajal at ifi.uzh.ch (Juan Pablo Carbajal) Date: Wed, 27 Apr 2011 21:41:24 +0200 Subject: [Maxima] [Update] Contribution: Adomian decomposition method 1D Message-ID: Dear all, I added two functions to calculate solutions of 2nd order nonlinear ODEs. In AdomianTest.wxm I added some examples. Please, note that the last one can take a few minutes (yes, an the result is not at all impressive!). Suggestions on how to improve and how to profile the code are very welcome. Thanks -- M. Sc. Juan Pablo Carbajal ----- PhD Student University of Z?rich www.ailab.ch/carbajal -------------- next part -------------- A non-text attachment was scrubbed... Name: Adomian.mac Type: application/octet-stream Size: 3275 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: AdomianODE.wxm Type: application/octet-stream Size: 1804 bytes Desc: not available URL: From robert.dodier at gmail.com Wed Apr 27 16:43:49 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 27 Apr 2011 15:43:49 -0600 Subject: [Maxima] expand before simplification? In-Reply-To: <4DB8557B.6070607@gmail.com> References: <4DB7CFB0.3050603@gmail.com> <4DB8557B.6070607@gmail.com> Message-ID: Try (a[1].a[2]).ket(1) versus a[1].(a[2].ket(1)). best Robert Dodier On 4/27/11, Fernando Aguayo wrote: > Thanks for your answer, but I think that is not the problem. > For instance, if I write a[1].a[2].a[3].ket(1) > it works, whereas, if I use > r:a[1].a[2].a[3]; > r.ket(1) > it doesn't. So I think the rule applies. I'll try your suggestion > anyways as soon as I can. > > Regards > Fernando > > On 4/27/2011 5:40 PM, Robert Dodier wrote: >> The problem is that (a . b) . c doesn't match the rule even >> though a . c or b . c does match the rule. >> Try extending basisp to recognize products of operators: >> basisp (x) := op (x) = 'ket or (op (x) = "." and every (basisp, args >> (x))); >> I didn't try that; it might be wrong. >> It turns out the problem doesn't really have anything to do with >> using intermediate variables, for what it's worth. >> >> best >> >> Robert Dodier >> >> On 4/27/11, Fernando Aguayo wrote: >>> Oops! >>> It seems I oversimplified the example, and my mistake of writing an "i" >>> instead of 1 lead me to think it was good enough. Let me show you a more >>> complete (non) working example of what my problem is: >>> >>> I need to use several operators over a "vector", so I make the following: >>> >>> kill(rules)$ >>> dotdistrib:true$ >>> dotscrules:true$ >>> basis:{a,ad}$ >>> >>> basisp(x):=elementp(x,basis)$ >>> ketp(x):=is(equal(op(x),ket))$ >>> >>> matchdeclare (i,integerp)$ >>> matchdeclare([Z1,Z2,Z3],basisp)$ >>> matchdeclare(K1,ketp )$ >>> >>> simp:false$ >>> tellsimp(Z1[i] . K1, ket(evolve(Z1,i,K1)))$ >>> simp:true$ >>> >>> phi:ket(n)$ >>> r:a[1].ad[2]$ >>> a[1].ad[2] . phi; >>> r.phi; >>> >>> So, is basically the same, but now I'm using two operators. The output >>> of this is: >>> (%o33) |evolve(a,1,|evolve(ad,2,|n>)>)> >>> (%o34) a[1] . |evolve(ad,2,|n>)> >>> >>> (I have defined the output of ket(n) as |n>) >>> So If I write the complete expression it will work, but if I use an >>> auxilary variable it >>> will apply the rule correctly once, but not the second time. This happes >>> for any >>> number of operators. How can I make it apply the rules for the whole >>> expression? >>> >>> Thanks! >>> >>> On 4/27/2011 12:00 AM, Robert Dodier wrote: >>>> Well, the problem is that i is not known to be an integer. >>>> You could try this: >>>> matchdeclare (i, lambda ([e], integerp (e) or featurep (e, >>>> integer))); >>>> and then after the rule, >>>> declare (i, integer); >>>> or you relax the matchdeclare for i to accept any symbol: >>>> matchdeclare (i, symbolp); >>>> and then it will match i without any declaration for i. >>>> >>>> HTH >>>> >>>> Robert Dodier >>>> >>>> On 4/26/11, beren olvar wrote: >>>>> Hi, >>>>> >>>>> I'm using tellsimp to write some simple rules to work with some >>>>> operators >>>>> (a, ad) acting on some vectors(ket,bra). >>>>> So far I have something like this: >>>>> >>>>> basis:{a,ad}$ >>>>> basisp(x):=elementp(x,basis)$ >>>>> ketp(x):=is(equal(op(x),ket))$ >>>>> >>>>> matchdeclare(K1,ketp )$ >>>>> matchdeclare(Z1,basisp)$ >>>>> matchdeclare (i,integerp)$ >>>>> >>>>> simp:false$ >>>>> tellsimp(Z1[i].K1, evolve(Z1,i,K1))$ /*operator acting over a state >>>>> (ket)*/ >>>>> simp:true$ >>>>> >>>>> where evolve is a function I have defined before. >>>>> The problem is that if I use the basis elements "a" or "ad" explicitly >>>>> it >>>>> works,for example: >>>>> a[1].ket(0,0,0,0); >>>>> gives >>>>> (%o1) evolve(a,1,ket(0,0,0,0)) >>>>> >>>>> but if I do something like >>>>> r:a[i]$ >>>>> r.ket(0,0,0,0); >>>>> >>>>> it will just write >>>>> (%o2) a[i] . ket(0,0,0,0) >>>>> >>>>> and "evolve" will not be called as it should. Is there a way I can >>>>> force >>>>> the >>>>> last expansion before the simplification is attempted so my rules are >>>>> used? >>>>> Do you know of any other way I should try doing this? >>>>> >>>>> Thank you very much >>>>> Regards >>>>> Fernando >>>>> >>> > > From fateman at eecs.berkeley.edu Wed Apr 27 19:43:48 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 27 Apr 2011 17:43:48 -0700 Subject: [Maxima] Confused writing a function and its result - depending on reevaluation of the function In-Reply-To: <1303899359.2514.6.camel@wigner> References: <00d701cc043f$9313c960$b93b5c20$@heartsome.de> <1303899134.2514.5.camel@wigner> <1303899359.2514.6.camel@wigner> Message-ID: <4DB8B844.8020504@eecs.berkeley.edu> On 4/27/2011 3:15 AM, Jaime Villate wrote: > On Wed, 2011-04-27 at 11:12 +0100, Jaime Villate wrote: >> kurvendiskussion(func) := >> block( >> [ab1,ab2,ab3,ab4,N,E,W,l,erg,abl,xi], >> ab1:ratsimp(diff(func,x)), >> ab1:ratsimp(diff(func,x)), >> ab2:ratsimp(diff(func,x,2)), >> ab3:ratsimp(diff(func,x,3)), >> ab4:ratsimp(diff(func,x,4)), .... I think you will find something like this works, and is much shorter. kurvendiskussion(func) := block([], local(ab, N), ab[0]:rat(func), ab[i]:=diff(ab[i-1],x), for i from 0 thru 2 do (l:realroots(ab[i]=0), N[i]: makelist(float(ev([x,func],l[j],j,1,length(l))), matrix( [funktion, ableitung, nullstellen extremwerte, wendepunkt], [func, transpose(makelist(ab[i],i,0,3)), transpose(N[0]), transpose(N[1]), transpose(N[2])]) ) From fateman at eecs.berkeley.edu Wed Apr 27 19:50:41 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 27 Apr 2011 17:50:41 -0700 Subject: [Maxima] expand before simplification? In-Reply-To: References: <4DB7CFB0.3050603@gmail.com> <4DB8557B.6070607@gmail.com> Message-ID: <4DB8B9E1.4030504@eecs.berkeley.edu> for a start, a rule tellsimp(a.b, ....) cannot be used to match any dot product of 3 or more items. next, turning simplification off around rule definitions is generally a bad idea, even though you will see examples of this, when the "pattern" being defined either simplifies away to something else, or triggers an error. If you want to define an operation that works for exactly and only 2 arguments, you can define a new operator, say Dot( ) that does exactly that. You may be able to use the built-in ".", but not if you ever use a.b.c etc. You can also experiment with tellsimpafter. Good luck RJF From willisb at unk.edu Thu Apr 28 06:33:11 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 28 Apr 2011 06:33:11 -0500 Subject: [Maxima] rtest16 tests 506 & 507 In-Reply-To: <4DB8B9E1.4030504@eecs.berkeley.edu> References: <4DB7CFB0.3050603@gmail.com> <4DB8557B.6070607@gmail.com> , <4DB8B9E1.4030504@eecs.berkeley.edu> Message-ID: Using Clozure CL, the following tests fail: rtest16.mac, problems: (506 507) rtestprintf.mac, problems: (27 54) rtest_graphs.mac, problems: (3 8 13) I did "git pull," but maybe I'm doing something wrong? --Barton From jcsantos at fc.up.pt Thu Apr 28 08:13:53 2011 From: jcsantos at fc.up.pt (=?ISO-8859-1?Q?Jos=E9_Carlos_Santos?=) Date: Thu, 28 Apr 2011 14:13:53 +0100 Subject: [Maxima] A variable belongs to some interval Message-ID: <4DB96811.9090901@fc.up.pt> Hi all, If I ask Maxima to compute cos(2*acos(.8)) or cos(3*acos(-.5)), I get the right answers. However, Maxima seems unable to simplify the expressions cos(2*acos(x)) or cos(3*acos(x)), even if I use the trigsimp command. I would like to declare that _x_ belongs to [-1,1], to see if that solves the problem. Is it possible? If not, is there some way of making Maxima "see" that cos(3*acos(x)) = 4x^3 - 3x? Best regards, Jose Carlos Santos From willisb at unk.edu Thu Apr 28 08:18:16 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 28 Apr 2011 08:18:16 -0500 Subject: [Maxima] A variable belongs to some interval In-Reply-To: <4DB96811.9090901@fc.up.pt> References: <4DB96811.9090901@fc.up.pt> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > is there some way of making Maxima "see" that >?? ?cos(3*acos(x)) = 4x^3 - 3x? (%i8) ratsimp(exponentialize(logarc(cos(3*acos(x))))); (%o8) 4*x^3-3*x --Barton From macrakis at alum.mit.edu Thu Apr 28 08:19:49 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 28 Apr 2011 09:19:49 -0400 Subject: [Maxima] A variable belongs to some interval In-Reply-To: <4DB96811.9090901@fc.up.pt> References: <4DB96811.9090901@fc.up.pt> Message-ID: trigexpand 2011/4/28 Jos? Carlos Santos > Hi all, > > If I ask Maxima to compute cos(2*acos(.8)) or cos(3*acos(-.5)), I get the > right answers. However, Maxima seems unable to simplify the expressions > cos(2*acos(x)) or cos(3*acos(x)), even if I use the trigsimp command. I > would like to declare that _x_ belongs to [-1,1], to see if that solves the > problem. Is it possible? If not, is there some way of making Maxima "see" > that > > cos(3*acos(x)) = 4x^3 - 3x? > > Best regards, > > Jose Carlos Santos > _______________________________________________ > 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 jcsantos at fc.up.pt Thu Apr 28 08:43:45 2011 From: jcsantos at fc.up.pt (=?ISO-8859-1?Q?Jos=E9_Carlos_Santos?=) Date: Thu, 28 Apr 2011 14:43:45 +0100 Subject: [Maxima] A variable belongs to some interval In-Reply-To: References: <4DB96811.9090901@fc.up.pt> Message-ID: <4DB96F11.9020101@fc.up.pt> On 28-04-2011 14:18, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > >> is there some way of making Maxima "see" that >> cos(3*acos(x)) = 4x^3 - 3x? > > (%i8) ratsimp(exponentialize(logarc(cos(3*acos(x))))); > (%o8) 4*x^3-3*x Many thanks, both to you and to Stavros Macrakis. Best regards, Jose Carlos Santos From drdieterkaiser at web.de Thu Apr 28 09:46:44 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 28 Apr 2011 16:46:44 +0200 Subject: [Maxima] rtest16 tests 506 & 507 In-Reply-To: References: <4DB7CFB0.3050603@gmail.com> <4DB8557B.6070607@gmail.com> , <4DB8B9E1.4030504@eecs.berkeley.edu> Message-ID: <1304002004.1688.6.camel@dieter> Am Donnerstag, den 28.04.2011, 06:33 -0500 schrieb Barton Willis: > Using Clozure CL, the following tests fail: > > rtest16.mac, problems: (506 507) > rtestprintf.mac, problems: (27 54) > rtest_graphs.mac, problems: (3 8 13) > > I did "git pull," but maybe I'm doing something wrong? The tests 506 & 507 in rtest16.mac are related to a "fast array" of the type hashed. The hashed array is declared in Problem 502. Problems 503, 504, and 505 put some values into the hashed array. Problem 506 shows infos about the hashed array and problem 506 lists the entries of the array. The code to the support has been reimplemented. In older versions hashed does not work. What are your results for these problems? I run these examples with SBCL. ********************** Problem 502 *************** Input: (a : make_array(hashed), done) Result: done ... Which was correct. ********************** Problem 503 *************** Input: a : 100 100 Result: 100 ... Which was correct. ********************** Problem 504 *************** Input: a : sin(x) x Result: sin(x) ... Which was correct. ********************** Problem 505 *************** Input: 2 a : y + x x y Result: 2 y + x ... Which was correct. ********************** Problem 506 *************** Input: arrayinfo(a) Result: [hash_table, 1, 100, x, x y] ... Which was correct. ********************** Problem 507 *************** Input: listarray(a) Result: 2 [100, sin(x), y + x ] ... Which was correct. Dieter Kaiser From robert.dodier at gmail.com Thu Apr 28 10:18:13 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 28 Apr 2011 09:18:13 -0600 Subject: [Maxima] expand before simplification? In-Reply-To: <4DB8B9E1.4030504@eecs.berkeley.edu> References: <4DB7CFB0.3050603@gmail.com> <4DB8557B.6070607@gmail.com> <4DB8B9E1.4030504@eecs.berkeley.edu> Message-ID: On 4/27/11, Richard Fateman wrote: > for a start, a rule tellsimp(a.b, ....) cannot be used to match any > dot product of 3 or more items. Yes, but a . b. c is actually parsed as a . (b . c) and then simplified to a . b . c (i.e. one operator with three arguments) and the tellsimp rule is applied before flattening the expression. However, it would be pretty easy to construct cases for which the tellsimp rule isn't applied as soon as the input is parsed. Then the rule could fail. e.g. input a . b . c then reevaluate it with a, b, and c bound to something. > turning simplification off around rule definitions is generally a bad idea, Not so. FWIW Robert Dodier From robert.dodier at gmail.com Thu Apr 28 10:24:39 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 28 Apr 2011 09:24:39 -0600 Subject: [Maxima] conjugate of undeclared array In-Reply-To: References: Message-ID: On 4/25/11, Barton Willis wrote: > I was looking at a conjugate bug and noticed the following: > > (%i6) declare(e,imaginary)$ > > (%i7) conjugate(e[x]); > (%o7) -e[x] > > I'd like to remove this undocumented feature before somebody decides > that they like it. > > Since declare(e[x], imaginary), doesn't work, a user will need to use a > tellsimp rule to do things like conjugate(e[x]) --> -e[x]. I don't agree that it's a bug. To be able to make a collective declaration about all e[whatever] seems like a useful feature. I wish that declare could handle subscripted variables, but that's a separate problem. best Robert Dodier From fateman at eecs.berkeley.edu Thu Apr 28 10:37:36 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 28 Apr 2011 08:37:36 -0700 Subject: [Maxima] expand before simplification? In-Reply-To: References: <4DB7CFB0.3050603@gmail.com> <4DB8557B.6070607@gmail.com> <4DB8B9E1.4030504@eecs.berkeley.edu> Message-ID: <4DB989C0.3080103@eecs.berkeley.edu> On 4/28/2011 8:18 AM, Robert Dodier wrote: > On 4/27/11, Richard Fateman wrote: > >> for a start, a rule tellsimp(a.b, ....) cannot be used to match any >> dot product of 3 or more items. > Yes, but a . b. c is actually parsed as a . (b . c) and then > simplified to a . b . c > (i.e. one operator with three arguments) and the tellsimp rule is applied > before flattening the expression. It is a really bad idea to assume that the input to a function is not simplified for tellsimp to work. > However, it would be pretty easy to construct cases for which the tellsimp > rule isn't applied as soon as the input is parsed. Then the rule could fail. > e.g. input a . b . c then reevaluate it with a, b, and c bound to something. Yes. >> turning simplification off around rule definitions is generally a bad idea, > Not so. It makes sense only if you want to place rules on things like 1/0 or 0^0. That is, you want to over-ride some built-in simplification. Otherwise it is a bad idea because (in general) the "left hand sides unsimplified" of the rules will not appear in expressions. Only some simplified version of them will appear, and either (a) they may not match or (b) it will take extra effort to make them match. To blindly copy this "simp:off / simp:on" as idiomatic usage of tellsimp is a bad idea. It may seem, superficially, that in defining a whole bunch of tellsimps that you want to define them in isolation from each other (that is, with simp turned off), but in reality the only way they can operate is with all of them interacting. You might as well face that when you define the rules so they operate together. A better way, for many tellsimps, may be to define rules via defrule, and then sequence through them as appropriate. (perhaps via ONE tellsimp or tellsimpafter). That way, in debugging, you can watch what they are doing more easily. RJF From drdieterkaiser at web.de Thu Apr 28 12:11:30 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 28 Apr 2011 19:11:30 +0200 Subject: [Maxima] Fast arrays Message-ID: <1304010690.1688.22.camel@dieter> We have two open bug reports related to "fast arrays": Bug ID: 903145 - make_array arrays not well integrated Bug ID: 1714200 - use_fast_arrays = lots of bugs The last time, I have committed some code to get "fast arrays" to work as expected. MAKE_ARRAY creates arrays of the type fixnum, flonum,and hashed. The type functional is working as expected and the display of these arrays is more consistent. The function ARRAY creates "fast arrays" of the types fixnum, flonum, and hashed, if the option variable USE_FAST_ARRAYS is true. Furthermore, the functions ARRAYINFO and LISTARRAY work for all types of "fast arrays". Because "fast arrays" are Lisp arrays in the value cell of a symbol, this type of arrays is not suited for symbolic calculations. Therefore, I think, we should not try to integrate this type of arrays better in Maxima. We should emphasize in the documentation the point, that "fast arrays" are not suitable for symbolic calculations and close the open bug reports as "won't fix". Furthermore, I would like to suggest to cut out the option variable USE_FAST_ARRAYS. This option variable breaks Maximas facilities to work symbolically with arrays. The only way to generate "fast arrays" should be the function MAKE_ARRAY. At last, I would like to suggest to cut out the type FUNCTIONAL for "fast arrays" and to simplify the code accordingly. I do not see a benefit of this functionality, but it makes the code more complicated. Dieter Kaiser From robert.dodier at gmail.com Thu Apr 28 12:49:22 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 28 Apr 2011 11:49:22 -0600 Subject: [Maxima] Fast arrays In-Reply-To: <1304010690.1688.22.camel@dieter> References: <1304010690.1688.22.camel@dieter> Message-ID: Well, a "fast array" as created when use_fast_arrays=true is actually a Lisp hash table, right? The "fast array" stuff is a replacement for the usual Maxima undeclared array which uses its own hashing scheme. I'm in favor of nuking Maxima's hashing scheme and using Lisp hash tables in Maxima undeclared arrays (keeping the hash table in a property, as it is now, not storing the hash table in the value cell). As to the question of whether or not Lisp arrays and hash tables should be stored in the value cell or in a property, I can see advantages to doing it either way. I think we could have a worthwhile discussion about it. Given the bugs in the existing implementation of fast arrays, we could probably nuke the existing fast array code. Hash tables in the value cell could come back later, in a non-buggy manner. best, Robert Dodier On 4/28/11, Dieter Kaiser wrote: > We have two open bug reports related to "fast arrays": > > Bug ID: 903145 - make_array arrays not well integrated > Bug ID: 1714200 - use_fast_arrays = lots of bugs > > The last time, I have committed some code to get "fast arrays" to work > as expected. MAKE_ARRAY creates arrays of the type fixnum, flonum,and > hashed. The type functional is working as expected and the display of > these arrays is more consistent. The function ARRAY creates "fast > arrays" of the types fixnum, flonum, and hashed, if the option variable > USE_FAST_ARRAYS is true. Furthermore, the functions ARRAYINFO and > LISTARRAY work for all types of "fast arrays". > > Because "fast arrays" are Lisp arrays in the value cell of a symbol, > this type of arrays is not suited for symbolic calculations. Therefore, > I think, we should not try to integrate this type of arrays better in > Maxima. We should emphasize in the documentation the point, that "fast > arrays" are not suitable for symbolic calculations and close the open > bug reports as "won't fix". > > Furthermore, I would like to suggest to cut out the option variable > USE_FAST_ARRAYS. This option variable breaks Maximas facilities to work > symbolically with arrays. The only way to generate "fast arrays" should > be the function MAKE_ARRAY. > > At last, I would like to suggest to cut out the type FUNCTIONAL for > "fast arrays" and to simplify the code accordingly. I do not see a > benefit of this functionality, but it makes the code more complicated. > > Dieter Kaiser > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From willisb at unk.edu Thu Apr 28 13:47:55 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 28 Apr 2011 13:47:55 -0500 Subject: [Maxima] conjugate of undeclared array In-Reply-To: References: Message-ID: There is a precedent for an subscripted thing to inherit a property: (%i1) declare(z,complex)$ (%i5) map(csign,[z, z[12]]); (%o5) [complex,complex] But (%i6) assume(p>0)$ (%i9) map(sign, [p, p[0]]); (%o9) [pos,pnz](%i6) assume(p>0)$ So, I'll let it be. --Barton maxima-bounces at math.utexas.edu wrote on 04/28/2011 10:24:39 AM: > Maxima Mailing List > > On 4/25/11, Barton Willis wrote: > > > I was looking at a conjugate bug and noticed the following: > > > > (%i6) declare(e,imaginary)$ > > > > (%i7) conjugate(e[x]); > > (%o7) -e[x] > > > > I'd like to remove this undocumented feature before somebody decides > > that they like it. > > > > Since declare(e[x], imaginary), doesn't work, a user will need to use a > > tellsimp rule to do things like conjugate(e[x]) --> -e[x]. > > I don't agree that it's a bug. To be able to make a collective declaration > about all e[whatever] seems like a useful feature. > > I wish that declare could handle subscripted variables, but that's > a separate problem. > > best > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From drdieterkaiser at web.de Thu Apr 28 14:05:47 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 28 Apr 2011 21:05:47 +0200 Subject: [Maxima] Fast arrays In-Reply-To: References: <1304010690.1688.22.camel@dieter> Message-ID: <1304017547.1688.55.camel@dieter> Am Donnerstag, den 28.04.2011, 11:49 -0600 schrieb Robert Dodier: > Well, a "fast array" as created when use_fast_arrays=true is actually > a Lisp hash table, right? The "fast array" stuff is a replacement for > the usual Maxima undeclared array which uses its own hashing scheme. When use_fast_arrays=true, we can generate the following Lisp arrays: (%i1) use_fast_arrays:true$ (%i2) array(a, fixnum, 2); (%o2) "{Lisp Array: #(0 0 0)}" (%i3) array(a, flonum, 2); (%o3) "{Lisp Array: #(0.0 0.0 0.0)}" (%i4) array(a, any, 2); (%o4) "{Lisp Array: #(NIL NIL NIL)}" (%i5) array(a, hashed); (%o5) "{Lisp Array: #}" These are the arrays we can generate with MAKE_ARRAY, too. MAKE_ARRAY knows in addition the type functional (a memoizing fast array). I have suggested to cut out the memoizing fast array. It never worked in the past, until I have corrected the implementation. > I'm in favor of nuking Maxima's hashing scheme and using Lisp hash tables > in Maxima undeclared arrays (keeping the hash table in a property, > as it is now, not storing the hash table in the value cell). > > As to the question of whether or not Lisp arrays and hash tables > should be stored in the value cell or in a property, > I can see advantages to doing it either way. > I think we could have a worthwhile discussion about it. > > Given the bugs in the existing implementation of fast arrays, > we could probably nuke the existing fast array code. > Hash tables in the value cell could come back later, > in a non-buggy manner. Yes, it might be a good idea to improve Maxima arrays in general. At this time, my suggestion is to allow Lisp arrays via the function MAKE_ARRAY and to cut out the functionality of USE_FAST_ARRAYS from the function ARRAY. That is, we do not allow the generation of Lisp arrays with the function ARRAY. This way we do not mix up the functionality of Maxima arrays with Lisp arrays, which might confuse the user. There is one point I have not looked into in detail. I do not know the usage of "fast arrays" used by the translator. Dieter Kaiser From A.G.Grozin at inp.nsk.su Thu Apr 28 14:14:23 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Fri, 29 Apr 2011 02:14:23 +0700 (NOVST) Subject: [Maxima] announcement: Maxima 5.24 release In-Reply-To: References: Message-ID: Hello *, I've just committed maxima-5.24.0 to Gentoo Linux. The usual summary of run times of the test suite plus failed tests: sbcl-1.0.47 171 rtest16 (386) gcl-2.6.8_pre 175 cmucl-20b 177 ccl-1.6 260 ecl-11.1.1 352 rtest8 (126, 127) clisp-2.49 569 As before, the group of leaders are sbcl, gcl, cmucl; other lisps are considerably slower. Andrey From macrakis at alum.mit.edu Thu Apr 28 14:59:21 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 28 Apr 2011 15:59:21 -0400 Subject: [Maxima] Fast arrays In-Reply-To: References: <1304010690.1688.22.camel@dieter> Message-ID: On Thu, Apr 28, 2011 at 13:49, Robert Dodier wrote: > Well, a "fast array" as created when use_fast_arrays=true is actually > a Lisp hash table, right? No. There are two kinds of fast arrays, as documented in ? use_fast_arrays : * fixed-size zero-based declared dense array (not a sparse hasharray). These are Fortran-like arrays with fixed bounds. * hasharray Neither kind of fast array is well-integrated into Maxima. But then, the non-fast arrays are pretty ugly, too.... -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From cfrangos at telkomsa.net Thu Apr 28 21:14:57 2011 From: cfrangos at telkomsa.net (Constantine Frangos) Date: Fri, 29 Apr 2011 04:14:57 +0200 Subject: [Maxima] Compiling maxima with gcl Message-ID: <201104290414.57958.cfrangos@telkomsa.net> Dear List, I have compiled maxima 5.24 maxima-5.24.0.tar.gz with cmucl: cmucl-2011-04-x86-linux.tar.bz2 and sbcl: sbcl-1.0.47-x86-64-linux-binary.tar.bz2 However, the draw package is not displaying plots (somehow plot2d works ok). I want to try and compile maxima 5.24 on a suse linux machine with gcl: gcl-2.6.7.tar but do not know the precise steps and flag settings etc to: (1) compile gcl (2) compile maxima with gcl. Any assistance would be much appreciated. Thanks very much. Constantine Frangos. From willisb at unk.edu Thu Apr 28 20:23:27 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 28 Apr 2011 20:23:27 -0500 Subject: [Maxima] rtest16 tests 506 & 507 Message-ID: -----drdieterkaiser at web.de wrote: ----- >Am?Donnerstag,?den?28.04.2011,?06:33?-0500?schrieb?Barton?Willis: >>?Using?Clozure?CL,?the?following?tests?fail:? >>? >>??rtest16.mac,?problems:?(506?507) >>??rtestprintf.mac,?problems:?(27?54)? >>??rtest_graphs.mac,?problems:?(3?8?13) >>? >>?I?did?"git?pull,"?but?maybe?I'm?doing?something?wrong? > >The?tests?506?&?507?in?rtest16.mac?are?related?to?a?"fast?array"?of?the >type?hashed.? Using SBCL, tests 506 & 507 pass, but with Clozure these tests fail. The rtest_graphs.mac bugs seems to be problems with backwards lists; I'm guessing it's a Clozure bug. (Clozure Common Lisp Version 1.6-r14468M). ********************** Problem 506 *************** Input: arrayinfo(a) Result: [hash_table, 1, 100, x y, x] This differed from the expected result: [hash_table, 1, 100, x, x y] ********************** Problem 507 *************** Input: listarray(a) Result: 2 [100, y + x , sin(x)] This differed from the expected result: 2 [100, sin(x), x + y] 569/571 tests passed The following 2 problems failed: (506 507) Running tests in rtestode: 90/90 tests passed From slitvinov at gmail.com Fri Apr 29 09:33:22 2011 From: slitvinov at gmail.com (Litvinov Sergey) Date: Fri, 29 Apr 2011 16:33:22 +0200 Subject: [Maxima] sum, taylor, simplification Message-ID: <5rsjt1cekt.fsf@kana.aer.mw.tum.de> Why I cannot simplify this? I get taylor: unable to expand at a point specified in: This works sum(taylor( exp(-x*R[i]), x, 0, 1), i, 1, N); Maxima 5.21.1 using Lisp CLISP 2.49 (2010-07-07) From slitvinov at gmail.com Fri Apr 29 09:40:10 2011 From: slitvinov at gmail.com (Litvinov Sergey) Date: Fri, 29 Apr 2011 14:40:10 +0000 (UTC) Subject: [Maxima] sum, taylor, simplification References: <5rsjt1cekt.fsf@kana.aer.mw.tum.de> Message-ID: Litvinov Sergey gmail.com> writes: > > Why I cannot simplify this? A line is somehow missing from my message taylor(sum ( exp(-x*R[i]), i, 1, 2), x, 0, 1); It works for explicit limit taylor(sum ( exp(-x*R[i]), i, 1, 2), x, 0, 1); From slitvinov at gmail.com Fri Apr 29 09:48:30 2011 From: slitvinov at gmail.com (Litvinov Sergey) Date: Fri, 29 Apr 2011 14:48:30 +0000 (UTC) Subject: [Maxima] sum, taylor, simplification References: <5rsjt1cekt.fsf@kana.aer.mw.tum.de> Message-ID: > taylor(sum ( exp(-x*R[i]), i, 1, 2), x, 0, 1); It must be taylor(sum ( exp(-x*R[i]), i, 1, N), x, 0, 1); From robert.dodier at gmail.com Fri Apr 29 10:35:18 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 29 Apr 2011 09:35:18 -0600 Subject: [Maxima] sum, taylor, simplification In-Reply-To: <5rsjt1cekt.fsf@kana.aer.mw.tum.de> References: <5rsjt1cekt.fsf@kana.aer.mw.tum.de> Message-ID: On 4/29/11, Litvinov Sergey wrote: > Why I cannot simplify this? > > > I get > taylor: unable to expand at a point specified in: > > This works > sum(taylor( exp(-x*R[i]), x, 0, 1), i, 1, N); > > > Maxima 5.21.1 using Lisp CLISP 2.49 (2010-07-07) There's something missing from your original message (and the subsequent ones didn't fix the problem). I see something interesting here. It may or may not be related to the problem you have observed. taylor (exp (x), x, 0, 1); => /T/ 1 + x + . . . :lisp $% => ((MRAT SIMP (((MEXPT SIMP) $%E $X) $X) (%e^x21874 X21875) (($X ((1 . 1)) 0 NIL X21875 . 2)) TRUNC) PS (X21875 . 2) ((1 . 1)) ((0 . 1) 1 . 1) ((1 . 1) 1 . 1)) foo (taylor (exp (x), x, 0, 1)); => foo(x + 1) :lisp $% => (($FOO SIMP) ((MPLUS SIMP) 1 $X)) The taylor-ness of the expression was apparently thrown away when it was the argument of some other operator. I don't know if that's by design or what. best Robert Dodier From robert.dodier at gmail.com Fri Apr 29 10:38:25 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 29 Apr 2011 09:38:25 -0600 Subject: [Maxima] Compiling maxima with gcl In-Reply-To: <201104290414.57958.cfrangos@telkomsa.net> References: <201104290414.57958.cfrangos@telkomsa.net> Message-ID: It seems unlikely that the problem with the draw package will be solved by recompiling w/ GCL. Let's try to solve the problem in the draw package. Can you give more details about it? best Robert Dodier On 4/28/11, Constantine Frangos wrote: > > Dear List, > > I have compiled maxima 5.24 maxima-5.24.0.tar.gz with > cmucl: cmucl-2011-04-x86-linux.tar.bz2 > and sbcl: sbcl-1.0.47-x86-64-linux-binary.tar.bz2 > However, the draw package is not displaying plots (somehow plot2d works ok). > > I want to try and compile maxima 5.24 on a suse linux machine with > gcl: gcl-2.6.7.tar > but do not know the precise steps and flag settings etc to: (1) compile gcl > (2) compile maxima with gcl. > > Any assistance would be much appreciated. > > Thanks very much. > Constantine Frangos. > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From macrakis at alum.mit.edu Fri Apr 29 11:00:16 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 29 Apr 2011 12:00:16 -0400 Subject: [Maxima] sum, taylor, simplification In-Reply-To: References: <5rsjt1cekt.fsf@kana.aer.mw.tum.de> Message-ID: I think the problem you are reporting is this: (%i7) sum(taylor(exp(x*i),x,0,1),i,0,2); (%o7) 3+3*x (%i8) sum(taylor(exp(x*i),x,0,1),i,0,N); (%o8) 'sum(i*x+1,i,0,N) (%i9) taylor(sum(exp(x*i),i,0,2),x,0,1); (%o9) 3+3*x (%i10) taylor(sum(exp(x*i),i,0,N),x,0,1); taylor: unable to expand at a point specified in: 'sum(%e^(i*x),i,0,N) -- an error. To debug this try: debugmode(true); Presumably, he'd like %o10 to be either 'sum(i*x+1,i,0,N) Even better if it's the closed form: 1+N+(N^2+N)*x/2+... The closed form can easily be gotten in this case by setting simpsum:true : (%i28) sum(taylor(exp(x*i),x,0,1),i,0,N),simpsum:true; (%o28) (x*N^2+x*N)/2+N+1 (%i29) taylor(sum(exp(x*i),i,0,N),x,0,1),simpsum:true; (%o29) 1+N+(N^2+N)*x/2 More generally, though, for finite sums, taylor(sum(...),...) is the same as sum(taylor(...),...), so perhaps taylor should look inside sums rather than giving an error. Of course, if the user subsequently sets N to inf, all bets are off. -s PS Could you please be more explicit and precise in your problem reports in the future? Thanks. On Fri, Apr 29, 2011 at 11:35, Robert Dodier wrote: > On 4/29/11, Litvinov Sergey wrote: > > > Why I cannot simplify this? > > > > > > I get > > taylor: unable to expand at a point specified in: > > > > This works > > sum(taylor( exp(-x*R[i]), x, 0, 1), i, 1, N); > > > > > > Maxima 5.21.1 using Lisp CLISP 2.49 (2010-07-07) > > There's something missing from your original message > (and the subsequent ones didn't fix the problem). > > I see something interesting here. It may or may not be > related to the problem you have observed. > > taylor (exp (x), x, 0, 1); > => /T/ 1 + x + . . . > :lisp $% > => ((MRAT SIMP (((MEXPT SIMP) $%E $X) $X) (%e^x21874 X21875) > (($X ((1 . 1)) 0 NIL X21875 . 2)) TRUNC) > PS (X21875 . 2) ((1 . 1)) ((0 . 1) 1 . 1) ((1 . 1) 1 . 1)) > > foo (taylor (exp (x), x, 0, 1)); > => foo(x + 1) > :lisp $% > => (($FOO SIMP) ((MPLUS SIMP) 1 $X)) > > The taylor-ness of the expression was apparently thrown away > when it was the argument of some other operator. > I don't know if that's by design or what. > > 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 slitvinov at gmail.com Fri Apr 29 11:41:51 2011 From: slitvinov at gmail.com (Litvinov Sergey) Date: Fri, 29 Apr 2011 16:41:51 +0000 (UTC) Subject: [Maxima] sum, taylor, simplification References: <5rsjt1cekt.fsf@kana.aer.mw.tum.de> Message-ID: Stavros Macrakis alum.mit.edu> writes: > > I think the problem you are reporting is this: > < ... > > You reconstruction is correct. Thank you for the solution. > PS Could you please be more explicit and precise in your problem reports in the future? I am sorry for the mess. From willisb at unk.edu Fri Apr 29 13:27:51 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 29 Apr 2011 13:27:51 -0500 Subject: [Maxima] sum, taylor, simplification In-Reply-To: References: <5rsjt1cekt.fsf@kana.aer.mw.tum.de> Message-ID: maxima-bounces at math.utexas.edu wrote on 04/29/2011 10:35:18 AM: > The taylor-ness of the expression was apparently thrown away > when it was the argument of some other operator. The same happens for CRE arguments: (%i8) foo(rat(x)); (%o8) foo(x) (%i9) ?print(%); (($FOO SIMP) $X) (%o9) foo(x) I don't know what hunk of code does this. Simplifying functions that use the services of simpcheck instead of simplifya also squash CRE and taylor polynomial arguments. Some functions (trig simplification functions, for example), call taylorize to handle taylor arguments. I'd guess that the testsuite calls taylorize many many times--I hope it's fast---if it's not, blame me :( --Barton From drdieterkaiser at web.de Fri Apr 29 13:53:53 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 29 Apr 2011 20:53:53 +0200 Subject: [Maxima] sum, taylor, simplification In-Reply-To: References: <5rsjt1cekt.fsf@kana.aer.mw.tum.de> Message-ID: <1304103233.1663.5.camel@dieter> Am Freitag, den 29.04.2011, 13:27 -0500 schrieb Barton Willis: > maxima-bounces at math.utexas.edu wrote on 04/29/2011 10:35:18 AM: > > > The taylor-ness of the expression was apparently thrown away > > when it was the argument of some other operator. > > The same happens for CRE arguments: > > (%i8) foo(rat(x)); > (%o8) foo(x) > > (%i9) ?print(%); > (($FOO SIMP) $X) > (%o9) foo(x) > > I don't know what hunk of code does this. > > Simplifying functions that use the services of simpcheck instead of > simplifya > also squash CRE and taylor polynomial arguments. > > Some functions (trig simplification functions, for example), call > taylorize to handle taylor arguments. I'd guess that the testsuite > calls taylorize many many times--I hope it's fast---if it's not, > blame me :( It is the function simpargs which removes the CRE-form. This is a trace of meval, simplifya and simpargs: (%i3) foo(rat(x)); 0: (MEVAL (($FOO) (($RAT) $X))) 1: (MEVAL (($RAT) $X)) 2: (MEVAL $X) 3: (SIMPLIFYA $X NIL) 3: SIMPLIFYA returned $X 2: MEVAL returned $X 2: (SIMPLIFYA ((MRAT SIMP ($X) (#:X912)) (#:X912 1 1) . 1) NIL) 2: SIMPLIFYA returned ((MRAT SIMP ($X) (#:X912)) (#:X912 1 1) . 1) 1: MEVAL returned ((MRAT SIMP ($X) (#:X912)) (#:X912 1 1) . 1) 1: (SIMPLIFYA (($FOO) ((MRAT SIMP ($X) (#:X912)) (#:X912 1 1) . 1)) NIL) 2: (SIMPARGS (($FOO) ((MRAT SIMP ($X) (#:X912)) (#:X912 1 1) . 1)) NIL) 3: (SIMPLIFYA $X NIL) 3: SIMPLIFYA returned $X 2: SIMPARGS returned (($FOO SIMP) $X) 1: SIMPLIFYA returned (($FOO SIMP) $X) 0: MEVAL returned (($FOO SIMP) $X) (%o3) foo(x) In simpargs the argument is replaced with return value of simpcheck. But in general this is not the correct way to use simpcheck. By the way, this behavior is as old as Maxima and observable with Maxima 5.9. Dieter Kaiser From drdieterkaiser at web.de Fri Apr 29 13:56:32 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 29 Apr 2011 20:56:32 +0200 Subject: [Maxima] rtest16 tests 506 & 507 In-Reply-To: References: Message-ID: <1304103392.1663.6.camel@dieter> Am Donnerstag, den 28.04.2011, 20:23 -0500 schrieb Barton Willis: > -----drdieterkaiser at web.de wrote: ----- > > > >Am Donnerstag, den 28.04.2011, 06:33 -0500 schrieb Barton Willis: > >> Using Clozure CL, the following tests fail: > >> > >> rtest16.mac, problems: (506 507) > >> rtestprintf.mac, problems: (27 54) > >> rtest_graphs.mac, problems: (3 8 13) > >> > >> I did "git pull," but maybe I'm doing something wrong? > > > >The tests 506 & 507 in rtest16.mac are related to a "fast array" of the > >type hashed. > > Using SBCL, tests 506 & 507 pass, but with Clozure these tests fail. The rtest_graphs.mac > bugs seems to be problems with backwards lists; I'm guessing it's a Clozure bug. > (Clozure Common Lisp Version 1.6-r14468M). > > ********************** Problem 506 *************** > Input: > arrayinfo(a) > > > Result: > [hash_table, 1, 100, x y, x] > > This differed from the expected result: > [hash_table, 1, 100, x, x y] > > ********************** Problem 507 *************** > Input: > listarray(a) > > > Result: > 2 > [100, y + x , sin(x)] > > This differed from the expected result: > 2 > [100, sin(x), x + y] > > 569/571 tests passed > > The following 2 problems failed: (506 507) > Running tests in rtestode: 90/90 tests passed The results are correct, too. Only the display of Lisp arrays is different. I will cut out these examples from rtest16.mac. Dieter Kaiser From macrakis at alum.mit.edu Fri Apr 29 13:57:53 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 29 Apr 2011 14:57:53 -0400 Subject: [Maxima] sum, taylor, simplification In-Reply-To: References: <5rsjt1cekt.fsf@kana.aer.mw.tum.de> Message-ID: Arithmetic with CREs (including taylor series) is contagious. That is, rat(x) + 1 == rat(x+1). It is even contagious for some function applications, e.g. sin(taylor(x,x,0,10)) == taylor(sin(x),x,0,10). For simple aggregates, it is not contagious: [x, rat(x)] preserves the first x in general representation and the second in CRE representation. For functions which are 'unaware' of CREs, the CRE is converted to general representation, e.g. f(rat(x)) => f(x) If that were not done, then (e.g.) f(rat(x)) - f(x) would not simplify to 0. -s On Fri, Apr 29, 2011 at 14:27, Barton Willis wrote: > maxima-bounces at math.utexas.edu wrote on 04/29/2011 10:35:18 AM: > > > The taylor-ness of the expression was apparently thrown away > > when it was the argument of some other operator. > > The same happens for CRE arguments: > > (%i8) foo(rat(x)); > (%o8) foo(x) > > (%i9) ?print(%); > (($FOO SIMP) $X) > (%o9) foo(x) > > I don't know what hunk of code does this. > > Simplifying functions that use the services of simpcheck instead of > simplifya > also squash CRE and taylor polynomial arguments. > > Some functions (trig simplification functions, for example), call > taylorize to handle taylor arguments. I'd guess that the testsuite > calls taylorize many many times--I hope it's fast---if it's not, > blame me :( > > --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 biomates at telefonica.net Fri Apr 29 14:10:53 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 29 Apr 2011 21:10:53 +0200 Subject: [Maxima] Compiling maxima with gcl In-Reply-To: References: <201104290414.57958.cfrangos@telkomsa.net> Message-ID: <1304104253.1625.35.camel@trasno> Hello Robert and Constantine, > Let's try to solve the problem in the draw package. > Can you give more details about it? The problem reported by Constantine is that when he writes draw2d(explicit(sin(10*x),x,-1,3)); Gnuplot returns the following error message: "maxout.gnuplot", line 1: undefined variable: size The first line in maxout.gnuplot is: set terminal x11 enhanced size 600, 500 I have introduced option 'dimensions' recently, so that it is possible to set the size of the graphic window. This works with Gnuplot 4.4, but it seems it does not work with 4.2, which is Constantine's version, although the code above is compatible with 4.2. According to Gnuplot 4.2's documentation: set terminal x11 {} {title ""} {{no}enhanced} {font } {linewidth LW} {solid|dashed} {{no}persist} {{no}raise} {{no}ctrlq} {close} {size XX,YY} {position XX,YY} I can't reproduce now the problem, since I don't have a 4.2 at hand, but I think the diagnostic is correct. Constantine, I suggest you to upgrade Gnuplot if you plan to work with package 'draw', since there are other draw features which only work with 4.4. Let me know if you have more problems. -- Mario From maxima at etherjones.us Fri Apr 29 15:27:33 2011 From: maxima at etherjones.us (Ether Jones) Date: Fri, 29 Apr 2011 13:27:33 -0700 (PDT) Subject: [Maxima] integrate(1/(1-x)) Message-ID: <233438.85820.qm@web161812.mail.bf1.yahoo.com> why is the antiderivative of f1(x) equal to 0 at x=0, but the antiderivative of f2(x) is undefined at x=0? are f1(x) and f2(x) not identical functions? f1(x):=1/(1-x); integrate(f1(x),x); f2(x):=-1/(x-1); integrate(f2(x),x); From mchecca at gmail.com Fri Apr 29 16:43:36 2011 From: mchecca at gmail.com (Michael Checca) Date: Fri, 29 Apr 2011 17:43:36 -0400 Subject: [Maxima] integrate(1/(1-x)) In-Reply-To: <233438.85820.qm@web161812.mail.bf1.yahoo.com> References: <233438.85820.qm@web161812.mail.bf1.yahoo.com> Message-ID: <4DBB3108.5000403@gmail.com> On 04/29/2011 04:27 PM, Ether Jones wrote: > > why is the antiderivative of f1(x) equal to 0 at x=0, > > but the antiderivative of f2(x) is undefined at x=0? > > are f1(x) and f2(x) not identical functions? > > f1(x):=1/(1-x); > integrate(f1(x),x); > > f2(x):=-1/(x-1); > integrate(f2(x),x); > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima I put both of the functions into Maple (my school requires us to use it even though Maxima is way better) with the same result. So it seems that it is not a Maxima bug, but a mathematical bug :) Also, if you ratsimp(f1(x)) you get f2(x), so it seems odd that they would have different antiderivatives. Perhaps a math guru could enlighten us? -- Michael Checca () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments From maxima at etherjones.us Fri Apr 29 17:44:30 2011 From: maxima at etherjones.us (Ether Jones) Date: Fri, 29 Apr 2011 15:44:30 -0700 (PDT) Subject: [Maxima] integrate(1/(1-x)) In-Reply-To: <4DBB3108.5000403@gmail.com> Message-ID: <475235.67771.qm@web161815.mail.bf1.yahoo.com> After pondering this further, I realized that "integrate(f1(x),x)" returns the antiderivative in the domain x=[-inf..1) whereas ""integrate(f2(x),x)" returns the antiderivative in the domain x=(1,+inf] How do I tell Maxima what the domain of "x" is, so that it returns the desired antiderivative? --- On Fri, 4/29/11, Michael Checca wrote: > From: Michael Checca > Subject: Re: [Maxima] integrate(1/(1-x)) > To: maxima at math.utexas.edu > Date: Friday, April 29, 2011, 5:43 PM > On 04/29/2011 04:27 PM, Ether Jones > wrote: > > > > why is the antiderivative of f1(x) equal to 0 at x=0, > > > > but the antiderivative of f2(x) is undefined at x=0? > > > > are f1(x) and f2(x) not identical functions? > > > > f1(x):=1/(1-x); > > integrate(f1(x),x); > > > > f2(x):=-1/(x-1); > > integrate(f2(x),x); > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > I put both of the functions into Maple (my school requires > us to use it > even though Maxima is way better) with the same result. So > it seems that > it is not a Maxima bug, but a mathematical bug :) Also, if > you > ratsimp(f1(x)) you get f2(x), so it seems odd that they > would have > different antiderivatives. Perhaps a math guru could > enlighten us? > > -- > Michael Checca > > ()? ascii ribbon campaign - against html e-mail > /\? www.asciiribbon.org???- against > proprietary attachments > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From woollett at charter.net Sat Apr 30 17:13:03 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 30 Apr 2011 15:13:03 -0700 Subject: [Maxima] Quark Gluon Hard Scattering Batch File Message-ID: <26B764AA99D34E76BD8FA8CD260B5A21@edwinc367e16bd> Quark Gluon Hard Scattering Processes We begin a series of batch files containing simple tree level QCD hard scattering calculations. Each batch file includes references and a copy of the batch file run. The version 2 Dirac package (dirac2.mac) needs to be loaded, and in addition the file qcd1.mac needs to be loaded as well. The latter file contains explicit matrix definitions of the eight SU(3) group 3 x 3 color matrices T[a], a = 1,2,..,8, and also calculates the antisymmetric gauge group structure contants f[a,b,c], and the symmetric structure constants d[a,b,c] for use in calculations. Current files: 1. qcd1.mac: Color matrices and structure constants 2. qq-qq1.mac: Quark-quark scattering via gluon exchange, April 30, 2011, Maxima 5.24.0 Ted Woollett http://www.csulb.edu/~woollett From luigi_marino2 at alice.it Sun May 1 01:54:39 2011 From: luigi_marino2 at alice.it (Luigi Marino) Date: Sun, 1 May 2011 08:54:39 +0200 Subject: [Maxima] integrate(1/(1-x)) Message-ID: <9E0ED3DD8D304271AE5EA284D013C76A@luigi3b0e34c8e> Hi Ether the correct matematic is integral of 1/(1-x ) or 1/(x-1) = log abs((x-1)) . The two functions have a discontinuty point in x=1 and the log func is definite for x>0. Best regards Luigi Marino -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sun May 1 09:27:50 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 01 May 2011 07:27:50 -0700 Subject: [Maxima] integrate(1/(1-x)) In-Reply-To: <475235.67771.qm@web161815.mail.bf1.yahoo.com> References: <475235.67771.qm@web161815.mail.bf1.yahoo.com> Message-ID: <4DBD6DE6.9060105@eecs.berkeley.edu> no no no. integrate(1/(x-1),x) returns log (x-1) which means that the anti-derivative is log(x-1) PLUS A CONSTANT. integrate(-1/(1-x),x) returns log(1-x) which means that the anti-derivative is log(1-x) PLUS ANOTHER CONSTANT. That means log(x-1)-log(1-x) is a constant. IT DOES NOT MEAN THAT IT IS ZERO. %,logcontract shows that maxima knows that, too. It returns log(-1). This is a constant. Introducing abs() in this answer is done in order to get around the fact that students don't always know as much about complex numbers as Maxima. RJF From willisb at unk.edu Sun May 1 11:07:00 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 1 May 2011 11:07:00 -0500 Subject: [Maxima] integrate(1/(1-x)) In-Reply-To: <4DBD6DE6.9060105@eecs.berkeley.edu> References: <475235.67771.qm@web161815.mail.bf1.yahoo.com>, <4DBD6DE6.9060105@eecs.berkeley.edu> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Introducing?abs()?in?this?answer?is?done?in?order?to?get?around?the?fact? >that students?don't?always?know?as?much?about?complex?numbers?as?Maxima. > >RJF If I recall correctly, definite integration sets logabs to true--this causes bugs: (%i1) f : partfrac(1/((x+%i) * (x-%i)),x); (%o1) %i/(2*(x+%i))-%i/(2*(x-%i)) Wrong: (%i2) integrate(f,x,0,1); (%o2) 0 Correct: (%i6) integrate(f,x), logabs : false$ (%i7) rectform(subst(x=1,%) - subst(x=0,%)); (%o7) %pi/4 --Barton From shinabe.munehiro at hotmail.co.jp Mon May 2 01:01:43 2011 From: shinabe.munehiro at hotmail.co.jp (Part Marty) Date: Mon, 2 May 2011 15:01:43 +0900 Subject: [Maxima] vect.mac Message-ID: You should append the below following comand to "vect.mac". tellsimpafter(etrue.etrue~ttrue,0)$ /***********example********************/ kill(all)$ load(vect)$ declare([e11,e12,e13,e21,e22,e23],nonscalar)$ e11:e22~e23$ e12:e23~e21$ e13:e21~e22$ s2:vectorsimp(e12~e13),expandcrosscross ; tellsimpafter(etrue.etrue~ttrue,0)$ ev(s2); /**********************************/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From renzodelfabbro at alice.it Sun May 1 11:47:01 2011 From: renzodelfabbro at alice.it (Renzo Del Fabbro) Date: Sun, 1 May 2011 16:47:01 +0000 (UTC) Subject: [Maxima] Simplify exponential expression Message-ID: Trying to solve a differential equation by these rows (%i1) L:10e-3;C:50e-3;R:0.5;i0:2.074;v0:0.732; (%i2) 'diff(i,t,2)+2*R*'diff(i,t)/L+i/(L*C)=0; (%i3) ode2(%,i,t); (%i4) ic2(%,t=0,i=i0,diff(i,t)=(v0-2*R*i0)/L); How can I simplify the final coefficients and exponent of the exponential solution to get a form like this i=a*%e^b+c*%e^d Thanks a lot Renzo From willisb at unk.edu Mon May 2 06:41:04 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 2 May 2011 06:41:04 -0500 Subject: [Maxima] rtest16 tests 506 & 507 In-Reply-To: <1304103392.1663.6.camel@dieter> References: , <1304103392.1663.6.camel@dieter> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >>?>Am?Donnerstag,?den?28.04.2011,?06:33?-0500?schrieb?Barton?Willis: >>?>>?Using?Clozure?CL,?the?following?tests?fail:? >>?>>? >>?>>??rtest16.mac,?problems:?(506?507) >>?>>??rtestprintf.mac,?problems:?(27?54)? >>?>>??rtest_graphs.mac,?problems:?(3?8?13) Thanks for fixing these bugs. The rtest16 and rtests_graphs tests now pass; I think the rtestprintf tests have failed for a long time. --Barton From macrakis at alum.mit.edu Mon May 2 08:47:03 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 2 May 2011 09:47:03 -0400 Subject: [Maxima] Simplify exponential expression In-Reply-To: References: Message-ID: First of all, I think you need to quote the diff in ic2: xxx: ic2(%,t=0,i=i0, ' diff(i,t)=(v0-2*R*i0)/L); ^^^ Then I think you want floating (not exact) coefficients, so ev( xxx, numer ); will give you that. -s On Sun, May 1, 2011 at 12:47, Renzo Del Fabbro wrote: > > ic2(%,t=0,i=i0,diff(i,t)=(v0-2*R*i0)/L); -------------- next part -------------- An HTML attachment was scrubbed... URL: From javier.arantegui at gmail.com Mon May 2 10:39:37 2011 From: javier.arantegui at gmail.com (Javier Arantegui) Date: Mon, 2 May 2011 17:39:37 +0200 Subject: [Maxima] Simplify exponential expression In-Reply-To: References: Message-ID: Hello, On Mon, May 2, 2011 at 3:47 PM, Stavros Macrakis wrote: > ? ? ?ev( xxx, numer ); Is there any difference between that command and "%,numer;"? Thanks, Javier -- Lee mi blog: "Un peque?o paso para Neil" http://up3n.wordpress.com/ ?Ahora tambi?n en Twitter! http://twitter.com/javierarantegui From macrakis at alum.mit.edu Mon May 2 10:44:56 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 2 May 2011 11:44:56 -0400 Subject: [Maxima] Simplify exponential expression In-Reply-To: References: Message-ID: No, "%,numer" on the command line is syntactic sugar for "ev(xxx,numer)" On Mon, May 2, 2011 at 11:39, Javier Arantegui wrote: > Hello, > > On Mon, May 2, 2011 at 3:47 PM, Stavros Macrakis > wrote: > > ev( xxx, numer ); > > Is there any difference between that command and "%,numer;"? > > Thanks, > > Javier > > > > -- > Lee mi blog: "Un peque?o paso para Neil" http://up3n.wordpress.com/ > ?Ahora tambi?n en Twitter! http://twitter.com/javierarantegui > -------------- next part -------------- An HTML attachment was scrubbed... URL: From renzodelfabbro at alice.it Mon May 2 11:07:54 2011 From: renzodelfabbro at alice.it (Renzo Del Fabbro) Date: Mon, 2 May 2011 16:07:54 +0000 (UTC) Subject: [Maxima] Simplify exponential expression References: Message-ID: Stavros Macrakis alum.mit.edu> writes: > > No, "%,numer" on the command line is syntactic sugar for "ev(xxx,numer)" and so could be ic2(%,t=0,i=i0,diff(i,t)=(v0-2*R*i0)/L),numer ; right ? Thanks Renzo From macrakis at alum.mit.edu Mon May 2 11:15:35 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 2 May 2011 12:15:35 -0400 Subject: [Maxima] Simplify exponential expression In-Reply-To: References: Message-ID: Probably. ev is a funny command (not a function, really, because it controls the evaluation of its arguments), and can have surprising effects. In general, xxx:abc$ ev(xxx,def); is NOT equivalent to ev(abc,def). For example, ev(factor(6)) => 2*3, but factor(6)$ev(%) => 6 Even worse: solve(x^2=2,x)$ %,numer; [x = -1.414213562373095,x = 1.414213562373095] ev(solve(x^2=2,x),numer); [x = 1.414213551646055*%e^(1.0*%i*%pi),x = 1.414213551646055*%e^(2.0*%i*%pi)] This is a bug, but it does show that ev(...) is not equivalent to ...$ev(%); -s On Mon, May 2, 2011 at 12:07, Renzo Del Fabbro wrote: > Stavros Macrakis alum.mit.edu> writes: > > > > > No, "%,numer" on the command line is syntactic sugar for "ev(xxx,numer)" > > and so could be > > ic2(%,t=0,i=i0,diff(i,t)=(v0-2*R*i0)/L),numer ; > > right ? > > Thanks > > Renzo > > _______________________________________________ > 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 samataros at hotmail.co.uk Tue May 3 13:26:12 2011 From: samataros at hotmail.co.uk (Samatar) Date: Tue, 3 May 2011 19:26:12 +0100 Subject: [Maxima] Draw an animated gif with black background Message-ID: Sent from my iPhone From biomates at telefonica.net Wed May 4 12:52:56 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 04 May 2011 19:52:56 +0200 Subject: [Maxima] Draw an animated gif with black background In-Reply-To: References: Message-ID: <1304531576.2741.5.camel@pc> El mar, 03-05-2011 a las 19:26 +0100, Samatar escribi?: > > Sent from my iPhone > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Hi, I don't know the question, but here is the answer, set_draw_defaults( yrange = [-1,1], background_color = black, color = yellow, user_preamble = "set border 15 lt 1 lc rgb '#ffffff'", grid = true) $ draw( terminal = animated_gif, makelist(gr2d(explicit(0.1*i*x, x, -1,1)), i, -10, 10)) $ -- Mario From fateman at eecs.berkeley.edu Fri May 6 12:15:46 2011 From: fateman at eecs.berkeley.edu (rjf droid-x) Date: Fri, 6 May 2011 10:15:46 -0700 Subject: [Maxima] integrate(1/(1-x)) In-Reply-To: <233438.85820.qm@web161812.mail.bf1.yahoo.com> References: <233438.85820.qm@web161812.mail.bf1.yahoo.com> Message-ID: <5e9b2837-9d98-4bd8-8eab-1801fa7add8b@blur> The integrals differ by a constant. :) Sent via DROID on Verizon Wireless -----Original message----- From: Ether Jones To: maxima Sent: Fri, Apr 29, 2011 20:27:38 GMT+00:00 Subject: [Maxima] integrate(1/(1-x)) why is the antiderivative of f1(x) equal to 0 at x=0, but the antiderivative of f2(x) is undefined at x=0? are f1(x) and f2(x) not identical functions? f1(x):=1/(1-x); integrate(f1(x),x); f2(x):=-1/(x-1); integrate(f2(x),x); _______________________________________________ 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 mzou at math.utexas.edu Sat May 7 10:54:50 2011 From: mzou at math.utexas.edu (Maorong Zou) Date: Sat, 07 May 2011 10:54:50 -0500 Subject: [Maxima] test, please ignore Message-ID: From germanjaber at gmail.com Sat May 7 20:22:52 2011 From: germanjaber at gmail.com (German Eduardo Jaber De Lima) Date: Sat, 7 May 2011 19:22:52 -0600 Subject: [Maxima] MuPad vs Maxima Message-ID: I found a link regarding a comparison between MuPad and Maxima: http://homepage.mac.com/peso1/MaximaMuPAD/MaxMuP-1.html The link contains a series of test to mesure the quality of both systems. There are several tests where Maxima returns incorrect results, so I'm posting this with the hopes that someone will address these issues. One example is the following problem: (C21) assume(x >= y, y >= z, z >= x)$ is( x = z ); (C22) (D22) FALSE That is the output for maxima. It should be true From fateman at eecs.berkeley.edu Sun May 8 01:32:31 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 07 May 2011 23:32:31 -0700 Subject: [Maxima] MuPad vs Maxima In-Reply-To: References: Message-ID: <4DC638FF.4080602@eecs.berkeley.edu> On 5/7/2011 6:22 PM, German Eduardo Jaber De Lima wrote: > I found a link regarding a comparison between MuPad and Maxima: > http://homepage.mac.com/peso1/MaximaMuPAD/MaxMuP-1.html > The link contains a series of test to mesure the quality of both systems. > There are several tests where Maxima returns incorrect results, so I'm > posting this with the hopes that someone will address these issues. > One example is the following problem: > (C21) assume(x>= y, y>= z, z>= x)$ is( x = z ); > (C22) > (D22) FALSE > > That is the output for maxima. It should be true > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Actually, maxima knows the answer to this because is (x>=z) returns true and is (x>z) returns false. leaving only the possibility that x=z. However, testing to see if two items are equal is probably NOT something that Maxima does by consulting the assumption database. I think it just looks at the values of x and z. They are not the same. Why? It is probably 1000X faster to treat tests for equality this way by ignoring assumptions. Whether the result should be true or not depends on what "=" means. Perhaps you (or the original poster of the test) should change the test to... is (x>=z and x<=z) which returns true. Often the comparison of systems is simply an enumeration of what features are known to the author of the test, and some of the individual comparisons are really not illuminating. For example, some systems bog down on large problems. Is this part of the test? Sometimes there are optional library routines that are needed. Sometimes (as in this case) the result that is declared to be a mistake is, in some sense, intentional by the system designers, and the author has a misconception. To get the "correct" answer he must use the system differently. (It is a different argument to say that the semantics of "=" should be changed -- one could argue that it should work really really very hard. For instance, is (sin(x)^2+cos(x)^2=1) return true? should is (exp(x)=1) return is(x=0) ? Also it seems that the link is to a page that is quite a few years old, so both systems may have changed. RJF From germanjaber at gmail.com Sun May 8 02:01:11 2011 From: germanjaber at gmail.com (German Eduardo Jaber De Lima) Date: Sun, 8 May 2011 01:01:11 -0600 Subject: [Maxima] MuPad vs Maxima In-Reply-To: <4DC638FF.4080602@eecs.berkeley.edu> References: <4DC638FF.4080602@eecs.berkeley.edu> Message-ID: Barton Willis pointed out that the correct command should be is(equals(x,z)). When I input the assumptions and use the 'is' functions together with the 'equals' function I get the expected result. The article is old (2004). I tested other examples where Maxima get wrong results in the article, they have come up right until now (although I haven't tested them all). Since I didn't know how to use the program properly, when I tested that particular example I was convinced that it was a bug. Since I find this software very useful I thought it would be nice for some of the developers to look into these issues, that was the cause of my initial email. I see now that the matter is not as serious as I thought at first. However I will continue to test their cases and I will use the bug system in case I find a bug. One thing I do find disappointing is that there doesn't seem to be a straightforward way to solve inequalities in maxima (if I'm mistaken, please do correct me). From willisb at unk.edu Sun May 8 05:37:40 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 8 May 2011 05:37:40 -0500 Subject: [Maxima] MuPad vs Maxima In-Reply-To: References: <4DC638FF.4080602@eecs.berkeley.edu>, Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >One?thing?I?do?find?disappointing?is?that?there?doesn't?seem?to?be?a >straightforward?way?to?solve?inequalities?in?maxima?(if?I'm?mistaken, >please?do?correct?me). To solve inequalities, use either to_poly_solver (calls Fourier elimination) or solve_rat_ineq. The to_poly_solver solves linear inequalities and some (not many) nonlinear inequalities: (%i1) load(to_poly_solver)$ Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:49 $ (%i6) %solve(x > max(3,10-x/5),x); (%o6) %union([25/3 12, x + 7*y < 12],[y,x]); (%o24) %union([y+120); (%o26) [[x>-1,x<1],[x>1]] Also, the Wester tests are in a folder ../tests/wester_problems, but the tests aren't in a form that Maxima can automatically run (with run_testsuite). Maybe you would like to convert the Wester tests into the Maxima regression test form of input followed by expected output: diff(x^2,x); 2*x$ diff(x^4,x); 4*x^3$ --Barton From mxue at vroomlab.com Mon May 9 10:51:56 2011 From: mxue at vroomlab.com (mxue at vroomlab.com) Date: Mon, 09 May 2011 08:51:56 -0700 Subject: [Maxima] Subject: Re: Simplify exponential expression Message-ID: <20110509085156.b7b3fc7d0c6ca0d100c8a34890539092.51d9ad1a5f.wbe@email06.secureserver.net> An HTML attachment was scrubbed... URL: From mxue at vroomlab.com Mon May 9 11:00:38 2011 From: mxue at vroomlab.com (mxue at vroomlab.com) Date: Mon, 09 May 2011 09:00:38 -0700 Subject: [Maxima] 4. Re: Simplify exponential expression (Stavros Macrakis) Message-ID: <20110509090038.b7b3fc7d0c6ca0d100c8a34890539092.bf96c1be02.wbe@email06.secureserver.net> An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon May 9 12:13:00 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 9 May 2011 13:13:00 -0400 Subject: [Maxima] 4. Re: Simplify exponential expression (Stavros Macrakis) In-Reply-To: <20110509090038.b7b3fc7d0c6ca0d100c8a34890539092.bf96c1be02.wbe@email06.secureserver.net> References: <20110509090038.b7b3fc7d0c6ca0d100c8a34890539092.bf96c1be02.wbe@email06.secureserver.net> Message-ID: It is a bug because %e^(1.0*%i*%pi) and %e^(2.0*%i*%pi) are unsimplified, and all output from all Maxima commands should be simplified (that is, should have the *default* simplifications performed). See below. Not that I'm particularly happy with %o8 and %o10, either.... -s Compare: (%i7) %e^(1.0*%i*%pi); (%o7) - 1.0 (%i8) %e^(1.0*%i*%pi),numer; (%o8) 1.2246063538223773E-16 %i - 1.0 (%i9) %e^(2.0*%i*%pi); (%o9) 1.0 (%i10) %e^(2.0*%i*%pi),numer; (%o10) 1.0 - 2.4492127076447545E-16 %i On Mon, May 9, 2011 at 12:00, wrote: > > Perhaps this should not be considered as a bug since: > > %e^(%i*%pi) = -1 > > Michael > > ------------------------------------------------------------------------------------- > > Quote: > > Message: 4 > Date: Mon, 2 May 2011 12:15:35 -0400 > From: Stavros Macrakis > To: Renzo Del Fabbro > Cc: maxima > Subject: Re: [Maxima] Simplify exponential expression > Message-ID: > Content-Type: text/plain; charset="iso-8859-1" > > Probably. ev is a funny command (not a function, really, because it > controls the evaluation of its arguments), and can have surprising effects. > > In general, xxx:abc$ ev(xxx,def); is NOT equivalent to ev(abc,def). > > For example, ev(factor(6)) => 2*3, but factor(6)$ev(%) => 6 > > Even worse: > > solve(x^2=2,x)$ %,numer; > [x = -1.414213562373095,x = 1.414213562373095] > > ev(solve(x^2=2,x),numer); > [x = 1.414213551646055*%e^(1.0*%i*%pi),x = > 1.414213551646055*%e^(2.0*%i*%pi)] > > This is a bug, but it does show that ev(...) is not equivalent to > ...$ev(%); > > -s > > > _______________________________________________ > 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 Tue May 10 06:58:35 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 10 May 2011 06:58:35 -0500 Subject: [Maxima] gcd for complex coefficient polynomials In-Reply-To: References: <20110509090038.b7b3fc7d0c6ca0d100c8a34890539092.bf96c1be02.wbe@email06.secureserver.net>, Message-ID: Let p = (z+%i-1)^2. Then gcd(p, diff(p,z)) = z+%i-1. Using the four gcd methods and the two values for algebraic, compute gcd(p, diff(p,z)): (%i1) p : z^2 + (2*%i - 2)*z - 2*%i$ (%i2) g : ['ez, 'subres, 'red, 'spmod]$ (%i3) a : [true,false]$ (%i4) m : []$ (%i5) for gx in g do ( for ax in a do ( gcd : gx, algebraic : ax, m : cons([gx,ax,gcd(p,diff(p,z))],m)))$ (%i6) funmake('matrix, cons(['gcd, 'algebraic, 'xxx],m)); (%o6) matrix([gcd,algebraic,xxx], [spmod,false,1], [spmod,true,1], [red,false,1], [red,true,z+%i-1], [subres,false,1], [subres,true,z+%i-1], [ez,false,1], [ez,true,1]) Try again, but first gfactor p: (%i7) p : gfactor(p); (%o7) (z+%i-1)^2 (%i8) m : []$ (%i9) for gx in g do ( for ax in a do ( gcd : gx, algebraic : ax, m : cons([gx,ax,gcd(p,diff(p,z))],m)))$ (%i10) funmake('matrix, cons(['gcd, 'algebraic, 'xxx],m)); (%o10) matrix([gcd,algebraic,xxx], [spmod,false,z+%i-1], [spmod,true,1], [red,false,z+%i-1], [red,true,z+%i-1], [subres,false,z+%i-1], [subres,true,z+%i-1], [ez,false,z+%i-1], [ez,true,1]) It's disappointing that *any* implementation of gcd would give different results for a factored / expanded input. And look at the spmod (default) results: The value is correct only for a factored input with algebraic equal *false*. I would have guessed that algebraic would need to be true. --Barton From Elwood151 at web.de Tue May 10 04:10:37 2011 From: Elwood151 at web.de (M) Date: Tue, 10 May 2011 11:10:37 +0200 Subject: [Maxima] Export plot result as pdf with "readable" text? Message-ID: I'm using wxMaxima 0.8.5 on MacOS X 10.6.5 I want to create pdf files from plots made with wxMaxima. It was possible when using Aquaterm as the output, which lets me save the ploted graph as EPS or PDF. However, in the PDF all the text (axes labels and numbers) is rendered as a vector graphic, so it is not searchable and "readable" text any more. I've seen PDF graphics created with gnuplot which contain "real searchable" text, so I assume that can also be done with wxMaxima. Is there a tutorial how to achieve that or can anyone help? Kind regards Martin From pbowyer at olynet.com Tue May 10 20:05:18 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Tue, 10 May 2011 18:05:18 -0700 Subject: [Maxima] getting the latest source Message-ID: <4DC9E0CE.8000100@olynet.com> Hello again: How do I obtain the current source code of Maxima via git? I tried: git clone git://maxima.git.sourceforge.net/gitroot/maxima/repo without success. I just want to experiment on a copy without the possibility of fouling up the repository. Paul Bowyer From aleksasd at mruni.eu Wed May 11 02:39:13 2011 From: aleksasd at mruni.eu (aleksasd at mruni.eu) Date: Wed, 11 May 2011 10:39:13 +0300 Subject: [Maxima] integration constant problem Message-ID: integrate((x-1)^5 answer should be (x-1)^6/6 integrate((x-1)^5*log(x-1),x) answer should be (x-1)^6*log(x-1)/6-(x-1)^6/36. Maxima 5.24.0 gives(right, but not nice): (%i1) integrate((x-1)^5,x); (%o1) x^6/6-x^5+(5*x^4)/2-(10*x^3)/3+(5*x^2)/2-x (%i2) integrate((x-1)^5*log(x-1),x); (%o2) (x^6/6-x^5+(5*x^4)/2-(10*x^3)/3+(5*x^2)/2-x)*log(x-1)+log(x-1)/6-(x^6-6*x^5+15*x^4-20*x^3+15*x^2-6*x)/36 /* nicely, better than Maple */ (%i3) integrate((x-1)^6*log(x-1),x); (%o3) ((x-1)^7*log(x-1))/7-(x-1)^7/49 How can this be corrected? From willisb at unk.edu Wed May 11 08:26:12 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 11 May 2011 08:26:12 -0500 Subject: [Maxima] integration constant problem In-Reply-To: References: Message-ID: ----maxima-bounces at math.utexas.edu wrote: ----- >Maxima?5.24.0?gives(right,?but?not?nice): >(%i1)?integrate((x-1)^5,x); >(%o1)?x^6/6-x^5+(5*x^4)/2-(10*x^3)/3+(5*x^2)/2-x >(%i2)?integrate((x-1)^5*log(x-1),x); >(%o2) >(x^6/6-x^5+(5*x^4)/2-(10*x^3)/3+(5*x^2)/2-x)*log(x-1)+log(x-1)/6-(x^6-6*x^ >5+15*x^4-20*x^3+15*x^2-6*x)/36 A method that requires trial and error and (mild) cleverness: (%i80) factor(integrate((x-1)^5,x,1,z)); (%o80) (z-1)^6/6 (%i81) facsum(integrate((x-1)^5*log(x-1),x,1,z),log(z-1)); "Is "z-1" positive, negative, or zero?"pos; (%o81) (6*(z-1)^6*log(z-1)-(z-1)^6)/36 If you search the mailing list, you might be able to find other methods for doing things like this. --Barton From l.butler at ed.ac.uk Wed May 11 08:35:02 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 11 May 2011 14:35:02 +0100 (BST) Subject: [Maxima] getting the latest source In-Reply-To: <4DC9E0CE.8000100@olynet.com> References: <4DC9E0CE.8000100@olynet.com> Message-ID: On Tue, 10 May 2011, Paul Bowyer wrote: < Hello again: < < How do I obtain the current source code of Maxima via git? < < I tried: < git clone git://maxima.git.sourceforge.net/gitroot/maxima/repo git clone git://maxima.git.sourceforge.net/gitroot/maxima/maxima The structure of the repository was changed after some discussiion and repo was split into a number of git repositories, maxima being the one with the source code. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From pbowyer at olynet.com Wed May 11 12:36:56 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Wed, 11 May 2011 10:36:56 -0700 Subject: [Maxima] getting the latest source In-Reply-To: References: <4DC9E0CE.8000100@olynet.com> Message-ID: <4DCAC938.2050403@olynet.com> On 05/11/2011 06:35 AM, Leo Butler wrote: > > On Tue, 10 May 2011, Paul Bowyer wrote: > > < Hello again: > < > < How do I obtain the current source code of Maxima via git? > < > < I tried: > < git clone git://maxima.git.sourceforge.net/gitroot/maxima/repo > > git clone git://maxima.git.sourceforge.net/gitroot/maxima/maxima > > The structure of the repository was changed after some discussiion > and repo was split into a number of git repositories, maxima being > the one with the source code. > > Leo > Thank you, Leo. That did the trick. Paul From pbowyer at olynet.com Wed May 11 17:08:38 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Wed, 11 May 2011 15:08:38 -0700 Subject: [Maxima] [maxima] xmaxima local start-up Message-ID: <4DCB08E6.1010006@olynet.com> Hello list: I have maxima-5.23.2 installed on my PCLinuxOS system, callable from "/usr/bin/xmaxima" and I just used git to download and install maxima-5-24post to ~/MaximaTest where it created: ~/MaximaTest/bin ~/MaximaTest/lib ~/MaximaTest/libexec ~/MaximaTest/share If I cd to ~/MaximaTest/bin and run ./maxima -l , I am able to run the local copy of maxima-5-24post in a shell and it finds and uses the lisp dialect I provide. If I cd to ~/MaximaTest/bin and run ./xmaxima -l , it calls xmaxima for maxima-5-23-2 and will not allow me to run the local copy of xmaxima. I tried: export PATH="~/MaximaTest/bin;~/MaximaTest/lib;~/MaximaTest/libexec;"$PATH prior to running the local copy of xmaxima with "./xmaxima" but it opens /usr/bin/xmaxima with GCL. I tried ~/MaximaTest/bin/xmaxima with the same result. I tried ~/MaximaTest/bin/xmaxima -u 5.24post -l ccl, but it shows "/usr/bin/maxima: line 174: exec: openmcl: not found" in the shell window. It seems I cannot run the local copy of xmaxima without first disabling or uninstalling maxima-5-23-2, but I'd really like to test maxima-5-24post prior to installing it permanently. Does anyone have suggestions on how I might be able to run the local version? Thanks, Paul Bowyer From l.butler at ed.ac.uk Thu May 12 05:07:08 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 12 May 2011 11:07:08 +0100 (BST) Subject: [Maxima] [maxima] xmaxima local start-up In-Reply-To: <4DCB08E6.1010006@olynet.com> References: <4DCB08E6.1010006@olynet.com> Message-ID: On Wed, 11 May 2011, Paul Bowyer wrote: < Hello list: < < I have maxima-5.23.2 installed on my PCLinuxOS system, callable from < "/usr/bin/xmaxima" < and I just used git to download and install maxima-5-24post to ~/MaximaTest < where it created: < ~/MaximaTest/bin < ~/MaximaTest/lib < ~/MaximaTest/libexec < ~/MaximaTest/share < < If I cd to ~/MaximaTest/bin and run ./maxima -l , I am able to run the < local copy of maxima-5-24post in a shell and it finds and uses the lisp < dialect I provide. < < If I cd to ~/MaximaTest/bin and run ./xmaxima -l , it calls xmaxima for < maxima-5-23-2 and will not allow me to run the local copy of xmaxima. If you are typing ./xmaxima, then this must be the script in $PWD. Do you mean that this script is calling maxima-5-23-2 or did you type 'xmaxima' and omit the leading './' ? < < I tried: < export PATH="~/MaximaTest/bin;~/MaximaTest/lib;~/MaximaTest/libexec;"$PATH I don't know if this will fix your problem, but the individual paths should be separated by colons, not semi-colons. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From coolens at kahosl.be Thu May 12 05:28:23 2011 From: coolens at kahosl.be (Hugo Coolens) Date: Thu, 12 May 2011 12:28:23 +0200 Subject: [Maxima] how to evaluate recursive function In-Reply-To: References: <4DCB08E6.1010006@olynet.com> Message-ID: I defined the following recursive formula: a(m):= if m=0 then 1 else if m=-1 then 0 else if mod(m,2)=1 then (z(m)*a(m-1)+a(m-2)) else (y(m)*a(m-1)+a(m-2)) this gives me the expected expressions for different values of m e.g. a(4)=((z(1)*y(2)+1)*z(3)+z(1))*y(4)+z(1)*y(2)+1 I now would like to (re)evaluate this result for z(1)=r1, y(2)=s*c1, z(3)=r2, y(4)=s*c2 How can this be done in Maxima? hugo From macrakis at gmail.com Thu May 12 05:56:42 2011 From: macrakis at gmail.com (Stavros Macrakis) Date: Thu, 12 May 2011 06:56:42 -0400 Subject: [Maxima] how to evaluate recursive function Message-ID: <9svew0ukqa2hnrvx2ff34xut.1305197746784@email.android.com> subst ( [ a(1) = x, a(2) = y ... ], vvv ) Hugo Coolens wrote: >I defined the following recursive formula: >a(m):= if m=0 then 1 else if m=-1 then 0 else if mod(m,2)=1 then (z(m)*a(m-1)+a(m-2)) else (y(m)*a(m-1)+a(m-2)) > >this gives me the expected expressions for different values of m e.g. >a(4)=((z(1)*y(2)+1)*z(3)+z(1))*y(4)+z(1)*y(2)+1 > >I now would like to (re)evaluate this result for z(1)=r1, y(2)=s*c1, >z(3)=r2, y(4)=s*c2 > >How can this be done in Maxima? > >hugo > >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From coolens at kahosl.be Thu May 12 06:41:27 2011 From: coolens at kahosl.be (Hugo Coolens) Date: Thu, 12 May 2011 13:41:27 +0200 Subject: [Maxima] how to evaluate recursive function In-Reply-To: <9svew0ukqa2hnrvx2ff34xut.1305197746784@email.android.com> References: <9svew0ukqa2hnrvx2ff34xut.1305197746784@email.android.com> Message-ID: Thank's a lot Stavros, subst ( [ z(1) = r1, y(2) = s*c1, z(3)=r3,y(4)=s*c2 ],vvv) does the job, I just wonder what the vvv is doing? hugo On Thu, 12 May 2011, Stavros Macrakis wrote: > subst ( [ a(1) = x, a(2) = y ... ], vvv ) > > Hugo Coolens wrote: > >> I defined the following recursive formula: >> a(m):= if m=0 then 1 else if m=-1 then 0 else if mod(m,2)=1 then (z(m)*a(m-1)+a(m-2)) else (y(m)*a(m-1)+a(m-2)) >> >> this gives me the expected expressions for different values of m e.g. >> a(4)=((z(1)*y(2)+1)*z(3)+z(1))*y(4)+z(1)*y(2)+1 >> >> I now would like to (re)evaluate this result for z(1)=r1, y(2)=s*c1, >> z(3)=r2, y(4)=s*c2 >> >> How can this be done in Maxima? >> >> hugo >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > From willisb at unk.edu Thu May 12 07:03:48 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 12 May 2011 07:03:48 -0500 Subject: [Maxima] alternative eigenvector code In-Reply-To: <9svew0ukqa2hnrvx2ff34xut.1305197746784@email.android.com> References: <9svew0ukqa2hnrvx2ff34xut.1305197746784@email.android.com> Message-ID: I wrote a Maxima function that expresses eigenvectors as polynomials in the eigenvalues; for example (%i15) alt_eigen(matrix([1,2,3],[4,5,6],[7,8,9]), 'var=z, 'maxdegree=1); (%o15) [z^2=15*z+18,[matrix([26-2*z],[2-z],[-22])],z=0,[matrix([-1],[2],[-1])]] Here, maxdegree is the highest degree polynomial that is solved. When maxdegree is 2: (%i23) alt_eigen(matrix([1,2,3],[4,5,6],[7,8,9]), 'var=z, 'maxdegree=2); (%o23) [z=(3*sqrt(33)+15)/2,[matrix([11-3*sqrt(33)],[2-(3*sqrt(33)+15)/2],[-22])],z=-(3*sqrt(33)-15)/2,[matrix([3*sqrt(33)+11],[(3*sqrt(33)-15)/2+2],[-22])],z=0,[matrix([-1],[2],[-1])]] For matrices with parameters, alt_eigen doesn't always return an expression that is correct for all values of the parameters, but it does return assumptions on the parameters (%i25) alt_eigen(matrix([2,0,1],[1,0,2],['w,0,1]), 'var=z, 'maxdegree=1); (%o25) assuming(notequal((w-2)^2*(4*w+1),0),[z^2=3*z+w-2,[matrix([-3*z-2*w+4],[-4*w-1],[z+w*(1-2*z)-2])],z=0,[matrix([0],[-1],[0])]]) When w <-- 2, output %025 simplifies to unknown: (%i26) subst(w=2,%); (%o26) unknown Comments? If you would like to test the code, I send you the 162 line file. If you all think this code is worthy, maybe it could be placed into share/linearalgebra. --Barton From coolens at kahosl.be Thu May 12 07:54:50 2011 From: coolens at kahosl.be (Hugo Coolens) Date: Thu, 12 May 2011 14:54:50 +0200 Subject: [Maxima] how to evaluate recursive function In-Reply-To: References: Message-ID: I guess it should have been like this? a(m):= if m=0 then 1 else if m=-1 then 0 else if mod(m,2)=1 then (z(m)*a(m-1)+a(m-2)) else (y(m)*a(m-1)+a(m-2)); a(4); subst ( [ z(1) = r1, y(2) = s*c1, z(3)=r3,y(4)=s*c2 ], a(4)); hugo On Thu, 12 May 2011, Stavros Macrakis wrote: > For a (1) etc. read x(1) > > T-Mobile. America?s First Nationwide 4G Network > > Hugo Coolens wrote: > >> I defined the following recursive formula: >> a(m):= if m=0 then 1 else if m=-1 then 0 else if mod(m,2)=1 then (z(m)*a(m-1)+a(m-2)) else (y(m)*a(m-1)+a(m-2)) >> >> this gives me the expected expressions for different values of m e.g. >> a(4)=((z(1)*y(2)+1)*z(3)+z(1))*y(4)+z(1)*y(2)+1 >> >> I now would like to (re)evaluate this result for z(1)=r1, y(2)=s*c1, >> z(3)=r2, y(4)=s*c2 >> >> How can this be done in Maxima? >> >> hugo >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > From pbowyer at olynet.com Thu May 12 11:22:31 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Thu, 12 May 2011 09:22:31 -0700 Subject: [Maxima] [maxima] xmaxima local start-up Message-ID: <4DCC0947.60805@olynet.com> forgot to include maxima list in my reply... -------- Original Message -------- Subject: Re: [Maxima] [maxima] xmaxima local start-up Date: Thu, 12 May 2011 09:17:55 -0700 From: Paul Bowyer To: Leo Butler On 05/12/2011 03:07 AM, Leo Butler wrote: > > On Wed, 11 May 2011, Paul Bowyer wrote: > > < Hello list: > < > < I have maxima-5.23.2 installed on my PCLinuxOS system, callable from > < "/usr/bin/xmaxima" > < and I just used git to download and install maxima-5-24post to ~/MaximaTest > < where it created: > < ~/MaximaTest/bin > < ~/MaximaTest/lib > < ~/MaximaTest/libexec > < ~/MaximaTest/share > < > < If I cd to ~/MaximaTest/bin and run ./maxima -l , I am able to run the > < local copy of maxima-5-24post in a shell and it finds and uses the lisp > < dialect I provide. > < > < If I cd to ~/MaximaTest/bin and run ./xmaxima -l, it calls xmaxima for > < maxima-5-23-2 and will not allow me to run the local copy of xmaxima. > > If you are typing ./xmaxima, then this must be the script in $PWD. > Do you mean that this script is calling maxima-5-23-2 or did you > type 'xmaxima' and omit the leading './' ? > > < > < I tried: > < export PATH="~/MaximaTest/bin;~/MaximaTest/lib;~/MaximaTest/libexec;"$PATH > > I don't know if this will fix your problem, but the individual paths > should be separated by colons, not semi-colons. > > Leo > > Thank you again, Leo. I failed to notice the semi-colons in my PATH prefix. How silly of me... That solved my problem. Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Thu May 12 11:36:28 2011 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 12 May 2011 17:36:28 +0100 Subject: [Maxima] [maxima] xmaxima local start-up In-Reply-To: <4DCB08E6.1010006@olynet.com> References: <4DCB08E6.1010006@olynet.com> Message-ID: <1305218188.2249.5.camel@wigner> On Wed, 2011-05-11 at 15:08 -0700, Paul Bowyer wrote: > I have maxima-5.23.2 installed on my PCLinuxOS system, callable from > "/usr/bin/xmaxima" > and I just used git to download and install maxima-5-24post to > ~/MaximaTest where it created: > ~/MaximaTest/bin > ~/MaximaTest/lib > ~/MaximaTest/libexec > ~/MaximaTest/share > > If I cd to ~/MaximaTest/bin and run ./maxima -l , I am able to > run the local copy of maxima-5-24post in a shell and it finds and uses > the lisp dialect I provide. > > If I cd to ~/MaximaTest/bin and run ./xmaxima -l , it calls > xmaxima for maxima-5-23-2 and will not allow me to run the local copy of > xmaxima. Hi, before doing "make install", you must have done "make" in some directory. Go to that directory where you built maxima-5-24post; you should have in that directory a script called xmaxima-local. Executing that script you should be able to run xmaxima 5.24post interacting with the maxima 5.24post that you just built. Best regards, Jaime From biomates at telefonica.net Thu May 12 13:58:49 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 12 May 2011 14:58:49 -0400 Subject: [Maxima] Colored postscript graphics in imaxima mode Message-ID: <4DCC2DE9.3090503@telefonica.net> Hello, Colored surfaces in embedded graphics (wxdraw and wxdraw3d) in emacs + imaxima are always rendered in gray levels, since the current palette is ignored. The second image in this site is an example: http://sites.google.com/site/imaximaimath/tutorial-of-imaxima/tutorial-of-imaxima-inline-graph If in the definition of function $wxdraw (imaxima.lisp), we substitute ((mequal simp) $terminal $eps) by ((mequal simp) $terminal $eps_color) something like wxdraw3d( enhanced3d = [x-z/10,x,y,z], palette = [3,6,-16], explicit(20*exp(-x^2-y^2)-10,x,-3,3,y,-3,3))$ should plot a colored surface. See screenshot: http://riotorto.users.sourceforge.net/gnuplot/func3d/emacs_color.png I'm an occasional user of emacs and I don't know if there is any special reason for using the eps terminal instead of eps_color. If not, I can commit this change. -- Mario From pbowyer at olynet.com Thu May 12 16:10:31 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Thu, 12 May 2011 14:10:31 -0700 Subject: [Maxima] 5-24post tests Message-ID: <4DCC4CC7.1080204@olynet.com> Hello again list: After I was able to run maxima-5-24post, I ran the test suite using the lisps I had available (except clisp) and here are the results. I compiled Maxima-5-24post with: 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/bin/sbcl --with-cmucl=/opt/cmucl-20c/bin/lisp --with-ccl=/usr/local/bin/ccl --with-gcl=/usr/bin/gcl I'm submitting this in the spirit of helpfulness in case it might be useful. ---------------------------------------------------------------------------------------------------------------------- Maxima-5-24post with gcl Version GCL-2.6.8pre run from xmaxima menu selection for run tests: No unexpected errors found out of 8,834 tests. real time : 367.280 secs run-gbc time : 323.740 secs child run time : 1.640 secs gbc time : 32.070 secs When run from xmaxima using "run_testsuite(display_all = true);" it quits at test 55 of rtest2 and xmaxima needs to be restarted. When run from maxima using "run_testsuite(display_all = true);" it quits at test 55 of rtest2 with a Segmentation fault. ---------------------------------------------------------------------------------------------------------------------- For a comparison: Maxima-5-23-2 with gcl Version GCL-2.6.8pre run from xmaxima menu selection for run tests: No unexpected errors found out of 8,720 tests. real time : 407.790 secs run-gbc time : 354.140 secs child run time : 1.610 secs gbc time : 42.440 secs Maxima-5-23-2 with gcl Version GCL-2.6.8pre When run from xmaxima using "run_testsuite(display_all = true);" No unexpected errors found out of 8,720 tests. real time : 441.900 secs run-gbc time : 380.580 secs child run time : 1.700 secs gbc time : 40.910 secs ---------------------------------------------------------------------------------------------------------------------- Maxima-5-24post with ccl Version 1.6-r14468M (LinuxX8632) run from xmaxima menu selection for run tests: No unexpected errors found out of 8,834 tests. (LOOP WITH ERRS = 'NIL FOR TESTENTRY IN TESTS-TO-RUN DO (IF (ATOM TESTENTRY) (PROGN (SETF TEST-FILE TESTENTRY) (SETF EXPECTED-FAILURES NIL)) (PROGN (SETF TEST-FILE (SECOND TESTENTRY)) (SETF EXPECTED-FAILURES (CDDR TESTENTRY)))) (FORMAT T (INTL:GETTEXT "Running tests in ~a: ") (IF (SYMBOLP TEST-FILE) (SUBSEQ (PRINT-INVERT-CASE TEST-FILE) 1) TEST-FILE)) (OR (ERRSET (PROGN (MULTIPLE-VALUE-SETQ (TESTRESULT TEST-COUNT) (TEST-BATCH ($FILE_SEARCH TEST-FILE $FILE_SEARCH_TESTS) EXPECTED-FAILURES :SHOW-EXPECTED DISPLAY_KNOWN_BUGS :SHOW-ALL DISPLAY_ALL :SHOWTIME TIME)) (SETF TESTRESULT (REST TESTRESULT)) (INCF TOTAL-COUNT TEST-COUNT) (WHEN TESTRESULT (INCF ERROR-COUNT (LENGTH (CDR TESTRESULT))) (SETQ ERRS (APPEND ERRS (LIST TESTRESULT)))))) (PROGN (SETQ ERROR-BREAK-FILE (FORMAT NIL "~a" TEST-FILE)) (SETQ ERRS (APPEND ERRS (LIST (LIST ERROR-BREAK-FILE "error break")))) (FORMAT T (INTL:GETTEXT "~%Caused an error break: ~a~%") TEST-FILE))) FINALLY (COND ((NULL ERRS) (FORMAT T (INTL:GETTEXT "~%~%No unexpected errors found out of ~:D tests.~%") TOTAL-COUNT)) (T (FORMAT T (INTL:GETTEXT "~%Error summary:~%")) (MAPCAR #'(LAMBDA (X) (LET ((S (IF (> (LENGTH (REST X)) 1) "s" ""))) (FORMAT T (INTL:GETTEXT "Error~a found in ~a, problem~a:~%~a~%") S (FIRST X) S (SORT (REST X) #'<)))) ERRS) (FORMAT T (INTL:GETTEXT "~&~:D test~P failed out of ~:D total tests.~%") ERROR-COUNT ERROR-COUNT TOTAL-COUNT)))) took 580,979 milliseconds (580.979 seconds) to run with 2 available CPU cores. During that period, 568,562 milliseconds (568.562 seconds) were spent in user mode 6,913 milliseconds (6.913 seconds) were spent in system mode 30,106 milliseconds (30.106 seconds) was spent in GC. 625,494,560 bytes of memory allocated. 2,384 minor page faults, 0 major page faults, 0 swaps. Additional output: Running tests in rtest2: ;Compiler warnings for "/home/pfb/MaximaTest/share/maxima/5.24post/share/linearalgebra/linalg-extra.lisp" : ; In $VANDERMONDE_MATRIX: IGNORE declaration for unknown variable LK ;Compiler warnings for "/home/pfb/MaximaTest/share/maxima/5.24post/share/linearalgebra/linalg-extra.lisp" : ; In $VANDERMONDE_MATRIX: Unused lexical variable LK66/66 tests passed Running tests in rtest16: ;Compiler warnings for "/home/pfb/MaximaTest/share/maxima/5.24post/share/lbfgs/lb1.lisp" : ; In LB1: Unused lexical variable I569/569 tests passed ---------------------------------------------------------------------------------------------------------------------- Maxima-5-24post with sbcl Version SBCL 1.0.29 run from xmaxima menu selection for run tests: Error summary: Error found in /home/pfb/MaximaTest/share/maxima/5.24post/tests/rtest16.mac, problem: (386) 1 test failed out of 8,834 total tests. Evaluation took: 439.098 seconds of real time 433.405112 seconds of total run time (429.165757 user, 4.239355 system) [ Run times consist of 9.037 seconds GC time, and 424.369 seconds non-GC time. ] 98.70% CPU 13,239 forms interpreted 8,775 lambdas converted 1,404,477,700,290 processor cycles 142 page faults 15,731,250,176 bytes consed Additional output: Running tests in rtest16: ********************** Problem 386 *************** Input: closeto(zeta(%i + 3) - (1.10721440843141 - .1482908671781754 %i), 1.e-15) Result: 3.3157171161039706e-9 This differed from the expected result: true ; in: LAMBDA NIL ; (PROG ((I 0)) ; (DECLARE (TYPE (INTEGER) I)) ; (COND ; ((= ITER 0) ; (F2CL-LIB:FFORMAT MP ; ("*************************************************" ; "~%")) ; (F2CL-LIB:FFORMAT MP ; (" N=" 1 # " NUMBER OF CORRECTIONS=" 1 # "~%" ; " INITIAL VALUES" "~%") ; N M) ; (F2CL-LIB:FFORMAT MP (" F= " 1 # " GNORM= " 1 # "~%") F GNORM) ; (COND (# # # # #)) ; (F2CL-LIB:FFORMAT MP ; ("*************************************************" ; "~%")) ; (F2CL-LIB:FFORMAT MP ; ("~%" " I NFN" "~5 at T" "FUNC" "~20 at T" "GNORM" "~19 at T" ; "STEPLENGTH" "~%" "~%"))) ; (T (IF (AND # #) (GO END_LABEL)) (COND (# #) (T # #)) (COND (# # # #)) ; (IF FINISH (F2CL-LIB:FFORMAT MP #)))) ; (GO END_LABEL) ; END_LABEL ; (RETURN (VALUES NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL))) ; --> BLOCK ; ==> ; (LET ((I 0)) ; (DECLARE (TYPE (INTEGER) I)) ; (TAGBODY ; (COND ; ((= ITER 0) (F2CL-LIB:FFORMAT MP #) (F2CL-LIB:FFORMAT MP # N M) ; (F2CL-LIB:FFORMAT MP # F GNORM) (COND #) (F2CL-LIB:FFORMAT MP #) ; (F2CL-LIB:FFORMAT MP #)) ; (T (IF # #) (COND # #) (COND #) (IF FINISH #))) ; (GO END_LABEL) ; END_LABEL ; (RETURN (VALUES NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL)))) ; ; caught STYLE-WARNING: ; The variable I is defined but never used. ; ; compilation unit finished ; caught 1 STYLE-WARNING condition ---------------------------------------------------------------------------------------------------------------------- Maxima-5-24post with sbcl Version SBCL 1.0.29 When run from xmaxima using "run_testsuite(display_all = true);" Error summary: Error found in rtest2, problem: (error break) Error found in /home/pfb/MaximaTest/share/maxima/5.24post/tests/rtest16.mac, problem: (386) 1 test failed out of 8,768 total tests. Evaluation took: 515.979 seconds of real time 500.538906 seconds of total run time (487.780846 user, 12.758060 system) [ Run times consist of 9.874 seconds GC time, and 490.665 seconds non-GC time. ] 97.01% CPU 13,239 forms interpreted 8,775 lambdas converted 1,650,394,380,192 processor cycles 72 page faults 16,401,471,360 bytes consed ---------------------------------------------------------------------------------------------------------------------- For a comparison: Maxima-5-23-2 with sbcl Version SBCL 1.0.29 run from xmaxima menu selection for run tests: Error summary: Error found in /usr/share/maxima/5.23.2/tests/rtest16.mac, problem: (385) 1 test failed out of 8,720 total tests. Evaluation took: 419.208 seconds of real time 414.646964 seconds of total run time (411.430453 user, 3.216511 system) [ Run times consist of 8.644 seconds GC time, and 406.003 seconds non-GC time. ] 98.91% CPU 12,655 forms interpreted 8,734 lambdas converted 1,340,861,056,504 processor cycles 15,153,891,032 bytes consed When run from xmaxima using "run_testsuite(display_all = true);" Error summary: Error found in /usr/share/maxima/5.23.2/tests/rtest16.mac, problem: (385) 1 test failed out of 8,720 total tests. Evaluation took: 470.009 seconds of real time 461.691811 seconds of total run time (450.815465 user, 10.876346 system) [ Run times consist of 9.493 seconds GC time, and 452.199 seconds non-GC time. ] 98.23% CPU 12,655 forms interpreted 8,734 lambdas converted 1,503,352,347,944 processor cycles 15,791,536,936 bytes consed Additional output: ********************** Problem 385 *************** Input: closeto(zeta(%i + 3) - (1.10721440843141 - .1482908671781754 %i), 1.e-15) Result: 3.3157171161039706e-9 This differed from the expected result: true ---------------------------------------------------------------------------------------------------------------------- Maxima 5-24post with cmucl Version CMU Common Lisp Snapshot 2011-02 (20B Unicode) run from xmaxima menu selection for run tests: No unexpected errors found out of 8,834 tests. ; Evaluation took: ; 357.37f0 seconds of real time ; 321.23917f0 seconds of user run time ; 31.64019f0 seconds of system run time ; 1,143,099,171,996 CPU cycles ; [Run times include 26.06f0 seconds GC run time] ; 96 page faults and ; 18,805,198,936 bytes consed. Additional output: Running tests in rtest14: ; ; Warning: This function is undefined: ; GAMMA ; 358/358 tests passed Running tests in rtest16: ; In: LAMBDA (IPRINT ITER NFUN GNORM N ...) ; (PROG (#) ; (DECLARE #) ; (COND ; # ; #) ..) ; --> BLOCK ; ==> ; (LET (#) ; (DECLARE #) ; (TAGBODY # # END_LABEL #)) ; Note: Variable I defined but never used. ; 569/569 tests passed ---------------------------------------------------------------------------------------------------------------------- From woollett at charter.net Thu May 12 17:38:22 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 12 May 2011 15:38:22 -0700 Subject: [Maxima] Export plot result as pdf with "readable" text? Message-ID: <95415DC722584657861C3C6DD63E14B0@edwinc367e16bd> On May 10, M wrote: ------------------- I'm using wxMaxima 0.8.5 on MacOS X 10.6.5 I want to create pdf files from plots made with wxMaxima. It was possible when using Aquaterm as the output, which lets me save the ploted graph as EPS or PDF. However, in the PDF all the text (axes labels and numbers) is rendered as a vector graphic, so it is not searchable and "readable" text any more. I've seen PDF graphics created with gnuplot which contain "real searchable" text, so I assume that can also be done with wxMaxima. Is there a tutorial how to achieve that or can anyone help? Kind regards Martin --------------------------- Hi Martin, Are you looking for an export tab/button which will automatically create pdf from your figure created inside Maxima? Although I am not very familiar with wxmaxima, (I use xmaxima) I don't think that feature exists yet. So just use, say, the normal latex to dvi to pdf route, using an eps file save. The following tex file has suitable plot2d code (as a comment) to test your system: ---------------------- % file wxplot2d.tex \documentclass[11pt]{article} %\usepackage{fullpage} \usepackage[dvips,top=1.5cm,left=1.5cm,right=1.5cm,foot=1cm,bottom=1.5cm]{geometry} \usepackage{times,amsmath,amsbsy,graphicx,fancyvrb,url} \usepackage[usenames]{color} \title{wxplot2d test } \author{Edwin Woollett} \begin{document} \maketitle \section{wxplot2d test with wxplot2d.tex and wx-black-red.eps} Test wxmaxima, ver. 5.23.2 with plot2d creating an eps file. \smallskip \begin{figure}[h] \centerline{\includegraphics[scale=1]{wx-black-red.eps} } \caption{ wxmaxima plot2d test with eps file } \end{figure} % plot2d code % plot2d( [u^2, u^3],[u,0,2], [x, -.2, 2.5], % [style, [lines,8,5],[lines,8,2]], % [y,-1,4] , [psfile, "c:/work5/wx-black-red.eps"] )$ % Does this look ok?? \end{document} ----------------------------- The output dvi and pdf produced look ok using wxmaxima 5.23.2 (with windows xp). Ted Woollett http://www.csulb.edu/~woollett From Elwood151 at web.de Fri May 13 02:59:19 2011 From: Elwood151 at web.de (M) Date: Fri, 13 May 2011 09:59:19 +0200 Subject: [Maxima] Export plot result as pdf with "readable" text? In-Reply-To: <95415DC722584657861C3C6DD63E14B0@edwinc367e16bd> Message-ID: Hi Edwin, thank you for your answer and for your example! Sorry, it seems that I did not write clearly what I want to do. AFAIK gnuplot can produce pdf files which contain "real" TrueType text. I want to edit Maxima plots with another tool (IPE) before including them as a PDF in my LaTeX document. As I also want to edit or re-format the axis labels and numbers with IPE, I need "real text" in the PDF. With wxMaxima on MacOS X there is an application called Aquaterm which can display a window with the gnuplot output of wxMaxima and the contents of this window can be saved as EPS or PDF. However, if I save them as a PDF, the text in the pdf is "rendered" as a vector graphic and is not editable any more (e. g. in IPE). In wxMaxima the plots created "inline" with WXplot2d can only be saved as bitmap images (.png, .jpg, .bmp), so then I also loose the text information. It would be great if there was a context menu in wxMaxima allowing me to directly save a plot result to PDF. If I get you right, this is not possible, or is there a way or workaround to save a plot from wxMaxima to PDF? The workaround I have found (and which is ok, if I don't use it too often): Maxima sends the plot (plot2d) to Aquaterm, I save it from Aquaterm as EPS, then run eps2pdf in the terminal, and the resulting pdf contains the "real text" I need. If anybody has a better solution to export to pdf directly from wxMaxima, I'd be glad to know how. Kind regards Martin > Von: Edwin Woollett > Datum: Thu, 12 May 2011 15:38:22 -0700 > An: > Cc: maxima mailing list > Betreff: Export plot result as pdf with "readable" text? > > On May 10, M wrote: > ------------------- > I'm using wxMaxima 0.8.5 on MacOS X 10.6.5 > > I want to create pdf files from plots made with wxMaxima. > It was possible when using Aquaterm as the output, which lets me save the > ploted graph as EPS or PDF. > > However, in the PDF all the text (axes labels and numbers) is rendered as a > vector graphic, so it is not searchable and "readable" text any more. > > I've seen PDF graphics created with gnuplot which contain "real searchable" > text, so I assume that can also be done with wxMaxima. > > Is there a tutorial how to achieve that or can anyone help? > > Kind regards > > Martin > --------------------------- > Hi Martin, > > Are you looking for an export tab/button > which will automatically create pdf from your > figure created inside Maxima? > > Although I am not very familiar with wxmaxima, > (I use xmaxima) I don't think that feature exists yet. > > So just use, say, the normal latex to dvi to pdf route, > using an eps file save. > > The following tex file has suitable plot2d code > (as a comment) to test your system: > > ---------------------- > % file wxplot2d.tex > \documentclass[11pt]{article} > %\usepackage{fullpage} > \usepackage[dvips,top=1.5cm,left=1.5cm,right=1.5cm,foot=1cm,bottom=1.5cm]{geom > etry} > \usepackage{times,amsmath,amsbsy,graphicx,fancyvrb,url} > \usepackage[usenames]{color} > \title{wxplot2d test } > \author{Edwin Woollett} > \begin{document} > \maketitle > \section{wxplot2d test with wxplot2d.tex and wx-black-red.eps} > Test wxmaxima, ver. 5.23.2 with plot2d creating an eps file. > \smallskip > \begin{figure}[h] > \centerline{\includegraphics[scale=1]{wx-black-red.eps} } > \caption{ wxmaxima plot2d test with eps file } > \end{figure} > > % plot2d code > % plot2d( [u^2, u^3],[u,0,2], [x, -.2, 2.5], > % [style, [lines,8,5],[lines,8,2]], > % [y,-1,4] , [psfile, "c:/work5/wx-black-red.eps"] )$ > % > > Does this look ok?? > \end{document} > ----------------------------- > The output dvi and pdf produced look ok using > wxmaxima 5.23.2 (with windows xp). > > Ted Woollett > http://www.csulb.edu/~woollett > > From biomates at telefonica.net Fri May 13 13:53:24 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 13 May 2011 14:53:24 -0400 Subject: [Maxima] Export plot result as pdf with "readable" text? In-Reply-To: References: Message-ID: <4DCD7E24.1020005@telefonica.net> On 05/13/2011 03:59 AM, M wrote: > If anybody has a better solution to export to pdf directly from wxMaxima, > I'd be glad to know how. > > Kind regards > > Martin Hello, Have you tried to use the terminal option? Both functions draw and plot can tell Gnuplot to generate the graph in pdf or eps format. See, for example, the documentation for terminal: ? terminal But I don't know if what you get is what you want. -- Mario From woollett at charter.net Fri May 13 15:35:43 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 13 May 2011 13:35:43 -0700 Subject: [Maxima] Export plot result as pdf with "readable" text? Message-ID: On May 13, Mario Rodriguez wrote: ------------------------- Have you tried to use the terminal option? Both functions draw and plot can tell Gnuplot to generate the graph in pdf or eps format. See, for example, the documentation for terminal: ? terminal But I don't know if what you get is what you want. -- Mario ----------------------------------- As well as the terminal option in draw, there is the gnuplot_term option in plot2d. If we accept the default filename output maxplot.ext (with ext = png, jpeg, svg, pdf, etc) then the option item [gnuplot_term, ext] yields the corresponding file for the produced figure. for example, working in windows xp with xmaxima: Maxima 5.24.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. 2011-05-13 (%i1) plot2d( [u^2, u^3],[u,0,2], [x, -.2, 2.5], [style, [lines,8,5],[lines,8,2]], [y,-1,4] , [gnuplot_term,png] )$ produced maxplot.png (%i2) plot2d( [u^2, u^3],[u,0,2], [x, -.2, 2.5], [style, [lines,8,5],[lines,8,2]], [y,-1,4] , [gnuplot_term,jpeg] )$ produced maxplot.jpeg (%i3) plot2d( [u^2, u^3],[u,0,2], [x, -.2, 2.5], [style, [lines,8,5],[lines,8,2]], [y,-1,4] , [gnuplot_term,svg] )$ produced maxplot.svg Can open this with inkscape. (%i4) plot2d( [u^2, u^3],[u,0,2], [x, -.2, 2.5], [style, [lines,8,5],[lines,8,2]], [y,-1,4] , [gnuplot_term,pdf] )$ this last produced maxplot.pdf with the correct curves BUT labels and legends were altered as follows: u --> greek l.c. upsilon y --> greek l.c. psi so I am not sure how the mutilation of labels and legends is cured using a windows based system. Note also, that you can specify the file name desired by adding the option item (for example) [gnuplot_out_file, "myname.png"] or [gnuplot_out_file, "c:/work5/myname.png"] etc. Ted Woollett From dbindner at truman.edu Fri May 13 15:37:08 2011 From: dbindner at truman.edu (Donald Bindner) Date: Fri, 13 May 2011 15:37:08 -0500 Subject: [Maxima] Using simplex package to solve a linear program Message-ID: I was starting on Dantzig's undegraduate text in linear programming, and wanted to work through the first exercise in Maxima. I admit to being pretty new at this, but the Maxima documentation seemed pretty clear. Yet I get answers that I suspect to be incorrect. This is my session: (%i1) load( "simplex" )$ (%i2) obj : 7.3*x1 + 6.9*x2 + 7.3*x3 + 7.5*x4 + 7.6*x5 + 6.0*x6 + 5.8*x7 + 4.3*x8 + 4.1*x9; (%i3) eq1 : x1+x2+x3+x4+x5+x6+x7+x8+x9 = 1; (%i4) eq2 : .2*x1 + .5*x2 + .3*x3 + .3*x4+ .3*x5 + .6*x6 + .4*x7 + .1*x8 + .1*x9 = .3; (%i5) eq3 : .3*x1 + .4*x2 + .2*x3 + .4*x4 + .3*x5 + .3*x6 + .5*x7 + .3*x8 + .1*x9 = .3; (%i6) eq4 : .5*x1 + .1*x2 + .5*x3 + .3*x4 + .4*x5 + .1*x6 + .1*x7 + .6*x8 + .8*x9 = .4; (%i7) eqs : [eq1,eq2,eq3,eq4]; (%i8) minimize_lp( obj, eqs), nonegative_lp=true; (%o8) [4.95, [x9 = - 0.10714285714286, x8 = 0.75, x7 = - 0.10714285714286, x6 = 0.46428571428571, x5 = 0, x4 = 0, x3 = 0, x2 = 0, x1 = 0]] According to the documentation, nonegative_lp=true is supposed to assume that all decision variables are positive, yet in this solution x9 and x7 are clearly negative. If we instead specify the constraints by hand we get: (%i9) eqs2 : [eq1,eq2,eq3,eq4,x1>0,x2>0,x3>0,x4>0,x5>0,x6>0,x7>0,x8>0,x9>0]; (%i10) minimize_lp(obj, eqs2); (%o10) [7.6, [x9 = 0.0, x8 = 0.0, x7 = 0, x6 = 0, x5 = 1.0, x4 = 0.0, x3 = 0.0, x2 = 0.0, x1 = 0.0]] This solution has all non-negative variables, however it isn't really a good minimum. We can verify, for example that there are better solutions: (%i11) obj, x6=.25,x7=.25,x8=.25,x9=.25, x1=0,x2=0,x3=0,x4=0,x5=0; (%o11) 5.05 (%i12) eqs, x6=.25,x7=.25,x8=.25,x9=.25, x1=0,x2=0,x3=0,x4=0,x5=0; (%o12) [1.0 = 1, 0.3 = 0.3, 0.3 = 0.3, 0.4 = 0.4] Am I doing something wrong, or is the simplex package not working? I have verified this behavior in both Maxima 5.22post on an Ubuntu Maverick system, and in Maxima Maxima 5.20.1 on an Ubuntu Lucid system. Thanks, Don -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbowyer at olynet.com Fri May 13 19:45:27 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Fri, 13 May 2011 17:45:27 -0700 Subject: [Maxima] test suite problems Message-ID: <4DCDD0A7.3050803@olynet.com> Hello again list: Thinking that I might have a problem with sbcl-1.0.29, I downloaded and installed sbcl-1.0.48 and then rebuilt my copy of Maxima-5.23.2 using the new sbcl. My configuration for the build was: export GCL_ANSI=y CFLAGS="-O2 -g -march=i386 -mcpu=pentium4 -fno-fast-math" CXXFLAGS="-O2 -g -march=i386 -mcpu=pentium4 -fno-fast-math" && ./configure --prefix=$HOME/Maxima-5.23.2/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 which completed properly and then I did the normal make followed by make install I ran the maxima-5.23.2 test suite using the menu option from within xmaxima and got the following: --------------------------------------------------------------------------------------------------------------------------------------------- Error summary: Error found in /home/pfb/Maxima-5.23.2/MaximaTest/share/maxima/5.23.2/tests/rtest16.mac, problem: (385) 1 test failed out of 8,720 total tests. Evaluation took: 404.704 seconds of real time 398.842366 seconds of total run time (394.044096 user, 4.798270 system) [ Run times consist of 8.588 seconds GC time, and 390.255 seconds non-GC time. ] 98.55% CPU 12,657 forms interpreted 8,626 lambdas converted 1,294,474,378,216 processor cycles 140 page faults 15,094,744,152 bytes consed Additional output from certain tests: Running tests in rtest14: STYLE-WARNING: redefining MAXIMA::SIMP-UNIT-STEP in DEFUN STYLE-WARNING: redefining MAXIMA::SIMP-POCHHAMMER in DEFUN STYLE-WARNING: redefining MAXIMA::SIMP-HYPERGEOMETRIC in DEFUN STYLE-WARNING: redefining MAXIMA::FLOAT-OR-RATIONAL-P in DEFUN 358/358 tests passed Running tests in rtest15: STYLE-WARNING: redefining MAXIMA::$F in DEFUN STYLE-WARNING: redefining MAXIMA::$F in DEFUN STYLE-WARNING: redefining MAXIMA::$F in DEFUN STYLE-WARNING: redefining MAXIMA::$F in DEFUN STYLE-WARNING: redefining MAXIMA::$F in DEFUN STYLE-WARNING: redefining MAXIMA::$F in DEFUN STYLE-WARNING: redefining MAXIMA::$F in DEFUN 252/252 tests passed Running tests in rtest16: ********************** Problem 385 *************** Input: closeto(zeta(%i + 3) - (1.10721440843141 - .1482908671781754 %i), 1.e-15) Result: 3.3157171161039706e-9 This differed from the expected result: true ; in: DEFUN LB1 ; (PROG ((I 0)) ; (DECLARE (TYPE (INTEGER) I)) ; (COND ; ((= ITER 0) ; (F2CL-LIB:FFORMAT MP ; ("*************************************************" ; "~%")) ; (F2CL-LIB:FFORMAT MP ; (" N=" 1 # " NUMBER OF CORRECTIONS=" 1 # "~%" ; " INITIAL VALUES" "~%") ; N M) ; (F2CL-LIB:FFORMAT MP (" F= " 1 # " GNORM= " 1 # "~%") F GNORM) ; (COND (# # # # #)) ; (F2CL-LIB:FFORMAT MP ; ("*************************************************" ; "~%")) ; (F2CL-LIB:FFORMAT MP ; ("~%" " I NFN" "~5 at T" "FUNC" "~20 at T" "GNORM" "~19 at T" ; "STEPLENGTH" "~%" "~%"))) ; (T ; (IF (AND # #) ; (GO END_LABEL)) ; (COND (# #) (T # #)) (COND (# # # #)) ; (IF FINISH ; (F2CL-LIB:FFORMAT MP #)))) ; (GO END_LABEL) ; END_LABEL ; (RETURN (VALUES NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL))) ; --> BLOCK ; ==> ; (LET ((I 0)) ; (DECLARE (TYPE (INTEGER) I)) ; (TAGBODY ; (COND ; ((= ITER 0) (F2CL-LIB:FFORMAT MP #) (F2CL-LIB:FFORMAT MP # N M) ; (F2CL-LIB:FFORMAT MP # F GNORM) (COND #) (F2CL-LIB:FFORMAT MP #) ; (F2CL-LIB:FFORMAT MP #)) ; (T ; (IF # ; #) ; (COND # #) (COND #) ; (IF FINISH ; #))) ; (GO END_LABEL) ; END_LABEL ; (RETURN (VALUES NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL)))) ; ; caught STYLE-WARNING: ; The variable I is defined but never used. ; ; compilation unit finished ; caught 1 STYLE-WARNING condition 485/486 tests passed The following 1 problem failed: (385) --------------------------------------------------------------------------------------------------------------------------------------------- (%i1) build_info (); Maxima version: 5.23.2 Maxima build date: 13:58 5/13/2011 Host type: i686-pc-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.48 --------------------------------------------------------------------------------------------------------------------------------------------- Am I doing something incorrectly in my build process that causes the failure in the test suite when using sbcl? I got a similar error for maxima-5.24post when using sbcl-1.0.29 (see message [Maxima] 5-24post tests ). When I run the test suite for maxima-5.23.2 using gcl Version GCL-2.6.8pre, I get no errors. When I try running the test suite for maxima-5.24post using gcl Version GCL-2.6.8pre, it runs to completion if I run it from the menu in xmaxima, but if I run it using "run_testsuite(display_all = true);" from within xmaxima or from a KDE Konsole session where I've run "./maxima" with the appropriate path settings, it halts at test 55 of rtest2 with a Segmentation fault. What's the likely cause of that problem and why should there be so much difference between maxima-5.23.2 and Maxima-5.24post? Thanks, Paul Bowyer From andrej.vodopivec at gmail.com Sat May 14 00:22:55 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Sat, 14 May 2011 07:22:55 +0200 Subject: [Maxima] Using simplex package to solve a linear program In-Reply-To: References: Message-ID: The implementation of the simplex algorithm is not very sophisticated. You get an error, probably because of numerical instability. You can convert the coefficients in the problem to rational numbers and that will give you a better solution: (%i1) load(simplex)$ (%i2) obj : 7.3*x1 + 6.9*x2 + 7.3*x3 + 7.5*x4 + 7.6*x5 + 6.0*x6 + 5.8*x7 + 4.3*x8 + 4.1*x9$ (%i3) eq1 : x1+x2+x3+x4+x5+x6+x7+x8+x9 = 1$ (%i4) eq2 : .2*x1 + .5*x2 + .3*x3 + .3*x4+ .3*x5 + .6*x6 + .4*x7 + .1*x8 + .1*x9 = .3$ (%i5) eq3 : .3*x1 + .4*x2 + .2*x3 + .4*x4 + .3*x5 + .3*x6 + .5*x7 + .3*x8 + .1*x9 = .3$ (%i6) eq4 : .5*x1 + .1*x2 + .5*x3 + .3*x4 + .4*x5 + .1*x6 + .1*x7 + .6*x8 + .8*x9 = .4$ (%i7) eqs : [eq1,eq2,eq3,eq4]$ (%i8) [opt_val, sol]: minimize_lp( ratsimp(obj), ratsimp(eqs), all), ratprint=false; (%o8) [249/50,[x9=0,x8=3/5,x7=0,x6=2/5,x5=0,x4=0,x3=0,x2=0,x1=0]] (%i9) %, numer; (%o9) [4.98,[x9=0,x8=0.6,x7=0,x6=0.4,x5=0,x4=0,x3=0,x2=0,x1=0]] (%i10) opt_val - obj, sol; (%o10) 0.0 (%i11) eqs, sol; (%o11) [1=1,0.3=0.3,0.3=0.3,0.4=0.4] Lp, Andrej On Fri, May 13, 2011 at 10:37 PM, Donald Bindner wrote: > I was starting on Dantzig's undegraduate text in linear programming, and > wanted to work through the first exercise in Maxima. ?I admit to being > pretty new at this, but the Maxima documentation seemed pretty clear. ?Yet I > get answers that I suspect to be incorrect. ?This is my session: > (%i1) load( "simplex" )$ > (%i2) obj : 7.3*x1 + 6.9*x2 + 7.3*x3 + 7.5*x4 + 7.6*x5 + 6.0*x6 + 5.8*x7 + > 4.3*x8 + 4.1*x9; > (%i3) eq1 : x1+x2+x3+x4+x5+x6+x7+x8+x9 = 1; > (%i4) eq2 : .2*x1 + .5*x2 + .3*x3 + .3*x4+ .3*x5 + .6*x6 + .4*x7 + .1*x8 + > .1*x9 = .3; > (%i5) eq3 : .3*x1 + .4*x2 + .2*x3 + .4*x4 + .3*x5 + .3*x6 + .5*x7 + .3*x8 + > .1*x9 = .3; > (%i6) eq4 : .5*x1 + .1*x2 + .5*x3 + .3*x4 + .4*x5 + .1*x6 + .1*x7 + .6*x8 + > .8*x9 = .4; > (%i7) eqs : [eq1,eq2,eq3,eq4]; > (%i8) minimize_lp( obj, eqs), nonegative_lp=true; > (%o8) [4.95, [x9 = - 0.10714285714286, x8 = 0.75, x7 = - 0.10714285714286, > ? ? ? ? ? ? ? ? x6 = 0.46428571428571, x5 = 0, x4 = 0, x3 = 0, x2 = 0, x1 = > 0]] > According to the documentation, nonegative_lp=true is supposed to assume > that all decision variables are positive, yet in this solution x9 and x7 are > clearly negative. > If we instead specify the constraints by hand we get: > (%i9)?eqs2 : [eq1,eq2,eq3,eq4,x1>0,x2>0,x3>0,x4>0,x5>0,x6>0,x7>0,x8>0,x9>0]; > (%i10) minimize_lp(obj, eqs2); > (%o10) [7.6, [x9 = 0.0, x8 = 0.0, x7 = 0, x6 = 0, x5 = 1.0, x4 = 0.0, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?x3 = 0.0, x2 = 0.0, x1 = > 0.0]] > This solution has all non-negative variables, however it isn't really a good > minimum. ?We can verify, for example that there are better solutions: > (%i11) obj, x6=.25,x7=.25,x8=.25,x9=.25, x1=0,x2=0,x3=0,x4=0,x5=0; > (%o11) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 5.05 > (%i12) eqs, x6=.25,x7=.25,x8=.25,x9=.25, x1=0,x2=0,x3=0,x4=0,x5=0; > (%o12) ? ? ? ? ? ?[1.0 = 1, 0.3 = 0.3, 0.3 = 0.3, 0.4 = 0.4] > Am I doing something wrong, or is the simplex package not working? > I have verified this behavior in both Maxima 5.22post on an Ubuntu Maverick > system, and in Maxima?Maxima 5.20.1 on an Ubuntu Lucid system. > Thanks, > Don > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > From yasuaki.honda at gmail.com Sat May 14 04:20:46 2011 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Sat, 14 May 2011 18:20:46 +0900 Subject: [Maxima] Colored postscript graphics in imaxima mode In-Reply-To: <4DCC2DE9.3090503@telefonica.net> References: <4DCC2DE9.3090503@telefonica.net> Message-ID: Hi Mario san, I also tried your patch and it worked fine. Would you please commit the fix, please? Yasuaki Honda 2011/5/13 Mario Rodriguez > Hello, > > Colored surfaces in embedded graphics (wxdraw and wxdraw3d) in emacs + > imaxima are always rendered in gray levels, since the current palette is > ignored. The second image in this site is an example: > > > http://sites.google.com/site/imaximaimath/tutorial-of-imaxima/tutorial-of-imaxima-inline-graph > > > > > If in the definition of function $wxdraw (imaxima.lisp), we substitute > > ((mequal simp) $terminal $eps) > > by > > ((mequal simp) $terminal $eps_color) > > something like > > wxdraw3d( > enhanced3d = [x-z/10,x,y,z], > palette = [3,6,-16], > explicit(20*exp(-x^2-y^2)-10,x,-3,3,y,-3,3))$ > > > should plot a colored surface. See screenshot: > > http://riotorto.users.sourceforge.net/gnuplot/func3d/emacs_color.png > > I'm an occasional user of emacs and I don't know if there is any special > reason for using the eps terminal instead of eps_color. If not, I can commit > this change. > > -- > 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: From willisb at unk.edu Sat May 14 09:30:08 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 14 May 2011 09:30:08 -0500 Subject: [Maxima] mixed CRE / float arithmetic with keepfloat In-Reply-To: References: <20110509090038.b7b3fc7d0c6ca0d100c8a34890539092.bf96c1be02.wbe@email06.secureserver.net>, , Message-ID: Bug: (I filed a report) (%i4) rat(1.2) * rat(1/2) - 11/5, keepfloat : true; (%o4)/R/ -8.0/5 (%i5) expand(%,0,0); Maxima encountered a Lisp error: Error in MACSYMA-TOP-LEVEL [or a callee]: -8.0 is not of type INTEGER. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. --Barton From biomates at telefonica.net Sat May 14 09:44:14 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Sat, 14 May 2011 10:44:14 -0400 Subject: [Maxima] Colored postscript graphics in imaxima mode In-Reply-To: References: <4DCC2DE9.3090503@telefonica.net> Message-ID: <4DCE953E.8080404@telefonica.net> On 05/14/2011 05:20 AM, ???? wrote: > Hi Mario san, > > I also tried your patch and it worked fine. Would you please commit > the fix, please? Done. -- Mario From pbowyer at olynet.com Sat May 14 19:14:28 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sat, 14 May 2011 17:14:28 -0700 Subject: [Maxima] test suite problems In-Reply-To: <4DCDD0A7.3050803@olynet.com> References: <4DCDD0A7.3050803@olynet.com> Message-ID: <4DCF1AE4.9060900@olynet.com> On 05/13/2011 05:45 PM, Paul Bowyer wrote: > Hello again list: > > Thinking that I might have a problem with sbcl-1.0.29, I downloaded > and installed sbcl-1.0.48 and then rebuilt my copy of Maxima-5.23.2 > using the new sbcl. > > My configuration for the build was: > export GCL_ANSI=y CFLAGS="-O2 -g -march=i386 -mcpu=pentium4 > -fno-fast-math" CXXFLAGS="-O2 -g -march=i386 -mcpu=pentium4 > -fno-fast-math" && ./configure --prefix=$HOME/Maxima-5.23.2/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 > > which completed properly and then I did the normal > make > > followed by > make install > > I ran the maxima-5.23.2 test suite using the menu option from within > xmaxima and got the following: > --------------------------------------------------------------------------------------------------------------------------------------------- > > Error summary: > Error found in > /home/pfb/Maxima-5.23.2/MaximaTest/share/maxima/5.23.2/tests/rtest16.mac, > problem: > (385) > 1 test failed out of 8,720 total tests. > Evaluation took: > 404.704 seconds of real time > 398.842366 seconds of total run time (394.044096 user, 4.798270 system) > [ Run times consist of 8.588 seconds GC time, and 390.255 seconds > non-GC time. ] > 98.55% CPU > 12,657 forms interpreted > 8,626 lambdas converted > 1,294,474,378,216 processor cycles > 140 page faults > 15,094,744,152 bytes consed > > Additional output from certain tests: > Running tests in rtest14: > STYLE-WARNING: redefining MAXIMA::SIMP-UNIT-STEP in DEFUN > STYLE-WARNING: redefining MAXIMA::SIMP-POCHHAMMER in DEFUN > STYLE-WARNING: redefining MAXIMA::SIMP-HYPERGEOMETRIC in DEFUN > STYLE-WARNING: redefining MAXIMA::FLOAT-OR-RATIONAL-P in DEFUN > 358/358 tests passed > > Running tests in rtest15: > STYLE-WARNING: redefining MAXIMA::$F in DEFUN > STYLE-WARNING: redefining MAXIMA::$F in DEFUN > STYLE-WARNING: redefining MAXIMA::$F in DEFUN > STYLE-WARNING: redefining MAXIMA::$F in DEFUN > STYLE-WARNING: redefining MAXIMA::$F in DEFUN > STYLE-WARNING: redefining MAXIMA::$F in DEFUN > STYLE-WARNING: redefining MAXIMA::$F in DEFUN > 252/252 tests passed > > Running tests in rtest16: > ********************** Problem 385 *************** > Input: > closeto(zeta(%i + 3) - (1.10721440843141 - .1482908671781754 %i), 1.e-15) > > > Result: > 3.3157171161039706e-9 > > This differed from the expected result: > true > ; in: DEFUN LB1 > ; (PROG ((I 0)) > ; (DECLARE (TYPE (INTEGER) I)) > ; (COND > ; ((= ITER 0) > ; (F2CL-LIB:FFORMAT MP > ; > ("*************************************************" > ; "~%")) > ; (F2CL-LIB:FFORMAT MP > ; (" N=" 1 # " NUMBER OF CORRECTIONS=" 1 > # "~%" > ; " INITIAL VALUES" "~%") > ; N M) > ; (F2CL-LIB:FFORMAT MP (" F= " 1 # " GNORM= " 1 # "~%") F > GNORM) > ; (COND (# # # # #)) > ; (F2CL-LIB:FFORMAT MP > ; > ("*************************************************" > ; "~%")) > ; (F2CL-LIB:FFORMAT MP > ; ("~%" " I NFN" "~5 at T" "FUNC" "~20 at T" > "GNORM" "~19 at T" > ; "STEPLENGTH" "~%" "~%"))) > ; (T > ; (IF (AND # #) > ; (GO END_LABEL)) > ; (COND (# #) (T # #)) (COND (# # # #)) > ; (IF FINISH > ; (F2CL-LIB:FFORMAT MP #)))) > ; (GO END_LABEL) > ; END_LABEL > ; (RETURN (VALUES NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL))) > ; --> BLOCK > ; ==> > ; (LET ((I 0)) > ; (DECLARE (TYPE (INTEGER) I)) > ; (TAGBODY > ; (COND > ; ((= ITER 0) (F2CL-LIB:FFORMAT MP #) (F2CL-LIB:FFORMAT MP # N M) > ; (F2CL-LIB:FFORMAT MP # F GNORM) (COND #) (F2CL-LIB:FFORMAT > MP #) > ; (F2CL-LIB:FFORMAT MP #)) > ; (T > ; (IF # > ; #) > ; (COND # #) (COND #) > ; (IF FINISH > ; #))) > ; (GO END_LABEL) > ; END_LABEL > ; (RETURN (VALUES NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL)))) > ; > ; caught STYLE-WARNING: > ; The variable I is defined but never used. > ; > ; compilation unit finished > ; caught 1 STYLE-WARNING condition > > 485/486 tests passed > > The following 1 problem failed: (385) > --------------------------------------------------------------------------------------------------------------------------------------------- > > (%i1) build_info (); > Maxima version: 5.23.2 > Maxima build date: 13:58 5/13/2011 > Host type: i686-pc-linux-gnu > Lisp implementation type: SBCL > Lisp implementation version: 1.0.48 > --------------------------------------------------------------------------------------------------------------------------------------------- > > > Am I doing something incorrectly in my build process that causes the > failure in the test suite when using sbcl? > I got a similar error for maxima-5.24post when using sbcl-1.0.29 (see > message [Maxima] 5-24post tests ). > > When I run the test suite for maxima-5.23.2 using gcl Version > GCL-2.6.8pre, I get no errors. > > When I try running the test suite for maxima-5.24post using gcl > Version GCL-2.6.8pre, it runs to completion if I run it from the menu > in xmaxima, but if I run it using "run_testsuite(display_all = true);" > from within xmaxima or from a KDE Konsole session where I've run > "./maxima" with the appropriate path settings, it halts at test 55 of > rtest2 with a Segmentation fault. > > What's the likely cause of that problem and why should there be so > much difference between maxima-5.23.2 and Maxima-5.24post? > > Thanks, > > Paul Bowyer > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Another test suite run using: Maxima 5-24post with cmucl Version CMU Common Lisp Snapshot 2011-02 (20B Unicode) -------------------------------------------------------------------------------------------------------------------------------------------------------- Error summary: Error found in rtest2, problem: (error break) 0 tests failed out of 8,768 total tests. ; Evaluation took: ; 382.47f0 seconds of real time ; 341.907f0 seconds of user run time ; 33.431915f0 seconds of system run time ; 1,223,376,844,544 CPU cycles ; [Run times include 27.25f0 seconds GC run time] ; 99 page faults and ; 19,129,943,776 bytes consed. ; (%i1) build_info (); Maxima version: 5.24post Maxima build date: 12:3 5/11/2011 Host type: i686-pc-linux-gnu Lisp implementation type: CMU Common Lisp Lisp implementation version: Snapshot 2011-02 (20B Unicode) Additional information copied from the test results: ********************** Problem 55 *************** Input: Caused an error break: rtest2 -------------------------------------------------------------------------------------------------------------------------------------------------------- I think this is the same test that causes maxima-5.24post using GCL-2.6.8pre to exit with a Segmentation fault. Paul Bowyer From paul.rey82 at yahoo.fr Sat May 14 16:20:56 2011 From: paul.rey82 at yahoo.fr (Paul Rey) Date: Sat, 14 May 2011 22:20:56 +0100 (BST) Subject: [Maxima] Problem with acos Message-ID: <295932.55876.qm@web28107.mail.ukl.yahoo.com> Excuse my very very bad english. I have a proble to compute integrate(acos(cos(t)),t,0,%pi/2), maxima return -3*%pi^2/8 instead of %pi^2/8. More genrally, it seems that for x in [0,%pi], maxima return x^2/2-%pi*x for integrate(acos(cos(t)),t,0,x) instead of x^2/2. Regards Paul Rey -------------- next part -------------- An HTML attachment was scrubbed... URL: From renzodelfabbro at alice.it Sun May 15 11:18:03 2011 From: renzodelfabbro at alice.it (Renzo Del Fabbro) Date: Sun, 15 May 2011 16:18:03 +0000 (UTC) Subject: [Maxima] Complex system of equations Message-ID: In a network analysis I have four complex relations about voltages, currents and complex power (two KVL one KCL and s=v*conjugate(i)=P+jQ ); for example (%i1) declare(ix,complex)$ (%i2) declare(iy,complex)$ (%i3) declare(v,complex)$ (%i3) declare(i,complex)$ (%i4) [va,vb,za,zb,s]:[5-%i,10,1+2*%i,1+%i,100+200*%i]; (%i5) e1:va-za*ix=v; (%i6) e2:vb-zb*iy=v; (%i7) e4:ix+iy=i; (%i8) e4:v*conjugate(i)=s; (%i9) solve([e1,e2,e3,e4],[ix,iy,v,i]); but I get this error :( "algsys: tried and failed to reduce system to a polynomial in one variable; give up. -- an error. To debug this try: debugmode(true);" How can i solve it ? Thanks Renzo From renzodelfabbro at alice.it Sun May 15 11:55:07 2011 From: renzodelfabbro at alice.it (Renzo Del Fabbro) Date: Sun, 15 May 2011 16:55:07 +0000 (UTC) Subject: [Maxima] Problem with acos References: <295932.55876.qm@web28107.mail.ukl.yahoo.com> Message-ID: Paul Rey yahoo.fr> writes: > > > Excuse my very very bad english. > I have a proble to compute integrate(acos(cos(t)),t,0,%pi/2), maxima return -3*%pi^2/8 instead of %pi^2/8. Just tested, and Maxima return %pi^2/8 Renzo From tomdean at speakeasy.org Sun May 15 12:35:06 2011 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Sun, 15 May 2011 10:35:06 -0700 Subject: [Maxima] Problem with acos In-Reply-To: References: <295932.55876.qm@web28107.mail.ukl.yahoo.com> Message-ID: <1305480906.17229.100.camel@asus> On Sun, 2011-05-15 at 16:55 +0000, Renzo Del Fabbro wrote: >maxima Maxima 5.23.2 http://maxima.sourceforge.net using Lisp CLISP 2.44.1 (2008-02-23) 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(acos(cos(t)),t,0,%pi/2); 2 3 %pi (%o1) - ------ 8 (%i2) tomdean From willisb at unk.edu Sun May 15 12:53:01 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 15 May 2011 12:53:01 -0500 Subject: [Maxima] Problem with acos In-Reply-To: <295932.55876.qm@web28107.mail.ukl.yahoo.com> References: <295932.55876.qm@web28107.mail.ukl.yahoo.com> Message-ID: Sorry, but this is a bug (version 5.24). I'll reported it to the Maxima bug list. Sadly, it seems that Maxima can find an antiderivative of acos(cos(t)) that is valid on [0, %pi/2], but Maxima gives an incorrect value for a definite integral (%i24) e : integrate(acos(cos(t)),t); (%o24) (atan2(1,sin(t)/(cos(t)+1))^2-2*atan2(1,-sin(t)/(cos(t)+1))*atan2(1,sin(t)/(cos(t)+1))+atan2(1,-sin(t)/(cos(t)+1))^2)/2 Evidence that %o24 is correct: (%i25) taylor(e,t,0,8); (%o25)/T/ t^2/2+... Also (%i26) subst(t=%pi/2,e)-subst(t=0,e); (%o26) %pi^2/8 A workaround for this particular integral is to use ldefint (%i28) ldefint(acos(cos(t)),t,0,%pi/2); (%o28) %pi^2/8 --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To:?maxima at math.utexas.edu >From:?Paul?Rey? >Sent?by:?maxima-bounces at math.utexas.edu >Date:?05/14/2011?04:20PM >Subject:?[Maxima]?Problem?with?acos > >Excuse?my?very?very?bad?english. >I?have?a?proble?to?compute?integrate(acos(cos(t)),t,0,%pi/2),?maxima >return?-3*%pi^2/8?instead?of?%pi^2/8.?More?genrally,?it?seems?that?for?x >in?[0,%pi],?maxima?return?x^2/2-%pi*x?for?integrate(acos(cos(t)),t,0,x) >instead?of?x^2/2. >Regards >Paul?Rey_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From tomdean at speakeasy.org Sun May 15 12:55:21 2011 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Sun, 15 May 2011 10:55:21 -0700 Subject: [Maxima] Problem with acos In-Reply-To: <1305480906.17229.100.camel@asus> References: <295932.55876.qm@web28107.mail.ukl.yahoo.com> <1305480906.17229.100.camel@asus> Message-ID: <1305482121.17229.106.camel@asus> On Sun, 2011-05-15 at 10:35 -0700, Thomas D. Dean wrote: > integrate(acos(cos(t)),t,0,%pi/2); I downloaded the source and rebuild/install. The problem still exists in 5.24.0. Or, is this a clisp problem? >maxima Maxima 5.24.0 http://maxima.sourceforge.net using Lisp CLISP 2.44.1 (2008-02-23) 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(acos(cos(t)),t,0,%pi/2); 2 3 %pi (%o1) - ------ 8 (%i2) tomdean From willisb at unk.edu Sun May 15 13:03:29 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 15 May 2011 13:03:29 -0500 Subject: [Maxima] Complex system of equations In-Reply-To: References: Message-ID: (1) Maybe (%i7) should be e3 : ...? (2) The function solve does not handle equations that involve a variable and its conjugate. (3) Changing (%i7) to e3 : ..., and eliminating ix,iy, and v yields an equation for i that has no solution, I'm pretty sure. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To:?maxima at math.utexas.edu >From:?Renzo?Del?Fabbro? >Sent?by:?maxima-bounces at math.utexas.edu >Date:?05/15/2011?11:18AM >Subject:?[Maxima]?Complex?system?of?equations > >In?a?network?analysis?I?have?four?complex?relations?about?voltages, >currents?and >complex?power?(two?KVL?one?KCL?and?s=v*conjugate(i)=P+jQ?);???for?example > >(%i1)?declare(ix,complex)$ >(%i2)?declare(iy,complex)$ >(%i3)?declare(v,complex)$ >(%i3)?declare(i,complex)$ >(%i4)?[va,vb,za,zb,s]:[5-%i,10,1+2*%i,1+%i,100+200*%i]; >(%i5)?e1:va-za*ix=v; >(%i6)?e2:vb-zb*iy=v; >(%i7)?e4:ix+iy=i; >(%i8)?e4:v*conjugate(i)=s; >(%i9)?solve([e1,e2,e3,e4],[ix,iy,v,i]); > >but?I?get?this?error?:( >"algsys:?tried?and?failed?to?reduce?system?to?a?polynomial?in?one >variable;?give >up.?--?an?error.?To?debug?this?try:?debugmode(true);" > >How?can?i?solve?it?? > >Thanks > >Renzo > >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Sun May 15 14:20:51 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 15 May 2011 13:20:51 -0600 Subject: [Maxima] Maxima + ECL error in rtest8; difference between interpreted & compiled code Message-ID: Hi everybody, I've compiled Maxima (current version from Git) with ECL (current version from CVS). The test suite runs with 2 unexpected errors, both in rtest8. These errors originate from calls to quad_qags which are expected to return a result close to 0. Here is a similar case which appears to tickle the same bug: quad_qags (cos(x), x, 0, 3.141592652327421); => quad_qags(cos(x), x, 0, 3.141592652327421, epsrel = 1.e-8, epsabs = 0.0, limit = 200) but it should return something like: [1.262372063675304e-9, 2.2102239413565408e-14, 21, 2] It appears that there's an error triggered when quad_qags is trying to print a message about the result being inexact. I find that loading some of the Lisp files (translated from Fortran) enables quad_qags to complete without error. So I guess there is a difference between compiled and interpreted code somewhere in the SLATEC stuff. :lisp (load "src/numerical/slatec/xermsg.lisp"); :lisp (load "src/numerical/slatec/xerprn.lisp"); :lisp (load "src/numerical/slatec/xersve.lisp"); quad_qags (cos(x), x, 0, 3.141592652327421); ***MESSAGE FROM ROUTINE DQAGS IN LIBRARY SLATEC. ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED * ABNORMAL RETURN * ERROR NUMBER = 2 * ***END OF MESSAGE => [1.262372063675304e-9, 2.2102239413565408e-14, 21, 2] as expected. It appears that all 3 Lisp files have to be loaded -- I didn't find a subset which enables Maxima to do the right thing. Thanks for any light you can shed on this problem. Robert Dodier From renzodelfabbro at alice.it Sun May 15 17:13:33 2011 From: renzodelfabbro at alice.it (Renzo Del Fabbro) Date: Sun, 15 May 2011 22:13:33 +0000 (UTC) Subject: [Maxima] Complex system of equations References: Message-ID: Barton Willis unk.edu> writes: > > (1) Maybe (%i7) should be e3 : ...? Yes sorry :( > > (2) The function solve does not handle equations that involve a variable and its conjugate. Ok but, is there other ways to solve such a system ? > > (3) Changing (%i7) to e3 : ..., and eliminating ix,iy, and v yields an equation for i that > has no solution, I'm pretty sure. You are right (sorry again),... to simplify I've used incoherent numbers :( The following system should have a solution (i=1.4-2.8*%i) (%i1)?declare(ix,complex)$ (%i2)?declare(iy,complex)$ (%i3)?declare(v,complex)$ (%i4)?declare(i,complex)$ (%i5)?[va,vb,za,zb,s]:[80,70,1+2*%i,1+%i,100+200*%i]; (%i6)?e1:va-za*ix=v; (%i7)?e2:vb-zb*iy=v; (%i8)?e3:ix+iy=i; (%i9)?e4:v*conjugate(i)=s; (%i10)?solve([e1,e2,e3,e4],[ix,iy,v,i]); Thank you very much for your Help! Regards Renzo From willisb at unk.edu Sun May 15 19:42:54 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 15 May 2011 19:42:54 -0500 Subject: [Maxima] Complex system of equations In-Reply-To: References: , Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >>?(2)?The?function?solve?does?not?handle?equations?that?involve?a?variable >and its?conjugate. > >Ok?but,?is?there?other?ways?to?solve?such?a?system?? The alternative package to_poly_solver is able to automatically solve some equations that involve a variable and its conjugate. When that doesn't work, you can introduce the real and imaginary parts of the variable and solve (and maybe use a numerical method). But you'll need to filter the solution to eliminate solutions with a nonreal real or imaginary part (numerically easy, but symbolically, not easy in general). >The?following?system?should?have?a?solution?(i=1.4-2.8*%i)? > >(%i1)?declare(ix,complex)$ >(%i2)?declare(iy,complex)$ >(%i3)?declare(v,complex)$ >(%i4)?declare(i,complex)$ >(%i5)?[va,vb,za,zb,s]:[80,70,1+2*%i,1+%i,100+200*%i]; >(%i6)?e1:va-za*ix=v; >(%i7)?e2:vb-zb*iy=v; >(%i8)?e3:ix+iy=i; >(%i9)?e4:v*conjugate(i)=s; >(%i10)?solve([e1,e2,e3,e4],[ix,iy,v,i]); There seems to be at least two solutions: (without the call to rootscontract, the solution is correct, I'd guess, but it's a messy conditional that doesn't simplify without help; also, setting algebraic to true simplifies complex numbers to a rectangular form--but algebraic : true, gcd : spmod fails to do a bug. (%i1) load("to_poly_solver")$ Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:49 $ (%i2) sol : (declare([ix,iy,v,i], complex), [va,vb,za,zb,s]:[80,70,1+2*%i,1+%i,100+200*%i], e1:va-za*ix=v, e2:vb-zb*iy=v, e3:ix+iy=i, e4:v*conjugate(i)=s, block([algebraic : true, gcd : 'red], rootscontract(%solve([e1,e2,e3,e4],[ix,iy,v,i])))); (%o2) %union([i=((67*sqrt(431681)-48013)*%i-51*sqrt(431681)+35489)/1418,ix=((193*sqrt(431681)-159047)*%i-94*sqrt(431681)+78896)/9217,iy=((485*sqrt(431681)-306075)*%i-475*sqrt(431681)+303565)/18434,v=-((5*sqrt(431681)-1255)*%i-480*sqrt(431681)-340370)/9217],[i=-((67*sqrt(431681)+48013)*%i-51*sqrt(431681)-35489)/1418,ix=-((193*sqrt(431681)+159047)*%i-94*sqrt(431681)-78896)/9217,iy=-((485*sqrt(431681)+306075)*%i-475*sqrt(431681)-303565)/18434,v=((5*sqrt(431681)+1255)*%i-480*sqrt(431681)+340370)/9217]) Check--always check. (%i3) makelist(expand(subst(sk, map(lambda([s], rhs(s)-lhs(s)), [e1,e2,e3,e4]))),sk, args(sol)); (%o3) [[0,0,0,0],[0,0,0,0]] (%i4) expand(float(sol)); (%o4) %union([i=48.65813962349394-64.90383048576655*%i,ix=15.26052827936178-31.01363785017898*%i,iy=33.39761134413216-33.89019263558757*%i,v=0.49258129145541*%i+2.712196020280274],[i=1.396867428692242-2.815492504360393*%i,ix=1.859141895315447-3.498025380807247*%i,iy=0.68253287644685*%i-0.4622744666232,v=71.14480734307006-0.22025840982365*%i]) --Barton (author of to_poly_solver). From luigi_marino2 at alice.it Mon May 16 02:36:53 2011 From: luigi_marino2 at alice.it (Luigi Marino) Date: Mon, 16 May 2011 09:36:53 +0200 Subject: [Maxima] Problem with acos Message-ID: Maxima have many problems with trigonometric functions, it is not able to reduce acos(cos(x)) to x If you try all trig simplification acos(cos(x)) is never x Best Luigi Marino -------------- next part -------------- An HTML attachment was scrubbed... URL: From luigi_marino2 at alice.it Mon May 16 02:56:27 2011 From: luigi_marino2 at alice.it (Luigi Marino) Date: Mon, 16 May 2011 09:56:27 +0200 Subject: [Maxima] Problem with acos Message-ID: <3BBFF9EF46704302BB0F3C06354CB65F@luigi3b0e34c8e> Hi for many CAS software (e.g. Maple 12 , MuPad 4) acos(cos(x)) is not equal to cos(acos(x)). Maxima integrate(cos(acos(x)),x,0,%pi/2) =pi^2/8 it is correct. Luigi Marino -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon May 16 08:48:37 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 16 May 2011 09:48:37 -0400 Subject: [Maxima] Problem with acos In-Reply-To: References: Message-ID: Luigi, The simplification acos(cos(x)) => x is only valid when 0 <= x <= %pi, so Maxima by default does not perform that simplification. (And unfortunately, it is not clever enough to perform it when x is declared to be in that range.) To tell Maxima to perform that transformation regardless, use triginverses: true$. Try ? triginverses for documentation. -s On Mon, May 16, 2011 at 03:36, Luigi Marino wrote: > Maxima have many problems > with trigonometric functions, > it is not able to reduce > acos(cos(x)) to x > If you try all trig simplification > acos(cos(x)) is never x > Best > 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 A.G.Grozin at inp.nsk.su Mon May 16 09:17:45 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Mon, 16 May 2011 21:17:45 +0700 (NOVST) Subject: [Maxima] Problem with acos In-Reply-To: References: Message-ID: On Mon, 16 May 2011, Luigi Marino wrote: > Maxima have?many?problems > with trigonometric functions, > it is not able to reduce > acos(cos(x)) to x > If you try all?trig simplification > acos(cos(x)) is never ?x Because acos(cos(x)) is not x! It is the following function ^ /\ /\ | /\ /\ / \ / \ | / \ / \ / \ / \ | / \ / \ / \ / \ | / \ / \ / \/ \|/ \/ \ ------------------------------------------> For example, acos(cos(x)) is an even function, because cos(x) is even. Andrey From renzodelfabbro at alice.it Mon May 16 11:30:03 2011 From: renzodelfabbro at alice.it (Renzo Del Fabbro) Date: Mon, 16 May 2011 16:30:03 +0000 (UTC) Subject: [Maxima] Complex system of equations References: , Message-ID: Barton Willis unk.edu> writes: > The alternative package to_poly_solver is able to automatically solve some equations that > involve a variable and its conjugate. Simply PERFECT ! Thank you very much for a so GREAT Package! :D BTW is there available a "to_poly_solver" package guide? > But you'll need to filter the solution to eliminate solutions with a nonreal real or imaginary > part (numerically easy, but symbolically, not easy in general). Numerically was my goal ... of course ! > involve a variable and its conjugate. When that doesn't work, you can introduce > the real and imaginary parts of the variable and solve (and maybe use a numerical method). Can you tell me please also how to "code" this way, i tried to use real and imaginary parts but my attempt failed :( THANKS!!! Best regards Renzo From willisb at unk.edu Mon May 16 13:16:48 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 16 May 2011 13:16:48 -0500 Subject: [Maxima] Complex system of equations Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Numerically?was?my?goal?...?of?course?! For purely numerical solutions, do not use to_poly_solver: (i) sometimes the exact solutions are lengthy and poorly suited for numerical evaluation (ii) to_poly_solver is limited to fairly simple systems--generally if you can't do it by hand, neither can to_poly_solver. A numerical solver doesn't have that restriction. --Barton From woollett at charter.net Mon May 16 17:18:48 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 16 May 2011 15:18:48 -0700 Subject: [Maxima] draw2d: remove ticks, numbers, edges... Message-ID: <67DC95A54D4545D6A70D098B2A655F90@edwinc367e16bd> I have forgotten how to get a histogram (using draw2d) which just shows the bars and legend, but not the surrounding box, tic marks, and without the left and bottom numbers. I tried the following as a simple example: draw2d( xrange = [-2,6], yrange = [-4,10], axis_left = false, axis_bottom = false, axis_top = false, axis_right = false, fill_density = 1, key = "0", fill_color = black, bars([0,5,2]), fill_density = 1, key = "1", fill_color = blue, bars([4,5,2]))$ but it doesn't get rid of the numbers and tick marks around the box. Ted Woollett (Using Windows Xp with Xmaxima 5.24.0) From pbowyer at olynet.com Mon May 16 18:23:43 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Mon, 16 May 2011 16:23:43 -0700 Subject: [Maxima] test suite problems In-Reply-To: <4DCF1AE4.9060900@olynet.com> References: <4DCDD0A7.3050803@olynet.com> <4DCF1AE4.9060900@olynet.com> Message-ID: <4DD1B1FF.4040504@olynet.com> More on the subject of test suite problems: I again downloaded a fresh copy of the maxima source code using git. This time I was clever enough to create a branch to make my executable from so I won't have to keep downloading. I used a vanilla configuration for the build: export GCL_ANSI=y && ./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 and did: make make install I then did: cd ~/MaximaTest/bin export PATH="~/MaximaTest/bin:~/MaximaTest/lib:~/MaximaTest/libexec:"$PATH (notice I got the syntax right this time) ./xmaxima -l Then I ran the test suite, once from the menu selection in xmaxima and once by entering "run_testsuite(display_all = true);" ------------------------------------------------------------------------------- (%i1) build_info (); Maxima version: 5.24post Maxima build date: 12:46 5/16/2011 Host type: i686-pc-linux-gnu Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 No unexpected errors found out of 8,834 tests. real time : 364.620 secs run-gbc time : 323.000 secs child run time : 1.650 secs gbc time : 31.930 secs This was after exiting xmaxima and starting with a fresh instance. run_testsuite(display_all = true); Dies at rtest2 problem 55 and requires a restart of xmaxima to regain control. Also, when running maxima from a Konsole shell and entering: run_testsuite(display_all = true); Dies at rtest2 problem 55 with a Segmentation fault. When running maxima from a Konsole shell and entering: run_testsuite(); It runs to completion without errors. No unexpected errors found out of 8,834 tests. real time : 378.040 secs run-gbc time : 331.620 secs child run time : 1.750 secs gbc time : 32.350 secs ------------------------------------------------------------------------------- (%i1) build_info (); Maxima version: 5.24post Maxima build date: 13:40 5/16/2011 Host type: i686-pc-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.48 Error summary: Error found in /home/pfb/MaximaTest/share/maxima/5.24post/tests/rtest16.mac, problem: (386) 1 test failed out of 8,834 total tests. Evaluation took: 415.916 seconds of real time 410.680568 seconds of total run time (406.554195 user, 4.126373 system) [ Run times consist of 9.052 seconds GC time, and 401.629 seconds non-GC time. ] 98.74% CPU 13,241 forms interpreted 8,667 lambdas converted 1,330,338,017,676 processor cycles 132 page faults 15,493,798,048 bytes consed run_testsuite(display_all = true); Error summary: Error found in rtest2, problem: (error break) Error found in /home/pfb/MaximaTest/share/maxima/5.24post/tests/rtest16.mac, problem: (386) 1 test failed out of 8,768 total tests. Evaluation took: 461.304 seconds of real time 452.644187 seconds of total run time (441.671855 user, 10.972332 system) [ Run times consist of 9.189 seconds GC time, and 443.456 seconds non-GC time. ] 98.12% CPU 13,241 forms interpreted 8,667 lambdas converted 1,475,518,445,132 processor cycles 16,158,884,736 bytes consed ------------------------------------------------------------------------------- (%i1) build_info (); Maxima version: 5.24post Maxima build date: 13:38 5/16/2011 Host type: i686-pc-linux-gnu Lisp implementation type: CMU Common Lisp Lisp implementation version: Snapshot 2011-02 (20B Unicode) No unexpected errors found out of 8,834 tests. ; Evaluation took: ; 361.36f0 seconds of real time ; 323.38583f0 seconds of user run time ; 33.397923f0 seconds of system run time ; 1,155,819,241,490 CPU cycles ; [Run times include 26.33f0 seconds GC run time] ; 92 page faults and ; 18,804,845,408 bytes consed. There were a few compiler warnings (mentioned in previous messages so not repeated here) that I don't know how to suppress. run_testsuite(display_all = true); Error summary: Error found in rtest2, problem: (error break) 0 tests failed out of 8,768 total tests. ; Evaluation took: ; 381.06f0 seconds of real time ; 340.0773f0 seconds of user run time ; 34.8587f0 seconds of system run time ; 1,218,865,948,064 CPU cycles ; [Run times include 27.31f0 seconds GC run time] ; 0 page faults and ; 19,129,892,152 bytes consed. Again this showed up which I think is the same test that breaks the gcl-binary: ********************* Problem 55 *************** Input: Caused an error break: rtest2 ------------------------------------------------------------------------------- These results are approximately the same as those I posted in "[Maxima] 5-24post tests" so I didn't do the tests for CCL, which outputs a lot more compiler warnings. I'm satisfied that my configure string used for the tests in "[Maxima] 5-24post tests" didn't have anything to do with those results since I used a vanilla configure string for these tests and got the same results. Based on what I'm seeing, it looks like the best lisp to use (of those I've tried) is CMUCL for running Maxima. I've been studying lisp enough that I can use it somewhat (although I'm a total klutz with it) and I'd be interested in some pointers on how to debug the maxima lisp files with an eye toward learning more about lisp in general and maybe also learning more about Maxima. I'm certain I don't know enough mathematics to go much beyond calculus, but maybe, over time, I could learn enough to actually do something useful. I hope these tests are useful to someone, Paul Bowyer From pbowyer at olynet.com Mon May 16 20:37:00 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Mon, 16 May 2011 18:37:00 -0700 Subject: [Maxima] draw2d: remove ticks, numbers, edges... In-Reply-To: <67DC95A54D4545D6A70D098B2A655F90@edwinc367e16bd> References: <67DC95A54D4545D6A70D098B2A655F90@edwinc367e16bd> Message-ID: <4DD1D13C.8040806@olynet.com> On 05/16/2011 03:18 PM, Edwin Woollett wrote: > > I have forgotten how to get a histogram (using > draw2d) which just shows the bars and legend, > but not the surrounding box, tic marks, and > without the left and bottom numbers. > > I tried the following as a simple example: > > draw2d( > xrange = [-2,6], > yrange = [-4,10], > axis_left = false, > axis_bottom = false, > axis_top = false, > axis_right = false, > fill_density = 1, > key = "0", fill_color = black, > bars([0,5,2]), > fill_density = 1, > key = "1", fill_color = blue, > bars([4,5,2]))$ > > but it doesn't get rid of the numbers and > tick marks around the box. > > Ted Woollett > (Using Windows Xp with Xmaxima 5.24.0) > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > I tried: draw2d( xrange = [-2,6], yrange = [-4,10], axis_left = false, axis_bottom = false, axis_top = false, axis_right = false, xtics = 'none, ytics = 'none, fill_density = 1, key = "0", fill_color = black, bars([0,5,2]), fill_density = 1, key = "1", fill_color = blue, bars([4,5,2]))$ which seemed to do what you're asking. Paul From tomdean at speakeasy.org Tue May 17 00:00:31 2011 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Mon, 16 May 2011 22:00:31 -0700 Subject: [Maxima] Complex system of equations In-Reply-To: References: , Message-ID: <1305608431.2454.56.camel@asus> On Sun, 2011-05-15 at 19:42 -0500, Barton Willis wrote: > (%i3) makelist(expand(subst(sk, map(lambda([s], rhs(s)-lhs(s)), [e1,e2,e3,e4]))),sk, args(sol)); Maxima 5.24.0 http://maxima.sourceforge.net using Lisp CLISP 2.44.1 (2008-02-23) I am new to maxima. I tried breaking this expression down to understand the parts. I think the makelist() function substitutes the solution into the initial equations to check. At least the result seems to indicate so. I think I understand the map sub-expression. map(lambda([s], lhs(s)), [e1,e2,e3,e4]); This defines a function with one argument s and executes it with the argument [e1,e2,e3,e4]; If I do xx:map(lambda([s], lhs(s)), [e1,e2,e3,e4]); makelist(expand(subst(sk, xx)),sk, args(sol)); The result is different. It appears this is using some side effect of the syntax to substitute the solution into the original equations. Can someone please explain this syntax? I looked at describe("subst");, but, did not find enough to explain the syntax. tomdean From mpc201 at bigpond.com Tue May 17 00:24:17 2011 From: mpc201 at bigpond.com (Michael Carey) Date: Tue, 17 May 2011 15:24:17 +1000 Subject: [Maxima] fourier series Message-ID: <1305609857.1779.1.camel@mickpc-G41MT-ES2L> How do I compute the Fourier series for f(x) = { 0, (-pi/2,0) cosx (0,pi/2)) Thank you Michael C From willisb at unk.edu Tue May 17 06:28:32 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 17 May 2011 06:28:32 -0500 Subject: [Maxima] Complex system of equations In-Reply-To: <1305608431.2454.56.camel@asus> References: , , <1305608431.2454.56.camel@asus> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >If?I?do? >xx:map(lambda([s],?lhs(s)),?[e1,e2,e3,e4]); >makelist(expand(subst(sk,?xx)),sk,?args(sol)); >The?result?is?different. > >It?appears?this?is?using?some?side?effect?of?the?syntax?to?substitute >the?solution?into?the?original?equations. > >Can?someone?please?explain?this?syntax???I?looked?at?describe("subst");, >but,?did?not?find?enough?to?explain?the?syntax. You missed a rhs in the expression for xx. Try again using xx:map(lambda([s], rhs(s) - lhs(s)), [e1,e2,e3,e4]); --Barton From toy.raymond at gmail.com Tue May 17 08:43:52 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 17 May 2011 09:43:52 -0400 Subject: [Maxima] test suite problems References: <4DCDD0A7.3050803@olynet.com> Message-ID: >>>>> "Paul" == Paul Bowyer writes: Paul> Error summary: Paul> Error found in Paul> /home/pfb/Maxima-5.23.2/MaximaTest/share/maxima/5.23.2/tests/rtest16.mac, Paul> problem: Paul> (385) Paul> 1 test failed out of 8,720 total tests. Paul> Running tests in rtest16: Paul> ********************** Problem 385 *************** Paul> Input: Paul> closeto(zeta(%i + 3) - (1.10721440843141 - .1482908671781754 %i), 1.e-15) Paul> Result: Paul> 3.3157171161039706e-9 It's been a while since I looked at this problem, but I think it's an issue in sbcl. Basically, maxima expects expt to return a double-float with double-float accuracy, but in certain cases, sbcl returns a double-float with single-float accuracy. This has been reported to sbcl and there was interest in fixing this. Ray From toy.raymond at gmail.com Tue May 17 08:54:16 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 17 May 2011 09:54:16 -0400 Subject: [Maxima] test suite problems References: <4DCDD0A7.3050803@olynet.com> <4DCF1AE4.9060900@olynet.com> Message-ID: >>>>> "Paul" == Paul Bowyer writes: Paul> Another test suite run using: Paul> Maxima 5-24post with cmucl Version CMU Common Lisp Snapshot 2011-02 Paul> (20B Unicode) Paul> -------------------------------------------------------------------------------------------------------------------------------------------------------- Paul> Error summary: Paul> Error found in rtest2, problem: Paul> (error break) Paul> 0 tests failed out of 8,768 total tests. I don't get this when running current maxima cvs with cmucl 2011-04. (There are only a few minor differences between 2011-02 and 2011-04.) Did you run the testsuite twice in the same session? There have been issues where running the testsuite twice in the same session will give different results. Some of these issues have been caused by bugs in maxima itself and others are bugs in the tests themselves assuming some certain environment which isn't true when the testsuite is run twice. Ray From toy.raymond at gmail.com Tue May 17 08:55:36 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 17 May 2011 09:55:36 -0400 Subject: [Maxima] fourier series References: <1305609857.1779.1.camel@mickpc-G41MT-ES2L> Message-ID: >>>>> "Michael" == Michael Carey writes: Michael> How do I compute the Fourier series for f(x) = { 0, (-pi/2,0) cosx Michael> (0,pi/2)) I do not understand your notation. What does that mean? Are you saying that f(x) is 0 for -pi/2 How do I compute the Fourier series for f(x) = { 0, (-pi/2,0) cosx (0,pi/2)) Thank you Michael C Aleksas Domarkas solve: (%i1) S(n):=a(0)/2+sum(a(k)*cos(k*%pi*x/L)+b(k)*sin(k*%pi*x/L),k,1,n)$ (%i2) f(x):=if x<0 then 0 else cos(x)$ (%i3) L:%pi/2$ (%i4) 1/L*integrate(cos(x)*cos(n*%pi*x/L),x,0,%pi/2)$ ratsimp(expand(%))$ define(a(n),%); (%o6) a(n):=-(2*cos(%pi*n))/(4*%pi*n^2-%pi) (%i7) 1/L*integrate(cos(x)*sin(n*%pi*x/L),x,0,%pi/2)$ ratsimp(expand(%))$ define(b(n),%); (%o9) b(n):=-(2*sin(%pi*n)-4*n)/(4*%pi*n^2-%pi) (%i10) S(3); (%o10) (12*sin(6*x))/(35*%pi)+(2*cos(6*x))/(35*%pi)+(8*sin(4*x))/(15*%pi)-(2*cos(4*x))/(15*%pi)+(4*sin(2*x))/(3*%pi)+(2*cos(2*x))/(3*%pi)+1/%pi (%i11) S(n); (%o11) (sum((4*k*sin(2*k*x))/(4*%pi*k^2-%pi)-(2*(-1)^k*cos(2*k*x))/(4*%pi*k^2-%pi),k,1,n))+1/%pi (%i12) wxplot2d([f(x),S(3),S(10),S(30)], [x,-%pi/2,%pi/2], [legend, "f(x)", "S(3)","S(10)","S(30)"], [gnuplot_preamble, "set key left top"])$ (%t12) << Graphics >> Aleksas D From pbowyer at olynet.com Tue May 17 10:33:40 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Tue, 17 May 2011 08:33:40 -0700 Subject: [Maxima] test suite problems In-Reply-To: References: <4DCDD0A7.3050803@olynet.com> <4DCF1AE4.9060900@olynet.com> Message-ID: <4DD29554.5010301@olynet.com> On 05/17/2011 06:54 AM, Raymond Toy wrote: >>>>>> "Paul" == Paul Bowyer writes: > Paul> Another test suite run using: > Paul> Maxima 5-24post with cmucl Version CMU Common Lisp Snapshot 2011-02 > Paul> (20B Unicode) > Paul> -------------------------------------------------------------------------------------------------------------------------------------------------------- > Paul> Error summary: > Paul> Error found in rtest2, problem: > Paul> (error break) > Paul> 0 tests failed out of 8,768 total tests. > > I don't get this when running current maxima cvs with cmucl 2011-04. > (There are only a few minor differences between 2011-02 and 2011-04.) > > Did you run the testsuite twice in the same session? There have been > issues where running the testsuite twice in the same session will give > different results. Some of these issues have been caused by bugs in > maxima itself and others are bugs in the tests themselves assuming > some certain environment which isn't true when the testsuite is run > twice. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Ray: I closed xmaxima and started a new session for the second test suite runs in all of the lisp dialects I tried. CMUCL didn't really count the break as an error because it showed 0 tests failed. It just reported it in the error summary. GCL, however crashes on that test. I examined "~/MaximaTest/share/maxima/5.24post/tests/rtest2.mac" and tried manually counting test pairs in that file. I started a GCL session of maxima-5.24post in a Konsole shell and began to copy/paste test expressions into maxima from "rtest2.mac" for evaluation, starting in the neighborhood of the 50th test pair and continuing until the end of the file, and I couldn't get maxima to crash that way. Evidently the problem is in the running of the test suite using "run_testsuite(display_all = true);" because just "run_testsuite();" runs to completion. If I start a GCL session of maxima-5.23.2 (also rebuilt with a vanilla configuration) in a Konsole shell and run the test suite using "run_testsuite(display_all = true);" it runs to completion without errors. Paul From tomdean at speakeasy.org Tue May 17 11:04:47 2011 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Tue, 17 May 2011 09:04:47 -0700 Subject: [Maxima] Complex system of equations In-Reply-To: References: , , <1305608431.2454.56.camel@asus> Message-ID: <1305648287.2454.63.camel@asus> On Tue, 2011-05-17 at 06:28 -0500, Barton Willis wrote: > You missed a rhs in the expression for xx. Try again using Sorry, that was copied from playing with map. I did try the expression you suggested. That works. However, the subst(sk,...) expression fails with an error. (%i6) xx:map(lambda([s], rhs(s) - lhs(s)), [e1,e2,e3,e4]); (%o6) [v + (2 %i + 1) ix - 80, v + (%i + 1) iy - 70, - iy - ix + i, - conjugate(i) v + 200 %i + 100] (%i7) makelist(expand(subst(sk, xx)),sk, args(sol)); (%o7) [[0, 0, 0, 0], [0, 0, 0, 0]] Now, the part I do not understand: (%i8) subst(sk, xx); subst: improper argument: sk -- an error. To debug this try: debugmode(true); I do not understand how the subst(sk,...) expression works in the context of makelist and expand. Can someone explain this? tomdean From rswarbrick at gmail.com Tue May 17 11:32:49 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Tue, 17 May 2011 17:32:49 +0100 Subject: [Maxima] Complex system of equations References: <1305608431.2454.56.camel@asus> <1305648287.2454.63.camel@asus> Message-ID: "Thomas D. Dean" writes: > Now, the part I do not understand: > > (%i8) subst(sk, xx); > subst: improper argument: sk > -- an error. To debug this try: debugmode(true); > > I do not understand how the subst(sk,...) expression works in the > context of makelist and expand. > > Can someone explain this? makelist is a macro and you read it as follows. makelist(expand(subst(sk, xx)),sk, args(sol)); means: (1) For each element of args(sol) (which is a list), bind a dummy variable called sk to its value (2) Now call the code "expand(subst(sk, xx))" with this name binding in place. So you should find that expand(subst(args(sol)[1], xx)) works and gives you the first element of the list you got with Barton's code. 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 Tue May 17 13:57:50 2011 From: woollett at charter.net (Edwin Woollett) Date: Tue, 17 May 2011 11:57:50 -0700 Subject: [Maxima] draw2d: remove ticks, numbers, edges... References: <67DC95A54D4545D6A70D098B2A655F90@edwinc367e16bd> <4DD1D13C.8040806@olynet.com> Message-ID: On May 16, 2011, Paul Bowyer wrote: ------------------ I tried: draw2d( xrange = [-2,6], yrange = [-4,10], axis_left = false, axis_bottom = false, axis_top = false, axis_right = false, xtics = 'none, ytics = 'none, fill_density = 1, key = "0", fill_color = black, bars([0,5,2]), fill_density = 1, key = "1", fill_color = blue, bars([4,5,2]))$ which seemed to do what you're asking. Paul ------------------------------------------ thanks, Paul, that does the job. Ted From willisb at unk.edu Tue May 17 22:47:49 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 17 May 2011 22:47:49 -0500 Subject: [Maxima] alternative eigenvector code In-Reply-To: References: <9svew0ukqa2hnrvx2ff34xut.1305197746784@email.android.com>, Message-ID: My eigenvector code is in the Maxima phpBB system: http://sourceforge.net/apps/phpbb/maxima/viewforum.php?f=3&sid=b65640cbbd05e929533c708664dc115f There is user documentation; for more examples, view the file rtest_alt_eigen.mac. --Barton From mathew.gwynne at gmail.com Wed May 18 05:12:17 2011 From: mathew.gwynne at gmail.com (Matthew Gwynne) Date: Wed, 18 May 2011 11:12:17 +0100 Subject: [Maxima] Help understanding random_integer lisp code Message-ID: Hi, I was wondering if anyone could help me understand what is going on in the function below: (defun %random-integer (arg state) "Generates an integer greater than or equal to zero and less than Arg. Successive chunks are concatenated without overlap to construct integers larger than a single chunk. The return value has this property: If two integers are generated from the same state with Arg equal to 2^m and 2^n, respectively, then bit k is the same in both integers for 0 <= k < min(m,n). Each call to %RANDOM-INTEGER consumes at least one chunk; bits left over from previous chunks are not re-used." (declare (type (integer 1) arg) (type random-state state)) (do* ((nchunks (ceiling (integer-length (1- arg)) random-chunk-length) (1- nchunks)) (new-bits 0 (random-chunk state)) (bits 0 (logior bits (ash new-bits shift))) (shift 0 (+ shift random-chunk-length))) ((= 0 nchunks) (rem bits arg)))) I've been looking at the lisp code for the random_integer function at maxima-5.21.1/src/rand-mt19937.lisp (above), trying to understand exactly what it is doing and how it matches up to the MT19937 specification. Specifically, I'm having trouble deciphering how the shifts and xors and so on relate to the tempering function defined in the original paper (http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/ARTICLES/mt.pdf - page 6): y := x + (x >> u) y := y + ((y << s) AND b) y := y + ((y << t) AND c) z := y + (y >> l); If anyone could point me towards the relevant definitions, or perhaps provide the equivalent Maxima/pseudo-code for random-integer, that would be fantastic! I'd like to compare this random number generator to that implemented in the boost system (for reproducibility), and so need to get a thorough understanding of both. Thanks in advance! Matthew Gwynne http://cs.swan.ac.uk/~csmg/ From aleksasd at mruni.eu Tue May 17 12:11:22 2011 From: aleksasd at mruni.eu (aleksasd at mruni.eu) Date: Tue, 17 May 2011 20:11:22 +0300 Subject: [Maxima] Integration problem Message-ID: <1aad7212f32e8a266134e571c6cb6fbf.squirrel@mail.mruni.eu> Am Samstag, den 02.04.2011, 07:20 +0200 schrieb Rene Grothmann: > On of the previous versions of Maxima knew how to find > > integrate(sqrt(x^5)*sqrt(1-x),x) > > But the current version cannot do this. Is there a way to get it? I think this has changed because expression like sqrt(1/x) and 1/sqrt(x) are no longer treated as equivalent. It is the flag radexpand, which switches on simplifications like sqrt(1/x) -> 1/sqrt(x). Therefore we get: (%i1) integrate(sqrt(x^5)*sqrt(1-x),x), radexpand:all; (%o1) -(-15*sqrt(1-x)/sqrt(x)+73*(1-x)^(3/2)/x^(3/2)+55*(1-x)^(5/2)/x^(5/2) +15*(1-x)^(7/2)/x^(7/2)) /(768*(1-x)/x+1152*(1-x)^2/x^2+768*(1-x)^3/x^3+192*(1-x)^4/x^4 +192) -5*atan(sqrt(1-x)/sqrt(x))/64 Another possibility is to assume the variable x to be positive: (%i1) assume(x>0); (%o1) [x > 0] (%i2) integrate(sqrt(x^5)*sqrt(1-x),x); (%o2) -(-15*sqrt(1-x)/sqrt(x)+73*(1-x)^(3/2)/x^(3/2)+55*(1-x)^(5/2)/x^(5/2) +15*(1-x)^(7/2)/x^(7/2)) /(768*(1-x)/x+1152*(1-x)^2/x^2+768*(1-x)^3/x^3+192*(1-x)^4/x^4 +192) -5*atan(sqrt(1-x)/sqrt(x))/64 Dieter Kaiser ***************************************************** Aleksas Domarkas solution: (%i1) S:'integrate(sqrt(x^5)*sqrt(1-x),x); (%o1) integrate(sqrt(1-x)*sqrt(x^5),x) (%i2) changevar(S, 2*x-1=y, y, x),rootscontract; (%o2) integrate(sqrt(1-y^2)*(y^2+2*y+1),y)/16 (%i3) ev(%, nouns); (%o3) ((5*asin(y))/8-(y*(1-y^2)^(3/2))/4-(2*(1-y^2)^(3/2))/3+(5*y*sqrt(1-y^2))/8)/16 solution: (%i4) sol:ratsimp(subst(y=2*x-1,%)); (%o4) (15*asin(2*x-1)+sqrt(4*x-4*x^2)*(48*x^3-8*x^2-10*x-15))/384 test of solution: (%i5) diff(sol,x)-first(S)$ radcan(%); (%o6) 0 Maxima version: 5.24.0 Maxima build date: 20:39 4/5/2011 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 Aleksas D From coolens at kahosl.be Wed May 18 09:30:30 2011 From: coolens at kahosl.be (Hugo Coolens) Date: Wed, 18 May 2011 16:30:30 +0200 Subject: [Maxima] solving system of equations [newbie] In-Reply-To: <1aad7212f32e8a266134e571c6cb6fbf.squirrel@mail.mruni.eu> References: <1aad7212f32e8a266134e571c6cb6fbf.squirrel@mail.mruni.eu> Message-ID: What is wrong with following sequence of commands? eq1:x1=(-b+sqrt(b^2-4*c))/2; eq2:x2=(-b-sqrt(b^2-4*c))/2; solut:solve([eq1,eq2],[b,c]); I expected to see b=-(x1+x2)/2 ... but I just get [] hugo From willisb at unk.edu Wed May 18 10:38:08 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 18 May 2011 10:38:08 -0500 Subject: [Maxima] solving system of equations [newbie] In-Reply-To: References: <1aad7212f32e8a266134e571c6cb6fbf.squirrel@mail.mruni.eu>, Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >What?is?wrong?with?following?sequence?of?commands? > >eq1:x1=(-b+sqrt(b^2-4*c))/2; >eq2:x2=(-b-sqrt(b^2-4*c))/2; >solut:solve([eq1,eq2],[b,c]); > >I?expected?to?see?b=-(x1+x2)/2?...?but?I?just?get?[] The solve function returns an empty list when either the solution set is empty or when solve is unable to solve the equations. In this case, solve is unable to find the solution set. A workaround: (%i1) load(to_poly_solver)$ (%i2) eqs : [x1=(-b+sqrt(b^2-4*c))/2,x2=(-b-sqrt(b^2-4*c))/2]$ (%i3) sol : %solve(eqs,[b,c]); (%o3) %union(%if((-%pi/2 References: <1aad7212f32e8a266134e571c6cb6fbf.squirrel@mail.mruni.eu> Message-ID: <1305736770.7311.2.camel@wigner> On Wed, 2011-05-18 at 16:30 +0200, Hugo Coolens wrote: > What is wrong with following sequence of commands? > > eq1:x1=(-b+sqrt(b^2-4*c))/2; > eq2:x2=(-b-sqrt(b^2-4*c))/2; > solut:solve([eq1,eq2],[b,c]); > > I expected to see b=-(x1+x2)/2 ... but I just get [] Hi Hugo, you mean b = - (x1+x2) I got the correct answer using a dirty hack: (%i7) solut:solve([eq1+eq2,eq1*eq2],[b,c]); (%o7) [[b = -x2-x1,c = x1*x2]] Cheers, Jaime From coolens at kahosl.be Wed May 18 13:35:06 2011 From: coolens at kahosl.be (Hugo Coolens) Date: Wed, 18 May 2011 20:35:06 +0200 Subject: [Maxima] solving system of equations [newbie] In-Reply-To: <1305736770.7311.2.camel@wigner> References: <1aad7212f32e8a266134e571c6cb6fbf.squirrel@mail.mruni.eu> <1305736770.7311.2.camel@wigner> Message-ID: On Wed, 18 May 2011, Jaime Villate wrote: > On Wed, 2011-05-18 at 16:30 +0200, Hugo Coolens wrote: >> What is wrong with following sequence of commands? >> >> eq1:x1=(-b+sqrt(b^2-4*c))/2; >> eq2:x2=(-b-sqrt(b^2-4*c))/2; >> solut:solve([eq1,eq2],[b,c]); >> >> I expected to see b=-(x1+x2)/2 ... but I just get [] > Hi Hugo, > you mean b = - (x1+x2) yes, you're right of course > I got the correct answer using a dirty hack: > > > (%i7) solut:solve([eq1+eq2,eq1*eq2],[b,c]); > (%o7) [[b = -x2-x1,c = x1*x2]] > thanks! > Cheers, > Jaime > > > From robert.dodier at gmail.com Wed May 18 13:40:55 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 18 May 2011 12:40:55 -0600 Subject: [Maxima] Help understanding random_integer lisp code In-Reply-To: References: Message-ID: Matthew, %RANDOM-INTEGER consumes the stream of chunks generated by RANDOM-CHUNK, which is where all the MT algorithmic stuff is located. The bit-mungeing in %RANDOM-INTEGER is just to construct a return value which has a different number of bits than a chunk. HTH Robert Dodier On 5/18/11, Matthew Gwynne wrote: > Hi, > > I was wondering if anyone could help me understand what is going on in > the function below: > > (defun %random-integer (arg state) > "Generates an integer greater than or equal to zero and less than Arg. > Successive chunks are concatenated without overlap to construct integers > larger than a single chunk. The return value has this property: > If two integers are generated from the same state with Arg equal to > 2^m and 2^n, > respectively, then bit k is the same in both integers for 0 <= k < > min(m,n). > Each call to %RANDOM-INTEGER consumes at least one chunk; bits left over > from previous chunks are not re-used." > (declare (type (integer 1) arg) (type random-state state)) > (do* > ((nchunks (ceiling (integer-length (1- arg)) > random-chunk-length) (1- nchunks)) > (new-bits 0 (random-chunk state)) > (bits 0 (logior bits (ash new-bits shift))) > (shift 0 (+ shift random-chunk-length))) > ((= 0 nchunks) > (rem bits arg)))) > > I've been looking at the lisp code for the random_integer function at > maxima-5.21.1/src/rand-mt19937.lisp (above), trying to understand > exactly what it is doing and how it matches up to the MT19937 > specification. > > Specifically, I'm having trouble deciphering how the shifts and xors > and so on relate to the tempering function defined in the original > paper (http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/ARTICLES/mt.pdf > - page 6): > > y := x + (x >> u) > y := y + ((y << s) AND b) > y := y + ((y << t) AND c) > z := y + (y >> l); > > If anyone could point me towards the relevant definitions, or perhaps > provide the equivalent Maxima/pseudo-code for random-integer, that > would be fantastic! > > I'd like to compare this random number generator to that implemented > in the boost system (for reproducibility), and so need to get a > thorough understanding of both. > > Thanks in advance! > > Matthew Gwynne > http://cs.swan.ac.uk/~csmg/ > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From razif66 at gmail.com Wed May 18 23:49:11 2011 From: razif66 at gmail.com (razif razali) Date: Thu, 19 May 2011 12:49:11 +0800 Subject: [Maxima] asking on kron_del Message-ID: I try to make this equation <1,0,0,1 | 1,0,0,1> = 1 and else is equal to 0 like what kron_del command give i giving maxima some rule, tellsimp(bra(m,n,o,l).ket(l,o,m,n),kron_del((m,n,o,l),(m,n,o,l))); but when i execute bra(1,0,0,1).ket(1,0,0,1) it just give kron_del(1,1) and the value should be 1 right? so how can do this in right way so that I can get 1 for same bra and ket while 0 for different bra and ket. -- 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 sjboege at yahoo.com Thu May 19 00:43:43 2011 From: sjboege at yahoo.com (Steven Boege) Date: Wed, 18 May 2011 22:43:43 -0700 (PDT) Subject: [Maxima] building long expressions Message-ID: <38261.75116.qm@web39322.mail.mud.yahoo.com> I would like to build long expressions or functions. I tried it this way: (%i1) a:b+c; (%o1)??????????????????????????????? c + b (%i2) b:d+e; (%o2)??????????????????????????????? e + d (%i3) c:f+g; (%o3)??????????????????????????????? g + f (%i4) a; (%o4)??????????????????????????????? c + b I was hoping to see (%o4)??????????????????????????????? g + f + e + d instead of? (%o4)??????????????????????????????? c + b So then I read a few tutorials and realized that I needed to tell Maxima to recalculate a. (%i5) ''a; (%o5)??????????????????????????? g + f + e + d OK. Next I tried to change one of the values upon which a is dependent: %i6) a; (%o6)??????????????????????????????? c + b (%i7) d:0; (%o7)????????????????????????????????? 0 (%i8) ''a; (%o8)??????????????????????????? g + f + e + d (%i9) d; (%o9)????????????????????????????????? 0 (%i10) ''a; (%o10)?????????????????????????? g + f + e + d So d was set to 0, but a doesn't realize that.? I clearly am looking at this wrong.? Since d = 0, please explain why I didn't get: (%o10)?????????????????????????? g + f + e Next I tried functions: %i1) a(x):=b(x)+c(x); (%o1)???????????????????????? a(x) := b(x) + c(x) (%i2) b(x):=d(x)+e(x); (%o2)???????????????????????? b(x) := d(x) + e(x) (%i3) c(x):=f(x)+g(x); (%o3)???????????????????????? c(x) := f(x) + g(x) (%i4) a(x); (%o4)????????????????????? g(x) + f(x) + e(x) + d(x) (%i5)? g(x):= value1; (%o5)?????????????????????????? g(x) := value1 (%i6) f(x):=value2; (%o6)?????????????????????????? f(x) := value2 (%i7) e(x):=value3; (%o7)?????????????????????????? e(x) := value3 (%i8) d(x):=value4; (%o8)?????????????????????????? d(x) := value4 (%i9) a(x); (%o9)????????????????? value4 + value3 + value2 + value1 (%i10) value4:0; (%o10)???????????????????????????????? 0 (%i11) a(x); (%o11)???????????????????? value3 + value2 + value1 This seems to work.? But how would I clear the definition for value4?? Also, I had to add "(x)" to the function definitions even though it's not really a function of x.? But if I leave the "(x)" out, Maxima complains. I looked for answers in the faq, but didn't find anything.? Thanks for reading.? Please consider taking a few minutes to get me rolling with this. Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Thu May 19 01:24:58 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 19 May 2011 00:24:58 -0600 Subject: [Maxima] building long expressions In-Reply-To: <38261.75116.qm@web39322.mail.mud.yahoo.com> References: <38261.75116.qm@web39322.mail.mud.yahoo.com> Message-ID: Maxima's default evaluation policy for variables is one-time evaluation. To shed some light on it, try this: [a, b, c, d, e] : '[b, c, d, e, FOO]; /* assign several variables */ a; ''%; ''%; ''%; ''%; You might try the evaluation flag infeval to repeatedly evaluate. ev(a, infeval); => FOO or, at the input prompt, just this: a, infeval; One-time evaluation is easier to predict so that's why it's the default. HTH Robert Dodier On 5/18/11, Steven Boege wrote: > I would like to build long expressions or functions. > > I tried it this way: > > (%i1) a:b+c; > (%o1)??????????????????????????????? c + b > (%i2) b:d+e; > (%o2)??????????????????????????????? e + d > (%i3) c:f+g; > (%o3)??????????????????????????????? g + f > (%i4) a; > (%o4)??????????????????????????????? c + b > > I was hoping to see > > (%o4)??????????????????????????????? g + f + e + d > > instead of > > (%o4)??????????????????????????????? c + b > > So then I read a few tutorials and realized that I needed to tell Maxima to > recalculate a. > > (%i5) ''a; > (%o5)??????????????????????????? g + f + e + d > > OK. > > Next I tried to change one of the values upon which a is dependent: > > %i6) a; > (%o6)??????????????????????????????? c + b > (%i7) d:0; > (%o7)????????????????????????????????? 0 > (%i8) ''a; > (%o8)??????????????????????????? g + f + e + d > (%i9) d; > (%o9)????????????????????????????????? 0 > (%i10) ''a; > (%o10)?????????????????????????? g + f + e + d > > > So d was set to 0, but a doesn't realize that.? I clearly am looking at this > wrong.? Since d = 0, please explain why I didn't get: > > (%o10)?????????????????????????? g + f + e > > Next I tried functions: > %i1) a(x):=b(x)+c(x); > (%o1)???????????????????????? a(x) := b(x) + c(x) > (%i2) b(x):=d(x)+e(x); > (%o2)???????????????????????? b(x) := d(x) + e(x) > (%i3) c(x):=f(x)+g(x); > (%o3)???????????????????????? c(x) := f(x) + g(x) > (%i4) a(x); > (%o4)????????????????????? g(x) + f(x) + e(x) + d(x) > (%i5)? g(x):= value1; > (%o5)?????????????????????????? g(x) := value1 > (%i6) f(x):=value2; > (%o6)?????????????????????????? f(x) := value2 > (%i7) e(x):=value3; > (%o7)?????????????????????????? e(x) := value3 > (%i8) d(x):=value4; > (%o8)?????????????????????????? d(x) := value4 > (%i9) a(x); > (%o9)????????????????? value4 + value3 + value2 + value1 > (%i10) value4:0; > (%o10)???????????????????????????????? 0 > (%i11) a(x); > (%o11)???????????????????? value3 + value2 + value1 > > This seems to work.? But how would I clear the definition for value4?? Also, > I had to add "(x)" to the function definitions even though it's not really a > function of x.? But if I leave the "(x)" out, Maxima complains. > > I looked for answers in the faq, but didn't find anything.? Thanks for > reading.? Please consider taking a few minutes to get me rolling with this. > > Steve From jdemeyer at cage.ugent.be Wed May 18 16:31:52 2011 From: jdemeyer at cage.ugent.be (Jeroen Demeyer) Date: Wed, 18 May 2011 23:31:52 +0200 Subject: [Maxima] [patch] Fix infodir path Message-ID: <4DD43AC8.8060509@cage.ugent.be> Dear Maxima developers, The Sage project (http://www.sagemath.org/) includes Maxima and needs a patch for Maxima 5.23.2 to fix the "infodir" path. In some cases, the "infodir" is set to $MAXIMA_PREFIX/info instead of $MAXIMA_PREFIX/share/info which means that some files cannot be found. This is in particular an issue when the location of the Maxima installation is changed after the installation. I attach a patch to fix this issue, see also http://trac.sagemath.org/sage_trac/ticket/11348 Best regards, Jeroen Demeyer. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: infodir.patch URL: From macrakis at alum.mit.edu Thu May 19 08:09:38 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 19 May 2011 09:09:38 -0400 Subject: [Maxima] building long expressions In-Reply-To: <38261.75116.qm@web39322.mail.mud.yahoo.com> References: <38261.75116.qm@web39322.mail.mud.yahoo.com> Message-ID: Several approaches are possible here. One is infeval, as Robert suggested. Another is to define things bottom-up instead of top-down: c: f+g$ b:d+e$ a:b+c$ Another is to use functions: a():= b() + c()$ b():=d()+e()$ etc. then call a(). If a function is not explicitly defined, the function call will remain in symbolic form. I do *not* recommend using ''xxx -- this substitutes the value of xxx at expression-reading time, and so can be useful in some cases (e.g. when defining a function by substituting in calculated expressions), but ***will not work as you expect in code***. I would also be very careful with infeval, but it can still be useful. -s On Thu, May 19, 2011 at 01:43, Steven Boege wrote: > I would like to build long expressions or functions. > > I tried it this way: > > (%i1) a:b+c; > (%o1) c + b > (%i2) b:d+e; > (%o2) e + d > (%i3) c:f+g; > (%o3) g + f > (%i4) a; > (%o4) c + b > > I was hoping to see > > (%o4) g + f + e + d > > instead of > > (%o4) c + b > > So then I read a few tutorials and realized that I needed to tell Maxima to > recalculate a. > > (%i5) ''a; > (%o5) g + f + e + d > > OK. > > Next I tried to change one of the values upon which a is dependent: > > %i6) a; > (%o6) c + b > (%i7) d:0; > (%o7) 0 > (%i8) ''a; > (%o8) g + f + e + d > (%i9) d; > (%o9) 0 > (%i10) ''a; > (%o10) g + f + e + d > > So d was set to 0, but a doesn't realize that. I clearly am looking at > this wrong. Since d = 0, please explain why I didn't get: > > (%o10) g + f + e > > Next I tried functions: > %i1) a(x):=b(x)+c(x); > (%o1) a(x) := b(x) + c(x) > (%i2) b(x):=d(x)+e(x); > (%o2) b(x) := d(x) + e(x) > (%i3) c(x):=f(x)+g(x); > (%o3) c(x) := f(x) + g(x) > (%i4) a(x); > (%o4) g(x) + f(x) + e(x) + d(x) > (%i5) g(x):= value1; > (%o5) g(x) := value1 > (%i6) f(x):=value2; > (%o6) f(x) := value2 > (%i7) e(x):=value3; > (%o7) e(x) := value3 > (%i8) d(x):=value4; > (%o8) d(x) := value4 > (%i9) a(x); > (%o9) value4 + value3 + value2 + value1 > (%i10) value4:0; > (%o10) 0 > (%i11) a(x); > (%o11) value3 + value2 + value1 > > This seems to work. But how would I clear the definition for value4? > Also, I had to add "(x)" to the function definitions even though it's not > really a function of x. But if I leave the "(x)" out, Maxima complains. > > I looked for answers in the faq, but didn't find anything. Thanks for > reading. Please consider taking a few minutes to get me rolling with this. > > Steve > > > > _______________________________________________ > 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 May 19 10:15:11 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 19 May 2011 09:15:11 -0600 Subject: [Maxima] [patch] Fix infodir path In-Reply-To: <4DD43AC8.8060509@cage.ugent.be> References: <4DD43AC8.8060509@cage.ugent.be> Message-ID: Hmm, isn't that patch going to mess up some systems for which the installation now works? best Robert Dodier On 5/18/11, Jeroen Demeyer wrote: > Dear Maxima developers, > > The Sage project (http://www.sagemath.org/) includes Maxima and needs a > patch for Maxima 5.23.2 to fix the "infodir" path. In some cases, the > "infodir" is set to $MAXIMA_PREFIX/info instead of > $MAXIMA_PREFIX/share/info which means that some files cannot be found. > > This is in particular an issue when the location of the Maxima > installation is changed after the installation. > > I attach a patch to fix this issue, see also > http://trac.sagemath.org/sage_trac/ticket/11348 > > > Best regards, > Jeroen Demeyer. > From willisb at unk.edu Thu May 19 10:39:16 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 19 May 2011 10:39:16 -0500 Subject: [Maxima] asking on kron_del Message-ID: The Maxima name for the Kronecker delta function is kron_delta, not kron_del; also, (e1,e2, ..., en) is a compound statement--evaluation proceeds from left to right. The last evaluation is the value of the compound statement. (I don't know where in the online help this is explained--it's difficult to find.) Example: (%i1) (1,2,3); (%o1) 3 Other readers of this list are much more skilled with tellsimp rules than I am, but I'm guessing you want something like: (%i1) matchdeclare(a, lambda([s], not mapatom(s) and op(s) = 'bra), b, lambda([s], not mapatom(s) and op(s) = 'ket)); (%o1) done (%i2) tellsimpafter(a.b, kron_delta(args(a), args(b))); (%o2) [.rule1,simpnct] (%i3) bra(3,6,7) . ket(3,6,7); (%o3) 1 (%i5) bra(1,0,1) . ket(1,0,1,8); (%o5) 0 (%i6) bra(1,0,0,1).ket(1,0,0,1); (%o6) 1 --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To:?maxima at math.utexas.edu >From:?razif?razali? >Sent?by:?maxima-bounces at math.utexas.edu >Date:?05/18/2011?11:49PM >Subject:?[Maxima]?asking?on?kron_del > >I?try?to?make?this?equation?<1,0,0,1?|?1,0,0,1>?=?1?and?else?is?equal?to?0 >like?what?kron_del?command?give >i?giving?maxima?some?rule, >tellsimp(bra(m,n,o,l).ket(l,o,m,n),kron_del((m,n,o,l),(m,n,o,l))); > >but?when?i?execute?bra(1,0,0,1).ket(1,0,0,1)?it?just?give?kron_del(1,1) >and?the?value?should?be?1?right?so?how?can?do?this?in?right?way?so?that?I >can?get?1?for?same?bra?and?ket?while?0?for?different?bra?and?ket. > >--? >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 From george.leeman at sbcglobal.net Thu May 19 11:32:52 2011 From: george.leeman at sbcglobal.net (George Leeman) Date: Thu, 19 May 2011 12:32:52 -0400 Subject: [Maxima] asking on kron_del Message-ID: I'm not sure I understand the notation. However, I wonder if the desired effect can be achieved simply via a function with two lists as arguments, i.e. f(x,y):=kron_delta(x,y); Then f([1,0,0,1],[1,0,0,1]) yields 1, and f(x,y) is 0 for two different lists. -----Original Message----- >To:?maxima at math.utexas.edu >From:?razif?razali? >Sent?by:?maxima-bounces at math.utexas.edu >Date:?05/18/2011?11:49PM >Subject:?[Maxima]?asking?on?kron_del > >I?try?to?make?this?equation?<1,0,0,1?|?1,0,0,1>?=?1?and?else?is?equal?to?0 >like?what?kron_del?command?give >i?giving?maxima?some?rule, >tellsimp(bra(m,n,o,l).ket(l,o,m,n),kron_del((m,n,o,l),(m,n,o,l))); > >but?when?i?execute?bra(1,0,0,1).ket(1,0,0,1)?it?just?give?kron_del(1,1) >and?the?value?should?be?1?right?so?how?can?do?this?in?right?way?so?that?I >can?get?1?for?same?bra?and?ket?while?0?for?different?bra?and?ket. > >--? >Regards, > >RAZIF?RAZALI, >Tutor?&?Master?Student, >Physics?Department, >Faculty?Of?Science, >Universiti?Teknologi?Malaysia(UTM). >+60199393606 From l.butler at ed.ac.uk Thu May 19 11:34:18 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Thu, 19 May 2011 17:34:18 +0100 (BST) Subject: [Maxima] [patch] Fix infodir path In-Reply-To: <4DD43AC8.8060509@cage.ugent.be> References: <4DD43AC8.8060509@cage.ugent.be> Message-ID: On Wed, 18 May 2011, Jeroen Demeyer wrote: < Dear Maxima developers, < < The Sage project (http://www.sagemath.org/) includes Maxima and needs a < patch for Maxima 5.23.2 to fix the "infodir" path. In some cases, the < "infodir" is set to $MAXIMA_PREFIX/info instead of < $MAXIMA_PREFIX/share/info which means that some files cannot be found. < < This is in particular an issue when the location of the Maxima < installation is changed after the installation. I'd be surprised if this is the only thing broken when you move the installation, to be honest. Is moving the installation a standard practice? I think maxima's build scripts treat the installation location as known at install time. < < I attach a patch to fix this issue, see also < http://trac.sagemath.org/sage_trac/ticket/11348 I have a few questions: -does maxima find the info files when it is in its original install location? -does sage set MAXIMA_PREFIX before launching maxima? Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From andre.maute at gmx.de Thu May 19 14:16:23 2011 From: andre.maute at gmx.de (andre maute) Date: Thu, 19 May 2011 21:16:23 +0200 Subject: [Maxima] parsing rational integers with numericalio Message-ID: <4DD56C87.6090701@gmx.de> Hi list, I would like to know, what is the correct way to parse the "/" from a read list of numbers in a file with the numericalio package? Thanks Andre The file looks as follows and describes a matrix ------------- readmatrix.txt ------------------- 11 11 0 0 1/2 1 1 1/4 2 2 1/12 3 3 1/6 4 4 1/18 5 5 1/30 6 6 1/8 7 7 1/24 8 8 1/40 9 9 1/56 10 10 1/10 ------------- readmatrix.txt ------------------- my finite state machine to parse the file with the MARKED line ------------- readmatrix.max ------------------- display2d : false; load("numericalio"); matlist : read_list("./readmatrix.txt"); m : first(matlist); matlist : rest(matlist); n : first(matlist); matlist : rest(matlist); /* state 1: read i */ /* state 2: read j */ /* state 3: read numerator of A[i,j] */ /* state 4: read "\/" */ /* state 5: read denominator of A[i,j] */ /* state 6: process tuple (i,j,A[i,j]) */ lmatlist : length(matlist); state : 1; i : -1; j : -1; aij : false; h : false; for kk : 1 thru lmatlist do block( if state = 1 then block( i : first(matlist), matlist : rest(matlist), state : 2 ) else if state = 2 then block( j : first(matlist), matlist : rest(matlist), state : 3 ) else if state = 3 then block( aij : first(matlist), matlist : rest(matlist), /* MARKED HACK */ if not numberp(first(matlist)) then block( state : 4 ) else block( state : 6 ) ) else if state = 4 then block( matlist : rest(matlist), state : 5 ) else if state = 5 then block( aij : aij/first(matlist), matlist : rest(matlist), state : 6 ), if state = 6 then block( print(i,j,aij), state : 1 ) ); ------------- readmatrix.max ------------------- From fateman at eecs.berkeley.edu Thu May 19 15:01:42 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 19 May 2011 13:01:42 -0700 Subject: [Maxima] parsing rational integers with numericalio In-Reply-To: <4DD56C87.6090701@gmx.de> References: <4DD56C87.6090701@gmx.de> Message-ID: <4DD57726.4090202@eecs.berkeley.edu> My suggestion is to edit that file by replacing all the spaces with commas and insert a comma before each newline. Then insert a few more characters as ... M=sparse_matrix(11,11, [ 0,0,1/2, ... ])$ and then use loadfile. You can disentangle the stuff by defining sparse_matrix by, say, sparse_matrix(rows,cols, stuff):= block ([ ans:zeromatrix(rows,cols)], while notequal (stuff,[]) do (ans[stuff[1],stuff[2]]:stuff[3], stuff:rest(stuff,3)), ans); example sparse_matrix(2,2,[1,1,11,2,2,22]); On 5/19/2011 12:16 PM, andre maute wrote: > Hi list, > > I would like to know, what is the correct way to > parse the "/" from a read list of numbers in a file > with the numericalio package? > > Thanks > Andre > > > The file looks as follows and describes a matrix > > ------------- readmatrix.txt ------------------- > 11 11 > 0 0 1/2 > 1 1 1/4 > 2 2 1/12 > 3 3 1/6 > 4 4 1/18 > 5 5 1/30 > 6 6 1/8 > 7 7 1/24 > 8 8 1/40 > 9 9 1/56 > 10 10 1/10 > ------------- readmatrix.txt ------------------- > > my finite state machine to parse the file with the MARKED line > > ------------- readmatrix.max ------------------- > display2d : false; > > load("numericalio"); > > matlist : read_list("./readmatrix.txt"); > > m : first(matlist); matlist : rest(matlist); > n : first(matlist); matlist : rest(matlist); > > /* state 1: read i */ > /* state 2: read j */ > /* state 3: read numerator of A[i,j] */ > /* state 4: read "\/" */ > /* state 5: read denominator of A[i,j] */ > /* state 6: process tuple (i,j,A[i,j]) */ > > lmatlist : length(matlist); > state : 1; > i : -1; j : -1; aij : false; h : false; > for kk : 1 thru lmatlist do block( > if state = 1 then block( > i : first(matlist), matlist : rest(matlist), > state : 2 > ) else if state = 2 then block( > j : first(matlist), matlist : rest(matlist), > state : 3 > ) else if state = 3 then block( > aij : first(matlist), matlist : rest(matlist), > /* MARKED HACK */ > if not numberp(first(matlist)) then block( > state : 4 > ) else block( > state : 6 > ) > ) else if state = 4 then block( > matlist : rest(matlist), > state : 5 > ) else if state = 5 then block( > aij : aij/first(matlist), matlist : rest(matlist), > state : 6 > ), > > if state = 6 then block( > print(i,j,aij), > state : 1 > ) > ); > ------------- readmatrix.max ------------------- > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From woollett at charter.net Thu May 19 16:58:12 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 19 May 2011 14:58:12 -0700 Subject: [Maxima] Read data file containing fractional numbers? Message-ID: Given a text data file with either space or comma separated items which may include signed fractional numbers, such as: 1 0 2 -1/3 3 -1/2 4 -3/5 5 -2/3 or 1, 0 2, -1/3 3, -1/2 4, -3/5 5, -2/3 how can I use Maxima to read this data into a nested list of the form [ [1,0], [2,-1/3], [3, -1/2], [4, -3/5], [5, -2/3] ] . My attempts with read_nested_list result in things like (%i22) fdataL : read_nested_list ("mydata2.dat",comma); (%o22) [[1, 0], [2, [- 1, /, 3]], [3, [- 1, /, 2]], [4, [- 3, /, 5]], [5, [- 2, /, 3]]] Ted Woollett From fateman at eecs.berkeley.edu Thu May 19 17:05:34 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 19 May 2011 15:05:34 -0700 Subject: [Maxima] Read data file containing fractional numbers? In-Reply-To: References: Message-ID: <4DD5942E.4060906@eecs.berkeley.edu> Didn't I just answer this? :) Do a little editing on the data file. There are many many editors, and some of them can do this with a few keystrokes. Here you can do this, starting with the comma-separated file.. replace newline with ],[ put data: [[ at the beginning delete extra ,[ at the end. If the data was produced by a program, you could of course have it do this extra stuff too. RJF On 5/19/2011 2:58 PM, Edwin Woollett wrote: > Given a text data file with either > space or comma separated items which > may include signed fractional numbers, > such as: > > 1 0 > 2 -1/3 > 3 -1/2 > 4 -3/5 > 5 -2/3 > > or > > 1, 0 > 2, -1/3 > 3, -1/2 > 4, -3/5 > 5, -2/3 > > how can I use Maxima to read this data into a nested > list of the form > [ [1,0], [2,-1/3], [3, -1/2], [4, -3/5], [5, -2/3] ] . > > My attempts with read_nested_list result in things > like > > (%i22) fdataL : read_nested_list ("mydata2.dat",comma); > (%o22) [[1, 0], [2, [- 1, /, 3]], [3, [- 1, /, 2]], [4, [- 3, /, 5]], > [5, [- > 2, /, 3]]] > > Ted Woollett > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From jdemeyer at cage.ugent.be Thu May 19 10:27:14 2011 From: jdemeyer at cage.ugent.be (Jeroen Demeyer) Date: Thu, 19 May 2011 17:27:14 +0200 Subject: [Maxima] [patch] Fix infodir path In-Reply-To: References: <4DD43AC8.8060509@cage.ugent.be> Message-ID: <4DD536D2.5060201@cage.ugent.be> On 2011-05-19 17:15, Robert Dodier wrote: > Hmm, isn't that patch going to mess up some systems for which the > installation now works? I doubt it. During install, the files are installed in MAXIMA_PREFIX/share/info and not in MAXIMA_PREFIX/info (regardless of whether my patch is applied or not). Within Sage, the directory MAXIMA_PREFIX/info exists but is empty. So it really seems like MAXIMA_PREFIX/share/info is the correct "infodir". Jeroen. From jdemeyer at cage.ugent.be Thu May 19 14:27:38 2011 From: jdemeyer at cage.ugent.be (Jeroen Demeyer) Date: Thu, 19 May 2011 21:27:38 +0200 Subject: [Maxima] [patch] Fix infodir path In-Reply-To: References: <4DD43AC8.8060509@cage.ugent.be> Message-ID: <4DD56F2A.3060103@cage.ugent.be> On 2011-05-19 18:34, Leo Butler wrote: > I'd be surprised if this is the only thing broken when > you move the installation, to be honest. For Sage, this is the only issue that we know of when moving the installation. But Sage likely only uses a particular subset of the Maxima functionality, so I don't know about Maxima in general. > -does maxima find the info files when it is in its > original install location? Yes. > -does sage set MAXIMA_PREFIX before launching maxima? As far as I know, no. Jeroen. From woollett at charter.net Thu May 19 17:47:17 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 19 May 2011 15:47:17 -0700 Subject: [Maxima] Read data file containing fractional numbers? References: <4DD5942E.4060906@eecs.berkeley.edu> Message-ID: <421F61930D224A14A6598D9D5EB8A372@edwinc367e16bd> On May 19 Richard Fateman wrote: Didn't I just answer this? :) Do a little editing on the data file. There are many many editors, and some of them can do this with a few keystrokes. Here you can do this, starting with the comma-separated file.. replace newline with ],[ put data: [[ at the beginning delete extra ,[ at the end. If the data was produced by a program, you could of course have it do this extra stuff too. RJF --------------------------------------- Hi Richard, Thanks for the prompt reply. I actually was not following the mailing list updates, since I am not on the "bounce list" and just occasionally go in to the archive to see what's new. It is amazing to me that I submitted a question so closely related to something you had just replied to. Anyway, since my needs are so specialized, I just wrote a do loop massaging function I call flist, and it seems to do the job so far: ----------------------------------- Maxima 5.24.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. 2011-05-19 (%i1) display2d:false$ (%i2) fdataL : read_nested_list ("mydata2.dat",comma); (%o2) [[1,0],[2,[-1,\/,3]],[3,[-1,\/,2]],[4,[-3,\/,5]],[5,[-2,\/,3]]] (%i3) load(flist); (%o3) "c:/work2/flist.mac" (%i4) flist (fdataL); (%o4) [[1,0],[2,-1/3],[3,-1/2],[4,-3/5],[5,-2/3]] (%i5) fundef (flist); (%o5) flist(mylist):=block([rlist,%k,%pk,tempL,%j,%pj],rlist:[], for %k thru length(mylist) do (%pk:part(mylist,%k),tempL:[], for %j thru length(%pk) do (%pj:part(%pk,%j), if listp(%pj) then tempL:cons(part(%pj,1)/part(%pj,3),tempL) else tempL:cons(%pj,tempL)),tempL:reverse(tempL), rlist:cons(tempL,rlist)),reverse(rlist)) (%i6) printfile ("mydata2.dat")$ 1,0 2,-1/3 3,-1/2 4,-3/5 5,-2/3 ------------------------------------------------- ted From l.couraud at gmail.com Thu May 19 17:59:40 2011 From: l.couraud at gmail.com (laurent couraud) Date: Fri, 20 May 2011 00:59:40 +0200 Subject: [Maxima] RE : parsing rational integers with numericalio In-Reply-To: <4DD56C87.6090701@gmx.de> Message-ID: <4CD125D7BE0444A0B50966D35CDE73A4@PASSERELLE> Maybe you can do it with the package string_proc s : openr("readmatrix.txt"); r : []; while (l : readline(s)) # false do( r : append(map(parse_string, split(l)), r)); Hope this help. Laurent. > -----Message d'origine----- > De?: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] De la part de > andre maute > Envoy??: jeudi 19 mai 2011 21:16 > ??: maxima at math.utexas.edu > Objet?: [Maxima] parsing rational integers with numericalio > > Hi list, > > I would like to know, what is the correct way to > parse the "/" from a read list of numbers in a file > with the numericalio package? > > Thanks > Andre > > > The file looks as follows and describes a matrix > > ------------- readmatrix.txt ------------------- > 11 11 > 0 0 1/2 > 1 1 1/4 > 2 2 1/12 > 3 3 1/6 > 4 4 1/18 > 5 5 1/30 > 6 6 1/8 > 7 7 1/24 > 8 8 1/40 > 9 9 1/56 > 10 10 1/10 > ------------- readmatrix.txt ------------------- > > my finite state machine to parse the file with the MARKED line > > ------------- readmatrix.max ------------------- > display2d : false; > > load("numericalio"); > > matlist : read_list("./readmatrix.txt"); > > m : first(matlist); matlist : rest(matlist); > n : first(matlist); matlist : rest(matlist); > > /* state 1: read i */ > /* state 2: read j */ > /* state 3: read numerator of A[i,j] */ > /* state 4: read "\/" */ > /* state 5: read denominator of A[i,j] */ > /* state 6: process tuple (i,j,A[i,j]) */ > > lmatlist : length(matlist); > state : 1; > i : -1; j : -1; aij : false; h : false; > for kk : 1 thru lmatlist do block( > if state = 1 then block( > i : first(matlist), matlist : rest(matlist), > state : 2 > ) else if state = 2 then block( > j : first(matlist), matlist : rest(matlist), > state : 3 > ) else if state = 3 then block( > aij : first(matlist), matlist : rest(matlist), > /* MARKED HACK */ > if not numberp(first(matlist)) then block( > state : 4 > ) else block( > state : 6 > ) > ) else if state = 4 then block( > matlist : rest(matlist), > state : 5 > ) else if state = 5 then block( > aij : aij/first(matlist), matlist : rest(matlist), > state : 6 > ), > > if state = 6 then block( > print(i,j,aij), > state : 1 > ) > ); > ------------- readmatrix.max ------------------- > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From andre.maute at gmx.de Thu May 19 18:32:57 2011 From: andre.maute at gmx.de (andre maute) Date: Fri, 20 May 2011 01:32:57 +0200 Subject: [Maxima] Read data file containing fractional numbers? In-Reply-To: <421F61930D224A14A6598D9D5EB8A372@edwinc367e16bd> References: <4DD5942E.4060906@eecs.berkeley.edu> <421F61930D224A14A6598D9D5EB8A372@edwinc367e16bd> Message-ID: <4DD5A8A9.8050109@gmx.de> Oh that was quick, the title should have read ... rationals and integers ... thanks Ted for changing the title. Hand tuning the files is out of question, nevertheless I've written a small filter in Perl to add the necessary maxima code as suggested by Richard. Thanks From lan1967 at mail.ru Thu May 19 19:32:53 2011 From: lan1967 at mail.ru (t t) Date: Fri, 20 May 2011 04:32:53 +0400 Subject: [Maxima] (no subject) Message-ID: Hello, people! Sorry for disturbance. I got a question. I need to use one of the found roots for calculation. But when I use one of them g[2] to compare the program doesn't really do any comparison. How to use the root for comparison? Thank you for your attention. w:realroots(g^2-1); w[1]; if (w[2]<2) then j:0; j;? [g=-1,g=1] g=-1 (%o330) if g=-1<2 then j:0 (%o331) j? -------------- next part -------------- An HTML attachment was scrubbed... URL: From volkervannek at googlemail.com Fri May 20 01:59:59 2011 From: volkervannek at googlemail.com (Volker van Nek) Date: Fri, 20 May 2011 08:59:59 +0200 Subject: [Maxima] Read data file containing fractional numbers? In-Reply-To: References: Message-ID: Hi Ted, you can use functions from stringproc: data.txt 1 0 2 -1/3 3 -1/2 4 -3/5 5 -2/3 (%i1) stream: openr("data.txt"); (%o1) # (%i2) display2d:false$ (%i3) stringdisp:true$ (%i4) lines:[]$ (%i5) while (line: readline(stream)) # false do lines: endcons(line, lines)$ (%i6) lines; (%o6) ["","1 0","2 -1/3","3 -1/2","4 -3/5","5 -2/3",""] (%i7) lines: delete("", lines); (%o7) ["1 0","2 -1/3","3 -1/2","4 -3/5","5 -2/3"] (%i8) strings: map(split, lines); (%o8) [["1","0"],["2","-1/3"],["3","-1/2"],["4","-3/5"],["5","-2/3"]] (%i9) numbers: fullmap(parse_string, strings); (%o9) [[1,0],[2,-1/3],[3,-1/2],[4,-3/5],[5,-2/3]] (%i10) 2*numbers; (%o10) [[2,0],[4,-2/3],[6,-1],[8,-6/5],[10,-4/3]] (%i11) close(stream); (%o11) true Some comments: Of course display2d:false and stringdisp:true are not necessary. The first and last line of the file was empty. Since parse_string cannot parse an empty string it is necessary to delete these empty strings from the list. The split function splits at blanks by default but other delimiters are also possible. See doc. Volker van Nek 2011/5/19 Edwin Woollett > Given a text data file with either > space or comma separated items which > may include signed fractional numbers, > such as: > > 1 0 > 2 -1/3 > 3 -1/2 > 4 -3/5 > 5 -2/3 > > or > > 1, 0 > 2, -1/3 > 3, -1/2 > 4, -3/5 > 5, -2/3 > > how can I use Maxima to read this data into a nested > list of the form > [ [1,0], [2,-1/3], [3, -1/2], [4, -3/5], [5, -2/3] ] . > > My attempts with read_nested_list result in things > like > > (%i22) fdataL : read_nested_list ("mydata2.dat",comma); > (%o22) [[1, 0], [2, [- 1, /, 3]], [3, [- 1, /, 2]], [4, [- 3, /, 5]], > [5, [- 2, /, > 3]]] > > 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 lan1967 at mail.ru Fri May 20 04:19:35 2011 From: lan1967 at mail.ru (t t) Date: Fri, 20 May 2011 13:19:35 +0400 Subject: [Maxima] working with realroots Message-ID: Hello, people! Sorry for disturbance and double post. I forgot to put a description theme. I got a question. I need to use one of the found roots for calculation. But when I use one of them g[2] to compare the program doesn't really do any comparison. How to use the realroots for comparison? I don't need g=-1. I need just? numerical -1. Thank you for your attention. w:realroots(g^2-1); w[1]; if (w[2]<2) then j:0; j;? [g=-1,g=1] g=-1 (%o330) if g=-1<2 then j:0 (%o331) j? ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Fri May 20 04:38:11 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 20 May 2011 10:38:11 +0100 Subject: [Maxima] (no subject) References: Message-ID: t t writes: > Hello, people! > Sorry for disturbance. > I got a question. > I need to use one of the found roots for calculation. > But when I use one of them g[2] to compare the program doesn't really > do any comparison. > How to use the root for comparison? > Thank you for your attention. > > w:realroots(g^2-1); > w[1]; > if (w[2]<2) then j:0; > j;? > > [g=-1,g=1] > g=-1 > (%o330) if g=-1<2 then j:0 > (%o331) j? Hi, There are two things that seem to be confusing you. Firstly, the second element of w is the equation g=1: (%i14) w:realroots(g^2-1); (%o14) [g = - 1, g = 1] (%i15) w[2]; (%o15) g = 1 To get the "1" bit, use the rhs() function: (%i16) rhs(w[2]); (%o16) 1 Now you want to check how big it is. Just testing "rhs(w[2]) < 2;" doesn't work: (%i18) rhs(w[2]) < 2; (%o18) 1 < 2 because Maxima doesn't perform (in)equality tests like this unless you tell it to. However, the is() function does what you need: (%i19) is(rhs(w[2]) < 2); (%o19) true So I think you want something like: (%i21) if (is(rhs(w[2]) < 2)) then j:0$ (%i22) j; (%o22) 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 rswarbrick at gmail.com Fri May 20 04:40:28 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 20 May 2011 10:40:28 +0100 Subject: [Maxima] working with realroots References: Message-ID: t t writes: > > Hello, people! > Sorry for disturbance and double post. > I forgot to put a description theme. > I got a question. > I need to use one of the found roots for calculation. > But when I use one of them g[2] to compare the program doesn't really do any comparison. > How to use the realroots for comparison? > I don't need g=-1. I need just? numerical -1. > Thank you for your attention. > > w:realroots(g^2-1); > w[1]; > if (w[2]<2) then j:0; > j;? > > [g=-1,g=1] > g=-1 > (%o330) if g=-1<2 then j:0 > (%o331) j? ? As in my reply to your almost identical previous post, use rhs() and is(). Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From andre.maute at gmx.de Fri May 20 04:56:14 2011 From: andre.maute at gmx.de (andre maute) Date: Fri, 20 May 2011 11:56:14 +0200 Subject: [Maxima] Read data file containing fractional numbers? In-Reply-To: References: Message-ID: <4DD63ABE.8020909@gmx.de> Hi list, the really nice feature of the stream/stringproc variant is, that it parses strings and hence the file can contain algebraic expressions Andre On 05/20/2011 08:59 AM, Volker van Nek wrote: > Hi Ted, > > you can use functions from stringproc: > > data.txt > > 1 0 > 2 -1/3 > 3 -1/2 > 4 -3/5 > 5 -2/3 > > > (%i1) stream: openr("data.txt"); > (%o1) # > (%i2) display2d:false$ > > (%i3) stringdisp:true$ > > (%i4) lines:[]$ > > (%i5) while (line: readline(stream)) # false do lines: endcons(line, lines)$ > > (%i6) lines; > > (%o6) ["","1 0","2 -1/3","3 -1/2","4 -3/5","5 -2/3",""] > (%i7) lines: delete("", lines); > > (%o7) ["1 0","2 -1/3","3 -1/2","4 -3/5","5 -2/3"] > (%i8) strings: map(split, lines); > > (%o8) [["1","0"],["2","-1/3"],["3","-1/2"],["4","-3/5"],["5","-2/3"]] > (%i9) numbers: fullmap(parse_string, strings); > > (%o9) [[1,0],[2,-1/3],[3,-1/2],[4,-3/5],[5,-2/3]] > (%i10) 2*numbers; > > (%o10) [[2,0],[4,-2/3],[6,-1],[8,-6/5],[10,-4/3]] > (%i11) close(stream); > > (%o11) true > > Some comments: > > Of course display2d:false and stringdisp:true are not necessary. > > The first and last line of the file was empty. Since parse_string cannot > parse an empty string it is necessary to delete these empty strings from the > list. > > The split function splits at blanks by default but other delimiters are also > possible. See doc. > > Volker van Nek > > > 2011/5/19 Edwin Woollett > >> Given a text data file with either >> space or comma separated items which >> may include signed fractional numbers, >> such as: >> >> 1 0 >> 2 -1/3 >> 3 -1/2 >> 4 -3/5 >> 5 -2/3 >> >> or >> >> 1, 0 >> 2, -1/3 >> 3, -1/2 >> 4, -3/5 >> 5, -2/3 >> >> how can I use Maxima to read this data into a nested >> list of the form >> [ [1,0], [2,-1/3], [3, -1/2], [4, -3/5], [5, -2/3] ] . >> >> My attempts with read_nested_list result in things >> like >> >> (%i22) fdataL : read_nested_list ("mydata2.dat",comma); >> (%o22) [[1, 0], [2, [- 1, /, 3]], [3, [- 1, /, 2]], [4, [- 3, /, 5]], >> [5, [- 2, /, >> 3]]] >> >> 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 lan1967 at mail.ru Fri May 20 05:16:09 2011 From: lan1967 at mail.ru (t t) Date: Fri, 20 May 2011 14:16:09 +0400 Subject: [Maxima] =?utf-8?q?working_with_realroots?= Message-ID: Thanks a lot. I surely forgot to use google and didn't understand rhs when I was looking through the manual. -------------- next part -------------- An HTML attachment was scrubbed... URL: From razif66 at gmail.com Thu May 19 19:28:41 2011 From: razif66 at gmail.com (razif razali) Date: Fri, 20 May 2011 08:28:41 +0800 Subject: [Maxima] asking on kron_del In-Reply-To: References: Message-ID: this one work like charm..thanks a lot for your help.. i'm reading this paper" A full quantum theory of parametric down conversion ...." by sergey a. podoshvedov and jaewoo noh. i try to solve to get equation for 18a in page 218 so here my code so far and its good to go when i simplify the result ----braket.mac---- declare(k, integer); declare(A, integer); declare(B, integer); declare(x1, integer); declare(x2, integer); declare(y1, integer); declare(y2, integer); declare(n, integer); declare(k, scalar); declare(A, scalar); declare(B, scalar); declare(x1,scalar); declare(x2,scalar); declare(y1,scalar); declare(y2,scalar); declare(n,scalar); declare(bra, nonscalar); declare(ket, nonscalar); matchdeclare(x1,lambda([t],featurep(t,integer))); matchdeclare(x2,lambda([t],featurep(t,integer))); matchdeclare(y1,lambda([t],featurep(t,integer))); matchdeclare(y2,lambda([t],featurep(t,integer))); matchdeclare(n,lambda([t],featurep(t,integer))); matchdeclare(a, lambda([s], not mapatom(s) and op(s) = 'bra), b, lambda([s], not mapatom(s) and op(s) = 'ket)); tellsimpafter(a.b, kron_delta(args(a), args(b))); dotscrules:true; tellsimp(I.ket(x1,x2,y1,y2), ket(x1,x2,y1,y2)); tellsimp(Lx1.ket(x1,x2,y1,y2), sqrt(x1)*ket(x1-1,x2,y1,y2)); tellsimp(Rx1.ket(x1,x2,y1,y2), sqrt(x1+1)*ket(x1+1,x2,y1,y2)); tellsimp(Lx2.ket(x1,x2,y1,y2), sqrt(x2)*ket(x1,x2-1,y1,y2)); tellsimp(Rx2.ket(x1,x2,y1,y2), sqrt(x2+1)*ket(x1,x2+1,y1,y2)); tellsimp(Ly1.ket(x1,x2,y1,y2), sqrt(y1)*ket(x1,x2,y1-1,y2)); tellsimp(Ry1.ket(x1,x2,y1,y2), sqrt(y1+1)*ket(x1,x2,y1+1,y2)); tellsimp(Ly2.ket(x1,x2,y1,y2), sqrt(y2)*ket(x1,x2,y1,y2-1)); tellsimp(Ry2.ket(x1,x2,y1,y2), sqrt(y2+1)*ket(x1,x2,y1,y2+1)); declare(I, linear); declare(Lx1, linear); declare(Rx1, linear); declare(Lx2, linear); declare(Rx2, linear); declare(Ly1, linear); declare(Ry1, linear); declare(Ly2, linear); declare(Ry2, linear); matchdeclare(k,lambda([t],featurep(t,integer))); tellsimp((Lx1^^k).ket(x1,x2,y1,y2), (Lx1^^(k-1)).(Lx1.ket(x1,x2,y1,y2))); tellsimp((Rx1^^k).ket(x1,x2,y1,y2), (Rx1^^(k-1)).(Rx1.ket(x1,x2,y1,y2))); tellsimp((Lx2^^k).ket(x1,x2,y1,y2), (Lx2^^(k-1)).(Lx2.ket(x1,x2,y1,y2))); tellsimp((Rx2^^k).ket(x1,x2,y1,y2), (Rx2^^(k-1)).(Rx2.ket(x1,x2,y1,y2))); tellsimp((Ly1^^k).ket(x1,x2,y1,y2), (Ly1^^(k-1)).(Ly1.ket(x1,x2,y1,y2))); tellsimp((Ry1^^k).ket(x1,x2,y1,y2), (Ry1^^(k-1)).(Ry1.ket(x1,x2,y1,y2))); tellsimp((Ly2^^k).ket(x1,x2,y1,y2), (Ly2^^(k-1)).(Ly2.ket(x1,x2,y1,y2))); tellsimp((Ry2^^k).ket(x1,x2,y1,y2), (Ry2^^(k-1)).(Ry2.ket(x1,x2,y1,y2))); tellsimp(I^^k, I); tellsimp(((Lx1.Rx1)^^k).ket(x1,x2,y1,y2), ((Lx1.Rx1)^^(k-1)).(Lx1.Rx1.ket(x1,x2,y1,y2))); tellsimp(((Rx1.Lx1)^^k).ket(x1,x2,y1,y2), ((Rx1.Lx1)^^(k-1)).(Rx1.Lx1.ket(x1,x2,y1,y2))); tellsimp(((Lx2.Rx1)^^k).ket(x1,x2,y1,y2), ((Lx2.Rx1)^^(k-1)).(Lx2.Rx1.ket(x1,x2,y1,y2))); tellsimp(((Rx2.Lx1)^^k).ket(x1,x2,y1,y2), ((Rx2.Lx1)^^(k-1)).(Rx2.Lx1.ket(x1,x2,y1,y2))); tellsimp(((Ly1.Rx1)^^k).ket(x1,x2,y1,y2), ((Ly1.Rx1)^^(k-1)).(Ly1.Rx1.ket(x1,x2,y1,y2))); tellsimp(((Ry1.Lx1)^^k).ket(x1,x2,y1,y2), ((Ry1.Lx1)^^(k-1)).(Ry1.Lx1.ket(x1,x2,y1,y2))); tellsimp(((Ly2.Rx1)^^k).ket(x1,x2,y1,y2), ((Ly2.Rx1)^^(k-1)).(Ly2.Rx1.ket(x1,x2,y1,y2))); tellsimp(((Ry2.Lx1)^^k).ket(x1,x2,y1,y2), ((Ry2.Lx1)^^(k-1)).(Ry2.Lx1.ket(x1,x2,y1,y2))); tellsimp(((Lx1.Rx2)^^k).ket(x1,x2,y1,y2), ((Lx1.Rx2)^^(k-1)).(Lx1.Rx2.ket(x1,x2,y1,y2))); tellsimp(((Rx1.Lx2)^^k).ket(x1,x2,y1,y2), ((Rx1.Lx2)^^(k-1)).(Rx1.Lx2.ket(x1,x2,y1,y2))); tellsimp(((Lx2.Rx2)^^k).ket(x1,x2,y1,y2), ((Lx2.Rx2)^^(k-1)).(Lx2.Rx2.ket(x1,x2,y1,y2))); tellsimp(((Rx2.Lx2)^^k).ket(x1,x2,y1,y2), ((Rx2.Lx2)^^(k-1)).(Rx2.Lx2.ket(x1,x2,y1,y2))); tellsimp(((Ly1.Rx2)^^k).ket(x1,x2,y1,y2), ((Ly1.Rx2)^^(k-1)).(Ly1.Rx2.ket(x1,x2,y1,y2))); tellsimp(((Ry1.Lx2)^^k).ket(x1,x2,y1,y2), ((Ry1.Lx2)^^(k-1)).(Ry1.Lx2.ket(x1,x2,y1,y2))); tellsimp(((Ly2.Rx2)^^k).ket(x1,x2,y1,y2), ((Ly2.Rx2)^^(k-1)).(Ly2.Rx2.ket(x1,x2,y1,y2))); tellsimp(((Ry2.Lx2)^^k).ket(x1,x2,y1,y2), ((Ry2.Lx2)^^(k-1)).(Ry2.Lx2.ket(x1,x2,y1,y2))); tellsimp(((Lx1.Ry1)^^k).ket(x1,x2,y1,y2), ((Lx1.Ry1)^^(k-1)).(Lx1.Ry1.ket(x1,x2,y1,y2))); tellsimp(((Rx1.Ly1)^^k).ket(x1,x2,y1,y2), ((Rx1.Ly1)^^(k-1)).(Rx1.Ly1.ket(x1,x2,y1,y2))); tellsimp(((Lx2.Ry1)^^k).ket(x1,x2,y1,y2), ((Lx2.Ry1)^^(k-1)).(Lx2.Ry1.ket(x1,x2,y1,y2))); tellsimp(((Rx2.Ly1)^^k).ket(x1,x2,y1,y2), ((Rx2.Ly1)^^(k-1)).(Rx2.Ly1.ket(x1,x2,y1,y2))); tellsimp(((Ly1.Ry1)^^k).ket(x1,x2,y1,y2), ((Ly1.Ry1)^^(k-1)).(Ly1.Ry1.ket(x1,x2,y1,y2))); tellsimp(((Ry1.Ly1)^^k).ket(x1,x2,y1,y2), ((Ry1.Ly1)^^(k-1)).(Ry1.Ly1.ket(x1,x2,y1,y2))); tellsimp(((Ly2.Ry1)^^k).ket(x1,x2,y1,y2), ((Ly2.Ry1)^^(k-1)).(Ly2.Ry1.ket(x1,x2,y1,y2))); tellsimp(((Ry2.Ly1)^^k).ket(x1,x2,y1,y2), ((Ry2.Ly1)^^(k-1)).(Ry2.Ly1.ket(x1,x2,y1,y2))); tellsimp(((Lx1.Ry2)^^k).ket(x1,x2,y1,y2), ((Lx1.Ry2)^^(k-1)).(Lx1.Ry2.ket(x1,x2,y1,y2))); tellsimp(((Rx1.Ly2)^^k).ket(x1,x2,y1,y2), ((Rx1.Ly2)^^(k-1)).(Rx1.Ly2.ket(x1,x2,y1,y2))); tellsimp(((Lx2.Ry2)^^k).ket(x1,x2,y1,y2), ((Lx2.Ry2)^^(k-1)).(Lx2.Ry2.ket(x1,x2,y1,y2))); tellsimp(((Rx2.Ly2)^^k).ket(x1,x2,y1,y2), ((Rx2.Ly2)^^(k-1)).(Rx2.Ly2.ket(x1,x2,y1,y2))); tellsimp(((Ly1.Ry2)^^k).ket(x1,x2,y1,y2), ((Ly1.Ry2)^^(k-1)).(Ly1.Ry2.ket(x1,x2,y1,y2))); tellsimp(((Ry1.Ly2)^^k).ket(x1,x2,y1,y2), ((Ry1.Ly2)^^(k-1)).(Ry1.Ly2.ket(x1,x2,y1,y2))); tellsimp(((Ly2.Ry2)^^k).ket(x1,x2,y1,y2), ((Ly2.Ry2)^^(k-1)).(Ly2.Ry2.ket(x1,x2,y1,y2))); tellsimp(((Ry2.Ly2)^^k).ket(x1,x2,y1,y2), ((Ry2.Ly2)^^(k-1)).(Ry2.Ly2.ket(x1,x2,y1,y2))); tellsimp(Rx1.Lx1, Lx1.Rx1-I); tellsimp(Rx2.Lx2, Lx2.Rx2-I); tellsimp(Ry1.Ly1, Ly1.Ry1-I); tellsimp(Ry2.Ly2, Ly2.Ry2-I); declare(i, integer); declare(i, scalar); declare(j, integer); declare(j, scalar); --------------------------------------------------- in maxima load this file and then give specific problem which is bra(n,0,0,n).(cos(B)*sqrt(0.5)*(-%i*Rx1+Rx2)+sin(B)*sqrt(0.5)*(+%i*Ry1+Ry2)).(cos(A)*sqrt(0.5)*(Rx1-%i*Rx2)+sin(A)*sqrt(0.5)*(Ry1+%i*Ry2)).(cos(B)*sqrt(0.5)*(%i*Lx1+Lx2)+sin(B)*sqrt(0.5)*(-%i*Ly1+Ly2)).(cos(A)*sqrt(0.5)*(Lx1+%i*Lx2)+sin(A)*sqrt(0.5)*(Ly1-%i*Ly2)).ket(n,0,0,n) this term (cos(B)*sqrt(0.5)*(-%i*Rx1+Rx2)+sin(B)*sqrt(0.5)*(+%i*Ry1+Ry2)).(cos(A)*sqrt(0.5)*(Rx1-%i*Rx2)+sin(A)*sqrt(0.5)*(Ry1+%i*Ry2)).(cos(B)*sqrt(0.5)*(%i*Lx1+Lx2)+sin(B)*sqrt(0.5)*(-%i*Ly1+Ly2)).(cos(A)*sqrt(0.5)*(Lx1+%i*Lx2)+sin(A)*sqrt(0.5)*(Ly1-%i*Ly2)) is the operator that use in the experiment. thanks a lot for all help here :D On Thu, May 19, 2011 at 11:39 PM, Barton Willis wrote: > The Maxima name for the Kronecker delta function is kron_delta, not > kron_del; also, > (e1,e2, ..., en) is a compound statement--evaluation proceeds from left to > right. > The last evaluation is the value of the compound statement. (I don't know > where in the online help this is explained--it's difficult to find.) > > Example: > > (%i1) (1,2,3); > (%o1) 3 > > Other readers of this list are much more skilled with tellsimp rules than I > am, but > I'm guessing you want something like: > > (%i1) matchdeclare(a, lambda([s], not mapatom(s) and op(s) = 'bra), b, > lambda([s], not mapatom(s) and op(s) = 'ket)); > (%o1) done > > (%i2) tellsimpafter(a.b, kron_delta(args(a), args(b))); > (%o2) [.rule1,simpnct] > > (%i3) bra(3,6,7) . ket(3,6,7); > (%o3) 1 > > (%i5) bra(1,0,1) . ket(1,0,1,8); > (%o5) 0 > > (%i6) bra(1,0,0,1).ket(1,0,0,1); > (%o6) 1 > > --Barton > > -----maxima-bounces at math.utexas.edu wrote: ----- > > >To: maxima at math.utexas.edu > >From: razif razali > >Sent by: maxima-bounces at math.utexas.edu > >Date: 05/18/2011 11:49PM > >Subject: [Maxima] asking on kron_del > > > >I try to make this equation <1,0,0,1 | 1,0,0,1> = 1 and else is equal to 0 > >like what kron_del command give > >i giving maxima some rule, > >tellsimp(bra(m,n,o,l).ket(l,o,m,n),kron_del((m,n,o,l),(m,n,o,l))); > > > >but when i execute bra(1,0,0,1).ket(1,0,0,1) it just give kron_del(1,1) > >and the value should be 1 right?so how can do this in right way so that I > >can get 1 for same bra and ket while 0 for different bra and ket. > > > >-- > >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 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: A_Full_Quantum_Theory_of_PDC_and_Its_Application_to_Coincidence_Measurements_05.pdf Type: application/pdf Size: 392619 bytes Desc: not available URL: From woollett at charter.net Fri May 20 19:10:59 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 20 May 2011 17:10:59 -0700 Subject: [Maxima] Read data file containing fractional numbers? References: Message-ID: <385AF386142C49EBB0F909888F1CE249@edwinc367e16bd> On May 20, 2011, Volker van Nek wrote: -------------------------------- Hi Ted, you can use functions from stringproc: data.txt 1 0 2 -1/3 3 -1/2 4 -3/5 5 -2/3 (%i1) stream: openr("data.txt"); (%o1) # (%i2) display2d:false$ (%i3) stringdisp:true$ (%i4) lines:[]$ (%i5) while (line: readline(stream)) # false do lines: endcons(line, lines)$ (%i6) lines; (%o6) ["","1 0","2 -1/3","3 -1/2","4 -3/5","5 -2/3",""] (%i7) lines: delete("", lines); (%o7) ["1 0","2 -1/3","3 -1/2","4 -3/5","5 -2/3"] (%i8) strings: map(split, lines); (%o8) [["1","0"],["2","-1/3"],["3","-1/2"],["4","-3/5"],["5","-2/3"]] (%i9) numbers: fullmap(parse_string, strings); (%o9) [[1,0],[2,-1/3],[3,-1/2],[4,-3/5],[5,-2/3]] (%i10) 2*numbers; (%o10) [[2,0],[4,-2/3],[6,-1],[8,-6/5],[10,-4/3]] (%i11) close(stream); (%o11) true Some comments: Of course display2d:false and stringdisp:true are not necessary. The first and last line of the file was empty. Since parse_string cannot parse an empty string it is necessary to delete these empty strings from the list. The split function splits at blanks by default but other delimiters are also possible. See doc. Volker van Nek -------------------------- Thanks, Volker, for the interesting use of functions from stringproc.lisp. I will experiment and perhaps create a function which automates these steps to handle routine access to data files inside a Maxima session. I am in the process of revising Ch. 2 of Maxima by Example, which will be renamed Plot, Read, Write, and Fit. The hope is to have separate sections on reading and writing data (as well as updating the plot2d stuff). Ted From g7rgtxn at gmx.de Sat May 21 00:54:09 2011 From: g7rgtxn at gmx.de (=?iso-8859-1?Q?Dr._Klemens_Waldh=F6r?=) Date: Sat, 21 May 2011 07:54:09 +0200 Subject: [Maxima] Questions about intermediate steps when performing the differentiate diff Message-ID: <004a01cc177b$8158d2c0$840a7840$@gmx.de> Hi, is there an option to show the intermediate steps when performing the differentiate diff command? I am using maxima in my lessons and students sometimes ask to see the intermediate steps and rules applied of more complex differentiations to understand the results. Thanks! Klemens From fateman at eecs.berkeley.edu Sat May 21 09:02:48 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 21 May 2011 07:02:48 -0700 Subject: [Maxima] Questions about intermediate steps when performing the differentiate diff In-Reply-To: <004a01cc177b$8158d2c0$840a7840$@gmx.de> References: <004a01cc177b$8158d2c0$840a7840$@gmx.de> Message-ID: <4DD7C608.6000806@eecs.berkeley.edu> On 5/20/2011 10:54 PM, Dr. Klemens Waldh?r wrote: > Hi, > > is there an option to show the intermediate steps when performing the > differentiate diff command? > > I am using maxima in my lessons and students sometimes ask to see the > intermediate steps and rules applied of more complex differentiations to > understand the results. > > Thanks! > > Klemens > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima try typing trace(?sdiff); diff(f(x)*g(x),x); and see if that is what you want. ?sdiff is an internal lisp program used by diff. RJF From woollett at charter.net Sat May 21 16:23:24 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 21 May 2011 14:23:24 -0700 Subject: [Maxima] Read data file containing fractional numbers? Message-ID: <952E7FFB0BA24B43BEC2F13F40E2BA25@edwinc367e16bd> trying to include the opening (and closing? ) of the requested data file inside a block structure, and getting errors, as in: ====================== Maxima 5.24.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. 2011-05-21 (%i1) load(read_data1); (%o1) c:/work2/read_data1.mac (%i2) fundef (read_data1); (%o2) read_data1(%filename) := block([%s, %r], if not file_search(%filename) then (disp(" file not found "), return(false)), %s : openr(%filename), %r : [], while (l : readline(s)) # false do r : cons(map(parse_string, split(l)), r), reverse(%r)) (%i3) read_data1("mydata1.dat"); readline: argument must be a stream. #0: read_data1(%filename=mydata1.dat)(read_data1.mac line 13) -- an error. To debug this try: debugmode(true); ========================== lines 13 and 14 of the data file are : while (l : readline(s)) # false do ( r : cons (map(parse_string, split(l)), r)), ============================== So the file hasn't been opened for reading by my code? Ted From pbowyer at olynet.com Sat May 21 20:14:39 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sat, 21 May 2011 18:14:39 -0700 Subject: [Maxima] Read data file containing fractional numbers? In-Reply-To: <952E7FFB0BA24B43BEC2F13F40E2BA25@edwinc367e16bd> References: <952E7FFB0BA24B43BEC2F13F40E2BA25@edwinc367e16bd> Message-ID: <4DD8637F.6090603@olynet.com> On 05/21/2011 02:23 PM, Edwin Woollett wrote: > trying to include the opening (and closing? ) > of the requested data file inside a block > structure, and getting errors, as in: > ====================== > Maxima 5.24.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. > 2011-05-21 > > > (%i1) load(read_data1); > (%o1) c:/work2/read_data1.mac > (%i2) fundef (read_data1); > (%o2) read_data1(%filename) := block([%s, %r], > if not file_search(%filename) then (disp(" file not found "), > return(false)), > %s : openr(%filename), %r : [], while (l : readline(s)) # false do r : > cons(map(parse_string, split(l)), r), reverse(%r)) > (%i3) read_data1("mydata1.dat"); > readline: argument must be a stream. > #0: read_data1(%filename=mydata1.dat)(read_data1.mac line 13) > -- an error. To debug this try: debugmode(true); > ========================== > lines 13 and 14 of the data file are : > > while (l : readline(s)) # false do > ( r : cons (map(parse_string, split(l)), r)), > ============================== > So the file hasn't been opened for reading by > my code? > > > Ted > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Hi Ted: I changed your syntax slightly to add some missing % chars and got it to work with this: read_data1(%filename) := block([%s, %r], if not file_search(%filename) then (disp(" file not found "), return(false)), %s : openr(%filename), %r : [], while (l : readline(%s)) # false do %r : cons(map(parse_string, split(l)), %r), reverse(%r) ); I called it with: read_data1("/home/pfb/mydata1.dat"); But, when I include more than just simple data in the data file, it chokes: If mydata1.dat contains (No newlines in long expression ): 10.3 14.4 read_data1(%filename) := block([%s, %r],if not file_search(%filename) then (disp(" file not found "), return(false)), %s : openr(%filename), %r : [], while (l : readline(%s)) # false do %r : cons(map(parse_string, split(l)), %r), reverse(%r)); 12.6 14.5 It gives this error: stdin:2:incorrect syntax: := is not a prefix operator If mydata1.dat contains (No newlines in long expression -- copy pasted from fundef (read_data1) output): 10.3 14.4 read_data1(%filename):=block([%s,%r],if notfile_search(%filename) then (disp(" file not found "),return(false)) ,%s:openr(%filename),%r:[],while (l:readline(%s))#false do %r:cons(map(parse_string,split(l)),%r),reverse(%r)); 12.6 14.5 It gives this error: stdin:40:incorrect syntax: Premature termination of input at $. If mydata1.dat contains (No newlines in long expression, quoted expression, and escaped " chars): 10.3 14.4 "read_data1(%filename):=block([%s,%r],if notfile_search(%filename) then (disp(\" file not found \"),return(false)) ,%s:openr(%filename),%r:[],while (l:readline(%s))#false do %r:cons(map(parse_string,split(l)),%r),reverse(%r));" 12.6 14.5 It gives this error, which seems to say it got past readline, but now chokes at parsing: Maxima encountered a Lisp error: Error in function PEEK-ONE-TOKEN-G: parser: end of file while scanning expression. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. If mydata1.dat contains: 10.3 14.4 12.6 14.5 it works fine. It looks like you need to quote your expressions and then pre-process them them before your run them into the parser, but I'm uncertain if that's true. Paul From pbowyer at olynet.com Sun May 22 13:29:35 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sun, 22 May 2011 11:29:35 -0700 Subject: [Maxima] Read data file containing fractional numbers? In-Reply-To: <4DD8637F.6090603@olynet.com> References: <952E7FFB0BA24B43BEC2F13F40E2BA25@edwinc367e16bd> <4DD8637F.6090603@olynet.com> Message-ID: <4DD9560F.4050108@olynet.com> On 05/21/2011 06:14 PM, Paul Bowyer wrote: > On 05/21/2011 02:23 PM, Edwin Woollett wrote: >> trying to include the opening (and closing? ) >> of the requested data file inside a block >> structure, and getting errors, as in: >> ====================== >> Maxima 5.24.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. >> 2011-05-21 >> >> >> (%i1) load(read_data1); >> (%o1) c:/work2/read_data1.mac >> (%i2) fundef (read_data1); >> (%o2) read_data1(%filename) := block([%s, %r], >> if not file_search(%filename) then (disp(" file not found "), >> return(false)), >> %s : openr(%filename), %r : [], while (l : readline(s)) # false do r : >> cons(map(parse_string, split(l)), r), reverse(%r)) >> (%i3) read_data1("mydata1.dat"); >> readline: argument must be a stream. >> #0: read_data1(%filename=mydata1.dat)(read_data1.mac line 13) >> -- an error. To debug this try: debugmode(true); >> ========================== >> lines 13 and 14 of the data file are : >> >> while (l : readline(s)) # false do >> ( r : cons (map(parse_string, split(l)), r)), >> ============================== >> So the file hasn't been opened for reading by >> my code? >> >> >> Ted >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > Hi Ted: > > I changed your syntax slightly to add some missing % chars and got it > to work with this: > read_data1(%filename) := block([%s, %r], > if not file_search(%filename) then > (disp(" file not found "), return(false)), > %s : openr(%filename), > %r : [], > while (l : readline(%s)) # false do > %r : cons(map(parse_string, split(l)), %r), > reverse(%r) > ); > > I called it with: > read_data1("/home/pfb/mydata1.dat"); > > But, when I include more than just simple data in the data file, it > chokes: > > If mydata1.dat contains (No newlines in long expression ): > 10.3 > 14.4 > read_data1(%filename) := block([%s, %r],if not file_search(%filename) > then (disp(" file not found "), return(false)), %s : > openr(%filename), %r : [], while (l : readline(%s)) # false do %r > : cons(map(parse_string, split(l)), %r), reverse(%r)); > 12.6 > 14.5 > It gives this error: > stdin:2:incorrect syntax: := is not a prefix operator > > If mydata1.dat contains (No newlines in long expression -- copy pasted > from fundef (read_data1) output): > 10.3 > 14.4 > read_data1(%filename):=block([%s,%r],if notfile_search(%filename) then > (disp(" file not found "),return(false)) > ,%s:openr(%filename),%r:[],while (l:readline(%s))#false do > %r:cons(map(parse_string,split(l)),%r),reverse(%r)); > 12.6 > 14.5 > It gives this error: > stdin:40:incorrect syntax: Premature termination of input at $. > > If mydata1.dat contains (No newlines in long expression, quoted > expression, and escaped " chars): > 10.3 > 14.4 > "read_data1(%filename):=block([%s,%r],if notfile_search(%filename) > then (disp(\" file not found \"),return(false)) > ,%s:openr(%filename),%r:[],while (l:readline(%s))#false do > %r:cons(map(parse_string,split(l)),%r),reverse(%r));" > 12.6 > 14.5 > It gives this error, which seems to say it got past readline, but now > chokes at parsing: > Maxima encountered a Lisp error: > > Error in function PEEK-ONE-TOKEN-G: > parser: end of file while scanning expression. > Automatically continuing. > To enable the Lisp debugger set *debugger-hook* to nil. > > > If mydata1.dat contains: > 10.3 > 14.4 > 12.6 > 14.5 > it works fine. > > It looks like you need to quote your expressions and then pre-process > them them before your run them into the parser, but I'm uncertain if > that's true. > > Paul > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Hi again Ted: I fiddled with this a little more this morning when I had some time so I could understand what's happening. Part of the problem last night was there wasn't a closing of the stream, so maxima kept opening new steams each time I ran the function. I modified it again like this to break out the various parts and add a close statement: read_data1(%filename) := block([%s, %r], if not file_search(%filename) then (disp(" file not found "), return(false)), %s : openr(%filename), %r : [], while (l : readline(%s)) # false do ( /*%r : cons(map(parse_string, split(l)), %r),*/ %r : l, %r : split (%r), %r : parse_string ( %r ), /*chokes here. Need something different!*/ disp( %r ) /*reverse(%r)*/ ), close(%s) ); mydata1.dat contains (unquoted and without newlines in long expression, but with internal spaces): 10.3 14.4 read_data1(%filename):=block([%s,%r],if notfile_search(%filename) then (disp(" file not found "),return(false)) ,%s:openr(%filename),%r:[],while (l:readline(%s))#false do %r:cons(map(parse_string,split(l)),%r),reverse(%r)) 12.6 14.5 called as: read_data1("/home/pfb/mydata1.dat"); and the output was: parse_string: ["10.3"] is not a string. #0: read_data1(%filename=/home/pfb/mydata1.dat) -- an error. To debug this try: debugmode(true); Paul From tomdean at speakeasy.org Sun May 22 21:45:47 2011 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Sun, 22 May 2011 19:45:47 -0700 Subject: [Maxima] plot2d error Message-ID: <1306118747.2454.112.camel@asus> clisp layout_autotools true Maxima 5.24.0 http://maxima.sourceforge.net using Lisp CLISP 2.44.1 (2008-02-23) 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) plot2d(abs(zeta(1/2+x*%i)),[x,0,36]); Maxima encountered a Lisp error: NO-APPLICABLE-METHOD: When calling # with arguments (1/2), no method is applicable. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. tomdean From villate at fe.up.pt Mon May 23 02:16:06 2011 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 23 May 2011 08:16:06 +0100 Subject: [Maxima] plot2d error In-Reply-To: <1306118747.2454.112.camel@asus> References: <1306118747.2454.112.camel@asus> Message-ID: <1306134966.1938.0.camel@wigner> On Sun, 2011-05-22 at 19:45 -0700, Thomas D. Dean wrote: > Maxima 5.24.0 http://maxima.sourceforge.net > using Lisp CLISP 2.44.1 (2008-02-23) > 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) plot2d(abs(zeta(1/2+x*%i)),[x,0,36]); > Maxima encountered a Lisp error: > NO-APPLICABLE-METHOD: When calling # BIGFLOAT-IMPL:EPSILON> with arguments (1/2), no method is > applicable. It works fine for me: Maxima 5.23post http://maxima.sourceforge.net using Lisp SBCL 1.0.40.0.debian Regards, Jaime From toy.raymond at gmail.com Mon May 23 08:17:21 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 23 May 2011 09:17:21 -0400 Subject: [Maxima] plot2d error References: <1306118747.2454.112.camel@asus> Message-ID: >>>>> "Thomas" == Thomas D Dean writes: Thomas> clisp Thomas> layout_autotools true Thomas> Maxima 5.24.0 http://maxima.sourceforge.net Thomas> using Lisp CLISP 2.44.1 (2008-02-23) Thomas> Distributed under the GNU Public License. See the file COPYING. Thomas> Dedicated to the memory of William Schelter. Thomas> The function bug_report() provides bug reporting information. Thomas> (%i1) plot2d(abs(zeta(1/2+x*%i)),[x,0,36]); Thomas> Maxima encountered a Lisp error: Thomas> NO-APPLICABLE-METHOD: When calling # BIGFLOAT-IMPL:EPSILON> with arguments (1/2), no method is applicable. I can reproduce this. This is caused by clisp's (non-ANSI) behavior that (complex 1/2 0.5) -> #c(1/2 0.5). All other Lisp's would return #c(0.5 0.5). I'll look into a fix for this. Ray From toy.raymond at gmail.com Mon May 23 08:55:41 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 23 May 2011 09:55:41 -0400 Subject: [Maxima] plot2d error References: <1306118747.2454.112.camel@asus> Message-ID: >>>>> "Raymond" == Raymond Toy writes: >>>>> "Thomas" == Thomas D Dean writes: Thomas> clisp Thomas> layout_autotools true Thomas> Maxima 5.24.0 http://maxima.sourceforge.net Thomas> using Lisp CLISP 2.44.1 (2008-02-23) Thomas> Distributed under the GNU Public License. See the file COPYING. Thomas> Dedicated to the memory of William Schelter. Thomas> The function bug_report() provides bug reporting information. Thomas> (%i1) plot2d(abs(zeta(1/2+x*%i)),[x,0,36]); Thomas> Maxima encountered a Lisp error: Thomas> NO-APPLICABLE-METHOD: When calling # BIGFLOAT-IMPL:EPSILON> with arguments (1/2), no method is applicable. Raymond> I can reproduce this. This is caused by clisp's (non-ANSI) behavior Raymond> that (complex 1/2 0.5) -> #c(1/2 0.5). All other Lisp's would return Raymond> #c(0.5 0.5). Raymond> I'll look into a fix for this. Fixed. This probably fixes some other related issues with how maxima and clisp handle complex numbers. Ray From woollett at charter.net Mon May 23 14:17:55 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 23 May 2011 12:17:55 -0700 Subject: [Maxima] detect unix or dos line endings Message-ID: <196405B884684234ADCAF060D1C5C8CF@edwinc367e16bd> How can I use Maxima to determine whether a text file has unix (LF = ascii 10) or dos line endings (CR = ascii 13, LF)? Ted Woollett From ahmed.abdelhakim at student.unife.it Mon May 23 07:52:40 2011 From: ahmed.abdelhakim at student.unife.it (ABDELHAKIM MOUHAMED AHMED ABDELSATTAR) Date: Mon, 23 May 2011 14:52:40 +0200 Subject: [Maxima] Installing Maxima on mac ox s 10.4.11 (ppc processor) Message-ID: Hi, I need to install maxima on ibook G4 ppc processor running mac os x 10.4.11. I tried installing all the maxima(version).dmg files but (after successful download and unraring and copying to the applications folder) when I doubleclick the wxmaxima, I get the message ..something like " this application cannot open ...." and when I try to run the Maxiam program i get the message telling me that the system is not suitable for it. If I need to build up maxima from source files...please kindly tell me in simple steps what to download -the links- the lines I should type in terminal.app because I have no idea about this! Thank you so much ... -- Ahmed Abdelhakim Dipatimento di Matematica 35, via Machiavelli 44121- Ferrara (FE)-Italy From pbowyer at olynet.com Mon May 23 14:51:06 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Mon, 23 May 2011 12:51:06 -0700 Subject: [Maxima] detect unix or dos line endings In-Reply-To: <196405B884684234ADCAF060D1C5C8CF@edwinc367e16bd> References: <196405B884684234ADCAF060D1C5C8CF@edwinc367e16bd> Message-ID: <4DDABAAA.6080409@olynet.com> On 05/23/2011 12:17 PM, Edwin Woollett wrote: > How can I use Maxima to determine whether a text > file has unix (LF = ascii 10) or dos line endings (CR = ascii 13, LF)? > > Ted Woollett > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Hi again Ted: Look in the help file for "ascii (int)" and "cequal (char_1, char_2)" and its friends as a possible solution. Paul From drdieterkaiser at web.de Mon May 23 15:50:01 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 23 May 2011 22:50:01 +0200 Subject: [Maxima] Work on the Manual Message-ID: <1306183801.1798.12.camel@dieter> German readers might have followed the work on the German translation of the manual. The work is not finished, but I have already translated big parts. It is not only a translation, but I have reorganized parts of the documentation and I have added examples and documentation. Furthermore, I have put in a lot of cross references. I have an online version of the German manual at http://crategus.users.sourceforge.net/maxima.html I would like to start to put some of the work into the English manual. The following shows the structure of the first 13 chapters the German manual. Most of the material up to chapter 30 has been translated. If desired, I would like to restructure the English manual in the same way. # 1. Introduction to Maxima # 2. Bug Detection and Reporting * 2.1 Introduction to Bug Detection and Reporting * 2.2 Functions and Variables for Bug Detection and Reporting # 3. Help * 3.1 Documentation * 3.2 Functions and Variables for Help # 4. Command Line * 4.1 Introduction to Command Line * 4.2 Functions and Variables for Input * 4.2 Functions and Variables for Output # 5. Data Types and Structures * 5.1 Numbers o 5.1.1 Introduction to Numbers o 5.1.2 Functions and Variables for Numbers * 5.2 Strings o 5.2.1 Introduction to Strings o 5.2.2 Functions and Variables for Strings * 5.3 Functions and Variables for Constants * 5.4 Lists o 5.4.1 Introduction to Lists o 5.4.2 Functions and Variables for Lists * 5.5 Arrays o 5.5.1 Introduction to Arrays o 5.5.2 Functions and Variables for Arrays * 5.6 Structures o 5.6.1 Introduction to Structures o 5.6.2 Functions and Variables for Structures # 6. Expressions * 6.1 Introduction to Expressions * 6.2 Nouns and Verbs * 6.3 Identifiers * 6.4 Functions and Variables for Expressions # 7. Operators * 7.1 Introduction to Operators * 7.2 Arithmetic Operators * 7.3 Relational Operators * 7.4 Logical Operators * 7.5 Operators for Equations * 7.6 Assignment Operators * 7.7 User defined Operators o 7.7.1 Introduction to User defined Operators o 7.7.2 Functions and Variables for User defined Operators # 8. Evaluation * 8.1 Introduction to Evaluation * 8.2 Functions and Variables for Evaluation # 9. Simplification * 9.1 Introduction to Simplification * 9.2 Functions and Variables for Simplification # 10. Mathematical Functions * 10.1 Functions for Numbers * 10.2 Functions for Complex Numbers * 10.3 Combinatorial Functions * 10.4 Root, Exponential and Logarithmic Functions * 10.5 Trigonometric Functions o 10.5.1 Introduction to Trigonometric Functions o 10.5.2 Functions and Variables for Trigonometric Functions * 10.6 Hyperbolic Functions o 10.6.1 Introduction to Hyperbolic Functions o 10.6.2 Functions and Variables for Hyperbolic Functions * 10.7 Random Numbers # 11. Maximas Database * 11.1 Introduction to Maximas Database * 11.2 Functions and Variables for Properties * 11.3 Functions and Variables for Facts * 11.4 Functions and Variables for Predicates # 12. Plotting * 12.1 Introduction to Plotting * 12.2 Plotting Formats * 12.3 Functions and Variables for Plotting * 12.4 Plotting Options * 12.5 Gnuplot Options * 12.6 Gnuplot_pipes Format Functions # 13. Input and Output * 13.1 Comments * 13.2 Files * 13.3 Functions and Variables for Input and Output * 13.4 Functions and Variables for Tex Output * 13.5 Functions and Variables for Fortran Output Dieter Kaiser From volkervannek at googlemail.com Mon May 23 16:12:28 2011 From: volkervannek at googlemail.com (Volker van Nek) Date: Mon, 23 May 2011 23:12:28 +0200 Subject: [Maxima] Read data file containing fractional numbers? In-Reply-To: <4DD9560F.4050108@olynet.com> References: <952E7FFB0BA24B43BEC2F13F40E2BA25@edwinc367e16bd> <4DD8637F.6090603@olynet.com> <4DD9560F.4050108@olynet.com> Message-ID: Hi Paul, I only can guess what you're trying to do here. It seems to me that the result of splitting is not what you want and in the end the parser complains. The parser needs a string which contains a valid Maxima expression. An example: (%i1) stringdisp:true$ (%i2) string: "10.2; sqrt(1.44); if true then x; foo+foo"; (%o2) "10.2; sqrt(1.44); if true then x; foo+foo" (%i3) strings: split(string,";"); (%o3) ["10.2", " sqrt(1.44)", " if true then x", " foo+foo"] (%i4) expressions: map(parse_string, strings); (%o4) [10.2, 1.2, if true then x, 2 foo] (%i5) ''expressions; (%o5) [10.2, 1.2, x, 2 foo] Comments: split(string) would split at blanks (the default). This wouldn't fit in case of expressions which contain e.g. operators and arguments and of course blanks itself. split(string, delimiter) allows to define other delimiters, e.g. ";" or "," or ... The parsed expressions are simplified but not evaluated . If you want evaluation you can use ev or '' (2 quotes) or the eval_string function. Hope this helps Volker 2011/5/22 Paul Bowyer > On 05/21/2011 06:14 PM, Paul Bowyer wrote: > >> On 05/21/2011 02:23 PM, Edwin Woollett wrote: >> >>> trying to include the opening (and closing? ) >>> of the requested data file inside a block >>> structure, and getting errors, as in: >>> ====================== >>> Maxima 5.24.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. >>> 2011-05-21 >>> >>> >>> (%i1) load(read_data1); >>> (%o1) c:/work2/read_data1.mac >>> (%i2) fundef (read_data1); >>> (%o2) read_data1(%filename) := block([%s, %r], >>> if not file_search(%filename) then (disp(" file not found "), >>> return(false)), >>> %s : openr(%filename), %r : [], while (l : readline(s)) # false do r : >>> cons(map(parse_string, split(l)), r), reverse(%r)) >>> (%i3) read_data1("mydata1.dat"); >>> readline: argument must be a stream. >>> #0: read_data1(%filename=mydata1.dat)(read_data1.mac line 13) >>> -- an error. To debug this try: debugmode(true); >>> ========================== >>> lines 13 and 14 of the data file are : >>> >>> while (l : readline(s)) # false do >>> ( r : cons (map(parse_string, split(l)), r)), >>> ============================== >>> So the file hasn't been opened for reading by >>> my code? >>> >>> >>> Ted >>> >>> >>> _______________________________________________ >>> Maxima mailing list >>> Maxima at math.utexas.edu >>> http://www.math.utexas.edu/mailman/listinfo/maxima >>> >>> Hi Ted: >> >> I changed your syntax slightly to add some missing % chars and got it to >> work with this: >> read_data1(%filename) := block([%s, %r], >> if not file_search(%filename) then >> (disp(" file not found "), return(false)), >> %s : openr(%filename), >> %r : [], >> while (l : readline(%s)) # false do >> %r : cons(map(parse_string, split(l)), %r), >> reverse(%r) >> ); >> >> I called it with: >> read_data1("/home/pfb/mydata1.dat"); >> >> But, when I include more than just simple data in the data file, it >> chokes: >> >> If mydata1.dat contains (No newlines in long expression ): >> 10.3 >> 14.4 >> read_data1(%filename) := block([%s, %r],if not file_search(%filename) then >> (disp(" file not found "), return(false)), %s : openr(%filename), %r : [], >> while (l : readline(%s)) # false do %r : cons(map(parse_string, >> split(l)), %r), reverse(%r)); >> 12.6 >> 14.5 >> It gives this error: >> stdin:2:incorrect syntax: := is not a prefix operator >> >> If mydata1.dat contains (No newlines in long expression -- copy pasted >> from fundef (read_data1) output): >> 10.3 >> 14.4 >> read_data1(%filename):=block([%s,%r],if notfile_search(%filename) then >> (disp(" file not found "),return(false)) ,%s:openr(%filename),%r:[],while >> (l:readline(%s))#false do >> %r:cons(map(parse_string,split(l)),%r),reverse(%r)); >> 12.6 >> 14.5 >> It gives this error: >> stdin:40:incorrect syntax: Premature termination of input at $. >> >> If mydata1.dat contains (No newlines in long expression, quoted >> expression, and escaped " chars): >> 10.3 >> 14.4 >> "read_data1(%filename):=block([%s,%r],if notfile_search(%filename) then >> (disp(\" file not found \"),return(false)) ,%s:openr(%filename),%r:[],while >> (l:readline(%s))#false do >> %r:cons(map(parse_string,split(l)),%r),reverse(%r));" >> 12.6 >> 14.5 >> It gives this error, which seems to say it got past readline, but now >> chokes at parsing: >> Maxima encountered a Lisp error: >> >> Error in function PEEK-ONE-TOKEN-G: >> parser: end of file while scanning expression. >> Automatically continuing. >> To enable the Lisp debugger set *debugger-hook* to nil. >> >> >> If mydata1.dat contains: >> 10.3 >> 14.4 >> 12.6 >> 14.5 >> it works fine. >> >> It looks like you need to quote your expressions and then pre-process them >> them before your run them into the parser, but I'm uncertain if that's true. >> >> Paul >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> Hi again Ted: > > I fiddled with this a little more this morning when I had some time so I > could understand what's happening. > > Part of the problem last night was there wasn't a closing of the stream, so > maxima kept opening new steams each time I ran the function. > > I modified it again like this to break out the various parts and add a > close statement: > > read_data1(%filename) := block([%s, %r], > if not file_search(%filename) then > (disp(" file not found "), return(false)), > %s : openr(%filename), > %r : [], > while (l : readline(%s)) # false do > ( > /*%r : cons(map(parse_string, split(l)), %r),*/ > %r : l, > %r : split (%r), > %r : parse_string ( %r ), /*chokes here. Need something different!*/ > disp( %r ) > /*reverse(%r)*/ > ), > close(%s) > ); > > mydata1.dat contains (unquoted and without newlines in long expression, but > with internal spaces): > > 10.3 > 14.4 > read_data1(%filename):=block([%s,%r],if notfile_search(%filename) then > (disp(" file not found "),return(false)) ,%s:openr(%filename),%r:[],while > (l:readline(%s))#false do > %r:cons(map(parse_string,split(l)),%r),reverse(%r)) > 12.6 > 14.5 > > called as: > > read_data1("/home/pfb/mydata1.dat"); > > and the output was: > parse_string: ["10.3"] is not a string. > #0: read_data1(%filename=/home/pfb/mydata1.dat) > > -- an error. To debug this try: debugmode(true); > > 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 woollett at charter.net Mon May 23 16:22:28 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 23 May 2011 14:22:28 -0700 Subject: [Maxima] Read data file containing fractional numbers? References: <952E7FFB0BA24B43BEC2F13F40E2BA25@edwinc367e16bd> <4DD8637F.6090603@olynet.com> <4DD9560F.4050108@olynet.com> Message-ID: On May 22, 2011, Paul Bowyer wrote: -------------------------------------------------- I modified it again like this to break out the various parts and add a close statement: read_data1(%filename) := block([%s, %r], if not file_search(%filename) then (disp(" file not found "), return(false)), %s : openr(%filename), %r : [], while (l : readline(%s)) # false do ( /*%r : cons(map(parse_string, split(l)), %r),*/ %r : l, %r : split (%r), %r : parse_string ( %r ), /*chokes here. Need something different!*/ disp( %r ) /*reverse(%r)*/ ), close(%s) ); mydata1.dat contains (unquoted and without newlines in long expression, but with internal spaces): 10.3 14.4 read_data1(%filename):=block([%s,%r],if notfile_search(%filename) then (disp(" file not found "),return(false)) ,%s:openr(%filename),%r:[],while (l:readline(%s))#false do %r:cons(map(parse_string,split(l)),%r),reverse(%r)) 12.6 14.5 called as: read_data1("/home/pfb/mydata1.dat"); and the output was: parse_string: ["10.3"] is not a string. #0: read_data1(%filename=/home/pfb/mydata1.dat) -- an error. To debug this try: debugmode(true); Paul ----------------------------------- Hi Paul, and thanks for catching my dumb typos. The following version of read_data1 works with all data files I have tested, decimal numbers, fractional numbers, and doesn't care about text file line endings. read_data1(%filename) := block ([%s,%r,%l], if not file_search (%filename) then (disp (" file not found "),return (false)), %s : openr (%filename), %r : [], while (%l : readline(%s)) # false do ( %r : cons (map(parse_string, split(%l)), %r)), close (%s), reverse (%r))$ Ted From volkervannek at googlemail.com Mon May 23 16:34:46 2011 From: volkervannek at googlemail.com (Volker van Nek) Date: Mon, 23 May 2011 23:34:46 +0200 Subject: [Maxima] Work on the Manual In-Reply-To: <1306183801.1798.12.camel@dieter> References: <1306183801.1798.12.camel@dieter> Message-ID: Hallo Dieter, I really appreciate your work on the German documentation and the tutorials on your Maxima webside! Greetings Volker van Nek 2011/5/23 Dieter Kaiser > German readers might have followed the work on the German translation of > the manual. The work is not finished, but I have already translated big > parts. It is not only a translation, but I have reorganized parts of the > documentation and I have added examples and documentation. > > Furthermore, I have put in a lot of cross references. I have an online > version of the German manual at > http://crategus.users.sourceforge.net/maxima.html > > I would like to start to put some of the work into the English manual. > The following shows the structure of the first 13 chapters the German > manual. Most of the material up to chapter 30 has been translated. > > If desired, I would like to restructure the English manual in the same > way. > > # 1. Introduction to Maxima > > # 2. Bug Detection and Reporting > * 2.1 Introduction to Bug Detection and Reporting > * 2.2 Functions and Variables for Bug Detection and Reporting > > # 3. Help > > * 3.1 Documentation > * 3.2 Functions and Variables for Help > > # 4. Command Line > > * 4.1 Introduction to Command Line > * 4.2 Functions and Variables for Input > * 4.2 Functions and Variables for Output > > # 5. Data Types and Structures > > * 5.1 Numbers > o 5.1.1 Introduction to Numbers > o 5.1.2 Functions and Variables for Numbers > * 5.2 Strings > o 5.2.1 Introduction to Strings > o 5.2.2 Functions and Variables for Strings > * 5.3 Functions and Variables for Constants > * 5.4 Lists > o 5.4.1 Introduction to Lists > o 5.4.2 Functions and Variables for Lists > * 5.5 Arrays > o 5.5.1 Introduction to Arrays > o 5.5.2 Functions and Variables for Arrays > * 5.6 Structures > o 5.6.1 Introduction to Structures > o 5.6.2 Functions and Variables for Structures > > # 6. Expressions > > * 6.1 Introduction to Expressions > * 6.2 Nouns and Verbs > * 6.3 Identifiers > * 6.4 Functions and Variables for Expressions > > # 7. Operators > > * 7.1 Introduction to Operators > * 7.2 Arithmetic Operators > * 7.3 Relational Operators > * 7.4 Logical Operators > * 7.5 Operators for Equations > * 7.6 Assignment Operators > * 7.7 User defined Operators > o 7.7.1 Introduction to User defined Operators > o 7.7.2 Functions and Variables for User defined Operators > > # 8. Evaluation > > * 8.1 Introduction to Evaluation > * 8.2 Functions and Variables for Evaluation > > # 9. Simplification > > * 9.1 Introduction to Simplification > * 9.2 Functions and Variables for Simplification > > # 10. Mathematical Functions > > * 10.1 Functions for Numbers > * 10.2 Functions for Complex Numbers > * 10.3 Combinatorial Functions > * 10.4 Root, Exponential and Logarithmic Functions > * 10.5 Trigonometric Functions > o 10.5.1 Introduction to Trigonometric Functions > o 10.5.2 Functions and Variables for Trigonometric Functions > * 10.6 Hyperbolic Functions > o 10.6.1 Introduction to Hyperbolic Functions > o 10.6.2 Functions and Variables for Hyperbolic Functions > * 10.7 Random Numbers > > # 11. Maximas Database > > * 11.1 Introduction to Maximas Database > * 11.2 Functions and Variables for Properties > * 11.3 Functions and Variables for Facts > * 11.4 Functions and Variables for Predicates > > # 12. Plotting > > * 12.1 Introduction to Plotting > * 12.2 Plotting Formats > * 12.3 Functions and Variables for Plotting > * 12.4 Plotting Options > * 12.5 Gnuplot Options > * 12.6 Gnuplot_pipes Format Functions > > # 13. Input and Output > > * 13.1 Comments > * 13.2 Files > * 13.3 Functions and Variables for Input and Output > * 13.4 Functions and Variables for Tex Output > * 13.5 Functions and Variables for Fortran Output > > Dieter Kaiser > > > _______________________________________________ > 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 dufault at hda.com Mon May 23 16:39:49 2011 From: dufault at hda.com (Peter Dufault) Date: Mon, 23 May 2011 17:39:49 -0400 Subject: [Maxima] Question about declare and properties of functions versus variables Message-ID: <8391C9BE-8A8E-4783-BB6F-A95A75A3309C@hda.com> "declare" says that some properties are for functions and some are for variables. In particular, real, scalar, and imaginary apply to variables. I have this: /* XXX "ip" and "qp" are functions, so does "real", "scalar", or "imaginary" * apply? */ declare (ip,[real,scalar,evenfun]); declare (qp,[imaginary,scalar,oddfun]); However, then I take rectform of them, and maxima seems to know that ip is strictly real, but not that qp is strictly imaginary: (%i10) rectform(qp(k)); (%o10) realpart(qp(k)) + %i imagpart(qp(k)) (%i11) rectform(ip(k)); (%o11) ip(k) What don't I understand? (Maxima 5.23.2 http://maxima.sourceforge.net using Lisp SBCL 1.0.40-1.fc14) Peter ----------------- Peter Dufault HD Associates, Inc. Software and System Engineering From woollett at charter.net Mon May 23 16:43:16 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 23 May 2011 14:43:16 -0700 Subject: [Maxima] detect unix or dos line endings References: <196405B884684234ADCAF060D1C5C8CF@edwinc367e16bd> <4DDABAAA.6080409@olynet.com> Message-ID: On May 23, Paul Bowyer wrote: ------------------------------------ On 05/23/2011 12:17 PM, Edwin Woollett wrote: > How can I use Maxima to determine whether a text > file has unix (LF = ascii 10) or dos line endings (CR = ascii 13, LF)? > > Ted Woollett > Hi again Ted: Look in the help file for "ascii (int)" and "cequal (char_1, char_2)" and its friends as a possible solution. Paul ---------------------------------------------- Thanks, Paul, but so far these critters are no help. For example, using openr, and then readline, results in all the characters of the line EXCEPT the LF ( or CR LF ) characters at the end of the binary line. So there is no "there" to interrogate. On May 23, Dan Stanger wrote: --------------------------------------------- Use the underlying lisp. Dan ----------------------------------- Hi Dan, I would like to find a solution which only uses the tools presently available in the Maxima language, such as are provided in file reads, and string processing, etc. I would like to include something about reading and writing files within the Maxima language in the revised Ch.2 of Maxima by Example. This should include mundane tasks such as file_length, file_type (unix or dos line endings), utilities such as unix_to_dos, dos_to_unix file conversions, etc, etc. So far, Maxima by Example has earnestly endeavored to accomplish basic grunt tasks using just the basic Maxima language tools (things you can do in True Basic, for example), since it is supposed to be an introduction, and not really for experts. Once I am satisfied that a good introduction for beginners exists, it might be time for some Lisp code tutorials. Ted From pbowyer at olynet.com Mon May 23 19:40:07 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Mon, 23 May 2011 17:40:07 -0700 Subject: [Maxima] detect unix or dos line endings In-Reply-To: References: <196405B884684234ADCAF060D1C5C8CF@edwinc367e16bd> <4DDABAAA.6080409@olynet.com> Message-ID: <4DDAFE67.9010102@olynet.com> On 05/23/2011 02:43 PM, Edwin Woollett wrote: > On May 23, Paul Bowyer wrote: > ------------------------------------ > > On 05/23/2011 12:17 PM, Edwin Woollett wrote: >> How can I use Maxima to determine whether a text >> file has unix (LF = ascii 10) or dos line endings (CR = ascii 13, LF)? >> >> Ted Woollett >> > Hi again Ted: > > Look in the help file for "ascii (int)" and "cequal (char_1, char_2)" > and its friends as a possible solution. > > Paul > ---------------------------------------------- > Thanks, Paul, but so far these critters are no help. > For example, using openr, and then readline, results in all the > characters of the line EXCEPT > the LF ( or CR LF ) characters at the end of the > binary line. So there is no "there" to > interrogate. > > On May 23, Dan Stanger wrote: > --------------------------------------------- > Use the underlying lisp. > Dan > ----------------------------------- > > Hi Dan, I would like to find a solution which only uses > the tools presently available in the Maxima language, > such as are provided in file reads, and string processing, > etc. I would like to include something about > reading and writing files within the Maxima language in > the revised Ch.2 of Maxima by Example. This should > include mundane tasks such as file_length, file_type > (unix or dos line endings), utilities such as > unix_to_dos, dos_to_unix file conversions, etc, etc. > > So far, Maxima by Example has earnestly endeavored > to accomplish basic grunt tasks using just the basic > Maxima language tools (things you can do in > True Basic, for example), since it is supposed > to be an introduction, and not really for experts. > Once I am satisfied that a good introduction for > beginners exists, it might be time for some Lisp > code tutorials. > > Ted > > > Ted: I found functions for opening binary and reading binary, but they bring in floating point numbers and I didn't find anything to convert that to ascii. If it's available in Maxima without resorting to lisp, I couldn't find it. Paul From kcrisman at gmail.com Mon May 23 19:57:56 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Mon, 23 May 2011 20:57:56 -0400 Subject: [Maxima] OS X PPC Maxima Message-ID: > > Message: 6 > Date: Mon, 23 May 2011 14:52:40 +0200 > From: ABDELHAKIM MOUHAMED AHMED ABDELSATTAR > ? ? ? ? > To: maxima at math.utexas.edu > Subject: [Maxima] Installing Maxima on mac ox s 10.4.11 (ppc > ? ? ? ?processor) > Message-ID: > Content-Type: text/plain; charset=ISO-8859-1 > > Hi, > I need to install maxima on ibook G4 ppc processor running mac os x 10.4.11. > I tried installing all the maxima(version).dmg files but (after > successful download and unraring and copying to the applications > folder) when I doubleclick the wxmaxima, I get the message ..something > like ?" ?this application cannot open ...." and when I try to run the > Maxiam program > i get the message telling me that the system is not suitable for it. > If I need to build up maxima from source files...please kindly tell me > in simple steps what to download -the links- the lines I should type > in terminal.app because I have no idea about this! > Thank you so much ... > You can build it from source relatively easily, I think, if you have a lisp. (I get mine via Fink.) The page http://pangea.stanford.edu/~schmitt/maxima.html has good instructions, though sometimes I have to do ./bootstrap first (thanks to Barton Willis for this tip). You don't necessarily have to use CMUCL, but then you have to do the correct configure command. Ironically, another way to get Maxima (slightly out of date) for this platform is to download Sage for this platform, and then use the command sage -maxima to get Maxima. The downside is that it would not come with wxmaxima, if you are looking for that. Good luck! From kcrisman at gmail.com Tue May 24 07:58:49 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Tue, 24 May 2011 08:58:49 -0400 Subject: [Maxima] OS X PPC Maxima In-Reply-To: <252980.76234.qm@web44805.mail.sp1.yahoo.com> References: <252980.76234.qm@web44805.mail.sp1.yahoo.com> Message-ID: > I appreciate your reply...but still have some questions if you may. > You can build it from source relatively easily, I think, if you have a > lisp. > What is the suitable lisp for me? please recommend a pecise filename so > that I download > and install. > (I get mine via Fink.) > I installed fink and tried downloading and installing maxima with cmul and > it was successful i guess..but I couldnot get the maxima to work!!! or let > me say did not know how or where to start! > I'm sorry that I can't say a lot more than is at the page below; I just followed its instructions. What you *do* need to do is make sure you actually have the lisp. CMUCL or whatever, installed via Fink, would live in /sw/bin/cmucl most likely. Then do step 6 in the web page. Then step 7, but instead of configure --with-cmucl=/usr/local/bin/lisp probably do configure --with-cmucl=/sw/bin/cmucl Once you finish all that, you should be able to run maxima-x.y.z/maxima-local and have Maxima. > The page > http://pangea.stanford.edu/~schmitt/maxima.html has good instructions, > though sometimes > I followed all these instructions in one trial. But the CMUL, all the > sourcefiles( suitable for my processor) failed to set up. > I have to do ./bootstrap first (thanks to Barton > Willis for this tip). > I'm afraid I have no idea about this..what is it and how can I perform it? > I don't know exactly what this is - sometimes before I did the "make", I had to do the command ./bootstrap (while I was in the maxima directory). > You don't necessarily have to use CMUCL, but > then you have to do the correct configure command. > where do i find these? > Ironically, another way to get Maxima (slightly out of date) for this > platform is to download Sage for this platform, and then use the > command > > sage -maxima > sage is a download-install software like fink?? > > For your platform, you would download at http://sagemath.org/mirror/osx/powerpc/sage-4.6.2-OSX-32bit-10.4-PPC-G4-PowerMacintosh-Darwin.dmg Warning! You would be downloading and unpacking a very large file just to get Maxima! But it should work - once you've unpacked it, cd into the sage directory and do ./sage -maxima and you should have Maxima 5.22.1. We usually are about six months behind Maxima, but unless you are using cutting-edge Maxima functionality it should be fine for ordinary use. Good luck! -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Tue May 24 10:05:00 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 24 May 2011 09:05:00 -0600 Subject: [Maxima] OS X PPC Maxima In-Reply-To: References: <252980.76234.qm@web44805.mail.sp1.yahoo.com> Message-ID: On 5/24/11, Karl-Dieter Crisman wrote: >> I have to do ./bootstrap first (thanks to Barton >> Willis for this tip). >> I'm afraid I have no idea about this..what is it and how can I perform it? For the record, the bootstrap script (in the top-level Maxima directory) generates the configure script from configure.in, and some other stuff related the autoconf machinery. Then ./configure --enable-whatever generates Makefiles. HTH Robert Dodier From weickhmann at imp.tu-darmstadt.de Tue May 24 11:17:21 2011 From: weickhmann at imp.tu-darmstadt.de (Christian Weickhmann) Date: Tue, 24 May 2011 18:17:21 +0200 Subject: [Maxima] How to "un-single-quote" expressions Message-ID: <4DDBDA11.2050901@imp.tu-darmstadt.de> Hi! I just ran into a problem with Maxima (v. 5.22.1) when evaluating the following expression: ev( %i*cos(kx*x)*diff(conjugate(kx(cos(kx*x))),x,1)*epsinvLC_yy*gamma+%i*cos(kx*x)*diff(kx(cos(kx*x)),x,1)*epsinvLC_yy*gamma); Basically what happens is: the two diff() get single-quoted automatically although I never requested it. Funny enough, when calling ev( diff(conjugate(kx(cos(kx*x))),x,1) ); that just turns out fine. I made no assumptions about the variables. But assuming all of them (but x) positive, does not change the unwanted single-quoting. Is there anything I can do to *force* Maxima to evaluate the diff()? Regards, Christian -- Dipl.-Ing. Christian Weickhmann Technische Universit?t Darmstadt Insitut f?r Mikrowellentechnik und Photonik Mikrowellentechnik / Microwave Engineering www.imp.tu-darmstadt.de Merckstr. 25 64283 Darmstadt Germany Office: S3|06-318 Tel: +49 6151/16-75147 Fax: +49 6151/16-4343 E-Mail: weickhmann at imp.tu-darmstadt.de From weickhmann at imp.tu-darmstadt.de Tue May 24 11:25:47 2011 From: weickhmann at imp.tu-darmstadt.de (Christian Weickhmann) Date: Tue, 24 May 2011 18:25:47 +0200 Subject: [Maxima] How to "un-single-quote" expressions In-Reply-To: <4DDBDA11.2050901@imp.tu-darmstadt.de> References: <4DDBDA11.2050901@imp.tu-darmstadt.de> Message-ID: <4DDBDC0B.4090003@imp.tu-darmstadt.de> Update on that... Okay, from the code I posted, it is clear no evaluation of diff is done because of an error: kx(cos(kx*x)) should rather be kx*(cos(kx*x)) So it seems the problem lies somewhere deeper. I got that expression from calling: H : ev ( gamma*(C1*sin(kx*x) + C2*cos(kx*x)) * ux + %i*kx( -C1*sin(kx*x) + C2*cos(kx*x) ) * uz, C1=0, C2=1 ); Now somehow H becomes the following: [cos(kx*x)*gamma,0,%i*kx(cos(kx*x))] Which contains the error. Does anybody understand why that is? Regards, Christian Am 24.05.2011 18:17, schrieb Christian Weickhmann: > Hi! > > I just ran into a problem with Maxima (v. 5.22.1) when evaluating the > following > expression: > > ev( > %i*cos(kx*x)*diff(conjugate(kx(cos(kx*x))),x,1)*epsinvLC_yy*gamma+%i*cos(kx*x)*diff(kx(cos(kx*x)),x,1)*epsinvLC_yy*gamma); > > Basically what happens is: the two diff() get single-quoted > automatically although I never requested it. > Funny enough, when calling > > ev( diff(conjugate(kx(cos(kx*x))),x,1) ); > > that just turns out fine. > > I made no assumptions about the variables. But assuming all of them (but > x) positive, does not change the unwanted single-quoting. > > Is there anything I can do to *force* Maxima to evaluate the diff()? > > Regards, > Christian > > -- Dipl.-Ing. Christian Weickhmann Technische Universit?t Darmstadt Insitut f?r Mikrowellentechnik und Photonik Mikrowellentechnik / Microwave Engineering www.imp.tu-darmstadt.de Merckstr. 25 64283 Darmstadt Germany Office: S3|06-318 Tel: +49 6151/16-75147 Fax: +49 6151/16-4343 E-Mail: weickhmann at imp.tu-darmstadt.de From macrakis at alum.mit.edu Tue May 24 11:27:33 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 24 May 2011 12:27:33 -0400 Subject: [Maxima] How to "un-single-quote" expressions In-Reply-To: <4DDBDA11.2050901@imp.tu-darmstadt.de> References: <4DDBDA11.2050901@imp.tu-darmstadt.de> Message-ID: Not sure what you have in mind here. Why are you using ev(...) at all? What do you expect that to do? What do you expect diff( conjugate( f(x) ) ) to be? After all, the conjugate function is not differentiable. Maxima has conjugate(kx*sin(x)) => kx*sin(x) because it assumes (unless told otherwise) that all variables are real, and conjugate(x)=x for x real. But it assumes that arbitrary functions like kx(x) are in general complex. -s On Tue, May 24, 2011 at 12:17, Christian Weickhmann < weickhmann at imp.tu-darmstadt.de> wrote: > Hi! > > I just ran into a problem with Maxima (v. 5.22.1) when evaluating the > following > expression: > > ev( > > %i*cos(kx*x)*diff(conjugate(kx(cos(kx*x))),x,1)*epsinvLC_yy*gamma+%i*cos(kx*x)*diff(kx(cos(kx*x)),x,1)*epsinvLC_yy*gamma); > > Basically what happens is: the two diff() get single-quoted > automatically although I never requested it. > Funny enough, when calling > > ev( diff(conjugate(kx(cos(kx*x))),x,1) ); > > that just turns out fine. > > I made no assumptions about the variables. But assuming all of them (but > x) positive, does not change the unwanted single-quoting. > > Is there anything I can do to *force* Maxima to evaluate the diff()? > > Regards, > Christian > > > -- > Dipl.-Ing. Christian Weickhmann > > Technische Universit?t Darmstadt > Insitut f?r Mikrowellentechnik und Photonik > Mikrowellentechnik / Microwave Engineering > www.imp.tu-darmstadt.de > > Merckstr. 25 > 64283 Darmstadt > Germany > > Office: S3|06-318 > Tel: +49 6151/16-75147 > Fax: +49 6151/16-4343 > E-Mail: weickhmann at imp.tu-darmstadt.de > > _______________________________________________ > 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 george.leeman at sbcglobal.net Tue May 24 11:34:47 2011 From: george.leeman at sbcglobal.net (George Leeman) Date: Tue, 24 May 2011 12:34:47 -0400 Subject: [Maxima] How to "un-single-quote" expressions In-Reply-To: <4DDBDC0B.4090003@imp.tu-darmstadt.de> References: <4DDBDA11.2050901@imp.tu-darmstadt.de> <4DDBDC0B.4090003@imp.tu-darmstadt.de> Message-ID: Maybe the problem could be that you corrected one occurrence of kx(...) but not the second one, which occurs in H (the term times %i). ---George Leeman -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Christian Weickhmann Sent: Tuesday, May 24, 2011 12:26 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] How to "un-single-quote" expressions Update on that... Okay, from the code I posted, it is clear no evaluation of diff is done because of an error: kx(cos(kx*x)) should rather be kx*(cos(kx*x)) So it seems the problem lies somewhere deeper. I got that expression from calling: H : ev ( gamma*(C1*sin(kx*x) + C2*cos(kx*x)) * ux + %i*kx( -C1*sin(kx*x) + C2*cos(kx*x) ) * uz, C1=0, C2=1 ); Now somehow H becomes the following: [cos(kx*x)*gamma,0,%i*kx(cos(kx*x))] Which contains the error. Does anybody understand why that is? Regards, Christian Am 24.05.2011 18:17, schrieb Christian Weickhmann: > Hi! > > I just ran into a problem with Maxima (v. 5.22.1) when evaluating the > following > expression: > > ev( > %i*cos(kx*x)*diff(conjugate(kx(cos(kx*x))),x,1)*epsinvLC_yy*gamma+%i*cos(kx* x)*diff(kx(cos(kx*x)),x,1)*epsinvLC_yy*gamma); > > Basically what happens is: the two diff() get single-quoted > automatically although I never requested it. > Funny enough, when calling > > ev( diff(conjugate(kx(cos(kx*x))),x,1) ); > > that just turns out fine. > > I made no assumptions about the variables. But assuming all of them (but > x) positive, does not change the unwanted single-quoting. > > Is there anything I can do to *force* Maxima to evaluate the diff()? > > Regards, > Christian > > -- Dipl.-Ing. Christian Weickhmann Technische Universit?t Darmstadt Insitut f?r Mikrowellentechnik und Photonik Mikrowellentechnik / Microwave Engineering www.imp.tu-darmstadt.de Merckstr. 25 64283 Darmstadt Germany Office: S3|06-318 Tel: +49 6151/16-75147 Fax: +49 6151/16-4343 E-Mail: weickhmann at imp.tu-darmstadt.de _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From toy.raymond at gmail.com Tue May 24 12:15:30 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 24 May 2011 13:15:30 -0400 Subject: [Maxima] detect unix or dos line endings References: <196405B884684234ADCAF060D1C5C8CF@edwinc367e16bd> <4DDABAAA.6080409@olynet.com> Message-ID: >>>>> "Edwin" == Edwin Woollett writes: Edwin> Hi Dan, I would like to find a solution which only uses Edwin> the tools presently available in the Maxima language, Edwin> such as are provided in file reads, and string processing, Edwin> etc. I would like to include something about Perhaps this is within the letter of the maxima language but not the spirit you're looking for, but the maxima language allows you to escape to Lisp using ?. Thus you can use ?read\-char to read a character from a stream and then use other maxima functions to determine if you've encountered LF or CR/LF or plain CR (Mac) end-of-line sequences. An alternative is to create new string processing tools to do what you want. The tools can then use Lisp as needed to implement the desired functionality. This is probably the best approach. Ray From wilhelm.haager at htlstp.ac.at Wed May 25 04:43:40 2011 From: wilhelm.haager at htlstp.ac.at (Wilhelm Haager) Date: Wed, 25 May 2011 11:43:40 +0200 Subject: [Maxima] Question regarding partfrac Message-ID: <0d98bef9f1427aeaa338325086d2cc2e@localhost> Hi, I want to make a partial fraction expansion of an expression in which the denominator is a higher order polynomial which can be factorized using allroots. (%i1) z:1/ev(allroots((x**3+2*x**2+3*x+1)),polyfactor=true); (%o1) 1.0/((x+0.43015970900195)*(x^2+1.569840290998053*x+2.324717957244746)) partfrac obviously rationalizes the floating point numbers, subsequent application of float produces unhandy (very large or very small) numbers (setting keepfloat to true results in an an error message). (%i2) float(partfrac(z1,x)); (%o2) 6177.795101294362/(11333.0*x+4875.0)-(5.2796308514673369*10^-16*(8.3000427432133274*10^21*x+9.4593976660316326*10^21))/(8038875.0*x^2+1.261975*10^7*x+1.8688117*10^7) Is there a SIMPLE way (e.g. a built in function) to divide numerators and denominators by their leading coefficients of the denominator polynomials each, in order to get handy numbers (i.e. 11333.0 and 8038875.0 respectively)? Thanks in advance Wilhelm From cfrangos at telkomsa.net Wed May 25 16:18:00 2011 From: cfrangos at telkomsa.net (Constantine Frangos) Date: Wed, 25 May 2011 23:18:00 +0200 Subject: [Maxima] radcan() simplification error. Message-ID: <201105252318.01073.cfrangos@telkomsa.net> Dear List, Any assistance with the following would be appreciated: (1) The function radcan() seems to simplify the following expression correctly: (%i98) radcan(sqrt(a^2)/sqrt(4*%pi^2*(q0-2000)^2)); (%o98) abs(a)/(2*%pi*abs(q0-2000)) (%i99) (2) However, for the following more complicated expression, radcan() seems to simplify the denominator incorrectly: (%i99) radcan(sqrt((sin(2*%pi*pmin*(q0-q))-sin(2*%pi*pmax*(q0-q)))^2/(4*%pi^2*(q0-q)^2)+(cos(2*%pi*pmin*(q0-q))-cos(2*%pi*pmax*(q0-q)))^2/(4*%pi^2*(q0-q)^2))); rat: replaced 2.0 by 2/1 = 2.0 rat: replaced 2.0 by 2/1 = 2.0 rat: replaced 2.0 by 2/1 = 2.0 rat: replaced 2.0 by 2/1 = 2.0 rat: replaced 2.0 by 2/1 = 2.0 rat: replaced 2.0 by 2/1 = 2.0 rat: replaced 2.0 by 2/1 = 2.0 rat: replaced 2.0 by 2/1 = 2.0 (%o99) sqrt(sin(2*%pi*pmin*q0-2*%pi*pmin*q)^2 -2*sin(2*%pi*pmax*q0-2*%pi*pmax*q) *sin(2*%pi*pmin*q0-2*%pi*pmin*q) +cos(2*%pi*pmin*q0-2*%pi*pmin*q)^2 -2*cos(2*%pi*pmax*q0-2*%pi*pmax*q) *cos(2*%pi*pmin*q0-2*%pi*pmin*q) +sin(2*%pi*pmax*q0-2*%pi*pmax*q)^2 +cos(2*%pi*pmax*q0-2*%pi*pmax*q)^2) /(2*%pi*q0-2*%pi*q) (%i100) (3) On the other hand, radcan() seems to take into account some facts specified by the assume() statement in the example below. Do other Maxima built-in simplification functions take specified constraints into account ? (%i101) assume(q0>=2000); (%o101) [q0 >= 2000] (%i102) radcan(sqrt(a^2)/sqrt(4*%pi^2*(q0-2000)^2)); (%o102) abs(a)/(2*%pi*q0-4000*%pi) (%i103) Thanks very much. Constantine Frangos. From macrakis at alum.mit.edu Wed May 25 12:55:56 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 25 May 2011 13:55:56 -0400 Subject: [Maxima] radcan() simplification error. In-Reply-To: <201105252318.01073.cfrangos@telkomsa.net> References: <201105252318.01073.cfrangos@telkomsa.net> Message-ID: I haven't looked at your example in detail, but I suspect that your question relates to the treatment of things like expr: sqrt(x^2-2*x+1). radcan(expr) => x-1, where you might expect abs(x-1), as returned by scanmap(factor,expr). This radcan behavior is intentional, on the theory that either branch of the root is correct. Why, then, does radcan(sqrt(x^2)) return abs(x)? Because the *general simplifier* tries to simplify to the positive root, and so simplifies the expression to abs(x) before radcan even looks at it: (%i2) sqrt(x^2); (%o2) abs(x) (%i3) radcan(%); (%o3) abs(x) (%i4) sqrt(x^2-2*x+1); (%o4) sqrt(x^2-2*x+1) (%i5) radcan(%); (%o5) x-1 (%i6) scanmap(factor,%o4); (%o6) abs(x-1) (%i7) radcan(%); (%o7) abs(x-1) -s On Wed, May 25, 2011 at 17:18, Constantine Frangos wrote: > > Dear List, > > Any assistance with the following would be appreciated: > > (1) The function radcan() seems to simplify the following expression > correctly: > > (%i98) radcan(sqrt(a^2)/sqrt(4*%pi^2*(q0-2000)^2)); > > (%o98) abs(a)/(2*%pi*abs(q0-2000)) > (%i99) > > (2) However, for the following more complicated expression, radcan() seems > to simplify the denominator incorrectly: > > (%i99) > radcan(sqrt((sin(2*%pi*pmin*(q0-q))-sin(2*%pi*pmax*(q0-q)))^2/(4*%pi^2*(q0-q)^2)+(cos(2*%pi*pmin*(q0-q))-cos(2*%pi*pmax*(q0-q)))^2/(4*%pi^2*(q0-q)^2))); > > rat: replaced 2.0 by 2/1 = 2.0 > > rat: replaced 2.0 by 2/1 = 2.0 > > rat: replaced 2.0 by 2/1 = 2.0 > > rat: replaced 2.0 by 2/1 = 2.0 > > rat: replaced 2.0 by 2/1 = 2.0 > > rat: replaced 2.0 by 2/1 = 2.0 > > rat: replaced 2.0 by 2/1 = 2.0 > > rat: replaced 2.0 by 2/1 = 2.0 > (%o99) sqrt(sin(2*%pi*pmin*q0-2*%pi*pmin*q)^2 > -2*sin(2*%pi*pmax*q0-2*%pi*pmax*q) > *sin(2*%pi*pmin*q0-2*%pi*pmin*q) > +cos(2*%pi*pmin*q0-2*%pi*pmin*q)^2 > -2*cos(2*%pi*pmax*q0-2*%pi*pmax*q) > *cos(2*%pi*pmin*q0-2*%pi*pmin*q) > +sin(2*%pi*pmax*q0-2*%pi*pmax*q)^2 > +cos(2*%pi*pmax*q0-2*%pi*pmax*q)^2) > /(2*%pi*q0-2*%pi*q) > (%i100) > > > (3) On the other hand, radcan() seems to take into account some facts > specified by the > assume() statement in the example below. Do other Maxima built-in > simplification functions > take specified constraints into account ? > > (%i101) assume(q0>=2000); > > (%o101) [q0 >= 2000] > (%i102) radcan(sqrt(a^2)/sqrt(4*%pi^2*(q0-2000)^2)); > > (%o102) abs(a)/(2*%pi*q0-4000*%pi) > (%i103) > > > Thanks very much. > Constantine Frangos. > > _______________________________________________ > 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 Wed May 25 13:19:55 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 25 May 2011 11:19:55 -0700 Subject: [Maxima] Universal read_data function Message-ID: <37537301E9104C17B59276B7C14B8E91@edwinc367e16bd> The use of the string processing functions from van Nek's stringproc.lisp allows construction of a "Universal" read_data function which not only doesn't care about line endings, but doesn't care whether data separators are spaces or commas, and can handle fractions, decimals, floating point and strings as data items. demo follows: ------------------------ Maxima 5.24.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. 2011-05-25 (%i1) display2d:false$ (%i2) load(read_data); (%o2) "c:/work2/read_data.mac" (%i3) fundef (read_data); (%o3) read_data(%filename):=block([%s,%r,%l], if not file_search(%filename) then (disp(" file not found "),return(false)), %s:openr(%filename),%r:[], while (%l:readline(%s)) # false do %r:cons(map(parse_string,split(ssubst(" ",",",%l))),%r), close(%s),reverse(%r)) (%i4) printfile ("mydata.dat")$ 1 2/3 3.4 2.3e9 "Abc" "Def" , -3/4 , 6 , -4.8e-7 , 5.5 7/13 "Ghi" 8 3.3e4 -7.3 4,-3/9,"Jkl",44.6,9.9e-6 (%i5) read_data ("mydata.dat"); (%o5) [ [1,2/3,3.4,2.3E+9,"Abc"], ["Def",-3/4,6,-4.7999999999999996E-7,5.5], [7/13,"Ghi",8,33000.0,-7.3], [4,-1/3,"Jkl",44.6,9.9000000000000001E-6] ] ---------------------------------------------------------- Ted Woollett From Jorge.Calvo at avemaria.edu Wed May 25 16:29:27 2011 From: Jorge.Calvo at avemaria.edu (Jorge Calvo) Date: Wed, 25 May 2011 17:29:27 -0400 Subject: [Maxima] Installing Maxima on MacOS X Message-ID: 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 From dufault at hda.com Wed May 25 16:32:25 2011 From: dufault at hda.com (Peter Dufault) Date: Wed, 25 May 2011 17:32:25 -0400 Subject: [Maxima] Help with Plancherel's theorem Message-ID: <40C5D294-8840-469C-81D1-BC4239F0F8DC@hda.com> I'm trying to get up to speed with Maxima. Can someone explain why I don't get "0" for %o12? Here's the input: ==== declare(x,[real,scalar])$ declare(k,[real,scalar])$ /* Gaussian. */ gauss(x):=%e^(-x^2)$ /* Fourier transform. */ FT(fx,x,k):=integrate(fx*%e^(-2 * %i * %pi * k * x), x, minf, inf)$ /* An even function (gaussian) + odd function (two shifted gaussians, one negative): */ feven:gauss(x)$ fodd:gauss(x - 1/2) - gauss(x + 1/2)$ f:feven+fodd$ /* "Plancherel's sum" - just integrate the square of the modulus over all values. */ planch(f,v):=factor(integrate(abs(f)^2,v,minf,inf))$ /* I expect these to all be 0. */ planch(feven,x) - planch(FT(feven,x,k),k); /* OK. */ planch(fodd,x) - planch(FT(fodd,x,k),k); /* OK. */ planch(f,x) - planch(FT(f,x,k),k); /* Huh? */ ==== Here's the output: ==== [dufault at flipper cross]$ maxima Maxima 5.23.2 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("simple.mac")$ read and interpret file: /home/dufault/play/cross/simple.mac (%i2) declare(x, [real, scalar]) (%i3) declare(k, [real, scalar]) 2 - x (%i4) gauss(x) := %e - 2 %i %pi k x (%i5) FT(fx, x, k) := integrate(fx %e , x, minf, inf) (%i6) feven : gauss(x) 1 1 (%i7) fodd : gauss(x - -) - gauss(- + x) 2 2 (%i8) f : fodd + feven 2 (%i9) planch(f, v) := factor(integrate(abs(f) , v, minf, inf)) (%i10) planch(feven, x) - planch(FT(feven, x, k), k) (%o10) 0 (%i11) planch(fodd, x) - planch(FT(fodd, x, k), k) (%o11) 0 (%i12) planch(f, x) - planch(FT(f, x, k), k) (3 sqrt(%e) - 2) sqrt(%pi) (sqrt(%e) - 2) sqrt(%pi) (%o12) -------------------------- + ------------------------ sqrt(2) sqrt(%e) sqrt(2) sqrt(%e) (%i14) ==== Peter ----------------- Peter Dufault HD Associates, Inc. Software and System Engineering From javier.arantegui at gmail.com Wed May 25 17:33:54 2011 From: javier.arantegui at gmail.com (Javier Arantegui) Date: Thu, 26 May 2011 00:33:54 +0200 Subject: [Maxima] Installing Maxima on MacOS X In-Reply-To: References: Message-ID: Hi! I wrote a guide to install Maxima and wxMaxima in a Mac OS X machine some weeks ago. The steps are quite easy to follow (if you can understand Spanish...). The guide is here: http://www.faq-mac.mobi/41547/instalacion-maximawxmaxima-mac-javier-arantegui I hope it helps. Javier On Wednesday, May 25, 2011, 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 > -- Lee mi blog: "Un peque?o paso para Neil" http://up3n.wordpress.com/ ?Ahora tambi?n en Twitter! http://twitter.com/javierarantegui From woollett at charter.net Wed May 25 17:42:16 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 25 May 2011 15:42:16 -0700 Subject: [Maxima] detect unix or dos line endings Message-ID: On May 24, Raymond Toy wrote: --------------------------------------- .... the maxima language allows you to escape to Lisp using ?. Thus you can use ?read\-char to read a character from a stream and then use other maxima functions to determine if you've encountered LF or CR/LF or plain CR (Mac) end-of-line sequences. --------------------------------------- Hi Ray, I am able to use ?read\-char(stream) ok to be able to detect the first (and perhaps only) end of line character, but in looking for a possible second character (as with CR LF dos file end), I run the risk of reaching the end of the file (If the file has only one line), and I don't know how to avoid the kind of lisp error shown below. The common lisp cookbook talks about using a second argument NIL in the lisp function read-char to get a return value of NIL is end-of-line is found, but I am probably not adapting this idea correctly below?? I have a one line file with dos (CR LF) endings here for the experiment. I first determine the length of the first line (excluding end of line chars) using readline. ........................................................... Maxima 5.24.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. 2011-05-25 (%i1) display2d:false$ (%i2) ss : openr("ndata1.dat"); (%o2) ?\#\ (%i3) l1 : readline(ss); (%o3) "2.3e9 \"Abc\"" (%i4) slength(l1); (%o4) 11 (%i5) close(ss); (%o5) true (%i6) ss : openr("ndata1.dat"); (%o6) ?\#\ (%i7) fposition(ss,12); (%o7) true (%i8) cs : string(?read\-char(ss,nil)); (%o8) "?\\ " (%i9) slength(cs); (%o9) 3 (%i10) cint (charat (cs,3)); (%o10) 13 /* so there is the CR end of line char */ (%i11) cs : string(?read\-char(ss,nil)); (%o11) "?\\ " (%i12) slength(cs); (%o12) 3 (%i13) cint (charat (cs,3)); (%o13) 10 /* so there is the second expected end of line char LF */ /* but, what if there had only been one end of line char, as in unix or mac file? As an experiment, we go for another char, not knowing if it is the end of file */ (%i14) cs : string(?read\-char(ss,nil)); Maxima encountered a Lisp error: Error in PROGN [or a callee]: Unexpected end of #. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i15) close(ss); (%o15) true (%i16) printfile("ndata1.dat")$ 2.3e9 "Abc" ................................................................ How can I avoid this read error? Ted From willisb at unk.edu Wed May 25 18:00:00 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 25 May 2011 18:00:00 -0500 Subject: [Maxima] Help with Plancherel's theorem In-Reply-To: <40C5D294-8840-469C-81D1-BC4239F0F8DC@hda.com> References: <40C5D294-8840-469C-81D1-BC4239F0F8DC@hda.com> Message-ID: In the definition for planch, try changing abs to cabs; thus planch(f,v):=factor(integrate(cabs(f)^2,v,minf,inf))$ Alternatively, change abs(f)^2 to conjugate(f) * f. To see what is going on, look at (%i51) larry : FT(f,x,k); (%o51) sqrt(%pi)*%e^(-%pi^2*k^2)-2*sqrt(%pi)*%i*%e^(-%pi^2*k^2)*sin(%pi*k) OK: (%i52) cabs(larry)^2; (%o52) 4*%pi*%e^(-2*%pi^2*k^2)*sin(%pi*k)^2+%pi*%e^(-2*%pi^2*k^2) OK: (%i53) expand(conjugate(larry) * larry); (%o53) 4*%pi*%e^(-2*%pi^2*k^2)*sin(%pi*k)^2+%pi*%e^(-2*%pi^2*k^2) Bogus: (%i54) expand(abs(larry)^2); (%o54) -4*%pi*%e^(-2*%pi^2*k^2)*sin(%pi*k)^2-4*%i*%pi*%e^(-2*%pi^2*k^2)*sin(%pi*k)+%pi*%e^(-2*%pi^2*k^2) There are readers on this list who understand the whys related to the behavior of abs vs cabs. And I'm not one of those readers :( --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To:?maxima at math.utexas.edu >From:?Peter?Dufault? >Sent?by:?maxima-bounces at math.utexas.edu >Date:?05/25/2011?04:32PM >Subject:?[Maxima]?Help?with?Plancherel's?theorem > >I'm?trying?to?get?up?to?speed?with?Maxima. > >Can?someone?explain?why?I?don't?get?"0"?for?%o12? > >Here's?the?input: >==== >declare(x,[real,scalar])$ >declare(k,[real,scalar])$ > >/*?Gaussian.?*/ >gauss(x):=%e^(-x^2)$ > >/*?Fourier?transform.?*/ >FT(fx,x,k):=integrate(fx*%e^(-2?*?%i?*?%pi?*?k?*?x),?x,?minf,?inf)$ > >/*?An?even?function?(gaussian)?+?odd?function?(two?shifted?gaussians,?one >negative):?*/ >feven:gauss(x)$ >fodd:gauss(x?-?1/2)?-?gauss(x?+?1/2)$ >f:feven+fodd$ > >/*?"Plancherel's?sum"?-?just?integrate?the?square?of?the?modulus?over?all >values.?*/ > >planch(f,v):=factor(integrate(abs(f)^2,v,minf,inf))$ > >/*?I?expect?these?to?all?be?0.?*/ > >planch(feven,x)?-?planch(FT(feven,x,k),k);??/*?OK.?*/ >planch(fodd,x)??-?planch(FT(fodd,x,k),k);???/*?OK.?*/ >planch(f,x)?????-?planch(FT(f,x,k),k);??????/*?Huh??*/ >==== > >Here's?the?output: >==== >[dufault at flipper?cross]$?maxima >Maxima?5.23.2?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("simple.mac")$ > >read?and?interpret?file:?/home/dufault/play/cross/simple.mac >(%i2)?????????????????????declare(x,?[real,?scalar]) >(%i3)?????????????????????declare(k,?[real,?scalar]) >???????????????????????????????????????????????2 >????????????????????????????????????????????-?x >(%i4)?????????????????????????gauss(x)?:=?%e >????????????????????????????????????????-?2?%i?%pi?k?x >(%i5)????FT(fx,?x,?k)?:=?integrate(fx?%e??????????????,?x,?minf,?inf) >(%i6)??????????????????????????feven?:?gauss(x) >???????????????????????????????????????1??????????1 >(%i7)?????????????????fodd?:?gauss(x?-?-)?-?gauss(-?+?x) >???????????????????????????????????????2??????????2 >(%i8)??????????????????????????f?:?fodd?+?feven >??????????????????????????????????????????????????2 >(%i9)??????planch(f,?v)?:=?factor(integrate(abs(f)?,?v,?minf,?inf)) >(%i10)???????????planch(feven,?x)?-?planch(FT(feven,?x,?k),?k) >(%o10)?????????????????????????????????0 >(%i11)????????????planch(fodd,?x)?-?planch(FT(fodd,?x,?k),?k) >(%o11)?????????????????????????????????0 >(%i12)???????????????planch(f,?x)?-?planch(FT(f,?x,?k),?k) >?????????????(3?sqrt(%e)?-?2)?sqrt(%pi)???(sqrt(%e)?-?2)?sqrt(%pi) >(%o12)???????--------------------------?+?------------------------ >??????????????????sqrt(2)?sqrt(%e)????????????sqrt(2)?sqrt(%e) >(%i14)? >==== > > >Peter >----------------- >Peter?Dufault >HD?Associates,?Inc.??????Software?and?System?Engineering > >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From xbenchi at gmail.com Wed May 25 20:53:23 2011 From: xbenchi at gmail.com (Chi Ben) Date: Wed, 25 May 2011 21:53:23 -0400 Subject: [Maxima] MaximaPHP and web interface Message-ID: I am trying to implement a web interface for Maxima. But the link for MaximaPHP project by Bowo Prasetyo at http://maxima.sourceforge.net/relatedprojects.html has expired. Is there anyway I can obtain a copy of MaximaPHP code? Or is there another way I can implement it? Thanks, Chi Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From nijso at hotmail.com Thu May 26 02:18:25 2011 From: nijso at hotmail.com (nijso beishuizen) Date: Thu, 26 May 2011 09:18:25 +0200 Subject: [Maxima] chain rule without dependencies Message-ID: Dear all, Is there a simple way to define the chain rule for f(g(x)) without declaring dependencies? My expressions also contain integrals, so declaring dependencies will lead to unwanted simplification/evaluation (or can I turn of simplification of integrals temporarily?). Is there a specific reason that the chain rule is not implemented except when dependencies are declared? Regards, NB From dufault at hda.com Thu May 26 04:43:17 2011 From: dufault at hda.com (Peter Dufault) Date: Thu, 26 May 2011 05:43:17 -0400 Subject: [Maxima] Help with Plancherel's theorem In-Reply-To: References: <40C5D294-8840-469C-81D1-BC4239F0F8DC@hda.com> Message-ID: <29926894-E0D0-4378-86BB-4DC94A92A9E5@hda.com> After a few changes I'm getting "The value of 1 is not of type LIST.". On May 25, 2011, at 7:00 , Barton Willis wrote: > In the definition for planch, try changing abs to cabs; thus > > planch(f,v):=factor(integrate(cabs(f)^2,v,minf,inf))$ OK, I did this and it worked, though the documentation for abs() is incorrect, or I need to do something to tell Maxima that Ft(f,x,k) is complex: -- Function: abs () Returns the absolute value . If is complex, returns the complex modulus of . Complicating the problem a bit by making the Gaussian adjustable I get a "The value 1 is not of type LIST." lisp error. If I set "c" (the width of the Gaussian) to 1/sqrt(2) the problem goes away. Can someone explain what's up? As I'm sending this I'm wondering why I didn't make a,b, and c scalars, I'll have to see what that does. ==== declare ( x,[real,scalar], k,[real,scalar], a,real, b,real, c,real)$ assume( a>0, b>0, c>0 )$ /* Gaussian. */ gauss(x,a,b,c):=a*%e^(-((x-b)^2)/(2*c^2))$ /* Fourier transform. */ FT(fx,x,k):=integrate(fx*%e^(-2 * %i * %pi * k * x), x, minf, inf)$ /* An even function (shifted gaussian) + odd function (two shifted gaussians, one negative): */ feven:gauss(x,1,0,1/sqrt(2))$ fodd:gauss(x - 1, a, b, c) - gauss(x + 1, a, b, c)$ f:feven+fodd$ /* "Plancherel's sum" - just integrate the square of the modulus over all values. */ planch(f,v):=factor(integrate(cabs(f)^2,v,minf,inf))$ /* I expect these to all be 0. */ planch(feven,x) - planch(FT(feven,x,k),k); /* OK. */ planch(fodd,x) - planch(FT(fodd,x,k),k); /* OK. */ planch(f,x) - planch(FT(f,x,k),k); /* Huh? */ ==== ... (%i9) planch(f, v) := factor(integrate(cabs (f), v, minf, inf)) (%i10) planch(feven, x) - planch(FT(feven, x, k), k) (%o10) 0 (%i11) planch(fodd, x) - planch(FT(fodd, x, k), k) (%o11) 0 (%i12) planch(f, x) - planch(FT(f, x, k), k) Maxima encountered a Lisp error: The value 1 is not of type LIST. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i14) ==== Peter ----------------- Peter Dufault HD Associates, Inc. Software and System Engineering From willisb at unk.edu Thu May 26 05:59:36 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 26 May 2011 05:59:36 -0500 Subject: [Maxima] Help with Plancherel's theorem In-Reply-To: <29926894-E0D0-4378-86BB-4DC94A92A9E5@hda.com> References: <40C5D294-8840-469C-81D1-BC4239F0F8DC@hda.com> , <29926894-E0D0-4378-86BB-4DC94A92A9E5@hda.com> Message-ID: Try changing cabs(f) to cabs(f)^2. I haven't looked at it, but the Lisp error "The value 1 ..." is a Maxima bug. Maybe you can report it to the Maxima bug list. I doubt that the declarations declare ( x,[real,scalar], k,[real,scalar], a,real, b,real, c,real)$ are needed. --Barton -----Peter Dufault wrote: ----- >(%i9)??????planch(f,?v)?:=?factor(integrate(cabs?(f),?v,?minf,?inf)) >(%i10)???????????planch(feven,?x)?-?planch(FT(feven,?x,?k),?k) >(%o10)?????????????????????????????????0 >(%i11)????????????planch(fodd,?x)?-?planch(FT(fodd,?x,?k),?k) >(%o11)?????????????????????????????????0 >(%i12)???????????????planch(f,?x)?-?planch(FT(f,?x,?k),?k) >Maxima?encountered?a?Lisp?error: > > The value 1 is not of type LIST. From dufault at hda.com Thu May 26 06:11:29 2011 From: dufault at hda.com (Peter Dufault) Date: Thu, 26 May 2011 07:11:29 -0400 Subject: [Maxima] Help with Plancherel's theorem In-Reply-To: References: <40C5D294-8840-469C-81D1-BC4239F0F8DC@hda.com> , <29926894-E0D0-4378-86BB-4DC94A92A9E5@hda.com> Message-ID: <8DEF0FE3-7B0B-46EA-995A-0E09A28435FA@hda.com> On May 26, 2011, at 6:59 , Barton Willis wrote: > Try changing cabs(f) to cabs(f)^2. I haven't looked at it, but the Lisp error > "The value 1 ..." is a Maxima bug. Maybe you can report it to the Maxima bug list. > I do have cabs(f)^2, I cut-and-pasted a line too far and didn't include the "2" in the line above: 2 (%i9) planch(f, v) := factor(integrate(cabs (f), v, minf, inf)) I'll look at it some more. Peter ----------------- Peter Dufault HD Associates, Inc. Software and System Engineering From willisb at unk.edu Thu May 26 06:27:18 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 26 May 2011 06:27:18 -0500 Subject: [Maxima] Help with Plancherel's theorem In-Reply-To: <8DEF0FE3-7B0B-46EA-995A-0E09A28435FA@hda.com> References: <40C5D294-8840-469C-81D1-BC4239F0F8DC@hda.com> , <29926894-E0D0-4378-86BB-4DC94A92A9E5@hda.com> , <8DEF0FE3-7B0B-46EA-995A-0E09A28435FA@hda.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I?do?have?cabs(f)^2,?I?cut-and-pasted?a?line?too?far?and?didn't?include >the?"2"?in?the?line?above: OK, for pasting into email, try display2d : false. Or from wxMaxima, try edit-->Copy as Text. --Barton From toy.raymond at gmail.com Thu May 26 09:09:49 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 26 May 2011 10:09:49 -0400 Subject: [Maxima] detect unix or dos line endings References: Message-ID: >>>>> "Edwin" == Edwin Woollett writes: Edwin> On May 24, Raymond Toy wrote: Ray> --------------------------------------- Ray> .... the maxima language allows you to Ray> escape to Lisp using ?. Thus you can use ?read\-char to read a Ray> character from a stream and then use other maxima functions to Ray> determine if you've encountered LF or CR/LF or plain CR (Mac) Ray> end-of-line sequences. Ray> --------------------------------------- Edwin> The common lisp cookbook talks about Edwin> using a second argument NIL in the Edwin> lisp function read-char to get a return Edwin> value of NIL is end-of-line is found, but Edwin> I am probably not adapting this idea Edwin> correctly below?? [snip] Edwin> /* so there is the second expected end of line char LF */ Edwin> /* but, what if there had only been one end of line char, Edwin> as in unix or mac file? As an experiment, we go Edwin> for another char, not knowing if it is the end of file Edwin> */ Edwin> (%i14) cs : string(?read\-char(ss,nil)); You want false, here, not nil. nil is the maxima symbol nil, which will be treated as true by READ-CHAR. "false" will get converted to CL:NIL, which is what you want to pass to READ-CHAR. So cs: string(?read\-char(ss,false)); will return false when you reach the end of the file instead of signaling an eof error. Ray From macrakis at alum.mit.edu Thu May 26 10:03:06 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 26 May 2011 11:03:06 -0400 Subject: [Maxima] abs vs. cabs WAS: Help with Plancherel's theorem Message-ID: I haven't read the thread in detail, but here's the quick version of the difference between abs and cabs (at least in an ideal world), which may be relevant to the problem: * abs is a mathematical function which has simplification rules. It assumes by default that it is operating over the reals, so that for example abs(sqrt(x)) => sqrt(x) -- because sqrt is treated as a real-to-real function with domain and range 0..inf. But if there is an explicitly complex quantity (%i or a variable declared complex), that assumption is invalidated, so abs(z^2) => abs(z)^2, where declare(z,complex). * cabs is a routine which transforms an expression into another expression, and does not have simplification rules. cabs does not appear in mathematical expressions, but is used in calculations on mathematical expressions. cabs assumes that any undeclared variables it encounters are real, but does not assume that functions are only defined where they are real-to-real. Thus cabs(sqrt(x)) => sqrt(abs(x)). Formerly, cabs tried to reduce all complex calculations to real calculations, using explicit realpart(z) and imagpart(z) when necessary, but nowadays it allows itself to use abs(z) as well. Unfortunately, this principle has not been extended very far. Though abs(z) is certainly more compact than sqrt(R(z)^2+I(z)^2), using the abs form in some cases and the sqrt form in others means that, for example cabs(z*conjugate(z)) => sqrt(R(z)^2+I(z)^2)*abs(z) instead of either abs(z)^2 or R(z)^2+I(z)^2, either of which would be better than the bastard form. The difference between a mathematical (simplifying) function and a routine is critical in Maxima. In most cases, it is represented by the noun-form (e.g. 'diff(x,y)) and the verb-form (diff(x,y)). In the case of abs, by far the more common usage is as a mathematical function, so requiring 'abs seems too clumsy and unintuitive for most use cases. LIke anything else, this decision (from 1970 or so) can always be revisited, but I don't see a better alternative. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbowyer at olynet.com Thu May 26 10:40:51 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Thu, 26 May 2011 08:40:51 -0700 Subject: [Maxima] Universal read_data function In-Reply-To: <37537301E9104C17B59276B7C14B8E91@edwinc367e16bd> References: <37537301E9104C17B59276B7C14B8E91@edwinc367e16bd> Message-ID: <4DDE7483.6090907@olynet.com> On 05/25/2011 11:19 AM, Edwin Woollett wrote: > The use of the string processing functions from > van Nek's stringproc.lisp allows construction of > a "Universal" read_data function which not only > doesn't care about line endings, but doesn't care > whether data separators are spaces or commas, > and can handle fractions, decimals, floating point > and strings as data items. > > demo follows: > ------------------------ > Maxima 5.24.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. > 2011-05-25 > > > (%i1) display2d:false$ > (%i2) load(read_data); > (%o2) "c:/work2/read_data.mac" > > (%i3) fundef (read_data); > > (%o3) read_data(%filename):=block([%s,%r,%l], > if not file_search(%filename) > then (disp(" file not found "),return(false)), > %s:openr(%filename),%r:[], > while (%l:readline(%s)) # false do > %r:cons(map(parse_string,split(ssubst(" > ",",",%l))),%r), > close(%s),reverse(%r)) > > (%i4) printfile ("mydata.dat")$ > > 1 2/3 3.4 2.3e9 "Abc" > > "Def" , -3/4 , 6 , -4.8e-7 , 5.5 > > 7/13 "Ghi" 8 3.3e4 -7.3 > > 4,-3/9,"Jkl",44.6,9.9e-6 > > (%i5) read_data ("mydata.dat"); > > (%o5) [ [1,2/3,3.4,2.3E+9,"Abc"], > ["Def",-3/4,6,-4.7999999999999996E-7,5.5], > [7/13,"Ghi",8,33000.0,-7.3], > [4,-1/3,"Jkl",44.6,9.9000000000000001E-6] ] > > ---------------------------------------------------------- > Ted Woollett > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Hi again Ted: That's cool. I didn't think of trying ssubst in my fiddlings. I learned something new about Maxima's abilities. Paul From Jorge.Calvo at avemaria.edu Thu May 26 11:05:40 2011 From: Jorge.Calvo at avemaria.edu (Jorge Calvo) Date: Thu, 26 May 2011 12:05:40 -0400 Subject: [Maxima] Installing Maxima on MacOS X References: Message-ID: Many thanks, Javier. Your instructions have filled me with hope. However, I am still stuck at the stage when I'm supposed to run wxMaxima for the first time. I get an error message saying that wxMaxima is not supported in this system. Also, the icon for wxMaxima is different than what appears in your screen shots -- on my mac there is a big circle with a slash through it, as in a "do not enter" sign. I wonder if there is a list of system requirements that I missed. I am running Mac OS X v.10.4.11 and trying to use wxMaxima v.0.8.5. Do I need to go to an earlier version of wxMaxima? Thanks again, Jorge -----Original Message----- From: Javier Arantegui [mailto:javier.arantegui at gmail.com] Sent: Wed 5/25/2011 6:33 PM To: Jorge Calvo Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Installing Maxima on MacOS X Hi! I wrote a guide to install Maxima and wxMaxima in a Mac OS X machine some weeks ago. The steps are quite easy to follow (if you can understand Spanish...). The guide is here: http://www.faq-mac.mobi/41547/instalacion-maximawxmaxima-mac-javier-arantegui I hope it helps. Javier On Wednesday, May 25, 2011, 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 > -- Lee mi blog: "Un peque?o paso para Neil" http://up3n.wordpress.com/ ?Ahora tambi?n en Twitter! http://twitter.com/javierarantegui From javier.arantegui at gmail.com Thu May 26 11:53:38 2011 From: javier.arantegui at gmail.com (Javier Arantegui) Date: Thu, 26 May 2011 18:53:38 +0200 Subject: [Maxima] Installing Maxima on MacOS X In-Reply-To: References: Message-ID: Dear Jorge, Are you using a PPC Mac? As far I know the compiled version of wxMaxima is intel only. In that case, a possible solution could be to compile it yourself using Fink. It takes some time to do it but it's not very difficult. Yours, Javier On Thu, May 26, 2011 at 6:05 PM, Jorge Calvo wrote: > Many thanks, Javier. ?Your instructions have filled me with hope. > > However, I am still stuck at the stage when I'm supposed to run wxMaxima for the first time. ?I get an error message saying that wxMaxima is not supported in this system. ?Also, the icon for wxMaxima is different than what appears in your screen shots -- on my mac there is a big circle with a slash through it, as in a "do not enter" sign. ?I wonder if there is a list of system requirements that I missed. > > I am running Mac OS X v.10.4.11 and trying to use wxMaxima v.0.8.5. > > Do I need to go to an earlier version of wxMaxima? > > Thanks again, > > Jorge > > -----Original Message----- > From: Javier Arantegui [mailto:javier.arantegui at gmail.com] > Sent: Wed 5/25/2011 6:33 PM > To: Jorge Calvo > Cc: maxima at math.utexas.edu > Subject: Re: [Maxima] Installing Maxima on MacOS X > > Hi! > > I wrote a guide to install Maxima and wxMaxima in a Mac OS X machine > some weeks ago. The steps are quite easy to follow (if you can > understand Spanish...). The guide is here: > > http://www.faq-mac.mobi/41547/instalacion-maximawxmaxima-mac-javier-arantegui > > I hope it helps. > > Javier > > On Wednesday, May 25, 2011, 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 >> > > -- > Lee mi blog: "Un peque?o paso para Neil" http://up3n.wordpress.com/ > ?Ahora tambi?n en Twitter! http://twitter.com/javierarantegui > > -- Lee mi blog: "Un peque?o paso para Neil" http://up3n.wordpress.com/ ?Ahora tambi?n en Twitter! http://twitter.com/javierarantegui From pinkisntwell at gmail.com Thu May 26 15:36:22 2011 From: pinkisntwell at gmail.com (George) Date: Thu, 26 May 2011 23:36:22 +0300 Subject: [Maxima] "Wrong usage" error message when trying to plot with plot3d or contour_plot Message-ID: Here is a short script that will reproduce the error: fn(x):=1/sqrt(2*%pi)*exp((-x^2)/2); Fn(x):=integrate(fn(t),t,-inf,x); pw(r1,r2,s1,s2):=1-Fn((r2-r1)/sqrt(s1^2+s2^2)); fbn(x,y,r):=1/(2*%pi*sqrt(1-r^2))*exp((-(x^2-2*r*x*y+y^2))/(2*(1-r^2))); fbnxcy(x,y,r) := fbn(x,y,r) / fn(y); loww(rs2, ro, r, s1, s2) := quad_qagi(fbnxcy(rs1, rs2, r)*pw(rs1, ro, s1, s2), rs1, minf, inf); plot3d( loww(rs2, 0, r, 1, 1)[1] , [rs2, -1.5, 2.5], [r, 0.1, 0.9] ); From woollett at charter.net Thu May 26 15:40:43 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 26 May 2011 13:40:43 -0700 Subject: [Maxima] detect unix or dos line endings Message-ID: <612918231FFD41CA88B0B130BA466841@edwinc367e16bd> On May 26 Paul Bowyer wrote: --------------------------------------- Try: ss : openr("/home/pfb/ndata1.dat"); ln : flength (ss); /*Get next-to-last char and see if it's a CR*/ fposition(ss,ln-1); cs : string(?read\-char(ss,nil)); cln : slength(cs); cint (charat (cs,cln)); /*Get last char and see if it's a LF*/ fposition(ss,ln); cs : string(?read\-char(ss,nil)); cln : slength(cs); cint (charat (cs,cln)); close(ss); ------------------- Thanks for the suggestions, Paul. I use your idea to use the file length function to tie down the analysis below. It seems to me that your code would only work if you knew ahead of time the file only contained one line (which of course you might well know). ============== On May 26 Raymond Toy wrote: ------------------------------------------- Edwin> (%i14) cs : string(?read\-char(ss,nil)); You want false, here, not nil. nil is the maxima symbol nil, which will be treated as true by READ-CHAR. "false" will get converted to CL:NIL, which is what you want to pass to READ-CHAR. So cs: string(?read\-char(ss,false)); will return false when you reach the end of the file instead of signaling an eof error. ---------------------------------- Thanks, Ray, for giving me the maxima to lisp translation of false: (%i1) display2d:false$ (%i2) get_char_raw(%s) := string(?read\-char(ss,false))$ (%i3) :lisp $_ ((MDEFINE) (($GET_CHAR_RAW) $%S) (($STRING) ((READ-CHAR) $SS NIL))) It would be nice if there was a list of such translations available somewhere. However, I realized that by simply analyzing the various possibilities, that I could predict ahead of time when I might get into trouble with an end of file, by simply comparing the file length with the length of the first line. I use this analysis for the code below: ============================== (%i1) load(file_info); (%o1) "c:/work2/file_info.mac" (%i2) fundef (file_info); (%o2) file_info(%filename):=block([%s,%fl,%ll,%EOL,%info,%next,%e1], if not file_search(%filename) then (disp(" file not found "),return(false)), %s:openr(%filename),%fl:flength(%s),%ll:slength(readline(%s)), %EOL:[],%info:[%fl],fposition(%s,1+%ll), %EOL:cons(cint_val(%s),%EOL), if %fl < 5+%ll then (if %fl = 2+%ll then (%EOL:cons(cint_val(%s),%EOL), %EOL:reverse(%EOL))) else (%next:cint_val(%s), if not lfreeof([10,13],%next) then (%EOL:cons(%next,%EOL), %EOL:reverse(%EOL))), if length(%EOL) = 1 then (%e1:part(%EOL,1), if %e1 = 10 then %info:cons("UNIX",%info) else (if %e1 = 13 then %info:cons("MAC",%info) else %info:cons(%e1,%info))) else (if part(%EOL,1) = 13 and part(%EOL,2) = 10 then %info:cons("WINDOWS",%info) else %info:flatten(cons(%EOL,%info))),close(%s), %info) (%i3) fundef (cint_val); (%o3) cint_val(%ss):=cint(charat(string(?read\-char(%ss)),3)) (%i4) printfile ("ndata1w.dat")$ 2.3e9 "Abc" /* here we test three one line files, having windows, unix and mac endings */ (%i5) file_info ("ndata1w.dat"); (%o5) ["WINDOWS",13] (%i6) file_info ("ndata1u.dat"); (%o6) ["UNIX",12] (%i7) file_info ("ndata1m.dat"); (%o7) ["MAC",12] (%i8) printfile ("ndata2w.dat")$ 2 , 4.8, -3/4, "xyz", -2.8e-9 3 22.2 7/8 "abc" 4.4e10 /* here we test three two line files */ (%i9) file_info ("ndata2w.dat"); (%o9) ["WINDOWS",57] (%i10) file_info ("ndata2u.dat"); (%o10) ["UNIX",55] (%i11) file_info ("ndata2m.dat"); (%o11) ["MAC",55] Ted Woollett p.s. for windows users, notepad2 makes it super easy to change end of line chars. From l.couraud at gmail.com Thu May 26 17:32:31 2011 From: l.couraud at gmail.com (laurent couraud) Date: Fri, 27 May 2011 00:32:31 +0200 Subject: [Maxima] RE : detect unix or dos line endings In-Reply-To: Message-ID: Maybe one other possibility is to open the file as binary. There is the command "openr_binary" in package numericalio. Best. > -----Message d'origine----- > De?: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] De la part de > Edwin Woollett > Envoy??: jeudi 26 mai 2011 00:42 > ??: Raymond Toy > Cc?: maxima mailing list > Objet?: Re: [Maxima] detect unix or dos line endings > > On May 24, Raymond Toy wrote: > --------------------------------------- > .... the maxima language allows you to > escape to Lisp using ?. Thus you can use ?read\-char to read a > character from a stream and then use other maxima functions to > determine if you've encountered LF or CR/LF or plain CR (Mac) > end-of-line sequences. > --------------------------------------- > Hi Ray, > > I am able to use ?read\-char(stream) ok to be able > to detect the first (and perhaps only) end of line > character, but in looking for a possible second > character (as with CR LF dos file end), I run the > risk of reaching the end of the file (If the file > has only one line), and I don't know how to > avoid the kind of lisp error shown below. > > The common lisp cookbook talks about > using a second argument NIL in the > lisp function read-char to get a return > value of NIL is end-of-line is found, but > I am probably not adapting this idea > correctly below?? > > I have a one line file with dos (CR LF) endings here > for the experiment. > > I first determine the length of the first line (excluding > end of line chars) using readline. > > ........................................................... > Maxima 5.24.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. > 2011-05-25 > > > (%i1) display2d:false$ > > (%i2) ss : openr("ndata1.dat"); > (%o2) ?\#\ > > (%i3) l1 : readline(ss); > (%o3) "2.3e9 \"Abc\"" > > (%i4) slength(l1); > (%o4) 11 > > (%i5) close(ss); > (%o5) true > > (%i6) ss : openr("ndata1.dat"); > (%o6) ?\#\ > > (%i7) fposition(ss,12); > (%o7) true > > (%i8) cs : string(?read\-char(ss,nil)); > (%o8) "?\\ > " > (%i9) slength(cs); > (%o9) 3 > (%i10) cint (charat (cs,3)); > (%o10) 13 > > /* so there is the CR end of line char */ > > (%i11) cs : string(?read\-char(ss,nil)); > (%o11) "?\\ > " > (%i12) slength(cs); > (%o12) 3 > (%i13) cint (charat (cs,3)); > (%o13) 10 > > /* so there is the second expected end of line char LF */ > > /* but, what if there had only been one end of line char, > as in unix or mac file? As an experiment, we go > for another char, not knowing if it is the end of file > */ > (%i14) cs : string(?read\-char(ss,nil)); > > Maxima encountered a Lisp error: > > Error in PROGN [or a callee]: Unexpected end of # "ndata1.dat">. > > Automatically continuing. > To enable the Lisp debugger set *debugger-hook* to nil. > > (%i15) close(ss); > (%o15) true > > (%i16) printfile("ndata1.dat")$ > 2.3e9 "Abc" > > ................................................................ > > How can I avoid this read error? > > Ted > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From arne.schmitz at gmx.net Fri May 27 04:20:15 2011 From: arne.schmitz at gmx.net (Arne Schmitz) Date: Fri, 27 May 2011 11:20:15 +0200 Subject: [Maxima] Installing Maxima on MacOS X In-Reply-To: References: Message-ID: Am 26.05.2011 um 18:53 schrieb Javier Arantegui: > Are you using a PPC Mac? As far I know the compiled version of > wxMaxima is intel only. In that case, a possible solution could be to > compile it yourself using Fink. It takes some time to do it but it's > not very difficult. I am using MacPorts for installing and updating wxMaxima and Maxima. That should also work on PPC, I think. Furthermore it is very actively maintained. I think Fink is usually a bit older. YMMV Both compile from source and as such will take some time and hard disk space. Best regards, Arne -- Dipl.-Inform. Arne Schmitz Phone +49 (0)241 80-21817 Computer Graphics Group Mobile +49 (0)151 29145947 RWTH Aachen University Fax +49 (0)241 80-22899 Ahornstrasse 55, 52074 Aachen, Germany http://www.rwth-graphics.de From sen1 at math.msu.edu Fri May 27 09:19:05 2011 From: sen1 at math.msu.edu (Sheldon Newhouse) Date: Fri, 27 May 2011 10:19:05 -0400 Subject: [Maxima] finer mesh implicit in draw3d? Message-ID: <4DDFB2D9.70501@math.msu.edu> Hello, How can one decrease the mesh size in the implicit function for draw3d? For instance, the expression draw3d(implicit(x^2 + y^2-1,x,-2,2,y,-2,2,z,-2,2))$ produces a vertical cylinder with a certain number of triangles in its boundary. I would like to make the triangles smaller; i.e. increase the number of triangles. Thanks, -sen From robert.dodier at gmail.com Fri May 27 15:33:24 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 27 May 2011 14:33:24 -0600 Subject: [Maxima] "Wrong usage" error message when trying to plot with plot3d or contour_plot In-Reply-To: References: Message-ID: George, the problem is that plot3d is attempting to detect a case in which the expression never evaluates to a number, which would otherwise result in an empty plot. But the logic to detect such cases is faulty; there are expressions which fail the test, but yield numbers all the same. You have found such an expression. You can disable the error by searching for the error message in your copy of plot.lisp (somewhere in your Maxima installation) and changing merror to mtell. Then load("FOO/plot.lisp"); where FOO = the appropriate path, will load your modified copy. I will probably make the same change in the project source code; I'm pretty sure others have run into the same problem. best, Robert Dodier On 5/26/11, George wrote: > Here is a short script that will reproduce the error: > > fn(x):=1/sqrt(2*%pi)*exp((-x^2)/2); > Fn(x):=integrate(fn(t),t,-inf,x); > pw(r1,r2,s1,s2):=1-Fn((r2-r1)/sqrt(s1^2+s2^2)); > fbn(x,y,r):=1/(2*%pi*sqrt(1-r^2))*exp((-(x^2-2*r*x*y+y^2))/(2*(1-r^2))); > fbnxcy(x,y,r) := fbn(x,y,r) / fn(y); > loww(rs2, ro, r, s1, s2) := quad_qagi(fbnxcy(rs1, rs2, r)*pw(rs1, ro, > s1, s2), rs1, minf, inf); > > plot3d( loww(rs2, 0, r, 1, 1)[1] , [rs2, -1.5, 2.5], [r, 0.1, 0.9] ); > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From woollett at charter.net Fri May 27 15:43:04 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 27 May 2011 13:43:04 -0700 Subject: [Maxima] write_data with separator_flag = space ? Message-ID: According to the write_data sect. of the help manual: "The recognized values of separator_flag are comma, pipe, semicolon, space, and tab. If separator_flag is not specified, the file is assumed space-delimited." I can get comma to work, but not space. ------------------------------------------------- Maxima 5.24.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. 2011-05-27 (%i1) dataL : [[0,2],[1,3],[2,4]]$ (%i2) write_data (dataL,"tmp4.out")$ (%i3) printfile ("tmp4.out")$ 0 2 1 3 2 4 (%i4) write_data (dataL,"tmp4.out",comma)$ (%i5) printfile ("tmp4.out")$ 0,2 1,3 2,4 (%i6) write_data(dataL,"tmp4.out",space)$ numericalio: separator flag " " not recognized; assume ``space''. ----------------------------------------------- Ted Woollett From woollett at charter.net Fri May 27 16:38:30 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 27 May 2011 14:38:30 -0700 Subject: [Maxima] Universal read_data function Message-ID: <5E1A157A4BCA4C6AB1D30457FD6A49D8@edwinc367e16bd> On May 25, 2011, I wrote: ---------------------------------------- The use of the string processing functions from van Nek's stringproc.lisp allows construction of a "Universal" read_data function which not only doesn't care about line endings, but doesn't care whether data separators are spaces or commas, and can handle fractions, decimals, floating point and strings as data items. ---------------------------------------------------- Well, I was wrong, since the proposed universal read_data function chokes if a string contains spaces, such as "my mistake". To read in string data containing spaces, using the stringproc.lisp methods, requires (I think) the use of a comma separated data file. Hence a re-designed read_data function with the syntax: read_data (filename, data_sep) in which the second arg is 1. optional, but if not present, space sep is assumed, 2. if present, must be either "comma" or "space" . --------------------------------------- Maxima 5.24.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. 2011-05-27 (%i1) load(readwrite); (%o1) "c:/work2/readwrite.mac" (%i2) printfile("ndata1.dat")$ 2.3e9 "Abc" (%i3) file_info ("ndata1.dat"); (%o3) ["WINDOWS",13] (%i4) read_data ("ndata1.dat"); (%o4) [[2.3E+9,"Abc"]] (%i5) read_data ("ndata1.dat","space"); (%o5) [[2.3E+9,"Abc"]] /* note that the following data file has a string with spaces: 5, "! = ", 120 there is a space before and after the equal sign */ (%i6) printfile("tmp12.out")$ 5, "! = ", 120 (%i7) file_info ("tmp12.out"); (%o7) ["UNIX",16] (%i8) read_data ("tmp12.out","comma"); (%o8) [[5,"! = ",120]] (%i9) fundef (read_data); (%o9) read_data ([%v]) := block ([%s,%r,%l,%filename,%dsep], %filename:part(%v,1), if not stringp(%filename) then (disp(" filename must be a string "),return(false)), if not file_search(%filename) then (disp(" file not found "),return(false)), if length(%v) = 1 then %dsep:"space" else %dsep:part(%v,2), if lfreeof(["space","comma"],%dsep) then (disp(" The allowed data-separators are the strings ``space'' or ``comma''. "), disp(" The default file type is space separated data. "), return(false)), %s:openr(%filename), %r:[], while (%l:readline(%s)) # false do if %dsep = "space" then %r:cons(map(parse_string,split(%l)),%r) else %r:cons(map(parse_string,split(%l,",")),%r), close(%s),reverse(%r)) ------------------------------------------------- Ted Woollett From volkervannek at googlemail.com Fri May 27 17:15:54 2011 From: volkervannek at googlemail.com (Volker van Nek) Date: Sat, 28 May 2011 00:15:54 +0200 Subject: [Maxima] Universal read_data function In-Reply-To: <5E1A157A4BCA4C6AB1D30457FD6A49D8@edwinc367e16bd> References: <5E1A157A4BCA4C6AB1D30457FD6A49D8@edwinc367e16bd> Message-ID: If you want to read general Maxima expressions containing blanks and commas it makes sense to me to use the default ";" or "$" as separators. E.g. (%i1) string: "(x:1,y:2,x+y); block([fpprec:24],bfloat(%pi)); foo;"$ (%i2) strings: split(string,";"); (%o2) [(x:1,y:2,x+y), block([fpprec:24],bfloat(%pi)), foo] (%i3) map(parse_string, strings); (%o3) [(x : 1, y : 2, y + x), block([fpprec : 24], bfloat(%pi)), foo] (%i4) ''%; (%o4) [3, 3.14159265358979323846264b0, foo] Volker van Nek 2011/5/27 Edwin Woollett > On May 25, 2011, I wrote: > ---------------------------------------- > The use of the string processing functions from > van Nek's stringproc.lisp allows construction of > a "Universal" read_data function which not only > doesn't care about line endings, but doesn't care > whether data separators are spaces or commas, > and can handle fractions, decimals, floating point > and strings as data items. > ---------------------------------------------------- > Well, I was wrong, since the proposed universal > read_data function chokes if a string contains > spaces, such as "my mistake". > > To read in string data containing spaces, using > the stringproc.lisp methods, requires (I think) > the use of a comma separated data file. > > Hence a re-designed read_data function with > the syntax: > read_data (filename, data_sep) > in which the second arg is > 1. optional, but if not present, space sep is assumed, > 2. if present, must be either > "comma" or "space" . > > --------------------------------------- > > Maxima 5.24.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. > 2011-05-27 > > (%i1) load(readwrite); > (%o1) "c:/work2/readwrite.mac" > > (%i2) printfile("ndata1.dat")$ > 2.3e9 "Abc" > > (%i3) file_info ("ndata1.dat"); > (%o3) ["WINDOWS",13] > > (%i4) read_data ("ndata1.dat"); > (%o4) [[2.3E+9,"Abc"]] > > (%i5) read_data ("ndata1.dat","space"); > (%o5) [[2.3E+9,"Abc"]] > > /* note that the following data file has a string with > spaces: 5, "! = ", 120 > there is a space before and after the equal sign */ > > (%i6) printfile("tmp12.out")$ > 5, "! = ", 120 > > (%i7) file_info ("tmp12.out"); > (%o7) ["UNIX",16] > > (%i8) read_data ("tmp12.out","comma"); > (%o8) [[5,"! = ",120]] > > (%i9) fundef (read_data); > > (%o9) read_data ([%v]) := > block ([%s,%r,%l,%filename,%dsep], > %filename:part(%v,1), > if not stringp(%filename) > then (disp(" filename must be a string "),return(false)), > > if not file_search(%filename) > then (disp(" file not found "),return(false)), > > if length(%v) = 1 then %dsep:"space" else %dsep:part(%v,2), > > if lfreeof(["space","comma"],%dsep) then > (disp(" The allowed data-separators are the strings ``space'' or > ``comma''. "), > disp(" The default file type is space separated data. "), > > return(false)), > %s:openr(%filename), > %r:[], > > while (%l:readline(%s)) # false do > if %dsep = "space" > then %r:cons(map(parse_string,split(%l)),%r) > else %r:cons(map(parse_string,split(%l,",")),%r), > close(%s),reverse(%r)) > > ------------------------------------------------- > > 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 joshua.stults at gmail.com Fri May 27 17:24:36 2011 From: joshua.stults at gmail.com (Joshua Stults) Date: Fri, 27 May 2011 18:24:36 -0400 Subject: [Maxima] ALPAL In-Reply-To: References: Message-ID: On Wed, Oct 20, 2010 at 12:18 PM, Joshua Stults wrote: > On Fri, Aug 27, 2010 at 3:21 PM, Joshua Stults wrote: >> I am still interested in starting an ALPAL-like package for Maxima. > > After getting in to some of the old papers on generating PDE solver > code (thanks Richard Fateman); I don't think it quite rises to the > level of a 'package', maybe just some tutorials demo'ing how to use > Maxima for this specific task. ?Here's my thoughts and collected > references on this for future reference: > > http://j-stults.blogspot.com/2010/10/nalpal-not-livermore-physics.html > which is now: http://variousconsequences.com/2010/10/nalpal-not-livermore-physics.html Documentation papers / code for ALPAL available here: https://sites.google.com/site/variousconsequences/alpal_docs Thanks to the fine folks at LLNL and NNSA for putting it all together and releasing it to me. Unfortunately, the code is images in pdf rather than text, but it does seem to have a BSD-style license. Probably more valuable as a reference than as something to port directly to Maxima. I split out the papers from the source as 'doc_xxx.pdf'; see the spreadsheet 'FOIA 10-00301-K Document listing.xlsx' for a description of all the files. -- Joshua Stults Website: variousconsequences.com Hackerspace: daytondiode.org From pinkisntwell at gmail.com Sat May 28 02:52:38 2011 From: pinkisntwell at gmail.com (George) Date: Sat, 28 May 2011 10:52:38 +0300 Subject: [Maxima] "Wrong usage" error message when trying to plot with plot3d or contour_plot In-Reply-To: References: Message-ID: On Fri, May 27, 2011 at 11:33 PM, Robert Dodier wrote: > You can disable the error by searching for the error message > in your copy of plot.lisp (somewhere in your Maxima installation) > and changing merror to mtell. Then load("FOO/plot.lisp"); where FOO = > the appropriate path, > will load your modified copy. > I will probably make the same change in the project source code; > I'm pretty sure others have run into the same problem. There is no such file in my system. I'm using the standard maxima package that comes from the Debian repositories. --version shows: Maxima 5.21.1 From biomates at telefonica.net Sat May 28 03:00:26 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Sat, 28 May 2011 10:00:26 +0200 Subject: [Maxima] finer mesh implicit in draw3d? In-Reply-To: <4DDFB2D9.70501@math.msu.edu> References: <4DDFB2D9.70501@math.msu.edu> Message-ID: <1306569626.1696.4.camel@pc> El vie, 27-05-2011 a las 10:19 -0400, Sheldon Newhouse escribi?: > Hello, > How can one decrease the mesh size in the implicit function for draw3d? > > For instance, the expression > > draw3d(implicit(x^2 + y^2-1,x,-2,2,y,-2,2,z,-2,2))$ > > produces a vertical cylinder with a certain number of triangles in its > boundary. I would like to make the triangles smaller; i.e. increase the > number of triangles. Hello, See info for x_voxel, y_voxel and z_voxel. You can find an example here: http://riotorto.users.sourceforge.net/gnuplot/implic By the way, this is one of the graphic objects ported to the VTK renderer: http://riotorto.users.sourceforge.net/vtk/implicit -- Mario From andre.maute at gmx.de Sat May 28 03:16:20 2011 From: andre.maute at gmx.de (andre maute) Date: Sat, 28 May 2011 10:16:20 +0200 Subject: [Maxima] "Wrong usage" error message when trying to plot with plot3d or contour_plot In-Reply-To: References: Message-ID: <4DE0AF54.5030000@gmx.de> On 05/28/2011 09:52 AM, George wrote: > On Fri, May 27, 2011 at 11:33 PM, Robert Dodier wrote: > >> You can disable the error by searching for the error message >> in your copy of plot.lisp (somewhere in your Maxima installation) >> and changing merror to mtell. Then load("FOO/plot.lisp"); where FOO = >> the appropriate path, >> will load your modified copy. >> I will probably make the same change in the project source code; >> I'm pretty sure others have run into the same problem. > There is no such file in my system. I'm using the standard maxima > package that comes from the Debian repositories. --version shows The debian package maxima-src has the file plot.lisp http://packages.debian.org/sid/maxima-src http://packages.debian.org/sid/all/maxima-src/filelist Andre From sen1 at math.msu.edu Sat May 28 09:20:38 2011 From: sen1 at math.msu.edu (Sheldon Newhouse) Date: Sat, 28 May 2011 10:20:38 -0400 Subject: [Maxima] finer mesh implicit in draw3d? In-Reply-To: <4DDFB2D9.70501@math.msu.edu> References: <4DDFB2D9.70501@math.msu.edu> Message-ID: <4DE104B6.1060100@math.msu.edu> On 05/27/2011 10:19 AM, Sheldon Newhouse wrote: > Hello, > How can one decrease the mesh size in the implicit function for draw3d? > > For instance, the expression > > draw3d(implicit(x^2 + y^2-1,x,-2,2,y,-2,2,z,-2,2))$ > > produces a vertical cylinder with a certain number of triangles in its > boundary. I would like to make the triangles smaller; i.e. increase > the number of triangles. > > Thanks, > -sen OK, got it. The x_voxel, y_voxel, or z_voxel needs to be increased and written BEFORE the implicit call. E.g., (%i10) draw3d(x_voxel=10,implicit(x^2+y^2=1,x,-2,2,y,-2,2,z,-1,1)); or draw3d(x_voxel=30,implicit(x^2+y^2=1,x,-2,2,y,-2,2,z,-1,1)); -sen From robert.dodier at gmail.com Sat May 28 12:13:09 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 28 May 2011 11:13:09 -0600 Subject: [Maxima] "Wrong usage" error message when trying to plot with plot3d or contour_plot In-Reply-To: <4DE0AF54.5030000@gmx.de> References: <4DE0AF54.5030000@gmx.de> Message-ID: Thanks for the info, Andre. George, you'll have to install maxima-src in order to get plot.lisp (and the rest of the source code). best Robert Dodier On 5/28/11, andre maute wrote: > On 05/28/2011 09:52 AM, George wrote: >> On Fri, May 27, 2011 at 11:33 PM, Robert Dodier >> wrote: >> >>> You can disable the error by searching for the error message >>> in your copy of plot.lisp (somewhere in your Maxima installation) >>> and changing merror to mtell. Then load("FOO/plot.lisp"); where FOO = >>> the appropriate path, >>> will load your modified copy. >>> I will probably make the same change in the project source code; >>> I'm pretty sure others have run into the same problem. >> There is no such file in my system. I'm using the standard maxima >> package that comes from the Debian repositories. --version shows > > The debian package maxima-src has the file plot.lisp > > http://packages.debian.org/sid/maxima-src > http://packages.debian.org/sid/all/maxima-src/filelist > > Andre > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From willisb at unk.edu Sat May 28 12:17:43 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 28 May 2011 12:17:43 -0500 Subject: [Maxima] red vs spmod In-Reply-To: References: <4DE0AF54.5030000@gmx.de>, Message-ID: OK: (%i41) radcan(exp(((t-2*%i)*x^2)/(4*t-2*%i))), gcd : 'red; (%o41) %e^(((t-2*%i)*x^2)/(4*t-2*%i)) OK (I think) but messy: (%i42) radcan(exp(((t-2*%i)*x^2)/(4*t-2*%i))), gcd : 'spmod; (%o42) %e^(((32*t^6-144*%i*t^5-240*t^4+200*%i*t^3+90*t^2-21*%i*t-2)*x^2)/(128*t^6-384*%i*t^5-480*t^4+320*%i*t^3+120*t^2-24*%i*t-2)) I wasn't able to transform (%o42) back to exp(((t-2*%i)*x^2)/(4*t-2*%i)). --Barton From macrakis at alum.mit.edu Sat May 28 12:33:49 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 28 May 2011 13:33:49 -0400 Subject: [Maxima] red vs spmod In-Reply-To: References: <4DE0AF54.5030000@gmx.de> Message-ID: scanmap(gfactor, ... ) will reduce to the original form. ratsimp, gcd:'subres or 'red also work. But that leaves the problem of radcan causing bloat. A simpler example: (%i1) expr; (%o1) (2*t^2-5*%i*t-2)/(4*t^2-4*%i*t-1) (%i2) factor(expr); (%o2) (2*t^2-5*%i*t-2)/(4*t^2-4*%i*t-1) (%i3) gfactor(expr); (%o3) (t-2*%i)/(2*t-%i) (%i4) ratsimp(expr); (%o4) (2*t^2-5*%i*t-2)/(4*t^2-4*%i*t-1) (%i5) ratsimp(expr),gcd:'red; (%o5) (t-2*%i)/(2*t-%i) (%i6) ratsimp(expr),gcd:'subres; (%o6) (t-2*%i)/(2*t-%i) (%i7) radcan(exp(expr)) ... a big mess... <<<< why? (%i8) scanmap(gfactor,%); (%o8) %e^((t-2*%i)/(2*t-%i)) (%i9) radcan(exp(expr)),gcd:'red; (%o9) %e^((t-2*%i)/(2*t-%i)) (%i10) radcan(exp(expr)),gcd:'subres; (%o10) %e^((t-2*%i)/(2*t-%i)) On Sat, May 28, 2011 at 13:17, Barton Willis wrote: > radcan(exp(((t-2*%i)*x^2)/(4*t-2*%i))), gcd : 'red; > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat May 28 12:52:07 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 28 May 2011 11:52:07 -0600 Subject: [Maxima] write_data with separator_flag = space ? In-Reply-To: References: Message-ID: Ted, the problem is that there is a variable in the stringproc package (which you must have loaded, I guess) named "space". Try write_data(, 'space) (i.e. quote the variable). HTH, Robert Dodier On 5/27/11, Edwin Woollett wrote: > According to the write_data sect. of the > help manual: > > "The recognized values of separator_flag > are comma, pipe, semicolon, space, and tab. > If separator_flag is not specified, the file > is assumed space-delimited." > > I can get comma to work, but not space. > ------------------------------------------------- > Maxima 5.24.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. > 2011-05-27 > > > (%i1) dataL : [[0,2],[1,3],[2,4]]$ > > (%i2) write_data (dataL,"tmp4.out")$ > (%i3) printfile ("tmp4.out")$ > 0 2 > 1 3 > 2 4 > > (%i4) write_data (dataL,"tmp4.out",comma)$ > (%i5) printfile ("tmp4.out")$ > 0,2 > 1,3 > 2,4 > > (%i6) write_data(dataL,"tmp4.out",space)$ > numericalio: separator flag " " not recognized; assume ``space''. > > ----------------------------------------------- > Ted Woollett > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From maxima at etherjones.us Sat May 28 12:55:08 2011 From: maxima at etherjones.us (Ether Jones) Date: Sat, 28 May 2011 10:55:08 -0700 (PDT) Subject: [Maxima] display multiplication symbol in output In-Reply-To: Message-ID: <646819.56182.qm@web161805.mail.bf1.yahoo.com> Hello. Is there a setting I can change to cause wxMaxima to display a multiplication symbol between two variables which are being multiplied? For example, a*b currently displays as "a b" (with a space instead of a multiply symbol) and I find that confusing to read. Thank you. --- On Sat, 5/28/11, Robert Dodier wrote: From: Robert Dodier Subject: Re: [Maxima] write_data with separator_flag = space ? To: "Edwin Woollett" Cc: "maxima mailing list" Date: Saturday, May 28, 2011, 1:52 PM Ted, the problem is that there is a variable in the stringproc package (which you must have loaded, I guess) named "space". Try write_data(, 'space) (i.e. quote the variable). HTH, Robert Dodier On 5/27/11, Edwin Woollett wrote: > According to the write_data sect. of the > help manual: > >? ? ? "The recognized values of separator_flag >? ? ???are comma, pipe, semicolon, space, and tab. >? ? ???If separator_flag is not specified, the file >? ? ???is assumed space-delimited." > > I can get comma to work, but not space. > ------------------------------------------------- > Maxima 5.24.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. >? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ???2011-05-27 > > > (%i1) dataL : [[0,2],[1,3],[2,4]]$ > > (%i2) write_data (dataL,"tmp4.out")$ > (%i3) printfile ("tmp4.out")$ > 0 2 > 1 3 > 2 4 > > (%i4) write_data (dataL,"tmp4.out",comma)$ > (%i5) printfile ("tmp4.out")$ > 0,2 > 1,3 > 2,4 > > (%i6) write_data(dataL,"tmp4.out",space)$ > numericalio: separator flag " " not recognized; assume ``space''. > > ----------------------------------------------- > 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 pbowyer at olynet.com Sat May 28 13:36:59 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sat, 28 May 2011 11:36:59 -0700 Subject: [Maxima] Universal read_data function In-Reply-To: <5E1A157A4BCA4C6AB1D30457FD6A49D8@edwinc367e16bd> References: <5E1A157A4BCA4C6AB1D30457FD6A49D8@edwinc367e16bd> Message-ID: <4DE140CB.102@olynet.com> On 05/27/2011 02:38 PM, Edwin Woollett wrote: > On May 25, 2011, I wrote: > ---------------------------------------- > The use of the string processing functions from > van Nek's stringproc.lisp allows construction of > a "Universal" read_data function which not only > doesn't care about line endings, but doesn't care > whether data separators are spaces or commas, > and can handle fractions, decimals, floating point > and strings as data items. > ---------------------------------------------------- > Well, I was wrong, since the proposed universal > read_data function chokes if a string contains > spaces, such as "my mistake". > > To read in string data containing spaces, using > the stringproc.lisp methods, requires (I think) > the use of a comma separated data file. > > Hence a re-designed read_data function with > the syntax: > read_data (filename, data_sep) > in which the second arg is > 1. optional, but if not present, space sep is assumed, > 2. if present, must be either > "comma" or "space" . > > --------------------------------------- > Maxima 5.24.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. > 2011-05-27 > > (%i1) load(readwrite); > (%o1) "c:/work2/readwrite.mac" > > (%i2) printfile("ndata1.dat")$ > 2.3e9 "Abc" > > (%i3) file_info ("ndata1.dat"); > (%o3) ["WINDOWS",13] > > (%i4) read_data ("ndata1.dat"); > (%o4) [[2.3E+9,"Abc"]] > > (%i5) read_data ("ndata1.dat","space"); > (%o5) [[2.3E+9,"Abc"]] > > /* note that the following data file has a string with > spaces: 5, "! = ", 120 > there is a space before and after the equal sign */ > > (%i6) printfile("tmp12.out")$ > 5, "! = ", 120 > > (%i7) file_info ("tmp12.out"); > (%o7) ["UNIX",16] > > (%i8) read_data ("tmp12.out","comma"); > (%o8) [[5,"! = ",120]] > > (%i9) fundef (read_data); > > (%o9) read_data ([%v]) := > block ([%s,%r,%l,%filename,%dsep], > %filename:part(%v,1), > if not stringp(%filename) > then (disp(" filename must be a string > "),return(false)), > if not file_search(%filename) > then (disp(" file not found "),return(false)), > > if length(%v) = 1 then %dsep:"space" else %dsep:part(%v,2), > > if lfreeof(["space","comma"],%dsep) then > (disp(" The allowed data-separators are the strings ``space'' or > ``comma''. "), > disp(" The default file type is space separated data. "), > return(false)), > %s:openr(%filename), > %r:[], > > while (%l:readline(%s)) # false do > if %dsep = "space" > then %r:cons(map(parse_string,split(%l)),%r) > else %r:cons(map(parse_string,split(%l,",")),%r), > close(%s),reverse(%r)) > > ------------------------------------------------- > > Ted Woollett > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Hi again Ted: Would this be of any use to you? read_data2(%filename) := block([%s, %r, %l, %lines, %chr], if not file_search(%filename) then (disp(" file not found "), return(false)), %s : openr(%filename), %l : "", %lines : [], while ( %r : ?read\-char(%s,false) ) #false do ( %chr : cint(cunlisp(%r)), if %chr # 13 then ( if %chr = 10 then ( %lines : append(%lines, cons( strim(" ",%l) ,[]) ), %l : "" ) else %l : concat(%l, %r) ) ), disp(%lines), close(%s) ); Data file contains (with embedded spaces, carriage returns, and newlines): 2.3e9 "Abc" 10.3 14.4 read_data1(%filename):=block([%s,%r],if notfile_search(%filename) then (disp(" file not found "),return(false)) ,%s:openr(%filename),%r:[],while (l:readline(%s))#false do %r:cons(map(parse_string,split(l)),%r),reverse(%r)) 12.6 14.5 Output from: read_data2("/home/pfb/ndata1.dat"); was: ["2.3e9 "Abc"","10.3","14.4", "read_data1(%filename):=block([%s,%r],if notfile_search(%filename) then (disp(" file not found "),return(false)) ,%s:openr(%filename),%r:[],while (l:readline(%s))#false do %r:cons(map(parse_string,split(l)),%r),reverse(%r))" ,"12.6","14.5"] You may need to do more to work with the strings in the list because I don't know the specifics of your needs. Paul From andrej.vodopivec at gmail.com Sat May 28 15:06:53 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Sat, 28 May 2011 22:06:53 +0200 Subject: [Maxima] display multiplication symbol in output In-Reply-To: <646819.56182.qm@web161805.mail.bf1.yahoo.com> References: <646819.56182.qm@web161805.mail.bf1.yahoo.com> Message-ID: On Sat, May 28, 2011 at 7:55 PM, Ether Jones wrote: > > Hello. > > Is there a setting I can change to cause wxMaxima to display a > multiplication symbol between two variables which are being multiplied? > > For example, a*b currently displays as "a b" (with a space instead of a > multiply symbol) and I find that confusing to read. > > Thank you. If you set stardisp to true then the multiplication will be represented with an asterisk. Andrej -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Sat May 28 15:31:44 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 28 May 2011 13:31:44 -0700 Subject: [Maxima] Universal read_data function Message-ID: On May 27, Volker van Nek wrote: --------------------------------------- If you want to read general Maxima expressions containing blanks and commas it makes sense to me to use the default ";" or "$" as separators. E.g. (%i1) string: "(x:1,y:2,x+y); block([fpprec:24],bfloat(%pi)); foo;"$ (%i2) strings: split(string,";"); (%o2) [(x:1,y:2,x+y), block([fpprec:24],bfloat(%pi)), foo] (%i3) map(parse_string, strings); (%o3) [(x : 1, y : 2, y + x), block([fpprec : 24], bfloat(%pi)), foo] (%i4) ''%; (%o4) [3, 3.14159265358979323846264b0, foo] ---------------------------------------------------------- Thanks for the great suggestion. Having a read_data function which allows the user to pass on to split any desired data separator string makes a lot of sense. My new (and improved?) version of read_data has the syntax: read_data (filename, data-sep-string, mult). Using the minimal form: read_data(filename) assumes an arbitrary mixture of commas and space data separators, convenient for many applications, but will not allow string data items containing spaces, since the default simple version converts all commas to spaces. Using read_data (filename, ",") or read_data (filename, ";") assumes all data items are using the same data separators as indicated. The code sets the third optional arg to true , but can be set to false for use by split. --------------------------------- Maxima 5.24.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. 2011-05-28 (%i1) (display2d:false,fpprintprec:8)$ (%i2) load(readwrite); (%o2) "c:/work2/readwrite.mac" (%i3) printfile ("ndata1.dat")$ 2.3e9 "Abc" (%i4) read_data ("ndata1.dat"); (%o4) [[2.3E+9,"Abc"]] (%i5) read_data ("ndata1.dat"," "); (%o5) [[2.3E+9,"Abc"]] (%i6) printfile ("ndata2.dat")$ 2 , 4.8, -3/4, "xyz", -2.8e-9 3 22.2 7/8 "abc" 4.4e10 (%i7) read_data ("ndata2.dat"); (%o7) [[2,4.8,-3/4,"xyz",-2.8E-9],[3,22.2,7/8,"abc",4.4E+10]] (%i8) printfile ("ndata3.dat")$ 2.0; -3/7; (x:1,y:2,x+y); block([fpprec:24],bfloat(%pi)); foo (%i9) read_data ("ndata3.dat",";"); (%o9) [[2.0,-3/7,(x:1,y:2,y+x),block([fpprec:24],bfloat(%pi)),foo]] (%i10) ev(%); (%o10) [[2.0,-3/7,3,3.1415926b0,foo]] (%i11) printfile ("ndata4.dat")$ 2.0; -3/7; (x:1,y:2,x+y); block([fpprec:24],bfloat(%pi)); "my error" (%i12) read_data ("ndata4.dat",";"); (%o12) [[2.0,-3/7,(x:1,y:2,y+x),block([fpprec:24],bfloat(%pi)),"my error"]] (%i13) ev(%); (%o13) [[2.0,-3/7,3,3.1415926b0,"my error"]] (%i14) printfile ("ndata5.dat")$ 1 0 2 -1/3 3 -1/2 4 -3/5 5 -2/3 (%i15) read_data ("ndata5.dat"); (%o15) [[1,0], [2,-1/3], [3,-1/2], [4,-3/5], [5,-2/3]] (%i16) printfile ("ndata6.dat")$ 1, 2/3, 3.4, 2.3e9, "file ndata6.dat" "line two" , -3/4 , 6 , -4.8e-7 , 5.5 7/13, "hi there", 8, 3.3e4, -7.3 4,-3/9,"Jkl", 44.6, 9.9e-6 (%i17) read_data("ndata6.dat",","); (%o17) [[1,2/3,3.4,2.3E+9,"file ndata6.dat"], ["line two",-3/4,6,-4.8E-7,5.5], [7/13,"hi there",8,33000.0,-7.3], [4,-1/3,"Jkl",44.6,9.9E-6]] (%i18) fundef (read_data); (%o18) read_data ([%v]) := block ([%s,%r,%l,%filename,%dsep,%mult:true, %mix:false], %filename:part(%v,1), if not stringp(%filename) then (disp(" file name must be a Maxima string "), return(false)), if not file_search(%filename) then (disp(" file not found "),return(false)), if length(%v) = 1 then %mix:true else (if length(%v) = 2 then %dsep:part(%v,2) else (%dsep:part(%v,2),%mult:part(%v,3))), %s:openr(%filename),%r:[], while (%l:readline(%s)) # false do if %mix then %r:cons( map(parse_string, split(ssubst(" ",",",%l))),%r) else %r:cons( map(parse_string,split(%l,%dsep,%mult)), %r), close(%s),reverse(%r)) ------------------------------------------------- Ted Woollett From maxima at etherjones.us Sat May 28 15:49:15 2011 From: maxima at etherjones.us (Ether Jones) Date: Sat, 28 May 2011 13:49:15 -0700 (PDT) Subject: [Maxima] assignment operator and function definition Message-ID: <776460.60793.qm@web161809.mail.bf1.yahoo.com> I'm still struggling to understand how to use the assignment operator ":" properly. Why does the following not give y(x) := x^2 + x - 1 ? Maxima 5.22.1 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) kill(all); ex1: x^2; ex2: x -1; y(x):=ex1+ex2; (%o0) done (%i1) 2 (%o1) x (%i2) (%o2) x - 1 (%i3) (%o3) y(x) := ex1 + ex2 (%i4) From woollett at charter.net Sat May 28 15:49:46 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 28 May 2011 13:49:46 -0700 Subject: [Maxima] write_data with separator_flag = space? Message-ID: <683D28DBB90A47F5A6FA77AC80DD25C9@edwinc367e16bd> On May 28, Robert Dodier wrote: -------------------------------------------------- Ted, the problem is that there is a variable in the stringproc package (which you must have loaded, I guess) named "space". Try write_data(, 'space) (i.e. quote the variable). -------------------------------------------- Thanks for the cure. However, it seems to me that the stringproc package is loaded as part of the core, since when I use space with print, there is no change to the items in the list functions. ----------------------------------------------- Maxima 5.24.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. 2011-05-28 (%i1) display2d:false$ (%i2) functions; (%o2) [] (%i3) print(space); (%o3) " " (%i4) functions; (%o4) [] ----------------- The help manual listing for 'space' seems to infer it is a global string, since the links are 'Global variables' plus ' Package stringproc'. Ted From robert.dodier at gmail.com Sat May 28 16:10:31 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 28 May 2011 15:10:31 -0600 Subject: [Maxima] assignment operator and function definition In-Reply-To: <776460.60793.qm@web161809.mail.bf1.yahoo.com> References: <776460.60793.qm@web161809.mail.bf1.yahoo.com> Message-ID: The body of a named function definition is not evaluated; it is not even simplified. Same goes for the body of a lambda expression. define(f(x), FOO) evaluates FOO and makes that the body of f. Or f(x) := ''(FOO) evaluates FOO and pastes that into the place of ''(FOO). Note that '' is processed only the first time it is parsed. So if you want to evaluate the function body in a script, use define. HTH, Robert Dodier On 5/28/11, Ether Jones wrote: > > I'm still struggling to understand how to use the assignment operator ":" > properly. > > Why does the following not give y(x) := x^2 + x - 1 ? > > Maxima 5.22.1 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) > kill(all); > ex1: x^2; > ex2: x -1; > y(x):=ex1+ex2; > > (%o0) done > (%i1) > 2 > (%o1) x > (%i2) > (%o2) x - 1 > (%i3) > (%o3) y(x) := ex1 + ex2 > (%i4) > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From maxima at etherjones.us Sat May 28 17:25:05 2011 From: maxima at etherjones.us (Ether Jones) Date: Sat, 28 May 2011 15:25:05 -0700 (PDT) Subject: [Maxima] minpack_lsquares Message-ID: <241901.89076.qm@web161806.mail.bf1.yahoo.com> Hello. See attached screenshot (PNG file). Am I doing something wrong, or is it just too complex for Maxima? I know the answer should be [0.5, 0.3, 0.4] Thank you. -------------- next part -------------- A non-text attachment was scrubbed... Name: lsquares.png Type: image/png Size: 20442 bytes Desc: not available URL: From maxima at etherjones.us Sat May 28 17:34:45 2011 From: maxima at etherjones.us (Ether Jones) Date: Sat, 28 May 2011 15:34:45 -0700 (PDT) Subject: [Maxima] minpack_lsquares In-Reply-To: <241901.89076.qm@web161806.mail.bf1.yahoo.com> Message-ID: <776090.57362.qm@web161815.mail.bf1.yahoo.com> Here's the complete script: kill(all)$ L: 30$ W:24$ s1: 0.66146087960253$ s2: 0.96813559654012$ s3: 0.74997966956141$ s4: 0.25042656950073$ a1: 1.183014673400058$ a2: 0.6847789579122$ a3: -0.016464555187806$ a4: -0.049325965088199$ R: sqrt(L^2+W^2)$ Lr: L/R$ Wr: W/R$ FWD: Y$ STR: X$ RCW: Z$ A: STR-RCW*(Lr)$ B: STR+RCW*(Lr)$ C: FWD-RCW*(Wr)$ D: FWD+RCW*(Wr)$ s1f: sqrt(B^2+C^2)$ s2f: sqrt(B^2+D^2)$ s3f: sqrt(A^2+D^2)$ s4f: sqrt(A^2+C^2)$ a1f: atan2(B,C)$ a2f: atan2(B,D)$ a3f: atan2(A,D)$ a4f: atan2(A,C)$ f1: define(s1(FWD,STR,RCW),s1f-s1); f2: define(s2(FWD,STR,RCW),s2f-s2); f3: define(s3(FWD,STR,RCW),s3f-s3); f4: define(s4(FWD,STR,RCW),s4f-s4); f5: define(a1(FWD,STR,RCW),a1f-a1); f6: define(a2(FWD,STR,RCW),a2f-a2); f7: define(a3(FWD,STR,RCW),a3f-a3); f8: define(a4(FWD,STR,RCW),a4f-a4); function_list: [f1,f2,f3,f4,f5,f6,f7,f8]; minpack_lsquares(function_list,[FWD,STR,RCW],[0.5,0.5,0.5]); --- On Sat, 5/28/11, Ether Jones wrote: > From: Ether Jones > Subject: [Maxima] minpack_lsquares > To: "maxima mailing list" > Date: Saturday, May 28, 2011, 6:25 PM > > Hello. > > See attached screenshot (PNG file). > > Am I doing something wrong, or is it just too complex for > Maxima? > > I know the answer should be [0.5, 0.3, 0.4] > > Thank you. > > > -----Inline Attachment Follows----- > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From pinkisntwell at gmail.com Sat May 28 17:46:17 2011 From: pinkisntwell at gmail.com (George) Date: Sun, 29 May 2011 01:46:17 +0300 Subject: [Maxima] "Wrong usage" error message when trying to plot with plot3d or contour_plot In-Reply-To: References: <4DE0AF54.5030000@gmx.de> Message-ID: On Sat, May 28, 2011 at 8:13 PM, Robert Dodier wrote: > Thanks for the info, Andre. George, you'll have to install maxima-src > in order to get plot.lisp (and the rest of the source code). Indeed, I followed Andre's instructions and I was able to get my plot. Thanks Andre. From maxima at etherjones.us Sat May 28 18:04:21 2011 From: maxima at etherjones.us (Ether Jones) Date: Sat, 28 May 2011 16:04:21 -0700 (PDT) Subject: [Maxima] minpack_lsquares Message-ID: <49937.47750.qm@web161810.mail.bf1.yahoo.com> This wasn't documented in the "help" file, and wasn't shown in the example code for minpack_lsquares: I had to add load("minpack")$ But when I did that, I got an error message which I do not understand. PNG screenshot attached. --- On Sat, 5/28/11, Ether Jones wrote: > From: Ether Jones > Subject: Re: [Maxima] minpack_lsquares > To: "maxima mailing list" > Date: Saturday, May 28, 2011, 6:34 PM > > Here's the complete script: > > kill(all)$ > > L: 30$ W:24$ > > s1: 0.66146087960253$ > s2: 0.96813559654012$ > s3: 0.74997966956141$ > s4: 0.25042656950073$ > > a1: 1.183014673400058$ > a2: 0.6847789579122$ > a3: -0.016464555187806$ > a4: -0.049325965088199$ > > R: sqrt(L^2+W^2)$ > Lr: L/R$? Wr: W/R$ > > FWD: Y$? STR: X$? RCW: Z$ > A: STR-RCW*(Lr)$ > B: STR+RCW*(Lr)$ > C: FWD-RCW*(Wr)$ > D: FWD+RCW*(Wr)$ > > s1f: sqrt(B^2+C^2)$ > s2f: sqrt(B^2+D^2)$ > s3f: sqrt(A^2+D^2)$ > s4f: sqrt(A^2+C^2)$ > a1f: atan2(B,C)$ > a2f: atan2(B,D)$ > a3f: atan2(A,D)$ > a4f: atan2(A,C)$ > > f1: define(s1(FWD,STR,RCW),s1f-s1); > f2: define(s2(FWD,STR,RCW),s2f-s2); > f3: define(s3(FWD,STR,RCW),s3f-s3); > f4: define(s4(FWD,STR,RCW),s4f-s4); > f5: define(a1(FWD,STR,RCW),a1f-a1); > f6: define(a2(FWD,STR,RCW),a2f-a2); > f7: define(a3(FWD,STR,RCW),a3f-a3); > f8: define(a4(FWD,STR,RCW),a4f-a4); > > function_list: [f1,f2,f3,f4,f5,f6,f7,f8]; > > minpack_lsquares(function_list,[FWD,STR,RCW],[0.5,0.5,0.5]); > > > > --- On Sat, 5/28/11, Ether Jones > wrote: > > > From: Ether Jones > > Subject: [Maxima] minpack_lsquares > > To: "maxima mailing list" > > Date: Saturday, May 28, 2011, 6:25 PM > > > > Hello. > > > > See attached screenshot (PNG file). > > > > Am I doing something wrong, or is it just too complex > for > > Maxima? > > > > I know the answer should be [0.5, 0.3, 0.4] > > > > Thank you. > > > > > > -----Inline Attachment Follows----- > > > > _______________________________________________ > > 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 -------------- A non-text attachment was scrubbed... Name: minpack_error.png Type: image/png Size: 22570 bytes Desc: not available URL: From maxima at etherjones.us Sat May 28 18:19:13 2011 From: maxima at etherjones.us (Ether Jones) Date: Sat, 28 May 2011 16:19:13 -0700 (PDT) Subject: [Maxima] minpack_lsquares In-Reply-To: <49937.47750.qm@web161810.mail.bf1.yahoo.com> Message-ID: <764024.10487.qm@web161811.mail.bf1.yahoo.com> Here's the macro: ----------------begin xmaxima macro-------------------- kill(all)$ load("minpack")$ minpack_lsquares( [ s1(Y,X,Z):=sqrt(((5*Z)/sqrt(41)+X)^2+(Y-(4*Z)/sqrt(41))^2)-0.66146087960253, s2(Y,X,Z):=sqrt(((5*Z)/sqrt(41)+X)^2+((4*Z)/sqrt(41)+Y)^2)-0.96813559654012, s3(Y,X,Z):=sqrt(((4*Z)/sqrt(41)+Y)^2+(X-(5*Z)/sqrt(41))^2)-0.74997966956141, s4(Y,X,Z):=sqrt((Y-(4*Z)/sqrt(41))^2+(X-(5*Z)/sqrt(41))^2)-0.25042656950073, a1(Y,X,Z):=atan2((5*Z)/sqrt(41)+X,Y-(4*Z)/sqrt(41))-1.183014673400058, a2(Y,X,Z):=atan2((5*Z)/sqrt(41)+X,(4*Z)/sqrt(41)+Y)-0.6847789579122, a3(Y,X,Z):=0.016464555187806-atan2((5*Z)/sqrt(41)-X,(4*Z)/sqrt(41)+Y), a4(Y,X,Z):=0.049325965088199-atan2((5*Z)/sqrt(41)-X,Y-(4*Z)/sqrt(41)) ], [Y,X,Z], [0.5,0.5,0.5], jacobian=false ); ---------------end xmaxima macro------------------------- Here's the xmaxima output: --------------begin xmaxima output--------------------- Maxima 5.24.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) read and interpret file: #pE:/My Documents/Maxima/minpack DNW.mac (%i2) kill(all) (%i1) load(minpack) Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/minpack-package.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/minpack-package.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/dpmpar.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/dpmpar.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/enorm.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/enorm.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/fdjac1.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/fdjac1.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/fdjac2.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/fdjac2.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/qrsolv.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/qrsolv.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/lmpar.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/lmpar.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/qrfac.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/qrfac.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/lmdif.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/lmdif.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/lmdif1.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/lmdif1.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/lmder.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/lmder.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/lmder1.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/lmder1.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/dogleg.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/dogleg.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/qform.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/qform.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/r1mpyq.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/r1mpyq.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/r1updt.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/r1updt.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/hybrd.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/hybrd.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/hybrd1.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/hybrd1.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/hybrj.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/hybrj.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/hybrj1.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/hybrj1.o Loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/minpack-interface.o Finished loading C:/Documents and Settings/us47temp/maxima/binary/binary-gcl/share/minpack/minpack-interface.o (%i2) minpack_lsquares([s1(Y, X, Z) := 4 Z 2 5 Z 2 sqrt((Y - --------) + (X + --------) ) - 0.66146087960253, sqrt(41) sqrt(41) 4 Z 2 5 Z 2 s2(Y, X, Z) := sqrt((Y + --------) + (X + --------) ) - 0.96813559654012, sqrt(41) sqrt(41) 5 Z 2 4 Z 2 s3(Y, X, Z) := sqrt((X - --------) + (Y + --------) ) - 0.74997966956141, sqrt(41) sqrt(41) 5 Z 2 4 Z 2 s4(Y, X, Z) := sqrt((X - --------) + (Y - --------) ) - 0.25042656950073, sqrt(41) sqrt(41) 5 Z 4 Z a1(Y, X, Z) := atan2(X + --------, Y - --------) - 1.183014673400058, sqrt(41) sqrt(41) 5 Z 4 Z a2(Y, X, Z) := atan2(X + --------, Y + --------) - 0.6847789579122, sqrt(41) sqrt(41) 5 Z 4 Z a3(Y, X, Z) := 0.016464555187806 - atan2(-------- - X, Y + --------), sqrt(41) sqrt(41) 5 Z 4 Z a4(Y, X, Z) := 0.049325965088199 - atan2(-------- - X, Y - --------)], sqrt(41) sqrt(41) [Y, X, Z], [0.5, 0.5, 0.5], jacobian = false) Maxima encountered a Lisp error: Error in FUNCALL [or a callee]: ((%REALPART SIMP) ((MDEFINE SIMP) (($S1 (2 "E:/My Documents/Maxima/minpack DNW.mac" SRC $A4 9)) |$y| |$x| |$z|) ((MPLUS SIMP) -0.66146087960252997 ((MEXPT SIMP) ((MPLUS SIMP) ((MEXPT SIMP) ((MPLUS SIMP) |$y| ((MTIMES SIMP) -0.62469504755442429 |$z|)) 2) ((MEXPT SIMP) ((MPLUS SIMP) |$x| ((MTIMES SIMP) 0.78086880944303039 |$z|)) 2)) ((RAT SIMP) 1 2))))) is not of type (OR RATIONAL LISP:FLOAT). Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i4) ---------------end xmaxima output---------------------- Is this a bug, or am I doing something wrong? From l.couraud at gmail.com Sat May 28 18:22:15 2011 From: l.couraud at gmail.com (laurent couraud) Date: Sun, 29 May 2011 01:22:15 +0200 Subject: [Maxima] RE : minpack_lsquares In-Reply-To: <49937.47750.qm@web161810.mail.bf1.yahoo.com> Message-ID: Hi, The flist parameter expects a list of mathematical function/expression, not a maxima function definition. You can construct your variable function_list with the body of the functions only or use: function_list : [rhs(''f1), rhs(''f2), ... ]; best. Laurent. > -----Message d'origine----- > De?: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] De la part de > Ether Jones > Envoy??: dimanche 29 mai 2011 01:04 > ??: maxima mailing list > Objet?: Re: [Maxima] minpack_lsquares > > This wasn't documented in the "help" file, and wasn't shown in the example code for > minpack_lsquares: I had to add load("minpack")$ > > But when I did that, I got an error message which I do not understand. PNG screenshot > attached. > > > --- On Sat, 5/28/11, Ether Jones wrote: > > > From: Ether Jones > > Subject: Re: [Maxima] minpack_lsquares > > To: "maxima mailing list" > > Date: Saturday, May 28, 2011, 6:34 PM > > > > Here's the complete script: > > > > kill(all)$ > > > > L: 30$ W:24$ > > > > s1: 0.66146087960253$ > > s2: 0.96813559654012$ > > s3: 0.74997966956141$ > > s4: 0.25042656950073$ > > > > a1: 1.183014673400058$ > > a2: 0.6847789579122$ > > a3: -0.016464555187806$ > > a4: -0.049325965088199$ > > > > R: sqrt(L^2+W^2)$ > > Lr: L/R$? Wr: W/R$ > > > > FWD: Y$? STR: X$? RCW: Z$ > > A: STR-RCW*(Lr)$ > > B: STR+RCW*(Lr)$ > > C: FWD-RCW*(Wr)$ > > D: FWD+RCW*(Wr)$ > > > > s1f: sqrt(B^2+C^2)$ > > s2f: sqrt(B^2+D^2)$ > > s3f: sqrt(A^2+D^2)$ > > s4f: sqrt(A^2+C^2)$ > > a1f: atan2(B,C)$ > > a2f: atan2(B,D)$ > > a3f: atan2(A,D)$ > > a4f: atan2(A,C)$ > > > > f1: define(s1(FWD,STR,RCW),s1f-s1); > > f2: define(s2(FWD,STR,RCW),s2f-s2); > > f3: define(s3(FWD,STR,RCW),s3f-s3); > > f4: define(s4(FWD,STR,RCW),s4f-s4); > > f5: define(a1(FWD,STR,RCW),a1f-a1); > > f6: define(a2(FWD,STR,RCW),a2f-a2); > > f7: define(a3(FWD,STR,RCW),a3f-a3); > > f8: define(a4(FWD,STR,RCW),a4f-a4); > > > > function_list: [f1,f2,f3,f4,f5,f6,f7,f8]; > > > > minpack_lsquares(function_list,[FWD,STR,RCW],[0.5,0.5,0.5]); > > > > > > > > --- On Sat, 5/28/11, Ether Jones > > wrote: > > > > > From: Ether Jones > > > Subject: [Maxima] minpack_lsquares > > > To: "maxima mailing list" > > > Date: Saturday, May 28, 2011, 6:25 PM > > > > > > Hello. > > > > > > See attached screenshot (PNG file). > > > > > > Am I doing something wrong, or is it just too complex > > for > > > Maxima? > > > > > > I know the answer should be [0.5, 0.3, 0.4] > > > > > > Thank you. > > > > > > > > > -----Inline Attachment Follows----- > > > > > > _______________________________________________ > > > 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 maxima at etherjones.us Sun May 29 00:20:13 2011 From: maxima at etherjones.us (Ether Jones) Date: Sat, 28 May 2011 22:20:13 -0700 (PDT) Subject: [Maxima] RE : minpack_lsquares In-Reply-To: Message-ID: <649600.28599.qm@web161814.mail.bf1.yahoo.com> Thank you. That worked !! --- On Sat, 5/28/11, laurent couraud wrote: > From: laurent couraud > Subject: RE : [Maxima] minpack_lsquares > To: maxima at etherjones.us, "'maxima mailing list'" > Date: Saturday, May 28, 2011, 7:22 PM > Hi, > > The flist parameter expects a list of mathematical > function/expression, not a maxima function > definition. > You can construct your variable function_list with the body > of the functions only or use: > function_list : [rhs(''f1), rhs(''f2), ... ]; > > best. > > Laurent. > > > > -----Message d'origine----- > > De?: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] > De la part de > > Ether Jones > > Envoy??: dimanche 29 mai 2011 01:04 > > ??: maxima mailing list > > Objet?: Re: [Maxima] minpack_lsquares > > > > This wasn't documented in the "help" file, and wasn't > shown in the example code for > > minpack_lsquares: I had to add load("minpack")$ > > > > But when I did that, I got an error message which I do > not understand.? PNG screenshot > > attached. > > > > > > --- On Sat, 5/28/11, Ether Jones > wrote: > > > > > From: Ether Jones > > > Subject: Re: [Maxima] minpack_lsquares > > > To: "maxima mailing list" > > > Date: Saturday, May 28, 2011, 6:34 PM > > > > > > Here's the complete script: > > > > > > kill(all)$ > > > > > > L: 30$ W:24$ > > > > > > s1: 0.66146087960253$ > > > s2: 0.96813559654012$ > > > s3: 0.74997966956141$ > > > s4: 0.25042656950073$ > > > > > > a1: 1.183014673400058$ > > > a2: 0.6847789579122$ > > > a3: -0.016464555187806$ > > > a4: -0.049325965088199$ > > > > > > R: sqrt(L^2+W^2)$ > > > Lr: L/R$? Wr: W/R$ > > > > > > FWD: Y$? STR: X$? RCW: Z$ > > > A: STR-RCW*(Lr)$ > > > B: STR+RCW*(Lr)$ > > > C: FWD-RCW*(Wr)$ > > > D: FWD+RCW*(Wr)$ > > > > > > s1f: sqrt(B^2+C^2)$ > > > s2f: sqrt(B^2+D^2)$ > > > s3f: sqrt(A^2+D^2)$ > > > s4f: sqrt(A^2+C^2)$ > > > a1f: atan2(B,C)$ > > > a2f: atan2(B,D)$ > > > a3f: atan2(A,D)$ > > > a4f: atan2(A,C)$ > > > > > > f1: define(s1(FWD,STR,RCW),s1f-s1); > > > f2: define(s2(FWD,STR,RCW),s2f-s2); > > > f3: define(s3(FWD,STR,RCW),s3f-s3); > > > f4: define(s4(FWD,STR,RCW),s4f-s4); > > > f5: define(a1(FWD,STR,RCW),a1f-a1); > > > f6: define(a2(FWD,STR,RCW),a2f-a2); > > > f7: define(a3(FWD,STR,RCW),a3f-a3); > > > f8: define(a4(FWD,STR,RCW),a4f-a4); > > > > > > function_list: [f1,f2,f3,f4,f5,f6,f7,f8]; > > > > > > > minpack_lsquares(function_list,[FWD,STR,RCW],[0.5,0.5,0.5]); > > > > > > > > > > > > --- On Sat, 5/28/11, Ether Jones > > > wrote: > > > > > > > From: Ether Jones > > > > Subject: [Maxima] minpack_lsquares > > > > To: "maxima mailing list" > > > > Date: Saturday, May 28, 2011, 6:25 PM > > > > > > > > Hello. > > > > > > > > See attached screenshot (PNG file). > > > > > > > > Am I doing something wrong, or is it just > too complex > > > for > > > > Maxima? > > > > > > > > I know the answer should be [0.5, 0.3, 0.4] > > > > > > > > Thank you. > > > > > > > > > > > > -----Inline Attachment Follows----- > > > > > > > > > _______________________________________________ > > > > 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 biomates at telefonica.net Sun May 29 04:22:20 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 29 May 2011 11:22:20 +0200 Subject: [Maxima] finer mesh implicit in draw3d? In-Reply-To: <4DE104B6.1060100@math.msu.edu> References: <4DDFB2D9.70501@math.msu.edu> <4DE104B6.1060100@math.msu.edu> Message-ID: <1306660940.1492.7.camel@pc> El s?b, 28-05-2011 a las 10:20 -0400, Sheldon Newhouse escribi?: > OK, got it. The x_voxel, y_voxel, or z_voxel needs to be increased and > written BEFORE the implicit call. Yes, it must be written before, since options and objects are read sequentialy. This way, you can plot several implicit objects with different voxel settings in the same scene. ?_voxel are local options, not globals. -- Mario From pbowyer at olynet.com Sun May 29 11:26:31 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sun, 29 May 2011 09:26:31 -0700 Subject: [Maxima] Universal read_data function In-Reply-To: References: Message-ID: <4DE273B7.4060509@olynet.com> On 05/28/2011 01:31 PM, Edwin Woollett wrote: > On May 27, Volker van Nek wrote: > --------------------------------------- > If you want to read general Maxima expressions > containing blanks and commas it makes sense > to me to use the default ";" or "$" as separators. > E.g. > > (%i1) string: "(x:1,y:2,x+y); block([fpprec:24],bfloat(%pi)); foo;"$ > > (%i2) strings: split(string,";"); > (%o2) [(x:1,y:2,x+y), block([fpprec:24],bfloat(%pi)), foo] > > (%i3) map(parse_string, strings); > (%o3) [(x : 1, y : 2, y + x), block([fpprec : 24], bfloat(%pi)), foo] > > (%i4) ''%; > (%o4) [3, 3.14159265358979323846264b0, foo] > ---------------------------------------------------------- > Thanks for the great suggestion. > Having a read_data function which allows the > user to pass on to split any desired data > separator string makes a lot of sense. > > My new (and improved?) version of read_data > has the syntax: > > read_data (filename, data-sep-string, mult). > > Using the minimal form: read_data(filename) assumes an arbitrary > mixture of commas > and space data separators, convenient for > many applications, but will not allow > string data items containing spaces, since > the default simple version converts all > commas to spaces. > > Using read_data (filename, ",") > or read_data (filename, ";") > assumes all data items are using the > same data separators as indicated. > > The code sets the third optional > arg to true , but can be set to false > for use by split. > > --------------------------------- > Maxima 5.24.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. > 2011-05-28 > > > (%i1) (display2d:false,fpprintprec:8)$ > (%i2) load(readwrite); > (%o2) "c:/work2/readwrite.mac" > > (%i3) printfile ("ndata1.dat")$ > 2.3e9 "Abc" > > (%i4) read_data ("ndata1.dat"); > (%o4) [[2.3E+9,"Abc"]] > (%i5) read_data ("ndata1.dat"," "); > (%o5) [[2.3E+9,"Abc"]] > > (%i6) printfile ("ndata2.dat")$ > 2 , 4.8, -3/4, "xyz", -2.8e-9 > > 3 22.2 7/8 "abc" 4.4e10 > > (%i7) read_data ("ndata2.dat"); > (%o7) [[2,4.8,-3/4,"xyz",-2.8E-9],[3,22.2,7/8,"abc",4.4E+10]] > > (%i8) printfile ("ndata3.dat")$ > 2.0; -3/7; (x:1,y:2,x+y); block([fpprec:24],bfloat(%pi)); foo > > (%i9) read_data ("ndata3.dat",";"); > (%o9) [[2.0,-3/7,(x:1,y:2,y+x),block([fpprec:24],bfloat(%pi)),foo]] > (%i10) ev(%); > (%o10) [[2.0,-3/7,3,3.1415926b0,foo]] > > (%i11) printfile ("ndata4.dat")$ > 2.0; -3/7; (x:1,y:2,x+y); block([fpprec:24],bfloat(%pi)); "my error" > > (%i12) read_data ("ndata4.dat",";"); > (%o12) [[2.0,-3/7,(x:1,y:2,y+x),block([fpprec:24],bfloat(%pi)),"my > error"]] > (%i13) ev(%); > (%o13) [[2.0,-3/7,3,3.1415926b0,"my error"]] > > (%i14) printfile ("ndata5.dat")$ > 1 0 > > 2 -1/3 > > 3 -1/2 > > 4 -3/5 > > 5 -2/3 > (%i15) read_data ("ndata5.dat"); > (%o15) [[1,0], [2,-1/3], [3,-1/2], [4,-3/5], [5,-2/3]] > > (%i16) printfile ("ndata6.dat")$ > 1, 2/3, 3.4, 2.3e9, "file ndata6.dat" > > "line two" , -3/4 , 6 , -4.8e-7 , 5.5 > > 7/13, "hi there", 8, 3.3e4, -7.3 > > 4,-3/9,"Jkl", 44.6, 9.9e-6 > > (%i17) read_data("ndata6.dat",","); > (%o17) [[1,2/3,3.4,2.3E+9,"file ndata6.dat"], > ["line two",-3/4,6,-4.8E-7,5.5], > [7/13,"hi there",8,33000.0,-7.3], > [4,-1/3,"Jkl",44.6,9.9E-6]] > (%i18) fundef (read_data); > > (%o18) read_data ([%v]) := block > ([%s,%r,%l,%filename,%dsep,%mult:true, > %mix:false], > %filename:part(%v,1), > if not stringp(%filename) > then (disp(" file name must be a Maxima string "), > return(false)), > if not file_search(%filename) > then (disp(" file not found "),return(false)), > > if length(%v) = 1 then %mix:true > else (if length(%v) = 2 then %dsep:part(%v,2) > else (%dsep:part(%v,2),%mult:part(%v,3))), > > %s:openr(%filename),%r:[], > while (%l:readline(%s)) # false do > if %mix > then %r:cons( > map(parse_string, > split(ssubst(" ",",",%l))),%r) > else %r:cons( > > map(parse_string,split(%l,%dsep,%mult)), > %r), > close(%s),reverse(%r)) > > ------------------------------------------------- > > Ted Woollett > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Hi Ted: I tried your latest Universal read_data function on the same file I used with the one I last presented and it chokes no matter what separator I use. This is what I think your function is (in case I copied it incorrectly): read_data ([%v]) := block( [%s,%r,%l,%filename,%dsep,%mult:true,%mix:false], %filename:part(%v,1), if not stringp(%filename) then ( disp(" file name must be a Maxima string "), return(false) ), if not file_search(%filename) then ( disp(" file not found "), return(false) ), if length(%v) = 1 then %mix:true else ( if length(%v) = 2 then %dsep:part(%v,2) else ( %dsep:part(%v,2), %mult:part(%v,3) ) ), %s:openr(%filename), %r:[], while (%l:readline(%s)) # false do if %mix then %r:cons(map(parse_string, split(ssubst(" ",",",%l))),%r) else %r:cons(map(parse_string,split(%l,%dsep,%mult)),%r), close(%s), reverse(%r) ); My data file (with embedded CRs, LFs, and spaces, which probably don't show up in this message, but I can attach it if necessary): 2.3e9 "Abc" 10.3 14.4 read_data1(%filename):=block([%s,%r],if notfile_search(%filename) then (disp(" file not found "),return(false)) ,%s:openr(%filename),%r:[],while (l:readline(%s))#false do %r:cons(map(parse_string,split(l)),%r),reverse(%r)) 12.6 14.5 If I use a space separator I get: stdin:2:incorrect syntax: Premature termination of input at $. If I use a "," or ";" separator I get: stdin:11:incorrect syntax: Abc is not an infix operator Maybe I'm making the data file more complex than it should be, but if you're calling it a universal read data function, It should be bullet proof. Paul From willisb at unk.edu Sun May 29 13:45:14 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 29 May 2011 13:45:14 -0500 Subject: [Maxima] red vs spmod In-Reply-To: References: <4DE0AF54.5030000@gmx.de> , Message-ID: Setting red as the default gcd, the testsuite reports 206 errors. Initially, these are quotient by zero errors, but eventually, the errors are "context: too many contexts." In a fresh Maxima, some (all?) of the tests that give a "too many contexts" error run OK with gcd : red. A quotient by zero bug is (Maxima 5.24 has this defect too) (rtest16, test 158) (%i5) integrate((sqrt(2-2*x^2) * (sqrt(2) + sqrt(2) * x^2))/(4-4*x^2),x,0,1), gcd : red; `quotient' by `zero' -- an error. To debug this try: debugmode(true); --Barton From woollett at charter.net Sun May 29 14:53:08 2011 From: woollett at charter.net (Edwin Woollett) Date: Sun, 29 May 2011 12:53:08 -0700 Subject: [Maxima] Universal read_data function Message-ID: On May 28, 2011, Paul Bowyer wrote: ------------------------------------------------- My data file (with embedded CRs, LFs, and spaces, which probably don't show up in this message, but I can attach it if necessary): 2.3e9 "Abc" 10.3 14.4 read_data1(%filename):=block([%s,%r],if notfile_search(%filename) then (disp(" file not found "),return(false)) ,%s:openr(%filename),%r:[],while (l:readline(%s))#false do %r:cons(map(parse_string,split(l)),%r),reverse(%r)) 12.6 14.5 ---------------------------------- Thanks for the good example of a complicated data file. I am going to assume you want all of the function definition as one separate data item, so make sure it is all on one line. (ie, look at the hidden end of line chars to make sure it is all on one line (for example with notepad2).) See my example ndata8.dat below. To include cases in which you want whole lines treated as one data item, regardless of the space, commas,etc, I have included an optional fourth arg in read_data, to be used in such an eventuality. Thus the most complicated syntax might look like: read_data ("ndata10.dat", ";" , true, [2,3,11] ) meaning treat lines 2,3,and 11 as single data items, and for the other lines use ";" as the data item separator. ------------------------------------------------------------ Maxima 5.24.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. 2011-05-29 (%i1) (display2d:false,fpprintprec:8)$ (%i2) load(readwrite); (%o2) "c:/work2/readwrite.mac" (%i3) printfile ("ndata2.dat")$ 2 , 4.8, -3/4, "xyz", -2.8e-9 3 22.2 7/8 "abc" 4.4e10 (%i4) read_data ("ndata2.dat"); (%o4) [[2,4.8,-3/4,"xyz",-2.8E-9],[3,22.2,7/8,"abc",4.4E+10]] (%i5) printfile ("ndata3.dat")$ 2.0; -3/7; (x:1,y:2,x+y); block([fpprec:24],bfloat(%pi)); foo (%i6) read_data ("ndata3.dat",";"); (%o6) [[2.0,-3/7,(x:1,y:2,y+x),block([fpprec:24],bfloat(%pi)),foo]] (%i7) printfile ("ndata5.dat")$ 1 0 2 -1/3 3 -1/2 4 -3/5 5 -2/3 (%i8) read_data ("ndata5.dat"); (%o8) [[1,0],[2,-1/3],[3,-1/2],[4,-3/5],[5,-2/3]] (%i9) printfile ("ndata6.dat")$ 1, 2/3, 3.4, 2.3e9, "file ndata6.dat" "line two" , -3/4 , 6 , -4.8e-7 , 5.5 7/13, "hi there", 8, 3.3e4, -7.3 4,-3/9,"Jkl", 44.6, 9.9e-6 (%i10) read_data("ndata6.dat",","); (%o10) [[1,2/3,3.4,2.3E+9,"file ndata6.dat"],["line two",-3/4,6,-4.8E-7,5.5], [7/13,"hi there",8,33000.0,-7.3],[4,-1/3,"Jkl",44.6,9.9E-6]] (%i11) printfile("ndata8.dat")$ 2.3e9 "Abc" 10.3 14.4 read_data1(%filename):=block([%s,%r],if notfile_search(%filename) then (disp(" file not found "),return(false)) ,%s:openr(%filename),%r:[],while (l:readline(%s))#false do %r:cons(map(parse_string,split(l)),%r),reverse(%r)) 12.6 14.5 (%i12) read_data ("ndata8.dat"," ",true,[4]); (%o12) [[2.3E+9,"Abc"],[10.3],[14.4], read_data1(%filename):=block([%s,%r], if notfile_search(%filename) then (disp(" file not found "),return(false)), %s:openr(%filename),%r:[], while (l:readline(%s)) # false do %r:cons(map(parse_string,split(l)),%r),reverse(%r)), [12.6],[14.5]] ------------------------------------ Needless to say, there really will never be a truly "universal" anything, including read_data, but you are always welcome to roll your own, depending on your specialized needs. Ted Woollett From woollett at charter.net Sun May 29 14:55:30 2011 From: woollett at charter.net (Edwin Woollett) Date: Sun, 29 May 2011 12:55:30 -0700 Subject: [Maxima] Universal read_data function Message-ID: I meant to include the code for the four arg version of read_data: ----------------------------------------------- read_data([%v]) := block ([%s,%r,%l,%filename,%dsep,%mult:true,%mix:false, %whole:[],%ln], %filename : part (%v,1), if not stringp (%filename) then ( disp (" file name must be a Maxima string "), return (false)), if not file_search (%filename) then (disp (" file not found "),return (false)), if length (%v) = 1 then %mix : true else if length(%v) = 2 then %dsep : part (%v,2) else if length (%v) = 3 then (%dsep : part (%v,2), %mult : part (%v,3)) else (%dsep : part (%v,2), %mult : part (%v,3),%whole : part(%v,4)), %s : openr (%filename), %r : [], %ln : 0, while (%l : readline(%s)) # false do ( %ln : %ln + 1, if not lfreeof (%whole,%ln) then %r : cons (parse_string (%l),%r) else if %mix then %r : cons (map(parse_string, split(ssubst (" ",",",%l))), %r) else %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r)), close (%s), reverse (%r))$ ----------------- ted From macrakis at alum.mit.edu Sun May 29 17:12:50 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 29 May 2011 18:12:50 -0400 Subject: [Maxima] red vs spmod In-Reply-To: References: <4DE0AF54.5030000@gmx.de> Message-ID: The gfactor I had before was unnecessary. It's enough to have ratsimp(...), gcd:'subres / 'red This is more-or-less documented under ? gcd: To take the gcd when an algebraic is present, e.g., `gcd (^2 - 2*sqrt(2)* + 2, - sqrt(2))', `algebraic' must be `true' and `gcd' must not be `ez' [ADD: or 'spmod'] I think it would be better to start with a black-box description (about algebraics) than to name the different algorithms (though that is I suppose useful for people with very large or 'difficult' cases). Examples: makelist(rat((x^2-2)/(x-sqrt(2))),gcd,'[ez,subres,red,spmod]),algebraic:true => [(x^2-2)/(x-sqrt(2)),x+sqrt(2),x+sqrt(2),(x^2-2)/(x-sqrt(2))] just like makelist(rat((x^2+1)/(x+%i)),gcd,'[ez,subres,red,spmod]),algebraic:true; => [(x^2+1)/(x+%i),x-%i,x-%i,(x^2+1)/(x+%i)] On Sat, May 28, 2011 at 13:17, Barton Willis wrote: > OK: > > (%i41) radcan(exp(((t-2*%i)*x^2)/(4*t-2*%i))), gcd : 'red; > (%o41) %e^(((t-2*%i)*x^2)/(4*t-2*%i)) > > OK (I think) but messy: > > (%i42) radcan(exp(((t-2*%i)*x^2)/(4*t-2*%i))), gcd : 'spmod; > (%o42) > %e^(((32*t^6-144*%i*t^5-240*t^4+200*%i*t^3+90*t^2-21*%i*t-2)*x^2)/(128*t^6-384*%i*t^5-480*t^4+320*%i*t^3+120*t^2-24*%i*t-2)) > > I wasn't able to transform (%o42) back to exp(((t-2*%i)*x^2)/(4*t-2*%i)). > > --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 pbowyer at olynet.com Sun May 29 19:34:18 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sun, 29 May 2011 17:34:18 -0700 Subject: [Maxima] Universal read_data function In-Reply-To: References: Message-ID: <4DE2E60A.7020208@olynet.com> On 05/29/2011 12:55 PM, Edwin Woollett wrote: > I meant to include the code for > the four arg version of read_data: > > ----------------------------------------------- > > read_data([%v]) := > block ([%s,%r,%l,%filename,%dsep,%mult:true,%mix:false, > %whole:[],%ln], > > %filename : part (%v,1), > > if not stringp (%filename) > then ( disp (" file name must be a Maxima string "), > return (false)), > > if not file_search (%filename) then > (disp (" file not found "),return (false)), > > if length (%v) = 1 then %mix : true > else if length(%v) = 2 then %dsep : part (%v,2) > else if length (%v) = 3 then (%dsep : part (%v,2), %mult : part > (%v,3)) > else (%dsep : part (%v,2), %mult : part (%v,3),%whole : > part(%v,4)), > > > > %s : openr (%filename), > %r : [], > %ln : 0, > > while (%l : readline(%s)) # false do > ( %ln : %ln + 1, > if not lfreeof (%whole,%ln) then > %r : cons (parse_string (%l),%r) > else if %mix then > %r : cons (map(parse_string, split(ssubst (" ",",",%l))), %r) > else %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r)), > > close (%s), > reverse (%r))$ > > ----------------- > > ted > > > > Hi Ted: I tried the above listed read_data function and it was still choking on the CRs in the data files on my Linux box. I fiddled with it slightly and this is what it looks like now: read_data([%v]) := block ( [%s,%r,%l,%filename,%dsep,%mult:true,%mix:false,%whole:[],%ln ], %filename : part (%v,1), if not stringp (%filename) then ( disp (" file name must be a Maxima string "), return (false)), if not file_search (%filename) then (disp (" file not found "),return (false)), if length (%v) = 1 then %mix : true else if length(%v) = 2 then %dsep : part (%v,2) else if length(%v) = 3 then (%dsep : part (%v,2), %mult : part (%v,3)) else (%dsep : part (%v,2), %mult : part (%v,3),%whole : part(%v,4)), %s : openr (%filename), %r : [], %ln : 0, while (%l : readline(%s)) # false do ( %ln : %ln + 1, /*Added the following two lines and the enclosing parens*/ %l : strim(" ", ssubst(" ", ascii(13), %l ) ), if %l # "" then ( if not lfreeof (%whole,%ln) then %r : cons (parse_string (%l),%r) else if %mix then %r : cons (map(parse_string, split(ssubst (" ",",",%l))), %r) else %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r) ) ), close (%s), reverse (%r)); Now it works on my Linux box, but you'll need to check it on your Windows box. I tested it against all of the data files you listed in your message where you forgot to post the code. I started to go back and modify the ?read\-char method I submitted earlier, but I soon discovered it was more work than I wanted to do to get it to automatically determine the data types it was reading. Maybe I'll play more with that another time just for fun. I was having difficulty trying to catch errors in Maxima so I could gracefully close the file and exit, but I wasn't able to do that either. Paul From maxima at etherjones.us Sun May 29 20:57:31 2011 From: maxima at etherjones.us (Ether Jones) Date: Sun, 29 May 2011 18:57:31 -0700 (PDT) Subject: [Maxima] find minimum of a function of three variables In-Reply-To: <649600.28599.qm@web161814.mail.bf1.yahoo.com> Message-ID: <273042.58197.qm@web161804.mail.bf1.yahoo.com> Hello. What is the proper way to find a local minimum for a function of three variables f(x,y,z) in maxima? I know I could take the partial with respect to each var and set the resulting 3 functions equal to zero and then use minpack_solve, but is this the best way to do it? Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxima at etherjones.us Sun May 29 21:31:23 2011 From: maxima at etherjones.us (Ether Jones) Date: Sun, 29 May 2011 19:31:23 -0700 (PDT) Subject: [Maxima] minpack_lsquares and minpack_solve Message-ID: <558137.68721.qm@web161805.mail.bf1.yahoo.com> Hello. I have 8 residual functions in 3 variables.? I was able to find a least-squares solution using minpack_lsquares. But when I tried to solve the same problem using minpack_solve it choked.? I squared each of the 8 residual functions and added them to get a single objective function.? Then I created three equations (in 3 unknowns) from that by taking the partial derivative with respect to each of the three variables and setting the result equal to zero.? minpack_solve choked on this. Here is the macro: -----------------begin macro------------------------ kill(all)$ load("minpack")$ L: 30$? W:24$ sFR: 0.66146087960253$ sFL: 0.96813559654012$ sRL: 0.74997966956141$ sRR: 0.25042656950073$ aFR: 1.183014673400058$ aFL: 0.6847789579122$ aRL: -0.016464555187806$ aRR: -0.049325965088199$ R: sqrt(L^2+W^2)$ Lr: L/R$? Wr: W/R$ RCW: omega*(R/2)$ A: STR-RCW*(Lr)$? B: STR+RCW*(Lr)$?? C: FWD-RCW*(Wr)$?? D: FWD+RCW*(Wr)$ sFR_: sqrt(B^2+C^2)$ sFL_: sqrt(B^2+D^2)$ sRL_: sqrt(A^2+D^2)$ sRR_: sqrt(A^2+C^2)$ aFR_: atan2(B,C)$ aFL_: atan2(B,D)$ aRL_: atan2(A,D)$ aRR_: atan2(A,C)$ s1: sFR_-sFR$ s2: sFL_-sFL$ s3: sRL_-sRL$ s4: sRR_-sRR$ a1: aFR_-aFR$ a2: aFL_-aFL$ a3: aRL_-aRL$ a4: aRR_-aRR$ function_list: [s1,s2,s3,s4,a1,a2,a3,a4]$ minpack_lsquares(function_list,[FWD,STR,omega],[.5,.5,.5]); obf: s1^2+s2^2+s3^2+s4^2+a1^2+a2^2+a3^2+a4^2$ eqs: [diff(obf,FWD)=0,diff(obf,STR)=0,diff(obf,omega)=0]$ minpack_solve(eqs,[FWD,STR,omega],[.5,.5,.5]); -----------------end macro-------------------------- Here is the output from maxima (notice the minpack_lsquares solution at line %o37, and the minpack_solve error following line %i40: ---------------begin maxima output------------------------- Maxima 5.24.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) read and interpret file: #pE:/My Documents/Maxima/z2.mac (%i2)????????????????????????????? kill(all) (%i1)??????????????????????????? load(minpack) [bunch of loading statements snipped here] (%i2)?????????????????????????????? L : 30 (%i3)?????????????????????????????? W : 24 (%i4)?????????????????????? sFR : 0.66146087960253 (%i5)?????????????????????? sFL : 0.96813559654012 (%i6)?????????????????????? sRL : 0.74997966956141 (%i7)?????????????????????? sRR : 0.25042656950073 (%i8)?????????????????????? aFR : 1.183014673400058 (%i9)??????????????????????? aFL : 0.6847789579122 (%i10)???????????????????? aRL : - 0.016464555187806 (%i11)???????????????????? aRR : - 0.049325965088199 ???????????????????????????????????????? 2??? 2 (%i12)???????????????????????? R : sqrt(W? + L ) ???????????????????????????????????????? L (%i13)????????????????????????????? Lr : - ???????????????????????????????????????? R ???????????????????????????????????????? W (%i14)????????????????????????????? Wr : - ???????????????????????????????????????? R ?????????????????????????????????????? omega R (%i15)?????????????????????????? RCW : ------- ????????????????????????????????????????? 2 (%i16)???????????????????????? A : STR - RCW Lr (%i17)???????????????????????? B : RCW Lr + STR (%i18)???????????????????????? C : FWD - RCW Wr (%i19)???????????????????????? D : RCW Wr + FWD ????????????????????????????????????????? 2??? 2 (%i20)?????????????????????? sFR_ : sqrt(C? + B ) ????????????????????????????????????????? 2??? 2 (%i21)?????????????????????? sFL_ : sqrt(D? + B ) ????????????????????????????????????????? 2??? 2 (%i22)?????????????????????? sRL_ : sqrt(D? + A ) ????????????????????????????????????????? 2??? 2 (%i23)?????????????????????? sRR_ : sqrt(C? + A ) (%i24)??????????????????????? aFR_ : atan2(B, C) (%i25)??????????????????????? aFL_ : atan2(B, D) (%i26)??????????????????????? aRL_ : atan2(A, D) (%i27)??????????????????????? aRR_ : atan2(A, C) (%i28)????????????????????????? s1 : sFR_ - sFR (%i29)????????????????????????? s2 : sFL_ - sFL (%i30)????????????????????????? s3 : sRL_ - sRL (%i31)????????????????????????? s4 : sRR_ - sRR (%i32)????????????????????????? a1 : aFR_ - aFR (%i33)????????????????????????? a2 : aFL_ - aFL (%i34)????????????????????????? a3 : aRL_ - aRL (%i35)????????????????????????? a4 : aRR_ - aRR (%i36)???????? function_list : [s1, s2, s3, s4, a1, a2, a3, a4] (%i37) minpack_lsquares(function_list, [FWD, STR, omega], [0.5, 0.5, 0.5]) (%o37)??? [[0.5, 0.3, 0.020823168251814], 3.6871652560846944E-15, 2] ????????????????????? 2???? 2???? 2???? 2???? 2???? 2???? 2???? 2 (%i38)??????? obf : a4? + a3? + a2? + a1? + s4? + s3? + s2? + s1 (%i39) eqs : [diff(obf, FWD) = 0, diff(obf, STR) = 0, diff(obf, omega) = 0] (%i40)????? minpack_solve(eqs, [FWD, STR, omega], [0.5, 0.5, 0.5]) Maxima encountered a Lisp error: ?Error in FUNCALL [or a callee]: ((MEQUAL SIMP) 2.1084356996122464 0.0) is not of type (OR ??????????????????????????????????????????????????????????????????????????????????????? RATIONAL ??????????????????????????????????????????????????????????????????????????????????????? LISP:FLOAT). Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i42) ---------------------end maxima output---------------------------- From maxima at etherjones.us Mon May 30 07:40:34 2011 From: maxima at etherjones.us (Ether Jones) Date: Mon, 30 May 2011 05:40:34 -0700 (PDT) Subject: [Maxima] minpack_solve documentation error Message-ID: <300034.44316.qm@web161815.mail.bf1.yahoo.com> The maxima documentation for minpack_solve (see below) says that flist should be a list of equations.?? Using equations doesn't work, they have to be expressions.?? See attached screenshot. Function: minpack_solve (flist, varlist, guess [, tolerance, jacobian]) Solve a system of n equations in n unknowns. The n equations are given in the list flist, and the unknowns are in varlist. An initial guess of the solution must be provided in guess. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: minpack_solve.png Type: image/png Size: 10986 bytes Desc: not available URL: From macrakis at alum.mit.edu Mon May 30 11:35:07 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 30 May 2011 12:35:07 -0400 Subject: [Maxima] radcan() simplification error. In-Reply-To: <201105302020.18386.cfrangos@telkomsa.net> References: <201105252318.01073.cfrangos@telkomsa.net> <201105302020.18386.cfrangos@telkomsa.net> Message-ID: Costa, 1) No, there is no complete and up-to-date catalog of the simplifications Maxima performs. Reading the code will of course show you everything it's doing, but that's not really practical, as most of the code is about efficient implementation of mathematically simple things (e.g. 3*x + 4*y + 2*x --> 5*x + 4*y). 2) As I understand it, different GCD algorithm implementations are better in different cases, e.g. univariate, high-degree dense, high-degree sparse, homogeneous, etc. Some of them also appear to have bugs. You might want to review the archives of this mailing list for discussion of this. Please note that the gcd and algebraic settings *only* affect the Rational Function package (rat, radcan, ratsimp, etc.) and *not* the general simplifier, which does not perform GCDs. -s On Mon, May 30, 2011 at 14:20, Constantine Frangos wrote: > > Dear Stavro, > > Thanks for the fast and detailed response. Any assistance with the > following would be > appreciated: > > (1) Is it possible to print out a list of the types of simplifications > performed by the general > simplifier ? > > (2) Up to now I have used the settings: algebraic : true; gcd : 'spmod; and > then applied > the Maxima built-in simplification functions to expressions, etc. > Based on your recent posting regarding 'red and 'spmod, it seems that I > should be using > gcd : 'red; OR gcd : 'subres; in order to obtain better simplifications. Is > this correct ? > > Thanks very much. > Kind regards, > Constantine Frangos. > > > On Wednesday 25 May 2011 07:55:56 pm you wrote: > > I haven't looked at your example in detail, but I suspect that your > question > > relates to the treatment of things like expr: sqrt(x^2-2*x+1). > radcan(expr) > > => x-1, where you might expect abs(x-1), as returned by > > scanmap(factor,expr). This radcan behavior is intentional, on the theory > > that either branch of the root is correct. > > > > Why, then, does radcan(sqrt(x^2)) return abs(x)? Because the *general > > simplifier* tries to simplify to the positive root, and so simplifies the > > expression to abs(x) before radcan even looks at it: > > > > (%i2) sqrt(x^2); > > (%o2) abs(x) > > (%i3) radcan(%); > > (%o3) abs(x) > > (%i4) sqrt(x^2-2*x+1); > > (%o4) sqrt(x^2-2*x+1) > > (%i5) radcan(%); > > (%o5) x-1 > > (%i6) scanmap(factor,%o4); > > (%o6) abs(x-1) > > (%i7) radcan(%); > > (%o7) abs(x-1) > > > > -s > > > > On Wed, May 25, 2011 at 17:18, Constantine Frangos < > cfrangos at telkomsa.net>wrote: > > > > > > > > Dear List, > > > > > > Any assistance with the following would be appreciated: > > > > > > (1) The function radcan() seems to simplify the following expression > > > correctly: > > > > > > (%i98) radcan(sqrt(a^2)/sqrt(4*%pi^2*(q0-2000)^2)); > > > > > > (%o98) abs(a)/(2*%pi*abs(q0-2000)) > > > (%i99) > > > > > > (2) However, for the following more complicated expression, radcan() > seems > > > to simplify the denominator incorrectly: > > > > > > (%i99) > > > > radcan(sqrt((sin(2*%pi*pmin*(q0-q))-sin(2*%pi*pmax*(q0-q)))^2/(4*%pi^2*(q0-q)^2)+(cos(2*%pi*pmin*(q0-q))-cos(2*%pi*pmax*(q0-q)))^2/(4*%pi^2*(q0-q)^2))); > > > > > > rat: replaced 2.0 by 2/1 = 2.0 > > > > > > rat: replaced 2.0 by 2/1 = 2.0 > > > > > > rat: replaced 2.0 by 2/1 = 2.0 > > > > > > rat: replaced 2.0 by 2/1 = 2.0 > > > > > > rat: replaced 2.0 by 2/1 = 2.0 > > > > > > rat: replaced 2.0 by 2/1 = 2.0 > > > > > > rat: replaced 2.0 by 2/1 = 2.0 > > > > > > rat: replaced 2.0 by 2/1 = 2.0 > > > (%o99) sqrt(sin(2*%pi*pmin*q0-2*%pi*pmin*q)^2 > > > -2*sin(2*%pi*pmax*q0-2*%pi*pmax*q) > > > *sin(2*%pi*pmin*q0-2*%pi*pmin*q) > > > +cos(2*%pi*pmin*q0-2*%pi*pmin*q)^2 > > > -2*cos(2*%pi*pmax*q0-2*%pi*pmax*q) > > > *cos(2*%pi*pmin*q0-2*%pi*pmin*q) > > > +sin(2*%pi*pmax*q0-2*%pi*pmax*q)^2 > > > +cos(2*%pi*pmax*q0-2*%pi*pmax*q)^2) > > > /(2*%pi*q0-2*%pi*q) > > > (%i100) > > > > > > > > > (3) On the other hand, radcan() seems to take into account some facts > > > specified by the > > > assume() statement in the example below. Do other Maxima built-in > > > simplification functions > > > take specified constraints into account ? > > > > > > (%i101) assume(q0>=2000); > > > > > > (%o101) [q0 >= 2000] > > > (%i102) radcan(sqrt(a^2)/sqrt(4*%pi^2*(q0-2000)^2)); > > > > > > (%o102) abs(a)/(2*%pi*q0-4000*%pi) > > > (%i103) > > > > > > > > > Thanks very much. > > > Constantine Frangos. > > > > > > _______________________________________________ > > > 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 Mon May 30 14:09:01 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Mon, 30 May 2011 12:09:01 -0700 Subject: [Maxima] Universal read_data function In-Reply-To: <22475D2B4C964F3281AAEEB59533D53E@edwinc367e16bd> References: <4DE2E60A.7020208@olynet.com> <22475D2B4C964F3281AAEEB59533D53E@edwinc367e16bd> Message-ID: <4DE3EB4D.6050103@olynet.com> On 05/30/2011 09:59 AM, Edwin Woollett wrote: > Hi Paul, > Please send me your data files which fail with > my code, as an attachement, so I get all the > correct end of line chars in your files. > > Ted > > ----- Original Message ----- From: Paul Bowyer To: Edwin Woollett Cc: > Maxima List Sent: Sunday, May 29, 2011 5:34 PM > Subject: Re: Universal read_data function > > > On 05/29/2011 12:55 PM, Edwin Woollett wrote: >> I meant to include the code for >> the four arg version of read_data: >> >> ----------------------------------------------- >> >> read_data([%v]) := >> block ([%s,%r,%l,%filename,%dsep,%mult:true,%mix:false, >> %whole:[],%ln], >> >> %filename : part (%v,1), >> >> if not stringp (%filename) >> then ( disp (" file name must be a Maxima string "), >> return (false)), >> >> if not file_search (%filename) then >> (disp (" file not found "),return (false)), >> >> if length (%v) = 1 then %mix : true >> else if length(%v) = 2 then %dsep : part (%v,2) >> else if length (%v) = 3 then (%dsep : part (%v,2), %mult : part >> (%v,3)) >> else (%dsep : part (%v,2), %mult : part (%v,3),%whole : >> part(%v,4)), >> >> >> >> %s : openr (%filename), >> %r : [], >> %ln : 0, >> >> while (%l : readline(%s)) # false do >> ( %ln : %ln + 1, >> if not lfreeof (%whole,%ln) then >> %r : cons (parse_string (%l),%r) >> else if %mix then >> %r : cons (map(parse_string, split(ssubst (" ",",",%l))), %r) >> else %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r)), >> >> close (%s), >> reverse (%r))$ >> >> ----------------- >> >> ted >> >> >> >> > Hi Ted: > > I tried the above listed read_data function and it was still choking > on the CRs in the data files on my Linux box. > I fiddled with it slightly and this is what it looks like now: > > read_data([%v]) := block ( > [%s,%r,%l,%filename,%dsep,%mult:true,%mix:false,%whole:[],%ln ], > %filename : part (%v,1), > if not stringp (%filename) > then ( disp (" file name must be a Maxima string "), > return (false)), > if not file_search (%filename) then > (disp (" file not found "),return (false)), > if length (%v) = 1 then %mix : true > else if length(%v) = 2 then %dsep : part (%v,2) > else if length(%v) = 3 then (%dsep : part (%v,2), %mult : part > (%v,3)) > else (%dsep : part (%v,2), %mult : part (%v,3),%whole : > part(%v,4)), > > %s : openr (%filename), > %r : [], > %ln : 0, > while (%l : readline(%s)) # false do > ( %ln : %ln + 1, > > /*Added the following two lines and the enclosing parens*/ > %l : strim(" ", ssubst(" ", ascii(13), %l ) ), > if %l # "" then > ( > if not lfreeof (%whole,%ln) then > %r : cons (parse_string (%l),%r) > else if %mix then > %r : cons (map(parse_string, split(ssubst (" ",",",%l))), %r) > else > %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r) > ) > ), > close (%s), > reverse (%r)); > > Now it works on my Linux box, but you'll need to check it on your > Windows box. I tested it against all of the data files you listed in > your message where you forgot to post the code. > > I started to go back and modify the ?read\-char method I submitted > earlier, but I soon discovered it was more work than I wanted to do to > get it to automatically determine the data types it was reading. Maybe > I'll play more with that another time just for fun. I was having > difficulty trying to catch errors in Maxima so I could gracefully > close the file and exit, but I wasn't able to do that either. > > Paul > Hi Ted: Here are the data files I used with the read_data function. The names might not be the same as they were in your email message. I created ndata1.dat by using a hex editor (Okteta) on regular a text file that had extra space chars that could be modified. All the others were copy/pasted directly from your email message without modification. I use Thunderbird for email. Paul -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ndata1.dat URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ndata2.dat URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ndata3.dat URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ndata5.dat URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ndata6.dat URL: From woollett at charter.net Mon May 30 15:27:09 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 30 May 2011 13:27:09 -0700 Subject: [Maxima] Universl read_data function Message-ID: <43E6094C68F74461916D454351CA7E41@edwinc367e16bd> On May 30, 2011 Paul Bowyer wrote: ----------- Here are the data files I used with the read_data function. The names might not be the same as they were in your email message. I created ndata1.dat by using a hex editor (Okteta) on regular a text file that had extra space chars that could be modified. All the others were copy/pasted directly from your email message without modification. I use Thunderbird for email. ---------------------------- I looked at you ndata1.dat file. You have two back to back CRLF's between lines 6 and 7 and between lines 7 and 8 and in addition you have an extra CRLF after the CRLf ending the last line. Ted From pbowyer at olynet.com Mon May 30 15:48:41 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Mon, 30 May 2011 13:48:41 -0700 Subject: [Maxima] Universal read_data function Message-ID: <4DE402A9.3030802@olynet.com> Forgot to add maxima to the mailing. -------- Original Message -------- Subject: Re: Universal read_data function Date: Mon, 30 May 2011 13:47:08 -0700 From: Paul Bowyer To: Edwin Woollett On 05/30/2011 01:04 PM, Edwin Woollett wrote: > Attached is pb-data1.dat which is > your ndata1.dat supplemented with the > symbols CRLF everywhere I found > them in the file, using notepad2 > (shift-ctrl-9). > a. you have incorrect CRLF between lines 6 and 7 > b. you have incorrect CRLF between lines 7 and 8 > c. you have an incorrect (ie gives error) CRLF > after the last line ending CRLF. > > In all the above case, you have back to > back CRLF's which will give trouble when you try to read in lines. > > ted > > > ----- Original Message ----- From: Paul Bowyer To: Edwin Woollett Cc: > Maxima List Sent: Monday, May 30, 2011 12:09 PM > Subject: Re: Universal read_data function > > > On 05/30/2011 09:59 AM, Edwin Woollett wrote: >> Hi Paul, >> Please send me your data files which fail with >> my code, as an attachement, so I get all the >> correct end of line chars in your files. >> >> Ted >> >> ----- Original Message ----- From: Paul Bowyer To: Edwin Woollett Cc: >> Maxima List Sent: Sunday, May 29, 2011 5:34 PM >> Subject: Re: Universal read_data function >> >> >> On 05/29/2011 12:55 PM, Edwin Woollett wrote: >>> I meant to include the code for >>> the four arg version of read_data: >>> >>> ----------------------------------------------- >>> >>> read_data([%v]) := >>> block ([%s,%r,%l,%filename,%dsep,%mult:true,%mix:false, >>> %whole:[],%ln], >>> >>> %filename : part (%v,1), >>> >>> if not stringp (%filename) >>> then ( disp (" file name must be a Maxima string "), >>> return (false)), >>> >>> if not file_search (%filename) then >>> (disp (" file not found "),return (false)), >>> >>> if length (%v) = 1 then %mix : true >>> else if length(%v) = 2 then %dsep : part (%v,2) >>> else if length (%v) = 3 then (%dsep : part (%v,2), %mult : >>> part (%v,3)) >>> else (%dsep : part (%v,2), %mult : part (%v,3),%whole : >>> part(%v,4)), >>> >>> >>> >>> %s : openr (%filename), >>> %r : [], >>> %ln : 0, >>> >>> while (%l : readline(%s)) # false do >>> ( %ln : %ln + 1, >>> if not lfreeof (%whole,%ln) then >>> %r : cons (parse_string (%l),%r) >>> else if %mix then >>> %r : cons (map(parse_string, split(ssubst (" ",",",%l))), >>> %r) >>> else %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r)), >>> >>> close (%s), >>> reverse (%r))$ >>> >>> ----------------- >>> >>> ted >>> >>> >>> >>> >> Hi Ted: >> >> I tried the above listed read_data function and it was still choking >> on the CRs in the data files on my Linux box. >> I fiddled with it slightly and this is what it looks like now: >> >> read_data([%v]) := block ( >> [%s,%r,%l,%filename,%dsep,%mult:true,%mix:false,%whole:[],%ln ], >> %filename : part (%v,1), >> if not stringp (%filename) >> then ( disp (" file name must be a Maxima string "), >> return (false)), >> if not file_search (%filename) then >> (disp (" file not found "),return (false)), >> if length (%v) = 1 then %mix : true >> else if length(%v) = 2 then %dsep : part (%v,2) >> else if length(%v) = 3 then (%dsep : part (%v,2), %mult : part >> (%v,3)) >> else (%dsep : part (%v,2), %mult : part (%v,3),%whole : >> part(%v,4)), >> >> %s : openr (%filename), >> %r : [], >> %ln : 0, >> while (%l : readline(%s)) # false do >> ( %ln : %ln + 1, >> >> /*Added the following two lines and the enclosing parens*/ >> %l : strim(" ", ssubst(" ", ascii(13), %l ) ), >> if %l # "" then >> ( >> if not lfreeof (%whole,%ln) then >> %r : cons (parse_string (%l),%r) >> else if %mix then >> %r : cons (map(parse_string, split(ssubst (" ",",",%l))), %r) >> else >> %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r) >> ) >> ), >> close (%s), >> reverse (%r)); >> >> Now it works on my Linux box, but you'll need to check it on your >> Windows box. I tested it against all of the data files you listed in >> your message where you forgot to post the code. >> >> I started to go back and modify the ?read\-char method I submitted >> earlier, but I soon discovered it was more work than I wanted to do >> to get it to automatically determine the data types it was reading. >> Maybe I'll play more with that another time just for fun. I was >> having difficulty trying to catch errors in Maxima so I could >> gracefully close the file and exit, but I wasn't able to do that either. >> >> Paul >> > Hi Ted: > > Here are the data files I used with the read_data function. The names > might not be the same as they were in your email message. I created > ndata1.dat by using a hex editor (Okteta) on regular a text file that > had extra space chars that could be modified. All the others were > copy/pasted directly from your email message without modification. I > use Thunderbird for email. > > Paul Ted: I looked at pb-data1.dat in Okteta and the places you changed to 'CR' and 'LF' coincide with their locations in ndata1.dat. In addition, pb-data1.dat follows 'CR' and 'LF' with a hex 0x0A, a LF in hexadecimal, but no hexadecimal CR is present. All of the files I copy/pasted from your email message show a sequence of hex 0x0D 0x0A. Am I mistaken to think the normal Windows line endings for text files are hex 0x0D 0x0A ? The back to back CR/LF are just empty lines occuring in the data file which the additional lines in the read_data function took care of on my Linux box. Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbowyer at olynet.com Mon May 30 16:12:55 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Mon, 30 May 2011 14:12:55 -0700 Subject: [Maxima] Universl read_data function Message-ID: <4DE40857.7080402@olynet.com> I forgot, again, to include maxima on the mailing. -------- Original Message -------- Subject: Re: Universl read_data function Date: Mon, 30 May 2011 14:11:44 -0700 From: Paul Bowyer To: Edwin Woollett On 05/30/2011 01:27 PM, Edwin Woollett wrote: > On May 30, 2011 Paul Bowyer wrote: > ----------- > Here are the data files I used with the read_data function. The names > might not be the same as they were in your email message. I created > ndata1.dat by using a hex editor (Okteta) on regular a text file that > had extra space chars that could be modified. All the others were > copy/pasted directly from your email message without modification. I > use Thunderbird for email. > ---------------------------- > > I looked at you ndata1.dat file. > You have two back to back CRLF's > between lines 6 and 7 and > between lines 7 and 8 and > in addition you have an > extra CRLF after the CRLf ending > the last line. > > Ted > > > Hi Ted: I forgot that I added some more lines to ndata1.dat by copy/paste and yes, it does have some blank lines between the data lines. When I was running the tests, I wanted to add some additional data from your data files, but I changed my mind and decided to use different files instead. I didn't get the file returned to its original state before I sent it off to you. When I remove the extra lines I added and leave the CR/LF combinations, including the trailing blank lines, the edited version of read_data operates correctly with "read_data ("/home/pfb/ndata1.dat"," ",true,[4]);" Sorry for the confusion, Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ndata1.dat URL: From woollett at charter.net Mon May 30 16:54:36 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 30 May 2011 14:54:36 -0700 Subject: [Maxima] parse_string behavor Message-ID: <8F9325A40AF047BAA06A782C78FEA1A0@edwinc367e16bd> I get premature termination at $ error below: ------------------------- (%i1) display2d:false$ (%i2) l1 : "is much simplified"$ (%i3) l2 : "is much simplified if"$ (%i4) l1s : split (l1); (%o4) ["is","much","simplified"] (%i5) l2s : split (l2); (%o5) ["is","much","simplified","if"] (%i6) map ('parse_string,l1s); (%o6) [is,much,simplified] (%i7) map ('parse_string,l2s); incorrect syntax: Premature termination of input at $. (%i8) map('parse_string,["only","if"]); incorrect syntax: Premature termination of input at $. (%i9) parse_string ("if"); incorrect syntax: Premature termination of input at $. Is there a fix for this? Ted Woollett From pbowyer at olynet.com Mon May 30 17:50:12 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Mon, 30 May 2011 15:50:12 -0700 Subject: [Maxima] parse_string behavor In-Reply-To: <8F9325A40AF047BAA06A782C78FEA1A0@edwinc367e16bd> References: <8F9325A40AF047BAA06A782C78FEA1A0@edwinc367e16bd> Message-ID: <4DE41F24.4080605@olynet.com> On 05/30/2011 02:54 PM, Edwin Woollett wrote: > I get premature termination at $ error below: > ------------------------- > (%i1) display2d:false$ > (%i2) l1 : "is much simplified"$ > (%i3) l2 : "is much simplified if"$ > (%i4) l1s : split (l1); > (%o4) ["is","much","simplified"] > (%i5) l2s : split (l2); > (%o5) ["is","much","simplified","if"] > (%i6) map ('parse_string,l1s); > (%o6) [is,much,simplified] > (%i7) map ('parse_string,l2s); > incorrect syntax: Premature termination of input at $. > > (%i8) map('parse_string,["only","if"]); > incorrect syntax: Premature termination of input at $. > (%i9) parse_string ("if"); > incorrect syntax: Premature termination of input at $. > > Is there a fix for this? > > Ted Woollett > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Hi Ted: I tried: l1 : "is much simplified"$ l2 : "is much simplified if more"$ l1s : split (l1); l2s : split (l2); map ('parse_string,l1s); trace( parse_string ); map ('parse_string,l2s); untrace( parse_string ); and got: (%o173) ["is","much","simplified"] (%o174) ["is","much","simplified","if","more"] (%o175) [is,much,simplified] (%o176) [parse_string] 1" Enter "parse_string["is"] 1" Exit "parse_string is 1" Enter "parse_string["much"] 1" Exit "parse_string much 1" Enter "parse_string["simplified"] 1" Exit "parse_string simplified 1" Enter "parse_string["if"] stdin:3:incorrect syntax: Premature termination of input at $. (%o178) [parse_string] which tells me, I think, it's choking on the 'if'. When I change: l2 : "is much simplified has more"$ I get: (%o182) ["is","much","simplified"] (%o183) ["is","much","simplified","has","more"] (%o184) [is,much,simplified] (%o185) [parse_string] 1" Enter "parse_string["is"] 1" Exit "parse_string is 1" Enter "parse_string["much"] 1" Exit "parse_string much 1" Enter "parse_string["simplified"] 1" Exit "parse_string simplified 1" Enter "parse_string["has"] 1" Exit "parse_string has 1" Enter "parse_string["more"] 1" Exit "parse_string more (%o186) [is,much,simplified,has,more] (%o187) [parse_string] A successful completion. Does the Maxima documentation: Function: parse_string (str) Parse the string str as a Maxima expression (do not evaluate it). The string str may or may not have a terminator (dollar sign $ or semicolon ;). Only the first expression is parsed, if there is more than one. mean that 'is' is interpreted as the first expression and 'if' as the second? Paul From volkervannek at googlemail.com Tue May 31 01:33:43 2011 From: volkervannek at googlemail.com (Volker van Nek) Date: Tue, 31 May 2011 08:33:43 +0200 Subject: [Maxima] parse_string behavor In-Reply-To: <4DE41F24.4080605@olynet.com> References: <8F9325A40AF047BAA06A782C78FEA1A0@edwinc367e16bd> <4DE41F24.4080605@olynet.com> Message-ID: parse_string only cares about the first containing expression: (%i1) parse_string("foo;bar;baz;"); (%o1) foo Basically parse_string behaves like the top level parser. You can parse symbols (e.g. foo) and function names: (%i2) sqrt; (%o2) sqrt (%i3) solve; (%o3) solve But you cannot parse operators without arguments: (%i4) +; incorrect syntax: Premature termination of input at ;. +; ^ Or fragments of programming constructs: (%i4) do; incorrect syntax: Premature termination of input at ;. do; ^ (%i4) if; incorrect syntax: Premature termination of input at ;. if; ^ Hope that helps. Volker van Nek 2011/5/31 Paul Bowyer > On 05/30/2011 02:54 PM, Edwin Woollett wrote: > >> I get premature termination at $ error below: >> ------------------------- >> (%i1) display2d:false$ >> (%i2) l1 : "is much simplified"$ >> (%i3) l2 : "is much simplified if"$ >> (%i4) l1s : split (l1); >> (%o4) ["is","much","simplified"] >> (%i5) l2s : split (l2); >> (%o5) ["is","much","simplified","if"] >> (%i6) map ('parse_string,l1s); >> (%o6) [is,much,simplified] >> (%i7) map ('parse_string,l2s); >> incorrect syntax: Premature termination of input at $. >> >> (%i8) map('parse_string,["only","if"]); >> incorrect syntax: Premature termination of input at $. >> (%i9) parse_string ("if"); >> incorrect syntax: Premature termination of input at $. >> >> Is there a fix for this? >> >> Ted Woollett >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> Hi Ted: > > I tried: > l1 : "is much simplified"$ > l2 : "is much simplified if more"$ > l1s : split (l1); > l2s : split (l2); > map ('parse_string,l1s); > > trace( parse_string ); > map ('parse_string,l2s); > untrace( parse_string ); > > and got: > > (%o173) ["is","much","simplified"] > (%o174) ["is","much","simplified","if","more"] > (%o175) [is,much,simplified] > (%o176) [parse_string] > 1" Enter "parse_string["is"] > 1" Exit "parse_string is > 1" Enter "parse_string["much"] > 1" Exit "parse_string much > 1" Enter "parse_string["simplified"] > 1" Exit "parse_string simplified > 1" Enter "parse_string["if"] > stdin:3:incorrect syntax: Premature termination of input at $. > (%o178) [parse_string] > > which tells me, I think, it's choking on the 'if'. > > When I change: > l2 : "is much simplified has more"$ > > I get: > > (%o182) ["is","much","simplified"] > (%o183) ["is","much","simplified","has","more"] > (%o184) [is,much,simplified] > (%o185) [parse_string] > 1" Enter "parse_string["is"] > 1" Exit "parse_string is > 1" Enter "parse_string["much"] > 1" Exit "parse_string much > 1" Enter "parse_string["simplified"] > 1" Exit "parse_string simplified > 1" Enter "parse_string["has"] > 1" Exit "parse_string has > 1" Enter "parse_string["more"] > 1" Exit "parse_string more > (%o186) [is,much,simplified,has,more] > (%o187) [parse_string] > > A successful completion. > > Does the Maxima documentation: > > Function: parse_string (str) > Parse the string str as a Maxima expression (do not evaluate it). The > string str may or may not have a terminator (dollar sign $ or semicolon ;). > Only the first expression is parsed, if there is more than one. > > mean that 'is' is interpreted as the first expression and 'if' as the > second? > > > 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 fukanchik at gmail.com Tue May 31 13:14:29 2011 From: fukanchik at gmail.com (Sergey Fukanchik) Date: Tue, 31 May 2011 19:14:29 +0100 Subject: [Maxima] How to properly work with inequalities Message-ID: Hi, I guess i'm doing something wrong here: (%i1) solve([7*x+2<-x-3], [x]); (%o1) [7 x + 2 < - x - 3 = 0] i expect something like this: [x < -5 / 8 ] Could please someone help me with correct method to solve such problems? Thank you in advance! -- Sergey From volkervannek at googlemail.com Tue May 31 14:28:10 2011 From: volkervannek at googlemail.com (Volker van Nek) Date: Tue, 31 May 2011 21:28:10 +0200 Subject: [Maxima] How to properly work with inequalities In-Reply-To: References: Message-ID: Hi, solve cannot solve inequalities. For simple rational inequalities you can load and use the addon package solve_rat_ineq. (%i1) display2d:false$ (%i2) load("solve_rat_ineq"); (%o2) "/usr/share/maxima/5.24.0/share/contrib/solve_rat_ineq.mac" (%i3) solve_rat_ineq(7*x+2<-x-3); (%o3) [[x < -5/8]] Hope that helps Volker van Nek 2011/5/31 Sergey Fukanchik > Hi, > I guess i'm doing something wrong here: > > (%i1) solve([7*x+2<-x-3], [x]); > (%o1) [7 x + 2 < - x - 3 = 0] > i expect something like this: > [x < -5 / 8 ] > > Could please someone help me with correct method to solve such problems? > > Thank you in advance! > > -- > Sergey > _______________________________________________ > 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 Tue May 31 17:43:58 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Tue, 31 May 2011 15:43:58 -0700 Subject: [Maxima] Universal read_data function In-Reply-To: <1D1A82725204439FB2B03621F7A6FE26@edwinc367e16bd> References: <4DE2E60A.7020208@olynet.com> <22475D2B4C964F3281AAEEB59533D53E@edwinc367e16bd> <4DE3EB4D.6050103@olynet.com> <468C15DAFEBD4E96A6FD0264C1503FC3@edwinc367e16bd> <4DE4024C.2030909@olynet.com> <1D1A82725204439FB2B03621F7A6FE26@edwinc367e16bd> Message-ID: <4DE56F2E.5040206@olynet.com> On 05/31/2011 12:54 PM, Edwin Woollett wrote: > *Hi Paul,* > *I am not sure of the Hex form of Windows* > *CRLF sequence of end of line chars, since I* > *have almost never used Hex forms.* > ** > *Ted* > > ----- Original Message ----- > *From:* Paul Bowyer > *To:* Edwin Woollett > *Sent:* Monday, May 30, 2011 1:47 PM > *Subject:* Re: Universal read_data function > > On 05/30/2011 01:04 PM, Edwin Woollett wrote: > > Attached is pb-data1.dat which is > > your ndata1.dat supplemented with the > > symbols CRLF everywhere I found > > them in the file, using notepad2 > > (shift-ctrl-9). > > a. you have incorrect CRLF between lines 6 and 7 > > b. you have incorrect CRLF between lines 7 and 8 > > c. you have an incorrect (ie gives error) CRLF > > after the last line ending CRLF. > > > > In all the above case, you have back to > > back CRLF's which will give trouble when you try to read in lines. > > > > ted > > > > > > ----- Original Message ----- From: Paul Bowyer To: Edwin > Woollett Cc: > > Maxima List Sent: Monday, May 30, 2011 12:09 PM > > Subject: Re: Universal read_data function > > > > > > On 05/30/2011 09:59 AM, Edwin Woollett wrote: > >> Hi Paul, > >> Please send me your data files which fail with > >> my code, as an attachement, so I get all the > >> correct end of line chars in your files. > >> > >> Ted > >> > >> ----- Original Message ----- From: Paul Bowyer To: Edwin > Woollett Cc: > >> Maxima List Sent: Sunday, May 29, 2011 5:34 PM > >> Subject: Re: Universal read_data function > >> > >> > >> On 05/29/2011 12:55 PM, Edwin Woollett wrote: > >>> I meant to include the code for > >>> the four arg version of read_data: > >>> > >>> ----------------------------------------------- > >>> > >>> read_data([%v]) := > >>> block ([%s,%r,%l,%filename,%dsep,%mult:true,%mix:false, > >>> %whole:[],%ln], > >>> > >>> %filename : part (%v,1), > >>> > >>> if not stringp (%filename) > >>> then ( disp (" file name must be a Maxima string "), > >>> return (false)), > >>> > >>> if not file_search (%filename) then > >>> (disp (" file not found "),return (false)), > >>> > >>> if length (%v) = 1 then %mix : true > >>> else if length(%v) = 2 then %dsep : part (%v,2) > >>> else if length (%v) = 3 then (%dsep : part (%v,2), %mult : > >>> part (%v,3)) > >>> else (%dsep : part (%v,2), %mult : part (%v,3),%whole : > >>> part(%v,4)), > >>> > >>> > >>> > >>> %s : openr (%filename), > >>> %r : [], > >>> %ln : 0, > >>> > >>> while (%l : readline(%s)) # false do > >>> ( %ln : %ln + 1, > >>> if not lfreeof (%whole,%ln) then > >>> %r : cons (parse_string (%l),%r) > >>> else if %mix then > >>> %r : cons (map(parse_string, split(ssubst (" > ",",",%l))), > >>> %r) > >>> else %r : cons (map(parse_string, > split(%l,%dsep,%mult)), %r)), > >>> > >>> close (%s), > >>> reverse (%r))$ > >>> > >>> ----------------- > >>> > >>> ted > >>> > >>> > >>> > >>> > >> Hi Ted: > >> > >> I tried the above listed read_data function and it was still > choking > >> on the CRs in the data files on my Linux box. > >> I fiddled with it slightly and this is what it looks like now: > >> > >> read_data([%v]) := block ( > >> [%s,%r,%l,%filename,%dsep,%mult:true,%mix:false,%whole:[],%ln ], > >> %filename : part (%v,1), > >> if not stringp (%filename) > >> then ( disp (" file name must be a Maxima string "), > >> return (false)), > >> if not file_search (%filename) then > >> (disp (" file not found "),return (false)), > >> if length (%v) = 1 then %mix : true > >> else if length(%v) = 2 then %dsep : part (%v,2) > >> else if length(%v) = 3 then (%dsep : part (%v,2), %mult : > part > >> (%v,3)) > >> else (%dsep : part (%v,2), %mult : part (%v,3),%whole : > >> part(%v,4)), > >> > >> %s : openr (%filename), > >> %r : [], > >> %ln : 0, > >> while (%l : readline(%s)) # false do > >> ( %ln : %ln + 1, > >> > >> /*Added the following two lines and the enclosing parens*/ > >> %l : strim(" ", ssubst(" ", ascii(13), %l ) ), > >> if %l # "" then > >> ( > >> if not lfreeof (%whole,%ln) then > >> %r : cons (parse_string (%l),%r) > >> else if %mix then > >> %r : cons (map(parse_string, split(ssubst (" > ",",",%l))), %r) > >> else > >> %r : cons (map(parse_string, > split(%l,%dsep,%mult)), %r) > >> ) > >> ), > >> close (%s), > >> reverse (%r)); > >> > >> Now it works on my Linux box, but you'll need to check it on your > >> Windows box. I tested it against all of the data files you > listed in > >> your message where you forgot to post the code. > >> > >> I started to go back and modify the ?read\-char method I submitted > >> earlier, but I soon discovered it was more work than I wanted > to do > >> to get it to automatically determine the data types it was > reading. > >> Maybe I'll play more with that another time just for fun. I was > >> having difficulty trying to catch errors in Maxima so I could > >> gracefully close the file and exit, but I wasn't able to do > that either. > >> > >> Paul > >> > > Hi Ted: > > > > Here are the data files I used with the read_data function. The > names > > might not be the same as they were in your email message. I created > > ndata1.dat by using a hex editor (Okteta) on regular a text file > that > > had extra space chars that could be modified. All the others were > > copy/pasted directly from your email message without > modification. I > > use Thunderbird for email. > > > > Paul > Ted: > > I looked at pb-data1.dat in Okteta and the places you changed to 'CR' > and 'LF' coincide with their locations in ndata1.dat. In addition, > pb-data1.dat follows 'CR' and 'LF' with a hex 0x0A, a LF in > hexadecimal, > but no hexadecimal CR is present. All of the files I copy/pasted from > your email message show a sequence of hex 0x0D 0x0A. > > Am I mistaken to think the normal Windows line endings for text files > are hex 0x0D 0x0A ? > > The back to back CR/LF are just empty lines occuring in the data file > which the additional lines in the read_data function took care of > on my > Linux box. > > Paul > Hi Ted: For clarification, hex 0x0D = int 13 and hex 0x0A = int 10. I just put it in hex form because that's the default in the hex editor, Okteta, that I use. My reason for thinking I needed to use Windows text file standards in the data files was because I copy/pasted them from your email messages. If I were creating them from scratch on a Linux box, I'd opt for the default LF that is standard for Linux text files. When I try to write utility functions, I try to make them robust so they don't fail when things aren't absolutely perfect. It made sense to me to handle the case where Windows text file standards were used since you were working on a Windows machine. I wasn't trying to be a nuisance by continually marking up your code and I hope I didn't upset you, but please forgive me if I did. Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From shinabe.munehiro at hotmail.co.jp Tue May 31 19:50:56 2011 From: shinabe.munehiro at hotmail.co.jp (Part Marty) Date: Wed, 1 Jun 2011 09:50:56 +0900 Subject: [Maxima] (no subject) Message-ID: Can I put the the attribute to the operator"^"? Example: a^(b+c) -->a^b*a^c kill(all)$ (%i1) declare(["^",exp],additive); a^(b+c); exp(b+c); (%o1) done (%o2) a^(c+b) (%o3) %e^c+%e^b -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Wed Jun 1 13:05:09 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 1 Jun 2011 11:05:09 -0700 Subject: [Maxima] Universal read_data function Message-ID: On May 31, Paul Bowyer wrote: ------------------------ My reason for thinking I needed to use Windows text file standards in the data files was because I copy/pasted them from your email messages. If I were creating them from scratch on a Linux box, I'd opt for the default LF that is standard for Linux text files. When I try to write utility functions, I try to make them robust so they don't fail when things aren't absolutely perfect. It made sense to me to handle the case where Windows text file standards were used since you were working on a Windows machine. I wasn't trying to be a nuisance by continually marking up your code and I hope I didn't upset you, but please forgive me if I did. Paul ------------------------------------- Hi Paul, I never get upset, and can only be flattered by your interest in my faltering efforts at Maxima code. The current version of read_data (which has changed: see below) cares not a whit about end of line chars, so that should never be the issue here. The important thing is that the file to be read does not contain spurious extra end of line chars, and that is why I advise looking at the file with a utility such as notepad2, which clearly shows up the locations and types of end of line chars (shift+control+9) (which is a toggle). (By the way, when you write data to a stream opened with openw, using printf as is the manual examples, the end of line chars are LF (unix).) The NEW version allows the 'data-sep-string' to be "text", (which is a hack), in which case all lines are read in as strings without splitting, as is appropriate for a purely text file which contains spaces and punctuation marks. A related change is if the four arg version is used, by supplying a list of line numbers, those lines 2 and 4 are read into separate sublists as a whole as one string for the whole line, doing no splitting. --------------------------------------- The present complete syntax and code are then: ------------------------------------------------------------- /*********** read_data ****************************/ /* if only a file name is given, then the data separators can be an arbitrary mixture of spaces and commas, but the commas are converted to spaces, so strings with spaces will choke the code if you only provide the filename, or you provide (filename," "). syntax: read_data(filename,data-sep-string,mult,line-list) with ";" for example in second slot, and false in third slot. (mult is set to true by default.) The data separator string can be anything recognised by split, and the boolean parameter mult is used by split. In addition, the data-sep-string can be "text", in which case *all* lines of the stream are read in as individual strings. Thus the syntax read_data(filename,"text") does no line splitting. The most complicated four arg syntax has the form read_data (filename, " ", true, [2,4] ) for example, where for split line data items, (ie., not lines 2 and 4) space is being used as the data separator, but lines 2 and 4 should be read into separate sublists as a whole as one string for the whole line, doing no splitting for lines 2 and 4. */ /* new 5-29 */ read_data([%v]) := block ([%s,%r,%l,%filename,%dsep,%mult:true, %mix:false, %whole:[],%ln], %filename : part (%v,1), if not stringp (%filename) then ( disp (" file name must be a Maxima string "), return (false)), if not file_search (%filename) then (disp (" file not found "),return (false)), if length (%v) = 1 then %mix : true else if length(%v) = 2 then %dsep : part (%v,2) else if length (%v) = 3 then (%dsep : part (%v,2), %mult : part (%v,3)) else (%dsep : part (%v,2), %mult : part (%v,3),%whole : part(%v,4)), %s : openr (%filename), %r : [], %ln : 0, while (%l : readline(%s)) # false do ( %ln : %ln + 1, if %dsep = "text" then %r : cons (%l,%r) else if not lfreeof (%whole,%ln) then %r : cons (%l,%r) else if %mix then %r : cons (map(parse_string, split(ssubst (" ",",",%l))), %r) else %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r)), close (%s), reverse (%r))$ ------------------------------------------------ Ted From willisb at unk.edu Wed Jun 1 14:28:41 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 1 Jun 2011 14:28:41 -0500 Subject: [Maxima] (no subject) In-Reply-To: References: Message-ID: The simplification a^b * a^c --> a^(b+c) is built into the general simplifier. I know of no way to prevent Maxima from doing this simplification. What exactly were you trying to do? --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >Can?I?put?the?the?attribute?to?the?operator"^"? > >? > >Example:? > >a^(b+c)?-->a^b*a^c > >? > >kill(all)$ >(%i1)?declare(["^",exp],additive); >?????????a^(b+c); >?????????exp(b+c); > >(%o1)?done >(%o2)?a^(c+b) >(%o3)?%e^c+%e^b >????? ???? ????? ??????? ???? ? >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From renzodelfabbro at alice.it Thu Jun 2 03:22:32 2011 From: renzodelfabbro at alice.it (Renzo Del Fabbro) Date: Thu, 2 Jun 2011 08:22:32 +0000 (UTC) Subject: [Maxima] Simplify Trigonometric Expressions Message-ID: Hi is there a way to simplify A*cos(w*t)+B*sin(w*t) to the form K*cos(w*t+c) Thanks Regards Renzo From carbajal at ifi.uzh.ch Thu Jun 2 03:44:26 2011 From: carbajal at ifi.uzh.ch (Juan Pablo Carbajal) Date: Thu, 2 Jun 2011 10:44:26 +0200 Subject: [Maxima] Simplify Trigonometric Expressions In-Reply-To: References: Message-ID: There are the functions trigreduce and trigsimp. However, 1. "A" and "B" are just constants for Maxima, there is no way it can self-generate A=cos(c), B=-sin(c). 2. The expression you sent is not always true, it holds only if -1 wrote: > Hi > > is there a way to simplify > > A*cos(w*t)+B*sin(w*t) > > to the form > > K*cos(w*t+c) > > Thanks > > Regards > Renzo > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- M. Sc. Juan Pablo Carbajal ----- PhD Student University of Z?rich www.ailab.ch/carbajal From toy.raymond at gmail.com Thu Jun 2 09:17:03 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 02 Jun 2011 10:17:03 -0400 Subject: [Maxima] Simplify Trigonometric Expressions References: Message-ID: >>>>> "Juan" == Juan Pablo Carbajal writes: Juan> There are the functions trigreduce and trigsimp. However, Juan> 1. "A" and "B" are just constants for Maxima, there is no way it can Juan> self-generate A=cos(c), B=-sin(c). Juan> 2. The expression you sent is not always true, it holds only if -1 and -1 Hence, if you know inequalities in 2. are true, then there exist a Juan> value c, such that 1. is valid. If you assume all this then But if you divide the expression by sqrt(A^2+B^2), I think you will be able to write the result in the desired form where A=sqrt(A^2+B^2)*cos(c) and B = sqrt(A^2+B^2)*sin(c). Juan> trigreduce( subst([A=cos(c), B=-sin(c)], A*cos(w*t)+B*sin(w*t)) ) I didn't check to see if maxima is smart enough to give the expected answer with the division, but it can obviously be done by hand. Ray From shinabe.munehiro at hotmail.co.jp Thu Jun 2 09:24:01 2011 From: shinabe.munehiro at hotmail.co.jp (Part Marty) Date: Thu, 2 Jun 2011 23:24:01 +0900 Subject: [Maxima] (no subject) In-Reply-To: References: , Message-ID: Dear Barton Thank you for reply. > What exactly were you trying to do? I try transformation of the following expression. I know that I can use the comand "trigexpand" comand. cos(z1+z2)-->cos(z1)*cos(z2)-sin(z1)*sin(z2) To learn the method of transforming the expression by "Maxima", I want to transform the expression through the following procedure. cos(z1+z2) %e^(%i*z2+%i*z1)/2+%e^(-%i*z2-%i*z1)/2 %e^(%i*z2)*%e^(%i*z1)/2+%e^(-%i*z2)*%e^(-%i*z1)/2 ((%e^(%i*z1)+%e^(-%i*z1))*(%e^(%i*z2)+%e^(-%i*z2)))/4+((%e^(%i*z1)-%e^(-%i*z1))*(%e^(%i*z2)-%e^(-%i*z2)))/4 cos(z1)*cos(z2)-sin(z1)*sin(z2) Is it nonsense? Part Marty > Subject: Re: [Maxima] (no subject) > From: willisb at unk.edu > To: shinabe.munehiro at hotmail.co.jp > CC: maxima at math.utexas.edu > Date: Wed, 1 Jun 2011 14:28:41 -0500 > > The simplification a^b * a^c --> a^(b+c) is built into the general simplifier. > I know of no way to prevent Maxima from doing this simplification. > > What exactly were you trying to do? > > --Barton > > -----maxima-bounces at math.utexas.edu wrote: ----- > > > >Can I put the the attribute to the operator"^"? > > > > > > > >Example: > > > >a^(b+c) -->a^b*a^c > > > > > > > >kill(all)$ > >(%i1) declare(["^",exp],additive); > > a^(b+c); > > exp(b+c); > > > >(%o1) done > >(%o2) a^(c+b) > >(%o3) %e^c+%e^b > > > >_______________________________________________ > >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 dani.germann at gmail.com Tue May 31 09:44:34 2011 From: dani.germann at gmail.com (Daniel Germann) Date: Tue, 31 May 2011 14:44:34 +0000 (UTC) Subject: [Maxima] Does Maxima work on Windows?? References: <861324.30619.qm@web161816.mail.bf1.yahoo.com> <5CD78996B8F8844D963C875D3159B94A0111211F@dsrcorreo> Message-ID: Rub?n Roa azti.es> writes: > > > > > -----Original Message----- > From: maxima-bounces math.utexas.edu on behalf of Ether Jones > Sent: Wed 4/13/2011 1:37 AM > To: maxima math.utexas.edu; Roy Stannard > Subject: Re: [Maxima] Does Maxima work on Windows?? > WinXP Pro SP3 > control panel -> system -> advanced -> Performance Settings -> Data Execution Prevention > - browse to the maxima executable and add it to the list of exceptions > - also add wxmaxima if you are going to use that > (requites admin privileges to access & change) > ----- > I did that too; it didn't work. > The problem lies somewhere in some obscure Winxp Home Edition setting, I'm pretty sure of that. > However, I haven't yet tried David Billinghurst's second low level check: > Begin quote: > Lets go right back to basics and tryat a low level > Open a cmd window and enter > ?? 1. cd "C:\Program Files\Maxima-5.23.2\bin" > ?? 2. .\maxima.bat > If that doesn't produce something, try > ?? 1. cd "C:\Program Files\Maxima-5.23.2 > ?? 2. lib\maxima\5.23.2\binary-gcl\maxima.exe -eval "(cl-user::run)" -f -- > End quote > ... > I just did, with a fresh install of Maxima 5.24.0 (gcl), and in both low-level checks there was no result. > I mean that nothing happened, the DOS console just jumped to the next line and did nothing. > Maxima didn't start. > I have downloaded maxima-5.24.0-ccl and will install it after uninstalling the previous maxima-5.24.0 (gcl). > Will see what comes out. > Details of the system affected: > Windows Vista Home Premium > SP2 > Rub?n > > > > > _______________________________________________ > Maxima mailing list > Maxima math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > With Maxima 5.24.0 I had the same problem (never before). In my case it was two wrong variables (prefix and maxima_prefix) in C:\programme\maxima-5.24.0\bin\maxima.bat, that pointed to C:\maxima. When I changed them to the correct values (the installation path), everything worked fine again (maxima from DOS as well as wxMaxima) Dani From aleksasd at mruni.eu Tue May 31 15:04:19 2011 From: aleksasd at mruni.eu (aleksasd at mruni.eu) Date: Tue, 31 May 2011 23:04:19 +0300 Subject: [Maxima] How to properly work with inequalities Message-ID: <9149aae9edbefd848fedc7f4f78deb60.squirrel@mail.mruni.eu> Problem: solve inequation 7*x+2<-x-3 (%i1) S:7*x+2<-x-3$ 1 method (%i2) assume(S); (%o2) [x<-5/8] 2 method (%i3) to_poly_solve([S], [x]); Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:49 $ (%o3) %union([x<-5/8]) (%i4) sol:first(%); (%o4) [x<-5/8] 3 method (%i5) load(ineq)$ (%i6) S-2; (%o6) 7*x<-x-5 (%i7) %+x; (%o7) 8*x<-5 (%i8) %/8; (%o8) x<-5/8 4 method (%i9) load(solve_rat_ineq); (%o9) "C:/PROGRA~2/MAXIMA~1.0/share/maxima/5.24.0/share/contrib/solve_rat_ineq.mac" (%i10) solve_rat_ineq(S); (%o10) [[x<-5/8]] (%i11) sol:%[1]; (%o11) [x<-5/8] Aleksas D From pbowyer at olynet.com Thu Jun 2 11:56:41 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Thu, 02 Jun 2011 09:56:41 -0700 Subject: [Maxima] Universal read_data function Message-ID: <4DE7C0C9.7080800@olynet.com> Again, I forgot to include the maxima mailing list. I think I must have sometimers... -------- Original Message -------- Subject: Re: Universal read_data function Date: Thu, 02 Jun 2011 08:57:11 -0700 From: Paul Bowyer To: Edwin Woollett On 06/01/2011 11:05 AM, Edwin Woollett wrote: > On May 31, Paul Bowyer wrote: > ------------------------ > My reason for thinking I needed to use Windows text file standards in > the data files was because I copy/pasted them from your email > messages. If I were creating them from scratch on a Linux box, I'd opt > for the default LF that is standard for Linux text files. > > When I try to write utility functions, I try to make them robust so > they don't fail when things aren't absolutely perfect. It made sense > to me to handle the case where Windows text file standards were used > since you were working on a Windows machine. I wasn't trying to be a > nuisance by continually marking up your code and I hope I didn't upset > you, but please forgive me if I did. > > Paul > ------------------------------------- > Hi Paul, > > I never get upset, and can only be flattered by your interest in > my faltering efforts at Maxima code. > > The current version of read_data (which has changed: see > below) cares not a whit about end of line chars, so that should > never be the issue here. The important thing is that the > file to be read does not contain spurious extra end of > line chars, and that is why I advise looking at the file with > a utility such as notepad2, which clearly shows up the > locations and types of end of line chars (shift+control+9) > (which is a toggle). > > (By the way, when you write data to a stream opened > with openw, using printf as is the manual examples, > the end of line chars are LF (unix).) > > The NEW version allows the 'data-sep-string' to be "text", > (which is a hack), in which case all lines are read > in as strings without splitting, as is appropriate for > a purely text file which contains spaces and punctuation > marks. > > A related change is if the four arg version is > used, by supplying a list of line numbers, > those lines 2 and 4 are read into separate > sublists as a whole as one string for the > whole line, doing no splitting. > > --------------------------------------- > The present complete syntax and code are then: > ------------------------------------------------------------- > /*********** read_data ****************************/ > /* if only a file name is given, then the > data separators can be an arbitrary mixture > of spaces and commas, but the commas are > converted to spaces, so strings with spaces > will choke the code if you only provide the > filename, or you provide (filename," "). > > > > syntax: read_data(filename,data-sep-string,mult,line-list) > > with ";" for example in second slot, > and false in third slot. > (mult is set to true by default.) > > The data separator string can be anything > recognised by split, and the boolean parameter > mult is used by split. > > > In addition, the data-sep-string can be "text", > in which case *all* lines of the stream are read > in as individual strings. > > Thus the syntax read_data(filename,"text") does > no line splitting. > > The most complicated four arg syntax has the > form > read_data (filename, " ", true, [2,4] ) > > for example, where for split line data items, > (ie., not lines 2 and 4) space is being used > as the data separator, but lines 2 and 4 should > be read into separate sublists as a whole as > one string for the whole line, doing no splitting > for lines 2 and 4. > */ > > > /* new 5-29 */ > > read_data([%v]) := > block ([%s,%r,%l,%filename,%dsep,%mult:true, > %mix:false, %whole:[],%ln], > > %filename : part (%v,1), > > if not stringp (%filename) > then ( disp (" file name must be a Maxima string "), > return (false)), > > if not file_search (%filename) then > (disp (" file not found "),return (false)), > > if length (%v) = 1 then %mix : true > else if length(%v) = 2 then %dsep : part (%v,2) > else if length (%v) = 3 > then (%dsep : part (%v,2), %mult : part (%v,3)) > else > (%dsep : part (%v,2), %mult : part (%v,3),%whole : part(%v,4)), > > > > %s : openr (%filename), > %r : [], > %ln : 0, > > while (%l : readline(%s)) # false do > ( %ln : %ln + 1, > if %dsep = "text" then > %r : cons (%l,%r) > else if not lfreeof (%whole,%ln) then > %r : cons (%l,%r) > else if %mix then > %r : cons (map(parse_string, split(ssubst (" ",",",%l))), %r) > else %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r)), > > close (%s), > reverse (%r))$ > ------------------------------------------------ > > Ted > > Hi Ted: I tried your latest code shown above on "ndata2.dat" which I re-copied from your email (using Thunderbird) of "05/29/2011 12:53 PM" into kwrite and filed without modifications. Because of the way printfile listed the data, there was a blank line between the two data lines, and because of the way I copy/pasted, there was only a single LF char at the end of the file. (%i3) printfile ("ndata2.dat")$ 2 , 4.8, -3/4, "xyz", -2.8e-9 3 22.2 7/8 "abc" 4.4e10 By the way, the CRs that I had in my copies of the data files that I used for my previous testing had to be manually entered using Okteta, because they weren't present in the copy/paste data for ndata2.dat. I must have gotten my facts turned around when I stated that the CRs showed up as a result of the copy/paste operation. Anyway, using your code shown above and running: printfile("/home/pfb/ndata2.dat")$ trace( parse_string ); read_data("/home/pfb/ndata2.dat"); untrace( parse_string ); results in this output: 2 , 4.8, -3/4, "xyz", -2.8e-9 3 22.2 7/8 "abc" 4.4e10 (%o36) [parse_string] 1" Enter "parse_string["2"] 1" Exit "parse_string2 1" Enter "parse_string["4.8"] 1" Exit "parse_string4.8 1" Enter "parse_string["-3/4"] 1" Exit "parse_string(-3)/4 1" Enter "parse_string[""xyz""] 1" Exit "parse_string"xyz" 1" Enter "parse_string["-2.8e-9"] 1" Exit "parse_string-2.8*10^-9 1" Enter "parse_string[] stdin:1:incorrect syntax: Premature termination of input at $. (%o38) [parse_string] The inclusion of one, or two lines of code in your function gives some protection against erroneous entries such as those that occur by copy/paste or simply by hand-typed entry. If I were writing this function, I'd do it this way: ------------------------------------------------------------------------------ read_data([%v]) := block ([%s,%r,%l,%filename,%dsep,%mult:true, %mix:false, %whole:[],%ln], %filename : part (%v,1), if not stringp (%filename) then ( disp (" file name must be a Maxima string "), return (false)), if not file_search (%filename) then (disp (" file not found "),return (false)), if length (%v) = 1 then %mix : true else if length(%v) = 2 then %dsep : part (%v,2) else if length (%v) = 3 then (%dsep : part (%v,2), %mult : part (%v,3)) else (%dsep : part (%v,2), %mult : part (%v,3),%whole : part(%v,4)), %s : openr (%filename), %r : [], %ln : 0, while (%l : readline(%s)) # false do ( %ln : %ln + 1, /*Added the following and the enclosing parens. The inclusion of these eliminates problems with: blank lines and CRs in the file. */ /*Add this line if you're concerned about CRs in line ends. %l : strim(" ", ssubst(" ", ascii(13), %l ) ),*/ if %l # "" then /*Check for blank line*/ ( if %dsep = "text" then %r : cons (%l,%r) else if not lfreeof (%whole,%ln) then %r : cons (%l,%r) else if %mix then %r : cons (map(parse_string, split(ssubst (" ",",",%l))), %r) else %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r) ) ), close (%s), reverse (%r)); ------------------------------------------------------------------------------ and again running: printfile("/home/pfb/ndata2.dat")$ trace( parse_string ); /*read_data("/home/pfb/ndata1.dat"," ",true,[4]);*/ read_data("/home/pfb/ndata2.dat"); untrace( parse_string ); results in this output: 2 , 4.8, -3/4, "xyz", -2.8e-9 3 22.2 7/8 "abc" 4.4e10 (%o45) [parse_string] 1" Enter "parse_string["2"] 1" Exit "parse_string2 1" Enter "parse_string["4.8"] 1" Exit "parse_string4.8 1" Enter "parse_string["-3/4"] 1" Exit "parse_string(-3)/4 1" Enter "parse_string[""xyz""] 1" Exit "parse_string"xyz" 1" Enter "parse_string["-2.8e-9"] 1" Exit "parse_string-2.8*10^-9 1" Enter "parse_string["3"] 1" Exit "parse_string3 1" Enter "parse_string["22.2"] 1" Exit "parse_string22.2 1" Enter "parse_string["7/8"] 1" Exit "parse_string7/8 1" Enter "parse_string[""abc""] 1" Exit "parse_string"abc" 1" Enter "parse_string["4.4e10"] 1" Exit "parse_string4.4*10^10 (%o46) [[2,4.8,-3/4,"xyz",-2.8*10^-9],[3,22.2,7/8,"abc",4.4*10^10]] (%o47) [parse_string] I didn't do any testing on other data files at this time. Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From renzodelfabbro at alice.it Thu Jun 2 12:10:37 2011 From: renzodelfabbro at alice.it (Renzo Del Fabbro) Date: Thu, 2 Jun 2011 17:10:37 +0000 (UTC) Subject: [Maxima] Simplify Trigonometric Expressions References: Message-ID: Raymond Toy gmail.com> writes: > I didn't check to see if maxima is smart enough to give the expected > answer with the division, but it can obviously be done by hand. > > Ray > yes,of course, but I wanted to know if I could do it by Maxima ------------- But I did not understand the advice of Juan > > Juan> trigreduce( subst([A=cos(c), B=-sin(c)], A*cos(w*t)+B*sin(w*t)) ) > how can I use it ? Thanks Renzo From carbajal at ifi.uzh.ch Thu Jun 2 12:20:32 2011 From: carbajal at ifi.uzh.ch (Juan Pablo Carbajal) Date: Thu, 2 Jun 2011 19:20:32 +0200 Subject: [Maxima] Simplify Trigonometric Expressions In-Reply-To: References: Message-ID: On Thu, Jun 2, 2011 at 7:10 PM, Renzo Del Fabbro wrote: > Raymond Toy gmail.com> writes: > > >> I didn't check to see if maxima is smart enough to give the expected >> answer with the division, but it can obviously be done by hand. >> >> Ray >> > > yes,of course, but I wanted to know if I could do it by Maxima > ------------- > But I did not understand the advice of Juan > >> >> ? ? Juan> trigreduce( subst([A=cos(c), B=-sin(c)], A*cos(w*t)+B*sin(w*t)) ) >> > > how can I use it ? > > Thanks > Renzo > trigreduce is a function. the command I sent you is quite handcrafted. it does this 1. substitutes A for cos(c) and B for -sin(c). The ouput of subst is then cos(c)*cos(w*t)-sin(c)*sin(w*t) 2. trigreduce applies trigonometric identities to reduce that expression, givin cos(w*t+c) If you have an expression for A and B, solving for c in the equalities A=cos(c) and B=-sin(c), may not be trivial. Cheers -- M. Sc. Juan Pablo Carbajal ----- PhD Student University of Z?rich www.ailab.ch/carbajal From woollett at charter.net Thu Jun 2 12:57:20 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 2 Jun 2011 10:57:20 -0700 Subject: [Maxima] Universal read_data function Message-ID: On June 2, 2011, Paul Bowyer wrote: ------------------------------------------- The inclusion of one, or two lines of code in your function gives some protection against erroneous entries such as those that occur by copy/paste or simply by hand-typed entry. If I were writing this function, I'd do it this way: [snip] while (%l : readline(%s)) # false do ( %ln : %ln + 1, /*Added the following and the enclosing parens. The inclusion of these eliminates problems with: blank lines and CRs in the file. */ /*Add this line if you're concerned about CRs in line ends. %l : strim(" ", ssubst(" ", ascii(13), %l ) ),*/ if %l # "" then /*Check for blank line*/ ( if %dsep = "text" then [snip] ------------------------------------------ Hi Paul, Thanks for the suggestion to include some code to guard against empty lines. I have modified the code to check that the string does not have zero length, as in: ....................... while (%l : readline(%s)) # false do if slength(%l) # 0 then ( %ln : %ln + 1, if %dsep = "text" then %r : cons (%l,%r) else if not lfreeof (%whole,%ln) then %r : cons (%l,%r) else if %mix then %r : cons (map(parse_string, split(ssubst (" ",",",%l))), %r) else %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r)), ...................... I then created ndata9.dat initially with copy/paste as a six line file, then with notepad2 (shift+cntrl+9) 'show end of line chars' mode turned on, deleted all of lines 2, 4, and 6 up to (but not including) the end of line chars and saved the file as is. This resulted in a file with three empty lines, and their presence is apparent from the output of printfile, which shows the "blank" lines (because end of line chars are non-printable), as in --------------------------------- (%i1) (display2d:false,fpprintprec:8)$ (%i2) printfile("ndata9.dat")$ 2 , 4.8, -3/4, "xyz", -2.8e-9 2 , 4.8, -3/4, "xyz", -2.8e-9 2 , 4.8, -3/4, "xyz", -2.8e-9 --------------------------------- Of course the same data file could have been created by pasting one line, pressing Enter twice, pasting one line, pressing Enter twice, pasting one line, pressing Enter twice, and then saving the file as is. The modified code now works around blank line defects in a data file: ---------------------------- (%i16) load(readwrite); (%o16) "c:/work2/readwrite.mac" (%i17) read_data("ndata9.dat"); (%o17) [[2,4.8,-3/4,"xyz",-2.8E-9],[2,4.8,-3/4,"xyz",-2.8E-9], [2,4.8,-3/4,"xyz",-2.8E-9]] ------------------------------- Ted From woollett at charter.net Thu Jun 2 16:31:54 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 2 Jun 2011 14:31:54 -0700 Subject: [Maxima] text_replace for one text string Message-ID: <8A6E7872CF4B4D07A9F812CBDE6D7712@edwinc367e16bd> The function text_replace is a one-string tool which can be used to process a text file using higher level functions which operate on files. The function text_replace has the various incantations: text_replace(snew,sold,string) replaces all *distinct* text substrings by snew and returns a new string. text_replace(snew,sold,string, distinct) does exactly the same thing. text_replace(snew,sold,string, all) replaces *all* text substrings sold, whether or not they are separate words. text_replace(snew,sold,string, 2) replaces the *2nd* substring sold found in string using the 'all' mode. text_replace calls sloc and sword. (see below) ------------------------ Example of use: (%i1) (display2d:false)$ (%i2) load(replace); (%o2) "c:/work2/replace.mac" (%i3) ls : "This is line one isn't it?"$ (%i4) text_replace ("was","is",ls,1); (%o4) "Thwas is line one isn't it?" (%i5) text_replace ("was","is",ls,2); (%o5) "This was line one isn't it?" (%i6) text_replace ("was","is",ls,3); (%o6) "This is line one wasn't it?" (%i7) text_replace ("was","is",ls,4); " string does not contain that many substrings" (%o7) "This is line one isn't it?" (%i8) text_replace ("was","is",ls); (%o8) "This was line one isn't it?" (%i9) text_replace ("was","is",ls,distinct); (%o9) "This was line one isn't it?" (%i10) text_replace ("was","is",ls,all); (%o10) "Thwas was line one wasn't it?" ---------------------------------------- text_replace code: ------------------------------------- text_replace ([%w]) := block ([sn,so,as,%mode:distinct,lso,lsn,nloc,n1,as1], sn : part (%w,1), so : part (%w,2), as : part (%w,3), if length (%w) > 3 then %mode : part (%w,4), if listp (%mode) then (disp (" fourth arg cannot be a list "), return (as)), if integerp (%mode) then (nloc : sloc (as,so,%mode), if not nloc then ( disp (" string does not contain that many substrings"), return (as)), return (ssubstfirst (sn,so,as,nloc))), if %mode = all then return (ssubst (sn,so,as)), /* case only subst for distinct separate words (the default case) */ lso : slength(so), lsn : slength(sn), n1 : sword (as,so,1), if not n1 then return (as), as1 : ssubstfirst(sn,so,as,sequal,n1,n1+lso), /* is that the end of the string as1? */ if n1 + lsn -1 = slength (as1) then return (as1), do ( n1 : sword (as1,so,n1+lsn), if not n1 then return(), as1 : ssubstfirst(sn,so,as1,sequal,n1,n1+lso), if n1 + lsn -1 = slength(as1) then return()), as1)$ ---------------------------------------------------- text_replace calls sloc. sloc (string, substring, n) finds the string position of the n'th appearance of the substring, ignoring distinctness. Returns false if no n'th appearance. (%i11) sloc (ls,"is",1); (%o11) 3 (%i12) sloc (ls,"is",2); (%o12) 6 (%i13) sloc (ls,"is",3); (%o13) 18 (%i14) sloc (ls,"is",4); (%o14) false code: ------------------------------------ sloc(bs,bo,bn) := block ([lbs,lbo,nbs,nsearch:0 ], lbs : slength (bs), lbo : slength (bo), /* search for first substring location */ nbs : ssearch (bo,bs,sequal,1), nsearch : nsearch + 1, if not nbs then return (false), if nsearch = bn then return (nbs), if nbs + lbo -1 = lbs then return(false), do (nsearch : nsearch + 1, nbs : ssearch (bo,bs,sequal,nbs+1), if not nbs then return(), if nsearch = bn then return(), if nbs + lbo -1 = lbs then return()), nbs)$ ----------------------------------------- text_replace also calls sword, whose code is: ------------------------------------------------ /************************ sword ***********************/ /* sword(string,substring,nstart) starts search at char pos nstart and returns false if text substring is not found or if text substring is found but is not a separate word. Otherwise returns the postion of the start of the first text substring found. sword calls sword1. */ sword (%ls,%ss,%nstart) := block ([%ln,%sl,%ns,%nnew,%sep ], %ln : slength (%ls), %sl : slength (%ss), %ns : ssearch (%ss,%ls,sequal,%nstart), /* if substring is not found in the string beginning the search at %nstart, ssearch returns false */ if not %ns then return(false), /* here we know %ns is some integer and is the position of the first substring found so far */ /* check if it is a separate word */ %sep : sword1 (%ls,%ns,%sl), if %sep then return(%ns), /* is substring found at end of the line? */ if %ns + %sl -1 = %ln then return (false), /* search for possible next substring */ %nnew : %ns + 1, do (%ns : ssearch (%ss,%ls,sequal,%nnew), if not %ns then return(), if sword1(%ls,%ns,%sl) then return(), if %ns + %sl -1 = %ln then ( %ns : false, return()) else %nnew : %ns + 1), %ns)$ -------------------------- finally, sword calls sword1, whose code is: ---------------------- /*************** sword1 ***********************/ /* sword1(string,nbegin,nlength) returns either true or false depending on whether the text substring (beginning at nbegin and having length nlength) is a separate word. */ sword1 (%ms,%p,%q) := block ([%sleft:false,%sright:false ], /* check left hand side of substring */ if (%p = 1) or (not alphanumericp (charat (%ms,%p - 1))) then %sleft : true, /* now check right hand side */ if (%p + %q - 1 = slength (%ms)) or (not alphanumericp (charat (%ms,%p + %q))) then %sright : true, if %sleft and %sright then true else false )$ ------------------------------------------ Ted Woollett From woollett at charter.net Thu Jun 2 17:37:40 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 2 Jun 2011 15:37:40 -0700 Subject: [Maxima] text_replace for one text string Message-ID: On June 2, 2011, Ted Woollett wrote: ---------------------------------------- The function text_replace is a one-string tool which can be used to process a text file using higher level functions which operate on files. [snip] ------------------------ the code for sloc has an error at the end with the incorrect behavior: ------------------ (%i15) sloc("this is","is",1); (%o15) 3 (%i16) sloc("this is","is",2); (%o16) 6 (%i17) sloc("this is","is",3); (%o17) 6 ---------------------------- The corrected code for sloc is: ---------------------------------- /* sloc (string, substring, n) returns the string position of the n'th appearance of the substring, ignoring distinctness. Returns false if no n'th appearance. */ sloc(bs,bo,bn) := block ([lbs,lbo,nbs,nsearch:0 ], lbs : slength (bs), lbo : slength (bo), /* search for first substring location */ nbs : ssearch (bo,bs,sequal,1), nsearch : nsearch + 1, if not nbs then return (false), if nsearch = bn then return (nbs), if nbs + lbo -1 = lbs then return(false), do (nsearch : nsearch + 1, nbs : ssearch (bo,bs,sequal,nbs+1), if not nbs then return(), if nsearch = bn then return(), if nbs + lbo -1 = lbs then ( nbs:false, return())), nbs)$ ---------------------------- with the correct behavior: ----------------------- (%i18) load(replace); (%o18) "c:/work2/replace.mac" (%i19) sloc("this is","is",1); (%o19) 3 (%i20) sloc("this is","is",2); (%o20) 6 (%i21) sloc("this is","is",3); (%o21) false (%i26) sloc("This is line one, isn't it? Yes, it is","is",1); (%o26) 3 (%i27) sloc("This is line one, isn't it? Yes, it is","is",2); (%o27) 6 (%i28) sloc("This is line one, isn't it? Yes, it is","is",3); (%o28) 19 (%i29) sloc("This is line one, isn't it? Yes, it is","is",4); (%o29) 37 (%i30) sloc("This is line one, isn't it? Yes, it is","is",5); (%o30) false ----------------------------- Ted Woollett From pbowyer at olynet.com Fri Jun 3 12:06:00 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Fri, 03 Jun 2011 10:06:00 -0700 Subject: [Maxima] Universal read_data function In-Reply-To: References: Message-ID: <4DE91478.4050408@olynet.com> Hi Ted: In my previous message on this subject I said: ------------------------------------------------------------------------ By the way, the CRs that I had in my copies of the data files that I used for my previous testing had to be manually entered using Okteta, because they weren't present in the copy/paste data for ndata2.dat. I must have gotten my facts turned around when I stated that the CRs showed up as a result of the copy/paste operation. ------------------------------------------------------------------------ I've done a little more exploring and I have discovered the source of my confusion. When I initially created my data files, I used kwrite as the text editor, which is configured for automatic end of line detection so it uses what ever line endings are present in the open file; a fact I only discovered this morning. After I edited ndata1.dat with okteta to include the CRLF sequences, I opened that file again with kwrite to see the effect on it. Without closing kwrite, I created the other data files by copy/paste from your email message and used "Save As " to rename them. Since I hadn't closed kwrite, it kept the CRLF line endings for all of the data files I saved, which caused me to think I was getting the CRLF sequences from the Thunderbird email message. With the CRLF sequences in the file, the read_data function chokes on the seemingly blank lines with the CRLF sequence whether I use: "if %l # "" then" or "if slength(%l) # 0 then" as the zero-length test. I had to include: "%l : strim(" ", ssubst(" ", ascii(13), %l ) )," just prior to the zero-length test for proper operation. A simple work-around for linux/unix users is to run, from a terminal window: dos2unix on the data file if dos2unix is installed. Paul From ross7k at gmail.com Sat Jun 4 00:16:19 2011 From: ross7k at gmail.com (ross kyprianou) Date: Sat, 4 Jun 2011 14:46:19 +0930 Subject: [Maxima] How to properly work with inequalities In-Reply-To: <9149aae9edbefd848fedc7f4f78deb60.squirrel@mail.mruni.eu> References: <9149aae9edbefd848fedc7f4f78deb60.squirrel@mail.mruni.eu> Message-ID: Can anyone please suggest the best way to find the real solutions to inequalities involving exp() such as exp(-4*x)>1/2 Neither solve nor fourier_elim seem to help (%i13) load(fourier_elim)$ (%i16) fourier_elim([exp(-4*x)>1/2],[x]); 4 x (%o16) [2 - %e > 0] Hope you can help Ross On Wed, Jun 1, 2011 at 5:34 AM, wrote: > Problem: solve inequation 7*x+2<-x-3 > (%i1) S:7*x+2<-x-3$ > > 1 method > (%i2) assume(S); > (%o2) [x<-5/8] > > 2 method > (%i3) to_poly_solve([S], [x]); > Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:49 $ > (%o3) %union([x<-5/8]) > (%i4) sol:first(%); > (%o4) [x<-5/8] > > 3 method > (%i5) load(ineq)$ > (%i6) S-2; > (%o6) 7*x<-x-5 > (%i7) %+x; > (%o7) 8*x<-5 > (%i8) %/8; > (%o8) x<-5/8 > > 4 method > (%i9) load(solve_rat_ineq); > (%o9) > > "C:/PROGRA~2/MAXIMA~1.0/share/maxima/5.24.0/share/contrib/solve_rat_ineq.mac" > (%i10) solve_rat_ineq(S); > (%o10) [[x<-5/8]] > (%i11) sol:%[1]; > (%o11) [x<-5/8] > > 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 dbmaxima at gmail.com Sat Jun 4 03:50:06 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Sat, 04 Jun 2011 18:50:06 +1000 Subject: [Maxima] How to properly work with inequalities In-Reply-To: References: <9149aae9edbefd848fedc7f4f78deb60.squirrel@mail.mruni.eu> Message-ID: <4DE9F1BE.6050508@gmail.com> On 4/06/2011 3:16 PM, ross kyprianou wrote: > Can anyone please suggest the best way to find the real solutions to > inequalities involving exp() such as > exp(-4*x)>1/2 > Neither solve nor fourier_elim seem to help > > (%i13) load(fourier_elim)$ > (%i16) fourier_elim([exp(-4*x)>1/2],[x]); > > 4 x > (%o16) [2 - %e > 0] > > Hope you can help > Ross (%i1) display2d:false; (%o1) false (%i2) load(fourier_elim)$ (%i3) exp(-4*x)>1/2; (%o3) %e^-(4*x) > 1/2 (%i4) map(log,%); (%o4) -4*x > -log(2) (%i5) fourier_elim([%],[x]); (%o5) [x < log(2)/4] From woollett at charter.net Sat Jun 4 14:18:43 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 4 Jun 2011 12:18:43 -0700 Subject: [Maxima] Universal read_data function Message-ID: <4DA64D1CAED341968CAEF01A27E24CCA@edwinc367e16bd> On June 3, 2011, Paul Bowyer wrote: -------------------------------- [snip] With the CRLF sequences in the file, the read_data function chokes on the seemingly blank lines with the CRLF sequence whether I use: "if %l # "" then" or "if slength(%l) # 0 then" as the zero-length test I had to include: "%l : strim(" ", ssubst(" ", ascii(13), %l ) )," just prior to the zero-length test for proper operation. A simple work-around for linux/unix users is to run, from a terminal window: dos2unix on the data file if dos2unix is installed. ------------------------------- Have you tried my last version of read_data(?) which, (in response to your suggestion) simply ignores any and all blank lines, as a good read_data function ought to do anyway, and also doesn't care about choice of end of line chars. (see below) Ted ------------------------- read_data([%v]) := block ([%s,%r,%l,%filename,%dsep,%mult:true,%mix:false, %whole:[],%ln], %filename : part (%v,1), if not stringp (%filename) then ( disp (" file name must be a Maxima string "), return (false)), if not file_search (%filename) then (disp (" file not found "),return (false)), if length (%v) = 1 then %mix : true else if length(%v) = 2 then %dsep : part (%v,2) else if length (%v) = 3 then (%dsep : part (%v,2), %mult : part (%v,3)) else (%dsep : part (%v,2), %mult : part (%v,3),%whole : part(%v,4)), %s : openr (%filename), %r : [], %ln : 0, while (%l : readline(%s)) # false do if slength(%l) # 0 then ( %ln : %ln + 1, if %dsep = "text" then %r : cons (%l,%r) else if not lfreeof (%whole,%ln) then %r : cons (%l,%r) else if %mix then %r : cons (map(parse_string, split(ssubst (" ",",",%l))), %r) else %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r)), close (%s), reverse (%r))$ ------------------------------- From woollett at charter.net Sat Jun 4 15:48:21 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 4 Jun 2011 13:48:21 -0700 Subject: [Maxima] search_file, a simple text search utility Message-ID: <4D20FC092BDE445E874C2DAD8A43ED16@edwinc367e16bd> The function search_file builds on the string tools recently created in writing text_replace. The simplest two arg form only returns line numbers and line text if the substring appears as a distinct word (as defined by sword). ------------------------------------------------ (%i1) display2d:false$ (%i2) load(mtext); (%o2) "c:/work2/mtext.mac" (%i3) printfile("text1.txt")$ is this line one? Yes, this is line one. This might be line two. Here is line three. I insist that this be line four. This is line five, isn't it? (%i4) search_file ("text1.txt","is"); 1 is this line one? Yes, this is line one. 3 Here is line three. 5 This is line five, isn't it? (%o4) done (%i5) search_file ("text1.txt","is",word)$ 1 is this line one? Yes, this is line one. 3 Here is line three. 5 This is line five, isn't it? (%i6) search_file ("text1.txt","is",all)$ 1 is this line one? Yes, this is line one. 2 This might be line two. 3 Here is line three. 4 I insist that this be line four. 5 This is line five, isn't it? ------------------------------------- The code for search_file is: ------------------------------ search_file ([%u]) := block ([%fname,%ss,%tmode : word,%lines,%flines:[],%ls,%nl:0,%p], %fname : part (%u,1), if not stringp (%fname) then ( disp (" file name must be a Maxima string "), return (false)), if not file_search (%fname) then (disp (" file not found "),return (false)), %ss : part (%u,2), if not stringp (%ss) then ( disp (" second arg must be a string "), return (false)), if length (%u) > 2 then %tmode : part (%u,3), %lines : read_text (%fname), if not %lines then return (false), if length (%lines) = 0 then return(false), for %ls in %lines do (%nl : %nl + 1, if slength (%ls) # 0 then ( if %tmode = word then %nfirst : wsearch(%ss,%ls) else %nfirst : ssearch(%ss,%ls), if integerp (%nfirst) then %flines : cons ([%nl,%ls],%flines))), %flines : reverse (%flines), if length (%flines) = 0 then return (false), for %p in %flines do printf(true," ~d ~a ~%",part (%p,1),part (%p,2)))$ ---------------------------------------- search_file first uses read_text, whose code is: -------------------------------------------------- /**************** read_text *******************************/ /* read_text(filename) preserves blank lines in the source file, and reads in each line as a string, returns a list of strings, one for each physical line in the source file. */ read_text(%filename) := block ([%s,%r:[],%l ], if not stringp (%filename) then ( disp (" file name must be a Maxima string "), return (false)), if not file_search (%filename) then (disp (" file not found "),return (false)), %s : openr (%filename), while (%l : readline(%s)) # false do %r : cons (%l,%r), close(%s), reverse (%r))$ --------------------------- When looking for lines with distinct words, search_file uses wsearch (which calls sword): ----------------------------------------------------- /************ wsearch ******************/ wsearch(%substr,%string) := sword (%string,%substr,1)$ /* (%i10) load(mtext); (%o10) "c:/work2/mtext.mac" (%i11) ss : openr("text1.txt"); (%o11) ?\#\ (%i12) ls : readline(ss); (%o12) "is this line one? Yes, this is line one." (%i13) wsearch("is",ls); (%o13) 1 (%i14) ls : readline(ss); (%o14) "This might be line two." (%i15) wsearch("is",ls); (%o15) false (%i16) ls : readline(ss); (%o16) "Here is line three." (%i17) wsearch("is",ls); (%o17) 6 (%i18) ls : readline(ss); (%o18) "I insist that this be line four." (%i19) wsearch("is",ls); (%o19) false (%i20) ls : readline(ss); (%o20) "This is line five, isn't it?" (%i21) wsearch("is",ls); (%o21) 6 (%i22) close(ss); (%o22) true */ -------------------------- Ted Woollett From pbowyer at olynet.com Sat Jun 4 17:54:57 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sat, 04 Jun 2011 15:54:57 -0700 Subject: [Maxima] Fwd: Re: Universal read_data function Message-ID: <4DEAB7C1.2000203@olynet.com> I forgot the maxima list again... -------- Original Message -------- Subject: Re: Universal read_data function Date: Sat, 04 Jun 2011 15:45:43 -0700 From: Paul Bowyer To: Edwin Woollett On 06/04/2011 12:18 PM, Edwin Woollett wrote: > On June 3, 2011, Paul Bowyer wrote: > -------------------------------- > [snip] > With the CRLF sequences in the file, the read_data function chokes on > the seemingly blank lines with the CRLF sequence whether I use: > "if %l # "" then" > or > "if slength(%l) # 0 then" > > as the zero-length test > > I had to include: > "%l : strim(" ", ssubst(" ", ascii(13), %l ) )," > just prior to the zero-length test for proper operation. > > A simple work-around for linux/unix users is to run, from a terminal > window: > dos2unix on the data file if dos2unix is installed. > ------------------------------- > > Have you tried my last version of read_data(?) which, > (in response to your suggestion) simply ignores any and > all blank lines, as a good read_data function ought to > do anyway, and also doesn't care about choice of > end of line chars. > (see below) > > Ted > ------------------------- > read_data([%v]) := > block ([%s,%r,%l,%filename,%dsep,%mult:true,%mix:false, > %whole:[],%ln], > > %filename : part (%v,1), > > if not stringp (%filename) > then ( disp (" file name must be a Maxima string "), > return (false)), > > if not file_search (%filename) then > (disp (" file not found "),return (false)), > > if length (%v) = 1 then %mix : true > else if length(%v) = 2 then %dsep : part (%v,2) > else if length (%v) = 3 then (%dsep : part (%v,2), %mult : part > (%v,3)) > else (%dsep : part (%v,2), %mult : part (%v,3),%whole : > part(%v,4)), > > > > %s : openr (%filename), > %r : [], > %ln : 0, > > while (%l : readline(%s)) # false do > if slength(%l) # 0 then > ( %ln : %ln + 1, > if %dsep = "text" then > %r : cons (%l,%r) > else if not lfreeof (%whole,%ln) then > %r : cons (%l,%r) > else if %mix then > %r : cons (map(parse_string, split(ssubst (" ",",",%l))), %r) > else %r : cons (map(parse_string, split(%l,%dsep,%mult)), %r)), > > close (%s), > reverse (%r))$ > ------------------------------- > > > Ted: That's the function I tried. The problem, at least on a Linux machine, is that "slength(%l)" returns 1 rather than 0 when there is a blank line with a CRLF line end because it sees the CR. Testing against [%l # ""] would have the same difficulty because of the CR in the string. I don't know if that is true for a Windows machine because I rarely use Windows any more. I have Windows XP on my Linux system, but it's been so long since I've booted it that I can't get it to boot any longer. I think that's because I added a drive and some partitions and Windows XP wants things a particular way before it will boot. I just haven't taken the time to see if I can get it to boot and still keep my Linux installations booting. It might be the case that Maxima on a Windows machine never sees the CRLF sequences and they are only a problem on Linux machines where the default line-end is a simple LF. If your read_data function on your Windows machine never sees a CR, then you would find it difficult to write code to catch one. Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From l.butler at ed.ac.uk Sun Jun 5 17:48:55 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sun, 5 Jun 2011 23:48:55 +0100 (BST) Subject: [Maxima] text_replace for one text string In-Reply-To: <8A6E7872CF4B4D07A9F812CBDE6D7712@edwinc367e16bd> References: <8A6E7872CF4B4D07A9F812CBDE6D7712@edwinc367e16bd> Message-ID: On Thu, 2 Jun 2011, Edwin Woollett wrote: < < The function text_replace is a one-string < tool which can be used to process a text file using higher level functions < which < operate on files. I haven't been following these threads, but I should say that cl-ppcre already has these capabilities and much more. The only thing that needs to be done is to write some code to make them accessible from the maxima repl. Likewise, cl-fad provides tools for working with files and directories. Both are in Maxima-CAS at the moment. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From woollett at charter.net Mon Jun 6 13:32:47 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 6 Jun 2011 11:32:47 -0700 Subject: [Maxima] lisp line continuation using Maxima Message-ID: <0C18B3ED903C4CF19D6051DFE2EFA8E9@edwinc367e16bd> If I use Maxima as a lisp programming engine, using either :lisp or to_lisp(); how can I enter code and continue entry on the next line without passing the unfinished line to lisp? Ted Woollett From toy.raymond at gmail.com Mon Jun 6 16:33:29 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 06 Jun 2011 17:33:29 -0400 Subject: [Maxima] lisp line continuation using Maxima References: <0C18B3ED903C4CF19D6051DFE2EFA8E9@edwinc367e16bd> Message-ID: >>>>> "Edwin" == Edwin Woollett writes: Edwin> If I use Maxima as a lisp programming engine, Edwin> using either :lisp or to_lisp(); Edwin> how can I enter code and continue entry on the next Edwin> line without passing the unfinished line to lisp? I don't know how to do that with :lisp; I always make sure it's all on one line. But to_lisp() drops you into a full Lisp REPL, so you shouldn't have any problems with partial lines, just like in a normal Lisp REPL. Ray From woollett at charter.net Mon Jun 6 18:05:59 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 6 Jun 2011 16:05:59 -0700 Subject: [Maxima] text_replace for one text string Message-ID: <4B247A3B682149319BCF4AA321F084EE@edwinc367e16bd> On June 5, 2011, Leo Butler wrote: ------------------------------------------- I haven't been following these threads, but I should say that cl-ppcre already has these capabilities and much more. The only thing that needs to be done is to write some code to make them accessible from the maxima repl. Likewise, cl-fad provides tools for working with files and directories. Both are in Maxima-CAS at the moment. ----------------------------------------------------- Thanks, Leo, for the info about the impending arrival of more text and file utilities in Maxima. I am assuming they will be available for the (non-compiling-source) windows user in the next version of Maxima? Also, will there be some documentation and examples in the help manual? With my 5.24.0 windows version: ..................................................................... MAXIMA> (scan "b" "foo bar baz but") Maxima encountered a Lisp error: Error in EVAL [or a callee]: The function SCAN is undefined. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. .................................................................... Also, I need to explain that my simple examples of using the current tools in Maxima are just meant as a simple tutorial introduction, for beginners, to first baby steps with Maxima programming and are not meant to be a contribution to the core abilities of Maxima. Thanks again, Ted From cfrangos at telkomsa.net Tue Jun 7 09:48:06 2011 From: cfrangos at telkomsa.net (Constantine Frangos) Date: Tue, 7 Jun 2011 16:48:06 +0200 Subject: [Maxima] Setting of gcd variable. Message-ID: <201106071648.06620.cfrangos@telkomsa.net> Dear List, I am using ratsimp() and fullratsimp() for simplification with the setting of the variable gcd = spmod. Any assistance with the following would be appreciated: (1) In a recent posting by Stavros Macrakis, it seems that the settings spmod = red and spmod = subres lead to cancellations in fractions, not obtainable with gcd = spmod. Which setting is best for the case of expressions with complicated trigonometric terms ? What known bugs/side-effects result for each possible value of spmod ? (2) Are facts entered using the assume() function, explicitly used by all/some simplification functions ? Thanks very much. Regards, Constantine Frangos. From willisb at unk.edu Tue Jun 7 10:11:09 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 7 Jun 2011 10:11:09 -0500 Subject: [Maxima] Setting of gcd variable. In-Reply-To: <201106071648.06620.cfrangos@telkomsa.net> References: <201106071648.06620.cfrangos@telkomsa.net> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I?am?using?ratsimp()?and?fullratsimp()?for?simplification?with?the?setting >of?the?variable?gcd?=?spmod. > >Any?assistance?with?the?following?would?be?appreciated: > >(1)?In?a?recent?posting?by?Stavros?Macrakis,?it?seems?that?the?settings >spmod?=?red?and?spmod?=?subres >lead?to?cancellations?in?fractions,?not?obtainable?with?gcd?=?spmod. > >Which?setting?is?best?for?the?case?of?expressions?with?complicated >trigonometric?terms??? Without knowing any thing more, I can't even guess. In general, spmod is the least likely to cause Maxima to halt with a Lisp error, but spmod sometimes misses simplifications that subres does. To decide what is best for your expressions, I'd suggest experimentation: gcd_try(e) := map(lambda([s], block([gcd : s], ratsimp(e))), ['red, 'subres, 'spmod, 'mod, false]); You can also experiment with algebraic set to true/false. >(2)?Are?facts?entered?using?the?assume()?function,?explicitly?used?by >all/some?simplification?functions?? Declared facts are used by some, but not all simplification functions: Example (%i1) assume(equal(x,0)); (%o1) [equal(x,0)] (%i2) [abs(x), cos(x),1+x, sign(x)]; (%o2) [0,cos(x),x+1,zero] When an assumption isn't considered by a (simplification) function, you might be able to get tellsimpafter to do the the job. >Thanks?very?much. >Regards, >Constantine?Frangos. >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From korte at lite.msu.edu Tue Jun 7 10:48:09 2011 From: korte at lite.msu.edu (Gerd Kortemeyer) Date: Tue, 7 Jun 2011 11:48:09 -0400 Subject: [Maxima] LON-CAPA 2.10 Released - More Mathematics Support Message-ID: <3ACA7B49-A88A-48BB-8D70-58D0D8A22B86@lite.msu.edu> Hi, We just released version 2.10 of LON-CAPA, http://www.lon-capa.org/ , a free open-source learning content management and assessment system. Version 2.10 makes better use of MAXIMA for homework and exams in science and mathematics, see http://www.lon-capa.org/presentations/VCUMath.pdf for a recent presentation of the new mathematics functionality. Besides STACK, http://www.stack.bham.ac.uk/wiki/index.php/Main_Page , LON-CAPA is a system that allows to use MAXIMA (as well as R, GnuPlot, GeoGebra, LaTeX, ...) in teaching, and is thus hopefully of some interest to this list. - Gerd. -- Gerd Kortemeyer, Ph.D. Michigan State University http://www.lite.msu.edu/kortemeyer/ From macrakis at alum.mit.edu Tue Jun 7 10:57:14 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 7 Jun 2011 11:57:14 -0400 Subject: [Maxima] Setting of gcd variable. In-Reply-To: <201106071648.06620.cfrangos@telkomsa.net> References: <201106071648.06620.cfrangos@telkomsa.net> Message-ID: The rational function package knows nothing about trigonometric functions: 2*cos(x)+sin(x)^3/3 is represented as (6*q1 + q2^3)/3, where q1=cos(x) and q2=sin(x). Any simplifications specific to trigonometric functions are handled in the general simplifier. ratsimp recursively applies rational function packages, so ratsimp( sin((x^2-1)/(x-1)) ) => sin(x+1). The differences among the various settings of gcd come up when the polynomials do not factor over the integers. For example, x^2 - 2 does not factor over the integers, but is evenly divisible by x-sqrt(2) over the algebraic numbers. Facts declared using assume are not used by the rational function package, but they are used (though not very consistently) in the general simplifier. Mostly this is used to determine whether quantities are in some appropriate range, so for example abs(x) => x when x>= 0. That said, many cases are not covered (usually for reasons of implementation ease or efficiency). For example, assume(q1>0,q1<1) floor(q1)=>0 but assume(q2>1,q2<2) floor(q2) => unsimplified and assume(equal(q3,0)) floor(q3) => q3 (better than floor(q3), but why not 0?). In general, equal is the least well supported: declaring assume(equal(x,0)) does *not* have the effect of substituting zero for x in all subsequent uses (why not? no good reason, really), and assume(equal(r1,r2)) does not simplify r1-r2 => 0. -s On Tue, Jun 7, 2011 at 10:48, Constantine Frangos wrote: > > Dear List, > > I am using ratsimp() and fullratsimp() for simplification with the setting > of the variable gcd = spmod. > > Any assistance with the following would be appreciated: > > (1) In a recent posting by Stavros Macrakis, it seems that the settings > spmod = red and spmod = subres > lead to cancellations in fractions, not obtainable with gcd = spmod. > > Which setting is best for the case of expressions with complicated > trigonometric terms ? > > What known bugs/side-effects result for each possible value of spmod ? > > > (2) Are facts entered using the assume() function, explicitly used by > all/some simplification functions ? > > Thanks very much. > Regards, > Constantine Frangos. > _______________________________________________ > 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 dsimcha at gmail.com Tue Jun 7 09:44:54 2011 From: dsimcha at gmail.com (David Simcha) Date: Tue, 7 Jun 2011 10:44:54 -0400 Subject: [Maxima] Differentiating w.r.t. A Subscript Message-ID: Let's say I want to differentiate a sum w.r.t. one of its terms. Below is a trivial case, though my real case is more complex. (%i1) expr : sum(x[i], i, 1, N); N ==== \ (%o1) > x / i ==== i = 1 (%i2) diff(expr, x[1]); (%o2) 0 (%i3) Of course the answer I'm looking for is 1. I want Maxima to treat the summation as if I had written out, for some fixed N: expr : x[1] + x[2] + x[3] + ... + x[N]; How do I get Maxima to behave more intelligently w.r.t. subscripts? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nmarais at gmail.com Wed Jun 8 07:06:11 2011 From: nmarais at gmail.com (Neilen Marais) Date: Wed, 8 Jun 2011 12:06:11 +0000 (UTC) Subject: [Maxima] Hash tables, anyone? References: Message-ID: Robert, Robert Dodier gmail.com> writes: > > On 7/2/10, Alexander Shulgin gmail.com> wrote: > > > Is it possible to get a reference to a hash table in maxima? > > Yes: try use_fast_arrays:true $ > Instead of attaching the hash table to a symbol property, > the hash table is put in the value slot of the symbol. > > The hash table is created the first time an attempt is > made to store something in it. Interesting, that also fixes the use of hash tables for my applicaion. Am I alone in wondering why that isn't the default behaviour? The whole hash table/symbol property seems like a black magic approach to me while the latter approach seems to be how it works in most modern languages. Simply a case of historic precedent? Cheers Neilen From macrakis at alum.mit.edu Wed Jun 8 08:14:38 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 8 Jun 2011 09:14:38 -0400 Subject: [Maxima] Differentiating w.r.t. A Subscript In-Reply-To: References: Message-ID: It is straightforward to have diff(x[i],x[j]) give kron_delta(i,j). The problem, though, is that you get messy expressions which Maxima doesn't know how to simplify usefully. For example, diff( sum( x[i]*x[n-i+1], i, 1, n) , x[j] ) would result in 'sum(kron_delta(i,j)*x[n-i+1]+x[i]*kron_delta(n-i+1,j),i,1,n) The hard part is getting that to simplify to if n>=j then 2*x[n-j+1] else 0 As far as I know, no one has implemented such simplifications. It would certainly be a useful area to work on; an important special case of the more general problem of simplifying expressions involving conditionals. -s On Tue, Jun 7, 2011 at 10:44, David Simcha wrote: > Let's say I want to differentiate a sum w.r.t. one of its terms. Below is > a trivial case, though my real case is more complex. > > (%i1) expr : sum(x[i], i, 1, N); > N > ==== > \ > (%o1) > x > / i > ==== > i = 1 > (%i2) diff(expr, x[1]); > (%o2) 0 > (%i3) > > Of course the answer I'm looking for is 1. I want Maxima to treat the > summation as if I had written out, for some fixed N: > > expr : x[1] + x[2] + x[3] + ... + x[N]; > > How do I get Maxima to behave more intelligently w.r.t. subscripts? > > _______________________________________________ > 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 Jun 8 08:55:11 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 8 Jun 2011 09:55:11 -0400 Subject: [Maxima] Differentiating w.r.t. A Subscript In-Reply-To: References: Message-ID: The case below could be handled by the transformations sum(a+b,...) => sum(a, ...) + sum(b,...) (which is valid only if the summation limit is finite) and then sum( kron_delta(a*i+b,j)* <...>, i, a, b) => if j>=a and j<=b then subst((j-b)/a,i,<...>) else 0 In the case below, this would result in (if j>=1 and j<=n then x[n-j+1]) + (if j>=1 and j<=n then x[n-j+1]) which Maxima can simplify to 2*(if j >= 1 and j <= n then x[n-j+1]) I'd think that such a method could be added to simpsum, but I haven't looked at its internals. Other useful simplifications for kron_delta include: kron_delta(i,j)*kron_delta(i,k) => kron_delta(i,j)*kron_delta(i,k)*kron_delta(j,k) Strangely enough, making it bigger like this really is a simplification in that explicitly including the j,k case enables kron_delta(i,1)*kron_delta(i,2) => 0 On Wed, Jun 8, 2011 at 09:14, Stavros Macrakis wrote: > It is straightforward to have diff(x[i],x[j]) give kron_delta(i,j). The > problem, though, is that you get messy expressions which Maxima doesn't know > how to simplify usefully. > > For example, diff( sum( x[i]*x[n-i+1], i, 1, n) , x[j] ) would result in > > 'sum(kron_delta(i,j)*x[n-i+1]+x[i]*kron_delta(n-i+1,j),i,1,n) > > The hard part is getting that to simplify to > > if n>=j then 2*x[n-j+1] else 0 > > As far as I know, no one has implemented such simplifications. It would > certainly be a useful area to work on; an important special case of the more > general problem of simplifying expressions involving conditionals. > > -s > > On Tue, Jun 7, 2011 at 10:44, David Simcha wrote: > >> Let's say I want to differentiate a sum w.r.t. one of its terms. Below is >> a trivial case, though my real case is more complex. >> >> (%i1) expr : sum(x[i], i, 1, N); >> N >> ==== >> \ >> (%o1) > x >> / i >> ==== >> i = 1 >> (%i2) diff(expr, x[1]); >> (%o2) 0 >> (%i3) >> >> Of course the answer I'm looking for is 1. I want Maxima to treat the >> summation as if I had written out, for some fixed N: >> >> expr : x[1] + x[2] + x[3] + ... + x[N]; >> >> How do I get Maxima to behave more intelligently w.r.t. subscripts? >> >> _______________________________________________ >> 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 Jun 8 09:32:50 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 8 Jun 2011 10:32:50 -0400 Subject: [Maxima] Differentiating w.r.t. A Subscript In-Reply-To: References: Message-ID: Oops, I used a and b in two different senses below and got the limits wrong... but you get the idea. On Wed, Jun 8, 2011 at 09:55, Stavros Macrakis wrote: > The case below could be handled by the transformations sum(a+b,...) => > sum(a, ...) + sum(b,...) (which is valid only if the summation limit is > finite) and then > > sum( kron_delta(a*i+b,j)* <...>, i, a, b) => if j>=a and j<=b then > subst((j-b)/a,i,<...>) else 0 > > In the case below, this would result in > > (if j>=1 and j<=n then x[n-j+1]) + (if j>=1 and j<=n then x[n-j+1]) > > which Maxima can simplify to > > 2*(if j >= 1 and j <= n then x[n-j+1]) > > I'd think that such a method could be added to simpsum, but I haven't > looked at its internals. > > Other useful simplifications for kron_delta include: > > kron_delta(i,j)*kron_delta(i,k) => > kron_delta(i,j)*kron_delta(i,k)*kron_delta(j,k) > > Strangely enough, making it bigger like this really is a simplification in > that explicitly including the j,k case enables > kron_delta(i,1)*kron_delta(i,2) => 0 > > > > On Wed, Jun 8, 2011 at 09:14, Stavros Macrakis wrote: > >> It is straightforward to have diff(x[i],x[j]) give kron_delta(i,j). The >> problem, though, is that you get messy expressions which Maxima doesn't know >> how to simplify usefully. >> >> For example, diff( sum( x[i]*x[n-i+1], i, 1, n) , x[j] ) would result in >> >> 'sum(kron_delta(i,j)*x[n-i+1]+x[i]*kron_delta(n-i+1,j),i,1,n) >> >> The hard part is getting that to simplify to >> >> if n>=j then 2*x[n-j+1] else 0 >> >> As far as I know, no one has implemented such simplifications. It would >> certainly be a useful area to work on; an important special case of the more >> general problem of simplifying expressions involving conditionals. >> >> -s >> >> On Tue, Jun 7, 2011 at 10:44, David Simcha wrote: >> >>> Let's say I want to differentiate a sum w.r.t. one of its terms. Below >>> is a trivial case, though my real case is more complex. >>> >>> (%i1) expr : sum(x[i], i, 1, N); >>> N >>> ==== >>> \ >>> (%o1) > x >>> / i >>> ==== >>> i = 1 >>> (%i2) diff(expr, x[1]); >>> (%o2) 0 >>> (%i3) >>> >>> Of course the answer I'm looking for is 1. I want Maxima to treat the >>> summation as if I had written out, for some fixed N: >>> >>> expr : x[1] + x[2] + x[3] + ... + x[N]; >>> >>> How do I get Maxima to behave more intelligently w.r.t. subscripts? >>> >>> _______________________________________________ >>> 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 lut.mentz at zen.co.uk Wed Jun 8 13:13:30 2011 From: lut.mentz at zen.co.uk (Lut Mentz) Date: Wed, 8 Jun 2011 19:13:30 +0100 Subject: [Maxima] CTensor : Problem with Weyl() and Petrov() ? Message-ID: <000c01cc2607$c80d4080$5d484552@albert2> CTensor "weyl()" function reports that the spacetime is conformally flat, but a call to "petrov()" gives type I. I would expect type O. Finger trouble, perhaps ? Regards, Lut Mentz -------------- next part -------------- An HTML attachment was scrubbed... URL: From lut.mentz at zen.co.uk Wed Jun 8 13:28:38 2011 From: lut.mentz at zen.co.uk (Lut Mentz) Date: Wed, 8 Jun 2011 19:28:38 +0100 Subject: [Maxima] Fw: CTensor : Problem with Weyl() and Petrov() ? - SORTED Message-ID: <001101cc2609$e6043ba0$5d484552@albert2> Whoops, I've done it again. Should have read the manual. I now get the expected type O after doing it properly. Regards, Lut Mentz ----- Original Message ----- From: Lut Mentz To: maxima at math.utexas.edu Sent: Wednesday, June 08, 2011 7:13 PM Subject: CTensor : Problem with Weyl() and Petrov() ? CTensor "weyl()" function reports that the spacetime is conformally flat, but a call to "petrov()" gives type I. I would expect type O. Finger trouble, perhaps ? Regards, Lut Mentz -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Wed Jun 8 14:38:22 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 8 Jun 2011 12:38:22 -0700 Subject: [Maxima] Universal read_data function Message-ID: On June 8, 2011, Paul Bowyer wrote: -------------------------- I tried your code and it works on the ndata9.dat that you sent along because that file contains only LF EOL chars, but when I tried it on ndata2.dat, which contains CRLF sequences, it chokes. Here's the marked up code that shows where it goes astray. ------------------------------------------------------------------------------------------------------------------------------ /*cint_val(%ss) := cint(charat(string(?read\-char(%ss)),3));*/ /*This might be more efficient and it gives the same result.*/ cint_val(%ss) := cint(cunlisp(?read\-char(%ss))); ------------------------------ Hi Paul, Let's try a new function and a new experiment. I am attaching three one line data files: line1w.txt is: ABCD[CR][LF] ( ie a windows text file) line1u.txt is ABCD[LF] (ie a unix text file ) line1m.txt is ABCD[CR] (ie a mac text file ) The new function eol_chars returns a list of the end of line chars found on the first line of any given file. When I run it on these three one line files I get: ------------------------ (%i1) display2d:false$ (%i2) load(eol_chars); (%o2) "c:/work2/eol_chars.mac" (%i3) printfile("line1w.txt")$ ABCD (%i4) eol_chars ("line1w.txt"); (%o4) [13,10] (%i5) printfile ("line1u.txt")$ ABCD (%i6) eol_chars ("line1u.txt"); (%o6) [10] (%i7) printfile ("line1m.txt")$ ABCD (%i8) eol_chars ("line1m.txt"); (%o8) [13] and just as a side check on previous work: (%i9) eol_chars ("ndata9.dat"); (%o9) [13,10] ----------------------------------- The code for eol_chars is (thanks for your suggestion to use cunlisp): eol_chars(%fname) := block([%s,%lch,eolL :[],%nch,%Nf : 0 ], %s : openr (%fname), do ( %lch : ?read\-char (%s,false), if %lch = false then return(), %nch : cint (cunlisp (%lch)), if not lfreeof ([10,13],%nch) then (%Nf : %Nf + 1, eolL : cons (%nch,eolL), if %Nf = 2 then return ()) else if %Nf = 1 then return()), close(%s), reverse (eolL))$ ------------------------- I am concerned that you found ndata9.dat to have a unix eol char (10), because the file I attached has windows eol chars (13,10), as confirmed above. Is there some automatic conversion of data and text files into unix end of line chars going on with your system?? Ted -------------- next part -------------- A non-text attachment was scrubbed... Name: eol_chars.mac Type: image/x-macpaint Size: 889 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: line1m.txt URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: line1u.txt URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: line1w.txt URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ndata9.dat Type: application/octet-stream Size: 93 bytes Desc: not available URL: From worwor at bellsouth.net Wed Jun 8 09:20:44 2011 From: worwor at bellsouth.net (Charles Russell) Date: Wed, 08 Jun 2011 09:20:44 -0500 Subject: [Maxima] Newby can't get "load" to work. Message-ID: <4DEF853C.7020708@bellsouth.net> maxima_userdir; "C:/Users/cdr/maxima" ************* load("test.max"); loadfile: failed to load C:/Users/cdr/maxima/test.max -- an error. To debug this try: debugmode(true); ************* yet the file is really there: /home/cdr$ ls C:/Users/cdr/maxima/test.max C:/Users/cdr/maxima/test.max ************* here is the file: /* test.max - test maxima */ /* put in maxima_userdir (e.g. cdr/maxima/) and then * call with load("test.max"); but not working */ a:3; b:4; c:a+b; ************** Above example from Windows 7, but have same problem in Debian (virtual, on VMWare). Also, "system" seems to work only on Windows XP, not Windows 7 or Debian, and only for the command-line version even on XP, so how do you navigate the file system? From woollett at charter.net Wed Jun 8 17:44:43 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 8 Jun 2011 15:44:43 -0700 Subject: [Maxima] file_convert to change eol chars of file Message-ID: <2EF236E3F09642FDAE9837E1438DCDBE@edwinc367e16bd> Some simple code, created as part of my revision of Ch. 2 of Maxima by Example, illustrates simple Maxima programming in the context of string manipulation. Here we use file_convert(source-file, new-file, new-type) to convert a windows eol file [cr][lf] to unix eol file [lf]. ------------------------- (%i1) load(eol_chars); (%o1) "c:/work2/eol_chars.mac" (%i2) printfile("text1w.txt")$ is this line one? Yes, this is line one. This might be line two. Here is line three. I insist that this be line four. This is line five, isn't it? (%i3) eol_chars("text1w.txt"); (%o3) [13,10] (%i4) file_length("text1w.txt"); (%o4) 152 (%i5) file_convert("text1w.txt","text2u.txt",unix); (%o5) true (%i6) printfile("text2u.txt")$ is this line one? Yes, this is line one. This might be line two. Here is line three. I insist that this be line four. This is line five, isn't it? (%i7) eol_chars("text2u.txt"); (%o7) [10] (%i8) file_length("text2u.txt"); (%o8) 147 ----------------------------------- code: read_text(%filename) := block ([%s,%r:[],%l ], if not stringp (%filename) then ( disp (" file name must be a Maxima string "), return (false)), if not file_search (%filename) then (disp (" file not found "),return (false)), %s : openr (%filename), while (%l : readline(%s)) # false do %r : cons (%l,%r), close(%s), reverse (%r))$ file_length (%fname) := block ([%s,%fl ], %s : openr (%fname), /* number of chars in file */ %fl : flength (%s), close (%s), %fl)$ eol_chars(%fname) := block([%s,%lch,eolL :[],%nch,%Nf : 0 ], if not file_search (%fname) then (disp(" file not found "),return(false)), %s : openr (%fname), do ( %lch : ?read\-char (%s,false), if %lch = false then return(), %nch : cint (cunlisp (%lch)), if not lfreeof ([10,13],%nch) then (%Nf : %Nf + 1, eolL : cons (%nch,eolL), if %Nf = 2 then return ()) else if %Nf = 1 then return()), close(%s), reverse (eolL))$ file_convert(%oldfname,%newfname,%newtype) := block ([%ntL,%otL,%snew,%eolL,%linesL,%l1 ], if %newtype = windows then %ntL : [13,10] else if %newtype = unix then %ntL : [10] else if %newtype = mac then %ntL : [13] else (disp (" valid types are windows, unix and mac "), return (false)), %otL : eol_chars (%oldfname), if %otL = %ntL then ( print ("check of first line of source file shows eol chars are already ",%newtype), return (false)), %snew : openw (%newfname), /* convert decimal form to strings */ %eolL : map ('ascii, %ntL), /* create list of strings containing contents (including blank lines) of old file using read_text (which uses readline, based on use of Lisp read-line ) */ %snew : openw (%newfname), %linesL : read_text (%oldfname), if (not %linesL) or (length (%linesL) = 0) then ( close(%snew), return(false)), for %l1 in %linesL do ( flatten (cons (%l1, %eolL)), apply ('sconcat, %%), printf (%snew,"~a",%%)), close (%snew))$ -------------------------------------- Ted Woollett From al_metwally at yahoo.com Wed Jun 8 18:44:25 2011 From: al_metwally at yahoo.com (Ahmad Abdo Metwally) Date: Wed, 8 Jun 2011 16:44:25 -0700 (PDT) Subject: [Maxima] (no subject) Message-ID: <8986.9117.qm@web36305.mail.mud.yahoo.com> http://jonathansteeleworks.com/supersurprise.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From cedric.listes at gmail.com Thu Jun 9 03:09:21 2011 From: cedric.listes at gmail.com (=?ISO-8859-1?Q?c=E9dric_ody?=) Date: Thu, 9 Jun 2011 10:09:21 +0200 Subject: [Maxima] simplify d(a^2*y^2)/d(a*y) with a constant Message-ID: Dear list-users, I would like to know if it is possible to use Maxima to non-dimensionalize a differential equation. Let say I have the expression expr:x+d(x^2)/dx I want to replace x by y with y=a*x I have used the following to do that subst(a*y,x,expr); The answer is a*y+d(a^2*y^2)/d(a*y) Is it possible to simplify the last term since a is constant? Thank you C?dric -------------- next part -------------- An HTML attachment was scrubbed... URL: From sourabh.bajaj at analog.com Thu Jun 9 01:16:04 2011 From: sourabh.bajaj at analog.com (Sourabh Bajaj) Date: Thu, 9 Jun 2011 11:46:04 +0530 Subject: [Maxima] Query Regarding Maxima Message-ID: <000001cc266c$ba647150$2f2d53f0$@bajaj@spd.analog.com> Dear Sir, I am trying to solve a system of non linear equations in Maxima but I get an error stating "The storage for CONS is exhausted". How can I solve this problem or its is that my hardware can't support it. Can you please help me with solving this command. algsys([(xp-xf1)*(2*x1-xf1-xp)+(yp-yf1)*(2*y1-yf1-yp)+(zp-zf1)*(2*z1-zf1-zp) -f1*f1+l1+l1, (xp-xf2)*(2*x1+2*a*d-xf2-xp)+(yp-yf2)*(2*y1+2*b*d-yf2-yp)+(zp-zf2)*(2*z1+2*c *d-zf2-zp)-f2*f2+l2+l2, (xp-xf3)*(2*x1+4*a*d-xf3-xp)+(yp-yf3)*(2*y1+4*b*d-yf3-yp)+(zp-zf3)*(2*z1+4*c *d-zf3-zp)-f3*f3+l2+l2, (xp-xf4)*(2*x1+6*a*d-xf4-xp)+(yp-yf4)*(2*y1+6*b*d-yf4-yp)+(zp-zf4)*(2*z1+6*c *d-zf4-zp)-f4*f4+l1+l1, 2*d*d*(a*a+b*b+c*c)-l1*l1+l2*l2, (x1-xp)*(x1-xp)+(y1-yp)*(y1-yp)+(z1-zp)*(z1-zp)-l1*l1, 4*a*d*(x1-xp)+4*b*d*(y1-yp)+4*c*d*(z1-zp)-3*(l2*l2-l1*l1)], [x1,y1,z1,a,b,c]); Thank you in advance Best Regards Sourabh Bajaj Analog Devices -------------- next part -------------- An HTML attachment was scrubbed... URL: From nmarais at gmail.com Thu Jun 9 04:37:27 2011 From: nmarais at gmail.com (Neilen Marais) Date: Thu, 09 Jun 2011 11:37:27 +0200 Subject: [Maxima] Function evaluates wrong when called from dblint Message-ID: <8762ofbb1k.fsf@gmail.com> I'm trying to integrate a function using dblint. The original integrand is specified in spherical coordinates, but I need to evaluate it on rectangular domains in order to compare it to the output of a numerical program I'm writing. In the example below the two functions f1() and f2() are identical apart from the debugging print statement. Note how in both cases f1(0.0, 0.0) and f2(0.0, 0.0) both evaluate to zero when called directly; when called from dblint the same parameter values result in something completely different as shown by the print statement! Am I doing something wrong here, or is there a bug going on? I'm using Maxima version 5.21.1 as packaged in 64-bit Ubuntu 10.10. Thanks Neilen (%i1) ratprint:false$ (%i2) sublis:[z=1/2]$ (%i3) f(x,y):=block([ r:sqrt(x^2+y^2+z^2), theta:acos(z/r), phi:(if is(equal(x, 0)) and is(equal(y, 0)) then 0 else atan2(y,x)), tmp], r:float(subst(sublis, r)), theta:float(subst(sublis,theta)), phi:float(subst(sublis,phi)), tmp:float(ev(subst(sublis, expr), eval)), /*(if tmp > 10000 then print([x, y, tmp, r, theta, phi]) else 0), */ print([x, y, tmp, r, theta, phi]), tmp)$ (%i4) expr:-(200*%pi*cos(phi)*cos(theta)*sin(theta)*cos((1000000000*%pi*z)/149896229-(1000000000*%pi*r)/149896229))/r$ (%i5) f(float(0.0), float(0.0)); [0.0,0.0,0.0,0.5,acos(0.5/r),0.0] (%o5) 0.0 (%i6) load (dblint); (%o6) "/usr/share/maxima/5.21.1/share/numeric/dblint.mac" (%i7) f2(x,y):=block([ r:sqrt(x^2+y^2+z^2), theta:acos(z/r), phi:(if is(equal(x, 0)) and is(equal(y, 0)) then 0 else atan2(y,x)), tmp], r:float(subst(sublis, r)), theta:float(subst(sublis,theta)), phi:float(subst(sublis,phi)), tmp:float(ev(subst(sublis, expr), eval)), (if tmp > 10000 then print([x, y, tmp, r, theta, phi]) else 0), /*print([x, y, tmp, r, theta, phi])*/ tmp)$ (%i8) f2(float(0), float(0)); (%o8) 0.0 (%i9) dblint(f2, lambda([x],-1/2), lambda([x], 1/2), -1/2, 1/2); [0.0,0.0,6.304713613808152*10^58,1.4850279263678455*10^-64,3.141592653589793-1.0*acos((1.4850279263678455*10^-64)/r),0.0] (%o9) 7.0052373486757241*10^55 From sourabh.bajaj at analog.com Thu Jun 9 04:39:50 2011 From: sourabh.bajaj at analog.com (Sourabh Bajaj) Date: Thu, 9 Jun 2011 15:09:50 +0530 Subject: [Maxima] Query Regarding Maxima Message-ID: <001301cc2689$322b1100$96813300$@bajaj@spd.analog.com> I have simplified some of the equations using a divide and conquer kind of strategy. And reduced my problem to a two variable one. Now the equations are : exp1=(2*beta4^2+2*beta3^2+2*beta2^2)*d^2*z1^2+( (4*alpha4*beta4+4*alpha3*beta3+4*alpha2*beta2)*d^2*y1+4*beta4*d^2*gamma4+4*b eta3*d^2*gamma3+4* beta2*d^2*gamma2)*z1+(2*alpha4^2+2*alpha3^2+2*alpha2^2)*d^2*y1^2+ (4*alpha4*d^2*gamma4+4*alpha3*d^2*gamma3+4*alpha2*d^2*gamma2)*y1+l2^2-l1^2+2 *d^2*gamma4^2+2*d^2* gamma3^2+2*d^2*gamma2^2 exp2=zp^2-2*z1*zp+(beta1^2+1)*z1^2+(2*alpha1*beta1*y1-2*beta1*xp+2*beta1*gam ma1)*z1+yp^2 -2*y1*yp+(alpha1^2+1)*y1^2+(2*alpha1*gamma1-2*alpha1*xp)*y1+xp^2-2*gamma1*xp -l1^2+gamma1^2 exp3=(-4*beta4*d*z1-4*alpha4*d*y1-4*d*gamma4)*zp+(4*beta4+4*beta1*beta2)*d*z 1^2+(-4* beta3*d*yp+(4*beta3+4*alpha1*beta2+4*alpha2*beta1+4*alpha4)*d*y1-4*beta2*d*x p+4*d*gamma4+4* beta1*d*gamma2+4*beta2*d*gamma1)*z1+(-4*alpha3*d*y1-4*d*gamma3)*yp+(4*alpha3 +4*alpha1*alpha2)* d*y1^2+(-4*alpha2*d*xp+4*d*gamma3+4*alpha1*d*gamma2+4*alpha2*d*gamma1)*y1-4* d*gamma2*xp-3*l2^2+ 3*l1^2+4*d*gamma1*gamma2 I just want to find, y1 & z1 and everything else is a constant. Can you please help me how to solve these. I have tried running the solution a lot of times but it gives the same error I stated earlier. -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Thu Jun 9 06:13:07 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 9 Jun 2011 06:13:07 -0500 Subject: [Maxima] simplify d(a^2*y^2)/d(a*y) with a constant In-Reply-To: References: Message-ID: The easiest way for me to to this is to use the (optional) positional derivative package. Example: For the DE m * diff(f(t),t,2) = k * f(t), substitute f(t) = g(omega * t). After that, choose omega: (%i1) load('pdiff)$ (%i2) m * diff(f(t),t,2) = k * f(t), f(t) := g(omega * t); (%o2) m*omega^2*g[(2)](omega*t)=k*g(omega*t) (%i3) ratsubst(t,omega*t,%); (%o3) m*omega^2*g[(2)](t)=k*g(t) (%i4) de : first(solve(%,diff(g(t),t,2))); (%o4) g[(2)](t)=(k*g(t))/(m*omega^2) (%i5) solve(1=coeff(rhs(de), g(t)),omega); (%o5) [omega=-sqrt(k/m),omega=sqrt(k/m)] (%i6) subst(second(%),de); (%o6) g[(2)](t)=g(t) --Barton (author of pdiff) -----maxima-bounces at math.utexas.edu wrote: ----- >To:?maxima at math.utexas.edu >From:?c?dric?ody? >Sent?by:?maxima-bounces at math.utexas.edu >Date:?06/09/2011?03:09AM >Subject:?[Maxima]?simplify?d(a^2*y^2)/d(a*y)?with?a?constant > >Dear?list-users, > >I?would?like?to?know?if?it?is?possible?to?use?Maxima?to?non-dimensionalize >a?differential?equation. > >Let?say?I?have?the?expression > >expr:x+d(x^2)/dx > >I?want?to?replace?x?by?y?with?y=a*x > > >I?have?used?the?following?to?do?that > >subst(a*y,x,expr); > >The?answer?is? > >a*y+d(a^2*y^2)/d(a*y) > >Is?it?possible?to?simplify?the?last?term?since?a?is?constant? > >Thank?you > >C?dric > > > > > >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From willisb at unk.edu Thu Jun 9 11:28:07 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 9 Jun 2011 11:28:07 -0500 Subject: [Maxima] Differentiating w.r.t. A Subscript In-Reply-To: References: Message-ID: maxima-bounces at math.utexas.edu wrote on 06/08/2011 08:55:11 AM: > Other useful simplifications for kron_delta include: > > kron_delta(i,j)*kron_delta(i,k) => kron_delta(i,j)*kron_delta(i,k)*kron_delta(j,k) To apply this rule, try something similar to (substitution for "*" by a lambda form is a trick that is worth knowing): (%i1) crunch_kron(e) := subst("*" = lambda([[s]], block([r : [], p : 1], for sk in s do ( if mapatom(sk) then p : p * sk else if op(sk)='kron_delta then r : append(args(sk),r) else p : p * sk), p * apply('xkron_delta, r))),e)$ (%i2) load('simplifying)$ (%i3) simp_xkron_delta([e]) := ( e : setify(e), xreduce("*", map(lambda([s], apply('kron_delta, s)), cartesian_product(e,e))))$ (%i4) simplifying(xkron_delta, simp_xkron_delta)$ (%i5) crunch_kron(z + f(kron_delta(a,4) * kron_delta(a,b))); (%o5) z+f(kron_delta(4,a)*kron_delta(4,b)*kron_delta(a,b)) (%i6) subst(b=5,%); (%o6) z+f(0) The function simp_xkron_delta is inefficient--the kron_delta function should be extended to (efficiently) accept n arguments. --Barton From woollett at charter.net Thu Jun 9 12:21:31 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 9 Jun 2011 10:21:31 -0700 Subject: [Maxima] Universal read_data function References: <4DF01FBB.20006@olynet.com> Message-ID: <4EB4812C2CAC429AAF991770AF810CAD@edwinc367e16bd> On June 8, 2011, Paul Bowyer wrote: ---------------------------------------- Evidently there is something going on with text file EOL conversion that happens in Thunderbird. I tried opening the attached data files directly with okteta by right-clicking on the attachment and selecting okteta, but Thunderbird uses some internal program/function to transfer the data. When I examined the data file in okteta I'd find the EOL chars to be either unix LF or, in the case of the macintosh file, non-existent. I also tried using notepad (comes with the Windows emulator, wine) and was unable to get the EOL chars the way you described them. I finally used kwrite as the opener after I had pre-configured it for the proper EOL sequences, but even then I had to manually modify a couple of the files by inserting spaces at the proper locations so I could then use okteta to convert those inserted spaces to CRs. After I got the EOL sequences set up according to those you described, I ran eol_chars and here are the results: ------------- printfile("/home/pfb/ndata9.dat")$ eol_chars("/home/pfb/ndata9.dat"); printfile("/home/pfb/line1w.txt")$ eol_chars("/home/pfb/line1w.txt"); printfile("/home/pfb/line1u.txt")$ eol_chars("/home/pfb/line1u.txt"); printfile("/home/pfb/line1m.txt")$ eol_chars("/home/pfb/line1m.txt"); 2 , 4.8, -3/4, "xyz", -2.8e-9 2 , 4.8, -3/4, "xyz", -2.8e-9 2 , 4.8, -3/4, "xyz", -2.8e-9 (%o4) [13,10] ABCD (%o6) [13,10] ABCD (%o8) [10] ABCD (%o10) [13] ---------------- So it looks like you have a working solution to the EOL situation that covers all of the platforms maxima runs on. By looking at the maxima documentation, I wouldn't have thought of using lfreeof as a way to discover character numbers in a string. So I learned something new about maxima that may come in handy one day. ----------------------------------------- Hi Paul, The next part of the experiment is to take those three one line files with known different eol chars and open each as a stream and then use the maxima function readline. The Maxima help manual description of readline is irritatingly vague. : --- readline (stream) Returns a string containing the characters from the current position in stream up to the end of the line or false if the end of the file is encountered. ---- (notice that 'end of line' is not defined there.) If you look at the lisp code for readline in stringproc.lisp, it uses the lisp function read-line, and the common lisp cookbook description of read-line is: ---- READ-LINE will read one line from a stream (which defaults to standard input) the end of which is determined by either a newline character or the end of the file. It will return this line as a string without the trailing newline character. (Note that READ-LINE has a second return value which is true if there was no trailing newline, i.e. if the line was terminated by the end of the file.) READ-LINE will by default signal an error if the end of the file is reached. You can inhibit this by supplying NIL as the second argument. If you do this, READ-LINE will return NIL if it reaches the end of the file. ----------------- So my literal reading of this is that the CL read-line will return all the chars up to the newline char (which I interpret to mean LF, decimal 10), and this would mean that Maxima's readline would return the CR (decimal 13) char as well as the first four chars "ABCD". --------------------------- So basically, I don't know who or what to believe, and thus this experiment. Is there a Lisp version dependency of read-line which will affect certain users of a universal read_data function?? (in which case I would have to write my own homemade read_line) ------------------------------------ Anyway, if your operating system and Lisp version cooperate as hoped for, you should get the following results: ------------------ (%i1) display2d:false$ (%i3) load(eol_chars); (%o3) "c:/work2/eol_chars.mac" (%i4) printfile("line1w.txt")$ ABCD (%i5) eol_chars ("line1w.txt"); (%o5) [13,10] (%i6) file_length ("line1w.txt"); (%o6) 6 (%i7) ss : openr ("line1w.txt"); (%o7) ?\#\ (%i8) al : readline (ss); (%o8) "ABCD" (%i9) slength(al); (%o9) 4 (%i10) close(ss); (%o10) true (%i11) printfile ("line1u.txt")$ ABCD (%i12) eol_chars ("line1u.txt"); (%o12) [10] (%i13) file_length ("line1u.txt"); (%o13) 5 (%i14) ss : openr ("line1u.txt"); (%o14) ?\#\ (%i15) al : readline (ss); (%o15) "ABCD" (%i16) slength (al); (%o16) 4 (%i17) close(ss); (%o17) true (%i18) printfile ("line1m.txt")$ ABCD (%i19) eol_chars ("line1m.txt"); (%o19) [13] (%i20) file_length ("line1m.txt"); (%o20) 5 (%i21) ss : openr ("line1m.txt"); (%o21) ?\#\ (%i22) al : readline (ss); (%o22) "ABCD" (%i23) slength (al); (%o23) 4 (%i24) close (ss); (%o24) true ------------------------- Ted From pbowyer at olynet.com Thu Jun 9 12:38:54 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Thu, 09 Jun 2011 10:38:54 -0700 Subject: [Maxima] Query Regarding Maxima In-Reply-To: <001301cc2689$322b1100$96813300$@bajaj@spd.analog.com> References: <001301cc2689$322b1100$96813300$@bajaj@spd.analog.com> Message-ID: <4DF1052E.40306@olynet.com> On 06/09/2011 02:39 AM, Sourabh Bajaj wrote: > > I have simplified some of the equations using a divide and conquer > kind of strategy. > > And reduced my problem to a two variable one. > > Now the equations are : > > exp1=(2*beta4^2+2*beta3^2+2*beta2^2)*d^2*z1^2+( > > (4*alpha4*beta4+4*alpha3*beta3+4*alpha2*beta2)*d^2*y1+4*beta4*d^2*gamma4+4*beta3*d^2*gamma3+4* > > beta2*d^2*gamma2)*z1+(2*alpha4^2+2*alpha3^2+2*alpha2^2)*d^2*y1^2+ > > (4*alpha4*d^2*gamma4+4*alpha3*d^2*gamma3+4*alpha2*d^2*gamma2)*y1+l2^2-l1^2+2*d^2*gamma4^2+2*d^2* > > gamma3^2+2*d^2*gamma2^2 > > exp2=zp^2-2*z1*zp+(beta1^2+1)*z1^2+(2*alpha1*beta1*y1-2*beta1*xp+2*beta1*gamma1)*z1+yp^2 > > -2*y1*yp+(alpha1^2+1)*y1^2+(2*alpha1*gamma1-2*alpha1*xp)*y1+xp^2-2*gamma1*xp-l1^2+gamma1^2 > > exp3=(-4*beta4*d*z1-4*alpha4*d*y1-4*d*gamma4)*zp+(4*beta4+4*beta1*beta2)*d*z1^2+(-4* > > beta3*d*yp+(4*beta3+4*alpha1*beta2+4*alpha2*beta1+4*alpha4)*d*y1-4*beta2*d*xp+4*d*gamma4+4* > > beta1*d*gamma2+4*beta2*d*gamma1)*z1+(-4*alpha3*d*y1-4*d*gamma3)*yp+(4*alpha3+4*alpha1*alpha2)* > > d*y1^2+(-4*alpha2*d*xp+4*d*gamma3+4*alpha1*d*gamma2+4*alpha2*d*gamma1)*y1-4*d*gamma2*xp-3*l2^2+ > > 3*l1^2+4*d*gamma1*gamma2 > > I just want to find, y1 & z1 and everything else is a constant. > > Can you please help me how to solve these. I have tried running the > solution a lot of times but it gives the same error I stated earlier. > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima I'm not much of a mathematician, but this caught my eye so I did the following as an exercise to see what maxima could do. I broke up your lengthy expressions into something I thought was more manageable because you stated everything except y1 and z1 were considered constant. If I didn't make a typo (or some other error) this is what maxima did: A=(2*beta4^2+2*beta3^2+2*beta2^2)*d^2; B=(4*alpha4*beta4+4*alpha3*beta3+4*alpha2*beta2)*d^2; C=+4*beta4*d^2*gamma4+4*beta3*d^2*gamma3+4*beta2*d^2*gamma2; D=(2*alpha4^2+2*alpha3^2+2*alpha2^2)*d^2; E=(4*alpha4*d^2*gamma4+4*alpha3*d^2*gamma3+4*alpha2*d^2*gamma2); F=l2^2-l1^2+2*d^2*gamma4^2+2*d^2*gamma3^2+2*d^2*gamma2^2; /*Then exp1 becomes exp1a*/ exp1a=A *z1^2 +( B *y1 + C ) *z1 + D *y1^2 + E *y1 +F; G=zp^2-2; H=zp+(beta1^2+1); I=2*alpha1*beta1; J=2*beta1*xp+2*beta1*gamma1; K=yp^2-2; L=yp+(alpha1^2+1); M=(2*alpha1*gamma1-2*alpha1*xp); N=xp^2-2*gamma1*xp-l1^2+gamma1^2; /*Then exp2 becomes exp2a*/ exp2a=G *z1 *H *z1^2 +(I *y1 -J) *z1 +K *y1 *L *y1^2 +M *y1 +N; O=-4*beta4*d; P=4*alpha4*d; Q=4*d*gamma4; R=zp+(4*beta4+4*beta1*beta2)*d; S=-4*beta3*d*yp+(4*beta3+4*alpha1*beta2+4*alpha2*beta1+4*alpha4)*d; T=4*beta2*d*xp+4*d*gamma4+4*beta1*d*gamma2+4*beta2*d*gamma1; U=-4*alpha3*d; V=4*d*gamma3; W=yp+(4*alpha3+4*alpha1*alpha2)*d; X=(-4*alpha2*d*xp+4*d*gamma3+4*alpha1*d*gamma2+4*alpha2*d*gamma1); Y=4*d*gamma2*xp-3*l2^2+3*l1^2+4*d*gamma1*gamma2; /*Then exp3 becomes exp3a*/ exp3a=(O *z1 -P *y1 -Q) *R *z1^2 +(S *y1 -T) *z1 +(U *y1 -V) *W *y1^2 +X *y1 -Y; solve([exp1a,exp2a,exp3a],[y1,z1]); [] As you can see by the empty solution from solve, there appears to be no solution, but since I'm not much of a mathematician, there might be better ways to approach this problem. I also tried doing: solve([exp1,exp2,exp3],[y1,z1]); [] Which maxima also could not solve, but I got no error messages from the attempt. build_info (); gives the following: Maxima version: 5.24post Maxima build date: 13:38 5/16/2011 Host type: i686-pc-linux-gnu Lisp implementation type: CMU Common Lisp Lisp implementation version: Snapshot 2011-02 (20B Unicode) Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbowyer at olynet.com Thu Jun 9 15:53:11 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Thu, 09 Jun 2011 13:53:11 -0700 Subject: [Maxima] Universal read_data function Message-ID: <4DF132B7.2070105@olynet.com> I keep forgetting to copy the maxima list on my replies. It's probably a habit I'll have difficulty breaking now. -------- Original Message -------- Subject: Re: Universal read_data function Date: Thu, 09 Jun 2011 13:50:57 -0700 From: Paul Bowyer To: Edwin Woollett On 06/09/2011 10:21 AM, Edwin Woollett wrote: > On June 8, 2011, Paul Bowyer wrote: > ---------------------------------------- > Evidently there is something going on with text file EOL conversion that > happens in Thunderbird. I tried opening the attached data files directly > with okteta by right-clicking on the attachment and selecting okteta, > but Thunderbird uses some internal program/function to transfer the > data. When I examined the data file in okteta I'd find the EOL chars to > be either unix LF or, in the case of the macintosh file, non-existent. I > also tried using notepad (comes with the Windows emulator, wine) and was > unable to get the EOL chars the way you described them. I finally used > kwrite as the opener after I had pre-configured it for the proper EOL > sequences, but even then I had to manually modify a couple of the files > by inserting spaces at the proper locations so I could then use okteta > to convert those inserted spaces to CRs. > > After I got the EOL sequences set up according to those you described, I > ran eol_chars and here are the results: > ------------- > printfile("/home/pfb/ndata9.dat")$ > eol_chars("/home/pfb/ndata9.dat"); > > printfile("/home/pfb/line1w.txt")$ > eol_chars("/home/pfb/line1w.txt"); > > printfile("/home/pfb/line1u.txt")$ > eol_chars("/home/pfb/line1u.txt"); > > printfile("/home/pfb/line1m.txt")$ > eol_chars("/home/pfb/line1m.txt"); > > 2 , 4.8, -3/4, "xyz", -2.8e-9 > > 2 , 4.8, -3/4, "xyz", -2.8e-9 > > 2 , 4.8, -3/4, "xyz", -2.8e-9 > > (%o4) [13,10] > ABCD > (%o6) [13,10] > ABCD > (%o8) [10] > ABCD > (%o10) [13] > ---------------- > So it looks like you have a working solution to the EOL situation that > covers all of the platforms maxima runs on. > > By looking at the maxima documentation, I wouldn't have thought of using > lfreeof as a way to discover character numbers in a string. So I learned > something new about maxima that may come in handy one day. > ----------------------------------------- > Hi Paul, > > The next part of the experiment is to take those three one > line files with known different eol chars and open each as > a stream and then use the maxima function readline. > > The Maxima help manual description of readline is irritatingly > vague. : > --- > readline (stream) > > Returns a string containing the characters from the current position > in stream up to the end of the line or false if the end of the file is > encountered. > > ---- > (notice that 'end of line' is not defined there.) > > If you look at the lisp code for readline in stringproc.lisp, it uses > the lisp function read-line, and the common lisp cookbook description > of read-line is: > ---- > READ-LINE will read one line from a stream (which defaults to standard > input) the end of which is determined by either a newline character or > the end of the file. It will return this line as a string without the > trailing newline character. (Note that READ-LINE has a second return > value which is true if there was no trailing newline, i.e. if the line > was terminated by the end of the file.) READ-LINE will by default > signal an error if the end of the file is reached. You can inhibit > this by supplying NIL as the second argument. If you do this, > READ-LINE will return NIL if it reaches the end of the file. > ----------------- > So my literal reading of this is that the CL read-line will return all > the chars up to > the newline char (which I interpret to mean LF, decimal 10), and this > would mean > that Maxima's readline would return the CR (decimal 13) char as well > as the > first four chars "ABCD". > --------------------------- > So basically, I don't know who or what to believe, and thus this > experiment. Is there a Lisp version dependency of read-line which > will affect certain users of a universal read_data function?? > (in which case I would have to write my own homemade read_line) > ------------------------------------ > Anyway, if your operating system and Lisp version cooperate as > hoped for, you should get the following results: > > ------------------ > (%i1) display2d:false$ > (%i3) load(eol_chars); > (%o3) "c:/work2/eol_chars.mac" > (%i4) printfile("line1w.txt")$ > ABCD > (%i5) eol_chars ("line1w.txt"); > (%o5) [13,10] > (%i6) file_length ("line1w.txt"); > (%o6) 6 > (%i7) ss : openr ("line1w.txt"); > (%o7) ?\#\ > (%i8) al : readline (ss); > (%o8) "ABCD" > (%i9) slength(al); > (%o9) 4 > (%i10) close(ss); > (%o10) true > (%i11) printfile ("line1u.txt")$ > ABCD > (%i12) eol_chars ("line1u.txt"); > (%o12) [10] > (%i13) file_length ("line1u.txt"); > (%o13) 5 > (%i14) ss : openr ("line1u.txt"); > (%o14) ?\#\ > (%i15) al : readline (ss); > (%o15) "ABCD" > (%i16) slength (al); > (%o16) 4 > (%i17) close(ss); > (%o17) true > (%i18) printfile ("line1m.txt")$ > ABCD > (%i19) eol_chars ("line1m.txt"); > (%o19) [13] > (%i20) file_length ("line1m.txt"); > (%o20) 5 > (%i21) ss : openr ("line1m.txt"); > (%o21) ?\#\ > (%i22) al : readline (ss); > (%o22) "ABCD" > (%i23) slength (al); > (%o23) 4 > (%i24) close (ss); > (%o24) true > ------------------------- > Ted > > > Hi Ted: I discovered that I didn't have your 'file_length ("pathname")' so I substituted "fl : flength(ss) which should give similar results. Here's the input and results: /*More testing of eol_chars: line1w*/ printfile("/home/pfb/line1w.txt")$ eol_chars("/home/pfb/line1w.txt"); ss : openr("/home/pfb/line1w.txt"); fl : flength(ss ); al : readline (ss); close(ss); ABCD (%o22) [13,10] (%o23) Stream [CHARACTER] (%o24) 6 (%o25) "ABCD?" (%o26) true /*More testing of eol_chars: line1u*/ printfile("/home/pfb/line1u.txt")$ eol_chars("/home/pfb/line1u.txt"); ss : openr("/home/pfb/line1u.txt"); fl : flength(ss ); al : readline (ss); close(ss); ABCD (%o28) [10] (%o29) Stream [CHARACTER] (%o30) 5 (%o31) "ABCD" (%o32) true /*More testing of eol_chars: line1m*/ printfile("/home/pfb/line1m.txt")$ eol_chars("/home/pfb/line1m.txt"); ss : openr("/home/pfb/line1m.txt"); fl : flength(ss ); al : readline (ss); close(ss); ABCD (%o34) [13] (%o35) Stream [CHARACTER] (%o36) 5 (%o37) "ABCD?" (%o38) true The ? is the CR in the file. Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri Jun 10 13:57:41 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 10 Jun 2011 14:57:41 -0400 Subject: [Maxima] Maxima git link broken Message-ID: <4DF26925.4090304@gmail.com> At the bottom of http://maxima.sourceforge.net/download.html there's a link to the git page for maxima. The link is broken. Can someone fix that? (Also, the text should probably smaller instead of being the same size as the CVS heading. There should probably also be a note saying CVS is not longer used, and maybe add a new section titled GIT.) Ray From l.butler at ed.ac.uk Fri Jun 10 18:55:24 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sat, 11 Jun 2011 00:55:24 +0100 (BST) Subject: [Maxima] Newby can't get "load" to work. In-Reply-To: <4DEF853C.7020708@bellsouth.net> References: <4DEF853C.7020708@bellsouth.net> Message-ID: On Wed, 8 Jun 2011, Charles Russell wrote: < maxima_userdir; < "C:/Users/cdr/maxima" < ************* < load("test.max"); < loadfile: failed to load C:/Users/cdr/maxima/test.max < -- an error. To debug this try: debugmode(true); < ************* < yet the file is really there: < /home/cdr$ ls C:/Users/cdr/maxima/test.max < C:/Users/cdr/maxima/test.max < ************* < here is the file: < /* test.max - test maxima */ < /* put in maxima_userdir (e.g. cdr/maxima/) and then < * call with load("test.max"); but not working */ < a:3; < b:4; < c:a+b; < ************** If you rename your file to test.mac does load work? < Also, "system" seems to work only on Windows XP, not Windows 7 or Debian, and < only for the command-line version even on XP, so how do you navigate the file < system? Could you send us the output of build_info(); please. Could you also explain what you mean by "work". That is, what commands are you typing in and what are the results. Note that if you are trying to change the working directory via system, this will not work: system launches a subshell, executes the system command in that subshell, and returns. It is like typing (cd /tmp; pwd) pwd on the Linux command line. The Maxima command ?xchdir("/tmp") will change the working directory of the Maxima process. That question mark is not a typo. I put the following in my maxima-init.mac file cd(dir) := ?xchdir(dir); Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From l.butler at ed.ac.uk Fri Jun 10 21:58:31 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sat, 11 Jun 2011 03:58:31 +0100 (BST) Subject: [Maxima] Maxima git link broken In-Reply-To: <4DF26925.4090304@gmail.com> References: <4DF26925.4090304@gmail.com> Message-ID: On Fri, 10 Jun 2011, Raymond Toy wrote: < At the bottom of http://maxima.sourceforge.net/download.html there's a < link to the git page for maxima. The link is broken. Can someone fix that? Thanks for the prod, Ray. I asked the webmaster to do it when we changed over to git, but forgot to checkup on it. I've made the changes to the xml file, but I need to find a tool to process it into html because xsltproc on debian is hanging. When I get that sorted, I'll make the changes. < < (Also, the text should probably smaller instead of being the same size < as the CVS heading. There should probably also be a note saying CVS is < not longer used, and maybe add a new section titled GIT.) Agreed. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From adammaj1 at o2.pl Sat Jun 11 06:22:26 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Sat, 11 Jun 2011 11:22:26 +0000 (UTC) Subject: [Maxima] contour plot Message-ID: Hi, I woluld like to make contour plots of real part of 6-th iteration of complex number, like fig 5 in paper : "Real and imaginary parts of polynomial iterates " by Julia A. Barnes, Clinton P. Curry nyjm.albany.edu/j/2010/16-29v.pdf or http://en.wikibooks.org/wiki/File:Julia_dendrit_modified.png I have made some code : ------------------- f(x,y):=block( [z,c,nMax], nMax:6, c:%i, z:x+y*%i, for n:1 thru nMax step 1 do z:z*z+c, return(imagpart(z)) ); contour_plot (f(x,y), [x, -4, 4], [y, -4, 4],[adapt_depth, 10], [nticks,50])$ -------------------- But the result is not good. Can I do it better ? Thx in advance Adam From jmbr at superadditive.com Sat Jun 11 10:02:22 2011 From: jmbr at superadditive.com (Juan M. Bello Rivas) Date: Sat, 11 Jun 2011 17:02:22 +0200 Subject: [Maxima] Default width of tex1 in mactex.lisp Message-ID: Hi, There is a hardcoded value for the width of the output produced by tex1. This value is inside the function myprinc and cannot be tweaked easily. Here is a patch that changes that value to use linel instead, although I am not sure if linel is the best choice in this case. Best regards, -- Juan M. Bello Rivas -------------- next part -------------- A non-text attachment was scrubbed... Name: mactex.diff Type: application/octet-stream Size: 478 bytes Desc: not available URL: From yasuaki.honda at gmail.com Sat Jun 11 10:59:07 2011 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Sun, 12 Jun 2011 00:59:07 +0900 Subject: [Maxima] A bug with tex() and make_array() Message-ID: Dear all, I have encountered a bug in tex() when passed a lisp array created using make_array(). The following session is obtained using 5.24.0 with closure common lisp. (This bug occurs with CMUCL and SBCL as well). (%i2) b:make_array(any,3); (%o2) ?\#\(NIL\ NIL\ NIL\) (%i3) tex(b); $$ Maxima encountered a Lisp error: value #(NIL NIL NIL) is not of the expected type SYMBOL. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i4) This is due to the fact that the function tex-atom in mactex.lisp is not prepared to accept a lisp array as its argument. The fix should be not complex. The following is a possible fix of tex-atom function. % git diff mactex.lisp diff --git a/src/mactex.lisp b/src/mactex.lisp index df0ee41..466605f 100644 --- a/src/mactex.lisp +++ b/src/mactex.lisp @@ -246,9 +246,13 @@ ((get (caar x) 'tex) (funcall (get (caar x) 'tex) x l r)) (t (tex-function x l r nil)))) +(defvar *LispArray-string* "\\left| Lisp Array ~D \\right|") + (defun tex-atom (x l r) ;; atoms: note: can we lose by leaving out {}s ? (append l - (list (cond ((numberp x) (texnumformat x)) + (list (cond ((arrayp x) + (tex-string (format nil *LispArray-string* (array-total-size x)))) + ((numberp x) (texnumformat x)) ((and (symbolp x) (or (get x 'texword) (get (get x 'reversealias) 'texword)))) ((stringp x) (tex-string (quote-% (if $stringdisp (concatenate 'string "``" x "''") x)))) If everyone is OK, I would like to commit above changes to the git repository. Any feedback is welcome. Thanks and best regards, Yasuaki Honda, Japan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomdean at speakeasy.org Sat Jun 11 12:58:20 2011 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Sat, 11 Jun 2011 10:58:20 -0700 Subject: [Maxima] Maxima equivalent of ls Message-ID: <1307815100.2402.46.camel@asus> How do I do common things like ls pwd I found ?xchdir. But, cannot find the others. tomdean From volkervannek at googlemail.com Sat Jun 11 13:53:34 2011 From: volkervannek at googlemail.com (Volker van Nek) Date: Sat, 11 Jun 2011 20:53:34 +0200 Subject: [Maxima] Maxima equivalent of ls In-Reply-To: <1307815100.2402.46.camel@asus> References: <1307815100.2402.46.camel@asus> Message-ID: There is the function system. E.g. (%i1) system("whoami;hostname;pwd"); volker uvw32 /home/volker (%o1) # but it seams that the informations you want cannot be retrieved as return values. Dont know if this is of much help. Volker van Nek 2011/6/11 Thomas D. Dean > How do I do common things like > > ls > pwd > > I found ?xchdir. But, cannot find the others. > > tomdean > > > _______________________________________________ > 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 Jun 11 15:05:52 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 11 Jun 2011 15:05:52 -0500 Subject: [Maxima] contour plot In-Reply-To: References: Message-ID: Try replacing [nticks,50] with [grid, 100, 100]). --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >contour_plot?(f(x,y),?[x,?-4,?4],?[y,?-4,?4],[adapt_depth,?10],[nticks,50])$ >But?the?result?is?not?good. Can?I?do?it?better?? From woollett at charter.net Sat Jun 11 17:43:14 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 11 Jun 2011 15:43:14 -0700 Subject: [Maxima] Universal read_line and print_line cure mac file read problems Message-ID: <6BB61C4193B14DE9936626D0140A1701@edwinc367e16bd> The present Maxima functions readline and printline behave as if mac text files have no end of line chars, so blank lines are ignored and everything in the file is returned as one string on one line. (This is, at least, what I observe on my Windows XP machine with xmaxima and ver. 5.24.0). Hence (as part of my effort to create a universal read_data, etc function(s) in connection with ch 2, Maxima by Example revisions), I have written new read_line and new print_line functions which hopefully should cure these problems. The new function read_line should replace readline in all my posted string manipulation functions. Here is a short demo using a three line mac text file, with text on the first line, followed by a blank line, followed by more text on the third line: ----------------------------------- (%i1) display2d:false$ (%i2) load(eol_chars); (%o2) "c:/work2/eol_chars.mac" (%i3) eol_chars ("line1b1m.txt"); (%o3) [13] (%i4) printfile ("line1b1m.txt")$ The calculation of the effective cross section is much simplified if onlythose collisi ons are considered for which the impact parameter is large, so (%i5) print_file ("line1b1m.txt")$ The calculation of the effective cross section is much simplified if only those collisions are considered for which the impact parameter is large, so (%i6) ss : openr("line1b1m.txt"); (%o6) ?\#\ (%i7) readline(ss); (%o7) "The calculation of the effective cross section is much simplified if onlythose collisions are considered for which the impact parameter is large, so" (%i8) readline(ss); (%o8) false (%i9) fposition (ss,1); (%o9) true (%i10) read_line(ss); (%o10) "The calculation of the effective cross section is much simplified if only" (%i11) read_line (ss); (%o11) "" (%i12) read_line (ss); (%o12) "those collisions are considered for which the impact parameter is large, so" (%i13) read_line (ss); (%o13) false (%i14) close(ss); (%o14) true -------------------------------- The code for read_line is -------------------------------------- read_line(%str) := block ([%l,%ls,%lls,%n, %rL:[],%tfflag:false, %lp,%lps,%llps,%np,%p,%bflag:false ], do ( %p : fposition(%str), %l : ?read\-char (%str, false), if %l = false then (%tfflag:true,return()), %ls : cunlisp (%l), %lls : slength (%ls), if %lls = 0 then (disp("string of length 0"),%tfflag:true,return()), %n : cint (%ls), if lfreeof ([10,13],%n) then %rL : cons (ascii (%n), %rL) else ( /* if we are here after reading just the first char on the line, then we have a blank line case */ if %p = 1 then %bflag:true, /* We have found the first and maybe only eol char. */ %p : fposition(%str), /* The next char is either another eol char (which could be the end of a blank line) or else the first char of the next line or else end of file. */ %lp : ?read\-char (%str,false), if %lp = false then return(), %lps : cunlisp(%lp), %llps : slength(%lps), if %llps = 0 then (disp("string of length 0"),%tfflag:true,return()), %np : cint (%lps), if not lfreeof([10,13],%np) then (if %np = %n then fposition(%str,%p), return()) else (fposition(%str,%p),return()))), if %bflag then "" else if %tfflag then false else if (length (%rL) = 0) then "" else simplode (reverse (%rL)))$ ----------------------------------------- The code for print_file, which uses read_line, is --------------------------------- print_file (%mf) := block ([%s,%al], if not stringp (%mf) then ( disp (" file name must be a Maxima string "), return (false)), if not file_search (%mf) then (disp (" file not found "),return (false)), %s : openr (%mf), while ( %al : read_line (%s)) # false do printf(true,"~a~%",%al), close(%s))$ -------------------------- Finally, a serious bug has been cured in eol_chars which now has the code: --------------------------------------- eol_chars(%fname) := block([%s,%lch,eolL :[],%nch,%Nf : 0,%n1:-1 ], if not file_search (%fname) then (disp(" file not found "),return(false)), %s : openr (%fname), do ( %lch : ?read\-char (%s,false), if %lch = false then return(), %nch : cint (cunlisp (%lch)), if not lfreeof ([10,13],%nch) then ( %Nf : %Nf + 1, if %Nf = 1 then ( %n1:%nch, eolL : cons (%nch,eolL)) else ( if (%nch # %n1) then (eolL : cons (%nch,eolL)), return ()))), close(%s), reverse (eolL))$ --------------------------------- Users of both mac and unix based machines are invited to test these new functions for proper behavior. Another purpose of these functions are to avoid behaviors which differ depending on the lisp version. Hence I avoid the common lisp function read-line, which is the basis of the current readline, and I only use the lisp function read-char. Ted Woollett From woollett at charter.net Sat Jun 11 19:06:13 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 11 Jun 2011 17:06:13 -0700 Subject: [Maxima] Universal read_line and print_line cure mac file read problems Message-ID: <690FE0FF7E0549479EDA102EA772FD32@edwinc367e16bd> The subject should have read: Universal read_line and print_file cure mac file read problems. Ted From l.butler at ed.ac.uk Sat Jun 11 19:44:17 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Sun, 12 Jun 2011 01:44:17 +0100 (BST) Subject: [Maxima] Newby can't get "load" to work. In-Reply-To: <4DF3AB53.8080503@bellsouth.net> References: <4DEF853C.7020708@bellsouth.net> <4DF3AB53.8080503@bellsouth.net> Message-ID: On Sat, 11 Jun 2011, Charles Russell wrote: < Another < respondent pointed out that the correct command should have been "batch" and < not "load". "load" evidently expects some other file format, perhaps lisp < rather than maxima. Please reply to the Maxima list, not me personally. Both batch and load should process your Maxima file; load can load both lisp or maxima code, but it uses the file ending to determine the language in the file. That is why I asked if load("test.mac"); works for you. < < > Note that if you are trying < > to change the working directory via system, this will not work: system < > launches a subshell, executes the system command in that subshell, and < > returns. It is like typing < > < > (cd /tmp; pwd) < > pwd < > < > on the Linux command line. < > < > The Maxima command < > < > ?xchdir("/tmp") < > < > will change the working directory of the Maxima process. That < > question mark is not a typo. I put the following in my maxima-init.mac < > file < > < > cd(dir) := ?xchdir(dir); < > < Thanks. Is "?xchdir" documented anywhere? I can't find it using the maxima < help system. < < This solves my problems as long as I stick to the command-line version of < maxima. With wxmaxima on Windows 7, though, I get: < < system("dir"); < 0 < < (The maxima prompts are absent because they don't copy from the wxmaxima < window. I can only mark one line at a time and that without the prompt.) The < command system("dir") works ok in the command-line version but not in < wxmaxima. It's not clear what you are trying to accomplish, but my comment about system is applicable for windows, also. Note that ?xchdir changes the working directory of the maxima process; it does not affect the working directory of any separate process like a frontend (e.g. xmaxima or wxmaxima). Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From robert.dodier at gmail.com Sat Jun 11 21:14:38 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 11 Jun 2011 20:14:38 -0600 Subject: [Maxima] Hash tables, anyone? In-Reply-To: References: Message-ID: On 6/8/11, Neilen Marais wrote: > Robert Dodier gmail.com> writes: >> On 7/2/10, Alexander Shulgin gmail.com> wrote: >> >> > Is it possible to get a reference to a hash table in maxima? >> >> Yes: try use_fast_arrays:true $ >> Instead of attaching the hash table to a symbol property, >> the hash table is put in the value slot of the symbol. >> >> The hash table is created the first time an attempt is >> made to store something in it. > > Interesting, that also fixes the use of hash tables for my applicaion. Am I > alone in wondering why that isn't the default behaviour? The whole hash > table/symbol property seems like a black magic approach to me while the > latter approach seems to be how it works in most modern languages. > Simply a case of historic precedent? Well, I think there is a certain tension between name and value in mathematics. Sometimes it's more convenient to work with one or the other. For example, let X be an orthogonal matrix with some specific elements. Let's say sooner or later the product transpose(X) . X appears. If the value of X is substituted for the name, then we explicitly carry out the multiplication and get an identity matrix. But it's more mathematical to remember the properties of X and say, oh, we can skip a step here, we know the result is an identity matrix. Unfortunately Maxima's ability to separate name and value is kind of confused. But that's the motivation (I'm pretty sure, anyway; I wasn't around for the first several iterations of Maxima development) for the distinction between objects which are values and objects which are properties of symbols. Hope this clarifies the situation. Best, Robert Dodier From nmarais at gmail.com Sun Jun 12 02:47:51 2011 From: nmarais at gmail.com (Neilen Marais) Date: Sun, 12 Jun 2011 09:47:51 +0200 Subject: [Maxima] Hash tables, anyone? In-Reply-To: References: Message-ID: Robert, On Sun, Jun 12, 2011 at 4:14 AM, Robert Dodier wrote: > On 6/8/11, Neilen Marais wrote: >> Robert Dodier gmail.com> writes: > Unfortunately Maxima's ability to separate name and value is kind > of confused. But that's the motivation (I'm pretty sure, anyway; > I wasn't around for the first several iterations of Maxima development) > for the distinction between objects which are values and objects > which are properties of symbols. > > Hope this clarifies the situation. Yes, it makes sense mathematically that you want to separate the name and the value. I just wish the handling of the two cases was clearer. I'm not sure of a better way to do it though, so feel free to ignore my moans :) Cheers Neilen > Best, > > Robert Dodier > From fateman at eecs.berkeley.edu Sun Jun 12 06:22:08 2011 From: fateman at eecs.berkeley.edu (R Fateman) Date: Sun, 12 Jun 2011 04:22:08 -0700 Subject: [Maxima] Hash tables, anyone? In-Reply-To: References: Message-ID: <4DF4A160.1070604@eecs.berkeley.edu> If you are used to a traditional programming language, then you have variables that can be set to values. You don't have indeterminates. In a symbolic mathematics system, you have indeterminates or names that can be manipulated. When you assign a value to an indeterminate, the symbolic math system must determine somehow whether your utterance is to be treated as the indeterminate or its value. One way of avoiding confusion is to have 2 sets of names. Names that are used as containers to hold values, as is traditional in programming languages, and another set of names that are used literally. Mathematicians are surprisingly sloppy notationally. That is, contrary to the usual expectation of mathematicians, they are usually not precise, formal, exacting, etc. in their specification of everything... Unfortunate for people trying to automate mathematics. RJF On 6/11/2011 7:14 PM, Robert Dodier wrote: > On 6/8/11, Neilen Marais wrote: >> Robert Dodier gmail.com> writes: >>> On 7/2/10, Alexander Shulgin gmail.com> wrote: >>> >>>> Is it possible to get a reference to a hash table in maxima? >>> Yes: try use_fast_arrays:true $ >>> Instead of attaching the hash table to a symbol property, >>> the hash table is put in the value slot of the symbol. >>> >>> The hash table is created the first time an attempt is >>> made to store something in it. >> Interesting, that also fixes the use of hash tables for my applicaion. Am I >> alone in wondering why that isn't the default behaviour? The whole hash >> table/symbol property seems like a black magic approach to me while the >> latter approach seems to be how it works in most modern languages. >> Simply a case of historic precedent? > Well, I think there is a certain tension between name and value > in mathematics. Sometimes it's more convenient to work with > one or the other. For example, let X be an orthogonal matrix with > some specific elements. Let's say sooner or later the product > transpose(X) . X appears. If the value of X is substituted for the > name, then we explicitly carry out the multiplication and get an > identity matrix. But it's more mathematical to remember the > properties of X and say, oh, we can skip a step here, we know the > result is an identity matrix. > > Unfortunately Maxima's ability to separate name and value is kind > of confused. But that's the motivation (I'm pretty sure, anyway; > I wasn't around for the first several iterations of Maxima development) > for the distinction between objects which are values and objects > which are properties of symbols. > > Hope this clarifies the situation. Best, > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From mary.sguanci at gmail.com Sun Jun 12 10:08:53 2011 From: mary.sguanci at gmail.com (meri sguanci) Date: Sun, 12 Jun 2011 17:08:53 +0200 Subject: [Maxima] Minimum Message-ID: <1307891333.4360.2.camel@Gallardo> Hi, I'm a noob, so I'm sorry for the stupid question. I started using Maxima few days ago 'cause I need it for a project @ university. I have a very simple problem: I don't know how to find the minimum of an expression on a domain. This is what I've done: /* [wxMaxima: input start ] */ cmin1:1.1; cmin2:1.5; cqi1:3; cqi2:1; xmin1:0.8; xmin2:0.85; Pnom1:80; -Pnom2:120; Preq:80; /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ cost1(P1):=P1*(cmin1+cqi1*(P1/Pnom1-xmin1)^2); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ cost2(P2):=P2*(cmin2+cqi2*(P2/Pnom2-xmin2)^2); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ COSTOTOT(P1,P2):=cost1(P1)+cost2(P2); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ plot3d(COSTOTOT(P1,P2),[P1,0,Pnom1],[P2,0,Pnom2]); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ Costo1v(P1):=cost1(P1)+cost2(Preq-P1); /* [wxMaxima: input end ] */ I need to know the minimum of Costo1v with P1 in the range [0,Pnom1]. How can I do? Thanks a Lot for ur time and help Yours, Maria Sguanci From robert.dodier at gmail.com Sun Jun 12 12:36:44 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 12 Jun 2011 11:36:44 -0600 Subject: [Maxima] Function evaluates wrong when called from dblint In-Reply-To: <8762ofbb1k.fsf@gmail.com> References: <8762ofbb1k.fsf@gmail.com> Message-ID: On 6/9/11, Neilen Marais wrote: > (%i9) dblint(f2, lambda([x],-1/2), lambda([x], 1/2), -1/2, 1/2); > [0.0,0.0,6.304713613808152*10^58,1.4850279263678455*10^-64,3.141592653589793-1.0*acos((1.4850279263678455*10^-64)/r),0.0] > (%o9) 7.0052373486757241*10^55 I nominate this one for the Maxima "unintended consequences" hall of fame. There is a variable z in dblint and the repeated evaluation and substitution in f2 pulls in (courtesy of dynamic binding, i.e. non-lexical) whatever is the current value of z. Try tracing subst -- you'll see stuff like this: Enter subst [[1.529155181083518 = 1/2], ... that can't be good. If you rename z in expr, sublis, and f2 to zz or something like that, or rename z in dblint to something else, I think you'll get a different result. I think the integrand function can be simplified substantially and that should make it easier to see what it is supposed to do. My general advice is to construct the integrand with the desired value of z pasted into it (instead of trying to substitute the value at run time). Some other minor items: do assignments outside of the list of local variables in block, so the assignments are evaluated in sequence, not in parallel (which makes a difference in this case because there is an assignment depends on the previous one); and predicates in "if" need not be enclosed in is(...). I was tinkering with different ways to avoid the dynamic binding name conflict problem. Here are two ideas. One is to use a macro (FOO) to construct the integrand function with the z value pasted into it. The other idea is to replace "block" in dblint with a lexical block. I have a naive implementation of such a thing, called BLEX. That makes the two variables named "z" distinct, so you don't need to rename z in your code. Here's the macro: FOO (f, expr, zeq) ::= subst (zeq, buildq ([f, expr], f (x, y) := block ([r, theta, phi], r : sqrt (x^2 + y^2 + z^2), theta : acos (z / r), phi : if equal (x, 0) and equal (y, 0) then 0 else atan2 (y, x), float (expr)))); FOO (f2b, ''expr, ''sublis); grind (f2b); => f2b(x,y):=block([r,theta,phi],r:sqrt(y^2+x^2+1/4),theta:acos(1/(2*r)), phi:if equal(x,0) and equal(y,0) then 0 else atan2(y,x), float(-200*%pi*cos(phi)*cos(1000000000*%pi*r/149896229-500000000*%pi/149896229)*cos(theta) *sin(theta) /r))$ dblint (f2b, lambda ([x], -1/2), lambda ([x], 1/2), -1/2, 1/2); => 1.32634644008552E-14 Here's the lexical block idea: load ("/mnt/windows2/Users/robert/maxima/blex.mac"); load ("./dblint_blex.mac"); dblint_blex (f1, lambda ([x], -1/2), lambda ([x], 1/2), -1/2, 1/2); => 1.4210854715202E-14 I'm guessing that lexical scope would be a wonderful thing. If someone wants to work on that with me, that would be terrific. Robert Dodier PS. I've attached the various scripts I was tinkering with, in case anybody wants to take a look. -------------- next part -------------- A non-text attachment was scrubbed... Name: marais_dblint.mac Type: application/octet-stream Size: 1745 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: marais_dblint.out Type: application/octet-stream Size: 12342 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dblint_blex.mac Type: application/octet-stream Size: 1057 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: blex.mac Type: application/octet-stream Size: 204 bytes Desc: not available URL: From dbmaxima at gmail.com Sun Jun 12 22:10:45 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Mon, 13 Jun 2011 13:10:45 +1000 Subject: [Maxima] Minimum In-Reply-To: <1307891333.4360.2.camel@Gallardo> References: <1307891333.4360.2.camel@Gallardo> Message-ID: <4DF57FB5.80906@gmail.com> On 13/06/2011 1:08 AM, meri sguanci wrote: > Hi, > I'm a noob, so I'm sorry for the stupid question. I started using Maxima > few days ago 'cause I need it for a project @ university. I have a very > simple problem: I don't know how to find the minimum of an > expression on a domain. > This is what I've done: > > /* [wxMaxima: input start ] */ > cmin1:1.1; > cmin2:1.5; > cqi1:3; > cqi2:1; > xmin1:0.8; > xmin2:0.85; > Pnom1:80; > -Pnom2:120; > Preq:80; > /* [wxMaxima: input end ] */ > /* [wxMaxima: input start ] */ > cost1(P1):=P1*(cmin1+cqi1*(P1/Pnom1-xmin1)^2); > /* [wxMaxima: input end ] */ > /* [wxMaxima: input start ] */ > cost2(P2):=P2*(cmin2+cqi2*(P2/Pnom2-xmin2)^2); > /* [wxMaxima: input end ] */ > /* [wxMaxima: input start ] */ > COSTOTOT(P1,P2):=cost1(P1)+cost2(P2); > /* [wxMaxima: input end ] */ > /* [wxMaxima: input start ] */ > plot3d(COSTOTOT(P1,P2),[P1,0,Pnom1],[P2,0,Pnom2]); > /* [wxMaxima: input end ] */ > /* [wxMaxima: input start ] */ > Costo1v(P1):=cost1(P1)+cost2(Preq-P1); > /* [wxMaxima: input end ] */ > > I need to know the minimum of Costo1v with P1 in the range [0,Pnom1]. > How can I do? > > Thanks a Lot for ur time and help > > Yours, > Maria Sguanci > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima You have written "-Pnom2:120;". I have taken this to mean "Pnom2:-120;". If you meant something else then your answers will be different, but the methodology is the same. The first thing to do is to plot the expression plot2d(Costo1v(P1),[P1,0,Pnom1]); This shows that the function is well-behaved with a minimum near P1 ~ 78. The global extrema are found at the points where diff(Costo1v(P1),P1)=0. Don't forget to check for local extrema at the ends of the domain. diff(Costo1v(P1),P1); solve(%,P1); %,numer; [P1 = - 29.80284238565096, P1 = 78.49849455956399] Either by inspection from the graph, or by evaluating diff(Costo1v(P1),P1,2), you can determine if the extrema a maxima, minima or inflection points. From nmarais at gmail.com Mon Jun 13 09:31:02 2011 From: nmarais at gmail.com (Neilen Marais) Date: Mon, 13 Jun 2011 16:31:02 +0200 Subject: [Maxima] Function evaluates wrong when called from dblint In-Reply-To: References: <8762ofbb1k.fsf@gmail.com> Message-ID: Hi, On Sun, Jun 12, 2011 at 7:36 PM, Robert Dodier wrote: > On 6/9/11, Neilen Marais wrote: > >> (%i9) dblint(f2, lambda([x],-1/2), lambda([x], 1/2), -1/2, 1/2); >> [0.0,0.0,6.304713613808152*10^58,1.4850279263678455*10^-64,3.141592653589793-1.0*acos((1.4850279263678455*10^-64)/r),0.0] >> (%o9) 7.0052373486757241*10^55 > > I nominate this one for the Maxima "unintended consequences" hall of fame. Haha :) > > There is a variable z in dblint and the repeated evaluation and > substitution in f2 pulls in (courtesy of dynamic binding, i.e. non-lexical) > whatever is the current value of z. Try tracing subst -- you'll see > stuff like this: > ?Enter subst [[1.529155181083518 = 1/2], > ... that can't be good. > > If you rename z in expr, sublis, and f2 to zz or something like that, > or rename z in dblint to something else, I think you'll get a different result. OK, so the dblint function's implementation uses a variable called 'z', which is intefering with my definition of 'z'? I changed my functions to use 'zz', and it indeed seems to be better! Thanks Neilen From l.butler at ed.ac.uk Mon Jun 13 10:21:21 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 13 Jun 2011 16:21:21 +0100 (BST) Subject: [Maxima] Maxima git link broken In-Reply-To: References: <4DF26925.4090304@gmail.com> Message-ID: On Sat, 11 Jun 2011, Leo Butler wrote: < < < On Fri, 10 Jun 2011, Raymond Toy wrote: < < < At the bottom of http://maxima.sourceforge.net/download.html there's a < < link to the git page for maxima. The link is broken. Can someone fix that? < < Thanks for the prod, Ray. I asked the webmaster to do it when we changed < over to git, but forgot to checkup on it. I've updated the site-xml repo and the download page. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From adammaj1 at o2.pl Mon Jun 13 11:35:31 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Mon, 13 Jun 2011 16:35:31 +0000 (UTC) Subject: [Maxima] contour plot References: Message-ID: Dnia Sat, 11 Jun 2011 15:05:52 -0500, Barton Willis napisa?(a): Thx for answer. It works. Looks good, but I think that white area in the middle of image should be smaller ( thinner). I have also tried : plot3d (f(x,y), [x, -4, 4], [y, -4, 4], [mesh_lines_color, true], [colorbox, true], [grid, 150, 150])$ But it gives a flat plane To big grid value gives error : (%i4) contour_plot (f(x,y), [x, -4, 4], [y, -4, 4],[adapt_depth, 10], [grid,1000,1000])$ Maxima encountered a Lisp error: The value 65000 is not of type (MOD 65000). Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. Best regards Adam From woollett at charter.net Mon Jun 13 13:14:04 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 13 Jun 2011 11:14:04 -0700 Subject: [Maxima] Universal print_file cures mac file read problems Message-ID: <621F6AC475DA43FEAEDAE0D3501767B5@edwinc367e16bd> I am repeating some of my message from June 11, just for purposes of making user searches of the archive more responsive. In that earlier message, I used the word printline instead of the correct printfile, when describing the incompatibility of the present readline and printfile functions with mac eol chars. The code for the new read_line and print_file has been given in that June 11, 2011 message. Ted Woollett From woollett at charter.net Mon Jun 13 15:03:14 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 13 Jun 2011 13:03:14 -0700 Subject: [Maxima] Maxima equivalent of ls Message-ID: <0B4D503F6D3C4513B5E40D55EA43085D@edwinc367e16bd> On June 11, Thomas Dean wrote: ------------------------------- How do I do common things like ls pwd I found ?xchdir. But, cannot find the others. -------------------------------------- Hi Tom, Here is a homemade ls function based on the lisp function directory: ------------------------------------------ (%i15) ls(apath) := block ([%aL:[],%pL,%v], %pL : ?directory (apath), for %v in %pL do %aL : cons (%v,%aL), reverse(%aL))$ (%i16) ls ("c:/work2/line1*w.txt"); (%o16) [#pc:/work2/line1b1w.txt, #pc:/work2/line1b2w.txt, #pc:/work2/line1bw.txt, #pc:/work2/line1w.txt] ---------------------------------------- As you might surmise, I am using Windows XP, Xmaxima, and Maxima 5.24.0 (GPL), and I am using one wildcard "*", although you can use any number. Ted Woollett From worwor at bellsouth.net Sun Jun 12 09:07:26 2011 From: worwor at bellsouth.net (carolus) Date: Sun, 12 Jun 2011 09:07:26 -0500 Subject: [Maxima] Newby can't get "load" to work. In-Reply-To: References: <4DEF853C.7020708@bellsouth.net> Message-ID: On 6/10/2011 6:55 PM, Leo Butler wrote: > > > On Wed, 8 Jun 2011, Charles Russell wrote: > > < maxima_userdir; > < "C:/Users/cdr/maxima" > < ************* > < load("test.max"); > < loadfile: failed to load C:/Users/cdr/maxima/test.max > < -- an error. To debug this try: debugmode(true); > < ************* > < yet the file is really there: > < /home/cdr$ ls C:/Users/cdr/maxima/test.max > < C:/Users/cdr/maxima/test.max > < ************* > < here is the file: > < /* test.max - test maxima */ > < /* put in maxima_userdir (e.g. cdr/maxima/) and then > < * call with load("test.max"); but not working */ > < a:3; > < b:4; > < c:a+b; > < ************** > > If you rename your file to test.mac does load work? Yes! > > < Also, "system" seems to work only on Windows XP, not Windows 7 or Debian, and > < only for the command-line version even on XP, so how do you navigate the file > < system? > > Could you send us the output of > build_info(); > please. On Windows 7: Maxima version: 5.24.0 Maxima build date: 20:39 4/5/2011 Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) Lisp implementation version: GCL 2.6.8 > > Could you also explain what you mean by "work". That is, what commands > are you typing in and what are the results. That is what was in the original message, but without the prompts, which would not copy/paste from wxmaxima. Note that if you are trying > to change the working directory via system, this will not work: system > launches a subshell, executes the system command in that subshell, and > returns. It is like typing > > (cd /tmp; pwd) > pwd > > on the Linux command line. > > The Maxima command > > ?xchdir("/tmp") > > will change the working directory of the Maxima process. That > question mark is not a typo. I put the following in my maxima-init.mac > file > > cd(dir) := ?xchdir(dir); > > > Leo > Thanks. I now have maxima working satisfactorily from the command line. For me, wxmaxima is flaky, and xmaxima on Windows 7 seems to be a console application that is almost identical to the command-line version. Is this group interested in problems that only occur in wxmaxima? By the way, I'm posting this to gmane.comp.mathematics.maxima.general after having trouble with the mailing list. Hope this works. From toy.raymond at gmail.com Mon Jun 13 16:05:01 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 13 Jun 2011 17:05:01 -0400 Subject: [Maxima] Maxima git link broken In-Reply-To: References: <4DF26925.4090304@gmail.com> Message-ID: <4DF67B7D.6080206@gmail.com> On 6/13/11 11:21 AM, Leo Butler wrote: > > On Sat, 11 Jun 2011, Leo Butler wrote: > > < > < > < On Fri, 10 Jun 2011, Raymond Toy wrote: > < > < < At the bottom of http://maxima.sourceforge.net/download.html there's a > < < link to the git page for maxima. The link is broken. Can someone fix that? > < > < Thanks for the prod, Ray. I asked the webmaster to do it when we changed > < over to git, but forgot to checkup on it. > > I've updated the site-xml repo and the download page. Thanks! I think that looks much better, and having a working link makes it look like maxima is not dead. :-) Was this something that I could have done myself? If so, my apologies. I didn't know. Ray From woollett at charter.net Mon Jun 13 18:38:35 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 13 Jun 2011 16:38:35 -0700 Subject: [Maxima] Maxima equivalent of ls Message-ID: On June 13, 2011, Ted Woollett wrote: ----------------------- Here is a homemade ls function based on the lisp function directory: ------------------------------------------ (%i15) ls(apath) := block ([%aL:[],%pL,%v], %pL : ?directory (apath), for %v in %pL do %aL : cons (%v,%aL), reverse(%aL))$ (%i16) ls ("c:/work2/line1*w.txt"); (%o16) [#pc:/work2/line1b1w.txt, #pc:/work2/line1b2w.txt, #pc:/work2/line1bw.txt, #pc:/work2/line1w.txt] ----------------------------------- A version which strips off the drive and folder information (and which is very dependent on the hardware/software details of implimentation) is dir(path) adapted to a windows evironment: the output looks nicest in display2d:true case (the default): -------------------------------------------- (%i1) load(ls); (%o1) c:/work2/ls.mac (%i2) mypath : "c:/work2/line1*w.txt"$ (%i3) dir (mypath); (%o3) [line1b1w.txt, line1b2w.txt, line1bw.txt, line1w.txt] (%i4) display2d:false$ (%i5) dir (mypath); (%o5) [line1b1w\.txt,line1b2w\.txt,line1bw\.txt,line1w\.txt] ------------------------------------ code for dir(path) is: ---------------------------- dir(apath) := block ([nstem,nsl,nrem,%aL:[],%pL,%v,%vp], [nstem,nsl] : stem_size (apath), nrem : 3 + nstem + 2*nsl, %pL : ?directory (apath), for %v in %pL do (%vp : simplode (rest(charlist (string (%v)),nrem)), %vp : parse_string (%vp), %aL : cons (%vp,%aL)), reverse(%aL))$ ---------------------------- which uses stem_size : --------------------------- /* stem_size returns the list [ psl,nsl], in which psl is the string length of everything up to and including the last forward slash and nsl is the number of forward slashes */ stem_size (bpath) := block ([%nsub,%stem], %nsub : 1 + slength (bpath) - sposition ("/",sreverse (bpath)), %stem : substring (bpath,1,%nsub + 1), [slength (%stem),nfsl(%stem)])$ ------------------------------------------- which uses nfsl: ---------------------------------- /* nfsl(string) returns the number of forward slashes found in the given string */ nfsl(%astr) := block ([%n:0,%chL,%v ], %chL : charlist (%astr), for %v in %chL do if %v = "/" then %n : %n + 1, %n)$ ------------------------------------- From ichikawa.yuji at gmail.com Mon Jun 13 21:50:38 2011 From: ichikawa.yuji at gmail.com (ICHIKAWA, Yuji) Date: Tue, 14 Jun 2011 11:50:38 +0900 Subject: [Maxima] Electric circuits package In-Reply-To: References: Message-ID: Hi, I made a simple package (attached one) for electric circuits. It imports PSIM(circuit simulator for power electronics) netlist, and solves linear circuits. It may be useful to analyze gain and phase, or impedance. If you know similar packages, please let me know. I want to try to use them. And any comments about my package will motivate me to develop further. Thank you. - ICHIKAWA, Yuji from Japan -------------- next part -------------- A non-text attachment was scrubbed... Name: circuits.zip Type: application/zip Size: 18746 bytes Desc: not available URL: From l.butler at ed.ac.uk Tue Jun 14 12:21:32 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 14 Jun 2011 18:21:32 +0100 (BST) Subject: [Maxima] Electric circuits package In-Reply-To: References: Message-ID: On Tue, 14 Jun 2011, ICHIKAWA, Yuji wrote: < Hi, < < I made a simple package (attached one) for electric circuits. < It imports PSIM(circuit simulator for power electronics) netlist, < and solves linear circuits. < It may be useful to analyze gain and phase, or impedance. < < If you know similar packages, please let me know. I want to try to use them. < And any comments about my package will motivate me to develop further. There is a page for such packages here http://sourceforge.net/apps/phpbb/maxima/viewforum.php?f=3 I think you need to have a sourceforge account, but that is painless to setup. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From l.butler at ed.ac.uk Tue Jun 14 12:25:02 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 14 Jun 2011 18:25:02 +0100 (BST) Subject: [Maxima] phpBB spam Message-ID: @andreyv: I noticed there are a couple spam posts at http://sourceforge.net/apps/phpbb/maxima/viewforum.php?f=3 which could be deleted. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From woollett at charter.net Tue Jun 14 12:32:37 2011 From: woollett at charter.net (Edwin Woollett) Date: Tue, 14 Jun 2011 10:32:37 -0700 Subject: [Maxima] accessing first element of lisp function directory Message-ID: <20274CDB78A340D69D43C48B67EA8280@edwinc367e16bd> The output of ?directory(path) is not a list. I am able to access all of the elements except the first. How can I access the first element? In the example below, there are five elements in myout. ------------------------------------------------------- Maxima 5.24.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. 2011-06-14 (%i1) myout : ?directory("c:/line1*w.txt"); (%o1) (#pc:/line10w.txt, #pc:/line1b1w.txt, #pc:/line1b2w.txt, #pc:/line1bw.txt, #pc:/line1w.txt) (%i2) length(myout); (%o2) 4 (%i3) part (myout,1); (%o3) #pc:/line1b1w.txt (%i4) for x in myout do print (x)$ #pc:/line1b1w.txt #pc:/line1b2w.txt #pc:/line1bw.txt #pc:/line1w.txt -------------------------------- Ted Woollett From toy.raymond at gmail.com Tue Jun 14 12:45:46 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 14 Jun 2011 13:45:46 -0400 Subject: [Maxima] accessing first element of lisp function directory References: <20274CDB78A340D69D43C48B67EA8280@edwinc367e16bd> Message-ID: >>>>> "Edwin" == Edwin Woollett writes: Edwin> The output of ?directory(path) is not a list. I am Edwin> able to access all of the elements except the first. Edwin> How can I access the first element? That's because cl:directory produces a Lisp list, not a Maxima list. The main difference is that a Maxima list looks like '((mlist) l1 l2 l3 ...) I think the easiest way would be to create your own Lisp function to return a maxima list. Something like: :lisp (defun $directory (path) (list* '(mlist) (directory path))) Then directory("foo") will return a normal Maxima list. Note that cl:directory is notoriously implmentation-dependent; the results can be very different depending on the Lisp being used. Ray From l.butler at ed.ac.uk Tue Jun 14 17:09:58 2011 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 14 Jun 2011 23:09:58 +0100 (BST) Subject: [Maxima] Maxima git link broken In-Reply-To: <4DF67B7D.6080206@gmail.com> References: <4DF26925.4090304@gmail.com> <4DF67B7D.6080206@gmail.com> Message-ID: On Mon, 13 Jun 2011, Raymond Toy wrote: < > I've updated the site-xml repo and the download page. < Thanks! I think that looks much better, and having a working link makes < it look like maxima is not dead. :-) < < Was this something that I could have done myself? If so, my < apologies. I didn't know. Yes, all the webpage stuff is in the site-xml git repo and there are instructions in the README file on how to update webpages from the xml. Anyhow, there's no need to apologise, I didn't know it was that easy before looking into it. --- Btw, our front page does look dead, with the news feed having its last update in 2009 and the last release listed as 5.18.1, so I have updated those. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From ichikawa.yuji at gmail.com Tue Jun 14 18:13:42 2011 From: ichikawa.yuji at gmail.com (ICHIKAWA, Yuji) Date: Wed, 15 Jun 2011 08:13:42 +0900 Subject: [Maxima] Electric circuits package In-Reply-To: References: Message-ID: Butler-san, Thank you for your advice. I registered my account in sourceforge and put my package. - ICHIKAWA, Yuji On 2011/06/15, at 2:21, Leo Butler wrote: > > > On Tue, 14 Jun 2011, ICHIKAWA, Yuji wrote: > > < Hi, > < > < I made a simple package (attached one) for electric circuits. > < It imports PSIM(circuit simulator for power electronics) netlist, > < and solves linear circuits. > < It may be useful to analyze gain and phase, or impedance. > < > < If you know similar packages, please let me know. I want to try to use them. > < And any comments about my package will motivate me to develop further. > > There is a page for such packages here > http://sourceforge.net/apps/phpbb/maxima/viewforum.php?f=3 > I think you need to have a sourceforge account, but > that is painless to setup. > > Leo > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > From worwor at bellsouth.net Tue Jun 14 10:47:23 2011 From: worwor at bellsouth.net (carolus) Date: Tue, 14 Jun 2011 10:47:23 -0500 Subject: [Maxima] Newbie problems with plot2d Message-ID: Neither of the two approaches used in the following script generates arguments acceptable to plot2d. (My intent is to use maxima for prototyping and debugging fortran, so I want to stay as close as possible to fortran idiom, particularly with respect to array usage.) Any help would be appreciated. ********************** lognormal(x) := (1/x)*exp(-(log(x/x0))^2/(2*sig^2)); tfmi(t) := first(quad_qagi(lognormal(s)*exp(-s*t), s, 10^-16, inf)); x0:2; sig:2; amp:0.1; tfmi(0.1); /* OK */ tfmi(1.0); /* OK */ numberp(tfmi(0.1)); /* true */ plot2d(tfmi(t),[t,0.1,1]); /* fails */ array(tvec, 20); array(yvec, 20); for i:0 step 1 thru 19 do block( tvec[i]: 0.1*i, yvec[i]: tfmi(tvec[i]) ); display(tvec[3],yvec[3]); /* OK */ plot2d([discrete,tvec,yvec]); /* fails */ From l_butler at users.sourceforge.net Wed Jun 15 08:12:10 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Wed, 15 Jun 2011 13:12:10 +0000 Subject: [Maxima] Newbie problems with plot2d In-Reply-To: (message from carolus on Tue, 14 Jun 2011 10:47:23 -0500) References: Message-ID: <1qp1uyvtf11.fsf@iceland.freeshell.org> > lognormal(x) := (1/x)*exp(-(log(x/x0))^2/(2*sig^2)); > tfmi(t) := first(quad_qagi(lognormal(s)*exp(-s*t), s, 10^-16, inf)); > x0:2; sig:2; amp:0.1; > tfmi(0.1); /* OK */ > tfmi(1.0); /* OK */ > numberp(tfmi(0.1)); /* true */ > plot2d(tfmi(t),[t,0.1,1]); /* fails */ Try: plot2d(tfmi,[t,0.1,1]); plot2d('(tfmi(t)), [t,0.1,1]); Explanation: tfmi is the name of a function, while tfmi(t) is an expression. If you pass the expression, then you want it to be unsimplified (because t is meant to be a numeric input). > array(tvec, 20); > array(yvec, 20); > for i:0 step 1 thru 19 do > block( > tvec[i]: 0.1*i, > yvec[i]: tfmi(tvec[i]) > ); > display(tvec[3],yvec[3]); /* OK */ > plot2d([discrete,tvec,yvec]); /* fails */ or: tlist : makelist(0.1*i,i,0,19); ylist : map(tfmi,tlist); plot2d([discrete,ylist,tlist]); Explanation: arrays and lists are different beasts and plot2d expects lists not arrays (see the examples in the online help). -- Leo Butler l_butler at users.sourceforge.net SDF Public Access UNIX System - http://sdf.lonestar.org From balteo at gmail.com Wed Jun 15 09:12:19 2011 From: balteo at gmail.com (Julien Martin) Date: Wed, 15 Jun 2011 16:12:19 +0200 Subject: [Maxima] Maxima syntax for finding the inverse of a function? Message-ID: Hello, What is the maxima syntax used to find the inverse of a function? Thanks in advance, Regards, Julien. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Wed Jun 15 09:15:14 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 15 Jun 2011 07:15:14 -0700 Subject: [Maxima] Maxima syntax for finding the inverse of a function? In-Reply-To: References: Message-ID: <4DF8BE72.5010208@eecs.berkeley.edu> On 6/15/2011 7:12 AM, Julien Martin wrote: > Hello, > What is the maxima syntax used to find the inverse of a function? > Thanks in advance, > Regards, > Julien. > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima you mean perhaps something like solve(y=a*x+b,x) ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From balteo at gmail.com Wed Jun 15 09:18:42 2011 From: balteo at gmail.com (Julien Martin) Date: Wed, 15 Jun 2011 16:18:42 +0200 Subject: [Maxima] Maxima syntax for finding the inverse of a function? In-Reply-To: <4DF8BE72.5010208@eecs.berkeley.edu> References: <4DF8BE72.5010208@eecs.berkeley.edu> Message-ID: thanks a lot Richard! 2011/6/15 Richard Fateman > On 6/15/2011 7:12 AM, Julien Martin wrote: > > Hello, > What is the maxima syntax used to find the inverse of a function? > Thanks in advance, > Regards, > Julien. > > > _______________________________________________ > Maxima mailing listMaxima at math.utexas.eduhttp://www.math.utexas.edu/mailman/listinfo/maxima > > you mean perhaps something like > > solve(y=a*x+b,x) > > ? > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Wed Jun 15 13:56:57 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 15 Jun 2011 11:56:57 -0700 Subject: [Maxima] Maxima equivalent of ls Message-ID: <35B11081E30248D38FB182C5F6021A17@edwinc367e16bd> On June 14, Raymond Toy wrote: -------------------------------- That's because cl:directory produces a Lisp list, not a Maxima list. The main difference is that a Maxima list looks like '((mlist) l1 l2 l3 ...) I think the easiest way would be to create your own Lisp function to return a maxima list. Something like: :lisp (defun $directory (path) (list* '(mlist) (directory path))) Then directory("foo") will return a normal Maxima list. Note that cl:directory is notoriously implmentation-dependent; the results can be very different depending on the Lisp being used. ------------------------------------------ Thanks for showing a method of converting a lisp list to a Maxima list. I have put your definition into directory.lisp and the rest of the code into ls.mac. Despite the Lisp version dependence of directory, this code at least gives beginning string programmers a starting point to test what happens with their lisp version. Using Windows (GCL) 5.24.0: we test stripping off drive and folder info using three different locations: --------------------------------- (%i1) load("directory.lisp"); (%o1) directory.lisp (%i2) load(ls); (%o2) c:/work2/ls.mac (%i3) ls("c:/line1*w.txt"); (%o3) [#pc:/line10w.txt, #pc:/line1b1w.txt, #pc:/line1b2w.txt, #pc:/line1bw.txt, #pc:/line1w.txt] (%i4) dir("c:/line1*w.txt"); (%o4) [line10w.txt, line1b1w.txt, line1b2w.txt, line1bw.txt, line1w.txt] (%i5) ls("c:/work2/line1*w.txt"); (%o5) [#pc:/work2/line10w.txt, #pc:/work2/line1b1w.txt, #pc:/work2/line1b2w.txt, #pc:/work2/line1bw.txt, #pc:/work2/line1w.txt] (%i6) dir("c:/work2/line1*w.txt"); (%o6) [line10w.txt, line1b1w.txt, line1b2w.txt, line1bw.txt, line1w.txt] (%i7) ls("c:/work2/temp1/line1*w.txt"); (%o7) [#pc:/work2/temp1/line10w.txt, #pc:/work2/temp1/line1b1w.txt, #pc:/work2/temp1/line1b2w.txt, #pc:/work2/temp1/line1bw.txt, #pc:/work2/temp1/line1w.txt] (%i8) dir("c:/work2/temp1/line1*w.txt"); (%o8) [line10w.txt, line1b1w.txt, line1b2w.txt, line1bw.txt, line1w.txt] ------------------------------------------------- with code in ls.mac: ls(apath) := block ([%aL:[],%pL,%v], %pL : directory (apath), for %v in %pL do %aL : cons (%v,%aL), reverse(%aL))$ scut(%ds) := block ([%dsr,%nrem], %dsr : sreverse (%ds), %nrem : slength(%ds) - (sposition ("/",%dsr) - 1), sreverse(simplode(rest(charlist(%dsr),-%nrem))))$ dir(apath) := block ([%aL:[],%pL,%v], %pL : map ('string, ls(apath)), /* display (%pL), */ for %v in %pL do %aL : cons (parse_string (scut(%v)),%aL), reverse(%aL))$ ------- and with directory.lisp containing: ;;; directory.lisp ;;; raymond toy code (defun $directory (path) (list* '(mlist) (directory path))) --------------------------------------------- Ted Woollett From drdieterkaiser at web.de Wed Jun 15 16:46:06 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 15 Jun 2011 23:46:06 +0200 Subject: [Maxima] Work on the Maxima Manual Message-ID: <1308174366.2913.18.camel@dieter> I have finished a reorganizing of the first 13 chapters of the Maxima Manual. I think a lot of functions have a more appropriate place and the documentation has a better structure. Now it is time to add more documentation at a lot of places. In the German translation I have already added introductory chapters and more documentation and examples for a lot of functions. This is much more difficult for me in English. Furthermore, I have started to add a lot of cross references for the html-documentation. The functions get an anchor like "expand" for the function expand. The cross references are inserted with the new macros @mref{anchor}, @mrefcomma{anchor}, @mrefdot{anchor}, or @mxref{anchor}. @mref{anchor} puts in a simple cross reference. The macro @mrefcomma puts in the text "anchor,". This is workaround, because in a Texinfo file a macro is always followed with a linefeed. Accordingly, @mrefdot puts in the text "anchor.". The macro @mxref{anchor, text} is used, when the name of the anchor and the text to be displayed are different, e.g. @mxref{quot, quote-operator}. A disadvantage of the macros is, that we get extra space after cross references in the pdf-documentation. I have found no way to avoid this. Dieter Kaiser From l_butler at users.sourceforge.net Wed Jun 15 17:12:04 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Wed, 15 Jun 2011 22:12:04 +0000 Subject: [Maxima] Maxima equivalent of ls In-Reply-To: <35B11081E30248D38FB182C5F6021A17@edwinc367e16bd> (message from Edwin Woollett on Wed, 15 Jun 2011 11:56:57 -0700) Message-ID: <1qpfwnarbgr.fsf@iceland.freeshell.org> Edwin Woollett writes: > I have put your definition into directory.lisp > and the rest of the code into ls.mac. > > Despite the Lisp version dependence of directory, > this code at least gives beginning string programmers > a starting point to test what happens with their lisp > version. This functionality is built into the cl-fad library, which I have patched to work with gcl. Here is an example from the Maxima-CAS code base: (%i1) :lisp (defmfun $ls (directory) (append '((mlist simp)) (cl-fad:list-directory directory))) $LS (%i2) ls("."); (%o2) [/home/work/maxima/sandbox/git/maxima-git/.cvsignore, /home/work/maxima/sandbox/git/maxima-git/.git/, ... -- Leo Butler l_butler at users.sourceforge.net SDF Public Access UNIX System - http://sdf.lonestar.org From tomdean at speakeasy.org Wed Jun 15 17:23:43 2011 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Wed, 15 Jun 2011 15:23:43 -0700 Subject: [Maxima] Maxima equivalent of ls In-Reply-To: <1qpfwnarbgr.fsf@iceland.freeshell.org> References: <1qpfwnarbgr.fsf@iceland.freeshell.org> Message-ID: <1308176623.9399.2.camel@asus> On Wed, 2011-06-15 at 22:12 +0000, Leo Butler wrote: > :lisp (defmfun $ls (directory) (append '((mlist simp)) > (cl-fad:list-directory directory))) > maxima clisp layout_autotools true Maxima 5.24.0 http://maxima.sourceforge.net using Lisp CLISP 2.44.1 (2008-02-23) 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 (defmfun $ls (directory) (append '((mlist simp)) (cl-fad:list-directory directory))) Maxima encountered a Lisp error: READ from #: there is no package with name "CL-FAD" Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. tomdean From l_butler at users.sourceforge.net Wed Jun 15 18:12:45 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Wed, 15 Jun 2011 23:12:45 +0000 Subject: [Maxima] Maxima equivalent of ls In-Reply-To: <1308176623.9399.2.camel@asus> (tomdean@speakeasy.org) Message-ID: <1qpd3ier8nm.fsf@iceland.freeshell.org> "Thomas D. Dean" writes: > On Wed, 2011-06-15 at 22:12 +0000, Leo Butler wrote: >> :lisp (defmfun $ls (directory) (append '((mlist simp)) >> (cl-fad:list-directory directory))) > See: https://github.com/leo-butler/Maxima-CAS/tree/4b59dc62543cc42a17dd66e2000eb2778294ff17/src/cl-fad -- Leo Butler l_butler at users.sourceforge.net SDF Public Access UNIX System - http://sdf.lonestar.org From worwor at bellsouth.net Wed Jun 15 12:06:14 2011 From: worwor at bellsouth.net (carolus) Date: Wed, 15 Jun 2011 12:06:14 -0500 Subject: [Maxima] Newbie problems with plot2d In-Reply-To: <1qp1uyvtf11.fsf@iceland.freeshell.org> References: <1qp1uyvtf11.fsf@iceland.freeshell.org> Message-ID: On 6/15/2011 8:12 AM, Leo Butler wrote: > Explanation: tfmi is the name of a function, while > tfmi(t) is an expression. > Explanation: arrays and lists are different beasts Is there a function that returns the type of a maxima object? From l_butler at users.sourceforge.net Thu Jun 16 09:49:42 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Thu, 16 Jun 2011 14:49:42 +0000 Subject: [Maxima] Newbie problems with plot2d In-Reply-To: (message from carolus on Wed, 15 Jun 2011 12:06:14 -0500) Message-ID: <1qp1uyt3k6x.fsf@iceland.freeshell.org> carolus writes: > Is there a function that returns the type of a maxima object? properties(foo) lists the properties of the symbol foo. For example: foo(x,y):=x^^y; foo:a+5; foo[x,y] := x^y; properties(foo); [value, array function, hashed array, function] featurep may also be helpful. -- Leo Butler l_butler at users.sourceforge.net SDF Public Access UNIX System - http://sdf.lonestar.org From woollett at charter.net Thu Jun 16 12:52:17 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 16 Jun 2011 10:52:17 -0700 Subject: [Maxima] create Maxima list from multiple return values of a Lisp function Message-ID: <1EE814485B2E471FB1BC0B3980302BE7@edwinc367e16bd> I am using GCL in my windows binary Maxima simply as a way to learn some Lisp to Maxima tricks. Both Raymond Toy and Leo Butler have provided methods of turning a Lisp list into a Maxima list. gcl:rename_file returns three values. How can I turn these into a Maxima list? ----------------------------- (%i1) :lisp (rename-file "foo.txt" "bar.txt") #pbar.txt #pC:/work2/foo.txt #pC:/work2/bar.txt ------------------- Ted Woollett windows (gcl) 5.24.0 From hawe at chefmail.de Thu Jun 16 12:43:53 2011 From: hawe at chefmail.de (Hans W. Hofmann) Date: Thu, 16 Jun 2011 17:43:53 +0000 (UTC) Subject: [Maxima] Work on the Maxima Manual References: <1308174366.2913.18.camel@dieter> Message-ID: Dieter Kaiser web.de> writes: > At first I want to thank you for your exellent work.... And please cross link solve to to_poly_solve. I think it should be possible to solve a equation with a sqrt in a reasonable time. Ein gro?es extra Dankesch?n :-) Hans W. Hofmann From macrakis at alum.mit.edu Thu Jun 16 13:39:17 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 16 Jun 2011 14:39:17 -0400 Subject: [Maxima] create Maxima list from multiple return values of a Lisp function In-Reply-To: <1EE814485B2E471FB1BC0B3980302BE7@edwinc367e16bd> References: <1EE814485B2E471FB1BC0B3980302BE7@edwinc367e16bd> Message-ID: (cons '(mlist simp) (multiple-value-list (rename-file "foo.txt" "bar.txt"))) But of course the individual elements of the result don't print correctly. On Thu, Jun 16, 2011 at 13:52, Edwin Woollett wrote: > I am using GCL in my windows binary > Maxima simply as a way to learn some > Lisp to Maxima tricks. > > Both Raymond Toy and Leo Butler have provided methods > of turning a Lisp list into a Maxima list. > > gcl:rename_file returns three values. > > How can I turn these into a Maxima list? > ----------------------------- > (%i1) :lisp (rename-file "foo.txt" "bar.txt") > #pbar.txt > #pC:/work2/foo.txt > #pC:/work2/bar.txt > ------------------- > Ted Woollett > windows (gcl) 5.24.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 l_butler at users.sourceforge.net Thu Jun 16 15:28:14 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Thu, 16 Jun 2011 20:28:14 +0000 Subject: [Maxima] create Maxima list from multiple return values of a Lisp function In-Reply-To: <1EE814485B2E471FB1BC0B3980302BE7@edwinc367e16bd> (message from Edwin Woollett on Thu, 16 Jun 2011 10:52:17 -0700) Message-ID: <1qpy6111py9.fsf@iceland.freeshell.org> Edwin Woollett writes: > gcl:rename_file returns three values. > > How can I turn these into a Maxima list? > ----------------------------- > (%i1) :lisp (rename-file "foo.txt" "bar.txt") > #pbar.txt > #pC:/work2/foo.txt > #pC:/work2/bar.txt :lisp (defmfun $rename_file (from to) (append '((mlist simp)) (multiple-value-list (rename-file from to)))) (%i1) rename_file("/tmp/foo.txt","/tmp/bar.txt"); (%o1) [/tmp/bar.txt, /tmp/foo.txt, /tmp/bar.txt] -- Leo Butler l_butler at users.sourceforge.net SDF Public Access UNIX System - http://sdf.lonestar.org From woollett at charter.net Thu Jun 16 16:16:24 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 16 Jun 2011 14:16:24 -0700 Subject: [Maxima] create Maxima list from multiple return values of a Lispfunction References: <1qpy6111py9.fsf@iceland.freeshell.org> Message-ID: <0FE8BF36D8EB4A6A8BAD5F2FF09881FE@edwinc367e16bd> On June 16, 2011, Leo Butler wrote --------------------------------- >> gcl:rename_file returns three values. >> >> How can I turn these into a Maxima list? >> ----------------------------- >> (%i1) :lisp (rename-file "foo.txt" "bar.txt") >> #pbar.txt >> #pC:/work2/foo.txt >> #pC:/work2/bar.txt > :lisp (defmfun $rename_file (from to) (append '((mlist simp)) > (multiple-value-list (rename-file from to)))) > (%i1) rename_file("/tmp/foo.txt","/tmp/bar.txt"); > (%o1) [/tmp/bar.txt, /tmp/foo.txt, /tmp/bar.txt] ------------------ When I try this using :lisp I get ok result, but if I use to_lisp() and try to use the same definition with a different name I get a Lisp error. --------------------------------------- (%i1) :lisp (probe-file "bar.txt") #pC:/work2/bar.txt (%i1) :lisp (defmfun $rename_file (from to) (append '((mlist simp)) (multiple-value-list (rename-file from to)))) $RENAME_FILE (%i1) rename_file("bar.txt","foo.txt"); (%o1) [#pfoo.txt, #pC:/work2/bar.txt, #pC:/work2/foo.txt] (%i2) to_lisp(); Type (to-maxima) to restart, ($quit) to quit Maxima. /* here I try to call the Maxima function rename1_file but the name is not accepted */ MAXIMA> (defmfun $rename1_file (from to) (append '((mlist simp)) (multiple-value-list (rename-file from to)))) $RENAME_FILE /* here I try to call the Maxima function rename_file_a, and the name appears to be accepted, but use then leads to error messages. */ MAXIMA> (defmfun $rename_file_a (from to) (append '((mlist simp)) (multiple-value-list (rename-file from to)))) $RENAME_FILE_A MAXIMA> (probe-file "foo.txt") #p"C:/work2/foo.txt" MAXIMA> rename_file_a ("foo.txt","bar.txt") Maxima encountered a Lisp error: Error in EVAL [or a callee]: The variable RENAME_FILE_A is unbound. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. MAXIMA> Maxima encountered a Lisp error: Error in READ [or a callee]: A comma has appeared out of a backquote. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. MAXIMA> "bar.txt" MAXIMA> --------------------- Ted From woollett at charter.net Thu Jun 16 16:56:45 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 16 Jun 2011 14:56:45 -0700 Subject: [Maxima] create Maxima list from multiple return values of a Lisp function References: <1EE814485B2E471FB1BC0B3980302BE7@edwinc367e16bd> Message-ID: <2ED5A49C46EA468D88C3884528B31D1E@edwinc367e16bd> On June 16, 2011, Stavros Macrakis wrote: ------------------------------------------- > (cons '(mlist simp) (multiple-value-list (rename-file "foo.txt" > "bar.txt"))) > But of course the individual elements of the result don't print correctly. ------------------------- When I try to use this in Maxima I get a lisp error: ------------------------- (%i1) :lisp (probe-file "foo.txt") #pC:/work2/foo.txt (%i1) to_lisp(); Type (to-maxima) to restart, ($quit) to quit Maxima. MAXIMA> (defun $rname (mfrom mto) (cons '(mlist simp) (multiple-value-list (rename-file mfrom mto)))) $RNAME MAXIMA> rname ("foo.txt","bar.txt"); Maxima encountered a Lisp error: Error in EVAL [or a callee]: The variable RNAME is unbound. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. MAXIMA> Maxima encountered a Lisp error: Error in READ [or a callee]: A comma has appeared out of a backquote. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. MAXIMA> "bar.txt" -------------------------------------- >>I am using GCL in my windows binary >>Maxima simply as a way to learn some >>Lisp to Maxima tricks. >>Both Raymond Toy and Leo Butler have provided methods >>of turning a Lisp list into a Maxima list. >>gcl:rename_file returns three values. >>How can I turn these into a Maxima list? >>----------------------------- >>(%i1) :lisp (rename-file "foo.txt" "bar.txt") >>#pbar.txt >>#pC:/work2/foo.txt >>#pC:/work2/bar.txt ------------------- Ted Woollett windows (gcl) 5.24.0 _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From pbowyer at olynet.com Thu Jun 16 16:57:48 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Thu, 16 Jun 2011 14:57:48 -0700 Subject: [Maxima] Looking for information Message-ID: <4DFA7C5C.3070201@olynet.com> I'm looking for a Graphic User Interface toolkit that I can use with common lisp so I can build common lisp applications that open in a graphic window and operate with mouse clicks and keyboard taps rather than being limited to terminal based Command Line Interface applications. I thought I might find someone on the Maxima mailing list that may know about such a toolkit. I'm especially interested in open-source projects because I don't want to buy something just to experiment. I've tried "mcclim", but it seems rather dated and it's difficult to find good examples of how to work with it. I've built a few working trial applications in it, but it's slow going trying to find ways to make it work. I've looked at "ltk", but I haven't yet tried working with it because I didn't like the way the demo looked. I've looked at "CommonQt" but my Linux system won't install it because of some dependency issues that may be resolved in the future. I've looked at "*E*mbedded *Q*t *L*isp" but I can't get it to build on my Linux system and the ECL that it wants didn't give correct answers to some math problems that SBCL and CMUCL gave correct answers to. There were some others that I discovered, but the last upgrade dates were so old that I passed them by. I'm somewhat fluent in java and I've looked at a few ways that java and lisp might work together, but they were either not "common" lisp or seemed to be slower in performance than I would prefer. If there is a well-maintained Common Lisp GUI toolkit available that you know about, please let me know. Thanks, Paul Bowyer -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Jun 16 17:23:57 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 16 Jun 2011 18:23:57 -0400 Subject: [Maxima] create Maxima list from multiple return values of a Lisp function In-Reply-To: <2ED5A49C46EA468D88C3884528B31D1E@edwinc367e16bd> References: <1EE814485B2E471FB1BC0B3980302BE7@edwinc367e16bd> <2ED5A49C46EA468D88C3884528B31D1E@edwinc367e16bd> Message-ID: If you are in the Lisp mode Read-Evaluate-Print Loop, you must use Lisp syntax: ($rname "foo.txt","bar.txt") If you are in the Maxima mode REPL, you can use Maxima syntax: rname("foo.txt","bar.txt") You switched to Lisp mode using to_lisp(); To switch back to Maxima mode, type (to-maxima) in Lisp mode. -s On Thu, Jun 16, 2011 at 17:56, Edwin Woollett wrote: > On June 16, 2011, Stavros Macrakis wrote: > ------------------------------**------------- > > > (cons '(mlist simp) (multiple-value-list (rename-file "foo.txt" >> "bar.txt"))) >> > > > But of course the individual elements of the result don't print correctly. >> > ------------------------- > When I try to use this in Maxima I get a lisp error: > ------------------------- > > (%i1) :lisp (probe-file "foo.txt") > #pC:/work2/foo.txt > (%i1) to_lisp(); > > Type (to-maxima) to restart, ($quit) to quit Maxima. > > MAXIMA> (defun $rname (mfrom mto) > (cons '(mlist simp) (multiple-value-list (rename-file mfrom mto)))) > > $RNAME > MAXIMA> rname ("foo.txt","bar.txt"); > > Maxima encountered a Lisp error: > > Error in EVAL [or a callee]: The variable RNAME is unbound. > > > Automatically continuing. > To reenable the Lisp debugger set *debugger-hook* to nil. > > MAXIMA> > Maxima encountered a Lisp error: > > Error in READ [or a callee]: A comma has appeared out of a backquote. > > Automatically continuing. > To reenable the Lisp debugger set *debugger-hook* to nil. > > MAXIMA> > "bar.txt" > ------------------------------**-------- > > > I am using GCL in my windows binary >>> Maxima simply as a way to learn some >>> Lisp to Maxima tricks. >>> >> > Both Raymond Toy and Leo Butler have provided methods >>> of turning a Lisp list into a Maxima list. >>> >> > gcl:rename_file returns three values. >>> >> > How can I turn these into a Maxima list? >>> ----------------------------- >>> (%i1) :lisp (rename-file "foo.txt" "bar.txt") >>> #pbar.txt >>> #pC:/work2/foo.txt >>> #pC:/work2/bar.txt >>> >> ------------------- > Ted Woollett > windows (gcl) 5.24.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 smh at franz.com Thu Jun 16 17:52:32 2011 From: smh at franz.com (Steve Haflich) Date: Thu, 16 Jun 2011 15:52:32 -0700 Subject: [Maxima] Looking for information In-Reply-To: <4DFA7C5C.3070201@olynet.com> References: <4DFA7C5C.3070201@olynet.com> Message-ID: <12472.1308264752@gemini.franz.com> Paul Bowyer wrote: I'm looking for a Graphic User Interface toolkit that I can use with common lisp so I can build common lisp applications that open in a graphic window and operate with mouse clicks and keyboard taps rather than being limited to terminal based Command Line Interface applications. I thought I might find someone on the Maxima mailing list that may know about such a toolkit. I'm especially interested in open-source projects because I don't want to buy something just to experiment. Your Google-fu seems strained. Both Lispworks and Franz have systems that satisfy your stated requirements and which have free versions you could use to experiment and/or do non-commercial development. These are both currently-supported commercial-quality Lisp implementations. From woollett at charter.net Thu Jun 16 18:30:47 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 16 Jun 2011 16:30:47 -0700 Subject: [Maxima] create Maxima list from multiple return values of a Lisp function References: <1EE814485B2E471FB1BC0B3980302BE7@edwinc367e16bd><2ED5A49C46EA468D88C3884528B31D1E@edwinc367e16bd> Message-ID: On June 16, 2011, Stavros Macrakis wrote ---------------- > If you are in the Lisp mode Read-Evaluate-Print Loop, you must use Lisp > syntax: > ($rname "foo.txt","bar.txt") > If you are in the Maxima mode REPL, you can use Maxima syntax: > rname("foo.txt","bar.txt") > You switched to Lisp mode using > to_lisp(); > To switch back to Maxima mode, type (to-maxima) in Lisp mode. -------------------------- Thanks, I was really compounding errors. I think I get it right here: ------------------------ (%i1) :lisp (probe-file "foo.txt") #pC:/work2/foo.txt (%i1) to_lisp(); Type (to-maxima) to restart, ($quit) to quit Maxima. MAXIMA> (defun $rname (mfrom mto) (cons '(mlist simp) (multiple-value-list (rename-file mfrom mto)))) $RNAME MAXIMA> (to-maxima) Returning to Maxima (%o1) true (%i2) rname ("foo.txt","bar.txt"); (%o2) [#pbar.txt, #pC:/work2/foo.txt, #pC:/work2/bar.txt] (%i3) :lisp (probe-file "bar.txt") #pC:/work2/bar.txt (%i3) to_lisp(); Type (to-maxima) to restart, ($quit) to quit Maxima. MAXIMA> ($rname "bar.txt" "foo.txt") ((MLIST SIMP) #p"foo.txt" #p"C:/work2/bar.txt" #p"C:/work2/foo.txt") ---------------------------------------- Ted From willisb at unk.edu Thu Jun 16 19:55:32 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 16 Jun 2011 19:55:32 -0500 Subject: [Maxima] create Maxima list from multiple return values of a Lisp function In-Reply-To: References: <1EE814485B2E471FB1BC0B3980302BE7@edwinc367e16bd>, Message-ID: ----maxima-bounces at math.utexas.edu wrote: ----- >(cons?'(mlist?simp) ... This is mostly OK, but don't get carried away. In general, the better way is (take '(mlist) ...). That way, the expression gets simplified. Doing (cons '(mlisp simp) ...) can cause tellsimpafter rules to not happen, I think. Maybe there is an opcon macro or something like that that will work instead of 'take.' ---Barton From rswarbrick at gmail.com Fri Jun 17 03:39:11 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 17 Jun 2011 09:39:11 +0100 Subject: [Maxima] Looking for information References: <4DFA7C5C.3070201@olynet.com> Message-ID: Paul Bowyer writes: > If there is a well-maintained Common Lisp GUI toolkit available that > you know about, please let me know. Further to Steve Haflich's reply, you might consider a GTK based approach. There's a (horribly formatted) list at the Cliki http://www.cliki.net/Gtk If you're feeling brave, you could try Cells-GTK http://common-lisp.net/project/cells-gtk/ I was rather turned off the whole approach a couple of years ago because of rubbish documentation and the presence of Kenneth Tilton, but both of these problems seem to have receded... I personally have a bit of experience with CLG http://sourceforge.net/projects/clg/ but it seems somewhat moribund and probably won't survive Gnome's move to gnome-introspection without some serious work. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From worwor at bellsouth.net Thu Jun 16 14:03:58 2011 From: worwor at bellsouth.net (carolus) Date: Thu, 16 Jun 2011 14:03:58 -0500 Subject: [Maxima] Newbie problems with plot2d In-Reply-To: <1qp1uyt3k6x.fsf@iceland.freeshell.org> References: <1qp1uyt3k6x.fsf@iceland.freeshell.org> Message-ID: On 6/16/2011 9:49 AM, Leo Butler wrote: > > carolus writes: > >> Is there a function that returns the type of a maxima object? > > properties(foo) > > lists the properties of the symbol foo. For example: > > foo(x,y):=x^^y; > foo:a+5; > foo[x,y] := x^y; > properties(foo); > [value, array function, hashed array, function] > > featurep may also be helpful. > Thanks. By the way, I see now that my idea of using fortran idiom with maxima was futile. Even numerical applications like plotting, quadrature, optimization, and differential equations require lists as input and output. From worwor at bellsouth.net Thu Jun 16 14:21:38 2011 From: worwor at bellsouth.net (carolus) Date: Thu, 16 Jun 2011 14:21:38 -0500 Subject: [Maxima] Work on the Maxima Manual In-Reply-To: <1308174366.2913.18.camel@dieter> References: <1308174366.2913.18.camel@dieter> Message-ID: On 6/15/2011 4:46 PM, Dieter Kaiser wrote: In the German translation I have > already added introductory chapters and more documentation and examples > for a lot of functions. Is a draft of the German version posted somewhere? From DrDieterKaiser at web.de Fri Jun 17 06:56:06 2011 From: DrDieterKaiser at web.de (Dieter Kaiser) Date: Fri, 17 Jun 2011 13:56:06 +0200 (CEST) Subject: [Maxima] Work on the Maxima Manual Message-ID: <333103939.1133646.1308311766880.JavaMail.fmail@mwmweb029> You can find the German Manual at http://crategus.users.sourceforge.net/maxima.html Dieter Kaiser ? -----Urspr?ngliche Nachricht----- Von: carolus Gesendet: 16.06.2011 21:21:38 An: maxima at math.utexas.edu Betreff: Re: [Maxima] Work on the Maxima Manual On 6/15/2011 4:46 PM, Dieter Kaiser wrote: In the German translation I have > already added introductory chapters and more documentation and examples > for a lot of functions. Is a draft of the German version posted somewhere? _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima ___________________________________________________________ Schon geh?rt? WEB.DE hat einen genialen Phishing-Filter in die Toolbar eingebaut! http://produkte.web.de/go/toolbar From macrakis at alum.mit.edu Fri Jun 17 08:57:58 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 17 Jun 2011 09:57:58 -0400 Subject: [Maxima] create Maxima list from multiple return values of a Lisp function In-Reply-To: References: <1EE814485B2E471FB1BC0B3980302BE7@edwinc367e16bd> Message-ID: For most operators, I agree. But mlists don't have any default simplifications, and *shouldn't* have any non-default simplifications on them. They should always be plain old lists. If you want to use lists to represent some other object with some other semantics, you should use some other operator.... -s On Thu, Jun 16, 2011 at 20:55, Barton Willis wrote: > ----maxima-bounces at math.utexas.edu wrote: ----- > > > >(cons '(mlist simp) ... > > This is mostly OK, but don't get carried away. In general, the better way > is (take '(mlist) ...). That way, the expression gets simplified. > Doing (cons '(mlisp simp) ...) can cause tellsimpafter rules to not happen, > I think. Maybe there is an opcon macro or something like > that that will work instead of 'take.' > > > ---Barton > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Fri Jun 17 11:15:49 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 17 Jun 2011 10:15:49 -0600 Subject: [Maxima] Newbie problems with plot2d In-Reply-To: References: Message-ID: About calling quadpack functions in a plottable function, try writing it as quad_foo(...)[1] instead of first(quad_foo(...)) x[1] where x is not a list is OK but not first(x). (Yes, it is unclear and confusing to try to distinguish between programming functions and symbolic functions. Sorry about that.) About arrays, Maxima has inconsistent policies about arrays. My advice is to just use lists and matrices instead. (Yes, this is a mess. Sorry again.) Hope this helps, Robert Dodier On 6/14/11, carolus wrote: > Neither of the two approaches used in the following script generates > arguments acceptable to plot2d. (My intent is to use maxima for > prototyping and debugging fortran, so I want to stay as close as > possible to fortran idiom, particularly with respect to array usage.) > Any help would be appreciated. > > ********************** > lognormal(x) := (1/x)*exp(-(log(x/x0))^2/(2*sig^2)); > tfmi(t) := first(quad_qagi(lognormal(s)*exp(-s*t), s, 10^-16, inf)); > x0:2; sig:2; amp:0.1; > tfmi(0.1); /* OK */ > tfmi(1.0); /* OK */ > numberp(tfmi(0.1)); /* true */ > plot2d(tfmi(t),[t,0.1,1]); /* fails */ > > array(tvec, 20); > array(yvec, 20); > for i:0 step 1 thru 19 do > block( > tvec[i]: 0.1*i, > yvec[i]: tfmi(tvec[i]) > ); > display(tvec[3],yvec[3]); /* OK */ > plot2d([discrete,tvec,yvec]); /* fails */ > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From robert.dodier at gmail.com Fri Jun 17 11:52:25 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 17 Jun 2011 10:52:25 -0600 Subject: [Maxima] Newbie problems with plot2d In-Reply-To: References: Message-ID: If you are interesting in generating Fortran code, take a look at the fortran and f90 functions. HTH Robert Dodier On 6/14/11, carolus wrote: > Neither of the two approaches used in the following script generates > arguments acceptable to plot2d. (My intent is to use maxima for > prototyping and debugging fortran, so I want to stay as close as > possible to fortran idiom, particularly with respect to array usage.) > Any help would be appreciated. > > ********************** > lognormal(x) := (1/x)*exp(-(log(x/x0))^2/(2*sig^2)); > tfmi(t) := first(quad_qagi(lognormal(s)*exp(-s*t), s, 10^-16, inf)); > x0:2; sig:2; amp:0.1; > tfmi(0.1); /* OK */ > tfmi(1.0); /* OK */ > numberp(tfmi(0.1)); /* true */ > plot2d(tfmi(t),[t,0.1,1]); /* fails */ > > array(tvec, 20); > array(yvec, 20); > for i:0 step 1 thru 19 do > block( > tvec[i]: 0.1*i, > yvec[i]: tfmi(tvec[i]) > ); > display(tvec[3],yvec[3]); /* OK */ > plot2d([discrete,tvec,yvec]); /* fails */ > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From woollett at charter.net Fri Jun 17 12:48:04 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 17 Jun 2011 10:48:04 -0700 Subject: [Maxima] analog of fundef for Maxima functions defined in lisp file Message-ID: <4E56CA6E2F534FA2A220BBACF50EEDDF@edwinc367e16bd> Is there an analog of fundef which can be used to display the definition of Maxima functions which have been loaded in via a lisp file? --------------------------------------- (%i1) functions; (%o1) [] (%i2) load ("rename.lisp"); (%o2) rename.lisp (%i3) functions; (%o3) [] (%i4) fundef (rename1); fundef: no such function: rename1 -- an error. To debug this try: debugmode(true); (%i5) printfile("rename.lisp"); ;;; rename.lisp (defun $rename1 (mfrom mto) (cons '(mlist simp) (multiple-value-list (rename-file mfrom mto)))) (defun $rename2 (mfrom mto) (append '((mlist simp)) (multiple-value-list (rename-file mfrom mto)))) (defun $rename3 (mfrom mto) (take '(mlist) (multiple-value-list (rename-file mfrom mto)))) (defun $probe_file (fname) (probe-file fname)) (%o5) rename.lisp ------------------------------------------ Ted Woollett From pbowyer at olynet.com Fri Jun 17 14:44:39 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Fri, 17 Jun 2011 12:44:39 -0700 Subject: [Maxima] Looking for information In-Reply-To: References: <4DFA7C5C.3070201@olynet.com> Message-ID: <4DFBAEA7.3000209@olynet.com> Hello Rupert: Thanks for the reply. I'll take a look at your suggestions to see if they're what I'm looking for. This may take me awhile if I actually try building test cases with any of them. Paul On 06/17/2011 01:39 AM, Rupert Swarbrick wrote: > Paul Bowyer writes: >> If there is a well-maintained Common Lisp GUI toolkit available that >> you know about, please let me know. > Further to Steve Haflich's reply, you might consider a GTK based > approach. There's a (horribly formatted) list at the Cliki > > http://www.cliki.net/Gtk > > If you're feeling brave, you could try Cells-GTK > > http://common-lisp.net/project/cells-gtk/ > > I was rather turned off the whole approach a couple of years ago because > of rubbish documentation and the presence of Kenneth Tilton, but both of > these problems seem to have receded... > > I personally have a bit of experience with CLG > > http://sourceforge.net/projects/clg/ > > but it seems somewhat moribund and probably won't survive Gnome's move > to gnome-introspection without some serious work. > > > 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 toy.raymond at gmail.com Fri Jun 17 18:07:00 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 17 Jun 2011 19:07:00 -0400 Subject: [Maxima] analog of fundef for Maxima functions defined in lisp file References: <4E56CA6E2F534FA2A220BBACF50EEDDF@edwinc367e16bd> Message-ID: >>>>> "Edwin" == Edwin Woollett writes: Edwin> Is there an analog of fundef which can be used to Edwin> display the definition of Maxima functions which Edwin> have been loaded in via a lisp file? Edwin> --------------------------------------- Edwin> (%i1) functions; Edwin> (%o1) [] Edwin> (%i2) load ("rename.lisp"); Edwin> (%o2) rename.lisp Edwin> (%i3) functions; Edwin> (%o3) [] Edwin> (%i4) fundef (rename1); Edwin> fundef: no such function: rename1 Edwin> -- an error. To debug this try: debugmode(true); I'm not aware of any such thing in maxima. But you could try :lisp (function-lambda-expression #'$rename1) This isn't guaranteed to return anything, but for many Lisps it will return the function. For example, cmucl will return (LAMBDA (MFROM MTO) (BLOCK $RENAME1 (CONS '(MLIST SIMP) (MULTIPLE-VALUE-LIST (RENAME-FILE MFROM MTO))))) This definition might work for you: (defun $lispfundef (f) (print (function-lambda-expression (coerce f 'function))) t) Ray From dbmaxima at gmail.com Fri Jun 17 21:04:34 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Sat, 18 Jun 2011 12:04:34 +1000 Subject: [Maxima] Newbie problems with plot2d In-Reply-To: References: Message-ID: <4DFC07B2.6020104@gmail.com> On 18/06/2011 2:52 AM, Robert Dodier wrote: > If you are interesting in generating Fortran code, > take a look at the fortran and f90 functions. > > HTH > > Robert Dodier Search for "maxima fortran" on http://www.variousconsequences.com/. A couple of interesting examples of generating fortran code from maxima. Joshua also calls the generated code from python using f2py From yusufma77 at yahoo.com Fri Jun 17 14:41:08 2011 From: yusufma77 at yahoo.com (Huan Ma) Date: Fri, 17 Jun 2011 12:41:08 -0700 (PDT) Subject: [Maxima] Yet another Maxima tutorial in Chinese Message-ID: <885936.92145.qm@web110109.mail.gq1.yahoo.com> Hi, I have been a Maxima user for several years. I wrote a Chinese document for Maxima in January 2010 and put it on my personal page. I have got some good feedback since then. Now I updated it and fixed some typos. I think it will benefit more people (mostly Chinese speakers) if the administrator can kindly put it on Maxima documentation page under "Tutorials in Chinese". Here is the link to the document (Title: Quick Maxima Reference): http://webfiles.uci.edu/huanm/www/maxima/maxima_html.xml (webpage) http://webfiles.uci.edu/huanm/www/maxima/maxima_zh.pdf (PDF file) This document was released under CC BY-NC-SA 3.0 license. Thanks. Huan From worwor at bellsouth.net Fri Jun 17 16:02:41 2011 From: worwor at bellsouth.net (carolus) Date: Fri, 17 Jun 2011 16:02:41 -0500 Subject: [Maxima] Newbie problems with plot2d In-Reply-To: References: Message-ID: On 6/17/2011 11:15 AM, Robert Dodier wrote: > (Yes, it is unclear and confusing to try to distinguish > between programming functions and symbolic functions. > Sorry about that.) > What is the difference? I've noticed "f(x) :=" for function definition and "f[x] :=" for initializing matrices. Is that what you are talking about? From macrakis at alum.mit.edu Sat Jun 18 06:19:26 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 18 Jun 2011 07:19:26 -0400 Subject: [Maxima] Newbie problems with plot2d In-Reply-To: References: Message-ID: Not sure exactly what Robert had in mind here, but.... Maxima lists like [a,b,c] support both first(x) and x[1]. Maxima arrays do not support first(x), but do support x[1]. This is because in general Maxima arrays do not have an unambiguous meaning for 'first'. If I assign x[cos(x)]:1 and x[sin(x)]:-1, what would first(x) be? As for defining things, as you say, f(x):= is for function definitions. f[x]:= is for defining memoizing functions, where the body is not re-evaluated every time the function is called -- nothing really to do with matrices. Thus: a:0$ f(x) := (a: a + x)$ f(2) => 2 f(2) => 4 f(3) => 7 f[x] := (a: a + x)$ f[2] => 9 f[2] => 9 <<<<<<<<<<<< remembers calculated value f[3] => 12 f[3] => 12 <<<<<<<<<<<< On Fri, Jun 17, 2011 at 17:02, carolus wrote: > On 6/17/2011 11:15 AM, Robert Dodier wrote: > > (Yes, it is unclear and confusing to try to distinguish >> between programming functions and symbolic functions. >> Sorry about that.) >> >> What is the difference? I've noticed "f(x) :=" for function definition > and "f[x] :=" for initializing matrices. Is that what you are talking > about? > > > ______________________________**_________________ > 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 Jun 18 12:07:01 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 18 Jun 2011 11:07:01 -0600 Subject: [Maxima] Newbie problems with plot2d In-Reply-To: References: Message-ID: On 6/17/11, carolus wrote: > On 6/17/2011 11:15 AM, Robert Dodier wrote: >> (Yes, it is unclear and confusing to try to distinguish >> between programming functions and symbolic functions. >> Sorry about that.) > What is the difference? I've noticed "f(x) :=" for function definition > and "f[x] :=" for initializing matrices. Is that what you are talking > about? Well, in conventional programming languages, the argument of a function must evaluate to some appropriate type, otherwise the function barfs out an error. Maxima and other symbolic math systems can handle inappropriate arguments via partial evaluation. e.g. when x and y are numbers, then x + y => number. But if x, say, x is a symbol and y is a number, then x + y => x + number. Later on, when x has a numeric value, you can reevaluate it and get x + number => number. Anyway, Maxima has some functions which act like ordinary programming language functions, and "first" is one of them. The argument of first must be a list, otherwise it's an error. On the other hand, subscripts like x[1] are OK when x is not any subscriptable object. best Robert Dodier From robert.dodier at gmail.com Sat Jun 18 12:10:22 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 18 Jun 2011 11:10:22 -0600 Subject: [Maxima] Newbie problems with plot2d In-Reply-To: References: Message-ID: Never mind what I said in the message below. I just thought about it for another 30 seconds and the stuff I wrote was mostly off the mark. best, Robert Dodier On 6/18/11, Robert Dodier wrote: > On 6/17/11, carolus wrote: >> On 6/17/2011 11:15 AM, Robert Dodier wrote: > >>> (Yes, it is unclear and confusing to try to distinguish >>> between programming functions and symbolic functions. >>> Sorry about that.) > >> What is the difference? I've noticed "f(x) :=" for function definition >> and "f[x] :=" for initializing matrices. Is that what you are talking >> about? > > Well, in conventional programming languages, the argument > of a function must evaluate to some appropriate type, > otherwise the function barfs out an error. > Maxima and other symbolic math systems can handle > inappropriate arguments via partial evaluation. > e.g. when x and y are numbers, then x + y => number. > But if x, say, x is a symbol and y is a number, then x + y => x + number. > Later on, when x has a numeric value, you can reevaluate it > and get x + number => number. > > Anyway, Maxima has some functions which act like ordinary > programming language functions, and "first" is one of them. > The argument of first must be a list, otherwise it's an error. > On the other hand, subscripts like x[1] are OK when x is > not any subscriptable object. > > best > > Robert Dodier > From woollett at charter.net Sat Jun 18 13:35:18 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 18 Jun 2011 11:35:18 -0700 Subject: [Maxima] analog of fundef for Maxima functions defined in lisp file Message-ID: <964876FDD67047479A54C51E32CF759D@edwinc367e16bd> On June 17, 2011, Raymond Toy wrote: ---------------------------------------- I'm not aware of any such thing in maxima. But you could try :lisp (function-lambda-expression #'$rename1) This isn't guaranteed to return anything, but for many Lisps it will return the function. For example, cmucl will return (LAMBDA (MFROM MTO) (BLOCK $RENAME1 (CONS '(MLIST SIMP) (MULTIPLE-VALUE-LIST (RENAME-FILE MFROM MTO))))) This definition might work for you: (defun $lispfundef (f) (print (function-lambda-expression (coerce f 'function))) t) ---------------------------------------- Thanks for the suggestion. It looks like GCL doesn't have function-lambda-expression defined (despite Steele:common lisp the language, saying it was voted into CL in 1989). There is also no mention in the CL Cookbook. ------------------------------ Maxima 5.24.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. 2011-06-18 (%i1) printfile("lispfundef.lisp")$ ;;;; lispfundef.lisp (defun f1 (x) (+ 1 x)) (defun $f2 (x) (+ 1 x)) (defun $lispfundef (f) (print (function-lambda-expression (coerce f 'function))) t) (%i2) load("lispfundef.lisp"); (%o2) lispfundef.lisp (%i3) :lisp (function-lambda-expression f1) Maxima encountered a Lisp error: Error in PROGN [or a callee]: The function FUNCTION-LAMBDA-EXPRESSION is undefined. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. -------------------- So maybe, a handmade lisp function to do the job instead of function-lambda-expression? Ted Woollett From fateman at eecs.berkeley.edu Sat Jun 18 13:47:11 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 18 Jun 2011 11:47:11 -0700 Subject: [Maxima] analog of fundef for Maxima functions defined in lisp file In-Reply-To: <4E56CA6E2F534FA2A220BBACF50EEDDF@edwinc367e16bd> References: <4E56CA6E2F534FA2A220BBACF50EEDDF@edwinc367e16bd> Message-ID: <4DFCF2AF.1010900@eecs.berkeley.edu> On 6/17/2011 10:48 AM, Edwin Woollett wrote: > Is there an analog of fundef which can be used to > display the definition of Maxima functions which > have been loaded in via a lisp file? > --------------------------------------- generally no, common lisp does not require that the "original definition" be saved anywhere and so if any particular lisp does it, it is not part of the standard and may not work in some other lisp. On the other hand, one can redefine the lisp function defun so that it stashes something that looks like the original material, sortof. HOWEVER The right thing to do, if you want to see the definition of a function, is to get the file name and the location in the file in which the function appears. This will give you the original text, the original spacing, the original comments, the context of the function (like declarations in the file) etc. So the "real" answer is, you should be asking for something else. Incidentally, some common lisps already store the file name and location on the property list of the function name, as files are loaded. RJF From woollett at charter.net Sat Jun 18 17:15:01 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 18 Jun 2011 15:15:01 -0700 Subject: [Maxima] analog of fundef for Maxima functions defined in lisp file Message-ID: On June 18, 2011, Richard Fateman wrote: ----------------------------------- Incidentally, some common lisps already store the file name and location on the property list of the function name, as files are loaded. ----------------------------------------------------- Is this true for GCL? Allegro? What would be an example of accessing such a plist relating file name and location of a given function in a lisp session? Ted From fateman at eecs.berkeley.edu Sat Jun 18 17:31:47 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 18 Jun 2011 15:31:47 -0700 Subject: [Maxima] analog of fundef for Maxima functions defined in lisp file In-Reply-To: References: Message-ID: <4DFD2753.1080506@eecs.berkeley.edu> On 6/18/2011 3:15 PM, Edwin Woollett wrote: > On June 18, 2011, Richard Fateman wrote: > ----------------------------------- > Incidentally, some common lisps already store the file name and > location on the property list of the function name, as files are loaded. > ----------------------------------------------------- > Is this true for GCL? > Allegro? > > What would be an example of accessing such a plist relating file name > and location of a given > function in a lisp session? > > Ted > > For Allegro, see http://www.franz.com/support/documentation/8.2/doc/source-file-recording.htm actually, finding the location of the definition can be done by search, so maybe all you need is the file name. I don't know about GCL. From smh at franz.com Sat Jun 18 19:03:31 2011 From: smh at franz.com (Steve Haflich) Date: Sat, 18 Jun 2011 17:03:31 -0700 Subject: [Maxima] analog of fundef for Maxima functions defined in lisp file In-Reply-To: <4DFD2753.1080506@eecs.berkeley.edu> References: <4DFD2753.1080506@eecs.berkeley.edu> Message-ID: <19712.1308441811@gemini.franz.com> This discussion missing a few ards from the deck. There is a _standard_ interface for obtaining the soure for a function See cl:function-lambda-epression. However, there are no requirements on this function. The ANS allows this function always to return nil, and indeed, a lambda function defined in a non-empty lexical evironment cannot be represented portably by its plain source sexpr. cl-user(10): (defun foo (x) (1+ x)) foo cl-user(11): (function-lambda-expression #'foo) (lambda (x) (block foo (1+ x))) nil foo but ... cl-user(12): (block bar (defun foo (x) (return-from bar (1+ x)))) foo cl-user(13): (function-lambda-expression #'foo) (lambda (x) (block foo (return-from bar (1+ x)))) # foo Some implementations record no sources. Others record interpreted definitions, but not compilerd definitions loaded fro a binary file. From biomates at telefonica.net Sun Jun 19 12:41:26 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 19 Jun 2011 13:41:26 -0400 Subject: [Maxima] Yet another Maxima tutorial in Chinese In-Reply-To: <885936.92145.qm@web110109.mail.gq1.yahoo.com> References: <885936.92145.qm@web110109.mail.gq1.yahoo.com> Message-ID: <4DFE34C6.2030206@telefonica.net> On 06/17/2011 03:41 PM, Huan Ma wrote: > Hi, > > I have been a Maxima user for several years. I wrote a Chinese document for Maxima in January 2010 and put it on my personal page. I have got some good feedback since then. Now I updated it and fixed some typos. I think it will benefit more people (mostly Chinese speakers) if the administrator can kindly put it on Maxima documentation page under "Tutorials in Chinese". > > Here is the link to the document (Title: Quick Maxima Reference): > http://webfiles.uci.edu/huanm/www/maxima/maxima_html.xml (webpage) > http://webfiles.uci.edu/huanm/www/maxima/maxima_zh.pdf (PDF file) > > This document was released under CC BY-NC-SA 3.0 license. > > Thanks. > > Huan Done. Thanks for this contribution. -- Mario From willisb at unk.edu Mon Jun 20 08:15:21 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 20 Jun 2011 08:15:21 -0500 Subject: [Maxima] great called on a CL list of expressions In-Reply-To: <4DFE34C6.2030206@telefonica.net> References: <885936.92145.qm@web110109.mail.gq1.yahoo.com>, <4DFE34C6.2030206@telefonica.net> Message-ID: By the way: Using Clozure: MAXIMA> (great (list 'p 'q) (list 'a 'b 'c)) Maxima encountered a Lisp error value P is not of the expected type LIST. Using GCL: MAXIMA> (great (list 'p 'q) (list 'a 'b 'c)) T I noticed this difference between Clozure & GCL when I was experimenting with giving kron_delta a reflection rule (kron_delta(a,b) == kron_delta(-a,-b)). --Barton From willisb at unk.edu Mon Jun 20 13:01:44 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 20 Jun 2011 13:01:44 -0500 Subject: [Maxima] proposal for object-oriented dispatch on sign In-Reply-To: References: <885936.92145.qm@web110109.mail.gq1.yahoo.com>, <4DFE34C6.2030206@telefonica.net>, Message-ID: Proposal: Modify sign (not $sign) to use object-oriented dispatch. The function associated with %asin extends the current sign function, I think: (%i1) assume(-1 < x, x < 0); (%o1) [x > - 1, x < 0] (%i2) sign(asin(x)); (%o2) neg The code (the frob macro is based on similar code in trigi): Comments? (defvar *sign-function* (make-hash-table :size 32) "Hash table mapping a maxima function identifier to a CL function that determines the sign of an expression.") (macrolet ((frob (fun sign-fun) `(setf (gethash ',fun *sign-function*) ,sign-fun))) (frob mtimes 'sign-mtimes) (frob mplus 'sign-mplus) (frob mexpt 'sign-mexpt) (frob %log 'sign-log) (frob mabs 'sign-mabs) (frob $min #'(lambda (x) (sign-minmax (caar x) (cdr x)))) (frob $max #'(lambda (x) (sign-minmax (caar x) (cdr x)))) (frob %csc #'(lambda (x) (sign (inv* (cons (ncons (zl-get (caar x) 'recip)) (cdr x)))))) (frob %csch #'(lambda (x) (sign (inv* (cons (ncons (zl-get (caar x) 'recip)) (cdr x)))))) (frob %asin #'(lambda (x) (if (and (eq t (mgrp (cadr x) -1)) (eq t (mgrp 1 (cadr x)))) (sign (cadr x)) (sign-any x)))) (frob %signum #'(lambda (x) (sign (cadr x)))) (frob %erf #'(lambda (x) (sign (cadr x))))) (defmfun sign (x) (cond ((mnump x) (setq sign (rgrp x 0) minus nil odds nil evens nil)) ((and *complexsign* (atom x) (eq x '$%i)) ;; In Complex Mode the sign of %i is $imaginary. (setq sign '$imaginary)) ((atom x) (if (eq x '$%i) (imag-err x)) (sign-any x)) ((gethash (mop x) *sign-function*) (funcall (gethash (mop x) *sign-function*) x)) ((specrepp x) (sign (specdisrep x))) ((kindp (caar x) '$posfun) (sign-posfun x)) ((and (kindp (caar x) '$oddfun) (kindp (caar x) '$increasing)) (sign-oddinc x)) (t (sign-any x)))) --Barton From cooch17 at verizon.net Mon Jun 20 12:26:17 2011 From: cooch17 at verizon.net (egc) Date: Mon, 20 Jun 2011 13:26:17 -0400 Subject: [Maxima] semi-newbie | differences in solve Message-ID: <4DFF82B9.5030707@verizon.net> Greetings -- Using most recent build of Maxima under Windows and Linux. Am trying to move from Maple to Maxima, and am struggling with a few things (so far, Maxima is very impressive). I was fooling with Maxima over the week-end, to updates some lecture notes, when I realized I must not fully understand how Maxima handles 'solve' (meaning, it doesn't do what I though it would do, after my experiences with Maple). For example, f : p^y*(1-p)^(N-y); df : diff(f,p); So, set up simple binomial, differentiate it, and then want to solve for p, which should yield y/N However, solve(df,p); yield a fairly complicated 'mess' [p^y=-((1-p)*p^(y-1)*y)/(y-N)] whereas linsolve(df,p) yields p=y/N as expected. However, it isn't obvious to me (based on the helpfile) why (i) basic 'solve' yields what it does, and why (ii) 'linsolve' seems to be needed (apparently generally, in my tests to date) to yield 'simplified' solutions to fairly simply expressions. Pointers to the obvious, or a quick explanation, most appreciated. Thanks in advance... From macrakis at alum.mit.edu Mon Jun 20 14:31:57 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 20 Jun 2011 15:31:57 -0400 Subject: [Maxima] semi-newbie | differences in solve In-Reply-To: <4DFF82B9.5030707@verizon.net> References: <4DFF82B9.5030707@verizon.net> Message-ID: It's unfortunate that solve doesn't solve this case. Solve does succeed on very similar cases, e.g. solve( factor(df), p ) or even solve( df, [p, xxx]) (where xxx doesn't even appear in df!). And both linsolve and algsys solve it correctly. Why is this? Well, solve and linsolve each have a certain "bag of tricks", and it happens that solve's doesn't cover this case. Solve does call linsolve or algsys when there are multiple equations or multiple variables (e.g. the [p,xxx] case above), but not when there's just one. Looks like solve's bag of tricks should be extended... (or repaired ... for all I know, this could be a regression). Sorry for the inconvenience. -s On Mon, Jun 20, 2011 at 13:26, egc wrote: > f : p^y*(1-p)^(N-y); -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Mon Jun 20 15:14:06 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 20 Jun 2011 15:14:06 -0500 Subject: [Maxima] semi-newbie | differences in solve In-Reply-To: <4DFF82B9.5030707@verizon.net> References: <4DFF82B9.5030707@verizon.net> Message-ID: ----maxima-bounces at math.utexas.edu wrote: ----- >whereas?linsolve(df,p)?yields?p=y/N?as?expected.? The function linsolve doesn't check for linearity, so calling linsolve on a nonlinear equation is hazardous; example Bogus: (%i16) linsolve(p + p^3-42,p); (%o16) [p=42] There is an alternative solver in Maxima (to_poly_solve), but it isn't able to solve this equation either: (%i17) load(to_poly_solver)$ (%i18) %solve(factor(df),p); Nonalgebraic argument given to 'topoly' unable to solve (%o18) %solve([((1-p)^(N-y)*p^(y-1)*(p*N-y))/(p-1)],[p]) Examples of eqquations that the to_poly_solve package can solve: (%i23) %solve(x - 19/4 = sqrt(x - 5),x); (%o23) %union([x=21/4]) (%i25) %solve([max(x,x-y)=10, min(x+y,8)=-12],[x,y]); (%o25) %union([x=-1,y=-11]) --Barton From drdieterkaiser at web.de Mon Jun 20 16:02:18 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 20 Jun 2011 23:02:18 +0200 Subject: [Maxima] proposal for object-oriented dispatch on sign In-Reply-To: References: <885936.92145.qm@web110109.mail.gq1.yahoo.com> , <4DFE34C6.2030206@telefonica.net> , Message-ID: <1308603739.2017.11.camel@dieter> Am Montag, den 20.06.2011, 13:01 -0500 schrieb Barton Willis: > Proposal: Modify sign (not $sign) to use object-oriented dispatch. > The function associated with %asin extends the current sign function, I think: > > (%i1) assume(-1 < x, x < 0); > (%o1) [x > - 1, x < 0] > > (%i2) sign(asin(x)); > (%o2) neg > > The code (the frob macro is based on similar code in trigi): Comments? > > (defvar *sign-function* (make-hash-table :size 32) > "Hash table mapping a maxima function identifier to a CL function that determines the > sign of an expression.") > > (macrolet ((frob (fun sign-fun) `(setf (gethash ',fun *sign-function*) ,sign-fun))) > (frob mtimes 'sign-mtimes) > (frob mplus 'sign-mplus) > (frob mexpt 'sign-mexpt) > (frob %log 'sign-log) > (frob mabs 'sign-mabs) > (frob $min #'(lambda (x) (sign-minmax (caar x) (cdr x)))) > (frob $max #'(lambda (x) (sign-minmax (caar x) (cdr x)))) > (frob %csc #'(lambda (x) (sign (inv* (cons (ncons (zl-get (caar x) 'recip)) (cdr x)))))) > (frob %csch #'(lambda (x) (sign (inv* (cons (ncons (zl-get (caar x) 'recip)) (cdr x)))))) > (frob %asin #'(lambda (x) (if (and (eq t (mgrp (cadr x) -1)) (eq t (mgrp 1 (cadr x)))) (sign (cadr x)) (sign-any x)))) > (frob %signum #'(lambda (x) (sign (cadr x)))) > (frob %erf #'(lambda (x) (sign (cadr x))))) > > (defmfun sign (x) > (cond ((mnump x) (setq sign (rgrp x 0) minus nil odds nil evens nil)) > ((and *complexsign* (atom x) (eq x '$%i)) > ;; In Complex Mode the sign of %i is $imaginary. > (setq sign '$imaginary)) > ((atom x) (if (eq x '$%i) (imag-err x)) (sign-any x)) > ((gethash (mop x) *sign-function*) (funcall (gethash (mop x) *sign-function*) x)) > ((specrepp x) (sign (specdisrep x))) > ((kindp (caar x) '$posfun) (sign-posfun x)) > ((and (kindp (caar x) '$oddfun) (kindp (caar x) '$increasing)) (sign-oddinc x)) > (t (sign-any x)))) Hello Barton, I like this style of programming very much. I would appreciate an implementation which uses the properties of a symbol. The code is easier to extend and to maintain. I have already used this style for implementing the properties 'simplim-%function, 'integral, and 'risplit-function. There are more places which could use this style of programming. It might be useful to extend the Maxima function $properties accordingly. So the user might see, that Maxima knows sign properties of the function. Dieter Kaiser From andrej.vodopivec at gmail.com Mon Jun 20 16:13:14 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Mon, 20 Jun 2011 23:13:14 +0200 Subject: [Maxima] phpBB spam In-Reply-To: References: Message-ID: It seems that my sourceforge username is not properly connected with phpbb. I can not login to phpbb and it will be some time before I can look into it more. Does anyone else have the rights to delete the posts? Andrej On Tue, Jun 14, 2011 at 7:25 PM, Leo Butler wrote: > @andreyv: > > I noticed there are a couple spam posts at > http://sourceforge.net/apps/phpbb/maxima/viewforum.php?f=3 > which could be deleted. > > Leo > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From willisb at unk.edu Mon Jun 20 17:03:05 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 20 Jun 2011 17:03:05 -0500 Subject: [Maxima] proposal for object-oriented dispatch on sign In-Reply-To: <1308603739.2017.11.camel@dieter> References: <885936.92145.qm@web110109.mail.gq1.yahoo.com> , <4DFE34C6.2030206@telefonica.net> , , <1308603739.2017.11.camel@dieter> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I?like?this?style?of?programming?very?much.?I?would?appreciate?an >implementation?which?uses?the?properties?of?a?symbol.?The?code?is?easier >to?extend?and?to?maintain. What about efficiency? The symbol %sin has 44 properties (using wxMaxima). Is this getting to be so many that it is slowing Maxima? --Barton From macrakis at alum.mit.edu Mon Jun 20 17:11:06 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 20 Jun 2011 18:11:06 -0400 Subject: [Maxima] proposal for object-oriented dispatch on sign In-Reply-To: References: <885936.92145.qm@web110109.mail.gq1.yahoo.com> <4DFE34C6.2030206@telefonica.net> <1308603739.2017.11.camel@dieter> Message-ID: Property lists are searched linearly, so yes, lots of properties can slow execution. But probably the only one that actually matters for speed in practice is the 'operators' property, which is what the simplifier dispatches on. I suppose we could iterate over all symbols and move any operators properties to the head of the property list. -s On Mon, Jun 20, 2011 at 18:03, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > > >I like this style of programming very much. I would appreciate an > >implementation which uses the properties of a symbol. The code is easier > >to extend and to maintain. > > What about efficiency? The symbol %sin has 44 properties (using wxMaxima). > Is this > getting to be so many that it is slowing Maxima? > > --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 macrakis at alum.mit.edu Mon Jun 20 17:26:39 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 20 Jun 2011 18:26:39 -0400 Subject: [Maxima] proposal for object-oriented dispatch on sign In-Reply-To: References: <885936.92145.qm@web110109.mail.gq1.yahoo.com> <4DFE34C6.2030206@telefonica.net> <1308603739.2017.11.camel@dieter> Message-ID: PS Not clear how much this matters, even for the operators property. Someone could measure it, I suppose.... On Mon, Jun 20, 2011 at 18:11, Stavros Macrakis wrote: > Property lists are searched linearly, so yes, lots of properties can slow > execution. But probably the only one that actually matters for speed in > practice is the 'operators' property, which is what the simplifier > dispatches on. > > I suppose we could iterate over all symbols and move any operators > properties to the head of the property list. > > -s > > > On Mon, Jun 20, 2011 at 18:03, Barton Willis wrote: > >> -----maxima-bounces at math.utexas.edu wrote: ----- >> >> >I like this style of programming very much. I would appreciate an >> >implementation which uses the properties of a symbol. The code is easier >> >to extend and to maintain. >> >> What about efficiency? The symbol %sin has 44 properties (using wxMaxima). >> Is this >> getting to be so many that it is slowing Maxima? >> >> --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 Mon Jun 20 18:26:34 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 20 Jun 2011 18:26:34 -0500 Subject: [Maxima] proposal for object-oriented dispatch on sign In-Reply-To: References: <885936.92145.qm@web110109.mail.gq1.yahoo.com> <4DFE34C6.2030206@telefonica.net> <1308603739.2017.11.camel@dieter> , Message-ID: >What?about?efficiency??The?symbol?%sin?has?44?properties?(using?wxMaxima). Correction: The symbol %sin has 22, not 44 properties. --Barton From fateman at eecs.berkeley.edu Tue Jun 21 00:18:06 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 20 Jun 2011 22:18:06 -0700 Subject: [Maxima] proposal for object-oriented dispatch on sign In-Reply-To: References: <885936.92145.qm@web110109.mail.gq1.yahoo.com> <4DFE34C6.2030206@telefonica.net> <1308603739.2017.11.camel@dieter> , Message-ID: <4E00298E.4000305@eecs.berkeley.edu> On 6/20/2011 4:26 PM, Barton Willis wrote: >> What about efficiency? The symbol %sin has 44 properties (using wxMaxima). > Correction: The symbol %sin has 22, not 44 properties. > > --Barton > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima the code to do this (move operator property to the front) was in the dumplisp setup circa 1970. it may have been removed or bypassed. As I recall, it didn't make a lot of difference. mplus and mtimes matter more than %sin RJF From cooch17 at verizon.net Mon Jun 20 14:46:45 2011 From: cooch17 at verizon.net (egc) Date: Mon, 20 Jun 2011 15:46:45 -0400 Subject: [Maxima] semi-newbie | differences in solve In-Reply-To: References: <4DFF82B9.5030707@verizon.net> Message-ID: <4DFFA3A5.3050604@verizon.net> Greetings! On 6/20/2011 3:31 PM, Stavros Macrakis wrote: > It's unfortunate that solve doesn't solve this case. > > Solve does succeed on very similar cases, e.g. solve( factor(df), p ) > or even solve( df, [p, xxx]) (where xxx doesn't even appear in df!). > And both linsolve and algsys solve it correctly. > > Why is this? Well, solve and linsolve each have a certain "bag of > tricks", and it happens that solve's doesn't cover this case. Solve > does call linsolve or algsys when there are multiple equations or > multiple variables (e.g. the [p,xxx] case above), but not when there's > just one. > > Looks like solve's bag of tricks should be extended... (or repaired > ... for all I know, this could be a regression). > > Sorry for the inconvenience. > Not an inconvenience -- I can see now (based on your explanation) that I *might* need to try multiple forms of 'solve' to get a right answer to a particular problem. If Maxima were the only application I use where the first most obvious approach isn't always the right one, I'd ask for my money back. ;-) From cooch17 at verizon.net Mon Jun 20 15:45:42 2011 From: cooch17 at verizon.net (egc) Date: Mon, 20 Jun 2011 16:45:42 -0400 Subject: [Maxima] semi-newbie | differences in solve In-Reply-To: References: <4DFF82B9.5030707@verizon.net> Message-ID: <4DFFB176.2040100@verizon.net> Greetings -- On 6/20/2011 4:14 PM, Barton Willis wrote: > ----maxima-bounces at math.utexas.edu wrote: ----- > > >> whereas linsolve(df,p) yields p=y/N as expected. > The function linsolve doesn't check for linearity, so calling linsolve > on a nonlinear equation is hazardous; example > > Bogus: > > (%i16) linsolve(p + p^3-42,p); > (%o16) [p=42] Clearly -- should be p=3.38015... Challenge here is the complex roots, I suppose. > There is an alternative solver in Maxima (to_poly_solve), but it isn't able to solve > this equation either: > > (%i17) load(to_poly_solver)$ > (%i18) %solve(factor(df),p); > Nonalgebraic argument given to 'topoly' unable to solve > (%o18) %solve([((1-p)^(N-y)*p^(y-1)*(p*N-y))/(p-1)],[p]) > > Examples of eqquations that the to_poly_solve package can solve: > > (%i23) %solve(x - 19/4 = sqrt(x - 5),x); > (%o23) %union([x=21/4]) > > (%i25) %solve([max(x,x-y)=10, min(x+y,8)=-12],[x,y]); > (%o25) %union([x=-1,y=-11]) > > --Barton Thanks very much. I suppose it is worth noting that there are at least 5-6 different forms of 'solve' in Maple, so having to 'futz' (from the Latin) with the same issue in Maxima is nothing new. I guess the only thing that might be useful in the broad sense is embedding some of this (or some summary of 'structural issues') into the Maxima help system, to provide some guidance. From fateman at eecs.berkeley.edu Tue Jun 21 07:43:10 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 21 Jun 2011 05:43:10 -0700 Subject: [Maxima] semi-newbie | differences in solve In-Reply-To: <4DFFB176.2040100@verizon.net> References: <4DFF82B9.5030707@verizon.net> <4DFFB176.2040100@verizon.net> Message-ID: <4E0091DE.7060103@eecs.berkeley.edu> The issue here is, to some extent, not solve but how much simplification should be used automatically by any command (including solve) in processing. One can try any or all of a substantial number of simplification programs, including ratsimp, fullratsimp, trigsimp, exponentialize, factor .... at every juncture, including "is", "if", "solve" ... or expect that the user will occasionally make a choice of some transformation before calling the command. Solve is perhaps unusual in that it may eventually conclude something like "nope, I couldn't do that" and could then try some extra tools. But just factoring the input to solve is probably NOT a good idea, given the potential expense of factoring when it is pointless. RJF From cooch17 at verizon.net Tue Jun 21 09:05:35 2011 From: cooch17 at verizon.net (egc) Date: Tue, 21 Jun 2011 10:05:35 -0400 Subject: [Maxima] semi-newbie | differences in solve In-Reply-To: <4E0091DE.7060103@eecs.berkeley.edu> References: <4DFF82B9.5030707@verizon.net> <4DFFB176.2040100@verizon.net> <4E0091DE.7060103@eecs.berkeley.edu> Message-ID: <4E00A52F.8030201@verizon.net> On 6/21/2011 8:43 AM, Richard Fateman wrote: > The issue here is, to some extent, not solve but how much > simplification should be used automatically by any command (including > solve) in processing. One can try any or all of a substantial number > of simplification programs, including ratsimp, fullratsimp, trigsimp, > exponentialize, factor .... at every juncture, including "is", "if", > "solve" ... > > or > > expect that the user will occasionally make a choice of some > transformation before calling the command. > > > Solve is perhaps unusual in that it may eventually conclude something > like "nope, I couldn't do that" and could then try some extra tools. > > But just factoring the input to solve is probably NOT a good idea, > given the potential expense of factoring when it is pointless. > > RJF > > Agree completely. For example, normally we work with the log of the binomial (maximizing likelihood of p): lf : y*log(p)+(N-y)*log(1-p); dlf : diff(lf,p); solve(dlf,p); In this case, solve yields the 'right answer' (p=y/N). From macrakis at alum.mit.edu Tue Jun 21 10:22:31 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 21 Jun 2011 11:22:31 -0400 Subject: [Maxima] semi-newbie | differences in solve In-Reply-To: <4DFFB176.2040100@verizon.net> References: <4DFF82B9.5030707@verizon.net> <4DFFB176.2040100@verizon.net> Message-ID: On Mon, Jun 20, 2011 at 16:45, egc wrote: > On 6/20/2011 4:14 PM, Barton Willis wrote: > >> ...The function linsolve doesn't check for linearity, so calling linsolve >> on a nonlinear equation is hazardous; example >> >> Bogus: >> >> (%i16) linsolve(p + p^3-42,p); >> (%o16) [p=42] >> > > Clearly -- should be p=3.38015... > > Challenge here is the complex roots, I suppose. No, that's not the problem! The problem is that linsolve is ignoring the p^3 term completely, cf. linsolve(a*x^2+b*x+c,x); => [x = -c/b] We should probably at least *check* for nonsense like this. Regular solve (for symbolic solutions), algsys (for systems of algebraic equations), and allroots (for numerical solutions) have no problem with the complex roots. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Tue Jun 21 10:24:42 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 21 Jun 2011 10:24:42 -0500 Subject: [Maxima] proposal for object-oriented dispatch on sign In-Reply-To: <1308603739.2017.11.camel@dieter> References: <885936.92145.qm@web110109.mail.gq1.yahoo.com> , <4DFE34C6.2030206@telefonica.net> , , <1308603739.2017.11.camel@dieter> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I?like?this?style?of?programming?very?much.?I?would?appreciate?an >implementation?which?uses?the?properties?of?a?symbol.?The?code?is?easier >to?extend?and?to?maintain Assuming I can navigate git (you all might need to be on belay), I'll commit a symbol property version of sign (it runs the testsuite in about the same time as the hash table version). The testsuite calls sign about 1.5 million times--I didn't try to time sign. Since kill(all) erases $timer data, it's not easy to time functions using the testsuite. --Barton From macrakis at alum.mit.edu Tue Jun 21 10:30:47 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 21 Jun 2011 11:30:47 -0400 Subject: [Maxima] semi-newbie | differences in solve In-Reply-To: <4E0091DE.7060103@eecs.berkeley.edu> References: <4DFF82B9.5030707@verizon.net> <4DFFB176.2040100@verizon.net> <4E0091DE.7060103@eecs.berkeley.edu> Message-ID: On Tue, Jun 21, 2011 at 08:43, Richard Fateman wrote: > The issue here is, to some extent, not solve but how much simplification > should be used automatically by any command (including solve) in processing. > One can try any or all of a substantial number of simplification programs, > including ratsimp, fullratsimp, trigsimp, exponentialize, factor .... at > every juncture, including "is", "if", "solve" ... > or > expect that the user will occasionally make a choice of some transformation > before calling the command. > > Solve is perhaps unusual in that it may eventually conclude something like > "nope, I couldn't do that" and could then try some extra tools. > > But just factoring the input to solve is probably NOT a good idea, given > the potential expense of factoring when it is pointless. > I'd think that our basic functions like solve, integrate, limit, etc. should try *all* reasonable techniques to get a useful result. In the vast majority of practical cases, trying factor will not take too much time. If a user it working on a problem that stretches the capabilities of the general-purpose tool, then we should offer special-purpose tools that allow finer control. I would be more worried about producing useless or incorrect results. For example, solve(exponentialize(sin(x)^3+cos(x)+1),x) produces a big, messy, (and incomplete) result, which I doubt is of any use to anyone. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Jun 21 10:32:27 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 21 Jun 2011 11:32:27 -0400 Subject: [Maxima] Warnings for arctrig vs. log Message-ID: solve(sin(x)) helpfully says solve: using arc-trig functions to get a solution. Some solutions will be lost. However, solve(exp(x)-1) does not, but silently omits the nonzero solutions 2*%pi*%z999. Should we fix this? -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Jun 21 12:09:51 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 21 Jun 2011 13:09:51 -0400 Subject: [Maxima] proposal for object-oriented dispatch on sign References: <885936.92145.qm@web110109.mail.gq1.yahoo.com> <4DFE34C6.2030206@telefonica.net> <1308603739.2017.11.camel@dieter> Message-ID: >>>>> "Barton" == Barton Willis writes: Barton> The testsuite calls sign about 1.5 million times--I didn't Barton> try to time sign. Since kill(all) erases $timer data, it's Barton> not easy to time functions using the testsuite. This is where you could probably use the profiling facility of your Lisp implementation. With CMUCL, I would just say :lisp (profile:profile $sign), run the testsuite and then run :lisp (profile:report-times) (Untested.) I'm sure other Lisps have some kind of profiling facility, and if not, there's always the (fairly) portable METERING package. Ray From toy.raymond at gmail.com Tue Jun 21 12:13:33 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 21 Jun 2011 13:13:33 -0400 Subject: [Maxima] Warnings for arctrig vs. log References: Message-ID: >>>>> "Stavros" == Stavros Macrakis writes: Stavros> solve(sin(x)) helpfully says Stavros> solve: using arc-trig functions to get a solution. Stavros> Some solutions will be lost. Stavros> However, solve(exp(x)-1) does not, but silently omits the nonzero solutions 2*%pi*%z999. I assume you left off the %i. Otherwise, I don't know what you're getting at. Stavros> Should we fix this? >From a high school student's point of view, the arc-trig warning is important, but less so for exp, since there's only one real root, unlike the arc-trig functions. For completeness, we probably should at least warn. Ray From pbowyer at olynet.com Tue Jun 21 12:21:55 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Tue, 21 Jun 2011 10:21:55 -0700 Subject: [Maxima] Looking for information In-Reply-To: References: <4DFA7C5C.3070201@olynet.com> Message-ID: <4E00D333.2000503@olynet.com> On 06/17/2011 01:39 AM, Rupert Swarbrick wrote: > Paul Bowyer writes: >> If there is a well-maintained Common Lisp GUI toolkit available that >> you know about, please let me know. > Further to Steve Haflich's reply, you might consider a GTK based > approach. There's a (horribly formatted) list at the Cliki > > http://www.cliki.net/Gtk > > If you're feeling brave, you could try Cells-GTK > > http://common-lisp.net/project/cells-gtk/ > > I was rather turned off the whole approach a couple of years ago because > of rubbish documentation and the presence of Kenneth Tilton, but both of > these problems seem to have receded... > > I personally have a bit of experience with CLG > > http://sourceforge.net/projects/clg/ > > but it seems somewhat moribund and probably won't survive Gnome's move > to gnome-introspection without some serious work. > > > Rupert > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Hello again, Rupert: After some experimentation and searching I found a gtk-based approach that looks interesting and it seems to work without errors so far. I'm including the websites I found in case you might still have an interest in GUI toolkits for common lisp (and/or other other ways to access the gtk). http://leonardoce.interfree.it/gtkserver/index.html http://www.gtk-server.org/ I also tried cl-gtk2, but parts of it (gtk-glext) wouldn't load with SBCL 1.0.48 and slime and I didn't feel I was up to the task discovering why. I have not yet tried cells-gtk, and I may not get to it if I find that gtk-server works out OK. Thanks again for pointing out some choices that led me to discovering gtk-server. Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Jun 21 12:28:10 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 21 Jun 2011 13:28:10 -0400 Subject: [Maxima] Warnings for arctrig vs. log In-Reply-To: References: Message-ID: Yes, omitted the %i : solve(exp(%i*x)-1); => [x = 0] That said, we do also simplify log(1)=>0 with no warning, not 2*%i*%pi* -s On Tue, Jun 21, 2011 at 13:13, Raymond Toy wrote: > >>>>> "Stavros" == Stavros Macrakis writes: > > Stavros> solve(sin(x)) helpfully says > > > > Stavros> solve: using arc-trig functions to get a > solution. > Stavros> Some solutions will be lost. > > > > Stavros> However, solve(exp(x)-1) does not, but silently omits the > nonzero solutions 2*%pi*%z999. > > I assume you left off the %i. Otherwise, I don't know what you're > getting at. > > Stavros> Should we fix this? > > From a high school student's point of view, the arc-trig warning is > important, but less so for exp, since there's only one real root, > unlike the arc-trig functions. > > For completeness, we probably should at least warn. > > 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 willisb at unk.edu Tue Jun 21 16:33:49 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 21 Jun 2011 16:33:49 -0500 Subject: [Maxima] proposal for object-oriented dispatch on sign In-Reply-To: References: <885936.92145.qm@web110109.mail.gq1.yahoo.com> , <4DFE34C6.2030206@telefonica.net> , , <1308603739.2017.11.camel@dieter>, Message-ID: I added a few lines to sign to support subscripted functions. Sadly, Maxima is too eager to determine the sign using a (potentially bogus) floating point evaluation. Examples: Even with signbfloat false, sign uses floating point :( (%i1) signbfloat : false$ (%i2) sign(li[2](7/8)); 0> Calling (SIGN 1.2381234817964804) <0 SIGN returned NIL (%o2) pos The sign function works by modifying special variables. This makes sign extra fun to debug or understand. For noninteger order Li, sign doesn't always use floating point :) (%i3) sign(li[7/3](7/8)); 0> Calling (SIGN ((MQAPPLY SIMP) (($LI SIMP ARRAY) ((RAT SIMP) 7 3)) ((RAT SIMP) 7 8))) 1> Calling (SIGN ((RAT SIMP) 7 8)) <1 SIGN returned NIL 1> Calling (SIGN ((RAT SIMP) 1 8)) <1 SIGN returned NIL 1> Calling (SIGN ((RAT SIMP) 7 8)) <1 SIGN returned NIL <0 SIGN returned NIL (%o3) pos These should be pos, but due to floating point evaluation, sign returns pnz: (%i4) sign(li[2](10^-1000)); (%o4) pnz (%i5) sign(li[2](1/10^10000)); (%o5) pnz Either completely stuck or takes longer than I'm willing to wait (%i6) sign(li[2](1/10^10000000)); --Barton From willisb at unk.edu Tue Jun 21 16:36:21 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 21 Jun 2011 16:36:21 -0500 Subject: [Maxima] proposal for object-oriented dispatch on sign In-Reply-To: References: <885936.92145.qm@web110109.mail.gq1.yahoo.com> <4DFE34C6.2030206@telefonica.net> <1308603739.2017.11.camel@dieter> , Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >This?is?where?you?could?probably?use?the?profiling?facility?of?your >Lisp?implementation.??With?CMUCL,?I?would?just?say?:lisp >(profile:profile?$sign),?run?the?testsuite?and?then?run?:lisp >(profile:report-times) I'll try this with SBCL---I think CCL doesn't have an easy way such as this that works under Windows :( -Barton From l_butler at users.sourceforge.net Wed Jun 22 06:54:42 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Wed, 22 Jun 2011 11:54:42 +0000 Subject: [Maxima] phpBB spam In-Reply-To: (message from Andrej Vodopivec on Mon, 20 Jun 2011 23:13:14 +0200) Message-ID: <1qpk4ce13p9.fsf@iceland.freeshell.org> Andrej Vodopivec writes: > It seems that my sourceforge username is not properly connected with > phpbb. I can not login to phpbb and it will be some time before I can > look into it more. Does anyone else have the rights to delete the > posts? I looked into this before reporting the spam, but the only admin listed on the page is you. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From woollett at charter.net Wed Jun 22 13:42:09 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 22 Jun 2011 11:42:09 -0700 Subject: [Maxima] analog of fundef for Maxima functions defined in lisp file Message-ID: On June ,2011, Steve Haflich wrote: smh> There is a _standard_ interface for obtaining the soure for a function smh> See cl:function-lambda-epression. However, there are no requirements on smh> this function. The ANS allows this function always to return nil, and smh> indeed, a lambda function defined in a non-empty lexical evironment smh> cannot be represented portably by its plain source sexpr. smh> smh> cl-user(10): (defun foo (x) (1+ x)) smh> foo smh> cl-user(11): (function-lambda-expression #'foo) smh> (lambda (x) (block foo (1+ x))) smh> nil Thanks for clarifying Allegro use, which works for me: --------------------- CG-USER(1): (defun foo (x) (1+ x)) FOO CG-USER(2): (foo 2) 3 CG-USER(3): (function-lambda-expression #'foo) (LAMBDA (X) (BLOCK FOO (1+ X))) NIL FOO -------------------------------- but CGL (via Maxima) fails: MAXIMA> (defun foo (x) (1+ x)) FOO MAXIMA> (foo 2) 3 MAXIMA> (function-lambda-expression #'foo) Maxima encountered a Lisp error: Error in EVAL [or a callee]: The function FUNCTION-LAMBDA-EXPRESSION is undefined. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. -------------------- Ted Woollett From pbowyer at olynet.com Wed Jun 22 17:37:14 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Wed, 22 Jun 2011 15:37:14 -0700 Subject: [Maxima] Looking for information In-Reply-To: <4E00D333.2000503@olynet.com> References: <4DFA7C5C.3070201@olynet.com> <4E00D333.2000503@olynet.com> Message-ID: <4E026E9A.1060702@olynet.com> On 06/21/2011 10:21 AM, Paul Bowyer wrote: > On 06/17/2011 01:39 AM, Rupert Swarbrick wrote: >> Paul Bowyer writes: >>> If there is a well-maintained Common Lisp GUI toolkit available that >>> you know about, please let me know. >> Further to Steve Haflich's reply, you might consider a GTK based >> approach. There's a (horribly formatted) list at the Cliki >> >> http://www.cliki.net/Gtk >> >> If you're feeling brave, you could try Cells-GTK >> >> http://common-lisp.net/project/cells-gtk/ >> >> I was rather turned off the whole approach a couple of years ago because >> of rubbish documentation and the presence of Kenneth Tilton, but both of >> these problems seem to have receded... >> >> I personally have a bit of experience with CLG >> >> http://sourceforge.net/projects/clg/ >> >> but it seems somewhat moribund and probably won't survive Gnome's move >> to gnome-introspection without some serious work. >> >> >> Rupert >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > Hello again, Rupert: > > After some experimentation and searching I found a gtk-based approach > that looks interesting and it seems to work without errors so far. I'm > including the websites I found in case you might still have an > interest in GUI toolkits for common lisp (and/or other other ways to > access the gtk). > > http://leonardoce.interfree.it/gtkserver/index.html > http://www.gtk-server.org/ > > I also tried cl-gtk2, but parts of it (gtk-glext) wouldn't load with > SBCL 1.0.48 and slime and I didn't feel I was up to the task > discovering why. > > I have not yet tried cells-gtk, and I may not get to it if I find that > gtk-server works out OK. > > Thanks again for pointing out some choices that led me to discovering > gtk-server. > > Paul > > > An update to the above info. I had to make few simple modifications to the lisp code provided by http://leonardoce.interfree.it/gtkserver/index.html because my version of gtk was later than that for which the code was built. There may be other changes necessary, but I'll address them as problems occur. Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From dekleer at parc.com Thu Jun 23 15:06:11 2011 From: dekleer at parc.com (dekleer at parc.com) Date: Thu, 23 Jun 2011 13:06:11 PDT Subject: [Maxima] Allegro + Maxima on Windows. Message-ID: <1C4F4F4F61496646AB61EDC99E1252520DFC1977@e2010dag2.corp.ad.parc.com> I see a number of emails about using Allegro. However, I downloaded the latest version and it seems to have many problems. I managed to get Macsyma to work, but its still fragile. Am I using a wrong version? I have Allegro 8.2 and 5.24.0. I used configure.lisp to create Maxima. A few of the problems are: - Case errors in package names, e.g., the source uses (in-package "BIGLOAT") and (in-package "bigfloat") interchangeably. - Share-subdirs.lisp does not get created. So I have to construct it by hand. - Some of the $file_... search pathnames are incorrect. Some of the pathnames have "//" which are not legal under Windows. Source of the problem seems to be whatever sets *maxima-userid* - Error handling (i.e., catch tags) does not work. Haven't debugged that yet. I'm willing to upload these and other fixes. But I suspect someone must have done this all before judging from the email traffic. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri Jun 24 09:39:21 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 24 Jun 2011 07:39:21 -0700 Subject: [Maxima] Allegro + Maxima on Windows. In-Reply-To: <1C4F4F4F61496646AB61EDC99E1252520DFC1977@e2010dag2.corp.ad.parc.com> References: <1C4F4F4F61496646AB61EDC99E1252520DFC1977@e2010dag2.corp.ad.parc.com> Message-ID: <4E04A199.1020501@eecs.berkeley.edu> On 6/23/2011 1:06 PM, dekleer at parc.com wrote: > > I see a number of emails about using Allegro. However, I downloaded > the latest version and it seems to have many problems. I managed to > get Macsyma to work, but its still fragile. Am I using a wrong > version? I have Allegro 8.2 and 5.24.0. I used configure.lisp to > create Maxima. A few of the problems are: > > -Case errors in package names, e.g., the source uses (in-package > "BIGLOAT") and (in-package "bigfloat") interchangeably. > > -Share-subdirs.lisp does not get created. So I have to construct it > by hand. > > -Some of the $file_... search pathnames are incorrect. Some of the > pathnames have "//" which are not legal under Windows. Source of the > problem seems to be whatever sets **maxima-userid** > > -Error handling (i.e., catch tags) does not work. Haven't debugged > that yet. > > I'm willing to upload these and other fixes. But I suspect someone > must have done this all before judging from the email traffic. > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima I have built Maxima on Allegro a number of times, and it (Maxima) is not entirely satisfactorily configured for Allegro when Allegro is run in my favorite mode (in which upper and lower case are used). But if I use Allegro in the upper-casifying "ANSI" mode, which is, I think, the default for the free system, then it generally works. I have not tried to bring up the interface to gplot or wxmaxima, so I don't know if it works. For some systems, a package name can appear as :bigfloat :BIGFLOAT "BIGFLOAT" and be the same. I think it should be :bigfloat, but at least it should always be the same. I have not used makefile at all, and have not constructed the share subdirectories. Macsyma originally had (and still has) a lisp-language makefile kind of thing to build a system. I have long ago given up on the notion of keeping that up to date, and now building Maxima depends on a raft of other tools, some of which are handy and standard in ways that ANSI CL may not be, some of which are superfluous and represent some habit inherited from some programmer's previous projects. Maxima code should be conditionalized for error handling since (I think) GCL doesn't conform to ANSI. so some of the conditionalizations like #+CMU might need to be changed to #+(or CMU Franz) or some such. You may, in fact, have gone further than I have in pushing Maxima through the free Allegro. Note: I was not able to compile all the converted-from-fortran stuff in the free Allegro. At least a few years ago. But it DOES compile in a paid-up copy, and can be loaded into a free Allegro. I don't know about now. If you have strong reasons to use Maxima in a free Allegro, maybe we should talk. As it is, there is not exactly a groundswell for setting this up, and Franz Inc doesn't seem to care one way or the other. [It represents no income, so that is fair business assessment!] RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri Jun 24 16:00:12 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 24 Jun 2011 14:00:12 -0700 Subject: [Maxima] Allegro + Maxima on Windows. In-Reply-To: <11Jun24.084025pdt."516677(2)"@alpha.xerox.com> References: <1C4F4F4F61496646AB61EDC99E1252520DFC1977@e2010dag2.corp.ad.parc.com> <4E04A199.1020501@eecs.berkeley.edu> <11Jun24.084025pdt."516677(2)"@alpha.xerox.com> Message-ID: <4E04FADC.4040503@eecs.berkeley.edu> On 6/24/2011 8:40 AM, Johan de Kleer wrote: > Thanks for your answer. I should describe my application. I have a > large Allegro Lisp application that now needs to do symbolic > manipulation. I could interface with Matlab/Mathematica but thats a > lot of new learning and I won't have the source. > > Since you have done this before let me ask you a question. If I have > maxima running (with run), any other listener's read-eval-print is > disabled which is a real pain. A lot of my problems went away when I > dynamically bind some critical variables in run like *debugger-hook*, > *readtable*,.... The current Macsyma doesn't rebind them and clobbers > them globally?????????? The Macsyma/Maxima read-eval-print loop has grown over the years to include a host of hacks to allow it to run in various incompatible lisps. In addition to which, some people have just written their own front ends (like wxmaxima) in non-Lisp languages, to make themselves more comfortable, and perhaps more portable over different operating systems. wxmaxima allows a user to type on a command line :lisp (defun ..... whatever) and so it must change back the readtable and such to normal lisp, at least when parsing the rest of that line. there is also a function to_lisp() which puts you in a lisp REPL until you type (to-maxima). So this is something other people have done. On the other hand, I don't know exactly how they've done it and I don't know what dbm-read is really supposed to do. If I have a program calling something in Maxima, I never use Maxima's front end. I compose the problem and create the data, and call the appropriate program. e.g. to compute polynomial gcd, I do (pgcd A B). As far as multivariate polynomials -- they do form a Euclidean domain; considered recursively in variables v1,v2,...,vn, a polynomial ring in v1 whose coefficients are (recursively) polynomials in v2 , ... vn ... are just fine. Maxima has Grobner basis calculations, but unless you absolutely need this, it is generally to be avoided. Solving systems of polynomial constraints may be done by computing resultants. I hope this is of some use. RJF > > My current problem is that if one Listener is running maxima, > read-eval-print is broken for every othre one. And I cannot figure > out the problem. After some hours I've isolated it to a read-char in > dbm-read. If that read-char is waiting for a character all the other > Listener's cannot eval. So there is some other variable Maxima is > setting globally which is causing the problem that I have not > identified. Any idea of which? One clue is that if I print out > messages to the listener in dmb-read those same messages gets read by > dbm-read and it gets obvious syntax errors. Or, if I don't, things > are sensitive to the delay, so just sleeping a bit or printing out > something causes an error too many characters to unread. Something is > very messed up in the reading/processes inside of dbm-read but I > cannot figure out what the problem is. Very very bizarre behavior. > > BTW, since you are an expert. The first I need is multivareate > polynomial gcd. They do not form a Euclidean domain so I need Grobner > bases which I assume this Macsyma does? > > > > At 07:39 AM 6/24/2011, Richard Fateman wrote: >> On 6/23/2011 1:06 PM, dekleer at parc.com wrote: >>> I see a number of emails about using Allegro. However, I downloaded >>> the latest version and it seems to have many problems. I managed to >>> get Macsyma to work, but its still fragile. Am I using a wrong >>> version? I have Allegro 8.2 and 5.24.0. I used configure.lisp to >>> create Maxima. A few of the problems are: >>> >>> - Case errors in package names, e.g., the source uses >>> (in-package "BIGLOAT") and (in-package "bigfloat") interchangeably. >>> - Share-subdirs.lisp does not get created. So I have to >>> construct it by hand. >>> - Some of the $file_... search pathnames are incorrect. >>> Some of the pathnames have "//" which are not legal under Windows. >>> Source of the problem seems to be whatever sets **maxima-userid** >>> - Error handling (i.e., catch tags) does not work. >>> Haven't debugged that yet. >>> >>> I'm willing to upload these and other fixes. But I suspect someone >>> must have done this all before judging from the email traffic. >>> >>> _______________________________________________ >>> Maxima mailing list >>> Maxima at math.utexas.edu >>> >>> http://www.math.utexas.edu/mailman/listinfo/maxima >> I have built Maxima on Allegro a number of times, and it (Maxima) is >> not entirely satisfactorily configured for Allegro >> when Allegro is run in my favorite mode (in which upper and lower >> case are used). But if I use Allegro in the upper-casifying "ANSI" >> mode, which is, I think, the default for the free system, then it >> generally works. I have not tried to bring up the interface to gplot >> or wxmaxima, so I don't know if it works. >> >> For some systems, a package name can appear as :bigfloat :BIGFLOAT >> "BIGFLOAT" and be the same. I think it should be :bigfloat, but at >> least it should always be the same. >> >> I have not used makefile at all, and have not constructed the share >> subdirectories. Macsyma originally had (and still has) a >> lisp-language makefile kind of thing to build a system. I have long >> ago given up on the notion of keeping that up to date, and now >> building Maxima depends on a raft of other tools, some of which are >> handy and standard in ways that ANSI CL may not be, some of which are >> superfluous and represent some habit inherited from some programmer's >> previous projects. >> >> Maxima code should be conditionalized for error handling since (I >> think) GCL doesn't conform to ANSI. so some of the >> conditionalizations like #+CMU might need to be changed to #+(or >> CMU Franz) or some such. >> >> You may, in fact, have gone further than I have in pushing Maxima >> through the free Allegro. Note: I was not able to compile all the >> converted-from-fortran stuff in the free Allegro. At least a few >> years ago. But it DOES compile in a paid-up copy, and can be loaded >> into a free Allegro. I don't know about now. >> >> If you have strong reasons to use Maxima in a free Allegro, maybe we >> should talk. As it is, there is not exactly a groundswell for >> setting this up, and Franz Inc doesn't seem to care one way or the >> other. [It represents no income, so that is fair business assessment!] >> >> RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From pfw at unl.edu Fri Jun 24 16:54:24 2011 From: pfw at unl.edu (Frazer Williams) Date: Fri, 24 Jun 2011 16:54:24 -0500 Subject: [Maxima] Integrating csch^2(x) gives an incorrect result Message-ID: <20110624165424.7346c14c@moi.unl.edu> Hi, I think I've found an error in the integration function. In case it's relevant, I'm using Maxima 5.23.2 http://maxima.sourceforge.net using Lisp SBCL 1.0.40-1.fc14 The error occurs when integrating (csch(x))^2. (%i3) integrate((1/sinh(x))^2,x); 4 (%o3) ------------- - 2 x 2 %e - 2 According to a book of tables, the integral should be -coth x Thanks for making available and maintaining the maxima program. I use it frequently. -- Frazer From drdieterkaiser at web.de Fri Jun 24 16:59:01 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 24 Jun 2011 23:59:01 +0200 Subject: [Maxima] Allegro + Maxima on Windows. In-Reply-To: <4E04FADC.4040503@eecs.berkeley.edu> References: <1C4F4F4F61496646AB61EDC99E1252520DFC1977@e2010dag2.corp.ad.parc.com> <4E04A199.1020501@eecs.berkeley.edu> <11Jun24.084025pdt."516677(2)"@alpha.xerox.com> <4E04FADC.4040503@eecs.berkeley.edu> Message-ID: <1308952741.1567.7.camel@dieter> Am Freitag, den 24.06.2011, 14:00 -0700 schrieb Richard Fateman: Some words about DBM-READ: When we think of a Lisp-read-eval-loop, then the function DBM-READ replaces the Lisp function READ. A better name for DBM-READ would be MAXIMA-TOPLEVEL-READ and a better place would be the file macsys.lisp. The function DBM-READ reads input from a stream, which can be the standard-input or a file in a demo- or batch-mode. If DBM-READ is reading from the standard-input first a prompt is printed and the function waits for input from the user. DBM-READ handles some special chars like ":" for break commands or "?", a shortcut to get documentation. If there are no special chars, then DBM-READ calls the function MREAD. This is the main routine of Maximas parser. The return value is a valid but unevaluated and unsimplifed Maxima expression. The function DBM-READ is called from the function CONTINUE. Again it would be better to have a more expressive name like MAXIMA-TOPLEVEL-LOOP. The function CONTINUE is Maximas read-eval-loop. The function reads the input from a stream, evaluates and simplifies the user input, and at last prints the result on the display. In addition the function CONTINUE does some bookkeeping, stores the input and result into labels and calculates the runtime of evaluation. For German readers it might be interesting to have a look at the documentation Maxima intern at http://crategus.users.sourceforge.net/kmaxima.html In this documentation I have started to write about Maximas internal functions. The implementation is simplified to work out the main ideas of the implementation. The first chapter Grundger?st is complete and shows the main ideas of the toplevel functions and the way to implement more functionality of a computer algebra system. Dieter Kaiser From vi5u0-maxima at yahoo.co.uk Fri Jun 24 17:16:01 2011 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Fri, 24 Jun 2011 23:16:01 +0100 (BST) Subject: [Maxima] Integrating csch^2(x) gives an incorrect result In-Reply-To: <20110624165424.7346c14c@moi.unl.edu> References: <20110624165424.7346c14c@moi.unl.edu> Message-ID: On Fri, 24 Jun 2011, Frazer Williams wrote: > The error occurs when integrating (csch(x))^2. > > > (%i3) integrate((1/sinh(x))^2,x); > 4 > (%o3) ------------- > - 2 x > 2 %e - 2 > > According to a book of tables, the integral should be > > -coth x The two only differ by an additive constant. Maxima doesn't make the constant of integration in an indefinite integral explicit. From A.G.Grozin at inp.nsk.su Fri Jun 24 17:19:33 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Sat, 25 Jun 2011 05:19:33 +0700 (NOVST) Subject: [Maxima] Integrating csch^2(x) gives an incorrect result In-Reply-To: <20110624165424.7346c14c@moi.unl.edu> References: <20110624165424.7346c14c@moi.unl.edu> Message-ID: On Fri, 24 Jun 2011, Frazer Williams wrote: > (%i3) integrate((1/sinh(x))^2,x); > 4 > (%o3) ------------- > - 2 x > 2 %e - 2 > > According to a book of tables, the integral should be > > -coth x The two results differ by a constant, and therefore both are equally correct. Andrey From pfw at unl.edu Fri Jun 24 17:22:30 2011 From: pfw at unl.edu (Frazer Williams) Date: Fri, 24 Jun 2011 17:22:30 -0500 Subject: [Maxima] Integrating csch^2(x) gives an incorrect result In-Reply-To: References: <20110624165424.7346c14c@moi.unl.edu> Message-ID: <20110624172230.3cc814fe@moi.unl.edu> On Fri, 24 Jun 2011 23:16:01 +0100 (BST) Dan wrote: > On Fri, 24 Jun 2011, Frazer Williams wrote: > > > The error occurs when integrating (csch(x))^2. > > > > > > (%i3) integrate((1/sinh(x))^2,x); > > 4 > > (%o3) ------------- > > - 2 x > > 2 %e - 2 > > > > According to a book of tables, the integral should be > > > > -coth x > > The two only differ by an additive constant. Maxima doesn't make the > constant of integration in an indefinite integral explicit. You're right. Thanks to you and to Andrey Grozin for the quick replies. Sorry for the noise. I'll quietly withdraw back into the woodwork now. -- Frazer From toy.raymond at gmail.com Sat Jun 25 15:10:52 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 25 Jun 2011 16:10:52 -0400 Subject: [Maxima] Allegro + Maxima on Windows. References: <1C4F4F4F61496646AB61EDC99E1252520DFC1977@e2010dag2.corp.ad.parc.com> <4E04A199.1020501@eecs.berkeley.edu> Message-ID: >>>>> "Richard" == Richard Fateman writes: Richard> I have built Maxima on Allegro a number of times, and it Richard> (Maxima) is not entirely satisfactorily configured for Richard> Allegro when Allegro is run in my favorite mode (in which Richard> upper and lower case are used).? But if I use Allegro in Richard> the upper-casifying "ANSI" mode, which is, I think, the Richard> default for the free system, then it generally works.? I I thought some time ago Douglas had made some changes to allow Maxima to be used with a "modern-mode" Lisp could be used. I don't think anyone has intentionally tried to make the code not work; it's just probably not developer is using such a Lisp, so these kinds of incompatible changes just leak in. Richard> For some systems, a package name can appear as ? Richard> :bigfloat? :BIGFLOAT "BIGFLOAT" and be the same. I think Richard> it should be :bigfloat, but at least it should always be Richard> the same. Richard> I have not used makefile at all, and have not constructed Richard> the share subdirectories.? Macsyma originally had (and Richard> still has) a lisp-language makefile kind of thing to Richard> build a system.?? I have long ago given up on the notion Maxima uses mk:defsys to build all of the Lisp code. The other stuff is built in other ways. I don't think it's easy to build the documentation from a pure Lisp system. Ray From fateman at eecs.berkeley.edu Sat Jun 25 16:46:49 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 25 Jun 2011 14:46:49 -0700 Subject: [Maxima] Allegro + Maxima on Windows. In-Reply-To: References: <1C4F4F4F61496646AB61EDC99E1252520DFC1977@e2010dag2.corp.ad.parc.com> <4E04A199.1020501@eecs.berkeley.edu> Message-ID: <4E065749.1040404@eecs.berkeley.edu> On 6/25/2011 1:10 PM, Raymond Toy wrote: >>>>>> "Richard" == Richard Fateman writes: > Richard> I have built Maxima on Allegro a number of times, and it > Richard> (Maxima) is not entirely satisfactorily configured for > Richard> Allegro when Allegro is run in my favorite mode (in which > Richard> upper and lower case are used). But if I use Allegro in > Richard> the upper-casifying "ANSI" mode, which is, I think, the > Richard> default for the free system, then it generally works. I > > I thought some time ago Douglas had made some changes to allow Maxima > to be used with a "modern-mode" Lisp could be used. I haven't experimented recently. > I don't think > anyone has intentionally tried to make the code not work; it's just > probably not developer is using such a Lisp, so these kinds of > incompatible changes just leak in. Yep. > Richard> For some systems, a package name can appear as > Richard> :bigfloat :BIGFLOAT "BIGFLOAT" and be the same. I think > Richard> it should be :bigfloat, but at least it should always be > Richard> the same. > > Richard> I have not used makefile at all, and have not constructed > Richard> the share subdirectories. Macsyma originally had (and > Richard> still has) a lisp-language makefile kind of thing to > Richard> build a system. I have long ago given up on the notion > > Maxima uses mk:defsys to build all of the Lisp code. That in and of itself should be just fine in Allegro. > The other stuff > is built in other ways. I don't think it's easy to build the > documentation from a pure Lisp system. Apparently it's not so each to do outside of Lisp, judging from a spate of email a few months ago. If one has a unicode-compatible Lisp, it seems to me it would be no easier, really, in Perl or whatever is used, to produce indexes and stuff. RJF From dekleer at parc.com Fri Jun 24 10:40:09 2011 From: dekleer at parc.com (Johan de Kleer) Date: Fri, 24 Jun 2011 08:40:09 PDT Subject: [Maxima] Allegro + Maxima on Windows. In-Reply-To: <4E04A199.1020501@eecs.berkeley.edu> References: <1C4F4F4F61496646AB61EDC99E1252520DFC1977@e2010dag2.corp.ad.parc.com> <4E04A199.1020501@eecs.berkeley.edu> Message-ID: <11Jun24.084025pdt."516677(2)"@alpha.xerox.com> Thanks for your answer. I should describe my application. I have a large Allegro Lisp application that now needs to do symbolic manipulation. I could interface with Matlab/Mathematica but thats a lot of new learning and I won't have the source. Since you have done this before let me ask you a question. If I have maxima running (with run), any other listener's read-eval-print is disabled which is a real pain. A lot of my problems went away when I dynamically bind some critical variables in run like *debugger-hook*, *readtable*,.... The current Macsyma doesn't rebind them and clobbers them globally?????????? My current problem is that if one Listener is running maxima, read-eval-print is broken for every othre one. And I cannot figure out the problem. After some hours I've isolated it to a read-char in dbm-read. If that read-char is waiting for a character all the other Listener's cannot eval. So there is some other variable Maxima is setting globally which is causing the problem that I have not identified. Any idea of which? One clue is that if I print out messages to the listener in dmb-read those same messages gets read by dbm-read and it gets obvious syntax errors. Or, if I don't, things are sensitive to the delay, so just sleeping a bit or printing out something causes an error too many characters to unread. Something is very messed up in the reading/processes inside of dbm-read but I cannot figure out what the problem is. Very very bizarre behavior. BTW, since you are an expert. The first I need is multivareate polynomial gcd. They do not form a Euclidean domain so I need Grobner bases which I assume this Macsyma does? At 07:39 AM 6/24/2011, Richard Fateman wrote: >On 6/23/2011 1:06 PM, dekleer at parc.com wrote: >>I see a number of emails about using Allegro. However, I downloaded the latest version and it seems to have many problems. I managed to get Macsyma to work, but its still fragile. Am I using a wrong version? I have Allegro 8.2 and 5.24.0. I used configure.lisp to create Maxima. A few of the problems are: >> >>- Case errors in package names, e.g., the source uses (in-package ?BIGLOAT?) and (in-package ?bigfloat?) interchangeably. >>- Share-subdirs.lisp does not get created. So I have to construct it by hand. >>- Some of the $file_... search pathnames are incorrect. Some of the pathnames have ?//? which are not legal under Windows. Source of the problem seems to be whatever sets *maxima-userid* >>- Error handling (i.e., catch tags) does not work. Haven?t debugged that yet. >> >>I?m willing to upload these and other fixes. But I suspect someone must have done this all before judging from the email traffic. >> >> >> >>_______________________________________________ >>Maxima mailing list >>Maxima at math.utexas.edu >>http://www.math.utexas.edu/mailman/listinfo/maxima >I have built Maxima on Allegro a number of times, and it (Maxima) is not entirely satisfactorily configured for Allegro >when Allegro is run in my favorite mode (in which upper and lower case are used). But if I use Allegro in the upper-casifying "ANSI" mode, which is, I think, the default for the free system, then it generally works. I have not tried to bring up the interface to gplot or wxmaxima, so I don't know if it works. > >For some systems, a package name can appear as :bigfloat :BIGFLOAT "BIGFLOAT" and be the same. I think it should be :bigfloat, but at least it should always be the same. > >I have not used makefile at all, and have not constructed the share subdirectories. Macsyma originally had (and still has) a lisp-language makefile kind of thing to build a system. I have long ago given up on the notion of keeping that up to date, and now building Maxima depends on a raft of other tools, some of which are handy and standard in ways that ANSI CL may not be, some of which are superfluous and represent some habit inherited from some programmer's previous projects. > >Maxima code should be conditionalized for error handling since (I think) GCL doesn't conform to ANSI. so some of the conditionalizations like #+CMU might need to be changed to #+(or CMU Franz) or some such. > >You may, in fact, have gone further than I have in pushing Maxima through the free Allegro. Note: I was not able to compile all the converted-from-fortran stuff in the free Allegro. At least a few years ago. But it DOES compile in a paid-up copy, and can be loaded into a free Allegro. I don't know about now. > >If you have strong reasons to use Maxima in a free Allegro, maybe we should talk. As it is, there is not exactly a groundswell for setting this up, and Franz Inc doesn't seem to care one way or the other. [It represents no income, so that is fair business assessment!] > >RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanieljsch at westnet.com.au Sun Jun 26 03:04:10 2011 From: nathanieljsch at westnet.com.au (Nathaniel Schmidt) Date: Sun, 26 Jun 2011 18:04:10 +1000 Subject: [Maxima] NCR and NPR Message-ID: <000001cc33d7$a19f7930$e4de6b90$@com.au> Hi all, I am a senior secondary student in Australia studying Maths Methods, and I use maxima a lot as my preferred CAS calculator because sinse I have no vision, the normal calculators are of no use to me as there is no accessible interface that I can use. I have a question relating to combinatorics: is it possible to do permutations in maxima? I can do them in my head, but when there are a lot of numbers, this can get tricky. So is there a function I can use for NCR or NPR? If so, this would also save a lot of typing so that I don't have to manually do so much multiplication. If anyone is able to offer any suggestions, I would be greatful. Kind regards, Nathaniel Schmidt -------------- next part -------------- An HTML attachment was scrubbed... URL: From dbmaxima at gmail.com Sun Jun 26 05:53:59 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Sun, 26 Jun 2011 20:53:59 +1000 Subject: [Maxima] NCR and NPR In-Reply-To: <000001cc33d7$a19f7930$e4de6b90$@com.au> References: <000001cc33d7$a19f7930$e4de6b90$@com.au> Message-ID: <4E070FC7.5040504@gmail.com> On 26/06/2011 6:04 PM, Nathaniel Schmidt wrote: > > Hi all, > > I have a question relating to combinatorics: is it possible to do > permutations in maxima? > > > Use functions permuation(n,r) and combination(n,r). You will need to load(functs) to use them. | | -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Wed Jun 29 18:25:40 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 29 Jun 2011 16:25:40 -0700 Subject: [Maxima] apply f to list hangs function Message-ID: <9FB0112DF8224F24939015DD699FA103@edwinc367e16bd> Use of apply ('search_file, alist) hangs the run of my function search_mfiles (file-or-direc-path,substring, options ), which uses search_file(file,substring,options) and ls (path). I test both of the latter two functions below, but cannot get my use of apply ('search_file, alist) to work inside a loop in search_mfiles. ---------------------------- Maxima 5.24.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. 2011-06-29 (%i1) display2d:false$ (%i2) load("search_mfiles.mac"); (%o2) "search_mfiles.mac" /* test use of apply with function search_file */ (%i3) myL : ["c:/work2/temp1/atext1.txt","is",word,cs]$ (%i4) apply ('search_file,myL); 2 Is this line two? Yes, this is line two. 6 This is line six, Isn't it? (%o4) "c:/work2/temp1/atext1.txt" /* test the function ls: */ (%i5) ls ("c:/work2/temp1/"); (%o5) ["c:/work2/temp1/atext1.txt","c:/work2/temp1/atext2.txt", "c:/work2/temp1/calc1news.txt","c:/work2/temp1/ndata1.dat", "c:/work2/temp1/stavros-tricks.txt","c:/work2/temp1/text1.txt", "c:/work2/temp1/text2.txt","c:/work2/temp1/trigsimplification.txt", "c:/work2/temp1/wu-d.txt"] (%i6) print_file ("c:/work2/temp1/atext1.txt"); Is this line two? Yes, this is line two. THIS might be line three. Here IS line four. I insist that this be line five. This is line six, Isn't it? (%o6) "c:/work2/temp1/atext1.txt" /* here we run the function search_mfiles, with the display outputs shown: */ (%i7) search_mfiles ("c:/work2/temp1/","is"); %fnamea = "c:/work2/temp1/" %fnL = ["c:/work2/temp1/atext1.txt","c:/work2/temp1/atext2.txt", "c:/work2/temp1/calc1news.txt","c:/work2/temp1/ndata1.dat", "c:/work2/temp1/stavros-tricks.txt","c:/work2/temp1/text1.txt", "c:/work2/temp1/text2.txt","c:/work2/temp1/trigsimplification.txt", "c:/work2/temp1/wu-d.txt"] %ssa = "is" %vf = "c:/work2/temp1/atext1.txt" %rrL = ["c:/work2/temp1/atext1.txt","is",word,cs] /* program hangs here. */ ------------------------------- code for search_mfiles is: ------------------------------------------- search_mfiles([%ua]) := block ([%fnamea,%ssa,%wmodea : word,%cmodea:cs,%linesa, %flinesa:[],%lssa,%nla:0,%pa,%nfirsta,optLa,%qa, %fnL,%vf,%rrL], %fnamea : part (%ua,1), display (%fnamea), %fnL : ls (%fnamea), display (%fnL), if not %fnL then return (false), if length (%fnL) = 0 then ( disp ("no files found"), return (false)), %ssa : part (%ua,2), display (%ssa), if not stringp (%ssa) then ( disp (" second arg must be a string "), return (false)), if length (%ua) > 2 then ( optLa : apply ('getopts,rest (%ua,2)), if not optL then return(false), for %qa in optLa do if part (%qa,1) = w then %wmodea : part (%qa,2) else %cmodea : part (%qa,2)), for %vf in %fnL do ( display (%vf), %rrL : flatten (cons ([%vf,%ssa],[%wmodea,%cmodea])), display (%rrL), apply ('search_file,%rrL)))$ --------------------------------------------- Any suggestions for a cure?? Ted Woollett From villate at fe.up.pt Thu Jun 30 07:10:48 2011 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 30 Jun 2011 13:10:48 +0100 Subject: [Maxima] contour plot In-Reply-To: References: Message-ID: <1309435848.4100.4.camel@wigner> On Mon, 2011-06-13 at 16:35 +0000, Adam Majewski wrote: > I have also tried : > > plot3d (f(x,y), [x, -4, 4], [y, -4, 4], > [mesh_lines_color, true], > [colorbox, true], [grid, 150, 150])$ > > But it gives a flat plane Hi Adam, sorry for the late reply. It looks flat because the fluctuations you were expecting to see are too small compared to the difference between the maximum and the minimum value, which is huge (about 10^86). You can use the z option of plot3d; for instance: plot3d (f(x,y), [x, -4, 4], [y, -4, 4],[z,-100,100], [mesh_lines_color, true], [colorbox, true], [grid, 150, 150])$ you will have to experiment with different ranges to find the one that will show you the region you want to see. Regards, Jaime From mxue at vroomlab.com Thu Jun 30 08:16:22 2011 From: mxue at vroomlab.com (Michael Xue) Date: Thu, 30 Jun 2011 13:16:22 +0000 (UTC) Subject: [Maxima] NCR and NPR References: <000001cc33d7$a19f7930$e4de6b90$@com.au> Message-ID: Nathaniel Schmidt westnet.com.au> writes: > > > Hi all, > > I am a senior secondary student in Australia studying Maths Methods, and I use maxima a lot as my preferred CAS calculator because sinse I have no vision, the normal calculators are of no use to me as there is no accessible interface that I can use. I have a question relating to combinatorics: is it possible to do permutations in maxima? I can do them in my head, but when there are a lot of numbers, this can get tricky. So is there a function I can use for NCR or NPR? If so, this would also save a lot of typing so that I don?t have to manually do so much multiplication. > > If anyone is able to offer any suggestions, I would be greatful. > > Kind regards, > Sure there is: permutation(n,r); for example: permutation(6,2); to use it, you need to load(functs) first. good luck with your study. - Michael From mxue at vroomlab.com Thu Jun 30 08:26:48 2011 From: mxue at vroomlab.com (Michael Xue) Date: Thu, 30 Jun 2011 13:26:48 +0000 (UTC) Subject: [Maxima] 'Solve' problem Message-ID: It seems that solve(exp(-20000*x)=9/17,x); sends maxima into an infinitive loop. but solve(exp(a*x),x)=b) works. Thank you in advance for helps and comments on this. Michael From fateman at eecs.berkeley.edu Thu Jun 30 08:52:07 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 30 Jun 2011 06:52:07 -0700 Subject: [Maxima] 'Solve' problem In-Reply-To: References: Message-ID: <4E0C7F87.7000700@eecs.berkeley.edu> On 6/30/2011 6:26 AM, Michael Xue wrote: > It seems that > > solve(exp(-20000*x)=9/17,x); > > sends maxima into an infinitive loop. > > but solve(exp(a*x),x)=b) works. > > Thank you in advance for helps and comments on this. > > > Michael > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima if you try solve(exp(-3*x)=9/17,x) you will get a hint of the reason. Maxima is computing and trying to display the 20,000 distinct solutions to your problem. It takes a long time to do this. Is this what you want to see? RJF From mxue at vroomlab.com Thu Jun 30 09:58:24 2011 From: mxue at vroomlab.com (Michael Xue) Date: Thu, 30 Jun 2011 14:58:24 +0000 (UTC) Subject: [Maxima] 'Solve' problem References: <4E0C7F87.7000700@eecs.berkeley.edu> Message-ID: Richard Fateman eecs.berkeley.edu> writes: > if you try solve(exp(-3*x)=9/17,x) you will get a hint of the reason. > > Maxima is computing and trying to display the 20,000 distinct solutions > to your > problem. It takes a long time to do this. > > Is this what you want to see? > > RJF > Thank you for your reply. I saw the long list of x's when I tried solve(exp(-20*x)=9/17,x). Myy question now is : Is there a way to tell solve that I only the real solution of this equation? Michael From mhanchak at yahoo.com Thu Jun 30 10:12:45 2011 From: mhanchak at yahoo.com (Michael Hanchak) Date: Thu, 30 Jun 2011 08:12:45 -0700 (PDT) Subject: [Maxima] ZIP file Message-ID: <1309446765.95986.YahooMailRC@web39321.mail.mud.yahoo.com> Dear sirs: ? Would it be possible to post a zip file of the latest Maxima for Windows executable?? My server does not permit me to download exe files. Thank you From willisb at unk.edu Thu Jun 30 10:50:40 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 30 Jun 2011 10:50:40 -0500 Subject: [Maxima] 'Solve' problem In-Reply-To: References: <4E0C7F87.7000700@eecs.berkeley.edu>, Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Thank?you?for?your?reply.?I?saw?the?long?list?of?x's?when?I?tried >solve(exp(-20*x)=9/17,x). > >Myy?question?now?is?:?Is?there?a?way?to?tell >solve?that?I?only?the?real?solution?of?this?equation? No, but this might help get you the real solution: (%i1) load(to_poly_solver)$ Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:49 $ Here, %z5 is an arbitrary integer (%i2) %solve(exp(-20000*x)=9/17,x); (%o2) %union([x=(2*%i*%pi*%z5+log(17/9))/20000]) To shift the counter on %z5 to zero, use nicedummies (%i3) nicedummies(%); (%o3) %union([x=(2*%i*%pi*%z0+log(17/9))/20000]) There is no Maxima tool for selecting the real solution; for that, you'll need to do some carbon-based (brain) computation (set %z5 to zero) --Barton (author of to_poly_solver) From woollett at charter.net Thu Jun 30 13:32:17 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 30 Jun 2011 11:32:17 -0700 Subject: [Maxima] apply f to list hangs function Message-ID: <17673042EE064D3DB4DE335A9C4036EA@edwinc367e16bd> On June 29, 2011, Edwin Woollett wrote: -------------- >Use of apply ('search_file, alist) hangs the >run of my function search_mfiles (file-or-direc-path,substring, options ), >which uses search_file(file,substring,options) and ls (path). ---------------- I found obscure error inside search_file, which had the lines ;;; %lines : read_text (%fname), ;;; if not %lines then return (false), which resulted in the hangup of Maxima in the context described. By changing the lines to ;;;; %lines : read_text (%fname), ;;;; if %lines = false then return (false), the hangup went away with typical results: -------------------------------------------- (%i1) display2d:false$ (%i2) load(search_mfiles); (%o2) "c:/work2/search_mfiles.mac" (%i3) search_mfiles ( "c:/work2/temp1/", "is" ); c:/work2/temp1/atext1.txt 2 Is this line two? Yes, this is line two. 6 This is line six, Isn't it? c:/work2/temp1/atext2.txt 2 Is this line two? Yes, this is line two. 6 This is line six, Isn't it? c:/work2/temp1/calc1news.txt 9 The organization of chapter six is then: 96 The Maxima output is the list of the vector curl components in the 98 a reminder to the user of what the current coordinate system is 102 Thus the syntax is based on lists and is similar to (although better 105 There is a separate function to change the current coordinate system. 112 plotderiv(..) which is useful for "automating" the plotting c:/work2/temp1/ndata1.dat 1 The calculation of the effective cross section is much simplified if only 3 those collisions are considered for which the impact parameter is large, so 5 that the field U is weak and the angles of deflection are small. The c:/work2/temp1/stavros-tricks.txt 34 Not a bug, but Maxima doesn't know that the beta function is symmetric: c:/work2/temp1/text1.txt 1 is this line one? Yes, this is line one. 3 Here is line three. 5 This is line five, isn't it? c:/work2/temp1/trigsimplification.txt 13 (1) Is there a Maxima command that indicates whether expr is a product of 76 > (1) Is there a Maxima command that indicates whether expr is a product of 91 Well, that is inherent in their definition. Trigreduce replaces all 94 is sin(x)*cos(x), since the individual terms are not products of trigs. 95 There is no built-in function which tries to find the smallest expression, 151 is better. If the user wants to expand the contents of sin to discover 153 is right that Maxima avoids potentially very expensive operations in c:/work2/temp1/wu-d.txt 1 As a dedicated windows xp user who is delighted to have windows binaries 3 all who are considering windows use that there is no problem with keeping previous (%o3) done ----------------------------------- I am experimenting with using these functions to search the Maxima lisp source code from inside a Maxima session. Ted Woollett From woollett at charter.net Thu Jun 30 15:24:46 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 30 Jun 2011 13:24:46 -0700 Subject: [Maxima] get fpprintprec to round float inside function? Message-ID: <19194FA59D5947AFA438A0B3CD968F60@edwinc367e16bd> I would like to use fpprintprec (or is there another way?) to round bytes to KB inside a function folder_info, using code like: ---------------------------------- folder_info ( %fnamec ) := block ( [ %vb, %afL, fpprintprec : 2, %rbL : [], %fiL ], display (fpprintprec), %afL : ls (%fnamec), for %vb in %afL do ( %fiL : file_info ( %vb ), %rbL : cons ( [ scut ( %vb ), part ( %fiL, 2), float ( part ( %fiL, 4)/1000 ) ], %rbL)), reverse (%rbL))$ ---------------------------------- The fourth element of the list returned by file_info is the number of bytes in the file ( gotten from flength after using openr). The indicated display of the local value of fpprintprec is 2 but no float rounding occurs. --------------------------------------------- (%i1) load(search_mfiles); (%o1) c:/work2/search_mfiles.mac (%i2) folder_info ("c:/work2/temp1/"); fpprintprec = 2 (%o2) [[atext1.txt, 6, 0.154], [atext2.txt, 7, 0.156], [calc1news.txt, 116, 4.187], [ndata1.dat, 9, 0.336], [stavros-tricks.txt, 44, 1.424], [text1.txt, 5, 0.152], [text2.txt, 5, 0.151], [trigsimplification.txt, 157, 4.983], [wu-d.txt, 4, 0.258]] (%i3) ( fpprintprec : 2, float ( 1424/1000 ) ); (%o3) 1.4 ----------------- Ted Woollett From willisb at unk.edu Thu Jun 30 15:27:12 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 30 Jun 2011 15:27:12 -0500 Subject: [Maxima] proposal for object-oriented dispatch on sign In-Reply-To: References: <885936.92145.qm@web110109.mail.gq1.yahoo.com> <4DFE34C6.2030206@telefonica.net> <1308603739.2017.11.camel@dieter> , Message-ID: I committed my patch that uses object-oriented dispatch for the function sign (not $sign); example (%i2) sign(signum(x)); (%o2) pnz (%i3) :lisp(setf (get '%signum 'sign-function) #'(lambda (s) (declare (ignore s)) (setq sign '$pz))) # (%i3) sign(signum(x)); (%o3) pz --Barton From drdieterkaiser at web.de Thu Jun 30 15:59:50 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 30 Jun 2011 22:59:50 +0200 Subject: [Maxima] get fpprintprec to round float inside function? In-Reply-To: <19194FA59D5947AFA438A0B3CD968F60@edwinc367e16bd> References: <19194FA59D5947AFA438A0B3CD968F60@edwinc367e16bd> Message-ID: <1309467590.1581.4.camel@dieter> Am Donnerstag, den 30.06.2011, 13:24 -0700 schrieb Edwin Woollett: > I would like to use fpprintprec (or is there another > way?) to round bytes to KB inside a function > folder_info, using code like: I had no look at the problem with the option variable fpprintprec, but I would use the function truncate to get the desired number of digits, e.g. (%i13) float(truncate(1234/100)/10); (%o13) 1.2 (%i14) float(truncate(1234/10)/100); (%o14) 1.23 (%i15) float(truncate(34/10)/100); (%o15) 0.03 This approach can be generalized. Dieter Kaiser From l.couraud at gmail.com Thu Jun 30 16:22:17 2011 From: l.couraud at gmail.com (laurent couraud) Date: Thu, 30 Jun 2011 23:22:17 +0200 Subject: [Maxima] RE : get fpprintprec to round float inside function? In-Reply-To: <1309467590.1581.4.camel@dieter> Message-ID: <059F9A5BA5CB4E34A3837EED7C1DAA07@PASSERELLE> > -----Message d'origine----- > De?: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] De la part de > Dieter Kaiser > Envoy??: jeudi 30 juin 2011 23:00 > ??: Edwin Woollett > Cc?: maxima mailing list > Objet?: Re: [Maxima] get fpprintprec to round float inside function? > > Am Donnerstag, den 30.06.2011, 13:24 -0700 schrieb Edwin Woollett: > > I would like to use fpprintprec (or is there another > > way?) to round bytes to KB inside a function > > folder_info, using code like: > > I had no look at the problem with the option variable fpprintprec, but I > would use the function truncate to get the desired number of digits, > e.g. > > (%i13) float(truncate(1234/100)/10); > (%o13) 1.2 > (%i14) float(truncate(1234/10)/100); > (%o14) 1.23 > (%i15) float(truncate(34/10)/100); > (%o15) 0.03 > > This approach can be generalized. > > Dieter Kaiser > > There is also the function round. (%i4) float(round(1234*100/1024)/100); (%o4) 1.21 Laurent Couraud. > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From woollett at charter.net Thu Jun 30 16:47:29 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 30 Jun 2011 14:47:29 -0700 Subject: [Maxima] get fpprintprec to round float inside function? Message-ID: On June 30, 2011, Ted Woollett wrote: ------------------------ I would like to use fpprintprec (or is there another way?) to round bytes to KB inside a function folder_info, using code like: ---------------------------------- folder_info ( path) := block ( [ fpprintprec : 2, stuff ], y: float(x/1000), etc, etc ) ------------------------------------------------- So far the simplest method (using fpprintprec to do the dirty work) which leaves the global value of fpprintprec unchanged, is to divide the function into two functions: ------------------------------------------------ folder_info1 (fp) := block ([v, aL, rL:[],fiL ], aL : ls (fp), for v in aL do ( fiL : file_info (v), rL : cons ( [scut (v), part (fiL,2), float (part (fiL,4)/1000)], rL)), reverse (rL))$ folder_info (path) := (fpprintprec : 2, %FI : folder_info1 (path), display (%FI), fpprintprec : 0, done)$ --------------------------------------- and simply put up with the global bound symbol %FI appearance which comes from using display. -------------------------------------------- (%i1) fpprintprec; (%o1) 0 (%i2) load(search_mfiles); (%o2) c:/work2/search_mfiles.mac (%i3) folder_info ("c:/work2/temp1/"); %FI = [[atext1.txt, 6, 0.2], [atext2.txt, 7, 0.2], [calc1news.txt, 116, 4.2], [ndata1.dat, 9, 0.3], [stavros-tricks.txt, 44, 1.4], [text1.txt, 5, 0.2], [text2.txt, 5, 0.2], [trigsimplification.txt, 157, 5.0], [wu-d.txt, 4, 0.3]] (%o3) done (%i4) fpprintprec; (%o4) 0 ------------------------------------------ Ted Woollett p.s. Thanks to Richard Fateman and Dieter Kaiser for suggestions. (I am trying to avoid the 'dirty work'). From fateman at eecs.berkeley.edu Thu Jun 30 17:07:07 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 30 Jun 2011 15:07:07 -0700 Subject: [Maxima] get fpprintprec to round float inside function? In-Reply-To: References: Message-ID: <4E0CF38B.4090603@eecs.berkeley.edu> I think you can do this: folder_info(path):= block([fpprecprint:2], display ( folder_info1(path))) From drgst at web.de Thu Jun 30 17:37:55 2011 From: drgst at web.de (drgst web de (at dot)) Date: Fri, 1 Jul 2011 00:37:55 +0200 Subject: [Maxima] specific form of Horner's scheme In-Reply-To: References: Message-ID: <20110701003755.B0380AC0.drgst@web.de> Hi all, is there any command (flag to be used with horner()-command, e.g.) or other procedure (or even trick) to force Maxima not only to recursively extract the powers of a variable from a series, but the corresponding coeffients, too? I'd really appreciate a result like A*x*(1+B*X*(1+C*X*(1+D*X))) , e.g., instead of x*(A+x*(F+x*(G+x*H))), which is of the kind that horner() gives me. BTW: when searching the web for an answer to the question above, I found Mr. Fateman's remarks on numerical problems in case of evaluating Legendre's polynomials in Horner()-form as floats. I (fortunately unseccessfully, i.e., LP(20,1.0)=1.0) tried to reproduce Mr. Fateman's results. But indeed, I encountered numerical problems when "rat" was involved automatically: (wx)Maxima told me that "rat" had (quite pathetically!!, i.e., only to 10 significant digits or so) tried to rationalize floats by listing the original float together with the automatically derived fraction of integer numbers as well as the float that fraction represents. Is it meanwhile common sense, that these problems described by Mr. Fateman were caused by "rat" rather than by "horner"? Kind regards Dragan Stoikovitch From fateman at eecs.berkeley.edu Thu Jun 30 18:26:58 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 30 Jun 2011 16:26:58 -0700 Subject: [Maxima] specific form of Horner's scheme In-Reply-To: <20110701003755.B0380AC0.drgst@web.de> References: <20110701003755.B0380AC0.drgst@web.de> Message-ID: <4E0D0642.6000000@eecs.berkeley.edu> On 6/30/2011 3:37 PM, drgst (at) web (dot) de wrote: > Hi all, > > is there any command (flag to be used with horner()-command, e.g.) or > other procedure (or even trick) to force Maxima not only to > recursively extract the powers of a variable from a series, but the > corresponding coeffients, too? I'd really appreciate a result like > A*x*(1+B*X*(1+C*X*(1+D*X))) , e.g., instead of x*(A+x*(F+x*(G+x*H))), > which is of the kind that horner() gives me. You can extract all of the coefficients, A, B, C, ... of a polynomial and do anything you wish with them. You may find hipow and bothcoef to be useful. > BTW: when searching the web for an answer to the question above, I > found Mr. Fateman's remarks on numerical problems in case of > evaluating Legendre's polynomials in Horner()-form as floats. I > (fortunately unseccessfully, i.e., LP(20,1.0)=1.0) tried to reproduce > Mr. Fateman's results. But indeed, I encountered numerical problems > when "rat" was involved automatically: (wx)Maxima told me that "rat" > had (quite pathetically!!, i.e., only to 10 significant digits or so) > tried to rationalize floats by listing the original float together > with the automatically derived fraction of integer numbers as well as > the float that fraction represents. If you believe that your floating point numbers deserve to be believed to more digits when converting to rationals, you can set ratepsilon to some value of your choice. It is, by default, 2.0*10^(-8). The paper you are presumably referring to is http://www.cs.berkeley.edu/~fateman/papers/horner.pdf but that starts with, and mostly keeps the coefficients in exact rational form until someone tries to do floating point arithmetic with them. the following expression gives an exact rational computation for p[20](x), and given any rational value for x will produce an exact value. So there will be no error whatsoever. However, doing rational arithmetic tends to be expensive. Putting in a float for x means the arithmetic will be done in double-float. (x^2*(x^2*(x^2*(x^2*(x^2*(x^2* (x^2*(x^2*(x^2*(34461632205*x^2-167890003050)+347123925225)-396713057400)+273491577450)- 116454478140)+30117537450)-4461857400)+334639305)-9699690)+46189)/(262144) I don't know if you want to convert these integers to floats; they should all work fine in double precision. They would not be fully accurate in 8 decimal digit representations. Carrying the computations along in double precision may not be adequate for all values of x, of course. > Is it meanwhile common sense, that > these problems described by Mr. Fateman were caused by "rat" rather > than by "horner"? I hope not. I redid some of the calculations and I get exactly the same answers either way, so I'm not sure what I did in that paper. I don't have time right now to look at it though. RJF > Kind regards > Dragan Stoikovitch > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From ichikawa.yuji at gmail.com Fri Jul 1 01:26:34 2011 From: ichikawa.yuji at gmail.com (ICHIKAWA, Yuji) Date: Fri, 1 Jul 2011 15:26:34 +0900 Subject: [Maxima] JavaScript front-end for Maxima on iPad In-Reply-To: References: Message-ID: <89EE0AAC-F171-4B27-BC20-0C4FB7863423@gmail.com> Hi, I am making a prototype of a web front-end for Maxima. Here is an article with screenshot (sorry it is written in Japanese). http://d.hatena.ne.jp/nextliteracy/20110701/1309500957 You can try it in http://www.h3.dion.ne.jp/~y.ich/applets/maxima_mobile.html though it is just a frond-end, without server connection. Basically, it is designed for tablets such as iPad. I hope that you will enjoy it. Thanks, - ICHIKAWA, Yuji -------------- next part -------------- An HTML attachment was scrubbed... URL: From mxue at vroomlab.com Fri Jul 1 08:24:08 2011 From: mxue at vroomlab.com (Michael Xue) Date: Fri, 1 Jul 2011 13:24:08 +0000 (UTC) Subject: [Maxima] JavaScript front-end for Maxima on iPad References: <89EE0AAC-F171-4B27-BC20-0C4FB7863423@gmail.com> Message-ID: ICHIKAWA, Yuji gmail.com> writes: > > Hi, > I am making a prototype of a web front-end for Maxima. > Here is an article with screenshot (sorry it is written in Japanese). > http://d.hatena.ne.jp/nextliteracy/20110701/1309500957 > > You can try it in?http://www.h3.dion.ne.jp/~y.ich/applets/maxima_mobile.html > > though it is just a frond-end, without server connection. > Basically, it is designed for tablets such as iPad. > I hope that you will enjoy it. > > Thanks,iv>- > ICHIKAWA, Yuji > > > > > _______________________________________________ > Maxima mailing list > Maxima math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > You may want to look at this one: http://www.vroomlab.com/nhome click on calculator image to access. it works with iPad, smartphone too. -Michael From willisb at unk.edu Fri Jul 1 08:42:47 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 1 Jul 2011 08:42:47 -0500 Subject: [Maxima] multivariable kron_delta In-Reply-To: References: Message-ID: I suggest extending kron_delta from a two argument to an n-argument function. The change causes no errors with either the testsuite or the share testsuite. For one argument, kron_delta signals an error. Apparently, MMA defines kron_delta(x) = kron_delta(x,0). This, I think, will cause confusion. Since kron_delta(x) signals an error, a user can assume kron_delta(x0,...,xn) * kron_delta(y0,..., ym) = kron_delta(x0, ..., xn, y0, ..., ym) is an identity without checking the number of arguments (if kron_delta(x) = kron_delta(x,0), it is *not* an identity). The source code comment: ;; A n-ary Kronecker delta function: kron_delta(n0,n1, ..., nk) simplifies to 1 if ;; (meqp ni nj) is true for *all* pairs ni, nj in (n0,n1, ..., nk); it simplifies to 0 if ;; (mnqp ni nj) is true for *some* pair ni, nj in (n0,n1, ..., nk). Further kron_delta() --> 1 ;; and kron_delta(xxx) --> wrong number of arguments error. Thus ;; ;; kron_delta(x0,...,xn) * kron_delta(y0,..., ym) = kron_delta(x0, ..., xn, y0, ..., ym) ;; ;; is an identity. Examples: (%i4) kron_delta(1,1,1,1); (%o4) 1 (%i5) kron_delta(1,1,%pi); (%o5) 0 (%i6) kron_delta(); (%o6) 1 (%i7) kron_delta(2); knon_delta: wrong number of arguments. -- an error. To debug this try: debugmode(true); Comments? Also, the current user documentation is too complex and wrong. The new code uses (effectively) is(equal(a,b)) to test for equality, it does not use sign (at least directly). --Barton From ichikawa.yuji at gmail.com Fri Jul 1 08:45:56 2011 From: ichikawa.yuji at gmail.com (ICHIKAWA, Yuji) Date: Fri, 1 Jul 2011 22:45:56 +0900 Subject: [Maxima] JavaScript front-end for Maxima on iPad In-Reply-To: References: <89EE0AAC-F171-4B27-BC20-0C4FB7863423@gmail.com> Message-ID: <19076D59-AFC9-4B97-AD5C-8761B60CDD54@gmail.com> Xue-san, Wow, it is already there! Thank you for your information. It also works on iPad indeed, but I felt that the design is not optimized for iPad size yet. Good stimulus for me. Thanks, - ICHIKAWA, Yuji On 2011/07/01, at 22:24, Michael Xue wrote: > ICHIKAWA, Yuji gmail.com> writes: > >> >> Hi, >> I am making a prototype of a web front-end for Maxima. >> Here is an article with screenshot (sorry it is written in Japanese). >> http://d.hatena.ne.jp/nextliteracy/20110701/1309500957 >> >> You can try it in http://www.h3.dion.ne.jp/~y.ich/applets/maxima_mobile.html >> >> though it is just a frond-end, without server connection. >> Basically, it is designed for tablets such as iPad. >> I hope that you will enjoy it. >> >> Thanks,iv>- >> ICHIKAWA, Yuji >> >> >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > > You may want to look at this one: > > http://www.vroomlab.com/nhome > > click on calculator image to access. > > it works with iPad, smartphone too. > > -Michael > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From drgst at web.de Fri Jul 1 09:03:42 2011 From: drgst at web.de (drgst web de (at dot)) Date: Fri, 1 Jul 2011 16:03:42 +0200 Subject: [Maxima] specific form of Horner's scheme In-Reply-To: <4E0D0642.6000000@eecs.berkeley.edu> References: <20110701003755.B0380AC0.drgst@web.de> <4E0D0642.6000000@eecs.berkeley.edu> Message-ID: <20110701160342.247A6550.drgst@web.de> Dear Mr. Fateman, hi all, > > I'd really appreciate a result like > > A*x*(1+B*X*(1+C*X*(1+D*X))) , e.g., instead of x*(A+x*(F+x*(G+x*H))), > > which is of the kind that horner() gives me. > You can extract all of the coefficients, A, B, C, ... of a polynomial > and do anything you wish with them. > You may find hipow and bothcoef to be useful. thank you for your hints, I'll exercise on that subject this weekend. IMHO, the scheme having a "1" in each bracketed term is most suitable for the human eye in order to check for potential numerical problems caused by cancellation effects... therefore, I thought "there has to be a command for that, I'm just too stupid to find it"... > If you believe that your floating point numbers deserve to be believed > to more digits when converting to rationals, you > can set ratepsilon to some value of your choice. It is, by default, > 2.0*10^(-8). thank you again for that hint; the "info on Maxima" command on my systems yields: Maxima version: 5.24.0 // Maxima build date: 20:39 4/5/2011 // Host type: i686-pc-mingw32 Lisp implementation type: GNU Common Lisp (GCL) // Lisp implementation version: GCL 2.6.8 + wxMaxima 11.04.0 on that system, the command ev(%,numer) with % referring to an exact expanded version of the LPs generated by the recurrence relations gives me, e.g.: lp_20_x = 131460.6941413879*x^20 - 640449.5355606079*x^18 + 1324172.688388825*x^16 -1513340.215301514*x^14 + 1043287.572669983*x^12 - 444238.5793304443*x^10 +114889.2877578735*x^8 - 17020.63522338867*x^6 + 1276.54764175415*x^4 -37.00138092041016*x^2 + 0.17619705200195 subst(0.5,x,%) -> lp_20_x=-0.048358381067374 subst(1.0,x,%) -> lp_20_x=1.0 if ratepsilon has its default value, the command horner(%) acting on the series given above yields: rat: replaced 0.17619705200195 by 2425/13763 = 0.17619705006176 rat: replaced -37.0013809204102 by -26789/724 = -37.0013812154696 rat: replaced 1276.54764175415 by 53615/42 = 1276.547619047619 rat: replaced -17020.6352233887 by -1259527/74 = -17020.6351351351 rat: replaced 114889.2877578735 by 804225/7 = 114889.2857142857 rat: replaced -444238.579330444 by -3109670/7 = -444238.571428571 rat: replaced 1043287.572669983 by 7303013/7 = 1043287.571428572 rat: replaced -1513340.21530151 by -7566701/5 = -1513340.2 rat: replaced 1324172.688388825 by 3972518/3 = 1324172.666666667 rat: replaced -640449.535560608 by -8325844/13 = -640449.538461539 rat: replaced 131460.6941413879 by 1708989/13 = 131460.6923076923 (%o53) lp_20_x=(x^2*(x^2*(x^2*(x^2*(x^2*(x^2*(x^2*(x^2*(x^2*(66157938890433180*x^2-322307913370583280) +666393374505218360)-761592432798846012)+525037212143763540)-223564228557048600) +57818334971650500)-8565679363007130)+642425944129450)-18621042338535)+88671628500) /(503252628060) which quite obviously causes numerical problems: subst(0.5,x,%) -> lp_20_x=-0.048358476478776 subst(1.0,x,%) -> lp_20_x=0.9935268531601 if I set ratepsilon:2.0*10^(-18), the result is: rat: replaced 0.17619705200195 by 46189/262144 = 0.17619705200195 rat: replaced -37.0013809204102 by -4849845/131072 = -37.0013809204102 rat: replaced 1276.54764175415 by 334639305/262144 = 1276.54764175415 rat: replaced -17020.6352233887 by -557732175/32768 = -17020.6352233887 rat: replaced 114889.2877578735 by 15058768725/131072 = 114889.2877578735 rat: replaced -444238.579330444 by -29113619535/65536 = -444238.579330444 rat: replaced 1043287.572669983 by 136745788725/131072 = 1043287.572669983 rat: replaced -1513340.21530151 by -49589132175/32768 = -1513340.21530151 rat: replaced 1324172.688388825 by 165647382454/125095 = 1324172.688388825 rat: replaced -640449.535560608 by -83945001525/131072 = -640449.535560608 rat: replaced 131460.6941413879 by 34461632205/262144 = 131460.6941413879 (%o75) lp_20_x=(x^2*(x^2*(x^2*(x^2*(x^2*(x^2*(x^2*(x^2*(x^2*(4310977880684475*x^2-21002199931539750) +43423467426021376)-49626819915453000)+34212428881107750)-14567872942923300) +3767553347307750)-558156051453000)+41861703858975)-1213382720550)+5778012955)/(32792903680) and no numerical problems occur: subst(0.5,x,%) -> lp_20_x=-0.048358381067374 subst(1.0,x,%) -> lp_20_x=1.0 BTW: a large value of ratepsilon seems not to cause any damage if keepfloat is set to true before having horner() act on the series with DP float coefficients. > The paper you are presumably referring to is > http://www.cs.berkeley.edu/~fateman/papers/horner.pdf Most presumably due to the larger number of hits acquired since publication, only the following file appeared in Google's first 20 results to my search request: http://www.cs.berkeley.edu/~fateman/legendre-horner.pdf which is dates back to Dec. 4. 2007. The URL you gave (thank you for providing it; I'm sorry that I did not include the URL...) seems to reference be the most recent version of the same paper. But I think the main claim of both versions is identical. > (x^2*(x^2*(x^2*(x^2*(x^2*(x^2* > (x^2*(x^2*(x^2*(34461632205*x^2-167890003050)+347123925225)-396713057400)+273491577450)- > 116454478140)+30117537450)-4461857400)+334639305)-9699690)+46189)/(262144) > > I don't know if you want to convert these integers to floats; they > should all work fine in double precision. within Maxima, the integer representation is best, of course. Even when transferring the results obtained with Maxima to the real world of a programming language like Fortran, Java..., DP floats could exactly represent integers in your formula. But I cannot spot possibly occurring cancellation effects; that only works if I use the scheme ...*(1+CF*x^n*(1+... because almost ever my xes are limited to the range [-1;1] and thus, if one of the CFs has an absolute value larger than 0.99 or so, a red alert is triggered (of course depending on the signs of x and CF as well as the power of x)... > > these problems described by Mr. Fateman were caused by "rat" rather > > than by "horner"? > I hope not. I redid some of the calculations and I get exactly the same > answers either way, so ------------ 2nd response ------------ > My suspicion right now is that Macsyma is using SINGLE PRECISION FLOATS > and that the paper is basically wrong because of that. So the problem > is not caused by RAT or by HORNER, but by Macsyma converting rationals to the nearest > single float instead of double float, and that's why HORNER is inaccurate. I've included the somewhat lenthy output of my Maxima system in this mail in order to demonstrate that at least on my Maxima system, the value of "ratepsilon" is crucial when letting horner() act on series with non-integer coefficients. I frequently encounter this scenario when checking "modern" results against published "ancient" ones. > Thanks for looking at the paper. my pleasure; I'd like to see much more "beware of ogre" signs in the world of numerical calculation... Kind regards Dragan Stoikovitch From tomdean at speakeasy.org Fri Jul 1 11:16:42 2011 From: tomdean at speakeasy.org (Thomas D. Dean) Date: Fri, 01 Jul 2011 09:16:42 -0700 Subject: [Maxima] 'Solve' problem In-Reply-To: References: Message-ID: <1309537002.2877.0.camel@asus> On Thu, 2011-06-30 at 13:26 +0000, Michael Xue wrote: eq1:exp(-3*x)=9/17; soln:-1/3*ln(9/17)-2/3*%i*%pi*5; subst(soln,x,eq1); This returns exp(ln(9/17)) = 9/17 for any integer z, x=-1/3*ln(9/17)-2/3*%i*%pi*z is a solution. True? tomdean From willisb at unk.edu Fri Jul 1 12:14:50 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 1 Jul 2011 12:14:50 -0500 Subject: [Maxima] 'Solve' problem In-Reply-To: <1309537002.2877.0.camel@asus> References: <1309537002.2877.0.camel@asus> Message-ID: maxima-bounces at math.utexas.edu wrote on 07/01/2011 11:16:42 AM: > eq1:exp(-3*x)=9/17; > soln:-1/3*ln(9/17)-2/3*%i*%pi*5; > subst(soln,x,eq1); > > This returns exp(ln(9/17)) = 9/17 > > for any integer z, x=-1/3*ln(9/17)-2/3*%i*%pi*z is a solution. > > True? Try this: (%i33) load(to_poly_solver)$ (%i34) eq : exp(-3*x)=9/17; (%o34) %e^(-3*x)=9/17 (%i35) %solve(eq,x); (%o35) %union([x=(2*%i*%pi*%z15+log(17/9))/3]) (%i36) subst(first(%), eq),rectform; (%o36) 9/17=9/17 Here %z15 is an arbitrary integer--also, the code automatically declares %z15 to be an integer: (%i37) facts(%z15); (%o37) [kind(%z15,integer)] --Barton From woollett at charter.net Fri Jul 1 12:40:51 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 1 Jul 2011 10:40:51 -0700 Subject: [Maxima] get fpprintprec to round float inside function? Message-ID: <805A66ADFF2849A190E0C5E6B93CB5D2@edwinc367e16bd> On June 30, 2011, Richard Fateman wrote: -------------------------- >I think you can do this: >folder_info(path):= > block([fpprecprint:2], > display ( folder_info1(path))) -------------------- This method avoids introducing an extraneous global variable, but the output (with fpprecprint --> fpprintprec (!) ) still has the display command exhibited on the left hand side (although we get correct rounding). I have decided to abandon producing a list, and instead accept a series of line outputs, most simply produced by using print, although one could get fancier with formated output via printf. With the code: ------------------ folder_info (path):= block([fpprintprec:2,vp], for vp in folder_info1 (path) do apply ('print,vp))$ ---------------------- the output is correctly rounded and looks like: ---------------------- (%i3) folder_info ("c:/work2/temp1/"); atext1.txt 6 0.2 atext2.txt 7 0.2 calc1news.txt 116 4.2 ndata1.dat 9 0.3 stavros-tricks.txt 44 1.4 text1.txt 5 0.2 text2.txt 5 0.2 trigsimplification.txt 157 5.0 wu-d.txt 4 0.3 (%o3) done -------------------------------------- displaying name, number of lines, and KB. Ted Woollett From ichikawa.yuji at gmail.com Fri Jul 1 19:12:19 2011 From: ichikawa.yuji at gmail.com (ICHIKAWA, Yuji) Date: Sat, 2 Jul 2011 09:12:19 +0900 Subject: [Maxima] How can I add simplification rule depending relation between two factors? Message-ID: <957173D5-F11A-4994-B0CE-C6319369FDE2@gmail.com> Hi, I am trying to make simplification rules for divisor function divsum. 1. divsum(p^n) = (p^(n+1)-1)/(p-1) when p is prime. defrule was great to implement this rule though I was happier if there is a feature of "prime". (example) matchdeclare(pp, primep, nn, lambda([x], (integerp(x) or featurep(x, integer)) and x > 0))$ defrule(sigma_simp1, divsum(pp^nn, 1), (pp^(nn + 1) - 1)/(pp - 1))$ declare(n, integer)$ assume(n > 0)$ sigma_simp1(divsum(3^n)); => (3^(n+1)-1)/2 2. divsum(a*b) = divsum(a)*divsum(b) if a and b are relatively prime. I lost my way for this simplification. Are there any manners to let Maxima check if two variables are relatively prime? Thanks, - Yuji From fateman at eecs.berkeley.edu Fri Jul 1 19:18:15 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 01 Jul 2011 17:18:15 -0700 Subject: [Maxima] How can I add simplification rule depending relation between two factors? In-Reply-To: <957173D5-F11A-4994-B0CE-C6319369FDE2@gmail.com> References: <957173D5-F11A-4994-B0CE-C6319369FDE2@gmail.com> Message-ID: <4E0E63C7.2030603@eecs.berkeley.edu> On 7/1/2011 5:12 PM, ICHIKAWA, Yuji wrote: > Hi, > > I am trying to make simplification rules for divisor function divsum. > > 1. divsum(p^n) = (p^(n+1)-1)/(p-1) when p is prime. > defrule was great to implement this rule though I was happier if there is a feature of "prime". > > (example) > matchdeclare(pp, primep, nn, lambda([x], (integerp(x) or featurep(x, integer)) and x> 0))$ > defrule(sigma_simp1, divsum(pp^nn, 1), (pp^(nn + 1) - 1)/(pp - 1))$ > > declare(n, integer)$ > assume(n> 0)$ > sigma_simp1(divsum(3^n)); > => (3^(n+1)-1)/2 > > 2. divsum(a*b) = divsum(a)*divsum(b) if a and b are relatively prime. > > I lost my way for this simplification. > Are there any manners to let Maxima check if two variables are relatively prime? > > Thanks, > - > Yuji > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima a. gcd(R,S) will be 1 if R and S are relatively prime. b. You will probably never see a*b in Maxima if a, b are numbers. They will be multiplied together. c. You will probably never see a^b in Maxima if a, b are numbers, either. d. There is no reliable way to attach a condition for matching that involves 2 parameters in the match. RJF From ichikawa.yuji at gmail.com Fri Jul 1 20:54:20 2011 From: ichikawa.yuji at gmail.com (ICHIKAWA, Yuji) Date: Sat, 2 Jul 2011 10:54:20 +0900 Subject: [Maxima] How can I add simplification rule depending relation between two factors? In-Reply-To: <4E0E63C7.2030603@eecs.berkeley.edu> References: <957173D5-F11A-4994-B0CE-C6319369FDE2@gmail.com> <4E0E63C7.2030603@eecs.berkeley.edu> Message-ID: Fateman-san, Thank you for your comments. I recognized that there is no reliable way to attach a condition for matching that involves 2 parameters in the match. By the way, you can see a^b even if a, b are numbers, when you use a returned value of "factor". It works well in the first case, though you need to change divsum to noun in order to see the result. I think that the case of a*b is same. Thanks, - Yuji On 2011/07/02, at 9:18, Richard Fateman wrote: > On 7/1/2011 5:12 PM, ICHIKAWA, Yuji wrote: >> Hi, >> >> I am trying to make simplification rules for divisor function divsum. >> >> 1. divsum(p^n) = (p^(n+1)-1)/(p-1) when p is prime. >> defrule was great to implement this rule though I was happier if there is a feature of "prime". >> >> (example) >> matchdeclare(pp, primep, nn, lambda([x], (integerp(x) or featurep(x, integer)) and x> 0))$ >> defrule(sigma_simp1, divsum(pp^nn, 1), (pp^(nn + 1) - 1)/(pp - 1))$ >> >> declare(n, integer)$ >> assume(n> 0)$ >> sigma_simp1(divsum(3^n)); >> => (3^(n+1)-1)/2 >> >> 2. divsum(a*b) = divsum(a)*divsum(b) if a and b are relatively prime. >> >> I lost my way for this simplification. >> Are there any manners to let Maxima check if two variables are relatively prime? >> >> Thanks, >> - >> Yuji >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > a. gcd(R,S) will be 1 if R and S are relatively prime. > b. You will probably never see a*b in Maxima if a, b are numbers. They will be multiplied together. > c. You will probably never see a^b in Maxima if a, b are numbers, either. > d. There is no reliable way to attach a condition for matching that involves 2 parameters in the match. > > RJF > From shinabe.munehiro at hotmail.co.jp Sat Jul 2 03:35:35 2011 From: shinabe.munehiro at hotmail.co.jp (Part Marty) Date: Sat, 2 Jul 2011 17:35:35 +0900 Subject: [Maxima] (a^b)^c--->a^(b*c) Message-ID: Please tell me easy conversion formula. How can I convert from "(a^b)^c" to "a^(b*c)"? -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdieterkaiser at web.de Sat Jul 2 07:22:26 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 02 Jul 2011 14:22:26 +0200 Subject: [Maxima] (a^b)^c--->a^(b*c) In-Reply-To: References: Message-ID: <1309609346.15480.6.camel@dieter> Am Samstag, den 02.07.2011, 17:35 +0900 schrieb Part Marty: > Please tell me easy conversion formula. > > How can I convert from "(a^b)^c" to "a^(b*c)"? In general, the desired simplification is true, if the variable a is positive. When setting the option variable radexpand to true, Maxima assumes all variables to be real and positive: (%i2) radexpand:all$ (%i3) (a^b)^c; (%o3) a^(b*c) (%i4) reset(radexpand)$ A second way is to assume the variable a to be positive: (%i7) assume(a>0)$ (%i8) (a^b)^c; (%o8) a^(b*c) Dieter Kaiser From shinabe.munehiro at hotmail.co.jp Sat Jul 2 08:21:46 2011 From: shinabe.munehiro at hotmail.co.jp (Part Marty) Date: Sat, 2 Jul 2011 22:21:46 +0900 Subject: [Maxima] (a^b)^c--->a^(b*c) In-Reply-To: <1309609346.15480.6.camel@dieter> References: , <1309609346.15480.6.camel@dieter> Message-ID: > Subject: Re: [Maxima] (a^b)^c--->a^(b*c) > From: drdieterkaiser at web.de > To: shinabe.munehiro at hotmail.co.jp > CC: maxima at math.utexas.edu > Date: Sat, 2 Jul 2011 14:22:26 +0200 > > Am Samstag, den 02.07.2011, 17:35 +0900 schrieb Part Marty: > > Please tell me easy conversion formula. > > > > How can I convert from "(a^b)^c" to "a^(b*c)"? > > In general, the desired simplification is true, if the variable a is > positive. When setting the option variable radexpand to true, Maxima > assumes all variables to be real and positive: > > (%i2) radexpand:all$ > > (%i3) (a^b)^c; > (%o3) a^(b*c) > > (%i4) reset(radexpand)$ > > A second way is to assume the variable a to be positive: > > (%i7) assume(a>0)$ > > (%i8) (a^b)^c; > (%o8) a^(b*c) > > Dieter Kaiser > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shinabe.munehiro at hotmail.co.jp Sat Jul 2 08:28:42 2011 From: shinabe.munehiro at hotmail.co.jp (Part Marty) Date: Sat, 2 Jul 2011 22:28:42 +0900 Subject: [Maxima] (a^b)^c--->a^(b*c) In-Reply-To: References: , <1309609346.15480.6.camel@dieter>, Message-ID: From: shinabe.munehiro at hotmail.co.jp To: drdieterkaiser at web.de Subject: RE: [Maxima] (a^b)^c--->a^(b*c) Date: Sat, 2 Jul 2011 22:06:54 +0900 Thank you,Dear Dieter Kaiser More,let me know! How about this? exp(%i*c)^n/exp(%i*c)-->exp(%i*c*(n-1)) > Subject: Re: [Maxima] (a^b)^c--->a^(b*c) > From: drdieterkaiser at web.de > To: shinabe.munehiro at hotmail.co.jp > CC: maxima at math.utexas.edu > Date: Sat, 2 Jul 2011 14:22:26 +0200 > > Am Samstag, den 02.07.2011, 17:35 +0900 schrieb Part Marty: > > Please tell me easy conversion formula. > > > > How can I convert from "(a^b)^c" to "a^(b*c)"? > > In general, the desired simplification is true, if the variable a is > positive. When setting the option variable radexpand to true, Maxima > assumes all variables to be real and positive: > > (%i2) radexpand:all$ > > (%i3) (a^b)^c; > (%o3) a^(b*c) > > (%i4) reset(radexpand)$ > > A second way is to assume the variable a to be positive: > > (%i7) assume(a>0)$ > > (%i8) (a^b)^c; > (%o8) a^(b*c) > > Dieter Kaiser > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdieterkaiser at web.de Sat Jul 2 10:56:43 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 02 Jul 2011 17:56:43 +0200 Subject: [Maxima] (a^b)^c--->a^(b*c) In-Reply-To: References: , <1309609346.15480.6.camel@dieter> , Message-ID: <1309622203.31826.21.camel@dieter> Am Samstag, den 02.07.2011, 22:28 +0900 schrieb Part Marty: ________________________________________________________________________ > From: shinabe.munehiro at hotmail.co.jp > To: drdieterkaiser at web.de > Subject: RE: [Maxima] (a^b)^c--->a^(b*c) > Date: Sat, 2 Jul 2011 22:06:54 +0900 > > Thank you,Dear Dieter Kaiser > More,let me know! > > How about this? > > exp(%i*c)^n/exp(%i*c)-->exp(%i*c*(n-1)) Again setting the option variable radexpand to the value true will help. The point is, that in general (a^b)^b is not equal to a^(b*c). You have to know or to assume something about the domain of the variables a, b, and c. Setting radexpand to the value true is equivalent to the assumption that a,b, and c > 0. Perhaps n is an integer. Then it is possible to declare n to be an integer. For this case you get the desired simplification too, e.g. (%i4) declare(n, integer)$ (%i5) exp(%i*c)^n/exp(%i*c); (%o5) %e^(%i*c*n-%i*c) At last, you can use a function like radcan to simplify expressions, e.g. (%i3) exp(%i*c)^n/exp(%i*c); (%o3) %e^-(%i*c)*(%e^(%i*c))^n (%i4) radcan(%); (%o4) %e^(%i*c*n-%i*c) Dieter Kaiser From drdieterkaiser at web.de Sat Jul 2 11:00:44 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 02 Jul 2011 18:00:44 +0200 Subject: [Maxima] Lineinfo added by the parser and debugmode Message-ID: <1309622444.31826.25.camel@dieter> When reading from a file, the parser adds a lineinfo to each expression. This can be seen, when tracing the function add-lineinfo: (%i1) load(ntrig); 0: (ADD-LINEINFO ($LOAD)) 0: ADD-LINEINFO returned ($LOAD) 0: (ADD-LINEINFO (DISPLAYINPUT)) 0: ADD-LINEINFO returned (DISPLAYINPUT) 0: (ADD-LINEINFO ($EVAL_WHEN)) 0: ADD-LINEINFO returned ($EVAL_WHEN (1 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac" SRC)) 0: (ADD-LINEINFO (MLIST)) 0: ADD-LINEINFO returned (MLIST (1 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac" SRC)) 0: (ADD-LINEINFO ($MATCHDECLARE)) 0: ADD-LINEINFO returned ($MATCHDECLARE (2 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac" SRC)) 0: (ADD-LINEINFO (NODISPLAYINPUT)) 0: ADD-LINEINFO returned (NODISPLAYINPUT (2 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac" SRC)) 0: (ADD-LINEINFO ($TELLSIMPAFTER)) 0: ADD-LINEINFO returned ($TELLSIMPAFTER (4 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac" SRC)) 0: (ADD-LINEINFO (%SIN)) 0: ADD-LINEINFO returned (%SIN (4 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac" SRC)) [...] (%o1) /usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac I think, this information is only used within the editor Emacs to jump into the file to debug the code. I would like to suggest to add the lineinfo only, if the option variable DEBUGMODE has the value TRUE. This can be done in the function ADD-LINEINFO. This way the option variable gets additional functionality. The standard value of the option variable DEBUGMODE is FALSE and we do not add unnecessary information to each expression. This is an example, when loading a file without adding a lineinfo to each expression: (%i1) :lisp (trace add-lineinfo) (ADD-LINEINFO) (%i1) load(ntrig); 0: (ADD-LINEINFO ($LOAD)) 0: ADD-LINEINFO returned ($LOAD) 0: (ADD-LINEINFO (DISPLAYINPUT)) 0: ADD-LINEINFO returned (DISPLAYINPUT) 0: (ADD-LINEINFO ($EVAL_WHEN)) 0: ADD-LINEINFO returned ($EVAL_WHEN) 0: (ADD-LINEINFO (MLIST)) 0: ADD-LINEINFO returned (MLIST) 0: (ADD-LINEINFO ($MATCHDECLARE)) 0: ADD-LINEINFO returned ($MATCHDECLARE) 0: (ADD-LINEINFO (NODISPLAYINPUT)) 0: ADD-LINEINFO returned (NODISPLAYINPUT) 0: (ADD-LINEINFO ($TELLSIMPAFTER)) 0: ADD-LINEINFO returned ($TELLSIMPAFTER) 0: (ADD-LINEINFO (%SIN)) 0: ADD-LINEINFO returned (%SIN) Dieter Kaiser From fateman at eecs.berkeley.edu Sat Jul 2 13:59:59 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 02 Jul 2011 11:59:59 -0700 Subject: [Maxima] specific form of Horner's scheme In-Reply-To: <20110701160342.247A6550.drgst@web.de> References: <20110701003755.B0380AC0.drgst@web.de> <4E0D0642.6000000@eecs.berkeley.edu> <20110701160342.247A6550.drgst@web.de> Message-ID: <4E0F6AAF.1020902@eecs.berkeley.edu> Thanks to Dragan Stoikovitch, an improved version of the paper at http://www.cs.berkeley.edu/~fateman/papers/horner.pdf is now posted. The principal point of the paper remains: that reformulating some polynomials to evaluate using Horner's rule can result in less accurate results than other methods. Specifically this paper investigates Legendre polynomials of the first kind, and uses Maxima. The typical defining recurrence is far more accurate especially at roots of the polynomial or near 1. RJF From fateman at eecs.berkeley.edu Sat Jul 2 16:08:02 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 02 Jul 2011 14:08:02 -0700 Subject: [Maxima] Macsyma? Maxima? website Message-ID: <4E0F88B2.3040001@eecs.berkeley.edu> I just visited http://www.macsyma.com/ there is a note on the bottom that this domain may be for sale. From macrakis at alum.mit.edu Sat Jul 2 16:11:22 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 2 Jul 2011 17:11:22 -0400 Subject: [Maxima] Macsyma? Maxima? website In-Reply-To: <4E0F88B2.3040001@eecs.berkeley.edu> References: <4E0F88B2.3040001@eecs.berkeley.edu> Message-ID: I wonder what the status of the Macsyma trademark is. Is it legally "abandoned" and therefore no longer a trademark? Is Macsyma Inc. still operating and selling Macsyma? -s On Sat, Jul 2, 2011 at 17:08, Richard Fateman wrote: > I just visited > > http://www.macsyma.com/ > > there is a note on the bottom that this domain may be for sale. > > ______________________________**_________________ > 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 Jul 2 16:27:18 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 02 Jul 2011 14:27:18 -0700 Subject: [Maxima] Macsyma? Maxima? website In-Reply-To: References: <4E0F88B2.3040001@eecs.berkeley.edu> Message-ID: <4E0F8D36.8070001@eecs.berkeley.edu> On 7/2/2011 2:11 PM, Stavros Macrakis wrote: > I wonder what the status of the Macsyma trademark is. Is it legally > "abandoned" and therefore no longer a trademark? Is Macsyma Inc. > still operating and selling Macsyma? > > -s > > On Sat, Jul 2, 2011 at 17:08, Richard Fateman > > wrote: > > I just visited > > http://www.macsyma.com/ > > there is a note on the bottom that this domain may be for sale. > Free online trademark search tells me that Macsyma is still a trademark (from 1984) and so is Macsyma Newsletter, owned by Macsyma Inc. (no address?) but abandoned trademarks include CL-Macsyma Common Lisp Macsyma Lisp Machine Macsyma which appear to have been owned by Symbolics. A registered-domain search shows that macsyma.com is actually registered and owned by someone but one can register maxima-CAS.com for $5.00. Macsyma CD-ROM appears to be for sale at Amazon for $61.05. go figure. -------------- next part -------------- An HTML attachment was scrubbed... URL: From smh at franz.com Sat Jul 2 18:46:49 2011 From: smh at franz.com (Steve Haflich) Date: Sat, 02 Jul 2011 16:46:49 -0700 Subject: [Maxima] Macsyma? Maxima? website In-Reply-To: <4E0F8D36.8070001@eecs.berkeley.edu> References: <4E0F88B2.3040001@eecs.berkeley.edu> <4E0F8D36.8070001@eecs.berkeley.edu> Message-ID: <5077.1309650409@gemini.franz.com> Richard Fateman wrote: On Sat, Jul 2, 2011 at 17:08, Richard Fateman wrote: I just visited http://www.macsyma.com/ there is a note on the bottom that this domain may be for sale. Of course, but this doesn't mean what you think. It is common practice by the scummier animals of the internet when a longstanding domain name expires, to squat on that name by various means for some redicuously miniscule cost. (I forget the details.) Most expired domain names expired because the nae was no longer "in business", but sometimes a valuable, active nae isn't renewed because of the client's administrative screwup. The squatters try to make money by selling the name back to the original owner, or someone else who has legitimate use for that name. If you visit the www.macsyma.com site, you will see that it is nothing more than an automatic advertising squatting site. It has nothing to do with Macsyma, and clicking on the single Macsyma link just brings you to more scam links. After you do this, remember to close all the hidden pop-up windows. You might also want to restart your browser, and run a virus scan of your machine. This has little to do with the trademark status, although once some living people can claim the trademark, that might have bearing on reclaiming the url. Free online trademark search tells me that Macsyma is still a trademark (from 1984) and so is Macsyma Newsletter, owned by Macsyma Inc. (no address?) Owned, I believe, by Ira Topping. But he's dead. "So it goes." (Vonnegut) So until that trademark expires (when will it?) his estate (which, last I heard, lives on in a cardboard box in some lawyer's office) will continue to own it. Richard and I know someone who might know how to find this lawyer, in case anyone wants to make an offer. The name isn't worth very much -- although not so much that the maxima community couldn't collect that much. But this would not be enough for the estate (aka the lawyer) to want to bother doing business. Macsyma CD-ROM appears to be for sale at Amazon for $61.05. go figure. Does it come with a license? From shinabe.munehiro at hotmail.co.jp Sat Jul 2 23:34:15 2011 From: shinabe.munehiro at hotmail.co.jp (Part Marty) Date: Sun, 3 Jul 2011 13:34:15 +0900 Subject: [Maxima] (a^b)^c--->a^(b*c) In-Reply-To: <1309622203.31826.21.camel@dieter> References: ,, <1309609346.15480.6.camel@dieter>,, , , <1309622203.31826.21.camel@dieter> Message-ID: I am sorry that I can't explain it enough. I understood that in general (a^b)^b is not equal to a^(b*c). I want to collect "%i*c" from the formula. But I can't use "collectterms". Please,let me know how to convert it. %e^(%i*c*n-%i*c)-->%e^(%i*c*(n-1)) (%i4) declare(n, integer)$ (%i5) exp(%i*c)^n/exp(%i*c); (%o5) %e^(%i*c*n-%i*c) (%i6)collectterms(%,%i,c); (%o6) %e^(%i*c*n-%i*c) %i*c*n-%i*c; collectterms(%,c,%i); (%o8) %i*c*(n-1) -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Jul 3 02:41:33 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 3 Jul 2011 03:41:33 -0400 Subject: [Maxima] (a^b)^c--->a^(b*c) In-Reply-To: References: <1309609346.15480.6.camel@dieter> <1309622203.31826.21.camel@dieter> Message-ID: scanmap(factor, expr) will do that transformation. 2011/7/3 Part Marty > I am sorry that I can't explain it enough. > I understood that in general (a^b)^b is not equal to a^(b*c). > I want to collect "%i*c" from the formula. > But I can't use "collectterms". > Please,let me know how to convert it. > > %e^(%i*c*n-%i*c)-->%e^(%i*c*(n-1)) > > > > (%i4) declare(n, integer)$ > (%i5) exp(%i*c)^n/exp(%i*c); > (%o5) %e^(%i*c*n-%i*c) > (%i6)collectterms(%,%i,c); > (%o6) %e^(%i*c*n-%i*c) > > %i*c*n-%i*c; > collectterms(%,c,%i); > (%o8) %i*c*(n-1) > > > _______________________________________________ > 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 max_corvallis at yahoo.com Sun Jul 3 03:18:44 2011 From: max_corvallis at yahoo.com (Max Jones) Date: Sun, 3 Jul 2011 01:18:44 -0700 (PDT) Subject: [Maxima] matrices, subscripts, and ratvars Message-ID: <1309681124.70658.YahooMailNeo@web30807.mail.mud.yahoo.com> When I multiply symbolic matrices with subscripted elements such as a: matrix([a00,a01],[a10,a11]) b: matrix([b00,b01],[b10,b11]) the product a . b returns as matrix([a01*b10+a00*b00,a01*b11+a00*b01],[a11*b10+a10*b00,a11*b11+a10*b01]). I need the terms ordered to match the conventional definition of multiplication, such that the first element is a00*b00+a01*b10, and so on. I am guessing that the problem is the reverse alphabetical order used by Canonical Rational Expressions. If this guess is correct, I would further guess that I have to wrap dot inside a function that explicitly sets ratvars to match the elements of the matrices. This is unappealing, and I hope I'm wrong. Please advise. From fateman at eecs.berkeley.edu Sun Jul 3 09:57:20 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 03 Jul 2011 07:57:20 -0700 Subject: [Maxima] matrices, subscripts, and ratvars In-Reply-To: <1309681124.70658.YahooMailNeo@web30807.mail.mud.yahoo.com> References: <1309681124.70658.YahooMailNeo@web30807.mail.mud.yahoo.com> Message-ID: <4E108350.9010806@eecs.berkeley.edu> On 7/3/2011 1:18 AM, Max Jones wrote: > When I multiply symbolic matrices with subscripted elements such as > > > a: matrix([a00,a01],[a10,a11]) > > b: matrix([b00,b01],[b10,b11]) > > > the product a . b returns as > > matrix([a01*b10+a00*b00,a01*b11+a00*b01],[a11*b10+a10*b00,a11*b11+a10*b01]). > > I need the terms ordered to match the conventional definition of multiplication, such > that the first element is a00*b00+a01*b10, and so on. > > > I am guessing that the problem is the reverse alphabetical > order used by Canonical > > Rational Expressions. If this guess is correct, I would further guess that I have to wrap > > dot inside a function that explicitly sets ratvars to match the elements of the matrices. > > This is unappealing, and I hope I'm wrong. Please advise. Try setting powerdisp:true to reverse the ordering of display of expressions in a sum, generally. Conventionally, expressions are ordered this way : x^2+x z+3 a*x+b with items later in the alphabet or more complicated coming first. but this is not uniformly observed, so that we also see u+v E=mc^2 F=ma a00*b00+a01*b10 This has nothing to do with ratvars. From fateman at eecs.berkeley.edu Sun Jul 3 10:02:41 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 03 Jul 2011 08:02:41 -0700 Subject: [Maxima] matrices, subscripts, and ratvars In-Reply-To: <4E108350.9010806@eecs.berkeley.edu> References: <1309681124.70658.YahooMailNeo@web30807.mail.mud.yahoo.com> <4E108350.9010806@eecs.berkeley.edu> Message-ID: <4E108491.8040509@eecs.berkeley.edu> On 7/3/2011 7:57 AM, Richard Fateman wrote: .. snip > > Try setting powerdisp:true > > to reverse the ordering of display of expressions in a sum, generally. > > Conventionally, expressions are ordered this way : > > x^2+x > z+3 > a*x+b > > with items later in the alphabet or more complicated coming first. (I forgot to add)... and in a product, with the more complicated items coming Last. hence a*x^2. > > but this is not uniformly observed, so that we also see > > u+v > E=mc^2 > F=ma > > a00*b00+a01*b10 > > This has nothing to do with ratvars. > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From max_corvallis at yahoo.com Sun Jul 3 12:06:02 2011 From: max_corvallis at yahoo.com (Max Jones) Date: Sun, 3 Jul 2011 10:06:02 -0700 (PDT) Subject: [Maxima] matrices, subscripts, and ratvars In-Reply-To: <4E108491.8040509@eecs.berkeley.edu> References: <1309681124.70658.YahooMailNeo@web30807.mail.mud.yahoo.com> <4E108350.9010806@eecs.berkeley.edu> <4E108491.8040509@eecs.berkeley.edu> Message-ID: <1309712762.70523.YahooMailNeo@web30807.mail.mud.yahoo.com> Perfect. Thanks! ----- Original Message ----- > From: Richard Fateman <fateman at eecs.berkeley.edu> > To: Max Jones <max_corvallis at yahoo.com>; Maxima - list <Maxima at math.utexas.edu> > Cc: > Sent: Sunday, July 3, 2011 8:02 AM > Subject: Re: [Maxima] matrices, subscripts, and ratvars > > On 7/3/2011 7:57 AM, Richard Fateman wrote: > > .. snip >> >> Try setting? powerdisp:true >> >> to reverse the ordering of display of expressions in a sum, generally. >> >> Conventionally, expressions are ordered this way : >> >> x^2+x >> z+3 >> a*x+b >> >> ? with items later in the alphabet or more complicated coming first. > > (I forgot to add)...? and in a product, with the more complicated items > coming Last. > > hence a*x^2. >> >> but this is not uniformly observed, so that we also see >> >> u+v >> E=mc^2 >> F=ma >> >> a00*b00+a01*b10 >> >> This has nothing to do with ratvars. >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > From macrakis at alum.mit.edu Mon Jul 4 00:52:48 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 4 Jul 2011 01:52:48 -0400 Subject: [Maxima] Macsyma? Maxima? website In-Reply-To: <5077.1309650409@gemini.franz.com> References: <4E0F88B2.3040001@eecs.berkeley.edu> <4E0F8D36.8070001@eecs.berkeley.edu> <5077.1309650409@gemini.franz.com> Message-ID: Trademarks, unlike patents and copyrights, don't expire. However, if they are not actively used in commerce, they can be considered "abandoned" and lapse. I am not a lawyer and don't know the details, but it looks like this might be the case here. -s On Jul 3, 2011 1:46 AM, "Steve Haflich" wrote: > > Richard Fateman wrote: > > On Sat, Jul 2, 2011 at 17:08, Richard Fateman < fateman at eecs.berkeley.edu> wrote: > > I just visited > > http://www.macsyma.com/ > > there is a note on the bottom that this domain may be for sale. > > Of course, but this doesn't mean what you think. > > It is common practice by the scummier animals of the internet when a > longstanding domain name expires, to squat on that name by various means > for some redicuously miniscule cost. (I forget the details.) Most > expired domain names expired because the nae was no longer "in > business", but sometimes a valuable, active nae isn't renewed because of > the client's administrative screwup. The squatters try to make money by > selling the name back to the original owner, or someone else who has > legitimate use for that name. > > If you visit the www.macsyma.com site, you will see that it is nothing > more than an automatic advertising squatting site. It has nothing to do > with Macsyma, and clicking on the single Macsyma link just brings you to > more scam links. After you do this, remember to close all the hidden > pop-up windows. You might also want to restart your browser, and run a > virus scan of your machine. > > This has little to do with the trademark status, although once some > living people can claim the trademark, that might have bearing on > reclaiming the url. > > Free online trademark search tells me that Macsyma is still a > trademark (from 1984) and so is Macsyma Newsletter, owned by Macsyma > Inc. (no address?) > > Owned, I believe, by Ira Topping. But he's dead. "So it goes." > (Vonnegut) So until that trademark expires (when will it?) his estate > (which, last I heard, lives on in a cardboard box in some lawyer's > office) will continue to own it. Richard and I know someone who might > know how to find this lawyer, in case anyone wants to make an offer. > The name isn't worth very much -- although not so much that the maxima > community couldn't collect that much. But this would not be enough for > the estate (aka the lawyer) to want to bother doing business. > > Macsyma CD-ROM appears to be for sale at Amazon for $61.05. go figure. > > Does it come with a license? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ols6000 at sbcglobal.net Sun Jul 3 12:01:56 2011 From: ols6000 at sbcglobal.net (ols6000 at sbcglobal.net) Date: Sun, 03 Jul 2011 10:01:56 -0700 Subject: [Maxima] wxMaxima cannot reduce system to a polynomial in one variable Message-ID: <7.0.1.0.2.20110703100101.058dcec0@wheresmymailserver.com> I'm attempting to use wxMaxima 11.04.0 to solve some non-linear equations symbolically, but I get the error "algsys: tried and failed to reduce system to a polynomial in one variable; give up.". Having solved these eqns by hand, I believe there is a solution. Since I am new to wxMaxima, I am probably using it incorrectly. Can someone suggest how I can get the solution I want? Here is the wxMaxima transcript: (%i1) A14:d=sr/(DM); A11:\alpha \eta *(M(1-d)/\rho)^(1/3)D=r/F; (%o1) d=(rs)/(DM) (%o2) (alpha(1-d)^(1/3)etaD*M^(1/3))/rho^(1/3)=r/F [this is actually rendered with Greek letters] (%i3) solve([%o1,%o2],[d,D]); algsys: tried and failed to reduce system to a polynomial in one variable; give up. Substituting d from A14 into A15 yields a cubic in D. I would like to see that, and also the solution of that cubic. For values of the parameters s, r, etc that I will use, there will be only one real root, but of course 'solve' can't know that, as I have asked for a symbolic solution. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon Jul 4 12:51:12 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 4 Jul 2011 10:51:12 -0700 Subject: [Maxima] Lineinfo added by the parser and debugmode In-Reply-To: <1309622444.31826.25.camel@dieter> References: <1309622444.31826.25.camel@dieter> Message-ID: Aside from Emacs, sometimes Maxima can display a stack trace and file line numbers when it runs into an error. The Maxima debugger isn't very strong, but I'd like to try to preserve at least that functionality, and omitting the line number information would make that unavailable. I agree that it's a nuisance to have the debug info in the car of expressions. My advice is to move the annotations to a symbol property. best, Robert Dodier On 7/2/11, Dieter Kaiser wrote: > When reading from a file, the parser adds a lineinfo to each expression. > This can be seen, when tracing the function add-lineinfo: > > (%i1) load(ntrig); > 0: (ADD-LINEINFO ($LOAD)) > 0: ADD-LINEINFO returned ($LOAD) > 0: (ADD-LINEINFO (DISPLAYINPUT)) > 0: ADD-LINEINFO returned (DISPLAYINPUT) > 0: (ADD-LINEINFO ($EVAL_WHEN)) > 0: ADD-LINEINFO returned > ($EVAL_WHEN > (1 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac" > SRC)) > 0: (ADD-LINEINFO (MLIST)) > 0: ADD-LINEINFO returned > (MLIST > (1 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac" > SRC)) > 0: (ADD-LINEINFO ($MATCHDECLARE)) > 0: ADD-LINEINFO returned > ($MATCHDECLARE > (2 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac" > SRC)) > 0: (ADD-LINEINFO (NODISPLAYINPUT)) > 0: ADD-LINEINFO returned > (NODISPLAYINPUT > (2 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac" > SRC)) > 0: (ADD-LINEINFO ($TELLSIMPAFTER)) > 0: ADD-LINEINFO returned > ($TELLSIMPAFTER > (4 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac" > SRC)) > 0: (ADD-LINEINFO (%SIN)) > 0: ADD-LINEINFO returned > (%SIN > (4 "/usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac" > SRC)) > > [...] > (%o1) /usr/local/share/maxima/5.24.0/share/trigonometry/ntrig.mac > > I think, this information is only used within the editor Emacs to jump > into the file to debug the code. > > I would like to suggest to add the lineinfo only, if the option variable > DEBUGMODE has the value TRUE. This can be done in the function > ADD-LINEINFO. This way the option variable gets additional > functionality. The standard value of the option variable DEBUGMODE is > FALSE and we do not add unnecessary information to each expression. > > This is an example, when loading a file without adding a lineinfo to > each expression: > > (%i1) :lisp (trace add-lineinfo) > (ADD-LINEINFO) > (%i1) load(ntrig); > 0: (ADD-LINEINFO ($LOAD)) > 0: ADD-LINEINFO returned ($LOAD) > 0: (ADD-LINEINFO (DISPLAYINPUT)) > 0: ADD-LINEINFO returned (DISPLAYINPUT) > 0: (ADD-LINEINFO ($EVAL_WHEN)) > 0: ADD-LINEINFO returned ($EVAL_WHEN) > 0: (ADD-LINEINFO (MLIST)) > 0: ADD-LINEINFO returned (MLIST) > 0: (ADD-LINEINFO ($MATCHDECLARE)) > 0: ADD-LINEINFO returned ($MATCHDECLARE) > 0: (ADD-LINEINFO (NODISPLAYINPUT)) > 0: ADD-LINEINFO returned (NODISPLAYINPUT) > 0: (ADD-LINEINFO ($TELLSIMPAFTER)) > 0: ADD-LINEINFO returned ($TELLSIMPAFTER) > 0: (ADD-LINEINFO (%SIN)) > 0: ADD-LINEINFO returned (%SIN) > > Dieter Kaiser > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From woollett at charter.net Mon Jul 4 15:59:48 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 4 Jul 2011 13:59:48 -0700 Subject: [Maxima] how to use f2cl in Maxima? Message-ID: <026B2CA3E5B64124A69BA00F195A8457@edwinc367e16bd> Would someone give me an example of how I can use f2cl (via ..src/numerical/f2cl-package.lisp) to convert some fortran procedures to common lisp. Do I need a fortran source file? Where does the translation appear? What kinds of editing is needed after the translation occurs to be able to use for numerical work inside Maxima? Ted Woollett From woollett at charter.net Mon Jul 4 17:12:10 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 4 Jul 2011 15:12:10 -0700 Subject: [Maxima] how to use f2cl in Maxima? Message-ID: <4F722CD0BD7D44C5A36481EA2AC56114@edwinc367e16bd> On July 4, 2011, Richard Fateman wrote: ---------------------------- > Would someone give me an example of how > I can use f2cl (via ..src/numerical/f2cl-package.lisp) > to convert some fortran procedures to common > lisp. > > Do I need a fortran source file? yes > > Where does the translation appear? in another file, as lisp. ---------------------------- My basic 'getting started' questions are then: 1. What type of initial load (lisp-file) load is needed to get access to f2cl (in Maxima)? 2. What is the syntax of call to f2cl? for example, would this work?: ?f2cl (fsource,fdest) my experiment: I have copied both f2cl-package.lisp and f2cl-lib.lisp to c:/work2, my work folder, and have a fortran source file flmoon.for in the same folder: (%i5) load("f2cl-package.lisp"); (%o5) f2cl-package.lisp (%i6) load("f2cl-lib.lisp"); (%o6) f2cl-lib.lisp (%i7) ?f2cl("flmoon.for"); (%o7) f2cl(flmoon.for) (%i8) ?f2cl("c:/work2/flmoon.for"); (%o8) f2cl(c:/work2/flmoon.for) (%i9) ?f2cl("flmoon.for","flmoon.lisp"); (%o9) f2cl(flmoon.for, flmoon.lisp) so Maxima doesn't know what f2cl means. Evidently I need another lisp file. I could not find a definition of f2cl in either of these lisp files. Ted From ichikawa.yuji at gmail.com Mon Jul 4 19:21:17 2011 From: ichikawa.yuji at gmail.com (ICHIKAWA, Yuji) Date: Tue, 5 Jul 2011 09:21:17 +0900 Subject: [Maxima] simplification function for divsum In-Reply-To: References: <957173D5-F11A-4994-B0CE-C6319369FDE2@gmail.com> <4E0E63C7.2030603@eecs.berkeley.edu> Message-ID: <53D5855F-8462-4187-B141-FBE69C99C93B@gmail.com> Hi, I made a simplication function for divsum. It works when second argument of divsum is 1. I hope that someone will enjoy it. Thanks, - Yuji -------------- next part -------------- A non-text attachment was scrubbed... Name: divsumsimp.mac Type: image/mac Size: 1344 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: rtest_divsumsimp.mac Type: image/mac Size: 1248 bytes Desc: not available URL: -------------- next part -------------- On 2011/07/02, at 10:54, ICHIKAWA, Yuji wrote: > Fateman-san, > > Thank you for your comments. > I recognized that there is no reliable way to attach a condition for matching that involves 2 parameters in the match. > > By the way, you can see a^b even if a, b are numbers, when you use a returned value of "factor". > It works well in the first case, though you need to change divsum to noun in order to see the result. > I think that the case of a*b is same. > > Thanks, > - > Yuji > > On 2011/07/02, at 9:18, Richard Fateman wrote: > >> On 7/1/2011 5:12 PM, ICHIKAWA, Yuji wrote: >>> Hi, >>> >>> I am trying to make simplification rules for divisor function divsum. >>> >>> 1. divsum(p^n) = (p^(n+1)-1)/(p-1) when p is prime. >>> defrule was great to implement this rule though I was happier if there is a feature of "prime". >>> >>> (example) >>> matchdeclare(pp, primep, nn, lambda([x], (integerp(x) or featurep(x, integer)) and x> 0))$ >>> defrule(sigma_simp1, divsum(pp^nn, 1), (pp^(nn + 1) - 1)/(pp - 1))$ >>> >>> declare(n, integer)$ >>> assume(n> 0)$ >>> sigma_simp1(divsum(3^n)); >>> => (3^(n+1)-1)/2 >>> >>> 2. divsum(a*b) = divsum(a)*divsum(b) if a and b are relatively prime. >>> >>> I lost my way for this simplification. >>> Are there any manners to let Maxima check if two variables are relatively prime? >>> >>> Thanks, >>> - >>> Yuji >>> _______________________________________________ >>> Maxima mailing list >>> Maxima at math.utexas.edu >>> http://www.math.utexas.edu/mailman/listinfo/maxima >> a. gcd(R,S) will be 1 if R and S are relatively prime. >> b. You will probably never see a*b in Maxima if a, b are numbers. They will be multiplied together. >> c. You will probably never see a^b in Maxima if a, b are numbers, either. >> d. There is no reliable way to attach a condition for matching that involves 2 parameters in the match. >> >> RJF >> > From toy.raymond at gmail.com Mon Jul 4 22:41:06 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 04 Jul 2011 23:41:06 -0400 Subject: [Maxima] how to use f2cl in Maxima? References: <026B2CA3E5B64124A69BA00F195A8457@edwinc367e16bd> Message-ID: >>>>> "Edwin" == Edwin Woollett writes: Edwin> Would someone give me an example of how Edwin> I can use f2cl (via ..src/numerical/f2cl-package.lisp) Edwin> to convert some fortran procedures to common Edwin> lisp. Maxima does not include the actual code that does the translation. Maxima only includes the support library needed by the translated code. If you want to translate some Fortran code, you'll have to get your own copy of f2cl. I'd recommend using quicklisp (quicklisp.org) to get f2cl. Or you can get it from http://trac.common-lisp.net/f2cl/. (Documentation is very limited there. If you view the source, there is a document describing how to use f2cl. It's a bit dated. The documentation needs to be updated.) Edwin> Do I need a fortran source file? Normally, yes. But you could just write Lisp code directly. But then, why use f2cl at all in that case? Edwin> Where does the translation appear? If you have f2cl, it will normally appear in the same directory as the Fortran source, but you can specify where you want it to go and what name to use too. Edwin> What kinds of editing is needed after the Edwin> translation occurs to be able to use for Edwin> numerical work inside Maxima? If you run (f2cl:f2cl "src.f" :float-format 'double-float :package :maxima) then you probably don't need to do any editing to be able to use it as is with maxima. Ray From t.albrecht at hzdr.de Tue Jul 5 02:12:50 2011 From: t.albrecht at hzdr.de (Thomas Albrecht) Date: Tue, 5 Jul 2011 09:12:50 +0200 Subject: [Maxima] Do not print a function's arguments? Message-ID: <201107050912.50939.t.albrecht@hzdr.de> Dear all, I have a function (%i1) u : u(x); hence, (%i2) derivabbrev: true$ (%i3) diff(u,x); gives (_ denotes subscript) (%o3) u(x)_x Is there a way to make Maxima print u_x instead? I.e., to omit the function's arguments for clarity? Cheers, Thomas -- Thomas Albrecht Helmholtz-Zentrum Dresden-Rossendorf Institute of Safety Research Tel.: +49 (0)351 2602377 P.O. Box 51 01 19, D-01314 Dresden / Germany Fax : +49 (0)351 2602007 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From t.albrecht at hzdr.de Tue Jul 5 04:36:53 2011 From: t.albrecht at hzdr.de (Thomas Albrecht) Date: Tue, 5 Jul 2011 11:36:53 +0200 Subject: [Maxima] Do not print a function's arguments? In-Reply-To: <201107050912.50939.t.albrecht@hzdr.de> References: <201107050912.50939.t.albrecht@hzdr.de> Message-ID: <201107051136.54045.t.albrecht@hzdr.de> On Tuesday, 5. July 2011 09:12:50 Thomas Albrecht wrote: > Dear all, > > I have a function > > (%i1) u : u(x); > > hence, > > (%i2) derivabbrev: true$ > (%i3) diff(u,x); > > gives (_ denotes subscript) > > (%o3) u(x)_x > > Is there a way to make Maxima print > > u_x > > instead? I.e., to omit the function's arguments for clarity? > > > Cheers, > Thomas Found it. (%i1) depends(u, x); did the trick. -- Thomas Albrecht Helmholtz-Zentrum Dresden-Rossendorf Institute of Safety Research Tel.: +49 (0)351 2602377 P.O. Box 51 01 19, D-01314 Dresden / Germany Fax : +49 (0)351 2602007 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From willisb at unk.edu Tue Jul 5 07:27:42 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 5 Jul 2011 07:27:42 -0500 Subject: [Maxima] unsimplified facts in database In-Reply-To: <201107051136.54045.t.albrecht@hzdr.de> References: <201107050912.50939.t.albrecht@hzdr.de>, <201107051136.54045.t.albrecht@hzdr.de> Message-ID: The fact database sometimes holds unsimplified facts. One way to see this is to insert a print into $sign: (defmfun $sign (x) (let ((x (specrepcheck x)) sign minus odds evens factored) (print `(facts = ,($facts))) ... Then, for example (%i12) abs(sin(x)/x); (FACTS = ((MLIST))) (FACTS = ((MLIST) ((MNOT) (($EQUAL) $X 0)))) (FACTS = ((MLIST) ((MNOT) (($EQUAL) $X 0)))) (FACTS = ((MLIST) ((MNOT) (($EQUAL) $X 0)))) (FACTS = ((MLIST) ((MNOT) (($EQUAL) $X 0)))) (%o12) abs(sin(x))/abs(x) The expression not equal(x,0) simplifies to notequal(x,0). I don't know of any bugs that this causes (other than with the code I was playing with), but it's really best to keep everything simplified. Circumventing simplifya to possibly speed things up causes trouble. --Barton From willisb at unk.edu Tue Jul 5 12:03:53 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 5 Jul 2011 12:03:53 -0500 Subject: [Maxima] unsimplified facts in database In-Reply-To: References: <201107050912.50939.t.albrecht@hzdr.de>, <201107051136.54045.t.albrecht@hzdr.de>, Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >The?fact?database?sometimes?holds?unsimplified?facts.?One?way?to >see?this?is?to?insert?a?print?into?$sign: >Then,?for?example > >(%i12)?abs(sin(x)/x); >(FACTS?=?((MLIST)))? >(FACTS?=?((MLIST)?((MNOT)?(($EQUAL)?$X?0))))? The functions c-$pos, c-$pz, daddnq, and intext (all defined in compar.lisp) do things such as (list '(mnot) (cons '($equal) body)). Fixing daddnq and intext to return $notequal expressions fixes nothing and causes no bugs. The functions c-$pos and c-$pz aren't called by any function in compar.lisp--maybe they could be commented out. --Barton From willisb at unk.edu Wed Jul 6 12:34:04 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 6 Jul 2011 12:34:04 -0500 Subject: [Maxima] multivariable kron_delta In-Reply-To: References: Message-ID: The kron_delta function now takes two or more arguments--I committed new code, user documentation, and (regression) tests Maxima 5.24post http://maxima.sourceforge.net using Lisp Clozure Common Lisp Version 1.6-dev (WindowsX8632) (%i1) kron_delta(u,n,k); (%o1)kron_delta(k, n, u) (%i2) subst(k=n+1,%); (%o2) 0 (%i3) kron_delta(a,b,-c) - kron_delta(-a,-b,c); (%o3) 0 (%i4) kron_delta(a,a,a,a); (%o4) 1 --Barton From willisb at unk.edu Wed Jul 6 13:03:14 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 6 Jul 2011 13:03:14 -0500 Subject: [Maxima] Bernstein polynomials In-Reply-To: References: <201107050912.50939.t.albrecht@hzdr.de>, <201107051136.54045.t.albrecht@hzdr.de> Message-ID: I have some code for the Bernstein polynomials---the code worked for what I needed, but I haven't put much time into it. I might work on the code and place it in /share or in phpBB (already re-spammed). If somebody has polished code for the Bernstein polynomials, send me a note. Examples: Nounform when k or n are not explicit integers (unless bernstein_explicit is true) (%i8) bernstein_poly(k,n,x); (%o8) bernstein_poly(k,n,x) (%i10) bernstein_poly(k,n,x), bernstein_explicit : true; (%o10) binomial(n,k)*(1-x)^(n-k)*x^k Numerical (via the bigfloat package) (%i13) bernstein_poly(2,10, 1/2 + %i/3); (%o13) (19435*%i)/186624-1719575/6718464 (%i14) bernstein_poly(2,10, 0.5b0 + %i/3); (%o14) 1.041398748285324b-1*%i-2.559476392222983b-1 Calculus (%i15) diff(bernstein_poly(k,n,x),x); (%o15) (bernstein_poly(k-1,n-1,x)-bernstein_poly(k,n-1,x))*n (%i20) integrate(bernstein_poly(k,n,x),x); (%o20) (hypergeometric([k+1,k-n],[k+2],x)*binomial(n,k)*x^(k+1))/(k+1) Single and multivariable uniform approximation (%i22) bernstein_approx(f(x),[x],3); (%o22) f(1)*x^3+3*f(2/3)*(1-x)*x^2+3*f(1/3)*(1-x)^2*x+f(0)*(1-x)^3 (%i23) bernstein_approx(f(x,y),[x,y],2); (%o23) f(1,1)*x^2*y^2+2*f(1/2,1)*(1-x)*x*y^2+f(0,1)*(1-x)^2*y^2+2*f(1,1/2)*x^2*(1-y)*y+4*f(1/2,1/2)*(1-x)*x*(1-y)*y+2*f(0,1/2)*(1-x)^2*(1-y)*y+f(1,0)*x^2*(1-y)^2+2*f(1/2,0)*(1-x)*x*(1-y)^2+f(0,0)*(1-x)^2*(1-y)^2 Exact expansion of polynomials as linear combinations of Bernstein polynomials (%i26) bernstein_factor(1+x*y,[x,y]); (%o26) 2*x*y+(1-x)*y+x*(1-y)+(1-x)*(1-y) (%i27) expand(%); (%o27) x*y+1 Comments & suggestions are (of course) welcomed. --Barton From woollett at charter.net Thu Jul 7 15:58:58 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 7 Jul 2011 13:58:58 -0700 Subject: [Maxima] how to use f2cl in Maxima? Message-ID: On July 4, Raymond Toy wrote: ------------------------------- rtoy> Maxima does not include the actual code that does the translation. rtoy> Maxima only includes the support library needed by the translated rtoy> code. If you want to translate some Fortran code, you'll have to get rtoy> your own copy of f2cl. I'd recommend using quicklisp (quicklisp.org) rtoy> to get f2cl. Or you can get it from rtoy> http://trac.common-lisp.net/f2cl/. (Documentation is very limited rtoy> there. If you view the source, there is a document describing how to ------------------------------- Thanks for the information about the needed package. It appears that both the quicklisp and trac links lead to f2cl stuff in a form that requires one to have a unix based system, which thus excludes windows users, such as myself, from access to this open source software in lisp. Is there an alternative link to a source of lisp f2cl code accessible to someone like me? Ted Woollett From talon at lpthe.jussieu.fr Thu Jul 7 17:12:48 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 08 Jul 2011 00:12:48 +0200 Subject: [Maxima] how to use f2cl in Maxima? References: Message-ID: Edwin Woollett wrote: > Is there an alternative link to > a source of lisp f2cl code accessible to > someone like me? > > Ted Woollett I have put a zip file of the f2cl source and instructions to run it here: http://www.lpthe.jussieu.fr/~talon/f2cl-src.zip This is extracted from the latest mercurial repository i have found. The basic way to run is to start a lisp shell (i assume running to_lisp() in maxima does the job and then compile and load the various lisp files in good order as described in the README, then you can start translating a fortran77 file). -- Michel Talon From willisb at unk.edu Fri Jul 8 12:58:41 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 8 Jul 2011 12:58:41 -0500 Subject: [Maxima] build problem: file_search_lisp / file_search_maxima In-Reply-To: References: <201107050912.50939.t.albrecht@hzdr.de>, <201107051136.54045.t.albrecht@hzdr.de> Message-ID: I decided to work on my Bernstein polynomial code and to place it into a new folder /share/contrib/bernstein. The new files were automatically included in src/sharefiles.mk, but both file_search_maxima and file_search_lisp are missing a path to the new folder and files. Any ideas of what I need to do to fix this problem? --Barton From maxima at etherjones.us Fri Jul 8 15:09:21 2011 From: maxima at etherjones.us (Ether Jones) Date: Fri, 8 Jul 2011 13:09:21 -0700 (PDT) Subject: [Maxima] QR & SVD In-Reply-To: Message-ID: <1310155761.56326.YahooMailClassic@web161801.mail.bf1.yahoo.com> Does Maxima have QR and/or SVD factorizations built in?? I couldn't find them. If not, are there any plugins available? --- On Wed, 7/6/11, Barton Willis wrote: From: Barton Willis Subject: Re: [Maxima] multivariable kron_delta To: maxima at math.utexas.edu Date: Wednesday, July 6, 2011, 1:34 PM The kron_delta function now takes two or more arguments--I committed new code, user documentation, and (regression) tests Maxima 5.24post http://maxima.sourceforge.net using Lisp Clozure Common Lisp Version 1.6-dev? (WindowsX8632) (%i1) kron_delta(u,n,k); (%o1)kron_delta(k, n, u) (%i2) subst(k=n+1,%); (%o2) 0 (%i3) kron_delta(a,b,-c) - kron_delta(-a,-b,c); (%o3) 0 (%i4) kron_delta(a,a,a,a); (%o4)? 1 --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 toy.raymond at gmail.com Fri Jul 8 15:41:34 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 08 Jul 2011 16:41:34 -0400 Subject: [Maxima] QR & SVD References: <1310155761.56326.YahooMailClassic@web161801.mail.bf1.yahoo.com> Message-ID: >>>>> "Ether" == Ether Jones writes: Ether> Does Maxima have QR and/or SVD factorizations built in?? I Ether> couldn't find them. If not, are there any plugins Ether> available? Maxima includes a significant portion of LAPACK, which includes QR and SVD routines. However, there are no interfaces from maxima to those routines. It will take a few days to create those interface routines. Ray From toy.raymond at gmail.com Fri Jul 8 15:48:43 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 08 Jul 2011 16:48:43 -0400 Subject: [Maxima] build problem: file_search_lisp / file_search_maxima References: <201107050912.50939.t.albrecht@hzdr.de> <201107051136.54045.t.albrecht@hzdr.de> Message-ID: >>>>> "Barton" == Barton Willis writes: Barton> I decided to work on my Bernstein polynomial code and to place it into Barton> a new folder /share/contrib/bernstein. The new files were Barton> automatically included in src/sharefiles.mk, but both Barton> file_search_maxima and file_search_lisp are missing a path to the new Barton> folder and files. Any ideas of what I need to do to fix this problem? Hmm. src/share-subdirs.lisp is supposed to contain the default list of directories to be used by file_search. This file is generated by configure. Did you run configure? (I think running "config.status" should be enough.) Of course, it could be a bug in the dependencies. I thought make would rerun configure if the config-generated files need to be updated. Ray From robert.dodier at gmail.com Fri Jul 8 16:36:55 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 8 Jul 2011 15:36:55 -0600 Subject: [Maxima] QR & SVD In-Reply-To: <1310155761.56326.YahooMailClassic@web161801.mail.bf1.yahoo.com> References: <1310155761.56326.YahooMailClassic@web161801.mail.bf1.yahoo.com> Message-ID: On 7/8/11, Ether Jones wrote: > > Does Maxima have QR and/or SVD factorizations built in? I couldn't find > them. Maxima functions dgeev and dgesvd punt to functions of the same name in the lapack package. dgeev seems to apply the QR algorithm, according to comments in the Fortran source code. hth Robert Dodier From sciwise at ihug.co.nz Sat Jul 9 05:52:17 2011 From: sciwise at ihug.co.nz (Edward Montague) Date: Sat, 09 Jul 2011 22:52:17 +1200 Subject: [Maxima] Augmented Langarian Function . Message-ID: <4E1832E1.8070003@ihug.co.nz> Awhile ago I was investigating the Variational Iteration Method , for the approximate symbolic solution of Non Linear Differential Equations . The solution of these requires the use of a Lagranian multiplier , lambda ; see attached pdf . I'm wondering how the Augmented Lagranian , found in Maxima , might be used in this setting . -------------- next part -------------- A non-text attachment was scrubbed... Name: VIM.tar.gz Type: application/x-gzip Size: 27888 bytes Desc: not available URL: From shinabe.munehiro at hotmail.co.jp Sat Jul 9 09:51:51 2011 From: shinabe.munehiro at hotmail.co.jp (Part Marty) Date: Sat, 9 Jul 2011 23:51:51 +0900 Subject: [Maxima] residue(z*exp(1/z),z,0); Message-ID: Please tell me that. (%i1)f:z*exp(1/z); residue(f,z,0); f2:taylor(f,[z,0,5,'asymp]); (%o1) z*%e^(1/z) (%o2) 0 (%o3)/T/ z+1+1/(2*z)+1/(6*z^2)+1/(24*z^3)+1/(120*z^4)+1/(720*z^5)+... I think the residue of the expression "f" is 1/2. Why not ? Function: residue (expr, z, z_0) Computes the residue in the complex plane of the expression expr when the variable z assumes the value z_0. The residue is the coefficient of (z - z_0)^(-1) in the Laurent series for expr. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jcsantos at fc.up.pt Sat Jul 9 11:10:14 2011 From: jcsantos at fc.up.pt (=?ISO-8859-1?Q?Jos=E9_Carlos_Santos?=) Date: Sat, 09 Jul 2011 17:10:14 +0100 Subject: [Maxima] residue(z*exp(1/z),z,0); In-Reply-To: References: Message-ID: <4E187D66.1030403@fc.up.pt> On 09-07-2011 15:51, Part Marty wrote: > Please tell me that. > > (%i1)f:z*exp(1/z); > residue(f,z,0); > f2:taylor(f,[z,0,5,'asymp]); > (%o1) z*%e^(1/z) > (%o2) 0 > (%o3)/T/ z+1+1/(2*z)+1/(6*z^2)+1/(24*z^3)+1/(120*z^4)+1/(720*z^5)+... > > I think the residue of the expression "/f" is 1/2./ > Why not ? Yes, the residue is 1/2. This seems to be a Maxima bug. And not a new one: https://bugs.launchpad.net/ubuntu/+source/maxima/+bug/323221 Best regards, Jose Carlos Santos From leon.magiera at wp.pl Sat Jul 9 13:43:13 2011 From: leon.magiera at wp.pl (leon.magiera at wp.pl) Date: Sat, 09 Jul 2011 20:43:13 +0200 Subject: [Maxima] problems Message-ID: <4e18a141d76197.72691650@wp.pl> Please look at the following problems Problem 1 assume(a>b); conjugate(sqrt(a-b)); Maxima displays the correct result: sqrt(a-b) however, for: assume(b>a); the calculation of conjugate( sqrt(a-b)) becomes too difficult. One would expect the result: -%i*sqrt(b-a) ) Problem 2 An attempt of calculation the laplacian of 1/r, where r:=sqrt(x^2+y^2+z^2) laplacian(1/r) gives a wrong result: "zero" . Is it possible to evaluate a correct result, using Maxima ? Problem 3. How, using Maxima, to solve in elegant way a system of inequalties, like: (x^2+x+1)^x>0 and x>-2 Thanks in advance Leon From willisb at unk.edu Sat Jul 9 15:11:41 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 9 Jul 2011 15:11:41 -0500 Subject: [Maxima] problems In-Reply-To: <4e18a141d76197.72691650@wp.pl> References: <4e18a141d76197.72691650@wp.pl> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >assume(b>a);? > >the?calculation?of?? >? >conjugate(?sqrt(a-b)) > >becomes?too?difficult.? One workaround: (%i1) matchdeclare(e, lambda([x], is(x <= 0)))$ (%i2) tellsimpafter(sqrt(e),%i * sqrt(-e))$ (%i3) assume(b > a)$ (%i5) conjugate(sqrt(a-b)); (%o5) -%i*sqrt(b-a) >An?attempt?of?calculation?the?laplacian?of?1/r,?where >? >?????r:=sqrt(x^2+y^2+z^2) >???????laplacian(1/r) Change r:=sqrt(x^2+y^2+z^2) to r : sqrt(x^2+y^2+z^2). For an explanation, enter ?? :=; Also, load(vector). (%i19) load(vector)$ (%i20) r:sqrt(x^2+y^2+z^2)$ (%i21) laplacian(r); (%o21) 3/sqrt(z^2+y^2+x^2)-z^2/(z^2+y^2+x^2)^(3/2)-y^2/(z^2+y^2+x^2)^(3/2)-x^2/(z^2+y^2+x^2)^(3/2) >How,?using?Maxima,?to?solve?in?elegant?way?a?system?of?inequalties,?like:? > >????????????????(x^2+x+1)^x>0?and?x>-2? Maxima has several functions for solving inequalities, but this one is out of reach for any of them to solve. Examples of solving inequations in Maxima: (%i6) load(to_poly_solver)$ Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:49 $ (%i11) %solve(x^2 -2*x + 1 <= 0,x); (%o11) %union([x=1]) (%i12) %solve(x^2 -2*x <= 0,x); (%o12) %union([0 9],[x,y]); (%o13) %union([y/6+9=3-2*sqrt(5),x<5],[x>=2*sqrt(5)+3]] --bw From willisb at unk.edu Sat Jul 9 19:17:03 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 9 Jul 2011 19:17:03 -0500 Subject: [Maxima] problems In-Reply-To: References: <4e18a141d76197.72691650@wp.pl>, Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >One?workaround: > >?(%i1)?matchdeclare(e,?lambda([x],?is(x?<=?0)))$ >?(%i2)?tellsimpafter(sqrt(e),%i?*?sqrt(-e))$ A better workaround: (%i1) assume(b>a)$ (%i2) conjugate(sqrt(a-b)); (%o2) conjugate(sqrt(a-b)) (%i3) map('rectform,%); (%o3) -%i*sqrt(b-a) --Barton From bernard at marcade.biz Sat Jul 9 19:13:58 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sun, 10 Jul 2011 01:13:58 +0100 Subject: [Maxima] problems In-Reply-To: References: <4e18a141d76197.72691650@wp.pl> Message-ID: <1310256838.4343.12.camel@dell-laptop> On Sat, 2011-07-09 at 15:11 -0500, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > > >assume(b>a); > > > >the calculation of > > > >conjugate( sqrt(a-b)) > > > >becomes too difficult. > > One workaround: > > (%i1) matchdeclare(e, lambda([x], is(x <= 0)))$ > (%i2) tellsimpafter(sqrt(e),%i * sqrt(-e))$ > (%i3) assume(b > a)$ > (%i5) conjugate(sqrt(a-b)); > (%o5) -%i*sqrt(b-a) > I'm new to maxima but I had a quick look at some of the code and it seems to me that the problem arises because there is no version of $rectform when *complexsign* is set to t, thus causing problems with $csign and, as a result, the function manifestly-pure-imaginary-p is coded as follows: (defun manifestly-pure-imaginary-p (e) (let (($inflag t)) (or (and ($mapatom e) (or (eq e '$%i) (and (symbolp e) (kindp e '$imaginary) (not ($nonscalarp e))) (and ($subvarp e) (manifestly-pure-imaginary-p ($op e))))) ;; For now, let's use $csign on constant expressions only; once $csign improves, ;; the ban on nonconstant expressions can be removed (and ($constantp e) (eq '$imaginary ($csign e)))))) Is this the root of the problem? It's years since I've programmed in Lisp, but I wouldn't mind looking into this further. Incidentally if you call rectform yourself you get the right answer: (%i1) assume (b>a)$ (%i2) rectform (sqrt(a-b))$ (%i3) conjugate(%); (%o5) -%i*sqrt(b-a) /Bernard From willisb at unk.edu Sun Jul 10 06:20:06 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 10 Jul 2011 06:20:06 -0500 Subject: [Maxima] problems In-Reply-To: <4e19484fc92dd1.59994994@wp.pl> References: <4e18a141d76197.72691650@wp.pl> , <4e19484fc92dd1.59994994@wp.pl> Message-ID: -----leon.magiera at wp.pl wrote: ----- >but?I?wanted?to?calculate?the?laplacian?of?1/r > load(vector)$ >?r:sqrt(x^2+y^2+z^2)$ >?factor(laplacian(1/r)); > >The?correct?result?should?be?Dirac?delta?function?instead??of?"zero". I don't know of a workaround that will do what you want. Even if there was, Maxima has little to no support for the Dirac delta function. Thus, it's unlikely that Maxima could do anything useful with the result. Maybe you would like to write Maxima code that could do these things. --Barton From willisb at unk.edu Sun Jul 10 06:49:03 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 10 Jul 2011 06:49:03 -0500 Subject: [Maxima] problems In-Reply-To: <1310256838.4343.12.camel@dell-laptop> References: <4e18a141d76197.72691650@wp.pl> , <1310256838.4343.12.camel@dell-laptop> Message-ID: First, welcome to Maxima. It's been too long ago for me to recall, but I'm guessing that when I wrote conjugate.lisp, I thought that $csign was either too buggy or too slow to use in general. There is also the problem that csign / rectform can generate huge & messy expressions. Courtesy of CL, it's possible to redefine functions from a Maxima prompt: (%i1) 42; (%o1) 42 (%i2) :lisp(defun manifestly-pure-imaginary-p (e) (eq '$imaginary ($csign e))) MANIFESTLY-PURE-IMAGINARY-P (%i3) run_testsuite() (I think wxMaxima has a bug that the first input cannot be :lisp(XXXX)--thus the 42 input). When I tried this, there were errors in rtestconjugate 37 and rest_equal 196. These failures might be due to side effects in calling $csign (the function $csign modifies the fact database--it should expunge these facts at the right moment). Indeed, (%i2) :lisp(defun manifestly-pure-imaginary-p (e) (unwind-protect (eq '$imaginary ($csign e)) (clearsign))) fixes these bugs. The actual bug might be in the code that runs the testsuite (doesn't call clearsign after completing each test, for example). Weirdly, this definition of manifestly-pure-imaginary-p fixes bugs in the share testsuite (do load(share_testsuite)) that seem to have *nothing* to do with conjugates. Alternatively, maybe the function conjugate-mexpt could be improved (return fewer conjugate nounforms). Again, welcome to Maxima. Learning or re-learning CL is far easier than learning your way around the Maxima source code, I think. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >I'm?new?to?maxima?but?I?had?a?quick?look?at?some?of?the?code?and?it >seems?to?me?that?the?problem?arises?because?there?is?no?version?of >$rectform?when?*complexsign*?is?set?to?t,?thus?causing?problems?with >$csign?and,?as?a?result,?the?function?manifestly-pure-imaginary-p?is >coded?as?follows: > >(defun?manifestly-pure-imaginary-p?(e) >??(let?(($inflag?t)) >????(or? >?????(and?($mapatom?e) >???? ??(or >???? ???(eq?e?'$%i) >???? ???(and?(symbolp?e)?(kindp?e?'$imaginary)?(not?($nonscalarp?e))) >???? ???(and?($subvarp?e)?(manifestly-pure-imaginary-p?($op?e))))) >?????;;?For?now,?let's?use?$csign?on?constant?expressions?only;?once >$csign?improves, >?????;;?the?ban?on?nonconstant?expressions?can?be?removed >?????(and?($constantp?e)?(eq?'$imaginary?($csign?e)))))) > >Is?this?the?root?of?the?problem??It's?years?since?I've?programmed?in >Lisp,?but?I?wouldn't?mind?looking?into?this?further. From drdieterkaiser at web.de Sun Jul 10 07:26:41 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 10 Jul 2011 14:26:41 +0200 Subject: [Maxima] problems In-Reply-To: References: <4e18a141d76197.72691650@wp.pl> , <1310256838.4343.12.camel@dell-laptop> Message-ID: <1310300801.1739.15.camel@dieter> Am Sonntag, den 10.07.2011, 06:49 -0500 schrieb Barton Willis: > First, welcome to Maxima. > > It's been too long ago for me to recall, but I'm guessing that when I wrote > conjugate.lisp, I thought that $csign was either too buggy or too slow to > use in general. There is also the problem that csign / rectform can generate > huge & messy expressions. Hello Barton, the time you wrote the code of conjugate.lisp the function $csign was not present. The first commit of $csign I have done in Dezember 2008. The functionality of $csign is not perfect, but it is supposed to extend the function $sign in a way which does not change any old code. Because $sign has a lot of limitations, it can not be expected that $csign is much better. The extension does not use calls to the functions of rpart.lisp. Therefore $csign should be as fast as the function $sign. By the way: The code of $sign is very difficult to maintain and to debug. The code depends on a lot of global variables and works with side effects on global variables. But you have remarked this point in a post already. Dieter Kaiser From willisb at unk.edu Sun Jul 10 07:59:45 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 10 Jul 2011 07:59:45 -0500 Subject: [Maxima] problems In-Reply-To: <1310300801.1739.15.camel@dieter> References: <4e18a141d76197.72691650@wp.pl> , <1310256838.4343.12.camel@dell-laptop> , <1310300801.1739.15.camel@dieter> Message-ID: When I wrote conjugate.lisp, there was a rudimentary csign (not $csign) function. Given the limitations of $sign and the (extreme) difficultly in working with code in compar.lisp, your work on $csign improved Maxima a great deal--I didn't mean to imply anything negative about the function $csign. The other day when I gave the sign function object-oriented dispatch, I thought (not long) about appending code that would do a better job of determining the sign of a single variable polynomial. For a polynomial defined on the entire reals, a few lines of code with nroots might work, but for a polynomial defined on a subset of the reals, it's not easy to determine from the fact database lower and upper bounds for a variable (suppose x+y<2 and x-y>5, deduce y <-3/2). It would be great if the fact database would maintain bunch of derived facts--re-deriving them each time sign is called is too spendy, I think. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >the?time?you?wrote?the?code?of?conjugate.lisp?the?function?$csign?was >not?present.?The?first?commit?of?$csign?I?have?done?in?Dezember?2008. >The?functionality?of?$csign?is?not?perfect,?but?it?is?supposed?to?extend >the?function?$sign?in?a?way?which?does?not?change?any?old?code. From drdieterkaiser at web.de Sun Jul 10 09:16:43 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 10 Jul 2011 16:16:43 +0200 Subject: [Maxima] problems In-Reply-To: References: <4e18a141d76197.72691650@wp.pl> , <1310256838.4343.12.camel@dell-laptop> , <1310300801.1739.15.camel@dieter> Message-ID: <1310307404.1739.28.camel@dieter> Am Sonntag, den 10.07.2011, 07:59 -0500 schrieb Barton Willis: > When I wrote conjugate.lisp, there was a rudimentary csign (not > $csign) function. Given the limitations of $sign and the (extreme) > difficultly in working with code in compar.lisp, your work on $csign > improved Maxima a great deal--I didn't mean to imply anything negative > about the function $csign. Thank you very much for your comment. > The other day when I gave the sign function object-oriented dispatch, > I thought (not long) about appending code that would do a better job > of determining the sign of a single variable polynomial. For a > polynomial defined on the entire reals, a few lines of code with > nroots might work, but for a polynomial defined on a subset of the > reals, it's not easy to determine from the fact database lower and > upper bounds for a variable (suppose x+y<2 and x-y>5, deduce y <-3/2). > It would be great if the fact database would maintain bunch of > derived facts--re-deriving them each time sign is called is too spendy, I > think. I like the object-oriented dispatch very much, which gives the possibility to extend the functionality for functions very easy. At the moment I am working almost exclusively on the the German translation and the Maxima manual. But this way, I have collected a lot of ideas to improve the implemented functions . Dieter Kaiser From fateman at eecs.berkeley.edu Sun Jul 10 09:25:57 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 10 Jul 2011 07:25:57 -0700 Subject: [Maxima] problems In-Reply-To: <1310307404.1739.28.camel@dieter> References: <4e18a141d76197.72691650@wp.pl> , <1310256838.4343.12.camel@dell-laptop> , <1310300801.1739.15.camel@dieter> <1310307404.1739.28.camel@dieter> Message-ID: <4E19B675.3040607@eecs.berkeley.edu> Without thinking about this too much, it seems that there is a possibility of using a (relatively strong) interval arithmetic package to do what sign is supposed to do, (or vice versa). That is, given an expression f(x) and an interval for x, e.g. [0,inf], it is an interval arithmetic problem to see if f([0,inf]) is bounded away from 0 or not. Interval arithmetic may be too sloppy to do this sufficiently accurately, but it addresses the same kind of problems and could use the same kinds of solutions, like finding the extrema of f. Does it makes sense to do both at at the same time? There are a number of lisp-language interval arithmetic package; I've written at least 3 myself. (one in my generic arithmetic package) RJF On 7/10/2011 7:16 AM, Dieter Kaiser wrote: > Am Sonntag, den 10.07.2011, 07:59 -0500 schrieb Barton Willis: >> When I wrote conjugate.lisp, there was a rudimentary csign (not >> $csign) function. Given the limitations of $sign and the (extreme) >> difficultly in working with code in compar.lisp, your work on $csign >> improved Maxima a great deal--I didn't mean to imply anything negative >> about the function $csign. > Thank you very much for your comment. > >> The other day when I gave the sign function object-oriented dispatch, >> I thought (not long) about appending code that would do a better job >> of determining the sign of a single variable polynomial. For a >> polynomial defined on the entire reals, a few lines of code with >> nroots might work, but for a polynomial defined on a subset of the >> reals, it's not easy to determine from the fact database lower and >> upper bounds for a variable (suppose x+y<2 and x-y>5, deduce y<-3/2). >> It would be great if the fact database would maintain bunch of >> derived facts--re-deriving them each time sign is called is too spendy, I >> think. > I like the object-oriented dispatch very much, which gives the > possibility to extend the functionality for functions very easy. At the > moment I am working almost exclusively on the the German translation and > the Maxima manual. But this way, I have collected a lot of ideas to > improve the implemented functions . > > Dieter Kaiser > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From willisb at unk.edu Sun Jul 10 10:19:36 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 10 Jul 2011 10:19:36 -0500 Subject: [Maxima] problems In-Reply-To: <4E19B675.3040607@eecs.berkeley.edu> References: <4e18a141d76197.72691650@wp.pl> , <1310256838.4343.12.camel@dell-laptop> , <1310300801.1739.15.camel@dieter> <1310307404.1739.28.camel@dieter>, <4E19B675.3040607@eecs.berkeley.edu> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Without?thinking?about?this?too?much,?it?seems?that?there?is?a? >possibility?of?using?a >(relatively?strong)?interval?arithmetic?package?to?do?what?sign?is? >supposed?to?do, Correct me if I'm mistaken, but doing things such as x+y<2 and x-y>5 implies y<-3/2 isn't something that interval arithmetic, as generally described, can handle. The sign code needs to be able to do things like this. Also to be useful for sign, intervals need to be open / closed--that might be tedious, but not terribly difficult. One obstacle is that setting the rounding mode isn't required by CL. For double floats, that makes it difficult to do 100% correct interval arithmetic for all Lisp versions. --Barton From willisb at unk.edu Sun Jul 10 10:32:59 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 10 Jul 2011 10:32:59 -0500 Subject: [Maxima] problems In-Reply-To: References: <4e18a141d76197.72691650@wp.pl> <1310256838.4343.12.camel@dell-laptop>, Message-ID: By the way: (%i2) :lisp(defun manifestly-pure-imaginary-p (e) (eq '$imaginary ($csign e))); MANIFESTLY-PURE-IMAGINARY-P (%i2) map(lambda([s], print(facts()), conjugate(s)), [1/sqrt(x),1/sqrt(x)]); [] [notequal(x,0)] (%o2) [conjugate(1/sqrt(x)),1/sqrt(x)] A conservative approach might be (defun conjugate-mexpt (e) (let ((x (first e)) (p (second e))) (cond ((or (off-negative-real-axisp x) ($featurep p '$integer)) (power (take '($conjugate) x) (take '($conjugate) p))) ((and (on-negative-real-axisp x) (manifestly-real-p p)) (mul -1 (power x p))) Then (%i3) assume(a > b); (%o3) [a>b] (%i5) conjugate(sqrt(b-a)); (%o5) -sqrt(b-a) --Barton From fateman at eecs.berkeley.edu Sun Jul 10 11:06:50 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 10 Jul 2011 09:06:50 -0700 Subject: [Maxima] inequalities, intervals, Cylindrical Decomposition, CAD, was Re: problems In-Reply-To: References: <4e18a141d76197.72691650@wp.pl> , <1310256838.4343.12.camel@dell-laptop> , <1310300801.1739.15.camel@dieter> <1310307404.1739.28.camel@dieter>, <4E19B675.3040607@eecs.berkeley.edu> Message-ID: <4E19CE1A.2080300@eecs.berkeley.edu> On 7/10/2011 8:19 AM, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > >> Without thinking about this too much, it seems that there is a >> possibility of using a >> (relatively strong) interval arithmetic package to do what sign is >> supposed to do, > Correct me if I'm mistaken, but doing things such as x+y<2 and x-y>5 > implies y<-3/2 isn't something that interval arithmetic, as generally > described, can handle. You are correct. > The sign code needs to be able to do things > like this. Would it be plausible to have a special "sign of a function of one real variable on a real interval" routine? > Also to be useful for sign, intervals need to be open / > closed--that might be tedious, but not terribly difficult. Yes. > One obstacle is that setting the rounding mode isn't required by > CL. For double floats, that makes it difficult to do 100% > correct interval arithmetic for all Lisp versions. Oh, there are many issues that prevent intervals from being "tight". A more general solution for a function p and conditions c1, c2, that are all polynomials equalities (maybe inequalities too) ... polynomials in n variables is to do "cylindrical algebraic decomposition" or CAD, which has a large literature going back to (at least) 1975. see http://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=1350&context=cstech&sei-redir=1#search=%22cylindrical%20algebraic%20decomposition%20introduction%22 If your problem cannot be reduced to a set of polynomials, this doesn't help. So far as I know, CAD has not been implemented for Maxima, and it may be worthwhile to do so. I believe that in Mathematica it was first implemented in version 5; Mathematica is now on version 8. A more general Mathematica command is Reduce. Quoting from the (version 7) manual.. "For polynomial equations or inequalities over the reals, the structure of the result returned by Reduce is typically a cylindrical algebraic decomposition or CAD. Sometimes Reduce can yield a simpler form. But in all cases you can get the complete CAD by using CylindricalDecomposition. " It would be a substantially interesting problem to implement a program similar to Reduce, and probably a cutting-edge research project to get it to work beyond polynomials. (As, I think, Mathematica now has, to some extent.) Oh, CAD computations are relatively time-consuming, but computers are fast :) RJF From willisb at unk.edu Sun Jul 10 12:51:18 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 10 Jul 2011 12:51:18 -0500 Subject: [Maxima] inequalities, intervals, Cylindrical Decomposition, CAD, was Re: problems In-Reply-To: <4E19CE1A.2080300@eecs.berkeley.edu> References: <4e18a141d76197.72691650@wp.pl> , <1310256838.4343.12.camel@dell-laptop> , <1310300801.1739.15.camel@dieter> <1310307404.1739.28.camel@dieter>, <4E19B675.3040607@eecs.berkeley.edu> , <4E19CE1A.2080300@eecs.berkeley.edu> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >A?more?general?solution?for?a?function?p?and??conditions?c1,?c2,?that? >are?all?polynomials?equalities >(maybe?inequalities?too)?...??polynomials?in?n?variables?is?to?do >"cylindrical?algebraic?decomposition"??or?CAD,?which?has?a?large >literature?going?back?to?(at?least)? As I understand it, CAD applied to linear functions and conditions is equivalent to Fourier elimination. And that we have: (%i3) load(fourier_elim)$ (%i4) fourier_elim([8 < x + y, x + y < 17, -1 < x - y, x-y < 42],[x,y]); (%o4) [max(8-y,y-1) References: <4e18a141d76197.72691650@wp.pl> <1310256838.4343.12.camel@dell-laptop> <1310300801.1739.15.camel@dieter> <1310307404.1739.28.camel@dieter> <4E19B675.3040607@eecs.berkeley.edu> <4E19CE1A.2080300@eecs.berkeley.edu> Message-ID: Real closed fields, CAD, etc., while solveable, are known to be extremely computationally intensive, in general. Even the simpler theory of rational order and addition (something I worked on back in 1973-ish) -- roughly what fourier/simplex/etc. do -- is nearly as complex. I believe that Jeanne Ferrante & Rackoff wrote the 1975 paper on the complexity of this theory. http://cseweb.ucsd.edu/~ferrante/ Computers have gotten faster, so larger problems have become solveable, but single & double exponentials remain very constraining. Just like integer factoring is usually turned off due to complexity issues, some of these more powerful methods -- even if implemented -- will usually be turned off by default due to long running times. At 09:06 AM 7/10/2011, Richard Fateman wrote: >On 7/10/2011 8:19 AM, Barton Willis wrote: >>-----maxima-bounces at math.utexas.edu wrote: ----- >> >>>Without thinking about this too much, it seems that there is a possibility of using a >>>(relatively strong) interval arithmetic package to do what sign is supposed to do, >>Correct me if I'm mistaken, but doing things such as x+y<2 and x-y>5 >>implies y<-3/2 isn't something that interval arithmetic, as generally >>described, can handle. > >You are correct. > >> The sign code needs to be able to do things like this. > >Would it be plausible to have a special "sign of a function of one real variable on a real interval" routine? > >> Also to be useful for sign, intervals need to be open / >>closed--that might be tedious, but not terribly difficult. > >Yes. > >>One obstacle is that setting the rounding mode isn't required by >>CL. For double floats, that makes it difficult to do 100% >>correct interval arithmetic for all Lisp versions. > >Oh, there are many issues that prevent intervals from being "tight". > >A more general solution for a function p and conditions c1, c2, that are all polynomials equalities >(maybe inequalities too) ... polynomials in n variables is to do >"cylindrical algebraic decomposition" or CAD, which has a large >literature going back to (at least) 1975. see >http://docs.lib.purdue.edu/cgi/viewcontent.cgi?article=1350&context=cstech&sei-redir=1#search=%22cylindrical%20algebraic%20decomposition%20introduction%22 > >If your problem cannot be reduced to a set of polynomials, this doesn't help. > >So far as I know, CAD has not been implemented for Maxima, and it may >be worthwhile to do so. I believe that in Mathematica it was first implemented in >version 5; Mathematica is now on version 8. > >A more general Mathematica command is Reduce. Quoting from the (version 7) manual.. > >"For polynomial equations or inequalities over the reals, the structure of the result returned by Reduce is typically a cylindrical algebraic decomposition or CAD. Sometimes Reduce can yield a simpler form. But in all cases you can get the complete CAD by using CylindricalDecomposition." > >It would be a substantially interesting problem to implement a program similar to Reduce, >and probably a cutting-edge research project to get it to work beyond polynomials. >(As, I think, Mathematica now has, to some extent.) > >Oh, CAD computations are relatively time-consuming, but computers are fast :) > >RJF From sciwise at ihug.co.nz Sat Jul 9 01:22:23 2011 From: sciwise at ihug.co.nz (Edward Montague) Date: Sat, 09 Jul 2011 18:22:23 +1200 Subject: [Maxima] Augmented Lagranian Message-ID: <4E17F39F.7020106@ihug.co.nz> Awhile ago I was investigating the Variational Iteration Method , for the approximate symbolic solution of Non Linear Differential Equations . The solution of these requires the use of a Lagranian multiplier , lambda ; see attached pdf . I'm wondering how the Augmented Lagranian , found in Maxima , might be used in this setting . -------------- next part -------------- A non-text attachment was scrubbed... Name: jafariAMS9-12-2008.pdf Type: application/pdf Size: 132944 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: AU1U2m.mac URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Au012e.bmp Type: image/bmp Size: 921654 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: alang1.mac URL: From sciwise at ihug.co.nz Sun Jul 10 22:06:57 2011 From: sciwise at ihug.co.nz (Edward Montague) Date: Mon, 11 Jul 2011 15:06:57 +1200 Subject: [Maxima] augmented_lagranian Message-ID: <4E1A68D1.4070308@ihug.co.nz> Awhile ago I was investigating the Variational Iteration Method. To be effective , as a computer program , the lambda multiplier needs to be determined through the appropriate code . I'm wondering if the augmented_lagranian_method , available through Maxima might be suitable . I've included some of my first code for the VIM and reference to the appropriate paper . -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: AU1U2m.mac URL: From bernard at marcade.biz Mon Jul 11 06:58:55 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Mon, 11 Jul 2011 12:58:55 +0100 Subject: [Maxima] matchdeclare and defrule not working as in documentation. Message-ID: <1310385535.9829.9.camel@dell-laptop> Hi all, In the documentation for matchdeclare we read: When matching arguments of + and *, if all match predicates are mutually exclusive, the match result is insensitive to ordering, as one match predicate cannot accept terms matched by another. (%i1) matchdeclare (aa, atom, bb, lambda ([x], not atom(x))); (%o1) done (%i2) defrule (r1, aa + bb, ["all atoms" = aa, "all nonatoms" = bb]); bb + aa partitions `sum' (%o2) r1 : bb + aa -> [all atoms = aa, all nonatoms = bb] (%i3) r1 (8 + a*b + %pi + sin(x) - c + 2^n); n (%o3) [all atoms = %pi + 8, all nonatoms = sin(x) + 2 - c + a b] (%i4) defrule (r2, aa * bb, ["all atoms" = aa, "all nonatoms" = bb]); bb aa partitions `product' (%o4) r2 : aa bb -> [all atoms = aa, all nonatoms = bb] (%i5) r2 (8 * (a + b) * %pi * sin(x) / c * 2^n); n (b + a) 2 sin(x) (%o5) [all atoms = 8 %pi, all nonatoms = -----------------] c However when I try this I get: n + 1 (b + a) 2 sin(x) (%o5) [all atoms = %pi, all nonatoms = ---------------------] c The output indicated in the documentation is what I would expect and presumably it is what happened at one time. The problem seems to be with defrule as atom(8) and atom(2^n) evaluate as "true" and "false" respectively. regards Bernard From willisb at unk.edu Mon Jul 11 09:26:30 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 11 Jul 2011 09:26:30 -0500 Subject: [Maxima] build problem: file_search_lisp / file_search_maxima In-Reply-To: References: <201107050912.50939.t.albrecht@hzdr.de> <201107051136.54045.t.albrecht@hzdr.de> Message-ID: maxima-bounces at math.utexas.edu wrote on 07/08/2011 03:48:43 PM: > Did you run configure? Thanks -- manually running configure fixed the problem. -Barton From maxima at etherjones.us Mon Jul 11 12:37:06 2011 From: maxima at etherjones.us (Ether Jones) Date: Mon, 11 Jul 2011 10:37:06 -0700 (PDT) Subject: [Maxima] QR & SVD In-Reply-To: Message-ID: <1310405826.86892.YahooMailClassic@web161807.mail.bf1.yahoo.com> Thanks. dgesvd is what I was looking for, for SVD. But dgeev only works on a square matrix. dgeqrf (from LAPACK) does a QR factorization on an MxN real matrix, but there's no interface to it in Maxima :-( --- On Fri, 7/8/11, Robert Dodier wrote: From: Robert Dodier Subject: Re: [Maxima] QR & SVD To: maxima at etherjones.us Cc: maxima at math.utexas.edu Date: Friday, July 8, 2011, 5:36 PM On 7/8/11, Ether Jones wrote: > > Does Maxima have QR and/or SVD factorizations built in?? I couldn't find > them. Maxima functions dgeev and dgesvd punt to functions of the same name in the lapack package. dgeev seems to apply the QR algorithm, according to comments in the Fortran source code. hth Robert Dodier -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Mon Jul 11 13:28:55 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 11 Jul 2011 13:28:55 -0500 Subject: [Maxima] appending new *.texi document to user documentation In-Reply-To: References: <201107050912.50939.t.albrecht@hzdr.de> <201107051136.54045.t.albrecht@hzdr.de> Message-ID: I placed the *.texi user documentation for my Bernstein polynomial code into /doc/info. To fully include this new documentation, what else must I do? --Barton From toy.raymond at gmail.com Mon Jul 11 13:30:40 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 11 Jul 2011 14:30:40 -0400 Subject: [Maxima] QR & SVD References: <1310405826.86892.YahooMailClassic@web161807.mail.bf1.yahoo.com> Message-ID: >>>>> "Ether" == Ether Jones writes: Ether> Thanks. dgesvd is what I was looking for, for SVD. But Ether> dgeev only works on a square matrix. dgeqrf (from LAPACK) Ether> does a QR factorization on an MxN real matrix, but there's Ether> no interface to it in Maxima :-( It shouldn't be too hard to create the interface, if you know a bit of Lisp and just cargo-cult the existing interface to dgeev and/or dgesvd. I would do it, but can't right now. Perhaps in a couple of weeks? Ray From l_butler at users.sourceforge.net Mon Jul 11 13:36:42 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Mon, 11 Jul 2011 18:36:42 +0000 Subject: [Maxima] appending new *.texi document to user documentation In-Reply-To: (message from Barton Willis on Mon, 11 Jul 2011 13:28:55 -0500) Message-ID: <1qptyaszmth.fsf@iceland.freeshell.org> Barton Willis writes: > I placed the *.texi user documentation for my Bernstein polynomial code > into /doc/info. To fully include this new documentation, > what else must I do? Add your file to the list in Makefile.am. See item 5 in README.developers-howto in the top directory. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From robert.dodier at gmail.com Mon Jul 11 15:06:53 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 11 Jul 2011 14:06:53 -0600 Subject: [Maxima] matchdeclare and defrule not working as in documentation. In-Reply-To: <1310385535.9829.9.camel@dell-laptop> References: <1310385535.9829.9.camel@dell-laptop> Message-ID: Well, I see that 8*2^n simplifies to 2^(n + 3) (dunno when that was implemented). That changes the expression so 8*%pi doesn't appear. Try changing 8 to 7 -- I think you'll get the expected result. In general matching is a little tricky because Maxima can simplify expressions before passing them to the match function. This is especially true with "*" and its friends "/" and "^". best, Robert Dodier On 7/11/11, Bernard Hurley wrote: > Hi all, > > In the documentation for matchdeclare we read: > > When matching arguments of + and *, if all match predicates are mutually > exclusive, the match result is insensitive to ordering, as one match > predicate cannot accept terms matched by another. > > (%i1) matchdeclare (aa, atom, bb, lambda ([x], not atom(x))); > (%o1) done > (%i2) defrule (r1, aa + bb, ["all atoms" = aa, "all nonatoms" = > bb]); > bb + aa partitions `sum' > (%o2) r1 : bb + aa -> [all atoms = aa, all nonatoms = bb] > (%i3) r1 (8 + a*b + %pi + sin(x) - c + 2^n); > n > (%o3) [all atoms = %pi + 8, all nonatoms = sin(x) + 2 - c + a b] > (%i4) defrule (r2, aa * bb, ["all atoms" = aa, "all nonatoms" = > bb]); > bb aa partitions `product' > (%o4) r2 : aa bb -> [all atoms = aa, all nonatoms = bb] > (%i5) r2 (8 * (a + b) * %pi * sin(x) / c * 2^n); > n > (b + a) 2 sin(x) > (%o5) [all atoms = 8 %pi, all nonatoms = -----------------] > c > > However when I try this I get: > > n + 1 > (b + a) 2 sin(x) > (%o5) [all atoms = %pi, all nonatoms = ---------------------] > c > > The output indicated in the documentation is what I would expect and > presumably it is what happened at one time. The problem seems to be with > defrule as atom(8) and atom(2^n) evaluate as "true" and "false" > respectively. > > regards > > Bernard > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From maxima at etherjones.us Mon Jul 11 15:34:53 2011 From: maxima at etherjones.us (Ether Jones) Date: Mon, 11 Jul 2011 13:34:53 -0700 (PDT) Subject: [Maxima] QR & SVD Message-ID: <1310416493.93801.YahooMailClassic@web161813.mail.bf1.yahoo.com> It shouldn't be too hard to create the interface, if you know a bit of Lisp and just cargo-cult the existing interface to dgeev and/or dgesvd. My knowledge of LISP is zero. I would do it, but can't right now.? Perhaps in a couple of weeks? That's a most generous offer, if you are so inclined. In the meantime, I've found another free interface to LAPACK which somewhat meets my needs for the time being, but the interface is awkward to use. If I had my choice, I'd much prefer Maxima. --- On Mon, 7/11/11, Raymond Toy wrote: From: Raymond Toy Subject: Re: [Maxima] QR & SVD To: maxima at math.utexas.edu Date: Monday, July 11, 2011, 2:30 PM >>>>> "Ether" == Ether Jones writes: ? ? Ether>? Thanks.? dgesvd is what I was looking for, for SVD.? But ? ? Ether>? dgeev only works on a square matrix.? dgeqrf (from LAPACK) ? ? Ether>? does a QR factorization on an MxN real matrix, but there's ? ? Ether>? no interface to it in Maxima :-( It shouldn't be too hard to create the interface, if you know a bit of Lisp and just cargo-cult the existing interface to dgeev and/or dgesvd.? I would do it, but can't right now.? Perhaps in a couple of weeks? 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 drdieterkaiser at web.de Mon Jul 11 15:52:40 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 11 Jul 2011 22:52:40 +0200 Subject: [Maxima] matchdeclare and defrule not working as in documentation. In-Reply-To: References: <1310385535.9829.9.camel@dell-laptop> Message-ID: <1310417560.1733.22.camel@dieter> Am Montag, den 11.07.2011, 14:06 -0600 schrieb Robert Dodier: > Well, I see that 8*2^n simplifies to 2^(n + 3) (dunno when that > was implemented). That changes the expression so 8*%pi doesn't > appear. Try changing 8 to 7 -- > I think you'll get the > expected result. For the record: This type of simplification is present since Maxima 5.10 (September 2006). Maxima version: 5.10.0 Maxima build date: 21:56 3/14/2011 host type: i686-pc-linux-gnu lisp-implementation-type: SBCL lisp-implementation-version: 1.0.45 (%i2) 8*2^n; (%o2) 2^(n+3) In the next release we will get more simplifications of expressions like 2^(n+3)+2*2^(n+3), which do not fully simplify in Maxima 5.24: Maxima version: 5.24.0 Maxima build date: 22:5 4/26/2011 Host type: i686-pc-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.45 (%i2) 2^(n+3)+2*2^(n+3); (%o2) 2^(n+4)+2^(n+3) But in Maxima 5.24post we will have Maxima version: 5.24post Maxima build date: 21:18 7/11/2011 Host type: i686-pc-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.45 (%i2) 2^(n+3)+2*2^(n+3); (%o2) 3*2^(n+3) Dieter Kaiser From robert.dodier at gmail.com Mon Jul 11 17:18:07 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 11 Jul 2011 16:18:07 -0600 Subject: [Maxima] matchdeclare and defrule not working as in documentation. In-Reply-To: <1310417560.1733.22.camel@dieter> References: <1310385535.9829.9.camel@dell-laptop> <1310417560.1733.22.camel@dieter> Message-ID: Just to be clear, I don't see any problem with such simplifications. best, Robert Dodier On 7/11/11, Dieter Kaiser wrote: > Am Montag, den 11.07.2011, 14:06 -0600 schrieb Robert Dodier: >> Well, I see that 8*2^n simplifies to 2^(n + 3) (dunno when that >> was implemented). That changes the expression so 8*%pi doesn't >> appear. Try changing 8 to 7 -- >> I think you'll get the >> expected result. > > For the record: This type of simplification is present since Maxima 5.10 > (September 2006). > > Maxima version: 5.10.0 > Maxima build date: 21:56 3/14/2011 > host type: i686-pc-linux-gnu > lisp-implementation-type: SBCL > lisp-implementation-version: 1.0.45 > > (%i2) 8*2^n; > (%o2) 2^(n+3) > > In the next release we will get more simplifications of expressions like > 2^(n+3)+2*2^(n+3), which do not fully simplify in Maxima 5.24: > > Maxima version: 5.24.0 > Maxima build date: 22:5 4/26/2011 > Host type: i686-pc-linux-gnu > Lisp implementation type: SBCL > Lisp implementation version: 1.0.45 > > (%i2) 2^(n+3)+2*2^(n+3); > (%o2) 2^(n+4)+2^(n+3) > > But in Maxima 5.24post we will have > > Maxima version: 5.24post > Maxima build date: 21:18 7/11/2011 > Host type: i686-pc-linux-gnu > Lisp implementation type: SBCL > Lisp implementation version: 1.0.45 > > (%i2) 2^(n+3)+2*2^(n+3); > (%o2) 3*2^(n+3) > > Dieter Kaiser > > > From villate at fe.up.pt Tue Jul 12 05:07:24 2011 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 12 Jul 2011 11:07:24 +0100 Subject: [Maxima] appending new *.texi document to user documentation In-Reply-To: <1qptyaszmth.fsf@iceland.freeshell.org> References: <1qptyaszmth.fsf@iceland.freeshell.org> Message-ID: <1310465244.2131.14.camel@wigner> On Mon, 2011-07-11 at 18:36 +0000, Leo Butler wrote: > Barton Willis writes: > > > I placed the *.texi user documentation for my Bernstein polynomial code > > into /doc/info. To fully include this new documentation, > > what else must I do? > > Add your file to the list in Makefile.am. > > See item 5 in README.developers-howto in the top directory. Hi, I've noticed that section 5.2 in README.developers-howto is outdated regarding the documentation; it is no longer necessary to build maxima.texi by hand, as suggested in share/template.texi A more up-to-date recommendation would be: -- Move my_package.texi to maxima/doc/info Put my_package.texi on the list of files in maxima/doc/info/Makefile.am Add a line for my_package in the section "Additional packages" in file maxima/doc/info/include-maxima.texi.in The line should have the following syntax: * my_package:: Brief description of my package. Notice that the additional packages are currently added in alphabetical order. I hope this helps and once I start experimenting with git I will update README.developers-howto and share/template.texi if nobody does it before. Cheers, Jaime From willisb at unk.edu Tue Jul 12 15:18:09 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 12 Jul 2011 15:18:09 -0500 Subject: [Maxima] appending new *.texi document to user documentation In-Reply-To: <1310465244.2131.14.camel@wigner> References: <1qptyaszmth.fsf@iceland.freeshell.org> <1310465244.2131.14.camel@wigner> Message-ID: Thanks to Jaime & Leo, the user documentation for Bernstein works. Likely I missed something in the directions, but I also needed to insert @node Bernstein, bode, augmented_lagrangian, Top @chapter Bernstein @include bernstein.texi into include-maxima.texi.in Should anybody have comments about naming or anything else, let me know. Short demo: (%i9) bernstein_poly(5,8,x); (%o9) 56*(1-x)^3*x^5 (%i10) bernstein_poly(k,n,x); (%o10) bernstein_poly(k,n,x) (%i11) %, bernstein_explicit : true; (%o11) binomial(n,k)*(1-x)^(n-k)*x^k (%i12) multibernstein_poly([2,3],[4,5],[x,y]); (%o12) 60*(1-x)^2*x^2*(1-y)^2*y^3 Approximate a function as a linear combination of Bernstein polynomials (works for multivariable case too) (%i14) bernstein_approx(f(x),[x], 2); (%o14) f(1)*x^2+2*f(1/2)*(1-x)*x+f(0)*(1-x)^2 Express a multivariable polynomial exactly as a linear combination of Bernstein polynomials (%i16) bernstein_expand(x*y+1,[x,y]); (%o16) 2*x*y+(1-x)*y+x*(1-y)+(1-x)*(1-y) Check: (%i17) expand(%); (%o17) x*y+1 --Barton From michele.dallarno at gmail.com Wed Jul 13 08:34:17 2011 From: michele.dallarno at gmail.com (Michele Dall'Arno) Date: Wed, 13 Jul 2011 15:34:17 +0200 Subject: [Maxima] Declare matrix with real elements Message-ID: Dear all, in my Maxima code I need a matrix M of real parameters: declare(M, nonscalar); done Then I use such real parameters, for example: x : conjugate(M[1,1]); conjugate(M[1,1]) How can I tell Maxima that all the elements of M are real, such that conjugate(M[i,j]) = M[i,j] for any i,j? Thank you in advance, Michele From willisb at unk.edu Wed Jul 13 09:33:16 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 13 Jul 2011 09:33:16 -0500 Subject: [Maxima] Declare matrix with real elements In-Reply-To: References: Message-ID: Try removing declare(M,nonscalar); then (%i1) map('conjugate, [M,M[1,1], M[%i,42]]); (%o1) [M,M[1,1],M[%i,42]] I'm don't know everything that declare(M,nonscalar) does, but declaring something to be nonscalar mostly changes the way an expression involving noncommutative multiplication simplifies. The conjugate code has various checks for nonscalar atoms--maybe these checks are silly (I can say that because I wrote the conjugate code :) --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To:?maxima at math.utexas.edu >From:?"Michele?Dall'Arno"? >Sent?by:?maxima-bounces at math.utexas.edu >Date:?07/13/2011?08:34AM >Subject:?[Maxima]?Declare?matrix?with?real?elements > >Dear?all, > >in?my?Maxima?code?I?need?a?matrix?M?of?real?parameters: > >declare(M,?nonscalar); >done > >Then?I?use?such?real?parameters,?for?example: > >x?:?conjugate(M[1,1]); >conjugate(M[1,1]) > >How?can?I?tell?Maxima?that?all?the?elements?of?M?are?real,?such?that >conjugate(M[i,j])?=?M[i,j]?for?any?i,j? > >Thank?you?in?advance, > >Michele >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Wed Jul 13 13:53:15 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 13 Jul 2011 12:53:15 -0600 Subject: [Maxima] Declare matrix with real elements In-Reply-To: References: Message-ID: On 7/13/11, Michele Dall'Arno wrote: > Dear all, > > in my Maxima code I need a matrix M of real parameters: > > declare(M, nonscalar); > done > > Then I use such real parameters, for example: > > x : conjugate(M[1,1]); > conjugate(M[1,1]) > > How can I tell Maxima that all the elements of M are real, such that > conjugate(M[i,j]) = M[i,j] for any i,j? Try declare(foo, real) or (conversely) declare(foo, complex) Some parts of Maxima (not sure how pervasive it is) will infer the real/complex feature of a subscripted variable from the declaration for just the unscripted variable. I think that's useful and desirable. e.g. (declare(x, real), declare(y, complex)); [realpart(x[1]), imagpart(x[1]), conjugate(x[1])]; => [x[1],0,x[1]] [realpart(y[1]), imagpart(y[1]), conjugate(y[1])]; => ['realpart(y[1]),'imagpart(y[1]),conjugate(y[1])] HTH Robert Dodier From dlakelan at street-artists.org Wed Jul 13 13:59:53 2011 From: dlakelan at street-artists.org (dlakelan) Date: Wed, 13 Jul 2011 11:59:53 -0700 Subject: [Maxima] augmented_lagranian In-Reply-To: <4E1A68D1.4070308@ihug.co.nz> References: <4E1A68D1.4070308@ihug.co.nz> Message-ID: <4E1DEB29.6080604@street-artists.org> On 07/10/2011 08:06 PM, Edward Montague wrote: > Awhile ago I was investigating the Variational Iteration Method. > To be effective , as a computer program , the lambda multiplier > needs to be determined through the appropriate code . > > I'm wondering if the augmented_lagranian_method , available > through Maxima might be suitable . > > I've included some of my first code for the VIM and reference > to the appropriate paper . Not sure if someone already answered this, but since I don't see one on the list I'll give it a try. The Augmented Lagrangian function in Maxima is a numerical procedure for finding numerical equality-constrained extrema. In the procedure you reference I believe that there is a need for a *symbolic* answer to the lagrange multiplier. Finding a symbolic answer requires some other method. For some problems, you should be able to set up the equation that defines the lagrange multiplier and find a symbolic solution using either solve or to_poly_solve From diegogiacomolli at gmail.com Wed Jul 13 06:42:57 2011 From: diegogiacomolli at gmail.com (Diego Giacomolli) Date: Wed, 13 Jul 2011 08:42:57 -0300 Subject: [Maxima] Problems. Message-ID: This is about Maxima 5.24.0 for Windows XP. The "bf_fmin_cobyla" package is bugged. It only works correctly if I set "iprint=0". With "iprint=1" it works well but gives an error message at the end of the calculation. With "iprint=2" or "iprint=3" it gives an error message in the first step of the calculation and then stops. It apparently does not want to print big float values for the figure of merit being minimized. The Maxima output (the one that appears when I use ";" instead of "$"; the one that is independent of "iprint" values) shows the value mentioned in the above paragraph normally - if the calculation was performed with "iprint=0" so that it can end in the first place. Another problem: the command "loadprint:false" does not work. That is, loading messages are displayed when I load a package. Is there a big float version of "quad_qagi"? I really need it. Is there a big float version of "lbfgs"? I really need it. -- Diego From toy.raymond at gmail.com Wed Jul 13 22:25:00 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 13 Jul 2011 23:25:00 -0400 Subject: [Maxima] Problems. References: Message-ID: >>>>> "Diego" == Diego Giacomolli writes: Diego> This is about Maxima 5.24.0 for Windows XP. Diego> The "bf_fmin_cobyla" package is bugged. Diego> It only works correctly if I set "iprint=0". Diego> With "iprint=1" it works well but gives an error message at the end of Diego> the calculation. Diego> With "iprint=2" or "iprint=3" it gives an error message in the first Diego> step of the calculation and then stops. Diego> It apparently does not want to print big float values for the figure Diego> of merit being minimized. Could be a bug. It would certainly help a lot if you actually provided a (simple) example illustrating this. Sorry I can't read your mind. Diego> Another problem: the command "loadprint:false" does not work. That is, Diego> loading messages are displayed when I load a package. Again, an example is always helpful. I do not see any message about loading a file. I do see that load returns a value which happens to be the full name of file that is loaded, but that is different from when loadprint is true, which prints out name of the file being loaded and still returns the name of the file loaded as the value. Diego> Is there a big float version of "quad_qagi"? I really need it. No. quad_qagi uses a Fortran (translated to Lisp) routine, which only exists in a double-float version. Perhaps romberg will work (with a suitable change of variable of integration to change the infinite limit to a finite limit, which is what quad_qagi does too.) Diego> Is there a big float version of "lbfgs"? I really need it. lbfgs is also a Fortran routine that only exists in a double-float version. However, I think it might be possible to make a bigfloat version of that without too much trouble since I don't think it has any hardwired numerical contansts. (This is unlike quad_qagi which has some hardwired constants for the integration rules. These would need to be converted on the fly to the appropriate bigfloat precision.) Ray From fabrizio_caruso at hotmail.com Thu Jul 14 03:57:37 2011 From: fabrizio_caruso at hotmail.com (Fabrizio Caruso) Date: Thu, 14 Jul 2011 08:57:37 +0000 Subject: [Maxima] CAD in SARAG Message-ID: It seems someone wants to implement CAD in Maxima. I would suggest using the SARAG package as a starting point. It has been developed primarily by me but a few other people from the Univ. of Rennes I have contributed new features and improments. The Maxima package "SARAG" is a real algebraic geometry package. Among the things you find in SARAG: subresultant, Bernstein polynomials, Cauchy index, isolation of real roots, sign determination, Thom encodings, topology of curves (with nice plots), certificate of positivity for both univariate and multivariate polynomials (with nice plots). The SARAG source is included in Maxima together with a small manual that can be found in the source directory. For any help please do not esitate to contact me. Fabrizio -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Thu Jul 14 09:40:31 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 14 Jul 2011 09:40:31 -0500 Subject: [Maxima] proposal for object-oriented dispatch on sign In-Reply-To: References: <885936.92145.qm@web110109.mail.gq1.yahoo.com> <4DFE34C6.2030206@telefonica.net> <1308603739.2017.11.camel@dieter> , , Message-ID: As an experiment, I inserted a few lines into sign to look at the operators of expressions that make it to sign that do not have a sign-function. Running the testsuite and the share testsuite gives [[op, number times expression with op makes it to sign], ... ] These results were done with experimental sign functions for floor, parg, and erf. Example: sign is called 1,400 times with an expression of the form realpart(XXX), and etc. [[qty,1610],[imagpart,1424],[realpart,1400],[f,828],[conjugate,656],[cos,568],[sin,550],[gamma_incomplete,200],[ tan,98],[mlist,92],[log,69],[atan,68],[atan2,54],[sec,44],[cosh,43],[gv,33],["!",33],[tanh,33],[matrix,31],[airy_dai,30],[ airy_bi,30],[airy_ai,24],[airy_dbi,24],[sum,22],[U,19],[bit_not,18],[sinh,16],[".",14],[bessel_y,12],[bessel_k,12],[asin,12],[ acos,12],[diff,12],[cot,8],[expintegral_si,8],[u,7],[mnotequal,6],["'",6],[gamma,6],[g,6],[asinh,6],[z,6],[set,5],[acosh,5],[f,5], [mncexpt,4],[expintegral_ei,4],[`,4],[y,4],[elliptic_kc,3],[unit_step,2],[sech,2],[coth,2],[atanh,2],[acsch,2],[zeta,2],[binomial, 1],[hypergeometric,1],[foo,1],[inverse_jacobi_sn,1]] If you want to experiment, try writing a sign function for one of these functions--I'd guess that giving a sign function on either imagart, realpart, or conjugate might be a quick way to an infinite loop :( As an example of a sign function, look at sign-mabs. But I don't know what the special variables minus, evens, and odds control:( I'd need to understand that better before I would append more sign functions. --Barton From willisb at unk.edu Thu Jul 14 11:09:48 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 14 Jul 2011 11:09:48 -0500 Subject: [Maxima] CAD in SARAG In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Among?the?things?you?find?in?SARAG: >subresultant,?Bernstein?polynomials, I didn't grep for bernstein before I wrote my (modest) bernstein package, but maybe I'll go ahead an commit my share/contrib code as is. My package uses bernstein_poly you used bernstein, so maybe the two packages can co-exist. Also for numerical evaluation, my code might have an advantage with complex arguments: (%i9) bernstein(5,3,0,1, 1/2+%i); (%o9) 10*(1/2-%i)^2*(%i+1/2)^3 (%i10) rectform(%); (%o10) (125*%i)/8+125/16 (%i11) bernstein_poly(3,5,1/2+%i); (%o11) (125*%i)/8+125/16 Notice the reversed order for the first two arguments. This is unfortunate. Is there a standard? Barton From willisb at unk.edu Thu Jul 14 12:02:34 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 14 Jul 2011 12:02:34 -0500 Subject: [Maxima] CAD in SARAG In-Reply-To: References: , Message-ID: ...I just noticed: (%i32) bernstein(1179,59,0,1, 1/2+%i)$ Evaluation took 0.0000 seconds (0.0000 elapsed) Not an explicit rational complex number: (%i33) rectform(%); Evaluation took 0.0000 seconds (0.0000 elapsed) (%o33) 273110916327905886808224906004[41 digits]271128615690896387310536974100*%i*((877452417124487492040256716272[352 digits]927837046794593334197998046875*sin(1120*atan(2)))/821041081256186991599434742739[295 digits]902799704226929872471576281088+(334680111304174800755995613190[352 digits]439800455234944820404052734375*cos(1120*atan(2)))/410520540628093495799717371369[295 digits]451399852113464936235788140544)+273110916327905886808224906004[41 digits]271128615690896387310536974100*((334680111304174800755995613190[352 digits]439800455234944820404052734375*sin(1120*atan(2)))/410520540628093495799717371369[295 digits]451399852113464936235788140544-(877452417124487492040256716272[352 digits]927837046794593334197998046875*cos(1120*atan(2)))/821041081256186991599434742739[295 digits]902799704226929872471576281088) The trigrat function is spendy: (%i34) trigexpand(%); Evaluation took 4.2180 seconds (4.2510 elapsed) (%o34) (100807440270028896619752463716[452 digits]152055840007960796356201171875*%i)/102630135157023373949929342842[295 digits]612849963028366234058947035136+726050027327422517799926964124[452 digits]051392094232141971588134765625/205260270314046747899858685684[295 digits]225699926056732468117894070272 --Barton From ogilvie at cecm.sfu.ca Thu Jul 14 12:14:38 2011 From: ogilvie at cecm.sfu.ca (John Ogilvie) Date: Thu, 14 Jul 2011 10:14:38 -0700 (PDT) Subject: [Maxima] report on solution of integral equations Message-ID: Does anybody have a copy of a report by David R. Stoutemyer of title "Analytical solution of integral equations using computer algebra" issued as Computer Physics Reports No. 34, University of Utah, Salt Lake City, Utah USA, 1975? I should be grateful for a copy of this report. John Ogilvie From fateman at eecs.berkeley.edu Thu Jul 14 13:03:39 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 14 Jul 2011 11:03:39 -0700 Subject: [Maxima] CAD in SARAG In-Reply-To: References: Message-ID: <4E1F2F7B.4040807@eecs.berkeley.edu> On 7/14/2011 9:09 AM, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > >> Among the things you find in SARAG: >> subresultant, Bernstein polynomials, > I didn't grep for bernstein before I wrote my (modest) bernstein package, > but maybe I'll go ahead an commit my share/contrib code as is. My package > uses bernstein_poly you used bernstein, so maybe the two packages can > co-exist. > > Also for numerical evaluation, my code might have an advantage with complex arguments: > > (%i9) bernstein(5,3,0,1, 1/2+%i); > (%o9) 10*(1/2-%i)^2*(%i+1/2)^3 > > (%i10) rectform(%); > (%o10) (125*%i)/8+125/16 > > (%i11) bernstein_poly(3,5,1/2+%i); > (%o11) (125*%i)/8+125/16 > > Notice the reversed order for the first two arguments. This is unfortunate. Is there > a standard? > > Barton > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima I was going to suggest NIST's DLMF e.g. http://dlmf.nist.gov/18.31 for standardization. But maybe this is no help since it only seems to have one subscript there. I hate to quote wikipedia as an authority, but there is it.. http://en.wikipedia.org/wiki/Bernstein_polynomial From willisb at unk.edu Thu Jul 14 13:12:19 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 14 Jul 2011 13:12:19 -0500 Subject: [Maxima] CAD in SARAG In-Reply-To: <4E1F2F7B.4040807@eecs.berkeley.edu> References: <4E1F2F7B.4040807@eecs.berkeley.edu> Message-ID: The polynomials in described in http://dlmf.nist.gov/18.31 are different from my Bernstein polynomials. The wikipedia article lists the subsripts in the same order that I listed the arguments. Does anybody know of a good reference text? --Barton Richard Fateman wrote on 07/14/2011 01:03:39 PM: > > Notice the reversed order for the first two arguments. This is > unfortunate. Is there > > a standard? > > > > Barton > > > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > I was going to suggest NIST's DLMF e.g. > http://dlmf.nist.gov/18.31 > > for standardization. But maybe this is no help since it only seems to > have one subscript there. > > I hate to quote wikipedia as an authority, but there is it.. > http://en.wikipedia.org/wiki/Bernstein_polynomial > From rswarbrick at gmail.com Thu Jul 14 14:11:19 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Thu, 14 Jul 2011 20:11:19 +0100 Subject: [Maxima] Linux Journal writeup Message-ID: For those who haven't seen this, there's a writeup (very light on maths, it seems) of Maxima in Linux Journal. http://www.linuxjournal.com/content/maximum-calculus-maxima Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From toy.raymond at gmail.com Thu Jul 14 14:27:59 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 14 Jul 2011 15:27:59 -0400 Subject: [Maxima] Linux Journal writeup In-Reply-To: References: Message-ID: <4E1F433F.1090506@gmail.com> On 7/14/11 3:11 PM, Rupert Swarbrick wrote: > For those who haven't seen this, there's a writeup (very light on maths, > it seems) of Maxima in Linux Journal. > > http://www.linuxjournal.com/content/maximum-calculus-maxima > > Thanks for the link. I had not seen this. It's unfortunate that it doesn't provide any links to maxima's online documentation. (Maybe the links are in the Feb article?) I especially like the comment about Sage using Python, "a real programming language". As if any of the other programming languages are less real than Python. Ray -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 259 bytes Desc: OpenPGP digital signature URL: From toy.raymond at gmail.com Thu Jul 14 14:30:04 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 14 Jul 2011 15:30:04 -0400 Subject: [Maxima] CAD in SARAG In-Reply-To: References: <4E1F2F7B.4040807@eecs.berkeley.edu> Message-ID: <4E1F43BC.9000901@gmail.com> On 7/14/11 2:12 PM, Barton Willis wrote: > The polynomials in described in http://dlmf.nist.gov/18.31 are different > from my Bernstein polynomials. > The wikipedia article lists the subsripts in the same order that I listed > the arguments. > > Does anybody know of a good reference text? > Don't have a reference, but for these things, I usually go to Wolfram and Math World: http://mathworld.wolfram.com/BernsteinPolynomial.html There are some references there, including, I think, Bernstein's original 1912 paper. Ray From rswarbrick at gmail.com Thu Jul 14 14:59:20 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Thu, 14 Jul 2011 20:59:20 +0100 Subject: [Maxima] Linux Journal writeup References: <4E1F433F.1090506@gmail.com> Message-ID: Raymond Toy writes: > I especially like the comment about Sage using Python, "a real > programming language". As if any of the other programming languages are > less real than Python. Well, in the author's defence, I wouldn't want to try to engineer a large application with Maxima's scoping rules. That said, there's this other language kicking about. 'Lisp', I think it was called... 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 Thu Jul 14 15:35:40 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 14 Jul 2011 13:35:40 -0700 Subject: [Maxima] Linux Journal writeup In-Reply-To: References: <4E1F433F.1090506@gmail.com> Message-ID: <4E1F531C.8050202@eecs.berkeley.edu> On 7/14/2011 12:59 PM, Rupert Swarbrick wrote: > Raymond Toy writes: >> I especially like the comment about Sage using Python, "a real >> programming language". As if any of the other programming languages are >> less real than Python. > Well, in the author's defence, I wouldn't want to try to engineer a > large application with Maxima's scoping rules. That said, there's this > other language kicking about. 'Lisp', I think it was called... > > Rupert > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Well, we haven't discussed Sage here for a while.. But there are some nasty comments about Sage collecting after the Linux journal on Maxima. I didn't know there were malcontents who based their criticisms of Sage on the way it was packaged for Linux, but there you go. A problem with Sage is that its usual proponents are advocates of a single-world-view (via python), a view which is based on their not knowing much about any other world view. Like naturally, if you find a bug in Maxima, why not rewrite the system in Python? It is amusing to see their blurbs claiming they want to be a viable alternative to Maple, Mathematica ... and then realize that the way they do that is to call Maxima. (Of course they could also call some other programs; I suspect that if anyone cared, those other programs could be called from Maxima.) RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Thu Jul 14 16:45:54 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 14 Jul 2011 17:45:54 -0400 Subject: [Maxima] report on solution of integral equations References: Message-ID: >>>>> "John" == John Ogilvie writes: John> Does anybody have a copy of a report by David R. Stoutemyer of title John> "Analytical solution of integral equations using computer algebra" John> issued as Computer Physics Reports No. 34, University of Utah, Salt Lake John> City, Utah USA, 1975? John> I should be grateful for a copy of this report. John> John Ogilvie Isn't this usually solved by visiting your local university library? Or, at worst, interlibrary loan? Sorry, I don't have this report. Ray From hbaker1 at pipeline.com Thu Jul 14 17:03:24 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Thu, 14 Jul 2011 15:03:24 -0700 Subject: [Maxima] report on solution of integral equations In-Reply-To: References: Message-ID: Some Russian OCR'ed the article on the web. It's pretty trashed, but you might get something out of the text. http://booklists.narod.ru/_Papers/Computer_algebra/Stoutemeyer._Solving_integral_equations_in_CAS_T__19s_.1.htm At 02:45 PM 7/14/2011, Raymond Toy wrote: >>>>>> "John" == John Ogilvie writes: > John> Does anybody have a copy of a report by David R. Stoutemyer of title > John> "Analytical solution of integral equations using computer algebra" > John> issued as Computer Physics Reports No. 34, University of Utah, Salt Lake > John> City, Utah USA, 1975? > John> I should be grateful for a copy of this report. > John> John Ogilvie > >Isn't this usually solved by visiting your local university library? >Or, at worst, interlibrary loan? > >Sorry, I don't have this report. > >Ray Stoutemeyer. Solving integral equations in CAS(T)(19s) Top / Papers / Computer algebra / [1] --page0001-- Analytically Solving Integral Equations by Using Computer Algebra DAVID R. STOUTEMYER University of Hawaii This paper describes how a computer algebra language such as REDUCE can be used to automatically construct closed-form and series analytical solutions of integral equations. The integral equations may be from a large class of nonsingular scalar one-dimensional problems, including nonlinear generalizations of the classical Volterra and Fredholm equations. Given a symbolic expression for the integral equation, the program described here categorizes the equation and applies applicable symbolic techniques to construct the solution (s). If no closed-form solutions are achieved, then series solutions are automatically attempted; and if they too are unsuccessful, then approximate solutions of the collocation type are attempted. In any case, the solutions differ from numerical floating-point solutions in the following respects. A) The solution expression is a complete direct representation of the solution for all values of the independent variable over an interval rather than a direct representation of the solution at a finite number of points or an indirect representation consisting of the numerical coefficients intended for use in an expression or interpolation formula. B) The equation may have nonnumerical parameters such as symbolic integration limits, scale factors, or coefficients, with the solution being expressed in terms of these parameters. C) Any arithmetic is done exactly by using arbitrary-precision rational numbers Key Words and Phrases: integral equations, Volterra equations, Fredholm equations, REDUCE, symbolic algebraic manipulation, polyalgorithm CR Categories: 5.7, 5.15, 5.18 1. INTRODUCTION Throughout applied mathematics, closed-form analytical solutions are particularly desirable because of the insight they afford. Such solutions can provide a complete representation over the entire range of data, and, provided they are not too complicated, such solutions permit direct qualitative understanding of how the solution varies with the data. Unfortunately this kind of solution is rarely possible except for simple cases that arise only in classrooms or from drastic idealizations of real physical situations. Consequently we must often be content with a less informative numerical solution, perhaps together with a numerical sensitivity study. For many Copyright ? 1977, Association for Computing Machinery, Inc. General permission to publish, but not for profit, all or part of this material is granted provided that ACM's copyright notice is given and that reference is made to the publication, to its date of issue, and to the fact that reprinting privileges were granted by permission of the Association for Computing Machinery. This work was supported in part by the National Science Foundation under Grants GJ-32181 and MCS75-22983 and in part by the Advanced Research Projects Agency, Office of the Department of Defense under Contract DAHC 15-73-C-0363. Authors' address: Department of Electrical Engineering, University of Hawaii, Honolulu, Hawaii 96822. ACM Transactions on Mathematical Software, Vol. 3, No 2, June 1977, Pages 128-146 . --page0002-- Analytically Solving Integral Equations ? 129 areas of applied mathematics, however, computer-algebra languages permit extension of the threshold of difficulty beyond which analytical techniques must be abandoned. The solution of various kinds of equations is one of the major endeavors of applied mathematics, and general-purpose programs have already been written for solving equations in finite terms and differential equations. Examples are the programs of Yun [23], Moses [14, 15], Golden and Kuipers [7], Bogen [2], and Kulp [10]. Integral equations are probably the next most frequently encountered category in engineering and science, and computer-algebra programs have been written to solve a particular integral equation (Gentlemen [6]) and to implement one technique for solving a certain class of integral equations (the Mathlab group [11])- This paper describes a general-purpose program intended to construct form series, or projected analytical solutions to a large class of one-dimensional integral equations. The program utilizes many of the most widely applicable methods for constructing such solutions. Section 2 outlines these methods, and Section 3 presents elementary examples using the corresponding program. Section 4 summarizes test results for a variety of more challenging problems, with conclusions given in Section 5. 2. IMPLEMENTED ANALYTICAL TECHNIQUES The type of integral equation considered here is of the form Q B) I. Ja(x) ) and/or of the first kind I w[x,u,p(u)]du = f(x) C) Ja{x) that are collectively equivalent to eq. A). For example, the equation \" If fb \\ ' 1 in / p(u) du log< p(x) ? / exp [p(u)] du> ? 2 asin I p(u) du asm - / exp [p(u)]du> + 2 = ACM Transactions on Mathematical Software, Vol. 3, No 2, June 1977 . --page0003-- 130 ? D. R. Stoutemyer would be converted to the pair of independent integral equations I p(u) du = sin (?;), D) J?x p(x) = / exp [p(u)] du + e. E) SOLVE, described by Stoutemyer [18], recursively uses factorization, together with known inverses of various polynomial, algebraic, and transcendental functions, to solve a nonlinear equation in finite terms. SOLVE is also capable of symbolically solving simultaneous algebraic equations provided they are linear or linear fractional in the unknowns. Most of the solution techniques require a specialized form of eqs. B) or C), such as the second kind p(x)=y F) I J?fa) J or quasi-linear second kind p(x) = J w[x,u,p(u)]du+f(x) G) or a linear equation, for which w in eq. C) or G) is the form k(x, u)p{u). Also, some techniques are applicable only for fixed limits, where the limits of integration are free of x, and others are applicable only for variable limits, where one or both limits of integration depend on x. Usually at most one limit is variable, and it is simply a; or ? x; but it is easier to program the general case than to transform the usual cases to one standard form and check for violations. The integral-equation solver automatically checks the necessary consistency condition for variable-limit equations of the first kind /(?) =0, Yx b(f) = a(x). (8) For each of the (consistent) independent simplified equations, the program successively attempts appropriate techniques until one succeeds or none remain. Depending upon the particular form of the simplified integral equation, the techniques are attempted in approximately the order that they are discussed below. Partial successes, such as a closed-form solution containing an unevaluated integral or a series solution with less than the requested number of terms, are retained too, but without terminating the search. The user also has the option of specifying that all appropriate techniques be attempted regardless of any successes, or specifying that only a particular technique be attempted. Originally intended as debugging tools, these options increase the flexibility of the program by facilitating survey and comparison of the techniques, followed perhaps by a concentrated effort on the most promising technique(s)?one(s) which otherwise might have been preempted by a previous success or by exhaustion of the available storage while a previous technique was being attempted. Table I summarizes the individual techniques described herein. ACM Transactions on Mathematical Software, Vol 3, No 2, June 1OT. . --page0004-- Analytically Solving Integral Equations * 131 Table I. Summary of Implemented Techniques Method Fixed-limit finite-rank 2nd kind Variable-limit rank-1 2nd kind Variable-limit rank-1 1st kind Laplace transform Fourier transform Differentiation Fredholm-Carleman series Taylor series Neumann series 1st kind series Collocation Selector FINITERANK FINITERANK FINITERANK TRANSFORM TRANSFORM ? FREDSERIES TAYLOR NEUMANN FIRSTICINDSERIES COLLOCATE Equation factor convertible to the form: p(x) = y{x,\\ I q.(x)r {u,p(u)\"\\du} J jml 3 0 b(x)* p(x) = f(x) + j q(x)R(u)p(u)du aix) bix)* f q(x)r[u,p(u)]du = fix) a(x) X [0 or p(x)] = f(x) + \\K(x-u)p(u)du 0 oo [0 or p(x)J = f(x) + \\K(x-u)p(u)du ?-co b(x)* [ [ , , = fix) aix) bix) pix) =f(x) + K(x,u)p(u)du aix) bix)* pCx) =fix) + j U{x,u,p(u)]du aix) pix) = { , [ ( )] , bix) | U[x,u,pt$iu,x))*ldu} aix) bix) \\w{x,u,p[$(u,x)]f}du = fix) aix) either of the above two forms * Either aix) ' = 0 and bix) =x or bix) ' = 0 and aix) = x, f There may be any number of such arguments, each with a distinct a or B, including the usual degenerate cases a(x)=x, Biu,x)=u. ACM Transactions on Mathematical Software, Vol. 3, No. 2, June 1977. . --page0005-- 132 ? D. R. Stoutemyer 2.1. Fixed-Limit Finite-Rank Equations An integrand in F) of the form ?^ , (?I (9) 3-1 is called finite-rank, degenerate, or separable. For fixed limits substitute eq. (9) into eq. F), then interchange the order of summation and integration to give p(x) = .}^)], A0) where the unknown constants c, are given by fb c, = / r,[u, p(u)] du, j = 1, 2, . . ., n. A1) \"a Substituting for x and i for j in eq. A0) gives !>.?.(?)]. A2) Substituting eq. A2) into eq. A1) gives c3 = I rAu, \\u, ^ . ( ) \\>du, j=l,2,...,n, A3) which is a set of n simultaneous equations in finite terms for C\\ through cn . After these equations have been solved by using symbolic integration and the SOLVE function, substitution of ci through cn into eq. A0) gives the exact closed-form solution. As mentioned before, SOLVE is currently limited to linear or fractional equations for n > 1, but there are plans to incorporate Yun's algorithm for simultaneous polynomial equations [23]. (Davis [4] and Squire [21, pp. 233], solve some nonlinear finite-rank examples by hand.) Meanwhile, the equation solver prints eq. A0) together with eq. A3) when SOLVE cannot solve eq. A3), permitting the user to proceed numerically with a problem that is usually easier than a direct numerical treatment of the original integral equation. The integral-equation solver is written in the REDUCE computer-algebra language, which does not currently have a built-in integrator. Consequently the symbolic integrations are performed by a simple REDUCE program described by Stoutemyer [19]. By using factorization and collection of terms together with substitutions such aslog[a(a:)|fl(u)]?>loga(x) + log/?(w), sin [a(x) + @(u)] ?> sin [a(x)] cos \\0(u)] + sin \\j3(u)} cos [a(x)}, and c[aM+Mu)} -? calx)c0w, the program attempts to minimize n and to achieve the form of eq. (9) even when w is not originally expressed that way. 2.2 Rank-1 Second-Kind Variable-Limit Equations As developed by Cochran [3], the general closed-form solution to the linear rank-1 variable-limit equation of the second kind, with w = q(x)R(u)p(u), is ACM Transactions on Mathematical Software, Vol 3, No 2, June 1977 . --page0006-- Analytically Solving Integral Equations ? 133 p(x) = f(x) + q(x) [ U> f{u)R{u) exp \\f q(v)R(v) dv~\\du, A4) provided either b(x) ? x and d{x) = 0 or a(x) = a; and b'{x) = 0, as is usual. 2.3 Rank-1 First-Kind Variable-Limit Equations For a rank-1 variable-limit equation of the first kind, assume sufficient differentiability and q(x) ?? 0 for a(x) < b(x), with w = q(x)r[u, p(u)]. Then division followed by differentiation gives { ( ), p[b(x)]}b'(x) - rla(x), p[a(x)])a'(x) = U(x)/q(x)}', A5) where primes denote differentiation with respect to x. This is an equation in finite terms for p(x), provided either b(x) = a;anda'(a;) = ( ) = x&ndb (x) = 0, as is usual. 2.4 Integral Transforms Laplace and Fourier transforms provide closed-form general solutions to certain linear equations with convolution or difference type kernels, k(x, ) = { ? ), A6) which may be checked by determining if k(x, + ) is free of x. We can use the Laplace transform for variable-limit equations when the lower integration limit is 0 and the upper limit is x, and we can use the Fourier transform when the lower limit is ? oo and the upper limit is ??. Let denote the appropriate transform of and F denote the appropriate transform of/. Then the solution to the first kind of equation is the inverse transform of F/K, A7) and the solution to the second kind of equation is the inverse transform of F/(l - K). A8) REDUCE does not have built-in Laplace or Fourier transforms; so a modest transform program listed in Stoutemyer [20] has been written for testing purposes to serve until completion of a more powerful program under current development. 2.5 Differentiation Provided there is sufficient differentiability, a variable-limit equation of the first kind can be differentiated to give w{x, b(x), p[b(x)]}b'(x) - w{x, a(x), p[a(x)]]d(x) wx[x,u,p(u)]du-f(x)=O, A9) where the x subscript denotes partial differentiation with respect to x. This may be an equation of the second kind, provided either b(x) = x and a (x) = 0 or a(x) = x and b (x) = 0, as is usual. The integral-equation solver is then recursively reentered with this new equation. If eq. A9) has factors of the first kind, such as when the first two terms of A9) are identically zero, the process may be reapplied to these ACM Transactions on Mathematical Software, Vol. 3, No. 2, June 1977 . --page0007-- 134 ? D. R. Stoutemyer factors. However, the depth of recursion is limited to a user-specified value to prevent infinite looping. 2.6 Fredholm-Carlemdn Series For linear integral equations of the second kind, there are well-known recurrence relations for constructing the Fredholm series solution p. Beginning with g = G = k(x,u) andj = D = 1, successively iterate the following assignments: Mx) /?OI.X) d <- / - g(u, u) du/j, Ja(x) /?biz) g *-fix) + / G(x, u)f(u) du/D. Although the series terminates after a finite number of terms for the fixed-limit finite-rank case, the program uses the method of Section 2.1 when it can do so. 2.7 Taylor Series Noble [16] describes a Taylor-series technique that is applicable to quasi-linear variable-limit equations of the second kind, and Norman [17] uses algebraic manipulation to apply it to a particular integral equation. Let x denote a solution of a(x) = b(x) and assume p(x) can be represented in the form P(x) = /(x) + g {X T, *Y ~ b>{x) - f(x)]x=i B0) for sufficiently small | x ? x \\. A violation of this assumption, such as a singularity at x, in lp(x) ? f(x)] or one of its derivatives is generally revealed by a divide interrupt during construction of the series. The program traps these errors from this source and prints the more specific message: \"Zero-divide when constructing Taylor series. Probable cause is a singularity in the solution or one of its derivatives.\" From eq. G), lp(x) - /(*)] = 0, b(*) -f(x)]Li = {w[x, b(x), p(b(x))]b'(x) - w[x, a(x), p(a(x))]a'(*)}_s = w[x,x,f(x)][b'(x) -a'(a)]x=i, provided a(x) = b(x) = x, as is usual. The Taylor-series method, when applicable, has the advantage over the holm-Carleman and Neumann series of usiiig symbolic differentiation rather than the more difficult process of symbolic integration. 2.8 NeumaHh Series The Neumann series is applicable to equations of the quasi-second kind B). It is in fact applicable to the more general situation where one or more subexpressions ACM Transactions on Mathematical Software, Vol 3, No 2, June 1977 . --page0008-- Analytically Solving Integral Equations ? 135 of the form p[a(x)] occur in 9, where one or more subexpressions of the form p\\0(x, u)] appear in the integrand, and when there is more than one integral. This method is simply successive approximation: It begins with a guess for p that is substituted into the right side of eq. B), which is then evaluated to provide a new approximation to p. This new approximation is then substituted into the hand side, and so on. This process may of course diverge if the right-hand side of eq. B) is too sensitive to its second or third argument. Often the integrand includes a scale factor, and the series converges only for sufficiently small magnitudes of that factor. The form of successive partial sums may indicate the critical scale factor; but alone they do not constitute a proof that it is critical. The user may specify the first guess, which may influence the success of the symbolic integrations, but the default first guess is the right side of eq. B) with the integrals set to zero. Fortuitously exact results are recognized a.nd are so indicated by the program. 2.9 First-Kind Series Mikhlin and Smolitskiy [12] give a series which is sometimes successful for equations of the first kind: Beginning with an arbitrary guess p* and a coefficient X, iterate using x) - / w[x, u, f(u)]> du. B1) ?/--page0018-- Analytically Solving Integral Equations ? 145 boolean procedure RANKlSECOND(y, P_OF_X, IESOLN); begin comment Equation is variable-limit of the form P_OF_X=y. Determines if is linear. If so, uses SUMFACTORS to determine if the integrand is convertible to the form q(x)R(u)p(u). If so, uses equation 04) and appends result together with \"FINITERANK\" on IESOLN. Returns true or false according to the success of its endeavor; end RANKlSECOND; boolean procedure RANK1FIRST(F, P_OF_X, INTGRL, IESOLN); begin comment Equation is variable-limit of the form INTGRL=F, with INTGRL of the form INTEGRAL(w, u, a(x), b(x)). Uses SUMFACTORS to determine if w has the form of equation (9) with n=l. If so, SOLVE is used on equation A5), and solutions paired with \"FINITERANK\" are appended to IESOLN. Returns true or false according to the success of its endeavor; ... end RANK!FIRST; symbolic procedure SUMFACTORS (w, x, u); begin comment If w can be put in the.form of equation (9), returns a list of the form [(qi>n), D2>r2)? ???? ( > )]- Returns empty otherwise; symbolic q0, r0; w -<- FR(w, x, u); if w contains any FR(...) then return empty; Factor the denominator of w, collecting into q0 the product of all factors that are free of u, and collecting into r0 the product of all remaining factors that are free of x, If any factors remain then return empty; 4o \"~ Vqo'. r0 +? l/r0; Factor the numerator of w, collecting into qo the product of all factors that are free of u, and collecting into r0 the product of all remaining factors that are free of x; Expand the product of any remaining factors of w with the x and all functional forms of x ordered before u and all functional forms of u to get a form such as (9) with independent monomial qj expressions. Repeat for the reverse ordering to get a form such as (9) with independent monomial rj expressions, and use the second expansion if it gives a smaller value of n than the first expansion; Multiply each of the qj by q0 and multiply each of the rj by r0, then return a list of these qj r,- pairs; end SUMFACTORS; J comment pattern-matching rules for the operator FR, intended to convert some transcendental expressions into finite-rank; for all Y, Z, X, U let FR(-Y,X,U) + -FR(Y,X,U), FR(Y-Z,X,U) + FR(Y,X,U)-FR(Z,X,U), FR(Y+Z,X,U) + FR(Y,X,U)+FR(Z,X,U), FR(Y*Z,X,U) ->- FR(Y,X,U)*FR(Z,X,U), FR(Y/Z,X,U) + FR(Y,X,U)/FR(Z,X,U); if free of (arbitrary X, arbitrary R_OR_Q) or free of (arbitrary U, R_OR_Q) let FR(R_OR_Q?X,U) -, R_or_Q; if free of (arbitrary X, arbitrary R) and free of (arbitrary U, arbitrary Q) and not free of (U,R) and not free of (X,Q) let FR(SIN(.Q+R),X,U) ->- SIN(Q)*COS(R)+COS(Q)*SIN(R), FR(COS(Q+R),X,U) + COS(Q)*COS(R)-SIN(Q)*SIN(R), FR(LOG(Q/R),X,U) ?* LOG(Q)-LOG(R), FR(LOG(R/Q),X,U) ->- LOG(R)-LOG(Q), FRCLOG(Q*R),X,U) + LOGCQ)+LOG(R); boolean procedure SOLVEANDSUB (EXPRESSIONS, UNKNOWNS, FORM, TECHNIQUE, IESOLN); begin comment EXPRESSIONS is a list of one or more expressions and UNKNOWNS is a list of unknowns. TECHNIQUE is either \"FINITERANK\" or \"COLLOCATE\". FORM is an expression containing the indeterminates listed ACM Transactions on Mathematical Software, Vol. 3, No. 2, June 1977. . --page0019-- 146 ? D. R. Stoutemyer in UNKNOWNS. The equation(s) EXPRESSIONS=O are solved for UNKNOWNS. For each solution, the values of UNKNOWNS are substituted in FORM, and the result paired with TECHNIQUE is appended to IESOLN. Returns true or false according to the success of this endeavor; ... end SOLVEANDSUB; boolean procedure TRANSFORM (y_0R_F, P_QF_X, INTGRL, IESOLN). begin comment If INTGRL=O then equation is of the 2nd kind, with P_OF_X=y_OR_F. Otherwise it is of the 1st kind with INTGRL=y_OR_F, If the equation is of linear convolution type with appropriate integration limits, uses formula A7) or A8) with Laplace or Fourier transforms depending upon the kind and the integration limits. Appends any solution together with \"TRANSFORM\" onto IESOLN and returns true or false according to the success of this endeavor. ... end TRANSFORM; boolean procedure FREDSERIES (y, P_OF X, N, IESOLN); begin comment Equation is fixed-limit, of the form P_OF_X=y. N is the requested number of terms. If is nonlinear, then false is returned immediately. Otherwise, the iteration of section 2,6 is executed up to N times, or until one of the Integrals cannot be evaluated in closed form, p from the last iteration, together with \"FREDSERIES\" is appended to IESOLN. Returns true or false according to the success in achieving the requested number of iterations without unevaluated integrals; ... end FREDSERIES; boolean procedure TAYLOR Cy, P_OF X, N, IESOLN); begin comment Equation is variable-limit of the form P_OF_X=y. N is the requested number of terms. Determines if is quasi-linear. If not then false is returned immediately. Otherwise, the iteration of section 2.7 is repeated N times, or until a singularity in the solution or one of its derivatives causes a zero-divide interrupt. Appends the series together with \"TAYLOR\" onto IESOLN and returns true or false according to the success of the endeavor; ... end TAYLOR; boolean procedure FIRST_OR_NEUMANN (y_0R_F, P_0F_X, INTGRL, N, GUESS, IESOLN); begin comment If INTGRL^O then the equation is of the form rNTGRL=y_OR_F. Otherwise the equation is of the form P_OF_X=y OR_F. Accordingly either the First-kind iteration of section 2.9 or the~~Neumann iteration of section 2.8 is repeated up to times, beginning with GUESS, until an integral cannot be evaluated in closed form. Appends any solution together with appropriately \"FIRSTKINDSERIES\" or \"NEUMANN\" to IESOLN, then returns true or false according to the success of the endeavor; ... end FIRST_OR NEUMANN; boolean procedure COLLOCATE (EXPRESSION, P_OF_X, N, IESOLN); begin comment Equation is of the form EXPRESSIONS; P_OF X is of the form P(x). Substitutes APPROX(..,,N) for every instance of P(,.J in EXPRESSION, then evaluates EXPRESSIONS at POINT(a,b,l ,N), POINT,N),..., POINT(a,b,N,N) to get a set of N equations in terms of the N indeterminates in the expression returned by APPROX, If none of the N equations contains an unevaluated integral, then SOLVEANDSUB is used to solve the equations for the N indeterminates and substitute them into APPROX(X.N). Prints the corresponding equations and APPROX(X.N) if SOLVEANDSUB fails. Otherwise SOLVEANDSUB appends the solutions to IESOLN. Returns true or false according to the success of the endeavor; ... end COLLATE; symbolic procedure APPROX(X, N); comment The user may wish to replace this default definition of APPROX; symbolic procedure POINT(A, B, J, N); comment The user may wish to replace this default definition of POINT; if N=1 then (A+B)/2 else A+(B-A)*(J-l)/(n-l); ACM Transactions on Mathematical Software, Vol 3, No. 2, June 1977. From bernard at marcade.biz Thu Jul 14 17:37:29 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Thu, 14 Jul 2011 23:37:29 +0100 Subject: [Maxima] matchdeclare and defrule not working as in documentation. In-Reply-To: References: <1310385535.9829.9.camel@dell-laptop> <1310417560.1733.22.camel@dieter> Message-ID: <1310683049.5308.2.camel@dell-laptop> I too like the way simplification is going and don't see it as a problem, it's just that I wasn't expecting 8*2^n to simplify to 2^(n+3). cheers, Bernard Hurley On Mon, 2011-07-11 at 16:18 -0600, Robert Dodier wrote: > Just to be clear, I don't see any problem with such simplifications. > > best, > > Robert Dodier > > On 7/11/11, Dieter Kaiser wrote: > > Am Montag, den 11.07.2011, 14:06 -0600 schrieb Robert Dodier: > >> Well, I see that 8*2^n simplifies to 2^(n + 3) (dunno when that > >> was implemented). That changes the expression so 8*%pi doesn't > >> appear. Try changing 8 to 7 -- > >> I think you'll get the > >> expected result. > > > > For the record: This type of simplification is present since Maxima 5.10 > > (September 2006). > > > > Maxima version: 5.10.0 > > Maxima build date: 21:56 3/14/2011 > > host type: i686-pc-linux-gnu > > lisp-implementation-type: SBCL > > lisp-implementation-version: 1.0.45 > > > > (%i2) 8*2^n; > > (%o2) 2^(n+3) > > > > In the next release we will get more simplifications of expressions like > > 2^(n+3)+2*2^(n+3), which do not fully simplify in Maxima 5.24: > > > > Maxima version: 5.24.0 > > Maxima build date: 22:5 4/26/2011 > > Host type: i686-pc-linux-gnu > > Lisp implementation type: SBCL > > Lisp implementation version: 1.0.45 > > > > (%i2) 2^(n+3)+2*2^(n+3); > > (%o2) 2^(n+4)+2^(n+3) > > > > But in Maxima 5.24post we will have > > > > Maxima version: 5.24post > > Maxima build date: 21:18 7/11/2011 > > Host type: i686-pc-linux-gnu > > Lisp implementation type: SBCL > > Lisp implementation version: 1.0.45 > > > > (%i2) 2^(n+3)+2*2^(n+3); > > (%o2) 3*2^(n+3) > > > > Dieter Kaiser > > > > > > From ogilvie at cecm.sfu.ca Thu Jul 14 18:22:51 2011 From: ogilvie at cecm.sfu.ca (John Ogilvie) Date: Thu, 14 Jul 2011 16:22:51 -0700 (PDT) Subject: [Maxima] report on solution of integral equations In-Reply-To: References: Message-ID: I have tried both interlibrary loan and University of Utah, departments of computer science and physics, not to mention the author who lacks even a copy himself -- without success. Professor Stoutemyer mentioned that somebody had translated his Reduce code for operation in Maxima (or Macsyma?). For that reason I sought the assistance of this list. I shall try to extract the source mentioned by another respondent, but apparently that source is in poor condition. So if anybody has a copy of the original report, that would still be appreciated. John Ogilvie On Thu, 14 Jul 2011, Raymond Toy wrote: >>>>>> "John" == John Ogilvie writes: > > John> Does anybody have a copy of a report by David R. Stoutemyer of title > John> "Analytical solution of integral equations using computer algebra" > John> issued as Computer Physics Reports No. 34, University of Utah, Salt Lake > John> City, Utah USA, 1975? > John> I should be grateful for a copy of this report. > John> John Ogilvie > > Isn't this usually solved by visiting your local university library? > Or, at worst, interlibrary loan? > > Sorry, I don't have this report. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From ogilvie at cecm.sfu.ca Thu Jul 14 18:41:19 2011 From: ogilvie at cecm.sfu.ca (John Ogilvie) Date: Thu, 14 Jul 2011 16:41:19 -0700 (PDT) Subject: [Maxima] report on solution of integral equations In-Reply-To: References: Message-ID: The article to which the link below pertains is what was published in ACM Transactions on Mathematical Software, NOT the desired Computer Physics Report No. 34, which appears as reference 20 in that paper in ACM Transactions. So I still seek this report, which was an internal document at the University of Utah, but apparently no trace of that document can be found at University of Utah. This document was dated 1975 at University of Utah. On Thu, 14 Jul 2011, Henry Baker wrote: > Some Russian OCR'ed the article on the web. It's pretty trashed, but you might get something out of the text. > > http://booklists.narod.ru/_Papers/Computer_algebra/Stoutemeyer._ Solving_integral_equations_in_CAS_T__19s_.1.htm From fateman at eecs.berkeley.edu Thu Jul 14 19:26:37 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 14 Jul 2011 17:26:37 -0700 Subject: [Maxima] report on solution of integral equations In-Reply-To: References: Message-ID: <4E1F893D.40806@eecs.berkeley.edu> On 7/14/2011 4:22 PM, John Ogilvie wrote: > I have tried both interlibrary loan and University of Utah, departments > of computer science and physics, not to mention the author who lacks > even a copy himself -- without success. Professor Stoutemyer mentioned > that somebody had translated his Reduce code for operation in Maxima > (or Macsyma?). I think you will find this in ....maxima/ * /share/integequations. unless that is someone else's work on integral equations. From macrakis at alum.mit.edu Thu Jul 14 20:51:11 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 14 Jul 2011 21:51:11 -0400 Subject: [Maxima] Linux Journal writeup In-Reply-To: References: <4E1F433F.1090506@gmail.com> Message-ID: I certainly agree that lexical scoping is the way to go in general. But Maxima/Macsyma itself was written in a dynamically scoped Lisp.... -s On Thu, Jul 14, 2011 at 15:59, Rupert Swarbrick wrote: > Raymond Toy writes: > > I especially like the comment about Sage using Python, "a real > > programming language". As if any of the other programming languages are > > less real than Python. > > Well, in the author's defence, I wouldn't want to try to engineer a > large application with Maxima's scoping rules. That said, there's this > other language kicking about. 'Lisp', I think it was called... > > 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 robert.dodier at gmail.com Fri Jul 15 00:46:21 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 14 Jul 2011 23:46:21 -0600 Subject: [Maxima] Linux Journal writeup In-Reply-To: <4E1F433F.1090506@gmail.com> References: <4E1F433F.1090506@gmail.com> Message-ID: On 7/14/11, Raymond Toy wrote: > I especially like the comment about Sage using Python, "a real > programming language". As if any of the other programming languages are > less real than Python. Well, this is probably a reference to the front-end user language, not the implementation language. Typically math systems (symbolic and numerical alike) have a user language which is just cobbled together as an afterthought. Python has, at least, the advantage of being more nearly complete and more carefully designed. It has occurred to me that Python could be a front-end language for Maxima, but it would require some work. best, Robert Dodier From jrgrauh at yahoo.com Fri Jul 15 04:56:07 2011 From: jrgrauh at yahoo.com (Joerg Rauh) Date: Fri, 15 Jul 2011 02:56:07 -0700 (PDT) Subject: [Maxima] Problems with express() Message-ID: <1310723767.53920.YahooMailClassic@web45307.mail.sp1.yahoo.com> Hi,Going through the following steps:load("vect");? ? "C:/Programme/Maxima-5.24.0/share/maxima/5.24.0/share/vector/vect.mac"div([-y,xy,z]);? ? div([-y,xy,z])express(%);? ? ?'diff((-y),x,1)+'diff(xy,y,1)+1ev(%,diff);this is my result:1It should have been:x+1 What should I do to get it right? Any help will be appreciated.Best regards Joerg?? -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Fri Jul 15 07:14:54 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 15 Jul 2011 07:14:54 -0500 Subject: [Maxima] Problems with express() In-Reply-To: <1310723767.53920.YahooMailClassic@web45307.mail.sp1.yahoo.com> References: <1310723767.53920.YahooMailClassic@web45307.mail.sp1.yahoo.com> Message-ID: Try div([-y,x * y,z]) instead of div([-y,xy,z]). Juxtaposition isn't multiplication in Maxima. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To:?Maxima at math.utexas.edu >From:?Joerg?Rauh? >Sent?by:?maxima-bounces at math.utexas.edu >Date:?07/15/2011?04:56AM >Subject:?[Maxima]?Problems?with?express() > >Hi, >Going?through?the?following?steps: >load("vect"); >????"C:/Programme/Maxima-5.24.0/share/maxima/5.24.0/share/vector/vect.mac" >div([-y,xy,z]); >????div([-y,xy,z]) >express(%); >?????'diff((-y),x,1)+'diff(xy,y,1)+1 >ev(%,diff); >this?is?my?result: >1 >It?should?have?been: >x+1 > > >What?should?I?do?to?get?it?right? > > >Any?help?will?be?appreciated. >Best?regards > > >Joerg >?? >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at eecs.berkeley.edu Fri Jul 15 09:07:47 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 15 Jul 2011 07:07:47 -0700 Subject: [Maxima] Linux Journal writeup In-Reply-To: References: <4E1F433F.1090506@gmail.com> Message-ID: <4E2049B3.8000206@eecs.berkeley.edu> On 7/14/2011 10:46 PM, Robert Dodier wrote: > On 7/14/11, Raymond Toy wrote: > >> I especially like the comment about Sage using Python, "a real >> programming language". As if any of the other programming languages are >> less real than Python. > Well, this is probably a reference to the front-end user language, > not the implementation language. Both, I think. The idea that Python is suitable for a front end to computer algebra is hard to entirely endorse, considering that after boasting about it, they then find it unsuitable themselves without a preprocessor to handle (as I recall) the fact that integers and arbitrary-precision integers are different types. Maybe some other things. The idea that Python is good for adding new features (e.g. "better" than Lisp for whatever Maxima does in Lisp) is another boast, and the fact that it is slow is avoided by using Cython. I thought that Cython was a compiler for Python, but it apparently is not. It is a compiled language that looks like parts of Python. I used to think that marketing hype was a kind of tool used by people selling products (for money). Sage people use it for angling for market share. Whatever. If you want to use python within lisp, there are, I think, python-to-lisp translators or python interpreters written in lisp. > Typically math systems > (symbolic and numerical alike) have a user language which is > just cobbled together as an afterthought. Python has, at least, > the advantage of being more nearly complete and more > carefully designed. I think that evaluating Python as a language to convey essentially all of mathematics, Python is going to appear cobbled together. Also note that Python has changed from time to time in fairly significant ways. One claim (maybe marketing hype too? I don't know first hand) is that there is ONE implementation standard for Python on all platforms, and so there is no need to deal with GCL CCL ECL Scieneer, Allegro... dialects. Of course if it were such a great idea for implementation, you'd think that Sage would run natively on the most widespread PC platform (Windows) after all these years. RJF > It has occurred to me that Python could be a front-end language > for Maxima, but it would require some work. > > 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 Fri Jul 15 10:35:38 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 15 Jul 2011 09:35:38 -0600 Subject: [Maxima] trouble w/ pushing commits -- "failed to push some refs" Message-ID: Hi, I've made several commits to my local Git repo (hope I'm using the right terminology there) and I am trying to push them. When I try git push origin master I get this message: To ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima ! [rejected] master -> master (non-fast forward) error: failed to push some refs to 'ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima' I gather the stuff I have is out of date wrt the SF repo, right? Now how shall I resolve that -- I gather that I could rebase, but that would throw away the history, which I'd rather not have to recreate. How can I bring my repo up to date without throwing away the commit history? Or maybe it's actually some other problem? Thanks for any info. Yes, I have browsed various manuals and tutorials and I still don't understand what's going on. Sorry about that. best Robert Dodier From willisb at unk.edu Fri Jul 15 10:50:39 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 15 Jul 2011 10:50:39 -0500 Subject: [Maxima] itensor redefines sdiff In-Reply-To: References: Message-ID: I appended rtest_bernstein (new) to the share_testsuite...Oops, I got errors with derivatives of binomial. And so it goes with share/contrib. The bug is due to the fact that itensor redefines sdiff in a way that makes derivatives of binomial(xxx,yyy) return nounforms. I did file a bug report--until itensor no longer redefines sdiff, rtest_bernstein will reside before the tensor code. And I will append a note in share_testsuite.mac about itensor & sdiff. OK: (%i1) diff(binomial(k,n),k); (%o1) -binomial(k,n)*(psi[0](-n+k+1)-psi[0](k+1)) (%i2) load(itensor)$ (%i3) diff(binomial(k,n),k); (%o3) 'diff(binomial(k,n),k,1) --Barton From toy.raymond at gmail.com Fri Jul 15 10:56:04 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 15 Jul 2011 11:56:04 -0400 Subject: [Maxima] trouble w/ pushing commits -- "failed to push some refs" References: Message-ID: >>>>> "Robert" == Robert Dodier writes: Robert> I gather the stuff I have is out of date wrt the SF repo, right? Robert> Now how shall I resolve that -- I gather that I could rebase, Robert> but that would throw away the history, which I'd rather not Robert> have to recreate. How can I bring my repo up to date without Robert> throwing away the commit history? Or maybe it's actually Robert> some other problem? I think you need to do a git pull. This will bring your local copy up-to-date and then you can push your changes. Maybe. I'm still learning all this new-fangled stuff. Ray From robert.dodier at gmail.com Fri Jul 15 11:11:00 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 15 Jul 2011 10:11:00 -0600 Subject: [Maxima] trouble w/ pushing commits -- "failed to push some refs" In-Reply-To: References: Message-ID: I did a git pull before trying to push stuff. I guess I should have mentioned that. best Robert Dodier On 7/15/11, Raymond Toy wrote: >>>>>> "Robert" == Robert Dodier writes: > > Robert> I gather the stuff I have is out of date wrt the SF repo, right? > Robert> Now how shall I resolve that -- I gather that I could rebase, > Robert> but that would throw away the history, which I'd rather not > Robert> have to recreate. How can I bring my repo up to date without > Robert> throwing away the commit history? Or maybe it's actually > Robert> some other problem? > > I think you need to do a git pull. This will bring your local copy > up-to-date and then you can push your changes. > > Maybe. I'm still learning all this new-fangled stuff. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From vttoth at vttoth.com Fri Jul 15 12:21:22 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Fri, 15 Jul 2011 13:21:22 -0400 Subject: [Maxima] itensor redefines sdiff In-Reply-To: References: Message-ID: <014f01cc4313$a20b7040$e62250c0$@vttoth.com> I don't think there is an easy way to have itensor stop redefining sdiff. Here is an example why: (%i1) diff(x([],[i]),x([],[j])); (%o1) 0 (%i2) load(itensor)$ (%i3) diff(x([],[i]),x([],[j])); (%o3) kdelta([j], [i]) If we keep itensor in share, as opposed to incorporating it into the main source code, this redefinition is unfortunately necessary. However, it means that changes to sdiff are not automatically reflected in itensor. One possible way out would be to have sdiff call a hook at the right place, allowing itensor to redefine that hook only. If I remember correctly, the only change to sdiff in the redefined version is the inclusion of the line, ((rpobj e) (diffrpobj e x)) which calls the itensor function that performs the differentiation of tensor-like indexed objects. In the meantime, I'll check to see if I can bring the itensor version of sdiff up-to-date. Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Barton Willis Sent: Friday, July 15, 2011 11:51 AM To: Maxima Mailing List Subject: [Maxima] itensor redefines sdiff I appended rtest_bernstein (new) to the share_testsuite...Oops, I got errors with derivatives of binomial. And so it goes with share/contrib. The bug is due to the fact that itensor redefines sdiff in a way that makes derivatives of binomial(xxx,yyy) return nounforms. I did file a bug report--until itensor no longer redefines sdiff, rtest_bernstein will reside before the tensor code. And I will append a note in share_testsuite.mac about itensor & sdiff. OK: (%i1) diff(binomial(k,n),k); (%o1) -binomial(k,n)*(psi[0](-n+k+1)-psi[0](k+1)) (%i2) load(itensor)$ (%i3) diff(binomial(k,n),k); (%o3) 'diff(binomial(k,n),k,1) --Barton _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From willisb at unk.edu Fri Jul 15 13:34:26 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 15 Jul 2011 13:34:26 -0500 Subject: [Maxima] itensor redefines sdiff In-Reply-To: <014f01cc4313$a20b7040$e62250c0$@vttoth.com> References: , <014f01cc4313$a20b7040$e62250c0$@vttoth.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > One possible way out would be to have sdiff call a hook at the right place, For years, pdiff had a similar problem. Eventually, I merged the code by pasting a clause into sdiff that was protected by a special variable. Unrelated: binomial doesn't have a grad property; if it did, sdiff wouldn't be responsible for its derivative. --Barton From toy.raymond at gmail.com Fri Jul 15 14:44:34 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 15 Jul 2011 15:44:34 -0400 Subject: [Maxima] trouble w/ pushing commits -- "failed to push some refs" References: Message-ID: >>>>> "Robert" == Robert Dodier writes: Robert> I did a git pull before trying to push stuff. Robert> I guess I should have mentioned that. Sorry then, I have no further ideas. A google search on the error message indicates that git pull is the answer. Perhaps you were unlucky and someone else did a push between the time you did a pull and wanted to do the push? But maxima code isn't changing *that* fast in general. Ray From l_butler at users.sourceforge.net Fri Jul 15 14:58:57 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Fri, 15 Jul 2011 19:58:57 +0000 Subject: [Maxima] trouble w/ pushing commits -- "failed to push some refs" In-Reply-To: (message from Raymond Toy on Fri, 15 Jul 2011 15:44:34 -0400) Message-ID: <1qp7h7jz56m.fsf@iceland.freeshell.org> Raymond Toy writes: >>>>>> "Robert" == Robert Dodier writes: > > Robert> I did a git pull before trying to push stuff. > Robert> I guess I should have mentioned that. > > Sorry then, I have no further ideas. A google search on the error > message indicates that git pull is the answer. Perhaps you were > unlucky and someone else did a push between the time you did a pull > and wanted to do the push? But maxima code isn't changing *that* > fast in general. I sent a message earlier, but it is being held up. What I would try is this: git checkout master git fetch EDITOR=emacs git rebase --interactive --onto FETCH_HEAD This will pop you into an emacs buffer, and you can alter your coommits, and so on. Exiting the buffer will start applying the commits. If a conflict exists, you'll get popped into a buffer to manually fix the conflicts; on exiting, do git add filename git rebase --continue If you get into a pickle, git rebase --abort undoes everything (unless the rebase is done). I would suggest doing these fixes in a copy of your repo in case something goes bad. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From pfw at unl.edu Fri Jul 15 16:45:14 2011 From: pfw at unl.edu (Frazer Williams) Date: Fri, 15 Jul 2011 16:45:14 -0500 Subject: [Maxima] Minor integration error in maxima Message-ID: <20110715164514.508a9446@moi.unl.edu> I think I've found a minor error in the maxima integration routines. Maxima 5.23.2 http://maxima.sourceforge.net using Lisp SBCL 1.0.40-1.fc14 (%i1) f(x):=x^(2*n)*exp(-(x/x0)^2); 2 n x 2 (%o1) f(x) := x exp(- (--) ) x0 (%i2) integrate(f(x),x,-inf,inf); Is 2 n + 1 positive, negative, or zero? p; Is 2 n an integer? y; (%o2) 0 The result should be zero only if 2*n is odd. If we declare n to be an integer, the correct result is produced. (%i3) declare(n,integer); (%o3) done (%i4) integrate(f(x),x,-inf,inf); Is 2 n + 1 positive, negative, or zero? p; Is x0 positive or negative? p; 2 n + 1 2 n + 1 (%o4) gamma(-------) x0 2 -- Frazer From robert.dodier at gmail.com Fri Jul 15 19:04:17 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 15 Jul 2011 18:04:17 -0600 Subject: [Maxima] trouble w/ pushing commits -- "failed to push some refs" In-Reply-To: <1qp7h7jz56m.fsf@iceland.freeshell.org> References: <1qp7h7jz56m.fsf@iceland.freeshell.org> Message-ID: Is there any way to have Git tell me what it thinks is the matter? I'd rather know before starting to hack on stuff. Also, is rebasing the only way out of this situation? I hope I don't have to recreate my commit history. best Robert Dodier On 7/15/11, Leo Butler wrote: > Raymond Toy writes: > >>>>>>> "Robert" == Robert Dodier writes: >> >> Robert> I did a git pull before trying to push stuff. >> Robert> I guess I should have mentioned that. >> >> Sorry then, I have no further ideas. A google search on the error >> message indicates that git pull is the answer. Perhaps you were >> unlucky and someone else did a push between the time you did a pull >> and wanted to do the push? But maxima code isn't changing *that* >> fast in general. > > I sent a message earlier, but it is being held up. > > What I would try is this: > > git checkout master > git fetch > EDITOR=emacs git rebase --interactive --onto FETCH_HEAD > > This will pop you into an emacs buffer, and you can > alter your coommits, and so on. Exiting the buffer will > start applying the commits. If a conflict exists, you'll > get popped into a buffer to manually fix the conflicts; > on exiting, do > > git add filename > git rebase --continue > > If you get into a pickle, > > git rebase --abort > > undoes everything (unless the rebase is done). > > I would suggest doing these fixes in a copy of your > repo in case something goes bad. > > > -- > 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 bernard at marcade.biz Sat Jul 16 06:10:52 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 16 Jul 2011 12:10:52 +0100 Subject: [Maxima] Linux Journal writeup In-Reply-To: <4E2049B3.8000206@eecs.berkeley.edu> References: <4E1F433F.1090506@gmail.com> <4E2049B3.8000206@eecs.berkeley.edu> Message-ID: <1310814652.4980.17.camel@dell-laptop> On Fri, 2011-07-15 at 07:07 -0700, Richard Fateman wrote: > Both, I think. The idea that Python is suitable for a front end to > computer algebra is hard to entirely endorse, > considering that after boasting about it, they then find it unsuitable > themselves without a preprocessor > to handle (as I recall) the fact that integers and arbitrary-precision > integers are different types. Maybe > some other things. As a recent "refugee" from Sage, I far prefer the Maxima language for a front end to Python. Don't get me wrong, Python is a great language for some applications, this just doesn't happen to be one of them! > > > Typically math systems > > (symbolic and numerical alike) have a user language which is > > just cobbled together as an afterthought. Python has, at least, > > the advantage of being more nearly complete and more > > carefully designed. > I think that evaluating Python as a language to convey essentially all > of mathematics, Python > is going to appear cobbled together. Also note that Python has changed > from time to time in > fairly significant ways. > It has also changed relatively quickly and different platforms don't always keep up with each other; different Linux distributions often have a slightly different version as "standard". Changes can cause a lot of hassle without necessarily being of any benefit to a project. CL has many dialects but I don't think the language is going to change much! > One claim (maybe marketing hype too? I don't know first hand) is that > there is ONE implementation > standard for Python on all platforms, and so there is no need to deal > with GCL CCL ECL Scieneer, Allegro... > dialects. > I would describe this more of a pious hope than a claim! Cheers, Bernard Hurley. From l_butler at users.sourceforge.net Sat Jul 16 10:03:06 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Sat, 16 Jul 2011 15:03:06 +0000 Subject: [Maxima] trouble w/ pushing commits -- "failed to push some refs" In-Reply-To: (message from Robert Dodier on Fri, 15 Jul 2011 18:04:17 -0600) Message-ID: <1qp4o2mz2s5.fsf@iceland.freeshell.org> Robert Dodier writes: > Is there any way to have Git tell me what it thinks is the matter? > I'd rather know before starting to hack on stuff. Your original post had in the error message something like "not a fast forward". This means that the 2 branches (your master and origin/master) have a history that looks like ---- __/_____ rather than ____ __/ i.e. the branches share a common ancestor, but there have been commits on each since then. A rebase will make the first history look like the 2nd. > > Also, is rebasing the only way out of this situation? > I hope I don't have to recreate my commit history. Yes, it is, for the above reason. You will not need to recreate the commit history, except possibly to add something about resolving conflicts. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From fateman at eecs.berkeley.edu Sat Jul 16 10:54:30 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 16 Jul 2011 08:54:30 -0700 Subject: [Maxima] integration by parts for oscillatory integrals Message-ID: <4E21B436.9070709@eecs.berkeley.edu> I wrote out a brief (1.5 page) note on kind of automating integration by parts for solving problems that include a rapidly oscillating part. The idea is to attenuate the oscillating part repeatedly, so that eventually you can compute the definite integral accurately and easily. This is not a new idea but may be new to you, and it is not part of maxima. comments are invited. RJF http://www.cs.berkeley.edu/~fateman/papers/byparts.pdf From cloos at jhcloos.com Sat Jul 16 12:21:59 2011 From: cloos at jhcloos.com (James Cloos) Date: Sat, 16 Jul 2011 13:21:59 -0400 Subject: [Maxima] trouble w/ pushing commits -- "failed to push some refs" In-Reply-To: (Robert Dodier's message of "Fri, 15 Jul 2011 09:35:38 -0600") References: Message-ID: > To ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima > ! [rejected] master -> master (non-fast forward) > error: failed to push some refs to > 'ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima' Whenever you do that, do a 'git pull --rebase' and try again. Even if you had just done a pull recently. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From robert.dodier at gmail.com Sat Jul 16 13:33:19 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 16 Jul 2011 12:33:19 -0600 Subject: [Maxima] trouble w/ pushing commits -- "failed to push some refs" In-Reply-To: <1qp7h7jz56m.fsf@iceland.freeshell.org> References: <1qp7h7jz56m.fsf@iceland.freeshell.org> Message-ID: On 7/15/11, Leo Butler wrote: > git checkout master > git fetch > EDITOR=emacs git rebase --interactive --onto FETCH_HEAD Well, when I try this, I get: $ git checkout master Previous HEAD position was 2cfae0e... Merge branch 'master' of ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima into HEAD Switched to branch "master" $ git fetch robert_dodier at maxima.git.sourceforge.net's password: robert_dodier at maxima.git.sourceforge.net's password: remote: Counting objects: 41, done. remote: Compressing objects: 100% (28/28), done. remote: Total 28 (delta 20), reused 0 (delta 0) Unpacking objects: 100% (28/28), done. >From ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima b2d2678..d69d06b master -> origin/master $ EDITOR=vim git rebase --interactive --onto FETCH_HEAD fatal: Needed a single revision Invalid base A cursory search doesn't reveal a solution. Ideas? I guess I'm rather puzzled about this situation. I guess that I am trying push changes to files to which someone else pushed changes after I got a copy to work on. (1) Shouldn't git pull merge in the other changes so that I am up-to-date wrt other developers' changes? (2) How can I get Git to tell me (short of working through a rebase) what are the files in question? (3) This situation isn't too surprising in the sense that if there are multiple developers pushing changes, sooner or later there will be changes to the same files. Why isn't there any obvious way to resolve this situation? Thanks for any info. Robert Dodier From bernard at marcade.biz Sat Jul 16 16:51:43 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 16 Jul 2011 22:51:43 +0100 Subject: [Maxima] Maxima assumes order of differentiation assumed to be irrelevant Message-ID: <1310853103.4466.4.camel@dell-laptop> Hi, Maxima assumes that the order of differentiation is irrelevant as the following shows: (%i1) depends([U],[x,y])$ (%i2) diff(U,x,1,y,1); 2 d U (%o2) ----- dx dy (%i3) diff(U,y,1,x,1); 2 d U (%o3) ----- dx dy Is there any way to override this? Thanks, Bernard Hurley. From leo.butler at member.ams.org Fri Jul 15 11:21:20 2011 From: leo.butler at member.ams.org (Leo Butler) Date: Fri, 15 Jul 2011 12:21:20 -0400 Subject: [Maxima] trouble w/ pushing commits -- "failed to push some refs" References: Message-ID: <87bowvpla7.fsf@cmich.edu> Robert Dodier writes: > Hi, > > I've made several commits to my local Git repo (hope I'm > using the right terminology there) and I am trying to push them. > When I try > > git push origin master > > I get this message: > > To ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima > ! [rejected] master -> master (non-fast forward) > error: failed to push some refs to > 'ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima' > > I gather the stuff I have is out of date wrt the SF repo, right? > Now how shall I resolve that -- I gather that I could rebase, > but that would throw away the history, which I'd rather not > have to recreate. How can I bring my repo up to date without > throwing away the commit history? Or maybe it's actually > some other problem? > > Thanks for any info. Yes, I have browsed various manuals > and tutorials and I still don't understand what's going on. > Sorry about that. > > best > > Robert Dodier Hi Robert, Rebasing does not throw away your commit history, unless you tell it to. Rather, it reorders the history of one branch relative to another. I think you likely need to do something like git checkout master git fetch git rebase --interactive --onto FETCH_HEAD This will bring your repo's origin/master up-to-date with the SF repo, then the interactive rebase will allow you to rebase your master branch onto origin/master. The 'interactive' bit means git will pop you into an editor's buffer with a list of the commits (and summary), and some text about what you can do with each. Once you exit that buffer, git will re-apply the commits until it hits a conflict, at which point you will need to manually resolve the conflict, then do git add file git rebase --continue If you get in a pickle, you can do git rebase --abort I would recommend you create a copy of your repo before you start experimenting. Leo From jaanvajakas at hot.ee Sat Jul 16 15:37:20 2011 From: jaanvajakas at hot.ee (Jaan Vajakas) Date: Sat, 16 Jul 2011 23:37:20 +0300 Subject: [Maxima] Wedge product Message-ID: Hi, I am new to Maxima so I apologize if the following question is trivial. Why does the wedge product command in package itensor behave like this: (%i2) ishow((o([j],[])*s([1],[]))~o([k],[]))$ (%t2) s o o 1 j k I would expect the answer to be zero, not s([1],[]))*o([j],[])*o([k],[]). Anyway, at least if I assign components to s then the wedge product works as I expect: (%i3) s(l1,l2,[l3]):=kdelta(l1,[1])$ (%i4) ishow((o([j],[])*s([1],[]))~o([k],[]))$ (%t4) 0 Is the former behavior a bug or am I getting something wrong? I am using Maxima 5.17.0. Best regards, Jaan Vajakas From l_butler at users.sourceforge.net Sun Jul 17 06:54:13 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Sun, 17 Jul 2011 11:54:13 +0000 Subject: [Maxima] trouble w/ pushing commits -- "failed to push some refs" In-Reply-To: (message from Robert Dodier on Sat, 16 Jul 2011 12:33:19 -0600) Message-ID: <1qp1uxpyvfe.fsf@iceland.freeshell.org> Robert Dodier writes: > On 7/15/11, Leo Butler wrote: > >> git checkout master >> git fetch >> EDITOR=emacs git rebase --interactive --onto FETCH_HEAD > > Well, when I try this, I get: > > $ git checkout master > Previous HEAD position was 2cfae0e... Merge branch 'master' of > ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima > into HEAD > Switched to branch "master" > $ git fetch > robert_dodier at maxima.git.sourceforge.net's password: > robert_dodier at maxima.git.sourceforge.net's password: > remote: Counting objects: 41, done. > remote: Compressing objects: 100% (28/28), done. > remote: Total 28 (delta 20), reused 0 (delta 0) > Unpacking objects: 100% (28/28), done. > From ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima > b2d2678..d69d06b master -> origin/master > $ EDITOR=vim git rebase --interactive --onto FETCH_HEAD > fatal: Needed a single revision > Invalid base > > A cursory search doesn't reveal a solution. Ideas? > > I guess I'm rather puzzled about this situation. > > I guess that I am trying push changes to files to which > someone else pushed changes after I got a copy to work on. > > (1) Shouldn't git pull merge in the other changes so that I am > up-to-date wrt other developers' changes? > (2) How can I get Git to tell me (short of working through a rebase) > what are the files in question? > (3) This situation isn't too surprising in the sense that if there are > multiple developers pushing changes, sooner or later there will > be changes to the same files. Why isn't there any obvious way to > resolve this situation? Robert, can you put a copy of your repo in a public spot so I can look at it? -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From vttoth at vttoth.com Sun Jul 17 07:56:12 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Sun, 17 Jul 2011 08:56:12 -0400 Subject: [Maxima] Wedge product In-Reply-To: <20110717093207.7BAFF31FC6@dell8.ma.utexas.edu> References: <20110717093207.7BAFF31FC6@dell8.ma.utexas.edu> Message-ID: <01b501cc4480$eb4b1210$c1e13630$@vttoth.com> Yes, there are bugs lurking here with the wedge product. This _really_ shouldn't happen: (%i7) ishow((o([i],[])*s([j],[]))~o([k],[]))$ (%t7) 0 (%i8) ishow((o([j],[])*s([i],[]))~o([k],[]))$ o (o s - s o ) j i k i k (%t8) - ------------------ 2 I added this to the bug tracker. But there is another, more general issue also, namely that itensor is not designed to work with numeric indices. For itensor, indices are abstract and are used for algebraic bookkeeping. So your %i2 expression really does not make much sense to itensor. The point is that itensor treats a thing that looks like symbol(list,list) as an indexed object (i.e., a tensor) and tries to apply the wedge product rules, even if list,list happens to be [1],[]. In other words, itensor does not know that s([1],[]) is a number, not a tensorial object. The function definition workaround really works only because the function is evaluated (and the tensor-looking object is replaced with a number) before itensor kicks in. On a related note, I've long been contemplating replacing '~' with '/\' as the wedge product operator in itensor. Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Jaan Vajakas Sent: Saturday, July 16, 2011 4:37 PM To: maxima at math.utexas.edu Subject: [Maxima] Wedge product Hi, I am new to Maxima so I apologize if the following question is trivial. Why does the wedge product command in package itensor behave like this: (%i2) ishow((o([j],[])*s([1],[]))~o([k],[]))$ (%t2) s o o 1 j k I would expect the answer to be zero, not s([1],[]))*o([j],[])*o([k],[]). Anyway, at least if I assign components to s then the wedge product works as I expect: (%i3) s(l1,l2,[l3]):=kdelta(l1,[1])$ (%i4) ishow((o([j],[])*s([1],[]))~o([k],[]))$ (%t4) 0 Is the former behavior a bug or am I getting something wrong? I am using Maxima 5.17.0. Best regards, Jaan Vajakas _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From willisb at unk.edu Sun Jul 17 09:06:00 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 17 Jul 2011 09:06:00 -0500 Subject: [Maxima] Maxima assumes order of differentiation assumed to be irrelevant In-Reply-To: <1310853103.4466.4.camel@dell-laptop> References: <1310853103.4466.4.camel@dell-laptop> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Maxima assumes that the order of differentiation is irrelevant as the > following shows: >Is there any way to override this? Not that I know of. Macsyma has an option package "opalg" with an option variable diff_cannonicalize that controls the simplification of derivatives. Maxima doesn't include opalg. Barton From robert.dodier at gmail.com Sun Jul 17 10:31:25 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 17 Jul 2011 09:31:25 -0600 Subject: [Maxima] QR & SVD In-Reply-To: References: <1310405826.86892.YahooMailClassic@web161807.mail.bf1.yahoo.com> Message-ID: For the record, I have a working interface for DGEQRF, and it will be available as soon as I figure out how to commit it .... best Robert Dodier From robert.dodier at gmail.com Sun Jul 17 11:18:00 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 17 Jul 2011 10:18:00 -0600 Subject: [Maxima] trouble w/ pushing commits -- "failed to push some refs" In-Reply-To: References: Message-ID: On 7/16/11, James Cloos wrote: >> To ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima >> ! [rejected] master -> master (non-fast forward) >> error: failed to push some refs to >> 'ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima' > > Whenever you do that, do a 'git pull --rebase' and try again. OK, tried that. Here's the output from git pull --rebase and git push afterwards. I get the same error as before from git push. This is tangential, but, it seems pretty questionable IMNSHO for Git to inspect files for "whitespace errors". I can't tell if that's actually preventing stuff from being brought up to date. Even if it isn't, I just don't need the noise. I'm having enough trouble figuring out what is going on. best, Robert Dodier PS. Here's the output. $ git pull --rebase origin master robert_dodier at maxima.git.sourceforge.net's password: robert_dodier at maxima.git.sourceforge.net's password: remote: Counting objects: 49, done. remote: Compressing objects: 100% (35/35), done. remote: Total 35 (delta 25), reused 0 (delta 0) Unpacking objects: 100% (35/35), done. First, rewinding head to replay your work on top of it... HEAD is now at b4cef38... Adding Database.es.texi and removing Contexts.es.texi Applying Cut out unused special variable TRANSL-MODULES and associated machinery, namely the function PRINT-TRANSL-MODULES and macros TRANSL-MODULE and DEF-TRANSL-MODULE. The properties TTIME-AUTO, FIRST-LOAD, NO-LOAD-AUTO, PSEUDO, and HYPER, which were defined via DEF-TRANSL-MODULE, are not referenced anywhere. Applying Regularize messages and enclose them in GETTEXT calls. Applying Cut out undocumented flag macsyma_extend_warnp and act as though it were always true (its default value). Applying Maxima interface for function dgeqrf (QR decomposition). Includes a test script and brief Texinfo documentation. .dotest/patch:47: trailing whitespace. (%o4) [[ ], warning: 1 line adds whitespace errors. Applying New bernstein polynomial package: code, user documentation, and regression tests. .dotest/patch:77: trailing whitespace. ;; This program is free software; you can redistribute it and/or modify .dotest/patch:78: trailing whitespace. ;; it under the terms of the GNU General Public License as published by .dotest/patch:79: trailing whitespace. ;; the Free Software Foundation; either version 2 of the License, or .dotest/patch:80: trailing whitespace. ;; (at your option) any later version. .dotest/patch:81: trailing whitespace, space before tab in indent. error: patch failed: doc/info/Makefile.am:53 error: doc/info/Makefile.am: patch does not apply error: patch failed: doc/info/include-maxima.texi.in:136 error: doc/info/include-maxima.texi.in: patch does not apply error: share/contrib/bernstein/bernstein.lisp: already exists in index error: share/contrib/bernstein/bernstein_utilities.mac: already exists in index error: share/contrib/bernstein/rtest_bernstein.mac: already exists in index error: patch failed: share/share_testsuite.mac:53 error: share/share_testsuite.mac: patch does not apply Using index info to reconstruct a base tree... :77: trailing whitespace. ;; This program is free software; you can redistribute it and/or modify :78: trailing whitespace. ;; it under the terms of the GNU General Public License as published by :79: trailing whitespace. ;; the Free Software Foundation; either version 2 of the License, or :80: trailing whitespace. ;; (at your option) any later version. :81: trailing whitespace, space before tab in indent. warning: squelched 36 whitespace errors warning: 41 lines add whitespace errors. Falling back to patching base and 3-way merge... No changes -- Patch already applied. Applying More updates .dotest/patch:256: trailing whitespace. esto es, el orden por defecto es el ascendente, tal como queda definido por .dotest/patch:264: trailing whitespace. con @code{orderlessp}. El predicado @code{"<"} permite tambi@'en la ordenaci@'on .dotest/patch:265: trailing whitespace. por norma, pero no ordena completamente los elementos de la lista @var{L} que .dotest/patch:299: trailing whitespace. (%i7) sort (my_list, lambda ([a, b], .dotest/patch:438: trailing whitespace. de coordenadas actual. error: patch failed: doc/info/es/Constants.es.texi:1 error: doc/info/es/Constants.es.texi: patch does not apply error: patch failed: doc/info/es/Differentiation.es.texi:1 error: doc/info/es/Differentiation.es.texi: patch does not apply error: patch failed: doc/info/es/Lists.es.texi:1 error: doc/info/es/Lists.es.texi: patch does not apply error: patch failed: doc/info/es/Matrices.es.texi:1 error: doc/info/es/Matrices.es.texi: patch does not apply Using index info to reconstruct a base tree... :256: trailing whitespace. esto es, el orden por defecto es el ascendente, tal como queda definido por :264: trailing whitespace. con @code{orderlessp}. El predicado @code{"<"} permite tambi@'en la ordenaci@'on :265: trailing whitespace. por norma, pero no ordena completamente los elementos de la lista @var{L} que :299: trailing whitespace. (%i7) sort (my_list, lambda ([a, b], :438: trailing whitespace. de coordenadas actual. warning: squelched 2 whitespace errors warning: 7 lines add whitespace errors. Falling back to patching base and 3-way merge... No changes -- Patch already applied. $ git push origin master robert_dodier at maxima.git.sourceforge.net's password: To ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima ! [rejected] master -> master (non-fast forward) error: failed to push some refs to 'ssh://robert_dodier at maxima.git.sourceforge.net/gitroot/maxima/maxima' From willisb at unk.edu Sun Jul 17 11:21:58 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 17 Jul 2011 11:21:58 -0500 Subject: [Maxima] CAD in SARAG In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > The SARAG source is included in Maxima together with a small manual > that can be found in the source directory. The manual in the SARAG folder says that a detailed manual is located at: http://name.math.univ-rennes1.fr/marie-francoise.roy/bpr-posted1.html I would like to read it, but the url times out. --Barton From l.couraud at gmail.com Sun Jul 17 11:48:07 2011 From: l.couraud at gmail.com (laurent couraud) Date: Sun, 17 Jul 2011 18:48:07 +0200 Subject: [Maxima] RE : CAD in SARAG In-Reply-To: Message-ID: <09653EF4A7B54E4C8F4EE12669DA952E@PASSERELLE> I suspect the new location is: http://perso.univ-rennes1.fr/marie-francoise.roy/bpr-ed2-posted2.html > -----Message d'origine----- > De?: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] De la part de > Barton Willis > Envoy??: dimanche 17 juillet 2011 18:22 > ??: Fabrizio Caruso > Cc?: maxima at math.utexas.edu > Objet?: Re: [Maxima] CAD in SARAG > > -----maxima-bounces at math.utexas.edu wrote: ----- > > > The SARAG source is included in Maxima together with a small manual > > that can be found in the source directory. > > The manual in the SARAG folder says that a detailed manual is located at: > > http://name.math.univ-rennes1.fr/marie-francoise.roy/bpr-posted1.html > > I would like to read it, but the url times out. > > --Barton > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Sun Jul 17 14:12:31 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 17 Jul 2011 13:12:31 -0600 Subject: [Maxima] trouble w/ pushing commits -- resolved Message-ID: OK, I seem to have sorted out the trouble w/ git push ... I updated my git installation from 1.5.x to 1.7.x and although that in itself didn't change the outcome, the new git version gives more informative messages. In particular when I tried git checkout master, it said that I had 8 commits which were not on any branch, so I should create a branch for them, so I did, then I merged that branch into master and then I pushed the commits successfully. A couple of follow-up questions. (1) if the commits weren't on any branch, where were they? I guess I was under the mistaken impression that I had committed them to local master. (2) git checkout master said there were 8 commits in question, but it only listed 4 (the 4 which were the only outstanding unpushed commits to the best of my knowledge) and then it only said "and 4 more". How can I find out which commits to which it was referring? I looked in the commit log email and it only lists the 4 I expected. I looked for unmerged commits via git cherry applied to each local branch, but that only finds one commit which I have excluded from merging on purpose. Thanks for any info. Robert Dodier From bernard at marcade.biz Mon Jul 18 09:28:24 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Mon, 18 Jul 2011 15:28:24 +0100 Subject: [Maxima] Maxima assumes order of differentiation assumed to be irrelevant In-Reply-To: References: <1310853103.4466.4.camel@dell-laptop> Message-ID: <1310999304.4782.1.camel@dell-laptop> On Sun, 2011-07-17 at 09:06 -0500, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > > >Maxima assumes that the order of differentiation is irrelevant as the > > following shows: > > >Is there any way to override this? > > Not that I know of. Macsyma has an option package "opalg" with an option variable diff_cannonicalize > that controls the simplification of derivatives. Maxima doesn't include opalg. Too bad, maybe this is something I can look into when I have got to know maxima a bit better. Bernard > > Barton From bernard at marcade.biz Mon Jul 18 09:31:49 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Mon, 18 Jul 2011 15:31:49 +0100 Subject: [Maxima] Newbie question. Message-ID: <1310999509.4782.4.camel@dell-laptop> Hi, If I wanted to use gamma for something other than the gamma function, how would I go about it? Thanks, Bernard From l_butler at users.sourceforge.net Mon Jul 18 12:26:14 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Mon, 18 Jul 2011 17:26:14 +0000 Subject: [Maxima] trouble w/ pushing commits -- resolved In-Reply-To: (message from Robert Dodier on Sun, 17 Jul 2011 13:12:31 -0600) Message-ID: <1qpy5zvxzyh.fsf@iceland.freeshell.org> Robert Dodier writes: > OK, I seem to have sorted out the trouble w/ git push ... > I updated my git installation from 1.5.x to 1.7.x and although > that in itself didn't change the outcome, the new git version > gives more informative messages. In particular when I tried > git checkout master, it said that I had 8 commits which were > not on any branch, so I should create a branch for them, so > I did, then I merged that branch into master and then I pushed > the commits successfully. > > A couple of follow-up questions. > > (1) if the commits weren't on any branch, where were they? > I guess I was under the mistaken impression that I had > committed them to local master. Because of the way that Git stores revision information, commits do not need to be on any branch --- rather, Git has the notion of an anonymous branch, called a detached head. For example, you can check out a commit via its sha1sum (commit id): $ git --no-pager checkout 11be1c1fe079f4254fc65ee939cdbdeb2a119275 Note: checking out '11be1c1fe079f4254fc65ee939cdbdeb2a119275'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_name HEAD is now at 11be1c1... Cut out unused special variable TRANSL-MODULES and associ$ > > (2) git checkout master said there were 8 commits in question, > but it only listed 4 (the 4 which were the only outstanding > unpushed commits to the best of my knowledge) and then it > only said "and 4 more". How can I find out which commits to > which it was referring? I looked in the commit log email and > it only lists the 4 I expected. I looked for unmerged commits > via git cherry applied to each local branch, but that only finds > one commit which I have excluded from merging on purpose. FWIW, git log -g --after=2011-07-01 --committer=robert_dodier will log all commits made by you after the first of this month. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From bernard at marcade.biz Tue Jul 19 04:03:46 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Tue, 19 Jul 2011 10:03:46 +0100 Subject: [Maxima] Integration by parts. Message-ID: <1311066226.5209.4.camel@dell-laptop> Hi, I wrote a small integration by parts function: (%i1) ibyparts(ii,f,x) := block ([gp,igp,df], gp: part(ii,1)/f, igp: integrate(gp,x),igp, df: diff(f,x), igp*f - integrate(igp*df,x))$ (%i2) 'integrate (f(x)*diff(g(x),x),x); / [ d (%o2) I f(x) (-- (g(x))) dx ] dx / (%i3) ibyparts(%,f(x),x); / [ d (%o3) f(x) g(x) - I g(x) (-- (f(x))) dx ] dx / It seems to work OK, but my question is. Does Maxima already have something like this? If it does, I couldn't find it! Cheers, Bernard. From willisb at unk.edu Tue Jul 19 06:33:42 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 19 Jul 2011 06:33:42 -0500 Subject: [Maxima] Integration by parts. Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I?wrote?a?small?integration?by?parts?function: >It?seems?to?work?OK,?but?my?question?is.?Does?Maxima?already?have >something?like?this?? Yes, look at /maxima/share/integration/bypart.mac (undocumented, I think). See also, antidiff: ?(%i53) load(antid)$ ?(%i54) antidiff(f(x)*diff(g(x),x),x,g(x)); ?(%o54) f(x)*g(x)-integrate(g(x)*('diff(f(x),x,1)),x) Finally, maybe you could modify your code to respect definite integration: ?(%i64) integrate (f(x)*diff(g(x),x),x,0,1); ?(%o64) integrate(f(x)*('diff(g(x),x,1)),x,0,1) ?(%i65) ibyparts(%,f(x),x); ?(%o65) f(x)*g(x)-integrate(g(x)*('diff(f(x),x,1)),x) --Barton From fateman at eecs.berkeley.edu Tue Jul 19 09:16:19 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 19 Jul 2011 07:16:19 -0700 Subject: [Maxima] Integration by parts. In-Reply-To: References: Message-ID: <4E2591B3.80703@eecs.berkeley.edu> On 7/19/2011 4:33 AM, Barton Willis wrote: > > (%i64) integrate (f(x)*diff(g(x),x),x,0,1); > (%o64) integrate(f(x)*('diff(g(x),x,1)),x,0,1) > > (%i65) ibyparts(%,f(x),x); > (%o65) f(x)*g(x)-integrate(g(x)*('diff(f(x),x,1)),x) > > --Barton > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima that would be at(%,x=1)-at(%,x=0) for the last line, no? RJF From willisb at unk.edu Tue Jul 19 09:51:15 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 19 Jul 2011 09:51:15 -0500 Subject: [Maxima] Integration by parts. In-Reply-To: <4E2591B3.80703@eecs.berkeley.edu> References: <4E2591B3.80703@eecs.berkeley.edu> Message-ID: > that would be at(%,x=1)-at(%,x=0) for the last line, no? > > RJF I suppose so--maybe ibyparts could be modified to do this automatically when it detects a definite integral. --Barton From bernard at marcade.biz Tue Jul 19 10:54:59 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Tue, 19 Jul 2011 16:54:59 +0100 Subject: [Maxima] I would have expected maxima to know exponential integral diverges. Message-ID: <1311090899.5448.8.camel@dell-laptop> Hi, I would have expected Maxima to know that the following integral diverges for negative a, but apparently it doesn't: (%i1) ein: 'integrate(exp(-a*x)/x,x,1,inf); inf / - a x [ %e (%o1) I ------- dx ] x / 1 (%i2) ev(ein,nouns); Is a positive, negative, or zero? positive; (%o2) gamma_incomplete(0, a) (%i3) ev(ein,nouns); Is a positive, negative, or zero? negative; inf / - a x [ %e (%o3) I ------- dx ] x / 1 (%i4) ev(ein,nouns); Is a positive, negative, or zero? zero; defint: integral is divergent. -- an error. To debug this try: debugmode(true); Bernard From bernard at marcade.biz Tue Jul 19 13:57:04 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Tue, 19 Jul 2011 19:57:04 +0100 Subject: [Maxima] Integration by parts. In-Reply-To: References: <4E2591B3.80703@eecs.berkeley.edu> Message-ID: <1311101824.4267.1.camel@dell-laptop> On Tue, 2011-07-19 at 09:51 -0500, Barton Willis wrote: > > that would be at(%,x=1)-at(%,x=0) for the last line, no? > > > > RJF > > I suppose so--maybe ibyparts could be modified to do this automatically > when > it detects a definite integral. If someone could give me some pointers about how to detect such a thing, I will make the modification. Bernard From willisb at unk.edu Tue Jul 19 16:38:14 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 19 Jul 2011 16:38:14 -0500 Subject: [Maxima] Integration by parts. In-Reply-To: <1311101824.4267.1.camel@dell-laptop> References: <4E2591B3.80703@eecs.berkeley.edu> , <1311101824.4267.1.camel@dell-laptop> Message-ID: Something like the following might get you started: (%i13) ibyparts(ii,f) := block ([gp,x,igp,lo,hi,partswitch : true], if verbify(part(ii,0)) # verbify('integrate) then error("ouch"), gp: part(ii,1)/f, x : part(ii,2), lo : part(ii,3), hi : part(ii,4), igp : integrate(gp,x), if lo # 'end then at(igp * f,x=hi) - at(igp * f,x=lo) - integrate(igp * diff(f,x),x,lo,hi) else igp * f - integrate(igp * diff(f,x),x))$ (%i29) integrate(f(x)*exp(-w*x),x,0,1); (%o29) integrate(%e^(-w*x)*f(x),x,0,1) OK, I think: (%i30) ibyparts(%, f(x)); (%o30) integrate(%e^(-w*x)*('diff(f(x),x,1)),x,0,1)/w-(f(1)*%e^(-w))/w+f(0)/w Not so good: (%i22) integrate(42*f(x)*exp(-w*x),x,0,1); (%o22) 42*integrate(%e^(-w*x)*f(x),x,0,1) (%i23) ibyparts(%, f(x)); ouch There are issues with singularites too. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- If someone could give me some pointers about how to detect such a thing, I will make the modification. From fabrizio_caruso at hotmail.com Wed Jul 20 03:28:24 2011 From: fabrizio_caruso at hotmail.com (Fabrizio Caruso) Date: Wed, 20 Jul 2011 08:28:24 +0000 Subject: [Maxima] SARAG Message-ID: A txt manual is included in Maxima. You find it in the directory that contains the SARAG code. Under Linux it could be something like: /usr/local/share/maxima/5.19.0/share/contrib/sarag (change the version number to the one you have installed) For those of you who need to read more about SARAG I can provide some extra material. Just send an email to Fabrizio_Caruso at hotmail.com SARAG is used by the free electronic version of the book "Algorithms in Real Algebraic Geometry" by M.-F. Roy and others. It seems the link is not working at the moment. I will tell M.-F. Roy and it'll be fixed. I will try to help anyone who wants to use SARAG or work on new features or integrate a different package with SARAG. Fabrizio -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.dalton47 at gmail.com Wed Jul 20 06:11:25 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Wed, 20 Jul 2011 21:11:25 +1000 Subject: [Maxima] Multiplying matrices Message-ID: <20110720111125.GA16519@gwsc.vic.edu.au> Hi, Currently in my high school mathematics course I'm studying probability. The current topic is to do with transitional and state matrices. The idea is given a passed probability it is possible to work out the probability of a future event. From the text book is a simple example which should explain what I'm trying to do. A sporting team has a success rate of 0.8 of winning given they won the last game, and a 0.5 chance of winning considering they lost the last game. The team won the last match so I enter the following into maxima: A:matrix([0.8,0.5],[0.2,0.5]); [ 0.8 0.5 ] (%o1) [ ] [ 0.2 0.5 ] (%i2) B:matrix([1],[0]); [ 1 ] (%o2) [ ] [ 0 ] (%i3) C:A*B; fullmap: arguments must have same formal structure. -- an error. To debug this try: debugmode(true); (%i4) And as you can see when multiplying the matrices I get this error. Does anyone have any ideas of what I'm doing wrong? Thank you very much, Dan From daniel.dalton47 at gmail.com Wed Jul 20 06:12:52 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Wed, 20 Jul 2011 21:12:52 +1000 Subject: [Maxima] Npr and Ncr functions Message-ID: <20110720111252.GB16519@gwsc.vic.edu.au> Hi, I was just wondering if anyone knew how to use the Npr and Ncr functions in maxima? (Presuming maxima has this functionality)... Thanks very much, Dan From villate at fe.up.pt Wed Jul 20 06:20:21 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 20 Jul 2011 12:20:21 +0100 Subject: [Maxima] Multiplying matrices In-Reply-To: <20110720111125.GA16519@gwsc.vic.edu.au> References: <20110720111125.GA16519@gwsc.vic.edu.au> Message-ID: <1311160821.3502.1.camel@wigner> On Wed, 2011-07-20 at 21:11 +1000, Daniel Dalton wrote: > (%i3) C:A*B; > > fullmap: arguments must have same formal structure. > -- an error. To debug this try: debugmode(true); > (%i4) > > And as you can see when multiplying the matrices I get this error. > Does > anyone have any ideas of what I'm doing wrong? Hi Daniel, you should use a dot, rather than an asterisk: (%i3) C:A.B; when you use *, Maxima tries to multiply each two elements in the same position of the 2 matrices, rather than doing a matrix multiplication. Cheers, Jaime From villate at fe.up.pt Wed Jul 20 06:29:44 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 20 Jul 2011 12:29:44 +0100 Subject: [Maxima] Npr and Ncr functions In-Reply-To: <20110720111252.GB16519@gwsc.vic.edu.au> References: <20110720111252.GB16519@gwsc.vic.edu.au> Message-ID: <1311161384.3502.3.camel@wigner> On Wed, 2011-07-20 at 21:12 +1000, Daniel Dalton wrote: > I was just wondering if anyone knew how to use the Npr and Ncr functions > in maxima? (Presuming maxima has this functionality)... I haven't seen them in Maxima, but you can define them easily: (%i3) nPr(n,r):=n!/(n-r)!$ (%i4) nCr(n,r):=nPr(n,r)/r!$ (%i5) nPr(4,2); (%o5) 12 (%i6) nCr(4,2); (%o6) 6 Regards, Jaime From andre.maute at gmx.de Wed Jul 20 09:23:09 2011 From: andre.maute at gmx.de (andre maute) Date: Wed, 20 Jul 2011 16:23:09 +0200 Subject: [Maxima] Multiplying matrices In-Reply-To: <20110720111125.GA16519@gwsc.vic.edu.au> References: <20110720111125.GA16519@gwsc.vic.edu.au> Message-ID: <4E26E4CD.1030101@gmx.de> On 07/20/2011 01:11 PM, Daniel Dalton wrote: > A:matrix([0.8,0.5],[0.2,0.5]); > [ 0.8 0.5 ] > (%o1) [ ] > [ 0.2 0.5 ] > (%i2) B:matrix([1],[0]); > [ 1 ] > (%o2) [ ] > [ 0 ] > (%i3) C:A*B; > > fullmap: arguments must have same formal structure. > -- an error. To debug this try: debugmode(true); > (%i4) Use A.B instead of A*B, A.B is the noncommutative product operator in Maxima. For your next questions please use display2d : false display2d : false; A : matrix([0.8,0.5],[0.2,0.5]); B : matrix([1],[0]); C : A.B; Regards Andre From robert.dodier at gmail.com Wed Jul 20 17:15:36 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 20 Jul 2011 16:15:36 -0600 Subject: [Maxima] SARAG In-Reply-To: References: Message-ID: For the record, I started converting the plain text documentation to Texinfo, but never finished the job. If anyone is interested, I can dig out the stuff I was working on. best Robert Dodier On 7/20/11, Fabrizio Caruso wrote: > > A txt manual is included in Maxima. > > You find it in the directory that contains the SARAG code. > > Under Linux it could be something like: > > /usr/local/share/maxima/5.19.0/share/contrib/sarag > > (change the version number to the one you have installed) > > > > > For those of you who need to read more about SARAG > > > I can provide some extra material. > > > Just send an email to Fabrizio_Caruso at hotmail.com > > > > SARAG is used by the free electronic version > > of the book "Algorithms in Real Algebraic Geometry" > > by M.-F. Roy and others. > > It seems the link is not working at the moment. > > I will tell M.-F. Roy and it'll be fixed. > > > > I will try to help anyone who wants to use SARAG > > or work on new features or integrate a different > > package with SARAG. > > > > Fabrizio > > From dbmaxima at gmail.com Thu Jul 21 03:51:47 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Thu, 21 Jul 2011 18:51:47 +1000 Subject: [Maxima] Npr and Ncr functions In-Reply-To: <20110720111252.GB16519@gwsc.vic.edu.au> References: <20110720111252.GB16519@gwsc.vic.edu.au> Message-ID: <4E27E8A3.4050203@gmail.com> On 20/07/2011 9:12 PM, Daniel Dalton wrote: > Hi, > > I was just wondering if anyone knew how to use the Npr and Ncr functions > in maxima? (Presuming maxima has this functionality)... Use functions permuation(n,r) and combination(n,r). You will need to load(functs) to use them. From nathanieljsch at westnet.com.au Thu Jul 21 04:13:57 2011 From: nathanieljsch at westnet.com.au (Nathaniel Schmidt) Date: Thu, 21 Jul 2011 19:13:57 +1000 Subject: [Maxima] Npr and Ncr functions In-Reply-To: <4E27E8A3.4050203@gmail.com> References: <20110720111252.GB16519@gwsc.vic.edu.au> <4E27E8A3.4050203@gmail.com> Message-ID: <000001cc4786$862ce260$9286a720$@com.au> I believe you meant permutation (n,r);? > -----Original Message----- > From: maxima-bounces at math.utexas.edu [mailto:maxima- > bounces at math.utexas.edu] On Behalf Of David Billinghurst > Sent: Thursday, 21 July 2011 6:52 PM > To: maxima at math.utexas.edu > Subject: Re: [Maxima] Npr and Ncr functions > > On 20/07/2011 9:12 PM, Daniel Dalton wrote: > > Hi, > > > > I was just wondering if anyone knew how to use the Npr and Ncr > functions > > in maxima? (Presuming maxima has this functionality)... > Use functions permuation(n,r) and combination(n,r). You will need to > load(functs) to use them. > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From daniel.dalton47 at gmail.com Thu Jul 21 06:12:46 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Thu, 21 Jul 2011 21:12:46 +1000 Subject: [Maxima] Multiplying matrices In-Reply-To: <1311160821.3502.1.camel@wigner> References: <20110720111125.GA16519@gwsc.vic.edu.au> <1311160821.3502.1.camel@wigner> Message-ID: <20110721111246.GD13022@gwsc.vic.edu.au> On Wed, Jul 20, 2011 at 12:20:21PM +0100, Jaime Villate wrote: > Hi Daniel, Hi Jaime, > you should use a dot, rather than an asterisk: > (%i3) C:A.B; > > when you use *, Maxima tries to multiply each two elements in the same > position of the 2 matrices, rather than doing a matrix multiplication. Perfect! That's exactly what I want, thanks. Are there any other operators specific to matrices I should be aware of? Thanks very much. Cheers, Dan From daniel.dalton47 at gmail.com Thu Jul 21 06:36:49 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Thu, 21 Jul 2011 21:36:49 +1000 Subject: [Maxima] Multiplying matrices In-Reply-To: <4E26E4CD.1030101@gmx.de> References: <20110720111125.GA16519@gwsc.vic.edu.au> <4E26E4CD.1030101@gmx.de> Message-ID: <20110721113649.GA16178@gwsc.vic.edu.au> On Wed, Jul 20, 2011 at 04:23:09PM +0200, andre maute wrote: > >(%i3) C:A*B; > > > >fullmap: arguments must have same formal structure. > > -- an error. To debug this try: debugmode(true); > >(%i4) > Use A.B instead of A*B, A.B is the noncommutative product operator in Maxima. Perfect, thank you. > For your next questions please use display2d : false Sorry... I'm vision impaired and this actually makes output much easier to read! Is it possible to set this variable to false on start-up? Thanks very much, Cheers, Dan From daniel.dalton47 at gmail.com Thu Jul 21 06:38:49 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Thu, 21 Jul 2011 21:38:49 +1000 Subject: [Maxima] Npr and Ncr functions In-Reply-To: <4E27E8A3.4050203@gmail.com> References: <20110720111252.GB16519@gwsc.vic.edu.au> <4E27E8A3.4050203@gmail.com> Message-ID: <20110721113849.GB16178@gwsc.vic.edu.au> On Thu, Jul 21, 2011 at 06:51:47PM +1000, David Billinghurst wrote: > On 20/07/2011 9:12 PM, Daniel Dalton wrote: > >Hi, > > > >I was just wondering if anyone knew how to use the Npr and Ncr functions > >in maxima? (Presuming maxima has this functionality)... > Use functions permuation(n,r) and combination(n,r). You will need > to load(functs) to use them. That's great, thanks! Dan From dbmaxima at gmail.com Thu Jul 21 07:02:21 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Thu, 21 Jul 2011 22:02:21 +1000 Subject: [Maxima] Multiplying matrices In-Reply-To: <20110721113649.GA16178@gwsc.vic.edu.au> References: <20110720111125.GA16519@gwsc.vic.edu.au> <4E26E4CD.1030101@gmx.de> <20110721113649.GA16178@gwsc.vic.edu.au> Message-ID: <4E28154D.1030601@gmail.com> On 21/07/2011 9:36 PM, Daniel Dalton wrote: > Is it possible to set this variable to false on start-up? See the chapter on Runtime Environment in the manual. |maxima-init.mac| is a file which is loaded automatically when Maxima starts. You can use |maxima-init.mac| to customize your Maxima environment. |maxima-init.mac|, if it exists, is typically placed in the directory named by |maxima_userdir|, although it can be in any directory searched by the function |file_search|. For me on Windows: (%i1) maxima_userdir; (%o1) "C:/Documents and Settings/dabilling/maxima" Just create a file named |maxima-init.mac in the appropriate directory containing the line display2d:false | -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Thu Jul 21 08:48:56 2011 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 21 Jul 2011 14:48:56 +0100 Subject: [Maxima] Multiplying matrices In-Reply-To: <20110721111246.GD13022@gwsc.vic.edu.au> References: <20110720111125.GA16519@gwsc.vic.edu.au> <1311160821.3502.1.camel@wigner> <20110721111246.GD13022@gwsc.vic.edu.au> Message-ID: <1311256136.2030.3.camel@wigner> On Thu, 2011-07-21 at 21:12 +1000, Daniel Dalton wrote: > On Wed, Jul 20, 2011 at 12:20:21PM +0100, Jaime Villate wrote: > > you should use a dot, rather than an asterisk: > > (%i3) C:A.B; > > > > when you use *, Maxima tries to multiply each two elements in the same > > position of the 2 matrices, rather than doing a matrix multiplication. > > Perfect! That's exactly what I want, thanks. Are there any other > operators specific to matrices I should be aware of? Yes, you should also be aware of A^^2 which means the matrix A times itself. If you wrote A^2, Maxima would simply square each element in the matrix. That operator can also be used to obtain the inverse of the matrix: A^^(-1) (or if you prefer, use the function invert(A)) Cheers, Jaime From woollett at charter.net Thu Jul 21 15:34:25 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 21 Jul 2011 13:34:25 -0700 Subject: [Maxima] describe displa lisp error? Message-ID: <056E99419C6A45348EAE55BDAF86D4B7@edwinc367e16bd> GCL returns obscure error message: ------------------------ MAXIMA> (describe 'displa) DISPLA - internal symbol in MAXIMA package property TRANSLATED: T property MACSYMA-MODULE: (RUNTIME) ----------------------------------------------------------------------------- DISPLA [Function] (not found "dir") Maxima encountered a Lisp error: Error in PCL::PCL-DESCRIBE [or a callee]: Cannot open the file NIL. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. MAXIMA> (describe 'dir) DIR - internal symbol in MAXIMA package(not found "dir") Maxima encountered a Lisp error: Error in EVAL [or a callee]: Cannot open the file NIL. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. -------------------------------------------- Is this a feature of GCL , or a lack of code documentation? Ted Woollett From daniel.dalton47 at gmail.com Thu Jul 21 21:47:54 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Fri, 22 Jul 2011 12:47:54 +1000 Subject: [Maxima] Multiplying matrices In-Reply-To: <4E28154D.1030601@gmail.com> References: <20110720111125.GA16519@gwsc.vic.edu.au> <4E26E4CD.1030101@gmx.de> <20110721113649.GA16178@gwsc.vic.edu.au> <4E28154D.1030601@gmail.com> Message-ID: <20110722024754.GA6833@gwsc.vic.edu.au> On Thu, Jul 21, 2011 at 10:02:21PM +1000, David Billinghurst wrote: > On 21/07/2011 9:36 PM, Daniel Dalton wrote: > > Is it possible to set this variable to false on start-up? > > See the chapter on Runtime Environment in the manual. > > maxima-init.mac is a file which is loaded automatically when Maxima > starts. You can use maxima-init.mac to customize your Maxima environment. Great, thanks! Dan From willisb at unk.edu Fri Jul 22 07:36:49 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 22 Jul 2011 07:36:49 -0500 Subject: [Maxima] describe displa lisp error? In-Reply-To: <056E99419C6A45348EAE55BDAF86D4B7@edwinc367e16bd> References: <056E99419C6A45348EAE55BDAF86D4B7@edwinc367e16bd> Message-ID: The output of describe varies with the Lisp implementation, but the GCL output seems like a bug. Using Maxima+Clozure MAXIMA> (describe 'displa); DISPLA Type: SYMBOL Class: # Function INTERNAL in package: # Print name: "DISPLA" Value: # Function: # Arglist: (FORM) Plist: (TRANSLATED T MACSYMA-MODULE (RUNTIME)) --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >GCL?returns?obscure?error?message: >------------------------ >MAXIMA>?(describe?'displa) > >DISPLA?-?internal?symbol?in?MAXIMA?package >?property?TRANSLATED: >???T >?property?MACSYMA-MODULE: >???(RUNTIME) >-------------------------------------------------------------------------- >--- >DISPLA? >[Function] >(not?found?"dir") >Maxima?encountered?a?Lisp?error: > >?Error?in?PCL::PCL-DESCRIBE?[or?a?callee]:?Cannot?open?the?file?NIL. > >Automatically?continuing. >To?reenable?the?Lisp?debugger?set?*debugger-hook*?to?nil. > >MAXIMA>?(describe?'dir) > >DIR?-?internal?symbol?in?MAXIMA?package(not?found?"dir") >Maxima?encountered?a?Lisp?error: > >?Error?in?EVAL?[or?a?callee]:?Cannot?open?the?file?NIL. > >Automatically?continuing. >To?reenable?the?Lisp?debugger?set?*debugger-hook*?to?nil. >-------------------------------------------- >Is?this?a?feature?of?GCL?,?or?a?lack?of?code?documentation? > >Ted?Woollett > >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From paulcefo at buffalo.edu Fri Jul 22 10:53:25 2011 From: paulcefo at buffalo.edu (Paul Cefola) Date: Fri, 22 Jul 2011 11:53:25 -0400 Subject: [Maxima] question Message-ID: <4E299CF5.7080102@buffalo.edu> Is anyone thinking about the possibilities for applying maxima symbolic algebra system in current computer architectures with multi-core CPU and multiple processing element GPU? -- Dr. Paul J. Cefola Adjunct Professor, Dept. Of Mechanical and Aerospace Engineering, University at Buffalo (SUNY) Consultant in Aerospace Systems, Spaceflight Mechanics,& Astrodynamics 508-696-1884 (Vineyard Haven MA home phone) 978-201-1393 (cell) paulcefo at buffalo.edu paul.cefola at gmail.com From hbaker1 at pipeline.com Fri Jul 22 11:22:49 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Fri, 22 Jul 2011 09:22:49 -0700 Subject: [Maxima] question In-Reply-To: <4E299CF5.7080102@buffalo.edu> References: <4E299CF5.7080102@buffalo.edu> Message-ID: One of the best ideas I've seen along these lines involves multiple/parallel "point-wise" evaluation of symbolic expressions (as compiled subroutines), followed by interpolation. At 08:53 AM 7/22/2011, Paul Cefola wrote: >Is anyone thinking about the possibilities for applying maxima symbolic algebra system in current computer architectures with multi-core CPU and multiple processing element GPU? > >-- >Dr. Paul J. Cefola >Adjunct Professor, Dept. Of Mechanical and Aerospace Engineering, University at Buffalo (SUNY) >Consultant in Aerospace Systems, Spaceflight Mechanics,& Astrodynamics >508-696-1884 (Vineyard Haven MA home phone) >978-201-1393 (cell) > >paulcefo at buffalo.edu >paul.cefola at gmail.com From joshua.stults at gmail.com Fri Jul 22 11:38:23 2011 From: joshua.stults at gmail.com (Joshua Stults) Date: Fri, 22 Jul 2011 12:38:23 -0400 Subject: [Maxima] question In-Reply-To: References: <4E299CF5.7080102@buffalo.edu> Message-ID: We get comments on the list from time to time about generating an "optimal" form (usually people mean "fewest ops", rather than worrying about round-off) for an expression to use in number crunching; this sort of search seems like it could benefit from a parallel approach. -- Joshua Stults Website: variousconsequences.com Hackerspace: daytondiode.org From fateman at eecs.berkeley.edu Fri Jul 22 13:27:40 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 22 Jul 2011 11:27:40 -0700 Subject: [Maxima] Fwd: parallel computation was: Re: question Message-ID: <4E29C11C.7080908@eecs.berkeley.edu> On 7/22/2011 8:53 AM, Paul Cefola wrote: > Is anyone thinking about the possibilities for applying maxima > symbolic algebra system in current computer architectures with > multi-core CPU and multiple processing element GPU? > type parallel algebraic computation into Google. The first page of hits shows you a list of papers on libraries, and collections of papers in conference proceedings on this topic. Parallel computer architectures have been around for several decades. See http://pasco2010.imag.fr/ They were not so cheap back in 1988, but the good ideas and not-so-good ideas could be explored, and people wrote about symbolic computation, tree-search stuff, interpolation-evaluation stuff, parallel/distributed hash tables, back then. I think the best payoff is to translate a symbolic problem into one of the classic numeric tasks, and use the best available systems for those. That way when someone invents a better FFT, your own program runs faster too. There are also language extensions in various lisps supporting parallel computation, but if Maxima is to run on any of a number of lisps, one has to write in the common subset, making it harder. So far as I know, this has not been attempted. You can read a lot about past experience, and some of it is, I think, relevant. See the PASCO proceedings as a start. To the extent that symbolic computation uses an unpredictable but probably large amount of memory in some linked-list irregular structure, parallel computing is tough. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Fri Jul 22 13:49:15 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 22 Jul 2011 11:49:15 -0700 Subject: [Maxima] undocumented maxima functions Message-ID: The undocumented maxima func (line 249: suprv1.lisp) had the definition: --------------- (defun $directory (path) (cons '(mlist) (mapcar 'namestring (directory ($filename_merge path))))) -------------------------------------- The maxima function has only documentation for the two arg form: ------------------------------------------- filename_merge (path, filename) Constructs a modified path from path and filename. If the final component of path is of the form ###.something, the component is replaced with filename.something. Otherwise, the final component is simply replaced by filename. The result is a Lisp pathname object. -------------------------------------- >From that help file info, it is not clear what the one arg form does, as used in the def. of $directory. Ted Woollett From woollett at charter.net Fri Jul 22 17:20:21 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 22 Jul 2011 15:20:21 -0700 Subject: [Maxima] access to $display from Lisp REPL? Message-ID: <9922F424524847A3BFD5FF4BD3A3D1B7@edwinc367e16bd> Is it possible to call $display (line 737, comm.lisp) from inside the Lisp interpreter? The definition starts with (defmspec $display (form) ...) I get a lisp error if I naively call it like a function: ----------------------------------------- MAXIMA> (setf s1 "This is my string") "This is my string" MAXIMA> ($display s1) Maxima encountered a Lisp error: Error in EVAL [or a callee]: The function $DISPLAY is undefined. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. ------------------------------------------------ Ted Woollett From drdieterkaiser at web.de Fri Jul 22 18:35:00 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 23 Jul 2011 01:35:00 +0200 Subject: [Maxima] access to $display from Lisp REPL? In-Reply-To: <9922F424524847A3BFD5FF4BD3A3D1B7@edwinc367e16bd> References: <9922F424524847A3BFD5FF4BD3A3D1B7@edwinc367e16bd> Message-ID: <1311377700.6268.14.camel@dieter> Am Freitag, den 22.07.2011, 15:20 -0700 schrieb Edwin Woollett: > Is it possible to call $display (line 737, comm.lisp) from > inside the Lisp interpreter? > > The definition starts with (defmspec $display (form) ...) > > I get a lisp error if I naively call it like a function: > ----------------------------------------- > MAXIMA> (setf s1 "This is my string") > > "This is my string" > > MAXIMA> ($display s1) > > Maxima encountered a Lisp error: > > Error in EVAL [or a callee]: The function $DISPLAY is undefined. > > Automatically continuing. > To reenable the Lisp debugger set *debugger-hook* to nil. > ------------------------------------------------ The macro defmspec defines a special form of a Maxima function. One possibility to use the function is to call Maximas evaluator directly: MAXIMA> (setq $form '((mplus) $a ((mtimes) 2 $x))) ((MPLUS) $A ((MTIMES) 2 $X)) MAXIMA> (meval '(($display) $form)) form = 2*x+a $DONE MAXIMA> (setq $form "This is my string") "This is my string" MAXIMA> (meval '(($display) $form)) form = "This is my string" $DONE The definition of a special form is on the property list: MAXIMA> (get '$display 'mfexpr*) # The following is executed by the evaluator and can be used directly too: MAXIMA> (apply (get '$display 'mfexpr*) (cons `(($display) $form) nil)) form = "This is my string" Dieter Kaiser From drdieterkaiser at web.de Fri Jul 22 19:11:34 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 23 Jul 2011 02:11:34 +0200 Subject: [Maxima] undocumented maxima functions In-Reply-To: References: Message-ID: <1311379894.7756.15.camel@dieter> Am Freitag, den 22.07.2011, 11:49 -0700 schrieb Edwin Woollett: > The undocumented maxima func > (line 249: suprv1.lisp) had the definition: > --------------- > (defun $directory (path) > (cons '(mlist) (mapcar 'namestring (directory ($filename_merge path))))) > -------------------------------------- > The maxima function has only documentation > for the two arg form: > ------------------------------------------- > filename_merge (path, filename) > Constructs a modified path from path and filename. > If the final component of path is of the > form ###.something, the component is replaced with > filename.something. Otherwise, the final > component is simply replaced by filename. > > > The result is a Lisp pathname object. > -------------------------------------- > >From that help file info, it is not clear > what the one arg form does, as used in > the def. of $directory. When called with one argument, the function filename_merge returns the argument as a Lisp pathname. The argument should be a string e.g. (%i1) :lisp (type-of ($filename_merge "*")) PATHNAME This is the content of my current working directory: (%i1) directory("*"); (%o1) [/home/dieter/Maxima/maxima/.git/, /home/dieter/Maxima/maxima/.gitignore, /home/dieter/Maxima/maxima/.project, /home/dieter/Maxima/maxima/AUTHORS, /home/dieter/Maxima/maxima/COPYING, /home/dieter/Maxima/maxima/ChangeLog, /home/dieter/Maxima/maxima/INSTALL, /home/dieter/Maxima/maxima/LICENSES/, /home/dieter/Maxima/maxima/Makefile, /home/dieter/Maxima/maxima/NEWS, /home/dieter/Maxima/maxima/README, /home/dieter/Maxima/maxima/admin/, /home/dieter/Maxima/maxima/archive/, /home/dieter/Maxima/maxima/bootstrap, /home/dieter/Maxima/maxima/configure, /home/dieter/Maxima/maxima/demo/, /home/dieter/Maxima/maxima/doc/, /home/dieter/Maxima/maxima/install-sh, /home/dieter/Maxima/maxima/interfaces/, /home/dieter/Maxima/maxima/lisp-utils/, /home/dieter/Maxima/maxima/locale/, /home/dieter/Maxima/maxima/macosx/, /home/dieter/Maxima/maxima/maxima-local, /home/dieter/Maxima/maxima/missing, /home/dieter/Maxima/maxima/plotting/, /home/dieter/Maxima/maxima/share/, /home/dieter/Maxima/maxima/src/, /home/dieter/Maxima/maxima/tests/, /home/dieter/Maxima/maxima/xmaxima-local] And this is the content of the subdirectory interfaces: (%i2) directory("interfaces/*"); (%o2) [/home/dieter/Maxima/maxima/interfaces/.gitignore, /home/dieter/Maxima/maxima/interfaces/Makefile, /home/dieter/Maxima/maxima/interfaces/bin/, /home/dieter/Maxima/maxima/interfaces/emacs/, /home/dieter/Maxima/maxima/interfaces/lib/, /home/dieter/Maxima/maxima/interfaces/tex/, /home/dieter/Maxima/maxima/interfaces/xmaxima/] Dieter Kaiser From robert.dodier at gmail.com Sat Jul 23 11:57:58 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 23 Jul 2011 10:57:58 -0600 Subject: [Maxima] ZIP file In-Reply-To: <1309446765.95986.YahooMailRC@web39321.mail.mud.yahoo.com> References: <1309446765.95986.YahooMailRC@web39321.mail.mud.yahoo.com> Message-ID: Hi Michael, sorry for the late reply, I was just trawling through my old email .... I have packaged the Maxima 5.24.0 installation files from my computer and posted the result (maxima-5.24.0-windows.zip) to the Sourceforge file manager. See: http://sourceforge.net/projects/maxima/files and follow the links for the Windows version. I just packaged the stuff as it was installed, so I don't know if perhaps things are organized in a way that's peculiar to my computer. But it's worth a try -- just unpack the zip and try running Maxima-5.24.0/bin/maxima.bat. Hope this is useful in some way. Robert Dodier On 6/30/11, Michael Hanchak wrote: > Dear sirs: > > Would it be possible to post a zip file of the latest Maxima for Windows > executable? My server does not permit me to download exe files. > > Thank you > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From cloos at jhcloos.com Sat Jul 23 12:41:09 2011 From: cloos at jhcloos.com (James Cloos) Date: Sat, 23 Jul 2011 13:41:09 -0400 Subject: [Maxima] delint Message-ID: I recent post on one of the sage lists complained about their implementation of dirac_delta integrals. I was curious and tested maxima's support. Grep(1)ing, I found delta.mac and tried: load(delta)& delint(delta(x),x,-1,1); which returned 3. In fact, it returned three for every set of limits I tried, whether minf,inf or 0,0 or anything else. The post I reacted to suggested the answer for -1,1 should be 1. Do I misunderstand how delta.mac is supposed to work? I run 5.24.0, currently on sbcl. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From woollett at charter.net Sat Jul 23 13:06:22 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 23 Jul 2011 11:06:22 -0700 Subject: [Maxima] access to $display from Lisp REPL? References: <9922F424524847A3BFD5FF4BD3A3D1B7@edwinc367e16bd> <1311377700.6268.14.camel@dieter> Message-ID: <5E6E05CD080546ECAF279366B30BCE07@edwinc367e16bd> On July 22, 2011, Dieter Kaiser wrote: ************************** The macro defmspec defines a special form of a Maxima function. One possibility to use the function is to call Maximas evaluator directly: ....... MAXIMA> (setq $form "This is my string") "This is my string" MAXIMA> (meval '(($display) $form)) form = "This is my string" $DONE ************************** Thanks for the suggestion. My actual goal is to create a debug printout of selected local lisp variables ( and perhaps global Maxima level parameters?) inside a lisp function, and have, for each variable or parameter, the screen output ' name = current-value', as the maxima function display does at the Maxima level. So instead of creating such a lisp function from scratch, perhaps using displa, I thought of trying to somehow use $display from the lisp level. Your method produces a lisp error (shown below) if used with a lisp parameter bound to a lisp list. Also, I try to define a function with one argument which uses your approach, but the attempt fails so far, even when used with the lisp string variable. -------- Maxima 5.24.0 using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) display2d:false$ (%i2) a1 : aa1; (%o2) aa1 (%i3) a2 : 10; (%o3) 10 (%i4) to_lisp(); Type (to-maxima) to restart, ($quit) to quit Maxima. MAXIMA> (setq s1 "My string") "My string" MAXIMA> (setq l1 '(1 2 3)) (1 2 3) MAXIMA> (meval '(($display) $a1)) a1 = aa1 $DONE MAXIMA> (meval '(($display) $a2)) a2 = 10 $DONE MAXIMA> (meval '(($display) s1)) ?s1 = "My string" $DONE MAXIMA> (meval '(($display) l1)) Maxima encountered a Lisp error: Error in EVAL [or a callee]: Caught fatal error [memory may be damaged] Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. MAXIMA> s1 "My string" MAXIMA> (defun ldisplay1 (arg) (meval '(($display) arg))) LDISPLAY1 MAXIMA> (ldisplay1 s1) ?arg = ?arg $DONE ----------------------------------- so clearly this function def doesn't work. Can I finetune this approach to work, or is their an easier way, or is there a lisp analog to display2d which will do what I need for quick debugging looks at current variable values inside a lisp function. (I don't want to use the debugger). Ted From drdieterkaiser at web.de Sat Jul 23 13:45:58 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 23 Jul 2011 20:45:58 +0200 Subject: [Maxima] access to $display from Lisp REPL? In-Reply-To: <5E6E05CD080546ECAF279366B30BCE07@edwinc367e16bd> References: <9922F424524847A3BFD5FF4BD3A3D1B7@edwinc367e16bd> <1311377700.6268.14.camel@dieter> <5E6E05CD080546ECAF279366B30BCE07@edwinc367e16bd> Message-ID: <1311446758.1627.11.camel@dieter> Am Samstag, den 23.07.2011, 11:06 -0700 schrieb Edwin Woollett: > On July 22, 2011, Dieter Kaiser wrote: > > ************************** > The macro defmspec defines a special form of a Maxima function. One > possibility to use the function is to call Maximas evaluator directly: > ....... > MAXIMA> (setq $form "This is my string") > > "This is my string" > > MAXIMA> (meval '(($display) $form)) > > form = "This is my string" > > $DONE > ************************** > Thanks for the suggestion. My actual goal is to create a > debug printout of selected local lisp variables > ( and perhaps global Maxima level parameters?) > inside a lisp function, and have, for each variable or parameter, > the screen output ' name = current-value', as the maxima function > display does at the Maxima level. So instead of creating such > a lisp function from scratch, perhaps using displa, I thought > of trying to somehow use $display from the lisp level. > > Your method produces a lisp error (shown below) > if used with a lisp parameter bound to a lisp list. > > Also, I try to define a function with one argument which > uses your approach, but the attempt fails so far, even > when used with the lisp string variable. > > -------- > Maxima 5.24.0 > using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) > > (%i1) display2d:false$ > (%i2) a1 : aa1; > (%o2) aa1 > (%i3) a2 : 10; > (%o3) 10 > (%i4) to_lisp(); > Type (to-maxima) to restart, ($quit) to quit Maxima. > > MAXIMA> (setq s1 "My string") > > "My string" > MAXIMA> (setq l1 '(1 2 3)) > > (1 2 3) > MAXIMA> (meval '(($display) $a1)) > > a1 = aa1 > > $DONE > MAXIMA> (meval '(($display) $a2)) > > a2 = 10 > > $DONE > MAXIMA> (meval '(($display) s1)) > > ?s1 = "My string" > > $DONE > MAXIMA> (meval '(($display) l1)) > > Maxima encountered a Lisp error: > > Error in EVAL [or a callee]: Caught fatal error [memory may be damaged] > > Automatically continuing. > To reenable the Lisp debugger set *debugger-hook* to nil. > > MAXIMA> s1 > > "My string" > MAXIMA> (defun ldisplay1 (arg) (meval '(($display) arg))) > LDISPLAY1 > MAXIMA> (ldisplay1 s1) > ?arg = ?arg > > $DONE > > ----------------------------------- > > so clearly this function def doesn't work. > Can I finetune this approach to work, or > is their an easier way, or is there a lisp > analog to display2d which will do what I need > for quick debugging looks at current variable values > inside a lisp function. (I don't want to use > the debugger). At first, you have to ensure that only valid Maxima expressions are passed to the function $display. The Lisp list '(1 2 3) is not a Maxima expressions, but '((mlist) 1 2 3), e.g. MAXIMA> (setq s1 '((mlist) 1 2 2)) ((MLIST) 1 2 2) MAXIMA> (meval '(($display) s1)) s1 = [1, 2, 2] $DONE Second, the syntax of your function ldisplay1 is not correct. The argument of the function has to be spliced into a valid Maxima form, e.g. MAXIMA> (defun ldisplay1 (arg) (meval `(($display) ,arg))) LDISPLAY1 With this definition your get for your example. MAXIMA> (setq s1 "My string") "My string" MAXIMA> (ldisplay1 's1) s1 = My string $DONE MAXIMA> It is important to quote the argument to the function ldisplay1, because ldisplay1 is a Lisp function and evaluates its argument. There might be more simple and more easy approaches. I will have a look at your problem. Dieter Kaiser From woollett at charter.net Sat Jul 23 14:05:09 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 23 Jul 2011 12:05:09 -0700 Subject: [Maxima] access to $display from Lisp REPL? Message-ID: On July 22, 2011, Barton Willis wrote: **************************** Use mfuncall to call a defmspec function from CL (%i2) :lisp(mfuncall '$display 'x 'y 42) x=x y=y 42=42 $DONE ************************ Thanks for the suggestion. Your method works for a lisp string but not for a lisp list, as shown below: --------------------------- Maxima 5.24.0 using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) display2d:false$ (%i2) to_lisp(); Type (to-maxima) to restart, ($quit) to quit Maxima. MAXIMA> (setq s1 "My string") "My string" MAXIMA> (setq l1 '(1 2 3)) (1 2 3) MAXIMA> (mfuncall '$display 's1) ?s1 = "My string" $DONE MAXIMA> (mfuncall '$display 'l1) Maxima encountered a Lisp error: Error in EVAL [or a callee]: Caught fatal error [memory may be damaged] Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. MAXIMA> ------------------------------------ Ted From drdieterkaiser at web.de Sat Jul 23 14:29:42 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 23 Jul 2011 21:29:42 +0200 Subject: [Maxima] access to $display from Lisp REPL? In-Reply-To: References: Message-ID: <1311449382.1627.21.camel@dieter> Am Samstag, den 23.07.2011, 12:05 -0700 schrieb Edwin Woollett: > On July 22, 2011, Barton Willis wrote: > **************************** > Use mfuncall to call a defmspec function from CL > > (%i2) :lisp(mfuncall '$display 'x 'y 42) > x=x > y=y > 42=42 > $DONE > ************************ > Thanks for the suggestion. > Your method works for a lisp string but > not for a lisp list, as shown below: > --------------------------- > Maxima 5.24.0 > using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) > > (%i1) display2d:false$ > (%i2) to_lisp(); > Type (to-maxima) to restart, ($quit) to quit Maxima. > > MAXIMA> (setq s1 "My string") > > "My string" > MAXIMA> (setq l1 '(1 2 3)) > > (1 2 3) > MAXIMA> (mfuncall '$display 's1) > ?s1 = "My string" > > $DONE > MAXIMA> (mfuncall '$display 'l1) > > Maxima encountered a Lisp error: > > Error in EVAL [or a callee]: Caught fatal error [memory may be damaged] > > Automatically continuing. > To reenable the Lisp debugger set *debugger-hook* to nil. > > MAXIMA> > ------------------------------------ Here is a further suggestion: MAXIMA> (defun $display_value (x) (displa `((mequal) ,x ,(eval x)))) $DISPLAY_VALUE MAXIMA> (setq expr '((mplus) $a $b $c)) ((MPLUS) $A $B $C) MAXIMA> ($display_value 'expr) expr = a + b + c NIL MAXIMA> (setq l1 '(1 2 3)) (1 2 3) MAXIMA> ($display_value 'l1) l1 = (1, 2, 3) NIL There are a lot of more possibilities, e.g. an example with a mtext-expression: MAXIMA> (defun $display_value (x) (displa `((mtext) ,x " = " ,(eval x)))) $DISPLAY_VALUE MAXIMA> (display_value 'expr) expr = a + b + c NIL MAXIMA> (display_value 'l1) l1 = (1, 2, 3) NIL Dieter Kaiser From fateman at eecs.berkeley.edu Sat Jul 23 17:00:23 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 23 Jul 2011 15:00:23 -0700 Subject: [Maxima] delint In-Reply-To: References: Message-ID: <4E2B4477.6090203@eecs.berkeley.edu> On 7/23/2011 10:41 AM, James Cloos wrote: > I recent post on one of the sage lists complained about their > implementation of dirac_delta integrals. I was curious and > tested maxima's support. > > Grep(1)ing, I found delta.mac and tried: > > load(delta)& > delint(delta(x),x,-1,1); > > which returned 3. In fact, it returned three for every set of limits > I tried, whether minf,inf or 0,0 or anything else. > > The post I reacted to suggested the answer for -1,1 should be 1. > > Do I misunderstand how delta.mac is supposed to work? > > I run 5.24.0, currently on sbcl. > > -JimC The file delta appears to be about 40 years old, and requires a utility file that is apparently non-existent. That file would define removeimag. The version in MIT Macsyma seems to work OK. The author, MPS, is not any name I recognize. From macrakis at gmail.com Sat Jul 23 17:14:54 2011 From: macrakis at gmail.com (Stavros Macrakis) Date: Sat, 23 Jul 2011 18:14:54 -0400 Subject: [Maxima] delint Message-ID: Delta.mac is in the share directory, which means that it is user-contributed and unsupported. Some of this code is useful and solid, some isn't. Much of it isn't even documented well enough that what it's *supposed* to do it's clear. It is more likely that code referenced by Maxima documentation works than that code found by grepping through source works. -s On Jul 23, 2011 1:45 PM, "James Cloos" wrote: -------------- next part -------------- An HTML attachment was scrubbed... URL: From hirotaka.niitsuma at gmail.com Sun Jul 24 06:16:42 2011 From: hirotaka.niitsuma at gmail.com (Niitsuma Hirotaka) Date: Sun, 24 Jul 2011 20:16:42 +0900 Subject: [Maxima] levenberg marquardt method Message-ID: I made levenberg marquardt method script on maxima. http://d.hatena.ne.jp/niitsuma/20080325/1311505968 usage ---------- /*minimize f*/ f(xx,p):=sin(apply("+",map("*",xx,p))); df(xx,p):=transpose(p)*cos(apply("+",map("*",xx,p))); ddf(xx,p):= -( transpose(p) .p) * sin(apply("+",map("*",xx,p))); xinit:[0.1,0.1]; param:[1,1]; eps:0.001; levenberg_marquardt_minimize([f,df,ddf,levenberg_marquardt_dx2x_default],xinit, eps,param); ---------- code ---------- load(diag); matrix2list(m):=substpart("[",m,0); rowmatrix2list(m):=matrix2list(m)[1]; colmatrix2list(m):=rowmatrix2list(transpose(m)); mat_en_diag(m):=diag(makelist(m[k][k],k,1,length(m))); levenberg_marquardt_dx2x_default(x,dx):=x+colmatrix2list(dx); levenberg_marquardt_minimize(fobj,x0,eps,param):=block( [n,m,f,df,ddf,dx2x,fv,fv_tmp,fv0,dfv,ddfv,dx,x_tmp , x:x0 , c:0.0001 , c_factor:10 /*c_factor:1.2*/ ], [f,df,ddf,dx2x]:fobj , dx:df(x0,param) , fv:f(x,param) , fv0:fv+100 , for n:1 /*thru 1000000000*/ while abs(fv - fv0) > eps /* norm2mat(dx) > eps */ do ( /*disp(norm2_list_or_scalar(dx)) ,*/ dfv:df(x,param) , ddfv:ddf(x,param) , fv_tmp:fv + 1000000000 , for m:1 thru 1000000000 while fv_tmp > fv do ( damped_ddfv: ddfv+c*mat_en_diag(ddfv) , dx: - invert(damped_ddfv).dfv , disp(x_tmp:dx2x(x,dx)) , fv_tmp:f(x_tmp,param) , if fv_tmp > fv then c:c_factor*c ) , x:x_tmp, fv0:fv, disp(fv:fv_tmp) , disp(c:c/c_factor) , x ), x ); From maxima at etherjones.us Sun Jul 24 15:45:50 2011 From: maxima at etherjones.us (Ether Jones) Date: Sun, 24 Jul 2011 13:45:50 -0700 (PDT) Subject: [Maxima] levenberg marquardt method In-Reply-To: Message-ID: <1311540350.1495.YahooMailClassic@web161817.mail.bf1.yahoo.com> How is this different from (or better than) minpack_lsquares ? --- On Sun, 7/24/11, Niitsuma Hirotaka wrote: From: Niitsuma Hirotaka Subject: [Maxima] levenberg marquardt method To: maxima at math.utexas.edu Date: Sunday, July 24, 2011, 7:16 AM I made levenberg marquardt method script on maxima. http://d.hatena.ne.jp/niitsuma/20080325/1311505968 usage ---------- /*minimize f*/ f(xx,p):=sin(apply("+",map("*",xx,p))); df(xx,p):=transpose(p)*cos(apply("+",map("*",xx,p))); ddf(xx,p):= -( transpose(p) .p) * sin(apply("+",map("*",xx,p))); xinit:[0.1,0.1]; param:[1,1]; eps:0.001; levenberg_marquardt_minimize([f,df,ddf,levenberg_marquardt_dx2x_default],xinit, eps,param); ---------- code ---------- load(diag); matrix2list(m):=substpart("[",m,0); rowmatrix2list(m):=matrix2list(m)[1]; colmatrix2list(m):=rowmatrix2list(transpose(m)); mat_en_diag(m):=diag(makelist(m[k][k],k,1,length(m))); levenberg_marquardt_dx2x_default(x,dx):=x+colmatrix2list(dx); levenberg_marquardt_minimize(fobj,x0,eps,param):=block( ? [n,m,f,df,ddf,dx2x,fv,fv_tmp,fv0,dfv,ddfv,dx,x_tmp ? , ? x:x0 ? , ? c:0.0001 ? , ? c_factor:10 ? /*c_factor:1.2*/ ? ], ? [f,df,ddf,dx2x]:fobj ? , ? dx:df(x0,param) ? , ? fv:f(x,param) ? , ? fv0:fv+100 ? , ? for n:1 ? /*thru 1000000000*/ ? ? while???abs(fv -???fv0) >? eps ? /* ? norm2mat(dx) > eps ? */ ? do ( ? ? /*disp(norm2_list_or_scalar(dx)) ,*/ ? ? dfv:df(x,param) ? ? , ? ? ddfv:ddf(x,param) ? ? , ? ? fv_tmp:fv + 1000000000 ? ? , ? ? for? m:1 thru 1000000000???while fv_tmp > fv do ( ? ? ? damped_ddfv: ddfv+c*mat_en_diag(ddfv) ? ? ? , ? ? ? dx: - invert(damped_ddfv).dfv ? ? ? , ? ? ? disp(x_tmp:dx2x(x,dx)) ? ? ? , ? ? ? fv_tmp:f(x_tmp,param) ? ? ? , ? ? ? if fv_tmp > fv then c:c_factor*c ? ? ? ) ? ? , ? ? x:x_tmp, ? ? fv0:fv, ? ? disp(fv:fv_tmp) ? ? , ? ? disp(c:c/c_factor) ? ? , ? ? x ? ? ), ? x ); _______________________________________________ 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 Sun Jul 24 18:17:07 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 24 Jul 2011 19:17:07 -0400 Subject: [Maxima] delint Message-ID: <4EC4A29B7E834096A8F3E7FCF4C68E85@RichsLaptop> There is a package called pw.mac for Maxima from https://sourceforge.net/projects/piecewisefunc/ This package has a pwdelta() function that behaves as you expect. pwint() means integrate, pwint(pwdelta(x-a)*x^2,x,minf,inf); a^2; The package is for piecewise functions. See the help for more information. FWIW, Rich > load(delta)& > delint(delta(x),x,-1,1); > > which returned 3. In fact, it returned three for every set of limits > I tried, whether minf,inf or 0,0 or anything else. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cloos at jhcloos.com Sun Jul 24 19:48:25 2011 From: cloos at jhcloos.com (James Cloos) Date: Sun, 24 Jul 2011 20:48:25 -0400 Subject: [Maxima] delint In-Reply-To: <4EC4A29B7E834096A8F3E7FCF4C68E85@RichsLaptop> (Richard Hennessy's message of "Sun, 24 Jul 2011 19:17:07 -0400") References: <4EC4A29B7E834096A8F3E7FCF4C68E85@RichsLaptop> Message-ID: >>>>> "RH" == Richard Hennessy writes: RH> This package has a pwdelta() function that behaves as you expect. Well, not so much as what I expected but rather better at helping me remember what the dirac delta *is*. ? I couldn't quite remember (hadn't come up in some time) and wanted to derive its meaning from an implementation. That said, I don't think I ever posted a thanks for pw.mac. It is a most useful addition. Thanks, -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From rich.hennessy at verizon.net Sun Jul 24 20:56:28 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 24 Jul 2011 21:56:28 -0400 Subject: [Maxima] delint In-Reply-To: References: <4EC4A29B7E834096A8F3E7FCF4C68E85@RichsLaptop> Message-ID: >>>>> "RH" == Richard Hennessy writes: RH> This package has a pwdelta() function that behaves as you expect. "I couldn't quite remember (hadn't come up in some time) and wanted to derive its meaning from an implementation. That said, I don't think I ever posted a thanks for pw.mac. It is a most useful addition." I think of pwdelta() as a limit of a spike-like distribution with its area held at 1, sometimes. I don't know if that is good enough, but it seems to work out in many cases. Anyway, I am glad you find pw.mac useful, you are welcome. Rich (Author of pw.mac) From willisb at unk.edu Sun Jul 24 22:36:32 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 24 Jul 2011 22:36:32 -0500 Subject: [Maxima] proposal for new sign-log Message-ID: The following sign-log function runs the testsuite with no errors and it reduces the run time from about 217.8 seconds to 197.734 seconds (Intel Core i3 380M 2.53 GHz, 64 bit Clozure 1.6, ...). It runs the share testsuite with no errors, but it doesn't change the run time for the share testsuite all that much. The testsuite spends about 33 seconds (out of about 200) finding the sign of mplus expressions. Both mtimes and mexpt expressions are fairly spendy too--%log expressions rank fourth in run time. The proposed sign-log function reduces the time for %log expressions from about 20 seconds to 2 seconds. For the testsuite, the run time of sign isn't dominated by a few nasty cases--the sign function is called many times on non-nasty expressions. Comments are welcomed. Proposed sign-log: (defun sign-log (x) (setq x (cadr x)) (setq sign (cond ((eq t (mgrp x 0)) (cond ((eq t (mgrp 1 x)) '$neg) ((eq t (meqp x 1)) '$zero);; log(1) = 0. ((eq t (mgrp x 1)) '$pos) ((eq t (mgqp x 1)) '$pz) (t '$pnz))) ((and *complexsign* (eql 1 (sratsimp (mul x (take '($conjugate) x))))) '$imaginary) (*complexsign* '$complex) (t '$pnz)))) Current sign-log (I wrote (the slow?) parts of this function) ???????????????? ???????????????? ? ? ? (defun sign-log (x) ??(setq x (cadr x)) ;; looking at sign of log(x) ??(cond ((eq t (meqp x 1)) (setf sign '$zero)) ;; log(1) = 0. ???????????????? ;; for x on the unit circle and x # 1, log(x) is pure imaginary ???????????????? ((and ?*complexsign* (eq t (meqp 1 (take '(mabs) x))) (eq t (mnqp x 1))) ???????????????? (setf sign '$imaginary)) ???????????????? ;; log(x) is positive for x > 1 ???????????????? ((eq t (mgrp x 1)) (setf sign '$pos)) ???????????????? ((eq t (mgqp x 1)) (setf sign '$pz)) ???????????????? ;; log(x) is negative for 0 < x < 1. ???????????????? ((and (eq t (mgrp x 0)) (eq t (mgrp 1 x))) (setf sign '$neg)) ???????????????? ;; log(x) is real for x > 0 ???????????????? ((eq t (mgrp x 0)) (setf sign '$pnz)) ???????????????? ;; Nothing is known. ?Return $complex if allowed, ???????????????? ;; ?otherwise pnz ???????????????? (*complexsign* (setf sign '$complex)) ???????????????? (t (setf sign '$pnz))) ??sign) --Barton From willisb at unk.edu Mon Jul 25 09:38:09 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 25 Jul 2011 09:38:09 -0500 Subject: [Maxima] proposal for new sign-log In-Reply-To: References: Message-ID: I neglected the nz case: log(x) with 0 < x <= 1. Fixing that doesn't change the running time for the testsuite all that much. Additional logic might speed up sign-log somewhat, but my tests showed that it did not made much difference. --Barton From macrakis at alum.mit.edu Mon Jul 25 11:06:01 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 25 Jul 2011 12:06:01 -0400 Subject: [Maxima] Stricter defaults Message-ID: A bunch of defaults in recent Maximas (changed a year ago or so) appear to have changed from assuming that variables and expressions are real-valued by default to assuming that they are complex-valued by default. For example, log(1/x) no longer simplifies to -log(x) and sqrt(1/x) no longer simplifies to 1/sqrt(x). I understand that these simplifications do not treat branch cuts consistently in the complex plane. However, Maxima made the design decision a long time ago that by default, entities (both undeclared variables and values) were assumed to be real. This design decision is still reflected by much of Maxima; thus sign(sqrt(x)) => pz, sign(log(x)) => pnz. In general, it is *not* true in Maxima that substituting a complex value for a variable will give reasonable results. For example, subst(%i,x,rectform(log(x))) yielsd %i*atan2(0,%i), which Maxima can't simplify any further as far as I can tell -- because atan2 is assumed to have real arguments. Moreover, even in the complex plane, as far as I know, no one has come up with a consistent, correct, and useful way of handling either branch-cut semantics or Riemann-surface semantics in Maxima. The main effects of suppressing simplifications log(1/x) => -log(x) appear to be (1) confusing new users (and some old users) and (2) breaking existing code (in particular integration) I propose we return to the "everything is real" assumption as the default in Maxima. Discussion? -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernard at marcade.biz Mon Jul 25 16:10:36 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Mon, 25 Jul 2011 22:10:36 +0100 Subject: [Maxima] Is this how dependencies are suppposed to work? Message-ID: <1311628236.4290.6.camel@dell-laptop> Hi, In the following snippet I would have expected the output (%o3) to be [x(y,z)] but it isn't. The documentation is not very clear about what is supposed to happen. (%i1) depends(x,y); (%o1) [x(y)] (%i2) depends(x,z); (%o2) [x(z)] (%i3) dependencies; (%o3) [x(z)] Bernard. From fateman at eecs.berkeley.edu Mon Jul 25 16:25:25 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 25 Jul 2011 14:25:25 -0700 Subject: [Maxima] essentially, fundamentally, actually, was Re: [mg120482] And now for something completely different In-Reply-To: <20110725134705.35611cmcfm7sm59c@web.mail.umich.edu> References: <201107251129.HAA25514@smc.vnet.net> <20110725134705.35611cmcfm7sm59c@web.mail.umich.edu> Message-ID: <4E2DDF45.6040504@eecs.berkeley.edu> If you mean A New Kind of Science, try http://www.wolframscience.com/nksonline/search/?collection=nks&query=essentially which gives you the 338 locations of the word "essentially". All Wolfram sites tote up 5021 matches. You might not have noticed the 551 occurrences of "fundamentally" (All sites 3418), 350 of "actually", and another 350 of "actual". I hadn't realized this tool was available, but using this search I found the count: 2229 of "And", (All sites 163,380). Further investigation shows that this doesn't distinguish between "and" and "And" so they are not all at the beginning of sentences. These numbers are as of July 25, 2011 14:07 PST My guess is that Wolfram didn't want to deal with editors, just as he didn't want to deal with publishers. He did it all himself. I give him credit in that the resulting book is very nice to look at. On the other hand, I think one can't blame anyone else for its shortcomings. RJF On 7/25/2011 10:47 AM, Jack L Goldberg 1 wrote: > As long as we are talking about poor written English, a particularly > annoying habit of Wolfram (or his editors) is the use of the word > "essentially" throughout his tome, "Mathematica". It appears so often > that it both disturbing and unessential (so to speak) :-) > > Jack > From jacinto.jimenez at upct.es Mon Jul 25 03:41:26 2011 From: jacinto.jimenez at upct.es (=?iso-8859-1?Q?Jacinto_M=AA_Jim=E9nez_Mart=EDnez?=) Date: Mon, 25 Jul 2011 10:41:26 +0200 Subject: [Maxima] problem with matrix tex output Message-ID: <000001cc4aa6$a538ee60$efaacb20$@jimenez@upct.es> Hi, I?m newbie in maxima and I don?t know how to change the tex output for a matrix. The tex() command in maxima produces \pmatrix, but I?d like to change the default option, i.e. , to produce \bmatrix. How can I do it? Thanks in advace Jacinto Jim?nez -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.mueller at math.uni-dortmund.de Mon Jul 25 09:15:11 2011 From: jan.mueller at math.uni-dortmund.de (=?ISO-8859-15?Q?Jan_Hendrik_M=FCller?=) Date: Mon, 25 Jul 2011 16:15:11 +0200 Subject: [Maxima] float values of cubic roots Message-ID: <4E2D7A6F.5050101@math.uni-dortmund.de> Dear all, I recently looked for integer values of cubic roots expressions. I was surprised that wxMaxima computed the second expression (of the attached screenshot) wrong, because both are integer. Can someone help me/explain the reason for the wrong result? Thanks a lot Jan M?ller -------------- next part -------------- A non-text attachment was scrubbed... Name: two integer cubic roots.JPG Type: image/jpeg Size: 19811 bytes Desc: not available URL: From talon at lpthe.jussieu.fr Tue Jul 26 03:27:51 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 26 Jul 2011 10:27:51 +0200 Subject: [Maxima] problem with matrix tex output References: <3434.89899901233$1311667590@news.gmane.org> Message-ID: Jacinto M? Jim?nez Mart?nez wrote: > Hi, I?m newbie in maxima and I don?t know how to change the tex output for > a > matrix. The tex() command in maxima produces \pmatrix, but I?d like to > change the default option, i.e. , to produce \bmatrix. > > > > How can I do it? > Only by editing the source code mactex.lisp under the src directory of maxima. Then you reload mactex.lisp and it should work. The relevant part is: (defun tex-matrix(x l r) ;;matrix looks like ((mmatrix)((mlist) a b) ...) (append l `("\\pmatrix{") (mapcan #'(lambda(y) (tex-list (cdr y) nil (list "\\cr ") "&")) (cdr x)) '("}") r)) Here you can replace pmatrix by whatever you like. > > > Thanks in advace > > > > Jacinto Jim?nez -- Michel Talon From willisb at unk.edu Tue Jul 26 06:11:36 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 26 Jul 2011 06:11:36 -0500 Subject: [Maxima] Stricter defaults In-Reply-To: References: Message-ID: Generally these stricter defaults involve calling sign or csign inside a simplifying function. This leads to undocumented behavior: (%i71) m : matrix([abs(x), log(exp(sqrt(x)))],[5,7]); (%o71) matrix([abs(x),sqrt(x)],[5,7]) (%i74) m : matrix([log(exp(sqrt(x))),abs(x)],[7,5]); (%o74) matrix([sqrt(x),x],[7,5]) The order matrix elements are simplified isn't documented. Another example (%i85) m : matrix([abs(x), if x > 0 then log(exp(sqrt(x))) else 42],[5,7]); (%o85) matrix([abs(x),if x>0 then sqrt(x) else 42],[5,7]) (%i86) m : matrix([if x > 0 then log(exp(sqrt(x))) else 42, abs(x)],[7,5]); (%o86) matrix([if x>0 then sqrt(x) else 42,x],[7,5]) Finally, sign & csign are somewhat slow functions (speed depends on fact database). --Barton From worwor at bellsouth.net Tue Jul 26 10:55:08 2011 From: worwor at bellsouth.net (Charles Russell) Date: Tue, 26 Jul 2011 10:55:08 -0500 Subject: [Maxima] plot2d and quad_qags feeding non-numeric input to user function Message-ID: <4E2EE35C.1010002@bellsouth.net> I can't use the following user-defined function in the numerical procedures plot2d and quad_qags because they feed it non-numeric values as input. In the case of plot2d I can get around this with a discrete plot, but I can't find a workaround for the numeric integration. (This is an easy example to integrate analytically, but I am interested in the general case.) bell(x):= block([dum], if not numberp(x) then print("bell: error, x = ",x), if x <= -1 then dum : 0 else if x >= 1 then dum : 0 else dum : (1 - x^2)^2, return(dum) ) ; plot2d(bell, [x,-1,1]); /* OK */ trace(bell); plot2d(bell(x), [x,-1,1]); /* input non-numerical */ qags_out: quad_qags(bell(s), s, -1, 1); /* input non-numerical */ (%i83) trace(bell); (%o83) [bell] (%i84) plot2d(bell(x), [x,-1,1]); /* input non-numerical */ 1 Enter bell [x] bell: error, x = x 1 Exit bell dum COERCE-FLOAT-FUN: no such Lisp or Maxima function: dum -- an error. To debug this try: debugmode(true); (%i85) qags_out: quad_qags(bell(s), s, -1, 1); /* input non-numerical */ 1 Enter bell [s] bell: error, x = s 1 Exit bell dum COERCE-FLOAT-FUN: no such Lisp or Maxima function: dum -- an error. To debug this try: debugmode(true); I've tried converting the input with ev(x,numer) but that doesn't work: /* lbell(x) := bell(log(x))/x; */ lbell(x) := block( [xn: ev(x,numer,infeval)], if not numberp(xn) then print("lbell: error, xn = ",xn), bell(log(xn))/xn ); (%i34) plot2d(lbell(x),[x, 0.01, 10]); lbell: error, xn = x From drdieterkaiser at web.de Tue Jul 26 12:08:36 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 26 Jul 2011 19:08:36 +0200 Subject: [Maxima] Stricter defaults In-Reply-To: References: Message-ID: <1311700116.1697.27.camel@dieter> Am Dienstag, den 26.07.2011, 06:11 -0500 schrieb Barton Willis: > Generally these stricter defaults involve calling sign or csign inside a > simplifying function. This leads to undocumented behavior: > > (%i71) m : matrix([abs(x), log(exp(sqrt(x)))],[5,7]); > (%o71) matrix([abs(x),sqrt(x)],[5,7]) > > (%i74) m : matrix([log(exp(sqrt(x))),abs(x)],[7,5]); > (%o74) matrix([sqrt(x),x],[7,5]) > > The order matrix elements are simplified isn't documented. Another example > > (%i85) m : matrix([abs(x), if x > 0 then log(exp(sqrt(x))) else 42],[5,7]); > (%o85) matrix([abs(x),if x>0 then sqrt(x) else 42],[5,7]) > > (%i86) m : matrix([if x > 0 then log(exp(sqrt(x))) else 42, abs(x)],[7,5]); > (%o86) matrix([if x>0 then sqrt(x) else 42,x],[7,5]) > > Finally, sign & csign are somewhat slow functions (speed depends on fact database). I will add more comments about the topic of this thread. But first, a look at the reported bug of this posting. It is very interesting bug and it is an old bug. The examples of this posting do not show the bug in Maxima versions before 5.22, but the origin of the bug is very old. First, an example with the current Maxima version. The problem is, that the sign of the second call in a compound expression or in a list depends on the first expression. Maxima version: 5.24post Maxima build date: 17:6 7/26/2011 Host type: i686-pc-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.45 These are the expected results: (%i1) sign(sqrt(x)); (%o1) pz (%i2) sign(x); (%o2) pnz A compound statement with a wrong result for the sign of x: (%i3) (sign(sqrt(x)), sign(x)); (%o3) pz A list with a wrong result for the sign of x: (%i6) [sign(sqrt(x)), sign(x)]; (%o6) [pz, pz] Again the wrong results with Maxima 5.10: Maxima version: 5.10.0 Maxima build date: 21:56 3/14/2011 host type: i686-pc-linux-gnu lisp-implementation-type: SBCL lisp-implementation-version: 1.0.45 (%i2) (sign(sqrt(x)), sign(x)); (%o2) pz (%i3) [sign(sqrt(x)), sign(x)]; (%o3) [pz, pz] In the examples from this posting the columns of the matrices are evaluated and simplified like a list. In Maxima 5.22 a call to the function csign was included for the log function, the second call to csign is from the abs function. The function csign behaves similar to the function sign and has the same bug. The second call gives a wrong result. The problem is easy to see when tracing the function csign. I suppose that the origin of the bug are some global variables in the function sign which have old values from a first call. The bug is not related to the functionality of the log function, but the extension of the functionality shows an old bug. Dieter Kaiser From drdieterkaiser at web.de Tue Jul 26 12:41:44 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 26 Jul 2011 19:41:44 +0200 Subject: [Maxima] Stricter defaults In-Reply-To: <1311700116.1697.27.camel@dieter> References: <1311700116.1697.27.camel@dieter> Message-ID: <1311702104.1697.42.camel@dieter> Am Dienstag, den 26.07.2011, 19:08 +0200 schrieb Dieter Kaiser: > Am Dienstag, den 26.07.2011, 06:11 -0500 schrieb Barton Willis: > > Generally these stricter defaults involve calling sign or csign inside a > > simplifying function. This leads to undocumented behavior: > > > > (%i71) m : matrix([abs(x), log(exp(sqrt(x)))],[5,7]); > > (%o71) matrix([abs(x),sqrt(x)],[5,7]) > > > > (%i74) m : matrix([log(exp(sqrt(x))),abs(x)],[7,5]); > > (%o74) matrix([sqrt(x),x],[7,5]) > > > > The order matrix elements are simplified isn't documented. Another example > > > > (%i85) m : matrix([abs(x), if x > 0 then log(exp(sqrt(x))) else 42],[5,7]); > > (%o85) matrix([abs(x),if x>0 then sqrt(x) else 42],[5,7]) > > > > (%i86) m : matrix([if x > 0 then log(exp(sqrt(x))) else 42, abs(x)],[7,5]); > > (%o86) matrix([if x>0 then sqrt(x) else 42,x],[7,5]) > > > > Finally, sign & csign are somewhat slow functions (speed depends on fact database). > > I will add more comments about the topic of this thread. But first, a > look at the reported bug of this posting. It is very interesting bug and > it is an old bug. The examples of this posting do not show the bug in > Maxima versions before 5.22, but the origin of the bug is very old. > > First, an example with the current Maxima version. The problem is, that > the sign of the second call in a compound expression or in a list > depends on the first expression. > > Maxima version: 5.24post > Maxima build date: 17:6 7/26/2011 > Host type: i686-pc-linux-gnu > Lisp implementation type: SBCL > Lisp implementation version: 1.0.45 > > These are the expected results: > > (%i1) sign(sqrt(x)); > (%o1) pz > (%i2) sign(x); > (%o2) pnz > > A compound statement with a wrong result for the sign of x: > > (%i3) (sign(sqrt(x)), sign(x)); > (%o3) pz > > A list with a wrong result for the sign of x: > > (%i6) [sign(sqrt(x)), sign(x)]; > (%o6) [pz, pz] > > Again the wrong results with Maxima 5.10: > > Maxima version: 5.10.0 > Maxima build date: 21:56 3/14/2011 > host type: i686-pc-linux-gnu > lisp-implementation-type: SBCL > lisp-implementation-version: 1.0.45 > > (%i2) (sign(sqrt(x)), sign(x)); > (%o2) pz > (%i3) [sign(sqrt(x)), sign(x)]; > (%o3) [pz, pz] > > In the examples from this posting the columns of the matrices are > evaluated and simplified like a list. In Maxima 5.22 a call to the > function csign was included for the log function, the second call to > csign is from the abs function. The function csign behaves similar to > the function sign and has the same bug. The second call gives a wrong > result. The problem is easy to see when tracing the function csign. > > I suppose that the origin of the bug are some global variables in the > function sign which have old values from a first call. > > The bug is not related to the functionality of the log function, but the > extension of the functionality shows an old bug. A further remark: The error is in the function sign-mexpt. This function writes facts into the actual context, using the functions tdpos, tdneg, tdzero, tdpn, and tdpz. The function meval* kills these facts after finishing an evaluation. But for evaluating the columns of a matrix or a list the function meval is mapped over the elements. Therefore the facts from a previous call of a sign function are still present in a second call. Two solutions might be possible: 1. Map the function meval* over the elements of a list or a compound statement. 2. Create a local context when entering the function sign-mexpt to store temporary facts. I would prefer the second approach. Dieter Kaiser From woollett at charter.net Tue Jul 26 12:42:14 2011 From: woollett at charter.net (Edwin Woollett) Date: Tue, 26 Jul 2011 10:42:14 -0700 Subject: [Maxima] Using lisp displa to view local variables Message-ID: <0367836CFBFD4510B5902D5AD6081C00@edwinc367e16bd> On July 23, 2011, Dieter Kaiser wrote: ******************* There are a lot of more possibilities, e.g. an example with a mtext-expression: MAXIMA> (defun $display_value (x) (displa `((mtext) ,x " = " ,(eval x)))) $DISPLAY_VALUE MAXIMA> (display_value 'expr) expr = a + b + c NIL ************************** I would like to use your approach to look at local lisp variables inside a lisp function, but am having trouble getting a bound local variable passed: ------------------------------------------------------ Maxima 5.24.0 using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) load(mfiles); (%o1) c:/work2/mfiles.mac (%i2) print_lines("display.lisp",1,11)$ ;;; display.lisp (defun ldisplay (&rest xx) (mapcar #'(lambda (s) (displa `((mtext) ,s " = " ,(eval s))) ) xx)) (defun f1 () (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) (mtell "local") (ldisplay 's1 'l1 'a1) (mtell "bye"))) (%i3) load("display.lisp"); (%o3) display.lisp (%i4) ?trace (?ldisplay); (%o4) (ldisplay) (%i5) :lisp (f1) local 1> (LDISPLAY S1 L1 A1) Maxima encountered a Lisp error: Error in EVAL [or a callee]: The variable S1 is unbound. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (%i5) -------------------------------------------------- Any suggestions for getting bound local variables passed to ldisplay? Ted Woollett p.s. I am probably making a basic lisp programming error? From macrakis at alum.mit.edu Tue Jul 26 13:36:21 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 26 Jul 2011 14:36:21 -0400 Subject: [Maxima] Using lisp displa to view local variables In-Reply-To: <0367836CFBFD4510B5902D5AD6081C00@edwinc367e16bd> References: <0367836CFBFD4510B5902D5AD6081C00@edwinc367e16bd> Message-ID: Common Lisp has lexical scope, so (eval 'x) evaluates x in the global scope (by default). Example: (let ((x 3)) (eval 'x)) => error You need to make $display_value into a Lisp macro, e.g. (defmacro $display_value (x) `(displa (list '(mtext) ',x " = " ,x))) Maxima does allow Lisp macros in Maxima expressions, so you can call this from either Maxima or Lisp code. -s On Tue, Jul 26, 2011 at 13:42, Edwin Woollett wrote: > On July 23, 2011, Dieter Kaiser wrote: > ******************* > There are a lot of more possibilities, e.g. an example with a > mtext-expression: > > MAXIMA> (defun $display_value (x) > (displa `((mtext) ,x " = " ,(eval x)))) > $DISPLAY_VALUE > > MAXIMA> (display_value 'expr) > expr = a + b + c > NIL > ************************** > I would like to use your approach to look at local > lisp variables inside a lisp function, but am having > trouble getting a bound local variable passed: > ------------------------------**------------------------ > Maxima 5.24.0 > using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) > > (%i1) load(mfiles); > (%o1) c:/work2/mfiles.mac > > (%i2) print_lines("display.lisp",1,**11)$ > ;;; display.lisp > > (defun ldisplay (&rest xx) > (mapcar #'(lambda (s) > (displa `((mtext) ,s " = " ,(eval s))) ) xx)) > > (defun f1 () > (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) > (mtell "local") > (ldisplay 's1 'l1 'a1) > (mtell "bye"))) > > (%i3) load("display.lisp"); > (%o3) display.lisp > > (%i4) ?trace (?ldisplay); > (%o4) (ldisplay) > > (%i5) :lisp (f1) > local > 1> (LDISPLAY S1 L1 A1) > Maxima encountered a Lisp error: > > Error in EVAL [or a callee]: The variable S1 is unbound. > > Automatically continuing. > To enable the Lisp debugger set *debugger-hook* to nil. > (%i5) > ------------------------------**-------------------- > Any suggestions for getting bound local variables passed > to ldisplay? > > Ted Woollett > p.s. I am probably making a basic lisp programming error? > > > ______________________________**_________________ > 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 Jul 26 13:41:01 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 26 Jul 2011 14:41:01 -0400 Subject: [Maxima] plot2d and quad_qags feeding non-numeric input to user function In-Reply-To: <4E2EE35C.1010002@bellsouth.net> References: <4E2EE35C.1010002@bellsouth.net> Message-ID: You need to quote the argument: plot2d( '( bell(x) ), [x,-1,1]); If quoting weren't required, you couldn't do (e.g.) plot2d( taylor(sin(x),x,0,3), [x, 0, 3] ) -- Maxima would have no way of knowing whether you wanted taylor(sin(x),x,0,3) plotted for each value of x (which would be an error) or the *result* of taylor(...) = x-x^3/6 plotted at each value of x. -s On Tue, Jul 26, 2011 at 11:55, Charles Russell wrote: > I can't use the following user-defined function in the numerical procedures > plot2d and quad_qags because they feed it non-numeric values as input. In > the case of plot2d I can get around this with a discrete plot, but I can't > find a workaround for the numeric integration. (This is an easy example to > integrate analytically, but I am interested in the general case.) > > bell(x):= block([dum], > if not numberp(x) then print("bell: error, x = ",x), > if x <= -1 then dum : 0 > else if x >= 1 then dum : 0 > else dum : (1 - x^2)^2, > return(dum) > ) ; > > plot2d(bell, [x,-1,1]); /* OK */ > trace(bell); > plot2d(bell(x), [x,-1,1]); /* input non-numerical */ > qags_out: quad_qags(bell(s), s, -1, 1); /* input non-numerical */ > > (%i83) trace(bell); > (%o83) [bell] > (%i84) plot2d(bell(x), [x,-1,1]); /* input non-numerical */ > 1 Enter bell [x] > bell: error, x = x > 1 Exit bell dum > COERCE-FLOAT-FUN: no such Lisp or Maxima function: dum > -- an error. To debug this try: debugmode(true); > (%i85) qags_out: quad_qags(bell(s), s, -1, 1); /* input non-numerical */ > 1 Enter bell [s] > bell: error, x = s > 1 Exit bell dum > COERCE-FLOAT-FUN: no such Lisp or Maxima function: dum > -- an error. To debug this try: debugmode(true); > > I've tried converting the input with ev(x,numer) but that doesn't work: > > /* lbell(x) := bell(log(x))/x; */ > lbell(x) := block( > [xn: ev(x,numer,infeval)], > if not numberp(xn) then print("lbell: error, xn = ",xn), > bell(log(xn))/xn > ); > > (%i34) plot2d(lbell(x),[x, 0.01, 10]); > lbell: error, xn = x > > ______________________________**_________________ > 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 Jul 26 14:15:15 2011 From: woollett at charter.net (Edwin Woollett) Date: Tue, 26 Jul 2011 12:15:15 -0700 Subject: [Maxima] Using lisp displa to view local variables Message-ID: <7A41BB290A8D45B784FC139756C50551@edwinc367e16bd> On July 26, 2011, Stavros Macrakis wrote: ************************** You need to make $display_value into a Lisp macro, e.g. (defmacro $display_value (x) `(displa (list '(mtext) ',x " = " ,x))) Maxima does allow Lisp macros in Maxima expressions, so you can call this from either Maxima or Lisp code. ***************************************** Thanks for the approach, which I get to work with a direct call, but not when mapping on a list: --------------------------------------------------- MAXIMA> (defmacro $display_value (x) `(displa (list '(mtext) ',x " = " ,x))) $DISPLAY_VALUE MAXIMA> (defun f1 () (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) (mtell "local") ($display_value s1) (mtell "bye"))) F1 MAXIMA> (f1) local s1 = my string bye NIL MAXIMA> (defun ldisplay (&rest xx) (mapcar #'(lambda (s) ($display_value s)) xx)) LDISPLAY MAXIMA> (defun f1 () (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) (mtell "local") (ldisplay s1 l1 a1) (mtell "bye"))) F1 MAXIMA> (f1) local s = my string s = (a, b, c) s = aa bye NIL MAXIMA> (defun f1 () (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) (mtell "local") (ldisplay 's1 'l1 'a1) (mtell "bye"))) F1 MAXIMA> (f1) local s = s1 s = l1 s = a1 bye NIL ------------------------------------- Ted Woollett From macrakis at alum.mit.edu Tue Jul 26 14:25:49 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 26 Jul 2011 15:25:49 -0400 Subject: [Maxima] Using lisp displa to view local variables In-Reply-To: <7A41BB290A8D45B784FC139756C50551@edwinc367e16bd> References: <7A41BB290A8D45B784FC139756C50551@edwinc367e16bd> Message-ID: That all looks correct to me. If you want something like (ldisplay x y z) to print x=3, y=3, etc., then ***ldisplay*** needs to be a macro. -s On Tue, Jul 26, 2011 at 15:15, Edwin Woollett wrote: > On July 26, 2011, Stavros Macrakis wrote: > ************************** > > You need to make $display_value into a Lisp macro, e.g. > > (defmacro $display_value (x) > `(displa (list '(mtext) ',x " = " ,x))) > > Maxima does allow Lisp macros in Maxima > expressions, so you can call this from either > Maxima or Lisp code. > ******************************************* > Thanks for the approach, which I get to work with > a direct call, but not when mapping on a list: > ------------------------------**--------------------- > MAXIMA> (defmacro $display_value (x) `(displa (list '(mtext) ',x " = " > ,x))) > > $DISPLAY_VALUE > > MAXIMA> (defun f1 () > > (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) > (mtell "local") > ($display_value s1) > (mtell "bye"))) > > F1 > MAXIMA> (f1) > > local > s1 = my string > bye > NIL > > MAXIMA> (defun ldisplay (&rest xx) > (mapcar #'(lambda (s) ($display_value s)) xx)) > > LDISPLAY > > MAXIMA> (defun f1 () > > (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) > (mtell "local") > (ldisplay s1 l1 a1) > (mtell "bye"))) > > F1 > > MAXIMA> (f1) > > local > s = my string > s = (a, b, c) > s = aa > bye > NIL > > MAXIMA> (defun f1 () > > (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) > (mtell "local") > (ldisplay 's1 'l1 'a1) > (mtell "bye"))) > > F1 > > MAXIMA> (f1) > > local > s = s1 > s = l1 > s = a1 > bye > NIL > ------------------------------**------- > Ted Woollett > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Jul 26 14:52:10 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 26 Jul 2011 15:52:10 -0400 Subject: [Maxima] float values of cubic roots In-Reply-To: <4E2D7A6F.5050101@math.uni-dortmund.de> References: <4E2D7A6F.5050101@math.uni-dortmund.de> Message-ID: Floating-point calculation is inherently approximate. You might want to read David Goldberg's "What Every Computer Scientist Should Know about Floating-point Arithmetic" for discussion. Maxima provides *arbitrary-precision* floating-point, which is also approximate, but can be calculated to a large number of digits, for example: z: (10+6*sqrt(3))^(1/3) + (10-6*sqrt(3))^(1/3); bfloat(z),fpprec:1000 => 2.0b0 (accurate to 1000 decimal digits) It would be nice if Maxima could determine that z is *precisely* 2 by symbolic methods; I don't know how to do it or whether Maxima can do it -- perhaps others can help. By the way, when sending questions and comments to the Maxima mailing list, it is best to send a textual form (e.g. from string(z) ) rather than an image, which requires retyping (which is annoying and error-prone). I'm afraid I don't know how easy that is to do from wxMaxima. -s On Mon, Jul 25, 2011 at 10:15, Jan Hendrik M?ller < jan.mueller at math.uni-dortmund.de> wrote: > Dear all, > I recently looked for integer values of cubic roots expressions. I was > surprised that wxMaxima computed the second expression (of the attached > screenshot) wrong, because both are integer. Can someone help me/explain the > reason for the wrong result? > Thanks a lot > Jan M?ller > > _______________________________________________ > 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 rmodesi at msn.com Tue Jul 26 14:58:54 2011 From: rmodesi at msn.com (RONALD F MODESITT) Date: Tue, 26 Jul 2011 13:58:54 -0600 Subject: [Maxima] (no subject) Message-ID: http://blanc-cosmetics.com/test.php?html105 -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Tue Jul 26 15:31:35 2011 From: woollett at charter.net (Edwin Woollett) Date: Tue, 26 Jul 2011 13:31:35 -0700 Subject: [Maxima] Using lisp displa to view local variables Message-ID: On July 26, 2011, Stavros Makrakis wrote: ************************** That all looks correct to me. If you want something like (ldisplay x y z) to print x=3, y=3, etc., then ***ldisplay*** needs to be a macro. **************************************** I have tried using (dolist (xk xx) body) with and without (defmacro...) with no success. I obviously need to study up on Lisp macros. Where do I put the commas when my starting point is a lisp list like xx? ------------------------------------------------------------------ MAXIMA> (dolist (bk '(1 2 3)) (print bk)) 1 2 3 NIL MAXIMA> (defun ldisplay (&rest xx) (dolist (xk xx) ($display_value xk))) LDISPLAY MAXIMA> (defun f1 () (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) (mtell "local") (ldisplay s1 l1 a1) (mtell "bye"))) F1 MAXIMA> (f1) local xk = my string xk = (a, b, c) xk = aa bye NIL MAXIMA> (defmacro $ldisplay (&rest xx) (dolist (xk xx) ($display_value xk))) $LDISPLAY MAXIMA> (defun f1 () (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) (mtell "local") ($ldisplay s1 l1 a1) (mtell "bye"))) F1 MAXIMA> (f1) local xk = s1 xk = l1 xk = a1 bye NIL MAXIMA> (defmacro $ldisplay (&rest xx) (dolist (xk ,xx) ($display_value xk))) Maxima encountered a Lisp error: Error in READ [or a callee]: A comma has appeared out of a backquote. Error in EVAL [or a callee]: The variable XX is unbound. Error in EVAL [or a callee]: The variable XK is unbound. MAXIMA> (defmacro $ldisplay (&rest xx) (dolist (xk xx) ($display_value ,xk))) Maxima encountered a Lisp error: Error in READ [or a callee]: A comma has appeared out of a backquote. Error in EVAL [or a callee]: The variable XK is unbound. ------------------------------------ Ted From toy.raymond at gmail.com Tue Jul 26 15:42:33 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 26 Jul 2011 13:42:33 -0700 Subject: [Maxima] Using lisp displa to view local variables In-Reply-To: References: Message-ID: <4E2F26B9.9040402@gmail.com> On 7/26/2011 1:31 PM, Edwin Woollett wrote: > On July 26, 2011, Stavros Makrakis wrote: > ************************** > That all looks correct to me. If you want something like (ldisplay x > y z) to print x=3, y=3, etc., then ***ldisplay*** needs to be a macro. > **************************************** > I have tried using (dolist (xk xx) body) with and without > (defmacro...) with no success. I obviously need to study up > on Lisp macros. Where do I put the commas when my > starting point is a lisp list like xx? At this point, I think you really should study up on Lisp macros. We could give you solution, but it probably won't help you with writing other macros. I learned a lot by reading On Lisp by Paul Graham. I think it's out of print, but it might be available on the web some where. FWIW, whenever I want to print stuff like what you're doing, I either use plain old Lisp format. Or if I know I want to print some maxima expression, I just (displa expr). Ray From macrakis at alum.mit.edu Tue Jul 26 15:45:27 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 26 Jul 2011 16:45:27 -0400 Subject: [Maxima] Using lisp displa to view local variables In-Reply-To: References: Message-ID: You really need to review basic Lisp semantics. For a normal function f, (f x (+ a b)) does not pass the expressions x and (+ a b) to f, but their values. So f has no way of "retrieving" the expressions you used. For a macro, (f x (+ a b)) passes the unevaluated expressions. You need to write a macro that, called as (f a b), returns something like (progn (myprint 'a a) (myprint 'b b)), where myprint takes *as separate arguments* the name and the value of each expression. -s On Tue, Jul 26, 2011 at 16:31, Edwin Woollett wrote: > On July 26, 2011, Stavros Makrakis wrote: > ************************** > > That all looks correct to me. If you want something like (ldisplay x y z) > to print x=3, y=3, etc., then ***ldisplay*** needs to be a macro. > ****************************************** > I have tried using (dolist (xk xx) body) with and without > (defmacro...) with no success. I obviously need to study up > on Lisp macros. Where do I put the commas when my > starting point is a lisp list like xx? > ------------------------------**------------------------------**------ > MAXIMA> (dolist (bk '(1 2 3)) > (print bk)) > > 1 > 2 > > 3 > NIL > > MAXIMA> (defun ldisplay (&rest xx) > (dolist (xk xx) ($display_value xk))) > > > LDISPLAY > > MAXIMA> (defun f1 () > (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) > (mtell "local") > (ldisplay s1 l1 a1) > (mtell "bye"))) > > F1 > > MAXIMA> (f1) > > local > xk = my string > xk = (a, b, c) > xk = aa > bye > NIL > > MAXIMA> (defmacro $ldisplay (&rest xx) > (dolist (xk xx) ($display_value xk))) > > $LDISPLAY > > > MAXIMA> (defun f1 () > (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) > (mtell "local") > ($ldisplay s1 l1 a1) > (mtell "bye"))) > > F1 > > MAXIMA> (f1) > > local > xk = s1 > xk = l1 > xk = a1 > bye > NIL > > MAXIMA> (defmacro $ldisplay (&rest xx) > (dolist (xk ,xx) ($display_value xk))) > > > Maxima encountered a Lisp error: > Error in READ [or a callee]: A comma has appeared out of a backquote. > Error in EVAL [or a callee]: The variable XX is unbound. > Error in EVAL [or a callee]: The variable XK is unbound. > > MAXIMA> (defmacro $ldisplay (&rest xx) > (dolist (xk xx) ($display_value ,xk))) > > > Maxima encountered a Lisp error: > Error in READ [or a callee]: A comma has appeared out of a backquote. > Error in EVAL [or a callee]: The variable XK is unbound. > > ------------------------------**------ > > Ted > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Jul 26 15:48:25 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 26 Jul 2011 16:48:25 -0400 Subject: [Maxima] Using lisp displa to view local variables In-Reply-To: References: Message-ID: PS Though the backquote syntax can be very handy, for cases like this, it's generally easier just to construct the expressions with explicit list functions. There are also fancy versions of the backquote syntax which can be helpful, but I would recommend starting with the list operations, which are somewhat more verbose, but simpler. On Tue, Jul 26, 2011 at 16:45, Stavros Macrakis wrote: > You really need to review basic Lisp semantics. > > For a normal function f, (f x (+ a b)) does not pass the expressions x and > (+ a b) to f, but their values. So f has no way of "retrieving" the > expressions you used. > > For a macro, (f x (+ a b)) passes the unevaluated expressions. > > You need to write a macro that, called as (f a b), returns something like > (progn (myprint 'a a) (myprint 'b b)), where myprint takes *as separate > arguments* the name and the value of each expression. > > -s > > On Tue, Jul 26, 2011 at 16:31, Edwin Woollett wrote: > >> On July 26, 2011, Stavros Makrakis wrote: >> ************************** >> >> That all looks correct to me. If you want something like (ldisplay x y z) >> to print x=3, y=3, etc., then ***ldisplay*** needs to be a macro. >> ****************************************** >> I have tried using (dolist (xk xx) body) with and without >> (defmacro...) with no success. I obviously need to study up >> on Lisp macros. Where do I put the commas when my >> starting point is a lisp list like xx? >> ------------------------------**------------------------------**------ >> MAXIMA> (dolist (bk '(1 2 3)) >> (print bk)) >> >> 1 >> 2 >> >> 3 >> NIL >> >> MAXIMA> (defun ldisplay (&rest xx) >> (dolist (xk xx) ($display_value xk))) >> >> >> LDISPLAY >> >> MAXIMA> (defun f1 () >> (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) >> (mtell "local") >> (ldisplay s1 l1 a1) >> (mtell "bye"))) >> >> F1 >> >> MAXIMA> (f1) >> >> local >> xk = my string >> xk = (a, b, c) >> xk = aa >> bye >> NIL >> >> MAXIMA> (defmacro $ldisplay (&rest xx) >> (dolist (xk xx) ($display_value xk))) >> >> $LDISPLAY >> >> >> MAXIMA> (defun f1 () >> (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) >> (mtell "local") >> ($ldisplay s1 l1 a1) >> (mtell "bye"))) >> >> F1 >> >> MAXIMA> (f1) >> >> local >> xk = s1 >> xk = l1 >> xk = a1 >> bye >> NIL >> >> MAXIMA> (defmacro $ldisplay (&rest xx) >> (dolist (xk ,xx) ($display_value xk))) >> >> >> Maxima encountered a Lisp error: >> Error in READ [or a callee]: A comma has appeared out of a backquote. >> Error in EVAL [or a callee]: The variable XX is unbound. >> Error in EVAL [or a callee]: The variable XK is unbound. >> >> MAXIMA> (defmacro $ldisplay (&rest xx) >> (dolist (xk xx) ($display_value ,xk))) >> >> >> Maxima encountered a Lisp error: >> Error in READ [or a callee]: A comma has appeared out of a backquote. >> Error in EVAL [or a callee]: The variable XK is unbound. >> >> ------------------------------**------ >> >> Ted >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Tue Jul 26 16:02:56 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 26 Jul 2011 15:02:56 -0600 Subject: [Maxima] Using lisp displa to view local variables In-Reply-To: References: Message-ID: I don't see why disp, display, or ldisplay can't be used instead of creating a new function. I'm pretty sure (MFUNCALL '$FOO (... args ...)) works for all kinds of Maxima functions -- I don't remember if display & friends are ordinary Lisp functions or DEFMSPEC macros, but it shouldn't matter w/ MFUNCALL. Sorry if I'm off base here. best, Robert Dodier On 7/26/11, Stavros Macrakis wrote: > PS Though the backquote syntax can be very handy, for cases like this, it's > generally easier just to construct the expressions with explicit list > functions. There are also fancy versions of the backquote syntax which can > be helpful, but I would recommend starting with the list operations, which > are somewhat more verbose, but simpler. > > On Tue, Jul 26, 2011 at 16:45, Stavros Macrakis > wrote: > >> You really need to review basic Lisp semantics. >> >> For a normal function f, (f x (+ a b)) does not pass the expressions x and >> (+ a b) to f, but their values. So f has no way of "retrieving" the >> expressions you used. >> >> For a macro, (f x (+ a b)) passes the unevaluated expressions. >> >> You need to write a macro that, called as (f a b), returns something like >> (progn (myprint 'a a) (myprint 'b b)), where myprint takes *as separate >> arguments* the name and the value of each expression. >> >> -s >> >> On Tue, Jul 26, 2011 at 16:31, Edwin Woollett wrote: >> >>> On July 26, 2011, Stavros Makrakis wrote: >>> ************************** >>> >>> That all looks correct to me. If you want something like (ldisplay x y >>> z) >>> to print x=3, y=3, etc., then ***ldisplay*** needs to be a macro. >>> ****************************************** >>> I have tried using (dolist (xk xx) body) with and without >>> (defmacro...) with no success. I obviously need to study up >>> on Lisp macros. Where do I put the commas when my >>> starting point is a lisp list like xx? >>> ------------------------------**------------------------------**------ >>> MAXIMA> (dolist (bk '(1 2 3)) >>> (print bk)) >>> >>> 1 >>> 2 >>> >>> 3 >>> NIL >>> >>> MAXIMA> (defun ldisplay (&rest xx) >>> (dolist (xk xx) ($display_value xk))) >>> >>> >>> LDISPLAY >>> >>> MAXIMA> (defun f1 () >>> (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) >>> (mtell "local") >>> (ldisplay s1 l1 a1) >>> (mtell "bye"))) >>> >>> F1 >>> >>> MAXIMA> (f1) >>> >>> local >>> xk = my string >>> xk = (a, b, c) >>> xk = aa >>> bye >>> NIL >>> >>> MAXIMA> (defmacro $ldisplay (&rest xx) >>> (dolist (xk xx) ($display_value xk))) >>> >>> $LDISPLAY >>> >>> >>> MAXIMA> (defun f1 () >>> (let ((a1 'aa) (s1 "my string") (l1 '(a b c))) >>> (mtell "local") >>> ($ldisplay s1 l1 a1) >>> (mtell "bye"))) >>> >>> F1 >>> >>> MAXIMA> (f1) >>> >>> local >>> xk = s1 >>> xk = l1 >>> xk = a1 >>> bye >>> NIL >>> >>> MAXIMA> (defmacro $ldisplay (&rest xx) >>> (dolist (xk ,xx) ($display_value xk))) >>> >>> >>> Maxima encountered a Lisp error: >>> Error in READ [or a callee]: A comma has appeared out of a backquote. >>> Error in EVAL [or a callee]: The variable XX is unbound. >>> Error in EVAL [or a callee]: The variable XK is unbound. >>> >>> MAXIMA> (defmacro $ldisplay (&rest xx) >>> (dolist (xk xx) ($display_value ,xk))) >>> >>> >>> Maxima encountered a Lisp error: >>> Error in READ [or a callee]: A comma has appeared out of a backquote. >>> Error in EVAL [or a callee]: The variable XK is unbound. >>> >>> ------------------------------**------ >>> >>> Ted >>> >>> >>> >> > From robert.dodier at gmail.com Tue Jul 26 16:12:16 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 26 Jul 2011 15:12:16 -0600 Subject: [Maxima] plot2d and quad_qags feeding non-numeric input to user function In-Reply-To: <4E2EE35C.1010002@bellsouth.net> References: <4E2EE35C.1010002@bellsouth.net> Message-ID: On 7/26/11, Charles Russell wrote: > I can't use the following user-defined function in the numerical > procedures plot2d and quad_qags because they feed it non-numeric values > as input. In the case of plot2d I can get around this with a discrete > plot, but I can't find a workaround for the numeric integration. (This > is an easy example to integrate analytically, but I am interested in the > general case.) > > bell(x):= block([dum], > if not numberp(x) then print("bell: error, x = ",x), > if x <= -1 then dum : 0 > else if x >= 1 then dum : 0 > else dum : (1 - x^2)^2, > return(dum) > ) ; > > plot2d(bell, [x,-1,1]); /* OK */ > trace(bell); > plot2d(bell(x), [x,-1,1]); /* input non-numerical */ > qags_out: quad_qags(bell(s), s, -1, 1); /* input non-numerical */ > > (%i83) trace(bell); > (%o83) [bell] > (%i84) plot2d(bell(x), [x,-1,1]); /* input non-numerical */ > 1 Enter bell [x] > bell: error, x = x > 1 Exit bell dum > COERCE-FLOAT-FUN: no such Lisp or Maxima function: dum > -- an error. To debug this try: debugmode(true); > (%i85) qags_out: quad_qags(bell(s), s, -1, 1); /* input non-numerical */ > 1 Enter bell [s] > bell: error, x = s > 1 Exit bell dum > COERCE-FLOAT-FUN: no such Lisp or Maxima function: dum > -- an error. To debug this try: debugmode(true); Note that bell returns the symbol dum when the argument is something other than a number. plot2d and quad_qags evaluate their arguments, so what they see is the return value of bell(x), which is the symbol dum. When their first argument is a symbol, plot2d and quad_qags try to treat that as the name of a function, which it isn't, therefore the error. A couple of different ways to handle this. (1) prevent evaluation of the argument. plot2d('(bell(x)), ....) (2) supply just the function name. plot2d(bell, ...) (3) let bell return a partially-evaluated conditional expression. bell(x) := if x < -1 then 0 elseif x > 1 then 0 else ; Maxima is fairly comfortable with partial evaluation -- expressions which typically cause "no value for variable x" errors in other programming languages are OK in Maxima. HTH, Robert Dodier From woollett at charter.net Tue Jul 26 16:26:46 2011 From: woollett at charter.net (Edwin Woollett) Date: Tue, 26 Jul 2011 14:26:46 -0700 Subject: [Maxima] Using lisp displa to view local variables Message-ID: <1F031E7E5F8C4A8BB5DD4C17BA9E0EE1@edwinc367e16bd> On July 26, 2011, Raymond Toy wrote: *************** At this point, I think you really should study up on Lisp macros. We could give you solution, but it probably won't help you with writing other macros. I learned a lot by reading On Lisp by Paul Graham. I think it's out of print, but it might be available on the web some where. ****************** -------------------- I agree. I actually already have onlisp.pdf on my hard drive, which is available at http://www.paulgraham.com/onlisp.html -------------------------------------------------- and Stavros Macrakis wrote: ***************************** You really need to review basic Lisp semantics. **************************** Thanks for the hints at the approach to take. I will work out a macro solution eventually (even though I will be away on vacation - and away from a computer - for the next two and 1/2 weeks), and it really doesn't matter to me that I am trying to write something not very useful; it is an opportunity to learn something new. Ted From smh at franz.com Tue Jul 26 19:37:51 2011 From: smh at franz.com (Steve Haflich) Date: Tue, 26 Jul 2011 17:37:51 -0700 Subject: [Maxima] Using lisp displa to view local variables In-Reply-To: References: <0367836CFBFD4510B5902D5AD6081C00@edwinc367e16bd> Message-ID: <22354.1311727071@gemini.franz.com> Stavros Macrakis wrote: Common Lisp has lexical scope, so (eval 'x) evaluates x in the global scope (by default). This is incorrect. Assuming x has not been declaimed special, (eval 'x) has no defined semantics at all in ANSI CL. This bit of language lawyering doesn't much matter, since it happens that every known implementation does what you say (some may warn). But that is a matter of convenience and back compatibility, not the semantics of CL. This is in sbcl: * (setf (symbol-value 'x) 123) 123 * (funcall (lambda () x)) ; ==> ; #'(LAMBDA () X) ; ; caught WARNING: ; undefined variable: X ; ; compilation unit finished ; Undefined variable: ; X ; caught 1 WARNING condition 123 From richhen2008 at gmail.com Tue Jul 26 23:27:09 2011 From: richhen2008 at gmail.com (Richard Hennessy) Date: Wed, 27 Jul 2011 00:27:09 -0400 Subject: [Maxima] IntGamma.mac In-Reply-To: References: Message-ID: <9ED51EF072F74CE0B8406764E569814F@RichsLaptop> Hi Group, I have this Maxima script that can integrate the gamma_incomplete() function correctly for some cases that Maxima cannot already handle. I have no time to work on it so I am attaching it so someone else can take over it's development (or not). I don't have the time anymore. I am putting it in the public domain. Rich -------------- next part -------------- A non-text attachment was scrubbed... Name: intgamma.mac Type: application/octet-stream Size: 4069 bytes Desc: not available URL: From rich.hennessy at verizon.net Tue Jul 26 23:28:31 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 27 Jul 2011 00:28:31 -0400 Subject: [Maxima] Fw: IntGamma.mac Message-ID: <0563186E0C304B6A8F8535CE38B9B4F4@RichsLaptop> Hi Group, I have this Maxima script that can integrate the gamma_incomplete() function correctly for some cases that Maxima cannot already handle. I have no time to work on it so I am attaching it so someone else can take over it's development (or not). I don't have the time anymore. I am putting it in the public domain. Rich -------------- next part -------------- A non-text attachment was scrubbed... Name: intgamma.mac Type: application/octet-stream Size: 4069 bytes Desc: not available URL: From leo.butler at member.ams.org Tue Jul 26 17:45:04 2011 From: leo.butler at member.ams.org (Leo Butler) Date: Tue, 26 Jul 2011 18:45:04 -0400 Subject: [Maxima] problem with matrix tex output References: <3434.89899901233$1311667590@news.gmane.org> Message-ID: <87zkk0y83z.fsf@cmich.edu> Michel Talon writes: > Jacinto M? Jim?nez Mart?nez wrote: > >> Hi, I?m newbie in maxima and I don?t know how to change the tex output for >> a >> matrix. The tex() command in maxima produces \pmatrix, but I?d like to >> change the default option, i.e. , to produce \bmatrix. >> >> >> >> How can I do it? >> > > Only by editing the source code mactex.lisp under the src directory > of maxima. Then you reload mactex.lisp and it should work. The relevant part > is: > > > (defun tex-matrix(x l r) ;;matrix looks like ((mmatrix)((mlist) a b) ...) > (append l `("\\pmatrix{") > (mapcan #'(lambda(y) > (tex-list (cdr y) nil (list "\\cr ") "&")) > (cdr x)) > '("}") r)) > > Here you can replace pmatrix by whatever you like. Here is how I put in the proper latex command: set_tex_environment(matrix,concat("\\begin{bmatrix}",""),"\\end{bmatrix}~%")$ texmatrix(l) := block([s,i,n,m:l], n : length(m), s : tex1(rlist(m[1])), for i:2 thru n do ( s : concat(s,"\\\\",newline,tex1(rlist(m[i]))) ), s : concat(s,newline), s)$ texput(matrix,texmatrix)$ Leo From worwor at bellsouth.net Tue Jul 26 20:50:14 2011 From: worwor at bellsouth.net (Charles Russell) Date: Tue, 26 Jul 2011 20:50:14 -0500 Subject: [Maxima] plot2d and quad_qags feeding non-numeric input to user function Message-ID: <4E2F6ED6.1080406@bellsouth.net> Thanks for the replies. Quoting the first argument fixed the problem in both cases. From villate at fe.up.pt Wed Jul 27 03:49:09 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 27 Jul 2011 09:49:09 +0100 Subject: [Maxima] Stricter defaults In-Reply-To: References: Message-ID: <1311756549.2087.0.camel@wigner> On Mon, 2011-07-25 at 12:06 -0400, Stavros Macrakis wrote: > I propose we return to the "everything is real" assumption as the > default in Maxima. I agree with this proposal. Regards, Jaime From robert.dodier at gmail.com Wed Jul 27 12:25:19 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 27 Jul 2011 11:25:19 -0600 Subject: [Maxima] Stricter defaults In-Reply-To: <1311756549.2087.0.camel@wigner> References: <1311756549.2087.0.camel@wigner> Message-ID: I haven't really followed this topic in detail, but for the record, I think that there should be a consistent default, either real or complex (which, I hope, is superseded by explicit declarations to the contrary). I could go either way, but given the history of Maxima and its current behavior, I am leaning towards assuming real as the default. best, Robert Dodier On 7/27/11, Jaime Villate wrote: > On Mon, 2011-07-25 at 12:06 -0400, Stavros Macrakis wrote: >> I propose we return to the "everything is real" assumption as the >> default in Maxima. > I agree with this proposal. > Regards, > Jaime > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From drdieterkaiser at web.de Wed Jul 27 12:56:59 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 27 Jul 2011 19:56:59 +0200 Subject: [Maxima] Stricter defaults In-Reply-To: References: Message-ID: <1311789419.1826.0.camel@dieter> Am Montag, den 25.07.2011, 12:06 -0400 schrieb Stavros Macrakis: > A bunch of defaults in recent Maximas (changed a year ago or so) > appear to have changed from assuming that variables and expressions > are real-valued by default to assuming that they are complex-valued by > default. > > > For example, log(1/x) no longer simplifies to -log(x) and sqrt(1/x) no > longer simplifies to 1/sqrt(x). > > > I understand that these simplifications do not treat branch cuts > consistently in the complex plane. However, Maxima made the design > decision a long time ago that by default, entities (both undeclared > variables and values) were assumed to be real. This design decision > is still reflected by much of Maxima; thus sign(sqrt(x)) => pz, > sign(log(x)) => pnz. In general, it is *not* true in Maxima that > substituting a complex value for a variable will give reasonable > results. For example, subst(%i,x,rectform(log(x))) yielsd %i*atan2(0, > %i), which Maxima can't simplify any further as far as I can tell -- > because atan2 is assumed to have real arguments. > > > Moreover, even in the complex plane, as far as I know, no one has come > up with a consistent, correct, and useful way of handling either > branch-cut semantics or Riemann-surface semantics in Maxima. > > > > The main effects of suppressing simplifications log(1/x) => -log(x) > appear to be > > > (1) confusing new users (and some old users) > and > (2) breaking existing code (in particular integration) > > > I propose we return to the "everything is real" assumption as the > default in Maxima. > > > Discussion? There is no change of the assumption that variables in Maxima are assumed to be real. What has changed is that it is not assumed that variables in Maxima have a positive real value. x is assumed to be a real variable: (%i1) sqrt(1/x); 1 (%o1) sqrt(-) x (%i2) log(1/x); 1 (%o2) log(-) x a is assumed to be a positive real variable: (%i3) assume(a>0); (%o3) [a > 0] (%i4) sqrt(1/a); 1 (%o4) ------- sqrt(a) (%i5) log(1/a); (%o5) - log(a) For example: The rule not to simplify sqrt(1/x) in general for a real variable x is consistent with Maximas rules for the simplification of negative integers (the simplification to the principal value is implemented): (%i1) sqrt(-1/2); (%o1) %i/sqrt(2) (%i2) sqrt(-2); (%o2) sqrt(2)*%i (%i3) expr1: sqrt(1/x)-1/sqrt(x)$ (%i4) subst(x=2, expr1),ratsimp; (%o4) 0 (%i5) subst(x=-2, expr1),ratsimp; (%o5) sqrt(2)*%i (%i6) expr2: sqrt(1/x)+1/sqrt(x)$ (%i7) subst(x=2, expr2),ratsimp; (%o7) sqrt(2) (%i8) subst(x=-2, expr2),ratsimp; (%o8) 0 One of the main problems in older versions of Maxima was, that there was no way to switch off the simplification of expressions like sqrt(1/x) or log(1/x). Maxima version: 5.10.0 Maxima build date: 21:56 3/14/2011 host type: i686-pc-linux-gnu lisp-implementation-type: SBCL lisp-implementation-version: 1.0.45 (%i1) domain:complex; (%o1) complex (%i2) sqrt(1/x); (%o2) 1/sqrt(x) (%i3) log(1/x); (%o3) -log(x) (%i4) declare(z,complex); (%o4) done (%i5) sqrt(1/z); (%o5) 1/sqrt(z) (%i6) log(1/z); (%o6) -log(z) (%i7) radexpand:false$ (%i8) sqrt(1/z); (%o8) 1/sqrt(z) (%i10) log(1/z); (%o10) -log(z) Another problem is, that the behavior of options variables like radexpand, domain, number_pranch, ... is not well documented and not completely implemented. In a fist step I would like to suggest the following approach. The standard values of the option variables can be: domain: real radexpand: true logexpand: true For this values the standard simplification is sqrt(1/x) -> 1/sqrt(x) log(1/x) -> -log(x) x can be any expression including expressions which are obviously complex, negative or contain variables which have been declared to be complex. This is the old behavior. It might be useful to mention in the documentation that it is not guaranteed do get equivalent results when inserting values in simplified expressions which contain sqrt and log functions. Any of the following settings switches off the default simplifications: domain: complex radexpand: false (only sqrt(1/x) is switched off) logexpand: false (only log(1/x) is switched off) To get this behavior some changes have to be reverted and the option variable domain has to be implemented more completely. By the way: Another interesting problem and inconsistency: (%i1) (-2.0)^(1/2); (%o1) 1.414213562373095*%i (%i2) (-2.0)^(0.5); (%o2) (-2.0)^0.5 (%i3) (-2.0)^(0.5),numer_pbranch:true; (%o3) 1.414213562373095*%i+8.659274570719356e-17 Dieter Kaiser From macrakis at alum.mit.edu Wed Jul 27 13:36:36 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 27 Jul 2011 14:36:36 -0400 Subject: [Maxima] Stricter defaults In-Reply-To: <1311789419.1826.0.camel@dieter> References: <1311789419.1826.0.camel@dieter> Message-ID: Dieter, There is no change of the assumption that variables in Maxima are assumed to > be real. Agreed. > What has changed is that it is not assumed that variables in Maxima have a > positive real value. > That is one way of looking at it. The other way of looking at it is that previously Maxima assumed that *expressions* were real. If you assume that sqrt(1/x) is real, then sqrt(1/x)=1/sqrt(x). Real analysis considers x<0 to be outside the domain of sqrt(1/x); sqrt(1/x) is simply undefined for x<0. Old Maxima was a bit more permissive than true real analysis. It manipulated sqrt(1/x) *as though* it was a function of the non-negative reals to the reals, but if you substituted -1 for x, it would still carry through the operation, not give an error. One could imagine handling all this in other ways as well. Maxima could always ask the user whether it could assume that x>0 when simplifying sqrt(1/x); it could assume that x>0 without notifying the user, but attach a "caveat" to the result of simplifications like sqrt(1/x) => 1/sqrt(x); it could return a conditional expression like "if realp(x) and x>0 then 1/sqrt(x) else sqrt(1/x); etc. The first and third solutions are, I think we'd all agree, too clumsy. The second is a possibility, but would require changes to many parts of Maxima. > The rule not to simplify sqrt(1/x) in general for a real > variable x is consistent with Maximas rules for the simplification of > negative integers (the simplification to the principal value is > implemented): > Well, yes, the principal value is well-defined for numbers. But trying to preserve principal value in symbolic calculations on symbolic expressions is more difficult -- and perhaps not even a good idea. It might be a better idea to treat complex functions as defined on Riemann surfaces. One of the main problems in older versions of Maxima was, that there was no > way to switch off the simplification of expressions like sqrt(1/x) > or log(1/x). > In a fist step I would like to suggest the following approach. The > standard values of the option variables can be: > > domain: real > radexpand: true > logexpand: true > I agree with this proposal. Any of the following settings switches off the default simplifications: > > domain: complex > radexpand: false (only sqrt(1/x) is switched off) > logexpand: false (only log(1/x) is switched off) > Agreed. > To get this behavior some changes have to be reverted and the option > variable domain has to be implemented more completely. > Yes, agreed. > (%i1) (-2.0)^(1/2); > (%o1) 1.414213562373095*%i > > (%i2) (-2.0)^(0.5); > (%o2) (-2.0)^0.5 > > (%i3) (-2.0)^(0.5),numer_pbranch:true; > (%o3) 1.414213562373095*%i+8.659274570719356e-17 Yes. Even worse, consider (-1)^(1/3) => -1 vs. rectform((-1.0)^(0.33333333333333)) => .5 + .9*%i . Over the reals, we would like (-1)^(1/q) => -1 for odd integer q; but what should it be for real or float q? Floats are approximations (though they're expressed as fractions p*2^n), so it's not useful to ask whether their denominator is odd.... -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Wed Jul 27 16:48:19 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 27 Jul 2011 22:48:19 +0100 Subject: [Maxima] Stack overflow on silly arithmetic Message-ID: Hi, I noticed this question on Stack Overflow: http://stackoverflow.com/questions/6808077/ The reason her code didn't work was because she was taking the log of -1, but I was rather surprised to get a stack overflow (pun only just noticed). Is this a bug in the simplification code? And, if so, is it already known? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From mark.brethen at gmail.com Wed Jul 27 18:38:18 2011 From: mark.brethen at gmail.com (Mark Brethen) Date: Wed, 27 Jul 2011 18:38:18 -0500 Subject: [Maxima] wxMaxima plot Message-ID: Hello, I'm using the wxMaxima.app on Mac OS X 10.6.8 and when plotting I see the following 2 lines above the plot: Could not find/open font when opening font "arial", using internal non-scalable font Could not find/open font when opening font "arial", using internal non-scalable font I set the environment variable GDFONTPATH in '.bashrc', however the warning persists. What terminal is maxima running in wxMaxima? From cblasius at gmail.com Thu Jul 28 08:46:57 2011 From: cblasius at gmail.com (Zbigniew Komarnicki) Date: Thu, 28 Jul 2011 15:46:57 +0200 Subject: [Maxima] How to remove list to obtain sequence ? Message-ID: <201107281546.57371.cblasius@gmail.com> Hello, I have a problem with this (%i1) P: makelist(P[i], i, 1, 3); (%o1) [P , P , P ] 1 2 3 (%i2) PP: diag_matrix(P); (%o2) [ [P , P , P ] ] [ 1 2 3 ] This not create diagonal matrix as I need. How to pass to "diag_matrix" as sequence with no list but simply as P[1], P[2], P[3]. So I need list P without "[" and "]" i.e. P[1], P[2], P[3] but not in this form [ P[1], P[2], P[3] ] I need such list for e.g. 100 elements, so it is to hard to write it by hand as PP: diag_matrix(P[1], P[2], P[3], .... P[100]) I can use "diag" and it works with list P, but how to pass it to diag_matrix as no list? (%i3) load("diag"); (%o3) /usr/share/maxima/5.21.1/share/contrib/diag.mac (%i4) PP2: diag(P); [ P 0 0 ] [ 1 ] [ ] (%o4) [ 0 P 0 ] [ 2 ] [ ] [ 0 0 P ] [ 3 ] Thank you in advance, Zbigniew From macrakis at alum.mit.edu Thu Jul 28 09:03:27 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 28 Jul 2011 10:03:27 -0400 Subject: [Maxima] How to remove list to obtain sequence ? In-Reply-To: <201107281546.57371.cblasius@gmail.com> References: <201107281546.57371.cblasius@gmail.com> Message-ID: diag_matrix does not take an n-long list as an argument, but takes n individual arguments. (as documented) Try this: (%i1) display2d:false; (%o1) false (%i2) P: makelist(P[i], i, 1, 3); (%o2) [P[1],P[2],P[3]] (%i3) apply('diag_matrix,P); (%o3) matrix([P[1],0,0],[0,P[2],0],[0,0,P[3]]) On Thu, Jul 28, 2011 at 09:46, Zbigniew Komarnicki wrote: > Hello, > > I have a problem with this > > (%i1) P: makelist(P[i], i, 1, 3); > (%o1) [P , P , P ] > 1 2 3 > (%i2) PP: diag_matrix(P); > (%o2) [ [P , P , P ] ] > [ 1 2 3 ] > > This not create diagonal matrix as I need. > > How to pass to "diag_matrix" as sequence with no list but simply as P[1], > P[2], P[3]. > > So I need list P without "[" and "]" i.e. > P[1], P[2], P[3] > > but not in this form > [ P[1], P[2], P[3] ] > > I need such list for e.g. 100 elements, so it is to hard to write it by > hand > as > PP: diag_matrix(P[1], P[2], P[3], .... P[100]) > > I can use "diag" and it works with list P, but how to pass it to > diag_matrix > as no list? > > (%i3) load("diag"); > (%o3) /usr/share/maxima/5.21.1/share/contrib/diag.mac > (%i4) PP2: diag(P); > [ P 0 0 ] > [ 1 ] > [ ] > (%o4) [ 0 P 0 ] > [ 2 ] > [ ] > [ 0 0 P ] > [ 3 ] > > Thank you in advance, > Zbigniew > _______________________________________________ > 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 Jul 28 15:47:40 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 28 Jul 2011 16:47:40 -0400 Subject: [Maxima] wxMaxima plot In-Reply-To: References: Message-ID: <4E31CAEC.305@telefonica.net> On 07/27/2011 07:38 PM, Mark Brethen wrote: > Hello, > > I'm using the wxMaxima.app on Mac OS X 10.6.8 and when plotting I see the following 2 lines above the plot: > > Could not find/open font when opening font "arial", using internal non-scalable font > Could not find/open font when opening font "arial", using internal non-scalable font > > I set the environment variable GDFONTPATH in '.bashrc', however the warning persists. What terminal is maxima running in wxMaxima? Hello, I suspect this is a Gnuplot problem. Try to execute directly the Gnuplot script generated by Maxima (maxout.gnuplot): $ gnuplot -persist 'maxout.gnuplot' (Note that if you have used a 'plot' command, perhaps you have to run set_plot_option ([plot_format, gnuplot]); and create 'maxout.gnuplot' again) If yo get the same warning messages, something should be fixed in your local Gnuplot configuration. Sorry, I don't have any idea on the Mac OS installation. -- Mario From cblasius at gmail.com Thu Jul 28 12:01:25 2011 From: cblasius at gmail.com (Zbigniew Komarnicki) Date: Thu, 28 Jul 2011 19:01:25 +0200 Subject: [Maxima] How to remove list to obtain sequence ? In-Reply-To: References: <201107281546.57371.cblasius@gmail.com> Message-ID: <201107281901.25571.cblasius@gmail.com> On Thursday 28 of July 2011 16:03:27 you wrote: > diag_matrix does not take an n-long list as an argument, but takes n > individual arguments. (as documented) Yes, I knew it, but I didn't know how to use it with many individual arguments. You give me the answer with "apply" below. > Try this: > > (%i1) display2d:false; > (%o1) false > (%i2) P: makelist(P[i], i, 1, 3); > (%o2) [P[1],P[2],P[3]] > (%i3) apply('diag_matrix,P); > (%o3) matrix([P[1],0,0],[0,P[2],0],[0,0,P[3]]) Thank you very much. Regards, Zbigniew From mark.brethen at gmail.com Thu Jul 28 12:55:29 2011 From: mark.brethen at gmail.com (Mark Brethen) Date: Thu, 28 Jul 2011 12:55:29 -0500 Subject: [Maxima] wxMaxima plot In-Reply-To: <4E31CAEC.305@telefonica.net> References: <4E31CAEC.305@telefonica.net> Message-ID: I have not tried your suggestions yet, but have traced the problem to the default font gnuplot is trying to use. I created the '.gnuplot' file in my user directory, and set a default font that I know exists in the /Library/Fonts/ directory on MacOS X. This eliminated those pesky messages. Sent from my iPad On Jul 28, 2011, at 3:47 PM, Mario Rodriguez wrote: > On 07/27/2011 07:38 PM, Mark Brethen wrote: >> Hello, >> >> I'm using the wxMaxima.app on Mac OS X 10.6.8 and when plotting I see the following 2 lines above the plot: >> >> Could not find/open font when opening font "arial", using internal non-scalable font >> Could not find/open font when opening font "arial", using internal non-scalable font >> >> I set the environment variable GDFONTPATH in '.bashrc', however the warning persists. What terminal is maxima running in wxMaxima? > > Hello, > > I suspect this is a Gnuplot problem. Try to execute directly the Gnuplot script generated by Maxima (maxout.gnuplot): > > $ gnuplot -persist 'maxout.gnuplot' > > (Note that if you have used a 'plot' command, perhaps you have to run > > set_plot_option ([plot_format, gnuplot]); > > and create 'maxout.gnuplot' again) > > > If yo get the same warning messages, something should be fixed in your local Gnuplot configuration. > > Sorry, I don't have any idea on the Mac OS installation. > > -- > Mario From willisb at unk.edu Thu Jul 28 15:13:00 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 28 Jul 2011 15:13:00 -0500 Subject: [Maxima] How to remove list to obtain sequence ? In-Reply-To: <201107281546.57371.cblasius@gmail.com> References: <201107281546.57371.cblasius@gmail.com> Message-ID: Either (%i2) diag_matrix(a,b); (%o2) matrix([a,0],[0,b]) or (%i3) apply('diag_matrix, [a,b]); (%o3) matrix([a,0],[0,b]) --Barton maxima-bounces at math.utexas.edu wrote on 07/28/2011 08:46:57 AM: > > I have a problem with this > > (%i1) P: makelist(P[i], i, 1, 3); > (%o1) [P , P , P ] > 1 2 3 > (%i2) PP: diag_matrix(P); > (%o2) [ [P , P , P ] ] > [ 1 2 3 ] > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernard at marcade.biz Thu Jul 28 20:21:58 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Fri, 29 Jul 2011 02:21:58 +0100 Subject: [Maxima] Why can't I match the pattern xx(t)? Message-ID: <1311902518.10180.4.camel@dell-laptop> Hi, In the following, tellsimpafter thinks I am trying to match "xx", when, in fact, I am trying to match "xx(t)". Why doesn't this work? (%i1) coords: [x,y,z]; (%o1) [x, y, z] (%i2) coordp (i) := member (i, coords); (%o2) coordp(i) := member(i, coords) (%i3) matchdeclare (xx, coordp); (%o3) done (%i4) tellsimpafter (xx(t), xx); tellsimpafter: pattern must not be an atom or a matchdeclare variable; found: xx -- an error. To debug this try: debugmode(true); (%i5) Cheers, Bernard. From robert.dodier at gmail.com Fri Jul 29 00:09:43 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 28 Jul 2011 23:09:43 -0600 Subject: [Maxima] Why can't I match the pattern xx(t)? In-Reply-To: <1311902518.10180.4.camel@dell-laptop> References: <1311902518.10180.4.camel@dell-laptop> Message-ID: On 7/28/11, Bernard Hurley wrote: > (%i3) matchdeclare (xx, coordp); > (%o3) done > (%i4) tellsimpafter (xx(t), xx); > > tellsimpafter: pattern must not be an atom or a matchdeclare variable; > found: xx tellsimp and tellsimpafter attach the generated rule (a Lisp function) to the main operator of the pattern expression, so the main operator cannot be a match variable. The error message is misleading; I'll try to clarify it. hth, Robert Dodier From bernard at marcade.biz Fri Jul 29 05:22:46 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Fri, 29 Jul 2011 11:22:46 +0100 Subject: [Maxima] Why can't I match the pattern xx(t)? In-Reply-To: References: <1311902518.10180.4.camel@dell-laptop> Message-ID: <1311934966.4435.2.camel@dell-laptop> On Thu, 2011-07-28 at 23:09 -0600, Robert Dodier wrote: > On 7/28/11, Bernard Hurley wrote: > > > (%i3) matchdeclare (xx, coordp); > > (%o3) done > > (%i4) tellsimpafter (xx(t), xx); > > > > tellsimpafter: pattern must not be an atom or a matchdeclare variable; > > found: xx > > tellsimp and tellsimpafter attach the generated rule (a Lisp function) > to the main operator of the pattern expression, so the main operator > cannot be a match variable. > > The error message is misleading; I'll try to clarify it. > Thanks! I managed to get the effect I wanted another way, but it is nice to know _why_ things happen. Bernard. From robert.dodier at gmail.com Fri Jul 29 11:17:23 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 29 Jul 2011 10:17:23 -0600 Subject: [Maxima] Stack overflow on silly arithmetic In-Reply-To: References: Message-ID: Looks like a bug to me. In summary (and perhaps it would be helpful to spell it out to help readers understand what's going on) Maxima generates a Lisp complex number, then barfs (stack overflow) while trying to display it. (Turns out both 1-d and 2-d displays are susceptible.) Maxima certainly should be able to display any Lisp object without an error; even PRINT would be OK. I'll try to remember to look into it, but if someone wants to file a bug report and/or fix it, I won't stop you. best, Robert Dodier PS. It occurs to me a larger issue is whether Maxima should be comfortable w/ Lisp complex numbers; I'm not sure, although I'm leaning towards yes. On 7/27/11, Rupert Swarbrick wrote: > Hi, > > I noticed this question on Stack Overflow: > > http://stackoverflow.com/questions/6808077/ > > The reason her code didn't work was because she was taking the log of > -1, but I was rather surprised to get a stack overflow (pun only just > noticed). > > Is this a bug in the simplification code? And, if so, is it already > known? > > > Rupert > From macrakis at alum.mit.edu Fri Jul 29 12:19:09 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 29 Jul 2011 13:19:09 -0400 Subject: [Maxima] Stack overflow on silly arithmetic In-Reply-To: References: Message-ID: This does seem to be a bug. But I question this: Maxima certainly should be able to display any Lisp object without an error; > even PRINT would be OK. > Well, that would be nice for debugging bad code, but I think it's perfectly OK for Maxima to simply give a *clean* error (not infinite loop or crash) for malformed expressions, e.g. (sin 1), (sin . 1), (((sin) 1)), ((rat) a 3), etc. Almost 40 years ago, I did write a printer for Macsyma designed specifically to handle arbitrary Lisp expressions that would try to handle embedded Macsyma nicely, e.g. (((mplus) a b) ((mtimes) a b)) would print as ( $(a+b) $(a*b) ) or something. Useful tracing and debugging tool for people coding in Lisp, but doesn't seem necessary for the Maxima end user. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Fri Jul 29 12:50:28 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 29 Jul 2011 11:50:28 -0600 Subject: [Maxima] planning Maxima 5.25 release Message-ID: Hi, I'm planning to make a branch for Maxima 5.25 on Aug 1, with a release to follow shortly thereafter. best Robert Dodier From macrakis at alum.mit.edu Fri Jul 29 14:34:50 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 29 Jul 2011 15:34:50 -0400 Subject: [Maxima] Using Lisp complex Message-ID: > > PS. It occurs to me a larger issue is whether Maxima should > be comfortable w/ Lisp complex numbers; I'm not sure, although I'm > leaning towards yes. That would be fine with me, but we would of course have to run a fine-tooth comb over the Maxima codebase. For example, some Lisp and Maxima modules look for "syntactically complex" expressions by seeing if the symbol %i is literally contained within them. Of course that doesn't catch cases like log(-1) anyway. Some other things to resolve: We would in any case have to continue to support the form a+b*%i for numbers where a and b are bfloats. Another problem: in GCL at least, (sqrt -1) = (sqrt -1.0) => 1+6e-17 + i, not 0+i exactly. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri Jul 29 16:54:14 2011 From: fateman at eecs.berkeley.edu (R Fateman) Date: Fri, 29 Jul 2011 14:54:14 -0700 Subject: [Maxima] Using Lisp complex In-Reply-To: References: Message-ID: <4E332C06.2030306@eecs.berkeley.edu> There would be an issue that subst(x,3,3+4*%i) would have to change #c(3 4) to ((mplus) $x #c(0 4)) and gobs of other related issues. One simpler way to "fix" this is to recognize complex numbers in the simplifier and change them to Maxima's representation. Just as the common lisp rational 3/4 could be (is it?) changed to ((rat) 3 4). RJF From willisb at unk.edu Sat Jul 30 07:14:32 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 30 Jul 2011 07:14:32 -0500 Subject: [Maxima] powerlist function in integration In-Reply-To: <4E332C06.2030306@eecs.berkeley.edu> References: <4E332C06.2030306@eecs.berkeley.edu>, Message-ID: In the integration code, the function powerlist seems to be called when it should not be. Example: (related to SF bug 3382358)--notice the Huh? Surely, this call to powerlist is bogus: (%i1) trace(?powerlist); (%o1) [powerlist] (%i2) integrate(z*ff(z^2-1/4),z); 1" Enter "?powerlist[z*ff(z^2-1/4),z] .2" Enter "?powerlist[ff(z-1/4),z] <---- Huh? .2" Exit "?powerlistfalse 1" Exit "?powerlistintegrate(z*ff(z^2-1/4),z) (%o2) integrate(z*ff(z^2-1/4),z) When ff is signum, we can get a bug: (%i3) assume(-1 References: Message-ID: <4E342B36.9000305@gmail.com> On 7/29/2011 12:34 PM, Stavros Macrakis wrote: > > Another problem: in GCL at least, (sqrt -1) = (sqrt -1.0) => 1+6e-17 + > i, not 0+i exactly. > I don't think this is a problem that maxima needs to solve. We should just file a bug report for gcl and let gcl fix it. There's really no excuse for getting that wrong when there are well documented algorithms for the complex square root. Well, I am assuming that most other lisps return #c(0.0 1.0) for that. Ray From felix.natter at smail.inf.fh-brs.de Fri Jul 29 15:04:19 2011 From: felix.natter at smail.inf.fh-brs.de (Felix Natter) Date: Fri, 29 Jul 2011 22:04:19 +0200 Subject: [Maxima] Solving Ball Collision Equation Message-ID: <87k4b0g8fw.fsf@bitburger.home.felix> hi, I am new to maxima and I would like to solve this equation: ([px1,py1] + t*[vx1,vy1] - ([px2,py2] + t*[vx2,vy2]))^2 = (r1+r2)^2 for t. I tried: solve([([px1,py1] + t*[vx1,vy1] - ([px2,py2] + t*[vx2,vy2]))^2 = (r1+r2)^2], t); but this doesn't succeed in solving for t. I would like to implement this in a C program. I read mbe4solve.pdf but couldn't find a hint. Is there a way to solve this problem (restate it?) with maxima or other open source tools? Thanks! -- Felix Natter From dougy at whidbey.com Sat Jul 30 09:59:28 2011 From: dougy at whidbey.com (Doug York) Date: Sat, 30 Jul 2011 14:59:28 +0000 (UTC) Subject: [Maxima] Maxima system constants References: Message-ID: Robert Dodier gmail.com> writes: > > On Thu, Jul 29, 2010 at 4:29 PM, Douglas Durdin gmail.com> wrote: > > > Is it possible to redefine a system constant such as %gamma to a user > > variable? > Maybe for your purposes it would be enough to use a > variable, say "mygamma", and fudge its properties so > that it displays as %gamma in Maxima output > or \gamma in TeX output. I can explain if you are interested. > What, exactly, are you trying to achieve? > > best > > Robert Dodier > I am interested in this process. I have used the gamma character in a paper to indicate the value 2*pi/3, and would like the WXmaxima output to match it. Can anyone help out? From bernard at marcade.biz Sat Jul 30 12:45:47 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 30 Jul 2011 18:45:47 +0100 Subject: [Maxima] How do I remove a derivative rule using remrule? Message-ID: <1312047947.25219.5.camel@dell-laptop> Hi, I have no problems using remrule to remove rules attached to functions or operators such as "+", but I can't work out how to use it to remove rules attached to derivatives. Nothing I try seems to work: (%i1) tellsimpafter('diff(xx(t),t,1),dt(xx)); (%o1) [derivativerule1, simpderiv] (%i2) rules; (%o2) [derivativerule1] (%i3) remrule(derivative,derivativerule1); remrule: no such rule: derivativerule1 -- an error. To debug this try: debugmode(true); (%i4) remrule(diff,derivativerule1); remrule: no such rule: derivativerule1 -- an error. To debug this try: debugmode(true); (%i5) remrule(simpderiv,derivativerule1); remrule: no such rule: derivativerule1 -- an error. To debug this try: debugmode(true); (%i6) rules; (%o6) [derivativerule1] Can anyone enlighten me? Thanks, Bernard. From willisb at unk.edu Sat Jul 30 12:49:50 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 30 Jul 2011 12:49:50 -0500 Subject: [Maxima] Solving Ball Collision Equation In-Reply-To: <87k4b0g8fw.fsf@bitburger.home.felix> References: <87k4b0g8fw.fsf@bitburger.home.felix> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >hi, I am new to maxima and I would like to solve this equation: >([px1,py1] + t*[vx1,vy1] - ([px2,py2] + t*[vx2,vy2]))^2 = (r1+r2)^2 for t. In Maxima, [a,b] is a list with two items. So the left side of your equation is a list, but the right side is not a list. Also, [a,b]^2 = [a^2,b^2]. Once you express the equations as two scalar equations, solve might work OK. --bw From macrakis at gmail.com Sat Jul 30 13:01:21 2011 From: macrakis at gmail.com (Stavros Macrakis) Date: Sat, 30 Jul 2011 14:01:21 -0400 Subject: [Maxima] Using Lisp complex In-Reply-To: <4E342B36.9000305@gmail.com> References: <4E342B36.9000305@gmail.com> Message-ID: Not the gaussian integer #c(0 1) =%i? By the way, I suspect that parts of Maxima assume that numberp implies real. On Jul 30, 2011 12:03 PM, "Raymond Toy" wrote: > On 7/29/2011 12:34 PM, Stavros Macrakis wrote: >> >> Another problem: in GCL at least, (sqrt -1) = (sqrt -1.0) => 1+6e-17 + >> i, not 0+i exactly. >> > I don't think this is a problem that maxima needs to solve. We should > just file a bug report for gcl and let gcl fix it. There's really no > excuse for getting that wrong when there are well documented algorithms > for the complex square root. Well, I am assuming that most other lisps > return #c(0.0 1.0) for that. > > 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 rswarbrick at gmail.com Sat Jul 30 13:18:22 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sat, 30 Jul 2011 19:18:22 +0100 Subject: [Maxima] Solving Ball Collision Equation References: <87k4b0g8fw.fsf@bitburger.home.felix> Message-ID: Felix Natter writes: > hi, > > I am new to maxima and I would like to solve this equation: > ([px1,py1] + t*[vx1,vy1] - ([px2,py2] + t*[vx2,vy2]))^2 = (r1+r2)^2 > for t. I'm not sure exactly what you mean by the square on the left hand side. Maxima interprets this as squaring each component in the row vector of length 2 that you've created. The right hand side of your equation is a number: (%i1) ([px1,py1] + t*[vx1,vy1] - ([px2,py2] + t*[vx2,vy2]))^2; 2 2 (%o1) [(- t vx2 + t vx1 - px2 + px1) , (- t vy2 + t vy1 - py2 + py1) ] I'm not sure what to suggest, since I can't work out what you're trying to do. Maybe you can explain what you're trying to solve with a simpler mathematical equation, which one of us could show how to rewrite in Maxima? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From bernard at marcade.biz Sat Jul 30 14:12:48 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 30 Jul 2011 20:12:48 +0100 Subject: [Maxima] Maxima system constants In-Reply-To: References: Message-ID: <1312053168.25219.23.camel@dell-laptop> On Sat, 2011-07-30 at 14:59 +0000, Doug York wrote: > > I am interested in this process. I have used the gamma character in a paper to > indicate the value 2*pi/3, and would like the WXmaxima output to match it. Can > anyone help out? > I don't know if this is any help. I have been developing a package that can handle Lagrangian mechanics equations in (near enough) the format that they appear in text books; there is a short example session below. As you can see I used characters that do not normally appear in maxima output. I did this by cutting and pasting them into tdot.mac. I don't know how platform dependent this makes it but I can use it in emacs,wxmaxima and at the command line. Also I'm not sure if all versions of CL can handle unicode characters (I'm using sbcl). You could try putting something like: mygamma: ?$ in a .mac and then loading it into maxima. That's how I got the ? in the code below. (I needed to do this so I could later concatenate it with ?.) (%i1) load("tdot.mac")$ (%i2) gcoords(x,y,z)$ (%i3) KE: T = (m/2)*(diff(x,t)^2+diff(y,t)^2+diff(z,t)^2); 2 2 2 m (z? + y? + x? ) (%o3) T = ------------------- 2 (%i4) diff(%,diff(x,t)); (%o4) ? (T) = m x? x? (%i5) diff(%,t); d (%o5) -- (? (T)) = m x? dt x? (%i6) diff(KE,x); (%o6) ? (T) = 0 x (%i7) F[x] = diff(diff(T,diff(x,t)),t) - diff(T,x); d (%o7) F = -- (? (T)) - ? (T) x dt x? x (%i8) gcoords(r,Ltheta)$ (%i9) declare (b,constant)$ (%i10) r = b*Ltheta^2; 2 (%o10) r = b ? (%i11) d(%); (%o11) ?r = 2 b ? ?? Cheers, Bernard. From bernard at marcade.biz Sat Jul 30 14:39:05 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 30 Jul 2011 20:39:05 +0100 Subject: [Maxima] How can I find out the format of a parameter passed to a function? Message-ID: <1312054745.25219.26.camel@dell-laptop> Hi, I am writing a maxima function that needs to know whether a parameter has the form "a[b]". How can I do this? Thanks, Bernard. From drdieterkaiser at web.de Sat Jul 30 15:06:54 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 30 Jul 2011 22:06:54 +0200 Subject: [Maxima] How can I find out the format of a parameter passed to a function? In-Reply-To: <1312054745.25219.26.camel@dell-laptop> References: <1312054745.25219.26.camel@dell-laptop> Message-ID: <1312056414.17389.1.camel@dieter> Am Samstag, den 30.07.2011, 20:39 +0100 schrieb Bernard Hurley: > Hi, > > I am writing a maxima function that needs to know whether a parameter > has the form "a[b]". How can I do this? Try the test function subvarp: (%i9) subvarp(a[b]); (%o9) true Dieter Kaiser From bernard at marcade.biz Sat Jul 30 15:51:31 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 30 Jul 2011 21:51:31 +0100 Subject: [Maxima] How can I find out the format of a parameter passed to a function? In-Reply-To: <1312056414.17389.1.camel@dieter> References: <1312054745.25219.26.camel@dell-laptop> <1312056414.17389.1.camel@dieter> Message-ID: <1312059091.25219.27.camel@dell-laptop> On Sat, 2011-07-30 at 22:06 +0200, Dieter Kaiser wrote: > Am Samstag, den 30.07.2011, 20:39 +0100 schrieb Bernard Hurley: > > Hi, > > > > I am writing a maxima function that needs to know whether a parameter > > has the form "a[b]". How can I do this? > > Try the test function subvarp: > > (%i9) subvarp(a[b]); > (%o9) true Thanks that is just what I needed! Bernard From robert.dodier at gmail.com Sat Jul 30 16:22:30 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 30 Jul 2011 15:22:30 -0600 Subject: [Maxima] Maxima system constants In-Reply-To: References: Message-ID: OK, try this. In wxMaxima enter the following. Note the quotes very carefully -- some are single quotes and some are double. :lisp (setf (get '$mygamma 'wxxmlword) "gamma") Then (I hope) when you enter mygamma in wxMaxima it will be displayed a Greek letter gamma. I don't have wxMaxima installed so I can't try it at the moment, sorry. HTH Robert Dodier From robert.dodier at gmail.com Sat Jul 30 16:47:37 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 30 Jul 2011 15:47:37 -0600 Subject: [Maxima] Stack overflow on silly arithmetic In-Reply-To: References: Message-ID: OK, on looking at this again, I think it's a simplifier bug. The display code does have trouble w/ Lisp complex numbers, but I think that's a distraction. (I fixed the display problem, but the bug still occurs.) The code in the original report > http://stackoverflow.com/questions/6808077/ is this: log10(x):=log(x)/log(10); char(x):=floor(log10(x))+1; mantissa(x):=x/10**char(x); chop(x,d):=(10**char(x))*(floor(mantissa(x)*(10**d))/(10**d)); rnd(x,d):=chop(x+5*10**(char(x)-d-1),d); d:5; a:10; Ibwd:[[30,rnd(integrate((x**60)/(1+10*x^2),x,0,1),d)]]; for n from 30 thru 1 step -1 do Ibwd:append([[n-1,rnd(1/(2*n-1)-a*last(first(Ibwd)),d)]],Ibwd); Try tracing SPLITPROD and COMPSPLT1 -- I find that the loop gets through several iterations (calling SPLITPROD and COMPSPLT1 along the way), then it gets into an endless recursion in which SPLITPROD and COMPSPLT1 are called over and over, until it gets a stack overflow. best Robert Dodier PS. I am working with nearly-current source from Git. From toy.raymond at gmail.com Sat Jul 30 16:55:42 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 30 Jul 2011 14:55:42 -0700 Subject: [Maxima] Using Lisp complex In-Reply-To: References: <4E342B36.9000305@gmail.com> Message-ID: For (sqrt -1) Lisp can return either #c(0 1) or #c(0 1.0) but (sqrt -1.0) must be #c(0.0 1.0). At least according to the CLHS. I agree about numberp ; it's s bit confusing. Ray On Jul 30, 2011 11:01 AM, "Stavros Macrakis" wrote: > Not the gaussian integer #c(0 1) =%i? By the way, I suspect that parts of > Maxima assume that numberp implies real. > On Jul 30, 2011 12:03 PM, "Raymond Toy" wrote: >> On 7/29/2011 12:34 PM, Stavros Macrakis wrote: >>> >>> Another problem: in GCL at least, (sqrt -1) = (sqrt -1.0) => 1+6e-17 + >>> i, not 0+i exactly. >>> >> I don't think this is a problem that maxima needs to solve. We should >> just file a bug report for gcl and let gcl fix it. There's really no >> excuse for getting that wrong when there are well documented algorithms >> for the complex square root. Well, I am assuming that most other lisps >> return #c(0.0 1.0) for that. >> >> 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 robert.dodier at gmail.com Sat Jul 30 16:58:26 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 30 Jul 2011 15:58:26 -0600 Subject: [Maxima] How do I remove a derivative rule using remrule? In-Reply-To: <1312047947.25219.5.camel@dell-laptop> References: <1312047947.25219.5.camel@dell-laptop> Message-ID: Try this: remrule (nounify (derivative), derivativerule1); The rule is attached to a noun as opposed to a verb ... Yes, it is quite obscure, I agree. best, Robert Dodier On 7/30/11, Bernard Hurley wrote: > Hi, > > I have no problems using remrule to remove rules attached to functions > or operators such as "+", but I can't work out how to use it to remove > rules attached to derivatives. Nothing I try seems to work: > > (%i1) tellsimpafter('diff(xx(t),t,1),dt(xx)); > (%o1) [derivativerule1, simpderiv] > (%i2) rules; > (%o2) [derivativerule1] > (%i3) remrule(derivative,derivativerule1); > > remrule: no such rule: derivativerule1 > -- an error. To debug this try: debugmode(true); > (%i4) remrule(diff,derivativerule1); > > remrule: no such rule: derivativerule1 > -- an error. To debug this try: debugmode(true); > (%i5) remrule(simpderiv,derivativerule1); > > remrule: no such rule: derivativerule1 > -- an error. To debug this try: debugmode(true); > (%i6) rules; > (%o6) [derivativerule1] > > Can anyone enlighten me? > > Thanks, > > Bernard. > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From bernard at marcade.biz Sat Jul 30 17:47:19 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 30 Jul 2011 23:47:19 +0100 Subject: [Maxima] How do I remove a derivative rule using remrule? In-Reply-To: <1312047947.25219.5.camel@dell-laptop> References: <1312047947.25219.5.camel@dell-laptop> Message-ID: <1312066039.27146.1.camel@dell-laptop> Can I thank the person who solved this for me? I accidentally deleted the email so I'm not sure who it was. Anyway it works fine! From robert.dodier at gmail.com Sat Jul 30 18:18:11 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 30 Jul 2011 17:18:11 -0600 Subject: [Maxima] Using Lisp complex In-Reply-To: References: Message-ID: OK, I've pushed the following patch which changes several instances of (AND (NUMBERP FOO) (MINUSP FOO)) to use REALP instead of NUMBERP. This is enough to make Maxima happy with some simple operations on Lisp complex numbers. My guess is that complex numbers should be converted to Maxima a + b*%i expressions, likewise rationals to ((RAT) ...). I hope this simple patch helps in the meantime. best, Robert Dodier PS. Here are some examples of Lisp complexes and rationals in Maxima. (%i3) display2d : true (%o3) true $Z(%i4) z (%o4) #C(5 3) (%i5) 10 z (%o5) #C(50 30) (%i6) z + 10 (%o6) #C(15 3) (%i7) a z (%o7) #C(5 3) a 2 (%i8) z (%o8) #C(16 30) n (%i9) z n (%o9) #C(5 3) $R(%i10) z r (%o10) #C(35/11 21/11) (%i11) b r (%o11) 7/11 b (%i12) b r + a z (%o12) 7/11 b + #C(5 3) a (%i13) L : [1, 2, x, %e, r, z] (%o13) [1, 2, x, %e, 7/11, #C(5 3)] (%i14) apply(+, L) (%o14) x + %e + #C(95/11 3) (%i15) apply(*, L) (%o15) #C(70/11 42/11) %e x (%i16) display2d : false (%o16) false $Z (%i17) z (%o17) #C(5 3) (%i18) 10*z (%o18) #C(50 30) (%i19) z+10 (%o19) #C(15 3) (%i20) a*z (%o20) #C(5 3)*a (%i21) z^2 (%o21) #C(16 30) (%i22) z^n (%o22) #C(5 3)^n $R (%i23) z*r (%o23) #C(35/11 21/11) (%i24) b*r (%o24) 7/11*b (%i25) b*r+a*z (%o25) 7/11*b+#C(5 3)*a (%i26) L:[1,2,x,%e,r,z] (%o26) [1,2,x,%e,7/11,#C(5 3)] (%i27) apply("+",L) (%o27) x+%e+#C(95/11 3) (%i28) apply("*",L) (%o28) #C(70/11 42/11)*%e*x PPS. Here's the input file. display2d : true; :lisp (defparameter $z #C(5 3)) z; 10 * z; 10 + z; a * z; z^2; z^n; :lisp (defparameter $r (/ 7 11)) z * r; b * r; a * z + b * r; L : [1, 2, x, %e, r, z]; apply ("+", L); apply ("*", L); display2d : false; :lisp (defparameter $z #C(5 3)) z; 10 * z; 10 + z; a * z; z^2; z^n; :lisp (defparameter $r (/ 7 11)) z * r; b * r; a * z + b * r; L : [1, 2, x, %e, r, z]; apply ("+", L); apply ("*", L); PPPS. Here's the patch. $ git diff 67e75d833e6dcc4e52296977b919698dfd156d4a 4cc0818b3229e41121d5a2680ad228b1b0b7350c diff --git a/src/compar.lisp b/src/compar.lisp index 26a597d..70df54a 100644 --- a/src/compar.lisp +++ b/src/compar.lisp @@ -1339,7 +1339,7 @@ relational knowledge is contained in the default context GLOBAL.") (defun signdiff-special (xlhs xrhs) ;; xlhs may be a constant (let ((sgn nil)) - (when (or (and (numberp xrhs) (minusp xrhs) + (when (or (and (realp xrhs) (minusp xrhs) (not (atom xlhs)) (eq (sign* xlhs) '$pos)) ; e.g. sign(a^3+%pi-1) where a>0 (and (mexptp xlhs) diff --git a/src/matrun.lisp b/src/matrun.lisp index 1c7a2bc..4788ec4 100644 --- a/src/matrun.lisp +++ b/src/matrun.lisp @@ -140,7 +140,7 @@ (setq e (reverse (cdr e))) (go b))) a (setq e (cdr e)) b (cond ((null e) - (return (if (and (numberp expon) (minusp expon)) 1 0))) + (return (if (and (realp expon) (minusp expon)) 1 0))) ((and (mexptp (car e)) (alike1 expon (caddar e))) (return (cadar e)))) (go a))) diff --git a/src/nforma.lisp b/src/nforma.lisp index 140c661..754299a 100644 --- a/src/nforma.lisp +++ b/src/nforma.lisp @@ -25,7 +25,7 @@ (defmfun nformat (form) (cond ((atom form) - (cond ((and (numberp form) (minusp form)) (list '(mminus) (- form))) + (cond ((and (realp form) (minusp form)) (list '(mminus) (- form))) ((eq t form) (if in-p t '$true)) ((eq nil form) (if in-p nil '$false)) ((and displayp (car (rassoc form aliaslist :test #'eq)))) diff --git a/src/optim.lisp b/src/optim.lisp index 8fe3aab..47d6eff 100644 --- a/src/optim.lisp +++ b/src/optim.lisp @@ -58,10 +58,10 @@ (defun opmexpt (x) (let ((*base (opformat (cadr x))) (exp (opformat (caddr x))) xnew negexp) (setq negexp - (cond ((and (numberp exp) (minusp exp)) (- exp)) + (cond ((and (realp exp) (minusp exp)) (- exp)) ((and (ratnump exp) (minusp (cadr exp))) (list (car exp) (- (cadr exp)) (caddr exp))) - ((and (mtimesp exp) (numberp (cadr exp)) (minusp (cadr exp))) + ((and (mtimesp exp) (realp (cadr exp)) (minusp (cadr exp))) (if (equal (cadr exp) -1) (if (null (cdddr exp)) (caddr exp) (cons (car exp) (cddr exp))) diff --git a/src/rat3a.lisp b/src/rat3a.lisp index 38c4e56..229629b 100644 --- a/src/rat3a.lisp +++ b/src/rat3a.lisp @@ -341,7 +341,7 @@ (cdr l))))) (defmfun pminusp (p) - (if (numberp p) (minusp p) + (if (realp p) (minusp p) (pminusp (p-lc p)))) (defmfun pminus (p) diff --git a/src/simp.lisp b/src/simp.lisp index 7335819..1b2e262 100644 --- a/src/simp.lisp +++ b/src/simp.lisp @@ -235,7 +235,7 @@ (defmfun mmminusp (x) (and (not (atom x)) (eq (caar x) 'mminus))) (defmfun mnegp (x) - (cond ((numberp x) (minusp x)) + (cond ((realp x) (minusp x)) ((or (ratnump x) ($bfloatp x)) (minusp (cadr x))))) (defmfun mqapplyp (e) (and (not (atom e)) (eq (caar e) 'mqapply))) @@ -2194,10 +2194,10 @@ (return res)) ((eq gr '$%i) (return (%itopot pot))) - ((and (numberp gr) (minusp gr) (mevenp pot)) + ((and (realp gr) (minusp gr) (mevenp pot)) (setq gr (- gr)) (go cont)) - ((and (numberp gr) (minusp gr) (moddp pot)) + ((and (realp gr) (minusp gr) (moddp pot)) (return (mul2 -1 (power (- gr) pot)))) ((and (equal gr -1) (maxima-integerp pot) (mminusp pot)) (setq pot (neg pot)) From robert.dodier at gmail.com Sat Jul 30 20:45:30 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 30 Jul 2011 19:45:30 -0600 Subject: [Maxima] How do I remove a derivative rule using remrule? In-Reply-To: <1312066039.27146.1.camel@dell-laptop> References: <1312047947.25219.5.camel@dell-laptop> <1312066039.27146.1.camel@dell-laptop> Message-ID: Hey, no problem. If ever we meet in person, you can buy me a beer. best, Robert Dodier On 7/30/11, Bernard Hurley wrote: > Can I thank the person who solved this for me? I accidentally deleted > the email so I'm not sure who it was. Anyway it works fine! > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From felix.natter at smail.inf.fh-brs.de Sat Jul 30 14:23:17 2011 From: felix.natter at smail.inf.fh-brs.de (Felix Natter) Date: Sat, 30 Jul 2011 21:23:17 +0200 Subject: [Maxima] Solving Ball Collision Equation References: <87k4b0g8fw.fsf@bitburger.home.felix> Message-ID: <871ux7374q.fsf@bitburger.home.felix> Barton Willis writes: > -----maxima-bounces at math.utexas.edu wrote: ----- > >>hi, I am new to maxima and I would like to solve this equation: >>([px1,py1] + t*[vx1,vy1] - ([px2,py2] + t*[vx2,vy2]))^2 = (r1+r2)^2 >>for t. hello Barton, > In Maxima, [a,b] is a list with two items. So the left side of your equation is a list, > but the right side is not a list. Also, [a,b]^2 = [a^2,b^2]. Once you express the > equations as two scalar equations, solve might work OK. Thanks for the explanation! I don't know how to formulate this with two equations, but this works fine (simply Pythagorean Theorem): solve([(px2+t*vx2 - px1-t*vx1)^2 + (py2 + t*vy2 - py1-t*vy1)^2 = (r1+r2)^2], t); Best Regards! -- Felix Natter From felix.natter at smail.inf.fh-brs.de Sat Jul 30 14:29:22 2011 From: felix.natter at smail.inf.fh-brs.de (Felix Natter) Date: Sat, 30 Jul 2011 21:29:22 +0200 Subject: [Maxima] Solving Ball Collision Equation References: <87k4b0g8fw.fsf@bitburger.home.felix> Message-ID: <87mxfv1sa5.fsf@bitburger.home.felix> Rupert Swarbrick writes: > Felix Natter writes: >> hi, >> >> I am new to maxima and I would like to solve this equation: >> ([px1,py1] + t*[vx1,vy1] - ([px2,py2] + t*[vx2,vy2]))^2 = (r1+r2)^2 >> for t. hello Rupert, > I'm not sure exactly what you mean by the square on the left hand > side. Maxima interprets this as squaring each component in the row > vector of length 2 that you've created. The right hand side of your > equation is a number: > > (%i1) ([px1,py1] + t*[vx1,vy1] - ([px2,py2] + t*[vx2,vy2]))^2; > 2 2 > (%o1) [(- t vx2 + t vx1 - px2 + px1) , (- t vy2 + t vy1 - py2 + py1) ] > > I'm not sure what to suggest, since I can't work out what you're trying > to do. Maybe you can explain what you're trying to solve with a simpler > mathematical equation, which one of us could show how to rewrite in > Maxima? As you can see in my other reply, I was simply trying to say that the distance between to balls in linear motion is radius1+radius2, which is now solved. Thanks, -- Felix Natter From fateman at eecs.berkeley.edu Sun Jul 31 06:50:22 2011 From: fateman at eecs.berkeley.edu (R Fateman) Date: Sun, 31 Jul 2011 04:50:22 -0700 Subject: [Maxima] Using Lisp complex In-Reply-To: References: Message-ID: <4E35417E.1090301@eecs.berkeley.edu> I haven't read your code in any detail, or tried it, but off the top of my head, here are some cases to worry about. (I am traveling..) converting complex with zero imag part to a real. matching a+b*%i to 3+5*%i substituting x for 3 in 3+5*%i substituting x for %i bfloat(complex) adding bigfloat to complex multiplying bigfloat etc. sin cos bessel_j abs, cabs sqrt x^complex, complex^complex plot realpart, imagpart >, < RJF On 7/30/2011 4:18 PM, Robert Dodier wrote: > OK, I've pushed the following patch which changes several > instances of (AND (NUMBERP FOO) (MINUSP FOO)) to use > REALP instead of NUMBERP. This is enough to make Maxima > happy with some simple operations on Lisp complex numbers. > > My guess is that complex numbers should be converted to > Maxima a + b*%i expressions, likewise rationals to ((RAT) ...). > I hope this simple patch helps in the meantime. > > best, > > Robert Dodier > > PS. Here are some examples of Lisp complexes and rationals in Maxima. > > (%i3) display2d : true > (%o3) true > $Z(%i4) z > (%o4) #C(5 3) > (%i5) 10 z > (%o5) #C(50 30) > (%i6) z + 10 > (%o6) #C(15 3) > (%i7) a z > (%o7) #C(5 3) a > 2 > (%i8) z > (%o8) #C(16 30) > n > (%i9) z > n > (%o9) #C(5 3) > $R(%i10) z r > (%o10) #C(35/11 21/11) > (%i11) b r > (%o11) 7/11 b > (%i12) b r + a z > (%o12) 7/11 b + #C(5 3) a > (%i13) L : [1, 2, x, %e, r, z] > (%o13) [1, 2, x, %e, 7/11, #C(5 3)] > (%i14) apply(+, L) > (%o14) x + %e + #C(95/11 3) > (%i15) apply(*, L) > (%o15) #C(70/11 42/11) %e x > (%i16) display2d : false > (%o16) false > $Z > (%i17) z > (%o17) #C(5 3) > (%i18) 10*z > (%o18) #C(50 30) > (%i19) z+10 > (%o19) #C(15 3) > (%i20) a*z > (%o20) #C(5 3)*a > (%i21) z^2 > (%o21) #C(16 30) > (%i22) z^n > (%o22) #C(5 3)^n > $R > (%i23) z*r > (%o23) #C(35/11 21/11) > (%i24) b*r > (%o24) 7/11*b > (%i25) b*r+a*z > (%o25) 7/11*b+#C(5 3)*a > (%i26) L:[1,2,x,%e,r,z] > (%o26) [1,2,x,%e,7/11,#C(5 3)] > (%i27) apply("+",L) > (%o27) x+%e+#C(95/11 3) > (%i28) apply("*",L) > (%o28) #C(70/11 42/11)*%e*x > > PPS. Here's the input file. > > display2d : true; > :lisp (defparameter $z #C(5 3)) > z; > 10 * z; > 10 + z; > a * z; > z^2; > z^n; > :lisp (defparameter $r (/ 7 11)) > z * r; > b * r; > a * z + b * r; > L : [1, 2, x, %e, r, z]; > apply ("+", L); > apply ("*", L); > > display2d : false; > :lisp (defparameter $z #C(5 3)) > z; > 10 * z; > 10 + z; > a * z; > z^2; > z^n; > :lisp (defparameter $r (/ 7 11)) > z * r; > b * r; > a * z + b * r; > L : [1, 2, x, %e, r, z]; > apply ("+", L); > apply ("*", L); > > > PPPS. Here's the patch. > $ git diff 67e75d833e6dcc4e52296977b919698dfd156d4a > 4cc0818b3229e41121d5a2680ad228b1b0b7350c > diff --git a/src/compar.lisp b/src/compar.lisp > index 26a597d..70df54a 100644 > --- a/src/compar.lisp > +++ b/src/compar.lisp > @@ -1339,7 +1339,7 @@ relational knowledge is contained in the default > context GLOBAL.") > (defun signdiff-special (xlhs xrhs) > ;; xlhs may be a constant > (let ((sgn nil)) > - (when (or (and (numberp xrhs) (minusp xrhs) > + (when (or (and (realp xrhs) (minusp xrhs) > (not (atom xlhs)) (eq (sign* xlhs) '$pos)) > ; e.g. sign(a^3+%pi-1) where a>0 > (and (mexptp xlhs) > diff --git a/src/matrun.lisp b/src/matrun.lisp > index 1c7a2bc..4788ec4 100644 > --- a/src/matrun.lisp > +++ b/src/matrun.lisp > @@ -140,7 +140,7 @@ > (setq e (reverse (cdr e))) (go b))) > a (setq e (cdr e)) > b (cond ((null e) > - (return (if (and (numberp expon) (minusp expon)) 1 0))) > + (return (if (and (realp expon) (minusp expon)) 1 0))) > ((and (mexptp (car e)) (alike1 expon (caddar e))) > (return (cadar e)))) > (go a))) > diff --git a/src/nforma.lisp b/src/nforma.lisp > index 140c661..754299a 100644 > --- a/src/nforma.lisp > +++ b/src/nforma.lisp > @@ -25,7 +25,7 @@ > > (defmfun nformat (form) > (cond ((atom form) > - (cond ((and (numberp form) (minusp form)) (list '(mminus) (- form))) > + (cond ((and (realp form) (minusp form)) (list '(mminus) (- form))) > ((eq t form) (if in-p t '$true)) > ((eq nil form) (if in-p nil '$false)) > ((and displayp (car (rassoc form aliaslist :test #'eq)))) > diff --git a/src/optim.lisp b/src/optim.lisp > index 8fe3aab..47d6eff 100644 > --- a/src/optim.lisp > +++ b/src/optim.lisp > @@ -58,10 +58,10 @@ > (defun opmexpt (x) > (let ((*base (opformat (cadr x))) (exp (opformat (caddr x))) xnew negexp) > (setq negexp > - (cond ((and (numberp exp) (minusp exp)) (- exp)) > + (cond ((and (realp exp) (minusp exp)) (- exp)) > ((and (ratnump exp) (minusp (cadr exp))) > (list (car exp) (- (cadr exp)) (caddr exp))) > - ((and (mtimesp exp) (numberp (cadr exp)) (minusp (cadr exp))) > + ((and (mtimesp exp) (realp (cadr exp)) (minusp (cadr exp))) > (if (equal (cadr exp) -1) > (if (null (cdddr exp)) (caddr exp) > (cons (car exp) (cddr exp))) > diff --git a/src/rat3a.lisp b/src/rat3a.lisp > index 38c4e56..229629b 100644 > --- a/src/rat3a.lisp > +++ b/src/rat3a.lisp > @@ -341,7 +341,7 @@ > (cdr l))))) > > (defmfun pminusp (p) > - (if (numberp p) (minusp p) > + (if (realp p) (minusp p) > (pminusp (p-lc p)))) > > (defmfun pminus (p) > diff --git a/src/simp.lisp b/src/simp.lisp > index 7335819..1b2e262 100644 > --- a/src/simp.lisp > +++ b/src/simp.lisp > @@ -235,7 +235,7 @@ > (defmfun mmminusp (x) (and (not (atom x)) (eq (caar x) 'mminus))) > > (defmfun mnegp (x) > - (cond ((numberp x) (minusp x)) > + (cond ((realp x) (minusp x)) > ((or (ratnump x) ($bfloatp x)) (minusp (cadr x))))) > > (defmfun mqapplyp (e) (and (not (atom e)) (eq (caar e) 'mqapply))) > @@ -2194,10 +2194,10 @@ > (return res)) > ((eq gr '$%i) > (return (%itopot pot))) > - ((and (numberp gr) (minusp gr) (mevenp pot)) > + ((and (realp gr) (minusp gr) (mevenp pot)) > (setq gr (- gr)) > (go cont)) > - ((and (numberp gr) (minusp gr) (moddp pot)) > + ((and (realp gr) (minusp gr) (moddp pot)) > (return (mul2 -1 (power (- gr) pot)))) > ((and (equal gr -1) (maxima-integerp pot) (mminusp pot)) > (setq pot (neg pot)) > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From bernard at marcade.biz Sun Jul 31 08:27:55 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sun, 31 Jul 2011 14:27:55 +0100 Subject: [Maxima] Angle brackets get lost in non commutative powers in wxmaxima. Message-ID: <1312118875.14278.4.camel@dell-laptop> Hi, Non-commutative powers should be in angle brackets as in: (%i1) a . a . a; <3> (%o1) a However, in wxmaxima, if xml format is chosen for the output they do not appear. Is there any way to get them back again? Cheers, Bernard. From robert.dodier at gmail.com Sun Jul 31 11:41:59 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 31 Jul 2011 10:41:59 -0600 Subject: [Maxima] Using Lisp complex In-Reply-To: <4E35417E.1090301@eecs.berkeley.edu> References: <4E35417E.1090301@eecs.berkeley.edu> Message-ID: Yup, that's a good list. I've just taken one step -- maybe someone else wants to keep going. best Robert Dodier On 7/31/11, R Fateman wrote: > I haven't read your code in any detail, or tried it, but off the top of > my head, here are some cases to worry about. > (I am traveling..) > > converting complex with zero imag part to a real. > matching a+b*%i to 3+5*%i > substituting x for 3 in 3+5*%i > > substituting x for %i > bfloat(complex) > adding bigfloat to complex > multiplying bigfloat etc. > sin > cos > bessel_j > abs, cabs > sqrt > x^complex, > complex^complex > plot > realpart, imagpart > >, < > > RJF > > > > On 7/30/2011 4:18 PM, Robert Dodier wrote: >> OK, I've pushed the following patch which changes several >> instances of (AND (NUMBERP FOO) (MINUSP FOO)) to use >> REALP instead of NUMBERP. This is enough to make Maxima >> happy with some simple operations on Lisp complex numbers. >> >> My guess is that complex numbers should be converted to >> Maxima a + b*%i expressions, likewise rationals to ((RAT) ...). >> I hope this simple patch helps in the meantime. >> >> best, >> >> Robert Dodier >> >> PS. Here are some examples of Lisp complexes and rationals in Maxima. >> >> (%i3) display2d : true >> (%o3) true >> $Z(%i4) z >> (%o4) #C(5 3) >> (%i5) 10 z >> (%o5) #C(50 30) >> (%i6) z + 10 >> (%o6) #C(15 3) >> (%i7) a z >> (%o7) #C(5 3) a >> 2 >> (%i8) z >> (%o8) #C(16 30) >> n >> (%i9) z >> n >> (%o9) #C(5 3) >> $R(%i10) z r >> (%o10) #C(35/11 21/11) >> (%i11) b r >> (%o11) 7/11 b >> (%i12) b r + a z >> (%o12) 7/11 b + #C(5 3) a >> (%i13) L : [1, 2, x, %e, r, z] >> (%o13) [1, 2, x, %e, 7/11, #C(5 3)] >> (%i14) apply(+, L) >> (%o14) x + %e + #C(95/11 3) >> (%i15) apply(*, L) >> (%o15) #C(70/11 42/11) %e x >> (%i16) display2d : false >> (%o16) false >> $Z >> (%i17) z >> (%o17) #C(5 3) >> (%i18) 10*z >> (%o18) #C(50 30) >> (%i19) z+10 >> (%o19) #C(15 3) >> (%i20) a*z >> (%o20) #C(5 3)*a >> (%i21) z^2 >> (%o21) #C(16 30) >> (%i22) z^n >> (%o22) #C(5 3)^n >> $R >> (%i23) z*r >> (%o23) #C(35/11 21/11) >> (%i24) b*r >> (%o24) 7/11*b >> (%i25) b*r+a*z >> (%o25) 7/11*b+#C(5 3)*a >> (%i26) L:[1,2,x,%e,r,z] >> (%o26) [1,2,x,%e,7/11,#C(5 3)] >> (%i27) apply("+",L) >> (%o27) x+%e+#C(95/11 3) >> (%i28) apply("*",L) >> (%o28) #C(70/11 42/11)*%e*x >> >> PPS. Here's the input file. >> >> display2d : true; >> :lisp (defparameter $z #C(5 3)) >> z; >> 10 * z; >> 10 + z; >> a * z; >> z^2; >> z^n; >> :lisp (defparameter $r (/ 7 11)) >> z * r; >> b * r; >> a * z + b * r; >> L : [1, 2, x, %e, r, z]; >> apply ("+", L); >> apply ("*", L); >> >> display2d : false; >> :lisp (defparameter $z #C(5 3)) >> z; >> 10 * z; >> 10 + z; >> a * z; >> z^2; >> z^n; >> :lisp (defparameter $r (/ 7 11)) >> z * r; >> b * r; >> a * z + b * r; >> L : [1, 2, x, %e, r, z]; >> apply ("+", L); >> apply ("*", L); >> >> >> PPPS. Here's the patch. >> $ git diff 67e75d833e6dcc4e52296977b919698dfd156d4a >> 4cc0818b3229e41121d5a2680ad228b1b0b7350c >> diff --git a/src/compar.lisp b/src/compar.lisp >> index 26a597d..70df54a 100644 >> --- a/src/compar.lisp >> +++ b/src/compar.lisp >> @@ -1339,7 +1339,7 @@ relational knowledge is contained in the default >> context GLOBAL.") >> (defun signdiff-special (xlhs xrhs) >> ;; xlhs may be a constant >> (let ((sgn nil)) >> - (when (or (and (numberp xrhs) (minusp xrhs) >> + (when (or (and (realp xrhs) (minusp xrhs) >> (not (atom xlhs)) (eq (sign* xlhs) '$pos)) >> ; e.g. sign(a^3+%pi-1) where a>0 >> (and (mexptp xlhs) >> diff --git a/src/matrun.lisp b/src/matrun.lisp >> index 1c7a2bc..4788ec4 100644 >> --- a/src/matrun.lisp >> +++ b/src/matrun.lisp >> @@ -140,7 +140,7 @@ >> (setq e (reverse (cdr e))) (go b))) >> a (setq e (cdr e)) >> b (cond ((null e) >> - (return (if (and (numberp expon) (minusp expon)) 1 0))) >> + (return (if (and (realp expon) (minusp expon)) 1 0))) >> ((and (mexptp (car e)) (alike1 expon (caddar e))) >> (return (cadar e)))) >> (go a))) >> diff --git a/src/nforma.lisp b/src/nforma.lisp >> index 140c661..754299a 100644 >> --- a/src/nforma.lisp >> +++ b/src/nforma.lisp >> @@ -25,7 +25,7 @@ >> >> (defmfun nformat (form) >> (cond ((atom form) >> - (cond ((and (numberp form) (minusp form)) (list '(mminus) (- >> form))) >> + (cond ((and (realp form) (minusp form)) (list '(mminus) (- >> form))) >> ((eq t form) (if in-p t '$true)) >> ((eq nil form) (if in-p nil '$false)) >> ((and displayp (car (rassoc form aliaslist :test #'eq)))) >> diff --git a/src/optim.lisp b/src/optim.lisp >> index 8fe3aab..47d6eff 100644 >> --- a/src/optim.lisp >> +++ b/src/optim.lisp >> @@ -58,10 +58,10 @@ >> (defun opmexpt (x) >> (let ((*base (opformat (cadr x))) (exp (opformat (caddr x))) xnew >> negexp) >> (setq negexp >> - (cond ((and (numberp exp) (minusp exp)) (- exp)) >> + (cond ((and (realp exp) (minusp exp)) (- exp)) >> ((and (ratnump exp) (minusp (cadr exp))) >> (list (car exp) (- (cadr exp)) (caddr exp))) >> - ((and (mtimesp exp) (numberp (cadr exp)) (minusp (cadr >> exp))) >> + ((and (mtimesp exp) (realp (cadr exp)) (minusp (cadr >> exp))) >> (if (equal (cadr exp) -1) >> (if (null (cdddr exp)) (caddr exp) >> (cons (car exp) (cddr exp))) >> diff --git a/src/rat3a.lisp b/src/rat3a.lisp >> index 38c4e56..229629b 100644 >> --- a/src/rat3a.lisp >> +++ b/src/rat3a.lisp >> @@ -341,7 +341,7 @@ >> (cdr l))))) >> >> (defmfun pminusp (p) >> - (if (numberp p) (minusp p) >> + (if (realp p) (minusp p) >> (pminusp (p-lc p)))) >> >> (defmfun pminus (p) >> diff --git a/src/simp.lisp b/src/simp.lisp >> index 7335819..1b2e262 100644 >> --- a/src/simp.lisp >> +++ b/src/simp.lisp >> @@ -235,7 +235,7 @@ >> (defmfun mmminusp (x) (and (not (atom x)) (eq (caar x) 'mminus))) >> >> (defmfun mnegp (x) >> - (cond ((numberp x) (minusp x)) >> + (cond ((realp x) (minusp x)) >> ((or (ratnump x) ($bfloatp x)) (minusp (cadr x))))) >> >> (defmfun mqapplyp (e) (and (not (atom e)) (eq (caar e) 'mqapply))) >> @@ -2194,10 +2194,10 @@ >> (return res)) >> ((eq gr '$%i) >> (return (%itopot pot))) >> - ((and (numberp gr) (minusp gr) (mevenp pot)) >> + ((and (realp gr) (minusp gr) (mevenp pot)) >> (setq gr (- gr)) >> (go cont)) >> - ((and (numberp gr) (minusp gr) (moddp pot)) >> + ((and (realp gr) (minusp gr) (moddp pot)) >> (return (mul2 -1 (power (- gr) pot)))) >> ((and (equal gr -1) (maxima-integerp pot) (mminusp pot)) >> (setq pot (neg pot)) >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > > From robert.dodier at gmail.com Sun Jul 31 13:31:47 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 31 Jul 2011 12:31:47 -0600 Subject: [Maxima] Stack overflow on silly arithmetic In-Reply-To: References: Message-ID: Here's a simpler example: floor (log (2^(floor (log (- 1)) - 1) - 1)); *** - Program stack overflow. RESET I've opened a bug report for it: https://sourceforge.net/tracker/?func=detail&aid=3383300&group_id=4933&atid=104933 HTH Robert Dodier On 7/30/11, Robert Dodier wrote: > OK, on looking at this again, I think it's a simplifier bug. > The display code does have trouble w/ Lisp complex numbers, > but I think that's a distraction. (I fixed the display problem, but > the bug still occurs.) > > The code in the original report > >> http://stackoverflow.com/questions/6808077/ > > is this: > > log10(x):=log(x)/log(10); > char(x):=floor(log10(x))+1; > mantissa(x):=x/10**char(x); > chop(x,d):=(10**char(x))*(floor(mantissa(x)*(10**d))/(10**d)); > rnd(x,d):=chop(x+5*10**(char(x)-d-1),d); > d:5; > a:10; > Ibwd:[[30,rnd(integrate((x**60)/(1+10*x^2),x,0,1),d)]]; > for n from 30 thru 1 step -1 do > Ibwd:append([[n-1,rnd(1/(2*n-1)-a*last(first(Ibwd)),d)]],Ibwd); > > Try tracing SPLITPROD and COMPSPLT1 -- I find that the loop gets through > several iterations (calling SPLITPROD and COMPSPLT1 along the way), > then it gets into an endless recursion in which SPLITPROD and COMPSPLT1 > are called over and over, until it gets a stack overflow. > > best > > Robert Dodier > > PS. I am working with nearly-current source from Git. > From fateman at eecs.berkeley.edu Sun Jul 31 20:06:49 2011 From: fateman at eecs.berkeley.edu (R Fateman) Date: Sun, 31 Jul 2011 18:06:49 -0700 Subject: [Maxima] Using Lisp complex In-Reply-To: References: <4E35417E.1090301@eecs.berkeley.edu> Message-ID: <4E35FC29.3080407@eecs.berkeley.edu> On 7/31/2011 9:41 AM, Robert Dodier wrote: > Yup, that's a good list. > I've just taken one step -- maybe someone else wants to keep going. > > best > > Robert Dodier > > I've thought about this some more, and I think it would be too messy to introduce CL complex in any central way in Maxima. 1. The CL notion is of a pair of reals. But Maxima has another real type, namely bigfloat, which is not acceptable as part of a CL complex. So the CL notion is inadequate for even numerical use in Maxima. 2. The notion of number in Maxima is extended further, to symbols and symbolic expressions. The CL complex notation is not adequate for pairs of arbitrary expressions. 3. It might make sense (or, at least, not much difference) to use internally #c(0 1) instead of $%i. Input and Output would be modified to show %i as before. note that in a+b*%i there is no a priori requirement that a and b be real or real-valued. So extending CL complex to allow symbolic real and imaginary parts would not be so great... realpart(a+b*%i) is not necessarily a . etc. 4, nothing much is gained. Maybe saving a little memory occasionally?? If you want to package complex numbers for operations done in Fortran or C, that can be done at that interface, as appropriate. After further thought, my view is now: The list I gave in an earlier message should not be construed as a menu of what to do, but as a list of reasons that doing it would be so messy as to be a bad idea. Mathematica has a Complex number data type and even today it breaks many things to have it around. RJF From robert.dodier at gmail.com Mon Aug 1 00:38:28 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 31 Jul 2011 23:38:28 -0600 Subject: [Maxima] error processing Texinfo -- Logarithms.es.texi Message-ID: Hi, I;m trying to build packages for 5.25.0 (I think I have successfully created a tag, branch-5_25-base, and a branch, branch-5_25) and make dist-gzip gives me this: make[3]: *** No rule to make target `Logarithms.es.texi', needed by `distdir'. Stop. Can someone fix it? best Robert Dodier From biomates at telefonica.net Mon Aug 1 01:35:29 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Mon, 01 Aug 2011 08:35:29 +0200 Subject: [Maxima] error processing Texinfo -- Logarithms.es.texi In-Reply-To: References: Message-ID: <1312180529.1489.3.camel@pc> El dom, 31-07-2011 a las 23:38 -0600, Robert Dodier escribi?: > Hi, I;m trying to build packages for 5.25.0 > (I think I have successfully created a tag, branch-5_25-base, > and a branch, branch-5_25) and make dist-gzip gives me this: > > make[3]: *** No rule to make target `Logarithms.es.texi', needed by > `distdir'. Stop. > > Can someone fix it? > > best > > Robert Dodier Robert, I think I've fixed it. I forgot to remove Logarithms.es.texi from Makefile.am. Sorry :( -- Mario From macrakis at alum.mit.edu Mon Aug 1 09:54:03 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 1 Aug 2011 10:54:03 -0400 Subject: [Maxima] Using Lisp complex In-Reply-To: <4E35FC29.3080407@eecs.berkeley.edu> References: <4E35417E.1090301@eecs.berkeley.edu> <4E35FC29.3080407@eecs.berkeley.edu> Message-ID: It may or may not be a good idea to allow Lisp complexes as part of Maxima expressions. I tend to think it is not, for many of the reasons Fateman and I have mentioned so far in this thread. But note that the output, part, and subst cases are actually quite straightforwardly handled by the existing architecture, where format1 (called by subst, part, displa, etc.) does conversions like ((mexpt) x -1) => ((mquotient) 1 x); it could equally well transform #c(1 2) => ((mplus) 1 ((mtimes) 2 $%i)). But even if they are allowed, this does *not* mean that we can translate Maxima arithmetic directly into native arithmetic. In fact, we can't even do that for integers and rationals. For example, the Common Lisp spec (if I'm interpreting it correctly) says that the result of (expt 4 1/2) can be *either* an integer or a float -- GCL in particular returns a float. That isn't acceptable for Maxima, where it must remain an integer. Also, I don't believe the CL spec requires that rational powers of integers be calculated exactly; GCL for example is an ULP off for 8^(1/3). The Common Lisp spec defines (expt 0 0) => 1 and (expt 0.0 0) => 1.0. Whether we want that to become the Maxima default or not (I know many people have argued for it), we probably want to preserve the *option* of giving an error for it. True, it is easier to *recognize* a complex if it's in the form #c(1 2) than in the form 1+2*%i, but Maxima will always have to be able to manipulate the latter (including cases where it is not Lisp numbers 1 and 2, but Maxima bfloats or symbolic expressions). CL floats have advantages for purely numerical calculations; perhaps the better CL implementations even implement them as stack-allocated pairs of floats in compiled code? How much is that advantage worth to us vs. the complications resulting from allowing complexes within Maxima expressions? -s On Sun, Jul 31, 2011 at 21:06, R Fateman wrote: > On 7/31/2011 9:41 AM, Robert Dodier wrote: > >> Yup, that's a good list. >> I've just taken one step -- maybe someone else wants to keep going. >> >> best >> >> Robert Dodier >> >> >> I've thought about this some more, and I think it would be too messy to > introduce CL complex in any central > way in Maxima. > 1. The CL notion is of a pair of reals. But Maxima has another real type, > namely bigfloat, which is > not acceptable as part of a CL complex. So the CL notion is inadequate for > even numerical use > in Maxima. > 2. The notion of number in Maxima is extended further, to symbols and > symbolic expressions. > The CL complex notation is not adequate for pairs of arbitrary expressions. > 3. It might make sense (or, at least, not much difference) to use > internally #c(0 1) instead of $%i. > Input and Output would be modified to show %i as before. > > note that in a+b*%i there is no a priori requirement that a and b be real > or real-valued. So > extending CL complex to allow symbolic real and imaginary parts would not > be so great... > > realpart(a+b*%i) is not necessarily a . etc. > 4, nothing much is gained. Maybe saving a little memory occasionally?? > > If you want to package complex numbers for operations done in Fortran or C, > that can be done at > that interface, as appropriate. > > After further thought, my view is now: > The list I gave in an earlier message should not be construed as a menu of > what to do, but > as a list of reasons that doing it would be so messy as to be a bad idea. > Mathematica has > a Complex number data type and even today it breaks many things to have it > around. > > 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 fateman at eecs.berkeley.edu Mon Aug 1 10:28:44 2011 From: fateman at eecs.berkeley.edu (R Fateman) Date: Mon, 01 Aug 2011 08:28:44 -0700 Subject: [Maxima] Using Lisp rational .. was Re: Using Lisp complex In-Reply-To: References: <4E35417E.1090301@eecs.berkeley.edu> <4E35FC29.3080407@eecs.berkeley.edu> Message-ID: <4E36C62C.1000506@eecs.berkeley.edu> A better case can be made for using CL rationals which appear to be isomorphic to Maxima structures of the form , e.g. ((rat simp) 1 2 ). numerator and denominator are integers etc. One advantage of our own rat), currently unutilized, is that we COULD in Maxima, use ((rat) ...1/0 and -1/0 for pos and neg real infinities, 0/0 as undefined. oddly enough, these extension would probably make simplification of rational number arithmetic faster. There plenty of other possible representations. e.g. 2/0, 3/0 ... RJF From cblasius at gmail.com Mon Aug 1 10:43:41 2011 From: cblasius at gmail.com (Zbigniew Komarnicki) Date: Mon, 1 Aug 2011 17:43:41 +0200 Subject: [Maxima] How to expand matrix multiplications ? Message-ID: <201108011743.41978.cblasius@gmail.com> Hello I have a problem wit matrix multiplication. I could not expand the result, below 'res'. How I can do this. matrix_element_mult: "."$ matrix_element_transpose: transpose$ A: matrix([A1,A2,A3]); PP: apply(diag_matrix, makelist(P,i,1,3)); res: transpose(A).P.A; How to expand the last matrix multiplications stored in 'res' ? expand(res); This do not work. Thank you in advance. Zbigniew From cblasius at gmail.com Mon Aug 1 10:50:37 2011 From: cblasius at gmail.com (Zbigniew Komarnicki) Date: Mon, 1 Aug 2011 17:50:37 +0200 Subject: [Maxima] How to expand matrix multiplications ? In-Reply-To: <201108011743.41978.cblasius@gmail.com> References: <201108011743.41978.cblasius@gmail.com> Message-ID: <201108011750.37476.cblasius@gmail.com> On Monday 01 of August 2011 17:43:41 you wrote: [...] > matrix_element_mult: "."$ > matrix_element_transpose: transpose$ > > A: matrix([A1,A2,A3]); > PP: apply(diag_matrix, makelist(P,i,1,3)); > res: transpose(A).P.A; I'm sory it should be: res: transpose(A).P.A - PP; How to expand the last matrix multiplications stored in 'res' ? From macrakis at alum.mit.edu Mon Aug 1 10:54:29 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 1 Aug 2011 11:54:29 -0400 Subject: [Maxima] How to expand matrix multiplications ? In-Reply-To: <201108011743.41978.cblasius@gmail.com> References: <201108011743.41978.cblasius@gmail.com> Message-ID: Perhaps you intended PP: apply(diag_matrix, makelist(P[i],i,1,3)); /* subscript P? */ res: transpose(A).PP.A; /* PP, not P ? */ ? On Mon, Aug 1, 2011 at 11:43, Zbigniew Komarnicki wrote: > matrix_element_mult: "."$ > matrix_element_transpose: transpose$ > > A: matrix([A1,A2,A3]); > PP: apply(diag_matrix, makelist(P,i,1,3)); > res: transpose(A).P.A; > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cblasius at gmail.com Mon Aug 1 11:44:38 2011 From: cblasius at gmail.com (Zbigniew Komarnicki) Date: Mon, 1 Aug 2011 18:44:38 +0200 Subject: [Maxima] How to expand matrix multiplications ? In-Reply-To: References: <201108011743.41978.cblasius@gmail.com> <201108011816.30878.cblasius@gmail.com> Message-ID: <201108011844.39007.cblasius@gmail.com> On Monday 01 of August 2011 18:35:53 you wrote: > Still not sure what you have in mind. > > Perhaps you want the 1x1 matrix with the element P?, that is > > transpose(A).matrix([P]).A - PP; Yes, it should by 'matrix([P])' . Thank you very much. This is my mistake. Now is OK. Thank you again and very sorry for the mistake. Zbigniew From willisb at unk.edu Mon Aug 1 12:11:45 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 1 Aug 2011 12:11:45 -0500 Subject: [Maxima] proposal for new sign-log In-Reply-To: References: Message-ID: I had suggestions from Stavros & Dan Gildea for improvements to sign-log--thanks. This change is checked in--I had some drama getting everything working on a new computer and new operating system (and new office). The sign and csign functions are spendy. And the old sign-log was very slow. Anytime sign or csign are used in simplifying functions, beware that sign changes the fact database as it works through an expression. The clearsign function removes these facts (I think), but clearsign is mostly only called at the bottom of the read-eval-print loop. I noticed that sign sometimes calls factor. For something like signum(x^2-1), it's sad that sign calls factor (not $factor), but simp-signum doesn't use the factorization: signum(x^2-1) doesn't simplify to signum(x-1) signum(x+1). Maybe somebody would like to speed up sign-mplus & sign-mtimes and improve them algorithmically... Again, thanks to all that contributed improvements. --Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernard at marcade.biz Mon Aug 1 19:56:06 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Tue, 02 Aug 2011 01:56:06 +0100 Subject: [Maxima] Calling one function with a variable number of parameters from another function. Message-ID: <1312246566.4791.6.camel@dell-laptop> Hi, What is the usual way in Maxima to call one function with a variable number of parameters when all you have is a list of those parameters? I came up with the following solution (where f2 calls f1), but I am interested to know whether there is a better way to do it: (%i1) f1(m,[L]) := (display (m,L), "done"); (%o1) f1(m, [L]) := (display(m, L), "done") (%i2) f2([L]) := (buildq([L], f1(1,splice(L))),ev(%%)); (%o2) f2([L]) := (buildq([L], f1(1, splice(L))), ev(%%)) (%i3) f1(2,a,b); m = 2 L = [a, b] (%o3) done (%i4) f2(2,a,b); m = 1 L = [2, a, b] (%o4) done Thanks, Bernard. From macrakis at gmail.com Mon Aug 1 20:35:24 2011 From: macrakis at gmail.com (Stavros Macrakis) Date: Mon, 1 Aug 2011 21:35:24 -0400 Subject: [Maxima] Calling one function with a variable number of parameters from another function. In-Reply-To: <1312246566.4791.6.camel@dell-laptop> References: <1312246566.4791.6.camel@dell-laptop> Message-ID: ? apply On Aug 1, 2011 8:56 PM, "Bernard Hurley" wrote: > Hi, > > What is the usual way in Maxima to call one function with a variable > number of parameters when all you have is a list of those parameters? I > came up with the following solution (where f2 calls f1), but I am > interested to know whether there is a better way to do it: > > (%i1) f1(m,[L]) := (display (m,L), "done"); > (%o1) f1(m, [L]) := (display(m, L), "done") > (%i2) f2([L]) := (buildq([L], f1(1,splice(L))),ev(%%)); > (%o2) f2([L]) := (buildq([L], f1(1, splice(L))), ev(%%)) > (%i3) f1(2,a,b); > m = 2 > > L = [a, b] > > (%o3) done > (%i4) f2(2,a,b); > m = 1 > > L = [2, a, b] > > (%o4) done > > > Thanks, > > Bernard. > > _______________________________________________ > 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 Aug 2 00:34:23 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 1 Aug 2011 23:34:23 -0600 Subject: [Maxima] Using Lisp complex In-Reply-To: References: <4E35417E.1090301@eecs.berkeley.edu> <4E35FC29.3080407@eecs.berkeley.edu> Message-ID: On 8/1/11, Stavros Macrakis wrote: > format1 (called by subst, part, displa, etc.) does > conversions like ((mexpt) x -1) => ((mquotient) 1 x); it could equally well > transform #c(1 2) => ((mplus) 1 ((mtimes) 2 $%i)). Yeah, that makes sense to me. In general, I'd like to see Maxima take a laissez-faire attitude toward Lisp complexes and rationals. It's OK if Maxima doesn't know what to make of sin(z) where z is a Lisp complex or rational, but it's not OK if it triggers an error. I claim the correct mathematical approach to unknown objects is to leave them alone; that way an interested party can devise the functions or identities or whatever to handle them. Triggering an error is essentially a declaration that there can never be a way to handle the objects in question. Maybe in some limited cases, an error is appropriate. But that certainly shouldn't be the option of first resort. best Robert Dodier From robert.dodier at gmail.com Tue Aug 2 00:38:04 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 1 Aug 2011 23:38:04 -0600 Subject: [Maxima] Maxima 5.25.0 Message-ID: Hi, I've tagged version-5.25.0 in Git and uploaded rpms and tar.gz to the SF file manager. http://sourceforge.net/projects/maxima/files Maybe someone can build a Windows package. Please give it a try and let us know if you run into problems. best Robert Dodier From andre.maute at gmx.de Tue Aug 2 03:51:46 2011 From: andre.maute at gmx.de (andre maute) Date: Tue, 02 Aug 2011 10:51:46 +0200 Subject: [Maxima] Maxima 5.25.0 Message-ID: <4E37BAA2.5090603@gmx.de> Under SBCL 1.0.40-1.fc14 under Fedora 14 Maxima-5.24.0 builds Maxima-5.25.0 does NOT build Regards Andre A part of the make output is below I used the following commands ---------------------------- $ prefix=$HOME/opt/maxima $ tar xvfz maxima-5.25.0.tar.gz $ cd maxima-5.25.0 $ ./configure --enable-sbcl --prefix=$prefix $ make ---------------------------- ------------------------------------------ STYLE-WARNING: Implicitly creating new generic function IMAG-VALUE. STYLE-WARNING: Implicitly creating new generic function MAXIMA::TO. STYLE-WARNING: Implicitly creating new generic function REALP. STYLE-WARNING: Implicitly creating new generic function COMPLEXP. STYLE-WARNING: Implicitly creating new generic function NUMBERP. STYLE-WARNING: Implicitly creating new generic function PLUSP. STYLE-WARNING: Implicitly creating new generic function MINUSP. STYLE-WARNING: Implicitly creating new generic function ZEROP. STYLE-WARNING: Implicitly creating new generic function SQRT. STYLE-WARNING: Implicitly creating new generic function ABS. STYLE-WARNING: Implicitly creating new generic function EXP. STYLE-WARNING: Implicitly creating new generic function SIN. STYLE-WARNING: Implicitly creating new generic function COS. STYLE-WARNING: Implicitly creating new generic function TAN. STYLE-WARNING: Implicitly creating new generic function ASIN. STYLE-WARNING: Implicitly creating new generic function ACOS. STYLE-WARNING: Implicitly creating new generic function SINH. STYLE-WARNING: Implicitly creating new generic function COSH. STYLE-WARNING: Implicitly creating new generic function TANH. STYLE-WARNING: Implicitly creating new generic function ASINH. STYLE-WARNING: Implicitly creating new generic function ACOSH. STYLE-WARNING: Implicitly creating new generic function ATANH. STYLE-WARNING: Implicitly creating new generic function ONE-ARG-LOG. STYLE-WARNING: Implicitly creating new generic function TWO-ARG-LOG. STYLE-WARNING: Implicitly creating new generic function ONE-ARG-ATAN. STYLE-WARNING: Implicitly creating new generic function TWO-ARG-ATAN. STYLE-WARNING: Implicitly creating new generic function SCALE-FLOAT. STYLE-WARNING: Implicitly creating new generic function REALPART. STYLE-WARNING: Implicitly creating new generic function IMAGPART. STYLE-WARNING: Implicitly creating new generic function CONJUGATE. STYLE-WARNING: Implicitly creating new generic function PHASE. STYLE-WARNING: Implicitly creating new generic function FLOOR. STYLE-WARNING: Implicitly creating new generic function FFLOOR. STYLE-WARNING: Implicitly creating new generic function CEILING. STYLE-WARNING: Implicitly creating new generic function FCEILING. STYLE-WARNING: Implicitly creating new generic function TRUNCATE. STYLE-WARNING: Implicitly creating new generic function FTRUNCATE. STYLE-WARNING: Implicitly creating new generic function ROUND. STYLE-WARNING: Implicitly creating new generic function FROUND. STYLE-WARNING: Implicitly creating new generic function CIS. STYLE-WARNING: Implicitly creating new generic function ONE-ARG-COMPLEX. STYLE-WARNING: Implicitly creating new generic function TWO-ARG-COMPLEX. STYLE-WARNING: Implicitly creating new generic function UNARY-FLOOR. STYLE-WARNING: Implicitly creating new generic function UNARY-FFLOOR. STYLE-WARNING: Implicitly creating new generic function UNARY-TRUNCATE. STYLE-WARNING: Implicitly creating new generic function UNARY-FTRUNCATE. STYLE-WARNING: Implicitly creating new generic function UNARY-CEILING. STYLE-WARNING: Implicitly creating new generic function UNARY-FCEILING. STYLE-WARNING: Implicitly creating new generic function EXPT. STYLE-WARNING: Implicitly creating new generic function EPSILON. STYLE-WARNING: Implicitly creating new generic function INTEGER-DECODE-FLOAT. STYLE-WARNING: Implicitly creating new generic function DECODE-FLOAT. STYLE-WARNING: Implicitly creating new generic function FLOAT. STYLE-WARNING: Implicitly creating new generic function RANDOM. STYLE-WARNING: Implicitly creating new generic function SIGNUM. STYLE-WARNING: Implicitly creating new generic function FLOAT-SIGN. STYLE-WARNING: Implicitly creating new generic function FLOAT-DIGITS. STYLE-WARNING: Implicitly creating new generic function RATIONAL. STYLE-WARNING: Implicitly creating new generic function RATIONALIZE. STYLE-WARNING: Implicitly creating new generic function %PI. ; - Loading module "server" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/server.fasl" ; - Loading module "i-o" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/macsys.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/mload.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/suprv1.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/dskfn.fasl" ; - Loading module "factoring" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/lesfac.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/factor.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/algfac.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/nalgfa.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/ufact.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/result.fasl" ; - Loading module "ifactor" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/ifactor.fasl" ; - Loading module "rational-functions" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/rat3a.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/rat3b.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/rat3d.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/rat3c.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/rat3e.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/nrat4.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/ratout.fasl" ; - Loading module "maxima-language-compiler-macros" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/transm.fasl" ; - Loading module "maxima-language-compiler" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/transl.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/transs.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/trans1.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/trans2.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/trans3.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/trans4.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/trans5.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/transf.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/troper.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/trutil.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/trmode.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/trdata.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/trpred.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/transq.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/acall.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/fcall.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/evalw.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/trprop.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/mdefun.fasl" ; - Loading module "trigonometry" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/trigi.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/trigo.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/trgred.fasl" ; - Loading module "numerical-functions" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/bessel.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/ellipt.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/airy.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/plasma.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/intpol.fasl" ; - Loading module "reader" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/nparse.fasl" ; - Loading module "display" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/displa.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/nforma.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/ldisp.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/grind.fasl" ; - Loading module "gcd" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/spgcd.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/ezgcd.fasl" ; - Loading module "documentation" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/option.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/macdes.fasl" ; - Loading module "algebraic-database" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/inmis.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/db.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/compar.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/askp.fasl" ; - Loading module "integration" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/sinint.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/sin.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/risch.fasl" ; - Loading module "taylor-series" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/hayat.fasl" ; - Loading module "definite-integration" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/defint.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/residu.fasl" ; - Loading module "special-functions" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/specfn.fasl" ; - Loading module "matrix-algebra" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/mat.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/linnew.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/matrix.fasl" ; - Loading module "determinants" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/sprdet.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/newinv.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/newdet.fasl" ; - Loading module "pattern-matching" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/schatc.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/matcom.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/matrun.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/nisimp.fasl" ; - Loading module "limits" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/tlimit.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/limit.fasl" ; - Loading module "solve" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/solve.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/psolve.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/algsys.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/polyrz.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/cpoly.fasl" ; - Loading module "debugging" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/mtrace.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/mdebug.fasl" ; - Loading module "miscellaneous" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/scs.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/asum.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/fortra.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/optim.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/marray.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/mdot.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/irinte.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/series.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/numth.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/laplac.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/pade.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/homog.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/combin.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/nset.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/rand-mt19937.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/maxmin.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/nummod.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/conjugate.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/expintegral.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/gamma.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/mstuff.fasl" ; - Loading module "poisson-series" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/ratpoi.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/pois2.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/pois3.fasl" ; - Loading module "translated-packages" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/desoln.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/elim.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/invert.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/hypgeo.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/hyp.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/todd-coxeter.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/mactex.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/plot.fasl" ; - Loading module "graphics-drivers" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/gnuplot_def.fasl" ; - Loading binary file ; "/home/user/Downloads/maxima-5.25.0/src/binary-sbcl/xmaxima_def.fasl" ; - Loading module "final" ; - Loading source file ; "/home/user/Downloads/maxima-5.25.0/src/autol.lisp" ; - Loading source file ; "/home/user/Downloads/maxima-5.25.0/src/max_ext.lisp" ; - Loading source file ; "/home/user/Downloads/maxima-5.25.0/src/share-subdirs.lisp" ; - Loading source file ; "/home/user/Downloads/maxima-5.25.0/src/init-cl.lisp" ; - Providing system maxima debugger invoked on a SIMPLE-ERROR in thread #: Problem running save hook ASDF::CLEAR-CONFIGURATION: The function ASDF::CLEAR-CONFIGURATION is undefined. Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. restarts (invokable by number or by possibly-abbreviated name): 0: [CONTINUE] Skip this save hook. 1: Ignore runtime option --eval "(progn (load \"../lisp-utils/defsystem.lisp\") (funcall (intern (symbol-name :operate-on-system) :mk) \"maxima\" :load :verbose t) (sb-ext:save-lisp-and-die \"binary-sbcl/maxima.core\") (sb-ext:quit))". 2: [ABORT ] Skip rest of --eval and --load options. 3: Skip to toplevel READ/EVAL/PRINT loop. 4: [QUIT ] Quit SBCL (calling #'QUIT, killing the process). (SB-INT:CALL-HOOKS "save" (ASDF::CLEAR-CONFIGURATION))[:EXTERNAL] ------------------------------------------------------------ From O.Kullmann at swansea.ac.uk Tue Aug 2 04:31:00 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Tue, 2 Aug 2011 10:31:00 +0100 Subject: [Maxima] Maxima 5.25.0 In-Reply-To: References: Message-ID: <20110802093100.GB27947@cs-wsok.swansea.ac.uk> Hi, built and run okay, under Ecl 11.1.1. By the way, would be good to have a changelog (one is already missing for 5.24). At least a very rudimentary one: "See XXX for new stuff." And the file "NEWS" should be deleted (or updated): The newest information in it is about "Release notes for Maxima 5.10.0 (notes compiled 2006/09/10)". Oliver On Mon, Aug 01, 2011 at 11:38:04PM -0600, Robert Dodier wrote: > Hi, I've tagged version-5.25.0 in Git and uploaded rpms and > tar.gz to the SF file manager. > http://sourceforge.net/projects/maxima/files > > Maybe someone can build a Windows package. > > Please give it a try and let us know if you run into problems. > > best > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From ferriste at gmail.com Tue Aug 2 05:13:19 2011 From: ferriste at gmail.com (Stefano Ferri) Date: Tue, 2 Aug 2011 12:13:19 +0200 Subject: [Maxima] Maxima 5.25.0 In-Reply-To: <20110802093100.GB27947@cs-wsok.swansea.ac.uk> References: <20110802093100.GB27947@cs-wsok.swansea.ac.uk> Message-ID: > Hi, > > built and run okay, under Ecl 11.1.1. > > By the way, would be good to have a changelog > (one is already missing for 5.24). I think it would be nice to have only one changelog containing all the history of improvements, with a separate section for each release, instead of one file per release. There are nearly 20 changelogs now, and they will be more in the future... Stefano > At least a very rudimentary > one: "See XXX for new stuff." > And the file "NEWS" should be deleted (or updated): > The newest information in it is about > "Release notes for Maxima 5.10.0 (notes compiled 2006/09/10)". > > Oliver > > On Mon, Aug 01, 2011 at 11:38:04PM -0600, Robert Dodier wrote: > > Hi, I've tagged version-5.25.0 in Git and uploaded rpms and > > tar.gz to the SF file manager. > > http://sourceforge.net/projects/maxima/files > > > > Maybe someone can build a Windows package. > > > > Please give it a try and let us know if you run into problems. > > > > 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 fateman at eecs.berkeley.edu Tue Aug 2 05:38:52 2011 From: fateman at eecs.berkeley.edu (R Fateman) Date: Tue, 02 Aug 2011 03:38:52 -0700 Subject: [Maxima] Using Lisp complex In-Reply-To: References: <4E35417E.1090301@eecs.berkeley.edu> <4E35FC29.3080407@eecs.berkeley.edu> Message-ID: <4E37D3BC.2010309@eecs.berkeley.edu> On 8/1/2011 10:34 PM, Robert Dodier wrote: > On 8/1/11, Stavros Macrakis wrote: > >> format1 (called by subst, part, displa, etc.) does >> conversions like ((mexpt) x -1) => ((mquotient) 1 x); it could equally well >> transform #c(1 2) => ((mplus) 1 ((mtimes) 2 $%i)). > Yeah, that makes sense to me. matching programs do not call format1. I never use part if time is of any concern. Inpart, which does not call format1, is much much much much faster. I was not aware that subst called format1. (It doesn't show on tracing . maybe you are really talking about a program with a different name, not format1?) > In general, I'd like to see Maxima take a laissez-faire attitude > toward Lisp complexes and rationals. > It's OK if Maxima doesn't know what to make of sin(z) where z is > a Lisp complex or rational, but it's not OK if it triggers an error. I agree. But I think that is not the point here. The point here is how many different ways should maxima maintain and continue to maintain in its processing through simplification, solving, matching, etc. for representing the same abstract concept. ((mquotient) 1 2) ((mexpt) 2 -1) ((rat) 1 2), common lisp 1/2 are all the same number. All are converted to ((rat) 1 2). allowing #c(1 2) as a special form for a+bi where a,b are both common lisp reals can be easily handled if the first time it is encountered it is converted to something that already exists. Doing otherwise requires a huge amount of rewriting of code, and probably a decade of debugging. If the parser never produces #c(1 2), and it is not produced as a value by any maxima program, it is not likely that cosine will ever see it. Allowing 'other' lisp objects to be treated nicely by cosine (if you mean a nice error message) is OK. Actually computing cosines is another matter. What about CL arrays? defstructs? CLOS objects? files? Mathematica, for example, allows Cos[array]. If we spread "CL complex is OK" in as many places as we can find, I think it will merely make processing slower for everyone, and buggier for people who do use them. It will only slow things down a little if you check for CL at the entry to cosine (etc) with numer:true. I suspect you will have to diddle with bigfloat cosine (etc) as well... > > I claim the correct mathematical approach to unknown objects > is to leave them alone; that way an interested party can devise > the functions or identities or whatever to handle them. For Maxima to operate as usual, the unknown objects must have a certain form: ((objectname simp) other stuff goes here) or these objects might be OK if they are viewed as "atoms" (e.g. pathnames?) and fall out in the processing, > Triggering an error is essentially a declaration that there can > never be a way to handle the objects in question. > Maybe in some limited cases, an error is appropriate. > But that certainly shouldn't be the option of first resort. Yes, the issue here is what to do with Lisp complex numbers if they are not treated as foreign objects. They happen to pass the "numberp" test so they are not entirely foreign. If they didn't, they would just be atoms like x, y,,z. From l_butler at users.sourceforge.net Tue Aug 2 06:40:04 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Tue, 02 Aug 2011 11:40:04 +0000 Subject: [Maxima] Maxima 5.25.0 In-Reply-To: (message from Robert Dodier on Mon, 1 Aug 2011 23:38:04 -0600) Message-ID: <1qpk4awujmz.fsf@iceland.freeshell.org> Robert Dodier writes: > Hi, I've tagged version-5.25.0 in Git and uploaded rpms and > tar.gz to the SF file manager. > http://sourceforge.net/projects/maxima/files Robert, I'd like to suggest that development proceed on a branch, pre-5.26. At release time for 5.26, you can rebase and merge this branch onto master, etc. A bug fix report on SF that reads "fixed in pre-5.26" is more informative than "fixed in git". -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From macrakis at alum.mit.edu Tue Aug 2 09:23:50 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 2 Aug 2011 10:23:50 -0400 Subject: [Maxima] Using Lisp complex In-Reply-To: <4E37D3BC.2010309@eecs.berkeley.edu> References: <4E35417E.1090301@eecs.berkeley.edu> <4E35FC29.3080407@eecs.berkeley.edu> <4E37D3BC.2010309@eecs.berkeley.edu> Message-ID: On Tue, Aug 2, 2011 at 06:38, R Fateman wrote: > On 8/1/2011 10:34 PM, Robert Dodier wrote: > >> On 8/1/11, Stavros Macrakis wrote: >> >>> format1 (called by subst, part, displa, etc.) does >>> conversions like ((mexpt) x -1) => ((mquotient) 1 x); ... >> >> matching programs do not call format1. I never use part if time is of > any concern. > Inpart, which does not call format1, is much much much much faster. I was > not aware that > subst called format1.... You're right, sorry. subst(x,1,1/y) => x/y and subst(a,2,1/y^2) => 1/y^a; but subst('f,'sqrt,sqrt(x)) => sqrt(x) (not f(x)) and subst('f,"/",x/y) => x/y, not f(x,y). Interestingly, subst(a,-2,1/y^2) => y^a but subst(a,-1,1/y) => 1/y. So there is some special cleverness around exponents/division in subst -- not format1. I agree that part is slow precisely because of format1, but I'd bet that the vast majority of users do not use inpart, and in the vast majority of applications, the convenience and clarity of not needing to understand the internal form are far more important than the speed difference. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Aug 2 09:35:59 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 2 Aug 2011 10:35:59 -0400 Subject: [Maxima] Using Lisp complex In-Reply-To: References: <4E35417E.1090301@eecs.berkeley.edu> <4E35FC29.3080407@eecs.berkeley.edu> Message-ID: On Tue, Aug 2, 2011 at 01:34, Robert Dodier wrote: > ...In general, I'd like to see Maxima take a laissez-faire attitude > toward Lisp complexes and rationals. > It's OK if Maxima doesn't know what to make of sin(z) where z is > a Lisp complex or rational, but it's not OK if it triggers an error. > On the contrary. It is a horrible user experience to have 1/2 - 1/2 not simplify to 0 because their internal form is different. If some code is injecting a Lisp complex or rational into a Maxima expression, and we have not updated Maxima to treat it correctly everywhere, then that is a bug, and the sooner an error is reported for bugs like that, the better. I claim the correct mathematical approach to unknown objects > is to leave them alone; that way an interested party can devise > the functions or identities or whatever to handle them. > First of all, we don't really treat Lisp 1/2 and #c(0 1) as opaque objects; after all, they test positive for numberp, and that has consequences within the Maxima code base. For example, (meval '(($ASSUME) ((MGREATERP) $Y #c(0 1)))) stack overflows; if #c(0 1) were really a completely opaque object, it would not. Secondly, there is no way within the Maxima language to generate Lisp rationals and complexes; so why should Maxima handle them at all? > Triggering an error is essentially a declaration that there can > never be a way to handle the objects in question. No. Triggering an error is a declaration that the preconditions for the correct functioning of code are not met, and that from then on, the system can't promise to deliver correct results. I still don't understand the positive motivation for allowing Lisp complexes as part of Maxima expressions. Is it so that we can use external functions which allow complex arguments and return complex results? If so, why isn't translating to and from Lisp complex just part of the normal interface transformation -- just like translating Lisp arrays to Fortran arrays or whatever. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From cblasius at gmail.com Tue Aug 2 11:18:32 2011 From: cblasius at gmail.com (Zbigniew Komarnicki) Date: Tue, 2 Aug 2011 18:18:32 +0200 Subject: [Maxima] How to simplify ? Message-ID: <201108021818.32912.cblasius@gmail.com> Hello, how to simplify matrix equation 'e2' to obtain back 'e1' ? A,B,C are matrices. matrix_element_mult: "."$ e1: A.(B+C); /* A . (C + B) */ e2: expand(e1); /* A . C + A . B */ How to obtain from 'e2' result given in 'e1' ? ratsimp(e2); <-- do not work Thank you in advance ? Zbigniew From robert.dodier at gmail.com Tue Aug 2 11:54:49 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 2 Aug 2011 10:54:49 -0600 Subject: [Maxima] Maxima 5.25.0 In-Reply-To: <1qpk4awujmz.fsf@iceland.freeshell.org> References: <1qpk4awujmz.fsf@iceland.freeshell.org> Message-ID: I dunno. Why not write "fixed in 5.25post" ? Git is far from easy to use. I guess I want to avoid forcing developers to flounder around with it, any more than we have already. best, Robert Dodier On 8/2/11, Leo Butler wrote: > Robert Dodier writes: > >> Hi, I've tagged version-5.25.0 in Git and uploaded rpms and >> tar.gz to the SF file manager. >> http://sourceforge.net/projects/maxima/files > > Robert, > I'd like to suggest that development proceed on a branch, > pre-5.26. At release time for 5.26, you can rebase and merge > this branch onto master, etc. > > A bug fix report on SF that reads "fixed in pre-5.26" is > more informative than "fixed in git". > > -- > Leo Butler > SDF Public Access UNIX System - http://sdf.lonestar.org > From willisb at unk.edu Tue Aug 2 12:54:19 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 2 Aug 2011 12:54:19 -0500 Subject: [Maxima] Maxima 5.25.0 In-Reply-To: References: <1qpk4awujmz.fsf@iceland.freeshell.org> Message-ID: Using the CCL 1.7, rtest_gamma Problem 673 fails (floating point error too large)--the test needs a tolerance of 4.343015945555673E-15 to pass (instead of 3.8e-15). Make clean does not delete the object files in \binary\binary-openmcl\share\contrib\graphs. This causes rtest_graphs to halt. Manually deleting these object files, allows the share testsuite to run OK (rtestprintf tests 27 & 54 have failed for a long time) (%i1) build_info(); Maxima version: 5.24post Maxima build date: 12:38 8/2/2011 Host type: i686-pc-cygwin Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.7-r14925M (WindowsX8632) --Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrej.vodopivec at gmail.com Tue Aug 2 14:49:39 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Tue, 2 Aug 2011 21:49:39 +0200 Subject: [Maxima] Maxima 5.25.0 In-Reply-To: References: Message-ID: On Tue, Aug 2, 2011 at 7:38 AM, Robert Dodier wrote: > Hi, I've tagged version-5.25.0 in Git and uploaded rpms and > tar.gz to the SF file manager. > http://sourceforge.net/projects/maxima/files > > Maybe someone can build a Windows package. I have uploaded a Windows package built with ccl 1.7. I won't have the chance to try to build a package with gcl until next week. Andrej From l_butler at users.sourceforge.net Tue Aug 2 16:50:16 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Tue, 02 Aug 2011 21:50:16 +0000 Subject: [Maxima] Maxima 5.25.0 In-Reply-To: (message from Robert Dodier on Tue, 2 Aug 2011 10:54:49 -0600) Message-ID: <1qphb5zv5yf.fsf@iceland.freeshell.org> Robert Dodier writes: > > Git is far from easy to use. I guess I want to avoid forcing > developers to flounder around with it, any more than we have already. Yes, all recent vcs give users lots of rope to hang themselves with. It can be difficult to deal with multi-headed vcs. Merge commits, in particular, can create problems. We have one such problem in the master branch of which I am aware. My point is that, were developers to commit to a pre-release branch, the project leader ought to be able to catch these problems and keep the master branch clean. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From cblasius at gmail.com Wed Aug 3 03:43:22 2011 From: cblasius at gmail.com (Zbigniew Komarnicki) Date: Wed, 3 Aug 2011 10:43:22 +0200 Subject: [Maxima] How to simplify ? In-Reply-To: <201108021818.32912.cblasius@gmail.com> References: <201108021818.32912.cblasius@gmail.com> Message-ID: <201108031043.22521.cblasius@gmail.com> On Tuesday 02 of August 2011 18:18:32 you wrote: > Hello, > > how to simplify matrix equation 'e2' to obtain back 'e1' ? > A,B,C are matrices. > > matrix_element_mult: "."$ > e1: A.(B+C); > /* > A . (C + B) > */ > e2: expand(e1); > /* > A . C + A . B > */ I found that it can be done by 'subst' and 'collectterms' commands. But with this is a problem, because sometimes the order of matrices are not preserved. e3: subst("*",".",e2); /* A C + A B */ e4: collectterms(e3,A); /* A (C + B) */ e5: subst(".","*",e4); /* A . (C + B) */ Is there any chance that 'collecterms' or 'ratcoef' and other command for simplifying matrices equations will be work in future Maxima releases (with matrices equations) ? And/Or with 'transpose' as I asked http://www.math.utexas.edu/pipermail/maxima/2010/021970.html I'm still beginner in Maxima and I work with Maxima only from time to time. Thank you for your time and great work. Zbigniew From willisb at unk.edu Wed Aug 3 08:03:28 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 3 Aug 2011 08:03:28 -0500 Subject: [Maxima] How to simplify ? In-Reply-To: <201108031043.22521.cblasius@gmail.com> References: <201108031043.22521.cblasius@gmail.com>, <201108021818.32912.cblasius@gmail.com> Message-ID: In maxima, "*" is commutative multiplication and "." is noncommutative multiplication: (%i2) subst("*",".",b.a); (%o2) a*b So substituting "*" for "." in order to allow collectterms to work isn't an option. I'd guess that you could do a.b + a.c --> a . (b + c) using a method similar to to method in http://www.math.utexas.edu/pipermail/maxima/2010/021970.html. --Barton > > how to simplify matrix equation 'e2' to obtain back 'e1' ? > A,B,C are matrices. > > matrix_element_mult: "."$ > e1: A.(B+C); > /* > ? A . (C + B) > */ > e2: expand(e1); > /* > ? A . C + A . B > */ I found that it can be done by 'subst' and 'collectterms' commands. But with this is a problem, because sometimes the order of matrices are not preserved. e3: subst("*",".",e2); /* ??A C + A B */ e4: collectterms(e3,A); /* ??A (C + B) */ e5: subst(".","*",e4); /* ??A . (C + B) */ Is there any chance that 'collecterms' or 'ratcoef' and other command for simplifying matrices equations will be work in future Maxima releases (with matrices equations) ? And/Or with 'transpose' as I asked http://www.math.utexas.edu/pipermail/maxima/2010/021970.html I'm still beginner in Maxima and I work with Maxima only from time to time. Thank you for your time and great work. Zbigniew _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Wed Aug 3 09:30:17 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 3 Aug 2011 10:30:17 -0400 Subject: [Maxima] How to simplify ? In-Reply-To: <201108031043.22521.cblasius@gmail.com> References: <201108021818.32912.cblasius@gmail.com> <201108031043.22521.cblasius@gmail.com> Message-ID: Well, yes, "." is non-commutative and "*" is commutative. As far as I know, there is no standard way to factor non-commutative polynomials in Maxima. -s On Wed, Aug 3, 2011 at 04:43, Zbigniew Komarnicki wrote: > On Tuesday 02 of August 2011 18:18:32 you wrote: > > Hello, > > > > how to simplify matrix equation 'e2' to obtain back 'e1' ? > > A,B,C are matrices. > > > > matrix_element_mult: "."$ > > e1: A.(B+C); > > /* > > A . (C + B) > > */ > > e2: expand(e1); > > /* > > A . C + A . B > > */ > > I found that it can be done by 'subst' and 'collectterms' commands. But > with > this is a problem, because sometimes the order of matrices are not > preserved. > > e3: subst("*",".",e2); > /* > A C + A B > */ > e4: collectterms(e3,A); > /* > A (C + B) > */ > e5: subst(".","*",e4); > /* > A . (C + B) > */ > > Is there any chance that 'collecterms' or 'ratcoef' and other command for > simplifying matrices equations will be work in future Maxima releases (with > matrices equations) ? And/Or with 'transpose' as I asked > http://www.math.utexas.edu/pipermail/maxima/2010/021970.html > > I'm still beginner in Maxima and I work with Maxima only from time to time. > > Thank you for your time and great work. > > Zbigniew > _______________________________________________ > 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 Wed Aug 3 09:51:48 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 3 Aug 2011 08:51:48 -0600 Subject: [Maxima] Maxima 5.25.0 In-Reply-To: <4E37BAA2.5090603@gmx.de> References: <4E37BAA2.5090603@gmx.de> Message-ID: On 8/2/11, andre maute wrote: > Under SBCL 1.0.40-1.fc14 under Fedora 14 > > Maxima-5.24.0 builds > Maxima-5.25.0 does NOT build > Problem running save hook ASDF::CLEAR-CONFIGURATION: > The function ASDF::CLEAR-CONFIGURATION is undefined. Hmm. Works for me with SBCL 1.0.25 on CentOS 4 and 1.0.40-something (I forget the exact version) on Ubuntu 11.something. best, Robert Dodier From toy.raymond at gmail.com Wed Aug 3 09:11:23 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 03 Aug 2011 07:11:23 -0700 Subject: [Maxima] Using Lisp complex In-Reply-To: References: <4E35417E.1090301@eecs.berkeley.edu> <4E35FC29.3080407@eecs.berkeley.edu> Message-ID: <4E39570B.5010506@gmail.com> On 8/2/2011 7:35 AM, Stavros Macrakis wrote: > On Tue, Aug 2, 2011 at 01:34, Robert Dodier > wrote: > > ...In general, I'd like to see Maxima take a laissez-faire attitude > toward Lisp complexes and rationals. > It's OK if Maxima doesn't know what to make of sin(z) where z is > a Lisp complex or rational, but it's not OK if it triggers an error. > > > On the contrary. It is a horrible user experience to have 1/2 - 1/2 > not simplify to 0 because their internal form is different. If some > code is injecting a Lisp complex or rational into a Maxima expression, > and we have not updated Maxima to treat it correctly everywhere, then > that is a bug, and the sooner an error is reported for bugs like that, > the better. > I agree for the most part. I think it's good that Robert fixed it so that printing a Lisp complex doesn't crash maxima. But I also think that it is an error that a Lisp complex (or rational) has somehow escaped from some internal code and is presented to the user. This is particularly bad for the 1/2-1/2 example since maxima prints out Lisp rationals the same as maxima rationals. (I think. I don't have access to maxima right now.) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed Aug 3 10:44:28 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 3 Aug 2011 11:44:28 -0400 Subject: [Maxima] Using Lisp complex In-Reply-To: <4E39570B.5010506@gmail.com> References: <4E35417E.1090301@eecs.berkeley.edu> <4E35FC29.3080407@eecs.berkeley.edu> <4E39570B.5010506@gmail.com> Message-ID: To start, I would propose that invalid objects within Maxima expressions be printed in some special way, e.g. #INTERNAL(1/2). On Wed, Aug 3, 2011 at 10:11, Raymond Toy wrote: > On 8/2/2011 7:35 AM, Stavros Macrakis wrote: > > On Tue, Aug 2, 2011 at 01:34, Robert Dodier wrote: > >> ...In general, I'd like to see Maxima take a laissez-faire attitude >> toward Lisp complexes and rationals. >> It's OK if Maxima doesn't know what to make of sin(z) where z is >> a Lisp complex or rational, but it's not OK if it triggers an error. >> > > On the contrary. It is a horrible user experience to have 1/2 - 1/2 not > simplify to 0 because their internal form is different. If some code is > injecting a Lisp complex or rational into a Maxima expression, and we have > not updated Maxima to treat it correctly everywhere, then that is a bug, and > the sooner an error is reported for bugs like that, the better. > > I agree for the most part. I think it's good that Robert fixed it so > that printing a Lisp complex doesn't crash maxima. But I also think that it > is an error that a Lisp complex (or rational) has somehow escaped from some > internal code and is presented to the user. This is particularly bad for > the 1/2-1/2 example since maxima prints out Lisp rationals the same as > maxima rationals. (I think. I don't have access to maxima right now.) > > 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 willisb at unk.edu Wed Aug 3 14:30:17 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 3 Aug 2011 14:30:17 -0500 Subject: [Maxima] Using Lisp complex In-Reply-To: References: <4E35417E.1090301@eecs.berkeley.edu> <4E35FC29.3080407@eecs.berkeley.edu> <4E39570B.5010506@gmail.com> Message-ID: Mostly off topic: For purely numerical code, we have Raymond's wonderful bigfloat package. More functions in simp should do numeric work by calling the bigfloat package. A few things in the bigfloat package could be improved (maybe complex^complex), but at least the bigfloat package provides a consistent way to do numerical calculations. --Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernard at marcade.biz Wed Aug 3 15:49:34 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Wed, 03 Aug 2011 21:49:34 +0100 Subject: [Maxima] Calling one function with a variable number of parameters from another function. In-Reply-To: References: <1312246566.4791.6.camel@dell-laptop> Message-ID: <1312404574.4439.1.camel@dell-laptop> On Mon, 2011-08-01 at 21:35 -0400, Stavros Macrakis wrote: > ? apply Thanks, I should have thought of that since knew apply existed. Must be my age. Bernard From A.G.Grozin at inp.nsk.su Thu Aug 4 05:52:41 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Thu, 4 Aug 2011 17:52:41 +0700 (NOVST) Subject: [Maxima] Maxima 5.25.0 In-Reply-To: References: Message-ID: maxima-5.25.0 has been committed to Gentoo Linux. On my box (Intel E5300 2.6Ghz), testsuite real times (in seconds) and failed tests are sbcl-1.0.50 204 rtest16 (386, 387) gcl-2.6.8_pre 208 cmucl-20b_p001 211 clozurecl-1.7 293 rtest_gamma (673) ecl-11.1.1 404 rtest8 (126, 127) clisp-2.49 628 It seems sbcl still computes something in single precision instead of double, numerical errors in these 2 tests are of order 10^(-8). For clozurecl, numerical error in the failed test is just a little larger than the tolerance. And those 2 ecl failures are present for a long time, nothing new here. Andrey From fabrizio_caruso at hotmail.com Thu Aug 4 09:18:13 2011 From: fabrizio_caruso at hotmail.com (Fabrizio Caruso) Date: Thu, 4 Aug 2011 14:18:13 +0000 Subject: [Maxima] CAD, SARAG and the link to the book Message-ID: Hi everyone, I have been informed by one of the authors (Marie-Francoise Roy) that the link to the free electronic Maxima-enhanced version of the book "Algorithms in Real Algebraic Geometry" is now working: http://perso.univ-rennes1.fr/marie-francoise.roy/bpr-ed2-posted2.html Someone on the forum was trying to get the book but couldn't because of a broken link. The electronic book uses SARAG for things like real root isolation and counting, topology of curves ("sort of" bivariate cylindrical algebraic decomposition), sign determinatin, Thom encodings. For those who want to test the topology code, the syntax is load(sarag); topology(x^2+y^2-1,x,y); drawTopology(%[2]); (You'll see the topology of a circle!) SARAG also implements univariate and multivariate certificate of positivity, i.e., "certificate" human-readable automatic proof of positivity/negativity of a polynomial. Any feed-back is wellcome. Is anyone still interested in implementing Collins' CAD in Maxima? Regards Fabrizio -------------- next part -------------- An HTML attachment was scrubbed... URL: From synhedionn at gmail.com Thu Aug 4 10:33:12 2011 From: synhedionn at gmail.com (syn hedionn) Date: Thu, 4 Aug 2011 17:33:12 +0200 Subject: [Maxima] notation of physics Message-ID: Hi, Is there a way to follow notation of physics in order that writing diff(omega(t),t) doesn't output this but the omega letter with a dot at the top of the letter(speed), 2dots for a double derivation=acceleration? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlakelan at street-artists.org Thu Aug 4 11:26:13 2011 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 04 Aug 2011 09:26:13 -0700 Subject: [Maxima] notation of physics In-Reply-To: References: Message-ID: <4E3AC825.2090506@street-artists.org> On 08/04/2011 08:33 AM, syn hedionn wrote: > Hi, > Is there a way to follow notation of physics in order that writing > diff(omega(t),t) doesn't output this but the omega letter with a dot at > the top of the letter(speed), 2dots for a double derivation=acceleration? using texput and the tex converter you can have maxima output this for inclusion into a TeX/LaTeX document. Hope that helps. From macrakis at alum.mit.edu Thu Aug 4 14:08:14 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 4 Aug 2011 15:08:14 -0400 Subject: [Maxima] Calling one function with a variable number of parameters from another function. In-Reply-To: <1312404574.4439.1.camel@dell-laptop> References: <1312246566.4791.6.camel@dell-laptop> <1312404574.4439.1.camel@dell-laptop> Message-ID: Depending on what exactly you're trying to do, you might also want to look at xreduce, lreduce, rreduce, and tree_reduce. -s On Wed, Aug 3, 2011 at 16:49, Bernard Hurley wrote: > On Mon, 2011-08-01 at 21:35 -0400, Stavros Macrakis wrote: > > ? apply > > Thanks, I should have thought of that since knew apply existed. Must be > my age. > > Bernard > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Thu Aug 4 16:08:11 2011 From: fateman at eecs.berkeley.edu (R Fateman) Date: Thu, 04 Aug 2011 14:08:11 -0700 Subject: [Maxima] notation of physics In-Reply-To: References: Message-ID: <4E3B0A3B.2000202@eecs.berkeley.edu> On 8/4/2011 8:33 AM, syn hedionn wrote: > Hi, > Is there a way to follow notation of physics in order that writing > diff(omega(t),t) doesn't output this but the omega letter with a dot > at the top of the letter(speed), 2dots for a double > derivation=acceleration? > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima look at derivabbrev:true and see if that will be enough for you. One problem with the dot notation is where to put the dot(s), e.g. diff('fatfunctionname(t),t). Also, what display technology do you have at your disposal? Are you outputting to a display, TeX, ... You can look at the display program and see how it uses the derivabbrev flag and write whatever you think should result in "notation of physics". RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Fri Aug 5 00:06:10 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 4 Aug 2011 23:06:10 -0600 Subject: [Maxima] notation of physics In-Reply-To: References: Message-ID: On 8/4/11, syn hedionn wrote: > Is there a way to follow notation of physics in order that writing > diff(omega(t),t) doesn't output this but the omega letter with a dot at the > top of the letter(speed), 2dots for a double derivation=acceleration? Well, here's a half-baked idea. tex_diff(e):=block([y,x,n,s],[y,x,n]:args(e),s:"",for i thru n do s:sconcat(s,"d"), sconcat("{\\",s,"ot{",tex1(y),"}}"))$ texput (nounify (derivative), tex_diff); depends (omega, t); eqn : diff (omega, t) + diff (omega, t, 2) = 0; tex (eqn); => $${\ddot{\omega}}+{\dot{\omega}}=0$$ HTH Robert Dodier From kcrisman at gmail.com Fri Aug 5 10:03:55 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Fri, 5 Aug 2011 11:03:55 -0400 Subject: [Maxima] What should %e^(y=x) mean? Message-ID: We got a bug report in Sage (an error raised) which led to the following experiment. (%i1) %e^(y=x); y = x (%o1) %e (%i2) log(y=x); (%o2) log(y) = log(x) I know that Maxima is very careful (or at least usually is) with automatic simplification of things involving exponents, but I'm trying to think of what interpretation the first result would have other than %e^y=%e^x. If there isn't, then this should be simplified; if there is, then we'll be sure to figure out how to fix the error while leaving that interpretation as Maxima has it. Thanks for any input! Karl-Dieter From fateman at eecs.berkeley.edu Fri Aug 5 11:26:51 2011 From: fateman at eecs.berkeley.edu (R Fateman) Date: Fri, 05 Aug 2011 09:26:51 -0700 Subject: [Maxima] What should %e^(y=x) mean? In-Reply-To: References: Message-ID: <4E3C19CB.2070106@eecs.berkeley.edu> To be as general as possible, we can consider it as a special case of a^(b=c). transform to a^b=a^c. Maybe (a=b)^c is a^c=b^c. What about (a=b)^(c=d)??? a^(c=d)=b^(c=d) ---> (a^c=a^d) = .... or something else.. How does it generalize to every function, e.g. f(a=b) is f(a)=f(b)? or f(x,a=b) is that f(x,a)=f(x,b) ? a^bOn 8/5/2011 8:03 AM, Karl-Dieter Crisman wrote: > We got a bug report in Sage (an error raised) which led to the > following experiment. > > (%i1) %e^(y=x); > y = x > (%o1) %e > (%i2) log(y=x); > (%o2) log(y) = log(x) > > > I know that Maxima is very careful (or at least usually is) with > automatic simplification of things involving exponents, but I'm trying > to think of what interpretation the first result would have other than > %e^y=%e^x. > > If there isn't, then this should be simplified; if there is, then > we'll be sure to figure out how to fix the error while leaving that > interpretation as Maxima has it. > > Thanks for any input! > Karl-Dieter > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From yasuaki.honda at gmail.com Sat Aug 6 01:31:30 2011 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Sat, 6 Aug 2011 15:31:30 +0900 Subject: [Maxima] How to write a function which may return noun form of itself in Maxima language Message-ID: Dear maxima users, Is there a suggested way to write a function in Maxima language which may return its noun form if it cannot process the arguments? Let me explain the issue with the following example: The (%i27) defines a function which returns its noun form if the argument is not a number. (%i27) f(x):=if numberp(x) then x^2 else 'f(x)$ (%i28) f(n+3); (%o28) 'f(n+3) So far it seems working as defined. (%i29) %,n:5; (%o29) 'f(8) (%i30) %,nouns; (%o30) 64 With additional informations, I can continue to compute using nouns flag. All this seems good. However: (%i31) f(n+3); (%o31) 'f(n+3) (%i32) %,nouns; This rather simpler example at (%i32), it never returns. It looks like the infinite recursive loop happens. I noticed that if everything is written in Lisp, then the above infinite loop can be avoided. integrate() and sum() functions does not cause such loop when evaluated with nouns. So my question is, is there any suggested way to write a function that may return noun form of itself, without causing infinite loop when evaluated with the noun flag set? Thanks and best regards, Yasuaki Honda, Chiba, Japan Imaxima and Imath maintainer -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernard at marcade.biz Fri Aug 5 19:52:37 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 06 Aug 2011 01:52:37 +0100 Subject: [Maxima] notation of physics In-Reply-To: References: Message-ID: <1312591957.4451.20.camel@dell-laptop> On Thu, 2011-08-04 at 17:33 +0200, syn hedionn wrote: > Hi, > Is there a way to follow notation of physics in order that writing > diff(omega(t),t) doesn't output this but the omega letter with a dot > at the top of the letter(speed), 2dots for a double > derivation=acceleration? I am developing a module for doing Lagrangian mechanics. It uses primes for doing time derivatives. I am a bit wary of attaching it to an email because it is in a very messy state and, since I haven't documented any of it, you wouldn't know what to do with it. Maybe in a couple of weeks I will have a pre-release. However to give you some idea, of what I am doing here it is finding equations of motion from a Lagrangian and solving them: (%i1) load("tdot.mac"); (%o1) /home/consultant/.maxima/mydefaults/tdot.mac (%i2) gcoords(x,y,z); (%o2) done (%i3) UfrakL = (m/2)*(diff(x,t)^2+diff(y,t)^2+diff(z,t)^2) + m*g*z; 2 2 2 m z? m y? m x? (%o3) ? = ----- + g m z + ----- + ----- 2 2 2 (%i4) LagrangEqns(%); (%o4) [m x? = 0, m y? = 0, m (z? - g) = 0] (%i5) msolve(%); 2 g t (%o5) [x = t v + x , y = t v + y , z = t v + ---- + z ] x o y o z 2 o The derivatives are implemented by rules like: tellsimp ('diff(xx,t,1),get(xx,dif)) Where xx picks out one of the variables declared in gcoords(x,y,z) - see (%i2) - and get(xx,dif) evaluates to x? - it was obtained using concat(x,?). msolve calls translates the differential equations into the usual maxima form, adds an explicit time dependency and calls desolve. It also knows that some derivatives should be partial and has a different notation for them, as in: (%i1) load ("tdot.mac"); (%o1) /home/consultant/.maxima/mydefaults/tdot.mac (%i2) gcoords (x, y, z); (%o2) done (%i3) T = (m/2)*(diff(x,t)^2+diff(y,t)^2+diff(z,t)^2); 2 2 2 m z? m y? m x? (%o3) T = ----- + ----- + ----- 2 2 2 (%i4) diff(%,diff(x,t)); (%o4) ? (T) = m x? ?x? (%i5) diff(%,t); d (%o5) -- (? (T)) = m x? dt ?x? Obviously I still have to work on the partial derivative notation, but its staring to look like hat you see in physics textbooks. Cheers, Bernard. From bernard at marcade.biz Fri Aug 5 20:07:08 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 06 Aug 2011 02:07:08 +0100 Subject: [Maxima] What should %e^(y=x) mean? In-Reply-To: <4E3C19CB.2070106@eecs.berkeley.edu> References: <4E3C19CB.2070106@eecs.berkeley.edu> Message-ID: <1312592828.4451.27.camel@dell-laptop> On Fri, 2011-08-05 at 09:26 -0700, R Fateman wrote: > How does it generalize to every function, e.g. f(a=b) is f(a)=f(b)? or > > f(x,a=b) is that f(x,a)=f(x,b) ? > > I wouldn't want desolve(a=b,x) to simplify to desolve(a,x)=desolve(b,x)! I think every example of a simplification of this type is a special case and should be considered on its merits. If enough people would find it useful for %e^(y=x) to simplify to %e^y=%e^x, then it might be worth adding. Personally I can live with it either way. Cheers, Bernard. From nghiaho12 at yahoo.com Wed Aug 3 21:26:11 2011 From: nghiaho12 at yahoo.com (Nghia Ho) Date: Wed, 3 Aug 2011 19:26:11 -0700 (PDT) Subject: [Maxima] Help with very very slow determinant calcuation Message-ID: <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> Hi all, I'm trying to run the determinant() function a 10x10 matrix that contains all symbolic values. I've searched through the mailing list to find a solution. I've tried ratmax:true and newdet(), but it is still taking forever. In fact, as of writing now it has been going for over 12 hours and still hasn't finished! Is the determinant doing other stuff besides doing the multiplication and addition? Is it trying to simplify/factorise as it goes along? Nghia From luigi_marino2 at alice.it Fri Aug 5 09:23:53 2011 From: luigi_marino2 at alice.it (Luigi Marino) Date: Fri, 5 Aug 2011 16:23:53 +0200 Subject: [Maxima] CAD, SARAG and the link to the book Message-ID: Hi Fabrizio I have tested Sarag with Maxima 5.19.2 (wxMaxima 0.8.3). I have found errors , include my test file. Best wishes Luigi Marino -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: esempi_uso.wxm Type: application/octet-stream Size: 9010 bytes Desc: not available URL: From bernard at marcade.biz Sat Aug 6 04:18:59 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 06 Aug 2011 10:18:59 +0100 Subject: [Maxima] Help with very very slow determinant calcuation In-Reply-To: <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> References: <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> Message-ID: <1312622339.4062.9.camel@dell-laptop> On Wed, 2011-08-03 at 19:26 -0700, Nghia Ho wrote: > Hi all, > > > I'm trying to run the determinant() function a 10x10 matrix that contains all symbolic values. I've searched through the mailing list to find a solution. I've tried ratmax:true and newdet(), but it is still taking forever. In fact, as of writing now it has been going for over 12 hours and still hasn't finished! Is the determinant doing other stuff besides doing the multiplication and addition? Is it trying to simplify/factorise as it goes along? > > Nghia > > _______________________________________________ To evaluate a 10x10 determinant containing independent symbols requires 10! = 3628800 multiplications, as well as additions etc. I would expect this to take a very very long time. There are ways of cutting down on this in a numerical matrix or if there are relationships between the symbols. Bernard. From cladelpino at gmail.com Sat Aug 6 04:25:20 2011 From: cladelpino at gmail.com (Claudio Delpino) Date: Sat, 6 Aug 2011 06:25:20 -0300 Subject: [Maxima] Help with very very slow determinant calcuation In-Reply-To: <1312622339.4062.9.camel@dell-laptop> References: <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> <1312622339.4062.9.camel@dell-laptop> Message-ID: Is there any reason you're not factorizing the matrix ? 2011/8/6 Bernard Hurley > On Wed, 2011-08-03 at 19:26 -0700, Nghia Ho wrote: > > Hi all, > > > > > > I'm trying to run the determinant() function a 10x10 matrix that > contains all symbolic values. I've searched through the mailing list to find > a solution. I've tried ratmax:true and newdet(), but it is still taking > forever. In fact, as of writing now it has been going for over 12 hours and > still hasn't finished! Is the determinant doing other stuff besides doing > the multiplication and addition? Is it trying to simplify/factorise as it > goes along? > > > > Nghia > > > > _______________________________________________ > > To evaluate a 10x10 determinant containing independent symbols requires > 10! = 3628800 multiplications, as well as additions etc. I would expect > this to take a very very long time. There are ways of cutting down on > this in a numerical matrix or if there are relationships between the > symbols. > > Bernard. > _______________________________________________ > 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 Aug 6 12:01:49 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 06 Aug 2011 10:01:49 -0700 Subject: [Maxima] How to write a function which may return noun form of itself in Maxima language In-Reply-To: References: Message-ID: <4E3D737D.4090703@eecs.berkeley.edu> I don't like using nouns for anything. You really have two concepts involved here. One is the request to do a computation. The other is a data structure which represents a suspension or an inability to do a computation. If these are represented differently, things become much simpler. define computef(x):= if numberp(x) then x^2 else f(x). s1: computef(3) s2: computef(n+3) work as expected. now try s2, f=computef, n=5 which works as expected also. (I'm also not a fan of "ev" which is being using implicitly, here. However, this is an appropriate use of ev!) RJF On 8/5/2011 11:31 PM, ???? wrote: > Dear maxima users, > > Is there a suggested way to write a function in Maxima language which > may return its noun form if it cannot process the arguments? > > Let me explain the issue with the following example: > The (%i27) defines a function which returns its noun form if the > argument is > not a number. > (%i27) f(x):=if numberp(x) then x^2 else 'f(x)$ > > (%i28) f(n+3); > (%o28) 'f(n+3) > So far it seems working as defined. > > (%i29) %,n:5; > (%o29) 'f(8) > > (%i30) %,nouns; > (%o30) 64 > With additional informations, I can continue to compute using nouns flag. > All this seems good. However: > > (%i31) f(n+3); > (%o31) 'f(n+3) > > (%i32) %,nouns; > > This rather simpler example at (%i32), it never returns. It looks like > the > infinite recursive loop happens. > > I noticed that if everything is written in Lisp, then the above > infinite loop > can be avoided. integrate() and sum() functions does not cause such > loop when evaluated with nouns. > > So my question is, is there any suggested way to write a function that > may return noun form of itself, without causing infinite loop when > evaluated > with the noun flag set? > > Thanks and best regards, > Yasuaki Honda, Chiba, Japan > > Imaxima and Imath maintainer > > > > > _______________________________________________ > 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 Aug 6 13:22:56 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 6 Aug 2011 12:22:56 -0600 Subject: [Maxima] notation of physics In-Reply-To: <1312591957.4451.20.camel@dell-laptop> References: <1312591957.4451.20.camel@dell-laptop> Message-ID: On 8/5/11, Bernard Hurley wrote: > The derivatives are implemented by rules like: > > tellsimp ('diff(xx,t,1),get(xx,dif)) > > Where xx picks out one of the variables declared in gcoords(x,y,z) - see > (%i2) - and get(xx,dif) evaluates to x? - it was obtained using > concat(x,?). msolve calls translates the differential equations into the > usual maxima form, adds an explicit time dependency and calls desolve. Bernard, I'll recommend pretty strongly that you separate the representation of derivative expressions from their display. It appears that you've constructed an alernate represention for derivatives, so the usual Maxima operations don't apply to them. At best you'll need to reinvent some wheels and at worst you or anyone using your code will get an unpleasant surprise when these special derivatives don't work the same way as others. My advice is to work with derivatives in their usual representation in Maxima. Incidentally there is an add-on package for partial derivatives called pdiff that might be useful to you. First work on getting the operations that you want. When you have the derivatives you want, we can work on getting them displayed in the manner you want. best, Robert Dodier From robert.dodier at gmail.com Sat Aug 6 14:05:55 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 6 Aug 2011 13:05:55 -0600 Subject: [Maxima] What should %e^(y=x) mean? In-Reply-To: References: Message-ID: On 8/5/11, Karl-Dieter Crisman wrote: > (%i1) %e^(y=x); > y = x > (%o1) %e > (%i2) log(y=x); > (%o2) log(y) = log(x) > > > I know that Maxima is very careful (or at least usually is) with > automatic simplification of things involving exponents, but I'm trying > to think of what interpretation the first result would have other than > %e^y=%e^x. Well, log is declared to distrubute over lists, matrices, and equations, while exp is not so declared. You can get the desired effect like this in a Maxima session, or just put the Lisp code in maxima-init.lisp. :lisp (setf (get '%exp 'distribute_over) '(mlist mequal)) (Note that this also declares that exp distributes over lists; I hope that's not controversial. Exp shouldn't distribute over matrices since exp(matrix) has another interpretation.) At present a lot of stuff is hard-wired in simplification functions; the distribute_over property is a step in the right direction -- there's just one simple declaration to get the desired effect. Ideally simplification properties for all functions could be declared via s.t. like declare(foo, has_some_relation_to(bar, baz, quux)) with a look-up capability to find all the simplifications for foo or all the operators which have the has_some_relation_to property or queries of that flavor. That's a distant goal at the moment. best, Robert Dodier From macrakis at alum.mit.edu Sat Aug 6 14:07:14 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 6 Aug 2011 15:07:14 -0400 Subject: [Maxima] How to write a function which may return noun form of itself in Maxima language In-Reply-To: References: Message-ID: I suggest you use the "simplifying" package for things like this. Please see: * http://www.ma.utexas.edu/pipermail/maxima/2007/006397.html * http://permalink.gmane.org/gmane.comp.mathematics.maxima.general/34008 for a quick introduction. -s 2011/8/6 ???? > Dear maxima users, > > Is there a suggested way to write a function in Maxima language which > may return its noun form if it cannot process the arguments? > > Let me explain the issue with the following example: > The (%i27) defines a function which returns its noun form if the argument > is > not a number. > (%i27) f(x):=if numberp(x) then x^2 else 'f(x)$ > > (%i28) f(n+3); > (%o28) 'f(n+3) > So far it seems working as defined. > > (%i29) %,n:5; > (%o29) 'f(8) > > (%i30) %,nouns; > (%o30) 64 > With additional informations, I can continue to compute using nouns flag. > All this seems good. However: > > (%i31) f(n+3); > (%o31) 'f(n+3) > > (%i32) %,nouns; > > This rather simpler example at (%i32), it never returns. It looks like the > infinite recursive loop happens. > > I noticed that if everything is written in Lisp, then the above infinite > loop > can be avoided. integrate() and sum() functions does not cause such > loop when evaluated with nouns. > > So my question is, is there any suggested way to write a function that > may return noun form of itself, without causing infinite loop when > evaluated > with the noun flag set? > > Thanks and best regards, > Yasuaki Honda, Chiba, Japan > > Imaxima and Imath maintainer > > > > _______________________________________________ > 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 Aug 6 16:56:59 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 06 Aug 2011 14:56:59 -0700 Subject: [Maxima] What should %e^(y=x) mean? In-Reply-To: References: Message-ID: <4E3DB8AB.5000302@eecs.berkeley.edu> On 8/6/2011 12:05 PM, Robert Dodier wrote: > ute over lists, matrices, and equations, while exp is not so declared. > You can get the desired effect like this in a Maxima session, or just > put the Lisp code in maxima-init.lisp. :lisp (setf (get '%exp > 'distribute_over) '(mlist mequal)) Unfortunately this works only if you write exp(a=b) but not %e^(a=b). I believe this will not work on any internal forms generated computationally. RJF From robert.dodier at gmail.com Sat Aug 6 17:15:57 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 6 Aug 2011 16:15:57 -0600 Subject: [Maxima] How to write a function which may return noun form of itself in Maxima language In-Reply-To: References: Message-ID: On 8/6/11, ???? wrote: > Is there a suggested way to write a function in Maxima language which > may return its noun form if it cannot process the arguments? One way to handle it is to create a simplification rule for each case. Then any arguments aside from those cases are just left unmodified. e.g. matchdeclare (xx, numberp); tellsimp (foo (xx), xx^2); foo (123); => 15129 foo (x + y); => foo(y + x) /* and here we make up another case that we can handle ... */ matchdeclare (ll, listp); tellsimp (foo (ll), map (foo, ll)); foo ([1, 2, %pi, x]); => [1, 4, foo(%pi), foo(x)] Hope this helps, Robert Dodier From robert.dodier at gmail.com Sat Aug 6 17:29:01 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 6 Aug 2011 16:29:01 -0600 Subject: [Maxima] What should %e^(y=x) mean? In-Reply-To: <4E3DB8AB.5000302@eecs.berkeley.edu> References: <4E3DB8AB.5000302@eecs.berkeley.edu> Message-ID: On 8/6/11, Richard Fateman wrote: > On 8/6/2011 12:05 PM, Robert Dodier wrote: >> ute over lists, matrices, and equations, while exp is not so declared. >> You can get the desired effect like this in a Maxima session, or just >> put the Lisp code in maxima-init.lisp. :lisp (setf (get '%exp >> 'distribute_over) '(mlist mequal)) > Unfortunately this works only if you write exp(a=b) but not %e^(a=b). Yup, and if I try the same thing with MEXPT, it doesn't work (probably because MEXPT takes 2 arguments? not sure). I guess it would probably take some Lisp hacking to get the desired effect for exp, then. best Robert Dodier From cladelpino at gmail.com Sat Aug 6 21:49:12 2011 From: cladelpino at gmail.com (Claudio Delpino) Date: Sat, 6 Aug 2011 23:49:12 -0300 Subject: [Maxima] Help with very very slow determinant calcuation In-Reply-To: <1312680220.3221.YahooMailNeo@web161426.mail.bf1.yahoo.com> References: <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> <1312622339.4062.9.camel@dell-laptop> <1312680220.3221.YahooMailNeo@web161426.mail.bf1.yahoo.com> Message-ID: Taking matrix "A" to a LU form (i don't know if there is anything pre-packed in maxima to do this, but it shouldn't be difficult to do on your own [i can help you if you need]), then for det(A)=det(LU)=det(L).det(U), and det(L) and det(U) are straightforwardly the product of their diagonal elements. Of course this is perhaps the approach that's packed in determinant(A), but you could do it step-by-step on your own to grasp control of the calculation. Just a suggestion Regards Claudio 2011/8/6 Nghia Ho > Can you elaborate more on how factorizing the matrix can help? My > background isn't in mathematics, I only did basic engineering level maths. > > ------------------------------ > *From:* Claudio Delpino > *To:* Bernard Hurley > *Cc:* Nghia Ho ; "maxima at math.utexas.edu" < > maxima at math.utexas.edu> > *Sent:* Saturday, 6 August 2011 7:25 PM > *Subject:* Re: [Maxima] Help with very very slow determinant calcuation > > Is there any reason you're not factorizing the matrix ? > > 2011/8/6 Bernard Hurley > > On Wed, 2011-08-03 at 19:26 -0700, Nghia Ho wrote: > > Hi all, > > > > > > I'm trying to run the determinant() function a 10x10 matrix that > contains all symbolic values. I've searched through the mailing list to find > a solution. I've tried ratmax:true and newdet(), but it is still taking > forever. In fact, as of writing now it has been going for over 12 hours and > still hasn't finished! Is the determinant doing other stuff besides doing > the multiplication and addition? Is it trying to simplify/factorise as it > goes along? > > > > Nghia > > > > _______________________________________________ > > To evaluate a 10x10 determinant containing independent symbols requires > 10! = 3628800 multiplications, as well as additions etc. I would expect > this to take a very very long time. There are ways of cutting down on > this in a numerical matrix or if there are relationships between the > symbols. > > Bernard. > _______________________________________________ > 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 nghiaho12 at yahoo.com Sat Aug 6 20:23:40 2011 From: nghiaho12 at yahoo.com (Nghia Ho) Date: Sat, 6 Aug 2011 18:23:40 -0700 (PDT) Subject: [Maxima] Help with very very slow determinant calcuation In-Reply-To: References: <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> <1312622339.4062.9.camel@dell-laptop> Message-ID: <1312680220.3221.YahooMailNeo@web161426.mail.bf1.yahoo.com> Can you elaborate more on how factorizing the matrix can help? My background isn't in mathematics, I only did basic engineering level maths. >________________________________ >From: Claudio Delpino >To: Bernard Hurley >Cc: Nghia Ho ; "maxima at math.utexas.edu" >Sent: Saturday, 6 August 2011 7:25 PM >Subject: Re: [Maxima] Help with very very slow determinant calcuation > > >Is there any reason you're not factorizing the matrix ? > > >2011/8/6 Bernard Hurley > >On Wed, 2011-08-03 at 19:26 -0700, Nghia Ho wrote: >>> Hi all, >>> >>> >>> I'm trying to run the determinant() function a ?10x10 matrix that contains all symbolic values. I've searched through the mailing list to find a solution. I've tried ratmax:true and newdet(), but it is still taking forever. In fact, as of writing now it has been going for over 12 hours and still hasn't finished! Is the determinant doing other stuff besides doing the multiplication and addition? Is it trying to simplify/factorise as it goes along? >>> >>> Nghia >>> >>> _______________________________________________ >> >>To evaluate a 10x10 determinant containing independent symbols requires >>10! = 3628800 multiplications, as well as additions etc. I would expect >>this to take a very very long time. There are ways of cutting down on >>this in a numerical matrix or if there are relationships between the >>symbols. >> >>Bernard. >> >>_______________________________________________ >>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 Sun Aug 7 05:18:35 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 7 Aug 2011 05:18:35 -0500 Subject: [Maxima] Help with very very slow determinant calcuation In-Reply-To: <1312680220.3221.YahooMailNeo@web161426.mail.bf1.yahoo.com> References: <1312680220.3221.YahooMailNeo@web161426.mail.bf1.yahoo.com>, <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> <1312622339.4062.9.camel@dell-laptop> Message-ID: The cost for the function determinant is comparable to the cost of a LU factorization. So, no computing the determinant by means of the LU factorization is unlikely to help. Nghia Ho already tried setting ratmx to true and newdet. And that's about all that might speed up the calculation. For symbolic matrices, the standard big oh time estimates are misleading. The time for addition, for example, isn't constant, but the time depends on the complexity of the expressions. It's likely that if Maxima was able to find the determinant of this 10x10 symbolic matrix, the result would be so huge that it wouldn't be useful. I would suggest a different approach. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- Can you elaborate more on how factorizing the matrix can help? My background isn't in mathematics, I only did basic engineering level maths. From yasuaki.honda at gmail.com Sun Aug 7 08:31:12 2011 From: yasuaki.honda at gmail.com (=?ISO-2022-JP?B?GyRCS1xFRDkvOTgbKEI=?=) Date: Sun, 7 Aug 2011 22:31:12 +0900 Subject: [Maxima] How to write a function which may return noun form of itself in Maxima language In-Reply-To: References: Message-ID: Richard, Robert, and Stavros, Thanks for all the suggestions. I tried both Robert's and Richard's suggestions and they worked great. I will also try simplifying pacakge that Starvos has introduced. This also seems applicable for my issue. Thank you very much!! Yasuaki Honda 2011?8?7?7:15 Robert Dodier : > On 8/6/11, ???? wrote: > > > Is there a suggested way to write a function in Maxima language which > > may return its noun form if it cannot process the arguments? > > One way to handle it is to create a simplification rule for > each case. Then any arguments aside from those cases > are just left unmodified. > > e.g. > > matchdeclare (xx, numberp); > tellsimp (foo (xx), xx^2); > > foo (123); > => 15129 > > foo (x + y); > => foo(y + x) > > /* and here we make up another case that we can handle ... */ > > matchdeclare (ll, listp); > tellsimp (foo (ll), map (foo, ll)); > > foo ([1, 2, %pi, x]); > => [1, 4, foo(%pi), foo(x)] > > > Hope this helps, > > Robert Dodier > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernard at marcade.biz Sun Aug 7 09:55:36 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sun, 07 Aug 2011 15:55:36 +0100 Subject: [Maxima] Help with very very slow determinant calcuation In-Reply-To: References: <1312680220.3221.YahooMailNeo@web161426.mail.bf1.yahoo.com> , <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> <1312622339.4062.9.camel@dell-laptop> Message-ID: <1312728936.4156.48.camel@dell-laptop> On Sun, 2011-08-07 at 05:18 -0500, Barton Willis wrote: > The cost for the function determinant is comparable to the cost of a LU factorization. So, no > computing the determinant by means of the LU factorization is unlikely to help. Nghia Ho already > tried setting ratmx to true and newdet. And that's about all that might speed up the > calculation. > > For symbolic matrices, the standard big oh time estimates are misleading. The time for addition, > for example, isn't constant, but the time depends on the complexity of the expressions. > > It's likely that if Maxima was able to find the determinant of this 10x10 symbolic matrix, the > result would be so huge that it wouldn't be useful. I would suggest a different approach. > An n x n determinant of terms of the form x[1,1],..., x[1,n], x[2,1]...., x[n,n] is the sum of n! terms each the product of n terms. There is no getting away from that however you evaluate the determinant! Using elementary row/column operations on a matrix of numbers can be used to reduce it to diagonal form and then evaluate the determinant of that but this is of no help with pure symbols. Cheers, Bernard. From willisb at unk.edu Sun Aug 7 12:34:21 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 7 Aug 2011 12:34:21 -0500 Subject: [Maxima] Help with very very slow determinant calcuation In-Reply-To: <1312728936.4156.48.camel@dell-laptop> References: <1312728936.4156.48.camel@dell-laptop>, <1312680220.3221.YahooMailNeo@web161426.mail.bf1.yahoo.com> , <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> <1312622339.4062.9.camel@dell-laptop> Message-ID: -----Bernard Hurley wrote: ----- An n x n determinant of terms of the form x[1,1],..., x[1,n], x[2,1]...., x[n,n] is the sum of n! terms each the product of n terms. There is no getting away from that however you evaluate the determinant! Whether or not Maxima can compute the determinat of a matrix with symbolic entries in a reasonable time depends on the matrix: (%i1) m : genmatrix(lambda([a,b], random(3) + random(3)*z),50,50)$ (%i2) m : matrixmap(rat,m)$ (%i3) (showtime : all, ratmx : true)$ (%i4) determinant(m)$ Evaluation took 13.3220 seconds (13.4630 elapsed) Roughly, Avogadro constant < 50! < Eddington number. --Barton From synhedionn at gmail.com Sun Aug 7 12:36:23 2011 From: synhedionn at gmail.com (syn hedionn) Date: Sun, 7 Aug 2011 19:36:23 +0200 Subject: [Maxima] notation of physics In-Reply-To: <4E3AC825.2090506@street-artists.org> References: <4E3AC825.2090506@street-artists.org> Message-ID: In fact, I use the Maxima Texmacs magnifier output , so thanks; I'll see what I can do with converters. On Thu, Aug 4, 2011 at 6:26 PM, dlakelan wrote: > On 08/04/2011 08:33 AM, syn hedionn wrote: > >> Hi, >> Is there a way to follow notation of physics in order that writing >> diff(omega(t),t) doesn't output this but the omega letter with a dot at >> the top of the letter(speed), 2dots for a double derivation=acceleration? >> > > using texput and the tex converter you can have maxima output this for > inclusion into a TeX/LaTeX document. Hope that helps. > > ______________________________**_________________ > 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 cloos at jhcloos.com Sun Aug 7 16:38:36 2011 From: cloos at jhcloos.com (James Cloos) Date: Sun, 07 Aug 2011 17:38:36 -0400 Subject: [Maxima] notation Message-ID: Can one write in maxima notation the TeX: $$ B_i^{n}(t) $$ as that is used, eg, for Bernstein basis functions? Or would one have to work with and alternate notation, such as B[i,n](t)? -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From willisb at unk.edu Sun Aug 7 17:36:17 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 7 Aug 2011 17:36:17 -0500 Subject: [Maxima] notation In-Reply-To: References: Message-ID: No user interface for Maxima supports input of mixed superscripted/subscripted functions. Be careful with subscripted functions: see http://www.math.utexas.edu/pipermail/maxima/2008/009712.html. Finally, for the Bernstein polynomials in Maxima 5.25.0, input ?? bernstein. Two examples: (%i9) bernstein_poly(5,10,1+%i/5); (%o9) 724752/9765625-(19152*%i)/390625 (%i10) bernstein_poly(k,n,x), bernstein_explicit : true; (%o10) binomial(n,k)*(1-x)^(n-k)*x^k --Barton -----maxima-bounces at math.utexas.edu wrote: ----- ne write in maxima notation the TeX: ??$$ B_i^{n}(t) $$ as that is used, eg, for Bernstein basis functions? Or would one have to work with and alternate notation, such as B[i,n](t)? -JimC -- James Cloos ? ? ? ? OpenPGP: 1024D/ED7DAEA6 _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at eecs.berkeley.edu Sun Aug 7 17:38:01 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 07 Aug 2011 15:38:01 -0700 Subject: [Maxima] notation In-Reply-To: References: Message-ID: <4E3F13C9.7000809@eecs.berkeley.edu> On 8/7/2011 2:38 PM, James Cloos wrote: > Can one write in maxima notation the TeX: > > $$ B_i^{n}(t) $$ > > as that is used, eg, for Bernstein basis functions? > > Or would one have to work with and alternate notation, such as B[i,n](t)? > > -JimC Given that you have full access to the parser and the display, you could implement almost any notation. However, B[i]^n would not be a great idea as input, unless you wish for B[i]^0 to be simplified to 1. You could use as input something like bernstein(i,n,t) and alter the display program to do something special with this. Most likely, a sensible thing to do is to just use b(i,n,t) or perhaps b[i,n](t) and get on with whatever you want to do with Bernstein functions. Unless you are insistent on seeing the notation just-so, and want to fiddle with the programs, in which case you are certainly welcome to do that. I once worked with a mathematician who essentially refused to use computer algebra systems because keyboards did not have keys for particular symbols like alpha, partial derivative, etc. His usefulness (to my project) was severely limited by this obsession with notational exactitude. RJF From cloos at jhcloos.com Sun Aug 7 18:20:29 2011 From: cloos at jhcloos.com (James Cloos) Date: Sun, 07 Aug 2011 19:20:29 -0400 Subject: [Maxima] notation In-Reply-To: <4E3F13C9.7000809@eecs.berkeley.edu> (Richard Fateman's message of "Sun, 07 Aug 2011 15:38:01 -0700") References: <4E3F13C9.7000809@eecs.berkeley.edu> Message-ID: >>>>> "RF" == Richard Fateman writes: RF> Most likely, a sensible thing to do is to just use b(i,n,t) or RF> perhaps b[i,n](t) and get on with whatever you want to do ... RF> Unless you are insistent on seeing the notation just-so, and want to RF> fiddle with the programs, in which case you are certainly welcome to RF> do that. Thanks. I referenced the bernstein only because it was a handy example to cut- n-paste. I asked because that notation would be useful to use in docu- mentation and cut-n-paste from an imaxima buffer to a TeX buffer makes some stuff easier. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From cloos at jhcloos.com Sun Aug 7 18:26:55 2011 From: cloos at jhcloos.com (James Cloos) Date: Sun, 07 Aug 2011 19:26:55 -0400 Subject: [Maxima] notation In-Reply-To: (Barton Willis's message of "Sun, 7 Aug 2011 17:36:17 -0500") References: Message-ID: >>>>> "BW" == Barton Willis writes: BW> No user interface for Maxima supports input of mixed BW> superscripted/subscripted functions. Thanks for the confirmation. BW> Be careful with subscripted functions: see BW> http://www.math.utexas.edu/pipermail/maxima/2008/009712.html. Yes. The article looks familiar, but I had forgotten about that issue. BW> Finally, for the Bernstein polynomials in Maxima 5.25.0 I expect to upgrade to .25 later tonight. My net bandwidth has been full this week downloading my dist's upgrade from texlive 2010 ? 2011. Something like 1.5 Gigs or so.... But $B^n_i$ was just one example. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From nghiaho12 at yahoo.com Sun Aug 7 08:28:19 2011 From: nghiaho12 at yahoo.com (Nghia Ho) Date: Sun, 7 Aug 2011 06:28:19 -0700 (PDT) Subject: [Maxima] Help with very very slow determinant calcuation In-Reply-To: References: <1312680220.3221.YahooMailNeo@web161426.mail.bf1.yahoo.com>, <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> <1312622339.4062.9.camel@dell-laptop> Message-ID: <1312723699.11979.YahooMailNeo@web161425.mail.bf1.yahoo.com> I think you might be right, I'm probably trying to calculate something very impractical mathematically. I was following an algorithm from a computer vision paper and was hoping to keep everything symbolic so I could write a function that calculates the result in "one shot" (albeit some monstrous equation). The 10x10 matrix that they have ends up having mostly numerical values mixed with a single polynomial symbol (z or z^2), which is probably practical to calculate. Of interest is that they note that higher order polynomial terms (> 10) end up canceling each other out, which made me optimistic that it was possible to keep it all symbolic. But I guess the intermediate steps that Maxima has to do will take an extremely long amount of time before it can do any cancellation of terms. >________________________________ >From: Barton Willis >To: nghiaho12 at yahoo.com >Cc: bernard at marcade.biz; cladelpino at gmail.com; maxima at math.utexas.edu >Sent: Sunday, 7 August 2011 8:18 PM >Subject: Re: [Maxima] Help with very very slow determinant calcuation > >The cost for the function determinant is comparable to the cost of a LU factorization. So, no >computing the determinant by means of the LU factorization is unlikely to help. Nghia Ho already >tried setting ratmx to true and newdet. And that's about all that might speed up the >calculation. > >For symbolic matrices, the standard big oh time estimates are misleading. The time for addition, >for example, isn't constant, but the time depends on the complexity of the expressions. > >It's likely that if Maxima was able to find the determinant of this 10x10 symbolic matrix, the >result would be so huge that it wouldn't be useful. I would suggest a different approach. > >--Barton > >-----maxima-bounces at math.utexas.edu wrote: ----- > >Can you elaborate more on how factorizing the matrix can help? My background isn't in mathematics, I only did basic engineering level maths. > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kcrisman at gmail.com Mon Aug 8 07:50:57 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Mon, 8 Aug 2011 08:50:57 -0400 Subject: [Maxima] What should %e^(y=x) mean? In-Reply-To: References: <4E3DB8AB.5000302@eecs.berkeley.edu> Message-ID: On Sat, Aug 6, 2011 at 6:29 PM, Robert Dodier wrote: > On 8/6/11, Richard Fateman wrote: > >> On 8/6/2011 12:05 PM, Robert Dodier wrote: >>> ute over lists, matrices, and equations, while exp is not so declared. >>> You can get the desired effect like this in a Maxima session, or just >>> put the Lisp code in maxima-init.lisp. :lisp (setf (get '%exp >>> 'distribute_over) '(mlist mequal)) > >> Unfortunately this works only if you write ?exp(a=b) ? but not %e^(a=b). > > Yup, and if I try the same thing with MEXPT, it doesn't work > (probably because MEXPT takes 2 arguments? not sure). > > I guess it would probably take some Lisp hacking to get > the desired effect for exp, then. > Thanks for these comments, that clarifies things a lot. Is getting exp to expand over equalities/lists something I should consider a Maxima bug/enhancement, or just a user option? (In particular, should I open a Maxima ticket for this, or just put on our ticket that we would want to hack our own copy of Sage?) Thanks! From fateman at eecs.berkeley.edu Mon Aug 8 08:52:44 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 08 Aug 2011 06:52:44 -0700 Subject: [Maxima] What should %e^(y=x) mean? In-Reply-To: References: <4E3DB8AB.5000302@eecs.berkeley.edu> Message-ID: <4E3FEA2C.5060504@eecs.berkeley.edu> I don't view this as a bug, since map(exp,a=b) or map(lambda([x],%e^x),a=b); does what you would seem to want. Since exp is not really a function of one argument -- it is ?mexpt(%e,x), there is not necessarily a natural mapping operation over structures, e.g. what does [a,b]^[c,d] mean, really? So if you want Sage to do something, you can easily put it in Sage. There are an unlimited number of ideas that could be put into Maxima, or Sage. I would prefer to see effort expended on good ideas that need hard work, not what constitutes (in my opinion) minor embroidery. Implementing something equivalent to Mathematica's Reduce for example, would be nice. RJF On 8/8/2011 5:50 AM, Karl-Dieter Crisman wrote: > On Sat, Aug 6, 2011 at 6:29 PM, Robert Dodier wrote: >> On 8/6/11, Richard Fateman wrote: >> >>> On 8/6/2011 12:05 PM, Robert Dodier wrote: >>>> ute over lists, matrices, and equations, while exp is not so declared. >>>> You can get the desired effect like this in a Maxima session, or just >>>> put the Lisp code in maxima-init.lisp. :lisp (setf (get '%exp >>>> 'distribute_over) '(mlist mequal)) >>> Unfortunately this works only if you write exp(a=b) but not %e^(a=b). >> Yup, and if I try the same thing with MEXPT, it doesn't work >> (probably because MEXPT takes 2 arguments? not sure). >> >> I guess it would probably take some Lisp hacking to get >> the desired effect for exp, then. >> > Thanks for these comments, that clarifies things a lot. > > Is getting exp to expand over equalities/lists something I should > consider a Maxima bug/enhancement, or just a user option? (In > particular, should I open a Maxima ticket for this, or just put on our > ticket that we would want to hack our own copy of Sage?) > > Thanks! From fateman at eecs.berkeley.edu Mon Aug 8 08:58:23 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 08 Aug 2011 06:58:23 -0700 Subject: [Maxima] Help with very very slow determinant calcuation In-Reply-To: <1312723699.11979.YahooMailNeo@web161425.mail.bf1.yahoo.com> References: <1312680220.3221.YahooMailNeo@web161426.mail.bf1.yahoo.com>, <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> <1312622339.4062.9.camel@dell-laptop> <1312723699.11979.YahooMailNeo@web161425.mail.bf1.yahoo.com> Message-ID: <4E3FEB7F.9050703@eecs.berkeley.edu> If the matrix entries are all polynomials in a single variable, say z, then you can use modular arithmetic and the "Chinese Remainder Theorem" to find the symbolic determinant, if it is a polynomial of modest degree. You compute the determinant several times modulo prime numbers p1, p2, ... , pn. Then you use the CRT to determine the polynomial of degree n-1 that assumes those values. This can also work with polys in several variables. You have managed to not describe your problem sufficiently to actually discuss it from a symbolic standpoint. From this standpoint what matters is the structural complexity of the entries: how many variables, polynomial or rational, degree, perhaps sparsity. It might be easier if you just put the matrix on a file and gave people a link to it. Or perhaps just posted it if it is small enough. RJF On 8/7/2011 6:28 AM, Nghia Ho wrote: > I think you might be right, I'm probably trying to calculate something > very impractical mathematically. I was following an algorithm from a > computer vision paper and was hoping to keep everything symbolic so I > could write a function that calculates the result in "one shot" > (albeit some monstrous equation). The 10x10 matrix that they have ends > up having mostly numerical values mixed with a single polynomial > symbol (z or z^2), which is probably practical to calculate. Of > interest is that they note that higher order polynomial terms (> 10) > end up canceling each other out, which made me optimistic that it was > possible to keep it all symbolic. But I guess the intermediate steps > that Maxima has to do will take an extremely long amount of time > before it can do any cancellation of terms. > > ------------------------------------------------------------------------ > *From:* Barton Willis > *To:* nghiaho12 at yahoo.com > *Cc:* bernard at marcade.biz; cladelpino at gmail.com; > maxima at math.utexas.edu > *Sent:* Sunday, 7 August 2011 8:18 PM > *Subject:* Re: [Maxima] Help with very very slow determinant > calcuation > > The cost for the function determinant is comparable to the cost of > a LU factorization. So, no > computing the determinant by means of the LU factorization is > unlikely to help. Nghia Ho already > tried setting ratmx to true and newdet. And that's about all that > might speed up the > calculation. > > For symbolic matrices, the standard big oh time estimates are > misleading. The time for addition, > for example, isn't constant, but the time depends on the > complexity of the expressions. > > It's likely that if Maxima was able to find the determinant of > this 10x10 symbolic matrix, the > result would be so huge that it wouldn't be useful. I would > suggest a different approach. > > --Barton > > -----maxima-bounces at math.utexas.edu > wrote: ----- > > Can you elaborate more on how factorizing the matrix can help? My > background isn't in mathematics, I only did basic engineering > level maths. > > > > > > _______________________________________________ > 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 kcrisman at gmail.com Mon Aug 8 09:08:03 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Mon, 8 Aug 2011 10:08:03 -0400 Subject: [Maxima] What should %e^(y=x) mean? In-Reply-To: <4E3FEA2C.5060504@eecs.berkeley.edu> References: <4E3DB8AB.5000302@eecs.berkeley.edu> <4E3FEA2C.5060504@eecs.berkeley.edu> Message-ID: > Since exp is not really a function of one argument -- it is ?mexpt(%e,x), > there is not necessarily a natural mapping operation over structures, e.g. > what does [a,b]^[c,d] mean, really? Right, and I'm not suggesting that should be resolved. I think that there are some structural differences here. > So if you want Sage to do something, you can easily put it in Sage. Naturally! Which in this case means patching Maxima, though hopefully it wouldn't be too hard. > There are an unlimited number of ideas that could be put into Maxima, > or Sage. ?I would prefer to see effort expended on good ideas that > need hard work, ?not what constitutes (in my opinion) minor embroidery. True. However, some of us only have time for minor embroidery, and that is what generates a lot of bug reports. > Implementing something equivalent to Mathematica's Reduce for example, > would be nice. Agreed. Are you volunteering? ;-) I'll put this issue as "not considered a bug by upstream", then. Thanks again for the assistance! Karl-Dieter From robert.dodier at gmail.com Mon Aug 8 10:30:40 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 8 Aug 2011 09:30:40 -0600 Subject: [Maxima] What should %e^(y=x) mean? In-Reply-To: References: <4E3DB8AB.5000302@eecs.berkeley.edu> Message-ID: Here's another attempt. If it works for you maybe you can put it in your initilization file (maxima-init.mac). matchdeclare ([aa, bb, cc], all); tellsimp (aa^(bb = cc), aa^bb = aa^cc); exp(a=b); => %e^a = %e^b 2^(a=b); => 2^a = 2^b HTH Robert Dodier On 8/8/11, Karl-Dieter Crisman wrote: > On Sat, Aug 6, 2011 at 6:29 PM, Robert Dodier > wrote: >> On 8/6/11, Richard Fateman wrote: >> >>> On 8/6/2011 12:05 PM, Robert Dodier wrote: >>>> ute over lists, matrices, and equations, while exp is not so declared. >>>> You can get the desired effect like this in a Maxima session, or just >>>> put the Lisp code in maxima-init.lisp. :lisp (setf (get '%exp >>>> 'distribute_over) '(mlist mequal)) >> >>> Unfortunately this works only if you write exp(a=b) but not %e^(a=b). >> >> Yup, and if I try the same thing with MEXPT, it doesn't work >> (probably because MEXPT takes 2 arguments? not sure). >> >> I guess it would probably take some Lisp hacking to get >> the desired effect for exp, then. >> > > Thanks for these comments, that clarifies things a lot. > > Is getting exp to expand over equalities/lists something I should > consider a Maxima bug/enhancement, or just a user option? (In > particular, should I open a Maxima ticket for this, or just put on our > ticket that we would want to hack our own copy of Sage?) > > Thanks! > From robert.dodier at gmail.com Mon Aug 8 10:34:54 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 8 Aug 2011 09:34:54 -0600 Subject: [Maxima] What should %e^(y=x) mean? In-Reply-To: References: <4E3DB8AB.5000302@eecs.berkeley.edu> Message-ID: On 8/8/11, Karl-Dieter Crisman wrote: > Is getting exp to expand over equalities/lists something I should > consider a Maxima bug/enhancement, or just a user option? (In > particular, should I open a Maxima ticket for this, or just put on our > ticket that we would want to hack our own copy of Sage?) Well, you can certainly open an enhancement request (there is a separate tracker in the Sourceforge project for that) for anything you want. There is no guarantee that anything will come of it, but at least it will be on the record. best Robert Dodier From rayneolivetti at yahoo.com Mon Aug 8 13:46:21 2011 From: rayneolivetti at yahoo.com (Rayne Olivetti) Date: Mon, 8 Aug 2011 11:46:21 -0700 (PDT) Subject: [Maxima] LaTeX labels in Maxima plots Message-ID: <1312829181.10306.YahooMailClassic@web65603.mail.ac4.yahoo.com> This is something very desirable for articles. (a Mathematica version can be found here: http://wwwth.mpp.mpg.de/members/jgrosse/mathpsfrag/) Currently, I can get output with LaTeX output with something like this: plot2d([sin(x)], [x,-5,5],[y,-5,5],[gnuplot_term, latex], [gnuplot_out_file, "~/graph.tex"],[xlabel, "$\\alpha$"],[ylabel,"$\\sin(\\alpha)$"]); then I will need to wrap it in a LaTeX file, like this \documentclass[letterpaper,10pt]{scrartcl} \usepackage[latin1]{inputenc} \usepackage{amsfonts} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsthm} \usepackage[T1]{fontenc} \usepackage[dvips]{graphicx} \begin{document} \thispagestyle{empty} \pagestyle{empty} \begin{figure} \input{graph} \end{figure} \end{document} and run LaTeX externally to see a plot with LaTeX labels. It'd be nice if there was a way of doing this in a more integrated fashion. From fateman at eecs.berkeley.edu Mon Aug 8 17:41:00 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 08 Aug 2011 15:41:00 -0700 Subject: [Maxima] Help with very very slow determinant calcuation In-Reply-To: <1312815042.76304.YahooMailNeo@web161425.mail.bf1.yahoo.com> References: <1312680220.3221.YahooMailNeo@web161426.mail.bf1.yahoo.com>, <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> <1312622339.4062.9.camel@dell-laptop> <1312723699.11979.YahooMailNeo@web161425.mail.bf1.yahoo.com> <4E3FEB7F.9050703@eecs.berkeley.edu> <1312815042.76304.YahooMailNeo@web161425.mail.bf1.yahoo.com> Message-ID: <4E4065FC.3090509@eecs.berkeley.edu> On 8/8/2011 7:50 AM, Nghia Ho wrote: > My maxima script can be downloaded here It would be nice to put newlines in your script. There seems to be at least 39 variables, just looking at the first few lines of the script. there are many redundancies in your code. for example, expand() could be called once instead of 100 times. and coeff(coeff(E,x,2),y,2) is coeff(E,x^2*y^2). Unless there is something more that you know about the determinant, calculating it by brute force seems unreasonable. Can you do a 3X3 case? From nghiaho12 at yahoo.com Mon Aug 8 09:50:42 2011 From: nghiaho12 at yahoo.com (Nghia Ho) Date: Mon, 8 Aug 2011 07:50:42 -0700 (PDT) Subject: [Maxima] Help with very very slow determinant calcuation In-Reply-To: <4E3FEB7F.9050703@eecs.berkeley.edu> References: <1312680220.3221.YahooMailNeo@web161426.mail.bf1.yahoo.com>, <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> <1312622339.4062.9.camel@dell-laptop> <1312723699.11979.YahooMailNeo@web161425.mail.bf1.yahoo.com> <4E3FEB7F.9050703@eecs.berkeley.edu> Message-ID: <1312815042.76304.YahooMailNeo@web161425.mail.bf1.yahoo.com> My maxima script can be downloaded here http://nghiaho.com/uploads/5point.mac I call it via load("5point.mac"). It will create matrix Cz and Cz2. Cz is the original symbolic matrix and Cz2 is my attempt at simplifying it by grouping the constants and z terms together. Apologies in advance for large chunk of repetitive code. I've only learnt to use Maxima recently and have not learnt enough of the syntax to make the code nicer. I used another scripting program to generate part of the Maxima script. The paper I'm trying to implement is from http://users.cecs.anu.edu.au/~hongdong/new5pt_cameraREady_ver_1.pdf (4 pages). I've reached a point where I'm trying to solve: det(C(z)) = 0, where C(z) is the 10x10 symbolic matrix. The paper says this determinant is also known as "hidden variable resultant", which I'm unfamiliar with. Beyond that it assumes the reader will know how to solve it. >________________________________ >From: Richard Fateman >To: Nghia Ho >Cc: Barton Willis ; "maxima at math.utexas.edu" >Sent: Monday, 8 August 2011 11:58 PM >Subject: Re: [Maxima] Help with very very slow determinant calcuation > > >If the matrix entries are all polynomials in a single variable, say z, then you can use modular arithmetic and the "Chinese Remainder Theorem" >to find the symbolic determinant, if it is a polynomial of modest ????degree. > >You compute the determinant several times modulo prime numbers p1, ????p2, ... , pn. >Then you use the CRT to determine the polynomial of degree n-1 that ????assumes those values. > >This can also work with polys in several variables.?? You have ????managed to not describe your problem >sufficiently to actually discuss it from a symbolic standpoint.? ????From this standpoint what matters is the >structural complexity of the entries:? how many variables, ????polynomial or rational, degree, perhaps sparsity. >It might be easier if you just put the matrix on a file and gave ????people a link to it.? Or perhaps just posted >it if it is small enough. >RJF >On 8/7/2011 6:28 AM, Nghia Ho wrote: >I think you might be right, I'm probably trying to calculate something very impractical mathematically. I was following an algorithm from a computer vision paper and was hoping to keep everything symbolic so I could write a function that calculates the result in "one shot" (albeit some monstrous equation). The 10x10 matrix that they have ends up having mostly numerical values mixed with a single polynomial symbol (z or z^2), which is probably practical to calculate. Of interest is that they note that higher order polynomial terms (> 10) end up canceling each other out, which made me optimistic that it was possible to keep it all symbolic. But I guess the intermediate steps that Maxima has to do will take an extremely long amount of time before it can do any cancellation of terms. >> >> >> >> >>>________________________________ >>>From: Barton Willis >>>To: nghiaho12 at yahoo.com >>>Cc: bernard at marcade.biz; cladelpino at gmail.com; maxima at math.utexas.edu >>>Sent: Sunday, 7 August 2011 8:18 PM >>>Subject: Re: [Maxima] Help with very very slow determinant calcuation >>> >>>The cost for the function determinant is comparable to ????????????????the cost of a LU factorization. So, no >>>computing the determinant by means of the LU ????????????????factorization is unlikely to help. Nghia Ho already >>>tried setting ratmx to true and newdet. And that's about ????????????????all that might speed up the >>>calculation. >>> >>>For symbolic matrices, the standard big oh time ????????????????estimates are misleading. The time for addition, >>>for example, isn't constant, but the time depends on the ????????????????complexity of the expressions. >>> >>>It's likely that if Maxima was able to find the ????????????????determinant of this 10x10 symbolic matrix, the >>>result would be so huge that it wouldn't be useful. I ????????????????would suggest a different approach. >>> >>>--Barton >>> >>>-----maxima-bounces at math.utexas.edu wrote: ----- >>> >>>Can you elaborate more on how factorizing the matrix can ????????????????help? My background isn't in mathematics, I only did ????????????????basic engineering level maths. >>> >>> >>> >>> >> >> >>_______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima > > > From nb0yjxtr at iceland.freeshell.org Mon Aug 8 16:50:51 2011 From: nb0yjxtr at iceland.freeshell.org (Leo) Date: Mon, 08 Aug 2011 21:50:51 +0000 Subject: [Maxima] LaTeX labels in Maxima plots In-Reply-To: <1312829181.10306.YahooMailClassic@web65603.mail.ac4.yahoo.com> (message from Rayne Olivetti on Mon, 8 Aug 2011 11:46:21 -0700) Message-ID: <1qpobzztvwk.fsf@iceland.freeshell.org> Rayne Olivetti writes: > This is something very desirable for articles. (a Mathematica version can be found here: http://wwwth.mpp.mpg.de/members/jgrosse/mathpsfrag/) > > Currently, I can get output with LaTeX output with something like this: > > plot2d([sin(x)], [x,-5,5],[y,-5,5],[gnuplot_term, latex], [gnuplot_out_file, "~/graph.tex"],[xlabel, "$\\alpha$"],[ylabel,"$\\sin(\\alpha)$"]); > > then I will need to wrap it in a LaTeX file, like this > > \documentclass[letterpaper,10pt]{scrartcl} > > \usepackage[latin1]{inputenc} > \usepackage{amsfonts} > \usepackage{amsmath} > \usepackage{amssymb} > \usepackage{amsthm} > \usepackage[T1]{fontenc} > \usepackage[dvips]{graphicx} > > > \begin{document} > \thispagestyle{empty} > \pagestyle{empty} > \begin{figure} > \input{graph} > \end{figure} > \end{document} > > and run LaTeX externally to see a plot with LaTeX labels. > It'd be nice if there was a way of doing this in a more integrated fashion. How about: plot2d_with_latex_labels([args]) := block([outfile:"/tmp/graph.tex",pdffile:"/tmp/graph.pdf"], print_latex_boiler_plate(outfile), apply(plot2d,args), system(concat("pdflatex ",outfile," && xpdf ",pdffile))); and print_latex_boiler_plate does what it says. -- Leo Butler nb0yjxtr at sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org From nghiaho12 at yahoo.com Mon Aug 8 21:33:22 2011 From: nghiaho12 at yahoo.com (Nghia Ho) Date: Mon, 8 Aug 2011 19:33:22 -0700 (PDT) Subject: [Maxima] Help with very very slow determinant calcuation In-Reply-To: <4E4065FC.3090509@eecs.berkeley.edu> References: <1312680220.3221.YahooMailNeo@web161426.mail.bf1.yahoo.com>, <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> <1312622339.4062.9.camel@dell-laptop> <1312723699.11979.YahooMailNeo@web161425.mail.bf1.yahoo.com> <4E3FEB7F.9050703@eecs.berkeley.edu> <1312815042.76304.YahooMailNeo@web161425.mail.bf1.yahoo.com> <4E4065FC.3090509@eecs.berkeley.edu> Message-ID: <1312857202.40889.YahooMailNeo@web161423.mail.bf1.yahoo.com> There should be newline characters, at least on Linux. Thanks for the suggestion about using only one coeff call. After much re-reading of the paper, I think I might have misinterpreted the paper (doh!). The problem boils down to solving a linear system of this form: C(z) * X(x,y) = 0 where C(z) is the 10x10 symbolic matrix of constants and 'z' and X(x,y) a 10x1 matrix comprised of combinations of 'x' and 'y'. This looks like a typical nullspace problem (Ax = 0), where I have to find a non-trivial solution. The paper says there is a non-trivial solution if and only if det(C(z)) = 0, which I think I misinterpreted as the equation to solve. I now believe the correct solution is to call nullspace(Cz), then solve a polynomial equation. I've tried the nullspace function on a mock 10x10 symbolic/numerical matrix and it returns a result almost immediately. ----- Original Message ----- > From: Richard Fateman > To: Nghia Ho > Cc: Barton Willis ; "maxima at math.utexas.edu" > Sent: Tuesday, 9 August 2011 8:41 AM > Subject: Re: [Maxima] Help with very very slow determinant calcuation > > On 8/8/2011 7:50 AM, Nghia Ho wrote: >> My maxima script can be downloaded here > It would be nice to put newlines in your script. > > > There seems to be at least 39 variables, just looking at the first few lines of > the script. > > there are many redundancies in your code. for example, expand() could be called > once instead of 100 times. and coeff(coeff(E,x,2),y,2)? ? is? coeff(E,x^2*y^2). > > Unless there is something more that you know about the determinant, calculating > it > by brute force seems unreasonable.? Can you do a 3X3 case? > From willisb at unk.edu Tue Aug 9 06:30:43 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 9 Aug 2011 06:30:43 -0500 Subject: [Maxima] Help with very very slow determinant calcuation In-Reply-To: <1312857202.40889.YahooMailNeo@web161423.mail.bf1.yahoo.com> References: <1312857202.40889.YahooMailNeo@web161423.mail.bf1.yahoo.com>, <1312680220.3221.YahooMailNeo@web161426.mail.bf1.yahoo.com>, <1312424771.99406.YahooMailNeo@web161427.mail.bf1.yahoo.com> <1312622339.4062.9.camel@dell-laptop> <1312723699.11979.YahooMailNeo@web161425.mail.bf1.yahoo.com> <4E3FEB7F.9050703@eecs.berkeley.edu> <1312815042.76304.YahooMailNeo@web161425.mail.bf1.yahoo.com> <4E4065FC.3090509@eecs.berkeley.edu> Message-ID: Without additional manual labor, I'm not sure that nullspace will do what you need; example: (%i2) nullspace(matrix([a,b],[c,d])); "Proviso: "notequal(a,0) and notequal(a*d-b*c,0) (%o2) span() Assuming a # 0 and ad-bc # 0, the nullspace is empty. You'll need to investigate the cases a=0, ad-bc=0 manually. Maybe you should try triangularize? --Barton (author of nullspace) -----maxima-bounces at math.utexas.edu wrote: ----- >To: Richard Fateman >From: Nghia Ho >Sent by: maxima-bounces at math.utexas.edu >Date: 08/09/2011 02:33AM >Cc: "maxima at math.utexas.edu" , Barton Willis > >Subject: Re: [Maxima] Help with very very slow determinant calcuation > >There should be newline characters, at least on Linux. Thanks for the >suggestion about using only one coeff call. After much re-reading of >the paper, I think I might have misinterpreted the paper (doh!). The >problem boils down to solving a linear system of this form: C(z) * X(x,y) >= 0 where C(z) is the 10x10 symbolic matrix of constants and 'z' and >X(x,y) a 10x1 matrix comprised of combinations of 'x' and 'y'. This looks >like a typical nullspace problem (Ax = 0), where I have to find a >non-trivial solution. The paper says there is a non-trivial solution if >and only if det(C(z)) = 0, which I think I misinterpreted as the equation >to solve. I now believe the correct solution is to call nullspace(Cz), >then solve a polynomial equation. I've tried the nullspace function on a >mock 10x10 symbolic/numerical matrix and it returns a result almost >immediately. ----- Original Message ----- > From: Richard Fateman > > To: Nghia Ho > Cc: >Barton Willis ; "maxima at math.utexas.edu" > > Sent: Tuesday, 9 August 2011 8:41 AM > Subject: >Re: [Maxima] Help with very very slow determinant calcuation > > On >8/8/2011 7:50 AM, Nghia Ho wrote: >> My maxima script can be downloaded >here > It would be nice to put newlines in your script. > > > There >seems to be at least 39 variables, just looking at the first few lines of >> the script. > > there are many redundancies in your code. for example, >expand() could be called > once instead of 100 times. and >coeff(coeff(E,x,2),y,2)? ? is? coeff(E,x^2*y^2). > > Unless there is >something more that you know about the determinant, calculating > it > by >brute force seems unreasonable.? Can you do a 3X3 case? > >_______________________________________________ Maxima mailing list >Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From maxima at etherjones.us Tue Aug 9 21:00:54 2011 From: maxima at etherjones.us (Ether Jones) Date: Tue, 9 Aug 2011 19:00:54 -0700 (PDT) Subject: [Maxima] solve Message-ID: <1312941654.1131.YahooMailClassic@web161819.mail.bf1.yahoo.com> Why can't Maxima find an explicit solution for y? Am I missing something obvious? (%i1) kill(all)$ ????? display2d:false$ (%i2) solve(y=x+h*C*sqrt((y+x)/2),y); (%o2) [y = (h*sqrt(y+x)*C+sqrt(2)*x)/sqrt(2)] From fateman at eecs.berkeley.edu Tue Aug 9 21:17:25 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 09 Aug 2011 19:17:25 -0700 Subject: [Maxima] solve In-Reply-To: <1312941654.1131.YahooMailClassic@web161819.mail.bf1.yahoo.com> References: <1312941654.1131.YahooMailClassic@web161819.mail.bf1.yahoo.com> Message-ID: <4E41EA35.8060107@eecs.berkeley.edu> On 8/9/2011 7:00 PM, Ether Jones wrote: > Why can't Maxima find an explicit solution for y? > > Am I missing something obvious? maybe > > > (%i1) kill(all)$ > display2d:false$ > > (%i2) solve(y=x+h*C*sqrt((y+x)/2),y); > > (%o2) [y = (h*sqrt(y+x)*C+sqrt(2)*x)/sqrt(2)] > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima solve(eq, sqrt(y+x)); part(%,1); %^2; solve(%,y) check the solutions to see if they are actual solutions. Maxima's solve does not 'square both side' and 'check'. maybe it should, but solve tries to generate solutions that it knows are solutions. Checking even correct solutions is sometimes not possible, and eliminating them because simplification is not clever enough, is not a great idea.. From willisb at unk.edu Tue Aug 9 21:23:43 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 9 Aug 2011 21:23:43 -0500 Subject: [Maxima] solve In-Reply-To: <1312941654.1131.YahooMailClassic@web161819.mail.bf1.yahoo.com> References: <1312941654.1131.YahooMailClassic@web161819.mail.bf1.yahoo.com> Message-ID: No, you are not missing something obvious; a workaround: (%i12) load(to_poly_solver)$ (%i13) sol : %solve(y=x+h*C*sqrt((y+x)/2),y); (%o13) %union(%if((-%pi/2 Hi, I install the last version today (5.25.0) but it doesn't work. I check the content of the directory and saw that it seems maxima for windows is compiled with openmcl instead of GCL. Also I see than in \Maxima-5.25.0\share\maxima\5.25.0\doc\html as in \Maxima-5.24.0\share\maxima\5.24.0\doc\html there is only the file "intromax.html" Best. Laurent. From willisb at unk.edu Wed Aug 10 06:02:23 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 10 Aug 2011 06:02:23 -0500 Subject: [Maxima] solve In-Reply-To: <4E41EA35.8060107@eecs.berkeley.edu> References: <4E41EA35.8060107@eecs.berkeley.edu>, <1312941654.1131.YahooMailClassic@web161819.mail.bf1.yahoo.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- << Checking even correct solutions is sometimes not possible, The to_poly_solver tries to convert an equation into an equivalent polynomial equation along with inequalities that a solution must satisfy: example (%i3) to_poly(sqrt(x)=a,[x]); (%o3) [[%g338-a,x=%g338^2],[-%pi/2 References: <48D819B00F0A419F85DA371B933A8367@PASSERELLE> Message-ID: On Wed, Aug 10, 2011 at 11:25 AM, laurent couraud wrote: > Hi, > > I install the last version today (5.25.0) but it doesn't work. > I check the content of the directory and saw that it seems maxima for windows is compiled with > openmcl instead of GCL. I mentioned this when I announced that an installer was uploaded. ccl requires the presence of SSE2 instructions in your processor. > Also I see than in \Maxima-5.25.0\share\maxima\5.25.0\doc\html as in > \Maxima-5.24.0\share\maxima\5.24.0\doc\html there is only the file "intromax.html" The documentation in html is not included since both guis use the documentation in chm format. Andrej From cloos at jhcloos.com Wed Aug 10 12:53:24 2011 From: cloos at jhcloos.com (James Cloos) Date: Wed, 10 Aug 2011 13:53:24 -0400 Subject: [Maxima] solve In-Reply-To: (Barton Willis's message of "Tue, 9 Aug 2011 21:23:43 -0500") References: <1312941654.1131.YahooMailClassic@web161819.mail.bf1.yahoo.com> Message-ID: >>>>> "BW" == Barton Willis writes: That shows an interesting buglet. The TeX ouput for: BW> (%o15) %union([y=99/16]) is: \mathrm{\%union}\left(\left[ y=\frac{99}{16} \right] \right) whereas the TeX for: BW> (%o16) %union([y=(8*%i-61/4)/4],[y=-(8*%i+61/4)/4]) is: \left[ y=\ifracn{8\,i-\frac{61}{4}}{4} \right] \cup \left(\left[ y=-\ifracn{8\,i+\frac{61}{4}}{4} \right] \right) Note the use of \cup when %union() has two args, but of \mathrm{\%union} when it has less than two args. Perhaps %union() should simplify to nothing and %union(a) to a ? -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From rich.hennessy at verizon.net Thu Aug 11 19:21:35 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 11 Aug 2011 20:21:35 -0400 Subject: [Maxima] delint Message-ID: <20AD6499AFA4421BA6F3D87599A6395C@RichsLaptop> "I couldn't quite remember (hadn't come up in some time) and wanted to derive its meaning from an implementation." Maybe this might help. Treating diracdelta() as a limiting case of a spike distrubution: assume(b>0); [b > 0] almostdiracdelta(x):=''(pwsimp(max(0,b-b^2*abs(x)),x))$ pwlimit(pwint(x^3*almostdiracdelta(x-t),x,minf,inf),b,inf); t^3 pwint(x^3*pwdelta(x-t),x,minf,inf); t^3 almostdiracdelta(x)$ diff(%,x)$ diff_almostdiracdelta(x):=''(%)$ pwlimit(pwint(x^3*diff_almostdiracdelta(x-t),x,minf,inf),b,inf); -3*t^2 pwint(x^3*diff_pwdelta(1,x-t),x,minf,inf); -3*t^2 This doesn't work for higher order derivatives, I am not sure why. I got it to work another way but it took a long time and it was a fairly messy process. Rich From luigi_marino2 at alice.it Thu Aug 11 03:14:26 2011 From: luigi_marino2 at alice.it (Luigi Marino) Date: Thu, 11 Aug 2011 10:14:26 +0200 Subject: [Maxima] solve in Maxima Message-ID: <6643667FF21947BBA01D3EBB88407811@luigi3b0e34c8e> Maxima cannot exactly solve this polynomial with not-rational coefficients: 35x^3+(35*sqrt(3)-9)x^2-(9*sqrt(3)+2)x-2*sqrt(3) the real solutions are: -sqrt(3) , -1/7 , 2/5 the only method is: divide( 35x^3+(35*sqrt(3)-9)x^2-(9*sqrt(3)+2)x-2*sqrt(3),x-2/5) and then solve(%,x) Best regards Luigi Marino -------------- next part -------------- An HTML attachment was scrubbed... URL: From kida.fujio at jgc.co.jp Fri Aug 12 03:32:26 2011 From: kida.fujio at jgc.co.jp (kida.fujio at jgc.co.jp) Date: Fri, 12 Aug 2011 17:32:26 +0900 Subject: [Maxima] solve in Maxima In-Reply-To: <6643667FF21947BBA01D3EBB88407811@luigi3b0e34c8e> References: <6643667FF21947BBA01D3EBB88407811@luigi3b0e34c8e> Message-ID: This is the first reply email from Fujio KIDA in Japan to CAS on the attached luigi's email. I tried and could find three distinct solutions by adding "dummy variable a=1" as follows; solve([ 0=35*x^3+(35*sqrt(3)-9)*x^2-(9*sqrt(3)+2)*x-2*sqrt(3) , a=1 ],[ a,x]); As Mr luigi said, Maxima sometime does not give the answers as we hope. (I have benefited quite a lot from using Maxima, and much better than "Mathematica" for my purposes.) Also, Maxima gave three solutions in complex formula as expected for the third order polynomials. Fujio KIDA ???: luigi_marino2 at alice.it ??: maxima at math.utexas.edu ??: 2011/08/12 16:51 ??: [Maxima] solve in Maxima Maxima cannot exactly solve this polynomial with not-rational coefficients: 35x^3+(35*sqrt(3)-9)x^2-(9*sqrt(3)+2)x-2*sqrt(3) the real solutions are: -sqrt(3) , -1/7 , 2/5 the only method is: divide( 35x^3+(35*sqrt(3)-9)x^2-(9*sqrt(3)+2)x-2*sqrt(3),x-2/5) and then solve(%,x) Best regards Luigi Marino_______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima *** INTERNET E-MAIL CONFIDENTIALITY *** This message and any attachment hereto may contain information that is privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient, please notify the sender by return e-mail and destroy this message, along with any attachment. You are hereby formally advised that any unauthorized disclosure, copying or distribution of this material, or the taking of any action in relation to the contents is strictly prohibited. Thank you for your cooperation. JGC CORPORATION From bernard at marcade.biz Thu Aug 11 20:22:06 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Fri, 12 Aug 2011 02:22:06 +0100 Subject: [Maxima] Index missing in maxima info files in latest Ubuntu package. Message-ID: <1313112126.6064.13.camel@dell-laptop> Hi, I'm not sure if this is the right place to report this but here goes. The info files from the Ubuntu package maxima-doc ver: 5.25.0-1~ppa1~natty from repository LP-PPA-blahota-wxmaxima-natty are faulty. Inside emacs, clicking on "Function and Variable Index" yields the message: no such node or anchor: Function and Variable Index This suggests that either the index is not there or it is incorrectly referenced. Doing Alt+F12 within a maxima file in emacs to get help yields the same message. Incidentally, help still works correctly in wxMaxima, but I guess it uses a different system to find things. Cheers, Bernard. From macrakis at alum.mit.edu Fri Aug 12 08:46:53 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 12 Aug 2011 09:46:53 -0400 Subject: [Maxima] solve in Maxima In-Reply-To: <6643667FF21947BBA01D3EBB88407811@luigi3b0e34c8e> References: <6643667FF21947BBA01D3EBB88407811@luigi3b0e34c8e> Message-ID: Sorry that Maxima doesn't do a better job here. But... expr: 35*x^3+(35*sqrt(3)-9)*x^2-(9*sqrt(3)+2)*x-2*sqrt(3)$ (Note the use of "*" for multiplication) solve(expr,x) returns three very messy solutions. Though these are correct, they are very difficult to simplify to anything more usable. On the other hand, gfactor(expr) returns (x+sqrt(3))*(5*x-2)*(7*x+1) which solve, of course, easily solves: [x = -1/7,x = 2/5,x = -sqrt(3)] Presumably solve should be using gfactor rather than (real) factor. -s On Thu, Aug 11, 2011 at 04:14, Luigi Marino wrote: > ** > Maxima cannot exactly solve this polynomial > with not-rational coefficients: > > the real solutions are: > -sqrt(3) , -1/7 , 2/5 > the only method is: > divide( > 35x^3+(35*sqrt(3)-9)x^2-(9*sqrt(3)+2)x-2*sqrt(3),x-2/5) > and then > solve(%,x) > Best regards > 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 willisb at unk.edu Fri Aug 12 09:40:19 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 12 Aug 2011 09:40:19 -0500 Subject: [Maxima] solve in Maxima In-Reply-To: References: <6643667FF21947BBA01D3EBB88407811@luigi3b0e34c8e> Message-ID: maxima-bounces at math.utexas.edu wrote on 08/12/2011 08:46:53 AM: > solve(expr,x) returns three very messy solutions. Though these are > correct, they are very difficult to simplify to anything more usable. Alternatively, setting algebraic to true allows solve to automatically give greatly simplified solutions: (%i1) solve(35*x^3+(35*sqrt(3)-9)*x^2-(9*sqrt(3)+2)*x-2*sqrt(3)), algebraic : true; (%o1) [x=-sqrt(3),x=2/5,x=-1/7] The user option 'algebraic' is obscure. How would a new user discover it? What would happen if 'algebraic' defaulted to true? --Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksasd873 at gmail.com Fri Aug 12 05:13:46 2011 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Fri, 12 Aug 2011 13:13:46 +0300 Subject: [Maxima] solve in Maxima Message-ID: ------------------------------ This is the first reply email from Fujio KIDA in Japan to CAS on the attached luigi's email. I tried and could find three distinct solutions by adding "dummy variable a=1" as follows; solve([ 0=35*x^3+(35*sqrt(3)-9)*x^2-(9*sqrt(3)+2)*x-2*sqrt(3) , a=1 ],[ a,x]); As Mr luigi said, Maxima sometime does not give the answers as we hope. (I have benefited quite a lot from using Maxima, and much better than "Mathematica" for my purposes.) Also, Maxima gave three solutions in complex formula as expected for the third order polynomials. Fujio KIDA ???: luigi_marino2 at alice.it ??: maxima at math.utexas.edu ??: 2011/08/12 16:51 ??: [Maxima] solve in Maxima Maxima cannot exactly solve this polynomial with not-rational coefficients: 35x^3+(35*sqrt(3)-9)x^2-(9*sqrt(3)+2)x-2*sqrt(3) the real solutions are: -sqrt(3) , -1/7 , 2/5 the only method is: divide( 35x^3+(35*sqrt(3)-9)x^2-(9*sqrt(3)+2)x-2*sqrt(3),x-2/5) and then solve(%,x) Best regards Luigi Marino_______________________________________________ *********************************************************************** (%i1) eq:35*x^3+(35*sqrt(3)-9)*x^2-(9*sqrt(3)+2)*x-2*sqrt(3)=0$ (%i2) factor(eq,a^2-3); (%o2) (x+sqrt(3))*(5*x-2)*(7*x+1)=0 or (%i3) gfactor(eq); (%o3) (x+sqrt(3))*(5*x-2)*(7*x+1)=0 (%i4) solve(%); (%o4) [x=-1/7,x=2/5,x=-sqrt(3)] (%i5) build_info()$ Maxima version: 5.25.0 Maxima build date: 12:0 8/2/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 l_butler at users.sourceforge.net Fri Aug 12 13:36:59 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Fri, 12 Aug 2011 18:36:59 +0000 Subject: [Maxima] Index missing in maxima info files in latest Ubuntu package. In-Reply-To: <1313112126.6064.13.camel@dell-laptop> (message from Bernard Hurley on Fri, 12 Aug 2011 02:22:06 +0100) Message-ID: <1qpaabetr1w.fsf@iceland.freeshell.org> Bernard Hurley writes: > Hi, > > I'm not sure if this is the right place to report this but here goes. > The info files from the Ubuntu package maxima-doc ver: > 5.25.0-1~ppa1~natty from repository LP-PPA-blahota-wxmaxima-natty are > faulty. Inside emacs, clicking on "Function and Variable Index" yields > the message: > > no such node or anchor: Function and Variable Index > > This suggests that either the index is not there or it is incorrectly > referenced. Doing Alt+F12 within a maxima file in emacs to get help > yields the same message. You will need to contact the packager, Ishtvan Blahota, about this matter. He builds the package and maintains it. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From ferriste at gmail.com Sat Aug 13 02:44:19 2011 From: ferriste at gmail.com (Stefano Ferri) Date: Sat, 13 Aug 2011 09:44:19 +0200 Subject: [Maxima] Cannot run Windows version of Maxima without sse2 instructions Message-ID: Recently on this mailing list there was a post about the impossibility to run the Windows version of Maxima with a processor that has not the support for sse2 instructions. There was also a more detalied discussion between developers some months ago about this. Well, I just encountered this problem with my home pc (it is quite old, but not so much, it is 5 years old), wich is sempron and windows-based, and Maxima doesn't work for this problem. Maxima.bat complains about the lack of sse2 instructions. Quite frankly, I thik this is unacceptable. There are really a lot of users that will be excluded from using the latest version of Maxima for this requirements. Even though ccl can be better for some reasons, this is, I think, a problem to think about. Of course, I can use Maxima on my notebook or use an earlier version, but why? Pretty all kinds of softwares can be run on old pcs, and above all free software care about this, I think that the exclusion of pcs (and users) without sse2 instructions is a too high price to pay for a better lisp. I don't want to seem unkind, but please think about this... I don't see a valid reason for the use of ccl, if it has such a limitation. Stefano -------------- next part -------------- An HTML attachment was scrubbed... URL: From volkervannek at googlemail.com Sat Aug 13 06:41:53 2011 From: volkervannek at googlemail.com (Volker van Nek) Date: Sat, 13 Aug 2011 13:41:53 +0200 Subject: [Maxima] Index missing in maxima info files in latest Ubuntu package. In-Reply-To: <1313112126.6064.13.camel@dell-laptop> References: <1313112126.6064.13.camel@dell-laptop> Message-ID: Hi Bernard, please type in sudo cp /usr/share/doc/maxima-doc/info/maxima-index.lisp /usr/share/info/ and let me know if this solves the problem. Volker van Nek 2011/8/12 Bernard Hurley > Hi, > > I'm not sure if this is the right place to report this but here goes. > The info files from the Ubuntu package maxima-doc ver: > 5.25.0-1~ppa1~natty from repository LP-PPA-blahota-wxmaxima-natty are > faulty. Inside emacs, clicking on "Function and Variable Index" yields > the message: > > no such node or anchor: Function and Variable Index > > This suggests that either the index is not there or it is incorrectly > referenced. Doing Alt+F12 within a maxima file in emacs to get help > yields the same message. > > Incidentally, help still works correctly in wxMaxima, but I guess it > uses a different system to find things. > > Cheers, > > Bernard. > _______________________________________________ > 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 bernard at marcade.biz Sat Aug 13 08:32:40 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 13 Aug 2011 14:32:40 +0100 Subject: [Maxima] Index missing in maxima info files in latest Ubuntu package. In-Reply-To: References: <1313112126.6064.13.camel@dell-laptop> Message-ID: <1313242360.5336.4.camel@dell-laptop> On Sat, 2011-08-13 at 13:41 +0200, Volker van Nek wrote: > Hi Bernard, > > please type in > > sudo cp /usr/share/doc/maxima-doc/info/maxima-index.lisp > /usr/share/info/ > > and let me know if this solves the problem. Than you for the suggestion. However /usr/share/info/maxima-index.lisp is already a symbolic link to /usr/share/doc/maxima-doc/info/maxima-index.lisp so there wouldn't be much point in doing that. Cheers, Bernard From bernard at marcade.biz Sat Aug 13 09:10:53 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 13 Aug 2011 15:10:53 +0100 Subject: [Maxima] What is _not_ killed by kill(all)? Message-ID: <1313244653.5336.22.camel@dell-laptop> Hi, I was under the impression that kill(all) cleaned all user-created definitions out of the global environment. However it seems that it doesn't. I am developing a package (called tdot) and I have some code (what it does precisely isn't relevant to my point) in a wxMaxima cell which starts: kill(all)$ load("tdot.mac")$ gcoords(x,y,q)$ ......etc The first time I run the cell it fails; however if I run it a second time it works perfectly. It also works perfectly if I repeat these first three lines at the top of the cell. This suggests that kill(all) doesn't kill everything. If anyone has any suggestions at this stage about what might be happening I would be grateful, if not I will try to isolate a minimal example of this phenomenon as it looks like it might be some sort of bug. Thanks, Bernard. From l_butler at users.sourceforge.net Sat Aug 13 09:31:00 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Sat, 13 Aug 2011 14:31:00 +0000 Subject: [Maxima] Index missing in maxima info files in latest Ubuntu package. In-Reply-To: <1313242360.5336.4.camel@dell-laptop> (message from Bernard Hurley on Sat, 13 Aug 2011 14:32:40 +0100) Message-ID: <1qpzkjds7rv.fsf@iceland.freeshell.org> Bernard, could you post the output of ls -l /usr/share/info/max*info* please? -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From willisb at unk.edu Sat Aug 13 09:39:56 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 13 Aug 2011 09:39:56 -0500 Subject: [Maxima] git pull + src/sharefiles.mk In-Reply-To: <1qpzkjds7rv.fsf@iceland.freeshell.org> References: <1qpzkjds7rv.fsf@iceland.freeshell.org> Message-ID: The files src/share-subdirs.lisp and src/sharefiles.mk are both automatically generated (by configure), but doing a pull, git complains about these files: Updating 0c6001a..c8d7c31 Aborting error: Your local changes to the following files would be overwritten by merge: src/share-subdirs.lisp src/sharefiles.mk Please, commit your changes or stash them before you can merge. Maybe I need to read about git stash? --Barton From bernard at marcade.biz Sat Aug 13 09:49:00 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 13 Aug 2011 15:49:00 +0100 Subject: [Maxima] Index missing in maxima info files in latest Ubuntu package. In-Reply-To: <1qpzkjds7rv.fsf@iceland.freeshell.org> References: <1qpzkjds7rv.fsf@iceland.freeshell.org> Message-ID: <1313246940.5336.24.camel@dell-laptop> On Sat, 2011-08-13 at 14:31 +0000, Leo Butler wrote: > Bernard, could you post the output of > > ls -l /usr/share/info/max*info* > > please? ~$ ls -l /usr/share/info/max*info* -rw-r--r-- 1 root root 13K 2011-04-11 21:34 /usr/share/info/maxima.info -rw-r--r-- 1 root root 964K 2011-04-11 21:34 /usr/share/info/maxima.info-1 -rw-r--r-- 1 root root 233K 2011-08-09 21:57 /usr/share/info/maxima.info-1.gz -rw-r--r-- 1 root root 960K 2011-04-11 21:34 /usr/share/info/maxima.info-2 -rw-r--r-- 1 root root 210K 2011-08-09 21:57 /usr/share/info/maxima.info-2.gz -rw-r--r-- 1 root root 434K 2011-04-11 21:34 /usr/share/info/maxima.info-3 -rw-r--r-- 1 root root 61K 2011-08-09 21:57 /usr/share/info/maxima.info-3.gz -rw-r--r-- 1 root root 12K 2011-08-09 21:57 /usr/share/info/maxima.info.gz From bernard at marcade.biz Sat Aug 13 09:59:00 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 13 Aug 2011 15:59:00 +0100 Subject: [Maxima] Is the keyword "block" redundant? Message-ID: <1313247540.5336.28.camel@dell-laptop> Hi, Is there any difference in functionality between: (... some code... ) and: block (... some code... ) ? Thanks, Bernard. From l_butler at users.sourceforge.net Sat Aug 13 10:21:43 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Sat, 13 Aug 2011 15:21:43 +0000 Subject: [Maxima] git pull + src/sharefiles.mk In-Reply-To: (message from Barton Willis on Sat, 13 Aug 2011 09:39:56 -0500) Message-ID: <1qpwrehs5fc.fsf@iceland.freeshell.org> Barton Willis writes: > The files src/share-subdirs.lisp and src/sharefiles.mk are both automatically > generated (by configure), but doing a pull, git complains about these files: > > Updating 0c6001a..c8d7c31 > Aborting > error: Your local changes to the following files would be overwritten by merge: > src/share-subdirs.lisp > src/sharefiles.mk > Please, commit your changes or stash them before you can merge. Barton, I don't think that you want to stash these changes. I generally use magit in emacs as a git front-end, and what I do is kill these changes. The corresponding git command is git --no-pager checkout -- where is the list of files to be reverted. Btw, it is probably best to do git pull --rebase rather than a simple git pull. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From l_butler at users.sourceforge.net Sat Aug 13 10:40:58 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Sat, 13 Aug 2011 15:40:58 +0000 Subject: [Maxima] Index missing in maxima info files in latest Ubuntu package. In-Reply-To: <1313246940.5336.24.camel@dell-laptop> (message from Bernard Hurley on Sat, 13 Aug 2011 15:49:00 +0100) Message-ID: <1qpty9ls4j9.fsf@iceland.freeshell.org> Bernard Hurley writes: > On Sat, 2011-08-13 at 14:31 +0000, Leo Butler wrote: >> Bernard, could you post the output of >> >> ls -l /usr/share/info/max*info* >> >> please? > > ~$ ls -l /usr/share/info/max*info* > -rw-r--r-- 1 root root 13K 2011-04-11 21:34 /usr/share/info/maxima.info > -rw-r--r-- 1 root root 964K 2011-04-11 21:34 /usr/share/info/maxima.info-1 > -rw-r--r-- 1 root root 233K 2011-08-09 21:57 /usr/share/info/maxima.info-1.gz > -rw-r--r-- 1 root root 960K 2011-04-11 21:34 /usr/share/info/maxima.info-2 > -rw-r--r-- 1 root root 210K 2011-08-09 21:57 /usr/share/info/maxima.info-2.gz > -rw-r--r-- 1 root root 434K 2011-04-11 21:34 /usr/share/info/maxima.info-3 > -rw-r--r-- 1 root root 61K 2011-08-09 21:57 /usr/share/info/maxima.info-3.gz > -rw-r--r-- 1 root root 12K 2011-08-09 21:57 /usr/share/info/maxima.info.gz What happens if you move those older, non-gzipped info files somewhere that emacs won't find them? -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From willisb at unk.edu Sat Aug 13 10:51:53 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 13 Aug 2011 10:51:53 -0500 Subject: [Maxima] git pull + src/sharefiles.mk In-Reply-To: <1qpwrehs5fc.fsf@iceland.freeshell.org> References: <1qpwrehs5fc.fsf@iceland.freeshell.org> Message-ID: -----Leo Butler wrote: ----- > The corresponding git command is git --no-pager checkout -- where is the list >of files to be reverted. Leo, Thanks, that worked. But just now the weather turned nice, so I'm going to goof off outside for the rest of Saturday :) --Barton From macrakis at alum.mit.edu Sat Aug 13 10:56:53 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 13 Aug 2011 11:56:53 -0400 Subject: [Maxima] Is the keyword "block" redundant? In-Reply-To: <1313247540.5336.28.camel@dell-laptop> References: <1313247540.5336.28.camel@dell-laptop> Message-ID: There are several differences. The most important is that block allows you to define local variables: block( [ var1, var2, ...], ...) block also supports 'return' and tags/go (though goto's are of course not usually used in modern coding styles) block([i:1], l, i: i+1, if i<3 then go(l),i) => 3 block( return(5), 1) => 5 I believe this is all clearly documented in ? block -s On Sat, Aug 13, 2011 at 10:59, Bernard Hurley wrote: > Hi, > > Is there any difference in functionality between: > > (... some code... ) > > and: > > block (... some code... ) > > ? > > Thanks, > > Bernard. > _______________________________________________ > 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 bernard at marcade.biz Sat Aug 13 11:04:53 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 13 Aug 2011 17:04:53 +0100 Subject: [Maxima] Is the keyword "block" redundant? In-Reply-To: <1313247540.5336.28.camel@dell-laptop> References: <1313247540.5336.28.camel@dell-laptop> Message-ID: <1313251493.5336.30.camel@dell-laptop> Sorry, silly question: I just realised you can't have local variables unless you use "block". On Sat, 2011-08-13 at 15:59 +0100, Bernard Hurley wrote: > Hi, > > Is there any difference in functionality between: > > (... some code... ) > > and: > > block (... some code... ) > > ? > > Thanks, > > Bernard. > _______________________________________________ From bernard at marcade.biz Sat Aug 13 11:31:33 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 13 Aug 2011 17:31:33 +0100 Subject: [Maxima] Index missing in maxima info files in latest Ubuntu package. In-Reply-To: <1qpty9ls4j9.fsf@iceland.freeshell.org> References: <1qpty9ls4j9.fsf@iceland.freeshell.org> Message-ID: <1313253093.5336.42.camel@dell-laptop> On Sat, 2011-08-13 at 15:40 +0000, Leo Butler wrote: > What happens if you move those older, non-gzipped info files somewhere > that emacs won't find them? > Now it works - thanks! The strange thing is that I can't remember uncompressing those files and I can't think why I would have wanted to (none of the other info files in the directory are uncompressed!) Emacs gives a message that it is uncompressing whichever info file it is using but it doesn't do it to that directory even if you run it as root (which I wouldn't normally do anyway.) So I have no idea how they got there! The only things I can think of are that an older version of the package had copies of the files uncompressed or that Sage put them there - I can't test for this without re-installing Sage, which I don't particularly want to do at present. Thanks for your help! Bernard. From robert.dodier at gmail.com Sat Aug 13 13:50:19 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 13 Aug 2011 12:50:19 -0600 Subject: [Maxima] What is _not_ killed by kill(all)? In-Reply-To: <1313244653.5336.22.camel@dell-laptop> References: <1313244653.5336.22.camel@dell-laptop> Message-ID: Sounds like a bug in kill(all). What is the error message? If you post tdot.mac I will give it a try. best Robert Dodier On 8/13/11, Bernard Hurley wrote: > Hi, > > I was under the impression that kill(all) cleaned all user-created > definitions out of the global environment. However it seems that it > doesn't. I am developing a package (called tdot) and I have some code > (what it does precisely isn't relevant to my point) in a wxMaxima cell > which starts: > > kill(all)$ > load("tdot.mac")$ > gcoords(x,y,q)$ > ......etc > > The first time I run the cell it fails; however if I run it a second > time it works perfectly. It also works perfectly if I repeat these first > three lines at the top of the cell. This suggests that kill(all) doesn't > kill everything. If anyone has any suggestions at this stage about what > might be happening I would be grateful, if not I will try to isolate a > minimal example of this phenomenon as it looks like it might be some > sort of bug. > > Thanks, > > Bernard. > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From bernard at marcade.biz Sat Aug 13 15:53:11 2011 From: bernard at marcade.biz (Bernard Hurley) Date: Sat, 13 Aug 2011 21:53:11 +0100 Subject: [Maxima] What is _not_ killed by kill(all)? In-Reply-To: References: <1313244653.5336.22.camel@dell-laptop> Message-ID: <1313268791.5608.1.camel@dell-laptop> On Sat, 2011-08-13 at 12:50 -0600, Robert Dodier wrote: > Sounds like a bug in kill(all). > What is the error message? > If you post tdot.mac I will give it a try. > At present the code that exhibits this behaviour is quite long and complicated. I will try to cut it down to a minimal example before posting anything as otherwise you are likely to waste a lot of time with irrelevancies. Bernard. From volkervannek at googlemail.com Sat Aug 13 18:59:11 2011 From: volkervannek at googlemail.com (Volker van Nek) Date: Sun, 14 Aug 2011 01:59:11 +0200 Subject: [Maxima] Index missing in maxima info files in latest Ubuntu package. In-Reply-To: <1313242360.5336.4.camel@dell-laptop> References: <1313112126.6064.13.camel@dell-laptop> <1313242360.5336.4.camel@dell-laptop> Message-ID: I am surprised. maxima-doc_5.25.0-1~ppa1~natty_all.deb from Istvan Blahota does not contain /usr/share/info/maxima-index.lisp. FWIW Volker van Nek 2011/8/13 Bernard Hurley > On Sat, 2011-08-13 at 13:41 +0200, Volker van Nek wrote: > > Hi Bernard, > > > > please type in > > > > sudo cp /usr/share/doc/maxima-doc/info/maxima-index.lisp > > /usr/share/info/ > > > > and let me know if this solves the problem. > > Than you for the suggestion. However /usr/share/info/maxima-index.lisp > is already a symbolic link to > /usr/share/doc/maxima-doc/info/maxima-index.lisp so there wouldn't be > much point in doing that. > > Cheers, > > Bernard > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Aug 13 19:10:16 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 13 Aug 2011 18:10:16 -0600 Subject: [Maxima] What is _not_ killed by kill(all)? In-Reply-To: <1313268791.5608.1.camel@dell-laptop> References: <1313244653.5336.22.camel@dell-laptop> <1313268791.5608.1.camel@dell-laptop> Message-ID: On 8/13/11, Bernard Hurley wrote: > At present the code that exhibits this behaviour is quite long and > complicated. I will try to cut it down to a minimal example before > posting anything as otherwise you are likely to waste a lot of time with > irrelevancies. I dunno -- I'm not going to debug your code, but only look at the behavior of kill. It's up to you, but I think you might as well post the code as it stands. best Robert Dodier From wilfried.kral at gmx.net Sun Aug 14 08:25:59 2011 From: wilfried.kral at gmx.net (Wilfried Kral) Date: Sun, 14 Aug 2011 15:25:59 +0200 Subject: [Maxima] Question regarding detecting roots of polynom Message-ID: <4E47CCE7.5030302@gmx.net> Hi, I am using Maxima 5.20.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (a.k.a. GCL) on Ubuntu 10.04 LTS I was building an 18 degree polynom like x^18-36*%i*x^17+83*x^17-2818*%i*x^16+2591*x^16-95676*%i*x^15+31291*x^15 -1829926*%i*x^14-222415*x^14-21043560*%i*x^13-13429735*x^13 -134373950*%i*x^12-221505091*x^12-162118764*%i*x^11-2100454047*x^11 +5328348982*%i*x^10-12519554958*x^10+54789418068*%i*x^9-44078314424*x^9 +287090759824*%i*x^8-50671326176*x^8+912058259616*%i*x^7+322740608816*x^7 +1651930704544*%i*x^6+1945453962592*x^6+873591016128*%i*x^5 +5209884712576*x^5-3122885337856*%i*x^4+7794942136576*x^4 -7959302616576*%i*x^3+5886979568640*x^3-8129574092800*%i*x^2 +690482554880*x^2-3774525235200*%i*x-1846961971200*x-585326592000*%i -841015296000$ with roots that have always integers for real an imaginary part If I am using solve(polynom,x) I always end up in: [x = - 3, x = - 1, x = - 4, x = - 8, x = - 6, 13 12 11 10 0 = x + (61 - 36 %i) x + (1070 - 2026 %i) x + (- 44660 %i - 3830) x 9 8 + (- 460920 %i - 371147) x + (- 1529088 %i - 5353727) x 7 6 + (13544402 %i - 35943060) x + (168139960 %i - 102170200) x 5 4 + (740595920 %i + 109209296) x + (1349765824 %i + 1597658416) x 3 2 + (4170648640 - 226610976 %i) x + (3755946880 - 4231612800 %i) x + (- 4647635200 %i - 468851200) x - 1016192000 %i - 1460096000] so Maxima seems to get the pure real values and then stops. If a freind uses Matlab or in Online Mathematica I get the exact solutions. Is the implementation of Berlekamp/Kronecker etc. in Maxima not so good or I am using wrong settings? Solutions can be guessed with algsys, but that is of course not so nice. Thx and Best regards, Wilfried From andre.maute at gmx.de Sun Aug 14 09:39:21 2011 From: andre.maute at gmx.de (andre maute) Date: Sun, 14 Aug 2011 16:39:21 +0200 Subject: [Maxima] parGosper from zeilberger package doesn't work as expected Message-ID: <4E47DE19.1030900@gmx.de> Hi, I have the following test for parGosper,which seems not to work. I think i have interpreted the documentation correctly. res below should vanish identically. I have attached my maxima file and an output file. Andre ---- testparGosper.max ---- display2d : false; load(zeilberger); F(d,a1,k1,a2,k2,b2,l2) := 1/(a1-k1)!/k1!*(-1)^k1 /(a2-k2)!/k2!*(-1)^k2 /(b2-l2)!/l2!*(-1)^l2 *(a1+2*a2+k1+d-1)! /(a1+2*a2+k1+d)! *(a1+a2+k1+k2+d-1)! /(k2+d-2)! *(b2+l2+d-2)!/(l2+d-2)! *(k2+l2+d-2)!/(k2+l2+d-1+k1)!; h : parGosper(F(d,a1,k1,a2,k2,b2,l2),b2,l2,0); R(d,a1,k1,a2,k2,b2,l2) := h[1][1]; A0(d,a1,k1,a2,k2,b2,l2) := h[1][2][1]; res : A0(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2) - (R(d,a1,k1,a2,k2,b2,l2+1)*F(d,a1,k1,a2,k2,b2,l2+1) - R(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2)); res : factor(minfactorial(res)); --------------------------- -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: testparGosper.max URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: testparGosper.txt URL: From macrakis at alum.mit.edu Sun Aug 14 12:49:26 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 14 Aug 2011 13:49:26 -0400 Subject: [Maxima] Question regarding detecting roots of polynom In-Reply-To: <4E47CCE7.5030302@gmx.net> References: <4E47CCE7.5030302@gmx.net> Message-ID: This appears to be a bug in solve. As a workaround, first factor the polynomial with gfactor, e.g. solve(gfactor( p ), x). This will get you all the gaussian integer roots. -s PS Unlike a previous similar problem, solve(),algebraic:true does not help here. On Sun, Aug 14, 2011 at 09:25, Wilfried Kral wrote: > Hi, > I am using Maxima 5.20.1 http://maxima.sourceforge.net using Lisp GNU > Common Lisp (GCL) GCL 2.6.7 (a.k.a. GCL) on Ubuntu 10.04 LTS > I was building an 18 degree polynom like > > x^18-36*%i*x^17+83*x^17-2818*%**i*x^16+2591*x^16-95676*%i*x^** > 15+31291*x^15 > -1829926*%i*x^14-222415*x^14-**21043560*%i*x^13-13429735*x^13 > -134373950*%i*x^12-221505091***x^12-162118764*%i*x^11-2100454047*x^11 > +5328348982*%i*x^10-**12519554958*x^10+54789418068*%** > i*x^9-44078314424*x^9 > +287090759824*%i*x^8-**50671326176*x^8+912058259616*%i*x^7+** > 322740608816*x^7 > +1651930704544*%i*x^6+**1945453962592*x^6+**873591016128*%i*x^5 > +5209884712576*x^5-**3122885337856*%i*x^4+**7794942136576*x^4 > -7959302616576*%i*x^3+**5886979568640*x^3-**8129574092800*%i*x^2 > +690482554880*x^2-**3774525235200*%i*x-**1846961971200*x-585326592000*% > **i > -841015296000$ > > with roots that have always integers for real an imaginary part > If I am using solve(polynom,x) I always end up in: > [x = - 3, x = - 1, x = - 4, x = - 8, x = - 6, > 13 12 11 10 > 0 = x + (61 - 36 %i) x + (1070 - 2026 %i) x + (- 44660 %i - 3830) x > 9 8 > + (- 460920 %i - 371147) x + (- 1529088 %i - 5353727) x > 7 6 > + (13544402 %i - 35943060) x + (168139960 %i - 102170200) x > 5 4 > + (740595920 %i + 109209296) x + (1349765824 %i + 1597658416) x > 3 2 > + (4170648640 - 226610976 %i) x + (3755946880 - 4231612800 %i) x > + (- 4647635200 %i - 468851200) x - 1016192000 %i - 1460096000] > > so Maxima seems to get the pure real values and then stops. > If a freind uses Matlab or in Online Mathematica I get the exact solutions. > > Is the implementation of Berlekamp/Kronecker etc. in Maxima not so good or > I am using wrong settings? > Solutions can be guessed with algsys, but that is of course not so nice. > > Thx and Best regards, > Wilfried > > > > > > > > ______________________________**_________________ > 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 cloos at jhcloos.com Sun Aug 14 13:01:20 2011 From: cloos at jhcloos.com (James Cloos) Date: Sun, 14 Aug 2011 14:01:20 -0400 Subject: [Maxima] Question regarding detecting roots of polynom In-Reply-To: <4E47CCE7.5030302@gmx.net> (Wilfried Kral's message of "Sun, 14 Aug 2011 15:25:59 +0200") References: <4E47CCE7.5030302@gmx.net> Message-ID: >>>>> "WK" == Wilfried Kral writes: WK> I was building an 18 degree polynom like ... WK> with roots that have always integers for real an imaginary part WK> so Maxima seems to get the pure real values and then stops. WK> If a freind uses Matlab or in Online Mathematica I get the exact solutions. As recently suggested on anther thread, solve(gfactor(poly),var); works better. Using your poly: (%i1) display2d:false; (%o1) false x^18-36*%i*x^17+83*x^17-2818*%i*x^16+2591*x^16-95676*%i*x^15+31291*x^15 -1829926*%i*x^14-222415*x^14-21043560*%i*x^13-13429735*x^13 -134373950*%i*x^12-221505091*x^12-162118764*%i*x^11-2100454047*x^11 +5328348982*%i*x^10-12519554958*x^10+54789418068*%i*x^9-44078314424*x^9 +287090759824*%i*x^8-50671326176*x^8+912058259616*%i*x^7+322740608816*x^7 +1651930704544*%i*x^6+1945453962592*x^6+873591016128*%i*x^5 +5209884712576*x^5-3122885337856*%i*x^4+7794942136576*x^4 -7959302616576*%i*x^3+5886979568640*x^3-8129574092800*%i*x^2 +690482554880*x^2-3774525235200*%i*x-1846961971200*x-585326592000*%i -841015296000; (%o2) x^18-36*%i*x^17+83*x^17-2818*%i*x^16+2591*x^16-95676*%i*x^15+31291*x^15 -1829926*%i*x^14-222415*x^14-21043560*%i*x^13-13429735*x^13 -134373950*%i*x^12-221505091*x^12-162118764*%i*x^11-2100454047*x^11 +5328348982*%i*x^10-12519554958*x^10+54789418068*%i*x^9 -44078314424*x^9+287090759824*%i*x^8-50671326176*x^8 +912058259616*%i*x^7+322740608816*x^7+1651930704544*%i*x^6 +1945453962592*x^6+873591016128*%i*x^5+5209884712576*x^5 -3122885337856*%i*x^4+7794942136576*x^4-7959302616576*%i*x^3 +5886979568640*x^3-8129574092800*%i*x^2+690482554880*x^2 -3774525235200*%i*x-1846961971200*x-585326592000*%i-841015296000 (%i3) gfactor(%o2); (%o3) (x+1)*(x+3)*(x+4)*(x+6)*(x+8)*(x-4*%i+2)*(x-4*%i+3)*(x-4*%i+4) *(x-4*%i+6)*(x-4*%i+9)*(x-2*%i)*(x-2*%i+1)*(x-2*%i+2)*(x-2*%i+4) *(x-2*%i+6)*(x-2*%i+7)*(x-2*%i+8)*(x-2*%i+9) (%i4) solve(%o3,x); (%o4) [x = 2*%i-9,x = 2*%i-8,x = 2*%i-7,x = 2*%i-6,x = 2*%i-4,x = 2*%i-2, x = 2*%i-1,x = 2*%i,x = 4*%i-9,x = 4*%i-6,x = 4*%i-4,x = 4*%i-3, x = 4*%i-2,x = -8,x = -6,x = -4,x = -3,x = -1] Another suggesting in that thread is to set algebraic:true, but that doesn't work as well here: (%i5) solve(%o2,x),algebraic:true; (%o5) [x = -3,x = -1,x = -4,x = -8,x = -6, 0 = x^13+(61-36*%i)*x^12+(1070-2026*%i)*x^11+(-44660*%i-3830)*x^10 +(-460920*%i-371147)*x^9+(-1529088*%i-5353727)*x^8 +(13544402*%i-35943060)*x^7+(168139960*%i-102170200)*x^6 +(740595920*%i+109209296)*x^5+(1349765824*%i+1597658416)*x^4 +(4170648640-226610976*%i)*x^3+(3755946880-4231612800*%i)*x^2 +(-4647635200*%i-468851200)*x-1016192000*%i-1460096000] It looks like using gfactor() when solving any poly with gaussian integer coefficients (or "gaussian rational" coefficients) is a good idea when trying to solve() them. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From robert.dodier at gmail.com Sun Aug 14 22:11:21 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 14 Aug 2011 21:11:21 -0600 Subject: [Maxima] Cannot run Windows version of Maxima without sse2 instructions In-Reply-To: References: Message-ID: Yeah, agreed. CCL can't be the default option if it doesn't work on cpu's which lack sse2. Maybe in a few years computers which lack sse2 will be very rare, then it won't be an issue. But for the moment, I think it's a problem we have to consider. Is there by chance an sse2-free version of CCL? Or maybe we just have to use another Lisp? best Robert Dodier From robert.dodier at gmail.com Mon Aug 15 10:33:15 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 15 Aug 2011 09:33:15 -0600 Subject: [Maxima] git pull + src/sharefiles.mk In-Reply-To: <1qpwrehs5fc.fsf@iceland.freeshell.org> References: <1qpwrehs5fc.fsf@iceland.freeshell.org> Message-ID: On 8/13/11, Leo Butler wrote: > Barton Willis writes: > >> The files src/share-subdirs.lisp and src/sharefiles.mk are both >> automatically >> generated (by configure), but doing a pull, git complains about these >> files: >> >> Updating 0c6001a..c8d7c31 >> Aborting >> error: Your local changes to the following files would be overwritten by >> merge: >> src/share-subdirs.lisp >> src/sharefiles.mk >> Please, commit your changes or stash them before you can merge. > > Barton, > I don't think that you want to stash these changes. > > I generally use magit in emacs as a git front-end, and > what I do is kill these changes. The corresponding > git command is > > git --no-pager checkout -- > > where is the list of files to be reverted. > > Btw, it is probably best to do > > git pull --rebase > > rather than a simple git pull. I dunno. How are casual users of Git (I believe this includes most of the Maxima developers) supposed to know minutiae like that? Rebase in particular is significantly different from a simple pull; how shall we choose which one? Git itself suggests stash, how do we know not to follow the recommendation? best, Robert Dodier From robert.dodier at gmail.com Mon Aug 15 10:36:41 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 15 Aug 2011 09:36:41 -0600 Subject: [Maxima] git pull + src/sharefiles.mk In-Reply-To: References: <1qpzkjds7rv.fsf@iceland.freeshell.org> Message-ID: On 8/13/11, Barton Willis wrote: > The files src/share-subdirs.lisp and src/sharefiles.mk are both > automatically > generated (by configure), but doing a pull, git complains about these files: > > Updating 0c6001a..c8d7c31 > Aborting > error: Your local changes to the following files would be overwritten by > merge: > src/share-subdirs.lisp > src/sharefiles.mk > Please, commit your changes or stash them before you can merge. I think it would be a big help to change the manner in which the share lists are generated; I find the noise from Git distracting. Can we have sharefiles.mk.in or something like that from which an unversioned file sharefiles.mk is generated? Likewise for share-subdirs.lisp. best Robert Dodier From gabriele_belperio at yahoo.it Mon Aug 15 09:08:13 2011 From: gabriele_belperio at yahoo.it (Gabriele Belperio) Date: Mon, 15 Aug 2011 16:08:13 +0200 Subject: [Maxima] unable to find cholesky factorization Message-ID: <4E49284D.1030401@yahoo.it> with wxmaxima 0.7.1 ubuntu hardy D:matrix([a,b],[b,c]); cholesky(D); Unable to find the Cholesky factorization -- an error. To debug this try debugmode(true); even with assume(determinant(D)>0); cholesky(D); Unable to find Cholesky etc... but cholesky(transpose(D).D); Is b^2+a^2 positive or zero?positive; result... which means cholesky symbolic works.. From dante_monti2 at yahoo.it Mon Aug 15 09:18:45 2011 From: dante_monti2 at yahoo.it (gabriele) Date: Mon, 15 Aug 2011 16:18:45 +0200 Subject: [Maxima] unable to find cholesky factorization Message-ID: <4E492AC5.6090505@yahoo.it> ith wxmaxima 0.7.1 ubuntu hardy D:matrix([a,b],[b,c]); cholesky(D); Unable to find the Cholesky factorization -- an error. To debug this try debugmode(true); even with assume(determinant(D)>0); cholesky(D); Unable to find Cholesky etc... but cholesky(transpose(D).D); Is b2+a2 positive or zero?positive; result... which means cholesky symbolic works.. From macrakis at alum.mit.edu Mon Aug 15 12:47:40 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 15 Aug 2011 13:47:40 -0400 Subject: [Maxima] unable to find cholesky factorization In-Reply-To: <4E492AC5.6090505@yahoo.it> References: <4E492AC5.6090505@yahoo.it> Message-ID: If I'm not mistaken, the Cholesky decomposition only exists if the matrix is both Hermitian and positive definite. To guarantee that, you need to assume both determinant(D)>0 *and also* a>0. Then Maxima finds the decomposition: (%i2) D:matrix([a,b],[b,c])$ (%i3) cholesky(D); Unable to find the Cholesky factorization -- an error. To debug this try: debugmode(true); (%i4) assume(determinant(D)>0)$ (%i5) cholesky(D); Unable to find the Cholesky factorization -- an error. To debug this try: debugmode(true); (%i6) assume(a>0)$ (%i7) cholesky(D); (%o7) matrix([sqrt(a),0],[b/sqrt(a),sqrt(c-b^2/a)]) <<<<<<<<<<<<<<<<<<<<<<<< Tested in Maxima 5.23.2 GCL 2.6.8 WIndows 7 -s On Mon, Aug 15, 2011 at 10:18, gabriele wrote: > ith wxmaxima 0.7.1 ubuntu hardy > D:matrix([a,b],[b,c]); > cholesky(D); > Unable to find the Cholesky factorization -- an error. To debug this try > debugmode(true); > > even with > > assume(determinant(D)>0); > cholesky(D); > Unable to find Cholesky etc... > > but > > cholesky(transpose(D).D); > Is b2+a2 positive or zero?positive; > result... > which means cholesky symbolic works.. > ______________________________**_________________ > 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 Mon Aug 15 13:06:37 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Mon, 15 Aug 2011 19:06:37 +0100 Subject: [Maxima] unable to find cholesky factorization References: <4E49284D.1030401@yahoo.it> Message-ID: Gabriele Belperio writes: > with wxmaxima 0.7.1 ubuntu hardy > D:matrix([a,b],[b,c]); > cholesky(D); > Unable to find the Cholesky factorization -- an error. To debug this > try debugmode(true); > > even with > > assume(determinant(D)>0); > cholesky(D); > Unable to find Cholesky etc... > > but > > cholesky(transpose(D).D); > Is b^2+a^2 positive or zero?positive; > result... > which means cholesky symbolic works.. The Cholesky decomposition requires a Hermitian positive definite matrix (see [1]). The last of your examples is, since it's symmetric, but the others aren't known to be. Rupert [1] http://en.wikipedia.org/wiki/Cholesky_decomposition PS: To other list members, sorry for the double post: I didn't notice the mails were duplicates until after approving them in the moderator queue. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From andrej.vodopivec at gmail.com Mon Aug 15 13:41:06 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Mon, 15 Aug 2011 20:41:06 +0200 Subject: [Maxima] Windows maxima with gcl In-Reply-To: References: Message-ID: A windows binary compiled with gcl is now available: http://sourceforge.net/projects/maxima/files/Maxima-Windows/5.25.0-Windows/maxima-5.25.0.exe/download -------------- next part -------------- An HTML attachment was scrubbed... URL: From richhen2008 at gmail.com Mon Aug 15 14:46:57 2011 From: richhen2008 at gmail.com (Richard Hennessy) Date: Mon, 15 Aug 2011 15:46:57 -0400 Subject: [Maxima] Maxima 25.0 In-Reply-To: References: Message-ID: <76345A4D049D423C9632319D27CA0972@RichsLaptop> The new Maxima command line has a bug. If you close the command window by clicking on the x close box, you get an error from wxcl86.exe before Windows closes the window. I am using Windows 7 professional. You have to type quit(); to avoid the error. Rich From richhen2008 at gmail.com Mon Aug 15 14:59:29 2011 From: richhen2008 at gmail.com (Richard Hennessy) Date: Mon, 15 Aug 2011 15:59:29 -0400 Subject: [Maxima] Maxima 25.0 In-Reply-To: <76345A4D049D423C9632319D27CA0972@RichsLaptop> References: <76345A4D049D423C9632319D27CA0972@RichsLaptop> Message-ID: Maxima version: 5.25.0 Maxima build date: 12:0 8/2/2011 Host type: i686-pc-mingw32 Lisp implementation type: Clozure Common Lisp Lisp implementation version: Version 1.7-r14925M (WindowsX8632) -----Original Message----- From: Richard Hennessy Sent: Monday, August 15, 2011 3:46 PM To: maxima at math.utexas.edu Subject: Re: Maxima 25.0 The new Maxima command line has a bug. If you close the command window by clicking on the x close box, you get an error from wxcl86.exe before Windows closes the window. I am using Windows 7 professional. You have to type quit(); to avoid the error. Rich From andrej.vodopivec at gmail.com Tue Aug 16 04:23:39 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Tue, 16 Aug 2011 11:23:39 +0200 Subject: [Maxima] parGosper from zeilberger package doesn't work as expected In-Reply-To: <4E47DE19.1030900@gmx.de> References: <4E47DE19.1030900@gmx.de> Message-ID: Maybe the documentation could be improved. parGosper(F(n,k), k, n, d) returns a recurrence for F(n,k) such that sum( a_i F(n+i,k), i, 0, d) = R(n,k+1)*F(n,k+1) - F(n, k)*F(n, k). In your example: (%i2) F(d,a1,k1,a2,k2,b2,l2) := 1/(a1-k1)!/k1!*(-1)^k1 /(a2-k2)!/k2!*(-1)^k2 /(b2-l2)!/l2!*(-1)^l2 *(a1+2*a2+k1+d-1)! /(a1+2*a2+k1+d)! *(a1+a2+k1+k2+d-1)! /(k2+d-2)! *(b2+l2+d-2)!/(l2+d-2)! *(k2+l2+d-2)!/(k2+l2+d-1+k1)!$ (%i3) h: parGosper(F(d,a1,k1,a2,k2,b2,l2),b2,l2,0)$ (%i4) define(R(d,a1,k1,a2,k2,b2,l2), h[1][1])$ define(A0(d,a1,k1,a2,k2,b2,l2), h[1][2][1])$ (%i6) res : A0(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2) - (R(d,a1,k1,a2,k2,b2+1,l2)*F(d,a1,k1,a2,k2,b2+1,l2) - R(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2))$ (%i7) factor(minfactorial(%)); (%o7) 0 BTW, if the degree of the recurrence is 0 then the term is Gosper summable, so you can also use AndiDifference: (%i8) ADF: AntiDifference(F(d,a1,k1,a2,k2,b2,l2), b2)$ (%i9) ADF - R(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2); (%o9) 0 HTH, Andrej ----------------------- http://gplus.to/andrejv 2011/8/14 andre maute : > Hi, > > I have the following test for parGosper,which seems not to work. > I think i have interpreted the documentation correctly. > > res below should vanish identically. > I have attached my maxima file and an output file. > > Andre > > ---- testparGosper.max ---- > display2d : false; > > load(zeilberger); > > F(d,a1,k1,a2,k2,b2,l2) > ? ?:= 1/(a1-k1)!/k1!*(-1)^k1 > ? ? ? ?/(a2-k2)!/k2!*(-1)^k2 > ? ? ? ?/(b2-l2)!/l2!*(-1)^l2 > ? ? ? ?*(a1+2*a2+k1+d-1)! > ? ? ? ?/(a1+2*a2+k1+d)! > ? ? ? ?*(a1+a2+k1+k2+d-1)! > ? ? ? ?/(k2+d-2)! > ? ? ? ?*(b2+l2+d-2)!/(l2+d-2)! > ? ? ? ?*(k2+l2+d-2)!/(k2+l2+d-1+k1)!; > > h : parGosper(F(d,a1,k1,a2,k2,b2,l2),b2,l2,0); > > R(d,a1,k1,a2,k2,b2,l2) := h[1][1]; > A0(d,a1,k1,a2,k2,b2,l2) := h[1][2][1]; > > res : A0(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2) > ? ?- (R(d,a1,k1,a2,k2,b2,l2+1)*F(d,a1,k1,a2,k2,b2,l2+1) - > R(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2)); > res : factor(minfactorial(res)); > > --------------------------- > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > From andre.maute at gmx.de Tue Aug 16 04:49:40 2011 From: andre.maute at gmx.de (andre maute) Date: Tue, 16 Aug 2011 11:49:40 +0200 Subject: [Maxima] parGosper from zeilberger package doesn't work as expected In-Reply-To: References: <4E47DE19.1030900@gmx.de> Message-ID: <4E4A3D34.4010602@gmx.de> On 08/16/2011 11:23 AM, Andrej Vodopivec wrote: > (%i6) res : A0(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2) > - (R(d,a1,k1,a2,k2,b2+1,l2)*F(d,a1,k1,a2,k2,b2+1,l2) > - R(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2))$ > (%i7) factor(minfactorial(%)); > (%o7) 0 > > 2011/8/14 andre maute: >> res : A0(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2) >> - (R(d,a1,k1,a2,k2,b2,l2+1)*F(d,a1,k1,a2,k2,b2,l2+1) - >> R(d,a1,k1,a2,k2,b2,l2)*F(d,a1,k1,a2,k2,b2,l2)); >> res : factor(minfactorial(res)); Aah, i see my typo, i used l2+1 instead of b2+1 Thank you very much Andre From l_butler at users.sourceforge.net Tue Aug 16 05:53:31 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Tue, 16 Aug 2011 10:53:31 +0000 Subject: [Maxima] git pull + src/sharefiles.mk In-Reply-To: (message from Robert Dodier on Mon, 15 Aug 2011 09:33:15 -0600) Message-ID: <1qpr54lsk44.fsf@iceland.freeshell.org> Robert Dodier writes: > On 8/13/11, Leo Butler wrote: >> Barton Willis writes: >> >>> The files src/share-subdirs.lisp and src/sharefiles.mk are both >>> automatically >>> generated (by configure), but doing a pull, git complains about these >>> files: >>> >>> Updating 0c6001a..c8d7c31 >>> Aborting >>> error: Your local changes to the following files would be overwritten by >>> merge: >>> src/share-subdirs.lisp >>> src/sharefiles.mk >>> Please, commit your changes or stash them before you can merge. >> >> Barton, >> I don't think that you want to stash these changes. >> >> I generally use magit in emacs as a git front-end, and >> what I do is kill these changes. The corresponding >> git command is >> >> git --no-pager checkout -- >> >> where is the list of files to be reverted. >> >> Btw, it is probably best to do >> >> git pull --rebase >> >> rather than a simple git pull. > > I dunno. How are casual users of Git (I believe this includes > most of the Maxima developers) supposed to know minutiae > like that? As I said, I generally use a front-end to git. This is the best option for casual users imo. I was simply pulling those commands from the log of magit (the frontend). > Rebase in particular is significantly different from > a simple pull; how shall we choose which one? This has been discussed on this list. > Git itself suggests stash, how do we know not to follow the > recommendation? IIRC, git makes 2 suggestions and no recommendations. Stash would not be a wrong option in most cases. But, as you know in the case of the files mentioned, they shouldn't really be under vc and one doesn't want to keep changes made to the local copies. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From piminusmeson at bk.ru Tue Aug 16 15:37:17 2011 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Wed, 17 Aug 2011 00:37:17 +0400 Subject: [Maxima] genmatrix question Message-ID: <4E4AD4FD.2050702@bk.ru> Hello, list. I need to create the 4x4 matrix, a upper-left element of which has indices [0,0]. The genmatrix(a,3,3,0,0) command gives such matrix, but to call the element of this matrix one needs to use indices from 1 to 4.( for instance, to call the element "a_00" in example below one needs to type "a[1,1];") Is it possible to create an matrix, the upper-left element of which can be called by a[0,0]? (%i1) a:genmatrix(a,3,3,0,0); [ a a a a ] [ 0, 0 0, 1 0, 2 0, 3 ] [ ] [ a a a a ] [ 1, 0 1, 1 1, 2 1, 3 ] (%o1) [ ] [ a a a a ] [ 2, 0 2, 1 2, 2 2, 3 ] [ ] [ a a a a ] [ 3, 0 3, 1 3, 2 3, 3 ] (%i2) a[0,0]; apply: no such matrix element: [0, 0] -- an error. To debug this try: debugmode(true); (%i3) a[1,1]; (%o3) a 0, 0 (%i4) P.S. Sorry for my rough english. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aleksasd873 at gmail.com Wed Aug 17 01:31:16 2011 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Wed, 17 Aug 2011 09:31:16 +0300 Subject: [Maxima] genmatrix question Message-ID: Hello, list. I need to create the 4x4 matrix, a upper-left element of which has indices [0,0]. The genmatrix(a,3,3,0,0) command gives such matrix, but to call the element of this matrix one needs to use indices from 1 to 4.( for instance, to call the element "a_00" in example below one needs to type "a[1,1];") Is it possible to create an matrix, the upper-left element of which can be called by a[0,0]? (%i1) a:genmatrix(a,3,3,0,0); [ a a a a ] [ 0, 0 0, 1 0, 2 0, 3 ] [ ] [ a a a a ] [ 1, 0 1, 1 1, 2 1, 3 ] (%o1) [ ] [ a a a a ] [ 2, 0 2, 1 2, 2 2, 3 ] [ ] [ a a a a ] [ 3, 0 3, 1 3, 2 3, 3 ] (%i2) a[0,0]; apply: no such matrix element: [0, 0] -- an error. To debug this try: debugmode(true); (%i3) a[1,1]; (%o3) a 0, 0 ********************************************************************************* You can use the array For example: (%i1) array(a,3,3); (%o1) a (%i2) a[0,0]; a[1,0];a[3,3]; (%o2) a[0,0] (%o3) a[1,0] (%o4) a[3,3] (%i5) a[4,4]; Array a has dimensions [3,3], but was called with [4,4] -- an error. To debug this try: debugmode(true); (%i6) fillarray (a, makelist (i, i, 1, 16)); (%o6) a (%i7) a[0,0]; (%o7) 1 (%i8) a[3,3]; (%o8) 16 (%i9) a[3,3]:100; (%o9) 100 (%i10) a[3,3]; (%o10) 100 AD -------------- next part -------------- An HTML attachment was scrubbed... URL: From piminusmeson at bk.ru Wed Aug 17 07:47:33 2011 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Wed, 17 Aug 2011 16:47:33 +0400 Subject: [Maxima] genmatrix question Message-ID: <4E4BB865.6080101@bk.ru> > You can use the array > For example: Thanks, it is possible, but i need to calculate the determinant, the inverse matrix and so on. I found the better solution, for example: (%i1) genmatrix(a,1,1,0,0); [ a a ] [ 0, 0 0, 1 ] (%o1) [ ] [ a a ] [ 1, 0 1, 1 ] (%i2) a[0,0]:x;a[0,1]:y;a[1,0]:z;a[1,1]:t; (%o2) x (%o3) y (%o4) z (%o5) t (%i6) a:%o1; [ a a ] [ 0, 0 0, 1 ] (%o6) [ ] [ a a ] [ 1, 0 1, 1 ] (%i7) a:''a; [ x y ] (%o7) [ ] [ z t ] (%i8) determinant(a); (%o8) t x - y z (%i9) a[0,0]; (%o9) x (%i10) But, if one changes the order of assignments, maxima gives an error: (%i1) genmatrix(a,1,1,0,0); [ a a ] [ 0, 0 0, 1 ] (%o1) [ ] [ a a ] [ 1, 0 1, 1 ] (%i2) a:%o1; [ a a ] [ 0, 0 0, 1 ] (%o2) [ ] [ a a ] [ 1, 0 1, 1 ] (%i3) a[0,0]:x;a[0,1]:y;a[1,0]:z;a[1,1]:t; setelmx: no such element [0, 0] -- an error. To debug this try: debugmode(true); setelmx: no such element [0, 1] -- an error. To debug this try: debugmode(true); setelmx: no such element [1, 0] -- an error. To debug this try: debugmode(true); (%o6) It is odd behaviour, may be it is bug? -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Wed Aug 17 14:48:11 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 17 Aug 2011 15:48:11 -0400 Subject: [Maxima] Maxima 5.25.0 and pw.mac In-Reply-To: References: Message-ID: <590FAD9D90A84B709447E867DD6F91B9@RichsLaptop> Hi List; There are no issues with pw.mac in Maxima 5.25.0. There was a bug in the integration of diff_pwdelta(), which is fixed now in the latest version of pw.mac, version 6.3. I uploaded it last night. The bug was when you try pwint(diff_pwdelta(2, a*x-t) * , x, minf, inf); or pwint(diff_pwdelta(2, a*x-t) * , x); where a # 1. Thanks to recent posts to this list by James Cloos, I noticed the bug and fixed it. Rich From rich.hennessy at verizon.net Wed Aug 17 15:17:38 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 17 Aug 2011 16:17:38 -0400 Subject: [Maxima] Maxima 5.25.0 and pw.mac Message-ID: Here are some examples. (%i1) display2d:false; (out1) false (%i2) assume(c>0); (out2) [c > 0] (%i3) pwint(x^5*diff_pwdelta(c*x-p),x,minf,inf); Error : diff_pwdelta takes two arguments. #0: simpdiffdelta(__e=[c*x-p])(pw.mac line 195) -- an error. To debug this try: debugmode(true); (%i4) pwint(x^5*diff_pwdelta(2,c*x-p),x,minf,inf); (out4) 20*p^3/c^6 (%i5) pwint(x^5*diff_pwdelta(3,c*x-p),x,minf,inf); (out5) -60*p^2/c^6 (%i6) pwint(cos(x)*diff_pwdelta(3,c*x-p),x,minf,inf); (out6) -sin(p/c)/c^4 (%i7) pwint(cos(x)*diff_pwdelta(2,c*x-p),x,minf,inf); (out7) -cos(p/c)/c^3 I believe these are all correct. Rich -----Original Message----- From: Richard Hennessy Sent: Wednesday, August 17, 2011 3:48 PM To: maxima at math.utexas.edu Subject: Re: Maxima 5.25.0 and pw.mac Hi List; There are no issues with pw.mac in Maxima 5.25.0. There was a bug in the integration of diff_pwdelta(), which is fixed now in the latest version of pw.mac, version 6.3. I uploaded it last night. The bug was when you try pwint(diff_pwdelta(2, a*x-t) * , x, minf, inf); or pwint(diff_pwdelta(2, a*x-t) * , x); where a # 1. Thanks to recent posts to this list by James Cloos, I noticed the bug and fixed it. Rich From acimmarusti at gmail.com Thu Aug 18 10:58:20 2011 From: acimmarusti at gmail.com (Andres Cimmarusti) Date: Thu, 18 Aug 2011 11:58:20 -0400 Subject: [Maxima] contour_plot and implicit_plot terrible resolution and cutting graph Message-ID: Hi, I'm using wxMaxima 0.8.5 atop maxima 5.21.1 on Debian Squeeze. I need to graph the following expression that I have defined as a function in maxima: ygs(x,C,d,t) := x * ( ( 1 + 3 * C / x * log( 1/2 + 1/2 * sqrt( 1 + 8 * x / ( 3 * ( 1 + d^2 ) ) ) ) )^2 + ( t - 3 * C * d / x * log( 1/2 + 1/2 * sqrt( 1 + 8 * x / ( 3 * ( 1 + d^2 ) ) ) ) )^2 ); So I'm using both implicit_plot and contour_plot as follows: implicit_plot( ygs(x,8,d,0) = 100 , [d,-20,20] , [x,0,120] )$ contour_plot( ygs(x,8,d,0) , [d,-20,20] , [x,0,200] )$ As soon as you do this you will notice 3 things: 1. The plot where ygs(x,8,d,0) = 100 is incomplete! it has a gap in the middle 2. There appears to be a mysterious line running parallel to the d-axis 2. The resolution is quite poor Now for what I'm doing both x and the value of the function, that is ygs, cannot possibly be negative, but I decided to give this a try: implicit_plot( ygs(x,8,d,0) = 100 , [d,-20,20] , [x,-200,200] )$ So the mysterious lines running parallel to the axis are explained. But I don't want these to show in the plot and interfere with the display of the graph I do want. Therefore I have the following questions and comments: 1. Is it possible to tell contour/implicit_plot's numerical solver to disregard anything where x < 0 and/or ygs < 0 ?. I tried using assume but it seems to be ignored. 2. Is this why there is a gap in the plot? 3. Is there a way to increase the resolution so that the plot traces don't look so bad? I couldn't find anything in the maxima help. 4. Is this a bug? if so, is this the proper place to report it? 5. For comparison I ran roughly the same commands in Mathematica 8.0.1 for Linux and it had no trouble displaying this curve and it displayed nothing running parallel to the axis Thanks in advance for any assistance! Andres Cimmarusti PS: I have reproduced the same issue running wxMaxima 11.04 atop 5.24.0 on Debian testing From kcrisman at gmail.com Thu Aug 18 20:29:48 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Thu, 18 Aug 2011 21:29:48 -0400 Subject: [Maxima] Maxima on PPC 64 bit SUSE Linux Message-ID: While testing Sage, someone tried to build it on a PowerPC Linux distribution. http://trac.sagemath.org/sage_trac/ticket/11708 ... ;;; Emitting code for UNARY. Internal or unrecoverable error in: not a lisp data object ?[2: No such file or directory] Now, that might just mean we have misconfigured something. ?Or it could mean that Maxima isn't supported on this platform. ?Or that ECL miscompiled on it. Anyway, does anyone know anything about whether Maxima ordinarily builds on this? ?I couldn't find anything in a very nominal internet search. ?Thanks! From toy.raymond at gmail.com Thu Aug 18 23:41:57 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 18 Aug 2011 21:41:57 -0700 Subject: [Maxima] Maxima on PPC 64 bit SUSE Linux In-Reply-To: References: Message-ID: <4E4DE995.80501@gmail.com> On 8/18/11 6:29 PM, Karl-Dieter Crisman wrote: > While testing Sage, someone tried to build it on a PowerPC Linux distribution. > > http://trac.sagemath.org/sage_trac/ticket/11708 > > ... > ;;; Emitting code for UNARY. > > Internal or unrecoverable error in: > not a lisp data object > [2: No such file or directory] > > Now, that might just mean we have misconfigured something. Or it > could mean that Maxima isn't supported on this platform. Or that ECL > miscompiled on it. Maxima probably isn't supported on this platform because probably no developer normally works on PPC Linux. I might be wrong about that. On the other hand, I have built maxima just fine using a 64-bit version of ecl on Linux (x86) and Solaris (sparc). So I would guess that the problem you are seeing is due to ecl. Ray From toy.raymond at gmail.com Thu Aug 18 23:45:14 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 18 Aug 2011 21:45:14 -0700 Subject: [Maxima] git pull + src/sharefiles.mk In-Reply-To: <1qpr54lsk44.fsf@iceland.freeshell.org> References: <1qpr54lsk44.fsf@iceland.freeshell.org> Message-ID: <4E4DEA5A.9090705@gmail.com> On 8/16/11 3:53 AM, Leo Butler wrote: > >> Git itself suggests stash, how do we know not to follow the >> recommendation? > IIRC, git makes 2 suggestions and no recommendations. Stash would not be > a wrong option in most cases. But, as you know in the case of the files > mentioned, they shouldn't really be under vc and one doesn't want to > keep changes made to the local copies. > I wish there were a better solution. Perhaps some more massaging of the current automake build system will allow us not to store those files in the repo. That would be the ideal situation, but oddly some people want to build maxima without going through configure/make, so some of these files need to exist. I will try to look at this again soon. Ray From robert.dodier at gmail.com Fri Aug 19 00:39:54 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 18 Aug 2011 23:39:54 -0600 Subject: [Maxima] git pull + src/sharefiles.mk In-Reply-To: <4E4DEA5A.9090705@gmail.com> References: <1qpr54lsk44.fsf@iceland.freeshell.org> <4E4DEA5A.9090705@gmail.com> Message-ID: On 8/18/11, Raymond Toy wrote: > I wish there were a better solution. Perhaps some more massaging of the > current automake build system will allow us not to store those files in > the repo. That would be the ideal situation, but oddly some people want > to build maxima without going through configure/make, so some of these > files need to exist. I don't understand what the problem is. We can rename sharefiles.mk to sharefiles.mk.in and just copy it to sharefiles.mk at build time (I guess this means there needs to be a rule for that in Makefile.am). Then sharefiles.mk will get bundled into the tarball for the benefit of those who are building without automake. best Robert Dodier From robert.dodier at gmail.com Fri Aug 19 00:58:23 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 18 Aug 2011 23:58:23 -0600 Subject: [Maxima] git pull + src/sharefiles.mk In-Reply-To: <1qpr54lsk44.fsf@iceland.freeshell.org> References: <1qpr54lsk44.fsf@iceland.freeshell.org> Message-ID: On 8/16/11, Leo Butler wrote: >> Rebase in particular is significantly different from >> a simple pull; how shall we choose which one? > > This has been discussed on this list. Let's discuss it again, then, since rebase was only an incidental topic in a long discussion about some other Git craziness. To keep it focused, can you explain why sometimes git pull is enough to keep things up to date, and sometimes git rebase is needed? You wrote some notes about Git which was posted to this list. Can you update the notes to indicate how to deal with pull vs rebase? best Robert Dodier From andreas_eder at gmx.net Fri Aug 19 07:52:38 2011 From: andreas_eder at gmx.net (Andreas Eder) Date: Fri, 19 Aug 2011 14:52:38 +0200 Subject: [Maxima] git pull + src/sharefiles.mk In-Reply-To: (Robert Dodier's message of "Thu, 18 Aug 2011 23:58:23 -0600") References: <1qpr54lsk44.fsf@iceland.freeshell.org> Message-ID: <87y5ypwokp.fsf@eder.homelinux.net> Robert Dodier wrote: >You wrote some notes about Git which was posted to this list. >Can you update the notes to indicate how to deal with pull vs rebase? Yes, I'd second this. Git is also new to me and sometimes behaves rather unexpectedly. So, a mini tutorial would be rather welcome. (Yes I know the freely available literature about git.) Andreas -- ceterum censeo redmondinem esse delendam. From kielhorn.martin at googlemail.com Fri Aug 19 11:24:58 2011 From: kielhorn.martin at googlemail.com (Martin Kielhorn) Date: Fri, 19 Aug 2011 18:24:58 +0200 Subject: [Maxima] Is there a way to solve this integral? Message-ID: Hi, is there way, to help maxima along solving the following integral? integrate(acos((2*c+k*u)/sqrt((1-k^2/4)*(1-u^2))),u); wolframalpha solves the problem with the input Integrate[ArcCos[(2*c + k*u)/ Sqrt[(1-k^2/4)*(1-u^2)]],u] However, I would very much like to be able to stay within maxima. Regards, Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Fri Aug 19 15:40:54 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 19 Aug 2011 16:40:54 -0400 Subject: [Maxima] contour_plot and implicit_plot terrible resolution and cutting graph In-Reply-To: References: Message-ID: <4E4ECA56.2040404@telefonica.net> On 08/18/2011 11:58 AM, Andres Cimmarusti wrote: > Hi, I'm using wxMaxima 0.8.5 atop maxima 5.21.1 on Debian Squeeze. > > I need to graph the following expression that I have defined as a > function in maxima: > > ygs(x,C,d,t) := x * ( ( 1 + 3 * C / x * log( 1/2 + 1/2 * sqrt( 1 + 8 * > x / ( 3 * ( 1 + d^2 ) ) ) ) )^2 > + ( t - 3 * C * d / x * log( 1/2 + 1/2 * sqrt( 1 + 8 * x / ( 3 * ( 1 + > d^2 ) ) ) ) )^2 ); > > So I'm using both implicit_plot and contour_plot as follows: > > implicit_plot( ygs(x,8,d,0) = 100 , [d,-20,20] , [x,0,120] )$ > > contour_plot( ygs(x,8,d,0) , [d,-20,20] , [x,0,200] )$ > > As soon as you do this you will notice 3 things: > > 1. The plot where ygs(x,8,d,0) = 100 is incomplete! it has a gap in the middle > 2. There appears to be a mysterious line running parallel to the d-axis > 2. The resolution is quite poor > > Now for what I'm doing both x and the value of the function, that is > ygs, cannot possibly be negative, but I decided to give this a try: > > implicit_plot( ygs(x,8,d,0) = 100 , [d,-20,20] , [x,-200,200] )$ > > So the mysterious lines running parallel to the axis are explained. > But I don't want these to show in the plot and interfere with the > display of the graph I do want. > > Therefore I have the following questions and comments: > > 1. Is it possible to tell contour/implicit_plot's numerical solver to > disregard anything where x< 0 and/or ygs< 0 ?. I tried using assume > but it seems to be ignored. > 2. Is this why there is a gap in the plot? > 3. Is there a way to increase the resolution so that the plot traces > don't look so bad? I couldn't find anything in the maxima help. > 4. Is this a bug? if so, is this the proper place to report it? > 5. For comparison I ran roughly the same commands in Mathematica 8.0.1 > for Linux and it had no trouble displaying this curve and it displayed > nothing running parallel to the axis > > Thanks in advance for any assistance! > > Andres Cimmarusti > > PS: I have reproduced the same issue running wxMaxima 11.04 atop > 5.24.0 on Debian testing > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Hello, You can try the draw version for implicit functions; it seems to work better for this example. Relevant options are 'ip_grid' and 'ip_grid_in': load(draw) $ draw2d( ip_grid = [80,80], ip_grid_in = [10,10], implicit(ygs(x,8,d,0) = 100, d,-20,20,x,0,200)) $ -- Mario From willisb at unk.edu Sat Aug 20 06:29:48 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 20 Aug 2011 06:29:48 -0500 Subject: [Maxima] generalized Lambert W In-Reply-To: <4E4ECA56.2040404@telefonica.net> References: <4E4ECA56.2040404@telefonica.net>, Message-ID: The to_poly_solver would benefit from having a generalized Lambert function; see http://functions.wolfram.com/ElementaryFunctions/ProductLog2/ The general simplifier does lambert_w(-log(2)/2) --> -log(2). Since this simplification isn't valid for all branches, I can not claim that the solution set to x * exp(x) = z is x = lambert_w(z). (Whence bug ID: 3392909.) We could define lambert_w(complex) = principle branch = lambert_w(0,complex). All other branches would be lambert_w(integer, complex). I don't like that all that much. I favor the verbose: generalized_lambert_w(integer, complex). Alternatively the generalized Lambert function could memoize: lambert_w[integer](complex). But do we really want Maxima to save all values in doing something like plot2d(lambert[3](x), ....)? Defining the generalized Lambert function would be a fun project--I might build a function (with no numerical evaluation) that allows me to fix the to_poly_solver bug. Comments? Has anybody already defined a generalized Lambert function? --Barton From l_butler at users.sourceforge.net Sat Aug 20 07:39:05 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Sat, 20 Aug 2011 12:39:05 +0000 Subject: [Maxima] git pull and friends, was git pull + src/sharefiles.mk In-Reply-To: <87y5ypwokp.fsf@eder.homelinux.net> (message from Andreas Eder on Fri, 19 Aug 2011 14:52:38 +0200) Message-ID: <1qpk4a8s1ee.fsf@iceland.freeshell.org> Andreas Eder writes: > Robert Dodier wrote: >>You wrote some notes about Git which was posted to this list. >>Can you update the notes to indicate how to deal with pull vs rebase? > > Yes, I'd second this. Git is also new to me and sometimes behaves rather > unexpectedly. > So, a mini tutorial would be rather welcome. (Yes I know the freely > available literature about git.) Ok, I will try to snatch some time in the next week to update the notes. In the meantime, here are a few pointers (please feel free to correct me on any misunderstandings): -a branch X in a git repo R can `track' another a branch X' in another repo R'; however, these branches are distinct in that their HEAD/history may diverge. -when branch X tracks X', repo R will contain a branch R'/X'. The command git branch -r will list these branches. -git fetch updates the "remote" branches like R'/X', but it does not alter the "local" tracking branches like X. -git merge attempts to merge the history of X and R'/X', this will include the history of which HEAD is on which branch at each commit, so a merge preserves as much history as possible, in some sense. A cost of this is that the history tends to look like spaghetti after a while. -git rebase attempts to rewrite the history of X so that all commits on X come after any commits on R'/X'. In short a history that looks like ____ X / -------- R'/X' is changed to a history that looks like _____ X / -------- R'/X' At that point, merging the two branches is trivial (there can be no conflicts) and git gives this trivial type of merge a name: it's a fast-forward. -the command git pull --rebase executes git fetch, followed by git rebase. Since rebasing re-writes history, this is *not* the default for git pull. (The potential harm in re-writing history is, if you someone else is already basing work on that history, then when it is re-written you force them to adapt--which can be quite messy and complicated.) -the command git pull --ff-only will do a git fetch, then a git merge but it will only do a fast-forward merge (in other words, the merge will succeed only if the histories look like ____ R'/X' / ---- X so the HEAD of X can be fast-forwarded to that of R'/X'). -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From dlakelan at street-artists.org Sat Aug 20 10:03:19 2011 From: dlakelan at street-artists.org (dlakelan) Date: Sat, 20 Aug 2011 08:03:19 -0700 Subject: [Maxima] How to help maxima get equation grouped nicely Message-ID: <4E4FCCB7.8070306@street-artists.org> Suppose I have an equation of the form: A*foo + A*bar + A*baz + B*quux how can I get maxima to reformat this as: A*(foo+bar+baz) + B*quux Especially helpful would be hints about using "format". From dlakelan at street-artists.org Sat Aug 20 11:21:28 2011 From: dlakelan at street-artists.org (dlakelan) Date: Sat, 20 Aug 2011 09:21:28 -0700 Subject: [Maxima] How to help maxima get equation grouped nicely In-Reply-To: <4E4FCCB7.8070306@street-artists.org> References: <4E4FCCB7.8070306@street-artists.org> Message-ID: <4E4FDF08.7020005@street-artists.org> On 08/20/2011 08:03 AM, dlakelan wrote: > Suppose I have an equation of the form: > > A*foo + A*bar + A*baz + B*quux > > how can I get maxima to reformat this as: > > A*(foo+bar+baz) + B*quux I should mention that A and B are not simple single variables but rather rational expressions of two variables which do not appear in foo, bar, baz, or quux From macrakis at alum.mit.edu Sat Aug 20 11:38:56 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 20 Aug 2011 12:38:56 -0400 Subject: [Maxima] How to help maxima get equation grouped nicely In-Reply-To: <4E4FDF08.7020005@street-artists.org> References: <4E4FCCB7.8070306@street-artists.org> <4E4FDF08.7020005@street-artists.org> Message-ID: Something like this, perhaps?: (%i13) A:a1+a2^2$ (%i14) B:b2/(1+b2)$ (%i15) foo:(q+p)$ (%i16) bar:(p+1/3)$ (%i17) baz:(p^3-1)$ (%i18) quux:(2*p-3*q)$ (%i19) expr: A*foo+A*bar+A*baz+B*quux; (%o19) (a2^2+a1)*(q+p)+b2*(2*p-3*q)/(b2+1)+(a2^2+a1)*(p^3-1)+(a2^2+a1)*(p+1/3) (%i20) divide(expr,A); (%o20) [(3*q+3*p^3+6*p-2)/3,-(3*b2*q-2*b2*p)/(b2+1)] (%i21) divide(%[2],B); (%o21) [2*p-3*q,0] (%i22) A*%o20[1]+B*%o21[1]; (%o22) (a2^2+a1)*(3*q+3*p^3+6*p-2)/3+b2*(2*p-3*q)/(b2+1) This works even if A, foo, etc. are not syntactic units: (%i23) ratsimp(expr); (%o23) (((3*a2^2+3*a1-9)*b2+3*a2^2+3*a1)*q+((3*a2^2+3*a1)*b2+3*a2^2+3*a1)*p^3+((6*a2^2+6*a1+6)*b2+6*a2^2+6*a1)*p +(-2*a2^2-2*a1)*b2-2*a2^2-2*a1) /(3*b2+3) (%i24) divide(expr,A); (%o24) [(3*q+3*p^3+6*p-2)/3,-(3*b2*q-2*b2*p)/(b2+1)] same intermediate result And of course the factors can be reorganized: (%i25) A*multthru(%o20[1])+B*%o21[1]; (%o25) (a2^2+a1)*(q+p^3+2*p-2/3)+b2*(2*p-3*q)/(b2+1) On Sat, Aug 20, 2011 at 12:21, dlakelan wrote: > On 08/20/2011 08:03 AM, dlakelan wrote: > > Suppose I have an equation of the form: > > > > A*foo + A*bar + A*baz + B*quux > > > > how can I get maxima to reformat this as: > > > > A*(foo+bar+baz) + B*quux > > I should mention that A and B are not simple single variables but rather > rational expressions of two variables which do not appear in foo, bar, > baz, or quux > > _______________________________________________ > 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 Sat Aug 20 17:04:30 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 20 Aug 2011 15:04:30 -0700 Subject: [Maxima] Is there a way to solve this integral? In-Reply-To: References: Message-ID: <4E502F6E.4070906@gmail.com> On 8/19/11 9:24 AM, Martin Kielhorn wrote: > Hi, > is there way, to help maxima along solving the following integral? > > integrate(acos((2*c+k*u)/sqrt((1-k^2/4)*(1-u^2))),u); > > wolframalpha solves the problem with the input > > Integrate[ArcCos[(2*c + k*u)/ Sqrt[(1-k^2/4)*(1-u^2)]],u] > > However, I would very much like to be able to stay within maxima. If Wolfram Alpha provides an answer for you, why do you need maxima to provide an answer? Yes, it would be nice if maxima could produce an answer, but it apparently can't. Why not just move on? Unless, of course, you want to improve maxima's integration routine. Ray From fateman at eecs.berkeley.edu Sat Aug 20 21:34:52 2011 From: fateman at eecs.berkeley.edu (R Fateman) Date: Sat, 20 Aug 2011 19:34:52 -0700 Subject: [Maxima] Is there a way to solve this integral? In-Reply-To: <4E502F6E.4070906@gmail.com> References: <4E502F6E.4070906@gmail.com> Message-ID: <4E506ECC.40806@eecs.berkeley.edu> You can write a program that runs on an internet-connected computer that will convert an unsolved integration problem into a problem in Mathematica syntax, ship it off to Wolfram Alpha, and if it comes up with an answer, suck it back into Maxima. I did such a thing with TILU and a predecessor of Wolfram Alpha. Until WRI changed the form of the answer so that if was an image. This was a few years ago. Is it ok to do this? I am not a lawyer. RJF On 8/20/2011 3:04 PM, Raymond Toy wrote: > On 8/19/11 9:24 AM, Martin Kielhorn wrote: >> Hi, >> is there way, to help maxima along solving the following integral? >> >> integrate(acos((2*c+k*u)/sqrt((1-k^2/4)*(1-u^2))),u); >> >> wolframalpha solves the problem with the input >> >> Integrate[ArcCos[(2*c + k*u)/ Sqrt[(1-k^2/4)*(1-u^2)]],u] >> >> However, I would very much like to be able to stay within maxima. > If Wolfram Alpha provides an answer for you, why do you need maxima to > provide an answer? Yes, it would be nice if maxima could produce an > answer, but it apparently can't. Why not just move on? Unless, of > course, you want to improve maxima's integration routine. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From cloos at jhcloos.com Sun Aug 21 03:33:01 2011 From: cloos at jhcloos.com (James Cloos) Date: Sun, 21 Aug 2011 04:33:01 -0400 Subject: [Maxima] funny Message-ID: (%i1) display2d:false; (%o1) false (%i2) solve(x^c-3,x); Is c an integer? n; (%o2) [x = 3^(1/c)] (%i3) vs: (%i1) display2d:false; (%o1) false (%i2) solve(x^c-3,x); Is c an integer? y; (%o2) [x = 3^(1/c)] (%i3) So why ask whether c is an integer? If it matters when some of the options are set to non-default values, then perhaps the question be asked only when needed? -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From david.kirkby at onetel.net Sun Aug 21 07:51:21 2011 From: david.kirkby at onetel.net (Dr. David Kirkby) Date: Sun, 21 Aug 2011 13:51:21 +0100 Subject: [Maxima] Is there a way to solve this integral? In-Reply-To: <4E506ECC.40806@eecs.berkeley.edu> References: <4E502F6E.4070906@gmail.com> <4E506ECC.40806@eecs.berkeley.edu> Message-ID: <4E50FF49.2000609@onetel.net> On 08/21/11 03:34 AM, R Fateman wrote: > You can write a program that runs on an internet-connected computer that > will convert an unsolved integration problem into a problem in > Mathematica syntax, ship it off to Wolfram Alpha, and if it comes up > with an answer, suck it back into Maxima. I did such a thing with TILU > and a predecessor of Wolfram Alpha. Until WRI changed the form of the > answer so that if was an image. This was a few years ago. Is it ok to do > this? > I am not a lawyer. > > RJF One would need to read the Wolfram|Alpha terms of usage. There is some wording in there about making competitive products. Or you could email Wolfram Research to clarify the matter. That is what I did when I wanted to use Wolfram|Alpha to compare results from Sage, then document the Wolfram|Alpha results in the Sage source code. Wolfram Research were happy for this to be done, as long as it was not an automated script that repeatedly called their server. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? From dan.stanger at ieee.org Sun Aug 21 07:52:07 2011 From: dan.stanger at ieee.org (Dan Stanger) Date: Sun, 21 Aug 2011 08:52:07 -0400 Subject: [Maxima] Is there a way to solve this integral? In-Reply-To: References: Message-ID: <4E50FF77.9020103@ieee.org> Hi Martin, Have you tried byparts, using acos((2*c+k*u)/sqrt((1-k^2/4)*(1-u^2))? An application of byparts and radcan reduces the integral to a rational function times a quadratic, which can be done by a trig substitution. FYI, here is the result of byparts, and radcan: u*acos((2*k*u+4*c)/(sqrt(k-2)*sqrt(k+2)*sqrt(u-1)*sqrt(u+1))) -'integrate((4*c*u^2+2*k*u)/((u^2-1)*sqrt((-3*k^2-4)*u^2-16*c*k*u-k ^2-16*c^2+4)),u) Dan Stanger Martin Kielhorn wrote: > Hi, > is there way, to help maxima along solving the following integral? > > integrate(acos((2*c+k*u)/sqrt((1-k^2/4)*(1-u^2))),u); > > wolframalpha solves the problem with the input > > Integrate[ArcCos[(2*c + k*u)/ Sqrt[(1-k^2/4)*(1-u^2)]],u] > > However, I would very much like to be able to stay within maxima. > > Regards, > Martin > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From fateman at eecs.berkeley.edu Sun Aug 21 09:17:43 2011 From: fateman at eecs.berkeley.edu (R Fateman) Date: Sun, 21 Aug 2011 07:17:43 -0700 Subject: [Maxima] Is there a way to solve this integral? In-Reply-To: <4E50FF49.2000609@onetel.net> References: <4E502F6E.4070906@gmail.com> <4E506ECC.40806@eecs.berkeley.edu> <4E50FF49.2000609@onetel.net> Message-ID: <4E511387.8030306@eecs.berkeley.edu> On 8/21/2011 5:51 AM, Dr. David Kirkby wrote: > > One would need to read the Wolfram|Alpha terms of usage. Or one could ignore it. RJF From dlakelan at street-artists.org Sun Aug 21 13:44:37 2011 From: dlakelan at street-artists.org (dlakelan) Date: Sun, 21 Aug 2011 11:44:37 -0700 Subject: [Maxima] How to help maxima get equation grouped nicely In-Reply-To: References: <4E4FCCB7.8070306@street-artists.org> <4E4FDF08.7020005@street-artists.org> Message-ID: <4E515215.5090404@street-artists.org> On 08/20/2011 09:38 AM, Stavros Macrakis wrote: > Something like this, perhaps?: > > (%i13) A:a1+a2^2$ > (%i14) B:b2/(1+b2)$ unfortunately in my problem A and B share two variables and this complicates your method. I actually managed to get something roughly correct by using factorout factorout(expression, ) gave me roughly the expression that i wanted. Now what I'd like to have Maxima do is output the expression in TeX as (numofA/denomofA) (foo+bar+baz) + (numofB/denomofB) (quux) instead of numofA (foo+bar+baz) + numofB quux -------------------- ----------- denomofA denomofB From macrakis at alum.mit.edu Sun Aug 21 14:04:36 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 21 Aug 2011 15:04:36 -0400 Subject: [Maxima] How to help maxima get equation grouped nicely In-Reply-To: <4E515215.5090404@street-artists.org> References: <4E4FCCB7.8070306@street-artists.org> <4E4FDF08.7020005@street-artists.org> <4E515215.5090404@street-artists.org> Message-ID: You can use "box" in Maxima to 'protect' things from default simplifications. But then you need to remove the box before calling tex, maybe something like this: expr: box(a/b)*c$ block([simp:false],tex(rembox(expr))) On Sun, Aug 21, 2011 at 14:44, dlakelan wrote: > On 08/20/2011 09:38 AM, Stavros Macrakis wrote: > > Something like this, perhaps?: > > > > (%i13) A:a1+a2^2$ > > (%i14) B:b2/(1+b2)$ > > unfortunately in my problem A and B share two variables and this > complicates your method. I actually managed to get something roughly > correct by using factorout > > factorout(expression, ) > > gave me roughly the expression that i wanted. Now what I'd like to have > Maxima do is output the expression in TeX as > > (numofA/denomofA) (foo+bar+baz) + (numofB/denomofB) (quux) > > instead of > > numofA (foo+bar+baz) + numofB quux > -------------------- ----------- > denomofA denomofB > > > _______________________________________________ > 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 mhansen at gmail.com Sun Aug 21 23:27:07 2011 From: mhansen at gmail.com (Mike Hansen) Date: Sun, 21 Aug 2011 21:27:07 -0700 Subject: [Maxima] Building Maxima on PPC64 (Power 7) with ECL Message-ID: Hello, I'm attempting to build Maxima on a Power7 box with ECL 11.1.1. The following error is thrown when building numeric.lisp: ;;; Note: ;;; Invoking external command: ;;; gcc -I. -I/home/wstein/silius/sage-4.7.1/local/include/ -I/home/wstein/silius/sage-4.7.1/local/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC -Dlinux -O2 -w -c binary-ecl/numeric.c -o binary-ecl/numeric.o ;;; Finished compiling /home/wstein/silius/sage-4.7.1/spkg/build/maxima-5.23.2.p0/src/src/numeric.lisp. ;;; ;;; Note: ;;; Invoking external command: ;;; gcc -I. -I/home/wstein/silius/sage-4.7.1/local/include/ -I/home/wstein/silius/sage-4.7.1/local/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC -Dlinux -O2 -w -c /tmp/eclinitkECreG.c -o /tmp/eclinitkECreG.o ;;; Note: ;;; Invoking external command: ;;; gcc -o binary-ecl/numeric.fas -L/home/wstein/silius/sage-4.7.1/local/lib/ /tmp/eclinitkECreG.o binary-ecl/numeric.o -Wl,--rpath,/home/wstein/silius/sage-4.7.1/local/lib/ -shared -L/home/wstein/silius/sage-4.7.1/local/lib -L/home/wstein/silius/sage-4.7.1/local/lib -lecl -lgmp -lgc -ldl -lm ; - Loading binary file "binary-ecl/numeric.fas" ;;; Loading "/home/wstein/silius/sage-4.7.1/spkg/build/maxima-5.23.2.p0/src/src/binary-ecl/numeric.fas" An error occurred during initialization: Attempt to redefine function NIL in locked package.. It seems this type of error has come up before. Is there a standard way to figure out why / where it's trying to redefine NIL? Thanks, --Mike From humberto.bortolossi at gmail.com Mon Aug 22 16:34:05 2011 From: humberto.bortolossi at gmail.com (Humberto Bortolossi) Date: Mon, 22 Aug 2011 18:34:05 -0300 Subject: [Maxima] integrate(1/x, x): why ln(x) and not ln(abs(x))? Message-ID: Hi! Why Maxima developers decided to evaluate integrate(1/x, x) as ln(x) and not ln(abs(x))? Thanks, Humberto. From willisb at unk.edu Mon Aug 22 16:53:39 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 22 Aug 2011 16:53:39 -0500 Subject: [Maxima] integrate(1/x, x): why ln(x) and not ln(abs(x))? In-Reply-To: References: Message-ID: There is an option variable that alters this: (%i2) integrate(1/x,x), logabs : false; (%o2) log(x) (%i3) integrate(1/x,x), logabs : true; (%o3) log(abs(x)) On the real line, maybe you would like logabs to be true; off the real line, chances are you'll need logabs to be false. --Barton maxima-bounces at math.utexas.edu wrote on 08/22/2011 04:34:05 PM: > From: Humberto Bortolossi > To: maxima at math.utexas.edu > Date: 08/22/2011 04:33 PM > Subject: [Maxima] integrate(1/x, x): why ln(x) and not ln(abs(x))? > Sent by: maxima-bounces at math.utexas.edu > > Hi! > > Why Maxima developers decided to evaluate > > integrate(1/x, x) > > as > > ln(x) > > and not > > ln(abs(x))? > > Thanks, Humberto. > _______________________________________________ > 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 Aug 22 21:50:34 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 22 Aug 2011 20:50:34 -0600 Subject: [Maxima] announcement: Maxima 5.25 Message-ID: Please distribute this message as you see fit. Announcing Maxima 5.25 Maxima is a GPL'd branch of Macsyma, the venerable symbolic computation system. Maxima 5.25 is a bug fix and feature enhancement release. The current version is 5.25.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, .... 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.25 release. Regards, Robert Dodier Maxima developer and 5.25 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/project/showfiles.php?group_id=4933 Ports page: http://apps.sourceforge.net/mediawiki/maxima/index.php?title=Maxima_ports Project home page: http://maxima.sourceforge.net Change log: http://maxima.git.sourceforge.net/git/gitweb.cgi?p=maxima/maxima;a=blob;f=ChangeLog-5.25 From david.kirkby at onetel.net Tue Aug 23 00:11:56 2011 From: david.kirkby at onetel.net (Dr. David Kirkby) Date: Tue, 23 Aug 2011 06:11:56 +0100 Subject: [Maxima] Is there a way to solve this integral? In-Reply-To: <4E511387.8030306@eecs.berkeley.edu> References: <4E502F6E.4070906@gmail.com> <4E506ECC.40806@eecs.berkeley.edu> <4E50FF49.2000609@onetel.net> <4E511387.8030306@eecs.berkeley.edu> Message-ID: <4E53369C.9000902@onetel.net> On 08/21/11 03:17 PM, R Fateman wrote: > On 8/21/2011 5:51 AM, Dr. David Kirkby wrote: >> >> One would need to read the Wolfram|Alpha terms of usage. > Or one could ignore it. > > RJF Well, that's a very profound statement Richard. Dave From robert.dodier at gmail.com Tue Aug 23 00:30:20 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 22 Aug 2011 23:30:20 -0600 Subject: [Maxima] MARGS, GREAT, MRAT => trouble Message-ID: Hi, I've found that this Lisp program: (defparameter x '((mplus) ((foo) ((mrat simp ($c) (#:c1635)) (#:c1635 1 -1) . 1) $a) ((foo) ((mrat simp nil nil) 1 . 1) ((mtimes simp) $a $b)))) (simplus x 1 t) triggers an error: CAR: #:C1635 is not a list I see that GREAT uses MARGS to decompose the MRAT expressions, which leads to the error because MARGS is naive, it just returns the CDR of the expression. How should GREAT and/or MARGS handle MRAT? The simplest thing to do is to reformat the arguments of GREAT but I suspect that's too expensive. I guess that whatever we come up with should be applied to other expressions with special representations. Thanks for any light you can shed on this. Robert Dodier PS. I discovered the error like this: load (ezunits); x : (rat(1) ` a) * (1 ` b + c); expand (x); => "not a list" error When the error is triggered, * has been distributed over + and SIMPLUS is sorting the arguments, hence the call to GREAT. From 33facebook at gmail.com Tue Aug 23 00:56:33 2011 From: 33facebook at gmail.com (first name) Date: Tue, 23 Aug 2011 13:56:33 +0800 Subject: [Maxima] How to Save Command-Line History Between Session (for the readline library)? Message-ID: hi! how can i save the command line history between session, so the readline library would "remember" my previous command line input, from a previous session? From 33facebook at gmail.com Tue Aug 23 01:02:22 2011 From: 33facebook at gmail.com (first name) Date: Tue, 23 Aug 2011 14:02:22 +0800 Subject: [Maxima] How to Map Key-Bindings in .inputrc, For Maxima only? Message-ID: Please let me explain my question. Usually, i use the following lines, in order to bind some shortcut, only for some application name.. for example: $if bash <> $endif $if gdb <> $endif Now, the bash man page says that EVERY application that uses the readline library should provide an "application name" so it can be used in the "$if <>" test, like i've showed above... So, I tried "$if Maxima" and $if maxima", but they are not working....so what is the application name? thanks From 33facebook at gmail.com Tue Aug 23 01:06:25 2011 From: 33facebook at gmail.com (first name) Date: Tue, 23 Aug 2011 14:06:25 +0800 Subject: [Maxima] How to Map Key-Bindings in .inputrc, For Maxima only? Message-ID: Please let me explain my question. Usually, i use the following lines, in order to bind some shortcut, only for some application name.. for example: $if bash <> $endif $if gdb <> $endif Now, the bash man page says that EVERY application that uses the readline library should provide an "application name" so it can be used in the "$if <>" test, like i've showed above... So, I tried "$if Maxima" and $if maxima", but they are not working....so what is the application name? thanks From 33facebook at gmail.com Tue Aug 23 01:36:16 2011 From: 33facebook at gmail.com (first name) Date: Tue, 23 Aug 2011 14:36:16 +0800 Subject: [Maxima] How to "Page" Large Output of Maxima, i.e Like the "|less" Pipe in Bash? Message-ID: Hi. I have a problem, especially when using the "?? function" command, that the output is far too big and so disappears somewhere from the screen...and i have to scroll up quite a few pages in order to read the display.. for example: the "?? integrate" command, which outputs a very long output... Now, in bash we pipe these output to the "less" commad etc. Now, what is the equivalent to this in Maxima? thanks From l_butler at users.sourceforge.net Tue Aug 23 06:41:54 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Tue, 23 Aug 2011 11:41:54 +0000 Subject: [Maxima] How to Save Command-Line History Between Session (for the readline library)? In-Reply-To: (message from first name on Tue, 23 Aug 2011 13:56:33 +0800) Message-ID: <1qp7h64s6bh.fsf@iceland.freeshell.org> first name <33facebook at gmail.com> writes: > hi! > how can i save the command line history between session, so the > readline library would "remember" my previous command line input, from > a previous session? If your lisp is not compiled with readline support, use rlwrap. http://utopia.knoware.nl/~hlub/rlwrap/ -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From l_butler at users.sourceforge.net Tue Aug 23 06:49:17 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Tue, 23 Aug 2011 11:49:17 +0000 Subject: [Maxima] How to Map Key-Bindings in .inputrc, For Maxima only? In-Reply-To: (message from first name on Tue, 23 Aug 2011 14:02:22 +0800) Message-ID: <1qp4o18s5z6.fsf@iceland.freeshell.org> first name <33facebook at gmail.com> writes: > Please let me explain my question. > > Usually, i use the following lines, in order to bind some shortcut, > only for some application name.. > for example: > $if bash > <> > $endif > > $if gdb > <> > $endif > > Now, the bash man page says that EVERY application that uses the > readline library should provide an "application name" so it can be > used in the "$if <>" test, like i've showed above... > > So, I tried "$if Maxima" and $if maxima", but they are not > working....so what is the application name? Hi, My guess is that the application name would be provided by the underlying lisp. But many lisps that Maxima runs on do not have readline support, so perhaps you are best off using rlwrap (provided you don't use it for other purposes)? Alternatively, Maxima has can be run inside Emacs with its own comint-based mode and keybindings. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From matthias.bindernagel at gmx.de Tue Aug 23 07:59:34 2011 From: matthias.bindernagel at gmx.de (Matthias Bindernagel) Date: Tue, 23 Aug 2011 14:59:34 +0200 Subject: [Maxima] Solving equation containing sum over list of vectors Message-ID: <4E53A436.5050003@gmx.de> Hi, I'm trying to investigate a problem containing the root mean square distance of a set of vectors to a set of transformed vectors. The transformation is parameterized by some scalar values. Now I want to minimize the rms distance under variation of the transformation parameters by finding the roots of the derivative. This is where I am stuck right now. I tried this approach: v: matrix([vx[i]], [vy[i]], [vz[i]], [1]); u: matrix([ux[i]], [uy[i]], [uz[i]], [1]); Rot: matrix( [cos(phi),-sin(phi), 0, 0], [sin(phi), cos(phi), 0, 0], [ 0, 0, 1, 0], [ 0, 0, 0, 1]); Transl: matrix( [1, 0, 0, l*tx], [0, 1, 0, l*ty], [0, 0, 1, 0], [0, 0, 0, 1]); Center: matrix( [1, 0, 0, cx], [0, 1, 0, cy], [0, 0, 1, 0], [0, 0, 0, 1]); T: invert(Center) . Rot . Center . Transl; d_rms(phi,l):= sum( transpose(T . v - u) . (T . v - u) * w[i], i,1,n); d_rms_l: diff(d_rms(phi,l), l); solve(d_rms_l = 0, l); The above code does not actually solve for l, which is what I want. And which I could perform by hand. (Note: for the last statement we can assume everything as constant except for l.) It may be related to the vector lists v and u and the scalar weight list w - I don't know how to declare them as list of vectors and scalars (I actually tried declare(v, nonscalar) etc., but it didn't work out). I would appreciate any help. Regards, Matze From l.couraud at gmail.com Tue Aug 23 08:47:55 2011 From: l.couraud at gmail.com (laurent couraud) Date: Tue, 23 Aug 2011 15:47:55 +0200 Subject: [Maxima] RE : Solving equation containing sum over list of vectors In-Reply-To: <4E53A436.5050003@gmx.de> Message-ID: <5954F69816C2445C98428A04BABA5695@PASSERELLE> Hi, I thing you have to declare sum to be linear with: declare(sum, linear) And maybe set simpsum to true. Regards. > -----Message d'origine----- > De?: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] De la part de > Matthias Bindernagel > Envoy??: mardi 23 ao?t 2011 15:00 > ??: maxima at math.utexas.edu > Objet?: [Maxima] Solving equation containing sum over list of vectors > > Hi, > > I'm trying to investigate a problem containing the root mean square > distance of a set of vectors to a set of transformed vectors. The > transformation is parameterized by some scalar values. > > Now I want to minimize the rms distance under variation of the > transformation parameters by finding the roots of the derivative. > This is where I am stuck right now. > > I tried this approach: > > v: matrix([vx[i]], [vy[i]], [vz[i]], [1]); > u: matrix([ux[i]], [uy[i]], [uz[i]], [1]); > > Rot: matrix( > [cos(phi),-sin(phi), 0, 0], > [sin(phi), cos(phi), 0, 0], > [ 0, 0, 1, 0], > [ 0, 0, 0, 1]); > > Transl: matrix( > [1, 0, 0, l*tx], > [0, 1, 0, l*ty], > [0, 0, 1, 0], > [0, 0, 0, 1]); > > Center: matrix( > [1, 0, 0, cx], > [0, 1, 0, cy], > [0, 0, 1, 0], > [0, 0, 0, 1]); > > T: invert(Center) . Rot . Center . Transl; > > d_rms(phi,l):= > sum( > transpose(T . v - u) . (T . v - u) * w[i], > i,1,n); > > d_rms_l: diff(d_rms(phi,l), l); > > solve(d_rms_l = 0, l); > > The above code does not actually solve for l, which is what I want. And > which I could perform by hand. (Note: for the last statement we can > assume everything as constant except for l.) > > It may be related to the vector lists v and u and the scalar weight list > w - I don't know how to declare them as list of vectors and scalars (I > actually tried declare(v, nonscalar) etc., but it didn't work out). > > I would appreciate any help. > Regards, > Matze > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at eecs.berkeley.edu Tue Aug 23 10:47:36 2011 From: fateman at eecs.berkeley.edu (fateman at eecs.berkeley.edu) Date: Tue, 23 Aug 2011 08:47:36 -0700 Subject: [Maxima] MARGS, GREAT, MRAT => trouble In-Reply-To: References: Message-ID: <460137cd9a302712bb7f9dfd2cf56818.squirrel@calmail.berkeley.edu> I'm away from a Maxima system, but here are some thoughts. 1. Great is not set up to deal with MRATs. Maybe the problem is in simplification of such mixed items, though I am not sure what this would lead to. eg. make foo(rat(1)) into the same as rat(foo(1)) ... 2. Rather than run the MRAT through format, one could "ratdisrep" the expression and add that form to the car of the MRAT, and save it there, at least as long as the expression did not change value. e.g. ((mrat ..... disrepform ((mplus ..) ....) rest of stuff) so great (or anyone else) who want to use this alternative has easy access.. One could also do this. ((mplus simp repform ((mrat ....))) ....) for fast access to the rat() form of an expression.. I am traveling and haven't thought so much about it. RJF > Hi, > > I've found that this Lisp program: > > (defparameter x '((mplus) ((foo) ((mrat simp ($c) (#:c1635)) (#:c1635 > 1 -1) . 1) $a) > ((foo) ((mrat simp nil nil) 1 . 1) ((mtimes simp) $a $b)))) > (simplus x 1 t) > > triggers an error: CAR: #:C1635 is not a list > > I see that GREAT uses MARGS to decompose the MRAT expressions, > which leads to the error because MARGS is naive, it just returns > the CDR of the expression. > > How should GREAT and/or MARGS handle MRAT? > The simplest thing to do is to reformat the arguments of GREAT > but I suspect that's too expensive. > > I guess that whatever we come up with should be applied to > other expressions with special representations. > > Thanks for any light you can shed on this. > > Robert Dodier > > > PS. I discovered the error like this: > > load (ezunits); > x : (rat(1) ` a) * (1 ` b + c); > expand (x); > => "not a list" error > > When the error is triggered, * has been distributed over + > and SIMPLUS is sorting the arguments, hence the call to GREAT. > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From toy.raymond at gmail.com Tue Aug 23 10:50:10 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 23 Aug 2011 08:50:10 -0700 Subject: [Maxima] How to "Page" Large Output of Maxima, i.e Like the "|less" Pipe in Bash? In-Reply-To: References: Message-ID: On Mon, Aug 22, 2011 at 11:36 PM, first name <33facebook at gmail.com> wrote: > Hi. > > I have a problem, especially when using the "?? function" command, > that the output is far too big and so disappears somewhere from the > screen...and i have to scroll up quite a few pages in order to read > the display.. > Use a bigger screen and/or a smaller font. :-) AFAIK, maxima doesn't have a pager, but I think that would be relatively easy to add for ??. It would not be so easy, I think, to add that for the actual documentation. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Aug 23 10:59:44 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 23 Aug 2011 08:59:44 -0700 Subject: [Maxima] funny In-Reply-To: References: Message-ID: On Sun, Aug 21, 2011 at 1:33 AM, James Cloos wrote: > (%i1) display2d:false; > > (%o1) false > (%i2) solve(x^c-3,x); > > Is c an integer? > > n; > (%o2) [x = 3^(1/c)] > (%i3) > > vs: > > (%i1) display2d:false; > > (%o1) false > (%i2) solve(x^c-3,x); > > Is c an integer? > > y; > (%o2) [x = 3^(1/c)] > (%i3) > > So why ask whether c is an integer? > > Yes, this is a bit annoying. While I haven't looked into the code for solve, this situation often happens because at a certain point maxima needs to know something to decide how to proceed. It sometimes turns out not to matter, but at the point where the question is asked, maxima needs to know. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Aug 23 11:09:03 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 23 Aug 2011 09:09:03 -0700 Subject: [Maxima] git pull + src/sharefiles.mk In-Reply-To: References: <1qpr54lsk44.fsf@iceland.freeshell.org> <4E4DEA5A.9090705@gmail.com> Message-ID: On Thu, Aug 18, 2011 at 10:39 PM, Robert Dodier wrote: > On 8/18/11, Raymond Toy wrote: > > > I wish there were a better solution. Perhaps some more massaging of the > > current automake build system will allow us not to store those files in > > the repo. That would be the ideal situation, but oddly some people want > > to build maxima without going through configure/make, so some of these > > files need to exist. > > I don't understand what the problem is. We can rename sharefiles.mk > to sharefiles.mk.in and just copy it to sharefiles.mk at build time > (I guess this means there needs to be a rule for that in Makefile.am). > Then sharefiles.mk will get bundled into the tarball for the benefit of > those who are building without automake. > > I don't remember what the actual problem was anymore. I will take a look again at this. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Aug 23 12:12:51 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 23 Aug 2011 10:12:51 -0700 Subject: [Maxima] git pull + src/sharefiles.mk In-Reply-To: References: <1qpr54lsk44.fsf@iceland.freeshell.org> <4E4DEA5A.9090705@gmail.com> Message-ID: On Tue, Aug 23, 2011 at 9:09 AM, Raymond Toy wrote: > > > I don't remember what the actual problem was anymore. I will take a look > again at this. > > Ok. This is probably a lack of understanding on my part, but this is what's happening. sharefiles.mk is needed by share/Makefile.am to produce a list of files that should be installed. If we can rearrange things so that Makefile.am can include sharefiles.mk after automake and get it to install the correct sharefiles, then we can remove sharefiles.mk from the repo. We might even be able to remove sharefiles.mk completely. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbaker1 at pipeline.com Tue Aug 23 16:12:08 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Tue, 23 Aug 2011 14:12:08 -0700 Subject: [Maxima] 64-bit Maxima/Windows7 ? In-Reply-To: References: <1qpr54lsk44.fsf@iceland.freeshell.org> <4E4DEA5A.9090705@gmail.com> Message-ID: Is there a 64-bit Maxima on Windows7 that can take advantage of 8 GBytes of real memory? From drdieterkaiser at web.de Tue Aug 23 16:22:54 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 23 Aug 2011 23:22:54 +0200 Subject: [Maxima] Commit to branch-5.25 Message-ID: <1314134574.1791.18.camel@dieter> I have committed a bug fix for the function plusin to the branch master. Now I think, I have to commit the bug fix to the branch branch-5.25. But I have not really an idea what is the best way to do it. Perhaps I can get some help. I have tried to checkout the branch-5.25, but I can not merge something from a local branch into the branch-5.25. I am using a git plugin in Eclipse. Dieter Kaiser From robert.dodier at gmail.com Tue Aug 23 16:56:38 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 23 Aug 2011 15:56:38 -0600 Subject: [Maxima] Commit to branch-5.25 In-Reply-To: <1314134574.1791.18.camel@dieter> References: <1314134574.1791.18.camel@dieter> Message-ID: Well, unless it's a pretty serious bug, I won't bother to create another release on the 5.25 branch. We're always fixing bugs of one kind or another, so unless there's a pressing need, the bug fix will be released in 5.26. That said, it would still be useful to know how to merge a patch from master onto a branch. I don't know how to do that. best, Robert Dodier On 8/23/11, Dieter Kaiser wrote: > I have committed a bug fix for the function plusin to the branch master. > Now I think, I have to commit the bug fix to the branch branch-5.25. But > I have not really an idea what is the best way to do it. Perhaps I can > get some help. > > I have tried to checkout the branch-5.25, but I can not merge something > from a local branch into the branch-5.25. I am using a git plugin in > Eclipse. > > Dieter Kaiser > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From drdieterkaiser at web.de Tue Aug 23 17:27:08 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 24 Aug 2011 00:27:08 +0200 Subject: [Maxima] Commit to branch-5.25 In-Reply-To: References: <1314134574.1791.18.camel@dieter> Message-ID: <1314138428.1791.25.camel@dieter> Am Dienstag, den 23.08.2011, 15:56 -0600 schrieb Robert Dodier: Hello Robert, yes, it is a serious bug and it is a silly bug. Please have a look at the bug report ID: 3396631 equal terms produce different results There is missing only one line of code. A variable in plusin must be reseted to the value 1. Dieter Kaiser > Well, unless it's a pretty serious bug, I won't bother > to create another release on the 5.25 branch. > We're always fixing bugs of one kind or another, > so unless there's a pressing need, the bug fix will be > released in 5.26. > > That said, it would still be useful to know how to merge > a patch from master onto a branch. I don't know how > to do that. > > best, Robert Dodier > > On 8/23/11, Dieter Kaiser wrote: > > I have committed a bug fix for the function plusin to the branch master. > > Now I think, I have to commit the bug fix to the branch branch-5.25. But > > I have not really an idea what is the best way to do it. Perhaps I can > > get some help. > > > > I have tried to checkout the branch-5.25, but I can not merge something > > from a local branch into the branch-5.25. I am using a git plugin in > > Eclipse. > > > > Dieter Kaiser > > > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > From lkreinitz at gmail.com Tue Aug 23 17:30:11 2011 From: lkreinitz at gmail.com (Louis Reinitz) Date: Tue, 23 Aug 2011 14:30:11 -0800 Subject: [Maxima] solving equations with hyperbolic functions Message-ID: B(t):=(b0*sqrt(b1)*cosh(sqrt(a1*b1)*t)-a0*sqrt(a1)*sinh(sqrt(a1*b1)*t))/sqrt(b1); solve(B(t),t) returns sinh(sqrt(a1*b1)*t)=(b0*sqrt(b1)*cosh(sqrt(a1*b1)*t))/(a0*sqrt(a1)) the useful solution is t=atanh((b0*sqrt(b1))/(a0*sqrt(a1))) how do I go about this? Is there a way of providing Maxima with hints -- Louis K Reinitz. -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Aug 23 18:04:26 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 23 Aug 2011 19:04:26 -0400 Subject: [Maxima] solving equations with hyperbolic functions In-Reply-To: References: Message-ID: I don't know of any way to provide Maxima with "hints", but you can work through the solution using Maxima as a symbolic calculator: (%i7) expr: (b0*sqrt(b1)*cosh(sqrt(a1*b1)*t)-a0*sqrt(a1)*sinh(sqrt(a1*b1)*t))/sqrt(b1)$ (%i8) expand(%); -- distribute the sqrt(b1) (%o8) b0*cosh(sqrt(a1*b1)*t)-a0*sqrt(a1)*sinh(sqrt(a1*b1)*t)/sqrt(b1) (%i9) %=0; -- put in the form of an equation (%o9) b0*cosh(sqrt(a1*b1)*t)-a0*sqrt(a1)*sinh(sqrt(a1*b1)*t)/sqrt(b1) = 0 (%i10) %-part(%,1,2); -- put sinh and cosh on the two sides (%o10) b0*cosh(sqrt(a1*b1)*t) = a0*sqrt(a1)*sinh(sqrt(a1*b1)*t)/sqrt(b1) (%i11) %/part(%,1); -- divide to get sinh/cosh (%o11) 1 = a0*sqrt(a1)*sinh(sqrt(a1*b1)*t)/(b0*sqrt(b1)*cosh(sqrt(a1*b1)*t)) (%i12) trigreduce(%); -- have Maxima recognize tanh (%o12) 1 = a0*sqrt(a1)*tanh(sqrt(a1*b1)*t)/(b0*sqrt(b1)) (%i13) solve(%,t); -- now solve (%o13) [t = atanh(b0*sqrt(b1)/(a0*sqrt(a1)))/sqrt(a1*b1)] You can get a fully automatic solution if you put the equation in exponential form: (%i19) solve(exponentialize(expr),t); (%o19) [t = log(-sqrt(-b0*sqrt(b1)/(b0*sqrt(b1)-a0*sqrt(a1))-a0*sqrt(a1)/(b0*sqrt(b1)-a0*sqrt(a1))))/(sqrt(a1)*sqrt(b1)), t = log(-b0*sqrt(b1)/(b0*sqrt(b1)-a0*sqrt(a1))-a0*sqrt(a1)/(b0*sqrt(b1)-a0*sqrt(a1)))/(2*sqrt(a1)*sqrt(b1))] (%i20) factor(%); (%o20) [t = log(-sqrt(-(b0*sqrt(b1)+a0*sqrt(a1))/(b0*sqrt(b1)-a0*sqrt(a1))))/(sqrt(a1)*sqrt(b1)),t = log(-(b0*sqrt(b1)+a0*sqrt(a1))/(b0*sqrt(b1)-a0*sqrt(a1)))/(2*sqrt(a1)*sqrt(b1))] But of course the result is not expressed using atanh... so let's do the substitution log(y) => atanh((y^2-1)/(y^2+1)): (%i21) subst(lambda([y],atanh((y^2-1)/(y^2+1))),'log,%o20); (%o21) [t = atanh((-(b0*sqrt(b1)+a0*sqrt(a1))/(b0*sqrt(b1)-a0*sqrt(a1))-1)/(1-(b0*sqrt(b1)+a0*sqrt(a1))/(b0*sqrt(b1)-a0*sqrt(a1))))/(sqrt(a1)*sqrt(b1)), t = atanh(((b0*sqrt(b1)+a0*sqrt(a1))^2/(b0*sqrt(b1)-a0*sqrt(a1))^2-1)/((b0*sqrt(b1)+a0*sqrt(a1))^2/(b0*sqrt(b1)-a0*sqrt(a1))^2+1))/(2*sqrt(a1)*sqrt(b1))] (%i22) radcan(%); (%o22) [t = atanh(b0*sqrt(b1)/(a0*sqrt(a1)))/(sqrt(a1)*sqrt(b1)),t = atanh(2*a0*sqrt(a1)*b0*sqrt(b1)/(b0^2*b1+a0^2*a1))/(2*sqrt(a1)*sqrt(b1))] Of course, this relies on recognizing that the result should be in terms of atanh.... -s On Tue, Aug 23, 2011 at 18:30, Louis Reinitz wrote: > atanh((b0*sqrt(b1))/(a0*sqrt(a1))) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cloos at jhcloos.com Tue Aug 23 18:48:47 2011 From: cloos at jhcloos.com (James Cloos) Date: Tue, 23 Aug 2011 19:48:47 -0400 Subject: [Maxima] Commit to branch-5.25 In-Reply-To: (Robert Dodier's message of "Tue, 23 Aug 2011 15:56:38 -0600") References: <1314134574.1791.18.camel@dieter> Message-ID: >>>>> "RD" == Robert Dodier writes: RD> That said, it would still be useful to know how to merge RD> a patch from master onto a branch. I don't know how RD> to do that. I have no idea how to do it in eclipse, but at the cli git cherry-pick is the typical magic. After a typical clone (which creates a local master branch tracking the upstream master branch), run: :; git checkout -t remotes/origin/branch-5_25 to create a local branch-5_25 branch tracking the upstream branch-5_25 branch. Then, you can use git cherry-pick to grab the commit(s) from master. You'll want to know the commit id. You can use :; git log master to look at master's history, even when another branch is checked-out. If, as an example, you wanted to cherry-pick the "Paste in info about 5.25 changes." commit, 124f7c2f4aaf, you could then run: :; git cherry-pick 124f7c2f4aaf and that commit will have been added to your local tracking branch. :; git push should then push that upstream. And :; git checkout master gets your repo back to master. Now that you have a local branch tracking branch-5_25, you just need: :; git checkout branch-5_25 to get back to it. Cherry-pick has several options. Either of: :; git help cherry-pick :; man git-cherry-pick will show the man page. -JimC -- James Cloos OpenPGP: 1024D/ED7DAEA6 From andre.maute at gmx.de Wed Aug 24 08:57:35 2011 From: andre.maute at gmx.de (andre maute) Date: Wed, 24 Aug 2011 15:57:35 +0200 Subject: [Maxima] unexpected behavior of simplify_sum Message-ID: <4E55034F.9080600@gmx.de> Hi, I have the following test, with a sum depending on b2. For general b2 simplify_sum gives an incorrect value. Andre ------- test-simplify_sum-1.max ----------- display2d : false; F(d,a1,k1,a2,k2,b2,l2) := block( [res:1], res : res/(b2-l2)!, res : res/l2!, res : res*(-1)^l2, res : res*(b2+l2+d-2)!, res : res/(l2+d-2)!, res : res*(k2+l2+d-2)!, res : res/(k2+l2+d-1+k1)!, return(res) ); load("simplify_sum"); s:sum(F(d,1,1,1,1,b2,l2),l2,0,b2); h : simplify_sum(s); h : factor(minfactorial(h)); s:sum(F(d,1,1,1,1,2,l2),l2,0,2); h : simplify_sum(s); h : factor(minfactorial(h)); ------- test-simplify_sum-1.max ----------- ------- test-simplify_sum-1.txt ----------- Maxima 5.19.2 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(test-simplify_sum-1.max) batching /home/user/progs/test-simplify_sum-1.max (%i2) display2d : false (%o2) false (%i3) F(d,a1,k1,a2,k2,b2,l2):=block([res:1],res:res/(b2-l2)!,res:res/l2!, res:res*(-1)^l2,res:res*(-2+d+l2+b2)!,res:res/(-2+d+l2)!, res:res*(-2+d+l2+k2)!,res:res/(k1-1+d+l2+k2)!,return(res)) (%o3) F(d,a1,k1,a2,k2,b2,l2):=block([res:1],res:res/(b2-l2)!,res:res/l2!, res:res*(-1)^l2,res:res*(-2+d+l2+b2)!,res:res/(-2+d+l2)!, res:res*(-2+d+l2+k2)!,res:res/(k1-1+d+l2+k2)!,return(res)) (%i4) load("simplify_sum") (%o4) "/home/user/opt/maxima/share/maxima/5.19.2/share/contrib/solve_rec/simplify_sum.mac" (%i5) s:sum(F(d,1,1,1,1,b2,l2),l2,0,b2) (%o5) 'sum((-1)^l2*(l2+d-1)!*(l2+d+b2-2)!/((b2-l2)!*l2!*(l2+d-2)!*(l2+d+1)!), l2,0,b2) (%i6) h:simplify_sum(s) (%o6) 0 (%i7) h:factor(minfactorial(h)) (%o7) 0 (%i8) s:sum(F(d,1,1,1,1,2,l2),l2,0,2) (%o8) (d+1)!*(d+2)!/(2*d!*(d+3)!)-d!*(d+1)!/((d-1)!*(d+2)!) +(d-1)!*d!/(2*(d-2)!*(d+1)!) (%i9) h:simplify_sum(s) (%o9) (d+1)!*(d+2)!/(2*d!*(d+3)!)-d!*(d+1)!/((d-1)!*(d+2)!) +(d-1)!*d!/(2*(d-2)!*(d+1)!) (%i10) h:factor(minfactorial(h)) (%o10) -2/((d+1)*(d+2)*(d+3)) (%o10) "/home/user/progs/test-simplify_sum-1.max" ------- test-simplify_sum-1.txt ----------- From macrakis at alum.mit.edu Wed Aug 24 11:05:41 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 24 Aug 2011 12:05:41 -0400 Subject: [Maxima] MARGS, GREAT, MRAT => trouble In-Reply-To: References: Message-ID: This doesn't cause a problem in Maxima 5.23.2 GCL 2.6.8. What version are you running? I wonder what has changed between the versions. I suspect that the problem in your example below is that you are calling (simplus x 1 t) and not (simplus x 1 nil). When the third arg to simplus is T, it means that all the arguments of mplus have already been simplified, which is not the case here. Given that the precondition is violated, I wouldn't be surprised that great was called on something it shouldn't be called on. -s On Tue, Aug 23, 2011 at 01:30, Robert Dodier wrote: > Hi, > > I've found that this Lisp program: > > (defparameter x '((mplus) ((foo) ((mrat simp ($c) (#:c1635)) (#:c1635 > 1 -1) . 1) $a) > ((foo) ((mrat simp nil nil) 1 . 1) ((mtimes simp) $a $b)))) > (simplus x 1 t) > > triggers an error: CAR: #:C1635 is not a list > > I see that GREAT uses MARGS to decompose the MRAT expressions, > which leads to the error because MARGS is naive, it just returns > the CDR of the expression. > > How should GREAT and/or MARGS handle MRAT? > The simplest thing to do is to reformat the arguments of GREAT > but I suspect that's too expensive. > > I guess that whatever we come up with should be applied to > other expressions with special representations. > > Thanks for any light you can shed on this. > > Robert Dodier > > > PS. I discovered the error like this: > > load (ezunits); > x : (rat(1) ` a) * (1 ` b + c); > expand (x); > => "not a list" error > > When the error is triggered, * has been distributed over + > and SIMPLUS is sorting the arguments, hence the call to GREAT. > _______________________________________________ > 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 drdieterkaiser at web.de Wed Aug 24 17:52:04 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 25 Aug 2011 00:52:04 +0200 Subject: [Maxima] Commit to branch-5.25 In-Reply-To: References: <1314134574.1791.18.camel@dieter> Message-ID: <1314226324.1799.9.camel@dieter> Am Dienstag, den 23.08.2011, 19:48 -0400 schrieb James Cloos: > >>>>> "RD" == Robert Dodier writes: > > RD> That said, it would still be useful to know how to merge > RD> a patch from master onto a branch. I don't know how > RD> to do that. > > I have no idea how to do it in eclipse, but at the cli git cherry-pick > is the typical magic. > > After a typical clone (which creates a local master branch tracking the > upstream master branch), run: > > :; git checkout -t remotes/origin/branch-5_25 > > to create a local branch-5_25 branch tracking the upstream branch-5_25 > branch. > > Then, you can use git cherry-pick to grab the commit(s) from master. > > You'll want to know the commit id. You can use > > :; git log master > > to look at master's history, even when another branch is checked-out. > > If, as an example, you wanted to cherry-pick the "Paste in info about > 5.25 changes." commit, 124f7c2f4aaf, you could then run: > > :; git cherry-pick 124f7c2f4aaf > > and that commit will have been added to your local tracking branch. > > :; git push > > should then push that upstream. And > > :; git checkout master > > gets your repo back to master. > > Now that you have a local branch tracking branch-5_25, you just need: > > :; git checkout branch-5_25 > > to get back to it. > > Cherry-pick has several options. Either of: > > :; git help cherry-pick > :; man git-cherry-pick > > will show the man page. Thank you very much for your help. It worked. I have done a cherry-pick and I have committed the change to branch-5.25. I have not committed the additional testsuite examples. But the examples work as expected. Dieter Kaiser From robert.dodier at gmail.com Wed Aug 24 18:25:23 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 24 Aug 2011 17:25:23 -0600 Subject: [Maxima] MARGS, GREAT, MRAT => trouble In-Reply-To: References: Message-ID: GCL returns NIL for list operations on non-lists instead of triggering an error. That may be controlled by the compiler safety setting or something like that. Anyway, I get the error for versions of Maxima from 5.10 through the present with Lisp varieties other than GCL. About the T argument, I just copied what I saw in a trace. I will try it again with NIL. best, Robert Dodier On 8/24/11, Stavros Macrakis wrote: > This doesn't cause a problem in Maxima 5.23.2 GCL 2.6.8. What version are > you running? I wonder what has changed between the versions. > > I suspect that the problem in your example below is that you are calling > (simplus x 1 t) and not (simplus x 1 nil). When the third arg to simplus is > T, it means that all the arguments of mplus have already been simplified, > which is not the case here. Given that the precondition is violated, I > wouldn't be surprised that great was called on something it shouldn't be > called on. > > -s > > > > On Tue, Aug 23, 2011 at 01:30, Robert Dodier wrote: > >> Hi, >> >> I've found that this Lisp program: >> >> (defparameter x '((mplus) ((foo) ((mrat simp ($c) (#:c1635)) (#:c1635 >> 1 -1) . 1) $a) >> ((foo) ((mrat simp nil nil) 1 . 1) ((mtimes simp) $a $b)))) >> (simplus x 1 t) >> >> triggers an error: CAR: #:C1635 is not a list >> >> I see that GREAT uses MARGS to decompose the MRAT expressions, >> which leads to the error because MARGS is naive, it just returns >> the CDR of the expression. >> >> How should GREAT and/or MARGS handle MRAT? >> The simplest thing to do is to reformat the arguments of GREAT >> but I suspect that's too expensive. >> >> I guess that whatever we come up with should be applied to >> other expressions with special representations. >> >> Thanks for any light you can shed on this. >> >> Robert Dodier >> >> >> PS. I discovered the error like this: >> >> load (ezunits); >> x : (rat(1) ` a) * (1 ` b + c); >> expand (x); >> => "not a list" error >> >> When the error is triggered, * has been distributed over + >> and SIMPLUS is sorting the arguments, hence the call to GREAT. >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > From robert.dodier at gmail.com Wed Aug 24 18:27:51 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 24 Aug 2011 17:27:51 -0600 Subject: [Maxima] Commit to branch-5.25 In-Reply-To: <1314226324.1799.9.camel@dieter> References: <1314134574.1791.18.camel@dieter> <1314226324.1799.9.camel@dieter> Message-ID: OK, I will create 5.25.1 this weekend. Thanks for your work on this topic. best, Robert Dodier On 8/24/11, Dieter Kaiser wrote: > Am Dienstag, den 23.08.2011, 19:48 -0400 schrieb James Cloos: >> >>>>> "RD" == Robert Dodier writes: >> >> RD> That said, it would still be useful to know how to merge >> RD> a patch from master onto a branch. I don't know how >> RD> to do that. >> >> I have no idea how to do it in eclipse, but at the cli git cherry-pick >> is the typical magic. >> >> After a typical clone (which creates a local master branch tracking the >> upstream master branch), run: >> >> :; git checkout -t remotes/origin/branch-5_25 >> >> to create a local branch-5_25 branch tracking the upstream branch-5_25 >> branch. >> >> Then, you can use git cherry-pick to grab the commit(s) from master. >> >> You'll want to know the commit id. You can use >> >> :; git log master >> >> to look at master's history, even when another branch is checked-out. >> >> If, as an example, you wanted to cherry-pick the "Paste in info about >> 5.25 changes." commit, 124f7c2f4aaf, you could then run: >> >> :; git cherry-pick 124f7c2f4aaf >> >> and that commit will have been added to your local tracking branch. >> >> :; git push >> >> should then push that upstream. And >> >> :; git checkout master >> >> gets your repo back to master. >> >> Now that you have a local branch tracking branch-5_25, you just need: >> >> :; git checkout branch-5_25 >> >> to get back to it. >> >> Cherry-pick has several options. Either of: >> >> :; git help cherry-pick >> :; man git-cherry-pick >> >> will show the man page. > > Thank you very much for your help. > It worked. I have done a cherry-pick and I have committed the change to > branch-5.25. I have not committed the additional testsuite examples. But > the examples work as expected. > > Dieter Kaiser > > > From hbaker1 at pipeline.com Wed Aug 24 19:36:03 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Wed, 24 Aug 2011 17:36:03 -0700 Subject: [Maxima] MARGS, GREAT, MRAT => trouble In-Reply-To: References: Message-ID: This may have been done by the GCL developers _precisely to make Maxima run!_ They were probably not in a good position to fix Maxima itself, so they "fixed" Lisp instead. I recall making Maxima work in an early Common Lisp (KCL) & running into all kinds of strange behavior that it would have taken months to track down; it was just easier to allow the Common Lisp to look a little more like Maclisp. At 04:25 PM 8/24/2011, Robert Dodier wrote: >GCL returns NIL for list operations on non-lists instead of >triggering an error. That may be controlled by the compiler safety setting or >something like that. Anyway, I get the error for versions of >Maxima from 5.10 through the present with Lisp varieties other than GCL. > >About the T argument, I just copied what I saw in a trace. >I will try it again with NIL. > >best, Robert Dodier > >On 8/24/11, Stavros Macrakis wrote: >> This doesn't cause a problem in Maxima 5.23.2 GCL 2.6.8. What version are >> you running? I wonder what has changed between the versions. >> >> I suspect that the problem in your example below is that you are calling >> (simplus x 1 t) and not (simplus x 1 nil). When the third arg to simplus is >> T, it means that all the arguments of mplus have already been simplified, >> which is not the case here. Given that the precondition is violated, I >> wouldn't be surprised that great was called on something it shouldn't be >> called on. >> >> -s >> >> On Tue, Aug 23, 2011 at 01:30, Robert Dodier wrote: >> >>> Hi, >>> >>> I've found that this Lisp program: >>> >>> (defparameter x '((mplus) ((foo) ((mrat simp ($c) (#:c1635)) (#:c1635 >>> 1 -1) . 1) $a) >>> ((foo) ((mrat simp nil nil) 1 . 1) ((mtimes simp) $a $b)))) >>> (simplus x 1 t) >>> >>> triggers an error: CAR: #:C1635 is not a list >>> >>> I see that GREAT uses MARGS to decompose the MRAT expressions, >>> which leads to the error because MARGS is naive, it just returns >>> the CDR of the expression. >>> >>> How should GREAT and/or MARGS handle MRAT? >>> The simplest thing to do is to reformat the arguments of GREAT >>> but I suspect that's too expensive. >>> >>> I guess that whatever we come up with should be applied to >>> other expressions with special representations. >>> >>> Thanks for any light you can shed on this. >>> >>> Robert Dodier >>> >>> PS. I discovered the error like this: >>> >>> load (ezunits); >>> x : (rat(1) ` a) * (1 ` b + c); >>> expand (x); >>> => "not a list" error >>> >>> When the error is triggered, * has been distributed over + >>> and SIMPLUS is sorting the arguments, hence the call to GREAT. From hbaker1 at pipeline.com Wed Aug 24 19:37:32 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Wed, 24 Aug 2011 17:37:32 -0700 Subject: [Maxima] 64-bit Maxima/Windows7 ? Message-ID: I never got an answer to this question. Is there a Maxima that runs on top of a 64-bit Common Lisp on Windows 7 ? >Date: Tue, 23 Aug 2011 14:12:08 -0700 >To: maxima at math.utexas.edu >From: Henry Baker >Subject: 64-bit Maxima/Windows7 ? > >Is there a 64-bit Maxima on Windows7 that can take advantage of 8 GBytes of real memory? From toy.raymond at gmail.com Wed Aug 24 19:49:24 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 24 Aug 2011 17:49:24 -0700 Subject: [Maxima] 64-bit Maxima/Windows7 ? In-Reply-To: References: Message-ID: On Wed, Aug 24, 2011 at 5:37 PM, Henry Baker wrote: > I never got an answer to this question. Is there a Maxima that runs on top > of a 64-bit Common Lisp > on Windows 7 ? > > I have no experience with this, but I think clozure cl has a 64-bit lisp for windows. I do know that ccl will run maxima. (At least it runs fine on Mac OS X.) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Wed Aug 24 20:54:04 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 24 Aug 2011 20:54:04 -0500 Subject: [Maxima] 64-bit Maxima/Windows7 ? In-Reply-To: References: , Message-ID: I have built Maxima using 64 bit Clozure CL. Command line Maxima runs OK. I have not built Xmaxima, wxMaxima, or an installer for 64 bit Maxima (last time I tried, I failed). --Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: Henry Baker >From: Raymond Toy >Sent by: maxima-bounces at math.utexas.edu >Date: 08/24/2011 07:48PM >Cc: Maxima at math.utexas.edu >Subject: Re: [Maxima] 64-bit Maxima/Windows7 ? > > > >On Wed, Aug 24, 2011 at 5:37 PM, Henry Baker wrote: > I never got an answer to this question. ?Is there a Maxima that runs on >top of a 64-bit Common Lisp > on Windows 7 ? > >I have no experience with this, but I think clozure cl has a 64-bit lisp >for windows.? I do know that ccl will run maxima.? (At least it runs fine >on Mac OS X.) > >Ray >? > _______________________________________________ Maxima mailing list >Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Wed Aug 24 23:30:03 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 25 Aug 2011 00:30:03 -0400 Subject: [Maxima] diracdelta() In-Reply-To: References: Message-ID: <61B1B2B18CD348708F96756533A353B6@RichsLaptop> I am thinking about renaming the pw.mac functional pwdelta() to diracdelta() since for all practical purposes they are the same. Then diff(diracdelta(x),x) would also be renamed diff_diracdelta(1,x) and diff(diff(diracdelta(n, x), x) would be diff_diracdelta(n+1, x), etc... Are there any objections? Rich From biomates at telefonica.net Thu Aug 25 02:35:10 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 25 Aug 2011 03:35:10 -0400 Subject: [Maxima] Commit to branch-5.25 In-Reply-To: References: <1314134574.1791.18.camel@dieter> <1314226324.1799.9.camel@dieter> Message-ID: <4E55FB2E.70501@telefonica.net> On 08/24/2011 07:27 PM, Robert Dodier wrote: > OK, I will create 5.25.1 this weekend. I've also commited some fixes to this branch, since some texi files were not copied into the tarball. I'd like to thank James Cloos, too. -- Mario From biomates at telefonica.net Thu Aug 25 02:40:14 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 25 Aug 2011 03:40:14 -0400 Subject: [Maxima] German documentation Message-ID: <4E55FC5E.5010808@telefonica.net> Hello, The German documentation, translated by Dieter Keiser, is now available from Maxima's web site, both in html and pdf formats: http://maxima.sourceforge.net/docs/manual/de/maxima.html http://maxima.sourceforge.net/docs/manual/de/maxima.pdf -- Mario From ichikawa.yuji at gmail.com Thu Aug 25 03:22:58 2011 From: ichikawa.yuji at gmail.com (ICHIKAWA, Yuji) Date: Thu, 25 Aug 2011 17:22:58 +0900 Subject: [Maxima] German documentation In-Reply-To: <4E55FC5E.5010808@telefonica.net> References: <4E55FC5E.5010808@telefonica.net> Message-ID: Hello, I translated Maxima manual into Japanese. Can I announce the URL? http://www.h3.dion.ne.jp/~y.ich/Maxima/maxima.html Regards, -- ICHIKAWA, Yuji On 2011/08/25, at 16:40, Mario Rodriguez wrote: > Hello, > > The German documentation, translated by Dieter Keiser, is now available from Maxima's web site, both in html and pdf formats: > > http://maxima.sourceforge.net/docs/manual/de/maxima.html > > http://maxima.sourceforge.net/docs/manual/de/maxima.pdf > > -- > 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: From derka.ladislav at gmail.com Thu Aug 25 09:41:56 2011 From: derka.ladislav at gmail.com (Ladislav Derka) Date: Thu, 25 Aug 2011 16:41:56 +0200 Subject: [Maxima] error function lsquares Message-ID: Variable "i" disable function lsquares. This defect I have long sought. I used only the commands for repeating mistakes 1. This is well: kill(all); load(lsquares); M: matrix([1,2],[2,4],[3,9])$ eq: y = A + B*x$ lsquares_estimates(M,[y,x],eq,[A,B]); values; (%o4) [[A=17/26,B=7/26]] (%o5) [M,eq,solutions] 2. This is wrong: M: matrix([1,2],[2,4],[3,9])$ eq: y = A + B*x$ i:0$ lsquares_estimates(M,[y,x],eq,[A,B]); values; apply: no such "matrix" element: [0,1]#0: lsquares_estimates_exact(mse=(-'data[0,2]*B-A+'data[0,1])^2,parameters=[A,B])#1: lsquares_estimates(data=matrix([1,2],[2,4],[3,9]),variables=[y,x],equation=y = x*B+A,parameters=[A,B],optional_args=[])(lsquares.mac line 245) -- an error. To debug this try: debugmode(true); (%o10) [M,eq,solutions,i] Derka -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Thu Aug 25 09:59:34 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 25 Aug 2011 08:59:34 -0600 Subject: [Maxima] MARGS, GREAT, MRAT => trouble In-Reply-To: References: Message-ID: On 8/24/11, Stavros Macrakis wrote: > I suspect that the problem in your example below is that you are calling > (simplus x 1 t) and not (simplus x 1 nil). Thanks for the hint. That does make a difference; the SIMPLUS call succeeds when the 3rd argument is NIL. While investigating that, I found that rules generated by tellsimpafter can prevent built-in simplifications from being applied. I think I have a patch for that, which enables the example expand((rat(1) ` a)*(1 ` b + c)) to succeed. I am still kind of puzzled by GREAT. Unless MRAT is simplified away, it causes an error in GREAT. Shouldn't GREAT be able to compare any Maxima expressions? I imagine there would be the same problem with other special representations, e.g. Taylor series. Are special representations always simplified away? That seems to take away their specialness. best, Robert Dodier From macrakis at alum.mit.edu Thu Aug 25 10:24:30 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 25 Aug 2011 11:24:30 -0400 Subject: [Maxima] MARGS, GREAT, MRAT => trouble In-Reply-To: References: Message-ID: On Thu, Aug 25, 2011 at 10:59, Robert Dodier wrote: > On 8/24/11, Stavros Macrakis wrote: > > > I suspect that the problem in your example below is that you are calling > > (simplus x 1 t) and not (simplus x 1 nil). > ... > I am still kind of puzzled by GREAT. Unless MRAT is simplified away, > it causes an error in GREAT. Shouldn't GREAT be able to compare > any Maxima expressions? GREAT is only designed to operate correctly on correctly simplified expressions in general representation; even (great ($rat 1) ($rat 1)) core dumps. Its primary use is in canonicalizing the order of arguments to commutative operators like MPLUS. I imagine there would be the same problem with other special > representations, e.g. Taylor series. > Are special representations always simplified away? That seems to take away > their specialness. > Since GREAT operates on the syntactic form of expressions, it would be hard to make it work consistently on objects in special representations without ratdisrep'ing them, which is what (e.g.) the set package has to do. Consider for example rat(x,x) vs. rat(x,y), which are identical in general representation, but different as CREs. You could imagine some sort of 'lazy' ratdisrep that only disrep's enough to compare, but that seems like unnecessary complication. -s > -------------- next part -------------- An HTML attachment was scrubbed... URL: From piminusmeson at bk.ru Thu Aug 25 12:05:22 2011 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Thu, 25 Aug 2011 21:05:22 +0400 Subject: [Maxima] integration question Message-ID: <4E5680D2.9000203@bk.ru> Hello, my question is about symbolic integration. Can maxima solve the integral if the output can be given it terms of special functions? May be some additional package must be used for it? For expample maxima can not give answer for this integral: (%i1) integrate(exp(a*sin(phi)),phi,0,2*%pi); 2 %pi / [ a sin(phi) (%o1) I %e dphi ] / 0 (%i2) Mathematica can solve it: integrate(exp(a*sin(phi)),phi,0,2*Pi) output: 2 Pi BesselI[0, a] -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Aug 25 13:55:25 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 25 Aug 2011 14:55:25 -0400 Subject: [Maxima] What factor does to unknown functions' arguments Message-ID: factor( f(x-1/x) ) => f( (x^2-1)/x) That is, factor calls sratsimp (with ratfac=T) on the arguments of unknown functions, even though it doesn't actually factor them. This seems peculiar. Either it should map over all the arguments of f, giving f((x-1)*(x+1)/x), or it should leave them completely untouched, returning f(x-1/x). Is there any disagreement about this? -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Aug 25 13:58:57 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 25 Aug 2011 14:58:57 -0400 Subject: [Maxima] What factor does to unknown functions' arguments In-Reply-To: References: Message-ID: PS Thanks to Barton for looking at this with me. On Thu, Aug 25, 2011 at 14:55, Stavros Macrakis wrote: > factor( f(x-1/x) ) => f( (x^2-1)/x) > > That is, factor calls sratsimp (with ratfac=T) on the arguments of unknown > functions, even though it doesn't actually factor them. > > This seems peculiar. Either it should map over all the arguments of f, > giving f((x-1)*(x+1)/x), or it should leave them completely untouched, > returning f(x-1/x). > > Is there any disagreement about this? > > -s > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Thu Aug 25 15:06:46 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 25 Aug 2011 13:06:46 -0700 Subject: [Maxima] What factor does to unknown functions' arguments In-Reply-To: References: <4E56A4D1.5090103@eecs.berkeley.edu> Message-ID: <4E56AB56.3080806@eecs.berkeley.edu> On 8/25/2011 12:48 PM, Stavros Macrakis wrote: > It ratsimps the argument then tries to factor. If it fails to factor, > it just returns the ratsimped version. Consider (x-1)/(x-1). You > factor it and get 1. > > My example shows that this is not true. factor( f(x-1/x) ) => f( > (x^2-1)/x) and not f((x-1)*(x+1)/x). It just sratsimp's with > ratfac=T. As for (x-1)/(x-1), the general simplifier simplifies that > to 1. ok, try factor(f ((x^2-1)/(x-1)); I am happier with f(x+1) than leaving it untouched. or factor ( f(x^2-1)/(x-1)) *f(x+1) ) ?? There are lots of other things that you could return from factor. e.g. factor(x^2+1) -> (x-%i)*(x+%i) as is done by gfactor. But there are lots of algebraic extensions. as well as other transformations that one could guess at from context.. e.g. trig.. cos(2*x)^2 trigreduce(%); factor(%) ??? > > By the way, this is more general than just unknown functions as I said > in my original mail. Same thing happens with log or for that matter > the exponent in mexpt, e.g. factor(2^(x^2-1)) => 2^(x^2-1), not > 2^((x-1)*(x+1)). > > -s > > On Thu, Aug 25, 2011 at 15:38, Richard Fateman > > wrote: > > On 8/25/2011 11:55 AM, Stavros Macrakis wrote: >> factor( f(x-1/x) ) => f( (x^2-1)/x) >> >> That is, factor calls sratsimp (with ratfac=T) on the arguments >> of unknown functions, even though it doesn't actually factor them. >> >> This seems peculiar. Either it should map over all the arguments >> of f, giving f((x-1)*(x+1)/x), or it should leave them completely >> untouched, returning f(x-1/x). >> >> Is there any disagreement about this? >> >> -s >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > It ratsimps the argument then tries to factor. If it fails to > factor, it just returns the ratsimped version. > Consider (x-1)/(x-1). You factor it and get 1. > > That's my guess. > RJF > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Aug 25 15:50:56 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 25 Aug 2011 16:50:56 -0400 Subject: [Maxima] What factor does to unknown functions' arguments In-Reply-To: <4E56AB56.3080806@eecs.berkeley.edu> References: <4E56A4D1.5090103@eecs.berkeley.edu> <4E56AB56.3080806@eecs.berkeley.edu> Message-ID: It seems arbitrary that factor( f ( ) ) = factor( f( ratsimp() ) ) , ratfac:true rather than either f() or f(factor()). Why are you happier with factor(f ((x^2-1)/(x-1)) => f(x+1) ? Most other functions don't perform simplifications like this if they can't do anything useful with f. Compare rat, limit, partfrac, etc. etc. -s On Thu, Aug 25, 2011 at 16:06, Richard Fateman wrote: > On 8/25/2011 12:48 PM, Stavros Macrakis wrote: > > It ratsimps the argument then tries to factor. If it fails to factor, it > just returns the ratsimped version. Consider (x-1)/(x-1). You factor it and > get 1. > > My example shows that this is not true. factor( f(x-1/x) ) => f( > (x^2-1)/x) and not f((x-1)*(x+1)/x). It just sratsimp's with ratfac=T. As > for (x-1)/(x-1), the general simplifier simplifies that to 1. > > > ok, try factor(f ((x^2-1)/(x-1)); > > I am happier with f(x+1) than leaving it untouched. > > or factor ( f(x^2-1)/(x-1)) *f(x+1) ) ?? > > There are lots of other things that you could return from factor. e.g. > factor(x^2+1) -> (x-%i)*(x+%i) as is done by gfactor. But there are > lots of algebraic extensions. > > as well as other transformations that one could guess at from context.. > e.g. trig.. > > cos(2*x)^2 > trigreduce(%); > > factor(%) ??? > > > > By the way, this is more general than just unknown functions as I said in > my original mail. Same thing happens with log or for that matter the > exponent in mexpt, e.g. factor(2^(x^2-1)) => 2^(x^2-1), not 2^((x-1)*(x+1)). > > > -s > > On Thu, Aug 25, 2011 at 15:38, Richard Fateman wrote: > >> On 8/25/2011 11:55 AM, Stavros Macrakis wrote: >> >> factor( f(x-1/x) ) => f( (x^2-1)/x) >> >> That is, factor calls sratsimp (with ratfac=T) on the arguments of >> unknown functions, even though it doesn't actually factor them. >> >> This seems peculiar. Either it should map over all the arguments of f, >> giving f((x-1)*(x+1)/x), or it should leave them completely untouched, >> returning f(x-1/x). >> >> Is there any disagreement about this? >> >> -s >> >> >> _______________________________________________ >> Maxima mailing listMaxima at math.utexas.eduhttp://www.math.utexas.edu/mailman/listinfo/maxima >> >> It ratsimps the argument then tries to factor. If it fails to factor, >> it just returns the ratsimped version. >> Consider (x-1)/(x-1). You factor it and get 1. >> >> That's my guess. >> RJF >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Fri Aug 26 01:19:54 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 26 Aug 2011 02:19:54 -0400 Subject: [Maxima] German documentation In-Reply-To: References: <4E55FC5E.5010808@telefonica.net> Message-ID: <4E573B0A.9080706@telefonica.net> On 08/25/2011 04:22 AM, ICHIKAWA, Yuji wrote: > Hello, > > I translated Maxima manual into Japanese. > Can I announce the URL? > http://www.h3.dion.ne.jp/~y.ich/Maxima/maxima.html > > > Regards, > -- > ICHIKAWA, Yuji Hello Yuji, This is interesting. If you want, we can allocate your texi files in our repository. You can send me your translations. Is there a pdf version? Thanks. -- Mario From dlakelan at street-artists.org Fri Aug 26 16:55:01 2011 From: dlakelan at street-artists.org (dlakelan) Date: Fri, 26 Aug 2011 14:55:01 -0700 Subject: [Maxima] How to help maxima get equation grouped nicely In-Reply-To: References: <4E4FCCB7.8070306@street-artists.org> <4E4FDF08.7020005@street-artists.org> <4E515215.5090404@street-artists.org> Message-ID: <4E581635.7080809@street-artists.org> On 08/21/2011 12:04 PM, Stavros Macrakis wrote: > You can use "box" in Maxima to 'protect' things from default > simplifications. But then you need to remove the box before calling tex, > maybe something like this: > > expr: box(a/b)*c$ > block([simp:false],tex(rembox(expr))) I tried something like this, but I have a function which uses tex to print out stuff to a file. With simp:false rather than calling this function I get the noun form of the function call. weird that it does this with my user defined function but not with say tex or rembox. From macrakis at alum.mit.edu Fri Aug 26 17:00:10 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 26 Aug 2011 18:00:10 -0400 Subject: [Maxima] How to help maxima get equation grouped nicely In-Reply-To: <4E581635.7080809@street-artists.org> References: <4E4FCCB7.8070306@street-artists.org> <4E4FDF08.7020005@street-artists.org> <4E515215.5090404@street-artists.org> <4E581635.7080809@street-artists.org> Message-ID: I don't understand. Can you post minimal code to reproduce your problem? Thanks, -s On Fri, Aug 26, 2011 at 17:55, dlakelan wrote: > On 08/21/2011 12:04 PM, Stavros Macrakis wrote: > > You can use "box" in Maxima to 'protect' things from default > > simplifications. But then you need to remove the box before calling tex, > > maybe something like this: > > > > expr: box(a/b)*c$ > > block([simp:false],tex(rembox(expr))) > > I tried something like this, but I have a function which uses tex to > print out stuff to a file. With simp:false rather than calling this > function I get the noun form of the function call. weird that it does > this with my user defined function but not with say tex or rembox. > > > _______________________________________________ > 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 Fri Aug 26 17:05:06 2011 From: dlakelan at street-artists.org (dlakelan) Date: Fri, 26 Aug 2011 15:05:06 -0700 Subject: [Maxima] How to help maxima get equation grouped nicely In-Reply-To: <4E581635.7080809@street-artists.org> References: <4E4FCCB7.8070306@street-artists.org> <4E4FDF08.7020005@street-artists.org> <4E515215.5090404@street-artists.org> <4E581635.7080809@street-artists.org> Message-ID: <4E581892.8070909@street-artists.org> On 08/26/2011 02:55 PM, dlakelan wrote: > On 08/21/2011 12:04 PM, Stavros Macrakis wrote: >> You can use "box" in Maxima to 'protect' things from default >> simplifications. But then you need to remove the box before calling tex, >> maybe something like this: >> >> expr: box(a/b)*c$ >> block([simp:false],tex(rembox(expr))) > > I tried something like this, but I have a function which uses tex to > print out stuff to a file. With simp:false rather than calling this > function I get the noun form of the function call. weird that it does > this with my user defined function but not with say tex or rembox. Whoops! I actually was generating an error due to a bug. Now that I fixed it your solution worked, more or less. For those reading the archive, here's what I did. First, I took the right hand side of my equation and I used "factorout" to factor out all the variables not included in the coefficient portion. So that took my equation and made it look like: numerator of A * (some stuff)/ denominator of A + numerator of B * someotherstuff / denominator of B then I loaded "disol" and asked disolate to isolate the variables that make up A and B (in this case e and e0). This gave me something like A * %t123 + B * %t124 then I grabbed the coefficients of each %t variable and boxed them up. so that I had box(A) * %t123 + box(B) * %t124 where in fact A and B were rational expressions of e and e0 then when I output my equation via tex, I turned off simplification as you described and rembox and that gave me more or less what I want. Thanks! From ladida.vllt at gmail.com Mon Aug 22 12:05:58 2011 From: ladida.vllt at gmail.com (ladida vllt) Date: Mon, 22 Aug 2011 19:05:58 +0200 Subject: [Maxima] slow file loading Message-ID: i have a huge matrix (saved in a file), and i want to load this file, but with the standard load-command this takes nearly 10 min; if i load it from a program (C#) it only takes a few seconds. how can i make the load-command faster? -------------- next part -------------- An HTML attachment was scrubbed... URL: From henryhom at live.cn Tue Aug 23 21:54:52 2011 From: henryhom at live.cn (-Henry Hom) Date: Wed, 24 Aug 2011 02:54:52 +0000 Subject: [Maxima] Maxima Help -- Command Prompt Input & Output, not GUI interface Message-ID: How can I use Maxima under *Command Prompt* but *not in GUI interface*??I'm going to write a nicer and more helpful GUI interface that uses *free language*.First the user inputs?"solve x^2+5x+6=0 for x"Then my program translates "solve x^2+5x+6=0 for x" to?"solve([x^2+5*x+6=0],[x])"Now I have a big problem. how can I use Maxima in Command Prompt? like:maxima solve([x^2+5x+6=0],[x]) > output.tmpThen Maxima will output the result to output.tmpThen I can load output.tmp.?If you know how to?use Maxima in Command Prompt, please send a mail to henryhom(at)live.cn . ? ? ? ? ? ? ? ? ? ? Thanks a lot? ? ? ? ? ? ? ? ? ?Henry Hom (China) From vladimir.voloshinov at gmail.com Fri Aug 26 12:03:05 2011 From: vladimir.voloshinov at gmail.com (vladimir voloshinov) Date: Fri, 26 Aug 2011 21:03:05 +0400 Subject: [Maxima] Defects in lu_factor() for degenerated matrices Message-ID: We have a long success story of Maxima usage. But recently some unpleasant drawback had been found. Current implementation of LU decomposition, lu_factor() function, presented in linearalgebra pack has a number of defects revealing for degenerated matrices. Can somebody help, recommend a workaround or some other implementation of lu_factor? Take for example, a simplest 2x2 matrix: M10_00:matrix([1,0],[0,0]); [ 1 0 ] [ 0 0 ] and a permutation one: Q:matrix([0,1],[1,0]); [ 0 1 ] [ 1 0 ] Matrix M10_00 is factored correctly [A:M10_00, get_lu_factors(lu_factor(A))]; [ 1 0 ] [ 1 0 ] [ 1 0 ] [ 1 0 ] [ 0 0 ], [ 0 1 ] [ 0 1 ] [ 0 0 ] But permuted matrix: M10_00.Q; [ 0 1 ] [ 0 0 ] causes an error in lu_factor(): [A:M10_00.Q, get_lu_factors(lu_factor(A))]; Unable to compute the LU factorization -- an error. To debug this try: debugmode(true); Obviously, that the reason is that %MAXIMA_HOME%\share\maxima\5.24.0\share\linearalgebra\lu.lisp does not implement "full pivoting" ("true" LU-factoring) when M is represented as M=P.L.U.Q, where P and Q are permutation matrices... More over, Q.M10_00 is factored: [A:Q.M10_00,get_lu_factors(lu_factor(A))]; [ 0 0 ] [ 0 1 ] [ 1 0 ] [ 1 0 ] [ 1 0 ], [ 1 0 ] [ 0 1 ] [ 0 0 ] but 3x3 matrix with two leading zero-rows is not (?!): M000_000_100:matrix([0,0,0],[0,0,0],[1,0,0]); [A:M000_000_100,get_lu_factors(lu_factor(A))]; Unable to compute the LU factorization -- an error. To debug this try: debugmode(true); We'll be thankful for any help! Regards, -- Vladimir V. Voloshinov, Center of Grid-technologies & Distributed Computing, http://dcs.isa.ru, Institute for System Analysis Russ. Acad. Sci., http://www.isa.ru, web: http://dcs.isa.ru/wiki/staff/vladimirv From volkervannek at googlemail.com Sat Aug 27 10:15:45 2011 From: volkervannek at googlemail.com (Volker van Nek) Date: Sat, 27 Aug 2011 17:15:45 +0200 Subject: [Maxima] Maxima Help -- Command Prompt Input & Output, not GUI interface In-Reply-To: References: Message-ID: Henry, you don't need a file to communicate with Maxima. E.g. in Java you can create a Process-Object executing Maxima. The exec-command is just 'maxima' in Linux and 'path-to\\maxima.bat' in Windows. You get the Input- and OutputStream of this Process-Object and communicate with Maxima. Another way is to create a SocketServer and to connect Maxima (as a client) to this server. Command syntax: 'maxima -s PORT' resp. 'path-to\\maxima.bat -s PORT'. Now you can create a Socket(Client)-Object which connects to your Server-Object. Use the Input- and OutputStream of this Socket(Client)-Object to communicate with Maxima. The GUI wxMaxima uses a socket connection to Maxima (similar to what I described). wxMaxima is open source and written in C++. The file wxMaxima.cpp describes the socket connection. Maybe this is an inspiration for you. Volker van Nek 2011/8/24 -Henry Hom > > > How can I use Maxima under *Command Prompt* but *not in GUI interface*? I'm > going to write a nicer and more helpful GUI interface that uses *free > language*.First the user inputs "solve x^2+5x+6=0 for x"Then my program > translates "solve x^2+5x+6=0 for x" to "solve([x^2+5*x+6=0],[x])"Now I have > a big problem. how can I use Maxima in Command Prompt? like:maxima > solve([x^2+5x+6=0],[x]) > output.tmpThen Maxima will output the result to > output.tmpThen I can load output.tmp. If you know how to use Maxima in > Command Prompt, please send a mail to henryhom(at)live.cn . > Thanks a lot Henry Hom (China) > > _______________________________________________ > 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 Aug 27 10:43:45 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 27 Aug 2011 08:43:45 -0700 Subject: [Maxima] Maxima Help -- Command Prompt Input & Output, not GUI interface In-Reply-To: References: Message-ID: <4E5910B1.5080701@eecs.berkeley.edu> On 8/23/2011 7:54 PM, -Henry Hom wrote: > > How can I use Maxima under *Command Prompt* but *not in GUI interface*? I'm going to write a nicer and more helpful GUI interface that uses *free language*.First the user inputs "solve x^2+5x+6=0 for x"Then my program translates "solve x^2+5x+6=0 for x" to "solve([x^2+5*x+6=0],[x])"Now I have a big problem. how can I use Maxima in Command Prompt? like:maxima solve([x^2+5x+6=0],[x])> output.tmpThen Maxima will output the result to output.tmpThen I can load output.tmp. If you know how to use Maxima in Command Prompt, please send a mail to henryhom(at)live.cn . > Thanks a lot Henry Hom (China) > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Here's a suggestion. Write your interface program in lisp and load it in to Maxima. You can use the existing parser as a model. That way your "gui" has full access to maxima and does not have to squeeze everything into a stream of characters that are then RE-parsed by maxima. For example, solve x^2.... for x can result in the lisp expression (($SOLVE) ((MEQUAL) ((MPLUS) ((MEXPT) $X 2) ((MTIMES) 5 $X) 6) 0) $X) which is then evaluated by maxima. This way you could use existing technology for 95% of the initial work and concentrate on your new ideas in what I assume is some kind of free-form natural language input for mathematical commands. You might also check up on the previous technology here: Bobrow's STUDENT program Handwritten input (stylus or mouse) Palette-driven input(keyboard or mouse) speech input and see how they compare to keyboard only input. From fateman at cs.berkeley.edu Sat Aug 27 11:08:29 2011 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Sat, 27 Aug 2011 09:08:29 -0700 Subject: [Maxima] description of Mathematica's Limit calculations In-Reply-To: References: Message-ID: <4E59167D.5090707@cs.berkeley.edu> In case someone wishes to revise Maxima's limit program, this information may be quite useful, especially with regard to when Gruntz's algorithm does not work. (This is from the mathematica newsgroup, as you can see from the heading.) There are a few areas in which Mathematica has forged ahead with additional efforts, where additional work in Maxima's code base might bring Maxima up to the same level. I think Limit is one of the areas. Other areas include numerical integration, symbolic integration, "Reduce". That is not to say that Maxima does the same as Mathematica everywhere else, just that the technology for these commands strikes me as more interesting and useful than (say) the latest display hacks. Arguably, Mathematica's matching program is more advanced (certainly different), but I already have Lisp code to do that, but it is tangled up in evaluation strategies. Anyway, here's the description of Limit... -------- Original Message -------- Subject: Re: decoding inbuilt function Date: Sat, 27 Aug 2011 12:18:44 +0000 (UTC) From: Daniel Lichtblau Organization: Steven M. Christensen and Associates, Inc and MathTensor, Inc. Newsgroups: comp.soft-sys.math.mathematica References: <201108221003.GAA22469 at smc.vnet.net> <4592974.8304.1314168104259.JavaMail.root at m06> <201108260925.FAA04591 at smc.vnet.net> On 08/26/2011 04:25 AM, student wrote: > hi, > i was trying to get the cas logic in computing limits > i never meant to decode a proprietary software illegally (just a try > to understand the logic behind) > so i really need to modify my question > WHAT IS THE CAS LOGIC BEHIND COMPUTING LIMITS IN MATHEMATICA > > i really thank everybody who responded in a positive way to help me > especially simon sir for the help rendered and rest of them really > guided me in a right way so i thank them all > anyway it is really clear that the logic is gruntz algorithm (which > looks really confusing) > so can u people please help me in this case > > thanking all Simon Tyler's response was on track. The actual situation is quite complicated (which was the main reason I was loathe to get into this). I still won't try to outline the code in any detail, but I will explain several of the considerations that went into it. (1) One often can use a basic power series expansion. (2) The Gruntz algorithm is quite powerful, in its area of applicability. But... (i) It does not really know how to handle oscillatory functions. (ii) It does not handle non-numeric parameters, even if we have some ranges in which they live e.g. from assumptions. (iii) It does not handle things with jump discontinuities e.g. from branch cut crossings. (iv) It does not handle (most) special functions directly. Some extensions of the algorithm understand certain such functions, but I do not think there is any general way to apply it universally. (v) It does not handle complex valued functions. We try, when possible, to separate into real and imaginary parts in a way that uses functions it will understand. ComplexExpand gets utilized here. (3) The handling of special functions involves attempts to change them into elementary functions, possibly by conversion to series (at infinity, when applicable). Mathematica's Series code attempts to do this sort of conversion in part because it is understood to be useful for Limit. (4) The handling of branch cuts gets tricky. We try to deduce the direction of approach, taking into account parameters and assumptions thereon (as well as interval bounds for oscillatory functions). We use a knowledge base of branch cut behavior for the elementary functions and a number of special functions. We have also some knowledge built into Series for handling these discontinuities via Floor, Arg, and the like. We do not claim this to be a particularly elegant way of handling the expansions, and it is not uniformly applied (Series takes this approach for special functions but not for elementary functions). (5) It is not easy to make adequate use of assumptions on parameter values. One cannot apply Simplify every which way (many things would start to hang). We tend to use Refine[...,Assumptions->...] and hope for the best. But there will be situations where a needed inference is missed. (6) There are other functions with jump discontinuities, such as UnitStep, Sign, and Floor. Handling these can be a nightmare. While I have forgotten what type of reptile we had to sacrifice to make that stuff (usually) work, I can say with assurance that it was big enough to leave scars. The basic methodology to the code is to check whether the function is trivial to handle (e.g. a rational function), if not check whether we think we have functions with possible branch cuts or jumps for other reasons. If so then we then go though an elaborate "dance of recursion" as we drill down into the function (not pretty--it resembles the mating ritual of ostriches). At some point we try series expansions, and one of those will attempt the Gruntz algorithm. I will mention that in many respects the use of Gruntz' algorithm is amongst the "cleanest" parts of Limit. That's because it is really and truly algorithmic (although subject to limitations that rarely arise in practice), whereas much of the other handling via Series and branch cut detection involves a bag of tricks. If all this fails, we try in a different way to deconstruct the functions and reattempt to take limits. There are also heuristic conversions by taking logs or exponentials (taking care one does not simply undo the other). There is even some ancient code that tries l'Hospital's rule. Again dicey, since that can lead in a roundabout way to the same problem in disguise (so it cannot be done repeatedly without extreme care). This might give a very rough idea of what Limit will do. The reasons for not going into more detail have less to do with it being proprietary than with it being a thick forest I don't care to get lost in yet again. Daniel Lichtblau Wolfram Research From robert.dodier at gmail.com Sat Aug 27 14:32:41 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 27 Aug 2011 13:32:41 -0600 Subject: [Maxima] slow file loading In-Reply-To: References: Message-ID: On 8/22/11, ladida vllt wrote: > i have a huge matrix (saved in a file), and i want to load this file, but > with the standard load-command this takes nearly 10 min; if i load it from a > program (C#) it only takes a few seconds. > how can i make the load-command faster? If the matrix in question contains only floating point numbers, you are probably better off using R or Octave or something like that, which are stronger than Maxima for many numerical problems. If you still want to use Maxima, you could load it once and then save it as file of binary floats via write_binary_data. If you are prepared to do some preprocessing to get the original data to load faster, you could reformat (via awk or sed or perl or whatever) the original data into Lisp and then load that; it would be faster since the Lisp parser is probably a lot faster than the Maxima parser. I can help with that if you choose to go down that road. What, exactly, is the content of the data file? Perhaps you can show the first few lines. And what command, exactly, are you using to load it? best, Robert Dodier From willisb at unk.edu Sat Aug 27 15:09:53 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 27 Aug 2011 15:09:53 -0500 Subject: [Maxima] Defects in lu_factor() for degenerated matrices In-Reply-To: References: Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > Can somebody help, recommend a workaround or some other implementation of lu_factor. I know of no workaround or alternative Maxima code for LU factorization. This limitation has been mentioned a few times on this list and elsewhere---as far as I know, nobody has pitched in to improve the LU factorization code. --Barton (author of lu_factor) From hiisi at fedoraproject.org Sun Aug 28 06:41:20 2011 From: hiisi at fedoraproject.org (Hiisi) Date: Sun, 28 Aug 2011 15:41:20 +0400 Subject: [Maxima] How to "Page" Large Output of Maxima, i.e Like the "|less" Pipe in Bash? In-Reply-To: References: Message-ID: On 23 August 2011 10:36, first name <33facebook at gmail.com> wrote: > Hi. > > I have a problem, especially when using the "?? function" command, > that the output is far too big and so disappears somewhere from the > screen...and i have to scroll up quite a few pages in order to read > the display.. > > for example: the "?? integrate" command, which outputs a very long output... > > Now, in bash we pipe these output to the "less" commad etc. > > Now, what is the equivalent to this in Maxima? > > thanks You can pipe output into outfile and then do with it whatever you want to do. -- Hiisi. Registered Linux User #487982. Be counted at: http://counter.li.org/ -- Spandex is a privilege, not a right. From robert.dodier at gmail.com Sun Aug 28 14:28:42 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 28 Aug 2011 13:28:42 -0600 Subject: [Maxima] Maxima 5.25.1 Message-ID: Hi, I've tagged version-5_25_1 in Git and uploaded rpms & source code to the SF file manager. http://sourceforge.net/projects/maxima/files This version contains the bug fix for # 3396631 (equal terms produce different results). best Robert Dodier From drdieterkaiser at web.de Mon Aug 29 12:58:40 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 29 Aug 2011 19:58:40 +0200 Subject: [Maxima] Maxima 5.25.1 In-Reply-To: References: Message-ID: <1314640720.1705.1.camel@dieter> Am Sonntag, den 28.08.2011, 13:28 -0600 schrieb Robert Dodier: > Hi, I've tagged version-5_25_1 in Git and uploaded rpms & source > code to the SF file manager. > http://sourceforge.net/projects/maxima/files > > This version contains the bug fix for # 3396631 (equal terms produce > different results). Hello Robert, thank you very much for the version Maxima 5.25.1 Dieter Kaiser From mxue at vroomlab.com Mon Aug 29 15:05:20 2011 From: mxue at vroomlab.com (Michael X) Date: Mon, 29 Aug 2011 20:05:20 +0000 (UTC) Subject: [Maxima] =?utf-8?q?Maxima_Help_--_Command_Prompt_Input_=26_Output?= =?utf-8?q?=2C=09not_GUI_interface?= References: Message-ID: -Henry Hom live.cn> writes: > > > How can I use Maxima under *Command Prompt* but *not in GUI interface*??I'm going to write a nicer and more > helpful GUI interface that uses *free language*.First the user inputs?"solve x^2+5x+6=0 for x"Then my > program translates "solve x^2+5x+6=0 for x" to?"solve([x^2+5*x+6=0],[x])"Now I have a big problem. > how can I use Maxima in Command Prompt? like:maxima solve([x^2+5x+6=0],[x]) > output.tmpThen Maxima > will output the result to output.tmpThen I can load output.tmp.?If you know how to?use Maxima in > Command Prompt, please send a mail to henryhom(at)live.cn . > ? ? ? ? ? ? ? ? ? ? Thanks a lot? ? ? ? ? ? ? ? ? ?Henry Hom (China) > thought you might be interested to see this one interface to maxima http://www.vroomlab.com/nhome click on calculator image to access From fateman at eecs.berkeley.edu Mon Aug 29 22:52:05 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 29 Aug 2011 20:52:05 -0700 Subject: [Maxima] slow file loading In-Reply-To: References: Message-ID: <4E5C5E65.9050302@eecs.berkeley.edu> On 8/27/2011 12:32 PM, Robert Dodier wrote: > On 8/22/11, ladida vllt wrote: > >> i have a huge matrix (saved in a file), and i want to load this file, but >> with the standard load-command this takes nearly 10 min; if i load it from a >> program (C#) it only takes a few seconds. >> how can i make the load-command faster? > If the matrix in question contains only floating point numbers, > you are probably better off using R or Octave or something like > that, which are stronger than Maxima for many numerical problems. > > If you still want to use Maxima, you could load it once and > then save it as file of binary floats via write_binary_data. > > If you are prepared to do some preprocessing to get the > original data to load faster, you could reformat (via awk or > sed or perl or whatever) the original data into Lisp > and then load that; it would be faster since the Lisp > parser is probably a lot faster than the Maxima parser. > I can help with that if you choose to go down that road. > > What, exactly, is the content of the data file? > Perhaps you can show the first few lines. > And what command, exactly, are you using to load it? > > best, > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima It's unclear from the original message if the file being loaded was one that was saved from a previous Maxima, in which case the load process would be reading LISP, or if this was some kind of "batch" file consisting of Maxima language commands like m[1,1]: 1.223$ m[1,2]: 4.56$ etc. If it is the latter, then perhaps the file can be edited to consist of lisp, e.g. (setq $m (make-array '(2 2) :initial-contents '((1 2)(3 4)))) in which case it would read in at lisp speed. depending on the lisp, it could be similar in speed to c# etc. (this would not be exactly a normal maxima array -- it is zero- based. that is, m[0,0] is 1. m[1,1] is 4. ) It may be the case that what you are computing could be done faster in a purely-numerical setting, but that is orthogonal to the question of the speed of reading numbers from a file. From andre.maute at gmx.de Wed Aug 31 07:58:43 2011 From: andre.maute at gmx.de (andre maute) Date: Wed, 31 Aug 2011 14:58:43 +0200 Subject: [Maxima] unexpected behavior of simplify_sum In-Reply-To: <4E55034F.9080600@gmx.de> References: <4E55034F.9080600@gmx.de> Message-ID: <4E5E3003.8050706@gmx.de> This is a repost, to attract someone's attention, because i got no response. Andre On 08/24/2011 03:57 PM, andre maute wrote: > Hi, > > I have the following test, with a sum depending on b2. > For general b2 simplify_sum gives an incorrect value. > > Andre > > ------- test-simplify_sum-1.max ----------- > > display2d : false; > > F(d,a1,k1,a2,k2,b2,l2) := block( > > [res:1], > > res : res/(b2-l2)!, > res : res/l2!, > res : res*(-1)^l2, > > res : res*(b2+l2+d-2)!, > res : res/(l2+d-2)!, > > res : res*(k2+l2+d-2)!, > res : res/(k2+l2+d-1+k1)!, > > return(res) > > ); > > load("simplify_sum"); > > s:sum(F(d,1,1,1,1,b2,l2),l2,0,b2); > h : simplify_sum(s); > h : factor(minfactorial(h)); > > s:sum(F(d,1,1,1,1,2,l2),l2,0,2); > h : simplify_sum(s); > h : factor(minfactorial(h)); > > ------- test-simplify_sum-1.max ----------- > > ------- test-simplify_sum-1.txt ----------- > > Maxima 5.19.2 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(test-simplify_sum-1.max) > > batching /home/user/progs/test-simplify_sum-1.max > (%i2) display2d : false > (%o2) false > (%i3) F(d,a1,k1,a2,k2,b2,l2):=block([res:1],res:res/(b2-l2)!,res:res/l2!, > res:res*(-1)^l2,res:res*(-2+d+l2+b2)!,res:res/(-2+d+l2)!, > res:res*(-2+d+l2+k2)!,res:res/(k1-1+d+l2+k2)!,return(res)) > (%o3) F(d,a1,k1,a2,k2,b2,l2):=block([res:1],res:res/(b2-l2)!,res:res/l2!, > res:res*(-1)^l2,res:res*(-2+d+l2+b2)!,res:res/(-2+d+l2)!, > res:res*(-2+d+l2+k2)!,res:res/(k1-1+d+l2+k2)!,return(res)) > (%i4) load("simplify_sum") > (%o4) > "/home/user/opt/maxima/share/maxima/5.19.2/share/contrib/solve_rec/simplify_sum.mac" > (%i5) s:sum(F(d,1,1,1,1,b2,l2),l2,0,b2) > (%o5) > 'sum((-1)^l2*(l2+d-1)!*(l2+d+b2-2)!/((b2-l2)!*l2!*(l2+d-2)!*(l2+d+1)!), > l2,0,b2) > (%i6) h:simplify_sum(s) > (%o6) 0 > (%i7) h:factor(minfactorial(h)) > (%o7) 0 > (%i8) s:sum(F(d,1,1,1,1,2,l2),l2,0,2) > (%o8) (d+1)!*(d+2)!/(2*d!*(d+3)!)-d!*(d+1)!/((d-1)!*(d+2)!) > +(d-1)!*d!/(2*(d-2)!*(d+1)!) > (%i9) h:simplify_sum(s) > (%o9) (d+1)!*(d+2)!/(2*d!*(d+3)!)-d!*(d+1)!/((d-1)!*(d+2)!) > +(d-1)!*d!/(2*(d-2)!*(d+1)!) > (%i10) h:factor(minfactorial(h)) > (%o10) -2/((d+1)*(d+2)*(d+3)) > (%o10) "/home/user/progs/test-simplify_sum-1.max" > > ------- test-simplify_sum-1.txt ----------- > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From rich.hennessy at verizon.net Thu Sep 1 20:20:15 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 01 Sep 2011 21:20:15 -0400 Subject: [Maxima] factor bug? Message-ID: <44FE9E30704544998F20F4C2364BEA4D@RichsLaptop> Should factor() give abs(x) in this example? (%i15) display2d:false; (%o15) false (%i16) kill(all); (%o0) done (%i1) integrate(asec(x),x); (%o1) x*asec(x)-log(sqrt(1-1/x^2)+1)/2+log(sqrt(1-1/x^2)-1)/2 (%i2) factor(%); (%o2) -(log((abs(x)+sqrt(x^2-1))/abs(x))-log((sqrt(x^2-1)-abs(x))/abs(x))-2*x*asec(x))/2 (%i3) diff(%,x); (%o3) -(abs(x)*(('diff(abs(x),x,1)+x/sqrt(x^2-1))/abs(x)-(abs(x)+sqrt(x^2-1))*'diff(abs(x),x,1)/x^2)/(abs(x)+sqrt(x^2-1)) -abs(x)*((x/sqrt(x^2-1)-'diff(abs(x),x,1))/abs(x)-(sqrt(x^2-1)-abs(x))*'diff(abs(x),x,1)/x^2)/(sqrt(x^2-1)-abs(x))-2*asec(x) -2/(sqrt(1-1/x^2)*x)) /2 (%i4) trigsimp(%); (%o4) ((x^3-x)*'diff(abs(x),x,1)+(1-x^2)*abs(x)+x*sqrt(x^2-1)*asec(x))/(x*sqrt(x^2-1)) (%i5) 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 You cannot get back to asec(x) after factoring, but you can if you don?t factor. Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From O.Kullmann at swansea.ac.uk Sat Sep 3 06:37:53 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 3 Sep 2011 12:37:53 +0100 Subject: [Maxima] is there some functionality in Maxima for creating "true" random numbers? Message-ID: <20110903113753.GA15766@cs-wsok.swan.ac.uk> Hi, I just wonder whether Maxima has some easy access to some "true" random source. I am aware of the Internet resources, but I would also like to have something like that in Maxima. It just needs to be reasonable: I partially mistrust the Internet resources (what if everything is logged?). It would be nice if Maxima had some function for extracting some randomness out of the computer. Oliver From willisb at unk.edu Sat Sep 3 08:18:05 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 3 Sep 2011 08:18:05 -0500 Subject: [Maxima] dispatching simplim%function In-Reply-To: References: Message-ID: Shouldn't limit dispatch the simplim%function earlier? Consider (%i8) :lisp(trace simplim%bessel_j) (SIMPLIM%BESSEL_J) These cases do not dispatch the simplim%function (what mechanism decides that bessel_j is continuous?) (%i8) limit(bessel_j(0,x),x,a); (%o8) bessel_j(0,a) (%i9) limit(bessel_j(0,x),x,0); (%o9) 1 (%i10) limit(bessel_j(a,x),x,0); (%o10) bessel_j(a,0) (%i11) limit('(bessel_j(a,x)),x,a); (%o11) bessel_j(a,a) Finally, limit dispatches simplim%bessel_j (%i12) limit(bessel_j(a,x),x,inf); 1> (SIMPLIM%BESSEL_J ((%BESSEL_J SIMP) $A $X) $X $INF) <1 (SIMPLIM%BESSEL_J 0) (%o12) 0 How can I prevent the limit from assuming continuity and call the simplim%function? --Barton (who was trying to get limits to work for the generalized Lambert function) From willisb at unk.edu Sun Sep 4 12:28:28 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 4 Sep 2011 12:28:28 -0500 Subject: [Maxima] dispatching simplim%function In-Reply-To: References: , Message-ID: Example: Define a (fake) simplim%function for the generalized Lambert function: (setf (get '%generalized_lambert_w 'simplim%function) #'(lambda (s v pt) 42)) ;fake The actual value of limit(generalized_lambert_w(-1,x),x,0,'minus) is minus infinity, but this calculation doesn't use the services of the simplim%function. Instead, limit assumes continuity: (%i93) limit(generalized_lambert_w(-1,x),x,0,'minus); (%o93) generalized_lambert_w(-1,0) Appending the simplification generalized_lambert_w(-1,0) --> minf isn't an option because limit(generalized_lambert_w(-1,x),x,0,'plus) =/= minf (I think, there are other reasons for not defining this simplification rule.) For a limit toward inf, the simplim%function is consulted (fake result) (%i94) limit(generalized_lambert_w(-1,x),x,inf); (%o94) 42 --Barton From dlakelan at street-artists.org Mon Sep 5 15:08:26 2011 From: dlakelan at street-artists.org (dlakelan) Date: Mon, 05 Sep 2011 13:08:26 -0700 Subject: [Maxima] How to graph an expression involving sum? Message-ID: <4E652C3A.8030806@street-artists.org> I have a solution of a differential equation in terms of some fourier series. I would like to graph one of the spatially varying coefficients, so I tried something like: draw2d(explicit(subst(avals,coefseries),z,0,1)); Where coefseries is something like a[0] + sum(a[i]*cos(...),i,1,17) and avals are the values for a[0]...a[17] in a list of the form [a[0]=...,a[1]=..., ...] but what the subst gives me is still in the form 1.234 + sum(a[i]*cos(...)...), that is, subst substituted the constant coefficient but of course not the individual coefficients in the sum (since they only appear as a[i]). What's the right way to go about graphing something like this? Thanks, Dan From rhyslpratt at yahoo.com.cn Tue Sep 6 06:15:25 2011 From: rhyslpratt at yahoo.com.cn (RLP) Date: Tue, 6 Sep 2011 19:15:25 +0800 Subject: [Maxima] gnuplot quits automatically Message-ID: <20110906191525.1259b80e@linux-gbkp.site> The following code (see the bottom) comes from manuals, It works except that the pop-up gnuplot window will quit immediately as soon as the mouse begins to move. So, How to prevent gnuplot from quitting? OS information: openSuSE 11.4 and (%i7) build_info()$ Maxima version: 5.25.0 Maxima build date: 13:26 8/13/2011 Host type: i686-pc-linux-gnu Lisp implementation type: CLISP Lisp implementation version: 2.49 (2010-07-07) (built on build34 [127.0.0.1]) ========================== /* [wxMaxima: input start ] */ load(implicit_plot); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ implicit_plot ([y^2=x, x*y^2-3*x*y+y+x^3-x^2+x=0] , [x, 1, 10], [y, 0, 10], [gnuplot_preamble, "set zeroaxis"]); /* [wxMaxima: input end ] */ kindly regards, xiang From fateman at eecs.berkeley.edu Tue Sep 6 15:25:10 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 06 Sep 2011 13:25:10 -0700 Subject: [Maxima] treatment of square roots. oof Message-ID: <4E6681A6.9090504@eecs.berkeley.edu> f(x):=x/sqrt(1+sqrt(x)); g(x):=sqrt(x^2/(1+sqrt(x))); f(x)-g(x) returns 0 f(3)-g(3) returns 0 f(-3) - g(-3) is NOT zero. indeed, f(x)-g(x) is not zero if x<0.... is there a remedy? RJF From adammaj1 at o2.pl Wed Sep 7 05:41:14 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Wed, 7 Sep 2011 10:41:14 +0000 (UTC) Subject: [Maxima] list order / draw-points joined Message-ID: Hi, I'm drawing circle l0 = {z:abs(z)=ER} and its preimages : l1={z1=sqrt(z) } l2={z2:sqrt(z1)} .... Program is below. It works. I can join points with lines only for first circle l0. For its preimages no probably because of bad order of points. Can I order point according to it's argument ? How can I improve the program ? Thx in advance Adam === code begin ===== radius:20; iMax:100; dt:float(1/iMax); /* */ l(t):=radius*%e^(2*%pi*%i*t); /* point to point method of drawing */ t:0; /* angle in turns */ w:rectform(ev(l(t), numer)); l0:makelist (w, j, 1, 1); w:sqrt(w); l1: makelist (w, j, 1, 1); l1:endcons(-w,l1); w:sqrt(w); l2: makelist (w, j, 1, 1); l2:endcons(-w,l2); for i:1 thru iMax step 1 do block ( t:t+dt, w0:rectform(ev(l(t), numer)), l0:cons(w0,l0), w1:sqrt(w0), l1:cons(w1,l1), l1:endcons(-w1,l1), w2:sqrt(w1), l2:cons(w2,l2), l2:endcons(-w2,l2), w2:sqrt(-w1), l2:cons(w2,l2), l2:endcons(-w2,l2) ); load(draw); draw2d( terminal = 'screen, title= " ", key = "LC0={z:abs(z)=ER}", xlabel = "re ", ylabel = "im", points_joined = true, point_type = dot, point_size = 5, color = black, points(map(realpart, l0),map(imagpart, l0)), points_joined = false, color = red, key = "LC1=f^(-1)(LC0)", points(map(realpart, l1),map(imagpart, l1)), color = blue, key = "LC2=f^(-2)(LC0)", points(map(realpart, l2),map(imagpart, l2)) ); == code end == From christianlupus at gmx.de Wed Sep 7 15:54:33 2011 From: christianlupus at gmx.de (Christian Wolf) Date: Wed, 7 Sep 2011 22:54:33 +0200 Subject: [Maxima] How to write this concat expression in the right way Message-ID: <201109072254.33718.christianlupus@gmx.de> Hello, I am using maxima since some time, but now I have a trivial problem with it. It more or less plain lisp, but... I give the folowing to maxima: (%i1) y : x1$ (%i2) d1y:x2$ (%i3) concat(d,1,y); (%o3) d1x1 (%i4) concat(d,1,'y); (%o4) d1y (%i5) ev(concat(d,1,'y)); (%o5) d1x1 Nr. 1 and 2 is just initialition. Nr 3 is clear: y is set to x1 therefore the concat command uses x1 to construct d1x1. Nr 4 is also clear: We suppress by using ' the set in of x1. Now the problem: Why does Nr 5 expand to d1x1 and not to d1y or x2? An even more important question is: How can I get maxima to evaluate somethong like Nr 5 to x2? The reason I need it is that there are several more variables I want to setup via a loop. Thanks Christian From ChristianLupus at gmx.de Thu Sep 8 05:05:42 2011 From: ChristianLupus at gmx.de (Christian) Date: Thu, 8 Sep 2011 12:05:42 +0200 Subject: [Maxima] Right invocation of concat Message-ID: <201109081205.42671.ChristianLupus@gmx.de> Hello everybody, it seems that my last mail has failed to reach this mailing list. So here agein: I do the following in maxima: First some initialisation... > y : x1$ > d1y : x2$ the following is clear. > concat(d,1,y) => d1x1 the following is also clear. > concat(d,1,'y) => d1y now comes the problem > ev(concat(d,1,'y),eval) => d1x1 How can I change the last command to get x2? Why does maxima first set x1 for y in, before the concat is evaluated? Thanks Christian From rhyslpratt at yahoo.com.cn Thu Sep 8 07:46:32 2011 From: rhyslpratt at yahoo.com.cn (RLP) Date: Thu, 8 Sep 2011 20:46:32 +0800 Subject: [Maxima] gnuplot quits automatically Message-ID: <20110908204632.69ef7e21@linux-gbkp.site> The following code comes from manuals, It works except that the pop-up gnuplot window will quit immediately as soon as the mouse begins to move. So, How to prevent gnuplot from quitting? ==== code ==== --> load(implicit_plot); --> implicit_plot ([y^2=x, x*y^2-3*x*y+y+x^3-x^2+x=0] , [x, 1, 10], [y, 0, 10], [gnuplot_preamble, "set zeroaxis"]); ============== OS information: openSuSE 11.4 and (%i7) build_info()$ Maxima version: 5.25.0 Maxima build date: 13:26 8/13/2011 Host type: i686-pc-linux-gnu Lisp implementation type: CLISP Lisp implementation version: 2.49 (2010-07-07) (built on build34 [127.0.0.1]) kindly regards, xiang From mzou at math.utexas.edu Thu Sep 8 10:43:28 2011 From: mzou at math.utexas.edu (Maorong Zou) Date: Thu, 08 Sep 2011 10:43:28 -0500 Subject: [Maxima] test Message-ID: Just a test, please ignore. From toy.raymond at gmail.com Thu Sep 8 11:19:24 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 8 Sep 2011 09:19:24 -0700 Subject: [Maxima] is there some functionality in Maxima for creating "true" random numbers? In-Reply-To: <20110903113753.GA15766@cs-wsok.swan.ac.uk> References: <20110903113753.GA15766@cs-wsok.swan.ac.uk> Message-ID: I'm not aware of anything like that in Maxima. Not sure if you can do this from Maxima itself, but from Lisp you can easily open /dev/urandom and read a few words to get "true" randomness. Ray On Sat, Sep 3, 2011 at 4:37 AM, Oliver Kullmann wrote: > Hi, > > I just wonder whether Maxima has some easy access to some > "true" random source. I am aware of the Internet resources, > but I would also like to have something like that in Maxima. > It just needs to be reasonable: I partially mistrust the Internet > resources (what if everything is logged?). > It would be nice if Maxima had some function for extracting some > randomness out of the computer. > > Oliver > > _______________________________________________ > 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 Sep 8 11:25:52 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 8 Sep 2011 09:25:52 -0700 Subject: [Maxima] treatment of square roots. oof In-Reply-To: <4E6681A6.9090504@eecs.berkeley.edu> References: <4E6681A6.9090504@eecs.berkeley.edu> Message-ID: Setting radexpand:false makes f(x) and g(x) be different. It seems that maxima has simplified g(x) incorrectly by making sqrt(x^2) be x. This shouldn't happen since radexpand is true by default. So at most maxima should make g(x) be abs(x)/sqrt(1+sqrt(x)). Ray On Tue, Sep 6, 2011 at 1:25 PM, Richard Fateman wrote: > f(x):=x/sqrt(1+sqrt(x)); > g(x):=sqrt(x^2/(1+sqrt(x))); > > f(x)-g(x) returns 0 > > f(3)-g(3) returns 0 > > f(-3) - g(-3) is NOT zero. > > indeed, f(x)-g(x) is not zero if x<0.... is there a remedy? > > 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 macrakis at alum.mit.edu Thu Sep 8 11:29:29 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 8 Sep 2011 12:29:29 -0400 Subject: [Maxima] Right invocation of concat In-Reply-To: <201109081205.42671.ChristianLupus@gmx.de> References: <201109081205.42671.ChristianLupus@gmx.de> Message-ID: I suspect you're expecting ev(...,eval) to be equivalent to something like eval(...). But (alas) that is not the definition of ev. Ev actually creates a special evaluation environment for ... and evaluates it in a very particular way. If you want the gory details of what's going on, read the documentation of 'ev'. But if you just want an eval function, try eval(val) := ev(val, eval)$ (%i1) y:x1$ (%i2) d1y:x2$ (%i3) concat(d,1,y); (%o3) d1x1 (%i4) concat(d,1,'y); (%o4) d1y (%i5) eval(val) := ev(val, eval)$ (%i6) eval(concat(d,1,'y)); (%o7) x2 Is that what you had in mind? -s On Thu, Sep 8, 2011 at 06:05, Christian wrote: > Hello everybody, > > it seems that my last mail has failed to reach this mailing list. So here > agein: > > I do the following in maxima: > First some initialisation... > > y : x1$ > > d1y : x2$ > the following is clear. > > concat(d,1,y) > => d1x1 > the following is also clear. > > concat(d,1,'y) > => d1y > now comes the problem > > ev(concat(d,1,'y),eval) > => d1x1 > > How can I change the last command to get x2? > Why does maxima first set x1 for y in, before the concat is evaluated? > > Thanks > Christian > _______________________________________________ > 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 Thu Sep 8 11:54:26 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 08 Sep 2011 09:54:26 -0700 Subject: [Maxima] treatment of square roots. oof In-Reply-To: References: <4E6681A6.9090504@eecs.berkeley.edu> Message-ID: <4E68F342.5050504@eecs.berkeley.edu> On 9/8/2011 9:25 AM, Raymond Toy wrote: > Setting radexpand:false makes f(x) and g(x) be different. > > It seems that maxima has simplified g(x) incorrectly by making > sqrt(x^2) be x. This shouldn't happen since radexpand is true by > default. So at most maxima should make g(x) be abs(x)/sqrt(1+sqrt(x)). > > Ray > > > On Tue, Sep 6, 2011 at 1:25 PM, Richard Fateman > > wrote: > > f(x):=x/sqrt(1+sqrt(x)); > g(x):=sqrt(x^2/(1+sqrt(x))); > > f(x)-g(x) returns 0 > > f(3)-g(3) returns 0 > > f(-3) - g(-3) is NOT zero. > > indeed, f(x)-g(x) is not zero if x<0.... is there a remedy? > > RJF > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > oddly enough, this came up in a Mathematica mailing list, but there it had to do with taylor series. For maxima, taylor(f(x),x,0,3) and ...g(x)... give the same expression, regardless of radexpand. This is, I think, correct. The series are identical but with different radii of convergence? This perhaps opens up another option for taylor series... that is, on the off chance that someone can made some useful observation about the function represented here, namely something about convergence, maybe add that info to the series data. There is a literature in numerical analysis that attempts to "compute" from some number of terms of a series its radius of convergence. This is obviously heuristic in nature, and presumably makes assumptions about how nasty the components are of a function being expanded. I haven't looked at it in many years, but perhaps an interested person could look at it. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From O.Kullmann at swansea.ac.uk Thu Sep 8 13:32:28 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Thu, 8 Sep 2011 19:32:28 +0100 Subject: [Maxima] is there some functionality in Maxima for creating "true" random numbers? In-Reply-To: References: <20110903113753.GA15766@cs-wsok.swan.ac.uk> Message-ID: <20110908183228.GP16268@cs-wsok.swan.ac.uk> On Thu, Sep 08, 2011 at 09:19:24AM -0700, Raymond Toy wrote: > I'm not aware of anything like that in Maxima. Not sure if you can do this > from Maxima itself, but from Lisp you can easily open /dev/urandom and read > a few words to get "true" randomness. > thanks, didn't know that; good enough that I access it as shell script. Thanks! Oliver > > I just wonder whether Maxima has some easy access to some > > "true" random source. I am aware of the Internet resources, > > but I would also like to have something like that in Maxima. > > It just needs to be reasonable: I partially mistrust the Internet > > resources (what if everything is logged?). > > It would be nice if Maxima had some function for extracting some > > randomness out of the computer. > > From soichi777 at gmail.com Mon Aug 29 02:52:18 2011 From: soichi777 at gmail.com (ishi soichi) Date: Mon, 29 Aug 2011 16:52:18 +0900 Subject: [Maxima] gnuplot doesn't work for Emacs+imaxima Message-ID: I have recently installed Maxima + imaxima. Although certainly I have also gnuplot, it does not plot at all. The environment is: MacOSX Snow Leopard Cocoa Emacs23.2 Maxima5.25 gnuplot 4.5 Ghostscript3.6.9 By double-clicking the icon shown in "Finder" will activate gnuplot, Maxima, and Ghostscript. But the problem arises when using with Emacs. in .emacs setting, ;; maxima (setq exec-path (append (list "/Applications/Maxima.app/bin" "/Applications/Emacs.app/Contents/Resources/lisp/imaxima-imath/" "/Applications/gnuplot.app/bin" "/Applications/Ghostscript.app/bin" "/Applications/teTeX.app/bin") exec-path)) (add-to-list 'load-path "/Applications/Emacs.app/Contents/Resources/lisp/imaxima-imath/") (setq imaxima-latex-preamble "\\usepackage{eulervm}") ;;; add autoload of imaxima and imath. (autoload 'imaxima "imaxima" "Image support for Maxima." t) (autoload 'imath "imath" "Interactive Math mode" t) ;;---------------------------------- When imaxima started, it shows, ;Compiler warnings for "/Applications/Emacs.app/Contents/Resources/lisp/imaxima-imath/imaxima.lisp" : ; In BREAK-DBM-LOOP inside an anonymous lambda form: Undefined function $FRAME Maxima 5.25post http://maxima.sourceforge.net using Lisp Clozure Common Lisp Version 1.7-dev-r14869 (DarwinX8664) at the top of the buffer. I'm not sure if it's important. Normal calculations, such as arithmetics and calculus, seem fine. But when typing "plot2d(sin(x),[x,-%pi/2, %pi/2]);", it will open a buffer "*imaxima gs output*" which is empty. Could anyone point out where the problem is? soichi -------------- next part -------------- An HTML attachment was scrubbed... URL: From alenskold at hotmail.com Tue Aug 30 11:23:48 2011 From: alenskold at hotmail.com (Art Lenskold) Date: Tue, 30 Aug 2011 12:23:48 -0400 Subject: [Maxima] to_poly_solve hangs Message-ID: Hi maxima, Robert Dodier referred me to you. I get the message that Maxima is calculating for a half hour on this input: load(to_poly_solver); to_poly_solve([0=x^2-1+(a-(t-x)*(t+1/(2*((t-x)^2+(b-sqrt(1-x^2))^2))*(2*(b*x-t*sqrt(1-x^2))*(b-sqrt(1-x^2))-2*(x^2*(b^2-t^2)*(x^2-2+2*t*x-t^2)+t^2*(x^2+b^2-1)-(2*t*x-x^2)*(1+b^2+t^2-2*t*x)-2*b*sqrt(1-x^2)*((t-x)^2+t*x*(x^2+2*t*x-t^2-2)))^(1/2)))^-1*(a+(1-1/(4*((t-x)^2+(b-sqrt(1-x^2))^2)^2)*(4*(b*x-t*sqrt(1-x^2))^2*(b-sqrt(1-x^2))^2-8*(x^2*(b^2-t^2)*(x^2-2+2*t*x-t^2)+t^2*(x^2+b^2-1)-(2*t*x-x^2)*(1+b^2+t^2-2*t*x)-2*b*sqrt(1-x^2)*((t-x)^2+t*x*(x^2+2*t*x-t^2-2)))^(1/2)*(b*x-t*sqrt(1-x^2))*(b-sqrt(1-x^2))+4*(x^2*(b^2-t^2)*(x^2-2+2*t*x-t^2)+t^2*(x^2+b^2-1)-(2*t*x-x^2)*(1+b^2+t^2-2*t*x)-2*b*sqrt(1-x^2)*((t-x)^2+t*x*(x^2+2*t*x-t^2-2)))))^(1/2)))^2 ], [x] ); Please help. Regards, Art Lenskold -------------- next part -------------- An HTML attachment was scrubbed... URL: From Carl.David at att.net Thu Sep 1 12:02:46 2011 From: Carl.David at att.net (Carl David) Date: Thu, 01 Sep 2011 13:02:46 -0400 Subject: [Maxima] wxmaxima loop control query Message-ID: <4E5FBAB6.6030300@att.net> I copied the following code from a tutorial on Maxima, and find that it does not wotk with wxMaxima: "FOR A:-3 THRU 26 STEP 7 DO LDISPLAY(A)$" I get the error : "(%i1) FOR A:-3 THRU 26 STEP 7 DO LDISPLAY(A)$ Incorrect syntax: a is not an infix operator FORSpaceA:" Am I doing something wrong? Thanks Carl David ^ -------------- next part -------------- An HTML attachment was scrubbed... URL: From phoenix.87103 at gmail.com Fri Sep 2 04:02:46 2011 From: phoenix.87103 at gmail.com (PHOENIX PERCIVAL) Date: Fri, 2 Sep 2011 14:32:46 +0530 Subject: [Maxima] Algorithm Message-ID: Hello, I would like to know how I could implement an algorithm in maxima. I want run the following algorithm; " Initialize: d=(3+sqrt(8))^n; d=(d+1/d)/2; b=-1; c=-d; s=0; For k=0 up to k=n-1, repeat: c=b-c; s=s+c*a_k; b=(k+n)*(k-n)*b/((k+0.5)*(k+1)); Output: s/d. " I am attaching the original PDF file of the algorithm. The one I want to run in maxima is 'Algorithm 1'. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sullivan at mathcom.com Sun Sep 4 11:01:22 2011 From: sullivan at mathcom.com (Steve Sullivan) Date: Sun, 4 Sep 2011 10:01:22 -0600 Subject: [Maxima] vector calculus Message-ID: <20110904160122.GA3963@mathcom.com> Hi, I'm a newbie to maxima and am trying to solve or at least simplify a pair of 3D equations. If v is a vector valued function of x, y, z: div(v) = 0 # del . v = 0 curl( cross( curl(v), v)) = 0 # del X ((del X v) X v) = 0 My attempts have been fruitless ... do you have any suggestions? load("vector3d.mac"); v : [vx,vy,vz]; depends([vx,vy,vz], [x,y,z]); solve( [div(v) = 0, curl( cross( curl(v), v)) = 0], v); Many thanks, Steve -- ======================================== Steve Sullivan sullivan at mathcom.com 303-494-7144 http://www.mathcom.com ======================================== From i7tyur5 at excite.fr Thu Sep 8 05:45:28 2011 From: i7tyur5 at excite.fr (i7tyur5) Date: Thu, 08 Sep 2011 12:45:28 +0200 Subject: [Maxima] integrate sin(t)/t^2 Message-ID: Hello, integrate((sin(t))/t^2, t, 1, inf); defint: integral is divergent. -- an error. To debug this try: debugmode(true); Why ? From piminusmeson at bk.ru Thu Sep 8 14:37:03 2011 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Thu, 08 Sep 2011 23:37:03 +0400 Subject: [Maxima] wxmaxima loop control query In-Reply-To: <4E5FBAB6.6030300@att.net> References: <4E5FBAB6.6030300@att.net> Message-ID: <4E69195F.4060002@bk.ru> > FOR A:-3 THRU 26 STEP 7 DO LDISPLAY(A)$ But this works: for a:-3 thru 26 step 7 do ldisplay(a)$ It seems that maxima requires small letters in operators. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlakelan at street-artists.org Thu Sep 8 15:36:58 2011 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 08 Sep 2011 13:36:58 -0700 Subject: [Maxima] How to graph an expression involving sum? In-Reply-To: <4E652C3A.8030806@street-artists.org> References: <4E652C3A.8030806@street-artists.org> Message-ID: <4E69276A.1080006@street-artists.org> On 09/05/2011 01:08 PM, dlakelan wrote: > I have a solution of a differential equation in terms of some fourier > series. I would like to graph one of the spatially varying coefficients, > so I tried something like: .... > What's the right way to go about graphing something like this? I should mention that I can do ev(coefseries,nouns) to convert the "sum" noun into an enormous + expression, but this slows things down considerably. If I am trying to simply do numerical calculations with the expression, is there a faster way to get the evaluation than to carry around a big symbolic expression? Is something like a lambda expression like this the way to go? lambda([x],ev(coefseries,avals,nouns,z=x,numer)) or does this just internally create and throw away the enormous + expression? From fateman at eecs.berkeley.edu Thu Sep 8 16:00:14 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 08 Sep 2011 14:00:14 -0700 Subject: [Maxima] wxmaxima loop control query In-Reply-To: <4E5FBAB6.6030300@att.net> References: <4E5FBAB6.6030300@att.net> Message-ID: <4E692CDE.70908@eecs.berkeley.edu> try lower case. for a .... etc rather than FOR A ... From biomates at telefonica.net Thu Sep 8 22:25:09 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 08 Sep 2011 23:25:09 -0400 Subject: [Maxima] list order / draw-points joined In-Reply-To: References: Message-ID: <4E698715.2090802@telefonica.net> On 09/07/2011 06:41 AM, Adam Majewski wrote: > Hi, > > I'm drawing circle l0 = {z:abs(z)=ER} > and its preimages : > l1={z1=sqrt(z) } > l2={z2:sqrt(z1)} > .... > > Program is below. > It works. > I can join points with lines only for first circle l0. > For its preimages no probably because of bad order of points. > > Can I order point according to it's argument ? Yes, l2_ordered: sort(l2, lambda([z1,z2], is(carg(z1) < carg(z2))))$ -- Mario From biomates at telefonica.net Thu Sep 8 23:09:01 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 09 Sep 2011 00:09:01 -0400 Subject: [Maxima] How to graph an expression involving sum? In-Reply-To: <4E652C3A.8030806@street-artists.org> References: <4E652C3A.8030806@street-artists.org> Message-ID: <4E69915D.4070305@telefonica.net> On 09/05/2011 04:08 PM, dlakelan wrote: > I have a solution of a differential equation in terms of some fourier > series. I would like to graph one of the spatially varying coefficients, > so I tried something like: > > draw2d(explicit(subst(avals,coefseries),z,0,1)); > > Where coefseries is something like a[0] + sum(a[i]*cos(...),i,1,17) and > avals are the values for a[0]...a[17] in a list of the form > [a[0]=...,a[1]=..., ...] > > but what the subst gives me is still in the form 1.234 + > sum(a[i]*cos(...)...), that is, subst substituted the constant > coefficient but of course not the individual coefficients in the sum > (since they only appear as a[i]). This is what I get: (%i12) display2d:false$ (%i13) avals: makelist(a[i]=random(10)-5,i,0,17); (%o13) [a[0] = -2,a[1] = -2,a[2] = 2,a[3] = 3,a[4] = -1,a[5] = 1,a[6] = 0, a[7] = -5,a[8] = 2,a[9] = 1,a[10] = 0,a[11] = -1,a[12] = 2,a[13] = -3, a[14] = 3,a[15] = -2,a[16] = -5,a[17] = 1] (%i14) coefseries: a[0] + sum(a[i]*cos(z*i*%pi),i,1,17); (%o14) a[17]*cos(17*%pi*z)+a[16]*cos(16*%pi*z)+a[15]*cos(15*%pi*z) +a[14]*cos(14*%pi*z)+a[13]*cos(13*%pi*z) +a[12]*cos(12*%pi*z)+a[11]*cos(11*%pi*z) +a[10]*cos(10*%pi*z)+a[9]*cos(9*%pi*z) +a[8]*cos(8*%pi*z)+a[7]*cos(7*%pi*z) +a[6]*cos(6*%pi*z)+a[5]*cos(5*%pi*z) +a[4]*cos(4*%pi*z)+a[3]*cos(3*%pi*z) +a[2]*cos(2*%pi*z)+a[1]*cos(%pi*z)+a[0] Don't you get this expanded expression? Perhaps I misunderstood your problem. -- Mario From biomates at telefonica.net Thu Sep 8 23:27:22 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 09 Sep 2011 00:27:22 -0400 Subject: [Maxima] Algorithm In-Reply-To: References: Message-ID: <4E6995AA.2090303@telefonica.net> On 09/02/2011 05:02 AM, PHOENIX PERCIVAL wrote: > Hello, > I would like to know how I could implement an algorithm in maxima. > I want run the following algorithm; > > " Initialize: d=(3+sqrt(8))^n; d=(d+1/d)/2; > b=-1; c=-d; s=0; > For k=0 up to k=n-1, repeat: > c=b-c; s=s+c*a_k; > b=(k+n)*(k-n)*b/((k+0.5)*(k+1)); > Output: s/d. " > > I am attaching the original PDF file of the algorithm. The one I want > to run in maxima is 'Algorithm 1'. > > Thank you. > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Hello, I'd suggest start reading the following documentation: ? block ? do ? := There are some simple examples there. In the share folder in your Maxima installation, there are lots of files with extension mac, which are written in Maxima language. Take a look at them to get an idea how Maxima functions look like. If you encounter problems, please let us know. -- Mario -------------- next part -------------- An HTML attachment was scrubbed... URL: From soichi777 at gmail.com Thu Sep 8 19:33:11 2011 From: soichi777 at gmail.com (ishi soichi) Date: Fri, 9 Sep 2011 09:33:11 +0900 Subject: [Maxima] defining a function that takes an array as an input Message-ID: Hi. I'm trying to develop a macro (or a function) that processes arrays. In the language of SymbolicC++, it looks like list function_name(const list &x, list g_array = list()) { //the function does calculations return g_array; } I'm sure that I can do a similar thing with Maxima. Could anyone give my an example? soichi -------------- next part -------------- An HTML attachment was scrubbed... URL: From rhyslpratt at yahoo.com.cn Thu Sep 8 19:52:58 2011 From: rhyslpratt at yahoo.com.cn (RLP) Date: Fri, 9 Sep 2011 08:52:58 +0800 Subject: [Maxima] gnuplot quits automatically In-Reply-To: <20110908204632.69ef7e21@linux-gbkp.site> References: <20110908204632.69ef7e21@linux-gbkp.site> Message-ID: <20110909085258.2596825b@linux-gbkp.site> On Thu, 8 Sep 2011 20:46:32 +0800 RLP wrote: > > The following code comes from manuals, It works except > that the pop-up gnuplot window will quit immediately as soon as the > mouse begins to move. > > So, How to prevent gnuplot from quitting? > > ==== code ==== > --> load(implicit_plot); > --> implicit_plot ([y^2=x, x*y^2-3*x*y+y+x^3-x^2+x=0] , [x, 1, 10], > [y, 0, 10], [gnuplot_preamble, "set zeroaxis"]); > ============== > I have just found a file "maxout.gnuplot" in the home directory, then I tried "gnuplot maxout.gnuplot" and caught the same result described above. So, I believe there may be something wrong related to gnuplot but maxima? It should be noted that plot2d functions normally. > gnuplot maxout.gnuplot plot '-' title "y^2 = x" with lines lt 3, '-' title "x*y^2-3*x*y+y+x^3-x^2+x = 0" with lines lt 1 ^ "maxout.gnuplot", line 927: warning: Skipping data file with no valid points gnuplot: xcb_io.c:221: poll_for_event: Assertion `(((long) (event_sequence) - (long) (dpy->request)) <= 0)' failed. gnuplot: xcb_io.c:221: poll_for_event: Assertion `(((long) (event_sequence) - (long) (dpy->request)) <= 0)' failed. Multiple segmentation faults occurred; can't display error dialog gnuplot: xcb_io.c:221: poll_for_event: Assertion `(((long) (event_sequence) - (long) (dpy->request)) <= 0)' failed. : Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0. From g.n.berman at gmail.com Fri Sep 9 05:08:22 2011 From: g.n.berman at gmail.com (Gregor Berman) Date: Fri, 9 Sep 2011 13:08:22 +0300 Subject: [Maxima] Initial- and boundary-value problems in Maxima. Message-ID: Hi there, I am looking for a decent Maxima numerical solver for initial-value problems, with adaptive step size and error control. As far I can tell, Maxima only has function rk() for this, but rk() is an implementation of a rather elementary 4th-order Runge-Kutta method, with constant step size and no error control. Such an algorithm is definitely not suitable for serious work. I am aware of excellent initial-value solvers implemented in Fortran, most notably LSODAR (included in ODEPACK ), which I use extensively in my Fortran programs (it is also included in Scilab). I wonder if I can use something similar in Maxima. If not, any decent solver for initial-value problems will do. The only way I can think is to use Maxima within Scilab, but I am looking for a neat Maxima way. Furthermore, I tried Maxima's version of colnew to solve boundary-value problems. It seems to be a direct f2cl translation of the well-known Fortran code, but it doesn't seem to work. Even the included examples prob1.mac and prob2.mac don't work as expected. Same with prob4.mac, included in the git version. In the case of prob1.mac, it almost hangs my computer, devouring all memory with no result. I used colnew in Fortran (even made a Fortran 90 interface for it), and it works remarkably well. However, I was not able to get any result with Maxima's version of colnew. Note that I am using Maxima 5.24, installed from Debian 64-bit repositories in a modern computer (Quad with lots of memory), so it should run at least included examples pretty fast. -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Fri Sep 9 05:09:52 2011 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 09 Sep 2011 11:09:52 +0100 Subject: [Maxima] gnuplot quits automatically In-Reply-To: <20110909085258.2596825b@linux-gbkp.site> References: <20110908204632.69ef7e21@linux-gbkp.site> <20110909085258.2596825b@linux-gbkp.site> Message-ID: <1315562992.1772.10.camel@B233-01> On Fri, 2011-09-09 at 08:52 +0800, RLP wrote: > > The following code comes from manuals, It works except > > that the pop-up gnuplot window will quit immediately as soon as the > > mouse begins to move. > > > > So, How to prevent gnuplot from quitting? > > > > ==== code ==== > > --> load(implicit_plot); > > --> implicit_plot ([y^2=x, x*y^2-3*x*y+y+x^3-x^2+x=0] , [x, 1, 10], > > [y, 0, 10], [gnuplot_preamble, "set zeroaxis"]); > > ============== Hi Xiang, you've found a bug in implicit_plot: it has failed to obtain any points in the region [x, 1, 10], [y, 0, 10] that satisfy the relation x*y^2-3*x*y+y+x^3-x^2+x=0 and instead of skiping that part, implicit_plot is sending a non-numeric output to Gnuplot. For the time being, until the bug is fixed, you can try changing the domain. For instance, the following should work for you: implicit_plot ([y^2=x, x*y^2-3*x*y+y+x^3-x^2+x=0], [x,-1,10], [y,-1,10]); Notice that in recent versions of Maxima there is no need for "set zeroaxis", since the axes will be shown by default. If you wanted Gnuplot not to show the axes, the preferred way would be to add the option [axes, false]. "gnuplot_preamble" is a very buggy option that should be avoided; you should better use one of the options listed in "Plotting Options" (type "? Plotting Options" in Maxima, or look them up in the manual). Best regards, Jaime From villate at fe.up.pt Fri Sep 9 05:22:10 2011 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 09 Sep 2011 11:22:10 +0100 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: References: Message-ID: <1315563730.1772.18.camel@B233-01> On Fri, 2011-09-09 at 13:08 +0300, Gregor Berman wrote: > I am looking for a decent Maxima numerical solver for initial-value > problems, with adaptive step size and error control. As far I can > tell, Maxima only has function rk() for this, but rk() is an > implementation of a rather elementary 4th-order Runge-Kutta method, > with constant step size and no error control. Such an algorithm is > definitely not suitable for serious work. > I am aware of excellent initial-value solvers implemented in Fortran, > most notably LSODAR (included in ODEPACK), which I use extensively in > my Fortran programs (it is also included in Scilab). I wonder if I can > use something similar in Maxima. If not, any decent solver for > initial-value problems will do. The only way I can think is to use > Maxima within Scilab, but I am looking for a neat Maxima way. Hi, the main focus of Maxima has been symbolic computations rather than numerical methods. rk was made just to let first-year undergraduate students play around with the Runge-Kutta method without getting lost with programming details. However, it should be easy to replace the 4th order Runge-Kutta method by any other method you want. You can find the Maxima code for rk() at the last 27 lines in the file: [Maxima-root]/share/dynamics/dynamics.mac Feel free to ask me for any help you need with the code. Regards, Jaime Villate (author of rk) From andre.maute at gmx.de Fri Sep 9 07:40:21 2011 From: andre.maute at gmx.de (andre maute) Date: Fri, 09 Sep 2011 14:40:21 +0200 Subject: [Maxima] unexpected behavior of simplify_sum In-Reply-To: References: <4E55034F.9080600@gmx.de> <4E5E3003.8050706@gmx.de> Message-ID: <4E6A0935.4030704@gmx.de> Could someone on the list open a bug report for me, because I don't have a sourceforge account. Thanks Andre Maute On 09/09/2011 01:25 PM, Andrej Vodopivec wrote: > This is a bug in nusum. > > (%i2) nusum(F(d,1,1,1,1,b2,l2), l2, 0, b2); > (%o2) 0 > > Basically, what nusum does is > > (%i3) load(zeilberger)$ > (%i4) ad: AntiDifference(F(d,1,1,1,1,b2,l2), l2)$ > (%i5) subst(l2=b2+1, ad) - subst(l2=0, ad)$ > factorial: factorial of negative integer -1 not defined. > -- an error. To debug this try: debugmode(true); > > The error comes from the upper bound. > > (%i6) subst(l2=b2+1, ad); > factorial: factorial of negative integer -1 not defined. > -- an error. To debug this try: debugmode(true); > > My guess is that nusum does not handle this error and just returns the > substitution of the lower bound > > (%i7) subst(l2=0, ad); > (%o7) 0 > > You could disable the nusum computation with use_gosper=false, but > then simplify_sum fails to compute the sum: > > (%i12) simplify_sum(%), use_gosper=false; > Is b2-1 positive, negative, or zero? pos; > Is d-2 positive, negative, or zero? pos; > Is d-1 positive, negative, or zero? pos; > Is d+b2-1 positive, negative, or zero? pos; > expt: undefined: 0 to a negative exponent. > (%o12) sum(((-1)^l2*(l2+d-1)!*(l2+d+b2-2)!)/((b2-l2)!*l2!*(l2+d-2)!*(l2+d+1)!),l2,0,b2) > > I don't have time to investigate this further. Maybe you can open a bugreport. > > --- > Andrej > > http://gplus.to/andrejv > > > > On Wed, Aug 31, 2011 at 2:58 PM, andre maute wrote: >> This is a repost, >> to attract someone's attention, because i got no response. >> >> Andre >> >> On 08/24/2011 03:57 PM, andre maute wrote: >>> Hi, >>> >>> I have the following test, with a sum depending on b2. >>> For general b2 simplify_sum gives an incorrect value. >>> >>> Andre >>> >>> ------- test-simplify_sum-1.max ----------- >>> >>> display2d : false; >>> >>> F(d,a1,k1,a2,k2,b2,l2) := block( >>> >>> [res:1], >>> >>> res : res/(b2-l2)!, >>> res : res/l2!, >>> res : res*(-1)^l2, >>> >>> res : res*(b2+l2+d-2)!, >>> res : res/(l2+d-2)!, >>> >>> res : res*(k2+l2+d-2)!, >>> res : res/(k2+l2+d-1+k1)!, >>> >>> return(res) >>> >>> ); >>> >>> load("simplify_sum"); >>> >>> s:sum(F(d,1,1,1,1,b2,l2),l2,0,b2); >>> h : simplify_sum(s); >>> h : factor(minfactorial(h)); >>> >>> s:sum(F(d,1,1,1,1,2,l2),l2,0,2); >>> h : simplify_sum(s); >>> h : factor(minfactorial(h)); >>> >>> ------- test-simplify_sum-1.max ----------- >>> >>> ------- test-simplify_sum-1.txt ----------- >>> >>> Maxima 5.19.2 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(test-simplify_sum-1.max) >>> >>> batching /home/user/progs/test-simplify_sum-1.max >>> (%i2) display2d : false >>> (%o2) false >>> (%i3) F(d,a1,k1,a2,k2,b2,l2):=block([res:1],res:res/(b2-l2)!,res:res/l2!, >>> res:res*(-1)^l2,res:res*(-2+d+l2+b2)!,res:res/(-2+d+l2)!, >>> res:res*(-2+d+l2+k2)!,res:res/(k1-1+d+l2+k2)!,return(res)) >>> (%o3) F(d,a1,k1,a2,k2,b2,l2):=block([res:1],res:res/(b2-l2)!,res:res/l2!, >>> res:res*(-1)^l2,res:res*(-2+d+l2+b2)!,res:res/(-2+d+l2)!, >>> res:res*(-2+d+l2+k2)!,res:res/(k1-1+d+l2+k2)!,return(res)) >>> (%i4) load("simplify_sum") >>> (%o4) >>> "/home/user/opt/maxima/share/maxima/5.19.2/share/contrib/solve_rec/simplify_sum.mac" >>> (%i5) s:sum(F(d,1,1,1,1,b2,l2),l2,0,b2) >>> (%o5) >>> 'sum((-1)^l2*(l2+d-1)!*(l2+d+b2-2)!/((b2-l2)!*l2!*(l2+d-2)!*(l2+d+1)!), >>> l2,0,b2) >>> (%i6) h:simplify_sum(s) >>> (%o6) 0 >>> (%i7) h:factor(minfactorial(h)) >>> (%o7) 0 >>> (%i8) s:sum(F(d,1,1,1,1,2,l2),l2,0,2) >>> (%o8) (d+1)!*(d+2)!/(2*d!*(d+3)!)-d!*(d+1)!/((d-1)!*(d+2)!) >>> +(d-1)!*d!/(2*(d-2)!*(d+1)!) >>> (%i9) h:simplify_sum(s) >>> (%o9) (d+1)!*(d+2)!/(2*d!*(d+3)!)-d!*(d+1)!/((d-1)!*(d+2)!) >>> +(d-1)!*d!/(2*(d-2)!*(d+1)!) >>> (%i10) h:factor(minfactorial(h)) >>> (%o10) -2/((d+1)*(d+2)*(d+3)) >>> (%o10) "/home/user/progs/test-simplify_sum-1.max" >>> >>> ------- test-simplify_sum-1.txt ----------- >>> _______________________________________________ >>> 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 fateman at eecs.berkeley.edu Fri Sep 9 11:00:24 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 09 Sep 2011 09:00:24 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: <1315563730.1772.18.camel@B233-01> References: <1315563730.1772.18.camel@B233-01> Message-ID: <4E6A3818.8050004@eecs.berkeley.edu> On 9/9/2011 3:22 AM, Jaime Villate wrote: > On Fri, 2011-09-09 at 13:08 +0300, Gregor Berman wrote: > >> I am looking for a decent Maxima numerical solver for initial-value >> problems, with adaptive step size and error control. As far I can >> tell, Maxima only has function rk() for this, but rk() is an >> implementation of a rather elementary 4th-order Runge-Kutta method, >> with constant step size and no error control. Such an algorithm is >> definitely not suitable for serious work. >> I am aware of excellent initial-value solvers implemented in Fortran, >> most notably LSODAR (included in ODEPACK), which I use extensively in >> my Fortran programs (it is also included in Scilab). I wonder if I can >> use something similar in Maxima. If not, any decent solver for >> initial-value problems will do. The only way I can think is to use >> Maxima within Scilab, but I am looking for a neat Maxima way. > Hi, > the main focus of Maxima has been symbolic computations rather than > numerical methods. rk was made just to let first-year undergraduate > students play around with the Runge-Kutta method without getting lost > with programming details. However, it should be easy to replace the 4th > order Runge-Kutta method by any other method you want. > > You can find the Maxima code for rk() at the last 27 lines in the file: > [Maxima-root]/share/dynamics/dynamics.mac > > Feel free to ask me for any help you need with the code. > > Regards, > > Jaime Villate > (author of rk) > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Jaime's code in dynamics.mac looks rather nice. If the changes needed to make it "decent" are to add adaptive step size and error control, it would be great to add that. If the term "decent" in Gregor Berman's original post also means "much faster" then a different tactic may be necessary. Typically this means writing out the function-evaluation parts into fortran-syntax files, compiling them and linking with fortran programs, and communicating with Maxima / plotting/ etc. This kind of setup has been used in the past, but tends to be more delicate -- for example, not all of the operating systems/lisps that support Maxima will manage such connections to fortran in the same way. Also, the programs that spew out fortran syntax may not be as sophisticated as needed. An intermediate possibility exists, which is to use lisp rather than Maxima language / [even compiled Maxima language] which should be considerably faster. There are other points to note: the arithmetic in Maxima can be altered to be higher precision, and so the treatment of sensitive parts of the solver can be modified to take smaller steps and also do the arithmetic to (arbitrarily) high precision if this would help. RJF From drdieterkaiser at web.de Fri Sep 9 11:32:00 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 09 Sep 2011 18:32:00 +0200 Subject: [Maxima] dispatching simplim%function In-Reply-To: References: Message-ID: <1315585920.20648.9.camel@dieter> Am Samstag, den 03.09.2011, 08:18 -0500 schrieb Barton Willis: > Shouldn't limit dispatch the simplim%function earlier? Consider > > (%i8) :lisp(trace simplim%bessel_j) > (SIMPLIM%BESSEL_J) > > These cases do not dispatch the simplim%function (what mechanism decides that bessel_j is continuous?) > > (%i8) limit(bessel_j(0,x),x,a); > (%o8) bessel_j(0,a) > > (%i9) limit(bessel_j(0,x),x,0); > (%o9) 1 > > (%i10) limit(bessel_j(a,x),x,0); > (%o10) bessel_j(a,0) > > (%i11) limit('(bessel_j(a,x)),x,a); > (%o11) bessel_j(a,a) > > Finally, limit dispatches simplim%bessel_j > > (%i12) limit(bessel_j(a,x),x,inf); > 1> (SIMPLIM%BESSEL_J ((%BESSEL_J SIMP) $A $X) $X $INF) > <1 (SIMPLIM%BESSEL_J 0) > (%o12) 0 > > How can I prevent the limit from assuming continuity and call the simplim%function? > > --Barton (who was trying to get limits to work for the generalized Lambert function) The above limits are calculated in the function simplimit. The function simplimit first calls the functions simplimsubst, which returns the results from above. This is a trace: (%i2) limit(bessel_j(0,x),x,a); 0: (SIMPLIMIT ((%BESSEL_J SIMP) 0 ((MPLUS SIMP) $A #:G1056)) #:G1056 $ZEROA) 1: (SIMPLIMSUBST $ZEROA ((%BESSEL_J SIMP) 0 ((MPLUS SIMP) $A #:G1056))) 1: SIMPLIMSUBST returned ((%BESSEL_J SIMP) 0 $A) 0: SIMPLIMIT returned ((%BESSEL_J SIMP) 0 $A) 0: (SIMPLIMIT ((%BESSEL_J SIMP) 0 ((MPLUS SIMP) $A #:G1056)) #:G1056 $ZEROB) 1: (SIMPLIMSUBST $ZEROB ((%BESSEL_J SIMP) 0 ((MPLUS SIMP) $A #:G1056))) 1: SIMPLIMSUBST returned ((%BESSEL_J SIMP) 0 $A) 0: SIMPLIMIT returned ((%BESSEL_J SIMP) 0 $A) (%o2) bessel_j(0, a) For the following functions simplimsubst is not called: sin, cos, atanh, cosh, sinh, tanh, factorial, and log These functions have special code to get the limit. Perhaps it is the best to check first for a simplim%function, which should handle all special cases. By the way: The special handling of some functions in simplimit can be reimplemented as a simplim%function. This approach would be much clearer. Dieter Kaiser From toy.raymond at gmail.com Fri Sep 9 12:42:38 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 9 Sep 2011 10:42:38 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: References: Message-ID: On Fri, Sep 9, 2011 at 3:08 AM, Gregor Berman wrote: > Hi there, > > I am looking for a decent Maxima numerical solver for initial-value > problems, with adaptive step size and error control. As far I can tell, > Maxima only has function rk() for this, but rk() is an implementation of a > rather elementary 4th-order Runge-Kutta method, with constant step size and > no error control. Such an algorithm is definitely not suitable for serious > work. > I am aware of excellent initial-value solvers implemented in Fortran, most > notably LSODAR (included in ODEPACK ), > which I use extensively in my Fortran programs (it is also included in > Scilab). I wonder if I can use something similar in Maxima. If not, any It turns out that f2cl includes a translation of ODEPACK that passes the odepack test cases. I think LSODAR is included. It would be possible to integrate this with maxima, but it might take some time. Furthermore, I tried Maxima's version of colnew to solve boundary-value > problems. It seems to be a direct f2cl translation of the well-known Fortran > code, but it doesn't seem > to work. Even the included examples prob1.mac and prob2.mac don't work as > expected. Could be code rot, but these tests did work at one point, and colnew was known to work, even for the more difficult but interesting case of restarting a solution from an old solution. I will have to look up some old emails and such to find out what happened and how to use it. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlakelan at street-artists.org Fri Sep 9 14:28:28 2011 From: dlakelan at street-artists.org (dlakelan) Date: Fri, 09 Sep 2011 12:28:28 -0700 Subject: [Maxima] How to graph an expression involving sum? In-Reply-To: <4E69915D.4070305@telefonica.net> References: <4E652C3A.8030806@street-artists.org> <4E69915D.4070305@telefonica.net> Message-ID: <4E6A68DC.80603@street-artists.org> On 09/08/2011 09:09 PM, Mario Rodriguez wrote: > On 09/05/2011 04:08 PM, dlakelan wrote: >> I have a solution of a differential equation in terms of some fourier >> series. I would like to graph one of the spatially varying coefficients, >> so I tried something like: >> >> draw2d(explicit(subst(avals,coefseries),z,0,1)); >> >> Where coefseries is something like a[0] + sum(a[i]*cos(...),i,1,17) and >> avals are the values for a[0]...a[17] in a list of the form >> [a[0]=...,a[1]=..., ...] >> >> but what the subst gives me is still in the form 1.234 + >> sum(a[i]*cos(...)...), that is, subst substituted the constant >> coefficient but of course not the individual coefficients in the sum >> (since they only appear as a[i]). > This is what I get: > > > (%i12) display2d:false$ > > (%i13) avals: makelist(a[i]=random(10)-5,i,0,17); > > (%o13) [a[0] = -2,a[1] = -2,a[2] = 2,a[3] = 3,a[4] = -1,a[5] = 1,a[6] = 0, > a[7] = -5,a[8] = 2,a[9] = 1,a[10] = 0,a[11] = -1,a[12] = 2,a[13] > = -3, > a[14] = 3,a[15] = -2,a[16] = -5,a[17] = 1] > (%i14) coefseries: a[0] + sum(a[i]*cos(z*i*%pi),i,1,17); > > (%o14) a[17]*cos(17*%pi*z)+a[16]*cos(16*%pi*z)+a[15]*cos(15*%pi*z) > +a[14]*cos(14*%pi*z)+a[13]*cos(13*%pi*z) > +a[12]*cos(12*%pi*z)+a[11]*cos(11*%pi*z) > +a[10]*cos(10*%pi*z)+a[9]*cos(9*%pi*z) > +a[8]*cos(8*%pi*z)+a[7]*cos(7*%pi*z) > +a[6]*cos(6*%pi*z)+a[5]*cos(5*%pi*z) > +a[4]*cos(4*%pi*z)+a[3]*cos(3*%pi*z) > +a[2]*cos(2*%pi*z)+a[1]*cos(%pi*z)+a[0] > > Don't you get this expanded expression? Perhaps I misunderstood your > problem. coefseries variable contains the noun form of the sum, I seem to have quoted it when I created it so that it wouldn't expand. If I force it to evaluate with the flag "nouns" i can get it expanded. Is that the right way to go about it, or is there a way where I don't have to expand the expression but can still get numerical evaluation? in other words, where maxima will calculate the numerical sum without constructing and carrying around a potentially long symbolic expression? From kcrisman at gmail.com Fri Sep 9 14:39:50 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Fri, 9 Sep 2011 15:39:50 -0400 Subject: [Maxima] integrate sin(t)/t^2 Message-ID: Yeah, I'm a little surprised at this as well. http://www.wolframalpha.com/input/?i=integrate+sin%28x%29%2Fx%5E2+from+1+to+infinity integral_1^infinity(sin(x))/x^2 dx = sin(1)-Ci(1)~~0.504067 But Maxima does have the sine and cosine integral now, http://maxima.sourceforge.net/docs/manual/en/maxima_15.html#SEC80 I have no idea how easy this would be to add to the integration, though. From dlakelan at street-artists.org Fri Sep 9 17:11:52 2011 From: dlakelan at street-artists.org (dlakelan) Date: Fri, 09 Sep 2011 15:11:52 -0700 Subject: [Maxima] vector calculus In-Reply-To: <20110904160122.GA3963@mathcom.com> References: <20110904160122.GA3963@mathcom.com> Message-ID: <4E6A8F28.6080003@street-artists.org> On 09/04/2011 09:01 AM, Steve Sullivan wrote: > Hi, > > I'm a newbie to maxima and am trying to solve > or at least simplify a pair of 3D equations. > > If v is a vector valued function of x, y, z: > div(v) = 0 # del . v = 0 > curl( cross( curl(v), v)) = 0 # del X ((del X v) X v) = 0 > > My attempts have been fruitless ... do you have any suggestions? > > load("vector3d.mac"); > > v : [vx,vy,vz]; > depends([vx,vy,vz], [x,y,z]); > > solve( [div(v) = 0, curl( cross( curl(v), v)) = 0], v); Since v is a vector field, and the equations you've given are (partial) differential equations there need to be at least some boundary conditions described. unless I'm being silly and there is only a single vector field that can satisfy these equations (perhaps the constant field or something like that) this is simply not the kind of thing you can hand to maxima's solve and expect an answer from. Solve is basically for solving algebraic equations. what did you expect or want Maxima to do here? Perhaps we can point you to something more helpful. From robert.dodier at gmail.com Sat Sep 10 00:17:04 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 9 Sep 2011 23:17:04 -0600 Subject: [Maxima] How to graph an expression involving sum? In-Reply-To: <4E652C3A.8030806@street-artists.org> References: <4E652C3A.8030806@street-artists.org> Message-ID: On 9/5/11, dlakelan wrote: > I have a solution of a differential equation in terms of some fourier > series. I would like to graph one of the spatially varying coefficients, > so I tried something like: > > draw2d(explicit(subst(avals,coefseries),z,0,1)); > > Where coefseries is something like a[0] + sum(a[i]*cos(...),i,1,17) and > avals are the values for a[0]...a[17] in a list of the form > [a[0]=...,a[1]=..., ...] > > but what the subst gives me is still in the form 1.234 + > sum(a[i]*cos(...)...), that is, subst substituted the constant > coefficient but of course not the individual coefficients in the sum > (since they only appear as a[i]). > > What's the right way to go about graphing something like this? After thinking about this for a bit, the only way I can see to make it work is to bind the values a[0], a[1], etc so that evaluation pulls them into the sum. I.e. you need a[i]:whatever instead of a[i]=whatever. Then you don't need any special evaluation of coefseries; plot2d(coefseries, [z, 0, 1]) has the expected effect, probably draw as well. If it's important to avoid collisions (multiple uses of the symbol a or something like that) probably one could play games with gensym or something like that. Incidentally it would help others understand the problem if you just paste in whatever non-working code you have. best Robert Dodier From g.n.berman at gmail.com Sat Sep 10 01:50:29 2011 From: g.n.berman at gmail.com (Gregor Berman) Date: Sat, 10 Sep 2011 09:50:29 +0300 Subject: [Maxima] Initial- and boundary-value problems in Maxima. Message-ID: >Jaime's code in dynamics.mac looks rather nice. If the changes >needed to make it "decent" are to add adaptive step size and >error control, it would be great to add that. > >If the term "decent" in Gregor Berman's original post >also means "much faster" then a different tactic may be necessary. >Typically this means writing out the function-evaluation parts into >fortran-syntax files, compiling them and linking with fortran >programs, and communicating with Maxima / plotting/ etc. This >kind of setup has been used in the past, but tends to be more >delicate -- for example, not all of the operating systems/lisps >that support Maxima will manage such connections to fortran in >the same way. Also, the programs that spew out fortran syntax >may not be as sophisticated as needed. > >An intermediate possibility exists, which is to use lisp >rather than Maxima language / [even compiled Maxima language] >which should be considerably faster. > >There are other points to note: the arithmetic in Maxima can be >altered to be higher precision, and so the treatment of sensitive >parts of the solver can be modified to take smaller steps and also >do the arithmetic to (arbitrarily) high precision if this would >help. > >RJF English is not my native language, I am really sorry if the term "decent" was not polite or appropriate. It didn't meant to be rude or anything. Now, rk() is nice, but implements a rather introductory algorithm, still useful for some experiments (students often ask for such a neat Runge-Kutta method implementation, because it is what they learn in their first lesson in Numerical Analysis). However, constant step size is never used for serious work, for two reasons. First, it is not possible to know in advance how many steps will be needed for an accurate solution; that always depends from the specific problem at hand. Second, in most cases, one needs to use a very small constant step to get an accurate solution, although that small step is only needed for a small part of the integration range, while a much larger step is more than sufficient for the rest. This makes constant step methods very slow. I understand that the main focus of Maxima has been symbolic computations rather than numerical methods. However, it is not easy to find a realistic problem, taken from Physics or other sciences, for which a complete analytic solution is possible. Even a very simple mechanical system, such as the pendulum, is described mathematically in a way that numerical solutions are necessary. For that reason, nearly all Computer Algebra Systems have built-in support for numerical computations, using implementations of numerical algorithms in the background. Most of them are translations of well-tested Fortran programs, mainly posted in http://www.netlib.org. I understand how rk() works. I believe a small correction should be made at line 13 of the code (line 391 of dynamics.mac), which reads if (not(numberp(last(apply(f_rk_4,cons(t0,xxx)))))) then This line catches an error in the initial conditions only if it happens at the last initial condition in list. For example, initial conditions like [1,0,k] will be detected as erroneous (provided k is not defined), but initial conditions like [1,k,0] will not. I think this line should be replaced with if member(false,map(numberp,apply(f_rk_4,cons(t0,xxx)))) then This ensures any non-numerical initial condition will be detected. I'll be back with a Maxima implementation of a initial-value problems solver, with built-in step size control soon. -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Sat Sep 10 03:39:23 2011 From: talon at lpthe.jussieu.fr (talon at lpthe.jussieu.fr) Date: Sat, 10 Sep 2011 10:39:23 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: Message-ID: Raymond Toy wrote: > > > Could be code rot, but these tests did work at one point, and colnew was > known to work, even for the more difficult but interesting case of > restarting a solution from an old solution. I will have to look up some > old emails and such to find out what happened and how to use it. > > Ray Colnew certainly works in maxima, at least the maxima version i have, and i have run all the examples with the expected results. For reference i have used maxima compiled with cmucl and sbcl, i don't have any idea if other lisps work as well. I have been lazy during the holidays, i wanted to produce a more automated version for using colnew under maxima, but instead i went to the beach. In fact most is written, but as always the last 10% is the harder to finalize! In the automated version one should provide the equations and boundary conditions and maxima should provide all the considerable administrativia that are required by colnew. Anyways the probi.mac exemplify how to use colnew in a version close to the original fortran program. Notably the last one (prob3.mac or prob4.mac, i don't remember solve a case of some complexity, with continuation, etc.). At the moment, cloning these examples is the way to use colnew, but the basics are here since several years thanks to Raymond Toy. For this last example, i have carefully compared the output of fortran colnew and maxima colnew and can assure that maxima colnew is correct (up to the last couple of decimals). Performancewise, unfortunately, maxima colnew is *much* slower than fortran colnew. One can expect a factor of 100 slower. Raymond and i have measured the time spent in various parts of the program. The principal part is spent in the evaluation of the differential equation at the mesh points. Since it is given in maxima this requires an excursion in maxima land thus is slow. One cannot do anything about that. The same occurs for similar problems in maple or mathematica. More worrisome, a non negligible part of the time is spent in linear algebra computations which should be as fast as in fortran if lisp was similarly fast as fortran, as some people claim. But in fact these computations are also 100 times slower than in fortran, while being pure lisp stuff. Of course this was a major disappointment for me. Anyways the considered example runs in about 2 mn on my old machine. So the end of the story is that maxima colnew will be performance impaired, but it may be *much much* easier to use than the fortran version if an appropriate wrapper is completed. I agree with the original poster that colnew is a fantastic program to solve that kind of problems, by far the best i know. -- Michel Talon From biomates at telefonica.net Sat Sep 10 10:26:42 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Sat, 10 Sep 2011 11:26:42 -0400 Subject: [Maxima] Problem with save Message-ID: <4E6B81B2.3040404@telefonica.net> Hello, I get the following results (clisp and sbcl): (%i1) m:makelist(k,k,105)$ (%i2) save("filename",m) $ (%i3) load("filename") $ loadfile: failed to load filename -- an error. To debug this try: debugmode(true); This is the contents of filename. List m has not been completely saved and load then fails. ;;; -*- Mode: LISP; package:maxima; syntax:common-lisp; -*- (in-package :maxima) (DSKSETQ $M '((MLIST SIMP) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...)) (ADD2LNC '$M $VALUES) I think this problem didn't arise in the past. -- Mario From talon at lpthe.jussieu.fr Sat Sep 10 06:20:41 2011 From: talon at lpthe.jussieu.fr (talon at lpthe.jussieu.fr) Date: Sat, 10 Sep 2011 13:20:41 +0200 Subject: [Maxima] Problem with save References: <4E6B81B2.3040404@telefonica.net> Message-ID: Mario Rodriguez wrote: > Hello, > > I get the following results (clisp and sbcl): > > (%i1) m:makelist(k,k,105)$ > (%i2) save("filename",m) $ > (%i3) load("filename") $ > loadfile: failed to load filename > -- an error. To debug this try: debugmode(true); > > > This is the contents of filename. List m has not been completely saved > and load then fails. > > ;;; -*- Mode: LISP; package:maxima; syntax:common-lisp; -*- > (in-package :maxima) > (DSKSETQ $M > '((MLIST SIMP) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 > 22 23 24 25 26 27 28 29 30 31 > 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 > 55 56 57 58 59 60 61 62 63 > 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 > 87 88 89 90 91 92 93 94 95 > 96 97 98 99 ...)) > (ADD2LNC '$M $VALUES) > > > I think this problem didn't arise in the past. > > -- > Mario I had similar problem when i was doing computations with maxima 2 years ago. I think you need to close maxima to flush all buffers then the file will be complete, and you can load it. Perhaps there is a command to flush IO buffers, but on any Unix machine IO is buffered until you call flush() or terminate the program. -- Michel Talon From macrakis at alum.mit.edu Sat Sep 10 06:49:06 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 10 Sep 2011 07:49:06 -0400 Subject: [Maxima] Problem with save In-Reply-To: <4E6B81B2.3040404@telefonica.net> References: <4E6B81B2.3040404@telefonica.net> Message-ID: I can't check this right now, but I suspect this comes from the recent global change to *print-level* and *print-length*. Clearly those need to be bound to nil for "save" operations, and *print-circle* to T. Until this gets fixed in Maxima, try :lisp (setq *print-level* nil *print-length* nil) or equivalently \*print\-level\*: \*print\-length\*: false$ before your 'save'. -s On Sat, Sep 10, 2011 at 11:26, Mario Rodriguez wrote: > Hello, > > I get the following results (clisp and sbcl): > > (%i1) m:makelist(k,k,105)$ > (%i2) save("filename",m) $ > (%i3) load("filename") $ > loadfile: failed to load filename > -- an error. To debug this try: debugmode(true); > > > This is the contents of filename. List m has not been completely saved and > load then fails. > > ;;; -*- Mode: LISP; package:maxima; syntax:common-lisp; -*- > (in-package :maxima) > (DSKSETQ $M > '((MLIST SIMP) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 > 24 25 26 27 28 29 30 31 > 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 > 56 57 58 59 60 61 62 63 > 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 > 88 89 90 91 92 93 94 95 > 96 97 98 99 ...)) > (ADD2LNC '$M $VALUES) > > > I think this problem didn't arise in the past. > > -- > 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: From l.couraud at gmail.com Sat Sep 10 07:06:46 2011 From: l.couraud at gmail.com (laurent couraud) Date: Sat, 10 Sep 2011 14:06:46 +0200 Subject: [Maxima] RE : How to graph an expression involving sum? In-Reply-To: <4E6A68DC.80603@street-artists.org> Message-ID: > -----Message d'origine----- > De?: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] De la part de > dlakelan > Envoy??: vendredi 9 septembre 2011 21:28 > ??: maxima at math.utexas.edu > Objet?: Re: [Maxima] How to graph an expression involving sum? > > On 09/08/2011 09:09 PM, Mario Rodriguez wrote: > > On 09/05/2011 04:08 PM, dlakelan wrote: > >> I have a solution of a differential equation in terms of some fourier > >> series. I would like to graph one of the spatially varying coefficients, > >> so I tried something like: > >> > >> draw2d(explicit(subst(avals,coefseries),z,0,1)); > >> > >> Where coefseries is something like a[0] + sum(a[i]*cos(...),i,1,17) and > >> avals are the values for a[0]...a[17] in a list of the form > >> [a[0]=...,a[1]=..., ...] > >> > >> but what the subst gives me is still in the form 1.234 + > >> sum(a[i]*cos(...)...), that is, subst substituted the constant > >> coefficient but of course not the individual coefficients in the sum > >> (since they only appear as a[i]). > > This is what I get: > > > > > > (%i12) display2d:false$ > > > > (%i13) avals: makelist(a[i]=random(10)-5,i,0,17); > > > > (%o13) [a[0] = -2,a[1] = -2,a[2] = 2,a[3] = 3,a[4] = -1,a[5] = 1,a[6] = 0, > > a[7] = -5,a[8] = 2,a[9] = 1,a[10] = 0,a[11] = -1,a[12] = 2,a[13] > > = -3, > > a[14] = 3,a[15] = -2,a[16] = -5,a[17] = 1] > > (%i14) coefseries: a[0] + sum(a[i]*cos(z*i*%pi),i,1,17); > > > > (%o14) a[17]*cos(17*%pi*z)+a[16]*cos(16*%pi*z)+a[15]*cos(15*%pi*z) > > +a[14]*cos(14*%pi*z)+a[13]*cos(13*%pi*z) > > +a[12]*cos(12*%pi*z)+a[11]*cos(11*%pi*z) > > +a[10]*cos(10*%pi*z)+a[9]*cos(9*%pi*z) > > +a[8]*cos(8*%pi*z)+a[7]*cos(7*%pi*z) > > +a[6]*cos(6*%pi*z)+a[5]*cos(5*%pi*z) > > +a[4]*cos(4*%pi*z)+a[3]*cos(3*%pi*z) > > +a[2]*cos(2*%pi*z)+a[1]*cos(%pi*z)+a[0] > > > > Don't you get this expanded expression? Perhaps I misunderstood your > > problem. > > coefseries variable contains the noun form of the sum, I seem to have > quoted it when I created it so that it wouldn't expand. If I force it to > evaluate with the flag "nouns" i can get it expanded. Is that the right > way to go about it, or is there a way where I don't have to expand the > expression but can still get numerical evaluation? in other words, where > maxima will calculate the numerical sum without constructing and > carrying around a potentially long symbolic expression? > Hi, If I understand well your problem you want sum command to evaluate the a[i] "Just In Time". If so, if your expressions don't need sum's specific simplification, then you can write your own sum command. That will be just a loop and a method to read the value of the a[i] from your list and maybe some call to ratsimp or trigsimp or so. Just an idea... Best. Laurent. > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Sat Sep 10 07:59:48 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 10 Sep 2011 08:59:48 -0400 Subject: [Maxima] How to graph an expression involving sum? In-Reply-To: <4E69276A.1080006@street-artists.org> References: <4E652C3A.8030806@street-artists.org> <4E69276A.1080006@street-artists.org> Message-ID: I would suggest defining a function in expanded form then compiling it: myfun(x) := ( mode_declare(x,float), ''(ev(coefseries,nouns)) ) $ (that's two single-quotes, not one double-quote) compile(myfun)$ plot2d( myfun, ... ) It would also be possible to convert the sum into a loop and the a[i]= into a[i]:, but that is more work for the same result. -s On Thu, Sep 8, 2011 at 16:36, dlakelan wrote: > On 09/05/2011 01:08 PM, dlakelan wrote: > > I have a solution of a differential equation in terms of some fourier > > series. I would like to graph one of the spatially varying coefficients, > > so I tried something like: > .... > > What's the right way to go about graphing something like this? > > I should mention that I can do ev(coefseries,nouns) to convert the "sum" > noun into an enormous + expression, but this slows things down > considerably. If I am trying to simply do numerical calculations with > the expression, is there a faster way to get the evaluation than to > carry around a big symbolic expression? Is something like a lambda > expression like this the way to go? > > lambda([x],ev(coefseries,avals,nouns,z=x,numer)) > > or does this just internally create and throw away the enormous + > expression? > > _______________________________________________ > 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 p.j.papasot at gmail.com Sat Sep 10 11:43:12 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Sat, 10 Sep 2011 19:43:12 +0300 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: References: Message-ID: ???? ???????, 10 ??????????? 2011, ? ??????? ??????: > Raymond Toy wrote: > >> >> >> Could be code rot, but these tests did work at one point, and colnew was >> known to work, even for the more difficult but interesting case of >> restarting a solution from an old solution. I will have to look up some >> old emails and such to find out what happened and how to use it. >> >> Ray > > Colnew certainly works in maxima, at least the maxima version i have, > and i have run all the examples with the expected results. For reference > i have used maxima compiled with cmucl and sbcl, i don't have any idea > if other lisps work as well. > > I have been lazy during the holidays, i wanted to produce a more automated > version for using colnew under maxima, but instead i went to the beach. > In fact most is written, but as always the last 10% is the harder to > finalize! In the automated version one should provide the equations and > boundary conditions and maxima should provide all the considerable > administrativia that are required by colnew. > > Anyways the probi.mac exemplify how to use colnew in a version close to the > original fortran program. Notably the last one (prob3.mac or prob4.mac, i > don't remember solve a case of some complexity, with continuation, etc.). > At the moment, cloning these examples is the way to use colnew, but the > basics are here since several years thanks to Raymond Toy. For this last > example, i have carefully compared the output of fortran colnew and maxima > colnew and can assure that maxima colnew is correct (up to the last couple > of decimals). > > Performancewise, unfortunately, maxima colnew is *much* slower than fortran > colnew. One can expect a factor of 100 slower. Raymond and i have measured > the time spent in various parts of the program. The principal part is spent > in the evaluation of the differential equation at the mesh points. Since it > is given in maxima this requires an excursion in maxima land thus is slow. > One cannot do anything about that. The same occurs for similar problems in > maple or mathematica. More worrisome, a non negligible part of the time is > spent in linear algebra computations which should be as fast as in fortran > if lisp was similarly fast as fortran, as some people claim. But in fact > these computations are also 100 times slower than in fortran, while being > pure lisp stuff. Of course this was a major disappointment for me. > Anyways the considered example runs in about 2 mn on my old machine. > So the end of the story is that maxima colnew will be performance impaired, > but it may be *much much* easier to use than the fortran version if an > appropriate wrapper is completed. I agree with the original poster that > colnew is a fantastic program to solve that kind of problems, by far the > best i know. > > > > -- > Michel Talon > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > There must be a bug concerning colnew in maxima 5.24, because even examples in share/colnew don't work for me. I am quite familiar with that package but still can't use it in maxima (installed from debian's 64-bit repositories). Anyway, I wrote a Fortran 90 interface that facilitates the use of colnew, as most arguments are set to optimal values automatically (but still supporting all "extra" capabilities via optional arguments). If someone needs it, drop me an email. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlakelan at street-artists.org Sat Sep 10 12:49:41 2011 From: dlakelan at street-artists.org (dlakelan) Date: Sat, 10 Sep 2011 10:49:41 -0700 Subject: [Maxima] How to graph an expression involving sum? In-Reply-To: References: <4E652C3A.8030806@street-artists.org> <4E69276A.1080006@street-artists.org> Message-ID: <4E6BA335.1060707@street-artists.org> On 09/10/2011 05:59 AM, Stavros Macrakis wrote: > I would suggest defining a function in expanded form then compiling it: > > myfun(x) := ( mode_declare(x,float), ''(ev(coefseries,nouns)) ) $ > (that's two single-quotes, not one double-quote) > compile(myfun)$ > plot2d( myfun, ... ) > > It would also be possible to convert the sum into a loop and the a[i]= into > a[i]:, but that is more work for the same result. Thanks Stavros, I think this is exactly what I was looking for. From talon at lpthe.jussieu.fr Sat Sep 10 13:30:24 2011 From: talon at lpthe.jussieu.fr (talon at lpthe.jussieu.fr) Date: Sat, 10 Sep 2011 20:30:24 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: Message-ID: Panagiotis Papasotiriou wrote: >> > There must be a bug concerning colnew in maxima 5.24, because even > examples in share/colnew don't work for me. I am quite familiar with that > package but still can't use it in maxima (installed from debian's 64-bit > repositories). Anyway, I wrote a Fortran 90 interface that facilitates the > use of colnew, as most arguments are set to optimal values automatically > (but still supporting all "extra" capabilities via optional arguments). If > someone needs it, drop me an email. This may be the case. I have an "old" version: niobe% \maxima Maxima 5.22.1 http://maxima.sourceforge.net using Lisp CMU Common Lisp 20a (20A Unicode) but with more recent versions of the colnew wrapper, and indeed you are right, prob1.mac and prob2.mac don't run, while they were certainly working without these modifications. More strange, the program we used to do these modifications runs OK. For reference it is here: http://www.lpthe.jussieu.fr/~talon/prob3.mac while the corresponding fortran program is here: http://www.lpthe.jussieu.fr/~talon/prob3.f If i remember well the modifications that Raymond did to colnew-if.lisp were mainly to facilitate profiling. A bug has unfortunately been introduced. Indeed i have this check: (the old version of the wrapper is available here: http://www.lpthe.jussieu.fr/~talon/colnew-if.lisp.old). niobe% maxima (%i1) load(colnew); ;; Loading #P"/home/michel/.maxima/binary/binary-cmucl/share/colnew/binary-cmucl/colnew-package.sse2f". ..... (%i2) load("colnew-if.lisp.old"); (%o2) /usr/local/share/maxima/5.22.1/share/colnew/colnew-if.lisp.old (%i3) load("prob1.mac"); VERSION *COLNEW* OF COLSYS . THE MAXIMUM NUMBER OF SUBINTERVALS IS MIN ( 12 (ALLOWED FROM FSPACE), 16 (ALLOWED FROM ISPACE) ) THE NEW MESH (OF 1 SUBINTERVALS), 1.000000 2.000000 THE NEW MESH (OF 2 SUBINTERVALS), 1.000000 1.500000 2.000000 THE NEW MESH (OF 4 SUBINTERVALS), 1.000000 1.250000 1.500000 1.750000 2.000000 The exact errors are: 1.7389e-10 6.2679e-9 2.1843e-7 9.5743e-6 (%o3) /usr/local/share/maxima/5.22.1/share/colnew/prob1.mac So reloading the old version of the wrapper, prob1.mac works. But on the other hand prob3.mac now crashes: (%i4) load("prob3.mac"); VERSION *COLNEW* OF COLSYS . THE MAXIMUM NUMBER OF SUBINTERVALS IS MIN ( 117 (ALLOWED FROM FSPACE), 124 (ALLOWED FROM ISPACE) ) THE NEW MESH (OF 4 SUBINTERVALS), 0.000000 0.500000 1.000000 1.450000 1.900000 Too few arguments supplied to gsub(i, z1, z2, z3, z4); found: [1, [- 1.0, 2.0, 1.0, .3571428571428572, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]] -- an error. To debug this try: debugmode(true); Apparently there is a difference in the way to call the arguments. -- Michel Talon From mzou at math.utexas.edu Sat Sep 10 13:55:26 2011 From: mzou at math.utexas.edu (Maorong Zou) Date: Sat, 10 Sep 2011 13:55:26 -0500 Subject: [Maxima] Initial- and boundary-value problems in Maxima. Message-ID: <143h1pcu00ludadsfsudqbe7.1315680926954@email.android.com> talon at lpthe.jussieu.fr wrote: >Panagiotis Papasotiriou wrote: > > >>> >> There must be a bug concerning colnew in maxima 5.24, because even >> examples in share/colnew don't work for me. I am quite familiar with that >> package but still can't use it in maxima (installed from debian's 64-bit >> repositories). Anyway, I wrote a Fortran 90 interface that facilitates the >> use of colnew, as most arguments are set to optimal values automatically >> (but still supporting all "extra" capabilities via optional arguments). If >> someone needs it, drop me an email. > >This may be the case. I have an "old" version: >niobe% \maxima >Maxima 5.22.1 http://maxima.sourceforge.net >using Lisp CMU Common Lisp 20a (20A Unicode) > >but with more recent versions of the colnew wrapper, and indeed you are >right, prob1.mac and prob2.mac don't run, while they were certainly working >without these modifications. > >More strange, the program we used to do these modifications runs OK. For >reference it is here: >http://www.lpthe.jussieu.fr/~talon/prob3.mac >while the corresponding fortran program is here: >http://www.lpthe.jussieu.fr/~talon/prob3.f > >If i remember well the modifications that Raymond did to colnew-if.lisp >were mainly to facilitate profiling. A bug has unfortunately been >introduced. Indeed i have this check: (the old version of the wrapper >is available here: >http://www.lpthe.jussieu.fr/~talon/colnew-if.lisp.old). > >niobe% maxima >(%i1) load(colnew); > >;; Loading >#P"/home/michel/.maxima/binary/binary-cmucl/share/colnew/binary-cmucl/colnew-package.sse2f". >..... > >(%i2) load("colnew-if.lisp.old"); >(%o2) /usr/local/share/maxima/5.22.1/share/colnew/colnew-if.lisp.old >(%i3) load("prob1.mac"); > > > VERSION *COLNEW* OF COLSYS . > > > THE MAXIMUM NUMBER OF SUBINTERVALS IS MIN ( 12 (ALLOWED FROM FSPACE), 16 >(ALLOWED FROM ISPACE) ) > > THE NEW MESH (OF 1 SUBINTERVALS), > 1.000000 2.000000 > > THE NEW MESH (OF 2 SUBINTERVALS), > 1.000000 1.500000 2.000000 > > THE NEW MESH (OF 4 SUBINTERVALS), > 1.000000 1.250000 1.500000 1.750000 2.000000 >The exact errors are: > 1.7389e-10 6.2679e-9 2.1843e-7 9.5743e-6 >(%o3) /usr/local/share/maxima/5.22.1/share/colnew/prob1.mac > >So reloading the old version of the wrapper, prob1.mac works. But on the >other hand prob3.mac now crashes: > >(%i4) load("prob3.mac"); > > > VERSION *COLNEW* OF COLSYS . > > > THE MAXIMUM NUMBER OF SUBINTERVALS IS MIN ( 117 (ALLOWED FROM FSPACE), 124 >(ALLOWED FROM ISPACE) ) > > THE NEW MESH (OF 4 SUBINTERVALS), > 0.000000 0.500000 1.000000 1.450000 1.900000 >Too few arguments supplied to gsub(i, z1, z2, z3, z4); found: >[1, [- 1.0, 2.0, 1.0, .3571428571428572, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, >0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, >0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]] > -- an error. To debug this try: debugmode(true); > >Apparently there is a difference in the way to call the arguments. > > >-- >Michel Talon > >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Sat Sep 10 15:37:46 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 10 Sep 2011 14:37:46 -0600 Subject: [Maxima] How to graph an expression involving sum? In-Reply-To: <4E6BA335.1060707@street-artists.org> References: <4E652C3A.8030806@street-artists.org> <4E69276A.1080006@street-artists.org> <4E6BA335.1060707@street-artists.org> Message-ID: On 9/10/11, dlakelan wrote: > On 09/10/2011 05:59 AM, Stavros Macrakis wrote: >> I would suggest defining a function in expanded form then compiling it: >> >> myfun(x) := ( mode_declare(x,float), ''(ev(coefseries,nouns)) ) $ >> (that's two single-quotes, not one double-quote) >> compile(myfun)$ >> plot2d( myfun, ... ) > Thanks Stavros, I think this is exactly what I was looking for. Well, the ''(ev(coefseries, nouns)) will expand the sum noun into a "+" expression. Didn't you say somewhere along the line that you don't want that? best, Robert Dodier From macrakis at gmail.com Sat Sep 10 15:52:12 2011 From: macrakis at gmail.com (Stavros Macrakis) Date: Sat, 10 Sep 2011 16:52:12 -0400 Subject: [Maxima] How to graph an expression involving sum? In-Reply-To: References: <4E652C3A.8030806@street-artists.org> <4E69276A.1080006@street-artists.org> <4E6BA335.1060707@street-artists.org> Message-ID: The customer isn't always right :-) Unless there is a huge number of terms, or this is going to be repeated for 100s of coefficient value sets, our some other special circumstance, it's surely better to let the machine do the work. Who cares if it's messy or ugly? -s On Sep 10, 2011 4:37 PM, "Robert Dodier" wrote: > On 9/10/11, dlakelan wrote: > >> On 09/10/2011 05:59 AM, Stavros Macrakis wrote: >>> I would suggest defining a function in expanded form then compiling it: >>> >>> myfun(x) := ( mode_declare(x,float), ''(ev(coefseries,nouns)) ) $ >>> (that's two single-quotes, not one double-quote) >>> compile(myfun)$ >>> plot2d( myfun, ... ) > >> Thanks Stavros, I think this is exactly what I was looking for. > > Well, the ''(ev(coefseries, nouns)) will expand the sum noun > into a "+" expression. Didn't you say somewhere along the > line that you don't want that? > > 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 macrakis at gmail.com Sat Sep 10 15:54:18 2011 From: macrakis at gmail.com (Stavros Macrakis) Date: Sat, 10 Sep 2011 16:54:18 -0400 Subject: [Maxima] How to graph an expression involving sum? In-Reply-To: References: <4E652C3A.8030806@street-artists.org> <4E69276A.1080006@street-artists.org> Message-ID: I left out the subst, sorry. On Sep 10, 2011 8:59 AM, "Stavros Macrakis" wrote: > I would suggest defining a function in expanded form then compiling it: > > myfun(x) := ( mode_declare(x,float), ''(ev(coefseries,nouns)) ) $ > (that's two single-quotes, not one double-quote) > compile(myfun)$ > plot2d( myfun, ... ) > > It would also be possible to convert the sum into a loop and the a[i]= into > a[i]:, but that is more work for the same result. > > -s > > On Thu, Sep 8, 2011 at 16:36, dlakelan wrote: > >> On 09/05/2011 01:08 PM, dlakelan wrote: >> > I have a solution of a differential equation in terms of some fourier >> > series. I would like to graph one of the spatially varying coefficients, >> > so I tried something like: >> .... >> > What's the right way to go about graphing something like this? >> >> I should mention that I can do ev(coefseries,nouns) to convert the "sum" >> noun into an enormous + expression, but this slows things down >> considerably. If I am trying to simply do numerical calculations with >> the expression, is there a faster way to get the evaluation than to >> carry around a big symbolic expression? Is something like a lambda >> expression like this the way to go? >> >> lambda([x],ev(coefseries,avals,nouns,z=x,numer)) >> >> or does this just internally create and throw away the enormous + >> expression? >> >> _______________________________________________ >> 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 Sep 10 15:58:09 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 10 Sep 2011 14:58:09 -0600 Subject: [Maxima] Right invocation of concat In-Reply-To: <201109081205.42671.ChristianLupus@gmx.de> References: <201109081205.42671.ChristianLupus@gmx.de> Message-ID: Not sure what you're trying to do, but if you just want to generate variables ad libitum, maybe you can use subscripts. e.g. x[1], x[2], etc. Subscripted variables are largely treated the same as ordinary variables, e.g. you can differentiate or integrate with respect to subscripted variables. Hope this helps, Robert Dodier From talon at lpthe.jussieu.fr Sat Sep 10 16:27:36 2011 From: talon at lpthe.jussieu.fr (talon at lpthe.jussieu.fr) Date: Sat, 10 Sep 2011 23:27:36 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: Message-ID: talon at lpthe.jussieu.fr wrote: > > Apparently there is a difference in the way to call the arguments. > > I know what the problem is: in the initial version of the wrapper, the "z-vector" is a maxima array z, the components z[1], z[2], etc. being the objects of interest. Hence one calls fsub(x,z) or g(z) in prob1.mac and prob2.mac Raymond discovered that for some reason this was prone to errors and changed to explicit variables z1,z2, ... so the calls are now as in prob3.mac of the form f(x,z1,z2,z3,z4) or g(z1,z2,z3,z4). Since we were working on prob3, this one was updated to the new syntax, but of course we forgot prob1 and prob2. This is why colnew now crashes on them. The solution is to update prob1.mac and prob3.mac to the same syntax as prob3.mac in the definition of f, g, and their jacobians. P.S. The "z-vector" here is the followiing object: for a differential equation like u'''=f(u,u',u'',x) one sets z=[u,u',u''] and similarly for a system, it is the collection of all derivatives of all functions up to maximal order of the corresponding eq. minus one. In general f is a maxima array, hence equations of the sort: /* v is the parameter. To solve the eigenvalues problem one adds the equations c'_2 = 0, c'_3 = 0, so 4 unknowns constants, and 4 boundary conditions f -> z[1], f' -> z[2], c_2 -> z[3], c_3 -> z[4], c_1 -> v - z[3] - z[4] */ f(x, z1, z2, z3, z4) := [- (1/2.0d0)*(1/x + 1/(x-1.0d0) + 1/(x-y))*z2 + ((vv - z3 - z4)/x + z3/(x-1.0d0) + z4/(x-y))*z1, 0.0d0, 0.0d0]; df: jacobian(f(x, z1, z2, z3, z4),[z1, z2, z3, z4])$ I hope it is now trivial to convert prob1 and prob2. -- Michel Talon From al_metwally at yahoo.com Sat Sep 10 21:43:46 2011 From: al_metwally at yahoo.com (Ahmad Abdo Metwally) Date: Sat, 10 Sep 2011 19:43:46 -0700 (PDT) Subject: [Maxima] [UTEXAS: SUSPECTED SPAM] Message-ID: <1315709026.28806.YahooMailMobile@web36308.mail.mud.yahoo.com> 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 ------------------------- http://nighttimegraphics.com/invitation.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Sun Sep 11 10:53:37 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 11 Sep 2011 11:53:37 -0400 Subject: [Maxima] Problem with save In-Reply-To: References: <4E6B81B2.3040404@telefonica.net> Message-ID: <4E6CD981.4050709@telefonica.net> On 09/10/2011 07:49 AM, Stavros Macrakis wrote: > I can't check this right now, but I suspect this comes from the recent > global change to *print-level* and *print-length*. > > Clearly those need to be bound to nil for "save" operations, and > *print-circle* to T. Until this gets fixed in Maxima, try > > :lisp (setq *print-level* nil *print-length* nil) > Yes, this works. > or equivalently > > \*print\-level\*: \*print\-length\*: false$ > > before your 'save'. > and this: ?\*print\-level\*: ?\*print\-length\*: false Thank you. -- Mario From talon at lpthe.jussieu.fr Sun Sep 11 05:21:01 2011 From: talon at lpthe.jussieu.fr (talon at lpthe.jussieu.fr) Date: Sun, 11 Sep 2011 12:21:01 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: Message-ID: talon at lpthe.jussieu.fr wrote: > > I hope it is now trivial to convert prob1 and prob2. > This is the version of prob1.mac converted to the new syntax of the colnew wrapper: http://www.lpthe.jussieu.fr/~talon/prob1.mac I have checked it runs fine with recent colnew for maxima. -- Michel Talon From adammaj1 at o2.pl Sun Sep 11 08:25:09 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Sun, 11 Sep 2011 13:25:09 +0000 (UTC) Subject: [Maxima] list order / draw-points joined References: <4E698715.2090802@telefonica.net> Message-ID: Dnia Thu, 08 Sep 2011 23:25:09 -0400, Mario Rodriguez napisa?(a): > On 09/07/2011 06:41 AM, Adam Majewski wrote: >> Hi, >> >> I'm drawing circle l0 = {z:abs(z)=ER} and its preimages : >> l1={z1=sqrt(z) } >> l2={z2:sqrt(z1)} >> .... >> >> Program is below. >> It works. >> I can join points with lines only for first circle l0. For its >> preimages no probably because of bad order of points. >> >> Can I order point according to it's argument ? > > Yes, > > l2_ordered: sort(l2, lambda([z1,z2], is(carg(z1) < carg(z2))))$ Thx for answer. It works, ... but for long lists it takes time. Below is a improved ( I hope) version of program. Can I run it faster ? ( for example sort inside own append function ) TIA Adam ===========code begin ========== kill(all); /* ------------------ definitions ----------------------------*/ f(z,c):=z*z+c; finverseplus(z):=float(rectform(sqrt(z-c))); finverseminus(z):=-sqrt(z-c); /* computes invese image of input points */ GivePreimage(OldList):= block( [NewL,NewLP,NewLN], NewLP:map(finverseplus,OldList), /* positive preimages */ NewLN:map("-",NewLP), /* negative preimages */ NewL:append(NewLP,NewLN) /* output = all preimages as a list */ ); /* t is an angle in turns */ p(t):=radius*%e^(2*%pi*%i*t); /* ------------------ compilation -------------------------------------- */ compile(all); /*------------------ constant values ---------------------------------- */ c:-0.11+0.65569999*%i; radius:3; /* radius of initial circle */ iMax:100; /* number of points of initial circle */ /* second curve will have 2*iMax = 200 points, third curve will have 2*2*iMax = 400 points .... */ dt:float(1/iMax); /* step of turn */ /* --------------------- main ------------------------------------------*/ /* point to point method of drawing */ /* compute points of curve and save points to the list */ /* points of initial circle l0={z:abs(z)=radius } */ l0:makelist (i*dt, i, 0, iMax); /* list of turns from 0 to 1 */ l0:map(p,l0); /* list of points of circle of fixed radius */ /* ---------- preimages of circle under fc = equipotential lines --------------------*/ l1:GivePreimage(l0); /* first preimage */ l2:GivePreimage(l1)$ /* second preimage */ l3:GivePreimage(l2)$ l4:GivePreimage(l3)$ l5:GivePreimage(l4)$ l6:GivePreimage(l5)$ l7:GivePreimage(l6)$ l8:GivePreimage(l7)$ l9:GivePreimage(l8)$ l10:GivePreimage(l9)$ l11:GivePreimage(l10)$ l12:GivePreimage(l11)$ l13:GivePreimage(l12)$ l14:GivePreimage(l13)$ /* preimages : - tend to Julia set as n increases - tend to equipotential lines as ER tends to infinity */ /*--- order point according to it's argument to join them by lines --*/ /* thx to Mario Rodriguez */ l1: sort(l1, lambda([z1,z2], is(carg(z1) < carg(z2))))$ l2: sort(l2, lambda([z1,z2], is(carg(z1) < carg(z2))))$ l3: sort(l3, lambda([z1,z2], is(carg(z1) < carg(z2))))$ l4: sort(l4, lambda([z1,z2], is(carg(z1) < carg(z2))))$ l5: sort(l5, lambda([z1,z2], is(carg(z1) < carg(z2))))$ l6: sort(l6, lambda([z1,z2], is(carg(z1) < carg(z2))))$ l7: sort(l7, lambda([z1,z2], is(carg(z1) < carg(z2))))$ l8: sort(l8, lambda([z1,z2], is(carg(z1) < carg(z2))))$ l9: sort(l9, lambda([z1,z2], is(carg(z1) < carg(z2))))$ l10: sort(l10, lambda([z1,z2], is(carg(z1) < carg(z2))))$ l11: sort(l11, lambda([z1,z2], is(carg(z1) < carg(z2))))$ l12: sort(l12, lambda([z1,z2], is(carg(z1) < carg(z2))))$ l13: sort(l13, lambda([z1,z2], is(carg(z1) < carg(z2))))$ l14: sort(l14, lambda([z1,z2], is(carg(z1) < carg(z2))))$ /*----------------------- draw -----------------------------------*/ load(draw); draw2d( terminal = 'screen, title= "Level curves of escape time for fc(z)=z*z+c made usung IIM ", key = "LC0", xlabel = "re ", ylabel = "im", points_joined = true, point_type = dot, point_size = 5, color = green, points(map(realpart, l0),map(imagpart, l0)), color = black, key = "LC1", points(map(realpart, l1),map(imagpart, l1)), key = "LC2", points(map(realpart, l2),map(imagpart, l2)), key = "LC3", points(map(realpart, l3),map(imagpart, l3)), key = "LC4", points(map(realpart, l4),map(imagpart, l4)), key = "LC5", points(map(realpart, l5),map(imagpart, l5)), color = red, color = red, key = "LC14", points(map(realpart, l14),map(imagpart, l14)) ); ========== code end ============= From talon at lpthe.jussieu.fr Sun Sep 11 08:52:33 2011 From: talon at lpthe.jussieu.fr (talon at lpthe.jussieu.fr) Date: Sun, 11 Sep 2011 15:52:33 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: Message-ID: talon at lpthe.jussieu.fr wrote: > talon at lpthe.jussieu.fr wrote: > > >> >> I hope it is now trivial to convert prob1 and prob2. >> > > This is the version of prob1.mac converted to the new syntax of the colnew > wrapper: > http://www.lpthe.jussieu.fr/~talon/prob1.mac > I have checked it runs fine with recent colnew for maxima. > > The revised version of prob2.mac is at: http://www.lpthe.jussieu.fr/~talon/prob2.mac It should be nice that someone checks that they work with last maxima and check them in the git system. Thanks a lot. By the way all the examples have 4 z-variables, this is of course by chance. -- Michel Talon From biomates at telefonica.net Sun Sep 11 19:00:38 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 11 Sep 2011 20:00:38 -0400 Subject: [Maxima] list order / draw-points joined In-Reply-To: References: <4E698715.2090802@telefonica.net> Message-ID: <4E6D4BA6.7070606@telefonica.net> On 09/11/2011 09:25 AM, Adam Majewski wrote: > /* ---------- preimages of circle under fc = equipotential lines > --------------------*/ > l1:GivePreimage(l0); /* first preimage */ > l2:GivePreimage(l1)$ /* second preimage */ > l3:GivePreimage(l2)$ > l4:GivePreimage(l3)$ > l5:GivePreimage(l4)$ > l6:GivePreimage(l5)$ > l7:GivePreimage(l6)$ > l8:GivePreimage(l7)$ > l9:GivePreimage(l8)$ > l10:GivePreimage(l9)$ > l11:GivePreimage(l10)$ > l12:GivePreimage(l11)$ > l13:GivePreimage(l12)$ > l14:GivePreimage(l13)$ > /* preimages : > - tend to Julia set as n increases > - tend to equipotential lines as ER tends to infinity */ Some of these lists are very long. You can try arrays instead. Graphic object 'points' can be used with lisp arrays. Type ? points for an example. -- Mario From talon at lpthe.jussieu.fr Sun Sep 11 15:10:42 2011 From: talon at lpthe.jussieu.fr (talon at lpthe.jussieu.fr) Date: Sun, 11 Sep 2011 22:10:42 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: Message-ID: talon at lpthe.jussieu.fr wrote: > > It should be nice that someone checks that they work with last maxima and > check them in the git system. Thanks a lot. > Panagiotis Papasotiriou sent me a mail where he states that these new versions don't work on his machine. They work on mine so there is a further problem that i have no idea about. -- Michel Talon From toy.raymond at gmail.com Sun Sep 11 15:43:36 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 11 Sep 2011 13:43:36 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: References: Message-ID: On Sep 11, 2011 1:11 PM, wrote: > > talon at lpthe.jussieu.fr wrote: > > > > > > It should be nice that someone checks that they work with last maxima and > > check them in the git system. Thanks a lot. > > > > Panagiotis Papasotiriou sent me a mail where he states that these new > versions don't work on his machine. They work on mine so there is a further > problem that i have no idea about. I'll look into the other issues soon and update the report accordingly. I hope Panagiotis will provide more information. Ray > > -- > 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 Sun Sep 11 17:32:44 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 11 Sep 2011 16:32:44 -0600 Subject: [Maxima] Problem with save In-Reply-To: <4E6CD981.4050709@telefonica.net> References: <4E6B81B2.3040404@telefonica.net> <4E6CD981.4050709@telefonica.net> Message-ID: I've pushed the following patch, which solves this problem if I'm not mistaken. best Robert Dodier diff --git a/src/dskfn.lisp b/src/dskfn.lisp index 1ddd290..5ba9b37 100644 --- a/src/dskfn.lisp +++ b/src/dskfn.lisp @@ -42,7 +42,7 @@ (append (or iteml '(nil)) (cdr x))))) (defmspec $save (form) - (let ((*print-circle* nil)) ; $save stores Lisp expressions. + (let ((*print-circle* nil) (*print-level* nil) (*print-length* nil)) ; $save stores Lisp expressions. (dsksetup (cdr form) nil nil '$save))) (defvar *macsyma-extend-types-saved* nil) From biomates at telefonica.net Mon Sep 12 04:45:06 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Mon, 12 Sep 2011 05:45:06 -0400 Subject: [Maxima] list order / draw-points joined In-Reply-To: <4E6D4BA6.7070606@telefonica.net> References: <4E698715.2090802@telefonica.net> <4E6D4BA6.7070606@telefonica.net> Message-ID: <4E6DD4A2.9070805@telefonica.net> On 09/11/2011 08:00 PM, Mario Rodriguez wrote: > > Some of these lists are very long. You can try arrays instead. Graphic > object 'points' can be used with lisp arrays. Type > > ? points > > for an example. List l11, for example, contains more than 200000 points. You don't need to join them with segments, since plotting the isolated points shows a continuous curve. Doing so, you can avoid sorting them, which is also time consuming. You can sort the short lists and plot them with points_joined = true, and generate the long ones as arrays (I hope this will be faster) and plot them without sorting and with points_joined = false. Another alternative is to extract from the long arrays a sample list of points (between 200 and 300 could be enough), sort and plot them with points_joined = true. By the way, due to the fractal nature of the figure, are you sure that sorting the points with respect to their arguments returns a correct ordering along the boundary of the Julia set? Certainly, I'd try to plot the longest lists (or arrays) without sorting. Just a pair of ideas. -- Mario From adammaj1 at o2.pl Mon Sep 12 02:45:42 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Mon, 12 Sep 2011 07:45:42 +0000 (UTC) Subject: [Maxima] list order / draw-points joined References: <4E698715.2090802@telefonica.net> <4E6D4BA6.7070606@telefonica.net> <4E6DD4A2.9070805@telefonica.net> Message-ID: Dnia Mon, 12 Sep 2011 05:45:06 -0400, Mario Rodriguez napisa?(a): > On 09/11/2011 08:00 PM, Mario Rodriguez wrote: >> >> Some of these lists are very long. You can try arrays instead. Graphic >> object 'points' can be used with lisp arrays. Type >> >> ? points >> >> for an example. > > List l11, for example, contains more than 200000 points. You don't need > to join them with segments, since plotting the isolated points shows a > continuous curve. Doing so, you can avoid sorting them, which is also > time consuming. Yes, they are dense on the curve. > > You can sort the short lists and plot them with points_joined = true, > and generate the long ones as arrays (I hope this will be faster) and > plot them without sorting and with points_joined = false. > > Another alternative is to extract from the long arrays a sample list of > points (between 200 and 300 could be enough), sort and plot them with > points_joined = true. Intresting. I will try it. > > By the way, due to the fractal nature of the figure, are you sure that > sorting the points with respect to their arguments returns a correct > ordering along the boundary of the Julia set? Certainly, I'd try to plot > the longest lists (or arrays) without sorting. Yes. Points should be ordered by external angle not argument !!!!! ( it will be time consuming) If argument of points of the circle is equall to its external angle then maybe I should keep it for other points ( preimages) for simple computation of external angle ? Thx Adam From talon at lpthe.jussieu.fr Mon Sep 12 04:00:32 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Mon, 12 Sep 2011 11:00:32 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: Message-ID: Raymond Toy wrote: > On Sep 11, 2011 1:11 PM, wrote: >> >> talon at lpthe.jussieu.fr wrote: >> >> >> > >> > It should be nice that someone checks that they work with last maxima > and >> > check them in the git system. Thanks a lot. >> > >> >> Panagiotis Papasotiriou sent me a mail where he states that these new >> versions don't work on his machine. They work on mine so there is a > further >> problem that i have no idea about. > > I'll look into the other issues soon and update the report accordingly. > > I hope Panagiotis will provide more information. > > Ray This morning i have downloaded the latest version of maxima, and compiled it with sbcl (on a FreeBSD machine). niobe% bin/maxima Maxima 5.25.1 http://maxima.sourceforge.net using Lisp SBCL 1.0.43 With this version of maxima, all the examples (updated as above) work perfectly OK. So the problem is most probably in a buggy version of the lisp used by the people who report problems. I have zero ability to debug such things, unfortunately. For reference, here is what i get at the end of prob3, when outputting fvals: (%i3) fvals; (%o3) [- 1.7216824940825148e-4, - .003515747388511068, - .01601145711178909, - .04981228778461431, - .1252152667919288, - .2697192979840536, - .5075105639616531, - .8255724919090548, - 1.089261661321262, - .8565923226792143, 1.0, 7.02336788187206, 22.52276623995412, 57.99492261736657, 133.3465950157767, 285.0922093766993, 578.3821182405767, 1126.757072885631, 2124.094292822591, 3895.557911971006] These are the same values i got with an older maxima version compiled with cmucl and sbcl and close to values obtained directly with the fortran program. -- Michel Talon From talon at lpthe.jussieu.fr Mon Sep 12 04:46:17 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Mon, 12 Sep 2011 11:46:17 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: Message-ID: Michel Talon wrote: > > This morning i have downloaded the latest version of maxima, and compiled > it with sbcl (on a FreeBSD machine). > niobe% bin/maxima > Maxima 5.25.1 http://maxima.sourceforge.net > using Lisp SBCL 1.0.43 > > With this version of maxima, all the examples (updated as above) work? > perfectly OK. So the problem is most probably in a buggy version of the > lisp used by the people who report problems. I have zero ability to debug > such things, unfortunately. In fact i have checked that the examples in 5.25.1 are already in corrected form (so Raymond had updated them previously), the only difference being that prob3.mac is called prob4.mac here. And i have also checked that the precompiled maxima for Mac OS X (which seems compiled by sbcl) is able to run the examples. So the problem is probably confined to people running Windows, who needs some funny version of lisp (CCL ?). Perhaps those people could try the maxima-5.25.1-gcl.exe which perhaps doesn't have the problem. -- Michel Talon From adammaj1 at o2.pl Mon Sep 12 07:16:29 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Mon, 12 Sep 2011 12:16:29 +0000 (UTC) Subject: [Maxima] list order / draw-points joined References: <4E698715.2090802@telefonica.net> <4E6D4BA6.7070606@telefonica.net> <4E6DD4A2.9070805@telefonica.net> Message-ID: Dnia Mon, 12 Sep 2011 07:45:42 +0000, Adam Majewski napisa?(a): > Dnia Mon, 12 Sep 2011 05:45:06 -0400, Mario Rodriguez napisa?(a): > >> On 09/11/2011 08:00 PM, Mario Rodriguez wrote: >>> >>> Some of these lists are very long. You can try arrays instead. Graphic >>> object 'points' can be used with lisp arrays. Type >>> >>> ? points >>> >>> for an example. >> >> List l11, for example, contains more than 200000 points. You don't need >> to join them with segments, since plotting the isolated points shows a >> continuous curve. Doing so, you can avoid sorting them, which is also >> time consuming. > > Yes, they are dense on the curve. >> >> You can sort the short lists and plot them with points_joined = true, >> and generate the long ones as arrays (I hope this will be faster) and >> plot them without sorting and with points_joined = false. >> >> Another alternative is to extract from the long arrays a sample list of >> points (between 200 and 300 could be enough), sort and plot them with >> points_joined = true. > Intresting. I will try it. >> >> By the way, due to the fractal nature of the figure, are you sure that >> sorting the points with respect to their arguments returns a correct >> ordering along the boundary of the Julia set? Certainly, I'd try to >> plot the longest lists (or arrays) without sorting. > > Yes. Points should be ordered by external angle not argument !!!!! ( it > will be time consuming) > If argument of points of the circle is equall to its external angle then > maybe I should keep it for other points ( preimages) for simple > computation of external angle ? > > > Thx > > Adam > > > _______________________________________________ Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Here is the result : http://commons.wikimedia.org/wiki/File:Preimages_of_curve_ER.png Regards Adam From i7tyur5 at excite.fr Mon Sep 12 09:22:07 2011 From: i7tyur5 at excite.fr (Excite User) Date: Mon, 12 Sep 2011 07:22:07 -0700 Subject: [Maxima] integrate sin(t)/t^2 Message-ID: <24CE17CEDBD2411595F595143DBD2FE4@mail2world.com> <-----Message d\'Origine -----> >From: Karl-Dieter Crisman [kcrisman at gmail.com] >Sent: 9/9/2011 9:39:50 PM >To: maxima at math.utexas.edu >Subject: Re: [Maxima] integrate sin(t)/t^2 > >Yeah, I'm a little surprised at this as well. > >http://www.wolframalpha.com/input/?i=integrate+sin%28x%29%2Fx%5E2+from+ 1+to+infinity > >integral_1^infinity(sin(x))/x^2 dx = sin(1)-Ci(1)~~0.504067 > >But Maxima does have the sine and cosine integral now, > >http://maxima.sourceforge.net/docs/manual/en/maxima_15.html#SEC80 > >I have no idea how easy this would be to add to the integration, though. Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernardo at fceia.unr.edu.ar Mon Sep 12 13:00:32 2011 From: bernardo at fceia.unr.edu.ar (bernardo gomez) Date: Mon, 12 Sep 2011 15:00:32 -0300 Subject: [Maxima] non-linear equations Message-ID: Hi ! It is possible to solve numerically a system Maxima of 2 nonlinear equations ? Thanks ! bernardo -- *Instituto de F?sica Rosario* *Grupo de F?sica de Plasmas* 27 de Febrero 210 bis (S2000EZP) Rosario -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.j.papasot at gmail.com Mon Sep 12 17:51:38 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 13 Sep 2011 01:51:38 +0300 Subject: [Maxima] non-linear equations In-Reply-To: References: Message-ID: Yes, Bernando, it is possible. Have a look at the package mnewton. It implements a multivariate Newton method for solving systems of non-linear differential equations. That is, it is a generalization of the Newton-Raphson method for root-finding of functions of one variable. Personally, I would prefer Broyden's method instead of multivariate Newton, because Broyden's method is based on Secant (its one-dimension equivalent). Nevertheless, multivariate Newton is not bad. Note that, depending on the problem at hand, a "good" initial guess might be necessary. If your initial guesses for the unknown variables are very bad, mnewton will fail to converge, and you will need to try again with different guesses. 2011/9/12 bernardo gomez > Hi ! > It is possible to solve numerically a system Maxima of 2 nonlinear > equations ? > Thanks ! > bernardo > -- > > *Instituto de F?sica Rosario* > *Grupo de F?sica de Plasmas* > 27 de Febrero 210 bis > (S2000EZP) Rosario > > > _______________________________________________ > 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 Mon Sep 12 18:00:18 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 12 Sep 2011 16:00:18 -0700 Subject: [Maxima] non-linear equations In-Reply-To: References: Message-ID: In addition, there is lbfgs and minpack_solve for doing unconstrained minimization. If you can express your problem as a minimization problem, then these two routines (and minpack_lsquares) might be useful. Ray On Mon, Sep 12, 2011 at 3:51 PM, Panagiotis Papasotiriou < p.j.papasot at gmail.com> wrote: > Yes, Bernando, it is possible. Have a look at the package mnewton. It > implements a multivariate Newton method for solving systems of non-linear > differential equations. That is, it is a generalization of the > Newton-Raphson method for root-finding of functions of one variable. > Personally, I would prefer Broyden's method instead of multivariate Newton, > because Broyden's method is based on Secant (its one-dimension equivalent). > Nevertheless, multivariate Newton is not bad. > Note that, depending on the problem at hand, a "good" initial guess might > be necessary. If your initial guesses for the unknown variables are very > bad, mnewton will fail to converge, and you will need to try again with > different guesses. > > 2011/9/12 bernardo gomez > >> Hi ! >> It is possible to solve numerically a system Maxima of 2 nonlinear >> equations ? >> Thanks ! >> bernardo >> -- >> >> *Instituto de F?sica Rosario* >> *Grupo de F?sica de Plasmas* >> 27 de Febrero 210 bis >> (S2000EZP) Rosario >> >> >> _______________________________________________ >> 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 p.j.papasot at gmail.com Mon Sep 12 18:10:45 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 13 Sep 2011 02:10:45 +0300 Subject: [Maxima] non-linear equations In-Reply-To: References: Message-ID: Whatever method you use, I would suggest to verify your result, because all those methods are iterative and may "think" they succeed, due to round-off errors or otherwise. So verifying the result returned is always a good idea, and besides it's easy to do that. For example: load(mnewton)$ equs:[x1-x2^4+x3-5,x1^2+x2^3-3,x1+x2*x3^2]$ sol:mnewton(equs,[x1,x2,x3],[2,1,2]); gives [[x1 = 1.733285742377482, x2 = - 0.16235405884328, x3 = 3.267409046090958]] which is correct, as we can easily verify: ev(equs,sol); [0.0, 4.5970172113385388E-16, - 4.4408920985006262E-16] 2011/9/13 Raymond Toy > In addition, there is lbfgs and minpack_solve for doing unconstrained > minimization. If you can express your problem as a minimization problem, > then these two routines (and minpack_lsquares) might be useful. > > Ray > > > > On Mon, Sep 12, 2011 at 3:51 PM, Panagiotis Papasotiriou < > p.j.papasot at gmail.com> wrote: > >> Yes, Bernando, it is possible. Have a look at the package mnewton. It >> implements a multivariate Newton method for solving systems of non-linear >> differential equations. That is, it is a generalization of the >> Newton-Raphson method for root-finding of functions of one variable. >> Personally, I would prefer Broyden's method instead of multivariate >> Newton, because Broyden's method is based on Secant (its one-dimension >> equivalent). Nevertheless, multivariate Newton is not bad. >> Note that, depending on the problem at hand, a "good" initial guess might >> be necessary. If your initial guesses for the unknown variables are very >> bad, mnewton will fail to converge, and you will need to try again with >> different guesses. >> >> 2011/9/12 bernardo gomez >> >>> Hi ! >>> It is possible to solve numerically a system Maxima of 2 nonlinear >>> equations ? >>> Thanks ! >>> bernardo >>> -- >>> >>> *Instituto de F?sica Rosario* >>> *Grupo de F?sica de Plasmas* >>> 27 de Febrero 210 bis >>> (S2000EZP) Rosario >>> >>> >>> _______________________________________________ >>> 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 Mon Sep 12 23:00:28 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 12 Sep 2011 21:00:28 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: References: Message-ID: <4E6ED55C.8050507@gmail.com> On 9/12/11 2:46 AM, Michel Talon wrote: > Michel Talon wrote: > > >> This morning i have downloaded the latest version of maxima, and compiled >> it with sbcl (on a FreeBSD machine). >> niobe% bin/maxima >> Maxima 5.25.1 http://maxima.sourceforge.net >> using Lisp SBCL 1.0.43 >> >> With this version of maxima, all the examples (updated as above) work? >> perfectly OK. So the problem is most probably in a buggy version of the >> lisp used by the people who report problems. I have zero ability to debug >> such things, unfortunately. > In fact i have checked that the examples in 5.25.1 are already in corrected > form (so Raymond had updated them previously), the only difference being > that prob3.mac is called prob4.mac here. And i have also checked that the > precompiled maxima for Mac OS X (which seems compiled by sbcl) is able to > run the examples. So the problem is probably confined to people running > Windows, who needs some funny version of lisp (CCL ?). Perhaps those people > could try the maxima-5.25.1-gcl.exe which perhaps doesn't have the problem. > Thanks for testing this out. I can confirm that 5.25.1 works fine for me as well with cmucl. I don't know why prob3 is called prob4.mac. I'm pretty sure this works with ccl; but I'll check soon to be sure. Ray From p.j.papasot at gmail.com Tue Sep 13 02:22:58 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 13 Sep 2011 10:22:58 +0300 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: <4E6ED55C.8050507@gmail.com> References: <4E6ED55C.8050507@gmail.com> Message-ID: Attached, please find the output of prob1, prob2, and prob3 on my system. Note that I am not using Window$ (of course). I am using Maxima 5.24, installed from Debian repositories, on a Quad system with lots of RAM, running Debian GNU/Linux (64bit "testing" version). For some reason, Debian still provides version 5.24 instead of 5.25.1. I assume this is because the "official" website of Maxima (http://maxima.sourceforge.net) still mentions version 5.24 as the latest one (although version 5.25.1 can be downloaded from Sourceforge). 2011/9/13 Raymond Toy > On 9/12/11 2:46 AM, Michel Talon wrote: > > Michel Talon wrote: > > > > > >> This morning i have downloaded the latest version of maxima, and > compiled > >> it with sbcl (on a FreeBSD machine). > >> niobe% bin/maxima > >> Maxima 5.25.1 http://maxima.sourceforge.net > >> using Lisp SBCL 1.0.43 > >> > >> With this version of maxima, all the examples (updated as above) work? > >> perfectly OK. So the problem is most probably in a buggy version of the > >> lisp used by the people who report problems. I have zero ability to > debug > >> such things, unfortunately. > > In fact i have checked that the examples in 5.25.1 are already in > corrected > > form (so Raymond had updated them previously), the only difference being > > that prob3.mac is called prob4.mac here. And i have also checked that the > > precompiled maxima for Mac OS X (which seems compiled by sbcl) is able to > > run the examples. So the problem is probably confined to people running > > Windows, who needs some funny version of lisp (CCL ?). Perhaps those > people > > could try the maxima-5.25.1-gcl.exe which perhaps doesn't have the > problem. > > > Thanks for testing this out. I can confirm that 5.25.1 works fine for > me as well with cmucl. I don't know why prob3 is called prob4.mac. I'm > pretty sure this works with ccl; but I'll check soon to be sure. > > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: prob1.out Type: application/octet-stream Size: 493 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: prob2.out Type: application/octet-stream Size: 108 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: prob3.out Type: application/octet-stream Size: 10732 bytes Desc: not available URL: From p.j.papasot at gmail.com Tue Sep 13 06:04:03 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 13 Sep 2011 14:04:03 +0300 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: <20110913094120.GA29898@lpthe.jussieu.fr> References: <4E6ED55C.8050507@gmail.com> <20110913094120.GA29898@lpthe.jussieu.fr> Message-ID: I installed version 5.25.1 from source, using sbcl. I still get the same errors when attempting to load prob1.mac and so on. Here what Maxima says when running the compiled from source version: Maxima 5.25.1 http://maxima.sourceforge.net using Lisp SBCL 1.0.51.0.debian And here is a short description of my system. Linux debian 3.0.0-1-amd64 #1 SMP Sat Aug 27 16:21:11 UTC 2011 x86_64 GNU/Linux Note that I use the Fortran version of colnew for several years now, also using my own interface module written in Fortran 90 to facilitate its use. It works perfectly. I also tried to use those examples within Sage 4.7.1 (which uses its own version of Maxima). I get exactly the same results. 2011/9/13 Michel Talon > On Tue, Sep 13, 2011 at 10:22:58AM +0300, Panagiotis Papasotiriou wrote: > > Attached, please find the output of prob1, prob2, and prob3 on my system. > > Note that I am not using Window$ (of course). I am using Maxima 5.24, > > installed from Debian repositories, on a Quad system with lots of RAM, > > running Debian GNU/Linux (64bit "testing" version). For some reason, > Debian > > still provides version 5.24 instead of 5.25.1. I assume this is because > the > > "official" website of Maxima (http://maxima.sourceforge.net) still > mentions > > version 5.24 as the latest one (although version 5.25.1 can be downloaded > > from Sourceforge). > > > > 2011/9/13 Raymond Toy > > > > > The outputs show that nothing works. This is extremely strange - i may > be tempted to accuse the 64 bits machine (my own one is 32 bits) but > the Mac OS X laptop is also 64 bits, and the programs work. > > Do you know with what lisp the Debian version of maxima is compiled? > > Would it be possible, Panagiotis, for you to install sbcl from the > testing repository (http://packages.debian.org/testing/lisp/sbcl) > download > > http://sourceforge.net/projects/maxima/files/Maxima-source/5.25.1-source/maxima-5.25.1.tar.gz/download > and compile it? > > It is very easy, it involves extracting somewhere, running > ./configure --help look for something like > ./configure --enable-sbcl --prefix= > and running make, make install > which puts everything . The compilation takes less than 5 mn. > You may have errors in the doc (i had) so don't care, make -i install. > > Then you go to and run bin/maxima > load(colnew); > load("prog1.mac"); > etc. > > If it works you know that the other version of maxima is buggy. And you > have only to erase to make things clean. Maxima puts > everything under that place. > > I join your outputs for Raymond to see. > > > > -- > > Michel TALON > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From metodosu at gmail.com Tue Sep 13 16:25:19 2011 From: metodosu at gmail.com (Matematicas) Date: Tue, 13 Sep 2011 16:25:19 -0500 Subject: [Maxima] Factor the following number Message-ID: Numbers are called Ruth-Aaron pair, such as {714, 715}. Are consecutive numbers {n, n +1} such that the sum of the prime factors of each are equal. Let's see 714 = 2x3x7x17 715 = 5x11x13 Sum of divisors of 714 = 29 = Sum of divisors of 715 FACTORS FOR EACH OF THE FOLLOWING TWO NUMBERS. COULD NOT DERIVE A number of 135 digits es1 Aoron * 296603151077074197308684124715622560525294501766069587161483751777320391554230009758029564174782423278870115094641644418265512090475910 * The following of the former is * 296603151077074197308684124715622560525294501766069587161483751777320391554230009758029564174782423278870115094641644418265512090475911 * The problem is that the command ifactor(n) don't work, generate an error, can help me?? 1 <#sdfootnote1anc> http://www.immortaltheory.com/NumberTheory/RuthAaron.htm -------------- next part -------------- An HTML attachment was scrubbed... URL: From amca01 at gmail.com Tue Sep 13 19:21:43 2011 From: amca01 at gmail.com (Alasdair McAndrew) Date: Wed, 14 Sep 2011 10:21:43 +1000 Subject: [Maxima] Factor the following number In-Reply-To: References: Message-ID: The number is simply too big to be factored by Maxima's algorithm. You might like to try other software with better support for computational number theory, such as Pari/GP. I suspect that the numbers in question (from here ) were produced by a polynomial, so all you need to do is to solve the appropriate polynomial f(x)=n, where n is the smaller of the two numbers. -Alasdair On Wed, Sep 14, 2011 at 7:25 AM, Matematicas wrote: > Numbers are called Ruth-Aaron pair, such as {714, 715}. Are consecutive > numbers {n, n +1} such that the sum of the prime factors of each are > equal. > > Let's see > > 714 = 2x3x7x17 > 715 = 5x11x13 > > Sum of divisors of 714 = 29 = Sum of divisors of 715 > > > > FACTORS FOR EACH OF THE FOLLOWING TWO NUMBERS. COULD NOT DERIVE > > A number of 135 digits es1 Aoron > > * > 296603151077074197308684124715622560525294501766069587161483751777320391554230009758029564174782423278870115094641644418265512090475910 > * > > > The following of the former is > > * > 296603151077074197308684124715622560525294501766069587161483751777320391554230009758029564174782423278870115094641644418265512090475911 > * > > The problem is that the command ifactor(n) don't work, generate an error, > can help me?? > > 1 <#13264ae44588bf30_sdfootnote1anc> > http://www.immortaltheory.com/NumberTheory/RuthAaron.htm > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -- Blog: http://amca01.wordpress.com Web: http://bit.ly/Alasdair Facebook: http://www.facebook.com/alasdair.mcandrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From bichedecerynie at gmail.com Wed Sep 14 06:33:27 2011 From: bichedecerynie at gmail.com (=?ISO-8859-1?Q?Biche_de_C=E9rynie?=) Date: Wed, 14 Sep 2011 13:33:27 +0200 Subject: [Maxima] Factor the following number In-Reply-To: References: Message-ID: Prime factors for your numbers : 2 5 2122943609450249057621 405620061201508643988375124643817406843652803 34444340671702467488860342883734479061576134487870291451728421045657 And 17222170335851233744430171441867239530788067265164581820366701099039 17222170335851233744430577061928441039432055599953297058218812657049 Jean-Claude Arbaut On Wed, Sep 14, 2011 at 2:21 AM, Alasdair McAndrew wrote: > The number is simply too big to be factored by Maxima's algorithm. You > might like to try other software with better support for computational > number theory, such as Pari/GP. I suspect that the numbers in question > (from here ) > were produced by a polynomial, so all you need to do is to solve the > appropriate polynomial f(x)=n, where n is the smaller of the two numbers. > > -Alasdair > > On Wed, Sep 14, 2011 at 7:25 AM, Matematicas wrote: > >> Numbers are called Ruth-Aaron pair, such as {714, 715}. Are consecutive >> numbers {n, n +1} such that the sum of the prime factors of each are >> equal. >> >> Let's see >> >> 714 = 2x3x7x17 >> 715 = 5x11x13 >> >> Sum of divisors of 714 = 29 = Sum of divisors of 715 >> >> >> >> FACTORS FOR EACH OF THE FOLLOWING TWO NUMBERS. COULD NOT DERIVE >> >> A number of 135 digits es1 Aoron >> >> * >> 296603151077074197308684124715622560525294501766069587161483751777320391554230009758029564174782423278870115094641644418265512090475910 >> * >> >> >> The following of the former is >> >> * >> 296603151077074197308684124715622560525294501766069587161483751777320391554230009758029564174782423278870115094641644418265512090475911 >> * >> >> The problem is that the command ifactor(n) don't work, generate an error, >> can help me?? >> >> 1 <#132654fce756ae77_13264ae44588bf30_sdfootnote1anc> >> http://www.immortaltheory.com/NumberTheory/RuthAaron.htm >> >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> > > > -- > Blog: http://amca01.wordpress.com > Web: http://bit.ly/Alasdair > 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 bichedecerynie at gmail.com Wed Sep 14 12:14:13 2011 From: bichedecerynie at gmail.com (=?ISO-8859-1?Q?Biche_de_C=E9rynie?=) Date: Wed, 14 Sep 2011 19:14:13 +0200 Subject: [Maxima] Factor the following number In-Reply-To: References: Message-ID: Maxima :o) No magick here. Actually, I read the page given by "Matematicas". There is an interesting relation : *M = (1800p3 - 1310p2 - 50p - 1) (1800p3 - 1220p2 - 130p - 1) M-1 = 2 * 5 * p * (90p2 - 61p - 6) (3600p3 - 2620p2 - 120p - 3)* With this the problem is quite easy. This gives (almost) p : inrt(floor(n/1800^2), 6); But you may find p by "direct" factorization, since it's quite small. 2011/9/14 Alasdair McAndrew > Nice - what software did you use for the factorization? > > -Alasdair > > > 2011/9/14 Biche de C?rynie > >> Prime factors for your numbers : >> >> 2 >> 5 >> 2122943609450249057621 >> 405620061201508643988375124643817406843652803 >> 34444340671702467488860342883734479061576134487870291451728421045657 >> >> And >> >> 17222170335851233744430171441867239530788067265164581820366701099039 >> 17222170335851233744430577061928441039432055599953297058218812657049 >> >> Jean-Claude Arbaut >> >> >> >> On Wed, Sep 14, 2011 at 2:21 AM, Alasdair McAndrew wrote: >> >>> The number is simply too big to be factored by Maxima's algorithm. You >>> might like to try other software with better support for computational >>> number theory, such as Pari/GP. I suspect that the numbers in question >>> (from here ) >>> were produced by a polynomial, so all you need to do is to solve the >>> appropriate polynomial f(x)=n, where n is the smaller of the two numbers. >>> >>> -Alasdair >>> >>> On Wed, Sep 14, 2011 at 7:25 AM, Matematicas wrote: >>> >>>> Numbers are called Ruth-Aaron pair, such as {714, 715}. Are consecutive >>>> numbers {n, n +1} such that the sum of the prime factors of each are >>>> equal. >>>> >>>> Let's see >>>> >>>> 714 = 2x3x7x17 >>>> 715 = 5x11x13 >>>> >>>> Sum of divisors of 714 = 29 = Sum of divisors of 715 >>>> >>>> >>>> >>>> FACTORS FOR EACH OF THE FOLLOWING TWO NUMBERS. COULD NOT DERIVE >>>> >>>> A number of 135 digits es1 Aoron >>>> >>>> * >>>> 296603151077074197308684124715622560525294501766069587161483751777320391554230009758029564174782423278870115094641644418265512090475910 >>>> * >>>> >>>> >>>> The following of the former is >>>> >>>> * >>>> 296603151077074197308684124715622560525294501766069587161483751777320391554230009758029564174782423278870115094641644418265512090475911 >>>> * >>>> >>>> The problem is that the command ifactor(n) don't work, generate an >>>> error, can help me?? >>>> >>>> 1<#13267fb41fb33c74_13267b72b91849ef_132654fce756ae77_13264ae44588bf30_sdfootnote1anc> >>>> http://www.immortaltheory.com/NumberTheory/RuthAaron.htm >>>> >>>> >>>> >>>> _______________________________________________ >>>> Maxima mailing list >>>> Maxima at math.utexas.edu >>>> http://www.math.utexas.edu/mailman/listinfo/maxima >>>> >>>> >>> >>> >>> -- >>> Blog: http://amca01.wordpress.com >>> Web: http://bit.ly/Alasdair >>> Facebook: http://www.facebook.com/alasdair.mcandrew >>> >>> _______________________________________________ >>> 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 >> >> > > > -- > Blog: http://amca01.wordpress.com > Web: http://bit.ly/Alasdair > Facebook: http://www.facebook.com/alasdair.mcandrew > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kcrisman at gmail.com Wed Sep 14 12:30:11 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Wed, 14 Sep 2011 13:30:11 -0400 Subject: [Maxima] Factor the following number Message-ID: > ?Numbers are called Ruth-Aaron pair, such as {714, 715}. Are consecutive > numbers {n, n +1} such that the sum of the prime factors of each are equal. > > Let's see > > 714 = 2x3x7x17 > 715 = 5x11x13 > > Sum of divisors of 714 = 29 = Sum of divisors of 715 > > > > FACTORS FOR EACH OF THE FOLLOWING TWO NUMBERS. COULD NOT DERIVE > > A number of 135 digits es1 Aoron > > * > 296603151077074197308684124715622560525294501766069587161483751777320391554230009758029564174782423278870115094641644418265512090475910 > * > > > The following of the former is > > * > 296603151077074197308684124715622560525294501766069587161483751777320391554230009758029564174782423278870115094641644418265512090475911 > * > > The number is simply too big to be factored by Maxima's algorithm. ?You > might like to try other software with better support for computational > number theory, such as Pari/GP. ?I suspect that the numbers in question > (from here ) were > produced by a polynomial, so all you need to do is to solve the appropriate > polynomial f(x)=n, where n is the smaller of the two numbers. > As Alasdair points out, other software can do this better (and Maxima does things e.g. Pari/GP doesn't do). Sage happens to include both Maxima and Pari/GP, where you can either use them as wrapped by Sage (to do things with both large numbers and integrals at the same time) or you can use it as a convenient way to access both in the norma way. Sage does tend to be a bit behind the most up-to-date version of each. These particular numbers are big enough, though, that any software will take a little bit doing them. ---------------------------------------------------------------------- | Sage Version 4.7.1, Release Date: 2011-08-11 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- sage: %time factor(296603151077074197308684124715622560525294501766069587161483751777320391554230009758029564174782423278870115094641644418265512090475910) It still hasn't finished :) If you are more specifically interested in certain types of factorizations or primes, there may be even more optimized software, e.g. the GIMPS uses a custom program to check Mersenne numbers for primality. From toy.raymond at gmail.com Wed Sep 14 18:18:15 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 14 Sep 2011 16:18:15 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: References: Message-ID: On Sat, Sep 10, 2011 at 1:39 AM, wrote: > > Performancewise, unfortunately, maxima colnew is *much* slower than fortran > colnew. One can expect a factor of 100 slower. Raymond and i have measured > the time spent in various parts of the program. The principal part is spent > in the evaluation of the differential equation at the mesh points. Since it > is given in maxima this requires an excursion in maxima land thus is slow. > Perhaps compiling the maxima code will help somewhat. Unfortunately, the maxima compiler is a bit buggy. > One cannot do anything about that. The same occurs for similar problems in > maple or mathematica. More worrisome, a non negligible part of the time is > spent in linear algebra computations which should be as fast as in fortran > if lisp was similarly fast as fortran, as some people claim. But in fact > these computations are also 100 times slower than in fortran, while being > pure lisp stuff. Of course this was a major disappointment for me. > Yes, this is a disappointment to me as well. I think part of the problem is that the Fortran code depends on being able to pass in parts of arrays other functions. In Fortran, there is virtually no cost to this; you just pass in the address of the part you want. In lisp, you can't do this. F2cl creates a displaced array for this (fast), but access to displaced arrays is slow. F2cl tries to reduce this cost by figuring out the parent array with the corresponding offset. The parent array should be a specialized array, so access is fast. Except that indexing of the array has an additional cost because we need the desired index to be added to the offset. This will slow down access by at least a factor of 2 or 3. I don't know why it's 100 times slower, though. Perhaps some additional optimizations by f2cl will reduce the cost. The nice thing about the conversion is that with a little bit of work, we can actually have a bigfloat version (that will run even slower!). Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Wed Sep 14 18:30:15 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 14 Sep 2011 16:30:15 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: References: Message-ID: <4E713907.9050807@eecs.berkeley.edu> On 9/14/2011 4:18 PM, Raymond Toy wrote:... > > I don't know why it's 100 times slower, though. Perhaps some > additional optimizations by f2cl will reduce the cost. I was puzzling over this too. I would expect that with sufficient cleverness (which might entail writing some pieces of code directly in lisp) one could get within 2X or so of fortran.... or -- for those lisps that support it -- directly calling via a foreign function interface, the fortran code would be just as fast. If speed is important, the next step is, in my opinion, running some benchmarks with profiling so we know where the time is spent. Is it actually in the array-referencing (are we calling subroutines to compute the array indexes? the code that is output from f2cl is not easy to figure out). Or is it in allocating floating point number "boxes" ? Or something else? > > The nice thing about the conversion is that with a little bit of work, > we can actually have a bigfloat version (that will run even slower!). > > 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 amca01 at gmail.com Wed Sep 14 20:37:46 2011 From: amca01 at gmail.com (Alasdair McAndrew) Date: Thu, 15 Sep 2011 11:37:46 +1000 Subject: [Maxima] Factor the following number In-Reply-To: References: Message-ID: That makes sense - I was trying to solve using the cubic polynomials, rather than the sextic one given. Then p = 2122943609450249057621 and the rest is straightforward. -Alasdair 2011/9/15 Biche de C?rynie > Maxima :o) > > No magick here. Actually, I read the page given by "Matematicas". There is > an interesting relation : > > *M = (1800p3 - 1310p2 - 50p - 1) (1800p3 - 1220p2 - 130p - 1) > M-1 = 2 * 5 * p * (90p2 - 61p - 6) (3600p3 - 2620p2 - 120p - 3)* > > With this the problem is quite easy. This gives (almost) p : > inrt(floor(n/1800^2), 6); > But you may find p by "direct" factorization, since it's quite small. > > > > 2011/9/14 Alasdair McAndrew > >> Nice - what software did you use for the factorization? >> >> -Alasdair >> >> >> 2011/9/14 Biche de C?rynie >> >>> Prime factors for your numbers : >>> >>> 2 >>> 5 >>> 2122943609450249057621 >>> 405620061201508643988375124643817406843652803 >>> 34444340671702467488860342883734479061576134487870291451728421045657 >>> >>> And >>> >>> 17222170335851233744430171441867239530788067265164581820366701099039 >>> 17222170335851233744430577061928441039432055599953297058218812657049 >>> >>> Jean-Claude Arbaut >>> >>> >>> >>> On Wed, Sep 14, 2011 at 2:21 AM, Alasdair McAndrew wrote: >>> >>>> The number is simply too big to be factored by Maxima's algorithm. You >>>> might like to try other software with better support for computational >>>> number theory, such as Pari/GP. I suspect that the numbers in question >>>> (from here ) >>>> were produced by a polynomial, so all you need to do is to solve the >>>> appropriate polynomial f(x)=n, where n is the smaller of the two numbers. >>>> >>>> -Alasdair >>>> >>>> On Wed, Sep 14, 2011 at 7:25 AM, Matematicas wrote: >>>> >>>>> Numbers are called Ruth-Aaron pair, such as {714, 715}. Are >>>>> consecutive numbers {n, n +1} such that the sum of the prime factors >>>>> of each are equal. >>>>> >>>>> Let's see >>>>> >>>>> 714 = 2x3x7x17 >>>>> 715 = 5x11x13 >>>>> >>>>> Sum of divisors of 714 = 29 = Sum of divisors of 715 >>>>> >>>>> >>>>> >>>>> FACTORS FOR EACH OF THE FOLLOWING TWO NUMBERS. COULD NOT DERIVE >>>>> >>>>> A number of 135 digits es1 Aoron >>>>> >>>>> * >>>>> 296603151077074197308684124715622560525294501766069587161483751777320391554230009758029564174782423278870115094641644418265512090475910 >>>>> * >>>>> >>>>> >>>>> The following of the former is >>>>> >>>>> * >>>>> 296603151077074197308684124715622560525294501766069587161483751777320391554230009758029564174782423278870115094641644418265512090475911 >>>>> * >>>>> >>>>> The problem is that the command ifactor(n) don't work, generate an >>>>> error, can help me?? >>>>> >>>>> 1<#13268eec65d80c87_13267fb41fb33c74_13267b72b91849ef_132654fce756ae77_13264ae44588bf30_sdfootnote1anc> >>>>> http://www.immortaltheory.com/NumberTheory/RuthAaron.htm >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Maxima mailing list >>>>> Maxima at math.utexas.edu >>>>> http://www.math.utexas.edu/mailman/listinfo/maxima >>>>> >>>>> >>>> >>>> >>>> -- >>>> Blog: http://amca01.wordpress.com >>>> Web: http://bit.ly/Alasdair >>>> Facebook: http://www.facebook.com/alasdair.mcandrew >>>> >>>> _______________________________________________ >>>> 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 >>> >>> >> >> >> -- >> Blog: http://amca01.wordpress.com >> Web: http://bit.ly/Alasdair >> Facebook: http://www.facebook.com/alasdair.mcandrew >> > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -- Blog: http://amca01.wordpress.com Web: http://bit.ly/Alasdair Facebook: http://www.facebook.com/alasdair.mcandrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Thu Sep 15 03:50:07 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Thu, 15 Sep 2011 10:50:07 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: Message-ID: Raymond Toy wrote: > On Sat, Sep 10, 2011 at 1:39 AM, wrote: > >> >> Performancewise, unfortunately, maxima colnew is *much* slower than >> fortran colnew. One can expect a factor of 100 slower. Raymond and i have >> measured the time spent in various parts of the program. The principal >> part is spent in the evaluation of the differential equation at the mesh >> points. Since it is given in maxima this requires an excursion in maxima >> land thus is slow. >> > > Perhaps compiling the maxima code will help somewhat. Unfortunately, the > maxima compiler is a bit buggy. > When we looked at these numbers we tried to compile the formulas. It made no difference. This is not suprising. When you write x+y in maxima, the + is not an ordinary plus, it is an MPLUS, and this simple formula goes through several steps before being recognized as the addition of two numbers. Compiling the formula doesn't change that. > > Yes, this is a disappointment to me as well. I think part of the problem > is that the Fortran code depends on being able to pass in parts of arrays > other > functions. In Fortran, there is virtually no cost to this; you just pass > in > the address of the part you want. In lisp, you can't do this. F2cl > creates a displaced array for this (fast), but access to displaced arrays > is slow. F2cl tries to reduce this cost by figuring out the parent array > with the > corresponding offset. The parent array should be a specialized array, so > access is fast. Except that indexing of the array has an additional cost > because we need the desired index to be added to the offset. This will > slow down access by at least a factor of 2 or 3. > I have here the profiling we did using sbcl. One of the routines which is most used and takes time is COLNEW::DAXPY This routine is surprisingly simple, it just does linear combinations of 2 columns of a matrix. It is 48 lines of fortran with comments! One of the comments is c constant times a vector plus a vector. c uses unrolled loops for increments equal to one. Perhaps this loop unrolling is beneficial in fortran but bad in lisp? Anyways this is a place where access to matrix elements plays a significant role, as you say. The statistical profiling shows that mosts samples live in maxima code, things like SIMPLIFYA MEVAL1, etc. This should correspond to the above discussion of evaluations of the differential equation at mesh points. Other frequant calls are to sbcl functions i suppose. In fact here is the beginning: Self Total Cumul Nr Count % Count % Count % Calls Function ------------------------------------------------------------------------ 1 490 5.8 1138 13.5 490 5.8 - REMOVE-IF 2 467 5.6 467 5.6 957 11.4 - "foreign function sigprocmask" 3 438 5.2 438 5.2 1395 16.6 - SB-EXT:WEAK-POINTER- VALUE 4 260 3.1 260 3.1 1655 19.7 - SB-C::COMPACT-INFO- LOOKUP 5 235 2.8 235 2.8 1890 22.5 - SB-VM::ALLOC-SIGNED- BIGNUM-IN-EAX 6 211 2.5 1725 20.5 2101 25.0 - SIMPLIFYA 7 210 2.5 210 2.5 2311 27.5 - SB-IMPL::GET3 8 182 2.2 8345 99.3 2493 29.7 - MEVAL1 9 137 1.6 137 1.6 2630 31.3 - (LAMBDA (SB- IMPL::VALUE)) 10 134 1.6 139 1.7 2764 32.9 - (LABELS SB- IMPL::EQUAL-AUX) 11 134 1.6 134 1.6 2898 34.5 - SB-KERNEL:%MEMBER-EQ 12 128 1.5 193 2.3 3026 36.0 - ALIKE1 13 124 1.5 131 1.6 3150 37.5 - LENGTH 14 116 1.4 247 2.9 3266 38.9 - SB-KERNEL:VALUES- SPECIFIER-TYPE 15 100 1.2 615 7.3 3366 40.1 - (FLET SB-C::LOOKUP) 16 97 1.2 97 1.2 3463 41.2 - SB-C::VOLATILE-INFO- LOOKUP 17 93 1.1 335 4.0 3556 42.3 - SB-KERNEL:SPECIFIER- TYPE 18 91 1.1 1318 15.7 3647 43.4 - SUBST1 19 91 1.1 233 2.8 3738 44.5 - EQUAL 20 90 1.1 2498 29.7 3828 45.6 - MAKE-ARRAY 21 88 1.0 88 1.0 3916 46.6 - SB-IMPL::GET2 22 84 1.0 109 1.3 4000 47.6 - SB-KERNEL:CSUBTYPEP 23 81 1.0 163 1.9 4081 48.6 - GETL 24 80 1.0 165 2.0 4161 49.5 - ALIKE 25 68 0.8 100 1.2 4229 50.3 76618 COLNEW::APPROX 26 65 0.8 65 0.8 4294 51.1 - KEYWORDP 27 65 0.8 65 0.8 4359 51.9 - (LABELS SB- IMPL::SXHASH-RECURSE) 28 63 0.7 390 4.6 4422 52.6 - PLS 29 63 0.7 254 3.0 4485 53.4 - TIMESIN 30 59 0.7 121 1.4 4544 54.1 - EQTEST 31 55 0.7 3194 38.0 4599 54.7 23178 COLNEW::VWBLOK The first explicit colnew functions are approx and vwblock. Approx evaluates numerically the differential equation, this is compute intensive, and vwblock solves a big linear system, which is also compute intensive. By contrast DAXPY is very simple, but called very much: 63 28 0.3 49 0.6 5793 68.9 1164244 COLNEW::DAXPY -- Michel Talon From fateman at eecs.berkeley.edu Thu Sep 15 09:46:53 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 15 Sep 2011 07:46:53 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: References: Message-ID: <4E720FDD.5010102@eecs.berkeley.edu> On 9/15/2011 1:50 AM, Michel Talon wrote: > ... > When we looked at these numbers we tried to compile the formulas. It made no > difference. This is not suprising. When you write x+y in maxima, the + is > not an ordinary plus, it is an MPLUS, and this simple formula goes through > several steps before being recognized as the addition of two numbers. > Compiling the formula doesn't change that. If you know that x and y are always double-float numbers, then a declaration is needed to take advantage of this fact. add2(x,y):=block([],mode_declare([x,y],float),x+y); for i:1 thru 10000 do add2(3.0,4.0); takes 0.33 sec compile(add2); for i:1 thru 10000 do add2(3.0,4.0); takes 0.11 sec for i:1 thru 10000 do nothing(x,y); takes 0.06 sec. (empty loop) so speedup is about 5.4X > > > I have here the profiling we did using sbcl. One of the routines which is > most used and takes time is COLNEW::DAXPY DAXPY is a fundamental part of LINPACK, I think. rewriting it could make other things faster too. unfortunately, if I understand the SBCL profiling, the time spent in the 28 calls DAXPY constitutes less than 1% of the time for the whole task. the other colnew functions, approx and vwblok are also insignificant (less than 1%). The profile reveals that SIMPLIFYA and its subroutines take 20.5% of the time. If you know that all the variables are floats, then SIMPLIFYA should be largely removed by mode_declare and compiling. > This routine is surprisingly simple, it just does linear combinations of 2 > columns of a matrix. It is 48 lines of fortran with comments! One of the > comments is > c constant times a vector plus a vector. > c uses unrolled loops for increments equal to one. > Perhaps this loop unrolling is beneficial in fortran but bad in lisp? probably not "bad" in lisp, but maybe ineffective. > Anyways this is a place where access to matrix elements plays a significant > role, as you say. > The statistical profiling shows that mosts samples live in maxima code, > things like SIMPLIFYA MEVAL1, etc. This should correspond to the above > discussion of evaluations of the differential equation at mesh points. > Other frequant calls are to sbcl functions i suppose. In fact here is the > beginning: > > Self Total Cumul > Nr Count % Count % Count % Calls Function > ------------------------------------------------------------------------ > 1 490 5.8 1138 13.5 490 5.8 - REMOVE-IF > 2 467 5.6 467 5.6 957 11.4 - "foreign function > sigprocmask" > 3 438 5.2 438 5.2 1395 16.6 - SB-EXT:WEAK-POINTER- > VALUE > 4 260 3.1 260 3.1 1655 19.7 - SB-C::COMPACT-INFO- > LOOKUP > 5 235 2.8 235 2.8 1890 22.5 - SB-VM::ALLOC-SIGNED- > BIGNUM-IN-EAX > 6 211 2.5 1725 20.5 2101 25.0 - SIMPLIFYA > 7 210 2.5 210 2.5 2311 27.5 - SB-IMPL::GET3 > 8 182 2.2 8345 99.3 2493 29.7 - MEVAL1 > 9 137 1.6 137 1.6 2630 31.3 - (LAMBDA (SB- > IMPL::VALUE)) > 10 134 1.6 139 1.7 2764 32.9 - (LABELS SB- > IMPL::EQUAL-AUX) > 11 134 1.6 134 1.6 2898 34.5 - SB-KERNEL:%MEMBER-EQ > 12 128 1.5 193 2.3 3026 36.0 - ALIKE1 > 13 124 1.5 131 1.6 3150 37.5 - LENGTH > 14 116 1.4 247 2.9 3266 38.9 - SB-KERNEL:VALUES- > SPECIFIER-TYPE > 15 100 1.2 615 7.3 3366 40.1 - (FLET SB-C::LOOKUP) > 16 97 1.2 97 1.2 3463 41.2 - SB-C::VOLATILE-INFO- > LOOKUP > 17 93 1.1 335 4.0 3556 42.3 - SB-KERNEL:SPECIFIER- > TYPE > 18 91 1.1 1318 15.7 3647 43.4 - SUBST1 > 19 91 1.1 233 2.8 3738 44.5 - EQUAL > 20 90 1.1 2498 29.7 3828 45.6 - MAKE-ARRAY > 21 88 1.0 88 1.0 3916 46.6 - SB-IMPL::GET2 > 22 84 1.0 109 1.3 4000 47.6 - SB-KERNEL:CSUBTYPEP > 23 81 1.0 163 1.9 4081 48.6 - GETL > 24 80 1.0 165 2.0 4161 49.5 - ALIKE > 25 68 0.8 100 1.2 4229 50.3 76618 COLNEW::APPROX > 26 65 0.8 65 0.8 4294 51.1 - KEYWORDP > 27 65 0.8 65 0.8 4359 51.9 - (LABELS SB- > IMPL::SXHASH-RECURSE) > 28 63 0.7 390 4.6 4422 52.6 - PLS > 29 63 0.7 254 3.0 4485 53.4 - TIMESIN > 30 59 0.7 121 1.4 4544 54.1 - EQTEST > 31 55 0.7 3194 38.0 4599 54.7 23178 COLNEW::VWBLOK > > The first explicit colnew functions are approx and vwblock. > Approx evaluates numerically the differential equation, this is compute > intensive, and vwblock solves a big linear system, which is also compute > intensive. > > By contrast DAXPY is very simple, but called very much: > 63 28 0.3 49 0.6 5793 68.9 1164244 COLNEW::DAXPY > > > From talon at lpthe.jussieu.fr Thu Sep 15 11:15:52 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Thu, 15 Sep 2011 18:15:52 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: <4E720FDD.5010102@eecs.berkeley.edu> Message-ID: Richard Fateman wrote: >> I have here the profiling we did using sbcl. One of the routines which >> is most used and takes time is COLNEW::DAXPY > DAXPY is a fundamental part of LINPACK, I think. Yes > unfortunately, if I understand the SBCL profiling, the time spent in the > 28 calls DAXPY constitutes less than 1% of the time for the whole task. There are indirect calls to daxpy, in fact 1164244, even if few samples fall inside because it is a so small function, and ther eare not a lot of samples generally. > > the other colnew functions, approx and vwblok are also insignificant > (less than 1%). > > The profile reveals that SIMPLIFYA and its subroutines take 20.5% of the > time. > If you know that all the variables are floats, then SIMPLIFYA should be > largely > removed by mode_declare and compiling. > Ordinary profiling shows that approx, vwblock etc. eat half of the time. seconds | gc | consed | calls | sec/call | name ------------------------------------------------------------ 31.360 | 0.928 | 836,818,968 | 1,064 | 0.029473 | COLNEW::LSYSLV 16.420 | 0.225 | 349,003,072 | 23,178 | 0.000708 | COLNEW::VWBLOK 9.829 | 0.937 | 800,942,728 | 52,124 | 0.000189 | COLNEW::DGESL 4.254 | 0.481 | 318,090,424 | 7,726 | 0.000551 | COLNEW::DGEFA ------------------------------------------------------------ 61.862 | 2.571 | 2,304,855,192 | 84,092 | | Total -- Michel Talon From fateman at eecs.berkeley.edu Thu Sep 15 12:25:57 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 15 Sep 2011 10:25:57 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: <20110915162726.GA12096@lpthe.jussieu.fr> References: <20110915162726.GA12096@lpthe.jussieu.fr> Message-ID: <4E723525.4060601@eecs.berkeley.edu> There are a few issues here. 1. Given that fortran does not do garbage collection at all in colnew, one wonders why lisp needs to do this. Probably because intermediate data/ floats are allocated and returned. This GC itself is a waste of time but more importantly it suggests that memory is unnecessarily being allocated and freed. Perhaps a good compiler can change this so all computations are done in registers. That is, the fact that there is gc suggests a lot of other time could be saved. 2. for CMUCL and SBCL it may be very critical to have the lisp declarations correct. In my experience (with Allegro CL) there are sometimes very subtle improvements in declarations that make the program run much faster. Looking at the diagnostics from the compiler to see what types are unknown and what is open-coded can help. I even sometimes look at the assembly code that is generated. 3. If 50% of the time is spent in colnew, then we can't speed up the program by more than 2X, even if colnew is free. If the current program is 100X slower, we would only get it to be 50X slower. We have to address the maxima/lisp/setup code to get better than 50X. 4. I think that writing the linpack programs in idiomatic efficient common lisp may require a higher-level look at the code. For example, instead of doing fancy indexing, it may be faster to copy a submatrix to a freshly-allocated data structure. For DAXPY, which does essentially y[i]= a*x[i]+y[i], maybe not. Guessing at what a lisp compiler might do, it is hard to say what is optimal, but (defun daxpy(n da dx incx dy incy) (declare ....) ;; important (if (= incx incy 1) (loop for k from 1 to n do (incf (aref dy k)(* da (aref dx k))) ;; common case ;; do something slightly fancier here if increment steps are not both 1 )) This code above, or something like it, would work if x,y are simple arrays. If they are cross-sections of a 2-d array, it would be trickier. One issue is whether "incf" computes the location of y[i] once or twice. Anyway, a version of daxpy in lisp should be about 5 lines of code. RJF From toy.raymond at gmail.com Thu Sep 15 13:24:34 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 15 Sep 2011 11:24:34 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: <4E723525.4060601@eecs.berkeley.edu> References: <20110915162726.GA12096@lpthe.jussieu.fr> <4E723525.4060601@eecs.berkeley.edu> Message-ID: On Thu, Sep 15, 2011 at 10:25 AM, Richard Fateman wrote: > There are a few issues here. > > 1. Given that fortran does not do garbage collection at all in colnew, one > wonders why lisp needs to do this. > Probably because intermediate data/ floats are allocated and returned. This > GC itself is a waste of time but more importantly it suggests that memory > is unnecessarily being allocated and freed. Perhaps a good compiler can > change this so all computations are done in registers. > That is, the fact that there is gc suggests a lot of other time could be > saved. > There should be enough declarations in the code so that boxing withing the function is not done. However, boxing is needed if the function calls another function. That's unavoidable. > > > 4. I think that writing the linpack programs in idiomatic efficient common > lisp may require a higher-level look at the code. For example, instead of > doing fancy indexing, it may be faster to copy a submatrix to a > freshly-allocated data structure. > That's a possibility. Of course, two copies need to be done. Hard to tell what would be more beneficial unless we know the sizes of the arrays. > > (defun daxpy(n da dx incx dy incy) > (declare ....) ;; important > > (if (= incx incy 1) (loop for k from 1 to n do (incf (aref dy k)(* da > (aref dx k))) ;; common case > > ;; do something slightly fancier here if increment steps are not both 1 > )) > > > This code above, or something like it, would work if x,y are simple > arrays. If they are cross-sections of a 2-d array, it would be trickier. > One issue is whether "incf" computes the location of y[i] once or twice. > I think given current architectures, the cost of computing the address of y[i] is very small compared to actually getting the value. But that is highly dependent on the cache. > > Anyway, a version of daxpy in lisp should be about 5 lines of code. > Yes, but it probably won't be fast in colnew. :-( From a quick grep of the code, daxpy is called in 3 different places, and each place calls daxpy with a slice of a larger array. F2cl tries to be smart about this and figures out the underlying array. That could be expensive, depending on how many intervening slices have been done. It might be cheaper to just use the normal displaced-array access. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Thu Sep 15 13:42:50 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 15 Sep 2011 11:42:50 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: References: <20110915162726.GA12096@lpthe.jussieu.fr> <4E723525.4060601@eecs.berkeley.edu> Message-ID: <4E72472A.3090903@eecs.berkeley.edu> On 9/15/2011 11:24 AM, Raymond Toy wrote: ... > > Yes, but it probably won't be fast in colnew. :-( From a quick grep > of the code, daxpy is called in 3 different places, and each place > calls daxpy with a slice of a larger array. F2cl tries to be smart > about this and figures out the underlying array. That could be > expensive, depending on how many intervening slices have been done. > It might be cheaper to just use the normal displaced-array access. The only other hack that comes to mind is to expand daxpy inline, perhaps as a macro, and that might not help either. Or call fortran. RJF From fateman at eecs.berkeley.edu Thu Sep 15 13:57:01 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 15 Sep 2011 11:57:01 -0700 Subject: [Maxima] inf and minf Message-ID: <4E724A7D.7080802@eecs.berkeley.edu> Do we need minf? (negative real infinity) Note that - minf is currently not simplified to inf. RJF From toy.raymond at gmail.com Thu Sep 15 14:33:56 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 15 Sep 2011 12:33:56 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: <4E72472A.3090903@eecs.berkeley.edu> References: <20110915162726.GA12096@lpthe.jussieu.fr> <4E723525.4060601@eecs.berkeley.edu> <4E72472A.3090903@eecs.berkeley.edu> Message-ID: On Thu, Sep 15, 2011 at 11:42 AM, Richard Fateman wrote: > On 9/15/2011 11:24 AM, Raymond Toy wrote: > ... > > > >> Yes, but it probably won't be fast in colnew. :-( From a quick grep of >> the code, daxpy is called in 3 different places, and each place calls daxpy >> with a slice of a larger array. F2cl tries to be smart about this and >> figures out the underlying array. That could be expensive, depending on how >> many intervening slices have been done. It might be cheaper to just use the >> normal displaced-array access. >> > The only other hack that comes to mind is to expand daxpy inline, perhaps > as a macro, and that might not help either. Or call fortran. > > The macro doesn't solve the array slicing issue. Anyway, here is a partial profile, including maxima and colnew functions from running prob4.mac using cmucl: Consed | Calls | Secs | Sec/Call | Bytes/C. | Name: ----------------------------------------------------------------------- 249,220,856 | 98,488 | 20.710 | 0.00021 | 2,530 | MEVALARGS 888,872 | 16,444,225 | 9.440 | 0.00000 | 0 | ALIKE1 213,018,152 | 443,364 | 8.240 | 0.00002 | 480 | SUBST1 96,491,264 | 1,395,109 | 7.710 | 0.00001 | 69 | TIMESIN 25,733,248 | 6,238,799 | 7.380 | 0.00000 | 4 | SIMPLIFYA 55,725,752 | 3,575,248 | 7.280 | 0.00000 | 16 | ALIKE 38,669,824 | 4,889,005 | 6.870 | 0.00000 | 8 | ZEROP1 88,211,472 | 2,092,049 | 6.860 | 0.00000 | 42 | PLS 68,157,344 | 381,477 | 6.620 | 0.00002 | 179 | MEMALIKE 152,944,024 | 41,348 | 6.060 | 0.00015 | 3,699 | COLNEW::DGESL 37,519,816 | 3,145,210 | 5.910 | 0.00000 | 12 | SUBST0 61,412,240 | 1,392,640 | 5.650 | 0.00000 | 44 | TMS 40,780,056 | 849,577 | 4.780 | 0.00001 | 48 | KINDP 42,017,976 | 644,313 | 4.730 | 0.00001 | 65 | SIMPTIMES 0 | 7,257,154 | 4.480 | 0.00000 | 0 | MNUMP 31,278,712 | 908,835 | 4.160 | 0.00000 | 34 | SIMPLUS 0 | 5,529,289 | 3.730 | 0.00000 | 0 | GETL 88,765,584 | 1,053 | 3.670 | 0.00349 | 84,298 | COLNEW::LSYSLV ... 121,144 | 120 | 0.000 | 0.00000 | 1,010 | COLNEW:APPSLN 13,504 | 303 | 0.000 | 0.00000 | 45 | COLNEW::VMONDE 336,128 | 1,652 | 0.000 | 0.00000 | 203 | COLNEW::HORDER ------------------------------------------------------------------- 2,333,921,136 | 144,589,941 | 230.770 | | | Total Adding up all of the time used by colnew functions, we get 21.02 sec. Adding the times for all the other functions, we get 209 sec for maxima. (The sum doesn't equal 230.77 due to profiling overhead, I think.) Hardly seems worth optimizing colnew since it represents just 10% of the time. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From kcrisman at gmail.com Thu Sep 15 14:44:44 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Thu, 15 Sep 2011 15:44:44 -0400 Subject: [Maxima] inf and minf Message-ID: > > Message: 5 > Date: Thu, 15 Sep 2011 11:57:01 -0700 > From: Richard Fateman > To: Maxima - list > Subject: [Maxima] inf and minf > Message-ID: <4E724A7D.7080802 at eecs.berkeley.edu> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Do we need minf? ? (negative real infinity) > > Note that - minf is currently not simplified to inf. > > RJF Is there a pressing need to remove this? It seems like it would break a lot of existing code (or at least cause annoyance for anyone using Maxima for improper integrals). Maybe there is some fairly substantial savings in time or memory? I have to admit that this was confusing to me at first, but I'm now used to it. The following does work. (%i9) integrate(1/x^2,x,minf,-1); (%o9) 1 (%i10) integrate(1/x^2,x,-inf,-1); (%o10) 1 (%i11) integrate(1/x^2,x,1,inf); (%o11) 1 (%i12) integrate(1/x^2,x,1,-minf); (%o12) 1 So maybe it wouldn't be a huge change. ? Just let us know so we could modify Sage's use of Maxima accordingly. From macrakis at alum.mit.edu Thu Sep 15 15:41:44 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 15 Sep 2011 16:41:44 -0400 Subject: [Maxima] Fwd: inf and minf In-Reply-To: References: <4E724A7D.7080802@eecs.berkeley.edu> Message-ID: We certainly don't need minf, and the user's view of the system would be cleaner without it. Removing it should be fairly straightforward, because a grep should catch everywhere it is used (except for users' load files). Are you volunteering to do it? Not sure that it has a lot of value to do this, though. I'd think that far higher value would be fixing such things as inf-inf => 0, inf/inf => 1, 0*inf => 0, is(2*inf > inf) => true, etc. But more work, too. Any particular reason you're bringing this up now? -s On Thu, Sep 15, 2011 at 14:57, Richard Fateman wrote: > Do we need minf? (negative real infinity) > > Note that - minf is currently not simplified to inf. > > 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 willisb at unk.edu Thu Sep 15 17:07:41 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 15 Sep 2011 17:07:41 -0500 Subject: [Maxima] Fwd: inf and minf In-Reply-To: References: , <4E724A7D.7080802@eecs.berkeley.edu> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > Removing it should be fairly straightforward, because a grep should catch everywhere it is used (except for users' load files). ? > Are you volunteering to do it? Doing (defvar $minf '((mtimes simp) -1 $inf)) and running the testsuite gives 31 errors. The same for the share testsuite gives 5 errors. --Barton From macrakis at alum.mit.edu Thu Sep 15 17:14:28 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 15 Sep 2011 18:14:28 -0400 Subject: [Maxima] Fwd: inf and minf In-Reply-To: References: <4E724A7D.7080802@eecs.berkeley.edu> Message-ID: I wasn't suggesting that defvar would do it. There are many places that explicitly return '$minf (which the defvar won't help with) or compare things to '$minf (possibly with eq). There are probably places that assume that if something isn't (memq x '($inf $minf $infinity)), then it is finite. Etc. -s On Thu, Sep 15, 2011 at 18:07, Barton Willis wrote: > > -----maxima-bounces at math.utexas.edu wrote: ----- > > > > Removing it should be fairly straightforward, because a grep should catch > everywhere it is used (except for users' load files). > > Are you volunteering to do it? > > Doing (defvar $minf '((mtimes simp) -1 $inf)) and running the testsuite > gives 31 errors. > The same for the share testsuite gives 5 errors. > > --Barton > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Thu Sep 15 17:18:27 2011 From: talon at lpthe.jussieu.fr (talon at lpthe.jussieu.fr) Date: Fri, 16 Sep 2011 00:18:27 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: <20110915162726.GA12096@lpthe.jussieu.fr> <4E723525.4060601@eecs.berkeley.edu> <4E72472A.3090903@eecs.berkeley.edu> Message-ID: Raymond Toy wrote: > On Thu, Sep 15, 2011 at 11:42 AM, Richard Fateman > > Anyway, here is a partial profile, including maxima and colnew functions > from running prob4.mac using cmucl: ........ > > Hardly seems worth optimizing colnew since it represents just 10% of the > time. This is not at all what i see in the profiles i have, where colnew related functions use 50% of the time and maxima stuff 50%. I don't know why there is this discrepancy. But i have 2 profiles, with cmucl and sbcl giving essentially the same result. If this is correct, there is hardly any hope to get good performance by tweaking the declarations in the maxima file prob[34].mac. In the profile i have posted here, in a total of 61 seconds, the linpack routine dgesl *alone* takes 10 s, and dgefa 4 seconds more (this includes daxpy which was not profiled). This is totally incompatible with a total colnew influence of 10%. Moreover these functions are pure lisp without *any* maxima intervention anywhere, and in the profile of the fortran version they take a small fraction of a second (the whole program runs in less than a second). So we are always with this huge factor between the lisp translation and the fortran version. I agree completely with professor Fateman when he says that even if we took the option of using the original fortran program colnew linked in some way into lisp, this would not be a huge gain, it would only divide the time by 2. This is basically what occurs in the scilab version of colnew where the same computation takes a non negligible time, because, while colnew is the fortran version, you have to make excursions to the scilab interpreter to evaluate the differential equation, exactly like here where you have to enter maxima. In the python version, they have introduced several threads which compute the differential equations at the mesh points simultaneously, so that the slow part benefits from a multiprocessor machine. Here colnew is the fortran version, compiled and linked into python. They have modified LSYSLV so that it is able to absorb values at several mesh points at the same time instead of successively. I recall the profile here: seconds | gc | consed | calls | sec/call | name ------------------------------------------------------------ 31.360 | 0.928 | 836,818,968 | 1,064 | 0.029473 | COLNEW::LSYSLV 16.420 | 0.225 | 349,003,072 | 23,178 | 0.000708 | COLNEW::VWBLOK 9.829 | 0.937 | 800,942,728 | 52,124 | 0.000189 | COLNEW::DGESL 4.254 | 0.481 | 318,090,424 | 7,726 | 0.000551 | COLNEW::DGEFA ------------------------------------------------------------ 61.862 | 2.571 | 2,304,855,192 | 84,092 | | Total Since fsub etc. are not profiled, they are hidden in LSYSLV, which is consistent with the fact that they eat 30s, half of the time. Of course this statement is based on the fact that the equations are computed in LSYSLV (this requires evaluating the differential equations at mesh points) and solved in VWBLOCK (this goes through some tricks and then using linpack dgesl and dgefa). Professor Fateman remarks there is garbage collection in these linpack routines, which appears both true and puzzling. In the fortran program there is static allocation for all the arrays, and the same space is always reused in all the computations. It seems lisp does differently. This being said the total cost of garbage collection, 2s is negligible with respect to the 60s, but not to the total running time of the fortran version (< 1 s). > > Ray -- Michel Talon From fateman at eecs.berkeley.edu Thu Sep 15 17:22:27 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 15 Sep 2011 15:22:27 -0700 Subject: [Maxima] Fwd: Re: inf and minf In-Reply-To: <4E725864.9080902@eecs.berkeley.edu> References: <4E725864.9080902@eecs.berkeley.edu> Message-ID: <4E727AA3.5090907@eecs.berkeley.edu> (originally only responded to kcrisman...) -------- Original Message -------- Subject: Re: [Maxima] inf and minf Date: Thu, 15 Sep 2011 12:56:20 -0700 From: Richard Fateman To: Karl-Dieter Crisman , fateman at cs.berkeley.edu On 9/15/2011 12:44 PM, Karl-Dieter Crisman wrote: >> Message: 5 >> Date: Thu, 15 Sep 2011 11:57:01 -0700 >> From: Richard Fateman >> To: Maxima - list >> Subject: [Maxima] inf and minf >> Message-ID:<4E724A7D.7080802 at eecs.berkeley.edu> >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed >> >> Do we need minf? (negative real infinity) >> >> Note that - minf is currently not simplified to inf. >> >> RJF > > Is there a pressing need to remove this? It seems like it would break > a lot of existing code (or at least cause annoyance for anyone using > Maxima for improper integrals). It's generally a hassle if you have two internal representations of the same value, at least if they coexist in the same subsystem. (There are indeed different ways of representing things because there are taylor series, polynomials, poisson series ... that can be equivalent). But in the general representation in maxima, 1/x is x^(-1) internally, -x is (-1)*x etc. I am trying to write a paper in which I mention the notion of DirectedInfinity as in Mathematica. ComplexInfinity is DirectedInfinity[]. real positive infinity is DirectedInfinity[1] negative is DirectedInfinity[-1] and any point on the unit circle can denote a particular direction as argument to DirectedInfinity. -DirectedInfinity[1] is simplified to DirectedInfinity[-1]. The analogous simplification is not done in Maxima. That's probably a misfeature. I wonder if Maxima really needs minf. other than seeing - - oo in wxmaxima, I have no specific issue. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Thu Sep 15 17:29:17 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 15 Sep 2011 15:29:17 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: References: <20110915162726.GA12096@lpthe.jussieu.fr> <4E723525.4060601@eecs.berkeley.edu> <4E72472A.3090903@eecs.berkeley.edu> Message-ID: <4E727C3D.7030309@eecs.berkeley.edu> On 9/15/2011 3:18 PM, talon at lpthe.jussieu.fr wrote: ... > This being said the total cost of garbage collection, 2s is negligible > with respect to the 60s, but not to the total running time of the > fortran version (< 1 s). The cost for gc may not be high, but the fact that it is needed at all suggests that something is going on that is not necessary. The fortran program presumably just uses the arrays that it is given as arguments, so there should be no array allocation. I think it is just creating floating-point number "boxes". I don't understand the discrepancy between 50% of the time and "negligible" between Michel and Ray; since I have some interest (as does Ray) in making lisp numerical programs run fast, I hope we can come to some agreement on this. From toy.raymond at gmail.com Thu Sep 15 17:51:49 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 15 Sep 2011 15:51:49 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: <4E727C3D.7030309@eecs.berkeley.edu> References: <20110915162726.GA12096@lpthe.jussieu.fr> <4E723525.4060601@eecs.berkeley.edu> <4E72472A.3090903@eecs.berkeley.edu> <4E727C3D.7030309@eecs.berkeley.edu> Message-ID: On Thu, Sep 15, 2011 at 3:29 PM, Richard Fateman wrote: > On 9/15/2011 3:18 PM, talon at lpthe.jussieu.fr wrote: > ... > > > This being said the total cost of garbage collection, 2s is negligible >> with respect to the 60s, but not to the total running time of the fortran >> version (< 1 s). >> > > The cost for gc may not be high, but the fact that it is needed at all > suggests that something is going on that is not necessary. The fortran > program presumably just uses the arrays that it is given as arguments, so > there should be no array allocation. I think it is just creating > floating-point number "boxes". > Don't have an explanation for all of this, but certainly daxpy needs consing. Or rather the caller must do it because it needs to pass a double-float value to daxpy. There are also some known issues in cmucl that some consing happens when it seem that it shouldn't. I'll have to compile the code at higher optimization to see all of the boxing notes to see if they make sense. > > I don't understand the discrepancy between 50% of the time and "negligible" > between Michel and Ray; > since I have some interest (as does Ray) in making lisp numerical programs > run fast, I hope we can come to some agreement on this. > > Could be that sbcl did a better job of optimizing, especially if it's a 64-bit version because then the 32-bit integer Fortran quantities will fit nicely in a fixnum. Could also be a bug in cmucl's profiler. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Thu Sep 15 18:15:28 2011 From: talon at lpthe.jussieu.fr (talon at lpthe.jussieu.fr) Date: Fri, 16 Sep 2011 01:15:28 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: <20110915162726.GA12096@lpthe.jussieu.fr> <4E723525.4060601@eecs.berkeley.edu> <4E72472A.3090903@eecs.berkeley.edu> <4E727C3D.7030309@eecs.berkeley.edu> Message-ID: Raymond Toy wrote: x >> >> I don't understand the discrepancy between 50% of the time and >> "negligible" >> between Michel and Ray; >> since I have some interest (as does Ray) in making lisp numerical >> programs run fast, I hope we can come to some agreement on this. >> >> Could be that sbcl did a better job of optimizing, especially if it's a > 64-bit version because then the 32-bit integer Fortran quantities will fit > nicely in a fixnum. Could also be a bug in cmucl's profiler. > > Ray My machine is a 32 bits machine. I have here, in another mail to you, profiles with both cmucl and sbcl which are consistent between themselves but not consistent with your profiles, so we can only agree to disagree. These profiles were done with you new colnew-if which allows to see directly the time spent in fsub and dfsub (basically 50 %): Note that dgesl and dgefa are much slower in cmucl than in sbcl. As always the boundary conditions gsub and dgsub are not relevant. This is because fsub and dfsub are computed on all mesh points while the boundary conditions are computed on 4 points only on this problem. And the number of mesh points rises up to around 80, plus there are several Newton iterations. cmucl _____ Elapsed time, 82.20000000000002 seconds Consed | Calls | Secs | Sec/Call | Bytes/C. | Name: ----------------------------------------------------------------------- 307,865,672 | 52,284 | 19.871 | 0.00038 | 5,888 | FSUB 205,306,464 | 52,124 | 14.742 | 0.00028 | 3,939 | COLNEW::DGESL 349,802,776 | 23,178 | 14.567 | 0.00063 | 15,092 | DFSUB 110,750,040 | 1,064 | 12.956 | 0.01218 | 104,088 | COLNEW::LSYSLV 84,280,384 | 7,726 | 8.309 | 0.00108 | 10,909 | COLNEW::DGEFA 16,853,120 | 23,178 | 3.257 | 0.00014 | 727 | COLNEW::VWBLOK 143,175,200 | 101 | 2.900 | 0.02871 | 1,417,576 | $COLNEW_EXPERT 14,118,080 | 2,524 | 1.140 | 0.00045 | 5,594 | GSUB 9,041,576 | 1,288 | 0.575 | 0.00045 | 7,020 | DGSUB ------------------------------------------------------------------- 1,241,193,312 | 163,467 | 78.316 | | | Total sbcl _____ Elapsed time, 70.38500000000002 seconds seconds | gc | consed | calls | sec/call | name ------------------------------------------------------------- 21.101 | 0.161 | 269,494,984 | 52,284 | 0.000404 | FSUB 16.015 | 0.539 | 337,162,200 | 23,178 | 0.000691 | DFSUB 10.203 | 0.587 | 557,970,888 | 1,064 | 0.009589 | COLNEW::LSYSLV 10.006 | 1.047 | 800,253,040 | 52,124 | 0.000192 | COLNEW::DGESL 4.073 | 0.402 | 317,906,360 | 7,726 | 0.000527 | COLNEW::DGEFA 3.503 | 0.358 | 222,979,672 | 101 | 0.034684 | $COLNEW_EXPERT 1.257 | 0.005 | 12,231,336 | 23,178 | 0.000054 | COLNEW::VWBLOK 0.869 | 0.052 | 10,649,800 | 2,524 | 0.000344 | GSUB 0.334 | 0.000 | 4,102,240 | 1,288 | 0.000259 | DGSUB ------------------------------------------------------------- 67.360 | 3.151 | 2,532,750,520 | 163,467 | | Total -- Michel Talon From virgilinux at yahoo.com Fri Sep 16 07:21:08 2011 From: virgilinux at yahoo.com (Virgil L) Date: Fri, 16 Sep 2011 05:21:08 -0700 (PDT) Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima Message-ID: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> Hello, All: Years ago, I had some limited exposure to Maxima, and recently have re-started using it. I have found many issues/oddities concerning plotting. Some may be caused by my misunderstanding or inability to find relevant information, perhaps others may be (missing) features, or bugs. ?Please, see below for a few items, and thanks in advance for any helpful comment. 1) It seems that getting several plot windows?simultaneously?displayed is problematic, buggy, undocumented or impossible depending upon the specific environment. On Xmaxima (Ubuntu) it seems Options--> Plot Windows --> Multiple only *may* work with the openmath plotting interface... having no effect when gnuplot is utilised. ?Even then, it seems to work inconsistently. For example: block(n:3, plot2d(sin(n*x),[x,0,2*%pi])); block(n:3, plot2d(sin(n*x),[x,0,2*%pi])); show each plot in its own separate window, and both are kept simultaneously open until closed by the user.? However, inexplicably? block(for n in [2,3] do plot2d(sin(n*x),[x,0,%pi])); results in only one window showing the last plot, sin(3x). Probably only one window is open and the first plot is overwritten. ?I can see no logical reason why calling the plot2d function twice from inside a loop would somehow affect the ability for each plot to appear on its own window. Again, the above applies to openmath. If gnuplot is chosen, it appears that the multiple plot windows option is always ignored regardless of the loop. As for wxMaxima, it appears that the equivalent menu choice, plot windows, is not offered at all. As far as I can see, it is not possible (or documented) how to get simultaneous multiple plot windows from wxMaxima. This situation is very unfortunate because some math software makes this functionality extremely easy for the usert. For example, in matlab the command figure (possibly with options) opens a new plot window (from a script or in interactive mode) 1.5) According to: ?http://www.linuxquestions.org/questions/linux-software-2/gnuplot-how-to-plot-individual-plots-in-separate-windows-799327/ gnuplot does support several simultaneous windows through?? set term x11 #?where # is a positive integer... example: set term x11 0 plot sin(x) set term x11 1 plot cos(x) , presumably results in each function plotted in its own window. However, I tried to put set term x11 # inside a gnuplot?preamble, and did not seem to work. 2) A related functionality is the ability to plot several functions on the same axis?sequentially, possibly within a loop. In matlab, this is easily implemented (inside or outside loops) through the binary variable hold. Hold on makes matlab keep on plotting on the same axis (window), until hold off or figure is invoked. ?As of 2006, according to http://www.math.utexas.edu/pipermail/maxima/2006/002796.html?such functionality was impossible in Maxima because gnuplot was (is) "restarted?every time?you enter a plot command". The offered workaround was to construct a list of functions to be plotted, say curves, ?and eventually call plot2d(curves, [x,x1,x2]) While the workaround seems ingenious and easy to implement once known, it seems difficult for a new user to think of it, and manuals/tutorials seem to omit mentioning. It would seem that the "hold on" functionality could be implemented in Maxima, by holding the current plot data (what is sent to gnuplot) in memory, and when the next plot command is invoked, Maxima could combine the new plot data with the one in memory and pass the combined data to gnuplot. For gnuplot it would be like a brand new call, but Maxima would give the user the illusion that the new plot is being added on top of the previous one. 3) One workaround for the lack of a multiple plot windows functionality is to save the file corresponding to each plot, from within a loop. Here, besides convenience considerations, a main issue is to dynamically generate appropriate file names. The best I have come up with so far is something like: pname:sconcat("plot_",a[ind1],"_",b[ind2],".eps"); plot2d(foo(x,-------),[x,0,100],[gnuplot_term,ps],[gnuplot_out_file,pname]); ind1 and ind2 are loop variables, a[], b[] are list with parameter values, and foo(x,-------) is a function to be plotted, which depends on the a and b values. A pname would look like plot_2_3.eps . Perhaps there is a much better way to do this. Anyhow, the above seem minimally or no documented, and is something a new user may need relatively soon in its Maxima journey. Thanks for your attention. Virgil -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri Sep 16 11:01:16 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 16 Sep 2011 09:01:16 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: References: <20110915162726.GA12096@lpthe.jussieu.fr> <4E723525.4060601@eecs.berkeley.edu> <4E72472A.3090903@eecs.berkeley.edu> <4E727C3D.7030309@eecs.berkeley.edu> Message-ID: On Thu, Sep 15, 2011 at 4:15 PM, wrote: > Raymond Toy wrote: > > x > >> > >> I don't understand the discrepancy between 50% of the time and > >> "negligible" > >> between Michel and Ray; > >> since I have some interest (as does Ray) in making lisp numerical > >> programs run fast, I hope we can come to some agreement on this. > >> > >> Could be that sbcl did a better job of optimizing, especially if it's a > > 64-bit version because then the 32-bit integer Fortran quantities will > fit > > nicely in a fixnum. Could also be a bug in cmucl's profiler. > > > > Ray > > My machine is a 32 bits machine. I have here, in another mail to you, > profiles with both cmucl and sbcl which are consistent between themselves > but not consistent with your profiles, so we can only agree to disagree. > These profiles were done with you new colnew-if which allows to see > directly the time spent in fsub and dfsub (basically 50 %): Note that dgesl > and dgefa are much slower in cmucl than in sbcl. As always the boundary > conditions gsub and dgsub are not relevant. This is because fsub and dfsub > are computed on all mesh points while the boundary conditions are computed > on 4 points only on this problem. And the number of mesh points rises up to > around 80, plus there are several Newton iterations. > > Before we do anything else, let's agree on what exactly is being tested. The profile that I reported was using the current maxima sources using cmucl. I just did load(colnew), then enabled profiling for the MAXIMA and COLNEW packages and then load("share/colnew/prob4.mac"). What steps did you use? Also, perhaps prob4 is more complex that we really need. I think prob1.mac is a simpler test.; let's use that for comparison. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri Sep 16 11:36:53 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 16 Sep 2011 09:36:53 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: References: <20110915162726.GA12096@lpthe.jussieu.fr> <4E723525.4060601@eecs.berkeley.edu> <4E72472A.3090903@eecs.berkeley.edu> <4E727C3D.7030309@eecs.berkeley.edu> Message-ID: On Fri, Sep 16, 2011 at 9:01 AM, Raymond Toy wrote: > > Before we do anything else, let's agree on what exactly is being tested. > The profile that I reported was using the current maxima sources using > cmucl. I just did load(colnew), then enabled profiling for the MAXIMA and > COLNEW packages and then load("share/colnew/prob4.mac"). What steps did > you use? > > Also, perhaps prob4 is more complex that we really need. I think prob1.mac > is a simpler test.; let's use that for comparison. > > prob1 doesn't take very long to run. prob2 takes longer, so let's use that. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.j.papasot at gmail.com Fri Sep 16 12:05:29 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Fri, 16 Sep 2011 20:05:29 +0300 Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima In-Reply-To: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> Message-ID: You *can* get multiple plots in wxMaxima. For example, for i:1 thru 2 do wxplot2d(sin(i*x),[x,0,6]); will return two plots in separate output cells. Not sure if ot is exactly what you want, but it's close, at least. In Maxima itself (not wxMaxima) you can save your plots to separate eps files with a code similar to your workaround, just a bit simpler. For example for i:1 thru 2 do plot2d(sin(i*x),[x,0,6],[psfile,sconcat("/pap/Maxima/plot_",i,".eps")]); will save the plots in two eps files named "plot_1.eps" and "plot_2.eps". Just a comment though... You mentioned matlab plenty of times, but matlab is not a Computer Algebra System. Anyway, I would suggest Scilab instead of that matlab thing (which I personally dislike). Scilab is free, and its own programming language is quite similar (if not identical) to matlab's. Furthermore, Scilab can call Maxima internally. 2011/9/16 Virgil L > Hello, All: > Years ago, I had some limited exposure to Maxima, and recently have > re-started using it. I have found many issues/oddities concerning plotting. > Some may be caused by my misunderstanding or inability to find relevant > information, perhaps others may be (missing) features, or bugs. Please, see > below for a few items, and thanks in advance for any helpful comment. > > 1) It seems that getting several plot windows simultaneously displayed is > problematic, buggy, undocumented or impossible depending upon the specific > environment. > > On Xmaxima (Ubuntu) it seems Options--> Plot Windows --> Multiple only > *may* work with the openmath plotting interface... having no effect when > gnuplot is utilised. Even then, it seems to work inconsistently. For > example: > block(n:3, plot2d(sin(n*x),[x,0,2*%pi])); > block(n:3, plot2d(sin(n*x),[x,0,2*%pi])); > show each plot in its own separate window, and both are kept simultaneously > open until closed by the user. > > However, inexplicably > block(for n in [2,3] do plot2d(sin(n*x),[x,0,%pi])); > results in only one window showing the last plot, sin(3x). Probably only > one window is open and the first plot is overwritten. I can see no logical > reason why calling the plot2d function twice from inside a loop would > somehow affect the ability for each plot to appear on its own window. > > Again, the above applies to openmath. If gnuplot is chosen, it appears that > the multiple plot windows option is always ignored regardless of the loop. > > As for wxMaxima, it appears that the equivalent menu choice, plot windows, > is not offered at all. As far as I can see, it is not possible (or > documented) how to get simultaneous multiple plot windows from wxMaxima. > > This situation is very unfortunate because some math software makes this > functionality extremely easy for the usert. For example, in matlab the > command figure (possibly with options) opens a new plot window (from a > script or in interactive mode) > > 1.5) According to: > > http://www.linuxquestions.org/questions/linux-software-2/gnuplot-how-to-plot-individual-plots-in-separate-windows-799327/ > gnuplot does support several simultaneous windows through > set term x11 # where # is a positive integer... example: > set term x11 0 > plot sin(x) > set term x11 1 > plot cos(x) , presumably results in each function plotted in its own > window. > However, I tried to put set term x11 # inside a gnuplot preamble, and did > not seem to work. > > 2) A related functionality is the ability to plot several functions on the > same axis sequentially, possibly within a loop. In matlab, this is easily > implemented (inside or outside loops) through the binary variable hold. Hold > on makes matlab keep on plotting on the same axis (window), until hold off > or figure is invoked. As of 2006, according to > http://www.math.utexas.edu/pipermail/maxima/2006/002796.html such > functionality was impossible in Maxima because gnuplot was (is) > "restarted every time you enter a plot command". The offered workaround > was to construct a list of functions to be plotted, say curves, and > eventually call plot2d(curves, [x,x1,x2]) > While the workaround seems ingenious and easy to implement once known, it > seems difficult for a new user to think of it, and manuals/tutorials seem to > omit mentioning. > It would seem that the "hold on" functionality could be implemented in > Maxima, by holding the current plot data (what is sent to gnuplot) in > memory, and when the next plot command is invoked, Maxima could combine the > new plot data with the one in memory and pass the combined data to gnuplot. > For gnuplot it would be like a brand new call, but Maxima would give the > user the illusion that the new plot is being added on top of the previous > one. > > 3) One workaround for the lack of a multiple plot windows functionality is > to save the file corresponding to each plot, from within a loop. Here, > besides convenience considerations, a main issue is to dynamically generate > appropriate file names. The best I have come up with so far is something > like: > pname:sconcat("plot_",a[ind1],"_",b[ind2],".eps"); > > plot2d(foo(x,-------),[x,0,100],[gnuplot_term,ps],[gnuplot_out_file,pname]); > > ind1 and ind2 are loop variables, a[], b[] are list with parameter values, > and foo(x,-------) is a function to be plotted, which depends on the a and b > values. A pname would look like plot_2_3.eps . > Perhaps there is a much better way to do this. Anyhow, the above seem > minimally or no documented, and is something a new user may need relatively > soon in its Maxima journey. > > > Thanks for your attention. > > > Virgil > > > > > > > > _______________________________________________ > 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 redneb8888 at gmail.com Fri Sep 16 12:06:35 2011 From: redneb8888 at gmail.com (Marios Titas) Date: Fri, 16 Sep 2011 13:06:35 -0400 Subject: [Maxima] ratsimp changes the value of limit Message-ID: Hi list, I have defined two functions as follows f(t):=((t^2+4)^(3/2)-t^3-4*t)/(2*sqrt(t^2+4)) g(t):=f(t+2/t^2)/f(t) and then I tried the following limit limit(g(t),t,inf) and I got -2 as the answer. But when I try to evaluate the same limit having simplified the function first I get a different answer: limit(ratsimp(g(t)),t,inf) returns 1. Is this a known issue? From drdieterkaiser at web.de Fri Sep 16 12:16:27 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 16 Sep 2011 19:16:27 +0200 Subject: [Maxima] Fwd: Re: inf and minf In-Reply-To: <4E727AA3.5090907@eecs.berkeley.edu> References: <4E725864.9080902@eecs.berkeley.edu> <4E727AA3.5090907@eecs.berkeley.edu> Message-ID: <1316193387.1627.2.camel@dieter> Am Donnerstag, den 15.09.2011, 15:22 -0700 schrieb Richard Fateman: > > (originally only responded to kcrisman...) > -------- Original Message -------- > Subject: > Re: [Maxima] inf and minf > Date: > Thu, 15 Sep 2011 12:56:20 -0700 > From: > Richard Fateman > > To: > Karl-Dieter Crisman > , > fateman at cs.berkeley.edu > > > On 9/15/2011 12:44 PM, Karl-Dieter Crisman wrote: > >> Message: 5 > >> Date: Thu, 15 Sep 2011 11:57:01 -0700 > >> From: Richard Fateman > >> To: Maxima - list > >> Subject: [Maxima] inf and minf > >> Message-ID:<4E724A7D.7080802 at eecs.berkeley.edu> > >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed > >> > >> Do we need minf? (negative real infinity) > >> > >> Note that - minf is currently not simplified to inf. > >> > >> RJF > > > > Is there a pressing need to remove this? It seems like it would break > > a lot of existing code (or at least cause annoyance for anyone using > > Maxima for improper integrals). > It's generally a hassle if you have two internal representations of the > same value, at least if they coexist in the same subsystem. (There are > indeed different ways of representing things because there are taylor > series, polynomials, poisson series ... that can be equivalent). But in > the general representation in maxima, 1/x is x^(-1) internally, -x is > (-1)*x etc. > > I am trying to write a paper in which I mention the notion of > DirectedInfinity as in Mathematica. > ComplexInfinity is DirectedInfinity[]. > real positive infinity is DirectedInfinity[1] > negative is DirectedInfinity[-1] > and any point on the unit circle can denote a particular direction as > argument to DirectedInfinity. > -DirectedInfinity[1] is simplified to DirectedInfinity[-1]. > The analogous simplification is not done in Maxima. > > That's probably a misfeature. I wonder if Maxima really needs minf. > other than seeing - - oo in wxmaxima, I have no specific issue. In the year 2009 I have done an attempt to implement the concept of a directed infinitiy. This is the posting with some code and results: http://www.math.utexas.edu/pipermail/maxima/2009/015780.html Dieter Kaiser From virgilinux at yahoo.com Fri Sep 16 12:46:06 2011 From: virgilinux at yahoo.com (Virgil L) Date: Fri, 16 Sep 2011 10:46:06 -0700 (PDT) Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima In-Reply-To: References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> Message-ID: <1316195166.54871.YahooMailNeo@web125306.mail.ne1.yahoo.com> Thanks, Panagiotis...See below: ________________________________ From: Panagiotis Papasotiriou Sent: Friday, September 16, 2011 7:05 PM Subject: Re: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima You can get multiple plots in wxMaxima. For example, for i:1 thru 2 do wxplot2d(sin(i*x),[x,0,6]); will return two plots in separate output cells. Not sure if ot is exactly what you want, but it's close, at least. ============================== Indeed. I was referring to plot2d, which put the plot in a separate gnuplot window, but apparently only one can be opened at a given time, and each plot over-writes the previous one, so one can only see the final plot. But, yes, wxplot2d might work for certain uses. ================================ In Maxima itself (not wxMaxima) you can save your plots to separate eps files with a code similar to your workaround, just a bit simpler.? ============================ Yes, fine, it is a bit simpler. Thanks. >As for matlab, in certain fields, particularly in engineering, it is a defacto standard (unfortunately). Avoiding matlab for serious research work may be possible, but it limits considerably collaboration possibilities, and reuse (I would prefer python numerical tools myself). And certain?specialised?matlab "toolboxes" may have no open-source equivalent. Although matlab started as a purely numerical tool ("MATrix LAB") it has for many years provided significant symbolic capabilities ?through?a "toolbox" currently based on MuPad, which was purchased by matlab.? >> >> >>Anyhow, I hope some of the other issues mentioned will be addressed at some point. >> >> >>Best, >> >> >>Virgil -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Fri Sep 16 18:54:45 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 16 Sep 2011 19:54:45 -0400 Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima In-Reply-To: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> Message-ID: <4E73E1C5.40609@telefonica.net> On 09/16/2011 08:21 AM, Virgil L wrote: > > 1) It seems that getting several plot windows simultaneously displayed > is problematic, buggy, undocumented or impossible depending upon the > specific environment. You can take a look at example "Multiple windows" in ? terminal > 2) A related functionality is the ability to plot several functions on > the same axis sequentially, possibly within a loop. ? multiplot_mode See also the last example in http://riotorto.users.sourceforge.net/gnuplot/multiplots -- Mario -------------- next part -------------- An HTML attachment was scrubbed... URL: From virgilinux at yahoo.com Fri Sep 16 15:49:14 2011 From: virgilinux at yahoo.com (Virgil L) Date: Fri, 16 Sep 2011 13:49:14 -0700 (PDT) Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima In-Reply-To: <4E73E1C5.40609@telefonica.net> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> Message-ID: <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> Thanks, Mario: It does seem that draw2d addresses the issues mentioned before. I had focused on plot2d since it seems to have a simpler interface, but draw2d seems manageable.? multiplot_mode seems nearly identical in functionality to the previously mentioned hold. And the first call immediately opens a blank window which is reminiscent of the "figure" function mentioned before. I suppose??terminal=[screen, 1] translates to something similar to the raw gnuplot instruction "set term x11 1" as mentioned before. It seems as though draw2d interface may perhaps be cosmetically simplified... for example, it seems that the declaration explicit/implicit could be made?optional -- if it is not already so -- since the absence/presence of an equal sign , =, provides the same information (if I understand correctly). So that??for example[ x^3,x,-1,1] can be unambiguously inferred to mean?explicit(x^3,x,-1,1) whereas [y^2=x^3-2*x+1, x, -4,4, y, -4,4]?could be?unambiguously?inferred?to mean?implicit(y^2=x^3-2*x+1, x, -4,4, y, -4,4) because of the equal sign.? On a related note, I also find matlab's convention to indicate line specs extremely handy, especially in "multiplot" (hold) interactive mode... For example, 'r:' means red dotted line, and 'b--' means blue dash line, 'k-.' means black dash dot, etc.?A command using this looks like: plot(t,sin(t),'-.r'). See http://www.mathworks.de/help/techdoc/ref/linespec.html Thanks again. Virgil ________________________________ From: Mario Rodriguez To: maxima at math.utexas.edu Sent: Saturday, September 17, 2011 1:54 AM Subject: Re: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima On 09/16/2011 08:21 AM, Virgil L wrote: > >1) It seems that getting several plot windows?simultaneously?displayed is problematic, buggy, undocumented or impossible depending upon the specific environment. You can take a look at example "Multiple windows" in ? terminal 2) A related functionality is the ability to plot several functions on the same axis?sequentially, possibly within a loop. ? multiplot_mode See also the last example in http://riotorto.users.sourceforge.net/gnuplot/multiplots -------------- next part -------------- An HTML attachment was scrubbed... URL: From biomates at telefonica.net Sat Sep 17 10:03:49 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Sat, 17 Sep 2011 11:03:49 -0400 Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima In-Reply-To: <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> Message-ID: <4E74B6D5.7090809@telefonica.net> On 09/16/2011 04:49 PM, Virgil L wrote: > Thanks, Mario: > It does seem that draw2d addresses the issues mentioned before. I had > focused on plot2d since it seems to have a simpler interface, but > draw2d seems manageable. Package draw has been written with complex scenes in mind, and to avoid users to consult the Gnuplot manual every time they need special plots. Probably, most of the time, users only need to plot simple curves and surfaces; in that cases, plot?d commands are more simple to type than in draw?d. > It seems as though draw2d interface may perhaps be cosmetically > simplified... for example, it seems that the declaration > explicit/implicit could be made optional -- if it is not already so -- > since the absence/presence of an equal sign , =, provides the same > information (if I understand correctly). So that for example[ > x^3,x,-1,1] can be unambiguously inferred to mean explicit(x^3,x,-1,1) > whereas [y^2=x^3-2*x+1, x, -4,4, y, -4,4] could > be unambiguously inferred to mean implicit(y^2=x^3-2*x+1, x, -4,4, y, > -4,4) because of the equal sign. The implicit example is equivalent to implicit(-y^2+x^3-2*x+1, x, -4,4, y, -4,4) When the equal symbol is not present, Maxima assumes that the expression is equal to zero. This is a convention also used in other parts of Maxima. I know some people don't like to write 'explicit' and would prefer the use of square brackets, following the plot?d rules. On the contrary, I think there must be a general norm for all graphic objects, which makes easier to read and understand complex plots. There are some solutions: 1.- When a user wants an specific syntax, he can write a wrapper, a simple Maxima function, to call draw commands. There are some user-written packages following this way. 2.- Instead of writing 'explicit', 'implicit', or even worse, 'parametric_surface', We could define 'e', 'i', or 'ps', as abbreviations inside package draw. This is not difficult to implement. > On a related note, I also find matlab's convention to indicate line > specs extremely handy, especially in "multiplot" (hold) interactive > mode... For example, 'r:' means red dotted line, and 'b--' means blue > dash line, 'k-.' means black dash dot, etc. A command using this looks > like: plot(t,sin(t),'-.r'). > See http://www.mathworks.de/help/techdoc/ref/linespec.html GOTO 1; > Thanks again. Thank you for your comments and interest. > > Virgil -- Mario -------------- next part -------------- An HTML attachment was scrubbed... URL: From virgilinux at yahoo.com Sat Sep 17 06:48:03 2011 From: virgilinux at yahoo.com (Virgil L) Date: Sat, 17 Sep 2011 04:48:03 -0700 (PDT) Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima In-Reply-To: <4E74B6D5.7090809@telefonica.net> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> <4E74B6D5.7090809@telefonica.net> Message-ID: <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> _______________________________ >From: Mario Rodriguez > On 09/16/2011 04:49 PM, Virgil L wrote: >>It does seem that draw2d addresses the issues mentioned before.? >>I had focused on plot2d since it seems to have a simpler interface, but draw2d seems manageable. >> >Package draw has been written with complex scenes in mind, and to >avoid users to consult the Gnuplot manual every time they need >special plots. Probably, most of the time, users only need to plot > simple curves and surfaces; in that cases, plot2d commands are > more simple to type than in draw2d. ============== Yes, that is what I thought. plot2d seemed like what I needed. But then I found the issues reported before. Since those issues disappear if one accesses gnuplot though draw2d (with same version of maxima and gnuplot) then it seems clear that they are not caused by inherent limitations of either maxima or gnuplot. They are being caused by the function plot2d.? It would be great if whoever maintain plot2d address/correct the issues/bugs mentioned before. The fact that the draw2d code is open would seem to be helpful in this effort.?? It is unfortunate that one would have to switch to a more complex plotting interface, or learn two plotting interfaces, just to address some relatively simple issues, such as having several plot windows open simultaneously. ?? =============== > >>It seems as though draw2d interface may perhaps be cosmetically simplified...? >> for example, it seems that the declaration explicit/implicit could be made?optional -- if it is not already so --? >> since the absence/presence of an equal sign , =, provides the same information (if I understand correctly).? >The implicit example is equivalent to > >implicit(-y^2+x^3-2*x+1, x, -4,4, y, -4,4) > >When the equal symbol is not present, Maxima assumes that the??expression is equal to zero.? >This is a convention also used in??other parts of Maxima. To make a concrete question: can maxima infer -- in the context of draw2d of course -- that?(sin(x),x,0,10) MUST mean ?explicit(sin(x),x,0,10) and (y^2=x^3+1,x,-4,-4,y,-4,4) MUST mean??implicit(y^2=x^3+1,x,-4,-4,y,-4,4) ? If true then the declaration explicit/implicit could be _optional_, that is, allowed but not required. >I know some people don't like to write 'explicit' and would prefer?the use of square brackets,? > following the plot?d rules.? > On the?contrary, I think there must be a general norm for all graphic?objects, which makes easier to read and? > understand complex plots. Of course, if a user wants to declare explicit/implicit for additional clarity,?consistency, etc fine....s/he should still be able to do so. But if maxima can infer unambiguously what the user means it would seem helpful to allow maxima to do so. And even if maxima occasionally infers wrong, the user could THEN write the complete declaration (while not writing it the vast majority of the times). The ideal solution would be for the draw2d interface to be "incremental" over the plot2d one. By this I mean that for tasks that can be accomplished with either solution, the interface would be the same. But of course for advanced features supported by draw2d only, then draw2d would necessarily deviate from plot2d (for obvious reasons). This way, the user could learn only one plotting interface, draw2d, since he could use the same commands for plot2d whenever plot2d supports the given feature (else he would get an error message)... example: plot2d(sin(x),[x,-1,1]) or draw2d(sin(x),[x,-1,1]). As for a user writing own wrapper functions, yes, it is in principle possible, especially for an "advanced" user. It may however not be realistic for a relatively new user to do so. The new user has his hands full learning the entire system (not just plotting) and won't want to deviate into modifying a system that he is just starting to know. Furthermore, it would seem to be a waste of community resources for "N" users to each spent "M" hours of programming each developing his own wrapper functions or adaptations. It would seem that the philosophy of open source software would suggest a different approach. Best, Virgil > From pcastellvi at gmail.com Sat Sep 17 12:10:31 2011 From: pcastellvi at gmail.com (=?ISO-8859-1?Q?Pere_Castellv=ED?=) Date: Sat, 17 Sep 2011 19:10:31 +0200 Subject: [Maxima] numerical value of a ratoinal number Message-ID: Hi all, How can I get a lot of correct decimal places of a rational numer? I tried numer: true$ fpprec:500$ bfloat(1/11); 9.09090909090909116141432377844466827809810638427734375b-2 which doesn't have 500 figures neither are correct! Best regards Pere PS: I apologize for my english From macrakis at alum.mit.edu Sat Sep 17 12:18:42 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 17 Sep 2011 13:18:42 -0400 Subject: [Maxima] numerical value of a ratoinal number In-Reply-To: References: Message-ID: By setting numer:true, you are asking Maxima to perform all calculations in ordinary floating-point. So when you write bfloat(1/11), Maxima first calculates 1/11 as a floating point number, and *then* converts it to a bigfloat. Just turn off numer:true. (%i1) numer:false$ (%i2) fpprec:500$ (%i3) bfloat(1/11); (%o3) 9.090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909\ 09090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909\ 09090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909\ 090909090909090909090909090909090909090909090909091b-2 Compare: (%i4) bfloat(float(1/11)); (%o4) 9.09090909090909116141432377844466827809810638427734375b-2 On Sat, Sep 17, 2011 at 13:10, Pere Castellv? wrote: > Hi all, > > How can I get a lot of correct decimal places of a rational numer? I tried > > numer: true$ > fpprec:500$ > bfloat(1/11); > 9.09090909090909116141432377844466827809810638427734375b-2 > > which doesn't have 500 figures neither are correct! > > Best regards > > Pere > > PS: I apologize for my english > _______________________________________________ > 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 Sat Sep 17 15:32:38 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 17 Sep 2011 13:32:38 -0700 Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima Message-ID: <99FE7B4429EF4113811EBF3655010FBA@edwinc367e16bd> On Sept. 16, 2011, Virgil L wrote ------------------------- It seems that getting several plot windows simultaneously displayed is problematic, buggy, undocumented or impossible ... ----------------------------- For what it is worth, perhaps for other Maxima users, I use the Xmaxima GUI (ver. 5.25.1) with Windows XP, and get as many multiple plots as I want using the XMaxima menu choice Options, Plot Windows, Embedded, and then typing plot2d commands. A plot2d command then brings up an embedded plot which can be reduced in size using the minus icon associated with the embedded plot panel. Another plot requires clicking the mouse at the new prompt and entering the new plot2d command. One then has a series of plots which can be compared. The embedded plot feature in XMaxima appears to be still "under construction", since the various control icons are not labeled and one must experiment. The leftmost control icon is an X which causes the embedded plot to vanish, apparently forever? The next icon, reading left to right, is some sort of crossed tool icon, which may be what the help screen means by the 'config menu'. I was not successful in getting, for example, the linewidth choice to have any effect on the plot. The third icon is mysterious. The help screen was no help. None of the above is meant to denigrate my favorite user interface for using Maxima, an interface which is steadily getting more useful. Ted Woollett From henryhom at live.cn Sat Sep 17 01:04:12 2011 From: henryhom at live.cn (-Henry Hom) Date: Sat, 17 Sep 2011 06:04:12 +0000 Subject: [Maxima] Maxima Help : Lambert W-Function Message-ID: Help:?How do I solve these equations in Maxima ?1. x^x=27 (the root is x=3)2. x^(1/x)=(cube root of 3) (the roots are x=3 and?x=-(3W(-(log(3))/3))/(log(3)))3. x^(2*x)=729(the roots are x=3 and x = (i(pi-3i log(3)))/(W(i pi+3log(3)))) but I cannot solve these equations in Maxima!(but I can use Find Root):(%i1) to_poly_solve([x^(2*x)=729], [x]); Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $ Unable to solve Unable to solve Unable to solve (%o1) %solve([x^(2*x)=729],[x]) How can I solve them not by find root? From willisb at unk.edu Sat Sep 17 17:02:57 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 17 Sep 2011 17:02:57 -0500 Subject: [Maxima] Maxima Help : Lambert W-Function In-Reply-To: References: Message-ID: With manual assistance, Maxima can find some, but not all, complex solutions to these equations; example: (%i12) %solve(log(x^(2*x)=729),x); (%o12) %union([x=log(729)/(2*lambert_w(log(729)/2))]) (%i13) float(%); (%o13) %union([x=3.0]) Recently I've been working on code for the generalized Lambert function. It recognizes simplifications such (%i21) generalized_lambert_w(-1 ,-log(5)/5); (%o21) -log(5) but it will not simplify %o12 to 3. This could be a bug or an oversight. Additionally, the code in to_poly_solve that solves in terms of the Lambert function needs work. I'm unsatisfied with that code. Thanks for the interest. --Barton (author of to_poly_solver) -----maxima-bounces at math.utexas.edu wrote: ----- To: From: -Henry Hom Sent by: maxima-bounces at math.utexas.edu Date: 09/17/2011 04:19PM Subject: [Maxima] Maxima Help : Lambert W-Function Help:?How do I solve these equations in Maxima ?1. x^x=27 (the root is x=3)2. x^(1/x)=(cube root of 3) (the roots are x=3 and?x=-(3W(-(log(3))/3))/(log(3)))3. x^(2*x)=729(the roots are x=3 and x = (i(pi-3i log(3)))/(W(i pi+3log(3)))) but I cannot solve these equations in Maxima!(but I can use Find Root):(%i1) to_poly_solve([x^(2*x)=729], [x]); Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $ Unable to solve Unable to solve Unable to solve (%o1) %solve([x^(2*x)=729],[x]) How can I solve them not by find root? ? ? _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From shinabe.munehiro at hotmail.co.jp Sat Sep 17 19:25:25 2011 From: shinabe.munehiro at hotmail.co.jp (Part Marty) Date: Sun, 18 Sep 2011 09:25:25 +0900 Subject: [Maxima] diff(f(g(x)),x,1) Message-ID: Dear everyone ! Please tell this transformation. diff(f(g(x)),x) ---->diff(f(g(x)),g(x))*diff(g(x),x) -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sat Sep 17 19:37:30 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 17 Sep 2011 17:37:30 -0700 Subject: [Maxima] diff(f(g(x)),x,1) In-Reply-To: References: Message-ID: <4E753D4A.7050008@eecs.berkeley.edu> On 9/17/2011 5:25 PM, Part Marty wrote: > Dear everyone ! > Please tell this transformation. > > diff(f(g(x)),x) ---->diff(f(g(x)),g(x))*diff(g(x),x) > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima The reason Maxima doesn't make such a transformation is that the notation is inadequate for the job. It is intentional. You can do this: gradef(f(y),h(y)); then diff(f(g(x)),x) is shown as h(g(x)) * diff(g(x),x). There is no widely accepted notation for "derivative with respect to the first argument of f". I believe that there are packages in Maxima that make up such a notation, but they are not used by the ordinary "diff" program. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From shinabe.munehiro at hotmail.co.jp Sat Sep 17 21:02:01 2011 From: shinabe.munehiro at hotmail.co.jp (Part Marty) Date: Sun, 18 Sep 2011 11:02:01 +0900 Subject: [Maxima] diff(f(g(x)),x,1) In-Reply-To: <4E753D4A.7050008@eecs.berkeley.edu> References: , <4E753D4A.7050008@eecs.berkeley.edu> Message-ID: Dear RJF Thank you a reply ! Furthermore, I want this to transform as follows. diff(f(g(x)),x,2)--> ('diff(g(x),x,2))*('diff(f(g(x)),g(x)))+('diff(g(x),x,1))^2*('diff(f(g(x)),g(x),2)); gradef(f(x),diff(f(x),x)); diff(f(g(x)),x,1); diff(f(g(x)),x,2); (%o1) f(x) (%o2) ('diff(g(x),x,1))*('diff(f(g(x)))) (%o3) ('diff(g(x),x,2))*('diff(f(g(x))))+('diff(g(x),x,1))*('diff(f(g(x)),x,1)) On 9/17/2011 5:25 PM, Part Marty wrote: Dear everyone ! Please tell this transformation. diff(f(g(x)),x) ---->diff(f(g(x)),g(x))*diff(g(x),x) _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima The reason Maxima doesn't make such a transformation is that the notation is inadequate for the job. It is intentional. You can do this: gradef(f(y),h(y)); then diff(f(g(x)),x) is shown as h(g(x)) * diff(g(x),x). There is no widely accepted notation for "derivative with respect to the first argument of f". I believe that there are packages in Maxima that make up such a notation, but they are not used by the ordinary "diff" program. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sat Sep 17 23:47:21 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 17 Sep 2011 21:47:21 -0700 Subject: [Maxima] diff(f(g(x)),x,1) In-Reply-To: References: , <4E753D4A.7050008@eecs.berkeley.edu> Message-ID: <4E7577D9.2070705@eecs.berkeley.edu> On 9/17/2011 7:02 PM, Part Marty wrote: > > > Dear RJF > Thank you a reply ! > Furthermore, I want this to transform as follows. > diff(f(g(x)),x,2)--> > ('diff(g(x),x,2))*('diff(f(g(x)),g(x)))+('diff(g(x),x,1))^2*('diff(f(g(x)),g(x),2)); > gradef(f(x),diff(f(x),x)); > diff(f(g(x)),x,1); > diff(f(g(x)),x,2); > (%o1) f(x) > (%o2) ('diff(g(x),x,1))*('diff(f(g(x)))) > (%o3) > ('diff(g(x),x,2))*('diff(f(g(x))))+('diff(g(x),x,1))*('diff(f(g(x)),x,1)) > ------------------------------------------------------------------------ > At first glance, your use of gradef looks like nonsense. Also, try cutting and pasting results into mail. You have mistyped lines %o2 and %o3. Let's do this. call the derivative of f(x) with respect to its first argument x, fp(x). Like fp = f' and also the derivative of fp wrt x as fpp. Like fpp=f''. and just to make things compact, call derivative of g(x) wrt x, gp(x). and deriv(gp(x),x) = gpp(x). gradef(f(y),fp(y)); gradef(fp(y),fpp(y)); gradef(g(y),gp(y)); gradef(gp(y),gpp(y)); now diff(f(g(x)),x,2) comes out gp(x)^2*fpp(g(x))+gpp(x)*fp(g(x)) This is what you seem to want. -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sun Sep 18 05:59:10 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 18 Sep 2011 05:59:10 -0500 Subject: [Maxima] diff(f(g(x)),x,1) In-Reply-To: <4E7577D9.2070705@eecs.berkeley.edu> References: <4E7577D9.2070705@eecs.berkeley.edu>, , <4E753D4A.7050008@eecs.berkeley.edu> Message-ID: Alternatively, you can use the positional derivative package (pdiff). (%i1) load(pdiff)$ Here g[(n)] is the n-th derivative of g (a function of one variable). (%i2) diff(f(g(x)),x); (%o2) g[(1)](x)*f[(1)](g(x)) (%i3) diff(f(g(x)),x,2); (%o3) g[(1)](x)^2*f[(2)](g(x))+g[(2)](x)*f[(1)](g(x)) And f[(m,n)] is the m-the derivative with respect to the first variable and the n-the derivative with respect to the second: (%i4) diff(f(x,y),y); (%o4) f[(0,1)](x,y) (%i6) diff(f(x,x^2),x); (%o6) f[(1,0)](x,x^2)+2*x*f[(0,1)](x,x^2) --Barton From biomates at telefonica.net Sun Sep 18 12:23:24 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 18 Sep 2011 13:23:24 -0400 Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima In-Reply-To: <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> <4E74B6D5.7090809@telefonica.net> <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> Message-ID: <4E76290C.3050807@telefonica.net> On 09/17/2011 07:48 AM, Virgil L wrote: > > To make a concrete question: can maxima infer -- in the context of > draw2d of course -- that (sin(x),x,0,10) MUST mean > explicit(sin(x),x,0,10) and (y^2=x^3+1,x,-4,-4,y,-4,4) MUST > mean implicit(y^2=x^3+1,x,-4,-4,y,-4,4) ? > > > If true then the declaration explicit/implicit could be _optional_, > that is, allowed but not required. > > Of course, if a user wants to declare explicit/implicit for additional > clarity, consistency, etc fine....s/he should still be able to do so. > But if maxima can infer unambiguously what the user means it would > seem helpful to allow maxima to do so. And even if maxima occasionally > infers wrong, the user could THEN write the complete declaration > (while not writing it the vast majority of the times). > Hello, You are focusing your attention on the syntax for explicit/implicit, but others have asked, for example, why are we using symbol = for the options. Some people would prefer something like xrange -> [0.1] instead of xrange = [0,1] and others, perhaps inspired by the lisp syntax, would be more comfortable with [xrange, 0, 1] or [xrange, [0, 1]] There were some discussions in this list on these topics in the past, not only related to the plotting routines. What is the best decision? I don't know; they all are reasonable, as well as your own opinions on the syntax for explicit and implicit objects, which I really understand. The draw package could understand all these variations, and many others, by simply adding more and more conditionals, and let the user write commands according to his own ideas. But I don't think this is the right direction. > The ideal solution would be for the draw2d interface to be > "incremental" over the plot2d one. > This is an interesting point. In fact, this was one of the first ideas before starting writing draw. By complex plots I do not only mean scenes with many different objects, but also multiplots (that is, various plots in the same window or file) and animations. The idea of multiple windows came later, as a user requested feature. But the plot routines were not designed with many-objects-scenes (and each one with its own fine-tuning options), multiplots and animations in mind. As a result, another internal logical structure was necessary. Of course, I don't claim the actual structure of draw is optimal in any sense. > As for a user writing own wrapper functions, yes, it is in principle > possible, especially for an "advanced" user. It may however not be > realistic for a relatively new user to do so. The new user has his > hands full learning the entire system (not just plotting) and won't > want to deviate into modifying a system that he is just starting to know. > You don't need to modify anything and you don't need to be an advanced user. You can write something like the following code in an external file or in a wxmaxima notebook (wn below is the window number): load(draw) $ p(expr,x0,x1,wn) := draw2d( explicit(expr,x,x0,x1), terminal = [screen,wn] ) $ And then, while explaining something to your students in class, p(x^2,0,1,0) $ p(x^3,0,1,1) $ This way, you can save time and avoid some typing. I find this very useful and make use of it in many other contexts, not just plotting. Writing functions in Maxima is very simple. I would say it's an excellent language for learning basic programming skills: local variables, conditionals, loops. Try it, and if you need assistance, you'll get help in this mailing list (at least 99% of the time). > Furthermore, it would seem to be a waste of community resources for > "N" users to each spent "M" hours of programming each developing his > own wrapper functions or adaptations. It would seem that the > philosophy of open source software would suggest a different approach. > I understand. I also have trouble finding time to write my own functions. Not to mention those to be used by others. > Best, > > Virgil > Again, thanks for your comments and interest. -- Mario From acimmarusti at gmail.com Sun Sep 18 14:50:03 2011 From: acimmarusti at gmail.com (Andres Cimmarusti) Date: Sun, 18 Sep 2011 15:50:03 -0400 Subject: [Maxima] contour_plot and implicit_plot terrible resolution and cutting graph Message-ID: Hello Mario > You can try the draw version for implicit functions; it seems to work > better for this example. Relevant options are 'ip_grid' and 'ip_grid_in': > > load(draw) $ > > draw2d( > ? ip_grid = [80,80], > ? ip_grid_in = [10,10], > ? implicit(ygs(x,8,d,0) = 100, d,-20,20,x,0,200)) $ This worked better. Thank you. I've also solved other similar problems with contour_plot (instead of implicit_plot) with the option [grid,200,200]. This basically improves resolution dramatically. From acimmarusti at gmail.com Sun Sep 18 15:04:37 2011 From: acimmarusti at gmail.com (Andres Cimmarusti) Date: Sun, 18 Sep 2011 16:04:37 -0400 Subject: [Maxima] contour_plot: can I get a logarithmic axis? Message-ID: Hello, I have the following code: assume( x >= 0, y >= 0, C >= 0 ); ytp(x,C,d,t) := x * ( ( 1 + 2 * C / ( 1 + d^2 + x ) )^2 + ( t - 2 * C * d / ( 1 + d^2 + x ) )^2 ); contour_plot( ytp(x,3,d,0), [d,-20,20], [x,0,40], [grid,200,200], [legend,"Y"], [gnuplot_preamble, "set key outside; set title 'Traveling plane wave, C = 3'"] )$ The last plot looks gorgeous to me, but I want to explore the possible Y values. Unfortunately If I try this: contour_plot( ytp(x,3,d,0), [d,-20,20], [x,0,1010], [grid,200,200], [legend,"Y"], [gnuplot_preamble, "set key outside; set title 'Traveling plane wave, C = 3'; set cntrparam levels 10"] )$ The center feature is barely noticeable, which is not what I want. I decided to try to use a logarithmic scale for my "y-axis" (really my x). So I tried using the option [logy] and got nothing as output. Decided then to try "set log y" in the gnuplot_preamble and again nothing. Is this feature available with contour_plot? or am I missing something? Thanks for the help Andres From acimmarusti at gmail.com Sun Sep 18 16:03:55 2011 From: acimmarusti at gmail.com (Andres Cimmarusti) Date: Sun, 18 Sep 2011 17:03:55 -0400 Subject: [Maxima] contour_plot: can I get a logarithmic axis? In-Reply-To: References: Message-ID: Hello again > The center feature is barely noticeable, which is not what I want. I > decided to try to use a logarithmic scale for my "y-axis" (really my > x). So I tried using the option [logy] and got nothing as output. > Decided then to try "set log y" in the gnuplot_preamble and again > nothing. > > Is this feature available with contour_plot? or am I missing something? While I couldn't get this to work using maxima, I worked around it by using maxima to put out a data file and then plotting it with gnuplot. The result was not good, so I guess my question is not very important to me anymore, but perhaps this functionality could be useful to have. Andres From biomates at telefonica.net Mon Sep 19 07:44:39 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Mon, 19 Sep 2011 08:44:39 -0400 Subject: [Maxima] contour_plot: can I get a logarithmic axis? In-Reply-To: References: Message-ID: <4E773937.1000400@telefonica.net> On 09/18/2011 04:04 PM, Andres Cimmarusti wrote: > contour_plot( > ytp(x,3,d,0), [d,-20,20], [x,0,1010], [grid,200,200], [legend,"Y"], > [gnuplot_preamble, "set key outside; set title 'Traveling plane > wave, C = 3'; set cntrparam levels 10"] )$ > > The center feature is barely noticeable, which is not what I want. I > decided to try to use a logarithmic scale for my "y-axis" (really my > x). So I tried using the option [logy] and got nothing as output. > Decided then to try "set log y" in the gnuplot_preamble and again > nothing. > > Is this feature available with contour_plot? or am I missing something? Since x can be equal to zero, plotting the logarithmic scale can be problematic. Try [x, 0.1, 10101] for the domain. If it doesn't work with contour_plot, you can try it with draw: draw3d(xu_grid = 200, yv_grid = 200, contour_levels = 10, contour = map, logy = true, title = "Traveling plane wave, C = 3", explicit(ytp(x,3,d,0), d,-20,20, x,0.1,1010) ) $ See the documentation for contour_levels and contour for extra control on isolines, or take a look at http://riotorto.users.sourceforge.net/gnuplot/contours -- Mario From talon at lpthe.jussieu.fr Mon Sep 19 08:24:49 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Mon, 19 Sep 2011 15:24:49 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: <20110915162726.GA12096@lpthe.jussieu.fr> <4E723525.4060601@eecs.berkeley.edu> <4E72472A.3090903@eecs.berkeley.edu> <4E727C3D.7030309@eecs.berkeley.edu> Message-ID: Raymond Toy wrote: > On Fri, Sep 16, 2011 at 9:01 AM, Raymond Toy > wrote: > >> >> Before we do anything else, let's agree on what exactly is being tested. >> The profile that I reported was using the current maxima sources using >> cmucl. I just did load(colnew), then enabled profiling for the MAXIMA >> and >> COLNEW packages and then load("share/colnew/prob4.mac"). What steps did >> you use? >> >> Also, perhaps prob4 is more complex that we really need. I think >> prob1.mac is a simpler test.; let's use that for comparison. >> >> prob1 doesn't take very long to run. prob2 takes longer, so let's use > that. > > Ray OK. Here is the first step, i am profiling prob2 with the latest maxima compiled with sbcl, since i have it at hand. I will run maxima compiled with cmucl later on. First the deterministic profiler. Here is the result: niobe% rlwrap bin/maxima Maxima 5.25.1 http://maxima.sourceforge.net using Lisp SBCL 1.0.43 (%i1) load(colnew); ... (%i2) :lisp(sb-profile:profile "COLNEW") (%i2) load(prob2); ...... (%i3) :lisp(sb-profile:report) measuring PROFILE overhead..done seconds | gc | consed | calls | sec/call | name ---------------------------------------------------------- 1.732 | 0.012 | 41,630,560 | 74 | 0.023403 | COLNEW::LSYSLV 0.668 | 0.031 | 12,610,568 | 1,584 | 0.000422 | COLNEW::VWBLOK 0.590 | 0.015 | 32,386,360 | 2,782 | 0.000212 | COLNEW::DGESL 0.224 | 0.029 | 11,143,912 | 396 | 0.000566 | COLNEW::DGEFA 0.171 | 0.041 | 11,650,088 | 49 | 0.003490 | COLNEW::SBBLOK 0.158 | 0.000 | 0 | 52,818 | 0.000003 | COLNEW::DAXPY 0.090 | 0.000 | 644,576 | 5,893 | 0.000015 | COLNEW::APPROX 0.033 | 0.000 | 2,068,232 | 16 | 0.002046 | COLNEW::FCBLOK 0.029 | 0.000 | 0 | 2,772 | 0.000010 | COLNEW::DSCAL 0.026 | 0.000 | 1,799,408 | 10 | 0.002552 | COLNEW::NEWMSH 0.018 | 0.000 | 89,360 | 1,312 | 0.000014 | COLNEW::RKBAS 0.016 | 0.000 | 806,416 | 4 | 0.003921 | COLNEW::ERRCHK 0.012 | 0.000 | 0 | 1,198 | 0.000010 | COLNEW::SUBFOR 0.011 | 0.000 | 0 | 2,772 | 0.000004 | COLNEW::IDAMAX 0.010 | 0.000 | 150,824 | 64 | 0.000153 | COLNEW::GDERIV 0.008 | 0.000 | 646,864 | 396 | 0.000020 | COLNEW::FACTRB 0.004 | 0.000 | 0 | 49 | 0.000079 | COLNEW::DMZSOL 0.003 | 0.000 | 0 | 1,198 | 0.000002 | COLNEW::SUBBAK 0.002 | 0.000 | 28,648 | 162 | 0.000009 | COLNEW::HORDER 0.001 | 0.000 | 0 | 380 | 0.000002 | COLNEW::SHIFTB 0.000 | 0.000 | 6,792,408 | 1 | 0.000000 | COLNEW::CONTRL 0.000 | 0.000 | 966,848 | 1,594 | 0.000000 | COLNEW::GBLOCK 0.000 | 0.000 | 0 | 4 | 0.000000 | COLNEW::VMONDE 0.000 | 0.000 | 0 | 1 | 0.000000 | COLNEW::CONSTS 0.000 | 0.000 | 4,096 | 4 | 0.000000 | COLNEW::SKALE 0.000 | 0.000 | 0 | 21 | 0.000000 | COLNEW:APPSLN 0.000 | 0.000 | 28,376 | 1 | 0.000000 | COLNEW:COLNEW ---------------------------------------------------------- 3.803 | 0.128 | 123,447,544 | 75,555 | | Total estimated total profiling overhead: 0.43 seconds Since fsub, dfsub are called inside LSYSL while all the other are pure lisp, we see that half of the time is in colnew, almost half in fsub dfsub, as in the prob3 case. One also sees that the linpack routines to solve linear systems, dgesl dgefa daxpy use 1s, that is half the time spent in colnew proper. Then i have changed the colnew-if.lisp in 5.25.1 to the file where fsub dfsub etc are real functions and not flets to be able to profile them. (%i1) load(colnew); .... (%i2) :lisp(sb-profile:profile fsub dfsub "COLNEW") (%i2) load(prob2); (%i3) :lisp(sb-profile:report) measuring PROFILE overhead..done seconds | gc | consed | calls | sec/call | name ---------------------------------------------------------- 1.355 | 0.000 | 12,880,288 | 4,632 | 0.000292 | FSUB 0.704 | 0.000 | 11,850,192 | 1,584 | 0.000445 | DFSUB 0.580 | 0.066 | 28,463,896 | 74 | 0.007841 | COLNEW::LSYSLV 0.567 | 0.013 | 32,434,888 | 2,782 | 0.000204 | COLNEW::DGESL 0.225 | 0.005 | 11,057,520 | 396 | 0.000567 | COLNEW::DGEFA 0.147 | 0.039 | 11,592,584 | 49 | 0.002998 | COLNEW::SBBLOK 0.126 | 0.000 | 0 | 52,818 | 0.000002 | COLNEW::DAXPY 0.069 | 0.000 | 950,472 | 5,893 | 0.000012 | COLNEW::APPROX 0.030 | 0.000 | 1,817,520 | 10 | 0.002951 | COLNEW::NEWMSH 0.021 | 0.000 | 0 | 1,198 | 0.000017 | COLNEW::SUBBAK 0.019 | 0.000 | 154,736 | 64 | 0.000294 | COLNEW::GDERIV 0.019 | 0.000 | 2,133,696 | 16 | 0.001169 | COLNEW::FCBLOK 0.017 | 0.000 | 137,872 | 1,312 | 0.000013 | COLNEW::RKBAS 0.014 | 0.000 | 805,872 | 4 | 0.003417 | COLNEW::ERRCHK 0.008 | 0.000 | 568,752 | 396 | 0.000020 | COLNEW::FACTRB 0.006 | 0.000 | 0 | 2,772 | 0.000002 | COLNEW::DSCAL 0.004 | 0.000 | 0 | 2,772 | 0.000001 | COLNEW::IDAMAX 0.003 | 0.000 | 0 | 49 | 0.000058 | COLNEW::DMZSOL 0.003 | 0.000 | 0 | 21 | 0.000134 | COLNEW:APPSLN 0.002 | 0.000 | 0 | 1,198 | 0.000001 | COLNEW::SUBFOR 0.002 | 0.000 | 32,720 | 162 | 0.000009 | COLNEW::HORDER 0.000 | 0.000 | 0 | 380 | 0.000000 | COLNEW::SHIFTB 0.000 | 0.000 | 6,799,280 | 1 | 0.000000 | COLNEW::CONTRL 0.000 | 0.000 | 846,272 | 1,594 | 0.000000 | COLNEW::GBLOCK 0.000 | 0.000 | 0 | 4 | 0.000000 | COLNEW::VMONDE 0.000 | 0.000 | 914,696 | 1,584 | 0.000000 | COLNEW::VWBLOK 0.000 | 0.000 | 0 | 1 | 0.000000 | COLNEW::CONSTS 0.000 | 0.000 | 0 | 4 | 0.000000 | COLNEW::SKALE 0.000 | 0.000 | 28,376 | 1 | 0.000000 | COLNEW:COLNEW ---------------------------------------------------------- 3.919 | 0.123 | 123,469,632 | 81,771 | | Total estimated total profiling overhead: 0.47 seconds Which confirmes the relative time spent in fsub dfsub The colnew-if.lisp i have used here is the one beginning by: (in-package :maxima) (defvar *f*) (defvar *df*) (defvar *g*) (defvar *dg*) (defvar *nz*) (defvar *ncomp*) (defun fsub (x z f-array) (declare (type (cl:array double-float (*)) z f-array) (double-float x)) (let ((res (apply *f* x (coerce (subseq z 0 *nz*) 'list)))) (loop for k from 0 for ff in (cdr res) do (setf (aref f-array k) ($float ff)))) (values nil nil f-array)) .... (defun $colnew_expert ( .... (*f* (coerce-float-fun f)) (*df* (coerce-float-fun df)) (*g* (coerce-float-fun g)) (*dg* (coerce-float-fun dg)) (*nz* (reduce #'+ (cdr m)))) ... I have also run the sbcl statistical profiler, this way: writefile("stat_profile"); load(colnew); :lisp(cl:require :sb-sprof "/usr/local/lib/sbcl/sb-sprof/sb-sprof.fasl") :lisp(sb-sprof:profile-call-counts "COLNEW") :lisp(sb-sprof:with-profiling (:max-samples 10000 :report :flat :loop nil )#load(prob2)$) I get things where sbcl and maxima internals get the predominant number of samples: Number of samples: 1120 Sample interval: 0.01 seconds Total sampling time: 11.2 seconds Number of cycles: 0 Sampled threads: # Self Total Cumul Nr Count % Count % Count % Calls Function ------------------------------------------------------------------------ 1 54 4.8 54 4.8 54 4.8 - "foreign function sigprocmask" 2 42 3.8 42 3.8 96 8.6 - SB-EXT:WEAK-POINTER- VALUE 3 41 3.7 41 3.7 137 12.2 - "foreign function stat" 4 37 3.3 37 3.3 174 15.5 - "foreign function _lstat" 5 36 3.2 36 3.2 210 18.8 - SB-C::COMPACT-INFO- LOOKUP 6 27 2.4 76 6.8 237 21.2 - REMOVE-IF 7 24 2.1 32 2.9 261 23.3 - SB-C::FIND-CONSTRAINT 8 20 1.8 96 8.6 281 25.1 - SIMPLIFYA 9 20 1.8 20 1.8 301 26.9 - SB-VM::ALLOC-SIGNED- BIGNUM-IN-EAX 10 15 1.3 1112 99.3 316 28.2 - MEVAL1 11 15 1.3 67 6.0 331 29.6 - (FLET SB-C::LOOKUP) 12 13 1.2 13 1.2 344 30.7 - SB-IMPL::GET3 13 12 1.1 12 1.1 356 31.8 - KEYWORDP 14 11 1.0 17 1.5 367 32.8 - SB-VM::GENERIC-+ 15 11 1.0 12 1.1 378 33.8 - (LABELS SB- IMPL::EQUAL-AUX) 16 10 0.9 16 1.4 388 34.6 - ALIKE1 17 10 0.9 10 0.9 398 35.5 - SB-KERNEL:%MEMBER-EQ 18 10 0.9 10 0.9 408 36.4 - (FLET #:CLEANUP- FUN-[MAKE-CORE-COMPONENT]37) 19 9 0.8 15 1.3 417 37.2 - SB-KERNEL:VALUES- SPECIFIER-TYPE 20 9 0.8 11 1.0 426 38.0 5893 COLNEW::APPROX 21 8 0.7 13 1.2 434 38.7 - LENGTH 22 8 0.7 8 0.7 442 39.5 - SB-C::VOLATILE-INFO- LOOKUP 23 8 0.7 8 0.7 450 40.2 - (LABELS SB- IMPL::SXHASH-RECURSE) 24 7 0.6 37 3.3 457 40.8 - SB-KERNEL:CSUBTYPEP 25 7 0.6 13 1.2 464 41.4 - GETL 26 7 0.6 9 0.8 471 42.1 - SB-KERNEL::%%TYPEP 27 7 0.6 7 0.6 478 42.7 - SB-KERNEL:SEQUENCEP 28 6 0.5 107 9.6 484 43.2 - MEVALARGS 29 6 0.5 40 3.6 490 43.7 - SB-INT:ABOUT-TO- MODIFY-SYMBOL-VALUE 30 6 0.5 29 2.6 496 44.3 - SB-C::CONSTRAIN-REF- TYPE 31 6 0.5 22 2.0 502 44.8 - SB-KERNEL:SPECIFIER- TYPE 32 6 0.5 16 1.4 508 45.4 - SB-KERNEL:%COERCE- CALLABLE-TO-FUN 33 6 0.5 15 1.3 514 45.9 - TIMESIN 34 6 0.5 13 1.2 520 46.4 - DELETE 35 6 0.5 10 0.9 526 47.0 - SB-C::CLASS-INFO-OR- LOSE 36 6 0.5 6 0.5 532 47.5 - SB-C::GET-INFO-VALUE 37 6 0.5 6 0.5 538 48.0 - EQL 38 5 0.4 91 8.1 543 48.5 - (LAMBDA (L)) 39 5 0.4 58 5.2 548 48.9 - MSET 40 5 0.4 40 3.6 553 49.4 2782 COLNEW::DGESL 41 5 0.4 28 2.5 558 49.8 - COMMON-LISP:MAKUNBOUND 42 5 0.4 21 1.9 563 50.3 - SB-KERNEL:TYPE= 43 5 0.4 10 0.9 568 50.7 - PLS 44 5 0.4 5 0.4 573 51.2 - SB-IMPL::GET2 45 5 0.4 5 0.4 578 51.6 - SB-KERNEL:HAIRY-DATA- VECTOR-REF 46 4 0.4 395 35.3 582 52.0 74 COLNEW::LSYSLV 47 4 0.4 63 5.6 586 52.3 - MBIND 48 4 0.4 46 4.1 590 52.7 - MUNBIND ...... Here the colnew function which gets most samples is approx, and it gets 9 samples only. One can see where using: :lisp(disassemble 'colnew::approx) but 9 samples on a long function gives nothing interesting. -- Michel Talon From virgilinux at yahoo.com Mon Sep 19 09:09:55 2011 From: virgilinux at yahoo.com (Virgil L) Date: Mon, 19 Sep 2011 07:09:55 -0700 (PDT) Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima In-Reply-To: <4E76290C.3050807@telefonica.net> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> <4E74B6D5.7090809@telefonica.net> <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> <4E76290C.3050807@telefonica.net> Message-ID: <1316441395.46505.YahooMailNeo@web125311.mail.ne1.yahoo.com> ----- Original Message ----- > From: Mario Rodriguez > On 09/17/2011 07:48 AM, Virgil L wrote: > >> >> To make a concrete question: can maxima infer -- in the context of draw2d > of course -- that (sin(x),x,0,10) MUST mean? explicit(sin(x),x,0,10) and > (y^2=x^3+1,x,-4,-4,y,-4,4) MUST mean? implicit(y^2=x^3+1,x,-4,-4,y,-4,4) ? >> >> >> If true then the declaration explicit/implicit could be _optional_, that > is, allowed but not required. >> >> Of course, if a user wants to declare explicit/implicit for additional > clarity, consistency, etc fine....s/he should still be able to do so. But if > maxima can infer unambiguously what the user means it would seem helpful to > allow maxima to do so. And even if maxima occasionally infers wrong, the user > could THEN write the complete declaration (while not writing it the vast > majority of the times). >> > Hello, > > You are focusing your attention on the syntax for explicit/implicit, but others > have asked, for example, why are we using symbol = for the options. Some people > would prefer something like Hi, Mario: I think we should not mix up two related but different issues: (1)Choosing the right/best format for plot specifications with (2) eliminating redundant/superfluous entry of information. The implicit/explicit issue falls in category (2), whereas the other issues you mention falls into (1). There obviously are many, many formatting possibilities, and it is difficult to "prove" that anyone is "superior" to the others. The one possible criterion to choose an "official" format would be to follow plot2d whenever possible, simply because plot2d is the "incumbent" function and I imagine most of us do learn plot2d usage before draw2d. This I discussed in my previous email. The?implicit/explicit declaration is a totally different concern. The question of whether this declaration is?redundant?CAN be answered objectively, and if the answer is yes, then it would seem?uncontroversial?to make this and any redundant declaration optional.? To differentiate between an implicit vs explicit declaration, not only is there an equal sign in one case but not in the other. The implicit declaration also involves 2 variables whose ranges are specified, whereas the explicit one only has one. So, it seems that the declaration simply carries no information, that is, it does not tell maxima anything that maxima could not infer easily otherwise.?I haven't thought about the parametric case, but I suspect that it is similar. It is also relevant that -- as far as I know -- ?the explicit/implicit?declaration is used EVERY time, even in the simplest of all plots, whereas other specifications are only used in certain cases.? In all, if it can be confirmed that the implicit/explicit/parametric declaration is redundant, then it cannot possibly hurt to make it optional for everybody, without any need for the end user to make a wrapper function. As for the wrapper functions to simplify data entry, thanks for your tips. I may give them a try. Still, it would be preferable to have one "official" wrapper, for the purpose of collaboration. Perhaps at some point we can start a little project of creating a wrapper that translates plot2d-like calls to draw2d calls whenever possible. But again, this is different from the redundancy issue discussed above. Best, Virgil > From biomates at telefonica.net Mon Sep 19 16:35:22 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Mon, 19 Sep 2011 17:35:22 -0400 Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima In-Reply-To: <1316441395.46505.YahooMailNeo@web125311.mail.ne1.yahoo.com> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> <4E74B6D5.7090809@telefonica.net> <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> <4E76290C.3050807@telefonica.net> <1316441395.46505.YahooMailNeo@web125311.mail.ne1.yahoo.com> Message-ID: <4E77B59A.4000802@telefonica.net> On 09/19/2011 10:09 AM, Virgil L wrote: > As for the wrapper functions to simplify data entry, thanks for your > tips. I may give them a try. Still, it would be preferable to have one > "official" wrapper, for the purpose of collaboration. Perhaps at some > point we can start a little project of creating a wrapper that > translates plot2d-like calls to draw2d calls whenever possible. In this case, let me know if you need some help. -- Mario From andre.maute at gmx.de Mon Sep 19 13:53:30 2011 From: andre.maute at gmx.de (andre maute) Date: Mon, 19 Sep 2011 20:53:30 +0200 Subject: [Maxima] least common multiple by hand is much faster than maxima implementation Message-ID: <4E778FAA.4030108@gmx.de> Hi list, I have the following attached least common multiple test, which I canceled after half an hour of computation. Doing it by hand can be done easily in 2 minutes, because the terms are factored. Does somebody have a faster implementation? Andre ------------------------------------- [user at home ~]$ maxima -v + '[' sbcl = clisp ']' + '[' sbcl = cmucl ']' + '[' sbcl = scl ']' + '[' sbcl = gcl ']' + '[' sbcl = acl ']' + '[' sbcl = openmcl ']' + '[' sbcl = ecl ']' + '[' sbcl = sbcl ']' + exec sbcl --core /home/user/opt/maxima/lib/maxima/5.19.2/binary-sbcl/maxima.core --noinform --end-runtime-options --eval '(cl-user::run)' --end-toplevel-options -v '' '' '' '' '' '' '' '' Maxima 5.19.2 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. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: lcm-test-1.max URL: From adammaj1 at o2.pl Mon Sep 19 15:20:44 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Mon, 19 Sep 2011 20:20:44 +0000 (UTC) Subject: [Maxima] list order / draw-points joined References: <4E698715.2090802@telefonica.net> <4E6D4BA6.7070606@telefonica.net> Message-ID: Dnia Sun, 11 Sep 2011 20:00:38 -0400, Mario Rodriguez napisa?(a): > On 09/11/2011 09:25 AM, Adam Majewski wrote: >> /* ---------- preimages of circle under fc = equipotential lines >> --------------------*/ >> l1:GivePreimage(l0); /* first preimage */ l2:GivePreimage(l1)$ /* >> second preimage */ l3:GivePreimage(l2)$ >> l4:GivePreimage(l3)$ >> l5:GivePreimage(l4)$ >> l6:GivePreimage(l5)$ >> l7:GivePreimage(l6)$ >> l8:GivePreimage(l7)$ >> l9:GivePreimage(l8)$ >> l10:GivePreimage(l9)$ >> l11:GivePreimage(l10)$ >> l12:GivePreimage(l11)$ >> l13:GivePreimage(l12)$ >> l14:GivePreimage(l13)$ >> /* preimages : >> - tend to Julia set as n increases >> - tend to equipotential lines as ER tends to infinity */ > > Some of these lists are very long. You can try arrays instead. Graphic > object 'points' can be used with lisp arrays. Type > > ? points > > for an example. (%i2) ? points; Maxima encountered a Lisp error: Couldn't load #P"/usr/share/info/./maxima-index.lisp": file does not exist. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. ; ; compilation unit aborted ; caught 1 fatal ERROR condition Maybe my Maxima failed Adam From rswarbrick at gmail.com Mon Sep 19 15:31:55 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Mon, 19 Sep 2011 21:31:55 +0100 Subject: [Maxima] list order / draw-points joined References: <4E698715.2090802@telefonica.net> <4E6D4BA6.7070606@telefonica.net> Message-ID: Adam Majewski writes: > (%i2) ? points; > Maxima encountered a Lisp error: > Couldn't load #P"/usr/share/info/./maxima-index.lisp": file does not > exist. > Automatically continuing. > To enable the Lisp debugger set *debugger-hook* to nil. > ; > ; compilation unit aborted > ; caught 1 fatal ERROR condition > > Maybe my Maxima failed > This sounds like an installation issue. Maxima looks in a path called *maxima-infodir* (it's a lisp variable name) to find the file. To work out where it's looking, try something like (%i1) :lisp (print-directories) maxima-prefix=/home/rupert/src/not-mine/maxima ... maxima-infodir=/home/rupert/src/not-mine/maxima/doc/info ... maxima-objdir=/home/rupert/src/not-mine/maxima/binary/binary-sbcl I presume that yours is set to /usr/share/info. Looking at the code in init-cl.lisp, this is probably because you (or your distribution) compiled Maxima using autoconf with "--prefix /usr". In which case, you either want to recompile with a different prefix (including running ./configure again) or just run "make install", which should stick the file where it's supposed to be. If, like me, you're frequently updating the version you use, I suggest the former. 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 Mon Sep 19 16:12:51 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 19 Sep 2011 17:12:51 -0400 Subject: [Maxima] Bug in multivariate GCD Message-ID: Andre Maute recently forwarded an LCM issue to the list. It turns out that ratfac:true makes it run much faster, which is good. Unfortunately, with ratfac:false, not only does it run slower, but it also gives an incorrect result! I have tried this will all the GCD algorithms -- I suspect the problem is in the common driver. factor(gcd( (a2+a1+1)^2 * (d+b2-1) * (l2+1)^2 * (l2-a2-a1)^2 * (l2-b2-1) * (l2-d+(-2)*a2-a1-1) * (l2-d-2*a2-a1), (a2+a1+1)^2 * (d+b2-1) * (l2+1)^2 * (l2-d-2*a2-a1) )),ratfac:false; (a2+a1+1)^2 * (l2+1)^2 * (l2-d-2*a2-a1) <<<< wrong factor(gcd( (a2+a1+1)^2 * (d+b2-1) * (l2+1)^2 * (l2-a2-a1)^2 * (l2-b2-1) * (l2-d+(-2)*a2-a1-1) * (l2-d-2*a2-a1), (a2+a1+1)^2 * (d+b2-1) * (l2+1)^2 * (l2-d-2*a2-a1) )),ratfac:false; (a2+a1+1)^2 * (d+b2-1) * (l2+1)^2 * (l2-d-2*a2-a1) <<<< correct Tested in Maxima 5.23.2 GCL 2.6.8 I have reported this as bug 3411622 at sourceforge. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhw at netris.org Mon Sep 19 16:49:17 2011 From: mhw at netris.org (Mark H Weaver) Date: Mon, 19 Sep 2011 17:49:17 -0400 Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima In-Reply-To: <1316441395.46505.YahooMailNeo@web125311.mail.ne1.yahoo.com> (Virgil L.'s message of "Mon, 19 Sep 2011 07:09:55 -0700 (PDT)") References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> <4E74B6D5.7090809@telefonica.net> <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> <4E76290C.3050807@telefonica.net> <1316441395.46505.YahooMailNeo@web125311.mail.ne1.yahoo.com> Message-ID: <87litkurs2.fsf@yeeloong.netris.org> Virgil L writes: > It is also relevant that -- as far as I know -- ?the > explicit/implicit?declaration is used EVERY time, even in the simplest > of all plots, whereas other specifications are only used in certain > cases.? This is not true. explicit() and implicit() are just two of many different kinds of graphic objects understood by draw2d. Others include: bars(), ellipse(), errors(), image(), label(), parametric(), points(), polar(), polygon(), quadrilateral(), rectangle(), region(), triangle(), and vector(). More may be added in the future. draw2d is a very general drawing tool that accepts a list of graphic objects and graphic options. explicit() and implicit() are not declarations, they are graphic objects. However, the biggest problem is that an equation passed to draw2d() is currently interpreted as a graphic option that affects all graphic objects that follow it, for example: draw2d(color=purple, line_width=2, explicit(x^2, x,0,1)); draw2d(points_joined=true, point_type=filled_circle, points(makelist([x,x^2], x,0,4))); draw2d(ip_grid=[100,100], proportional_axes=xy, implicit(x^2+y^2=1, x,-1.2,1.2, y,-1.2,1.2)); So you see, an equation at the beginning of draw2d's parameter list already has a well-defined meaning. In order to implement what you suggest, we'd have to overload the meaning of an equation at the beginning of the parameter list, which would create the potential for symbol name conflicts between draw2d's options and user's equations. For example, you might become quite accustomed to using this abbreviated form, and then one day you decide to plot the following equation: draw2d(delay=R*C, ...); but now it will fail, because delay happens to be the name of an existing graphic option. Or worse, you may have a script that you have published somewhere, and then later it breaks because a new graphic option is added to draw2d that conflicts with a variable name in your equation. This, in turn, would create pressure on Mario to avoid simple option names, and instead choose complex names that are unlikely to conflict with user's equations. Having said all of this, I can sympathize with your desire to advocate for a simpler draw2d interface for the common cases. In retrospect, maybe it would have been better to use a different syntax for options, ideally some nice looking infix operator like "->" that would be used consistently across Maxima for keyword-style parameters. Unfortunately, we cannot make that change now without breaking lots of existing code. Fortunately, as Mario has already pointed out, it is trivial to create convenience functions for the common cases you want. Best, Mark From andre.maute at gmx.de Mon Sep 19 17:22:31 2011 From: andre.maute at gmx.de (andre maute) Date: Tue, 20 Sep 2011 00:22:31 +0200 Subject: [Maxima] least common multiple by hand is much faster than maxima implementation In-Reply-To: References: <4E778FAA.4030108@gmx.de> Message-ID: <4E77C0A7.70908@gmx.de> On 09/19/2011 10:55 PM, Stavros Macrakis wrote: > Try ratfac:true, which preserves factors in rational expressions. Result is > instantaneous. I have already implemented my by hand algorithm, nevertheless thank you for the quick reply. Regards Andre > It also has the advantage that it is correct. > > There is a bug in GCD when ratfac:false in this case (I tried all the > algorithms). I will follow up with a message to the whole list about this > case. > > > (%i94) factor(gcd((a2+a1+1)^2*(d+b2-1)*(l2+1)^2*(l2-a2-a1)^2*(l2-b2-1)*(l2-d+(-2)*a2-a1-1)*(l2-d+(-2)*a2-a1),(a2+a1+1)^2*(d+b2-1)*(l2+1)^2*(l2-d+(-2)*a2-a1))),ratfac:false; > (%o94) (a2+a1+1)^2*(l2+1)^2*(l2-d-2*a2-a1)<<<< wrong > > (%i95) factor(gcd((a2+a1+1)^2*(d+b2-1)*(l2+1)^2*(l2-a2-a1)^2*(l2-b2-1)*(l2-d+(-2)*a2-a1-1)*(l2-d+(-2)*a2-a1),(a2+a1+1)^2*(d+b2-1)*(l2+1)^2*(l2-d+(-2)*a2-a1))),ratfac:true; > (%o95) (a2+a1+1)^2*(d+b2-1)*(l2+1)^2*(l2-d-2*a2-a1)<<<< correct > > -s > > On Mon, Sep 19, 2011 at 14:53, andre maute wrote: > >> Hi list, >> >> I have the following attached least common multiple test, >> which I canceled after half an hour of computation. >> Doing it by hand can be done easily in 2 minutes, >> because the terms are factored. >> >> Does somebody have a faster implementation? >> >> Andre >> >> ------------------------------**------- >> [user at home ~]$ maxima -v >> + '[' sbcl = clisp ']' >> + '[' sbcl = cmucl ']' >> + '[' sbcl = scl ']' >> + '[' sbcl = gcl ']' >> + '[' sbcl = acl ']' >> + '[' sbcl = openmcl ']' >> + '[' sbcl = ecl ']' >> + '[' sbcl = sbcl ']' >> + exec sbcl --core /home/user/opt/maxima/lib/**maxima/5.19.2/binary-sbcl/* >> *maxima.core --noinform --end-runtime-options --eval '(cl-user::run)' >> --end-toplevel-options -v '' '' '' '' '' '' '' '' >> Maxima 5.19.2 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. >> >> >> >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> From toy.raymond at gmail.com Mon Sep 19 21:50:31 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 19 Sep 2011 19:50:31 -0700 Subject: [Maxima] Colnew profiling (Was Re: Initial- and boundary-value problems in Maxima.) Message-ID: [Changing subject to better reflect the topic] On Mon, Sep 19, 2011 at 6:24 AM, Michel Talon wrote: > > writefile("stat_profile"); > load(colnew); > :lisp(cl:require :sb-sprof "/usr/local/lib/sbcl/sb-sprof/sb-sprof.fasl") > :lisp(sb-sprof:profile-call-counts "COLNEW") > :lisp(sb-sprof:with-profiling (:max-samples 10000 :report :flat :loop nil > )#load(prob2)$) > I wonder how many of the maxima calls are from load prob2? Maybe the way to profile would be to load prob2 and then just profile and run colnew_expert? Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Mon Sep 19 22:32:16 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 19 Sep 2011 20:32:16 -0700 Subject: [Maxima] Initial- and boundary-value problems in Maxima. In-Reply-To: References: <20110915162726.GA12096@lpthe.jussieu.fr> <4E723525.4060601@eecs.berkeley.edu> <4E72472A.3090903@eecs.berkeley.edu> <4E727C3D.7030309@eecs.berkeley.edu> Message-ID: On Mon, Sep 19, 2011 at 6:24 AM, Michel Talon wrote: > > (%i3) :lisp(sb-profile:report) > measuring PROFILE overhead..done > Here's what I get using cmucl. They're roughly the same. I guess the difference could be assumed to be a difference in the compiler. The top few items are pretty similar. Consed | Calls | Secs | Sec/Call | Bytes/C. | Name: ----------------------------------------------------------------------- 19,343,200 | 74 | 0.600 | 0.00811 | 261,395 | COLNEW::LSYSLV 8,759,448 | 2,782 | 0.394 | 0.00014 | 3,149 | COLNEW::DGESL 13,525,352 | 1,584 | 0.367 | 0.00023 | 8,539 | COLNEW::VWBLOK 3,223,656 | 396 | 0.199 | 0.00050 | 8,141 | COLNEW::DGEFA 2,767,096 | 52,818 | 0.154 | 0.00000 | 52 | COLNEW::DAXPY 7,418,416 | 1 | 0.090 | 0.09000 | 7,418,416 | COLNEW::CONTRL 1,480,968 | 5,872 | 0.068 | 0.00001 | 252 | COLNEW::APPROX 1,302,056 | 1,594 | 0.047 | 0.00003 | 817 | COLNEW::GBLOCK 743,128 | 49 | 0.040 | 0.00081 | 15,166 | COLNEW::SBBLOK 222,168 | 4 | 0.030 | 0.00750 | 55,542 | COLNEW::ERRCHK 227,720 | 1,291 | 0.017 | 0.00001 | 176 | COLNEW::RKBAS 67,536 | 2,772 | 0.014 | 0.00001 | 24 | COLNEW::IDAMAX 1,331,240 | 10 | 0.010 | 0.00100 | 133,124 | COLNEW::NEWMSH 13,984 | 396 | 0.009 | 0.00002 | 35 | COLNEW::FACTRB 59,880 | 2,772 | 0.004 | 0.00000 | 22 | COLNEW::DSCAL 39,968 | 1 | 0.000 | 0.00000 | 39,968 | COLNEW:COLNEW 243,592 | 64 | 0.000 | 0.00000 | 3,806 | COLNEW::GDERIV 25,312 | 1,198 | 0.000 | 0.00000 | 21 | COLNEW::SUBBAK 39,776 | 1,198 | 0.000 | 0.00000 | 33 | COLNEW::SUBFOR 128 | 4 | 0.000 | 0.00000 | 32 | COLNEW::VMONDE 4,288 | 1 | 0.000 | 0.00000 | 4,288 | COLNEW::CONSTS 8,848 | 380 | 0.000 | 0.00000 | 23 | COLNEW::SHIFTB 33,728 | 162 | 0.000 | 0.00000 | 208 | COLNEW::HORDER 1,344 | 4 | 0.000 | 0.00000 | 336 | COLNEW::SKALE 211,704 | 16 | 0.000 | 0.00000 | 13,232 | COLNEW::FCBLOK 4,600 | 49 | 0.000 | 0.00000 | 94 | COLNEW::DMZSOL ------------------------------------------------------------------- 61,099,136 | 75,492 | 2.045 | | | Total > (%i1) load(colnew); > .... > (%i2) :lisp(sb-profile:profile fsub dfsub "COLNEW") > > (%i2) load(prob2); > (%i3) :lisp(sb-profile:report) > measuring PROFILE overhead..done > > seconds | gc | consed | calls | sec/call | name > ---------------------------------------------------------- > 1.355 | 0.000 | 12,880,288 | 4,632 | 0.000292 | FSUB > 0.704 | 0.000 | 11,850,192 | 1,584 | 0.000445 | DFSUB > 0.580 | 0.066 | 28,463,896 | 74 | 0.007841 | COLNEW::LSYSLV > 0.567 | 0.013 | 32,434,888 | 2,782 | 0.000204 | COLNEW::DGESL > 0.225 | 0.005 | 11,057,520 | 396 | 0.000567 | COLNEW::DGEFA > 0.147 | 0.039 | 11,592,584 | 49 | 0.002998 | COLNEW::SBBLOK > 0.126 | 0.000 | 0 | 52,818 | 0.000002 | COLNEW::DAXPY > Corresponding results for cmucl: Consed | Calls | Secs | Sec/Call | Bytes/C. | Name: ----------------------------------------------------------------------- 8,995,512 | 2,782 | 0.464 | 0.00017 | 3,233 | COLNEW::DGESL 15,297,232 | 4,632 | 0.391 | 0.00008 | 3,303 | FSUB 12,451,000 | 1,584 | 0.257 | 0.00016 | 7,860 | DFSUB 3,271,472 | 396 | 0.179 | 0.00045 | 8,261 | COLNEW::DGEFA 3,527,200 | 74 | 0.150 | 0.00203 | 47,665 | COLNEW::LSYSLV 2,074,056 | 5,872 | 0.128 | 0.00002 | 353 | COLNEW::APPROX 7,418,448 | 1 | 0.100 | 0.10000 | 7,418,448 | COLNEW::CONTRL 1,310,232 | 1,594 | 0.067 | 0.00004 | 822 | COLNEW::GBLOCK 1,076,160 | 1,584 | 0.047 | 0.00003 | 679 | COLNEW::VWBLOK ... ------------------------------------------------------------------- 60,178,656 | 81,952 | 1.903 | | | Total I think this just basically confirms that cmucl compiles things differently from sbcl. But it's clear the fsub and dfsub take a large amount of time. Roughly 34% of the time. dgesl and lsyslv take another 32%. Making lsyslv faster would be a nice improvement. I also wanted to mention that colnew makes use of a lot of common blocks. In the current conversion, the common blocks are represented as one giant array instead of a structure of smaller arrays/scalars. To access a particular part of a common block, an array slice is taken. I don't know how much additional time this takes, but it could be reduced if the parts of the common blocks were left as arrays. The naming used in colnew prevents f2cl from doing this. (Because in some parts of colnew we have a common block with an array named kdum, but in other parts it's named k, and that difference confuses f2cl.) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Tue Sep 20 00:37:16 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 19 Sep 2011 23:37:16 -0600 Subject: [Maxima] References to backslash in Texinfo manual Message-ID: Hi, I got this message: > My request is this: Could \ be added to the index, to refer the > user to the introductory material in Section 5.2.1? Section 5.2.1 is about strings and among other things it describes what effect backslash has in a string. Is there a way to make a reference to that section so that someone looking for "\" or "backslash" can find it? I tinkered with using @anchor but I couldn't get it to work. I suppose in addition there should be a reference to the section about symbols, 6.3 "Identifiers". (Hmm, I suppose that should be renamed to "Symbols".) I hope someone can handle this -- best, Robert Dodier From villate at fe.up.pt Tue Sep 20 03:08:30 2011 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 20 Sep 2011 09:08:30 +0100 Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima In-Reply-To: <99FE7B4429EF4113811EBF3655010FBA@edwinc367e16bd> References: <99FE7B4429EF4113811EBF3655010FBA@edwinc367e16bd> Message-ID: <1316506110.3249.5.camel@B233-01> On Sat, 2011-09-17 at 13:32 -0700, Edwin Woollett wrote: > None of the above is meant to denigrate my favorite > user interface for using Maxima, an interface which > is steadily getting more useful. Hi, thanks for using Xmaxima. Your comments are very useful and well taken. I've been trying to give a face lift to an interface that was frozen since William Schelter wrote it. It should get more improvements in the near future (anxiously awaiting the release of Tcl/Tk 8.6). Best regards, Jaime Villate From talon at lpthe.jussieu.fr Tue Sep 20 04:50:53 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 20 Sep 2011 11:50:53 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: <20110915162726.GA12096@lpthe.jussieu.fr> <4E723525.4060601@eecs.berkeley.edu> <4E72472A.3090903@eecs.berkeley.edu> <4E727C3D.7030309@eecs.berkeley.edu> Message-ID: Raymond Toy wrote: > > Corresponding results for cmucl: > > Consed | Calls | Secs | Sec/Call | Bytes/C. | Name: > ----------------------------------------------------------------------- > 8,995,512 | 2,782 | 0.464 | 0.00017 | 3,233 | COLNEW::DGESL > 15,297,232 | 4,632 | 0.391 | 0.00008 | 3,303 | FSUB > 12,451,000 | 1,584 | 0.257 | 0.00016 | 7,860 | DFSUB > 3,271,472 | 396 | 0.179 | 0.00045 | 8,261 | COLNEW::DGEFA > 3,527,200 | 74 | 0.150 | 0.00203 | 47,665 | COLNEW::LSYSLV > 2,074,056 | 5,872 | 0.128 | 0.00002 | 353 | COLNEW::APPROX > 7,418,448 | 1 | 0.100 | 0.10000 | 7,418,448 | COLNEW::CONTRL > 1,310,232 | 1,594 | 0.067 | 0.00004 | 822 | COLNEW::GBLOCK > 1,076,160 | 1,584 | 0.047 | 0.00003 | 679 | COLNEW::VWBLOK > ... > ------------------------------------------------------------------- > 60,178,656 | 81,952 | 1.903 | | | Total > > I think this just basically confirms that cmucl compiles things > differently What is strange is that there is a large penalty on dgesl compared to the compilation with sbcl. One may wonder what may cost so much time in this basic routine - this may be a hint about the inefficiencies of the lisp version. Anyways i have checked in the profilings i had done on prob3, i see the same pattern: sbcl: seconds |gc | consed | calls | sec/call | name ------------------------------------------------------------ 31.360 | 0.928 | 836,818,968 | 1,064 | 0.029473 | COLNEW::LSYSLV 16.420 | 0.225 | 349,003,072 | 23,178 | 0.000708 | COLNEW::VWBLOK 9.829 | 0.937 | 800,942,728 | 52,124 | 0.000189 | COLNEW::DGESL 4.254 | 0.481 | 318,090,424 | 7,726 | 0.000551 | COLNEW::DGEFA ------------------------------------------------------------ 61.862 | 2.571 | 2,304,855,192 | 84,092 | | Total cmucl: Consed | Calls | Secs | Sec/Call | Bytes/C. | Name: ----------------------------------------------------------------------- 436,497,560 | 1,064 | 31.526 | 0.02963 | 410,242 | COLNEW::LSYSLV 366,043,528 | 23,178 | 16.477 | 0.00071 | 15,793 | COLNEW::VWBLOK 198,947,816 | 52,124 | 12.692 | 0.00024 | 3,817 | COLNEW::DGESL 86,848,840 | 7,726 | 7.929 | 0.00103 | 11,241 | COLNEW::DGEFA ------------------------------------------------------------------- 1,088,337,744 | 84,092 | 68.624 | | | Total Here fsub, dfsub are hidden in lsyslv and take roughly the same time in sbcl and cmucl. But dgesl dgefa are much more expensive in cmucl than in sbcl, and this accounts for the difference in total time. > from sbcl. But it's clear the fsub and dfsub take a large amount of time. > Roughly 34% of the time. dgesl and lsyslv take another 32%. > > Making lsyslv faster would be a nice improvement. The problem i see is that lsyslv is a "do nothing" routine which contents itself with assembling computations done by other routines, approx, vwblock etc. and of course fsub dfsub. It is in these routines that real computations are done, for example approx will yield the values at collocation points to be used in the equations, then one gets a linear system to be inverted (one step of the Newton method). First the system is massaged to a convenient form, vwblock, etc. and then finally solved by dgesl dgefa. Eventually another step of Newton method is applied, perhaps the mesh is refined etc. In this game lsyslv is only a driver. I had obtained a graphviz representation of the call graph in colnew which shows the driver routines at top, and the working routines at bottom (as always ...) it is in: http://www.lpthe.jussieu.fr/~talon/colnew.pdf It has been obtained by first getting a vcg graph with ftnchek -vcg, and then converting it to graphviz format by a script. > > I also wanted to mention that colnew makes use of a lot of common blocks. > In the current conversion, the common blocks are represented as one giant > array instead of a structure of smaller arrays/scalars. To access a > particular part of a common block, an array slice is taken. I don't know > how much additional time this takes, but it could be reduced if the parts > of > the common blocks were left as arrays. The naming used in colnew prevents > f2cl from doing this. (Because in some parts of colnew we have a common > block with an array named kdum, but in other parts it's named k, and that > difference confuses f2cl.) I must say i understand next to nothing to these common blocks, but i see a line where both K and KDUM appear, they may not be the same: COMMON /COLORD/ K, NCDUM, MSTAR, KDUM, MMAX, M(20) The way in which the variables are setup in colnew is particularly obscure, and this doesn't help to understand the program! > > Ray -- Michel Talon From piminusmeson at bk.ru Tue Sep 20 04:57:48 2011 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Tue, 20 Sep 2011 13:57:48 +0400 Subject: [Maxima] f90 question Message-ID: <4E78639C.9030309@bk.ru> Hello, list. I want to use the f90 command for getting the fortran code. For example: (%i1) load("f90")$ (%i2) f90(first_long_name_variable+second_long_name_variable+third_long_name_variable)$ third_long_name_variable+second_long_name_variable+first_long_nam& e_variable (%i3) But such output of f90 command is not recognized by gfortran, let's consider the simple program: !#####test.f90##### program test implicit none real(8) a,first_long_name_variable,second_long_name_variable,third_long_name_variable first_long_name_variable=1 second_long_name_variable=1 third_long_name_variable=1 a=third_long_name_variable+second_long_name_variable+first_long_nam& e_variable write(*,*) a end program test ya at debian:/mnt/maindisk/fortran/gem$ gfortran -o a.out test.f90 test.f90:8: a=third_long_name_variable+second_long_name_variable+first_long_nam& 1 error: Unclassifiable statement at (1) ya at debian:/mnt/maindisk/fortran/gem$ Putting sumbol "&" in the beginning of the next line that is to be continued solves the problem, i.e. the program !#####test.f90##### program test implicit none real(8) a,first_long_name_variable,second_long_name_variable,third_long_name_variable first_long_name_variable=1 second_long_name_variable=1 third_long_name_variable=1 a=third_long_name_variable+second_long_name_variable+first_long_nam& &e_variable write(*,*) a end program test can be compilled by gfortran. Is it possible to make maxima to put the ampersand symbol not only in the end of the line that is to be continued , but in the beginning of the next line too? P.S. sorry for my rough english. From talon at lpthe.jussieu.fr Tue Sep 20 06:35:49 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 20 Sep 2011 13:35:49 +0200 Subject: [Maxima] f90 question References: <4E78639C.9030309@bk.ru> Message-ID: Dmitry Shkirmanov wrote: > Hello, list. I want to use the f90 command for getting the fortran > code. For example: > > (%i1) load("f90")$ > (%i2) > f90(first_long_name_variable+second_long_name_variable+third_long_name_variable)$ > third_long_name_variable+second_long_name_variable+first_long_nam& > e_variable > (%i3) > > But such output of f90 command is not recognized by gfortran, let's Yes, i think it is not very difficult. The file which does the job is f90.lisp which you can find in /share/maxima//share/contrib/f90.lisp The place where lines are broken and & added is: (if (>= (length x) *f90-output-line-length-max*) ;; Split this line and print it with trailing ampersand. ;; Previous scheme to break the lines nicely had some bugs; ;; it's simpler to break at a fixed length. (let ((line x) (break-point *f90-output-line-length-max*)) (princ (subseq line 0 break-point)) (princ "&") (terpri) (setf line (subseq line break-point)) (loop while (> (length line) break-point) do (princ (subseq line 0 break-point)) (princ "&") (terpri) (setf line (subseq line break-point))) (if (> (length line) 0) (princ line))) (princ x)) Here (terpri) terminates line and goes to new line, break-point is for example 80, (subseq line 0 break-point) is the part of the line from first to 80th character, it is printed then a & is printed and line is reset to the rest of line, etc. One needs to add a (princ "&") at the correct place, a bit of experiment will do. You can edit f90.lisp, then reload it and run it, etc. all interactive. -- Michel Talon From piminusmeson at bk.ru Tue Sep 20 08:21:54 2011 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Tue, 20 Sep 2011 17:21:54 +0400 Subject: [Maxima] f90 question In-Reply-To: References: <4E78639C.9030309@bk.ru> Message-ID: <4E789372.10808@bk.ru> Thanks. I do not know lisp, but i changed f90.lisp by inserting (princ "&") in two places: ;; Split this line and print it with trailing ampersand. ;; Previous scheme to break the lines nicely had some bugs; ;; it's simpler to break at a fixed length. (let ((line x) (break-point *f90-output-line-length-max*)) (princ (subseq line 0 break-point)) (princ "&") (terpri) (princ "&") (setf line (subseq line break-point)) (loop while (> (length line) break-point) do (princ (subseq line 0 break-point)) (princ "&") (terpri) (princ "&) (setf line (subseq line break-point))) (if (> (length line) 0) (princ line))) (princ x)) It solved the problem: (%i1) load("f90"); (%o1) /usr/local/share/maxima/5.25.1/share/contrib/f90.lisp (%i2) res: long_name_variable_1+long_name_variable_2+long_name_variable_3+long_name_variable_4+ long_name_variable_5+long_name_variable_6+long_name_variable_7+long_name_variable_8+long_name_variable_9+long_name_variable_10 +long_name_variable_11+long_name_variable_12+long_name_variable_13; (%o2) long_name_variable_9 + long_name_variable_8 + long_name_variable_7 + long_name_variable_6 + long_name_variable_5 + long_name_variable_4 + long_name_variable_3 + long_name_variable_2 + long_name_variable_13 + long_name_variable_12 + long_name_variable_11 + long_name_variable_10 + long_name_variable_1 (%i3) f90(res); long_name_variable_9+long_name_variable_8+long_name_variable_7+lo& &ng_name_variable_6+long_name_variable_5+long_name_variable_4+long& &_name_variable_3+long_name_variable_2+long_name_variable_13+long_& &name_variable_12+long_name_variable_11+long_name_variable_10+long& &_name_variable_1 (%o3) false (%i4) I asked about possibility to make gfortran to recognize line continuation only with "&" symbol in the end of the line on the gfortran mailing list, the answer is: > On Sep 20 2011, Dmitry Shkirmanov wrote: >> >> third_long_name_variable+second_long_name_variable+first_long_nam& >> e_variable >> >> But such line continuation is not recognized by gfortran, ... > > It's a breach of Fortran's syntax rules, and therefore a bug in Maxima. > The correct syntax is: > > a=third_long_name_variable+second_long_name_variable+first_long_nam& > &e_variable > > You must use the double & form when splitting lexical tokens. You can > easily fix up Maxima's bug by running a simple awk, Python or Perl > script to add an & to the start of every line that follows one that is > terminated with an &. > > > Regards, > Nick Maclaren. So, i think that developers of maxima should change f90.lisp to add the ampersand symbol in the beginning of the next line by default. On 20.09.2011 15:35, Michel Talon wrote: > Dmitry Shkirmanov wrote: > > >> Hello, list. I want to use the f90 command for getting the fortran >> code. For example: >> >> (%i1) load("f90")$ >> (%i2) >> >> > f90(first_long_name_variable+second_long_name_variable+third_long_name_variable)$ > >> third_long_name_variable+second_long_name_variable+first_long_nam& >> e_variable >> (%i3) >> >> But such output of f90 command is not recognized by gfortran, let's >> > Yes, i think it is not very difficult. The file which does the job is > f90.lisp which you can find in > /share/maxima//share/contrib/f90.lisp > > The place where lines are broken and& added is: > (if (>= (length x) *f90-output-line-length-max*) > > ;; Split this line and print it with trailing ampersand. > ;; Previous scheme to break the lines nicely had some bugs; > ;; it's simpler to break at a fixed length. > > (let ((line x) (break-point *f90-output-line-length-max*)) > (princ (subseq line 0 break-point)) > (princ "&") > (terpri) > (setf line (subseq line break-point)) > > (loop while (> (length line) break-point) do > (princ (subseq line 0 break-point)) > (princ "&") > (terpri) > (setf line (subseq line break-point))) > > (if (> (length line) 0) > (princ line))) > > (princ x)) > > > Here (terpri) terminates line and goes to new line, break-point is for > example 80, (subseq line 0 break-point) is the part of the line from > first to 80th character, it is printed then a& is printed and line is reset > to the rest of line, etc. One needs to add a (princ "&") at the correct > place, a bit of experiment will do. > > You can edit f90.lisp, then reload it and run it, etc. all interactive. > From virgilinux at yahoo.com Tue Sep 20 08:31:38 2011 From: virgilinux at yahoo.com (Virgil L) Date: Tue, 20 Sep 2011 06:31:38 -0700 (PDT) Subject: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima In-Reply-To: <87litkurs2.fsf@yeeloong.netris.org> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> <4E74B6D5.7090809@telefonica.net> <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> <4E76290C.3050807@telefonica.net> <1316441395.46505.YahooMailNeo@web125311.mail.ne1.yahoo.com> <87litkurs2.fsf@yeeloong.netris.org> Message-ID: <1316525498.45837.YahooMailNeo@web125305.mail.ne1.yahoo.com> ----- Original Message ----- > From: Mark H Weaver > > Virgil L writes: >> It is also relevant that -- as far as I know -- ?the >> explicit/implicit?declaration is used EVERY time, even in the simplest >> of all plots, whereas other specifications are only used in certain >> cases.? > > This is not true.? explicit() and implicit() are just two of many > different kinds of graphic objects understood by draw2d.? Others > include: bars(), ellipse(), errors(), image(), label(), parametric(), > points(), polar(), polygon(), quadrilateral(), rectangle(), region(), > triangle(), and vector().? More may be added in the future. Sorry, what I meant is that this specification (plot type, that is, explicit/implicit/parametric/whatever) is needed in every use (choose one of them), even in the simplest cases. This is different from other specifications that are only used in specific kinds of plots. The point is that "optimising" this aspect makes more sense than if it only affected very particular cases. I appreciate the rest of your post, as it seems to provide some technical explanations about how things work internally in draw2d. I cannot say I follow all of it, but that isn't surprising to me, since I am not familiar with lisp (the underlying programming system), and I tend to do most of my programming in relatively higher-level "environments" such as or similar to matlab/octave/scilab. Anyhow, > So you see, an equation at the beginning of draw2d's parameter list > already has a well-defined meaning.? In order to implement what you > suggest, we'd have to overload the meaning of an equation at the > beginning of the parameter list, which would create the potential for > symbol name conflicts between draw2d's options and user's equations. It is possible that what you have in mind is more sophisticated (and potentially more useful) than what I have in mind. What I suggest are purely _syntactic_ identities of the sort: ?explicit(f(x),x,x1,x2) ==?[f(x),[x,x1,x2]] ?implicit(f(x,y)=0,x,x1,x2,y,y1,y2) ==?[f(x,y)=0,[x,x1,x2],[y,y1,y2]] ?parametric(f(t),g(t),t,t1,t2)) ==?[[f(t),g(t)],[t,t1,t2]] As you can probably tell, the left has today's draw2d syntax, whereas the right is (similar to) plot2d's. >?Unfortunately,?we cannot make that change now without breaking lots of existing code. >? > Fortunately, as Mario has already pointed out, it is trivial to create > convenience functions for the common cases you want. Given my limited understanding of these issues, it would seem that the above "identities" could be implemented at the _syntactic_ level inside draw2d without utilising "overloading" or any sophisticated scheme, and without breaking or making any significant change to the underlying code. The idea is that the draw2d "interpreter" would in principle look for the the presence of any of the constructs on left-hand side of the identities. If any is found the function would work exactly as it does today. If none is found, instead of returning an error, it would look for the presence of one of the constructs on the right-side. If one is found, it would make the "translation" to the equivalent one in the left, and after that it would work EXACTLY as it does today. Notice that after a construct on the right is translated to its equivalent on the left, draw2d's underlying algorithm would work??EXACTLY as it does today, that is, the underlying algorithm (the one that actually does the plotting) would "see" ?explicit(f(x),x,x1,x2) whether the user has typed it exactly like that, or whether the user wrote?[f(x),[x,x1,x2]]?and it was "translated" to explicit(f(x),x,x1,x2) . Other plot types could be left as they are today, or similar identities could be developed for the others.? Sorry, if the above doesn't make sense.? Best, Virgil From adammaj1 at o2.pl Tue Sep 20 14:09:10 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Tue, 20 Sep 2011 19:09:10 +0000 (UTC) Subject: [Maxima] list order / draw-points joined References: <4E698715.2090802@telefonica.net> <4E6D4BA6.7070606@telefonica.net> Message-ID: Dnia Mon, 19 Sep 2011 21:31:55 +0100, Rupert Swarbrick napisa?(a): > Adam Majewski writes: >> (%i2) ? points; >> Maxima encountered a Lisp error: >> Couldn't load #P"/usr/share/info/./maxima-index.lisp": file does not >> exist. >> Automatically continuing. >> To enable the Lisp debugger set *debugger-hook* to nil. ; >> ; compilation unit aborted >> ; caught 1 fatal ERROR condition >> >> Maybe my Maxima failed >> >> > This sounds like an installation issue. Maxima looks in a path called > *maxima-infodir* (it's a lisp variable name) to find the file. To work > out where it's looking, try something like > > (%i1) :lisp (print-directories) > maxima-prefix=/home/rupert/src/not-mine/maxima ... > maxima-infodir=/home/rupert/src/not-mine/maxima/doc/info ... > maxima-objdir=/home/rupert/src/not-mine/maxima/binary/binary-sbcl > > I presume that yours is set to /usr/share/info. Looking at the code in > init-cl.lisp, this is probably because you (or your distribution) > compiled Maxima using autoconf with "--prefix /usr". > > In which case, you either want to recompile with a different prefix > (including running ./configure again) or just run "make install", which > should stick the file where it's supposed to be. If, like me, you're > frequently updating the version you use, I suggest the former. > > > Rupert > _______________________________________________ Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Hi, Thx for answer. You are right. (%i1) :lisp (print-directories) maxima-prefix=/usr maxima-imagesdir=/usr/lib/maxima/5.25.1/binary-sbcl maxima-sharedir=/usr/share/maxima/5.25.1/share maxima-srcdir=/usr/share/maxima/5.25.1/src maxima-demodir=/usr/share/maxima/5.25.1/demo maxima-testsdir=/usr/share/maxima/5.25.1/tests maxima-docdir=/usr/share/maxima/5.25.1/doc maxima-infodir=/usr/share/info maxima-htmldir=/usr/share/maxima/5.25.1/doc/html maxima-plotdir=/usr/lib/maxima/5.25.1 maxima-layout-autotools=T maxima-userdir=/home/adam/.maxima maxima-tempdir=/home/adam maxima-lang-subdir=NIL maxima-objdir=/home/adam/.maxima/binary/binary-sbcl NIL I have done as make install and : (%i4) :lisp (print-directories) maxima-prefix=/usr/local maxima-imagesdir=/usr/local/lib/maxima/5.25.1/binary-clisp maxima-sharedir=/usr/local/share/maxima/5.25.1/share maxima-srcdir=/usr/local/share/maxima/5.25.1/src maxima-demodir=/usr/local/share/maxima/5.25.1/demo maxima-testsdir=/usr/local/share/maxima/5.25.1/tests maxima-docdir=/usr/local/share/maxima/5.25.1/doc maxima-infodir=/usr/local/share/info maxima-htmldir=/usr/local/share/maxima/5.25.1/doc/html maxima-plotdir=/usr/local/libexec/maxima/5.25.1 maxima-layout-autotools=T maxima-userdir=/home/adam/.maxima maxima-tempdir=/home/adam maxima-lang-subdir=NIL maxima-objdir=/home/adam/.maxima/binary/binary-clisp NIL but : (%i2) ? points; No exact match found for topic `points'. Try `?? points' (inexact match) instead. (%o2) false (%i3) ?? points; (%o3) false Best regards Adam From drdieterkaiser at web.de Tue Sep 20 15:24:32 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 20 Sep 2011 22:24:32 +0200 Subject: [Maxima] References to backslash in Texinfo manual In-Reply-To: References: Message-ID: <1316550272.1681.4.camel@dieter> Am Montag, den 19.09.2011, 23:37 -0600 schrieb Robert Dodier: > Hi, I got this message: > > > My request is this: Could \ be added to the index, to refer the > > user to the introductory material in Section 5.2.1? > > Section 5.2.1 is about strings and among other things > it describes what effect backslash has in a string. > Is there a way to make a reference to that section so > that someone looking for "\" or "backslash" can find it? > I tinkered with using @anchor but I couldn't get it to work. > > I suppose in addition there should be a reference to the > section about symbols, 6.3 "Identifiers". (Hmm, I suppose > that should be renamed to "Symbols".) > > I hope someone can handle this -- It is necessary to put "backslash" and "\" into one of the indices. Available indices are @findex for functions and @vindex for variables. The environments @deffn and @defvr do this automatically, but it is possible to add any name by hand. I will commit it. Dieter Kaiser From andre.maute at gmx.de Wed Sep 21 09:08:31 2011 From: andre.maute at gmx.de (andre maute) Date: Wed, 21 Sep 2011 16:08:31 +0200 Subject: [Maxima] unexpected behavior of divide Message-ID: <4E79EFDF.4050107@gmx.de> Hi list, suppose we have the following, polynomial division, r1 is the remainder, but why is f1 a rational function? Regards Andre ------------------------------------------ Maxima 5.19.2 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(divide-test-1.max) batching /home/user/divide-test-1.max (%i2) display2d : false (%o2) false (%i3) h0:2*b1^2+4*a2*b2-4*a2^2*b2+4*b1*b2+2*b1^2*b2+4*a2*b2^2-4*a2^2*b2^2 +4*b1*b2^2+2*b1^2*b2^2-2*b2^3+4*b1*b2^3+2*a2*d-2*a2^2*d+2*b1*d -b1^2*d-4*a2^2*b2*d+2*b1^2*b2*d-5*b2^2*d-4*a2*b2^2*d +6*b1*b2^2*d-a2*d^2-a2^2*d^2-b1*d^2+b1^2*d^2-4*b2*d^2 -4*a2*b2*d^2+4*b1*b2*d^2-d^3-a2*d^3+b1*d^3 (%o3) b1*d^3-a2*d^3-d^3+4*b1*b2*d^2-4*a2*b2*d^2-4*b2*d^2+b1^2*d^2-b1*d^2 -a2^2*d^2-a2*d^2+6*b1*b2^2*d-4*a2*b2^2*d-5*b2^2*d+2*b1^2*b2*d -4*a2^2*b2*d-b1^2*d+2*b1*d-2*a2^2*d+2*a2*d+4*b1*b2^3-2*b2^3 +2*b1^2*b2^2+4*b1*b2^2-4*a2^2*b2^2+4*a2*b2^2+2*b1^2*b2+4*b1*b2 -4*a2^2*b2+4*a2*b2+2*b1^2 (%i4) [f1,r1]:factor(divide(h0,(2+b2-b1)*(2*b2+d))) (%o4) [(b1*d^2-a2*d^2-d^2+2*b1*b2*d-2*a2*b2*d-2*b2*d+b1^2*d-b1*d-a2^2*d-a2*d +2*b1*b2^2-b2^2+2*b1*b2-2*a2^2*b2+2*a2*b2-b1^2+2*b1-2*a2^2+2*a2) /(b2-b1+2),2*b1^2*(b2+1)^2] (%o4) "/home/user/divide-test-1.max" -------------------------------------------------------- From fateman at eecs.berkeley.edu Wed Sep 21 09:34:27 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 21 Sep 2011 07:34:27 -0700 Subject: [Maxima] unexpected behavior of divide In-Reply-To: <4E79EFDF.4050107@gmx.de> References: <4E79EFDF.4050107@gmx.de> Message-ID: <4E79F5F3.10002@eecs.berkeley.edu> There is a 3rd argument to divide, which you have left out. The two results from divide(a,b,x) are the quotient and remainder from the division of polynomials a by b in the ring Q[x], where Q is a field of rational functions in all the other variables. Thus the quotient and remainder are in Q, which is in general rational functions. If divide is given just two arguments (i.e. x is unspecified) I think it picks one variable for x. I haven't looked at your example in detail, so I am not positive what you are finding. But I hope this makes sense to you (and other readers...) RJF On 9/21/2011 7:08 AM, andre maute wrote: > Hi list, > > suppose we have the following, > polynomial division, r1 is the remainder, > but why is f1 a rational function? > > Regards > Andre > > ------------------------------------------ > Maxima 5.19.2 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(divide-test-1.max) > > batching /home/user/divide-test-1.max > (%i2) display2d : false > (%o2) false > (%i3) h0:2*b1^2+4*a2*b2-4*a2^2*b2+4*b1*b2+2*b1^2*b2+4*a2*b2^2-4*a2^2*b2^2 > > +4*b1*b2^2+2*b1^2*b2^2-2*b2^3+4*b1*b2^3+2*a2*d-2*a2^2*d+2*b1*d > -b1^2*d-4*a2^2*b2*d+2*b1^2*b2*d-5*b2^2*d-4*a2*b2^2*d > +6*b1*b2^2*d-a2*d^2-a2^2*d^2-b1*d^2+b1^2*d^2-4*b2*d^2 > -4*a2*b2*d^2+4*b1*b2*d^2-d^3-a2*d^3+b1*d^3 > (%o3) b1*d^3-a2*d^3-d^3+4*b1*b2*d^2-4*a2*b2*d^2-4*b2*d^2+b1^2*d^2-b1*d^2 > -a2^2*d^2-a2*d^2+6*b1*b2^2*d-4*a2*b2^2*d-5*b2^2*d+2*b1^2*b2*d > -4*a2^2*b2*d-b1^2*d+2*b1*d-2*a2^2*d+2*a2*d+4*b1*b2^3-2*b2^3 > > +2*b1^2*b2^2+4*b1*b2^2-4*a2^2*b2^2+4*a2*b2^2+2*b1^2*b2+4*b1*b2 > -4*a2^2*b2+4*a2*b2+2*b1^2 > (%i4) [f1,r1]:factor(divide(h0,(2+b2-b1)*(2*b2+d))) > (%o4) > [(b1*d^2-a2*d^2-d^2+2*b1*b2*d-2*a2*b2*d-2*b2*d+b1^2*d-b1*d-a2^2*d-a2*d > > +2*b1*b2^2-b2^2+2*b1*b2-2*a2^2*b2+2*a2*b2-b1^2+2*b1-2*a2^2+2*a2) > /(b2-b1+2),2*b1^2*(b2+1)^2] > (%o4) "/home/user/divide-test-1.max" > -------------------------------------------------------- > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From rswarbrick at gmail.com Wed Sep 21 10:03:41 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 21 Sep 2011 16:03:41 +0100 Subject: [Maxima] list order / draw-points joined References: <4E698715.2090802@telefonica.net> <4E6D4BA6.7070606@telefonica.net> Message-ID: Adam Majewski writes: > I have done as make install and : > > > > (%i4) :lisp (print-directories) > maxima-prefix=/usr/local > maxima-imagesdir=/usr/local/lib/maxima/5.25.1/binary-clisp > maxima-sharedir=/usr/local/share/maxima/5.25.1/share > maxima-srcdir=/usr/local/share/maxima/5.25.1/src > maxima-demodir=/usr/local/share/maxima/5.25.1/demo > maxima-testsdir=/usr/local/share/maxima/5.25.1/tests > maxima-docdir=/usr/local/share/maxima/5.25.1/doc > maxima-infodir=/usr/local/share/info > maxima-htmldir=/usr/local/share/maxima/5.25.1/doc/html > maxima-plotdir=/usr/local/libexec/maxima/5.25.1 > maxima-layout-autotools=T > maxima-userdir=/home/adam/.maxima > maxima-tempdir=/home/adam > maxima-lang-subdir=NIL > maxima-objdir=/home/adam/.maxima/binary/binary-clisp > NIL > > but : > (%i2) ? points; > No exact match found for topic `points'. > Try `?? points' (inexact match) instead. > (%o2) false > (%i3) ?? points; > (%o3) false Hmm, I'm not sure what's going on here. What's supposed to happen is that Maxima reads in a file called maxima-index.lisp from maxima-infodir (in your case /usr/local/share/info). Since you aren't getting an error about that, I presume this worked. Maybe check the file exists and has a massive defparameter form (my copy is about 2500 lines long). To check that this bit has worked, you could do something like the following. - First load up maxima-index.lisp. The easiest way is to type something like (%i*) ? blarglblargl or whatever. - Now check that *info-deffn-defvr-pairs* has been populated: (%i2) :lisp (length cl-info::*info-deffn-defvr-pairs*) I get 2388, but I guess this might vary slightly depending on the version of Maxima's help (and the language? I'm not sure). - Check that "points" is actually in the list: (%i2) :lisp (assoc "points" cl-info::*info-deffn-defvr-pairs* :test 'equal) If you get NIL, something's broken. I get a list like this: (points maxima.info-2 600814 6480 Functions and Variables for draw) The second element in the list is the info file that should contain the help and then Maxima loads that up. Maybe go through these steps. I suspect at least one of them will fail and maybe that'll tell you what's gone wrong with your installation. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From talon at lpthe.jussieu.fr Wed Sep 21 10:10:18 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 21 Sep 2011 17:10:18 +0200 Subject: [Maxima] Initial- and boundary-value problems in Maxima. References: <20110915162726.GA12096@lpthe.jussieu.fr> <4E723525.4060601@eecs.berkeley.edu> <4E72472A.3090903@eecs.berkeley.edu> <4E727C3D.7030309@eecs.berkeley.edu> Message-ID: Raymond Toy wrote: <...> You asked to run sbcl statistical profiler only on colnew_expert. I have done it the following way: load(colnew); :lisp(cl:require :sb-sprof "/usr/local/lib/sbcl/sb-sprof/sb-sprof.fasl") load(prob2); :lisp(sb-sprof:profile-call-counts "COLNEW") :lisp(sb-sprof:with-profiling (:max-samples 10000 :report :flat :loop nil )#$[iflag, fspace, ispace] : colnew_expert(ncomp, m, aleft, aright, zeta, ipar, ltol, tol, fixpnt, ispace, fspace,0, fsub, dfsub, gsub, dgsub, solutn)$) The last one on one line. Here is the result: Number of samples: 403 Sample interval: 0.01 seconds Total sampling time: 4.0299997 seconds Number of cycles: 0 Sampled threads: # Self Total Cumul Nr Count % Count % Count % Calls Function ------------------------------------------------------------------------ 1 36 8.9 36 8.9 36 8.9 - SB-EXT:WEAK-POINTER- VALUE 2 28 6.9 75 18.6 64 15.9 - REMOVE-IF 3 18 4.5 18 4.5 82 20.3 - SB-C::COMPACT-INFO- LOOKUP 4 16 4.0 16 4.0 98 24.3 - "foreign function sigprocmask" 5 15 3.7 15 3.7 113 28.0 - SB-IMPL::GET3 6 14 3.5 75 18.6 127 31.5 - SIMPLIFYA 7 13 3.2 399 99.0 140 34.7 - MEVAL1 8 12 3.0 54 13.4 152 37.7 - (FLET SB-C::LOOKUP) 9 10 2.5 10 2.5 162 40.2 - SB-VM::ALLOC-SIGNED- BIGNUM-IN-EAX 10 9 2.2 132 32.8 171 42.4 - MAKE-ARRAY 11 9 2.2 9 2.2 180 44.7 - SB-KERNEL:%MEMBER-EQ 12 9 2.2 9 2.2 189 46.9 - SB-C::VOLATILE-INFO- LOOKUP 13 7 1.7 7 1.7 196 48.6 - SB-KERNEL:CSUBTYPEP 14 6 1.5 6 1.5 202 50.1 - LENGTH 15 6 1.5 6 1.5 208 51.6 - KEYWORDP 16 5 1.2 13 3.2 213 52.9 - SB-KERNEL:SPECIFIER- TYPE 17 5 1.2 10 2.5 218 54.1 - EQUAL 18 5 1.2 8 2.0 223 55.3 - SB-KERNEL:VALUES- SPECIFIER-TYPE 19 4 1.0 134 33.3 227 56.3 1584 COLNEW::VWBLOK 20 4 1.0 20 5.0 231 57.3 - SUBTYPEP 21 4 1.0 8 2.0 235 58.3 - ALIKE1 22 4 1.0 8 2.0 239 59.3 - SAFE-MGET 23 4 1.0 6 1.5 243 60.3 - REDUCE 24 4 1.0 6 1.5 247 61.3 - SB-C::CLASS-INFO-OR- LOSE 25 4 1.0 5 1.2 251 62.3 - SB-C::FIND-TYPE-INFO 26 4 1.0 4 1.0 255 63.3 - (LABELS SB- IMPL::EQUAL-AUX) 27 4 1.0 4 1.0 259 64.3 - SB-KERNEL::%%TYPEP 28 4 1.0 4 1.0 263 65.3 - (LAMBDA (SB- IMPL::VALUE)) 29 3 0.7 38 9.4 266 66.0 - MACRO-FUNCTION 30 3 0.7 12 3.0 269 66.7 - TIMESIN 31 3 0.7 8 2.0 272 67.5 - GETL 32 3 0.7 3 0.7 275 68.2 - DELETE 33 3 0.7 3 0.7 278 69.0 - SB-KERNEL:HAIRY-DATA- VECTOR-REF/CHECK-BOUNDS 34 3 0.7 3 0.7 281 69.7 - BADFUNCHK 35 3 0.7 3 0.7 284 70.5 - GETCHARN 36 3 0.7 3 0.7 287 71.2 - MTIMESP 37 2 0.5 380 94.3 289 71.7 74 COLNEW::LSYSLV 38 2 0.5 45 11.2 291 72.2 - GETL-LM-FCN-PROP 39 2 0.5 31 7.7 293 72.7 - SB-KERNEL:FDEFINITION- OBJECT 40 2 0.5 29 7.2 295 73.2 - MSET 41 2 0.5 29 7.2 297 73.7 - MBIND-DOIT 42 2 0.5 29 7.2 299 74.2 - SIMPTIMES 43 2 0.5 22 5.5 301 74.7 - SB-IMPL::%COMPLEX- VECTOR-WIDETAG 44 2 0.5 19 4.7 303 75.2 - (LAMBDA (SB-C::NAME)) 45 2 0.5 12 3.0 305 75.7 - MUNBIND 46 2 0.5 9 2.2 307 76.2 - SB-VM::GENERIC-+ 47 2 0.5 4 1.0 309 76.7 - SB-KERNEL:TWO-ARG-> 48 2 0.5 3 0.7 311 77.2 - SB-KERNEL:TWO-ARG-< 49 2 0.5 2 0.5 313 77.7 - NOTLOREQ 50 2 0.5 2 0.5 315 78.2 - $LISTP 51 2 0.5 2 0.5 317 78.7 - SB-KERNEL:TYPE- SPECIFIER 52 2 0.5 2 0.5 319 79.2 - (LAMBDA (SB-C::NAME)) 53 2 0.5 2 0.5 321 79.7 - SB-C::GET-INFO-VALUE 54 2 0.5 2 0.5 323 80.1 - LIST 55 2 0.5 2 0.5 325 80.6 - SB-KERNEL:VECTOR- SUBSEQ* 56 2 0.5 2 0.5 327 81.1 - $SUBVARP 57 2 0.5 2 0.5 329 81.6 - MNUMP 58 2 0.5 2 0.5 331 82.1 - SB-BIGNUM:BIGNUM- TRUNCATE 59 2 0.5 2 0.5 333 82.6 - (LAMBDA (&REST REST)) 60 2 0.5 2 0.5 335 83.1 - F2CL-LIB::FIND-ARRAY- DATA 61 1 0.2 399 99.0 336 83.4 - MEVAL 62 1 0.2 213 52.9 337 83.6 - MLAMBDA 63 1 0.2 152 37.7 338 83.9 - FSUB 64 1 0.2 116 28.8 339 84.1 - MEVALARGS 65 1 0.2 49 12.2 340 84.4 - MAXIMA-SUBSTITUTE 66 1 0.2 45 11.2 341 84.6 - SUBST1 67 1 0.2 34 8.4 342 84.9 - FUNCTIONP 68 1 0.2 30 7.4 343 85.1 - MBIND 69 1 0.2 22 5.5 344 85.4 - FBOUNDP 70 1 0.2 20 5.0 345 85.6 - SB-INT:ABOUT-TO- MODIFY-SYMBOL-VALUE 71 1 0.2 16 4.0 346 85.9 - SB-INT:INFO 72 1 0.2 15 3.7 347 86.1 396 COLNEW::DGEFA 73 1 0.2 14 3.5 348 86.4 - F2CL-LIB::EXECUTE- FORMAT 74 1 0.2 12 3.0 349 86.6 49 COLNEW::SBBLOK 75 1 0.2 10 2.5 350 86.8 - SB-KERNEL:%COERCE- CALLABLE-TO-FUN 76 1 0.2 9 2.2 351 87.1 - PLS 77 1 0.2 5 1.2 352 87.3 - MAKUNBOUND 78 1 0.2 5 1.2 353 87.6 5872 COLNEW::APPROX 79 1 0.2 4 1.0 354 87.8 - SUBST0 80 1 0.2 4 1.0 355 88.1 - PLUSIN 81 1 0.2 4 1.0 356 88.3 - COMMON-LISP:MAKUNBOUND 82 1 0.2 3 0.7 357 88.6 - ALIKE 83 1 0.2 3 0.7 358 88.8 - SIMPARGS 84 1 0.2 3 0.7 359 89.1 - TIMESK 85 1 0.2 2 0.5 360 89.3 - TESTTNEG 86 1 0.2 2 0.5 361 89.6 - GREAT 87 1 0.2 2 0.5 362 89.8 - QUEUE+P 88 1 0.2 2 0.5 363 90.1 - MEVAL2 89 1 0.2 2 0.5 364 90.3 - EXPTB 90 1 0.2 2 0.5 365 90.6 52818 COLNEW::DAXPY 91 1 0.2 2 0.5 366 90.8 - FPCOFRAT1 92 1 0.2 2 0.5 367 91.1 - SB-KERNEL::NUMBER- UNPARSE-TYPE-METHOD 93 1 0.2 1 0.2 368 91.3 - SB-C::VARIFY-LAMBDA- ARG 94 1 0.2 1 0.2 369 91.6 - SB-KERNEL:MAKE-VALUES- TYPE 95 1 0.2 1 0.2 370 91.8 - MATCHECK 96 1 0.2 1 0.2 371 92.1 - CPUT 97 1 0.2 1 0.2 372 92.3 - ARRAY-ELEMENT-TYPE 98 1 0.2 1 0.2 373 92.6 - (LABELS SB- IMPL::SXHASH-RECURSE) 99 1 0.2 1 0.2 374 92.8 - SB-KERNEL:TWO-ARG-= 100 1 0.2 1 0.2 375 93.1 - SB-KERNEL:TWO-ARG-AND 101 1 0.2 1 0.2 376 93.3 - MAPPLY 102 1 0.2 1 0.2 377 93.5 - MPLUSP 103 1 0.2 1 0.2 378 93.8 - GETOPR0 104 1 0.2 1 0.2 379 94.0 - SB-IMPL::%OUTPUT- REASONABLE-INTEGER-IN-BASE 105 1 0.2 1 0.2 380 94.3 - SB-INT:VALID-FUNCTION- NAME-P 106 1 0.2 1 0.2 381 94.5 - SB-KERNEL:TWO-ARG-+ 107 1 0.2 1 0.2 382 94.8 - EXPT 108 1 0.2 1 0.2 383 95.0 - SB-KERNEL:VECTOR- SIGNED-BYTE-32-P 109 1 0.2 1 0.2 384 95.3 - MDEFLISTP 110 1 0.2 1 0.2 385 95.5 - SIMPQUOT 111 1 0.2 1 0.2 386 95.8 - ARRAY-TOTAL-SIZE 112 1 0.2 1 0.2 387 96.0 - SB-KERNEL:%ASSOC-EQ 113 1 0.2 1 0.2 388 96.3 - ONEP1 114 1 0.2 1 0.2 389 96.5 1291 COLNEW::RKBAS 115 1 0.2 1 0.2 390 96.8 - SB-KERNEL::INTEGER-/- INTEGER 116 1 0.2 1 0.2 391 97.0 - SB-BIGNUM:BIGNUM- LOGCOUNT 117 1 0.2 1 0.2 392 97.3 - SB-INT:LEGAL-FUN-NAME- OR-TYPE-ERROR 118 1 0.2 1 0.2 393 97.5 - MXORLISTP 119 1 0.2 1 0.2 394 97.8 - SB-INT:EQUAL-BUT-NO- CAR-RECURSION 120 1 0.2 1 0.2 395 98.0 - RISPLIT 121 1 0.2 1 0.2 396 98.3 - NTHCDR 122 1 0.2 1 0.2 397 98.5 - REALPART 123 1 0.2 1 0.2 398 98.8 - SB-C:RETURN-MULTIPLE 124 1 0.2 1 0.2 399 99.0 - ZEROP1 125 1 0.2 1 0.2 400 99.3 - (LAMBDA (SB-C::NAME)) 126 1 0.2 1 0.2 401 99.5 - WRITE-STRING 127 1 0.2 1 0.2 402 99.8 - TRUNCATE 128 1 0.2 1 0.2 403 100.0 - SB-KERNEL:VECTOR- DOUBLE-FLOAT-P 129 0 0.0 399 99.0 403 100.0 - SB-INT:SIMPLE-EVAL-IN- LEXENV I stopped at the function which has 0 direct sample in it. The problem is always the same, sampling at 0.01s gives to few samples, and there are very little samples in colnew code. Most samples are inside sbcl or maxima code. It is interesting to look at the column Total. For example if one looks at the line 63 one sees that fsub has just 1 sample directly inside it, but has 152 samples in functions called from fsub (37.7%) that is in functions from maxima which evaluate fsub. Similarly lsyslv in line 37 has 380 samples (94.3 %) of samples in functions called from it, which is not surprising since almost everything in colnew is called from lsyslv. Now look at dgesl, which we know uses a fair amount of time. It doesn't even appear above, it is at line 154: 154 0 0.0 50 12.4 403 100.0 2782 COLNEW::DGESL it has no sample directly in it and 50 samples in functions called from dgesl. What are these functions? Maybe some boxing or unboxing or indexing which appears inside the lisp translation of dgesl. By the way, one can shorten the sampling time, by doing: :lisp(sb-sprof:with-profiling (:max-samples 10000 :sample-interval 0.001 :report :flat :loop nil )#$[iflag, fspace, ispace] : colnew_expert(ncomp, m, aleft, aright, zeta, ipar, ltol, tol, fixpnt, ispace, fspace,0, fsub, dfsub, gsub, dgsub, solutn)$) One gets the more statistically significant result, but which doesn't change much the top scorers (note that daxpy in line 36 has 39 direct samples, but 57 samples from functions called within, what functions?) Number of samples: 6566 Sample interval: 0.001 seconds Total sampling time: 6.566 seconds Number of cycles: 0 Sampled threads: # Self Total Cumul Nr Count % Count % Count % Calls Function ------------------------------------------------------------------------ 1 413 6.3 413 6.3 413 6.3 - SB-EXT:WEAK-POINTER- VALUE 2 328 5.0 889 13.5 741 11.3 - REMOVE-IF 3 319 4.9 319 4.9 1060 16.1 - "foreign function sigprocmask" 4 290 4.4 290 4.4 1350 20.6 - SB-C::COMPACT-INFO- LOOKUP 5 191 2.9 191 2.9 1541 23.5 - SB-VM::ALLOC-SIGNED- BIGNUM-IN-EAX 6 177 2.7 1273 19.4 1718 26.2 - SIMPLIFYA 7 173 2.6 173 2.6 1891 28.8 - SB-IMPL::GET3 8 160 2.4 6507 99.1 2051 31.2 - MEVAL1 9 117 1.8 117 1.8 2168 33.0 - SB-KERNEL:%MEMBER-EQ 10 112 1.7 685 10.4 2280 34.7 - (FLET SB-C::LOOKUP) 11 109 1.7 109 1.7 2389 36.4 - SB-C::VOLATILE-INFO- LOOKUP 12 105 1.6 107 1.6 2494 38.0 - (LABELS SB- IMPL::EQUAL-AUX) 13 97 1.5 220 3.4 2591 39.5 - SB-KERNEL:VALUES- SPECIFIER-TYPE 14 97 1.5 146 2.2 2688 40.9 - ALIKE1 15 95 1.4 95 1.4 2783 42.4 - (LAMBDA (SB- IMPL::VALUE)) 16 76 1.2 2082 31.7 2859 43.5 - MAKE-ARRAY 17 74 1.1 74 1.1 2933 44.7 - SB-IMPL::GET2 18 73 1.1 107 1.6 3006 45.8 5872 COLNEW::APPROX 19 65 1.0 277 4.2 3071 46.8 - SB-KERNEL:SPECIFIER- TYPE 20 64 1.0 175 2.7 3135 47.7 - EQUAL 21 64 1.0 64 1.0 3199 48.7 - KEYWORDP 22 63 1.0 69 1.1 3262 49.7 - LENGTH 23 62 0.9 124 1.9 3324 50.6 - GETL 24 62 0.9 62 0.9 3386 51.6 - SB-C::GET-INFO-VALUE 25 60 0.9 60 0.9 3446 52.5 - SB-KERNEL:CSUBTYPEP 26 55 0.8 120 1.8 3501 53.3 - SB-VM::GENERIC-+ 27 54 0.8 269 4.1 3555 54.1 - SUBTYPEP 28 53 0.8 53 0.8 3608 54.9 - BADFUNCHK 29 52 0.8 63 1.0 3660 55.7 - SB-C::FIND-TYPE-INFO 30 46 0.7 74 1.1 3706 56.4 - ARRAY-ELEMENT-TYPE 31 46 0.7 59 0.9 3752 57.1 - DELETE 32 43 0.7 148 2.3 3795 57.8 - PLS 33 43 0.7 43 0.7 3838 58.5 - (LABELS SB- IMPL::SXHASH-RECURSE) 34 42 0.6 230 3.5 3880 59.1 - TIMESIN 35 41 0.6 6112 93.1 3921 59.7 74 COLNEW::LSYSLV 36 39 0.6 57 0.9 3960 60.3 52818 COLNEW::DAXPY 37 38 0.6 2206 33.6 3998 60.9 1584 COLNEW::VWBLOK 38 38 0.6 1685 25.7 4036 61.5 - MEVALARGS 39 37 0.6 799 12.2 4073 62.0 - SUBST1 40 37 0.6 37 0.6 4110 62.6 - MNUMP 41 36 0.5 92 1.4 4146 63.1 - ALIKE 42 36 0.5 55 0.8 4182 63.7 - ZEROP1 43 35 0.5 417 6.4 4217 64.2 - SIMPTIMES 44 35 0.5 35 0.5 4252 64.8 - SXHASH 45 34 0.5 356 5.4 4286 65.3 - MSET 46 33 0.5 216 3.3 4319 65.8 - SB-C::TYPE-INFO-OR- LOSE 47 32 0.5 36 0.5 4351 66.3 - SB-KERNEL:%WITH-ARRAY- DATA 48 32 0.5 32 0.5 4383 66.8 - SB-INT:EQUAL-BUT-NO- CAR-RECURSION 49 31 0.5 243 3.7 4414 67.2 - SB-INT:INFO 50 31 0.5 83 1.3 4445 67.7 - SB-C::CLASS-INFO-OR- LOSE 51 31 0.5 58 0.9 4476 68.2 - SB-IMPL::BACKQ-LIST 52 30 0.5 48 0.7 4506 68.6 - EQTEST 53 28 0.4 54 0.8 4534 69.1 - RISPLIT 54 28 0.4 28 0.4 4562 69.5 - AT-SUBSTP 55 27 0.4 473 7.2 4589 69.9 - SB-KERNEL:FDEFINITION- OBJECT 56 27 0.4 27 0.4 4616 70.3 - $BFLOATP 57 26 0.4 27 0.4 4642 70.7 - SB-KERNEL:TWO-ARG-= 58 24 0.4 307 4.7 4666 71.1 - TMS 59 24 0.4 39 0.6 4690 71.4 - SB-INT:LEGAL-FUN-NAME- OR-TYPE-ERROR 60 23 0.4 711 10.8 4713 71.8 2782 COLNEW::DGESL 61 23 0.4 326 5.0 4736 72.1 - MBIND-DOIT 62 23 0.4 216 3.3 4759 72.5 - SIMPLUS 63 23 0.4 37 0.6 4782 72.8 - SB-KERNEL:TWO-ARG-+ 64 23 0.4 23 0.4 4805 73.2 - F2CL-LIB::FIND-ARRAY- DATA 65 22 0.3 450 6.9 4827 73.5 - MACRO-FUNCTION 66 22 0.3 45 0.7 4849 73.9 - REDUCE 67 21 0.3 105 1.6 4870 74.2 - SIMPARGS 68 21 0.3 24 0.4 4891 74.5 - GETCHARN 69 20 0.3 166 2.5 4911 74.8 - SB-KERNEL:%COERCE- CALLABLE-TO-FUN 70 20 0.3 78 1.2 4931 75.1 - MEVAL2 71 20 0.3 73 1.1 4951 75.4 - TIMESK 72 20 0.3 23 0.4 4971 75.7 - SB-BIGNUM:BIGNUM- TRUNCATE 73 20 0.3 20 0.3 4991 76.0 - SB-KERNEL:VECTOR- DOUBLE-FLOAT-P 74 19 0.3 573 8.7 5010 76.3 - GETL-LM-FCN-PROP 75 19 0.3 19 0.3 5029 76.6 - SPECREPP 76 19 0.3 19 0.3 5048 76.9 - SB-KERNEL:TYPE- SPECIFIER 77 19 0.3 19 0.3 5067 77.2 - TRUNCATE 78 18 0.3 6507 99.1 5085 77.4 - MEVAL 79 18 0.3 209 3.2 5103 77.7 1594 COLNEW::GBLOCK 80 17 0.3 1306 19.9 5120 78.0 - (FLET SB-IMPL::PURGE) 81 17 0.3 250 3.8 5137 78.2 - (LAMBDA (SB-C::NAME)) 82 17 0.3 139 2.1 5154 78.5 - COMMON-LISP:MAKUNBOUND 83 17 0.3 106 1.6 5171 78.8 - SIMPEXPT 84 17 0.3 73 1.1 5188 79.0 - SAFE-MGET 85 17 0.3 31 0.5 5205 79.3 - SB-KERNEL::%%TYPEP 86 16 0.2 3307 50.4 5221 79.5 - MLAMBDA 87 16 0.2 236 3.6 5237 79.8 - UPGRADED-ARRAY- ELEMENT-TYPE 88 16 0.2 61 0.9 5253 80.0 - PLUSIN 89 16 0.2 26 0.4 5269 80.2 - SB-KERNEL::NUMBER- UNPARSE-TYPE-METHOD 90 16 0.2 16 0.2 5285 80.5 - MTIMESP 91 15 0.2 1325 20.2 5300 80.7 - SB-IMPL::%SAVE- DISPLACED-ARRAY-BACKPOINTER 92 15 0.2 30 0.5 5315 80.9 - EXPT 93 15 0.2 21 0.3 5330 81.2 396 COLNEW::FACTRB Running :lisp(disassemble 'colnew::daxpy) i have looked where are these samples for functions called from daxpy. Apparently in functions like ALLOC-SIGNED-BIGNUM-IN-ECX ALLOC-SIGNED-BIGNUM-IN-EDI and similar. Is this boxing and unboxing? Looking similarly in the disassembly of dgesl, i see call to daxpy (normal) but also fair number of calls to # so calls inside lisp, and ALLOCS like above in great number. -- Michel Talon From adammaj1 at o2.pl Wed Sep 21 14:16:47 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Wed, 21 Sep 2011 19:16:47 +0000 (UTC) Subject: [Maxima] list order / draw-points joined References: <4E698715.2090802@telefonica.net> <4E6D4BA6.7070606@telefonica.net> Message-ID: Dnia Wed, 21 Sep 2011 16:03:41 +0100, Rupert Swarbrick napisa?(a): > Adam Majewski writes: >> I have done as make install and : >> >> >> >> (%i4) :lisp (print-directories) >> maxima-prefix=/usr/local >> maxima-imagesdir=/usr/local/lib/maxima/5.25.1/binary-clisp >> maxima-sharedir=/usr/local/share/maxima/5.25.1/share >> maxima-srcdir=/usr/local/share/maxima/5.25.1/src >> maxima-demodir=/usr/local/share/maxima/5.25.1/demo >> maxima-testsdir=/usr/local/share/maxima/5.25.1/tests >> maxima-docdir=/usr/local/share/maxima/5.25.1/doc >> maxima-infodir=/usr/local/share/info >> maxima-htmldir=/usr/local/share/maxima/5.25.1/doc/html >> maxima-plotdir=/usr/local/libexec/maxima/5.25.1 >> maxima-layout-autotools=T >> maxima-userdir=/home/adam/.maxima >> maxima-tempdir=/home/adam >> maxima-lang-subdir=NIL >> maxima-objdir=/home/adam/.maxima/binary/binary-clisp NIL >> >> but : >> (%i2) ? points; >> No exact match found for topic `points'. Try `?? points' (inexact >> match) instead. >> (%o2) false >> (%i3) ?? points; >> (%o3) false > > Hmm, I'm not sure what's going on here. What's supposed to happen is > that Maxima reads in a file called maxima-index.lisp from maxima-infodir > (in your case /usr/local/share/info). adam at adam-laptop:/usr/local/share/info$ ls dir gmp.info gmp.info-1 gmp.info-2 mpc.info mpfr.info Since you aren't getting an error > about that, I presume this worked. Maybe check the file exists and has a > massive defparameter form (my copy is about 2500 lines long). > > To check that this bit has worked, you could do something like the > following. > > - First load up maxima-index.lisp. The easiest way is to type something > like > > (%i*) ? blarglblargl (%i1) ? blarglblargl; Maxima encountered a Lisp error: LOAD: A file with name /usr/local/share/info/maxima-index.lisp does not exist Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. > > or whatever. > > - Now check that *info-deffn-defvr-pairs* has been populated: > > (%i2) :lisp (length cl-info::*info-deffn-defvr-pairs*) (%i2) :lisp (length cl-info::*info-deffn-defvr-pairs*) Maxima encountered a Lisp error: EVAL: variable CL-INFO::*INFO-DEFFN-DEFVR-PAIRS* has no value Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. Adam From rswarbrick at gmail.com Wed Sep 21 20:33:03 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Thu, 22 Sep 2011 02:33:03 +0100 Subject: [Maxima] list order / draw-points joined References: <4E698715.2090802@telefonica.net> <4E6D4BA6.7070606@telefonica.net> Message-ID: Adam Majewski writes: >> - First load up maxima-index.lisp. The easiest way is to type something >> like >> >> (%i*) ? blarglblargl > > (%i1) ? blarglblargl; > Maxima encountered a Lisp error: > LOAD: A file with name /usr/local/share/info/maxima-index.lisp does not > exist > Automatically continuing. > To enable the Lisp debugger set *debugger-hook* to nil. Welp. There's the problem. Probably you need to work out how to install the program properly, including the documentation files, for the documentation system to work... 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 Thu Sep 22 01:03:14 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 22 Sep 2011 00:03:14 -0600 Subject: [Maxima] f90 question In-Reply-To: <4E789372.10808@bk.ru> References: <4E78639C.9030309@bk.ru> <4E789372.10808@bk.ru> Message-ID: >> It's a breach of Fortran's syntax rules, and therefore a bug in Maxima. >> The correct syntax is: >> >> a=third_long_name_variable+second_long_name_variable+first_long_nam& >> &e_variable >> >> You must use the double & form when splitting lexical tokens. You can >> easily fix up Maxima's bug by running a simple awk, Python or Perl >> script to add an & to the start of every line that follows one that is >> terminated with an &. >> >> >> Regards, >> Nick Maclaren. I have changed f90.lisp accordingly. Thanks to Dmitry & Nick for bringing it to our attention. best, Robert Dodier From kcrisman at gmail.com Thu Sep 22 20:26:15 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Thu, 22 Sep 2011 21:26:15 -0400 Subject: [Maxima] Question about radcan Message-ID: We have a question at http://ask.sagemath.org/question/767/simplification-errors-in-simple-expressions which seems to find a bug in radcan. Here is the relevant Maxima session. (%i3) b:((1-x)/sqrt(1-2*x+x^2)); 1 - x (%o3) ------------------ 2 sqrt(x - 2 x + 1) (%i4) radcan(b); (%o4) - 1 which seems a little aggressive. But (%i7) d:((1-x)/sqrt((1-x)^2)); 1 - x (%o7) ---------- abs(x - 1) Radcan's documentation is a little confusing. radicals, by converting it into a form which is canonical over a large class of expressions and a given ordering of variables; that is, all functionally equivalent forms are mapped into a unique form. For a somewhat larger class of expressions, `radcan' doesn't give very many details. But I'm certainly not an expert in making expressions canonical :) Thanks for any help! From piminusmeson at bk.ru Fri Sep 23 01:56:41 2011 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Fri, 23 Sep 2011 10:56:41 +0400 Subject: [Maxima] Question about radcan In-Reply-To: References: Message-ID: <4E7C2DA9.7090301@bk.ru> I found radexpand option variable in the reference manual: > radexpand > Option variable > Default value: true > radexpand controls some simpli?cations of radicals. > When radexpand is all, causes nth roots of factors of a product which > are powers > of n to be pulled outside of the radical. E.g. if radexpand is all, > sqrt (16*x^2) > simpli?es to 4*x. > More particularly, consider sqrt (x^2). > ? If radexpand is all or assume (x > 0) has been executed, sqrt(x^2) > simpli?es > to x. > ? If radexpand is true and domain is real (its default), sqrt(x^2) > simpli?es to > abs(x). > ? If radexpand is false, or radexpand is true and domain is complex, > sqrt(x^2) > is not simpli?ed. > Note that domain only matters when radexpand is true. But it does not work for me(version of maxima is 5.25.1): (%i1) radexpand:true; (%o1) true (%i2) b: ((1-x)/sqrt(1-2*x+x^2)); 1 - x (%o2) ------------------ 2 sqrt(x - 2 x + 1) (%i3) radcan(b); (%o3) - 1 (%i4) radexpand: false; (%o4) false (%i5) radcan(b); (%o5) - 1 any ideas? > We have a question at > http://ask.sagemath.org/question/767/simplification-errors-in-simple-expressions > which seems to find a bug in radcan. Here is the relevant Maxima > session. > > > (%i3) b:((1-x)/sqrt(1-2*x+x^2)); > 1 - x > (%o3) ------------------ > 2 > sqrt(x - 2 x + 1) > (%i4) radcan(b); > (%o4) - 1 > > which seems a little aggressive. But > > (%i7) d:((1-x)/sqrt((1-x)^2)); > 1 - x > (%o7) ---------- > abs(x - 1) > > > Radcan's documentation is a little confusing. > > radicals, by converting it into a form which is canonical over a > large class of expressions and a given ordering of variables; that > is, all functionally equivalent forms are mapped into a unique > form. For a somewhat larger class of expressions, `radcan' > > doesn't give very many details. But I'm certainly not an expert in > making expressions canonical :) > > Thanks for any help! > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > > From macrakis at gmail.com Fri Sep 23 06:00:00 2011 From: macrakis at gmail.com (Stavros Macrakis) Date: Fri, 23 Sep 2011 07:00:00 -0400 Subject: [Maxima] Question about radcan In-Reply-To: <4E7C2DA9.7090301@bk.ru> References: <4E7C2DA9.7090301@bk.ru> Message-ID: factor(b) On Sep 23, 2011 2:56 AM, "Dmitry Shkirmanov" wrote: > I found radexpand option variable in the reference manual: >> radexpand >> Option variable >> Default value: true >> radexpand controls some simpli?cations of radicals. >> When radexpand is all, causes nth roots of factors of a product which >> are powers >> of n to be pulled outside of the radical. E.g. if radexpand is all, >> sqrt (16*x^2) >> simpli?es to 4*x. >> More particularly, consider sqrt (x^2). >> ? If radexpand is all or assume (x > 0) has been executed, sqrt(x^2) >> simpli?es >> to x. >> ? If radexpand is true and domain is real (its default), sqrt(x^2) >> simpli?es to >> abs(x). >> ? If radexpand is false, or radexpand is true and domain is complex, >> sqrt(x^2) >> is not simpli?ed. >> Note that domain only matters when radexpand is true. > > But it does not work for me(version of maxima is 5.25.1): > > (%i1) radexpand:true; > (%o1) true > (%i2) b: ((1-x)/sqrt(1-2*x+x^2)); > 1 - x > (%o2) ------------------ > 2 > sqrt(x - 2 x + 1) > (%i3) radcan(b); > (%o3) - 1 > (%i4) radexpand: false; > (%o4) false > (%i5) radcan(b); > (%o5) - 1 > > > any ideas? > >> We have a question at >> http://ask.sagemath.org/question/767/simplification-errors-in-simple-expressions >> which seems to find a bug in radcan. Here is the relevant Maxima >> session. >> >> >> (%i3) b:((1-x)/sqrt(1-2*x+x^2)); >> 1 - x >> (%o3) ------------------ >> 2 >> sqrt(x - 2 x + 1) >> (%i4) radcan(b); >> (%o4) - 1 >> >> which seems a little aggressive. But >> >> (%i7) d:((1-x)/sqrt((1-x)^2)); >> 1 - x >> (%o7) ---------- >> abs(x - 1) >> >> >> Radcan's documentation is a little confusing. >> >> radicals, by converting it into a form which is canonical over a >> large class of expressions and a given ordering of variables; that >> is, all functionally equivalent forms are mapped into a unique >> form. For a somewhat larger class of expressions, `radcan' >> >> doesn't give very many details. But I'm certainly not an expert in >> making expressions canonical :) >> >> Thanks for any help! >> _______________________________________________ >> 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 kcrisman at gmail.com Fri Sep 23 07:55:23 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Fri, 23 Sep 2011 08:55:23 -0400 Subject: [Maxima] Question about radcan In-Reply-To: <4E7C1767.9020002@eecs.berkeley.edu> References: <4E7C1767.9020002@eecs.berkeley.edu> Message-ID: > factor(b) But of course the idea is not how to make it happen, but rather what the default behavior is. On Sep 23, 2011 2:56 AM, "Dmitry Shkirmanov" wrote: > I found radexpand option variable in the reference manual: >> radexpand >> Option variable >> Default value: true >> radexpand controls some simpli?cations of radicals. >> When radexpand is all, causes nth roots of factors of a product which >> are powers >> of n to be pulled outside of the radical. E.g. if radexpand is all, >> sqrt (16*x^2) >> simpli?es to 4*x. >> More particularly, consider sqrt (x^2). >> ? If radexpand is all or assume (x > 0) has been executed, sqrt(x^2) >> simpli?es >> to x. >> ? If radexpand is true and domain is real (its default), sqrt(x^2) >> simpli?es to >> abs(x). >> ? If radexpand is false, or radexpand is true and domain is complex, >> sqrt(x^2) >> is not simpli?ed. >> Note that domain only matters when radexpand is true. > > But it does not work for me(version of maxima is 5.25.1): > > (%i1) radexpand:true; > (%o1) true > (%i2) b: ((1-x)/sqrt(1-2*x+x^2)); > 1 - x > (%o2) ------------------ > 2 > sqrt(x - 2 x + 1) > (%i3) radcan(b); > (%o3) - 1 > (%i4) radexpand: false; > (%o4) false > (%i5) radcan(b); > (%o5) - 1 > maybe the default is now all instead of true? > >> http://ask.sagemath.org/question/767/simplification-errors-in-simple-expressions >> which seems to find a bug in radcan. ?Here is the relevant Maxima >> session. >> >> >> (%i3) b:((1-x)/sqrt(1-2*x+x^2)); >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 - x >> (%o3) ? ? ? ? ? ? ? ? ? ? ? ? ------------------ >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2 >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? sqrt(x ?- 2 x + 1) >> (%i4) radcan(b); >> (%o4) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - 1 >> >> which seems a little aggressive. > > Radcan will consistently choose a branch for the square root. ?It may not be > the one you would choose, but it does so by picking a main variable (here, x > is the only one) and looking at the sign of the leading coefficient. ?If it > is negative, it takes out a factor of sqrt(-1). I see. That should probably be more explicit in the documentation for radcan, then. Or? >> >> (%i7) d:((1-x)/sqrt((1-x)^2)); >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 - x >> (%o7) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ---------- >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? abs(x - 1) > > This of course has nothing to do with radcan, and I personally view this > transformation as a bug. > A correct result for d is a representation of the pair {-1,1}. The answer > above is neither 1, -1, or the pair, but a step function except at x=1 where > it is possibly undefined. Right. So you are saying that (1-x)/abs(x-1) is NOT a function, but purely a symbolic expression which may happen to take on the value 1 or -1? But that is not how most users of Maxima will see it, I think. >> doesn't give very many details. But I'm certainly not an expert in >> making expressions canonical :) > > There's plenty of detail in my PhD dissertation, TR-95, MIT Project MAC. > http://publications.csail.mit.edu/lcs/specpub.php?id=663 Yes, since you *are* an expert. Which reiterates my suggestion that radcan could have a lot more detail in its documentation (and not pointing to a dissertation...) +++ Thanks for all three of your suggestions. From macrakis at alum.mit.edu Fri Sep 23 08:56:36 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 23 Sep 2011 09:56:36 -0400 Subject: [Maxima] Question about radcan In-Reply-To: References: <4E7C1767.9020002@eecs.berkeley.edu> Message-ID: On Fri, Sep 23, 2011 at 08:55, Karl-Dieter Crisman wrote: > > factor(b) > Barton has pointed out that you actually need scanmap(factor,b). > But of course the idea is not how to make it happen, but rather what > the default behavior is. Two issues actually: 1) default value of radexpand 2) how hard general simplification should work in analyzing expressions. Maxima general simplification does not do major reorganizations of expressions, such as factoring. This was a design decision (a long time ago) with two major parts: 1) let the user control the *form* of expression as well as its meaning; 2) don't spend potentially large amounts of time on general simplification. See Joel Moses' Algebraic Simplification: a guide for the perplexed(1971) for background. Since computers are 1000x faster now than when Maxima was designed (though Maxima is not 1000x faster), we might want to revisit (2), but (1) remains an important principle. The following expressions are all mathematically equivalent: (x^2-1)/x^2 (1-1/x)*(1+1/x) 1-1/x^2 (x-1)*(x+1)/x^2 but each form may be more useful to the user in a different content. Of course, general simplification does do some normalization, so it doesn't preserve (x-1)/x * (x+1)/x. Having sqrt(x^2-2*x+1) simplify to abs(x-1) requires finding the square factors of the inner expression, which is more a bigger transformation than general simplification normally does. -s > On Sep 23, 2011 2:56 AM, "Dmitry Shkirmanov" > wrote: > > I found radexpand option variable in the reference manual: > >> radexpand > >> Option variable > >> Default value: true > >> radexpand controls some simpli?cations of radicals. > >> When radexpand is all, causes nth roots of factors of a product which > >> are powers > >> of n to be pulled outside of the radical. E.g. if radexpand is all, > >> sqrt (16*x^2) > >> simpli?es to 4*x. > >> More particularly, consider sqrt (x^2). > >> ? If radexpand is all or assume (x > 0) has been executed, sqrt(x^2) > >> simpli?es > >> to x. > >> ? If radexpand is true and domain is real (its default), sqrt(x^2) > >> simpli?es to > >> abs(x). > >> ? If radexpand is false, or radexpand is true and domain is complex, > >> sqrt(x^2) > >> is not simpli?ed. > >> Note that domain only matters when radexpand is true. > > > > But it does not work for me(version of maxima is 5.25.1): > > > > (%i1) radexpand:true; > > (%o1) true > > (%i2) b: ((1-x)/sqrt(1-2*x+x^2)); > > 1 - x > > (%o2) ------------------ > > 2 > > sqrt(x - 2 x + 1) > > (%i3) radcan(b); > > (%o3) - 1 > > (%i4) radexpand: false; > > (%o4) false > > (%i5) radcan(b); > > (%o5) - 1 > > > > maybe the default is now all instead of true? > > > > > > > > >> > http://ask.sagemath.org/question/767/simplification-errors-in-simple-expressions > >> which seems to find a bug in radcan. Here is the relevant Maxima > >> session. > >> > >> > >> (%i3) b:((1-x)/sqrt(1-2*x+x^2)); > >> 1 - x > >> (%o3) ------------------ > >> 2 > >> sqrt(x - 2 x + 1) > >> (%i4) radcan(b); > >> (%o4) - 1 > >> > >> which seems a little aggressive. > > > > Radcan will consistently choose a branch for the square root. It may not > be > > the one you would choose, but it does so by picking a main variable > (here, x > > is the only one) and looking at the sign of the leading coefficient. If > it > > is negative, it takes out a factor of sqrt(-1). > > > I see. That should probably be more explicit in the documentation for > radcan, then. Or? > > > >> > >> (%i7) d:((1-x)/sqrt((1-x)^2)); > >> 1 - x > >> (%o7) ---------- > >> abs(x - 1) > > > > This of course has nothing to do with radcan, and I personally view this > > transformation as a bug. > > A correct result for d is a representation of the pair {-1,1}. The answer > > above is neither 1, -1, or the pair, but a step function except at x=1 > where > > it is possibly undefined. > > Right. So you are saying that (1-x)/abs(x-1) is NOT a function, but > purely a symbolic expression which may happen to take on the value 1 > or -1? But that is not how most users of Maxima will see it, I think. > > >> doesn't give very many details. But I'm certainly not an expert in > >> making expressions canonical :) > > > > There's plenty of detail in my PhD dissertation, TR-95, MIT Project MAC. > > http://publications.csail.mit.edu/lcs/specpub.php?id=663 > > Yes, since you *are* an expert. > > Which reiterates my suggestion that radcan could have a lot more > detail in its documentation (and not pointing to a dissertation...) > > +++ > > Thanks for all three of your suggestions. > _______________________________________________ > 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 Fri Sep 23 09:21:56 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 23 Sep 2011 07:21:56 -0700 Subject: [Maxima] Question about radcan In-Reply-To: References: <4E7C1767.9020002@eecs.berkeley.edu> Message-ID: <4E7C9604.20507@eecs.berkeley.edu> On 9/23/2011 5:55 AM, Karl-Dieter Crisman wrote: > Yes, since you *are* an expert. Which reiterates my suggestion that > radcan could have a lot more detail in its documentation (and not > pointing to a dissertation...) +++ Thanks for all three of your > suggestions. Since the treatment of radicals has been (in my view) clouded by others through using assume, domain, radexpand... I can only state what radcan() itself does (which is written above, and I would be happy to see added to the manual if it clarifies things!) Radcan gets blamed for simplifications that happen before and after it gets called, so it is sometimes difficult to debug "bug reports". Especially from Sage, when it is not even evident that it calls radcan! RJF From kcrisman at gmail.com Fri Sep 23 09:36:00 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Fri, 23 Sep 2011 10:36:00 -0400 Subject: [Maxima] Question about radcan In-Reply-To: References: <4E7C1767.9020002@eecs.berkeley.edu> Message-ID: >> But of course the idea is not how to make it happen, but rather what >> the default behavior is. > > Two issues actually: > 1) default value of radexpand > 2) how hard general simplification should work in analyzing expressions. > Maxima general simplification does not do major reorganizations of > expressions, such as factoring. ?This was a ?design decision (a long time > ago) with two major parts: 1) let the user control the *form* of expression > as well as its meaning; 2) don't spend potentially large amounts of time on > general simplification. > See Joel Moses' Algebraic Simplification: a guide for the perplexed (1971) > Having sqrt(x^2-2*x+1) simplify to abs(x-1) requires finding the square > factors of the inner expression, which is more a bigger transformation than > general simplification normally does. Absolutely, and I'm not suggesting it should all the time. I think that the real question was why the answer was -1, when the function (considered as a *function*) is clearly not -1. Which rjf responded to more than adequately. I knew radcan was trouble for Sage at times, but I hadn't seen this one before. Readers of this might also want to see rjf's post [1] on ask.sagemath.org responding to the original post, which among other things discusses why Derive is not a good comparison to Maxima - you can even give him Sage karma by upvoting his answer ;-) [1] http://ask.sagemath.org/question/767/simplification-errors-in-simple-expressions From talon at lpthe.jussieu.fr Fri Sep 23 12:05:23 2011 From: talon at lpthe.jussieu.fr (talon at lpthe.jussieu.fr) Date: Fri, 23 Sep 2011 19:05:23 +0200 Subject: [Maxima] Question about radcan References: <4E7C1767.9020002@eecs.berkeley.edu> Message-ID: Karl-Dieter Crisman wrote: x> Absolutely, and I'm not suggesting it should all the time. I think > that the real question was why the answer was -1, when the function > (considered as a *function*) is clearly not -1. Which rjf responded > to more than adequately. I knew radcan was trouble for Sage at times, > but I hadn't seen this one before. May i add my two cents to the question? As a physicist, i think that the main usefulness of a computer algebra system is to find simplifications and do computations that i cannot do by hand or that need a lot of work. Towards this aim i am very happy if maxima "simplifies" sqrt(x^2-2*x+1) to x-1, and i keep in a corner of my head that there is a sign ambiguity. And i am angry when it omits "obvious" simplifications which render the result completely impossible to exploit, which unfortunately occurs far too often. This means that i don't expect that maxima emphasizes elementary formulas such as sqrt(x^2) = abs(x) which do far more harm than good and are completely false in the complex domain, that is in the place where things are interesting. As you are justly saying a computer algebra system has nothing to do with "functions" in the mathematical sense, and all to do with algebraic manipulations which belong to the realm of algebraic geometry, and as such manipulate "multivalued functions" and such stuff. So at the end, i completely agree with the position of professor Fateman in your Sage forum. Needless to say, this question regularly appears in the maxima mailing list. -- Michel Talon From drdieterkaiser at web.de Fri Sep 23 14:49:37 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 23 Sep 2011 21:49:37 +0200 Subject: [Maxima] References to backslash in Texinfo manual In-Reply-To: <1316550272.1681.4.camel@dieter> References: <1316550272.1681.4.camel@dieter> Message-ID: <1316807377.1541.19.camel@dieter> Am Dienstag, den 20.09.2011, 22:24 +0200 schrieb Dieter Kaiser: > It is necessary to put "backslash" and "\" into one of the indices. > Available indices are @findex for functions and @vindex for variables. > The environments @deffn and @defvr do this automatically, but it is > possible to add any name by hand. > > I will commit it. I think there is something wrong with the reading of info files in Maxima. I have tried several ways to add an entry to the index. It is possible with the commands @findex, @vindex, ... At last I have tried the command @cindex to distinguish the new entry from the existing indices and I have added a second command @synindex cp fn to combine the index cp with the index fn. In all cases I have got correct entries for the html-, pdf-file, and the info-file, when reading it with info, but not when reading the info-file from Maxima. This is the place in section 5.2.1 "Introduction to Strings" I have put in the index entry: @cindex backslash Strings may contain any characters, including embedded tab, newline, and carriage return characters. [...] If I ask for the documentation I get a wrong answer. (%i1) ? backslash ators with respect to radicals to take effect. `ratalgdenom' has an effect only when canonical rational expressions (CRE) are used in algebraic mode. This looks like the problems we have with the German info files, because of wrong offsets. Dieter Kaiser From daniel.dalton47 at gmail.com Fri Sep 23 17:23:32 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Sat, 24 Sep 2011 08:23:32 +1000 Subject: [Maxima] Radians and degrese Message-ID: <20110923222332.GA8200@gwsc.vic.edu.au> Hi, I believe maxima's default mode is radians. Is it possible to change the default mode between degrese and radians? Also, is it possible to convert between the two? Thanks, Dan From toy.raymond at gmail.com Fri Sep 23 17:52:06 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 23 Sep 2011 15:52:06 -0700 Subject: [Maxima] Radians and degrese In-Reply-To: <20110923222332.GA8200@gwsc.vic.edu.au> References: <20110923222332.GA8200@gwsc.vic.edu.au> Message-ID: On Fri, Sep 23, 2011 at 3:23 PM, Daniel Dalton wrote: > Hi, > > I believe maxima's default mode is radians. Is it possible to change the > default mode between degrese and radians? > Not that I know of. But you can always do sind(x) := sin(x*%pi/180); sind(90) -> 1 asind(x) := asin(x)*180/%pi; asind(1/2) -> 30 > > Also, is it possible to convert between the two? > Of course you can define your own functions to do that: r2d(x) := x*180/%pi; d2r(x) := x*%pi/180; Or were you looking for something else? Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Sep 24 15:13:35 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 24 Sep 2011 14:13:35 -0600 Subject: [Maxima] References to backslash in Texinfo manual In-Reply-To: <1316807377.1541.19.camel@dieter> References: <1316550272.1681.4.camel@dieter> <1316807377.1541.19.camel@dieter> Message-ID: On 9/23/11, Dieter Kaiser wrote: > (%i1) ? backslash > > ators with respect to radicals to take effect. > `ratalgdenom' has an effect only when canonical rational > expressions (CRE) are used in algebraic mode. > > This looks like the problems we have with the German info files, because > of wrong offsets. The file offset is incorrect, but it is not a character encoding problem. I've pushed a new version of build_index.pl which, I hope, will handle @cindex items correctly. (There are a lot of assumptions about how .info files are structured; @cindex items didn't fit into the assumptions. I hope it's right now.) Can you please give it a try & let me know how it turns out. best, Robert Dodier From robert.dodier at gmail.com Sat Sep 24 15:28:04 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 24 Sep 2011 14:28:04 -0600 Subject: [Maxima] unexpected behavior of simplify_sum In-Reply-To: <4E6A0935.4030704@gmx.de> References: <4E55034F.9080600@gmx.de> <4E5E3003.8050706@gmx.de> <4E6A0935.4030704@gmx.de> Message-ID: I've created a bug report. https://sourceforge.net/tracker/?func=detail&aid=3413648&group_id=4933&atid=104933 best Robert Dodier From robert.dodier at gmail.com Sat Sep 24 15:47:10 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 24 Sep 2011 14:47:10 -0600 Subject: [Maxima] error function lsquares In-Reply-To: References: Message-ID: > 2. This is wrong: > > M: matrix([1,2],[2,4],[3,9])$ > eq: y = A + B*x$ > i:0$ > lsquares_estimates(M,[y,x],eq,[A,B]); > values; > > apply: no such "matrix" element: [0,1]#0: Hi Ladislav, I have pushed a new version of lsquares.mac which, I think, fixes the problem you noticed. You can get the new version from maxima.git.sourceforge.net (sorry, I don;t have a direct link at hand) or you can apply the patch below. Hope this helps! Robert Dodier PS. Here's the patch: $ git diff share diff --git a/share/contrib/lsquares.mac b/share/contrib/lsquares.mac index 440eaa1..a8346f8 100644 --- a/share/contrib/lsquares.mac +++ b/share/contrib/lsquares.mac @@ -254,7 +254,7 @@ lsquares_mse ('data%, variables, equation) := block (if not atom (data%) then block ([temp : ?gentemp (sconcat ("$M"))], temp :: data%, data% : temp), - makelist ('data% [i, j], j, 1, length (variables)), + makelist ('data% ['i, j], j, 1, length (variables)), map ("=", variables, %%), sublis (%%, (lhs (equation) - rhs (equation))^2), buildq @@ -265,7 +265,7 @@ lsquares_mse ('data%, variables, equation) := block /* Some evaluation gyrations can be avoided by working with an array ... * lsquares_mse_with_array (data%,variables,equation):=block - (makelist(data%[i,j],j,0,length(variables)-1), + (makelist(data%['i,j],j,0,length(variables)-1), map("=",variables,%%), sublis(%%,(lhs(equation)-rhs(equation))^2), buildq([n:array_nrows(data%),summand:%%], From drdieterkaiser at web.de Sun Sep 25 09:31:48 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 25 Sep 2011 16:31:48 +0200 Subject: [Maxima] References to backslash in Texinfo manual In-Reply-To: References: <1316550272.1681.4.camel@dieter> <1316807377.1541.19.camel@dieter> Message-ID: <1316961108.7795.5.camel@dieter> Am Samstag, den 24.09.2011, 14:13 -0600 schrieb Robert Dodier: > On 9/23/11, Dieter Kaiser wrote: > > > (%i1) ? backslash > > > > ators with respect to radicals to take effect. > > `ratalgdenom' has an effect only when canonical rational > > expressions (CRE) are used in algebraic mode. > > > > This looks like the problems we have with the German info files, because > > of wrong offsets. > > The file offset is incorrect, but it is not a character encoding problem. > > I've pushed a new version of build_index.pl which, I hope, > will handle @cindex items correctly. (There are a lot of assumptions > about how .info files are structured; @cindex items didn't fit into the > assumptions. I hope it's right now.) > > Can you please give it a try & let me know how it turns out. It works now. The entries "\" and "backslash" are present in the info-, html- and pdf-file and it is possible to get the documentation with the commands ? and ?? from a Maxima command line. I have checked it for the English and the German version of the manual. I have committed the new entries to the index. Dieter Kaiser From daniel.dalton47 at gmail.com Mon Sep 26 22:29:31 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Tue, 27 Sep 2011 13:29:31 +1000 Subject: [Maxima] Radians and degrese In-Reply-To: References: <20110923222332.GA8200@gwsc.vic.edu.au> Message-ID: <20110927032931.GB29054@gwsc.vic.edu.au> On Fri, Sep 23, 2011 at 03:52:06PM -0700, Raymond Toy wrote: > I believe maxima's default mode is radians. Is it possible to change the > default mode between degrese and radians? > > Not that I know of.? But you can always do > > sind(x) := sin(x*%pi/180); > sind(90) -> 1 > > asind(x) := asin(x)*180/%pi; > asind(1/2) -> 30 > ? > > Also, is it possible to convert between the two? > > Of course you can define your own functions to do that: > > r2d(x) := x*180/%pi; > d2r(x) := x*%pi/180; No, I think that should be sufficient! Thanks very much Dan From fateman at eecs.berkeley.edu Mon Sep 26 23:40:09 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 26 Sep 2011 21:40:09 -0700 Subject: [Maxima] making maxima do chebfuns Message-ID: <4E8153A9.3010306@eecs.berkeley.edu> Chebfuns (google it..) are about Chebyshev approximations to functions, and are fun. You can read about this topic with relationship to Maxima, in a newly revised paper at http://www.cs.berkeley.edu/~fateman/papers/cheby.pdf and all the relevant programs and some irrelevant ones are here: http://www.cs.berkeley.edu/~fateman/cheby Comments, suggestions, questions, etc welcome. (I suspect I emailed to this list about this topic, but an archive search doesn't find it... Anyway the paper is a little cleaner now, as are the programs. ) RJF From willisb at unk.edu Thu Sep 29 07:14:02 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 29 Sep 2011 07:14:02 -0500 Subject: [Maxima] derivatives of generalized Lambert In-Reply-To: <1316961108.7795.5.camel@dieter> References: <1316961108.7795.5.camel@dieter>, <1316550272.1681.4.camel@dieter> <1316807377.1541.19.camel@dieter> Message-ID: I was thinking about the options for the derivative of the generalized Lambert function with respect to the first argument. Possibilities: (1) signal an error, (2) return an 'at' nounform, (3) give the function a silly name and hope that nobody asks for the derivative of that function. Scheme (1) is honest and pretty easy to do with a simplifying error. One not so nice thing about this method is that internally Maxima doesn't expect diff to signal an error, so things such as integrate(generalized_lambert_w(k,x),k) signals an error about the derivative of the generalized Lambert, instead of returning an integrate nounform. Code for scheme 1: ;;; A derivative of the generalized Lambert function with respect to the first argument signals an error. ;;; To do this, we need a simplifying error function: (defun simp-serror (x y z) "A simplifying error function." (declare (ignore y)) (merror (simpcheck (second x) z))) (setf (get 'serror 'operators) #'simp-serror) ;;; Derivative of generalized_lambert_w. This code is adapted from specfun.lisp (defprop %generalized_lambert_w ((k x) ((serror) "Maxima doesn't know the derivative of generalized_lambert_w with respect to the first argument.") ((mtimes) ((mexpt) $%e ((mtimes) -1 ((%generalized_lambert_w) k x))) ((mexpt) ((mplus) 1 ((%generalized_lambert_w) k x)) -1))) grad) Scheme (2) is a bit weird, but maybe it's not wrong: (defprop %generalized_lambert_w ((k x) ((mprog) ((mlist) ((msetq) kk (($gensym))) ((msetq) xx (($gensym)))) ((%at) ((%derivative) ((%generalized_lambert_w) kk xx) kk 1) ((mlist) ((mequal) kk k) ((mequal) xx x)))) ((mtimes) ((mexpt) $%e ((mtimes) -1 ((%generalized_lambert_w) k x))) ((mexpt) ((mplus) 1 ((%generalized_lambert_w) k x)) -1))) grad) (%i13) diff(%,k); (%o13) block([kk:gensym(),xx:gensym()],at('diff(generalized_lambert_w(kk,xx),kk,1),[kk=k,xx=x])) (%i14) ev(%,at); (%o14) at('diff(generalized_lambert_w(g34265,g34266),g34265,1),[g34265=k,g34266=x]) (%i15) ev(%,diff); (%o15) at(block([kk:gensym(),xx:gensym()],at('diff(generalized_lambert_w(kk,xx),kk,1),[kk=g34265,xx=g34266])),[g34265=k,g34266=x]) Scheme (3) isn't a serious option (name the function abracadabra, maybe). --Barton From dbmaxima at gmail.com Thu Sep 29 08:06:14 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Thu, 29 Sep 2011 23:06:14 +1000 Subject: [Maxima] derivatives of generalized Lambert In-Reply-To: References: <1316961108.7795.5.camel@dieter>, <1316550272.1681.4.camel@dieter> <1316807377.1541.19.camel@dieter> Message-ID: <4E846D46.90802@gmail.com> On 29/09/2011 10:14 PM, Barton Willis wrote: > I was thinking about the options for the derivative of the generalized Lambert function with respect to > the first argument. Possibilities: > > (1) signal an error, > (2) return an 'at' nounform, > (3) give the function a silly name and hope that nobody asks for the derivative of that function. > > Scheme (1) is honest and pretty easy to do with a simplifying error. One not so nice thing about this > method is that internally Maxima doesn't expect diff to signal an error, so things such as > integrate(generalized_lambert_w(k,x),k) signals an error about the derivative of the > generalized Lambert, instead of returning an integrate nounform. Code for scheme 1: > > ;;; A derivative of the generalized Lambert function with respect to the first argument signals an error. > ;;; To do this, we need a simplifying error function: > > (defun simp-serror (x y z) "A simplifying error function." > (declare (ignore y)) > (merror (simpcheck (second x) z))) > > (setf (get 'serror 'operators) #'simp-serror) > > ;;; Derivative of generalized_lambert_w. This code is adapted from specfun.lisp > > (defprop %generalized_lambert_w > ((k x) > ((serror) "Maxima doesn't know the derivative of generalized_lambert_w with respect to the first argument.") > ((mtimes) > ((mexpt) $%e ((mtimes) -1 ((%generalized_lambert_w) k x))) > ((mexpt) ((mplus) 1 ((%generalized_lambert_w) k x)) -1))) > grad) > > Scheme (2) is a bit weird, but maybe it's not wrong: > > (defprop %generalized_lambert_w > ((k x) > ((mprog) > ((mlist) ((msetq) kk (($gensym))) ((msetq) xx (($gensym)))) > ((%at) ((%derivative) ((%generalized_lambert_w) kk xx) kk 1) > ((mlist) ((mequal) kk k) ((mequal) xx x)))) > ((mtimes) > ((mexpt) $%e ((mtimes) -1 ((%generalized_lambert_w) k x))) > ((mexpt) ((mplus) 1 ((%generalized_lambert_w) k x)) -1))) > grad) > > (%i13) diff(%,k); > (%o13) block([kk:gensym(),xx:gensym()],at('diff(generalized_lambert_w(kk,xx),kk,1),[kk=k,xx=x])) > > (%i14) ev(%,at); > (%o14) at('diff(generalized_lambert_w(g34265,g34266),g34265,1),[g34265=k,g34266=x]) > > (%i15) ev(%,diff); > (%o15) at(block([kk:gensym(),xx:gensym()],at('diff(generalized_lambert_w(kk,xx),kk,1),[kk=g34265,xx=g34266])),[g34265=k,g34266=x]) > > Scheme (3) isn't a serious option (name the function abracadabra, maybe). For integrals, you can return a value of nil and this is converted to a noun form. The code for this is in function integrallookups in sin.lisp. Examples of usage for the first arg of Bessel functions are in bessel.lisp. I think the same happens for derivatives. Certainly %inverse_jacobi_nc and %inverse_jacobi_nd in ellipt.lisp are coded that way. (defprop %inverse_jacobi_nc ((x m) ;; Whittaker and Watson, example in 22.122 ;; inverse_jacobi_nc(u,m) = integrate(1/sqrt(t^2-1)/sqrt((1-m)*t^2+m), t, 1, u) ;; -> 1/sqrt(x^2-1)/sqrt((1-m)*x^2+m) ((mtimes) ((mexpt) ((mplus) -1 ((mexpt) x 2)) ((rat) -1 2)) ((mexpt) ((mplus) m ((mtimes) -1 ((mplus) -1 m) ((mexpt) x 2))) ((rat) -1 2))) ;; wrt m ; ((%derivative) ((%inverse_jacobi_nc) x m) m 1) nil) grad) From willisb at unk.edu Thu Sep 29 08:23:03 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 29 Sep 2011 08:23:03 -0500 Subject: [Maxima] derivatives of generalized Lambert In-Reply-To: <4E846D46.90802@gmail.com> References: <4E846D46.90802@gmail.com>, <1316961108.7795.5.camel@dieter>, <1316550272.1681.4.camel@dieter> <1316807377.1541.19.camel@dieter> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >For integrals, you can return a value of nil and this is converted to a >noun form. ?The code for this is in function integrallookups in >sin.lisp. Examples of usage for the first arg of Bessel functions are in >bessel.lisp. >I think the same happens for derivatives. ? Thanks--this works. I knew this trick for integrals, but I didn't know it for derivatives. With this change: (%i20) diff(generalized_lambert_w(k,x),k); (%o20) 'diff(generalized_lambert_w(k,x),k,1) (%i21) integrate(generalized_lambert_w(k,x),k); (%o21) integrate(generalized_lambert_w(k,x),k) And all is well. Again, thanks for the advice. From rich.hennessy at verizon.net Thu Sep 29 13:31:40 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 29 Sep 2011 14:31:40 -0400 Subject: [Maxima] pwdelta, diff_pwdelta Message-ID: <38505EEA322E4B6F9A7693300E2CB20F@RichsLaptop> I have been thinking about renaming pwdelta() and diff_pwdelta() in pw.mac for a while. I was considering diracdelta() and diff_diracdelta() but now I think it would be better to use delta() and diff_delta(). If no one objects I will make the name change shortly. Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Thu Sep 29 13:34:54 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 29 Sep 2011 14:34:54 -0400 Subject: [Maxima] pwdelta, diff_pwdelta Message-ID: <7EA2571A28B34B2681E87E2CEE616D41@RichsLaptop> If anyone knows a good reason not to do this I would like to know. From: Richard Hennessy Sent: Thursday, September 29, 2011 2:31 PM To: Maxima List Subject: pwdelta, diff_pwdelta I have been thinking about renaming pwdelta() and diff_pwdelta() in pw.mac for a while. I was considering diracdelta() and diff_diracdelta() but now I think it would be better to use delta() and diff_delta(). If no one objects I will make the name change shortly. Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdieterkaiser at web.de Thu Sep 29 13:17:23 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 29 Sep 2011 20:17:23 +0200 Subject: [Maxima] derivatives of generalized Lambert In-Reply-To: References: <4E846D46.90802@gmail.com>, <1316961108.7795.5.camel@dieter> , <1316550272.1681.4.camel@dieter> <1316807377.1541.19.camel@dieter> Message-ID: <1317320243.1974.8.camel@dieter> Am Donnerstag, den 29.09.2011, 08:23 -0500 schrieb Barton Willis: > -----maxima-bounces at math.utexas.edu wrote: ----- > >For integrals, you can return a value of nil and this is converted to a > >noun form. The code for this is in function integrallookups in > >sin.lisp. Examples of usage for the first arg of Bessel functions are in > >bessel.lisp. > > >I think the same happens for derivatives. > > Thanks--this works. I knew this trick for integrals, but I didn't know it for > derivatives. With this change: > > (%i20) diff(generalized_lambert_w(k,x),k); > (%o20) 'diff(generalized_lambert_w(k,x),k,1) > > (%i21) integrate(generalized_lambert_w(k,x),k); > (%o21) integrate(generalized_lambert_w(k,x),k) > > And all is well. > > Again, thanks for the advice. The possibility to put NIL on the property list to get the noun form for a derivative is present since revision 12.07.2009 of comm.lisp. I have added the code, because of the wrong derivatives for the psi and li functions, which had noun forms on the property list. The noun form must be generated within the algorithm of the function sdiff. Dieter Kaiser From rswarbrick at gmail.com Thu Sep 29 19:53:16 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 30 Sep 2011 01:53:16 +0100 Subject: [Maxima] pwdelta, diff_pwdelta References: <38505EEA322E4B6F9A7693300E2CB20F@RichsLaptop> Message-ID: "Richard Hennessy" writes: > I have been thinking about renaming pwdelta() and diff_pwdelta() in > pw.mac for a while. I was considering diracdelta() and > diff_diracdelta() but now I think it would be better to use delta() > and diff_delta(). If no one objects I will make the name change > shortly. > > Rich I don't actually use (and, therefore, load) pw.mac myself, so this is not an issue for me, but: "delta" is a pretty generic name. As far as I can tell, this change would mean that any code using your library (or a library that used your library) would be precluded from using "delta" to mean a function. I suspect that delta is the most used greek letter in maths, so you may wish to be cautious about such a change. There's also the question of separating out the mathematical concept (distribution on some domain which, when integrated against a test function, samples at a point) with your specific implementation. For example, it makes sense to talk about Dirac distributions on C, R^n or even more exotic measure spaces. I suspect that specifically flagging the functions as "pwdelta()" and "diff_pwdelta()" makes it clear to a user exactly what the function is able to do. Rupert -------------- 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 Thu Sep 29 20:12:47 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 29 Sep 2011 21:12:47 -0400 Subject: [Maxima] pwdelta, diff_pwdelta In-Reply-To: References: <38505EEA322E4B6F9A7693300E2CB20F@RichsLaptop> Message-ID: Thanks for the feedback, I guess I will leave it alone. Considering that the Greek meaning for delta as a letter in the Greek alphabet could cause problems, I didn't think of that. Rich -----Original Message----- From: Rupert Swarbrick Sent: Thursday, September 29, 2011 8:53 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] pwdelta, diff_pwdelta _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Thu Sep 29 20:23:16 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Thu, 29 Sep 2011 21:23:16 -0400 Subject: [Maxima] pwdelta, diff_pwdelta In-Reply-To: References: <38505EEA322E4B6F9A7693300E2CB20F@RichsLaptop> Message-ID: <5D63DAFC28EC4A9CBCB5C0920D78C5FA@RichsLaptop> And your other points are good too. Thanks, Rich -----Original Message----- From: Richard Hennessy Sent: Thursday, September 29, 2011 9:12 PM To: Rupert Swarbrick ; maxima at math.utexas.edu Subject: Re: [Maxima] pwdelta, diff_pwdelta Thanks for the feedback, I guess I will leave it alone. Considering that the Greek meaning for delta as a letter in the Greek alphabet could cause problems, I didn't think of that. Rich -----Original Message----- From: Rupert Swarbrick Sent: Thursday, September 29, 2011 8:53 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] pwdelta, diff_pwdelta _______________________________________________ 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 wmixon at berry.edu Tue Sep 20 15:12:19 2011 From: wmixon at berry.edu (Mixon, Wilson) Date: Tue, 20 Sep 2011 16:12:19 -0400 Subject: [Maxima] plot_real_part Message-ID: Does draw have a counterpart to plot's plot_real_part? The default for plot_real_part is false, so that plot does not plot the real part of complex numbers. On the other hand, draw does plot them and does so without any warning (as far as I can determine). Thanks. From hawe at chefmail.de Tue Sep 27 14:15:21 2011 From: hawe at chefmail.de (Hans W. Hofmann) Date: Tue, 27 Sep 2011 19:15:21 +0000 (UTC) Subject: [Maxima] =?utf-8?q?pdf=5Fhypergeometric?= Message-ID: Hallo, how to calculate 6/49 Lotto distribution, pdf_hypergeometric? maxima help: what means x,n1,n2,n? got no resonable answer by pdf_hypergeometric HW From willisb at unk.edu Fri Sep 30 05:11:50 2011 From: willisb at unk.edu (Barton Willis) Date: Fri, 30 Sep 2011 05:11:50 -0500 Subject: [Maxima] generalized Lambert In-Reply-To: References: , <1316961108.7795.5.camel@dieter>, <1316550272.1681.4.camel@dieter> <1316807377.1541.19.camel@dieter> Message-ID: My generalized Lambert code doesn't do numerical (binary64 or big float) evaluation. If you are looking for something fun to do, the project is yours. --Barton From kcrisman at gmail.com Fri Sep 30 07:16:52 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Fri, 30 Sep 2011 08:16:52 -0400 Subject: [Maxima] pwdelta, diff_pwdelta Message-ID: Or maybe pwdirac_delta? I agree about the not using delta, and about keeping the pw part. pw.mac looks pretty useful, in fact, so I'm glad this reminded me about it! From biomates at telefonica.net Fri Sep 30 08:41:47 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 30 Sep 2011 09:41:47 -0400 Subject: [Maxima] pdf_hypergeometric In-Reply-To: References: Message-ID: <4E85C71B.1040200@telefonica.net> On 09/27/2011 03:15 PM, Hans W. Hofmann wrote: > Hallo, > > how to calculate 6/49 Lotto distribution, > pdf_hypergeometric? Hallo, (%i10) display2d:false$ (%i11) p: makelist(pdf_hypergeometric(x, 6, 43, 6), x, 0, 6); (%o11) [435461/998844,68757/166474,44075/332948,8815/499422,645/665896, 43/2330636,1/13983816] (%i12) apply("+", p); (%o12) 1 > maxima help: what means x,n1,n2,n? > If you have n1 white balls and n2 red balls in an urn, and n balls is the number of balls drawn from the urn, pdf_hypergeometric(x, n1, n2, n) is the probability for event "x balls are white". -- Mario From biomates at telefonica.net Fri Sep 30 08:48:05 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 30 Sep 2011 09:48:05 -0400 Subject: [Maxima] plot_real_part In-Reply-To: References: Message-ID: <4E85C895.4020402@telefonica.net> On 09/20/2011 04:12 PM, Mixon, Wilson wrote: > Does draw have a counterpart to plot's plot_real_part? The default for plot_real_part is false, so that plot does not plot the real part of complex numbers. On the other hand, draw does plot them and does so without any warning (as far as I can determine). > > Thanks. Hello, This was fixed some days ago. You can download 'draw.lisp' and 'grcommon.lisp' from the repository (maxima/share/draw) and copy them into your local system. http://maxima.git.sourceforge.net/git/gitweb-index.cgi In short, I have added a new option named draw_realpart (true by default). These examples should work: f(x) := sqrt(x2 - 4*x) - x; draw2d( xaxis = true, yaxis = true, draw_realpart = false, explicit(f(x), x, -1, 5), color = red, draw_realpart = true, explicit(f(x)+1,x,-1,5), color = black, draw_realpart = false, explicit(f(x)+2,x,-1,5) ); And: set_draw_defaults(draw_realpart = false); draw2d( xaxis = true, yaxis = true, explicit(f(x), x, -1, 5), color = red, explicit(f(x)+1,x,-1,5), color = black, explicit(f(x)+2,x,-1,5) ); Take into account that this option only works with explicit 2D objects. I'll try to extend the effects to other 2D and 3D objects. Good luck. -- Mario -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Fri Sep 30 17:57:41 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 30 Sep 2011 18:57:41 -0400 Subject: [Maxima] pwdelta, diff_pwdelta In-Reply-To: References: Message-ID: <697396FA985240C4A7B8B088E537818B@RichsLaptop> Thanks. I don't like underscores though. Maybe pwdiracdelta()? Underscores are hard to type. I have carpal tunnel syndrome, so this matters to me. I was wondering if anyone had code based on the name pwdelta(). There have been only a small number of downloads from sourceforge.net. Last time I checked under 350. Rich -----Original Message----- From: Karl-Dieter Crisman Sent: Friday, September 30, 2011 8:16 AM To: maxima at math.utexas.edu Subject: Re: [Maxima] pwdelta, diff_pwdelta Or maybe pwdirac_delta? I agree about the not using delta, and about keeping the pw part. pw.mac looks pretty useful, in fact, so I'm glad this reminded me about it! _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From pcastellvi at gmail.com Sun Oct 2 04:22:06 2011 From: pcastellvi at gmail.com (=?ISO-8859-1?Q?Pere_Castellv=ED?=) Date: Sun, 2 Oct 2011 11:22:06 +0200 Subject: [Maxima] powers Message-ID: Hi all, is there a way to obtain 40*sqrt(2) in this computation? (%i3) 20*sqrt(2)+20*sqrt(2); (%o3) 5*2^(7/2) Thanks in advance Pere From drdieterkaiser at web.de Sun Oct 2 11:05:58 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 02 Oct 2011 18:05:58 +0200 Subject: [Maxima] Documentation for eval_when Message-ID: <1317571559.1654.16.camel@dieter> Because of a bug report, I have figured out the functionality of the Maxima function eval_when. I have written a documentation in German. Perhaps, someone can help to translate this documentation in the English language. At this time, there is a lot of additionally information in the German manual, which could be translated in English. I would appreciate any help to translate more documentation. If someone is interested to help; the German manual is available at http://crategus.users.sourceforge.net/maxima.html This is the documentation for the function eval_when in German: -- Funktion: eval_when (, , ..., ) -- Funktion: eval_when ([, , ...], , ..., ) Ein Ausdruck mit der Funktion `eval_when' wird an oberster Stelle in einer Datei definiert und erlaubt die bedingte Auswertung von Ausdr?cken beim Laden, ?bersetzen oder Kompilieren einer Datei. Das Argument ist eines der Schl?sselworte `batch', `translate', `compile' oder `loadfile'. Das erste Argument kann ein einzelnes Schl?sselwort oder ein Liste mit mehreren Schl?sselworten sein. Trifft die mit dem Schl?sselwort angegebene Bedingung zu, wird eine oder mehrere der folgenden Aktionen ausgef?hrt: `batch' Wird die Datei mit einer der Funktionen `load', `batch', `batchload' oder `demo' geladen und ist `batch' in der Liste der Schl?sselworte enthalten, dann werden die Ausdr?cke , ..., genau einmal beim Laden der Datei ausgewertet. Die R?ckgabe der Funktion `eval_when' ist ein Ausdruck `evaluated_when(', wobei das Ergebnis der Auswertung ist. Ist das Schl?sselwort `batch' nicht vorhanden, ist die R?ckgabe das Symbol `not_evaluated_when'. `translate' Wird die Datei mit dem Kommando `translate_file' oder `compile_file' geladen und ist `translate' unter den Schl?sselworten, dann werden die Ausdr?cke , ..., sofort ausgewertet. Seiteneffekte wie Zuweisungen von Werten an Optionsvariablen oder Deklarationen sind f?r die folgende ?bersetzung der Datei nach Lisp wirksam. Die Ausdr?cke sind jedoch nicht Teil des ?bersetzten Programms. `loadfile' Wird die Datei mit dem Kommando `translate_file' oder dem Kommando `compile_file' geladen und ist `loadfile' unter den Schl?sselworten, dann werden die Ausdr?cke , ..., nach Lisp ?bersetzt und als Block der Form `(PROGN EXPR_1 ... EXPR_N)' in das Lisp Programm eingesetzt. Hier sind die Anweisungen die nach Lisp ?bersetzten Maxima-Ausdr?cke . `compile' Wird die Datei mit dem Kommando `translate_file' oder `compile_file' geladen und ist `compile' unter den Schl?sselworten, dann werden die Ausdr?cke , ..., nach Lisp ?bersetzt und als eine Lisp-Anweisung in das Lisp-Programm eingesetzt, die die Form `(EVAL-WHEN (:COMPILE-TOPLEVEL) (EXPR_1 ... EXPR_N))' hat. Das Schl?sselwort `compile' kann nicht mit dem Schl?sselwort `loadfile' in einem `eval_when'-Ausdruck kombiniert werden. In diesem Fall wird das Schl?sselwort `compile' ignoriert. Beispiele: F?r die folgende Beispiele ist eine Datei mit den Namen `eval_when.mac' definiert, die verschiedene `eval_when'-Anweisungen enth?lt. (%i1) file: file_search("eval_when.mac"); (%o1) /home/dieter/.maxima/eval_when.mac (%i2) printfile(file); eval_when(batch, print("called in mode BATCH")); eval_when(loadfile, print("called in mode LOADFILE")); eval_when(compile, print("called in mode COMPILE")); eval_when(translate, print("called in mode TRANSLATE")); (%o2) /home/dieter/.maxima/eval_when.mac Die Datei wird mit dem Kommando `load' geladen. Die Anweisung mit dem Schl?sselwort `batch' wird beim Laden einmal ausgef?hrt. (%i1) file: file_search("eval_when.mac"); (%o1) /home/dieter/.maxima/eval_when.mac (%i2) load(file); called in mode BATCH (%o2) /home/dieter/.maxima/eval_when.mac In diesem Fall wird die Datei mit dem Befehl `batch' geladen. Die Anweisung mit dem Schl?sselwort `batch' wird einmal ausgef?hrt. Die anderen `eval_when'-Anweisungen werten jeweils zum Ergebnis `not_evaluated_when' aus. (%i3) batch(file); read and interpret file: /home/dieter/.maxima/eval_when.mac (%i4) eval_when(batch, print(called in mode BATCH)) called in mode BATCH (%o4) evaluated_when(called in mode BATCH) (%i5) eval_when(loadfile, print(called in mode LOADFILE)) (%o5) not_evaluated_when (%i6) eval_when(compile, print(called in mode COMPILE)) (%o6) not_evaluated_when (%i7) eval_when(translate, print(called in mode TRANSLATE)) (%o7) not_evaluated_when (%o7) /home/dieter/.maxima/eval_when.mac Jetzt wird die Datei mit dem Kommando `translate_file' geladen und nach Lisp ?bersetzt. Der Ausdruck mit dem Schl?sselwort `translate' wird sofort ausgewertet. Das ?bersetzte Programm wird in die Ausgabedatei `eval_when.LISP' geschrieben. Die `eval_when'-Anweisung zum Schl?sselwort wird nicht ausgewertet. (%i1) file: file_search("eval_when.mac"); (%o1) /home/dieter/.maxima/eval_when.mac (%i2) translate_file(file); translator: begin translating /home/dieter/.maxima/eval_when.mac. called in mode TRANSLATE (%o2) [/home/dieter/.maxima/eval_when.mac, /home/dieter/.maxima/eval_when.LISP, /home/dieter/.maxima/eval_when.UNLISP] Dies ist der Inhalt der Ausgabedatei `eval_when.LISP'. Die Ausgabedatei enth?lt eine `PROGN'-Anweisung mit dem Ausdruck `($print '"called in mode LOADFILE")' f?r den `eval_when'-Ausdruck zum Schl?sselwort `loadfile' sowie eine `EVAL-WHEN'-Anweisung mit dem Ausdruck `($print '"called in mode COMPILE")' f?r den `eval_when'-Ausdruck mit dem Schl?sselwort `compile'. ;;; -*- Mode: Lisp; package:maxima; syntax:common-lisp ;Base: 10 -*- ;;; ;;; Translated on: 2011-10-02 13:35:37+02:00 ;;; Maxima version: 5.25post ;;; Lisp implementation: SBCL ;;; Lisp version: 1.0.45 (in-package :maxima) [...] nil (progn ($print '"called in mode LOADFILE")) (eval-when (:compile-toplevel) ($print '"called in mode COMPILE")) nil From hawe at chefmail.de Fri Sep 30 10:00:16 2011 From: hawe at chefmail.de (Hans W. Hofmann) Date: Fri, 30 Sep 2011 15:00:16 +0000 (UTC) Subject: [Maxima] =?utf-8?q?pdf=5Fhypergeometric?= References: <4E85C71B.1040200@telefonica.net> Message-ID: Mario Rodriguez telefonica.net> writes: Hi Mario, > If you have n1 white balls and n2 red balls in an urn, and n balls is > the number of balls drawn from the urn, pdf_hypergeometric(x, n1, n2, n) > is the probability for event "x balls are white". > > -- thank you I tried some combinations, but get always nonsense or errors. Help text ist not realy a help? From rich.hennessy at verizon.net Sun Oct 2 12:21:38 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sun, 02 Oct 2011 13:21:38 -0400 Subject: [Maxima] pwdelta, diff_pwdelta In-Reply-To: <697396FA985240C4A7B8B088E537818B@RichsLaptop> References: <697396FA985240C4A7B8B088E537818B@RichsLaptop> Message-ID: <7B7F22C6D15840C993F299419D85C5F5@RichsLaptop> List, I am not going to change the name. I named it with the pw prefix so as to not confuse people into thinking that this was _the_ diracdelta() function. It turns out it is mostly, but not a complete implementation of it. So pwdelta() is okay. Sorry about the noise but this has been bothering me for a long time. Rich -----Original Message----- From: Richard Hennessy Sent: Friday, September 30, 2011 6:57 PM To: Karl-Dieter Crisman ; maxima at math.utexas.edu Subject: Re: [Maxima] pwdelta, diff_pwdelta Thanks. I don't like underscores though. Maybe pwdiracdelta()? Underscores are hard to type. I have carpal tunnel syndrome, so this matters to me. I was wondering if anyone had code based on the name pwdelta(). There have been only a small number of downloads from sourceforge.net. Last time I checked under 350. Rich -----Original Message----- From: Karl-Dieter Crisman Sent: Friday, September 30, 2011 8:16 AM To: maxima at math.utexas.edu Subject: Re: [Maxima] pwdelta, diff_pwdelta Or maybe pwdirac_delta? I agree about the not using delta, and about keeping the pw part. pw.mac looks pretty useful, in fact, so I'm glad this reminded me about it! _______________________________________________ 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 Sun Oct 2 12:25:25 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sun, 02 Oct 2011 18:25:25 +0100 Subject: [Maxima] Documentation for eval_when References: <1317571559.1654.16.camel@dieter> Message-ID: Dieter Kaiser writes: > Because of a bug report, I have figured out the functionality of the > Maxima function eval_when. I have written a documentation in German. > Perhaps, someone can help to translate this documentation in the English > language. > > At this time, there is a lot of additionally information in the German > manual, which could be translated in English. I would appreciate any > help to translate more documentation. If someone is interested to help; > the German manual is available at > http://crategus.users.sourceforge.net/maxima.html Do you mean just for the eval_when function or in the manual in general? If the latter, do you have a list of places to look for it. I'd happily translate some. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From drdieterkaiser at web.de Sun Oct 2 13:14:05 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 02 Oct 2011 20:14:05 +0200 Subject: [Maxima] Documentation for eval_when In-Reply-To: References: <1317571559.1654.16.camel@dieter> Message-ID: <1317579246.1654.35.camel@dieter> Am Sonntag, den 02.10.2011, 18:25 +0100 schrieb Rupert Swarbrick: > Dieter Kaiser writes: > > Because of a bug report, I have figured out the functionality of the > > Maxima function eval_when. I have written a documentation in German. > > Perhaps, someone can help to translate this documentation in the English > > language. > > > > At this time, there is a lot of additionally information in the German > > manual, which could be translated in English. I would appreciate any > > help to translate more documentation. If someone is interested to help; > > the German manual is available at > > http://crategus.users.sourceforge.net/maxima.html > > Do you mean just for the eval_when function or in the manual in general? > If the latter, do you have a list of places to look for it. I'd happily > translate some. Thank you very much for your offering. It is really a lot of work for me to translate a text to English and the text is not as good as it could be. Yes, there are a lot of places, which could be translated in English to extend the documentation of the English manual. A starting point might be the chapter about mathematical functions. This is an example of the English Manual: ---------------------------------------------- Function: abs (expr) Returns the absolute value expr. If expr is complex, returns the complex modulus of expr. abs distributes over a list, a matrix, or an equation. See distribute_over. ---------------------------------------------- And this is the German documentation: ---------------------------------------------- Funktion: abs (z) Die Funktion abs ist die Betragsfunktion und f?r das numerische und symbolische Rechnen geeignet. Ist das Argument z eine reelle oder komplexe Zahl wird der Betrag berechnet. Wenn m?glich werden allgemeine Ausdr?cke mit der Betragsfunktion vereinfacht. Maxima kann Ausdr?cke mit der Betragsfunktion integrieren und ableiten sowie Grenzwerte von Ausdr?cken mit der Betragsfunktion ermitteln. Das Paket abs_integrate erweitert Maximas M?glichkeiten, Integrale mit der Betragsfunktion zu l?sen. Die Betragsfunktion wird automatisch auf die Elemente von Listen und Matrizen sowie auf die beiden Seiten von Gleichungen angewendet. Siehe distribute_over. Siehe die Funktion cabs, um den Betrag eines komplexen Ausdrucks oder einer Funktion zu berechnen. Beispiele: Berechnung des Betrages f?r reelle und komplexen Zahlen sowie numerische Konstanten und unendliche Gr??en. Das erste Beispiel zeigt, wie die Betragsfunktion von Maxima auf die Elemente einer Liste angewendet wird. (%i1) abs([-4, 0, 1, 1+%i]); (%o1) [4, 0, 1, sqrt(2)] (%i2) abs((1+%i)*(1-%i)); (%o2) 2 (%i3) abs(%e+%i); 2 (%o3) sqrt(%e + 1) (%i4) abs([inf, infinity, minf]); (%o4) [inf, inf, inf] Vereinfachung von Ausdr?cken mit der Betragsfunktion. (%i5) abs(x^2); 2 (%o5) x (%i6) abs(x^3); 2 (%o6) x abs(x) (%i7) abs(abs(x)); (%o7) abs(x) (%i8) abs(conjugate(x)); (%o8) abs(x) Ableitung und Integrale mit der Betragsfunktion. Wird das Paket abs_integrate geladen, k?nnen weitere Integrale mit der Betragsfunktion gel?st werden. Das letzte Beispiel zeigt die Laplacetransformation der Betragsfunktion. Siehe laplace. (%i9) diff(x*abs(x),x),expand; (%o9) 2 abs(x) (%i10) integrate(abs(x),x); x abs(x) (%o10) -------- 2 (%i11) integrate(x*abs(x),x); / [ (%o11) I x abs(x) dx ] / (%i12) load(abs_integrate)$ (%i13) integrate(x*abs(x),x); 2 3 x abs(x) x signum(x) (%o13) --------- - ------------ 2 6 (%i14) integrate(abs(x),x,-2,%pi); 2 %pi (%o14) ---- + 2 2 (%i15) laplace(abs(x),x,s); 1 (%o15) -- 2 s ---------------------------------------------- This is the English documentation for cabs: ---------------------------------------------- Function: cabs (expr) Returns the complex absolute value (the complex modulus) of expr. ---------------------------------------------- And this is the documentation in German: ---------------------------------------------- Funktion: cabs (expr) Berechnet den Betrag eines komplexen Ausdrucks expr. Im Unterschied zu der Funktion abs, zerlegt die Funktion cabs einen komplexen Ausdruck immer in einen Realteil und Imagin?rteil, um den komplexen Betrag zu berechnen. Sind x und y zwei reelle Variablen oder Ausdr?cke berechnet die Funktion cabs den Betrag des komplexen Ausdrucks x + %i*y als: 2 2 sqrt(y + x ) Die Funktion cabs nutzt Symmetrieeigenschaften und implementierte Eigenschaften komplexer Funktionen, um den Betrag eines Ausdrucks zu berechnen. Sind solche Eigenschaften f?r eine Funktion vorhanden, k?nnen diese mit der Funktion properties angezeigt werden. Eigenschaften, die das Ergebnis der Funktion cabs bestimmen, sind: mirror symmetry, conjugate function und complex characteristic. cabs ist eine Verbfunktion, die nicht f?r das symbolische Rechnen geeignet ist. F?r das symbolische Rechnen wie der Integration oder der Ableitung von Ausdr?cken mit der Betragsfunktion muss die Funktion abs verwendet werden. Das Ergebnis der Funktion cabs kann die Betragsfunktion abs und den Arkustangens atan2 enthalten. cabs wird automatisch auf die Elemente von Listen und Matrizen sowie auf die beiden Seiten von Gleichungen angewendet. Siehe auch die Funktionen rectform, realpart, imagpart, carg, conjugate und polarform f?r das Rechnen mit komplexen Zahlen. Beispiele: Zwei Beispiele mit der Wurzelfunktion sqrt und der Sinusfunktion sin. (%i1) cabs(sqrt(1+%i*x)); 2 1/4 (%o1) (x + 1) (%i2) cabs(sin(x+%i*y)); 2 2 2 2 (%o2) sqrt(cos (x) sinh (y) + sin (x) cosh (y)) Die Funktion erf hat Spiegelsymmetrie, die hier f?r die Berechnung des komplexen Betrages angewendet wird. (%i3) cabs(erf(x+%i*y)); 2 (erf(%i y + x) - erf(%i y - x)) (%o3) sqrt(-------------------------------- 4 2 (erf(%i y + x) + erf(%i y - x)) - --------------------------------) 4 Maxima kennt komplexe Eigenschaften der Besselfunktionen, um den komplexen Betrag zu vereinfachen. Dies ist ein Beispiel f?r die Besselfunktion bessel_j. (%i4) cabs(bessel_j(1,%i)); (%o4) abs(bessel_j(1, %i)) ---------------------------------------------- Dieter Kaiser From pbowyer at olynet.com Sun Oct 2 14:30:11 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Sun, 02 Oct 2011 12:30:11 -0700 Subject: [Maxima] Fwd: Re: Documentation for eval_when In-Reply-To: <4E88BB5E.3000907@olynet.com> References: <4E88BB5E.3000907@olynet.com> Message-ID: <4E88BBC3.6060303@olynet.com> Again I forgot to copy maxima list. Sorry... -------- Original Message -------- Subject: Re: [Maxima] Documentation for eval_when Date: Sun, 02 Oct 2011 12:28:30 -0700 From: Paul Bowyer To: Dieter Kaiser On 10/02/2011 11:14 AM, Dieter Kaiser wrote: > Am Sonntag, den 02.10.2011, 18:25 +0100 schrieb Rupert Swarbrick: >> Dieter Kaiser writes: >>> Because of a bug report, I have figured out the functionality of the >>> Maxima function eval_when. I have written a documentation in German. >>> Perhaps, someone can help to translate this documentation in the English >>> language. >>> >>> At this time, there is a lot of additionally information in the German >>> manual, which could be translated in English. I would appreciate any >>> help to translate more documentation. If someone is interested to help; >>> the German manual is available at >>> http://crategus.users.sourceforge.net/maxima.html >> Do you mean just for the eval_when function or in the manual in general? >> If the latter, do you have a list of places to look for it. I'd happily >> translate some. > Thank you very much for your offering. It is really a lot of work for me > to translate a text to English and the text is not as good as it could > be. > > Yes, there are a lot of places, which could be translated in English to > extend the documentation of the English manual. A starting point might > be the chapter about mathematical functions. This is an example of the > English Manual: > > ---------------------------------------------- > Function: abs (expr) > > Returns the absolute value expr. If expr is complex, returns the complex > modulus of expr. > > abs distributes over a list, a matrix, or an equation. See > distribute_over. > ---------------------------------------------- > > And this is the German documentation: > > ---------------------------------------------- > Funktion: abs (z) > > Die Funktion abs ist die Betragsfunktion und f?r das numerische > und symbolische Rechnen geeignet. Ist das Argument z eine reelle > oder komplexe Zahl wird der Betrag berechnet. Wenn m?glich > werden allgemeine Ausdr?cke mit der Betragsfunktion vereinfacht. > Maxima kann Ausdr?cke mit der Betragsfunktion integrieren und > ableiten sowie Grenzwerte von Ausdr?cken mit der Betragsfunktion > ermitteln. Das Paket abs_integrate erweitert Maximas > M?glichkeiten, Integrale mit der Betragsfunktion zu l?sen. > > Die Betragsfunktion wird automatisch auf die Elemente von Listen > und Matrizen sowie auf die beiden Seiten von Gleichungen > angewendet. Siehe distribute_over. > > Siehe die Funktion cabs, um den Betrag eines komplexen Ausdrucks > oder einer Funktion zu berechnen. > > Beispiele: > > Berechnung des Betrages f?r reelle und komplexen Zahlen sowie > numerische Konstanten und unendliche Gr??en. Das erste Beispiel > zeigt, wie die Betragsfunktion von Maxima auf die Elemente einer > Liste angewendet wird. > > (%i1) abs([-4, 0, 1, 1+%i]); > (%o1) [4, 0, 1, sqrt(2)] > > (%i2) abs((1+%i)*(1-%i)); > (%o2) 2 > (%i3) abs(%e+%i); > 2 > (%o3) sqrt(%e + 1) > (%i4) abs([inf, infinity, minf]); > (%o4) [inf, inf, inf] > > Vereinfachung von Ausdr?cken mit der Betragsfunktion. > > (%i5) abs(x^2); > 2 > (%o5) x > (%i6) abs(x^3); > 2 > (%o6) x abs(x) > > (%i7) abs(abs(x)); > (%o7) abs(x) > (%i8) abs(conjugate(x)); > (%o8) abs(x) > > Ableitung und Integrale mit der Betragsfunktion. Wird das Paket > abs_integrate geladen, k?nnen weitere Integrale mit der > Betragsfunktion gel?st werden. Das letzte Beispiel zeigt die > Laplacetransformation der Betragsfunktion. Siehe laplace. > > (%i9) diff(x*abs(x),x),expand; > (%o9) 2 abs(x) > > (%i10) integrate(abs(x),x); > x abs(x) > (%o10) -------- > 2 > > (%i11) integrate(x*abs(x),x); > / > [ > (%o11) I x abs(x) dx > ] > / > > (%i12) load(abs_integrate)$ > (%i13) integrate(x*abs(x),x); > 2 3 > x abs(x) x signum(x) > (%o13) --------- - ------------ > 2 6 > > (%i14) integrate(abs(x),x,-2,%pi); > 2 > %pi > (%o14) ---- + 2 > 2 > > (%i15) laplace(abs(x),x,s); > 1 > (%o15) -- > 2 > s > ---------------------------------------------- > > This is the English documentation for cabs: > > ---------------------------------------------- > Function: cabs (expr) > > Returns the complex absolute value (the complex modulus) of > expr. > ---------------------------------------------- > > And this is the documentation in German: > > ---------------------------------------------- > Funktion: cabs (expr) > > Berechnet den Betrag eines komplexen Ausdrucks expr. Im > Unterschied zu der Funktion abs, zerlegt die Funktion cabs einen > komplexen Ausdruck immer in einen Realteil und Imagin?rteil, um > den komplexen Betrag zu berechnen. Sind x und y zwei reelle > Variablen oder Ausdr?cke berechnet die Funktion cabs den Betrag > des komplexen Ausdrucks x + %i*y als: > > 2 2 > sqrt(y + x ) > > Die Funktion cabs nutzt Symmetrieeigenschaften und > implementierte Eigenschaften komplexer Funktionen, um den Betrag > eines Ausdrucks zu berechnen. Sind solche Eigenschaften f?r eine > Funktion vorhanden, k?nnen diese mit der Funktion properties > angezeigt werden. Eigenschaften, die das Ergebnis der Funktion > cabs bestimmen, sind: mirror symmetry, conjugate function und > complex characteristic. > > cabs ist eine Verbfunktion, die nicht f?r das symbolische > Rechnen geeignet ist. F?r das symbolische Rechnen wie der > Integration oder der Ableitung von Ausdr?cken mit der > Betragsfunktion muss die Funktion abs verwendet werden. > > Das Ergebnis der Funktion cabs kann die Betragsfunktion abs und > den Arkustangens atan2 enthalten. > > cabs wird automatisch auf die Elemente von Listen und Matrizen > sowie auf die beiden Seiten von Gleichungen angewendet. > > Siehe auch die Funktionen rectform, realpart, imagpart, carg, > conjugate und polarform f?r das Rechnen mit komplexen Zahlen. > > Beispiele: > > Zwei Beispiele mit der Wurzelfunktion sqrt und der Sinusfunktion > sin. > > (%i1) cabs(sqrt(1+%i*x)); > 2 1/4 > (%o1) (x + 1) > (%i2) cabs(sin(x+%i*y)); > 2 2 2 2 > (%o2) sqrt(cos (x) sinh (y) + sin (x) cosh (y)) > > Die Funktion erf hat Spiegelsymmetrie, die hier f?r die > Berechnung des komplexen Betrages angewendet wird. > > (%i3) cabs(erf(x+%i*y)); > 2 > (erf(%i y + x) - erf(%i y - x)) > (%o3) sqrt(-------------------------------- > 4 > 2 > (erf(%i y + x) + erf(%i y - x)) > - --------------------------------) > 4 > > Maxima kennt komplexe Eigenschaften der Besselfunktionen, um den > komplexen Betrag zu vereinfachen. Dies ist ein Beispiel f?r die > Besselfunktion bessel_j. > > (%i4) cabs(bessel_j(1,%i)); > (%o4) abs(bessel_j(1, %i)) > ---------------------------------------------- > > Dieter Kaiser > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Hello Dieter: I don't speak a word of German, so I cannot help you directly with translating from German into English, but I tried pasting your German documentation for the abs function into "http://translation.babylon.com/german/to-english/" and got this as a result: Function: abs (z) The abs function is the Betragsfunktion and suitable for the numerical and symbolic expect. Is the argument z a real or complex number, the amount will be charged. If possible , general expressions with the Betragsfunktion simplified. Maxima can integrate Betragsfunktion and derive expressions with the limits of print as well as with the Betragsfunktion identify. It doesn't look perfect to me, but it might be close enough that your effort to translate would be much reduced by using the online translator as a first draft of the English from the German. I hope this might be of use to you, Paul Bowyer -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdieterkaiser at web.de Sun Oct 2 14:55:13 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 02 Oct 2011 21:55:13 +0200 Subject: [Maxima] Fwd: Re: Documentation for eval_when In-Reply-To: <4E88BBC3.6060303@olynet.com> References: <4E88BB5E.3000907@olynet.com> <4E88BBC3.6060303@olynet.com> Message-ID: <1317585313.25565.17.camel@dieter> Am Sonntag, den 02.10.2011, 12:30 -0700 schrieb Paul Bowyer: > Hello Dieter: > > I don't speak a word of German, so I cannot help you directly with > translating from German into English, but I tried pasting your German > documentation for the abs function into > "http://translation.babylon.com/german/to-english/" and got this as a > result: > > Function: abs (z) The abs function is the Betragsfunktion and suitable > for the numerical and symbolic expect. Is the argument z a real or > complex number, the amount will be charged. If possible , general > expressions with the Betragsfunktion simplified. Maxima can integrate > Betragsfunktion and derive expressions with the limits of print as > well as with the Betragsfunktion identify. > > It doesn't look perfect to me, but it might be close enough that your > effort to translate would be much reduced by using the online > translator as a first draft of the English from the German. Hello Paul, I already use as a translation tool the translator from Google. My experience from translating a text from English to German is, that the translation is horrible. The German text is almost unreadable in most cases. It is enough to get a rough idea about the content, but the translation is to far away from something which looks like an acceptable translation. I think, it is the same when translating from German to English. The problem is, that the grammar and the way to express something is quite different in both languages. Dieter Kaiser From biomates at telefonica.net Sun Oct 2 15:12:46 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 02 Oct 2011 16:12:46 -0400 Subject: [Maxima] pdf_hypergeometric In-Reply-To: References: <4E85C71B.1040200@telefonica.net> Message-ID: <4E88C5BE.6000101@telefonica.net> On 09/30/2011 11:00 AM, Hans W. Hofmann wrote: >> If you have n1 white balls and n2 red balls in an urn, and n balls is >> the number of balls drawn from the urn, pdf_hypergeometric(x, n1, n2, n) >> is the probability for event "x balls are white". >> >> -- > > thank you I tried some combinations, but get always nonsense or errors. But now you get correct results, don't you? > Help text ist not realy a help? I'll extend the documentation for hypergeometric. -- Mario From rswarbrick at gmail.com Sun Oct 2 17:35:05 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sun, 02 Oct 2011 23:35:05 +0100 Subject: [Maxima] Documentation for eval_when References: <1317571559.1654.16.camel@dieter> <1317579246.1654.35.camel@dieter> Message-ID: Hi, Here's a stab at a translation for the two functions you sent. My German is mediocre, but I guess it's not like I'm trying to translate poetry or something! I've made some notes at the bottom about things I intended to change (rather than things I misunderstood) and also some questions that I had when reading it. I hope this doesn't create too much extra work for you! Rupert (skip ahead to "NOTES" for my questions) ---------------------------------------------------------------------- Function: abs (z) The abs function represents the mathematical absolute value function and works for both numerical and symbolic values. If the argument, z, is a real or complex number, abs returns the absolute value of z. If possible, symbolic expressions using the absolute value function are also simplified. Maxima can differentiate, integrate and calculate limits for some expressions containing abs. The abs_integrate package further extends Maxima's ability to calculate integrals involving the abs function. See (%i12) in the examples below. When applied to a list or matrix, abs automatically distributes over the terms. Similarly, it distributes over both sides of an equation. To alter this behaviour, see the variable distribute_over. Examples: Calculation of abs for real and complex numbers, including numerical constants and various infinities. The first example shows how abs distributes over the elements of a list. (%i1) abs([-4, 0, 1, 1+%i]); (%o1) [4, 0, 1, sqrt(2)] (%i2) abs((1+%i)*(1-%i)); (%o2) 2 (%i3) abs(%e+%i); 2 (%o3) sqrt(%e + 1) (%i4) abs([inf, infinity, minf]); (%o4) [inf, inf, inf] Simplification of expressions containing abs: (%i5) abs(x^2); 2 (%o5) x (%i6) abs(x^3); 2 (%o6) x abs(x) (%i7) abs(abs(x)); (%o7) abs(x) (%i8) abs(conjugate(x)); (%o8) abs(x) Integrating and differentiating with the abs function. Note that, if the abs_integrate package is loaded, more integrals involving the abs function can be performed. The last example shows the Laplace transform of abs: see laplace. (%i9) diff(x*abs(x),x),expand; (%o9) 2 abs(x) (%i10) integrate(abs(x),x); x abs(x) (%o10) -------- 2 (%i11) integrate(x*abs(x),x); / [ (%o11) I x abs(x) dx ] / (%i12) load(abs_integrate)$ (%i13) integrate(x*abs(x),x); 2 3 x abs(x) x signum(x) (%o13) --------- - ------------ 2 6 (%i14) integrate(abs(x),x,-2,%pi); 2 %pi (%o14) ---- + 2 2 (%i15) laplace(abs(x),x,s); 1 (%o15) -- 2 s ---------------------------------------------------------------------- Function: cabs (expr) Calculates the absolute value of an expression representing a complex number. Unlike the function abs, the cabs function always decomposes its argument into a real and an imaginary part. If x and y represent real variables or expressions, the cabs function calculates the absolute value of x + %i*y as sqrt (y^2 + x^2). The cabs function can use symmetry properties and identities of complex functions to help it calculate the absolute value of an expression. If such identities exist, they can be advertised to cabs using function properties. The symmetries that cabs understands are: mirror symmetry, conjugate function and complex characteristic. cabs is a verb function and is not very suitable for symbolic calculations. For such calculations (including integration, differentiation and taking limits of expressions containing absolute values), use abs. The result of cabs can include the absolute value function, abs, and the arc tangent, atan2. When applied to a list or matrix, cabs automatically distributes over the terms. Similarly, it distributes over both sides of an equation. For further ways to compute with complex numbers, see the functions rectform, realpart, imagpart, carg, conjugate and polarform. Examples: Examples with sqrt and sin. (%i1) cabs(sqrt(1+%i*x)); 2 1/4 (%o1) (x + 1) (%i2) cabs(sin(x+%i*y)); 2 2 2 2 (%o2) sqrt(cos (x) sinh (y) + sin (x) cosh (y)) The error function, erf, has mirror symmetry, which is used here in the calculation of the absolute value with a complex argument: (%i3) cabs(erf(x+%i*y)); 2 (erf(%i y + x) - erf(%i y - x)) (%o3) sqrt(-------------------------------- 4 2 (erf(%i y + x) + erf(%i y - x)) - --------------------------------) 4 Maxima knows complex identities for the Bessel functions, which allow it to compute the absolute value for complex arguments. Here is an example for bessel_j. (%i4) cabs(bessel_j(1,%i)); (%o4) abs(bessel_j(1, %i)) ---------------------------------------------------------------------- NOTES: ====== Some things I changed (intentionally!) from the German text: maybe these are improvements. (1) I pointed at the abs_integrate example when the abs_integrate package is mentioned. (2) I explained why one should see distribute_over. (3) Since sqrt and sin are from the English names, I didn't clarify what they were in the cabs examples. Questions I have after reading this, which would be nice to add answers for! Providing this isn't just from my poor German, maybe answering these could improve the German manual too. (1) Why is abs_integrate functionality not permanently loaded if it improves Maxima's ability to integrate functions with abs() in? (I presume the answer is that it slows down general integration, but can someone confirm this?) (2) Is the repeat of the information about abs_integrate necessary? Maybe the text about it can be removed from the examples section, since it's already explained above? (Especially if there's a forward reference, like I added) (3) Is there a reason that abs takes z as an argument and cabs takes expr? (4) I'm a bit confused about the German in the first sentence of the second paragraph in cabs. I suspect that what I wrote isn't quite what you meant. (5) Is it possible for a user to set a property indicating that his/her function f has mirror symmetry, say? Maybe this documentation should point to the properties a user can set. Maybe with an example? (I would suggest wording, but I don't actually know how to do this!) (6) Also, what exactly do these properties mean? Are they documented elsewhere? (In which case, it would probably be good to have "See foo, bar") (7) Is there a reason that cabs doesn't respect distribute_over? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From drdieterkaiser at web.de Sun Oct 2 18:11:41 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 03 Oct 2011 01:11:41 +0200 Subject: [Maxima] Documentation for eval_when In-Reply-To: References: <1317571559.1654.16.camel@dieter> <1317579246.1654.35.camel@dieter> Message-ID: <1317597101.25565.24.camel@dieter> Am Sonntag, den 02.10.2011, 23:35 +0100 schrieb Rupert Swarbrick: > Hi, > > Here's a stab at a translation for the two functions you sent. My German > is mediocre, but I guess it's not like I'm trying to translate poetry or > something! > > I've made some notes at the bottom about things I intended to change > (rather than things I misunderstood) and also some questions that I had > when reading it. I hope this doesn't create too much extra work for you! > > Rupert > > (skip ahead to "NOTES" for my questions) > > ---------------------------------------------------------------------- > Function: abs (z) > > The abs function represents the mathematical absolute value function and > works for both numerical and symbolic values. If the argument, z, is a > real or complex number, abs returns the absolute value of z. If > possible, symbolic expressions using the absolute value function are > also simplified. > > Maxima can differentiate, integrate and calculate limits for some > expressions containing abs. The abs_integrate package further extends > Maxima's ability to calculate integrals involving the abs function. See > (%i12) in the examples below. > > When applied to a list or matrix, abs automatically distributes over > the terms. Similarly, it distributes over both sides of an > equation. To alter this behaviour, see the variable distribute_over. > > Examples: > > Calculation of abs for real and complex numbers, including numerical > constants and various infinities. The first example shows how abs > distributes over the elements of a list. > > (%i1) abs([-4, 0, 1, 1+%i]); > (%o1) [4, 0, 1, sqrt(2)] > > (%i2) abs((1+%i)*(1-%i)); > (%o2) 2 > (%i3) abs(%e+%i); > 2 > (%o3) sqrt(%e + 1) > (%i4) abs([inf, infinity, minf]); > (%o4) [inf, inf, inf] > > Simplification of expressions containing abs: > > (%i5) abs(x^2); > 2 > (%o5) x > (%i6) abs(x^3); > 2 > (%o6) x abs(x) > > (%i7) abs(abs(x)); > (%o7) abs(x) > (%i8) abs(conjugate(x)); > (%o8) abs(x) > > Integrating and differentiating with the abs function. Note that, if > the abs_integrate package is loaded, more integrals involving the abs > function can be performed. The last example shows the Laplace > transform of abs: see laplace. > > (%i9) diff(x*abs(x),x),expand; > (%o9) 2 abs(x) > > (%i10) integrate(abs(x),x); > x abs(x) > (%o10) -------- > 2 > > (%i11) integrate(x*abs(x),x); > / > [ > (%o11) I x abs(x) dx > ] > / > > (%i12) load(abs_integrate)$ > (%i13) integrate(x*abs(x),x); > 2 3 > x abs(x) x signum(x) > (%o13) --------- - ------------ > 2 6 > > (%i14) integrate(abs(x),x,-2,%pi); > 2 > %pi > (%o14) ---- + 2 > 2 > > (%i15) laplace(abs(x),x,s); > 1 > (%o15) -- > 2 > s > > ---------------------------------------------------------------------- > > Function: cabs (expr) > > Calculates the absolute value of an expression representing a complex > number. Unlike the function abs, the cabs function always decomposes > its argument into a real and an imaginary part. If x and y represent > real variables or expressions, the cabs function calculates the > absolute value of x + %i*y as > > sqrt (y^2 + x^2). > > The cabs function can use symmetry properties and identities of > complex functions to help it calculate the absolute value of an > expression. If such identities exist, they can be advertised to cabs > using function properties. The symmetries that cabs understands are: > mirror symmetry, conjugate function and complex characteristic. > > cabs is a verb function and is not very suitable for symbolic > calculations. For such calculations (including integration, > differentiation and taking limits of expressions containing absolute > values), use abs. > > The result of cabs can include the absolute value function, abs, and > the arc tangent, atan2. > > When applied to a list or matrix, cabs automatically distributes over > the terms. Similarly, it distributes over both sides of an equation. > > For further ways to compute with complex numbers, see the functions > rectform, realpart, imagpart, carg, conjugate and polarform. > > Examples: > > Examples with sqrt and sin. > > (%i1) cabs(sqrt(1+%i*x)); > 2 1/4 > (%o1) (x + 1) > (%i2) cabs(sin(x+%i*y)); > 2 2 2 2 > (%o2) sqrt(cos (x) sinh (y) + sin (x) cosh (y)) > > The error function, erf, has mirror symmetry, which is used here in > the calculation of the absolute value with a complex argument: > > (%i3) cabs(erf(x+%i*y)); > 2 > (erf(%i y + x) - erf(%i y - x)) > (%o3) sqrt(-------------------------------- > 4 > 2 > (erf(%i y + x) + erf(%i y - x)) > - --------------------------------) > 4 > > Maxima knows complex identities for the Bessel functions, which allow > it to compute the absolute value for complex arguments. Here is an > example for bessel_j. > > (%i4) cabs(bessel_j(1,%i)); > (%o4) abs(bessel_j(1, %i)) > > ---------------------------------------------------------------------- > > > NOTES: > ====== > > Some things I changed (intentionally!) from the German text: maybe > these are improvements. > > (1) I pointed at the abs_integrate example when the abs_integrate > package is mentioned. > > (2) I explained why one should see distribute_over. > > (3) Since sqrt and sin are from the English names, I didn't clarify > what they were in the cabs examples. > > Questions I have after reading this, which would be nice to add > answers for! Providing this isn't just from my poor German, maybe > answering these could improve the German manual too. > > (1) Why is abs_integrate functionality not permanently loaded if it > improves Maxima's ability to integrate functions with abs() in? (I > presume the answer is that it slows down general integration, but > can someone confirm this?) > > (2) Is the repeat of the information about abs_integrate necessary? > Maybe the text about it can be removed from the examples section, > since it's already explained above? (Especially if there's a > forward reference, like I added) > > (3) Is there a reason that abs takes z as an argument and cabs takes > expr? > > (4) I'm a bit confused about the German in the first sentence of the > second paragraph in cabs. I suspect that what I wrote isn't quite > what you meant. > > (5) Is it possible for a user to set a property indicating that > his/her function f has mirror symmetry, say? Maybe this > documentation should point to the properties a user can set. Maybe > with an example? (I would suggest wording, but I don't actually > know how to do this!) > > (6) Also, what exactly do these properties mean? Are they documented > elsewhere? (In which case, it would probably be good to have "See > foo, bar") > > (7) Is there a reason that cabs doesn't respect distribute_over? > _______________________________________________ Hello Rupert, your translation is great and your comments are very helpful to improve the documentation of both the English and the German version even more. I will go through your comments tomorrow, today it is to late. Thank you very much. Dieter Kaiser From toy.raymond at gmail.com Sun Oct 2 18:47:46 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 02 Oct 2011 16:47:46 -0700 Subject: [Maxima] powers In-Reply-To: References: Message-ID: <4E88F822.4080202@gmail.com> On 10/2/11 2:22 AM, Pere Castellv? wrote: > Hi all, > > is there a way to obtain 40*sqrt(2) in this computation? > > (%i3) 20*sqrt(2)+20*sqrt(2); > (%o3) 5*2^(7/2) > Hmm. It seems that you can't. Even 40*sqrt(2) is simplified to 5*2^(7/2). I think this is due to some work done a while a go to fix some other issues where maxima was not simplifying expressions like this, so maxima now factors the numbers and puts the factors into the square root. Ray From drdieterkaiser at web.de Sun Oct 2 19:13:42 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 03 Oct 2011 02:13:42 +0200 Subject: [Maxima] powers In-Reply-To: <4E88F822.4080202@gmail.com> References: <4E88F822.4080202@gmail.com> Message-ID: <1317600822.25565.38.camel@dieter> Am Sonntag, den 02.10.2011, 16:47 -0700 schrieb Raymond Toy: > On 10/2/11 2:22 AM, Pere Castellv? wrote: > > Hi all, > > > > is there a way to obtain 40*sqrt(2) in this computation? > > > > (%i3) 20*sqrt(2)+20*sqrt(2); > > (%o3) 5*2^(7/2) > > > Hmm. It seems that you can't. Even 40*sqrt(2) is simplified to 5*2^(7/2). > > I think this is due to some work done a while a go to fix some other > issues where maxima was not simplifying expressions like this, so maxima > now factors the numbers and puts the factors into the square root. Yes, products with roots and integers are consistently simplified. This might be not the prefered representation, but it allows much better simplification of complex expressions. See e.g. the different answers we had in Maxima 5.15. In Maxima 5.25 all expressions simplifies to the same result. Maxima version: 5.15.0 Maxima build date: 19:15 4/3/2011 host type: i686-pc-linux-gnu lisp-implementation-type: SBCL lisp-implementation-version: 1.0.45 (%i2) 20*sqrt(2)+20*sqrt(2); (%o2) 40*sqrt(2) (%i3) sqrt(2)*20+sqrt(2)*20; (%o3) 10*2^(5/2) (%i4) 40*sqrt(2); (%o4) 40*sqrt(2) (%i5) sqrt(2)*40; (%o5) 5*2^(7/2) (%i6) 20*sqrt(2)+sqrt(2)*20; (%o6) 5*2^(5/2)+20*sqrt(2) Dieter Kaiser From macrakis at alum.mit.edu Sun Oct 2 19:59:59 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 2 Oct 2011 20:59:59 -0400 Subject: [Maxima] Documentation for eval_when In-Reply-To: <1317571559.1654.16.camel@dieter> References: <1317571559.1654.16.camel@dieter> Message-ID: Maxima eval_when is calqued on Common Lisp eval-when, whose documentationmight be useful. -s 2011/10/2 Dieter Kaiser > Because of a bug report, I have figured out the functionality of the > Maxima function eval_when. I have written a documentation in German. > Perhaps, someone can help to translate this documentation in the English > language. > > At this time, there is a lot of additionally information in the German > manual, which could be translated in English. I would appreciate any > help to translate more documentation. If someone is interested to help; > the German manual is available at > http://crategus.users.sourceforge.net/maxima.html > > This is the documentation for the function eval_when in German: > > -- Funktion: eval_when (, , ..., ) > -- Funktion: eval_when ([, , ...], , > ..., ) > Ein Ausdruck mit der Funktion `eval_when' wird an oberster Stelle > in einer Datei definiert und erlaubt die bedingte Auswertung von > Ausdr?cken beim Laden, ?bersetzen oder Kompilieren einer Datei. > Das Argument ist eines der Schl?sselworte `batch', > `translate', `compile' oder `loadfile'. Das erste Argument kann > ein einzelnes Schl?sselwort oder ein Liste mit mehreren > Schl?sselworten sein. Trifft die mit dem Schl?sselwort angegebene > Bedingung zu, wird eine oder mehrere der folgenden Aktionen > ausgef?hrt: > > `batch' > Wird die Datei mit einer der Funktionen `load', `batch', > `batchload' oder `demo' geladen und ist `batch' in der > Liste der Schl?sselworte enthalten, dann werden die Ausdr?cke > , ..., genau einmal beim Laden der Datei > ausgewertet. Die R?ckgabe der Funktion `eval_when' ist ein > Ausdruck `evaluated_when(', wobei das > Ergebnis der Auswertung ist. Ist das Schl?sselwort `batch' > nicht vorhanden, ist die R?ckgabe das Symbol > `not_evaluated_when'. > > `translate' > Wird die Datei mit dem Kommando `translate_file' oder > `compile_file' geladen und ist `translate' unter den > Schl?sselworten, dann werden die Ausdr?cke , ..., > sofort ausgewertet. Seiteneffekte wie Zuweisungen > von Werten an Optionsvariablen oder Deklarationen sind f?r > die folgende ?bersetzung der Datei nach Lisp wirksam. Die > Ausdr?cke sind jedoch nicht Teil des ?bersetzten Programms. > > `loadfile' > Wird die Datei mit dem Kommando `translate_file' oder dem > Kommando `compile_file' geladen und ist `loadfile' unter den > Schl?sselworten, dann werden die Ausdr?cke , ..., > nach Lisp ?bersetzt und als Block der Form `(PROGN > EXPR_1 ... EXPR_N)' in das Lisp Programm eingesetzt. Hier > sind die Anweisungen die nach Lisp ?bersetzten > Maxima-Ausdr?cke . > > `compile' > Wird die Datei mit dem Kommando `translate_file' oder > `compile_file' geladen und ist `compile' unter den > Schl?sselworten, dann werden die Ausdr?cke , ..., > nach Lisp ?bersetzt und als eine Lisp-Anweisung in > das Lisp-Programm eingesetzt, die die Form `(EVAL-WHEN > (:COMPILE-TOPLEVEL) (EXPR_1 ... EXPR_N))' hat. Das > Schl?sselwort `compile' kann nicht mit dem Schl?sselwort > `loadfile' in einem `eval_when'-Ausdruck kombiniert werden. > In diesem Fall wird das Schl?sselwort `compile' ignoriert. > > Beispiele: > > F?r die folgende Beispiele ist eine Datei mit den Namen > `eval_when.mac' definiert, die verschiedene `eval_when'-Anweisungen > enth?lt. > > (%i1) file: file_search("eval_when.mac"); > (%o1) /home/dieter/.maxima/eval_when.mac > (%i2) printfile(file); > > eval_when(batch, print("called in mode BATCH")); > eval_when(loadfile, print("called in mode LOADFILE")); > eval_when(compile, print("called in mode COMPILE")); > eval_when(translate, print("called in mode TRANSLATE")); > > (%o2) /home/dieter/.maxima/eval_when.mac > > Die Datei wird mit dem Kommando `load' geladen. Die Anweisung mit > dem Schl?sselwort `batch' wird beim Laden einmal ausgef?hrt. > > (%i1) file: file_search("eval_when.mac"); > (%o1) /home/dieter/.maxima/eval_when.mac > (%i2) load(file); > called in mode BATCH > (%o2) /home/dieter/.maxima/eval_when.mac > > In diesem Fall wird die Datei mit dem Befehl `batch' geladen. Die > Anweisung mit dem Schl?sselwort `batch' wird einmal ausgef?hrt. > Die anderen `eval_when'-Anweisungen werten jeweils zum Ergebnis > `not_evaluated_when' aus. > > (%i3) batch(file); > > read and interpret file: /home/dieter/.maxima/eval_when.mac > (%i4) eval_when(batch, print(called in mode BATCH)) > called in mode BATCH > (%o4) evaluated_when(called in mode BATCH) > (%i5) eval_when(loadfile, print(called in mode LOADFILE)) > (%o5) not_evaluated_when > (%i6) eval_when(compile, print(called in mode COMPILE)) > (%o6) not_evaluated_when > (%i7) eval_when(translate, print(called in mode TRANSLATE)) > (%o7) not_evaluated_when > (%o7) /home/dieter/.maxima/eval_when.mac > > Jetzt wird die Datei mit dem Kommando `translate_file' geladen und > nach Lisp ?bersetzt. Der Ausdruck mit dem Schl?sselwort > `translate' wird sofort ausgewertet. Das ?bersetzte Programm wird > in die Ausgabedatei `eval_when.LISP' geschrieben. Die > `eval_when'-Anweisung zum Schl?sselwort wird nicht ausgewertet. > > (%i1) file: file_search("eval_when.mac"); > (%o1) /home/dieter/.maxima/eval_when.mac > (%i2) translate_file(file); > translator: begin > translating /home/dieter/.maxima/eval_when.mac. > called in mode TRANSLATE > (%o2) [/home/dieter/.maxima/eval_when.mac, > /home/dieter/.maxima/eval_when.LISP, > /home/dieter/.maxima/eval_when.UNLISP] > > Dies ist der Inhalt der Ausgabedatei `eval_when.LISP'. Die > Ausgabedatei enth?lt eine `PROGN'-Anweisung mit dem Ausdruck > `($print '"called in mode LOADFILE")' f?r den `eval_when'-Ausdruck > zum Schl?sselwort `loadfile' sowie eine `EVAL-WHEN'-Anweisung mit > dem Ausdruck `($print '"called in mode COMPILE")' f?r den > `eval_when'-Ausdruck mit dem Schl?sselwort `compile'. > > ;;; -*- Mode: Lisp; package:maxima; syntax:common-lisp ;Base: 10 > -*- ;;; > ;;; Translated on: 2011-10-02 13:35:37+02:00 > ;;; Maxima version: 5.25post > ;;; Lisp implementation: SBCL > ;;; Lisp version: 1.0.45 > (in-package :maxima) > > [...] > > nil > (progn ($print '"called in mode LOADFILE")) > (eval-when (:compile-toplevel) ($print '"called in mode COMPILE")) > nil > > > _______________________________________________ > 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 anton.n.voropaev at gmail.com Mon Oct 3 04:35:31 2011 From: anton.n.voropaev at gmail.com (Anton Voropaev) Date: Mon, 3 Oct 2011 13:35:31 +0400 Subject: [Maxima] powers References: Message-ID: <002101cc81af$db5bfb00$c0c614ac@homecomp> (%i2) 20*sqrt(2)+20*sqrt(2); (%o2) 5*2^(7/2) (%i3) rat(factor(%)), simp=false; (%o3) 40*sqrt(2) From drdieterkaiser at web.de Mon Oct 3 04:43:19 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 03 Oct 2011 11:43:19 +0200 Subject: [Maxima] Documentation for eval_when In-Reply-To: References: <1317571559.1654.16.camel@dieter> <1317579246.1654.35.camel@dieter> Message-ID: <1317634999.1671.65.camel@dieter> Am Sonntag, den 02.10.2011, 23:35 +0100 schrieb Rupert Swarbrick: [...] > NOTES: > ====== > > Some things I changed (intentionally!) from the German text: maybe > these are improvements. > > (1) I pointed at the abs_integrate example when the abs_integrate > package is mentioned. Yes, it is helpful to have a hint to the example. I will add this to German documentation. > (2) I explained why one should see distribute_over. Yes, it is helpful to give the user this hint. I will add this to the German translation. > (3) Since sqrt and sin are from the English names, I didn't clarify > what they were in the cabs examples. In the German manual at this point I use the names of the Maxima functions with a special formating e.g. @code{sin} and @code{sqrt} and do not translate these names. Furthermore, for the html-file I add cross references to the documentation of the functions. Therefore it is correct not to translate the names of Maxima functions. The ascii-documentation does not show all special formating and the cross references. It is more easy to have a look at the html-documentation on my website http://crategus.users.sourceforge.net/maxima.html > Questions I have after reading this, which would be nice to add > answers for! Providing this isn't just from my poor German, maybe > answering these could improve the German manual too. > > (1) Why is abs_integrate functionality not permanently loaded if it > improves Maxima's ability to integrate functions with abs() in? (I > presume the answer is that it slows down general integration, but > can someone confirm this?) There is one open problem with the abs_integrate package. When loaded in Maxima it is no longer possible to use the quote-operator to create a noun form of an integral. (%i1) 'integrate(x^2,x); (%o1) 'integrate(x^2,x) (%i2) load(abs_integrate)$ (%i3) 'integrate(x^2,x); (%o3) x^3/3 This problem must be solved first. We have an open bug report about this problem. The documentation of abs_integrate misses a hint about this defect. > (2) Is the repeat of the information about abs_integrate necessary? > Maybe the text about it can be removed from the examples section, > since it's already explained above? (Especially if there's a > forward reference, like I added) This is a matter of style. At a lot of places in the documentation the style is to repeat informations in the examples. > (3) Is there a reason that abs takes z as an argument and cabs takes > expr? I have thought about this point when writing the German translation. I have tried to use a unique convention for naming arguments, because this is very helpful for the user. The argument z emphasizes that abs is the mathematical function with one argument which calculates the absolute value of numbers and simplifies for other arguments. In contrast the function cabs does not simplify, but decomposes any expression expr in a realpart and a imagpart and calculates sqrt(x^2 +y^2). This behavior is quite different. cabs works on expressions and abs simplifies expressions. Therefore, the naming of the argument should help to distinguish between theses functionalities > (4) I'm a bit confused about the German in the first sentence of the > second paragraph in cabs. I suspect that what I wrote isn't quite > what you meant. Perhaps, it is possible to change "identities" with "known properties". You might argue, that symmetry properties are "known properties". Then it might be even better to write: "The cabs function can use known properties like symmetry properties of complex functions to help it calculate the absolute value of an expression." The point is, that Maxima has knowledge about functions like a mirror symmetry. This knowledge is applied when calculating cabs of an expression. Furthermore, the user can define properties in addition, but a lot of possible things are not implemented well or are not documented well. A lot of work is possible on this topic. > (5) Is it possible for a user to set a property indicating that > his/her function f has mirror symmetry, say? Maybe this > documentation should point to the properties a user can set. Maybe > with an example? (I would suggest wording, but I don't actually > know how to do this!) The handling of properties and the documentation is not as good as it should be. In the German translation I have started to put in more documentation about this point and I have listed all available properties symbols and functions have by default and can get by the user (see an example below). In the German translation there is a cross reference e.g. to the Maxima function properties. E.g. these are the defined properties for the function abs, but there is not much documentation about their usage for the user. (%i4) properties(abs); (%o4) [integral,rule,"distributes over bags",noun,gradef,"system function"] > (6) Also, what exactly do these properties mean? Are they documented > elsewhere? (In which case, it would probably be good to have "See > foo, bar") See above. > (7) Is there a reason that cabs doesn't respect distribute_over? cabs distributes over equations, lists and matrices like the abs function. But cabs is not a simplifying function and does not call the simplifier. The property distribute_over is applied by the simplifier. Therefore, cabs can not use the property distribute_over and it is not possible to switch off this property. The diffeent behavior is a consequence of the difference between a noun and a verb function. Perhaps, I can add a hint for the user about this point. Dieter Kaiser P.S. This is the documentation of properties in the English manual: Function: properties (a) Returns a list of the names of all the properties associated with the atom a. This is a first attempt to document the function properties more complete: -- Funktion: properties () Gibt eine Liste mit den Eigenschaften zur?ck, die das Symbol von Maxima oder dem Nutzer erhalten hat. Die R?ckgabe kann jede Eigenschaft enthalten, die mit der Funktion `declare' einem Symbol zugewiesen ist. Diese Eigenschaften sind: linear additive multiplicative outative commutative symmetric antisymmetric nary lassociativ rassociative evenfun oddfun bindtest feature alphabetic scalar nonscalar nonarray constant integer noninteger even odd rational irrational real imaginary complex increasing decreasing posfun integervalued Die folgenden Eintr?ge beschreiben Eigenschaften, die Variablen haben k?nnen: `value' Der Variable ist mit dem Operatoren `:' oder `::' ein Wert zugewiesen. `system value' Die Variable ist eine Optionsvariable oder Systemvariable, die von Maxima definiert ist. `numer' Die Variable hat einen numerischen Wert auf der Eigenschaftsliste, der mit der Funktion `numerval' zugewiesen ist. `assign property' Die Variable hat eine eine Funktion auf der Eigenschaftsliste, die die Zuweisung eines Wertes kontrolliert. Eintr?ge, die die Eigenschaften von Funktionen beschreiben: `function' Eine mit dem Operator `:=' oder der Funktion `define' definierte Nutzerfunktion. `macro' Eine mit dem Operator `::=' definierte Makrofunktion. `system function' Ein interne Maxima-Funktion. `special evaluation form' Eine Maxima-Spezialform, die die Argumente nicht auswertet. `transfun' Wird eine Nutzerfunktion mit `translate' ?bersetzt oder mit der Funktion `compile' kompiliert, erh?lt sie die Eigenschaft `transfun'. Interne Maxima-Funktionen, die mit dem Lisp-Makro `defmfun' definiert werden, haben ebenfalls diese Eigenschaft. `deftaylor' F?r die Funktion ist eine Taylorreihenentwicklung definiert. `gradef' Die Funktion hat eine Ableitung. `integral' Die Funktion hat eine Stammfunktion. `distribute over bags' Ist das Argument der Funktion eine Liste, Matrix oder Gleichung so wird die Funktion auf die Elemente oder beide Seiten der Gleichung angewendet. `limit function' Es existiert eine Funktion f?r die Behandlung spezieller Grenzwerte. `conjugate function' Es existiert eine Funktion, um die konjugiert komplexe Funktion f?r spezielle Wertebereiche zu ermitteln. `mirror symmetry' Die Funktion hat die Eigenschaft der Spiegelsymmetrie. `complex characteristic' Es existiert eine Funktion, um den Realteil und den Imagin?rteil der Funktion f?r spezielle Wertebereiche zu ermitteln. `user autoload function' Die Funktion wird automatisch beim ersten Aufruf aus einer Datei geladen. Der Nutzer kann mit dem Funktion `setup_autoload' eine solche Funktion definieren. Weitere Eigenschaften, die Symbole erhalten k?nnen: `operator' Das Symbol ist ein Maxima-Operator oder ein nutzerdefinierte Operator. `rule' Die Funktion oder der Operator haben eine Regel f?r die Vereinfachung. `alias' `database info' Das Symbol hat Eintr?ge in Maximas Datenbank. `hashed array, declared array, complete array' Ein Hashed-Array, ein deklariertes Array oder ein Array dessen Elemente einen bestimmten Typ haben. `array function' Eine Array-Funktion die mit dem Operator `:=' definiert ist. `atvalue' Dem Symbol ist mit der Funktion `atvalue' ein Wert an einer Stelle zugewiesen. `atomgrad' F?r das Symbol ist mit der Funktion `gradef' eine Ableitung definiert. `dependency' F?r das Symbol ist eine Abh?ngigkeit mit der Funktion `depends' definiert. `matchdeclare' Das Symbol ist eine mit `matchdeclare' definierte Mustervariable, der eine Aussagefunktion zugeordnet ist. `modedeclare' F?r das Symbol ist mit der Funktion `mode_declare' ein Typ definiert. `user properties' `context' Das Symbol bezeichnet einen Kontext. `activecontext' Das Symbol bezeichnet einen aktiven Kontextes. From drdieterkaiser at web.de Mon Oct 3 05:07:37 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 03 Oct 2011 12:07:37 +0200 Subject: [Maxima] Documentation for eval_when In-Reply-To: References: <1317571559.1654.16.camel@dieter> Message-ID: <1317636457.4961.5.camel@dieter> Am Sonntag, den 02.10.2011, 20:59 -0400 schrieb Stavros Macrakis: > Maxima eval_when is calqued on Common Lisp eval-when, whose > documentation might be useful. Thank you very much for the hint. Actually, I had some problems to figure out the functionality of eval_when. At the end I have recognized that only the four keywords 'batch, 'translate, 'compile, and 'loadfile does have an effect. All other keywords used in the files of the share packages like 'demo, 'load, ... do not have any effect. Dieter Kaiser From jpc3 at psu.edu Mon Oct 3 08:20:21 2011 From: jpc3 at psu.edu (Joseph Cusumano) Date: Mon, 03 Oct 2011 09:20:21 -0400 Subject: [Maxima] expanding and comparing symbolic integrals In-Reply-To: References: Message-ID: <4E89B695.1090005@psu.edu> Hi everyone. If I define something like F1:integrate(a*f(x)+b*g(x),x,c,d); F2:a*integrate(f(x),x,c,d)+b*integrate(g(x),x,c,d); These clearly are equal, but how do I get Maxima to recognize this? In general, how can I expand F1 to get F2? Thanks, Joe Cusumano -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Oct 3 08:25:17 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 3 Oct 2011 09:25:17 -0400 Subject: [Maxima] expanding and comparing symbolic integrals In-Reply-To: <4E89B695.1090005@psu.edu> References: <4E89B695.1090005@psu.edu> Message-ID: They are only equal if the individual integrals are convergent. Consider f(x)=1/x and g(x)= - 1/x from 0 to 1. You can do declare(integrate,linear) if you know that this will not cause you problems. -s On Mon, Oct 3, 2011 at 09:20, Joseph Cusumano wrote: > > Hi everyone. > > If I define something like > > F1:integrate(a*f(x)+b*g(x),x,c,d); > F2:a*integrate(f(x),x,c,d)+b*integrate(g(x),x,c,d); > > These clearly are equal, but how do I get Maxima to recognize this? In > general, how can I expand F1 to get F2? > > Thanks, > > Joe Cusumano > > _______________________________________________ > 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 cooch17 at verizon.net Mon Oct 3 08:54:00 2011 From: cooch17 at verizon.net (egc) Date: Mon, 03 Oct 2011 09:54:00 -0400 Subject: [Maxima] implicit differentiation and subscripted variables? Message-ID: <4E89BE78.7040503@verizon.net> I am in the process of porting over a *lot* of lecture notes from Maple -> Maxima. For the most part, this has been a relatively straightforward 'port'. But, I am stuck a bit on handling implicit differentiation (which is a one-line command in Maple, but requires a couple of steps in Maxima). My problem isn't so much >1 steps ( can probably write a wrapper to shield students from the multiple steps), but rather, why the depends command is blowing up. Take the following example: mat:matrix([0,s[a]*m[1],s[a]*m[a]],[s[o],0,0],[0,s[a],0]); cp:charpoly(mat,lambda); Now, what I want students to do is implicitly differentiate lambda wrt to each other variable in the characteristic polynomial. So, for example, to implicitly differentiate lambda wrt s[a], I would start with depends(lambda,s[a]); But, this throws an error: depends: argument must be a symbol; found s[a] -- an error. To debug this try: debugmode(true); Guessing that this is because depends doesn't like my attempt to 'subscript' s[a], I try mat:matrix([0,sa*m1,sa*ma],[so,0,0],[0,sa,0]); cp:charpoly(mat,lambda); depends(lambda,sa); Now, this works fine (so, my guess was right). Problem is, using mat:matrix([0,s[a]*m[1],s[a]*m[a]],[s[o],0,0],[0,s[a],0]); generates pretty ugly output (not concerned about aesthetics, as much as the fact that the lack of explicit subscripting makes the process more error prone for students). So, is there a recommended way to allow for subscripting of matrix elements (or any variable, for that matter) that won't cause depends to have 'issues'? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Mon Oct 3 10:37:10 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 03 Oct 2011 08:37:10 -0700 Subject: [Maxima] implicit differentiation and subscripted variables? In-Reply-To: <4E89BE78.7040503@verizon.net> References: <4E89BE78.7040503@verizon.net> Message-ID: <4E89D6A6.3060009@eecs.berkeley.edu> I suggest you start your session by defining s[u]:=concat(s,u); and see if you like what happens. Do you need s[a] to depend on a?? RJF From mhw at netris.org Mon Oct 3 13:12:18 2011 From: mhw at netris.org (Mark H Weaver) Date: Mon, 03 Oct 2011 14:12:18 -0400 Subject: [Maxima] powers In-Reply-To: <1317600822.25565.38.camel@dieter> (Dieter Kaiser's message of "Mon, 03 Oct 2011 02:13:42 +0200") References: <4E88F822.4080202@gmail.com> <1317600822.25565.38.camel@dieter> Message-ID: <87botyhrlp.fsf@yeeloong.netris.org> Dieter Kaiser writes: > Am Sonntag, den 02.10.2011, 16:47 -0700 schrieb Raymond Toy: >> On 10/2/11 2:22 AM, Pere Castellv? wrote: >> > Hi all, >> > >> > is there a way to obtain 40*sqrt(2) in this computation? >> > >> > (%i3) 20*sqrt(2)+20*sqrt(2); >> > (%o3) 5*2^(7/2) >> > >> Hmm. It seems that you can't. Even 40*sqrt(2) is simplified to 5*2^(7/2). >> >> I think this is due to some work done a while a go to fix some other >> issues where maxima was not simplifying expressions like this, so maxima >> now factors the numbers and puts the factors into the square root. > > Yes, products with roots and integers are consistently simplified. This > might be not the prefered representation, but it allows much better > simplification of complex expressions. We could modify NFORMAT to convert constant expressions like 5*2^(7/2) into a more attractive form. If others think this is a good idea, I could work on it. Mark From cooch17 at verizon.net Mon Oct 3 11:35:41 2011 From: cooch17 at verizon.net (egc) Date: Mon, 03 Oct 2011 12:35:41 -0400 Subject: [Maxima] implicit differentiation and subscripted variables? In-Reply-To: <4E89D6A6.3060009@eecs.berkeley.edu> References: <4E89BE78.7040503@verizon.net> <4E89D6A6.3060009@eecs.berkeley.edu> Message-ID: <4E89E45D.9010008@verizon.net> Thanks for the suggestion. In fact, no formal 'relationship' between S and a -- the use is merely symbolic (verging on straight aesthetics). I have a parameter S which takes in different values for different classes of 'individuals' in the sample -- so, S_a, s_o, S_j etc.... What I had often done (with Maple) is throw all the parameters in a vector S, and used the subscript to 'call' them. The implicitdiff function in Maple has no problem with this (note: not a complaint about Maxima in any form -- I'm just trying to suss out the easiest way to proceed). On 10/3/2011 11:37 AM, Richard Fateman wrote: > I suggest you start your session by defining > > s[u]:=concat(s,u); > > and see if you like what happens. Do you need s[a] to depend on a?? > RJF > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Mon Oct 3 16:03:41 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 3 Oct 2011 14:03:41 -0700 Subject: [Maxima] Maxima by Example: new Ch. 2: Plots, Files, Read, Write, and Fit Message-ID: <7A1F9F754E364CDFBAA88090371621C7@edwinc367e16bd> Maxima by Example, Ch. 2 has been rewritten and given a new title: Chapter 2, Plots, Files, Read, Write, and Fit Chapter 2 has been revised to include a large section on working with files from within Maxima. The new software file mfiles.mac includes many useful file manipulation functions. The small file mfiles1.lisp is loaded in by mfiles.mac. ---------------------------------------- Files now available: --mbe2plotfit.pdf : Oct. 3, 2011, Maxima 5.25.1, 41 pages --mbe2toc.txt : Detailed table of contents, Oct. 3, 2011 --mbe2code.txt : Code file: Oct. 3, 2011, Maxima 5.25.1 --qplot.mac : Maxima code for quick plots, Oct. 3, 2011, Maxima 5.25.1 --mfiles.mac : Maxima code for file work, Oct. 3, 2011, Maxima 5.25.1 --mfiles1.lisp : Lisp code loaded by mfiles.mac, Oct. 3, 2011, Maxima 5.25.1 --coffee.dat : Coffee cooling tab separated data file: July, 13, 2009 ---------------------------------------- Chapter 2 Topics: A. Introduction to plot2d First Steps with plot2d Parametric Plots Line Width and Color Controls Discrete Data Plots: Point Size, Color, and Type Control Plot of a Discontinuous Function Using qplot for Quick Plots of One or More Functions Multiple Plots Using the Embedded Option --------------- B. Working with Files Using the Package mfiles.mac file_search, probe_file, ls, and dir ftype, file_length, file_info print_file, print_lines rename_file, delete_file, copy_file, file_convert, ftext_replace Break file lines with pbreak(), email reply with reply_to Search File with search_file Search Multiple files with search_mfiles read_data, read_text, write_data, with_stdout --------------- C. Least Squares Fit to Experimental Data Syntax of lsquares_estimates Coffee Cooling Model Experiment Data for Coffee Cooling Least Squares Fit of Coffee Cooling Data ----------------------------------------------- The new function read_data is designed to work correctly with unix, mac, and windows type text files. read_data uses the new functions read_line (a replacement for the current Maxima function readline) and print_line (a replacement for the current Maxima function printline). ----------------------------------------------------- Ted Woollett http://www.csulb.edu/~woollett From woollett at charter.net Mon Oct 3 16:18:34 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 3 Oct 2011 14:18:34 -0700 Subject: [Maxima] Maxima by Example: new Ch. 2: Plots, Files, Read, Write, and Fit Message-ID: On Oct. 3, 2011, I wrote: ------------------- The new function read_data is designed to work correctly with unix, mac, and windows type text files. read_data uses the new functions read_line (a replacement for the current Maxima function readline) and print_line (a replacement for the current Maxima function printline). ------------------------------------------ read_data only calls the new function read_line, which is a replacement for Maxima's readline. The new function print_file correctly treats mac, windows and unix files, and is a replacement for Maxima's printfile. Ted Woollett From dlakelan at street-artists.org Mon Oct 3 19:13:26 2011 From: dlakelan at street-artists.org (dlakelan) Date: Mon, 03 Oct 2011 17:13:26 -0700 Subject: [Maxima] matching or some other thing for sums of exponentials? Message-ID: <4E8A4FA6.7030803@street-artists.org> I have an expression that I get back from ode2 which contains things like (a*%e^b + %e^c) I would like to convert this to %e^c*(a*%e^(b-c)+1) or maybe in general take the sum of two exponentials multiplied by something and do this: a*exp(b) + c*exp(d) -> exp(d) * (a*(exp(b)/exp(d)) + c) one of the reasons I want to do this is that many times this appears inside a logarithm and the resulting simplifications will eliminate intermediate overflows in floating point. I can't figure out how to do this with matching / defrule, or with fooling around using factor or factorsum or anything like that. One of the problems seems to be the general problem that matching sub parts of sums or products can be tricky. any ideas? From woollett at charter.net Mon Oct 3 23:01:30 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 3 Oct 2011 21:01:30 -0700 Subject: [Maxima] matching or some other thing for sums of exponentials? Message-ID: <81CF8B36FBA442D7B40AD5C510F9FC8C@edwinc367e16bd> On Oct. 3, 2011, dlakelan wrote: ------------------------------------ I have an expression that I get back from ode2 which contains things like (a*%e^b + %e^c) I would like to convert this to %e^c*(a*%e^(b-c)+1) or maybe in general take the sum of two exponentials multiplied by something and do this: a*exp(b) + c*exp(d) -> exp(d) * (a*(exp(b)/exp(d)) + c) one of the reasons I want to do this is that many times this appears inside a logarithm and the resulting simplifications will eliminate intermediate overflows in floating point. I can't figure out how to do this with matching / defrule, or with fooling around using factor or factorsum or anything like that. One of the problems seems to be the general problem that matching sub parts of sums or products can be tricky. any ideas? ------------------------------ Some code from my dirac2.mac code file (Maxima by Example, Ch. 13) seems to work here: (%i1) divout(expr,_aa%) := block ([jj,_newsum% ], _newsum% : 0, for jj thru length (expr) do _newsum% : _newsum% + part(expr,jj)/_aa%, _newsum% )$ (%i2) pullfac(eexpr,_n%) := _n%*divout (eexpr,_n%)$ (%i3) myee : (a*%e^b + %e^c)$ (%i4) pullfac (myee, %e^b); b c - b (%o4) %e (%e + a) (%i5) pullfac (myee, %e^c); b - c c (%o5) (a %e + 1) %e There are other tricks I use in my dirac package batch files to express complicated expressions in a form which can be compared with published results. Ted Woollett From hawe at chefmail.de Tue Oct 4 05:22:35 2011 From: hawe at chefmail.de (Hans Hofmann) Date: Tue, 4 Oct 2011 10:22:35 +0000 (UTC) Subject: [Maxima] =?utf-8?q?pdf=5Fhypergeometric?= References: <4E85C71B.1040200@telefonica.net> <4E88C5BE.6000101@telefonica.net> Message-ID: Mario Rodriguez telefonica.net> writes: > > thank you I tried some combinations, but get always nonsense or errors. > > But now you get correct results, don't you? yes, I always want to place the parameters 49 Possibilities 6 Winners 6 Tries > > Help text ist not realy a help? > > I'll extend the documentation for hypergeometric. Thanks... From dlakelan at street-artists.org Tue Oct 4 11:15:22 2011 From: dlakelan at street-artists.org (dlakelan) Date: Tue, 04 Oct 2011 09:15:22 -0700 Subject: [Maxima] matching or some other thing for sums of exponentials? In-Reply-To: <81CF8B36FBA442D7B40AD5C510F9FC8C@edwinc367e16bd> References: <81CF8B36FBA442D7B40AD5C510F9FC8C@edwinc367e16bd> Message-ID: <4E8B311A.9060507@street-artists.org> On 10/03/2011 09:01 PM, Edwin Woollett wrote: > Some code from my dirac2.mac code file (Maxima by Example, > Ch. 13) seems to work here: >... I think this is very similar to using multthru, such as: (%i455) myee: (a*exp(b) + exp(c)); c b (%o455) %e + a %e (%i456) exp(c)*multthru(1/exp(c),myee); b - c c (%o456) (a %e + 1) %e The issue I have is that there are several locations within this big ugly expression where this *type* of simplification could occur, but I want to get maxima to traverse the expression tree and recognize when it is possible and carry it out. I thought pattern matching would be the way, but I can't figure out how to match a sum of two exponentials multiplied by constants in a reliable way (since it doesn't have a unique match it gives me some kinds of warnings) (%i457) matchdeclare([consta],atom,[expa,expb],lambda([x],not(atom(x)) and op(x)="^" and part(x,1)=%e)); (%o457) done (%i458) defrule(sumexp,consta*expa+expb,expb*(consta*(expa/expb)+1)); defmatch: expa consta will be matched uniquely since sub-parts would otherwise be ambigious. consta expa (%o458) sumexp : expb + consta expa -> (----------- + 1) expb expb I guess I could use "scanmap" with a function I'd write that checks to see if the expression is a sum of the right form, and then performs the simplification. From drdieterkaiser at web.de Tue Oct 4 13:52:00 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 04 Oct 2011 20:52:00 +0200 Subject: [Maxima] powers In-Reply-To: <87botyhrlp.fsf@yeeloong.netris.org> References: <4E88F822.4080202@gmail.com> <1317600822.25565.38.camel@dieter> <87botyhrlp.fsf@yeeloong.netris.org> Message-ID: <1317754320.1791.7.camel@dieter> Am Montag, den 03.10.2011, 14:12 -0400 schrieb Mark H Weaver: > Dieter Kaiser writes: > > Am Sonntag, den 02.10.2011, 16:47 -0700 schrieb Raymond Toy: > >> On 10/2/11 2:22 AM, Pere Castellv? wrote: > >> > Hi all, > >> > > >> > is there a way to obtain 40*sqrt(2) in this computation? > >> > > >> > (%i3) 20*sqrt(2)+20*sqrt(2); > >> > (%o3) 5*2^(7/2) > >> > > >> Hmm. It seems that you can't. Even 40*sqrt(2) is simplified to 5*2^(7/2). > >> > >> I think this is due to some work done a while a go to fix some other > >> issues where maxima was not simplifying expressions like this, so maxima > >> now factors the numbers and puts the factors into the square root. > > > > Yes, products with roots and integers are consistently simplified. This > > might be not the prefered representation, but it allows much better > > simplification of complex expressions. > > We could modify NFORMAT to convert constant expressions like 5*2^(7/2) > into a more attractive form. If others think this is a good idea, I > could work on it. Some times ago I suggested the extension of nformat, too, and we had a short discussion about this point on the mailing list. The result was, that we should not introduce too much differences between the internal representation of expressions and their external representation for display. Another point is, that nformat is not only used for the display, but also for the part and the subst functions of Maxima. Dieter Kaiser From willisb at unk.edu Tue Oct 4 14:58:06 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 4 Oct 2011 14:58:06 -0500 Subject: [Maxima] matching or some other thing for sums of exponentials? In-Reply-To: <4E8A4FA6.7030803@street-artists.org> References: <4E8A4FA6.7030803@street-artists.org> Message-ID: Maybe you need to substitute a lambda form for "+". Try something like (%i85) xexpy_p(e):= if ?mtimesp(e) and every(lambda([s], not ?mexptp(s)), rest(args(e),-1)) and ?mexptp(last(e)) then last(e) else if ?mexptp(e) then e else false$ (%i86) powfactor(e) := subst("+" = lambda([[s]], block([s1 : 0, s2 : 0, xo, po : 1], for sk in s do ( xo : xexpy_p(sk), if xo=false then s1 : s1 + sk else (s2 : s2 + sk, po : xo)), s1+ po * expand(s2/po))),e)$ (%i94) powfactor(log(x^2 + 943*x^q) -56 * log(x^2 + y^3)); (%o94) log(x^q*(x^(2-q)+943))-56*log((x^2/y^3+1)*y^3) This function is untested; further, it simply factors out the last b^c term it scans. And that's silly. --Barton maxima-bounces at math.utexas.edu wrote on 10/03/2011 07:13:26 PM: > From: dlakelan > To: Maxima Mailing List > Date: 10/03/2011 07:13 PM > Subject: [Maxima] matching or some other thing for sums of exponentials? > Sent by: maxima-bounces at math.utexas.edu > > I have an expression that I get back from ode2 which contains things > like (a*%e^b + %e^c) > > I would like to convert this to %e^c*(a*%e^(b-c)+1) or maybe in general > take the sum of two exponentials multiplied by something and do this: > > a*exp(b) + c*exp(d) -> exp(d) * (a*(exp(b)/exp(d)) + c) > > one of the reasons I want to do this is that many times this appears > inside a logarithm and the resulting simplifications will eliminate > intermediate overflows in floating point. > > I can't figure out how to do this with matching / defrule, or with > fooling around using factor or factorsum or anything like that. > > One of the problems seems to be the general problem that matching sub > parts of sums or products can be tricky. > > any ideas? > > > _______________________________________________ > 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 evan.cooch at gmail.com Wed Oct 5 11:31:57 2011 From: evan.cooch at gmail.com (Evan Cooch) Date: Wed, 05 Oct 2011 12:31:57 -0400 Subject: [Maxima] implicit diff & subst problems... Message-ID: <4E8C867D.2070101@gmail.com> Consider the following -- 1\ create square non-negative projection matrix, in terms of a set of underlying parameters: mat:matrix([0,s_a*m_2,s_a*m_3],[s_o,0,0],[0,s[a],s[a]]); 2\ generate characteristic polynomial for matrix cp:charpoly(mat,lam); 3\ implicitly differentiate cp for lam with respect to parameter s_a depends(lam,s_a); deriv:diff(cp,s_a); sol:solve(deriv,'diff(lam,s_a)); So far, so good. Returned expression for sol is correct. But, I want to evaluate sol given the numerical values of each parameter. However, when I try something as obvious as subst([s_a=0.8,s_o=0.4,m_2=1.2,m_3=1.2,lam=1.1667],sol); I get the following error message from Maxima diff: variable must not be a number; found: 0.8 -- an error. To debug this try: debugmode(true); OK, so how does one evaluate a diff numerically (if that is a correct statement of the problem)? I've fooled (a bit) with psubst and at, but haven't hit the 'right trick' yet. Surely substituting known values into a differential equation should be straightforward (since every other symbolic algebra program I've ever used handles this with no problems whatsoever). Perhaps not a problem with Maxima, but clearly a magic command (or some such) I'm missing. Thanks in advance for any suggestions/insights... -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Wed Oct 5 11:50:11 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 05 Oct 2011 09:50:11 -0700 Subject: [Maxima] implicit diff & subst problems... In-Reply-To: <4E8C867D.2070101@gmail.com> References: <4E8C867D.2070101@gmail.com> Message-ID: <4E8C8AC3.7000504@eecs.berkeley.edu> On 10/5/2011 9:31 AM, Evan Cooch wrote:... .. > I think you should take rhs(part(sol,1)). and do the substitution. substituting 0.8 for x in d/dx ... makes no sense. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cooch17 at verizon.net Wed Oct 5 11:24:00 2011 From: cooch17 at verizon.net (egc) Date: Wed, 05 Oct 2011 12:24:00 -0400 Subject: [Maxima] implicit diffferentiation and subst Message-ID: <4E8C84A0.4070104@verizon.net> Consider the following -- 1\ create square non-negative projection matrix, in terms of a set of underlying parameters: mat:matrix([0,s_a*m_2,s_a*m_3],[s_o,0,0],[0,s[a],s[a]]); 2\ generate characteristic polynomial for matrix cp:charpoly(mat,lam); 3\ implicitly differentiate cp for lam with respect to parameter s_a depends(lam,s_a); deriv:diff(cp,s_a); sol:solve(deriv,'diff(lam,s_a)); So far, so good. Returned expression for sol is correct. But, I want to evaluate sol given the numerical values of each parameter. However, when I try something as obvious as subst([s_a=0.8,s_o=0.4,m_2=1.2,m_3=1.2,lam=1.1667],sol); I get the following error message from Maxima diff: variable must not be a number; found: 0.8 -- an error. To debug this try: debugmode(true); OK, so how does one evaluate a diff numerically (if that is a correct statement of the problem)? I've fooled (a bit) with psubst and at, but haven't hit the 'right trick' yet. Surely substituting known values into a differential equation should be straightforward (since every other symbolic algebra program I've ever used handles this with no problems whatsoever). Perhaps not a problem with Maxima, but clearly a magic command (or some such) I'm missing. Thanks in advance for any suggestions/insights... -------------- next part -------------- An HTML attachment was scrubbed... URL: From evan.cooch at gmail.com Wed Oct 5 12:17:20 2011 From: evan.cooch at gmail.com (Evan Cooch) Date: Wed, 05 Oct 2011 13:17:20 -0400 Subject: [Maxima] implicit diff & subst problems... In-Reply-To: <4E8C8AC3.7000504@eecs.berkeley.edu> References: <4E8C867D.2070101@gmail.com> <4E8C8AC3.7000504@eecs.berkeley.edu> Message-ID: <4E8C9120.5080706@gmail.com> I don't really see the problem. I impicitiy differentiate the charpoly, generating a function (i.e., the derivative). Imply want to evaluate the function at a particular point. In Maple, this is trivial: with(linalg): mat:=Matrix([[0,s_a*m_2,s_a*m_3],[s_o,0,0],[0,s_a.s_a]]); cp:=charpoly(mat,lambda); implicitdiff(cp,lambda,s_a); subs(s_a=0.8,s_o=0.4,m_2=1.2,m_3=1.4,lambda=0.849,%); yielding 0.834 (can do the same thing in Mathematica, and Gauss...) Basically, all I (and students) need to be able to do is implicitly differentiate a function, and then evaluate that derivative at a point specific by known values of the variables in the derivative. So, how does one do this in Maxima? On 10/5/2011 12:50 PM, Richard Fateman wrote: > On 10/5/2011 9:31 AM, Evan Cooch wrote:... > .. > >> I think you should take rhs(part(sol,1)). and do the substitution. > > substituting 0.8 for x in d/dx ... makes no sense. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Wed Oct 5 13:02:57 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 05 Oct 2011 19:02:57 +0100 Subject: [Maxima] implicit diff & subst problems... References: <4E8C867D.2070101@gmail.com> <4E8C8AC3.7000504@eecs.berkeley.edu> <4E8C9120.5080706@gmail.com> Message-ID: Richard Fateman's answer was correct: it doesn't make sense to substitute numbers for x,y into "dy/dx". Something like the following does work: (%i1) mat:matrix([0,s_a*m_2,s_a*m_3],[s_o,0,0],[0,s[a],s[a]]); [ 0 m_2 s_a m_3 s_a ] [ ] (%o1) [ s_o 0 0 ] [ ] [ 0 s s ] [ a a ] (%i2) cp:charpoly(mat,lam); 2 (%o2) s m_3 s_a s_o - (s - lam) m_2 s_a s_o + (s - lam) lam a a a (%i3) depends(lam,s_a); (%o3) [lam(s_a)] (%i4) deriv:diff(cp,s_a); dlam 2 dlam (%o4) ---- m_2 s_a s_o + s m_3 s_o - (s - lam) m_2 s_o - lam ---- ds_a a a ds_a dlam + 2 (s - lam) lam ---- a ds_a (%i5) sol:solve(deriv,'diff(lam,s_a)); (s m_3 + (lam - s ) m_2) s_o dlam a a (%o5) [---- = - -------------------------------] ds_a 2 m_2 s_a s_o - 3 lam + 2 s lam a (%i6) subst([s_a=0.8,s_o=0.4,m_2=1.2,m_3=1.2,lam=1.1667],rhs(first(sol))); 0.4 (1.2 s + 1.2 (1.1667 - s )) a a (%o6) - -------------------------------- 2.3334 s - 3.699566670000001 a (%i7) subst(0.8, s[a], %); (%o7) .3055443803163305 The last line is because you seem to have got confused about s_a and s[a]. I don't know why I'm getting 0.3 instead of the 0.8 you report From Maple, but I suspect that's a typo from one of us. Note that "rhs(first(sol))" above says to take the first thing in the sol list (ie the equation) and then take its right hand side. Does this solve your problem for you? Rupert PS Regarding your Maple example, I logged into a University computer to check it out. Note that the response to your implicit diff line looks like > implicitdiff(cp,lambda,s_a); 2 s_o (m_2 lambda + 3 s_a m_3) ----------------------------- 2 3 lambda - s_o s_a m_2 This doesn't have the left hand dlam/ds_a part, so substitution actually makes sense. -------------- 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 Wed Oct 5 13:51:49 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 05 Oct 2011 11:51:49 -0700 Subject: [Maxima] implicit diff & subst problems... In-Reply-To: <4E8C9120.5080706@gmail.com> References: <4E8C867D.2070101@gmail.com> <4E8C8AC3.7000504@eecs.berkeley.edu> <4E8C9120.5080706@gmail.com> Message-ID: <4E8CA745.8010804@eecs.berkeley.edu> Let me try to be more explicit. Here is an expression: diff(f(x),x). Maxima returns it unevaluated, diff(f(x),x). substitute 0.8 for x. You get the expression diff(f(0.8), 0.8) This makes no sense, and Maxima objects. If you mean to evaluate an expression including derivatives, at a point, you could try at(diff(f(x),x), x=0.8), which has the advantage of making sense. On 10/5/11 10:17 AM, Evan Cooch wrote: > I don't really see the problem. I impicitiy differentiate the > charpoly, generating a function (i.e., the derivative). Imply want to > evaluate the function at a particular point. > > In Maple, this is trivial: > > with(linalg): > mat:=Matrix([[0,s_a*m_2,s_a*m_3],[s_o,0,0],[0,s_a.s_a]]); > cp:=charpoly(mat,lambda); > implicitdiff(cp,lambda,s_a); > subs(s_a=0.8,s_o=0.4,m_2=1.2,m_3=1.4,lambda=0.849,%); > > yielding 0.834 > > (can do the same thing in Mathematica, and Gauss...) > > Basically, all I (and students) need to be able to do is implicitly > differentiate a function, and then evaluate that derivative at a point > specific by known values of the variables in the derivative. > > So, how does one do this in Maxima? > > > On 10/5/2011 12:50 PM, Richard Fateman wrote: >> On 10/5/2011 9:31 AM, Evan Cooch wrote:... >> .. >> >>> I think you should take rhs(part(sol,1)). and do the substitution. >> >> substituting 0.8 for x in d/dx ... makes no sense. >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Wed Oct 5 15:09:12 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 5 Oct 2011 13:09:12 -0700 Subject: [Maxima] quadpack functions wrapper for numerical integration Message-ID: I am beginning revisions of ch. 8, numerical integration, (maxima by example), and want to include a simple wrapper function for the quadpack functions for one dimensional quadrature. (area and volume integral wrappers are a separate project.) If we ignore efficiency and principal value integrals, we can get away with just using quad_qags (finite domain) and quad_qagi. A global variable 'details' (set to false inside nint.mac) governs how much output nint produces. --------------------------- (%i1) load(nint); (%o1) c:/work2/nint.mac (%i2) fpprintprec:8$ (%i3) nint (a*x,x,0,1); undefined parameter in integrand (%o3) false (%i4) quad_qags(sqrt(x)*log(1/x),x,0,1); (%o4) [0.444444, 4.93432455E-16, 315, 0] (%i5) nint(sqrt(x)*log(1/x),x,0,1); (%o5) 0.444444 (%i6) details; (%o6) false (%i7) details:true$ (%i8) nint(sqrt(x)*log(1/x),x,0,1); case quad_qags est. abs. error = 4.93432455E-16 no. of evaluations = 315 (%o8) 0.444444 (%i9) details:false$ (%i10) quad_qagi(exp(-x^2),x,minf,inf); (%o10) [1.7724539, 1.42026368E-8, 270, 0] (%i11) nint(exp(-x^2),x,minf,inf); (%o11) 1.7724539 (%i12) quad_qags(cos(50*x)*sin(3*x)*exp(-x),x,0,1); (%o12) [-0.00191455,2.8536E-15,315,0] (%i13) nint(cos(50*x)*sin(3*x)*exp(-x),x,0,1); (%o13) -0.00191455 -------------------------------------------------------- The code so far is: ------------------------------------- /* nint.mac nintegrate code */ nint (expr,_var%,_a%, _b%, [_v%]) := block ([argL,rL,nerr ], if not numberp (float (subst (_var%=1.0,expr))) then ( disp ("undefined parameter in integrand"), return() ), argL : flatten ( cons ([expr,_var%,_a%,_b%],[_v%])), if _a% = minf or _b% = inf then ( if details then print (" case quad_qagi"), rL : apply ('quad_qagi, argL) ) else ( if details then print (" case quad_qags "), rL : apply ('quad_qags,argL)), if not listp (rL) then ( disp ("undefined parameter produces a noun form with default options"), return (rL)), nerr : part (rL,4), if nerr = 1 then disp ("too many subintervals done") else if nerr = 2 then disp ("excessive roundoff error detected") else if nerr = 3 then disp ("extremely bad integrand behavior observed") else if nerr = 4 then disp ("quadrature failed to converge") else if nerr = 5 then disp ("integral is probably divergent or slowly convergent") else if nerr = 6 then disp ("the input is invalid"), if details then ( print (" est. abs. error = ",part (rL,2)), print (" no. of evaluations = ",part (rL,3))), part (rL,1))$ details : false$ ------------------------------------------- Ted Woollett From macrakis at alum.mit.edu Wed Oct 5 15:22:04 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 5 Oct 2011 16:22:04 -0400 Subject: [Maxima] implicit diffferentiation and subst In-Reply-To: <4E8C84A0.4070104@verizon.net> References: <4E8C84A0.4070104@verizon.net> Message-ID: 'subst' is a syntactic substitution. It can be useful to substitute one symbolic variable for another, e.g. subst(z,y,'diff(x,y)) => 'diff(x,z). But it is not meaningful to substitute a number for a variable of differentiation: what is dx/d3? 'at', on the other hand, means 'evaluate at'. For example: (%i5) 'diff(y,x)=x; (%o5) 'diff(y,x,1) = x (%i6) at(%,x=3); (%o6) ?%at('diff(y,x,1),x = 3) = 3 (%i7) subst(3,x,%o5); Attempt to differentiate with respect to a number: 3 -- an error. To debug this try: debugmode(true); You could also just use subst on the part without diffs: (%i8) subst(3,x,rhs(%o5)); (%o8) 3 Does this solve your problem? -s On Wed, Oct 5, 2011 at 12:24, egc wrote: > Consider the following -- > > 1\ create square non-negative projection matrix, in terms of a set of > underlying parameters: > > mat:matrix([0,s_a*m_2,s_a*m_3],[s_o,0,0],[0,s[a],s[a]]); > > 2\ generate characteristic polynomial for matrix > > cp:charpoly(mat,lam); > > 3\ implicitly differentiate cp for lam with respect to parameter s_a > > depends(lam,s_a); > deriv:diff(cp,s_a); > sol:solve(deriv,'diff(lam,s_a)); > > > So far, so good. Returned expression for sol is correct. But, I want to > evaluate sol given the numerical values of each parameter. However, when I > try something as obvious as > > subst([s_a=0.8,s_o=0.4,m_2=1.2,m_3=1.2,lam=1.1667],sol); > > I get the following error message from Maxima > > diff: variable must not be a number; found: 0.8 > -- an error. To debug this try: debugmode(true); > > > OK, so how does one evaluate a diff numerically (if that is a correct > statement of the problem)? > > I've fooled (a bit) with psubst and at, but haven't hit the 'right trick' > yet. > > Surely substituting known values into a differential equation should be > straightforward (since every other symbolic algebra program I've ever used > handles this with no problems whatsoever). Perhaps not a problem with > Maxima, but clearly a magic command (or some such) I'm missing. > > > Thanks in advance for any suggestions/insights... > > _______________________________________________ > 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 Wed Oct 5 16:35:53 2011 From: maxima at etherjones.us (Ether Jones) Date: Wed, 5 Oct 2011 14:35:53 -0700 (PDT) Subject: [Maxima] vector syntax Message-ID: <1317850553.70302.YahooMailNeo@web161806.mail.bf1.yahoo.com> Hello. In the Maxima script below, why won't Maxima give a solution at Line 7?? Why do I have to use Lines 8,9,&10 to get a solution? Attached is the WMX file and a PNG screenshot of the output. --------------start Maxima script------------------------ 1) kill(all)$ 2) display2d: false; 3) load("vect")$ 4) E: [Ex,Ey,Ez]; 5) M: [1,2,3]; 6) E=M$ 7) solve(%,[Ex,Ey,Ez]); 8) E[1]=M[1]$ solve(%,Ex); 9) E[2]=M[2]$ solve(%,Ey); 10) E[3]=M[3]$ solve(%,Ez); ---------------end Maxima script--------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: vectors.png Type: image/png Size: 19765 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: z.wxm Type: application/octet-stream Size: 874 bytes Desc: not available URL: From dlakelan at street-artists.org Wed Oct 5 16:47:53 2011 From: dlakelan at street-artists.org (dlakelan) Date: Wed, 05 Oct 2011 14:47:53 -0700 Subject: [Maxima] matching or some other thing for sums of exponentials? In-Reply-To: <4E8B311A.9060507@street-artists.org> References: <81CF8B36FBA442D7B40AD5C510F9FC8C@edwinc367e16bd> <4E8B311A.9060507@street-artists.org> Message-ID: <4E8CD089.6080004@street-artists.org> Well, here's what I did (for those reading the archive): Since my problem is specific to this expression I didn't go for a general purpose solution, instead what I did was match any sum that contains %e in every term and then simply pull out the first term using multthru to distribute the multiplication. matchdeclare(sumofexps,lambda([x],not(atom(x)) and op(x) = "+" and every(lambda([x],not(freeof(%e,x))),args(x)))); pulloutfirstexp(sumofx) := part(sumofx,1)*(multthru(1/part(sumofx,1),sumofx)); defrule(sumexp,sumofexps,pulloutfirstexp(sumofexps)); Applying this rule using apply1, together with starting my mnewton session at a better initial condition fixed my intermediate floating point overflow problems and I got the numerical answer I was looking for. From macrakis at alum.mit.edu Wed Oct 5 17:25:46 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 5 Oct 2011 18:25:46 -0400 Subject: [Maxima] vector syntax In-Reply-To: <1317850553.70302.YahooMailNeo@web161806.mail.bf1.yahoo.com> References: <1317850553.70302.YahooMailNeo@web161806.mail.bf1.yahoo.com> Message-ID: Thanks for your question. Maxima doesn't distribute "=" over lists the way it does, say "+". So [a,b]=[1,2] doesn't become [a=1,b=2]. This is perhaps to allow vector equations like a=[1,2,3], though honestly Maxima currently doesn't do much with such things. The easy way around this is simply to subtract instead of equating, as 'solve' implicitly solves each expression for 0: solve(E-M,[Ex,Ey,Ez]) Does that resolve your issue? -s On Wed, Oct 5, 2011 at 17:35, Ether Jones wrote: > > Hello. > > In the Maxima script below, why won't Maxima give a solution at Line 7? > Why do I have to use Lines 8,9,&10 to get a solution? > > Attached is the WMX file and a PNG screenshot of the output. > > --------------start Maxima script------------------------ > 1) kill(all)$ > 2) display2d: false; > 3) load("vect")$ > > 4) E: [Ex,Ey,Ez]; > 5) M: [1,2,3]; > > 6) E=M$ > 7) solve(%,[Ex,Ey,Ez]); > > 8) E[1]=M[1]$ > solve(%,Ex); > > 9) E[2]=M[2]$ > solve(%,Ey); > > 10) E[3]=M[3]$ > solve(%,Ez); > ---------------end Maxima script--------------------- > > _______________________________________________ > 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 Wed Oct 5 18:17:34 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 5 Oct 2011 16:17:34 -0700 Subject: [Maxima] slatec error message surpression? Message-ID: <741ABF5E64574D48B1AA599B50C183B2@edwinc367e16bd> Using my prev. message code for nint, which will call quad_qags for this example, I get results which agree with Mma's pdf tutorial on advanced numerical integration (http://www.wolfram.com/learningcenter/tutorialcollection/AdvancedNumericalIntegrationInMathematica/) for the integrand (p. 2, pdf 5) (x-2)^2 * sin (4000*x), over the interval (x,2,3) by using the default epsabs=0.0, epsrel = 1.0e-8, so only epsrel plays a role, but I get error no. 1 message from slatec (in all its glory), ------------------------------------------------ (%i29) details:true$ (%i30) nint( (x-2)^2 * sin (4000*x),x,2,3,limit=400); case quad_qags ***MESSAGE FROM ROUTINE DQAGS IN LIBRARY SLATEC. ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED * ABNORMAL RETURN * ERROR NUMBER = 1 * ***END OF MESSAGE "too many subintervals done" est. abs. error = 2.767763E-9 no. of evaluations = 16779 (%o30) -1.586246E-4 ----------------------------------- with the answer the *same* as Mma's answer. But it I let epsabs be the decider, by setting epsrel to 0.0, etc, no error message arrives from slatec, but the answer is not as accurate. ---------------------------------------------- (%i31) nint( (x-2)^2 * sin (4000*x),x,2,3,epsrel=0.0,epsabs=1e-4,limit=400); case quad_qags est. abs. error = 8.183297E-5 no. of evaluations = 10101 (%o31) -1.609751E-4 (%i32) nint( (x-2)^2 * sin (4000*x),x,2,3,epsrel=0.0,epsabs=1e-5,limit=400); case quad_qags est. abs. error = 6.045407E-6 no. of evaluations = 10437 (%o32) -1.586189E-4 (%i33) nint( (x-2)^2 * sin (4000*x),x,2,3,epsrel=0.0,epsabs=1e-8,limit=400); case quad_qags est. abs. error = 9.961624E-9 no. of evaluations = 14763 (%o33) -1.586246E-4 ------------------------------------------------ So, I am wondering if there is some global parameter which will allow me to turn off the automatic messages from slatec?? For this type of integral, the epsrel control parameter is a better choice, but leads to unwanted error messages. Ted Woollett From robert.dodier at gmail.com Wed Oct 5 22:28:45 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 5 Oct 2011 21:28:45 -0600 Subject: [Maxima] matching or some other thing for sums of exponentials? In-Reply-To: <4E8A4FA6.7030803@street-artists.org> References: <4E8A4FA6.7030803@street-artists.org> Message-ID: I guess I 'm a little late to the pary, but here's something that might work. matchdeclare ([aa, bb], all); matchdeclare (xx, "#" (0)); defmatch (eep, bb*%e^xx); matchdeclare (ee, lambda ([e], eep (e) # false)); defrule (ree, aa + ee, FOO (ee, aa)); FOO (x, y) := if op (x) = "+" then (eep (first (x)), y + exp (xx) * expand (x / exp (xx))) else y + x; Here are some examples making use of the above: (%i8) foo : 1 + x + exp(x) + 2*exp(u) - z*y*exp(-w); (%o8) -%e^-w*y*z+%e^x+x+2*%e^u+1 (%i9) ree (foo); (%o9) %e^-w*(-y*z+%e^(x+w)+2*%e^(w+u))+x+1 (%i10) apply1 (foo, ree); (%o10) %e^-w*((2*%e^(u-x)+1)*%e^(x+w)-y*z)+x+1 (%i11) apply1 (sin (foo), ree); (%o11) -sin(%e^-w*(y*z+(-2*%e^(u-x)-1)*%e^(x+w))-x-1) (%i12) bar : %pi * exp(%pi*x) - (1/2) * exp(-%pi*x); (%o12) %pi*%e^(%pi*x)-%e^-(%pi*x)/2 (%i13) apply1 (1 + blurf (bar), ree); (%o13) blurf((%pi-%e^-(2*%pi*x)/2)*%e^(%pi*x))+1 Hope this helps in some way. Robert Dodier From toy.raymond at gmail.com Thu Oct 6 01:19:01 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 05 Oct 2011 23:19:01 -0700 Subject: [Maxima] slatec error message surpression? In-Reply-To: <741ABF5E64574D48B1AA599B50C183B2@edwinc367e16bd> References: <741ABF5E64574D48B1AA599B50C183B2@edwinc367e16bd> Message-ID: <4E8D4855.2070808@gmail.com> On 10/5/11 4:17 PM, Edwin Woollett wrote: > Using my prev. message code for nint, which will > call quad_qags for this example, I get results which > agree with Mma's pdf tutorial on advanced numerical > integration > (http://www.wolfram.com/learningcenter/tutorialcollection/AdvancedNumericalIntegrationInMathematica/) > > > for the integrand (p. 2, pdf 5) > > (x-2)^2 * sin (4000*x), > over the interval (x,2,3) by using the default epsabs=0.0, > epsrel = 1.0e-8, so only epsrel plays a role, but I get I don't think that's true. If you set epsabs to 0, then you are telling quadpack that you want to get an absolute error of 0. I don't recall how epsabs and epsrel interact, though. > ------------------------------------------------ > > So, I am wondering if there is some global parameter > which will allow me to turn off the automatic > messages from slatec?? No, I don't think there is currently a way to do that, but from looking at the code it shouldn't be hard. > > For this type of integral, the epsrel control parameter is > a better choice, but leads to unwanted error messages. For the standard quadpack interface, I can see where it might be useful to turn off the messages because the return code is part of the answer so you can tell if the integration was apparently ok or not. But with your nint (which reminds of Fortran nint/aint, not numerical integration), there's no indication that anything went wrong, except if quadpack prints out the error message. I would not be happy to use such an interface. Ray From p.j.papasot at gmail.com Thu Oct 6 05:37:48 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Thu, 6 Oct 2011 13:37:48 +0300 Subject: [Maxima] Variables local to packages? Message-ID: Hi community, I am preparing a package for Maxima and I wonder if I can declare variables/functions local to the package, so that only functions defined within the package will have access to those variables. define_variable defines global variables which is not what I want. localdefines local variables or functions, but only inside a block. I am looking for something like local but package-oriented, not block-oriented. For example, suppose package foo.mac defines 2 global functions A and B. I am looking for a way to declare a variable/function C which would be local to the package, so that only functions A and B will have access to it. Such a local variable/function should not be visible to any other function defined outside foo.mac, so that typing values; in a Maxima session won't even list it. Such a functionality, often called data hiding, is absolutely necessary for creating something more complicated than a simple package, so I guess there is a way to do it in Maxima, although I was not able to find a way by looking to the documentation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From evan.cooch at gmail.com Thu Oct 6 08:17:35 2011 From: evan.cooch at gmail.com (Evan Cooch) Date: Thu, 06 Oct 2011 09:17:35 -0400 Subject: [Maxima] implicit diff & subst problems... In-Reply-To: References: <4E8C867D.2070101@gmail.com> <4E8C8AC3.7000504@eecs.berkeley.edu> <4E8C9120.5080706@gmail.com> Message-ID: <4E8DAA6F.1060303@gmail.com> Rupert -- thanks for your reply. Some quick follow-up below: On 10/5/2011 2:02 PM, Rupert Swarbrick wrote: > Richard Fateman's answer was correct: it doesn't make sense to > substitute numbers for x,y into "dy/dx". Something like the following > does work: > > (%i1) mat:matrix([0,s_a*m_2,s_a*m_3],[s_o,0,0],[0,s[a],s[a]]); > [ 0 m_2 s_a m_3 s_a ] > [ ] > (%o1) [ s_o 0 0 ] > [ ] > [ 0 s s ] > [ a a ] > (%i2) cp:charpoly(mat,lam); > 2 > (%o2) s m_3 s_a s_o - (s - lam) m_2 s_a s_o + (s - lam) lam > a a a > (%i3) depends(lam,s_a); > (%o3) [lam(s_a)] > (%i4) deriv:diff(cp,s_a); > dlam 2 dlam > (%o4) ---- m_2 s_a s_o + s m_3 s_o - (s - lam) m_2 s_o - lam ---- > ds_a a a ds_a > dlam > + 2 (s - lam) lam ---- > a ds_a > (%i5) sol:solve(deriv,'diff(lam,s_a)); > (s m_3 + (lam - s ) m_2) s_o > dlam a a > (%o5) [---- = - -------------------------------] > ds_a 2 > m_2 s_a s_o - 3 lam + 2 s lam > a > (%i6) subst([s_a=0.8,s_o=0.4,m_2=1.2,m_3=1.2,lam=1.1667],rhs(first(sol))); > 0.4 (1.2 s + 1.2 (1.1667 - s )) > a a > (%o6) - -------------------------------- > 2.3334 s - 3.699566670000001 > a > (%i7) subst(0.8, s[a], %); > (%o7) .3055443803163305 > > > The last line is because you seem to have got confused about s_a and > s[a]. Not so much confusion, as reflecting difficulty remembering that Maple and Maxima handle subst and implicit differentiation differently if a variable is 'subscripted' using s[a] (works in Maple, not in Maxima). I'll have to dig into the rhs(first(sol)) part of your 'solution'. It clearly works (based in a criterion that the result matches output from Maple, Mathematica, Gauss, and (heaven for fend) by hand), but I'm not really sure what it's doing. > I don't know why I'm getting 0.3 instead of the 0.8 you report > From Maple, but I suspect that's a typo from one of us. Indeed. You have m_2=m_3=1.2, whereas I was using m_2=1.2, m_3=1.4. > > Note that "rhs(first(sol))" above says to take the first thing in the > sol list (ie the equation) and then take its right hand side. > > Does this solve your problem for you? > > > Rupert > > > > PS Regarding your Maple example, I logged into a University computer to > check it out. Note that the response to your implicit diff line looks > like > > > implicitdiff(cp,lambda,s_a); > 2 > s_o (m_2 lambda + 3 s_a m_3) > ----------------------------- > 2 > 3 lambda - s_o s_a m_2 > > This doesn't have the left hand dlam/ds_a part, so substitution > actually makes sense. And this, I believe, is the key to why I was having trouble understanding what Maxima was doing. Maple doesn't care if a function is a derivative or not -- it is simply an entity into which you can substitute values for things all you want. There is a way to make Maple 'aware' that something is a derivative (or anything else), but I almost never use that, since all I generally want to do is (i) get the derivative, and (ii) evaluate it at a particular point. -------------- next part -------------- An HTML attachment was scrubbed... URL: From evan.cooch at gmail.com Thu Oct 6 11:02:01 2011 From: evan.cooch at gmail.com (Evan Cooch) Date: Thu, 06 Oct 2011 12:02:01 -0400 Subject: [Maxima] implicit diff & subst problems... /just to you. In-Reply-To: <4E8DBBF6.2090807@eecs.berkeley.edu> References: <4E8C867D.2070101@gmail.com> <4E8C8AC3.7000504@eecs.berkeley.edu> <4E8C9120.5080706@gmail.com> <4E8DAA6F.1060303@gmail.com> <4E8DBBF6.2090807@eecs.berkeley.edu> Message-ID: <4E8DD0F9.1000001@gmail.com> On 10/6/2011 10:32 AM, Richard Fateman wrote: > Somehow you really seem to be missing the point. > > diff(f(x),x) is an expression. If f is "undefined" it is left alone. > > substituting a number, say 3, for x in that expression produces > NONSENSE, namely > diff(f(3),3). > > One cannot compute a derivative with respect to a number. > No, but I can evaluate a derivative at a number. A derivative has heuristic meaning, but is also just an equation. I simply want to evaluate the equation at a particular value of all the parameters in the equation. You implicitily differentiate one equation yielding another equation, which you then evaluate. y^2+x^2=25 implicit diff of y on x: -x/y evaluate for x=3, y=2 : -3/2 Thats all I'm interested in doing. In Maple (for example), its a simple as f:=x^2+^2=25; implicitdiff(f,y,x); subs(x=3,y=2,%); Done -- returns -3/2. Now, an earlier answer gave me a clue as to how to accomplish this in Maxima -- it looks (to me) like when I execute the following --> mat:matrix([0,s_a*m_2,s_a*m_3],[s_o,0,0],[0,s_a,0]); --> cp:charpoly(mat,lambda); --> depends(lambda,s_a); --> deriv:diff(cp,s_a); --> sol:solve(deriv,'diff(lambda,s_a)); then what Maxima returns for sol is a vector, or some similar construct, where there is importance to the the LHS and RHS (which appear to be separately addressable), and that to use subst, you need to tell it to look/focus on the RHS, and ignore the LHS, where the LHS indicates that it is a derivative, which is true, but irrelevant to the purpose of numerically evaluating the function. (%o9) ['diff(lambda,s_a,1)=(m_2*s_o*lambda+2*m_3*s_a*s_o)/(3*lambda^2-m_2*s_a*s_o)] My clue (prompted by the earlier email) was noticing that sol is returned inside [ ]. So, the LHS has a distinct 'meaning', as does the RHS. I'm only interested in the 'equation' (RHS), so I simply subst values for all the parameters into the RHS (%i10) subst([s_a=0.8,s_o=0.5,m_2=1.2,m_3=1.4,lambda=0.9704],rhs(first(sol))); (%o10) 0.725893103012548 which is exactly what I was looking for. As Rupert Swarbrick usefully noted in his reply (which is whee the light bulb started to flicker on over my head), when Maple does implicit differentiation, > implicitdiff(cp,lambda,s_a); 2 s_o (m_2 lambda + 3 s_a m_3) ----------------------------- 2 3 lambda - s_o s_a m_2 This doesn't have the left hand dlam/ds_a part, so substitution actually makes sense. Exactly -- dlam/ds_a isn't a 'part' of the answer because Maple basically processes (differentiates) one equation yielding another equation, which is stateless -- in Maple, an equation doesn't have an implicit context based on how it was derived. This seems to not be the case for Maxima, where the LHS (dlam/ds_a in the example), actually has meaning and context. And which is why subst didn't work when I tried it initially. So, my confusion stemmed from the fact the Maple (where I'm coming from) doesn't 'care' about the source of the expression you're trying to subst into, whereas Maxima does (more or less). -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlakelan at street-artists.org Thu Oct 6 12:00:32 2011 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 06 Oct 2011 10:00:32 -0700 Subject: [Maxima] implicit diff & subst problems... /just to you. In-Reply-To: <4E8DD0F9.1000001@gmail.com> References: <4E8C867D.2070101@gmail.com> <4E8C8AC3.7000504@eecs.berkeley.edu> <4E8C9120.5080706@gmail.com> <4E8DAA6F.1060303@gmail.com> <4E8DBBF6.2090807@eecs.berkeley.edu> <4E8DD0F9.1000001@gmail.com> Message-ID: <4E8DDEB0.3030509@street-artists.org> On 10/06/2011 09:02 AM, Evan Cooch wrote: > Now, an earlier answer gave me a clue as to how to accomplish this in > Maxima -- it looks (to me) like when I execute the following > > > --> mat:matrix([0,s_a*m_2,s_a*m_3],[s_o,0,0],[0,s_a,0]); > --> cp:charpoly(mat,lambda); > --> depends(lambda,s_a); > --> deriv:diff(cp,s_a); > --> sol:solve(deriv,'diff(lambda,s_a)); > > > then what Maxima returns for sol is a vector, or some similar construct, > where there is importance to the the LHS and RHS (which appear to be > separately addressable), and that to use subst, you need to tell it to > look/focus on the RHS, and ignore the LHS, where the LHS indicates that > it is a derivative, which is true, but irrelevant to the purpose of > numerically evaluating the function. Maxima is giving you an equation (actually a list of equations, in case there might be more than one solution), every equation has a left and a right hand side. In this case, the left hand side tells you what was solved for, and the right hand side tells you the solution. If you substitute into the equation you will be substituting into both sides. That is why you must take the right hand side before using subst to evaluate. From woollett at charter.net Thu Oct 6 12:26:50 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 6 Oct 2011 10:26:50 -0700 Subject: [Maxima] slatec error message surpression? Message-ID: <68AB52C8E0EC4946977D1334BE48BB01@edwinc367e16bd> Thanks for the feedback on quadpack and any potential interface. You write: ------------------------ >> over the interval (x,2,3) by using the default epsabs=0.0, >> epsrel = 1.0e-8, so only epsrel plays a role, but I get >I don't think that's true. If you set epsabs to 0, then you are telling >quadpack that you want to get an absolute error of 0. I don't recall >how epsabs and epsrel interact, though. --------------------------------------------------- You will get the default options settings if you use an integrand containing an undefined symbol, in which case quad_qags (for example) returns a noun form: (%i3) quad_qags(a*x,x,0,1); (%o3) quad_qags(a x, x, 0, 1, epsrel = 1.0E-8, epsabs = 0.0, limit = 200) It is clear that this set of defaults is not meant to ask for an answer with zero absolute error (which is also not possible usually in any floating point calculation). The example I used, in fact, showed that a more accurate answer is returned by using epsabs=0.0, in which case the relative error criterion is the complete decider on precision goals being met. Detailed examples and comparisons of the effects, in practice, of using one or the other of these parameters to control the calculation are included in Ch. 8, Numerical Integration (Maxima by Example). You later write: ---------------------------------------- >For the standard quadpack interface, I can see where it might be useful >to turn off the messages because the return code is part of the answer >so you can tell if the integration was apparently ok or not. But with >your nint (which reminds of Fortran nint/aint, not numerical >integration), there's no indication that anything went wrong, except if >quadpack prints out the error message. -------------------------------------------------- The current version of nint always writes an error message to the console screen whenever the error number is not 0. Hence nint satisfies your justified desire to be warned of anything not going right. And because I automatically write an error message to the screen, I would like to have a way to locally turn off the automatic slatec error message reporting to the screen. That being said, I don't understand error number 1 being declared for my example. It seems counterintuitive that slatec complains with the progress using a choice of options that leads to the most accurate answer. As to the weird name, nint is just a short easily typed placeholder for a better name. As the archives reveal, there was a long and passionate exchange of views long ago about another proposed numerical integration packager function, which I think was called nintegrate. There were complaints about that name as well, and the whole effort was lost(?) in the mists of history. My attitude is that providing students etc with a less than perfect packaged numerical integrator is still a useful thing to do. Ted Woollett From mhw at netris.org Thu Oct 6 12:42:13 2011 From: mhw at netris.org (Mark H Weaver) Date: Thu, 06 Oct 2011 13:42:13 -0400 Subject: [Maxima] slatec error message surpression? In-Reply-To: <4E8D4855.2070808@gmail.com> (Raymond Toy's message of "Wed, 05 Oct 2011 23:19:01 -0700") References: <741ABF5E64574D48B1AA599B50C183B2@edwinc367e16bd> <4E8D4855.2070808@gmail.com> Message-ID: <87d3eat3t6.fsf@yeeloong.netris.org> Raymond Toy writes: > On 10/5/11 4:17 PM, Edwin Woollett wrote: >> Using my prev. message code for nint, which will >> call quad_qags for this example, I get results which >> agree with Mma's pdf tutorial on advanced numerical >> integration >> (http://www.wolfram.com/learningcenter/tutorialcollection/AdvancedNumericalIntegrationInMathematica/) >> >> >> for the integrand (p. 2, pdf 5) >> >> (x-2)^2 * sin (4000*x), >> over the interval (x,2,3) by using the default epsabs=0.0, >> epsrel = 1.0e-8, so only epsrel plays a role, but I get > I don't think that's true. If you set epsabs to 0, then you are telling > quadpack that you want to get an absolute error of 0. I don't recall > how epsabs and epsrel interact, though. It's explained at the top of dqags.f: C***PURPOSE The routine calculates an approximation result to a given C Definite integral I = Integral of F over (A,B), C Hopefully satisfying following claim for accuracy C ABS(I-RESULT).LE.MAX(EPSABS,EPSREL*ABS(I)). So Edwin is correct. If EPSABS is 0 then only EPSREL plays a role, and vice versa. Best, Mark From evan.cooch at gmail.com Thu Oct 6 13:36:15 2011 From: evan.cooch at gmail.com (Evan Cooch) Date: Thu, 06 Oct 2011 14:36:15 -0400 Subject: [Maxima] implicit diff & subst problems... /just to you. In-Reply-To: <4E8DDEB0.3030509@street-artists.org> References: <4E8C867D.2070101@gmail.com> <4E8C8AC3.7000504@eecs.berkeley.edu> <4E8C9120.5080706@gmail.com> <4E8DAA6F.1060303@gmail.com> <4E8DBBF6.2090807@eecs.berkeley.edu> <4E8DD0F9.1000001@gmail.com> <4E8DDEB0.3030509@street-artists.org> Message-ID: <4E8DF51F.10605@gmail.com> Indeed -- so I finally figured out, with the help of many replies to my original query. Thanks! On 10/6/2011 1:00 PM, dlakelan wrote: > On 10/06/2011 09:02 AM, Evan Cooch wrote: > >> Now, an earlier answer gave me a clue as to how to accomplish this in >> Maxima -- it looks (to me) like when I execute the following >> >> >> --> mat:matrix([0,s_a*m_2,s_a*m_3],[s_o,0,0],[0,s_a,0]); >> --> cp:charpoly(mat,lambda); >> --> depends(lambda,s_a); >> --> deriv:diff(cp,s_a); >> --> sol:solve(deriv,'diff(lambda,s_a)); >> >> >> then what Maxima returns for sol is a vector, or some similar construct, >> where there is importance to the the LHS and RHS (which appear to be >> separately addressable), and that to use subst, you need to tell it to >> look/focus on the RHS, and ignore the LHS, where the LHS indicates that >> it is a derivative, which is true, but irrelevant to the purpose of >> numerically evaluating the function. > Maxima is giving you an equation (actually a list of equations, in case > there might be more than one solution), every equation has a left and a > right hand side. In this case, the left hand side tells you what was > solved for, and the right hand side tells you the solution. If you > substitute into the equation you will be substituting into both sides. > That is why you must take the right hand side before using subst to > evaluate. > _______________________________________________ > 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 Oct 6 16:25:56 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 6 Oct 2011 14:25:56 -0700 Subject: [Maxima] slatec error message surpression? References: <741ABF5E64574D48B1AA599B50C183B2@edwinc367e16bd> Message-ID: <9EAF55048B5044F0953C102D6A889E0C@edwinc367e16bd> >I think the error message is appropriate. You've requested a relerr of >1d-8, but the actual relerr is about 1d-5. What >did you expect qags to do >in this case? There are three issues here. 1. I initially accepted the default nominal rel error goal which ignored both the approximate value of the expected result and the number of significant figures desired. 2. the actual rel error of slatec returned results is usually of the order of 10^(-6) times the requested rel error precision (ie, much more accurate). 3. given a requested precision, one can avoid the slatec error message by increasing the limit value. ------------------------------------------------- here we calculate the true value first using integrate and float. (%i1) (display2d:false,fpprintprec:6)$ (%i2) g : (x-2)^2 * sin (4000*x)$ (%i3) integrate(g,x,2,3); (%o3) (4000*sin(12000)-7999999*cos(12000))/32000000000-cos(8000)/32000000000 (%i4) tval : float(%); (%o4) -1.586246E-4 proceeding very roughly, for six figure precision, we need abs error <= 10^(-10) or rel error <= (abs err)/ value = 6.7 10^(-7) =appr 10^(-6) so use quad_qags directly: (%i5) qval : quad_qags(g,x,2,3,epsrel=1.0e-6,limit=400)[1]; ***MESSAGE FROM ROUTINE DQAGS IN LIBRARY SLATEC. ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED * ABNORMAL RETURN * ERROR NUMBER = 1 * ***END OF MESSAGE (%o5) -1.586246E-4 <---- answer (%i6) abs(qval - tval); (%o6) 7.375285E-17 <------abs error (%i7) %/abs(tval); (%o7) 4.64952E-13 <------rel error - note how small so increase limit value: (%i8) qval : quad_qags(g,x,2,3,epsrel=1.0e-6,limit=600)[1]; no message from slatec (%o8) -1.586246E-4 <---- answer (%i9) abs(qval-tval); (%o9) 5.838429E-17 <-------abs error (%i10) %/abs(tval); (%o10) 3.680657E-13 <------- rel error note - how small likewise with nint: (%i11) load(nint); (%o11) "c:/work2/nint.mac" (%i12) nint(g,x,2,3,epsrel=1.0e-6,limit=600); (%o12) -1.586246E-4 The actual relative error of slatec returned result is typically 10^(-6) to 10^(-7) smaller than the requested value, so we can get good results using here epsrel=1.0e-2 (but still have to increase limit to avoid slatec message 1). (%i14) nint(g,x,2,3,epsrel=1.0e-2,limit=400); (%o14) -1.586245E-4 --------------------------------------------------- > >For such highly oscillatory integrals some other approach could be used >like quad_qawo. It says: > >quad_qawo((x-2)^2,x, 2,3,4000,'sin); > [- 1.586246466526855e-4, 0.0, 25, 0] > >As accurate, and much less expensive too! Double win! --------------------------------------------------------------- I completely agree a double win, but a lot more work to incorporate this efficiency bonus into a wrapper for quadpack routines. 1. The nintegrate function must detect the highly oscillatory nature of the integrand. 2. Only sometimes is the oscillation due simply to a factor of sin(...something ), which would also have to be identified to include the correct sin or cos expected by quad_qawo which is designed to calculate fourier series coefficients. 3. The only quadpack function really suitable for highly oscillating integrands in general is quad_qag, in which you have to supply the 'key' as an additional argument, a number from 1 to 6 to select the order of the method. So using quad_qag, you need to both detect rapid oscillations, and decide on the 'key' value. My initial approach is to sacrifice efficiency for a reasonably accurate result for down and dirty use, by a student or engineer, who often is not interested in high precision, but in four or six figure accuracy. One approach is to have the user input a requested rel error precision goal (if not the default), and inside nint we could use our knowledge that usually quad_qags returns a result that has a lot more rel error precision than the nominal value input to quad_qags. Thanks for your feedback. Ted From toy.raymond at gmail.com Thu Oct 6 17:15:26 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 6 Oct 2011 15:15:26 -0700 Subject: [Maxima] slatec error message surpression? In-Reply-To: <9EAF55048B5044F0953C102D6A889E0C@edwinc367e16bd> References: <741ABF5E64574D48B1AA599B50C183B2@edwinc367e16bd> <9EAF55048B5044F0953C102D6A889E0C@edwinc367e16bd> Message-ID: On Thu, Oct 6, 2011 at 2:25 PM, Edwin Woollett wrote: > > I think the error message is appropriate. You've requested a relerr of >> 1d-8, but the actual relerr is about 1d-5. What >did you expect qags to do >> in this case? >> > > There are three issues here. > > 1. I initially accepted the default nominal rel error goal > which ignored both the approximate value of the > expected result and the number of significant figures > desired. > > 2. the actual rel error of slatec returned results is usually > of the order of 10^(-6) times the requested rel error precision > (ie, much more accurate). > > 3. given a requested precision, one can avoid the slatec error > message by increasing the limit value. > ------------------------------**------------------- > here we calculate the true value first using integrate and float. > > (%i1) (display2d:false,fpprintprec:**6)$ > (%i2) g : (x-2)^2 * sin (4000*x)$ > (%i3) integrate(g,x,2,3); > (%o3) (4000*sin(12000)-7999999*cos(**12000))/32000000000-cos(8000)/** > 32000000000 > (%i4) tval : float(%); > (%o4) -1.586246E-4 > > proceeding very roughly, > for six figure precision, we need abs error <= 10^(-10) > or rel error <= (abs err)/ value = 6.7 10^(-7) =appr 10^(-6) > > so use quad_qags directly: > > (%i5) qval : quad_qags(g,x,2,3,epsrel=1.0e-**6,limit=400)[1]; > > > ***MESSAGE FROM ROUTINE DQAGS IN LIBRARY SLATEC. > ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED > * ABNORMAL RETURN > * ERROR NUMBER = 1 > * > ***END OF MESSAGE > > (%o5) -1.586246E-4 <---- answer > > (%i6) abs(qval - tval); > (%o6) 7.375285E-17 <------abs error > > (%i7) %/abs(tval); > (%o7) 4.64952E-13 <------rel error - note how small > So? I think it just means that quadpack was rather conservative in its estimate of what the relative error actually was and the limit was too low for quadpack to refine the estimate any further. But what if you didn't know the analytical solution and therefore the "true" error? All you would have is the estimated value. Then what? Also, how about this: quad_qags(g,x,2,3)-> [- 1.6023580453445135e-4, .005299669215071409, 8379, 1] The actual relative error is 1d-2, far above the requested default relative error. > 1. The nintegrate function must detect the highly oscillatory nature > of the integrand. > 2. Only sometimes is the oscillation due simply to a factor of > sin(...something ), which would also have to be identified > to include the correct sin or cos expected by quad_qawo > which is designed to calculate fourier series coefficients. > 3. The only quadpack function really suitable for highly > oscillating integrands in general is quad_qag, in which > you have to supply the 'key' as an additional argument, > a number from 1 to 6 to select the order of the method. > I didn't say it would be easy to automate this. :-) > > So using quad_qag, you need to both detect rapid oscillations, > and decide on the 'key' value. > > My initial approach is to sacrifice efficiency for a reasonably > accurate result for down and dirty use, by a student or engineer, > who often is not interested in high precision, but in four or six > figure accuracy. > For some quick and dirty hack it's ok. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Thu Oct 6 18:30:54 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 6 Oct 2011 16:30:54 -0700 Subject: [Maxima] slatec error message surpression? References: <741ABF5E64574D48B1AA599B50C183B2@edwinc367e16bd><9EAF55048B5044F0953C102D6A889E0C@edwinc367e16bd> Message-ID: <16358CD58B64453194A16A8957E55262@edwinc367e16bd> On Oct. 6, 2011, Raymond Toy wrote: ------------------------------- >So? I think it just means that quadpack was rather conservative in its >estimate of what the relative error actually was >and the limit was too low >for quadpack to refine the estimate any further. > >But what if you didn't know the analytical solution and therefore the >"true" error? All you would have is the >estimated value. Then what? The first step should be to roughly estimate the size of the integral. I think quad_qag with key = 6, limit = 800, epsrel = 1.0E-2 just to get a rough value, even if an oscillatory integrand. The next step is to use either quad_qag (default) or quad_qags (if option 'singular' is added to the input line) and just use reasonable values for the optional parameters, hide the intermediate results from the users, (that also means to surpress the slatec error messages) and use the results returned to use better option values if needed to get the default or requested precision. This might require several passes. If the integrand is too hard, we simply tell the user that. Ted From javier.arantegui at gmail.com Fri Oct 7 03:28:27 2011 From: javier.arantegui at gmail.com (Javier Arantegui) Date: Fri, 7 Oct 2011 10:28:27 +0200 Subject: [Maxima] Bug in xmaxima for Mac OS X Message-ID: Hello, I'm not sure if here is the right place to report this small bug I found trying to run the version of xmaxima that can be found in the binary package of Maxima for Mac OS X available at Sourceforge. If it isn't, please let me know where should I report it. To run xmaxima I went to the right directory. In my case is: /Applications/Maxima/Maxima.app/Contents/Resources/maxima/bin Then I run in a Terminal: ./xmaxima I got a window with the following error message: Maxima data directory not found in '/Users/drasko/Desktop/Maxima.app/Contents/Resources/maxima/share/' After validating the error, it appears again in different way: Documentation not found in '/Users/drasko/Desktop/Maxima.app/Contents/Resources/maxima/share/maxima/5.25.1' One more error window, and the program closes. Best, Javier -- Lee mi blog: "Un peque?o paso para Neil" http://up3n.wordpress.com/ ?Ahora tambi?n en Twitter! http://twitter.com/javierarantegui From cedric.listes at gmail.com Fri Oct 7 03:51:45 2011 From: cedric.listes at gmail.com (=?ISO-8859-1?Q?c=E9dric_ody?=) Date: Fri, 7 Oct 2011 10:51:45 +0200 Subject: [Maxima] solving a pde with finite differences Message-ID: 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 2011/10/7 Javier Arantegui > Hello, > > I'm not sure if here is the right place to report this small bug I > found trying to run the version of xmaxima that can be found in the > binary package of Maxima for Mac OS X available at Sourceforge. If it > isn't, please let me know where should I report it. > > To run xmaxima I went to the right directory. In my case is: > > /Applications/Maxima/Maxima.app/Contents/Resources/maxima/bin > > Then I run in a Terminal: > > ./xmaxima > > I got a window with the following error message: > > Maxima data directory not found in > '/Users/drasko/Desktop/Maxima.app/Contents/Resources/maxima/share/' > > After validating the error, it appears again in different way: > > Documentation not found in > > '/Users/drasko/Desktop/Maxima.app/Contents/Resources/maxima/share/maxima/5.25.1' > > One more error window, and the program closes. > > Best, > > 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 villate at fe.up.pt Fri Oct 7 10:45:28 2011 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 07 Oct 2011 16:45:28 +0100 Subject: [Maxima] Bug in xmaxima for Mac OS X In-Reply-To: References: Message-ID: <1318002328.5336.14.camel@B233-01> On Fri, 2011-10-07 at 10:28 +0200, Javier Arantegui wrote: > I'm not sure if here is the right place to report this small bug I > found trying to run the version of xmaxima that can be found in the > binary package of Maxima for Mac OS X available at Sourceforge. If it > isn't, please let me know where should I report it. Hi, thanks for reporting the problem. This is the right place to report it. > To run xmaxima I went to the right directory. In my case is: > /Applications/Maxima/Maxima.app/Contents/Resources/maxima/bin > Then I run in a Terminal: > ./xmaxima > I got a window with the following error message: > Maxima data directory not found in > '/Users/drasko/Desktop/Maxima.app/Contents/Resources/maxima/share/' It looks like Xmaxima was installed in a users' home directory and after it was installed, the executable was moved to /Applications. Xmaxima is a tcl script with some paths hard-coded at installation time. Unfortunately, I do not work with Mac systems so I cannot try to reproduce the conditions that lead to the bug. I don't know who has created the Mac Os version available in Sourceforge. It they installed Xmaxima as a Starkit archive, it will be harder to solve the problem. On the other hand, if /Applications/Maxima/Maxima.app/Contents/Resources/maxima/bin/xmaxima in your system is just a Tcl script, it can be edited with a text editor to fix the wrong values for the directories (they have been placed inside an array called autoconf). > After validating the error, it appears again in different way: > Documentation not found in > '/Users/drasko/Desktop/Maxima.app/Contents/Resources/maxima/share/maxima/5.25.1' > One more error window, and the program closes. As I said, I cannot help with the Mac OS version of Maxima that is being distributed in Sourceforge, but I can modify Xmaxima for future versions in order to prevent if from exiting when the documentation is not found (which is the current behavior). For the time being, you could help me a lot by sending me (in private to villate at fe.up.pt) a copy of your file /Applications/Maxima/Maxima.app/Contents/Resources/maxima/bin/xmaxima so I can take a look at it and try to fix it. Cheers, Jaime From toy.raymond at gmail.com Fri Oct 7 10:49:46 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 7 Oct 2011 08:49:46 -0700 Subject: [Maxima] slatec error message surpression? In-Reply-To: <16358CD58B64453194A16A8957E55262@edwinc367e16bd> References: <741ABF5E64574D48B1AA599B50C183B2@edwinc367e16bd> <9EAF55048B5044F0953C102D6A889E0C@edwinc367e16bd> <16358CD58B64453194A16A8957E55262@edwinc367e16bd> Message-ID: On Thu, Oct 6, 2011 at 4:30 PM, Edwin Woollett wrote: > On Oct. 6, 2011, Raymond Toy wrote: > ------------------------------**- > > So? I think it just means that quadpack was rather conservative in its >> estimate of what the relative error actually was >and the limit was too low >> for quadpack to refine the estimate any further. >> >> But what if you didn't know the analytical solution and therefore the >> "true" error? All you would have is the >estimated value. Then what? >> > > The first step should be to roughly estimate the size of the > integral. I think quad_qag with key = 6, limit = 800, epsrel = 1.0E-2 > just to get a rough value, even if an oscillatory integrand. > What will you do with the rough value? Why not just try both qag and qags and choose the one that gives the "better" answer? You might find the following interesting: http://trac.common-lisp.net/f2cl/browser/packages/quadpack/quadpack-tests.lisp It's in lisp, but you don't need to know lisp. Just read the comments. These are a bunch of tests given in the quadpack book. There are a bunch of tests illustrating the performance of several algorithms on different integrals. Some are comparisons of the same integral with different algorithms. The book also said something about having to do some thinking before applying the algorithms. I believe there was an example there that was very difficult for quadpack, but a little bit of thought allowed you to change the integral into something that was much easier. There was also some tips on how to do multiple integrals that might be useful. (There was a restriction there on using different algorithms for the multiple integrals, but maxima shouldn't have that problem because all the storage is local, so recursive calls should not be a problem.) I will look into suppressing the slatec messages. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri Oct 7 11:26:42 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 7 Oct 2011 09:26:42 -0700 Subject: [Maxima] slatec error message surpression? In-Reply-To: References: <741ABF5E64574D48B1AA599B50C183B2@edwinc367e16bd> <9EAF55048B5044F0953C102D6A889E0C@edwinc367e16bd> <16358CD58B64453194A16A8957E55262@edwinc367e16bd> Message-ID: On Fri, Oct 7, 2011 at 8:49 AM, Raymond Toy wrote: > > > I will look into suppressing the slatec messages. > Stick the following in, say, j4save.lisp: (in-package :maxima) (defun quad-j4save (parameter &optional new-value) (values (slatec::j4save (case parameter ($current_error 1) ($control 2) ($max_message 4)) (or new-value 0) (if new-value t nil)))) (defun $quad_j4save (parameter &optional new-value) (quad-j4save parameter new-value)) And then :lisp (load "j4save.lisp"). Here is an example: (%i15) quad_qags((x-2)^2*sin(4000*x),x,2,3); ***MESSAGE FROM ROUTINE DQAGS IN LIBRARY SLATEC. ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED * ABNORMAL RETURN * ERROR NUMBER = 1 * ***END OF MESSAGE (%o15) [- 1.6023580453445135e-4, .005299669215071409, 8379, 1] (%i16) quad_j4save('control, 0); (%o16) 2 (%i17) quad_qags((x-2)^2*sin(4000*x),x,2,3); (%o17) [- 1.6023580453445135e-4, .005299669215071409, 8379, 1] (%i18) quad_j4save('current_error); (%o18) 1 (%i19) quad_j4save('control); (%o19) 0 So setting 'control to 0 suppresses the output, and quad_j4save returns the previous value of the 'control flag. 'current_error returns the current error number. This is not the greatest interface, but it works. Suggestions welcome on a better interface (and name). Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Fri Oct 7 12:26:23 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 07 Oct 2011 13:26:23 -0400 Subject: [Maxima] if then and unit_step Message-ID: It has occurred to me on various occasions, that you can do logic in Maxima by using step functions. The unit_step() function, which is used in pw for representing piecewise functions, is bi-valued. So are Boolean expressions. You can represent connectors like "and", "or" and "not" as expressions involving unit_step(). Consider if x>a and x>b then u else v; It is equivalent to the following, if you agree with the idea that how an expression evaluates is all that matters. (u - v) * unit_step(x - max(a, b)) + v; then there is "or" as in the following if x>a or x>b then u else v; It is equivalent to the following. (u - v) * unit_step(x - min(a, b)) + v; Another possibility is if (x > a) and (x < b) then u else v (v - u) * unit_step(x - b) + (u - v) * unit_step(x - a) + v Rich From macrakis at alum.mit.edu Fri Oct 7 12:36:02 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 7 Oct 2011 13:36:02 -0400 Subject: [Maxima] if then and unit_step In-Reply-To: References: Message-ID: All that is true, but not terribly useful, since Maxima does very few simplifications on unit_step, not even unit_step(x)*unit_step(-x) => 0. -s On Fri, Oct 7, 2011 at 13:26, Richard Hennessy wrote: > It has occurred to me on various occasions, that you can do logic in Maxima > by using step functions. The unit_step() function, which is used in pw for > representing piecewise functions, is bi-valued. So are Boolean expressions. > You can represent connectors like "and", "or" and "not" as expressions > involving unit_step(). > > Consider if x>a and x>b then u else v; > > It is equivalent to the following, if you agree with the idea that how an > expression evaluates is all that matters. > > (u - v) * unit_step(x - max(a, b)) + v; > > then there is "or" as in the following > > if x>a or x>b then u else v; > > It is equivalent to the following. > > (u - v) * unit_step(x - min(a, b)) + v; > > Another possibility is > > if (x > a) and (x < b) then u else v > > (v - u) * unit_step(x - b) + (u - v) * unit_step(x - a) + v > > 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 Fri Oct 7 13:04:10 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 07 Oct 2011 11:04:10 -0700 Subject: [Maxima] if then and unit_step In-Reply-To: References: Message-ID: <4E8F3F1A.9090504@eecs.berkeley.edu> On 10/7/2011 10:26 AM, Richard Hennessy wrote: > It has occurred to me on various occasions, that you can do logic in > Maxima by using step functions. > The unit_step() function, which is used in pw for representing > piecewise functions, is bi-valued. So are Boolean expressions. > You can represent connectors like "and", "or" and "not" as expressions > involving unit_step(). In maxima, "if"s can result in evaluating the "then" clause, the "else" clause, an error (prederror), or an unevaluated expression. > > Consider if x>a and x>b then u else v; > > It is equivalent to the following, .... not really... > if you agree with the idea that how an expression evaluates is all > that matters. I'm not sure what you mean by this. > > > (u - v) * unit_step(x - max(a, b)) + v; no, can't do that since it evaluates both u and v. If it cannot be determined if " x>a and x>b" or not, then NEITHER u nor v is evaluated. I haven't looked at the rest of the stuff in detail, and it certainly could be both correct and useful in some context. Just that I'm pretty sure you can't automatically convert arbitrary maxima-version if's to it. Also I suspect evaluating conjunctions etc by "short circuiting" would cause results to differ. RJF From adammaj1 at o2.pl Fri Oct 7 14:37:03 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Fri, 07 Oct 2011 21:37:03 +0200 Subject: [Maxima] list order / draw-points joined In-Reply-To: References: <4E698715.2090802@telefonica.net> <4E6D4BA6.7070606@telefonica.net> Message-ID: <4E8F54DF.7090603@o2.pl> W dniu 2011-09-22 03:33, Rupert Swarbrick pisze: > Adam Majewski writes: >>> - First load up maxima-index.lisp. The easiest way is to type something >>> like >>> >>> (%i*) ? blarglblargl >> >> (%i1) ? blarglblargl; >> Maxima encountered a Lisp error: >> LOAD: A file with name /usr/local/share/info/maxima-index.lisp does not >> exist >> Automatically continuing. >> To enable the Lisp debugger set *debugger-hook* to nil. > > Welp. There's the problem. Probably you need to work out how to install > the program properly, including the documentation files, for the > documentation system to work... > > Rupert > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Right, Thx. (:-)) Adam From adammaj1 at o2.pl Fri Oct 7 14:37:03 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Fri, 07 Oct 2011 21:37:03 +0200 Subject: [Maxima] list order / draw-points joined In-Reply-To: References: <4E698715.2090802@telefonica.net> <4E6D4BA6.7070606@telefonica.net> Message-ID: <4E8F54DF.7090603@o2.pl> W dniu 2011-09-22 03:33, Rupert Swarbrick pisze: > Adam Majewski writes: >>> - First load up maxima-index.lisp. The easiest way is to type something >>> like >>> >>> (%i*) ? blarglblargl >> >> (%i1) ? blarglblargl; >> Maxima encountered a Lisp error: >> LOAD: A file with name /usr/local/share/info/maxima-index.lisp does not >> exist >> Automatically continuing. >> To enable the Lisp debugger set *debugger-hook* to nil. > > Welp. There's the problem. Probably you need to work out how to install > the program properly, including the documentation files, for the > documentation system to work... > > Rupert > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Right, Thx. (:-)) Adam From rich.hennessy at verizon.net Fri Oct 7 15:46:59 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 07 Oct 2011 16:46:59 -0400 Subject: [Maxima] if then and unit_step In-Reply-To: <4E8F3F1A.9090504@eecs.berkeley.edu> References: <4E8F3F1A.9090504@eecs.berkeley.edu> Message-ID: <86CAE2AA2C354005977E93F77FC3028A@RichsLaptop> On 10/7/2011 10:26 AM, Richard Hennessy wrote: > > Consider if x>a and x>b then u else v; > > It is equivalent to the following, .... not really... In some cases it does not matter. > if you agree with the idea that how an expression evaluates is all that > matters. I'm not sure what you mean by this. In mean in some cases it does not matter. > > > (u - v) * unit_step(x - max(a, b)) + v; "no, can't do that since it evaluates both u and v. If it cannot be determined if " x>a and x>b" or not, then NEITHER u nor v is evaluated." Well, it is good to be able to go the other way and convert to "if then" from the "unit_step form" if you want speedier calculations, in certain cases. Lets say you have a complex expression involving unit_step in a lot of places and you want to plot it. I have tried converting to "if then form" first and it does speed up how long it takes to plot, but it also takes time to do the converting. In some cases the whole process of converting to "if then form" and plotting is faster that just plotting the function "as is" in its original unit_step() form. I can provide an example in a .mac file. The reason is because the "if then" does not unconditionally evaluate BOTH u and v. Rich From rich.hennessy at verizon.net Fri Oct 7 15:53:34 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 07 Oct 2011 16:53:34 -0400 Subject: [Maxima] if then and unit_step In-Reply-To: References: Message-ID: <4391BB20DAB04C5AB2099F45A3258A7B@RichsLaptop> All that is true, but not terribly useful, since Maxima does very few simplifications on unit_step, not even unit_step(x)*unit_step(-x) => 0. Sometimes ratsimp() can simplify some cases, pw.mac can do some cases. I don?t think its useless. Rich -s On Fri, Oct 7, 2011 at 13:26, Richard Hennessy wrote: It has occurred to me on various occasions, that you can do logic in Maxima by using step functions. The unit_step() function, which is used in pw for representing piecewise functions, is bi-valued. So are Boolean expressions. You can represent connectors like "and", "or" and "not" as expressions involving unit_step(). Consider if x>a and x>b then u else v; It is equivalent to the following, if you agree with the idea that how an expression evaluates is all that matters. (u - v) * unit_step(x - max(a, b)) + v; then there is "or" as in the following if x>a or x>b then u else v; It is equivalent to the following. (u - v) * unit_step(x - min(a, b)) + v; Another possibility is if (x > a) and (x < b) then u else v (v - u) * unit_step(x - b) + (u - v) * unit_step(x - a) + v 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 Fri Oct 7 17:53:51 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Fri, 07 Oct 2011 18:53:51 -0400 Subject: [Maxima] if then and unit_step Message-ID: I should add, I have given up on Maxima being fast at plotting and some other types of problems that can be done better on a multicore machine or GPU or just using another programming language. Rich On 10/7/2011 10:26 AM, Richard Hennessy wrote: > > Consider if x>a and x>b then u else v; > > It is equivalent to the following, .... not really... In some cases it does not matter. > if you agree with the idea that how an expression evaluates is all that > matters. I'm not sure what you mean by this. In mean in some cases it does not matter. > > > (u - v) * unit_step(x - max(a, b)) + v; "no, can't do that since it evaluates both u and v. If it cannot be determined if " x>a and x>b" or not, then NEITHER u nor v is evaluated." Well, it is good to be able to go the other way and convert to "if then" from the "unit_step form" if you want speedier calculations, in certain cases. Lets say you have a complex expression involving unit_step in a lot of places and you want to plot it. I have tried converting to "if then form" first and it does speed up how long it takes to plot, but it also takes time to do the converting. In some cases the whole process of converting to "if then form" and plotting is faster that just plotting the function "as is" in its original unit_step() form. I can provide an example in a .mac file. The reason is because the "if then" does not unconditionally evaluate BOTH u and v. Rich From freddie at witherden.org Thu Oct 6 05:30:35 2011 From: freddie at witherden.org (Freddie Witherden) Date: Thu, 06 Oct 2011 11:30:35 +0100 Subject: [Maxima] Simplification of vector norms, logs and fractions Message-ID: <4E8D834B.7040902@witherden.org> Hello, I have two vectors, R = [x, y]^T and ri = [xi, yi]^T and wish to Taylor expand the function: log(abs(R - ri)) about ri = [0,0]^T where abs(v) == sqrt(v.v). So: (%i1) R : matrix([x],[y]); ri : matrix([xi],[yi]); [ x ] (%o1) [ ] [ y ] [ xi ] (%o2) [ ] [ yi ] (%i3) taylor(log(sqrt((R-ri).(R-ri))),[xi,yi],[0,0],2); 2 2 log(y + x ) x xi + y yi (%o3)/T/ ------------ - ----------- 2 2 2 x + y 2 2 2 2 2 2 (x - y ) xi + 4 y x yi xi + (- x + y ) yi - --------------------------------------------- 4 2 2 4 2 x + 4 y x + 2 y I am wondering how I can simplify the result so that 1/2*log(x^2+y^2) => log(abs(R)), x^2 + y^2 => abs(R)^2. It would be nice if the last term could be broken up as: 2 2 2 1 2 y 2 1 2 x yi (-- - ----) xi (-- - ----) 2 4 2 4 R R R R 2 x xi y yi --------------- + --------------- - ----------- 2 2 4 R I have played around with the various expand/contract/ratsimp options but can find nothing that does that kind of expansion. Can anyone point me in the correct direction? Regards, Freddie. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 262 bytes Desc: OpenPGP digital signature URL: From rswarbrick at gmail.com Sat Oct 8 04:54:39 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sat, 08 Oct 2011 10:54:39 +0100 Subject: [Maxima] if then and unit_step References: <4E8F3F1A.9090504@eecs.berkeley.edu> <86CAE2AA2C354005977E93F77FC3028A@RichsLaptop> Message-ID: "Richard Hennessy" writes: > Well, it is good to be able to go the other way and convert to "if > then" from the "unit_step form" if you want speedier calculations, in > certain cases. Lets say you have a complex expression involving > unit_step in a lot of places and you want to plot it. I have tried > converting to "if then form" first and it does speed up how long it > takes to plot, but it also takes time to do the converting. In some > cases the whole process of converting to "if then form" and plotting > is faster that just plotting the function "as is" in its original > unit_step() form. I can provide an example in a .mac file. The > reason is because the "if then" does not unconditionally evaluate BOTH > u and v. It's not just for speed. What Richard Fateman was referring to was that it can also be important for correctness. Consider something like this function of x: f(x) := if is(x > 0) then 1/x else 0 Trying to evaluate this via unit step functions would give something that included a 1/0 when evaluated at the wrong place. There are advantages to phrasing things in terms of the Heaviside step function. I'm not sure whether Maxima deals with this, but I worked with physicist who would write things like f(x) = g(x) + ?(x-x?)h(x) and then differentiate them, getting a distribution involving the Dirac delta. Obviously, it's much harder to see what is going on with an "if, else" definition. Richard: If you want to see more of such techniques (in a situation that's not the real line), you could try looking up "partitions of unity". It's a way to define a function piecewise on a manifold but glue together the bits so that the answer's 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 ballmann at sapo.pt Sat Oct 8 07:47:20 2011 From: ballmann at sapo.pt (Herbert Ballmann) Date: Sat, 08 Oct 2011 13:47:20 +0100 Subject: [Maxima] Behaviour of factor Message-ID: Just a question about 'factor': With a/b-a*%e^(b*x)/b; factor(%); The result is: -a*(%e^(b*x)-1)/b But with a/b-a*%e^(-b*x)/b; factor(%); I obtain: a*%e^(-b*x)*(%e^(b*x)-1)/b and not -a*(%e^(-b*x)-1)/b, as I expected. Is it not possible to have "%e^(-b*x)*(%e^(b*x)-1)" expanded to "1-"%e^(-b*x)"? Herbert Ballmann From maxima at etherjones.us Sat Oct 8 09:28:03 2011 From: maxima at etherjones.us (Ether Jones) Date: Sat, 8 Oct 2011 07:28:03 -0700 (PDT) Subject: [Maxima] isolating a common factor from a sum of terms Message-ID: <1318084083.96217.YahooMailNeo@web161811.mail.bf1.yahoo.com> Consider the following expression: -c5*v5*D-8*c2*v4*D-c5*h*D+u2*v2*v6+u3*v6-6*u4*v3+4*u2*v3-4*c2*u3*v2+4*u4-2*c2*u1+4*u1+4*c2*c4 Is there a straightforward way to factor out the common factor "2*c2" from the four terms in which it appears? Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sat Oct 8 11:57:40 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 8 Oct 2011 12:57:40 -0400 Subject: [Maxima] isolating a common factor from a sum of terms In-Reply-To: <1318084083.96217.YahooMailNeo@web161811.mail.bf1.yahoo.com> References: <1318084083.96217.YahooMailNeo@web161811.mail.bf1.yahoo.com> Message-ID: Here's one way: (%i1) ex: -c5*v5*D-8*c2*v4*D-c5*h*D+u2*v2*v6+u3*v6-6*u4*v3+4*u2*v3-4*c2*u3*v2+4*u4-2*c2*u1+4*u1+4*c2*c4$ (%i2) pullout(a,b):= block([t],t:divide(a,b), b*factor(t[1])+t[2])$ (%i3) pullout(ex,c2); (%o3) -2*c2*(4*v4*D+2*u3*v2+u1-2*c4)+(-c5*v5-c5*h)*D+(u2*v2+u3)*v6+(4*u2-6*u4)*v3+4*u4+4*u1 Try to restructure the remainder as well: (%i4) pullout1(a,b):=block([t],t:divide(a,b),b*factorsum(t[1])+factorsum(t[2]))$ (%i5) pullout1(ex,c2); (%o4) -2*c2*(4*v4*D+2*u3*v2+u1-2*c4)-c5*(v5+h)*D+(u2*v2+u3)*v6-2*(3*u4-2*u2)*v3+4*(u4+u1) A simpler way, with a slightly different result: (%i6) rat(ex,c2); (%o6) (-8*v4*D-4*u3*v2-2*u1+4*c4)*c2+(-c5*v5-c5*h)*D+(u2*v2+u3)*v6+(-6*u4+4*u2)*v3+4*u4+4*u1 (%i7) map(factor,%o6); (%o7) -2*c2*(4*v4*D+2*u3*v2+u1-2*c4)-c5*(v5+h)*D+(u2*v2+u3)*v6-2*(3*u4-2*u2)*v3+4*u4+4*u1 On Sat, Oct 8, 2011 at 10:28, Ether Jones wrote: > > -c5*v5*D-8*c2*v4*D-c5*h*D+u2*v2*v6+u3*v6-6*u4*v3+4*u2*v3-4*c2*u3*v2+4*u4-2*c2*u1+4*u1+4*c2*c4 -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sat Oct 8 11:57:53 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 8 Oct 2011 11:57:53 -0500 Subject: [Maxima] isolating a common factor from a sum of terms In-Reply-To: <1318084083.96217.YahooMailNeo@web161811.mail.bf1.yahoo.com> References: <1318084083.96217.YahooMailNeo@web161811.mail.bf1.yahoo.com> Message-ID: > -c5*v5*D-8*c2*v4*D-c5*h*D+u2*v2*v6+u3*v6-6*u4*v3+4*u2*v3-4*c2*u3*v2+4*u4-2*c2*u1+4*u1+4*c2*c4 > Is there a straightforward way to factor out the common factor "2*c2" from the four terms in which it appears? Try facsum (%i108) facsum(%,c2); (%o108) -2*c2*(4*v4*D+2*u3*v2+u1-2*c4)-c5*v5*D-c5*h*D+u2*v2*v6+u3*v6-6*u4*v3+4*u2*v3+4*u4+4*u1 --Barton From macrakis at alum.mit.edu Sat Oct 8 12:24:13 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 8 Oct 2011 13:24:13 -0400 Subject: [Maxima] Simplification of vector norms, logs and fractions In-Reply-To: <4E8D834B.7040902@witherden.org> References: <4E8D834B.7040902@witherden.org> Message-ID: Sometimes ratsubst(RR^2,x^2+y^2,...) will help in cases like this, but not here -- it is "overenthusiastic". How about map(factor,%o3) then subst(RR^2,x^2+y^2,%) Then you can wrangle it into the form you want with things like multthru(rat(%,xi,yi)) etc. Another way: part(%o3,3)$ args(multthru(%)) -- want to process each term separately ratsubst(RR,x^2+y^2,%) map(multthru,%) xreduce("+",%) -- put terms together again Not exactly the form you wanted, but close, and you could certainly do further manipulations. I'm using RR so that you won't have issues with R being expanded out at later stages, but you could also use 'R if you're careful. -s On Thu, Oct 6, 2011 at 06:30, Freddie Witherden wrote: > R : matrix([x],[y]); ri : matrix([xi],[yi]); -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Oct 8 13:49:04 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 8 Oct 2011 12:49:04 -0600 Subject: [Maxima] Variables local to packages? In-Reply-To: References: Message-ID: On 10/6/11, Panagiotis Papasotiriou wrote: > example, suppose package foo.mac defines 2 global functions A and B. I am > looking for a way to declare a variable/function C which would be local to > the package, so that only functions A and B will have access to it. Such a > local variable/function should not be visible to any other function defined > outside foo.mac, so that typing values; in a Maxima session won't even list > it. Well, there exists the share package "namespaces" which exposes CL's package mechanism. I guess it works OK. You can define A, B, and C in a namespace such that outside that namespace, A, B, and C refer to other things. e.g. ---- begin /tmp/foo.mac ---- in_namespace (foo); A (x) := 1 - x; B (x) := 2 * x; C : 12345; ---- end foo.mac ---- ---- in your Maxima session ---- load (namespaces); load_namespace ("/tmp/foo.mac"); A (100); => A(100) foo|A (100); => - 99 C; => C C : 5678; foo|C; => 12345 foo|C : 54321; C; => 5678 functions; => [foo|A(foo|x), foo|B(foo|x)] values; => [foo|C, C] ---- end Maxima session ---- Some notes: (1) namespaces are an experimental feature (2) namespaces are dynamic, not lexical: you change the namespace via in_namespace function call; the namespace isn't associated with a lexical unit (3) documentation in comment header of share/contrib/namespaces/namespaces.lisp (4) in_namespace changes the Lisp package so it has the potential to confuse Lisp code which makes assumptions about packages (:cl-user, :maxima, etc) (5) namespaces doesn't hide the existence of symbols At this point I would say that the biggest unresolved problem is to make sure that namespaces play nice w/ Lisp, and the biggest improvement would be to make namespaces lexical instead of dynamic. > Such a functionality, often called data hiding, is absolutely necessary for > creating something more complicated than a simple package, so I guess there > is a way to do it in Maxima, although I was not able to find a way by > looking to the documentation. Yeah -- Maxima's user language is pretty weak in that department ... Occasionally I have daydreams about replacing it with an existing language or an extension of one. E.g. Python + modified evaluation to allow partial evaluation of expressions. (Yes, I do understand that's a pretty big deal.) best Robert Dodier From rich.hennessy at verizon.net Sat Oct 8 18:53:56 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sat, 08 Oct 2011 19:53:56 -0400 Subject: [Maxima] if then and unit_step In-Reply-To: References: <4E8F3F1A.9090504@eecs.berkeley.edu> <86CAE2AA2C354005977E93F77FC3028A@RichsLaptop> Message-ID: -----Original Message----- From: Rupert Swarbrick Sent: Saturday, October 08, 2011 5:54 AM To: maxima at math.utexas.edu Subject: Re: [Maxima] if then and unit_step It's not just for speed. What Richard Fateman was referring to was that it can also be important for correctness. Consider something like this function of x: f(x) := if is(x > 0) then 1/x else 0 Trying to evaluate this via unit step functions would give something that included a 1/0 when evaluated at the wrong place. There are advantages to phrasing things in terms of the Heaviside step function. I'm not sure whether Maxima deals with this, but I worked with physicist who would write things like f(x) = g(x) + ?(x-x?)h(x) and then differentiate them, getting a distribution involving the Dirac delta. Obviously, it's much harder to see what is going on with an "if, else" definition. Richard: If you want to see more of such techniques (in a situation that's not the real line), you could try looking up "partitions of unity". It's a way to define a function piecewise on a manifold but glue together the bits so that the answer's smooth. Rupert Well, "partitions of unity" is something new for me to digest, I never heard of that term before. Manifolds also come up a lot when you are listening to mathematicians talk. I don't know what they are, but I can Google it and get basic information. Rich From shorne at energetiq.com Mon Oct 10 10:00:09 2011 From: shorne at energetiq.com (shorne at energetiq.com) Date: Mon, 10 Oct 2011 11:00:09 -0400 Subject: [Maxima] substitute for independent variable in 'diff Message-ID: I'm being driven nuts by something that should be easy... I have a simple differential equation that can be un-dimensionalized by defining a new timelike variable tau=t/u, or t=tau*u where u is a constant characteristic time. So that, starting from an equation that includes terms like 'diff(y(t),t,n) where n=1 or 2, I want to make a substitution of (tau*u) for t, and let the new factors of u that appear through the chain rule propagate through. Explicitly, for n=1, a term like 'diff(y(t),t,1) should become diff(y(tau*u) /u, tau,1) or 1/u * diff(y(tau*u),tau,1) when evaluated. Substitution into the first arg of diff is no issue, but diff won't evaluate unless the second argument is a single variable, not an expression. Even such a simple one. Is there an automagical way to produce this effect? I looked at pdiff but the examples are complicated enough that I haven't figured out how to apply it to this case. In any event, the manipulation I'm attempting to do is so simple that there must be a clean way to do it with the standard maxima primitives. I've grepped through the digests, of course, and found nothing on point... Please respond directly to my email (shorne at energetiq.com) -- (A separate problem I'm having is that I've stopped receiving email from the maxima list, - though I seem to still be subscribed - probably an issue with spam filtering at my end.) Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Mon Oct 10 10:15:52 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 10 Oct 2011 10:15:52 -0500 Subject: [Maxima] substitute for independent variable in 'diff In-Reply-To: References: Message-ID: maxima-bounces at math.utexas.edu wrote on 10/10/2011 10:00:09 AM: > I looked at pdiff but the examples are complicated enough that I > haven't figured out how to apply it to this case. Sorry about the overly complicated examples in pdiff :( A minimalist example: (%i1) load(pdiff)$ A DE (%i2) de : diff(f(x),x) = 42 * f(x); (%o2) f[(1)](x)=42*f(x) Let f(x) = g(42 * x) (%i3) de, f(x) := g(42 * x); (%o3) 42*g[(1)](42*x)=42*g(42*x) Replace 42 * x by x (%i4) ratsubst(x, 42*x,%); (%o4) 42*g[(1)](x)=42*g(x) And, if you like, solve for diff(g(x),x) (%i5) solve(%, diff(g(x),x)); (%o5) [g[(1)](x)=g(x)] So the DE for g is diff(g(x),x) = g(x). --Barton (author of pdiff) -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Oct 10 10:23:47 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 10 Oct 2011 11:23:47 -0400 Subject: [Maxima] Behaviour of factor In-Reply-To: References: Message-ID: Factor treats %e^(-b*x)*(%e^(b*x)-1) as a rational function (y-1)/y with y=%e^(b*x). Factor doesn't return 1-1/y because that is not in the standard rational function format poly1/poly2. There are several ways to force the form %e^(-b*x)-1. One is to temporarily substitute a positive exponent when factoring: expr: a/b-a*%e^(-b*x)/b$ subst(-b,mb,factor(subst(-mb,b,expr))); or subst(1/%e,%e,factor(subst(1/%e,%e,expr))); Another is to reorganize after the fact: fexpr: factor(expr); substpart(multthru(piece),fexpr,1,[2,3]) Does that resolve your issue? -s On Sat, Oct 8, 2011 at 08:47, Herbert Ballmann wrote: > Just a question about 'factor': > > With > a/b-a*%e^(b*x)/b; > factor(%); > The result is: -a*(%e^(b*x)-1)/b > > But with > a/b-a*%e^(-b*x)/b; > factor(%); > I obtain: a*%e^(-b*x)*(%e^(b*x)-1)/b > and not -a*(%e^(-b*x)-1)/b, as I expected. > > Is it not possible to have > "%e^(-b*x)*(%e^(b*x)-1)" expanded to "1-"%e^(-b*x)"? > > Herbert Ballmann > > > _______________________________________________ > 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 Oct 10 13:45:34 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 10 Oct 2011 11:45:34 -0700 Subject: [Maxima] slatec error message surpression? Message-ID: On Oct. 7, Raymond Toy wrote: --------------------------- > Stick the following in, say, j4save.lisp: ----------------------------------- Thanks for the error msg. surpression code, which works fine. ...................... (%i1) load("j4save.lisp"); (%o1) j4save.lisp (%i2) quad_qags((x-2)^2*sin(4000*x),x,2,3); ***MESSAGE FROM ROUTINE DQAGS IN LIBRARY SLATEC. ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED * ABNORMAL RETURN * ERROR NUMBER = 1 * ***END OF MESSAGE (%o2) [- 1.6023580453445113E-4, 0.0052996692150713, 8379, 1] (%i3) quad_j4save('control, 0); (%o3) 2 (%i4) quad_qags((x-2)^2*sin(4000*x),x,2,3); (%o4) [- 1.6023580453445113E-4, 0.0052996692150713, 8379, 1] (%i5) quad_j4save('current_error); (%o5) 1 (%i6) quad_j4save('control); (%o6) 0 (%i7) printfile("j4save.lisp"); ;;; j4save.lisp ;;; raymond toy ;;; Oct., 2011 (in-package :maxima) (defun quad-j4save (parameter &optional new-value) (values (slatec::j4save (case parameter ($current_error 1) ($control 2) ($max_message 4)) (or new-value 0) (if new-value t nil)))) (defun $quad_j4save (parameter &optional new-value) (quad-j4save parameter new-value)) (%o7) j4save.lisp ............................................... --------------------------------------------- >What will you do with the rough value? Why not just try both qag and qags >and choose the one that gives the "better" answer? > --------------------------------------------------- I had the same idea - go for a rough value using both qag and qags and look at the number of function evaluations needed; the one that needs the smallest # of func evals should then be tried first to get desired precision. ------------------------------------------- >You might find the following interesting: >http://trac.common-lisp.net/f2cl/browser/packages/quadpack/quadpack-tests.lisp ----------------------------------------------- Thanks for the test code. I can use these ideas to test nint. ------------------------------------------- >These are a bunch of tests given in the quadpack book. There are a bunch >of >tests illustrating the performance of several algorithms on different >integrals. Some are comparisons of the same integral with different >algorithms. > >The book also said something about having to do some thinking before >applying the algorithms. I believe there was an example there that was >very >difficult for quadpack, but a little bit of thought allowed you to change >the integral into something that was much easier. There was also some tips >on how to do multiple integrals that might be useful. (There was a >restriction there on using different algorithms for the multiple integrals, >but maxima shouldn't have that problem because all the storage is local, so >recursive calls should not be a problem.) ------------------------------------------------- Thanks for the reference. I have ordered a copy of Piessens' Quadpack:... Ted From O.Kullmann at swansea.ac.uk Mon Oct 10 17:48:52 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Mon, 10 Oct 2011 23:48:52 +0100 Subject: [Maxima] how to redirect printout into string? Message-ID: <20111010224852.GA9573@cs-wsok.swan.ac.uk> Hello, we have to use a function which has only a side effect, printing out its result. Is it possible to redirect this output into a string (so that we can process that output)? Thanks for your consideration. Oliver From toy.raymond at gmail.com Mon Oct 10 18:00:31 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 10 Oct 2011 16:00:31 -0700 Subject: [Maxima] how to redirect printout into string? In-Reply-To: <20111010224852.GA9573@cs-wsok.swan.ac.uk> References: <20111010224852.GA9573@cs-wsok.swan.ac.uk> Message-ID: On Mon, Oct 10, 2011 at 3:48 PM, Oliver Kullmann wrote: > Hello, > > we have to use a function which has only a side effect, > printing out its result. Is it possible to redirect > this output into a string (so that we can process that > output)? > > Perhaps with_stdout will do what you want? Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From O.Kullmann at swansea.ac.uk Mon Oct 10 18:23:27 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Tue, 11 Oct 2011 00:23:27 +0100 Subject: [Maxima] how to redirect printout into string? In-Reply-To: References: <20111010224852.GA9573@cs-wsok.swan.ac.uk> Message-ID: <20111010232327.GD5940@cs-wsok.swan.ac.uk> > we have to use a function which has only a side effect, > printing out its result. Is it possible to redirect > this output into a string (so that we can process that > output)? > > > Perhaps with_stdout will do what you want? What would be needed is a string-output-stream (a stream which is not a file, but where the output is put into a string), so that we do not have to open a file. But I am not aware of such a facility in Maxima? Thanks! Oliver -- 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 Mon Oct 10 18:49:10 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 10 Oct 2011 16:49:10 -0700 Subject: [Maxima] how to redirect printout into string? In-Reply-To: <20111010232327.GD5940@cs-wsok.swan.ac.uk> References: <20111010224852.GA9573@cs-wsok.swan.ac.uk> <20111010232327.GD5940@cs-wsok.swan.ac.uk> Message-ID: On Mon, Oct 10, 2011 at 4:23 PM, Oliver Kullmann wrote: > > we have to use a function which has only a side effect, > > printing out its result. Is it possible to redirect > > this output into a string (so that we can process that > > output)? > > > > > Perhaps with_stdout will do what you want? > > What would be needed is a string-output-stream (a stream which is not > a file, but where the output is put into a string), so that we > do not have to open a file. But I am not aware of such > a facility in Maxima? > > Probably wouldn't be too hard to add such a thing. But why not just return the string that you would have printed out? (Or list of strings or whatever). Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon Oct 10 19:50:35 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 10 Oct 2011 18:50:35 -0600 Subject: [Maxima] how to redirect printout into string? In-Reply-To: References: <20111010224852.GA9573@cs-wsok.swan.ac.uk> <20111010232327.GD5940@cs-wsok.swan.ac.uk> Message-ID: In addition to a file, with_stdout accepts a stream as an output destination. make_string_output_stream creates a Lisp string output stream. get_output_stream_string returns the stream's content. The latter 2 functions aren't documented; sorry, I guess that's an oversight. (They were added a few years ago.) e.g. (%i6) S : make_string_output_stream (); (%o6) # (%i7) with_stdout (S, print (HELLO)); (%o7) HELLO (%i8) get_output_stream_string (S); (%o8) HELLO There is also make_string_input_stream. HTH Robert Dodier From dbmaxima at gmail.com Tue Oct 11 04:32:12 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Tue, 11 Oct 2011 20:32:12 +1100 Subject: [Maxima] generalized Lambert In-Reply-To: References: , <1316961108.7795.5.camel@dieter>, <1316550272.1681.4.camel@dieter> <1316807377.1541.19.camel@dieter> Message-ID: <4E940D1C.7010509@gmail.com> On 30/09/2011 8:11 PM, Barton Willis wrote: > My generalized Lambert code doesn't do numerical (binary64 or big float) evaluation. > If you are looking for something fun to do, the project is yours. > > --Barton I'm interested in taking this on. I have some numerical code working - just a matter of providing a starting guess on the correct branch - although some more testing is in order. David From willisb at unk.edu Tue Oct 11 06:50:23 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 11 Oct 2011 06:50:23 -0500 Subject: [Maxima] generalized Lambert In-Reply-To: <4E940D1C.7010509@gmail.com> References: <4E940D1C.7010509@gmail.com>, , <1316961108.7795.5.camel@dieter>, <1316550272.1681.4.camel@dieter> <1316807377.1541.19.camel@dieter> Message-ID: --Barton On 30/09/2011 8:11 PM, Barton Willis wrote: > My generalized Lambert code doesn't do numerical (binary64 or big float) evaluation. > If you are looking for something fun to do, the project is yours. > > --Barton I'm interested in taking this on. ?I have some numerical code working - just a matter of providing a starting guess on the correct branch - although some more testing is in order. ?? ? David Great--numerical code will help me test my code that decides when generalized_lambert_w(k, x*exp(x)) = x. So far, I've only tried the k=0 & k=-1 cases. On the tiny chance you haven't seen it, page 16 of http://www.cs.uwaterloo.ca/research/tr/1993/03/W.pdf is helpful. Also, the picture wxdraw2d( x_voxel = 60, y_voxel = 60, fill_color = navy, region((x*sin(y)+y*cos(y)) > 0,x,-9,9,y,-9,9)); has helped me (and looks cool too). --Barton From akshaysrinivasan at gmail.com Tue Oct 11 09:44:31 2011 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Tue, 11 Oct 2011 20:14:31 +0530 Subject: [Maxima] Mixing numerics and maxima in LISP Message-ID: <4E94564F.8030203@gmail.com> Hello, I've been going the round-about way for my mechanics problems, doing symbolics in Maxima, generating code for solving the thus obtained ODE by C through Lisp/Python, then doing visualisation in LISP with cl-opengl. I'm not all that experienced with Lisp (or Maxima for that matter!) yet, but I sense that I can generate code on the fly using macros. I know maxima has a lisp mode; but from what I've seen, it does not strike me as a particularly clean interface; by "clean", I mean something like Sussman and Wisdom's scmutils. I can probably do something like replace maxima's function tags in the expression list with the usual operators and put it inside a function definition; but is there a better interface for Lisp ? Is there a better way of going about this ? Has someone done something like this before with Maxima - so that I can steal their code :) ? Cheers, Akshay From fateman at eecs.berkeley.edu Tue Oct 11 10:25:05 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 11 Oct 2011 08:25:05 -0700 Subject: [Maxima] Mixing numerics and maxima in LISP In-Reply-To: <4E94564F.8030203@gmail.com> References: <4E94564F.8030203@gmail.com> Message-ID: <4E945FD1.3040007@eecs.berkeley.edu> On 10/11/2011 7:44 AM, Akshay Srinivasan wrote: > Hello, > I've been going the round-about way for my mechanics problems, > doing symbolics in Maxima, generating code for solving the thus > obtained ODE by C through Lisp/Python, then doing visualisation in > LISP with cl-opengl. > I'm not all that experienced with Lisp (or Maxima for that > matter!) yet, but I sense that I can generate code on the fly using > macros. I know maxima has a lisp mode; but from what I've seen, it > does not strike me as a particularly clean interface; by "clean", I > mean something like Sussman and Wisdom's scmutils. It is more accurate to say that Maxima is written in Lisp, not that it has a lisp mode. If you want to invoke a fast numeric program from Maxima, you can write a program in lisp. e.g. to compute f(x):=x^2-0.5 fast, write the lisp program :lisp (defun $f(x)(- (* x x) 0.5)) and call it from Maxima, e.g. f(3.0) is 8.5. You can make f run faster this way.. :lisp (defun $f(x) (declare (double x)(optimize (speed 3)(safety 0))) (- (* x x) 0.5d0)) and :lisp (compile '$f). Now if you want to generate a piece of code using an expression computed in Maxima, you have some options. One of them is to use the compile command in Maxima. In which case it also helps to have mode_declares in place. This command converts the Maxima stuff into Lisp stuff and then into machine language. It is not usually so efficient because the possibility that something "symbolic" may be left in there has to be entirely eliminated before one can generate really good numeric code. And yes, there is a macro construction mechanism in Maxima tha is sometimes useful. > I can probably do something like replace maxima's function tags in > the expression list with the usual operators and put it inside a > function definition; but is there a better interface for Lisp ? unclear what you are trying here. Can you give an example? > Is there a better way of going about this ? Has someone done something > like this before with Maxima - so that I can steal their code :) ? > There's stuff like gentran (unsupported?) and f2cl. Maybe other stuff. > Cheers, > Akshay > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Tue Oct 11 10:25:36 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 11 Oct 2011 11:25:36 -0400 Subject: [Maxima] Mixing numerics and maxima in LISP In-Reply-To: <4E94564F.8030203@gmail.com> References: <4E94564F.8030203@gmail.com> Message-ID: I'm not sure I understand exactly what you want, but have you looked at the 'translate' and 'compile' functions? With appropriate declarations, you can translate your Maxima expressions into Lisp and compile it into numerical code that is not much slower than C or Fortran. -s On Tue, Oct 11, 2011 at 10:44, Akshay Srinivasan wrote: > Hello, > I've been going the round-about way for my mechanics problems, doing > symbolics in Maxima, generating code for solving the thus obtained ODE by C > through Lisp/Python, then doing visualisation in LISP with cl-opengl. > I'm not all that experienced with Lisp (or Maxima for that matter!) > yet, but I sense that I can generate code on the fly using macros. I know > maxima has a lisp mode; but from what I've seen, it > does not strike me as a particularly clean interface; by "clean", I mean > something like Sussman and Wisdom's scmutils. > I can probably do something like replace maxima's function tags in > the expression list with the usual operators and put it inside a function > definition; but is there a better interface for Lisp ? Is there a better way > of going about this ? Has someone done something like this before with > Maxima - so that I can steal their code :) ? > > Cheers, > 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 spluque at gmail.com Tue Oct 11 11:26:46 2011 From: spluque at gmail.com (Sebastian P. Luque) Date: Tue, 11 Oct 2011 11:26:46 -0500 Subject: [Maxima] assignment, evaluation, and substitutions Message-ID: <87wrcbijeh.fsf@kolob.subpolar.dyndns.org> Hi, I'm slowly learning these important topics in maxima by working through a simple exercise in geometry. Starting with the expression for the volume of an object, based on 2 radii (r1, r2) and height (h): Vtr: (1/3) * %pi * h * ((r1^2) + (r2^2) + ((r1^2) * (r2^2))); So the expression has been assigned to the variable Vtr, and now I want to find the expression where the radii are defined in terms of the perimeter (p): r: p / (2 * %pi); How can this substitution be made efficiently, so as not to type this for each radius? If Vtr above and the perimeter-based equivalent are needed as functions to call with different heights and radii/perimeters, when should the function definitions (i.e. :=) be made? In other words, is it better to work with simple variable assignments until after the substitutions are made? Thanks. Cheers, -- Seb From robert.dodier at gmail.com Tue Oct 11 17:32:21 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 11 Oct 2011 16:32:21 -0600 Subject: [Maxima] Mixing numerics and maxima in LISP In-Reply-To: <4E94564F.8030203@gmail.com> References: <4E94564F.8030203@gmail.com> Message-ID: On 10/11/11, Akshay Srinivasan wrote: > Hello, > I've been going the round-about way for my mechanics problems, doing > symbolics in Maxima, generating code for solving the thus obtained ODE > by C through Lisp/Python, then doing visualisation in LISP with cl-opengl. > I'm not all that experienced with Lisp (or Maxima for that matter!) > yet, but I sense that I can generate code on the fly using macros. I > know maxima has a lisp mode; but from what I've seen, it > does not strike me as a particularly clean interface; by "clean", I mean > something like Sussman and Wisdom's scmutils. > I can probably do something like replace maxima's function tags in the > expression list with the usual operators and put it inside a function > definition; but is there a better interface for Lisp ? Is there a better > way of going about this ? Has someone done something like this before > with Maxima - so that I can steal their code :) ? If I understand correctly, by "replace function tags" you mean to transform stuff like ((MPLUS) 1 2 3) to (+ 1 2 3). Right? If so then Maxima's compile and translate functions can do that. With mode_declare, compile & translate will try to apply Lisp functions to the arguments, but if the translator can't determine that all arguments will be numbers, then it falls back on general symbolic operations. Another approach is to use fortran or f90 to translate expressions to Fortran, and then compile & run that. best, Robert Dodier From spluque at gmail.com Tue Oct 11 18:45:34 2011 From: spluque at gmail.com (Sebastian P. Luque) Date: Tue, 11 Oct 2011 18:45:34 -0500 Subject: [Maxima] assignment, evaluation, and substitutions In-Reply-To: <87wrcbijeh.fsf@kolob.subpolar.dyndns.org> (Sebastian P. Luque's message of "Tue, 11 Oct 2011 11:26:46 -0500") References: <87wrcbijeh.fsf@kolob.subpolar.dyndns.org> Message-ID: <87pqi3gkip.fsf@kolob.subpolar.dyndns.org> On Tue, 11 Oct 2011 11:26:46 -0500, "Sebastian P. Luque" wrote: > Hi, I'm slowly learning these important topics in maxima by working > through a simple exercise in geometry. Starting with the expression > for the volume of an object, based on 2 radii (r1, r2) and height (h): > Vtr: (1/3) * %pi * h * ((r1^2) + (r2^2) + ((r1^2) * (r2^2))); > So the expression has been assigned to the variable Vtr, and now I > want to find the expression where the radii are defined in terms of > the perimeter (p): > r: p / (2 * %pi); > How can this substitution be made efficiently, so as not to type this > for each radius? If Vtr above and the perimeter-based equivalent are > needed as functions to call with different heights and > radii/perimeters, when should the function definitions (i.e. :=) be > made? In other words, is it better to work with simple variable > assignments until after the substitutions are made? This is how I've done it: /* The volume of a truncated cone, using radii only */ Vtr: (1/3) * %pi * h * ((r1^2) + (r2^2) + ((r1^2) * (r2^2))); /* Obtain the equivalent expression, substituting radii for perimeters */ Vtr, r1=p1/(2 * %pi), r2=p2/(2 * %pi); /* Simplify expression and assign to a variable */ Vtp: ratsimp(%); /* Assign the expressions to functions for later use */ VtrF(h, r1, r2) := ''Vtr; VtpF(h, p1, p2) := ''Vtp; but I'm left with the variables Vtr and Vtp. Is there a better way to do this? Thanks. -- Seb From willisb at unk.edu Tue Oct 11 18:54:59 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 11 Oct 2011 18:54:59 -0500 Subject: [Maxima] Mixing numerics and maxima in LISP In-Reply-To: References: , <4E94564F.8030203@gmail.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > If I understand correctly, by "replace function tags" you mean to > transform stuff like ((MPLUS) 1 2 3) to (+ 1 2 3). Right? Although mostly a toy, to_cl is a tiny easy to modify Maxima to CL translator. Every once in awhile, I find some useful way to modify it. As Robert and others suggested, you should try using the Maxima translator--nevertheless: (%i10) load(tocl)$ (%i13) to_cl(u + n / k)$ (+ U (/ N K)) (%i14) to_cl('(x : x + 1, x * x))$ (PROGN (SETQ X (+ 1 X)) (EXPT X 2)) (%i16) to_cl('(f(a,b,c) := (a : a +1, a + b*c)))$ (DEFUN $F (A B C) (PROGN (SETQ A (+ A 1)) (+ A (* B C)))) (%i17) to_cl('block([acc : 0], for k : 1 thru 100 do acc : acc + 1.0/k, acc))$ (LET ((ACC 0)) (DO ((K 1 (INCF K 1))) ((> K 100) '$DONE) (SETQ ACC (+ ACC (* 1.0 (EXPT K -1))))) ACC) --bw From akshaysrinivasan at gmail.com Tue Oct 11 23:14:23 2011 From: akshaysrinivasan at gmail.com (Akshay Srinivasan) Date: Wed, 12 Oct 2011 09:44:23 +0530 Subject: [Maxima] Mixing numerics and maxima in LISP In-Reply-To: References: , <4E94564F.8030203@gmail.com> Message-ID: <4E95141F.7050306@gmail.com> Thank you for all the replies and suggestions. I guess I have to be necessarily vague, since I haven't really done anything on this front yet. I intend to have the callback function for ODEPACK - for the vector field - residing in lisp. Using CFFI to do this seemed to work well. I wouldn't want to have code in C/Fortran if I can help it. I tried using tranlate_file to convert something like this: -- L(t, q, q1) := 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], L: thetadot_2^2/2. + thetadot_1^2 + thetadot_1 * thetadot_2 * cos(theta_1 - t\ heta_2) - 2 * sin(theta_1) -sin(theta_2), return(L))$ -- The translated code seems to have a lot of fluff; not something I'd use for numerical stuff - I could of course be doing it wrong. I didn't of course, use mode_declare while doing this. I'd be very skittish when passing something like this through - unedited- to any numerical code, especially so because the ODEs I need to solve are inturn passed on to an optimisation routine; so efficient numerics is something that is very much desired. Let me be more precise about what I basically want to be able to do. -- (defun f (x) (sin x)) (diff f 'x) ;; should give me (lambda (x) (cos x)) -- In some sense I don't want to have a distinction between numerical and symbolic functions. Scmutils allows me to do this, but, maxima is much more powerful for what I do - and much faster too! I guess I can sort of do this in maxima using tocl, by doing something like: -- (defun f (x) `((%sin simp) ,x)) (defmacro symbolic->lisp (f) (let* ((x (gensym))) (expr (funcall f x))) `(lambda (,x) ,($to_cl expr)))) (defmacro make-diff-func (f) (let* ((x (gensym)) (expr (funcall f x))) `(lambda (,x) ,($to_cl ($diff expr x)))))) -- Of course this is all hunky dory for R^1->R^1; what I actually want is something from R^m->R^n. Ideally the data structures here would be a simple vector used in some nice way - ala MATLISP (?). What I now do, is actually save the expressions one by one in a file, and substitute them in appropriate places in the C code; something I find to be very ugly. I can't think of a better way to this - mostly because I follow a similar workflow for generating the C code from the symbolic expressions generate by maxima. Cheers, Akshay On 10/12/2011 05:24 AM, Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- >> If I understand correctly, by "replace function tags" you mean to >> transform stuff like ((MPLUS) 1 2 3) to (+ 1 2 3). Right? > > Although mostly a toy, to_cl is a tiny easy to modify Maxima to CL translator. > Every once in awhile, I find some useful way to modify it. As Robert and others > suggested, you should try using the Maxima translator--nevertheless: > > (%i10) load(tocl)$ > > (%i13) to_cl(u + n / k)$ > (+ U (/ N K)) > > (%i14) to_cl('(x : x + 1, x * x))$ > (PROGN (SETQ X (+ 1 X)) (EXPT X 2)) > > (%i16) to_cl('(f(a,b,c) := (a : a +1, a + b*c)))$ > (DEFUN $F (A B C) (PROGN (SETQ A (+ A 1)) (+ A (* B C)))) > > (%i17) to_cl('block([acc : 0], for k : 1 thru 100 do acc : acc + 1.0/k, acc))$ > (LET ((ACC 0)) > (DO ((K 1 (INCF K 1))) ((> K 100) '$DONE) > (SETQ ACC (+ ACC (* 1.0 (EXPT K -1))))) > ACC) > > --bw From toy.raymond at gmail.com Wed Oct 12 00:13:39 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 11 Oct 2011 22:13:39 -0700 Subject: [Maxima] Mixing numerics and maxima in LISP In-Reply-To: <4E95141F.7050306@gmail.com> References: , <4E94564F.8030203@gmail.com> <4E95141F.7050306@gmail.com> Message-ID: <4E952203.2080705@gmail.com> On 10/11/11 9:14 PM, Akshay Srinivasan wrote: > Thank you for all the replies and suggestions. I guess I have to be > necessarily vague, since I haven't really done anything on this front > yet. > > I intend to have the callback function for ODEPACK - for the vector > field - residing in lisp. Using CFFI to do this seemed to work well. I > wouldn't want to have code in C/Fortran if I can help it. > > I tried using tranlate_file to convert something like this: > -- > L(t, q, q1) := 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], > L: thetadot_2^2/2. + thetadot_1^2 + thetadot_1 * thetadot_2 * > cos(theta_1 - t\ > heta_2) - 2 * sin(theta_1) -sin(theta_2), > return(L))$ > -- > The translated code seems to have a lot of fluff; not something I'd > use for numerical stuff - I could of course be doing it wrong. I > didn't of course, use mode_declare while doing this. I'd be very > skittish when passing something like this through - unedited- to any > numerical code, especially so because the ODEs I need to solve are > inturn passed on to an optimisation routine; so efficient numerics is > something that is very much desired. Of course the translated code is pretty weird because it has to handle symbolic as well as numeric results. mode_declare will help, but I don't think it would be quite the same as if you wrote an equivalent lisp routine by hand. And passing such a function to ODEPACK via CFFI can produce some really interesting results (corrupted memory, crashes, etc.) if the function decides to return a symbolic value instead of a numeric value for some corner case you forgot about. And if the recent thread about colnew is any indication, the maxima function basically limits how fast you can go anyway. If efficiency is really that important, then translating the maxima function to C/Fortran is the way to go. If you can deal with moderate efficiency, then maxima might be ok. Ray who has occasionally thought about creating a maxima interface to the f2cl version of odepack From p.j.papasot at gmail.com Wed Oct 12 01:55:12 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Wed, 12 Oct 2011 09:55:12 +0300 Subject: [Maxima] assignment, evaluation, and substitutions In-Reply-To: <87pqi3gkip.fsf@kolob.subpolar.dyndns.org> References: <87wrcbijeh.fsf@kolob.subpolar.dyndns.org> <87pqi3gkip.fsf@kolob.subpolar.dyndns.org> Message-ID: According to the manual , , ..., cannot be used instead of ev (, , ..., ) as part of another expression, such as function definitions, or blocks. Therefore, the substitutions should be made using function ev, not its alias form. To avoid intermediate variables, you can just define the functions like that (I have trimmed unnecessary spaces and parentheses to make it simpler): VtrF(h,r1,r2):=1/3*%pi*h*(r1^2+r2^2+(r1^2*r2^2)); ratsimp(ev(VtrF(h,r1,r2),r1=p1/(2*%pi),r2=p2/(2*%pi))); VtpF(h,p1,p2):=''%; This would define VtrF(h,r1,r2) and VtpF(h,p1,p2) without using auxiliary variables: values; --> [ ] 2011/10/12 Sebastian P. Luque > On Tue, 11 Oct 2011 11:26:46 -0500, > "Sebastian P. Luque" wrote: > > > Hi, I'm slowly learning these important topics in maxima by working > > through a simple exercise in geometry. Starting with the expression > > for the volume of an object, based on 2 radii (r1, r2) and height (h): > > > Vtr: (1/3) * %pi * h * ((r1^2) + (r2^2) + ((r1^2) * (r2^2))); > > > So the expression has been assigned to the variable Vtr, and now I > > want to find the expression where the radii are defined in terms of > > the perimeter (p): > > > r: p / (2 * %pi); > > > How can this substitution be made efficiently, so as not to type this > > for each radius? If Vtr above and the perimeter-based equivalent are > > needed as functions to call with different heights and > > radii/perimeters, when should the function definitions (i.e. :=) be > > made? In other words, is it better to work with simple variable > > assignments until after the substitutions are made? > > This is how I've done it: > > /* The volume of a truncated cone, using radii only */ > Vtr: (1/3) * %pi * h * ((r1^2) + (r2^2) + ((r1^2) * (r2^2))); > /* Obtain the equivalent expression, substituting radii for perimeters */ > Vtr, r1=p1/(2 * %pi), r2=p2/(2 * %pi); > /* Simplify expression and assign to a variable */ > Vtp: ratsimp(%); > /* Assign the expressions to functions for later use */ > VtrF(h, r1, r2) := ''Vtr; > VtpF(h, p1, p2) := ''Vtp; > > but I'm left with the variables Vtr and Vtp. Is there a better way to > do this? Thanks. > > -- > Seb > _______________________________________________ > 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 p.j.papasot at gmail.com Wed Oct 12 02:10:04 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Wed, 12 Oct 2011 10:10:04 +0300 Subject: [Maxima] Variables local to packages? In-Reply-To: References: Message-ID: Thank you for your answer. That explains why I could not find any information about the package namespaces in Maxima's documentation. namespaces' functionality loosely reminds me Fortran 90's "module" structure, which I use a lot in my Fortran programs. However, it is not the same. I think I'll use namespaces only when it is absolutely necessary, given it is not lexical but dynamic (as it is a big part of Maxima itself, I think.) As for the Python replacement, I am not sure it is worth the effort. Python is very limited, to be honest. 2011/10/8 Robert Dodier > On 10/6/11, Panagiotis Papasotiriou wrote: > > > example, suppose package foo.mac defines 2 global functions A and B. I am > > looking for a way to declare a variable/function C which would be local > to > > the package, so that only functions A and B will have access to it. Such > a > > local variable/function should not be visible to any other function > defined > > outside foo.mac, so that typing values; in a Maxima session won't even > list > > it. > > Well, there exists the share package "namespaces" which exposes > CL's package mechanism. I guess it works OK. > You can define A, B, and C in a namespace such that outside that > namespace, A, B, and C refer to other things. > > e.g. > > ---- begin /tmp/foo.mac ---- > in_namespace (foo); > A (x) := 1 - x; > B (x) := 2 * x; > C : 12345; > ---- end foo.mac ---- > > ---- in your Maxima session ---- > load (namespaces); > load_namespace ("/tmp/foo.mac"); > A (100); > => A(100) > foo|A (100); > => - 99 > C; > => C > C : 5678; > foo|C; > => 12345 > foo|C : 54321; > C; > => 5678 > functions; > => [foo|A(foo|x), foo|B(foo|x)] > values; > => [foo|C, C] > ---- end Maxima session ---- > > Some notes: > > (1) namespaces are an experimental feature > (2) namespaces are dynamic, not lexical: > you change the namespace via in_namespace function call; > the namespace isn't associated with a lexical unit > (3) documentation in comment header of > share/contrib/namespaces/namespaces.lisp > (4) in_namespace changes the Lisp package so it has the potential > to confuse Lisp code which makes assumptions about packages > (:cl-user, :maxima, etc) > (5) namespaces doesn't hide the existence of symbols > > At this point I would say that the biggest unresolved problem is to > make sure that namespaces play nice w/ Lisp, and the biggest improvement > would be to make namespaces lexical instead of dynamic. > > > Such a functionality, often called data hiding, is absolutely necessary > for > > creating something more complicated than a simple package, so I guess > there > > is a way to do it in Maxima, although I was not able to find a way by > > looking to the documentation. > > Yeah -- Maxima's user language is pretty weak in that department ... > Occasionally I have daydreams about replacing it with an existing language > or an extension of one. E.g. Python + modified evaluation to allow > partial evaluation of expressions. (Yes, I do understand that's a > pretty big deal.) > > best > > Robert Dodier > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlakelan at street-artists.org Wed Oct 12 12:31:01 2011 From: dlakelan at street-artists.org (dlakelan) Date: Wed, 12 Oct 2011 10:31:01 -0700 Subject: [Maxima] substitute for independent variable in 'diff In-Reply-To: References: Message-ID: <4E95CED5.3010601@street-artists.org> On 10/10/2011 08:00 AM, shorne at energetiq.com wrote: > I'm being driven nuts by something that should be easy... > > I have a simple differential equation that can be > un-dimensionalized by defining a new timelike variable tau=t/u, > or t=tau*u where u is a constant characteristic time. I have some hacked up code for nondimensionalizing things. I wouldn't send it to the list because it's not at all robust, but here's the basic idea and perhaps you can hack up something yourself that suits your particular purposes. I create a list of variables called "dvars" which defines the dimensional variables in terms of the nondimensional variables, and a list of the nondimensional variables. In your case: dvars: [t = u*tau]; ndvars: [tau]; Then I define a couple of pattern rules, something like: matchdeclare(n,integerp,[dimvar1,dimvar2],lambda([x],member(x,map(lhs,dvars))), [ndvar1,ndvar2], lambda([x],member(x,ndvars))); Now I define a set of defmatch rules which match diff(dimvar1,dimvar2,n) and do some work to convert it into diff(dimvar1,ndvar1)/diff(dimvar2,ndvar2,n) * diff(ndvar1,ndvar2,n) where here you have to look up which ndvar corresponds to which dimvar before constructing this expression so it's not complete code but it's the basic idea. Then I define a "nondimensionalize" function which first applies this pattern, and then goes through and simply uses subst to replace the dimensional vars with the nondimensional vars in cases that are not inside a diff. hope that helps From woollett at charter.net Wed Oct 12 15:47:37 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 12 Oct 2011 13:47:37 -0700 Subject: [Maxima] minimal version of nintegrate Message-ID: A minimal version of nintegrate, called nint here, uses defaults epsrel=1d-4,limit=600, key=3, and uses either quad_qagi (infinite domain), quad_qag (finite domain oscillation), quad_qags (finite domain singular), with the choice between the latter two functions made on the basis of which method takes the least number of function evaluations (as suggested by Raymond Toy). The slatec error messages are surpressed using Ray's lisp code replacement j4save.lisp. Two global lists are created for after the fact diagnosis: 1. gargL includes the method used and the list of input args. 2. goutL includes the method used and the complete output of quadpack. In addition, if the global flag details is set to true, nint will print out the method used. nint.mac sets details:false. If the numerical integral cannot be found using the defaults, appropriate error messages are written to the screen (rather than error code integers). The two global lists gargL and goutL allow the user to see the defaults being used, and this can help the user go directly to a quadpack method and play with the options. Here are examples of an oscillating integrand, an integrand with singular features, an integral over an infinite domain, and an example which the defaults cannot cope with. ============================= (%i1) load(nint); (%o1) "c:/work2/nint.mac" (%i2) details:true$ oscillating integrand (%i3) g : (x-2)^2 * sin (4000*x)$ (%i4) tval : float (integrate (g,x,2,3)); (%o4) -1.5862464665268553E-4 (%i5) nint(g,x,2,3); quad_qag (%o5) -1.5862464665235301E-4 (%i6) relerr(%); (%o6) 2.0962997448270408E-12 (%i7) gargL; (%o7) [qag,(x-2)^2*sin(4000*x),x,2,3,3,epsrel = 1.0E-4,limit = 600] (%i8) goutL; (%o8) [qag,-1.5862464665235301E-4,1.5316233778733241E-8,11873,0] singular integrand (%i9) g:x^(1/2)*log(1/x); (%o9) -sqrt(x)*log(x) (%i10) tval : float (integrate(g,x,0,1)); (%o10) 0.44444444444444 (%i11) nint(g,x,0,1); quad_qags (%o11) 0.44444444444444 (%i12) relerr(%); (%o12) 3.7470027081099033E-16 infinite domain (%i13) g : x^2*exp (-4*x)$ (%i14) tval : float (integrate (g,x,0,inf)); (%o14) 0.03125 (%i15) nint (g,x,0,inf); quad_qagi (%o15) 0.031250000000007 (%i16) relerr(%); (%o16) 2.1760371282653068E-13 fail behavior: (%i17) g: cos (log (x)/x)/x; (%o17) cos(log(x)/x)/x (%i18) integrate (g,x,0,1); (%o18) 'integrate(cos(log(x)/x)/x,x,0,1) (%i19) nint(g,x,0,1); keyval = 3 prec = 1.0E-4 limval = 600 quad_qag error code = too many subintervals done quad_qags error code = integral is probably divergent or slowly convergent (%o19) false ================================= code file: (using print_file from Ch.2 mfiles.mac which produces less space between lines when copying Xmaxima output to a text file, as compared with printfile) (%i21) load(mfiles); (%o21) "c:/work2/mfiles.mac" (%i22) print_file("nint.mac")$ ------------------------------------------------------- /* nint.mac oct. 12, 2011 nintegrate code */ load ("j4save.lisp")$ codelist : [[1,"too many subintervals done"], [2,"excessive roundoff error detected"], [3,"extremely bad integrand behavior observed"], [4, "integration failed to converge"], [5, "integral is probably divergent or slowly convergent"], [6, "the input is invalid"]]$ /* tval should hold "true" value */ relerr(u) := abs(u - tval)/abs(tval)$ reldiff(u,v) := 2.0*abs(u - v)/abs(u + v)$ /* oct. 12, 2011 nint is minimal version which sets limit = 600, epsrel = 1d-4, chooses either quad_qag or quad_qags for finite interval based on min number of function evaluations and calls quad_qagi for infinite domain. two global lists are available for diagnosis after invocation: gargL is a list of method and args input, goutL is a list of method and quadpack total output. If details is set to true, nint will print out the method used. */ nint (expr,_var%,_a%, _b%) := block ([prec : 1d-4,limval : 600, keyval:3, argL,rL, gL,gsL,ans ], if _a% = minf or _b% = inf then ( argL : [expr,_var%,_a%, _b%, epsrel=prec,limit=limval], gargL : cons (qagi, argL), if details then print ("quad_qagi"), rL : apply ('quad_qagi, argL), goutL : cons (qagi,rL), if rL[4] = 0 then ( ans : rL[1], gargL : [qagi,expr,_var%,_a%, _b%, epsrel=prec,limit=limval], goutL : cons (qagi,rL)) else ( ans : false, print (" prec = ",prec," limval = ",limval), print (" quad_qagi error code = ", part (codelist,rL[4],2)))) else ( /* finite interval case */ gL : apply ('quad_qag, [expr,_var%,_a%,_b%,keyval,epsrel=prec,limit=limval]), gsL : apply ('quad_qags, [expr,_var%,_a%,_b%,epsrel=prec,limit=limval]), /* select winner */ if gL[4] = 0 and gsL[4] = 0 then ( /* no errors case */ if gL[3] < gsL[3] then ( ans : gL[1], if details then print ("quad_qag"), gargL : [qag,expr,_var%,_a%,_b%,keyval,epsrel=prec,limit=limval], goutL : cons (qag,gL)) else ( ans : gsL[1], if details then print ("quad_qags"), gargL : [qags,expr,_var%,_a%,_b%,epsrel=prec,limit=limval], goutL : cons (qags,gsL) )) else if gL[4] = 0 then ( ans : gL[1], if details then print ("quad_qag"), gargL : [qag,expr,_var%,_a%,_b%,keyval,epsrel=prec,limit=limval], goutL : cons (qag,gL)) else if gsL[4] = 0 then ( ans : gsL[1], if details then print ("quad_qags"), gargL : [qags,expr,_var%,_a%,_b%,epsrel=prec,limit=limval], goutL : cons (qags,gsL)) else ( ans : false, print (" keyval = ",keyval," prec = ",prec," limval = ",limval), print (" quad_qag error code = ", part (codelist,gL[4],2)), print (" quad_qags error code = ", part (codelist,gsL[4],2)))), ans)$ quad_j4save('control, 0)$ display2d:false$ details:false$ ------------------------------------------------------------------------- Ted Woollett From toy.raymond at gmail.com Wed Oct 12 16:27:32 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 12 Oct 2011 14:27:32 -0700 Subject: [Maxima] minimal version of nintegrate In-Reply-To: References: Message-ID: On Wed, Oct 12, 2011 at 1:47 PM, Edwin Woollett wrote: > A minimal version of nintegrate, called nint here, > uses defaults epsrel=1d-4,limit=600, key=3, and > uses either quad_qagi (infinite domain), > quad_qag (finite domain oscillation), > quad_qags (finite domain singular), > with the choice between the latter two functions > made on the basis of which method takes the > least number of function evaluations (as > suggested by Raymond Toy). > Did I actually suggest that? I thought I suggested choosing the one with the least error (relative or absolute). Choosing the fewest number of evaluations doesn't seem like a good criterion. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Wed Oct 12 17:36:27 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 12 Oct 2011 15:36:27 -0700 Subject: [Maxima] minimal version of nintegrate Message-ID: <9BA8A3F946B64E1D89A21EA218F1079A@edwinc367e16bd> On Oct. 12, 2011, Raymond Toy wrote: ------------------------- >> with the choice between the latter two functions >> made on the basis of which method takes the >> least number of function evaluations (as >> suggested by Raymond Toy). >> > >Did I actually suggest that? I thought I suggested choosing the one with >the least error (relative or absolute). Choosing the fewest number of >evaluations doesn't seem like a good criterion. > I would have to search my emails to find out your actual suggestion. But in the meantime, I insert a couple display printouts to expose the relative values of element 2 = est. abs. error, and element 3 = no. of func. evals. For the examples tested so far, using either element as the choice criterion yields the same choice of method. My idea is that a method with less function evaluations is having an easier time of converging, and the result is then more likely to be more accurate. But this is of course an experimental question. ------------------------------------------------------------- (%i1) load(nint); (%o1) "c:/work2/nint.mac" (%i2) details:true$ (%i3) g : (x-2)^2 * sin (4000*x)$ (%i4) nint(g,x,2,3); gL = [-1.5862464665235301E-4,1.5316233778733241E-8,11873, 0] smaller smaller gsL = [-1.586246466525885E-4,1.5682686228551024E-8,13923, 0] larger larger quad_qag (%o4) -1.5862464665235301E-4 (%i5) g:x^(1/2)*log(1/x); (%o5) -sqrt(x)*log(x) (%i6) nint(g,x,0,1); gL = [0.44444448137913,3.1051603361057058E-5,403, 0] larger larger gsL = [0.44444444444444,1.314939093721712E-7,231, 0] smaller smaller quad_qags (%o6) 0.44444444444444 ---------------------------------------------------- Ted From woollett at charter.net Wed Oct 12 19:00:14 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 12 Oct 2011 17:00:14 -0700 Subject: [Maxima] minimal version of nintegrate Message-ID: <0A8A4B41DD284C138378DA15E32D1D49@edwinc367e16bd> On Oct. 12, 2011, I wrote ------------------- >My idea is that a method with less function evaluations is >having an easier time of converging, and the result is >then more likely to be more accurate. But this is of >course an experimental question. ---------------------------------- On second thought, I agree that I should use est abs error size as the criterion. Especially since the writers of quadpack took the trouble to hazard a guess as to that value. Ted From toy.raymond at gmail.com Wed Oct 12 22:01:15 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 12 Oct 2011 20:01:15 -0700 Subject: [Maxima] minimal version of nintegrate In-Reply-To: <0A8A4B41DD284C138378DA15E32D1D49@edwinc367e16bd> References: <0A8A4B41DD284C138378DA15E32D1D49@edwinc367e16bd> Message-ID: <4E96547B.8050705@gmail.com> On 10/12/11 5:00 PM, Edwin Woollett wrote: > On Oct. 12, 2011, I wrote > ------------------- >> My idea is that a method with less function evaluations is >> having an easier time of converging, and the result is >> then more likely to be more accurate. But this is of >> course an experimental question. > ---------------------------------- > On second thought, I agree that I should use est abs error size > as the criterion. Especially since the writers of quadpack took > the trouble to hazard a guess as to that value. > Here is an example where the number of evaluations is not the correct criterion: (%i58) alpha:9; (%o58) 9 (%i59) quad_qag(4^(-alpha)/((s - %pi/4)^2 + 16^(-alpha)),s,0,1,3); (%o59) [3.14157002086875,1.621492651486314e-8,1271,0] (%i60) quad_qags(4^(-alpha)/((s - %pi/4)^2 + 16^(-alpha)),s,0,1); (%o60) [3.141570020867747,2.996182815899798e-8,1113,0] Using the number of evaluations, quad_qags would be chosen, but, using the error, quad_qag should be chosen. And, it is, in fact closer to the true value of the integral. This integral is one of the tests from the quadpack book. The integrand has a vary narrow spike at %pi/4. For alpha > 10, quad_qags fails to converge. quad_qag converges until alpha > 18. And I just remembered that src/numerical/slatec/quadpack.lisp has the test examples from the book so you can run the tests yourself. Look at the comments at the end of the file. I'm sure we can cook up various integrals to demonstrate all kinds of bad things. :-) Ray From p.j.papasot at gmail.com Thu Oct 13 08:10:11 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Thu, 13 Oct 2011 16:10:11 +0300 Subject: [Maxima] minimal version of nintegrate In-Reply-To: <4E96547B.8050705@gmail.com> References: <0A8A4B41DD284C138378DA15E32D1D49@edwinc367e16bd> <4E96547B.8050705@gmail.com> Message-ID: 2011/10/13 Raymond Toy > On 10/12/11 5:00 PM, Edwin Woollett wrote: > > On Oct. 12, 2011, I wrote > > ------------------- > >> My idea is that a method with less function evaluations is > >> having an easier time of converging, and the result is > >> then more likely to be more accurate. But this is of > >> course an experimental question. > > ---------------------------------- > > On second thought, I agree that I should use est abs error size > > as the criterion. Especially since the writers of quadpack took > > the trouble to hazard a guess as to that value. > > > Here is an example where the number of evaluations is not the correct > criterion: > > (%i58) alpha:9; > (%o58) 9 > (%i59) quad_qag(4^(-alpha)/((s - %pi/4)^2 + 16^(-alpha)),s,0,1,3); > (%o59) [3.14157002086875,1.621492651486314e-8,1271,0] > (%i60) quad_qags(4^(-alpha)/((s - %pi/4)^2 + 16^(-alpha)),s,0,1); > (%o60) [3.141570020867747,2.996182815899798e-8,1113,0] > > Using the number of evaluations, quad_qags would be chosen, but, using > the error, quad_qag should be chosen. And, it is, in fact closer to > the true value of the integral. > > This integral is one of the tests from the quadpack book. The integrand > has a vary narrow spike at %pi/4. For alpha > 10, quad_qags fails to > converge. quad_qag converges until alpha > 18. > > And I just remembered that src/numerical/slatec/quadpack.lisp has the > test examples from the book so you can run the tests yourself. Look at > the comments at the end of the file. > > I'm sure we can cook up various integrals to demonstrate all kinds of > bad things. :-) > > 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 p.j.papasot at gmail.com Thu Oct 13 09:03:01 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Thu, 13 Oct 2011 17:03:01 +0300 Subject: [Maxima] minimal version of nintegrate In-Reply-To: <4E96547B.8050705@gmail.com> References: <0A8A4B41DD284C138378DA15E32D1D49@edwinc367e16bd> <4E96547B.8050705@gmail.com> Message-ID: To be honest, it is the first time I see the number of function evaluations as a criterion of convergence or accuracy. It is widely used to measure the speed of a numerical method, provided it is already known (proven theoretically or otherwise) that the method is convergent. In my opinion, an interface simplifying the use of packages like QUADPACK should not attempt to guess which method is more appropriate for a given problem. This should be left to the user. Otherwise we are going to have an "all-purpose" Maxima function supposed to do everything, like Mathematica's function "NIntegrate", which, however, not only fails to do what is supposed to do in many cases, but also encourages the "blind use" of Numerical Analysis. There is no "perfect" numerical method, able to solve any problem efficiently; this is true for any numerical problem, such as numerical quadrature, solution of initial or boundary value problems etc. Two simple examples: (1) consider integrating a "sawtooth" function. Romberg integration, which is generally very fast and accurate for smooth functions would have a hard time integrating a sawtooth function, while a simple trapezoidal method would be much faster in that particular case. (2) Most people use "natural" cubic splines for interpolation, just because of their name I guess, or maybe because Computer Algebra Systems use natural cubic splines by default for interpolation. However, "natural" splines are not natural at all, and should be used only if there is a reason to assume second derivative is zero at the end points of the interpolation interval. Otherwise, "not-a-knot" splines should be used instead. I doubt there is a way to make a function which automatically selects the best method to solve a numerical problem. Mathematica tries that and the result is disappointing. I am very suspicious about such attempts, and I believe none should trust them, no matter how sophisticated they are. Everyone who needs to use numerical methods should have a basic knowledge of what (s)he is doing, and should be able to pick the numerical method most appropriate method for a given problem. 2011/10/13 Raymond Toy > On 10/12/11 5:00 PM, Edwin Woollett wrote: > > On Oct. 12, 2011, I wrote > > ------------------- > >> My idea is that a method with less function evaluations is > >> having an easier time of converging, and the result is > >> then more likely to be more accurate. But this is of > >> course an experimental question. > > ---------------------------------- > > On second thought, I agree that I should use est abs error size > > as the criterion. Especially since the writers of quadpack took > > the trouble to hazard a guess as to that value. > > > Here is an example where the number of evaluations is not the correct > criterion: > > (%i58) alpha:9; > (%o58) 9 > (%i59) quad_qag(4^(-alpha)/((s - %pi/4)^2 + 16^(-alpha)),s,0,1,3); > (%o59) [3.14157002086875,1.621492651486314e-8,1271,0] > (%i60) quad_qags(4^(-alpha)/((s - %pi/4)^2 + 16^(-alpha)),s,0,1); > (%o60) [3.141570020867747,2.996182815899798e-8,1113,0] > > Using the number of evaluations, quad_qags would be chosen, but, using > the error, quad_qag should be chosen. And, it is, in fact closer to > the true value of the integral. > > This integral is one of the tests from the quadpack book. The integrand > has a vary narrow spike at %pi/4. For alpha > 10, quad_qags fails to > converge. quad_qag converges until alpha > 18. > > And I just remembered that src/numerical/slatec/quadpack.lisp has the > test examples from the book so you can run the tests yourself. Look at > the comments at the end of the file. > > I'm sure we can cook up various integrals to demonstrate all kinds of > bad things. :-) > > 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 mag.wolfgang.ebner at inode.at Wed Oct 12 15:32:17 2011 From: mag.wolfgang.ebner at inode.at (Mag. Wolfgang Ebner) Date: Wed, 12 Oct 2011 22:32:17 +0200 Subject: [Maxima] b/(b+a) + a/(b+a) =? 1 Message-ID: <000001cc891e$089cf4f0$19d6ded0$@wolfgang.ebner@inode.at> Sorry for the newbies question (I am switching from Mathematica to MaximaJ ): How to get 1 from b/(b+a) + a/(b+a) ? Could not find help in the manual quickly but I promise I will read it more carefully soon!! THANX basko -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Thu Oct 13 14:52:44 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 13 Oct 2011 14:52:44 -0500 Subject: [Maxima] b/(b+a) + a/(b+a) =? 1 In-Reply-To: <000001cc891e$089cf4f0$19d6ded0$@wolfgang.ebner@inode.at> References: <000001cc891e$089cf4f0$19d6ded0$@wolfgang.ebner@inode.at> Message-ID: Use ratsimp: (%i13) b/(b+a) + a/(b+a); (%o13) b/(b+a)+a/(b+a) (%i14) ratsimp(%); (%o14) 1 For user documentation on ratsimp, enter "? ratsimp;" Welcome to Maxima. --Barton maxima-bounces at math.utexas.edu wrote on 10/12/2011 03:32:17 PM: > From: "Mag. Wolfgang Ebner" > To: > Date: 10/13/2011 02:39 PM > Subject: [Maxima] b/(b+a) + a/(b+a) =? 1 > Sent by: maxima-bounces at math.utexas.edu > > Sorry for the newbies question (I am switching from Mathematica to MaximaJ): > > How to get 1 from b/(b+a) + a/(b+a) ? > > Could not find help in the manual quickly but I promise I will read > it more carefully soon!! > > THANX > basko_______________________________________________ > 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 p.j.papasot at gmail.com Fri Oct 14 04:48:35 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Fri, 14 Oct 2011 12:48:35 +0300 Subject: [Maxima] Lisp programming and Emacs Message-ID: Dear community, my question is only implicitly related to Maxima, but I am sure someone could help: I wrote some Numerical Analysis functions in Maxima, and they perform very well. However, I guess a Lisp implementation of those functions would be faster (and I wonder how faster it will be.) So I decided to rewrite the functions in Lisp (good opportunity to learn Lisp as well.) I am a big fan of Emacs, which I use extensively for Maxima sessions, gnuplot sessions, and as an IDE for Fortran 90 or C/C++ programming. As far I can tell, "Slime" is the Emacs package for Lisp programming. I installed Slime and SBCL (directly from Debian GNU/Linux repositories) but somehow those two are not connected, so I cannot, for example, mark a region of a Lisp program and execute it in SBCL with keystrokes like C-c C-b, as I do with Maxima programs. In fact, the Lisp program edited in Emacs seems completely on its own, not connected with SBCL in any way, although Slime is supposed to support SBCL. I tried several solutions which I found on the Internet, suggesting adding things in .emacs configuration file. However, none of those suggestions worked. So my question is, which is the "best" Lisp implementation I should use for Maxima-oriented Lisp programming, and how can I use it in Emacs? -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Fri Oct 14 09:59:50 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 14 Oct 2011 10:59:50 -0400 Subject: [Maxima] Lisp programming and Emacs In-Reply-To: References: Message-ID: Panagioti, I certainly don't want to discourage you from learning Lisp, but I'm not sure that rewriting numerical Maxima code by hand in Lisp will teach you much. Working on symbolic computations in Lisp may be more educational and productive. Have you tried using mode_declare, compile, and arrays (rather than Maxima lists and matrices) for your numerical code? With proper declarations and use of arrays, compiled Maxima code should be almost as fast as hand-written Lisp numerical code or even scalar Fortran code. -s On Fri, Oct 14, 2011 at 05:48, Panagiotis Papasotiriou < p.j.papasot at gmail.com> wrote: > Dear community, my question is only implicitly related to Maxima, but I am > sure someone could help: > > I wrote some Numerical Analysis functions in Maxima, and they perform very > well. However, I guess a Lisp implementation of those functions would be > faster (and I wonder how faster it will be.) So I decided to rewrite the > functions in Lisp (good opportunity to learn Lisp as well.) I am a big fan > of Emacs, which I use extensively for Maxima sessions, gnuplot sessions, and > as an IDE for Fortran 90 or C/C++ programming. As far I can tell, "Slime" is > the Emacs package for Lisp programming. I installed Slime and SBCL (directly > from Debian GNU/Linux repositories) but somehow those two are not connected, > so I cannot, for example, mark a region of a Lisp program and execute it in > SBCL with keystrokes like C-c C-b, as I do with Maxima programs. In fact, > the Lisp program edited in Emacs seems completely on its own, not connected > with SBCL in any way, although Slime is supposed to support SBCL. I tried > several solutions which I found on the Internet, suggesting adding things in > .emacs configuration file. However, none of those suggestions worked. So my > question is, which is the "best" Lisp implementation I should use for > Maxima-oriented Lisp programming, and how can I use it in Emacs? > > _______________________________________________ > 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 Fri Oct 14 11:51:31 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 14 Oct 2011 09:51:31 -0700 Subject: [Maxima] Lisp programming and Emacs In-Reply-To: References: Message-ID: <4E986893.30006@eecs.berkeley.edu> .... > > but somehow those two are not connected, so I cannot, for > example, mark a region of a Lisp program and execute it in SBCL > with keystrokes like C-c C-b, as I do with Maxima programs. > > You may perhaps have not installed everything correctly. I use a different setup, but in your emacs, did you try $run-lisp to get an SBCL window? > In fact, the Lisp program edited in Emacs seems completely on its > own, not connected with SBCL in any way, although Slime is > supposed to support SBCL. I tried several solutions which I found > on the Internet, suggesting adding things in .emacs configuration > file. However, none of those suggestions worked. So my question > is, which is the "best" Lisp implementation I should use for > Maxima-oriented Lisp programming, and how can I use it in Emacs? > which lisp? it doesn't matter, I suspect. The same lisp that the Maxima system is using? -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.j.papasot at gmail.com Fri Oct 14 11:54:53 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Fri, 14 Oct 2011 19:54:53 +0300 Subject: [Maxima] Lisp programming and Emacs In-Reply-To: References: Message-ID: It still doesn't work... I can run sbcl with M-x slime, but it complains that 'package "ASDF" not found', although cl-asdf is installed. After that, if I try to compile a function with C-c C-c, I get an annoying message "Polling /tmp/slime.xxxx", which stays there forever. I can load a lisp file from repl though. I have to say it is the first time I see an Emacs mode not working as expected, or at least not working out-of-the-box. Furthermore, the idea of using a client-server model implemented in slime/swank seems strange to me. All that just to compile lisp programs from within Emacs? 2011/10/14 Raymond Toy > > > On Fri, Oct 14, 2011 at 2:48 AM, Panagiotis Papasotiriou < > p.j.papasot at gmail.com> wrote: > >> for Maxima sessions, gnuplot sessions, and as an IDE for Fortran 90 or >> C/C++ programming. As far I can tell, "Slime" is the Emacs package for Lisp >> programming. I installed Slime and SBCL (directly from Debian GNU/Linux >> repositories) but somehow those two are not connected, so I cannot, for >> example, mark a region of a Lisp program and execute it in SBCL with >> keystrokes like C-c C-b, as I do with Maxima programs. In fact, the Lisp >> program edited in Emacs seems completely on its own, not connected with SBCL >> in any way, although Slime is supposed to support SBCL. I tried several >> solutions which I found on the Internet, suggesting adding things in .emacs >> configuration file. However, none of those suggestions worked. So my >> question is, which is the "best" Lisp implementation I should use for >> Maxima-oriented Lisp programming, and how can I use it in Emacs? >> > > Any lisp supported by slime will work fine. I use cmucl. Many use ccl, > ecl, or sbcl. > > Slime is pretty well documented, so you should read the documents. > > FWIW, this is what I use and it works fine me. In my xemacs init.el file, > I have: > > ;; Load slime > (setq inferior-lisp-program "cmulisp") > (setq slime-lisp-implementations > '((cmulisp ("cmulisp") :coding-system utf-8-unix) > (cmulisp-8bit ("cmulisp-8bit")))) > > (require 'slime) > (slime-setup '(slime-fancy slime-repl)) > > where cmulisp is my shell script that runs cmucl. Change cmulisp > (everywhere above) to sbcl. You can delete the cmulisp-8bit part. > > Then M-x slime will start slime and lisp for you in *slime-repl ". > In a lisp file, you can C-c C-c in a function and it will be compiled and > loaded into lisp. This doesn't work so well with maxima. There was a way > to hook up maxima to support compiling lisp code like this with slime, but I > don't remember how to do that anymore; I just load the lisp file from the > maxima repl. > > Ray > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Fri Oct 14 12:16:19 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 14 Oct 2011 10:16:19 -0700 Subject: [Maxima] Lisp programming and Emacs In-Reply-To: References: Message-ID: On Fri, Oct 14, 2011 at 9:54 AM, Panagiotis Papasotiriou < p.j.papasot at gmail.com> wrote: > It still doesn't work... I can run sbcl with M-x slime, but it complains > that 'package "ASDF" not found', although cl-asdf is installed. After that, > if I try to compile a function with C-c C-c, I get an annoying message > "Polling /tmp/slime.xxxx", which stays there forever. I can load a lisp file > from repl though. > Sorry, I can't help since I don't use slime with sbcl, but when I last tried it it worked fine. C-u M-x slime sbcl doesn't work for me either, but it looks like a version mismatch between sbcl and slime. > > I have to say it is the first time I see an Emacs mode not working as > expected, or at least not working out-of-the-box. Furthermore, the idea of > using a client-server model implemented in slime/swank seems strange to me. > All that just to compile lisp programs from within Emacs? How else would you have emacs talk to a different process? Anyway, this is no longer relevant to maxima. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.j.papasot at gmail.com Fri Oct 14 12:21:56 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Fri, 14 Oct 2011 20:21:56 +0300 Subject: [Maxima] Lisp programming and Emacs In-Reply-To: References: Message-ID: Stavro, (I won't use my native language as you will understand but everybody else will blame me) Sometime ago, I already tried to translate my Maxima functions, without success. Following your suggestion, I decided to give it a second try. I declared all variables using mode_declare, but translation fails. The function I am trying to translate has the form rkf45(odes,funcs,interval):=block( [],, ) Now, "funcs" is a dummy variable, which is supposed to be a list. Somewhere in the code, the following line causes an error: define(funmake(f_rhs,cons(interval[1],funcs)),odes), It says "cons: 2nd argument must be a non-atomic expression; found funcs". I suppose translator doesn't know funcs is a non-atomic expression. I tried to mode_declare funcs as a float, any, or even list (the latter is undocumented though). I still get the same error when I try to translate the code. Note that in the original Maxima code, function f_rhs is declared as local, but translator complains that "local" doesn't work well, so I removed local(f_rhs). 2011/10/14 Stavros Macrakis > Panagioti, > > I certainly don't want to discourage you from learning Lisp, but I'm not > sure that rewriting numerical Maxima code by hand in Lisp will teach you > much. Working on symbolic computations in Lisp may be more educational and > productive. > > Have you tried using mode_declare, compile, and arrays (rather than Maxima > lists and matrices) for your numerical code? With proper declarations and > use of arrays, compiled Maxima code should be almost as fast as hand-written > Lisp numerical code or even scalar Fortran code. > > -s > > On Fri, Oct 14, 2011 at 05:48, Panagiotis Papasotiriou < > p.j.papasot at gmail.com> wrote: > >> Dear community, my question is only implicitly related to Maxima, but I am >> sure someone could help: >> >> I wrote some Numerical Analysis functions in Maxima, and they perform very >> well. However, I guess a Lisp implementation of those functions would be >> faster (and I wonder how faster it will be.) So I decided to rewrite the >> functions in Lisp (good opportunity to learn Lisp as well.) I am a big fan >> of Emacs, which I use extensively for Maxima sessions, gnuplot sessions, and >> as an IDE for Fortran 90 or C/C++ programming. As far I can tell, "Slime" is >> the Emacs package for Lisp programming. I installed Slime and SBCL (directly >> from Debian GNU/Linux repositories) but somehow those two are not connected, >> so I cannot, for example, mark a region of a Lisp program and execute it in >> SBCL with keystrokes like C-c C-b, as I do with Maxima programs. In fact, >> the Lisp program edited in Emacs seems completely on its own, not connected >> with SBCL in any way, although Slime is supposed to support SBCL. I tried >> several solutions which I found on the Internet, suggesting adding things in >> .emacs configuration file. However, none of those suggestions worked. So my >> question is, which is the "best" Lisp implementation I should use for >> Maxima-oriented Lisp programming, and how can I use it in Emacs? >> >> _______________________________________________ >> 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 Oct 14 12:28:46 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 14 Oct 2011 13:28:46 -0400 Subject: [Maxima] Lisp programming and Emacs In-Reply-To: References: Message-ID: Could you provide a minimal example that reproduces the problem you/re having? It sounds like you're doing fairly complicated things with dynamic function definitions etc. You should probably not declare list-valued variables at all. -s On Fri, Oct 14, 2011 at 13:21, Panagiotis Papasotiriou < p.j.papasot at gmail.com> wrote: > Stavro, > (I won't use my native language as you will understand but everybody else > will blame me) > > Sometime ago, I already tried to translate my Maxima functions, without > success. Following your suggestion, I decided to give it a second try. I > declared all variables using mode_declare, but translation fails. The > function I am trying to translate has the form > > rkf45(odes,funcs,interval):=block( > [],, > ) > > Now, "funcs" is a dummy variable, which is supposed to be a list. Somewhere > in the code, the following line causes an error: > > define(funmake(f_rhs,cons(interval[1],funcs)),odes), > > It says "cons: 2nd argument must be a non-atomic expression; found funcs". > I suppose translator doesn't know funcs is a non-atomic expression. I tried > to mode_declare funcs as a float, any, or even list (the latter is > undocumented though). I still get the same error when I try to translate the > code. > Note that in the original Maxima code, function f_rhs is declared as local, > but translator complains that "local" doesn't work well, so I removed > local(f_rhs). > > > 2011/10/14 Stavros Macrakis > >> Panagioti, >> >> I certainly don't want to discourage you from learning Lisp, but I'm not >> sure that rewriting numerical Maxima code by hand in Lisp will teach you >> much. Working on symbolic computations in Lisp may be more educational and >> productive. >> >> Have you tried using mode_declare, compile, and arrays (rather than Maxima >> lists and matrices) for your numerical code? With proper declarations and >> use of arrays, compiled Maxima code should be almost as fast as hand-written >> Lisp numerical code or even scalar Fortran code. >> >> -s >> >> On Fri, Oct 14, 2011 at 05:48, Panagiotis Papasotiriou < >> p.j.papasot at gmail.com> wrote: >> >>> Dear community, my question is only implicitly related to Maxima, but I >>> am sure someone could help: >>> >>> I wrote some Numerical Analysis functions in Maxima, and they perform >>> very well. However, I guess a Lisp implementation of those functions would >>> be faster (and I wonder how faster it will be.) So I decided to rewrite the >>> functions in Lisp (good opportunity to learn Lisp as well.) I am a big fan >>> of Emacs, which I use extensively for Maxima sessions, gnuplot sessions, and >>> as an IDE for Fortran 90 or C/C++ programming. As far I can tell, "Slime" is >>> the Emacs package for Lisp programming. I installed Slime and SBCL (directly >>> from Debian GNU/Linux repositories) but somehow those two are not connected, >>> so I cannot, for example, mark a region of a Lisp program and execute it in >>> SBCL with keystrokes like C-c C-b, as I do with Maxima programs. In fact, >>> the Lisp program edited in Emacs seems completely on its own, not connected >>> with SBCL in any way, although Slime is supposed to support SBCL. I tried >>> several solutions which I found on the Internet, suggesting adding things in >>> .emacs configuration file. However, none of those suggestions worked. So my >>> question is, which is the "best" Lisp implementation I should use for >>> Maxima-oriented Lisp programming, and how can I use it in Emacs? >>> >>> _______________________________________________ >>> 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 p.j.papasot at gmail.com Fri Oct 14 13:01:00 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Fri, 14 Oct 2011 21:01:00 +0300 Subject: [Maxima] Lisp programming and Emacs In-Reply-To: References: Message-ID: 2011/10/14 Stavros Macrakis > Could you provide a minimal example that reproduces the problem you/re > having? It sounds like you're doing fairly complicated things with dynamic > function definitions etc. My function, "rkf45", implements the Runge-Kutta-Fehleberg (4th-5th order) algorithm for solving initial-value problems. I was thinking it would be nice if it is added in maxima/share, as it supports automatic step size and error control. As far I can tell, Maxima lacks a good ODE numerical integrator at the moment (there is rk, but it is a simple fixed-size Runge-Kutta implementation - definitely not appropriate for serious work.) I have tested the Maxima code for rkf45 rather extensively, and it seems capable of solving difficult problems pretty well, with minimal computation effort (the algorithm increases the step size whenever this is safe.) Results returned satisfy a prescribed accuracy criterion, given by the user. Tests of the code included several complex initial value problems found in the literature, and the results I get are highly accurate. I also wrote extensive documentation with lots of examples (the pdf file documenting rkf45 is more than 40 pages at the moment, and it's not finished yet.) Dynamic function definition is used only once in the code. It can be avoided, but that would make the call of rkf45 more complicated, not "natural" for a computer algebra system, and different from that of rk. I tried to make the code compatible with rk, so that users won't get confused. Code execution depends on the problem being solved, of course, but in general rkf45 needs a few seconds to solve an initial value problem (way less than one second for simple problems.) However, I was thinking that translating it to lisp would make it much faster. > You should probably not declare list-valued variables at all. > Unfortunately, that's impossible. Actually, all dummy variables are (and must be) lists. So the question is, how can I mode_declare a list? And, if that's not possible, how can I get the same functionality? > > > -s > > On Fri, Oct 14, 2011 at 13:21, Panagiotis Papasotiriou < > p.j.papasot at gmail.com> wrote: > >> Stavro, >> (I won't use my native language as you will understand but everybody else >> will blame me) >> >> Sometime ago, I already tried to translate my Maxima functions, without >> success. Following your suggestion, I decided to give it a second try. I >> declared all variables using mode_declare, but translation fails. The >> function I am trying to translate has the form >> >> rkf45(odes,funcs,interval):=block( >> [],, >> ) >> >> Now, "funcs" is a dummy variable, which is supposed to be a list. >> Somewhere in the code, the following line causes an error: >> >> define(funmake(f_rhs,cons(interval[1],funcs)),odes), >> >> It says "cons: 2nd argument must be a non-atomic expression; found funcs". >> I suppose translator doesn't know funcs is a non-atomic expression. I tried >> to mode_declare funcs as a float, any, or even list (the latter is >> undocumented though). I still get the same error when I try to translate the >> code. >> Note that in the original Maxima code, function f_rhs is declared as >> local, but translator complains that "local" doesn't work well, so I removed >> local(f_rhs). >> >> >> 2011/10/14 Stavros Macrakis >> >>> Panagioti, >>> >>> I certainly don't want to discourage you from learning Lisp, but I'm not >>> sure that rewriting numerical Maxima code by hand in Lisp will teach you >>> much. Working on symbolic computations in Lisp may be more educational and >>> productive. >>> >>> Have you tried using mode_declare, compile, and arrays (rather than >>> Maxima lists and matrices) for your numerical code? With proper >>> declarations and use of arrays, compiled Maxima code should be almost as >>> fast as hand-written Lisp numerical code or even scalar Fortran code. >>> >>> -s >>> >>> On Fri, Oct 14, 2011 at 05:48, Panagiotis Papasotiriou < >>> p.j.papasot at gmail.com> wrote: >>> >>>> Dear community, my question is only implicitly related to Maxima, but I >>>> am sure someone could help: >>>> >>>> I wrote some Numerical Analysis functions in Maxima, and they perform >>>> very well. However, I guess a Lisp implementation of those functions would >>>> be faster (and I wonder how faster it will be.) So I decided to rewrite the >>>> functions in Lisp (good opportunity to learn Lisp as well.) I am a big fan >>>> of Emacs, which I use extensively for Maxima sessions, gnuplot sessions, and >>>> as an IDE for Fortran 90 or C/C++ programming. As far I can tell, "Slime" is >>>> the Emacs package for Lisp programming. I installed Slime and SBCL (directly >>>> from Debian GNU/Linux repositories) but somehow those two are not connected, >>>> so I cannot, for example, mark a region of a Lisp program and execute it in >>>> SBCL with keystrokes like C-c C-b, as I do with Maxima programs. In fact, >>>> the Lisp program edited in Emacs seems completely on its own, not connected >>>> with SBCL in any way, although Slime is supposed to support SBCL. I tried >>>> several solutions which I found on the Internet, suggesting adding things in >>>> .emacs configuration file. However, none of those suggestions worked. So my >>>> question is, which is the "best" Lisp implementation I should use for >>>> Maxima-oriented Lisp programming, and how can I use it in Emacs? >>>> >>>> _______________________________________________ >>>> 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 Oct 14 13:09:19 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 14 Oct 2011 14:09:19 -0400 Subject: [Maxima] Lisp programming and Emacs In-Reply-To: References: Message-ID: On Fri, Oct 14, 2011 at 14:01, Panagiotis Papasotiriou < p.j.papasot at gmail.com> wrote: > 2011/10/14 Stavros Macrakis > >> Could you provide a minimal example that reproduces the problem you/re >> having? It sounds like you're doing fairly complicated things with dynamic >> function definitions etc. > > > My function, "rkf45", implements the Runge-Kutta-Fehleberg (4th-5th order) > algorithm for solving initial-value problems. I was thinking it would be > nice if it is added in maxima/share, as it supports automatic step size and > error control. > Yes, that would be great! Dynamic function definition is used only once in the code. It can be > avoided,... > I wasn't suggesting that you avoid it. Just that it will be hard to help you improve the compilation of the code without getting a reproducible (and preferably small) example of the problem you're having. > However, I was thinking that translating it to lisp would make it much > faster. > Yes, it should, but the existing 'translate' function does a pretty good job of that -- no need for manual translation. > You should probably not declare list-valued variables at all. >> > > Unfortunately, that's impossible. Actually, all dummy variables are (and > must be) lists. So the question is, how can I mode_declare a list? And, if > that's not possible, how can I get the same functionality? > I think you're misunderstanding my remark. You can certainly ***use*** list-valued variables. You should simply not mode_declare them; undeclared variables can take any value of any type. I don't know what you're using lists for, but if you're using them to represent numeric vectors, that will not be good for performance (unless you always traverse them left to right); random access in Maxima/Lisp lists is relatively slow. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.j.papasot at gmail.com Fri Oct 14 13:55:14 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Fri, 14 Oct 2011 21:55:14 +0300 Subject: [Maxima] Lisp programming and Emacs In-Reply-To: References: Message-ID: This is a rather minimal example. It doesn't do anything useful by itself, but it demonstrates the problem: foo(odes,funcs,initial,interval):=block( [xi,yi], mode_declare([xi,yi],any), xi:interval[2], yi:initial, define(funmake(f_rhs,cons(interval[1],funcs)),odes), apply(f_rhs,cons(xi,yi)) )$ Now, if you execute that code then trying, for example, foo([x+y],[y],[1],[x,2]); you get [3], as expected: with that call of foo, funcs=x+y, xi=[2], yi=[1], so apply(f_rhs,cons(xi,yi)) should return 2+1=3. Now, if you try to translate the code you get the error: cons: 2nd argument must be a non-atomic expression; found funcs Apparently, translator complains about the line define(funmake(f_rhs,cons(interval[1],funcs)),odes), Here, funcs is the 2nd argument of cons, and as such, it should be a list, but the translator doesn't know this is the case. I tried to mode_declare funcs as "any" or as "list", although funcs is a dummy variable, and manual says only local variables should be mode_declare'd. It didn't work. Furthermore, mode_declare doesn't say anything about declaring lists. Note that in this example, funcs is a list of only one element for the sake of simplicity; in the real code, it can be a list of many elements. 2011/10/14 Stavros Macrakis > On Fri, Oct 14, 2011 at 14:01, Panagiotis Papasotiriou < > p.j.papasot at gmail.com> wrote: > >> 2011/10/14 Stavros Macrakis >> >>> Could you provide a minimal example that reproduces the problem you/re >>> having? It sounds like you're doing fairly complicated things with dynamic >>> function definitions etc. >> >> >> My function, "rkf45", implements the Runge-Kutta-Fehleberg (4th-5th order) >> algorithm for solving initial-value problems. I was thinking it would be >> nice if it is added in maxima/share, as it supports automatic step size and >> error control. >> > > Yes, that would be great! > > Dynamic function definition is used only once in the code. It can be >> avoided,... >> > > I wasn't suggesting that you avoid it. Just that it will be hard to help > you improve the compilation of the code without getting a reproducible (and > preferably small) example of the problem you're having. > > >> However, I was thinking that translating it to lisp would make it much >> faster. >> > > Yes, it should, but the existing 'translate' function does a pretty good > job of that -- no need for manual translation. > > >> You should probably not declare list-valued variables at all. >>> >> >> Unfortunately, that's impossible. Actually, all dummy variables are (and >> must be) lists. So the question is, how can I mode_declare a list? And, if >> that's not possible, how can I get the same functionality? >> > > I think you're misunderstanding my remark. You can certainly ***use*** > list-valued variables. You should simply not mode_declare them; undeclared > variables can take any value of any type. > > I don't know what you're using lists for, but if you're using them to > represent numeric vectors, that will not be good for performance (unless you > always traverse them left to right); random access in Maxima/Lisp lists is > relatively slow. > > -s > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Fri Oct 14 14:19:50 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 14 Oct 2011 15:19:50 -0400 Subject: [Maxima] Lisp programming and Emacs In-Reply-To: References: Message-ID: Not sure if this is the *same* bug, but here is a bug in 'translate' that appears with a simpler case: f(vars):=define(funmake('f,vars),2)$ f([a,b,c]); => f(a, b, c) := 2 OK translate(f)$ f([a,b,c]); Maxima encountered a Lisp error: Error in $F [or a callee]: $F [or a callee] requires more than one argument. I suspect that the best workaround for this is to do anything involving funmake, define, etc. in interpreted code, and only use compiled code for the core computation. Unless of course someone is ready to roll up their sleeves and fix the bug. I wrote the original 'translate' in the 1970's, but the current one is completely different. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.j.papasot at gmail.com Fri Oct 14 14:37:29 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Fri, 14 Oct 2011 22:37:29 +0300 Subject: [Maxima] Lisp programming and Emacs In-Reply-To: References: Message-ID: Yes, it seems it is the same bug, or at least caused by the same reason. The only workaround I can think is to avoid dynamic function definition within the translated code. Unfortunately. this would make the call of the function more close to Fortran than what it is expected in a Computer Algebra System. Maybe it is a better idea to leave the code untranslated, and publish it as it is now. I am very curious to see how faster the translated code is, though. I will come back with more news on the subject soon. Thank you for your help. 2011/10/14 Stavros Macrakis > Not sure if this is the *same* bug, but here is a bug in 'translate' that > appears with a simpler case: > > f(vars):=define(funmake('f,vars),2)$ > f([a,b,c]); => f(a, b, c) := 2 OK > translate(f)$ > f([a,b,c]); > Maxima encountered a Lisp error: > Error in $F [or a callee]: $F [or a callee] requires more than one > argument. > > I suspect that the best workaround for this is to do anything involving > funmake, define, etc. in interpreted code, and only use compiled code for > the core computation. > > Unless of course someone is ready to roll up their sleeves and fix the bug. > I wrote the original 'translate' in the 1970's, but the current one is > completely different. > > -s > -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Fri Oct 14 16:16:45 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 14 Oct 2011 21:16:45 +0000 (UTC) Subject: [Maxima] Lisp programming and Emacs References: Message-ID: Panagiotis Papasotiriou wrote: > It still doesn't work... I can run sbcl with M-x slime, but it complains > that 'package "ASDF" not found', although cl-asdf is installed. After that, > if I try to compile a function with C-c C-c, I get an annoying message > "Polling /tmp/slime.xxxx", which stays there forever. I can load a lisp file > from repl though. > > I have to say it is the first time I see an Emacs mode not working as > expected, or at least not working out-of-the-box. Furthermore, the idea of > using a client-server model implemented in slime/swank seems strange to me. > All that just to compile lisp programs from within Emacs? > Panagiotis, i suspect your sbcl on Debian is buggy, since this is the second time you have apparently impossible to understand problems with your setup. I can confirm you that emacs and slime work for me with cmucl and sbcl on Ubuntu 10.04 (64 bits), FreeBSD (i386) and Mac OS X (here with aquamacs). Slime is particularly interesting, not only to execute lisp code on the fly under emacs, but also to disentangle error reports, not mentioning correct formatting and colorization of code ... From talon at lpthe.jussieu.fr Fri Oct 14 16:52:52 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 14 Oct 2011 21:52:52 +0000 (UTC) Subject: [Maxima] Maxima by Example: new Ch. 2: Plots, Files, Read, Write, and Fit References: <7A1F9F754E364CDFBAA88090371621C7@edwinc367e16bd> Message-ID: Edwin Woollett wrote: > Maxima by Example, Ch. 2 has been rewritten and given a > new title: > > Chapter 2, Plots, Files, Read, Write, and Fit > As always, extremely nice examples of maxima usage. Thanks for all your work -- Michel Talon From p.j.papasot at gmail.com Fri Oct 14 17:13:09 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Sat, 15 Oct 2011 01:13:09 +0300 Subject: [Maxima] Maxima by Example: new Ch. 2: Plots, Files, Read, Write, and Fit In-Reply-To: <7A1F9F754E364CDFBAA88090371621C7@edwinc367e16bd> References: <7A1F9F754E364CDFBAA88090371621C7@edwinc367e16bd> Message-ID: Ted's "Maxima by Example" series was the first text I read about Maxima when I decided I should get rid of Mathematica and migrated to Maxima Since then, I always recommend it to students starting with Maxima. Thank you Ted. 2011/10/4 Edwin Woollett > Maxima by Example, Ch. 2 has been rewritten and given a > new title: > > Chapter 2, Plots, Files, Read, Write, and Fit > > Chapter 2 has been revised to include a large section > on working with files from within Maxima. The new > software file mfiles.mac includes many useful > file manipulation functions. The small file > mfiles1.lisp is loaded in by mfiles.mac. > ------------------------------**---------- > Files now available: > > --mbe2plotfit.pdf : Oct. 3, 2011, Maxima 5.25.1, 41 pages > --mbe2toc.txt : Detailed table of contents, Oct. 3, 2011 > --mbe2code.txt : Code file: Oct. 3, 2011, Maxima 5.25.1 > --qplot.mac : Maxima code for quick plots, Oct. 3, 2011, Maxima 5.25.1 > --mfiles.mac : Maxima code for file work, Oct. 3, 2011, Maxima 5.25.1 > --mfiles1.lisp : Lisp code loaded by mfiles.mac, Oct. 3, 2011, Maxima > 5.25.1 > --coffee.dat : Coffee cooling tab separated data file: July, 13, 2009 > ------------------------------**---------- > Chapter 2 Topics: > > A. Introduction to plot2d > > First Steps with plot2d > Parametric Plots > Line Width and Color Controls > Discrete Data Plots: Point Size, Color, > and Type Control > Plot of a Discontinuous Function > Using qplot for Quick Plots of One or More Functions > Multiple Plots Using the Embedded Option > --------------- > B. Working with Files Using the Package mfiles.mac > > file_search, probe_file, ls, and dir > ftype, file_length, file_info > print_file, print_lines > rename_file, delete_file, copy_file, file_convert, ftext_replace > Break file lines with pbreak(), email reply with reply_to > Search File with search_file > Search Multiple files with search_mfiles > read_data, read_text, write_data, with_stdout > --------------- > C. Least Squares Fit to Experimental Data > > Syntax of lsquares_estimates > Coffee Cooling Model > Experiment Data for Coffee Cooling > Least Squares Fit of Coffee Cooling Data > ------------------------------**----------------- > > The new function read_data is designed to work > correctly with unix, mac, and windows type text files. > > read_data uses the new functions read_line > (a replacement for the current Maxima function readline) > and print_line (a replacement for the current > Maxima function printline). > ------------------------------**----------------------- > Ted Woollett > http://www.csulb.edu/~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 p.j.papasot at gmail.com Fri Oct 14 17:37:56 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Sat, 15 Oct 2011 01:37:56 +0300 Subject: [Maxima] Translating Maxima functions. Message-ID: This is a continuation of the Lisp programming and Emacsthread, which however, turned out to be a discussion about translating Maxima functions, so it deserved another subject. Ok, I managed to change the code so that it can finally get translated, but the results are disappointing at the moment. It works, it gives correct results (which differ very slightly, compared to the untranslated code, but this is expected.) However, the big surprise is that program execution lasts slightly longer, compared to the untranslated version. I suspect (and please correct me if I'm wrong) that this happens because I needed to mode_declare almost all local variables as "any". Proper declaration is "float" but if I do that, I get several warning messages like: WARNING-> Assigning variable k1, whose mode is float,a value of mode any. Not only that, but the code doesn't work as well. I don't know how translation works, but I guess if most local variables are declared as "any", translation doesn't really do anything useful. Moreover, other options for mode declaring, such as "fixednum" and "number" are not documented, as far I can tell. Any guidelines about effective translation would be appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Fri Oct 14 18:30:28 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 14 Oct 2011 16:30:28 -0700 Subject: [Maxima] more quadpack? Message-ID: <0F484D5C49634882B53643E223A78F33@edwinc367e16bd> I have acquired Piessens et. al.'s book Quadpack, and notice on p. 156 a discussion of QAGP, which allows user input of "breakpoints" in the domain of integration, where local difficulties of the integrand may occur. Is it possible to get Maxima user access to a translated version of this code? This would make possible a more versatile code for nint (minimal nintegrate). Ted Woollett From talon at lpthe.jussieu.fr Fri Oct 14 19:00:22 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sat, 15 Oct 2011 00:00:22 +0000 (UTC) Subject: [Maxima] more quadpack? References: <0F484D5C49634882B53643E223A78F33@edwinc367e16bd> Message-ID: Edwin Woollett wrote: > I have acquired Piessens et. al.'s book > Quadpack, and notice on p. 156 a > discussion of QAGP, which allows user > input of "breakpoints" in the domain of > integration, where local difficulties of > the integrand may occur. > Is this the description of the analogous GNU program? http://www.gnu.org/software/gsl/manual/html_node/QAGP-adaptive-integration-wit h-known-singular-points.html > Is it possible to get Maxima user access > to a translated version of this code? > This would make possible a more > versatile code for nint (minimal nintegrate). > > Ted Woollett Looking at quadpack.lisp, apparently most procedures are wrapped, qag, qags, gagi, gaws, etc. but qagp is not. It may be easy to do taking examples on the other ones. -- Michel Talon From toy.raymond at gmail.com Fri Oct 14 22:00:48 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 14 Oct 2011 20:00:48 -0700 Subject: [Maxima] more quadpack? In-Reply-To: References: <0F484D5C49634882B53643E223A78F33@edwinc367e16bd> Message-ID: <4E98F760.7020303@gmail.com> On 10/14/11 5:00 PM, Michel Talon wrote: > Edwin Woollett wrote: > >> Is it possible to get Maxima user access >> to a translated version of this code? >> This would make possible a more >> versatile code for nint (minimal nintegrate). >> >> Ted Woollett > Looking at quadpack.lisp, apparently most procedures are wrapped, qag, > qags, gagi, gaws, etc. but qagp is not. It may be easy to do taking examples > on the other ones. > Yes, definitely possible. I was lazy because qagp has one of the more complicated interfaces. But I know more know about this kind of interfacing than I did then. Could you add that as either feature request on maxima's bug tracker? Ray From toy.raymond at gmail.com Sun Oct 16 00:08:02 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 15 Oct 2011 22:08:02 -0700 Subject: [Maxima] more quadpack? In-Reply-To: <4E98F760.7020303@gmail.com> References: <0F484D5C49634882B53643E223A78F33@edwinc367e16bd> <4E98F760.7020303@gmail.com> Message-ID: On 10/14/11 8:00 PM, Raymond Toy wrote: > Yes, definitely possible. I was lazy because qagp has one of the more > complicated interfaces. But I know more know about this kind of > interfacing than I did then. > > Could you add that as either feature request on maxima's bug tracker? Never mind. I've implemented the interface to qagp. You'll have to get to from git. A couple of examples: (%i17) quad_qags(abs(x-%pi/4)^(0.1),x,0,1); (%o17) [.8642219419275866, 1.701761398464896e-9, 945, 0] (%i18) quad_qagp(abs(x-%pi/4)^(0.1),x,0,1,[%pi/4]); (%o18) [.8642219426699342, 9.594790991384431e-16, 462, 0] Here, qagp is much more accurate and requires fewer evaluations. (%i19) quad_qags(abs(x-1/3)^(0.1),x,0,1); (%o19) [.8534810489167268, 9.475543115885799e-16, 189, 0] (%i20) quad_qagp(abs(x-1/3)^(0.1),x,0,1,[1/3]); (%o20) [.8534810489167265, 9.475543115885795e-16, 378, 0] In this case, the accuracy is comparable, but qags is less work. Finally, (%i21) quad_qags(x^3*log(abs((x^2-1)*(x^2-2))), x, 0, 3); (%o21) [52.74074847951494, 4.088443219529836e-7, 1869, 0] (%i22) quad_qagp(x^3*log(abs((x^2-1)*(x^2-2))), x, 0, 3, [1,sqrt(2)]); (%o22) [52.74074838347143, 2.6247632689546663e-7, 1029, 0] Here, qagp is more accurate and a bit less work. Ray From toy.raymond at gmail.com Sun Oct 16 01:20:52 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 15 Oct 2011 23:20:52 -0700 Subject: [Maxima] slatec error message surpression? In-Reply-To: References: Message-ID: <4E9A77C4.9000706@gmail.com> On 10/10/11 11:45 AM, Edwin Woollett wrote: > On Oct. 7, Raymond Toy wrote: > --------------------------- >> Stick the following in, say, j4save.lisp: > ----------------------------------- > Thanks for the error msg. surpression code, > which works fine. I've added this to maxima (in git), but the name is now quad_control, not quad_j4save. Ray From drdieterkaiser at web.de Sun Oct 16 09:40:35 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 16 Oct 2011 16:40:35 +0200 Subject: [Maxima] more quadpack? In-Reply-To: References: <0F484D5C49634882B53643E223A78F33@edwinc367e16bd> <4E98F760.7020303@gmail.com> Message-ID: <1318776035.1861.3.camel@dieter> Am Samstag, den 15.10.2011, 22:08 -0700 schrieb Raymond Toy: > On 10/14/11 8:00 PM, Raymond Toy wrote: > > Yes, definitely possible. I was lazy because qagp has one of the more > > complicated interfaces. But I know more know about this kind of > > interfacing than I did then. > > > > Could you add that as either feature request on maxima's bug tracker? > > Never mind. > > I've implemented the interface to qagp. You'll have to get to from git. > > A couple of examples: > > (%i17) quad_qags(abs(x-%pi/4)^(0.1),x,0,1); > (%o17) [.8642219419275866, 1.701761398464896e-9, 945, 0] > (%i18) quad_qagp(abs(x-%pi/4)^(0.1),x,0,1,[%pi/4]); > (%o18) [.8642219426699342, 9.594790991384431e-16, 462, 0] > > Here, qagp is much more accurate and requires fewer evaluations. > > (%i19) quad_qags(abs(x-1/3)^(0.1),x,0,1); > (%o19) [.8534810489167268, 9.475543115885799e-16, 189, 0] > (%i20) quad_qagp(abs(x-1/3)^(0.1),x,0,1,[1/3]); > (%o20) [.8534810489167265, 9.475543115885795e-16, 378, 0] > > In this case, the accuracy is comparable, but qags is less work. > > Finally, > > (%i21) quad_qags(x^3*log(abs((x^2-1)*(x^2-2))), x, 0, 3); > (%o21) [52.74074847951494, 4.088443219529836e-7, 1869, 0] > (%i22) quad_qagp(x^3*log(abs((x^2-1)*(x^2-2))), x, 0, 3, [1,sqrt(2)]); > (%o22) [52.74074838347143, 2.6247632689546663e-7, 1029, 0] > > Here, qagp is more accurate and a bit less work. Hello Ray, when compiling quadpack.lisp I get an error with SBCL. The symbol j4save is not exported. It works if I add the symbol j4save to the exported symbols in the file slatec.lisp. This is the message from the compiler: ; compiling (DEFUN QUAD_ARGUMENT_CHECK ...); ; compilation aborted because of fatal error: ; SB-INT:SIMPLE-READER-PACKAGE-ERROR at 10075 (line 328, column 17) on #: ; The symbol "J4SAVE" is not external in the SLATEC package. Dieter Kaiser From adammaj1 at o2.pl Sun Oct 16 15:21:04 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Sun, 16 Oct 2011 20:21:04 +0000 (UTC) Subject: [Maxima] Lisp programming and Emacs References: Message-ID: Hi, I'm not good at emacs but I have emacs/slime/sbcl. sudo apt-get install slime cl-swank sbcl echo '(setq inferior-lisp-program "sbcl")' >> ~/.emacs > I installed Slime and SBCL (directly from Debian GNU/Linux repositories) > but somehow those two are not connected, so I cannot, for example, mark > a region of a Lisp program and execute it in SBCL with keystrokes like > C-c C-b ... After M-x slime I have checked list of all defined keystrokes : C-h b In my list I do not see C-c C-b defined Is it in your list ? Best regards Adam From adammaj1 at o2.pl Sun Oct 16 15:25:59 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Sun, 16 Oct 2011 20:25:59 +0000 (UTC) Subject: [Maxima] limit / Continued fraction Message-ID: Hi, I would like to find limit of Continued fraction [3,2,1000,1...] http://www.warwick.ac.uk/~masiay/Research/Siegel.html In maxima I can compute n-term finite fraction : a: [0,3,2,1000,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] (%o1) [0,3,2,1000,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] (%i2) t:cfdisrep(a) (%o2) (1)/(3+(1)/(2+(1)/(1000+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 +(1)/(1+(1)/(1+(1)/(1+(1)/(1+ (1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 +1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/ (1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 +1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/ (1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 +1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 +1/1))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) (%i3) float(t) Can I find it's limit ? TIA Adam From l_butler at users.sourceforge.net Sun Oct 16 15:59:27 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Sun, 16 Oct 2011 20:59:27 +0000 Subject: [Maxima] Lisp programming and Emacs In-Reply-To: (message from Panagiotis Papasotiriou on Fri, 14 Oct 2011 12:48:35 +0300) Message-ID: <1qp1uucps9c.fsf@iceland.freeshell.org> Panagiotis Papasotiriou writes: > As far I can tell, "Slime" is > the Emacs package for Lisp programming. I installed Slime and SBCL (directly > from Debian GNU/Linux repositories) but somehow those two are not connected, > so I cannot, for example, mark a region of a Lisp program and execute it in > SBCL with keystrokes like C-c C-b, as I do with Maxima programs. In fact, > the Lisp program edited in Emacs seems completely on its own, not connected > with SBCL in any way, although Slime is supposed to support SBCL. I tried > several solutions which I found on the Internet, suggesting adding things in > .emacs configuration file. However, none of those suggestions worked. So my > question is, which is the "best" Lisp implementation I should use for > Maxima-oriented Lisp programming, and how can I use it in Emacs? You don't provide much information about how you started slime, so it is difficult to say what is happening. However, my experience with debian and slime+sbcl is that slime sometimes gets confused during start-up--but it tells you what it is confused about in the *inferior-lisp* buffer. I can usually resolve the problem on the command line in that buffer and resume, or in the grimmest cases killing slime and restarting will work fine. Anyhow, here is some emacs lisp code I use to run a Maxima lisp image inside a slime session. A while ago I had to add the SBCL_HOME bit in order for sbcl to start properly. ;; see ;; http://common-lisp.net/pipermail/slime-devel/2009-December/017018.html ;; for an explanation of this function (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)))) ;; Set Lisps (setq slime-lisp-implementations '((cmucl ("cmucl" "-quiet") :init load-swank-dont-close) (clisp ("/usr/bin/clisp") :init load-swank-dont-close) (sbcl ("sbcl" "-quiet") :init load-swank-dont-close) (maxima-5.25.1-sbcl ("sbcl" "--core" "/usr/local/lib/maxima/5.25.1/binary-sbcl/maxima.core" "--noinform" "--end-runtime-options" "--eval" "(cl-user::run)" "--end-toplevel-options" "--init=/dev/null") :init-function slime-init-fn-msbcl :env ("SBCL_HOME=/usr/lib/sbcl") :init slime-maxima-init ))) ;; helper functions to switch Maxima into the Lisp reader and select the package (defun slime-init-fn-msbcl () (insert "(in-package :maxima)\n")) (defun slime-maxima-init (p e) (concat "to_lisp();\n(in-package :cl-user)\n" (load-swank-dont-close p e) "\n")) HTH -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From toy.raymond at gmail.com Sun Oct 16 15:59:37 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 16 Oct 2011 13:59:37 -0700 Subject: [Maxima] more quadpack? In-Reply-To: <1318776035.1861.3.camel@dieter> References: <0F484D5C49634882B53643E223A78F33@edwinc367e16bd> <4E98F760.7020303@gmail.com> <1318776035.1861.3.camel@dieter> Message-ID: <4E9B45B9.7030507@gmail.com> On 10/16/11 7:40 AM, Dieter Kaiser wrote: > Am Samstag, den 15.10.2011, 22:08 -0700 schrieb Raymond Toy: >> On 10/14/11 8:00 PM, Raymond Toy wrote: >>> Yes, definitely possible. I was lazy because qagp has one of the more >>> complicated interfaces. But I know more know about this kind of >>> interfacing than I did then. >>> >>> Could you add that as either feature request on maxima's bug tracker? >> Never mind. >> >> I've implemented the interface to qagp. You'll have to get to from git. >> >> A couple of examples: >> >> (%i17) quad_qags(abs(x-%pi/4)^(0.1),x,0,1); >> (%o17) [.8642219419275866, 1.701761398464896e-9, 945, 0] >> (%i18) quad_qagp(abs(x-%pi/4)^(0.1),x,0,1,[%pi/4]); >> (%o18) [.8642219426699342, 9.594790991384431e-16, 462, 0] >> >> Here, qagp is much more accurate and requires fewer evaluations. >> >> (%i19) quad_qags(abs(x-1/3)^(0.1),x,0,1); >> (%o19) [.8534810489167268, 9.475543115885799e-16, 189, 0] >> (%i20) quad_qagp(abs(x-1/3)^(0.1),x,0,1,[1/3]); >> (%o20) [.8534810489167265, 9.475543115885795e-16, 378, 0] >> >> In this case, the accuracy is comparable, but qags is less work. >> >> Finally, >> >> (%i21) quad_qags(x^3*log(abs((x^2-1)*(x^2-2))), x, 0, 3); >> (%o21) [52.74074847951494, 4.088443219529836e-7, 1869, 0] >> (%i22) quad_qagp(x^3*log(abs((x^2-1)*(x^2-2))), x, 0, 3, [1,sqrt(2)]); >> (%o22) [52.74074838347143, 2.6247632689546663e-7, 1029, 0] >> >> Here, qagp is more accurate and a bit less work. > Hello Ray, > > when compiling quadpack.lisp I get an error with SBCL. The symbol j4save > is not exported. It works if I add the symbol j4save to the exported > symbols in the file slatec.lisp. > That's because I was stupid and forgot to check in my changes and push it to the repo. Ray From p.j.papasot at gmail.com Sun Oct 16 17:05:24 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Mon, 17 Oct 2011 01:05:24 +0300 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: All necessary stuff can be found in https://sites.google.com/site/pjpapasot/maxima/temporary The code in question is the function "rkf45" and its translated version, "rkf45_translated". These are basically the same. The only difference is that in rkf45_translated the first argument is passed as a function created by the user in main program, while in the non-translated code, rkf45, the function is created dynamically. I needed to change this in order to be able to translate the code (discussion about this a previous thread.) To test the codes, run the "driver" program Test.mac, which solves a stiff problem (so that it takes more time than usual and the difference in time execution is more pronounced.) In my system (Quad Core processor @ 4 x 3 GHz, 4Mb RAM, running Debian GNU/LInux, 64 bit version), solving the problem using non-translated code rkf45 takes about 31 seconds, while translated code needs about 32.5 seconds. I can only think of two reasons causing that: either mode_declaring floats as "any" doesn't help at all, or function odes(x,y), which is called six times in every iteration, takes much more time to be evaluated than the corresponding local function in rkf45, named f_rhs, which is created dynamically. Note that the block of variables [atol,xi,...x_tiny] should be declared as "float", but if I try that, the translated code doesn't run at all. Moreover, the block [maxit,bad_steps] should be declared as integer, but it is not clear in the documentation how I can do that (I suspect they should be declared as "number", but this is undocumented, as far I can tell.) Also note that the code might need some polishing and fine-tuning before final release. > 2011/10/15 Robert Dodier > >> Can you post the code in question? I think that would clarify the >> discussion. >> >> best >> >> Robert Dodier >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.j.papasot at gmail.com Sun Oct 16 17:10:36 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Mon, 17 Oct 2011 01:10:36 +0300 Subject: [Maxima] Lisp programming and Emacs In-Reply-To: References: Message-ID: C-c C-b was just an example (the usual keystrokes needed in several Emacs modes to evaluate a file (e.g. in Maxima- or gnuplot-mode.) 2011/10/16 Adam Majewski > Hi, > > I'm not good at emacs but I have emacs/slime/sbcl. > > sudo apt-get install slime cl-swank sbcl > echo '(setq inferior-lisp-program "sbcl")' >> ~/.emacs > > > > > I installed Slime and SBCL (directly from Debian GNU/Linux repositories) > > but somehow those two are not connected, so I cannot, for example, mark > > a region of a Lisp program and execute it in SBCL with keystrokes like > > C-c C-b ... > > After > M-x slime > I have checked list of all defined keystrokes : > C-h b > In my list I do not see C-c C-b defined > > Is it in your list ? > > Best regards > > Adam > > > > _______________________________________________ > 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 Mon Oct 17 11:09:47 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Mon, 17 Oct 2011 16:09:47 +0000 (UTC) Subject: [Maxima] Translating Maxima functions. References: Message-ID: Panagiotis Papasotiriou wrote: > All necessary stuff can be found in > https://sites.google.com/site/pjpapasot/maxima/temporary > > The code in question is the function "rkf45" and its translated version, > "rkf45_translated". These are basically the same. The only difference is > that in rkf45_translated the first argument is passed as a function created > by the user in main program, while in the non-translated code, rkf45, the > function is created dynamically. I needed to change this in order to be able > to translate the code (discussion about this a previous thread.) > > To test the codes, run the "driver" program Test.mac, which solves a stiff > problem (so that it takes more time than usual and the difference in time > execution is more pronounced.) In my system (Quad Core processor @ 4 x 3 > GHz, 4Mb RAM, running Debian GNU/LInux, 64 bit version), solving the problem > using non-translated code rkf45 takes about 31 seconds, while translated > code needs about 32.5 seconds. I continue to think there is something strange on your machine. On my laptop here (Mac Air) the program runs faster (and the translated code is faster): lilas% \maxima Maxima 5.25.1 http://maxima.sourceforge.net using Lisp SBCL 1.0.47 ?? 2 3 (%i7) sol_stiff : rkf45(y - y , y, d, [x, x_start, x_end], max_iterations = 40000, report = true) ------------------------------------------------------ Info: rkf45: Integration points selected: 30209 Total number of iterations: 35145 Bad steps corrected: 4937 Minimum estimated error: 1.965404499142395e-19 Maximum estimated error: 9.99978753725041e-7 Minimum integration step taken: 0.344084594619511 Maximum integration step taken: 51200.0 ------------------------------------------------------ Evaluation took 17.9590 seconds (18.1830 elapsed) using 4426.317 MB. 2 3 (%i8) odes(x, y) := y - y Evaluation took 0.0000 seconds (0.0000 elapsed) using 0 bytes. (%i9) translate(odes) Evaluation took 0.0060 seconds (0.0070 elapsed) using 260.758 KB. (%i10) sol_stiff : rkf45_translated(odes, y, d, [x, x_start, x_end], max_iterations = 40000, report = true) ------------------------------------------------------ Info: rkf45: Integration points selected: 30211 Total number of iterations: 35149 Bad steps corrected: 4939 Minimum estimated error: 1.965404499142395e-19 Maximum estimated error: 9.998794583131294e-7 Minimum integration step taken: .3440845946200041 Maximum integration step taken: 51200.0 ------------------------------------------------------ Evaluation took 15.5930 seconds (15.7270 elapsed) using 4607.490 MB. (%i11) showtime : false (%o11) /Users/michel/Downloads/Test.mac -- Michel Talon From macrakis at alum.mit.edu Mon Oct 17 11:34:13 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 17 Oct 2011 12:34:13 -0400 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: On Sun, Oct 16, 2011 at 18:05, Panagiotis Papasotiriou < p.j.papasot at gmail.com> wrote: > ...either mode_declaring floats as "any" doesn't help at all... Correct, declaring an object as "any" means that Maxima must handle the general case of symbolic arithmetic (see below). To get fast numerical arithmetic, you need to operate on floats. General symbolic arithmetic is much slower than numerical arithmetic. See the trace below to see how Maxima simplifies 1+2 => 3 -s f(x):=(modedeclare(x,any),x+1)$ translate(f)$ f(z) => z+1 g(x):=(modedeclare(x,float),x+1)$ translate(g)$ g(z) => Maxima encountered a Lisp error: Error in + [or a callee]: $%PI is not of type NUMBER. ---------------------------- 1> (SIMPLIFYA ((MPLUS) 1 2) NIL) 2> (SIMPLUS ((MPLUS) 1 2) 1 NIL) 3> (SIMPLIFYA 1 NIL) <3 (SIMPLIFYA 1) 3> (PLS 1 NIL) 4> (MNUMP 1) <4 (MNUMP T) <3 (PLS ((MPLUS) 1)) 3> (SIMPLIFYA 2 NIL) <3 (SIMPLIFYA 2) 3> (PLS 2 ((MPLUS) 1)) 4> (MNUMP 2) <4 (MNUMP T) 4> (MNUMP 1) <4 (MNUMP T) 4> (ADDK 1 2) <4 (ADDK 3) <3 (PLS ((MPLUS) 3)) 3> (TESTP ((MPLUS) 3)) <3 (TESTP 3) 3> (EQTEST 3 ((MPLUS) 1 2)) <3 (EQTEST 3) <2 (SIMPLUS 3) <1 (SIMPLIFYA 3) -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Oct 17 11:37:29 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 17 Oct 2011 12:37:29 -0400 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: Oops, shows what happens when you hand-edit machine output. Should be: > g(x):=(modedeclare(x,float),x+1)$ > translate(g)$ > g(z) => > Maxima encountered a Lisp error: > Error in + [or a callee]: Z is not of type NUMBER. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From william.wood3 at comcast.net Mon Oct 17 23:04:39 2011 From: william.wood3 at comcast.net (Bill Wood) Date: Mon, 17 Oct 2011 23:04:39 -0500 Subject: [Maxima] limit / Continued fraction In-Reply-To: References: Message-ID: <1318910679.19810.3.camel@ubuntu> On Sun, 2011-10-16 at 20:25 +0000, Adam Majewski wrote: > Hi, > > I would like to find limit of Continued fraction [3,2,1000,1...] > http://www.warwick.ac.uk/~masiay/Research/Siegel.html . . . > Can I find it's limit ? I don't know if Maxima knows much about the algebra of continued fractions, but it can be of some help hacking out the manipulation details of a derivation. A most useful fact is that [a1, a2, a3, ...] = a1 + 1/[a2, a3, ...] provided the continued fraction converges. If we apply that three times by hand to [3, 2, 1000, 1, 1, ...] we obtain 3 + 1/(2 + 1/(1000 + 1/[1, 1, ...])) Now it is known that [1, 1, ...] converges to the Golden Ratio, (1+sqrt(5))/2. So now we can use Maxima as follows: (%i20) 3+(1/(2+(1/(1000+(1/((1+sqrt(5))/2)))))); 1 (%o20) ---------------------- + 3 1 ------------------ + 2 2 ----------- + 1000 sqrt(5) + 1 (%i21) factor(%o13); 7003 sqrt(5) + 7017 (%o21) ------------------- 2001 sqrt(5) + 2005 (%i22) %o21,numer; (%o22) 3.499750279196346 You set a to [0, 3, 2, 1000, 1, 1, ...], which by our useful fact must be the reciprocal of [3, 2, 1000, 1, 1, ...], and indeed the reciprocal of 3.499750279196346 is 0.2857346725405882, which is what your float(t) evaluates to, so we seem to get consistent results. If all of the continued fractions for the rotation numbers exhibited on the link you provided do end up repeating 1 forever then the method I used above can be used to determine their limits as ratios of linear expressions in sqrt(5). -- Bill Wood From p.j.papasot at gmail.com Tue Oct 18 04:33:59 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 18 Oct 2011 12:33:59 +0300 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: Everything is installed from Debian repositories. Maxima version installed is 5.24, as this is the "official" latest release yet. SBCL is also installed from the original Debian package, and it it version 1.0.51. 2011/10/17 Michel Talon > Panagiotis Papasotiriou wrote: > > All necessary stuff can be found in > > https://sites.google.com/site/pjpapasot/maxima/temporary > > > > The code in question is the function "rkf45" and its translated version, > > "rkf45_translated". These are basically the same. The only difference is > > that in rkf45_translated the first argument is passed as a function > created > > by the user in main program, while in the non-translated code, rkf45, the > > function is created dynamically. I needed to change this in order to be > able > > to translate the code (discussion about this a previous thread.) > > > > To test the codes, run the "driver" program Test.mac, which solves a > stiff > > problem (so that it takes more time than usual and the difference in time > > execution is more pronounced.) In my system (Quad Core processor @ 4 x 3 > > GHz, 4Mb RAM, running Debian GNU/LInux, 64 bit version), solving the > problem > > using non-translated code rkf45 takes about 31 seconds, while translated > > code needs about 32.5 seconds. > > I continue to think there is something strange on your machine. On my > laptop > here (Mac Air) the program runs faster (and the translated code is faster): > > lilas% \maxima > Maxima 5.25.1 http://maxima.sourceforge.net > using Lisp SBCL 1.0.47 > ?? > > 2 3 > (%i7) sol_stiff : rkf45(y - y , y, d, [x, x_start, x_end], > max_iterations = 40000, report = > true) > ------------------------------------------------------ > Info: rkf45: > Integration points selected: 30209 > Total number of iterations: 35145 > Bad steps corrected: 4937 > Minimum estimated error: 1.965404499142395e-19 > Maximum estimated error: 9.99978753725041e-7 > Minimum integration step taken: 0.344084594619511 > Maximum integration step taken: 51200.0 > ------------------------------------------------------ > Evaluation took 17.9590 seconds (18.1830 elapsed) using 4426.317 MB. > 2 3 > (%i8) odes(x, y) := y - y > Evaluation took 0.0000 seconds (0.0000 elapsed) using 0 bytes. > (%i9) translate(odes) > Evaluation took 0.0060 seconds (0.0070 elapsed) using 260.758 KB. > (%i10) sol_stiff : rkf45_translated(odes, y, d, [x, x_start, x_end], > max_iterations = 40000, report = > true) > ------------------------------------------------------ > Info: rkf45: > Integration points selected: 30211 > Total number of iterations: 35149 > Bad steps corrected: 4939 > Minimum estimated error: 1.965404499142395e-19 > Maximum estimated error: 9.998794583131294e-7 > Minimum integration step taken: .3440845946200041 > Maximum integration step taken: 51200.0 > ------------------------------------------------------ > Evaluation took 15.5930 seconds (15.7270 elapsed) using 4607.490 MB. > (%i11) showtime : false > (%o11) /Users/michel/Downloads/Test.mac > > > > -- > 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 p.j.papasot at gmail.com Tue Oct 18 05:04:52 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 18 Oct 2011 13:04:52 +0300 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: Stavro, looks like it is as I guessed... However, I still can't figure out why the code is not working if I declare variables in the [atol,xi,...x_tiny] block as "float". It is translated, with several warning messages complaining about using variables as "any" while they are declared as "float" (this is not true, but the translator complains about it.) However, the translated code is not running as expected. So far I failed to figure out why. Note that I have tested the non-translated code and it works very well. It gives accurate results even or really difficult initial-value problems.. Given the problems I encountered translating the code, and the fact execution time for the translated code (reported by Michel Talon) is not impressive compared to the non-translated code, I am afraid I will need to quit trying translation of complex algorithms for now, unless someone can figure out what is happening. I am planning to implement more numerical methods in Maxima, so that the user could easily solve the usual set of numerical problems encountered in practice, such as initial-value problems, boundary-value problems, cubic-spline interpolation (including calculation of derivatives) and others. Yes, maxima already has some packages for those tasks, but they are either not so easy to use or they don't offer much functionality. For example, Maxima's package for cubic splines, "interpol", only supports "natural" cubic splines (which are not natural at all, and should be avoided in most cases), and the interpolating function returned by interpol cannot be differentiated. Maxima's primary use is symbolic computations, but let's face it, numerical solution are more than necessary in practice. That's why most Computer Algebra Systems support a large set of numerical algorithms as well. Even the equation of motion for a simple pendulum cannot be solved analytically without assumptions "simplifying" the problem. 2011/10/17 Stavros Macrakis > On Sun, Oct 16, 2011 at 18:05, Panagiotis Papasotiriou < > p.j.papasot at gmail.com> wrote: > >> ...either mode_declaring floats as "any" doesn't help at all... > > > Correct, declaring an object as "any" means that Maxima must handle the > general case of symbolic arithmetic (see below). To get fast numerical > arithmetic, you need to operate on floats. > > General symbolic arithmetic is much slower than numerical arithmetic. See > the trace below to see how Maxima simplifies 1+2 => 3 > > -s > > f(x):=(modedeclare(x,any),x+1)$ > translate(f)$ > f(z) => z+1 > > g(x):=(modedeclare(x,float),x+1)$ > translate(g)$ > g(z) => > Maxima encountered a Lisp error: > Error in + [or a callee]: $%PI is not of type NUMBER. > ---------------------------- > 1> (SIMPLIFYA ((MPLUS) 1 2) NIL) > 2> (SIMPLUS ((MPLUS) 1 2) 1 NIL) > 3> (SIMPLIFYA 1 NIL) > <3 (SIMPLIFYA 1) > 3> (PLS 1 NIL) > 4> (MNUMP 1) > <4 (MNUMP T) > <3 (PLS ((MPLUS) 1)) > 3> (SIMPLIFYA 2 NIL) > <3 (SIMPLIFYA 2) > 3> (PLS 2 ((MPLUS) 1)) > 4> (MNUMP 2) > <4 (MNUMP T) > 4> (MNUMP 1) > <4 (MNUMP T) > 4> (ADDK 1 2) > <4 (ADDK 3) > <3 (PLS ((MPLUS) 3)) > 3> (TESTP ((MPLUS) 3)) > <3 (TESTP 3) > 3> (EQTEST 3 ((MPLUS) 1 2)) > <3 (EQTEST 3) > <2 (SIMPLUS 3) > <1 (SIMPLIFYA 3) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Tue Oct 18 06:37:36 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 18 Oct 2011 11:37:36 +0000 (UTC) Subject: [Maxima] Translating Maxima functions. References: Message-ID: Panagiotis Papasotiriou wrote: > Everything is installed from Debian repositories. Maxima version installed > is 5.24, as this is the "official" latest release yet. SBCL is also > installed from the original Debian package, and it it version 1.0.51. > Sure, but i am not so confident that everything in Debian repositories work OK. For example i have seen severely broken mplayer coming from "quasi official" repositories, and i had to recompile it myself. In the present cases i have doubts about sbcl, since you have already seen two problems. Maybe this 64 bits sbcl doesn't work OK, i don't know. -- Michel Talon From p.j.papasot at gmail.com Tue Oct 18 06:54:15 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 18 Oct 2011 14:54:15 +0300 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: Could you please replace rkf45_translated.mac with that one: https://sites.google.com/site/pjpapasot/maxima/temporary/rkf45_translated.mac?attredirects=0&d=1 and run Test.mac again? In that version of rkf45_translated, most local variables are declared as "float" instead of "any" (which is correct.) However, in my system that gives the following error when I run Test.mac: Maxima encountered a Lisp error: Error in * [or a callee]: ((MLIST SIMP) 1.9999800000000002E-7) is not of type NUMBER. The error is actually generated at line 113 of the code, which reads: k2:h*odes(xi+0.25*h,yi+0.25*k1), here, k1, computed at line 112, is 1.9999800000000002E-7 and, for some reason, that value is not accepted as a number, hence the error. I am curious to know if you get the same error. 2011/10/18 Michel Talon > Panagiotis Papasotiriou wrote: > > Everything is installed from Debian repositories. Maxima version > installed > > is 5.24, as this is the "official" latest release yet. SBCL is also > > installed from the original Debian package, and it it version 1.0.51. > > > > Sure, but i am not so confident that everything in Debian repositories work > OK. For example i have seen severely broken mplayer coming from "quasi > official" repositories, and i had to recompile it myself. In the present > cases > i have doubts about sbcl, since you have already seen two problems. Maybe > this > 64 bits sbcl doesn't work OK, i don't know. > > > > -- > 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 macrakis at alum.mit.edu Tue Oct 18 06:59:55 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 18 Oct 2011 07:59:55 -0400 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: The error message is showing that k1 is a list containing one number, not a number. Is that enough information to help you debug? Thanks for your work on improving and extending Maxima's numerical capabilities! -s On Oct 18, 2011 7:54 AM, "Panagiotis Papasotiriou" wrote: > Could you please replace rkf45_translated.mac with that one: > > > https://sites.google.com/site/pjpapasot/maxima/temporary/rkf45_translated.mac?attredirects=0&d=1 > > and run Test.mac again? In that version of rkf45_translated, most local > variables are declared as "float" instead of "any" (which is correct.) > However, in my system that gives the following error when I run Test.mac: > > Maxima encountered a Lisp error: > Error in * [or a callee]: ((MLIST SIMP) 1.9999800000000002E-7) is not of > type NUMBER. > > The error is actually generated at line 113 of the code, which reads: > > k2:h*odes(xi+0.25*h,yi+0.25*k1), > > here, k1, computed at line 112, is 1.9999800000000002E-7 and, for some > reason, that value is not accepted as a number, hence the error. I am > curious to know if you get the same error. > > 2011/10/18 Michel Talon > >> Panagiotis Papasotiriou wrote: >> > Everything is installed from Debian repositories. Maxima version >> installed >> > is 5.24, as this is the "official" latest release yet. SBCL is also >> > installed from the original Debian package, and it it version 1.0.51. >> > >> >> Sure, but i am not so confident that everything in Debian repositories >> work >> OK. For example i have seen severely broken mplayer coming from "quasi >> official" repositories, and i had to recompile it myself. In the present >> cases >> i have doubts about sbcl, since you have already seen two problems. Maybe >> this >> 64 bits sbcl doesn't work OK, i don't know. >> >> >> >> -- >> Michel Talon >> >> _______________________________________________ >> 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 p.j.papasot at gmail.com Tue Oct 18 07:20:24 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 18 Oct 2011 15:20:24 +0300 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: Stavro, k1 is actually a list of one (float) element in this particular example (in the general case, when solving a system of differential equations, k1 would have more than one elements.) So the question is, how can I mode_declare a list of floats so that it will work as expected when the code is translated? thank you for helping -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.j.papasot at gmail.com Tue Oct 18 07:21:42 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 18 Oct 2011 15:21:42 +0300 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: Stavro, k1 is actually a list of one (float) element in this particular example (in the general case, when solving a system of differential equations, k1 would have more than one elements.) So the question is, how can I mode_declare a list of floats so that it will work as expected when the code is translated? thank you for helping 2011/10/18 Stavros Macrakis > The error message is showing that k1 is a list containing one number, not a > number. Is that enough information to help you debug? > > Thanks for your work on improving and extending Maxima's numerical > capabilities! > > -s > On Oct 18, 2011 7:54 AM, "Panagiotis Papasotiriou" > wrote: > >> Could you please replace rkf45_translated.mac with that one: >> >> >> https://sites.google.com/site/pjpapasot/maxima/temporary/rkf45_translated.mac?attredirects=0&d=1 >> >> and run Test.mac again? In that version of rkf45_translated, most local >> variables are declared as "float" instead of "any" (which is correct.) >> However, in my system that gives the following error when I run Test.mac: >> >> Maxima encountered a Lisp error: >> Error in * [or a callee]: ((MLIST SIMP) 1.9999800000000002E-7) is not of >> type NUMBER. >> >> The error is actually generated at line 113 of the code, which reads: >> >> k2:h*odes(xi+0.25*h,yi+0.25*k1), >> >> here, k1, computed at line 112, is 1.9999800000000002E-7 and, for some >> reason, that value is not accepted as a number, hence the error. I am >> curious to know if you get the same error. >> >> 2011/10/18 Michel Talon >> >>> Panagiotis Papasotiriou wrote: >>> > Everything is installed from Debian repositories. Maxima version >>> installed >>> > is 5.24, as this is the "official" latest release yet. SBCL is also >>> > installed from the original Debian package, and it it version 1.0.51. >>> > >>> >>> Sure, but i am not so confident that everything in Debian repositories >>> work >>> OK. For example i have seen severely broken mplayer coming from "quasi >>> official" repositories, and i had to recompile it myself. In the present >>> cases >>> i have doubts about sbcl, since you have already seen two problems. Maybe >>> this >>> 64 bits sbcl doesn't work OK, i don't know. >>> >>> >>> >>> -- >>> Michel Talon >>> >>> _______________________________________________ >>> 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 Tue Oct 18 08:35:53 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 18 Oct 2011 09:35:53 -0400 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: I don't think you can declare something to be a "list of floats". But you can handle each element with a float variable, e.g. f(l,k):= block([s], mode_declare([s],float,[k],integer), for li in l do (mode_declare([li],float), s:s+li^k), s); Do you see how you'd do that in your case? -s On Tue, Oct 18, 2011 at 08:21, Panagiotis Papasotiriou < p.j.papasot at gmail.com> wrote: > Stavro, > > k1 is actually a list of one (float) element in this particular example (in > the general case, when solving a system of differential equations, k1 would > have more than one elements.) So the question is, how can I mode_declare a > list of floats so that it will work as expected when the code is translated? > > thank you for helping > > 2011/10/18 Stavros Macrakis > >> The error message is showing that k1 is a list containing one number, not >> a number. Is that enough information to help you debug? >> >> Thanks for your work on improving and extending Maxima's numerical >> capabilities! >> >> -s >> On Oct 18, 2011 7:54 AM, "Panagiotis Papasotiriou" >> wrote: >> >>> Could you please replace rkf45_translated.mac with that one: >>> >>> >>> https://sites.google.com/site/pjpapasot/maxima/temporary/rkf45_translated.mac?attredirects=0&d=1 >>> >>> and run Test.mac again? In that version of rkf45_translated, most local >>> variables are declared as "float" instead of "any" (which is correct.) >>> However, in my system that gives the following error when I run Test.mac: >>> >>> Maxima encountered a Lisp error: >>> Error in * [or a callee]: ((MLIST SIMP) 1.9999800000000002E-7) is not of >>> type NUMBER. >>> >>> The error is actually generated at line 113 of the code, which reads: >>> >>> k2:h*odes(xi+0.25*h,yi+0.25*k1), >>> >>> here, k1, computed at line 112, is 1.9999800000000002E-7 and, for some >>> reason, that value is not accepted as a number, hence the error. I am >>> curious to know if you get the same error. >>> >>> 2011/10/18 Michel Talon >>> >>>> Panagiotis Papasotiriou wrote: >>>> > Everything is installed from Debian repositories. Maxima version >>>> installed >>>> > is 5.24, as this is the "official" latest release yet. SBCL is also >>>> > installed from the original Debian package, and it it version 1.0.51. >>>> > >>>> >>>> Sure, but i am not so confident that everything in Debian repositories >>>> work >>>> OK. For example i have seen severely broken mplayer coming from "quasi >>>> official" repositories, and i had to recompile it myself. In the present >>>> cases >>>> i have doubts about sbcl, since you have already seen two problems. >>>> Maybe this >>>> 64 bits sbcl doesn't work OK, i don't know. >>>> >>>> >>>> >>>> -- >>>> Michel Talon >>>> >>>> _______________________________________________ >>>> 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 macrakis at alum.mit.edu Tue Oct 18 08:40:20 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 18 Oct 2011 09:40:20 -0400 Subject: [Maxima] limit / Continued fraction In-Reply-To: References: Message-ID: You can set up the equations for a continued fraction quite easily: eqs: [ a = cfdisrep([0,3,2,1000,xx]), xx = cfdisrep([1,xx]) ] /* the repeating part */ $ solve(eqs,[a,xx]); On Sun, Oct 16, 2011 at 16:25, Adam Majewski wrote: > Hi, > > I would like to find limit of Continued fraction [3,2,1000,1...] > http://www.warwick.ac.uk/~masiay/Research/Siegel.html > > In maxima I can compute n-term finite fraction : > a: > > [0,3,2,1000,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] > (%o1) > > [0,3,2,1000,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] > (%i2) t:cfdisrep(a) > (%o2) (1)/(3+(1)/(2+(1)/(1000+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 > +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 > +(1)/(1+(1)/(1+(1)/(1+(1)/(1+ (1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 > +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 > +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 > +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 > +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 > +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 > +1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/ > (1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 > +1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/ > (1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 > +1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 > > +1/1))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) > (%i3) float(t) > > Can I find it's limit ? > > TIA > > Adam > > _______________________________________________ > 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 virgilinux at yahoo.com Tue Oct 18 09:09:58 2011 From: virgilinux at yahoo.com (Virgil L) Date: Tue, 18 Oct 2011 07:09:58 -0700 (PDT) Subject: [Maxima] only 2 line types? (Re: Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima) In-Reply-To: <4E77B59A.4000802@telefonica.net> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> <4E74B6D5.7090809@telefonica.net> <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> <4E76290C.3050807@telefonica.net> <1316441395.46505.YahooMailNeo@web125311.mail.ne1.yahoo.com> <4E77B59A.4000802@telefonica.net> Message-ID: <1318946998.17238.YahooMailNeo@web125319.mail.ne1.yahoo.com> Hi, All: It seems that draw2d only supports 2 line types: ? line_type; ? `line_type' indicates how lines are displayed; possible values are `solid' and `dots'. However it appears that gnuplot (which is the underlying plotting engine) supports at least 4 (maybe more): solid, dashed, dotted, and dot-dashed lines (see http://t16web.lanl.gov/Kawano/gnuplot/misc4-e.html for example). Those 4 types seem to be supported by common plotting tools. Assuming that the documentation is right about this, is there a workaround to get draw2d to provide dashed, dot-dashed and any other line type supported by gnuplot? To the untrained eye it would seem that passing on to gnuplot any supported line type would not be more challenging than doing so for the two which are currently being supported. BTW, in case you are wondering why not just use colors... the problem with colors is that certain publications have color restrictions or impose substantial fees for this service, and anyhow, one cannot be certain that all end-readers will have color at his/her disposal (may be reading a b/w photocopy or b/w printout). So, in a complex plot in which separating lines is critical it is preferable to use both color and line types. For this purpose, only two line types may be insufficient. Best, Virgil ----- Original Message ----- > From: Mario Rodriguez > To: maxima at math.utexas.edu > Cc: > Sent: Monday, September 19, 2011 11:35 PM > Subject: Re: [Maxima] Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima > > On 09/19/2011 10:09 AM, Virgil L wrote: >> As for the wrapper functions to simplify data entry, thanks for your tips. > I may give them a try. Still, it would be preferable to have one > "official" wrapper, for the purpose of collaboration. Perhaps at some > point we can start a little project of creating a wrapper that translates > plot2d-like calls to draw2d calls whenever possible. > > In this case, let me know if you need some help. From p.j.papasot at gmail.com Tue Oct 18 09:32:20 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 18 Oct 2011 17:32:20 +0300 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: The problem is that I need to declare local variables as lists of floats. In your example, you define l as a list of floats, but l is a dummy variable, not a local variable. Nevertheless, I tried to do something similar in my code. To make things simple, declarations look like in the following simple example: f(y):=block([z],mode_declare(z,list),for el in z do mode_declare(el,float),z:y); translate(f); f([1,2,3]); Here, z is a local variable, and I define each element of z as a float. However, I still need to declare z itself as a list, otherwise I get errors. And I am actually not sure if declaring each element of z has any effect in translation, after declaring z itself. here is why: I modified the code in rkf45_transformed in a similar way (all local variables are declared as lists, then each element is declared as float.) The translated code runs without errors now, but computation time is almost the same as if I declared each local variable as a list, without defining their element as floats. It seems to me that, after declaring a local variable as a list, declaring its elements as floats has no effect. To confirm that, please run Test.mac and tell me if there is any difference in execution time between rkf45 and rkf45_translated. In my system, I get the following output: (%i7) sol_stiff:rkf45(y^2-y^3,y,d,[x,x_start,x_end],max_iterations=40000)$ Evaluation took 30.7200 seconds (30.7300 elapsed) (%i10) sol_stiff:rkf45_translated(odes,y,d,[x,x_start,x_end],max_iterations=40000)$ Evaluation took 30.9600 seconds (31.2300 elapsed) So, non-translated code needs ~30.7 seconds to solve the problem, while translated code needs ~31 seconds. All necessary files to do the test are in: https://sites.google.com/site/pjpapasot/maxima/temporary (these are updated versions of previously uploaded files.) 2011/10/18 Stavros Macrakis > I don't think you can declare something to be a "list of floats". But you > can handle each element with a float variable, e.g. > > f(l,k):= block([s], mode_declare([s],float,[k],integer), for li in l do > (mode_declare([li],float), s:s+li^k), s); > > Do you see how you'd do that in your case? > > -s > > > On Tue, Oct 18, 2011 at 08:21, Panagiotis Papasotiriou < > p.j.papasot at gmail.com> wrote: > >> Stavro, >> >> k1 is actually a list of one (float) element in this particular example >> (in the general case, when solving a system of differential equations, k1 >> would have more than one elements.) So the question is, how can I >> mode_declare a list of floats so that it will work as expected when the code >> is translated? >> >> thank you for helping >> >> 2011/10/18 Stavros Macrakis >> >>> The error message is showing that k1 is a list containing one number, not >>> a number. Is that enough information to help you debug? >>> >>> Thanks for your work on improving and extending Maxima's numerical >>> capabilities! >>> >>> -s >>> On Oct 18, 2011 7:54 AM, "Panagiotis Papasotiriou" < >>> p.j.papasot at gmail.com> wrote: >>> >>>> Could you please replace rkf45_translated.mac with that one: >>>> >>>> >>>> https://sites.google.com/site/pjpapasot/maxima/temporary/rkf45_translated.mac?attredirects=0&d=1 >>>> >>>> and run Test.mac again? In that version of rkf45_translated, most local >>>> variables are declared as "float" instead of "any" (which is correct.) >>>> However, in my system that gives the following error when I run Test.mac: >>>> >>>> Maxima encountered a Lisp error: >>>> Error in * [or a callee]: ((MLIST SIMP) 1.9999800000000002E-7) is not >>>> of type NUMBER. >>>> >>>> The error is actually generated at line 113 of the code, which reads: >>>> >>>> k2:h*odes(xi+0.25*h,yi+0.25*k1), >>>> >>>> here, k1, computed at line 112, is 1.9999800000000002E-7 and, for some >>>> reason, that value is not accepted as a number, hence the error. I am >>>> curious to know if you get the same error. >>>> >>>> 2011/10/18 Michel Talon >>>> >>>>> Panagiotis Papasotiriou wrote: >>>>> > Everything is installed from Debian repositories. Maxima version >>>>> installed >>>>> > is 5.24, as this is the "official" latest release yet. SBCL is also >>>>> > installed from the original Debian package, and it it version 1.0.51. >>>>> > >>>>> >>>>> Sure, but i am not so confident that everything in Debian repositories >>>>> work >>>>> OK. For example i have seen severely broken mplayer coming from "quasi >>>>> official" repositories, and i had to recompile it myself. In the >>>>> present cases >>>>> i have doubts about sbcl, since you have already seen two problems. >>>>> Maybe this >>>>> 64 bits sbcl doesn't work OK, i don't know. >>>>> >>>>> >>>>> >>>>> -- >>>>> Michel Talon >>>>> >>>>> _______________________________________________ >>>>> 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 mhw at netris.org Tue Oct 18 10:34:56 2011 From: mhw at netris.org (Mark H Weaver) Date: Tue, 18 Oct 2011 11:34:56 -0400 Subject: [Maxima] Cannot run Windows version of Maxima without sse2 instructions In-Reply-To: (Stefano Ferri's message of "Sat, 13 Aug 2011 09:44:19 +0200") References: Message-ID: <87r52apb33.fsf@yeeloong.netris.org> Stefano Ferri writes: > Recently on this mailing list there was a post about the impossibility > to run the Windows version of Maxima with a processor that has not the > support for sse2 instructions. FYI, Andrej Vodopivec recently posted a Windows binary for Maxima based on GCL: http://sourceforge.net/projects/maxima/files/Maxima-Windows/5.25.0-Windows/maxima-5.25.0.exe/download Mark From macrakis at alum.mit.edu Tue Oct 18 11:23:45 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 18 Oct 2011 12:23:45 -0400 Subject: [Maxima] limit / Continued fraction In-Reply-To: References: Message-ID: PS To get results without radicals in the denominator, use ratsimp(...), algebraic. On Tue, Oct 18, 2011 at 09:40, Stavros Macrakis wrote: > You can set up the equations for a continued fraction quite easily: > > eqs: [ a = cfdisrep([0,3,2,1000,xx]), > xx = cfdisrep([1,xx]) ] /* the repeating part */ $ > > solve(eqs,[a,xx]); > > > On Sun, Oct 16, 2011 at 16:25, Adam Majewski wrote: > >> Hi, >> >> I would like to find limit of Continued fraction [3,2,1000,1...] >> http://www.warwick.ac.uk/~masiay/Research/Siegel.html >> >> In maxima I can compute n-term finite fraction : >> a: >> >> [0,3,2,1000,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] >> (%o1) >> >> [0,3,2,1000,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] >> (%i2) t:cfdisrep(a) >> (%o2) (1)/(3+(1)/(2+(1)/(1000+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+ (1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 >> +1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/ >> (1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 >> +1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/ >> (1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 >> +1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 >> >> +1/1))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) >> (%i3) float(t) >> >> Can I find it's limit ? >> >> TIA >> >> Adam >> >> _______________________________________________ >> 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 Tue Oct 18 12:43:24 2011 From: dlakelan at street-artists.org (dlakelan) Date: Tue, 18 Oct 2011 10:43:24 -0700 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: <4E9DBABC.5080702@street-artists.org> On 10/18/2011 07:32 AM, Panagiotis Papasotiriou wrote: > The problem is that I need to declare local variables as lists of floats. In > your example, you define l as a list of floats, but l is a dummy variable, > not a local variable. Nevertheless, I tried to do something similar in my > code. To make things simple, declarations look like in the following simple > example: > > f(y):=block([z],mode_declare(z,list),for el in z do > mode_declare(el,float),z:y); > translate(f); > f([1,2,3]); it's not at all clear to me what you're trying to do here, but perhaps we can clear up some confusion for you. in this block of code you first declare a local variable z, then you declare z to be a list, then you run through each element in the list but each time you do nothing with the element (other than declare it which has no effect by itself) but you do set z equal to the input list multiple times... also, your input list is NOT a list of floats, it's a list of integers. mode_declare is a declaration, not a function that has any effect, so for i in foo do mode_declare(i,float) would not be expected to do anything really. I think what you want to do is to take your lists as input, declare a local array of floats of the appropriate size, and copy the floats out of the list into your array, then you can do fast arithmetic on the array in your algorithm. see info on declared arrays here: http://maxima.sourceforge.net/docs/manual/en/maxima_5.html Also, thanks again for working on these numerical algorithms. They will be much appreciated by maxima users such as myself! From p.j.papasot at gmail.com Tue Oct 18 13:15:35 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 18 Oct 2011 21:15:35 +0300 Subject: [Maxima] Translating Maxima functions. In-Reply-To: <4E9DBABC.5080702@street-artists.org> References: <4E9DBABC.5080702@street-artists.org> Message-ID: I'll try what you suggested, copy the input list to a local array. Question is... How do I mode_declare a local variable which is an array of floats? 2011/10/18 dlakelan > On 10/18/2011 07:32 AM, Panagiotis Papasotiriou wrote: > > The problem is that I need to declare local variables as lists of floats. > In > > your example, you define l as a list of floats, but l is a dummy > variable, > > not a local variable. Nevertheless, I tried to do something similar in my > > code. To make things simple, declarations look like in the following > simple > > example: > > > > f(y):=block([z],mode_declare(z,list),for el in z do > > mode_declare(el,float),z:y); > > translate(f); > > f([1,2,3]); > > it's not at all clear to me what you're trying to do here, but perhaps > we can clear up some confusion for you. > > in this block of code you first declare a local variable z, then you > declare z to be a list, then you run through each element in the list > but each time you do nothing with the element (other than declare it > which has no effect by itself) but you do set z equal to the input list > multiple times... > > also, your input list is NOT a list of floats, it's a list of integers. > > mode_declare is a declaration, not a function that has any effect, so > for i in foo do mode_declare(i,float) would not be expected to do > anything really. > > I think what you want to do is to take your lists as input, declare a > local array of floats of the appropriate size, and copy the floats out > of the list into your array, then you can do fast arithmetic on the > array in your algorithm. > > see info on declared arrays here: > > http://maxima.sourceforge.net/docs/manual/en/maxima_5.html > > Also, thanks again for working on these numerical algorithms. They will > be much appreciated by maxima users such as myself! > _______________________________________________ > 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 Oct 18 13:28:13 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 18 Oct 2011 14:28:13 -0400 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: On Tue, Oct 18, 2011 at 10:32, Panagiotis Papasotiriou < p.j.papasot at gmail.com> wrote: > The problem is that I need to declare local variables as lists of floats. > In your example, you define l as a list of floats, but l is a dummy > variable, not a local variable. First of all, "dummy variable" is not a concept in Maxima or Lisp. This may be a Fortran usage, since Fortran has call-by-reference (assigning to a parameter in a subroutine changes the value of the *argument* in the caller). Maxima and Lisp have call-by-object-value, so a function parameter is really just a local variable initialized to the argument value. You can mode_declare both parameters and local variables. Nevertheless, I tried to do something similar in my code. To make things > simple, declarations look like in the following simple example: > f(y):=block([z],mode_declare(z,list),for el in z do > mode_declare(el,float),z:y); > translate(f); > f([1,2,3]); > Hmm. You seem to be trying to treat mode_declare as an executable statement, which it is not. The above 'for/mode_declare' construction has no effect on anything. It simply loops through the elements of z and the body of the loop consists only of a declaration of the variable el, which is local to the loop; there are no executable statements. The trick is to refer to the elements of z ***within*** that loop, as el, which is declared as a float. That is what my code below does. -s 2011/10/18 Stavros Macrakis > >> I don't think you can declare something to be a "list of floats". But you >> can handle each element with a float variable, e.g. >> >> f(l,k):= block([s], mode_declare([s],float,[k],integer), for li in l do >> (mode_declare([li],float), s:s+li^k), s); >> >> Do you see how you'd do that in your case? >> >> -s >> >> >> On Tue, Oct 18, 2011 at 08:21, Panagiotis Papasotiriou < >> p.j.papasot at gmail.com> wrote: >> >>> Stavro, >>> >>> k1 is actually a list of one (float) element in this particular example >>> (in the general case, when solving a system of differential equations, k1 >>> would have more than one elements.) So the question is, how can I >>> mode_declare a list of floats so that it will work as expected when the code >>> is translated? >>> >>> thank you for helping >>> >>> 2011/10/18 Stavros Macrakis >>> >>>> The error message is showing that k1 is a list containing one number, >>>> not a number. Is that enough information to help you debug? >>>> >>>> Thanks for your work on improving and extending Maxima's numerical >>>> capabilities! >>>> >>>> -s >>>> On Oct 18, 2011 7:54 AM, "Panagiotis Papasotiriou" < >>>> p.j.papasot at gmail.com> wrote: >>>> >>>>> Could you please replace rkf45_translated.mac with that one: >>>>> >>>>> >>>>> https://sites.google.com/site/pjpapasot/maxima/temporary/rkf45_translated.mac?attredirects=0&d=1 >>>>> >>>>> and run Test.mac again? In that version of rkf45_translated, most local >>>>> variables are declared as "float" instead of "any" (which is correct.) >>>>> However, in my system that gives the following error when I run Test.mac: >>>>> >>>>> Maxima encountered a Lisp error: >>>>> Error in * [or a callee]: ((MLIST SIMP) 1.9999800000000002E-7) is not >>>>> of type NUMBER. >>>>> >>>>> The error is actually generated at line 113 of the code, which reads: >>>>> >>>>> k2:h*odes(xi+0.25*h,yi+0.25*k1), >>>>> >>>>> here, k1, computed at line 112, is 1.9999800000000002E-7 and, for some >>>>> reason, that value is not accepted as a number, hence the error. I am >>>>> curious to know if you get the same error. >>>>> >>>>> 2011/10/18 Michel Talon >>>>> >>>>>> Panagiotis Papasotiriou wrote: >>>>>> > Everything is installed from Debian repositories. Maxima version >>>>>> installed >>>>>> > is 5.24, as this is the "official" latest release yet. SBCL is also >>>>>> > installed from the original Debian package, and it it version >>>>>> 1.0.51. >>>>>> > >>>>>> >>>>>> Sure, but i am not so confident that everything in Debian repositories >>>>>> work >>>>>> OK. For example i have seen severely broken mplayer coming from "quasi >>>>>> official" repositories, and i had to recompile it myself. In the >>>>>> present cases >>>>>> i have doubts about sbcl, since you have already seen two problems. >>>>>> Maybe this >>>>>> 64 bits sbcl doesn't work OK, i don't know. >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Michel Talon >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>> >>> >> > > _______________________________________________ > 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 dbindner at truman.edu Tue Oct 18 14:15:45 2011 From: dbindner at truman.edu (Donald Bindner) Date: Tue, 18 Oct 2011 14:15:45 -0500 Subject: [Maxima] Integration error in Maxima 5.22.1 Message-ID: This was correct in older versions of Maxima: Maxima 5.20.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (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) integrate( cos(x)*cos(2*x), x, 0, %pi ); (%o1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?0 It is broken in 5.22.1: Maxima 5.22.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (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) integrate( cos(x)*cos(2*x), x, 0, %pi ); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?4 (%o1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?3 Cheers, Don From macrakis at alum.mit.edu Tue Oct 18 14:29:37 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 18 Oct 2011 15:29:37 -0400 Subject: [Maxima] Integration error in Maxima 5.22.1 In-Reply-To: References: Message-ID: This appears to be correct in Maxima 5.25.1 (GCL 2.6.8, Windows Vista). On Tue, Oct 18, 2011 at 15:15, Donald Bindner wrote: > cos(x)*cos(2*x), -------------- next part -------------- An HTML attachment was scrubbed... URL: From william.wood3 at comcast.net Tue Oct 18 14:59:59 2011 From: william.wood3 at comcast.net (Bill Wood) Date: Tue, 18 Oct 2011 14:59:59 -0500 Subject: [Maxima] limit / Continued fraction In-Reply-To: References: Message-ID: <1318967999.5800.78.camel@ubuntu> On Tue, 2011-10-18 at 12:23 -0400, Stavros Macrakis wrote: > PS To get results without radicals in the denominator, use > ratsimp(...), algebraic. It took a while but I see now. Thanks, -- Bill Wood From dlakelan at street-artists.org Tue Oct 18 15:23:00 2011 From: dlakelan at street-artists.org (dlakelan) Date: Tue, 18 Oct 2011 13:23:00 -0700 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: <4E9DBABC.5080702@street-artists.org> Message-ID: <4E9DE024.405@street-artists.org> On 10/18/2011 11:15 AM, Panagiotis Papasotiriou wrote: > I'll try what you suggested, copy the input list to a local array. Question > is... How do I mode_declare a local variable which is an array of floats? the link I gave has the manual pages for the "functions and variables for arrays" here's the direct link to the section http://maxima.sourceforge.net/docs/manual/en/maxima_5.html#SEC25 it turns out since your array is internal to your algorithm, you are better off with an "unnamed" array using "make_array" function as an example f(x) := block([temp:make_array(flonum,length(x))], /* creates a local unnamed array of floating point numbers and stores it in the local variable temp*/ for i:1 thru length(x) do ( temp[i]: float(x[1]), x:rest(x)), /* fills the array with numbers and eats the list x */ temp); /* returns temp */ Hope this helps give you an idea of how to use arrays. Dan From talon at lpthe.jussieu.fr Tue Oct 18 19:24:21 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 19 Oct 2011 00:24:21 +0000 (UTC) Subject: [Maxima] Translating Maxima functions. References: Message-ID: Panagiotis Papasotiriou wrote: > Could you please replace rkf45_translated.mac with that one: > > https://sites.google.com/site/pjpapasot/maxima/temporary/rkf45_translated.ma c?attredirects=0&d=1 > > and run Test.mac again? In that version of rkf45_translated, most local > variables are declared as "float" instead of "any" (which is correct.) > However, in my system that gives the following error when I run Test.mac: > > Maxima encountered a Lisp error: > Error in * [or a callee]: ((MLIST SIMP) 1.9999800000000002E-7) is not of > type NUMBER. > I don't have this error, but i have an error coming from x_start=0 instead of 0.0. Note that lisp is *very* strict about variable declarations. Having changed that, the test runs to completion, and gives: (%i3) x_start : 0.0 (%i4) d : 1.e-5 2 (%i5) x_end : - d (%i6) showtime : true Evaluation took 0.0000 seconds (0.0000 elapsed) using 0 bytes. 2 3 (%i7) sol_stiff : rkf45(y - y , y, d, [x, x_start, x_end], max_iterations = 40000) Evaluation took 17.9030 seconds (18.0450 elapsed) using 4426.274 MB. 2 3 (%i8) odes(x, y) := y - y Evaluation took 0.0000 seconds (0.0000 elapsed) using 0 bytes. (%i9) translate(odes) Evaluation took 0.0070 seconds (0.0070 elapsed) using 262.461 KB. (%i10) sol_stiff : rkf45_translated(odes, y, d, [x, x_start, x_end], max_iterations = 40000) Evaluation took 15.5040 seconds (15.6190 elapsed) using 4600.577 MB. The compilation gives a number of warnings which are interesting and show that many variables remain of type "any" which means that no real compilation is done. (%i2) load(rkf45_translated.mac) warning: variable atol (declared type float) assigned type any. warning: variable save_steps (declared type boolean) assigned type any. warning: variable maxit (declared type fixnum) assigned type any. warning: variable show_report (declared type boolean) assigned type any. warning: variable h (declared type float) assigned type any. warning: variable xi (declared type float) assigned type any. warning: encountered undefined variable numberp in translation. warning: odes is a bound variable in odes(xi,yi), but it is used as a function. note: instead I'll translate it as: apply(odes,[xi,yi]) warning: odes is a bound variable in odes(xi,yi), but it is used as a function. note: instead I'll translate it as: apply(odes,[xi,yi]) warning: odes is a bound variable in odes(0.25*h+xi,0.25*k1+yi), but it is used as a function. note: instead I'll translate it as: apply(odes,[0.25*h+xi,0.25*k1+yi]) warning: odes is a bound variable in odes(0.375*h+xi,0.28125*k2+0.09375*k1+yi), but it is used as a function. note: instead I'll translate it as: apply(odes,[0.375*h+xi,0.28125*k2+0.09375*k1+yi]) warning: odes is a bound variable in odes(.9230769230769231*h+xi,3.32089212562 5854*k3-3.277196176604461*k2+.8793809740555303*k1+yi), but it is used as a function. note: instead I'll translate it as: apply(odes,[.9230769230769231*h+xi,3.32089 2125625854*k3-3.277196176604461*k2+.8793809740555303*k1+yi]) warning: odes is a bound variable in odes(h+xi,-.2058966861598441*k4+7.1734892 78752437*k3-8*k2+2.032407407407407*k1+yi), but it is used as a function. note: instead I'll translate it as: apply(odes,[h+xi,-.2058966861598441*k4+7.1 73489278752437*k3-8*k2+2.032407407407407*k1+yi]) warning: odes is a bound variable in odes(0.5*h+xi,-0.275*k5+.4529727095516569 *k4-1.381676413255361*k3+2*k2-.2962962962962963*k1+yi), but it is used as a function. note: instead I'll translate it as: apply(odes,[0.5*h+xi,-0.275*k5+.4529727095 516569*k4-1.381676413255361*k3+2*k2-.2962962962962963*k1+yi]) warning: variable trunc_error (declared type float) assigned type any. warning: variable h_optimal (declared type float) assigned type any. warning: variable x_tiny (declared type float) assigned type any. -- Michel Talon From macrakis at alum.mit.edu Tue Oct 18 21:34:34 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 18 Oct 2011 22:34:34 -0400 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: On Tue, Oct 18, 2011 at 20:24, Michel Talon wrote: > ,,,The compilation gives a number of warnings which are interesting and > show that > many variables remain of type "any" which means that no real compilation is > done.... > warning: variable atol (declared type float) assigned type any. > warning: variable save_steps (declared type boolean) assigned type any. ... These warnings aren't too dire. They mean that you are doing an assignment like x:y, where x is declared to be a float, and y is of unknown type (any). In effect, you are asserting that you promise that y is *actually* a float when you do this. Of course, if your code is doing this everywhere, you aren't benefiting from compilation, as Michel says. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxima at etherjones.us Tue Oct 18 21:41:24 2011 From: maxima at etherjones.us (Ether Jones) Date: Tue, 18 Oct 2011 19:41:24 -0700 (PDT) Subject: [Maxima] subscripted greek letters Message-ID: <1318992084.91627.YahooMailNeo@web161805.mail.bf1.yahoo.com> Please see attached screenshot. Why doesn't the subscripted Greek letter rho[b] display properly?? Is this a bug, or am I doing it wrong? Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: greek.png Type: image/png Size: 1632 bytes Desc: not available URL: From p.j.papasot at gmail.com Wed Oct 19 03:21:21 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Wed, 19 Oct 2011 11:21:21 +0300 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: It is strange how Stavros gets translation messages completely different than what I get. Anyway, both solutions suggested (the trick with mode declarations in lists, and the use of arrays instead of lists) seem to work. I had quite some progress by converting everything in array forms as well. However, I realized that I will need to replace all list operations with loops, which is something I honestly don't want to do. It reminds me implementing numerical methods in languages not appropriate for Mathematics, like C/C++, where the lack of decent matrix algebra support forces the user to use loops and nested loops for the simplest thing on Earth. Being a Fortran 90+ programmer for several years, I refuse to come back to a programming style which reminds me "archaic" Fortran 77 or C/C++. Note that all that trouble could be avoided if Maxima translator had a way to define lists of floats. Moreover, if translator allowed dynamic declarations of functions within the block being translated, I could have the same functionality and convenience as in the non-translated code. So, I decided to put my priorities in order: I'll return to "pure" Maxima programming, at least for now, implementing numerical methods that I think they need to be added in Maxima. The code will run in non-translated form for now, but well many packages already existing in maxima/share directory are actually implemented that way. Besides, it is not that slow. Execution time for rkf45, for example, needs less than one second for simple problems and really complex problems (such as the Pleiades problem, which is a system of 28 differential equations) won't need more than a few seconds to be solved. The testing example Test.mac I posted before needs much more time to be solved (30 seconds in my system,) but it is actually a well-known very stiff problem, and rkf45 is an explicit method, not designed for such kind of problems, although it can solve them. I will leave translation for later (maybe someone is planning to improve the translator?) For now, I return to my .mac packages. Expect a "final" version of rkf45 soon. By the way, I also managed to implement a simple numerical method in pure Lisp, but I will leave that for later as well. Lisp programming seems very exotic to me, and makes me think "why should I do that, while I could do it much easier in Fortran 90?". It is still a plan for the future though. Another possibility is to translate Fortran 90 code using f2cl, but I'm not sure f2cl can handle complex Fortran 90 structures such as modules, data hiding via public/private declarations, function interfacing etc. 2011/10/19 Stavros Macrakis > On Tue, Oct 18, 2011 at 20:24, Michel Talon wrote: > >> ,,,The compilation gives a number of warnings which are interesting and >> show that >> many variables remain of type "any" which means that no real compilation >> is >> done.... >> >> warning: variable atol (declared type float) assigned type any. >> warning: variable save_steps (declared type boolean) assigned type any. >> > ... > > These warnings aren't too dire. They mean that you are doing an assignment > like x:y, where x is declared to be a float, and y is of unknown type (any). > In effect, you are asserting that you promise that y is *actually* a float > when you do this. Of course, if your code is doing this everywhere, you > aren't benefiting from compilation, as Michel says. > > -s > > _______________________________________________ > 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 Oct 19 11:21:23 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 19 Oct 2011 09:21:23 -0700 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: On Wed, Oct 19, 2011 at 1:21 AM, Panagiotis Papasotiriou < p.j.papasot at gmail.com> wrote: > > By the way, I also managed to implement a simple numerical method in pure > Lisp, but I will leave that for later as well. Lisp programming seems very > exotic to me, and makes me think "why should I do that, while I could do it > much easier in Fortran 90?". It is still a plan for the future though. > Another possibility is to translate Fortran 90 code using f2cl, but I'm not > sure f2cl can handle complex Fortran 90 structures such as modules, data > hiding via public/private declarations, function interfacing etc. > Sorry, f2cl cannot handle Fortran 90. Some simple Fortran extensions are handled, but nothing close to Fortran 90. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlakelan at street-artists.org Wed Oct 19 12:04:44 2011 From: dlakelan at street-artists.org (dlakelan) Date: Wed, 19 Oct 2011 10:04:44 -0700 Subject: [Maxima] Translating Maxima functions. In-Reply-To: References: Message-ID: <4E9F032C.2070808@street-artists.org> On 10/19/2011 01:21 AM, Panagiotis Papasotiriou wrote: > Anyway, both solutions suggested (the trick with mode declarations in lists, > and the use of arrays instead of lists) seem to work. I had quite some > progress by converting everything in array forms as well. However, I > realized that I will need to replace all list operations with loops, which > is something I honestly don't want to do. It reminds me implementing > numerical methods in languages not appropriate for Mathematics, like C/C++, > where the lack of decent matrix algebra support forces the user to use loops > and nested loops for the simplest thing on Earth. Yes, I understand your frustration here. It would be nice to be able to simply say a+b with a and b both arrays and get back a new array perhaps. One problem would be that lisp in general does not focus on in-place modification of data structures. So if such a thing existed, doing a+b would normally allocate a new array c that contained the results of a and b just as it does with lists. It is trivially easy to write a function "a+" which would do this "a+"(a,b) := block([c:make_array(...)],...) but this is not ideal either. Simply having an adaptive stepsize improves speed significantly. I have used the rk4 code to do some solutions of simple equations that required tiny stepsizes and run times in the tens of minutes. It is written in lisp I believe, and therefore compiled to machine code, so it is actually doing a LOT of calculations. As you mentioned earlier, the small step size is only needed usually for a small portion of the domain so you have already doing a great service by creating an adaptive stepsize algorithm. Please don't get discouraged because it is not easily translated to ultra-fast code. From dlakelan at street-artists.org Wed Oct 19 12:12:30 2011 From: dlakelan at street-artists.org (dlakelan) Date: Wed, 19 Oct 2011 10:12:30 -0700 Subject: [Maxima] Translating Maxima functions. In-Reply-To: <4E9F032C.2070808@street-artists.org> References: <4E9F032C.2070808@street-artists.org> Message-ID: <4E9F04FE.3090303@street-artists.org> On 10/19/2011 10:04 AM, dlakelan wrote: > "a+"(a,b) := block([c:make_array(...)],...) > > but this is not ideal either. in particular if you want infix syntax you will need to fiddle around with Maxima's operator definition methods, and there is no modules/hiding that I know of, so when someone loads your code it will redefine operators for all other purposes as well. However perhaps a ".+" operator similar to matlab's elementwise operators would make your life easier. From jukarimov at gmail.com Wed Oct 19 12:13:30 2011 From: jukarimov at gmail.com (Jalil Karimov) Date: Wed, 19 Oct 2011 21:13:30 +0400 Subject: [Maxima] Simplify trigonometric expression Message-ID: Hi, I was wondering what is a complexity limits of the trigonometric identities which maxima can simplify. I tried first, the following: trigsimp ( (sin(a)^6 + cos(a)^6 + 3*sin(a)^2 * cos(a)^2) ); We get 1 here. Now that: trigsimp ( (sin(2*a) + sin(5*a) - sin(3*a)) / (cos(a) + 1 - 2*sin(2*a)^2) ); We just get extracted minus: -(sin(5*a)-sin(3*a)+sin(2*a))/(2*sin(2*a)^2-cos(a)-1) Only after bringing it to: trigsimp ( (2*sin(a) * cos(a) + 2*cos(4*a) * sin(a)) / (cos(a) + cos(4*a)) ); by hand, it gives 2sin(a) Is that correct, or any tricks can applied to unleash max of maxima Regards. --jukarimov From macrakis at alum.mit.edu Wed Oct 19 12:37:52 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 19 Oct 2011 13:37:52 -0400 Subject: [Maxima] Simplify trigonometric expression In-Reply-To: References: Message-ID: There is a variety of functions that can change the form of trigonometric expressions. You could try to understand in detail the strengths and weaknesses of each function, or you can do what I do, which is to try various approaches until one gets you the form you're looking for: (%i8) e1: (sin(2*a) + sin(5*a) - sin(3*a)) / (cos(a) + 1 - 2*sin(2*a)^2); (%o8) (sin(5*a)-sin(3*a)+sin(2*a))/(-2*sin(2*a)^2+cos(a)+1) (%i9) factor(trigexpand(e1)); (%o9) -sin(a)*(sin(a)^4-10*cos(a)^2*sin(a)^2+sin(a)^2+5*cos(a)^4-3*cos(a)^2+2*cos(a))/(8*cos(a)^2*sin(a)^2-cos(a)-1) (%i10) factor(trigsimp(e1)); (%o10) -(sin(5*a)-sin(3*a)+sin(2*a))/(2*sin(2*a)^2-cos(a)-1) (%i11) factor(trigreduce(e1)); (%o11) (sin(5*a)-sin(3*a)+sin(2*a))/(cos(4*a)+cos(a)) (%i12) factor(trigrat(e1)); (%o12) 2*sin(a) Your first example: (%i14) e2: (sin(a)^6 + cos(a)^6 + 3*sin(a)^2 * cos(a)^2); (%o14) sin(a)^6+3*cos(a)^2*sin(a)^2+cos(a)^6 (%i15) trigexpand(e2); (%o15) sin(a)^6+3*cos(a)^2*sin(a)^2+cos(a)^6 (%i16) factorsum(trigexpand(e2)); (%o16) sin(a)^6+3*cos(a)^2*sin(a)^2+cos(a)^6 (%i17) factorsum(trigreduce(e2)); (%o17) 1 (%i18) factorsum(trigsimp(e2)); (%o18) 1 (%i19) factorsum(trigrat(e2)); (%o19) 1 When you suspect the expression may simplify to a constant, you might even try 'taylor': (%i20) taylor(e2,a,0,20); (%o20) +1 Another approach is exponentialization. You'd do something like rectform(radcan(exponentialize( ... ))) or rectform(factor(exponentialize( ... ))). This in fact gets e2 => 1, but doesn't help much with e1. Does this resolve your issue? -s On Wed, Oct 19, 2011 at 13:13, Jalil Karimov wrote: > (sin(2*a) + sin(5*a) - sin(3*a)) / (cos(a) + 1 - 2*sin(2*a)^2) -------------- next part -------------- An HTML attachment was scrubbed... URL: From secretagent007 at web.de Wed Oct 19 15:02:59 2011 From: secretagent007 at web.de (anonymous) Date: Wed, 19 Oct 2011 22:02:59 +0200 Subject: [Maxima] define integer to simplify trigonometric functions Message-ID: <4E9F2CF3.7090001@web.de> Dear Sir or Madam, is it possible to tell Maxima that the variable n is an integer, so that Maxima will automatically simplify expressions like sin( n*%pi ) = 0, cos (n*%pi ) = (-1)^n ? Best regards, Sebastian From woollett at charter.net Wed Oct 19 15:31:37 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 19 Oct 2011 13:31:37 -0700 Subject: [Maxima] float of struve_h functions? Message-ID: I am using integrate to evaluate one the the Mathematica list of NIntegrate examples: integrate(bessel_y(2,x),x,1,10^4); which produces -2*bessel_y(2,10000)+(4*bessel_y(2,1)-%pi*struve_h(0,1)*bessel_y(1,1) -%pi*struve_h(-1,1)*bessel_y(0,1)) /2+5000*%pi*struve_h(0,10000)*bessel_y(1,10000) +5000*%pi*struve_h(-1,10000)*bessel_y(0,10000) The floats of the bessel functions are no problem, but the struve_h float chokes: (%i66) float(struve_h(0,10)); (%o66) 0.11874368368746 (%i67) float(struve_h(0,100)); (%o67) -0.070878751689647 (%i68) float(struve_h(0,1000)); Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec. (%o68) 636.6197723675813*hypergeometric([1.0],[1.5,1.5],-250000.0) How can I get a numerical value for the output of integrate for this case? Ted Woollett From mhw at netris.org Wed Oct 19 16:21:28 2011 From: mhw at netris.org (Mark H Weaver) Date: Wed, 19 Oct 2011 17:21:28 -0400 Subject: [Maxima] define integer to simplify trigonometric functions In-Reply-To: <4E9F2CF3.7090001@web.de> (anonymous's message of "Wed, 19 Oct 2011 22:02:59 +0200") References: <4E9F2CF3.7090001@web.de> Message-ID: <874nz4llt3.fsf@yeeloong.netris.org> anonymous writes: > is it possible to tell Maxima that the variable n is an integer, so > that Maxima will automatically simplify expressions like > sin( n*%pi ) = 0, > cos (n*%pi ) = (-1)^n ? Yes, you want to declare(n,integer): (%i2) declare(n, integer); (%o2) done (%i3) sin(n*%pi); (%o3) 0 (%i4) cos(n*%pi); (%o4) (-1)^n Mark From macrakis at alum.mit.edu Wed Oct 19 16:40:39 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 19 Oct 2011 17:40:39 -0400 Subject: [Maxima] define integer to simplify trigonometric functions In-Reply-To: <874nz4llt3.fsf@yeeloong.netris.org> References: <4E9F2CF3.7090001@web.de> <874nz4llt3.fsf@yeeloong.netris.org> Message-ID: By the way, Maxima isn't as clever as it should be in some cases: declare(n,integer)$ tan(x+3*%pi) => tan(x) but tan(x+n*%pi) => tan(x+n*%pi) To get Maxima to simplify that, you need to use trigexpand: trigexpand(tan(x+n*%pi)) => tan(x) I hope we'll fix cases like this in later versions. Enjoy using Maxima! -s On Wed, Oct 19, 2011 at 17:21, Mark H Weaver wrote: > anonymous writes: > > is it possible to tell Maxima that the variable n is an integer, so > > that Maxima will automatically simplify expressions like > > sin( n*%pi ) = 0, > > cos (n*%pi ) = (-1)^n ? > > Yes, you want to declare(n,integer): > > (%i2) declare(n, integer); > (%o2) done > (%i3) sin(n*%pi); > (%o3) 0 > (%i4) cos(n*%pi); > (%o4) (-1)^n > > Mark > _______________________________________________ > 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 mhw at netris.org Wed Oct 19 17:19:50 2011 From: mhw at netris.org (Mark H Weaver) Date: Wed, 19 Oct 2011 18:19:50 -0400 Subject: [Maxima] subscripted greek letters In-Reply-To: <1318992084.91627.YahooMailNeo@web161805.mail.bf1.yahoo.com> (Ether Jones's message of "Tue, 18 Oct 2011 19:41:24 -0700 (PDT)") References: <1318992084.91627.YahooMailNeo@web161805.mail.bf1.yahoo.com> Message-ID: <87zkgwk4jd.fsf@yeeloong.netris.org> > Why doesn't the subscripted Greek letter rho[b] display properly?? Is > this a bug, or am I doing it wrong? I suspect this is a bug in wxMaxima, which seems to expect different Lisp symbols than the Maxima parser actually produces in cases like this. "rho[b]", "rho(b)", "rho" and "'rho" all use the lisp symbol $RHO, but "'rho[b]" and "'rho(b)" use the nounified lisp symbol %RHO. However, wxMaxima seems to expect the noun form to be $%RHO. Most other Greek symbols have the same problem. For now, you can work around this by typing the following commands (the second one is only needed if you would like to render 'rho[b] to TeX): :lisp (defprop %rho "%rho" wxxmlword) :lisp (defprop %rho "\\rho" texword) I have attached a suggested patch to wxmathml.lisp (part of wxMaxima) to fix this problem for the other Greek letters as well. On the other hand, mactex.lisp (part of Maxima) makes no attempt to render Greek symbols in noun form. Do we want to add properties like the second line above? I'm not sure. Best, Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: wxmaxima-greek-fix.patch Type: text/x-diff Size: 6423 bytes Desc: Patch to wxMaxima to fix rendering of Greek symbols in noun form URL: From mhw at netris.org Wed Oct 19 18:07:09 2011 From: mhw at netris.org (Mark H Weaver) Date: Wed, 19 Oct 2011 19:07:09 -0400 Subject: [Maxima] only 2 line types? (Re: Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima) In-Reply-To: <1318946998.17238.YahooMailNeo@web125319.mail.ne1.yahoo.com> (Virgil L.'s message of "Tue, 18 Oct 2011 07:09:58 -0700 (PDT)") References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> <4E74B6D5.7090809@telefonica.net> <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> <4E76290C.3050807@telefonica.net> <1316441395.46505.YahooMailNeo@web125311.mail.ne1.yahoo.com> <4E77B59A.4000802@telefonica.net> <1318946998.17238.YahooMailNeo@web125319.mail.ne1.yahoo.com> Message-ID: <87vcrkk2ci.fsf@yeeloong.netris.org> Virgil L writes: > It seems that draw2d only supports 2 line types: > > ? line_type; > ? `line_type' indicates how lines are displayed; possible values are `solid' and `dots'. > > However it appears that gnuplot (which is the underlying plotting > engine) supports at least 4 (maybe more): solid, dashed, dotted, and > dot-dashed lines (see > http://t16web.lanl.gov/Kawano/gnuplot/misc4-e.html for example). Those > 4 types seem to be supported by common plotting tools. > > Assuming that the documentation is right about this, is there a > workaround to get draw2d to provide dashed, dot-dashed and any other > line type supported by gnuplot? Mario is the best person to answer this question, but for now I will share an observation: The draw package actually accepts two other undocumented line types: "dashes" and "dot_dash". However, these only work with the "eps" and "eps_color" terminals as far as I can tell. Also (on my system at least) "dot_dash" does not render as I'd expect, but rather as a plain dashed pattern, except with shorter dashes than "dashes". Best, Mark From dbmaxima at gmail.com Thu Oct 20 01:27:00 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Thu, 20 Oct 2011 17:27:00 +1100 Subject: [Maxima] float of struve_h functions? In-Reply-To: References: Message-ID: <4E9FBF34.4010708@gmail.com> On 20/10/2011 7:31 AM, Edwin Woollett wrote: > I am using integrate to evaluate one the the > Mathematica list of NIntegrate examples: > > integrate(bessel_y(2,x),x,1,10^4); > > which produces > > -2*bessel_y(2,10000)+(4*bessel_y(2,1)-%pi*struve_h(0,1)*bessel_y(1,1) > > -%pi*struve_h(-1,1)*bessel_y(0,1)) > > /2+5000*%pi*struve_h(0,10000)*bessel_y(1,10000) > +5000*%pi*struve_h(-1,10000)*bessel_y(0,10000) > > The floats of the bessel functions are no problem, but > the struve_h float chokes: Not implemented. Maxima doesn't know much about Struve functions (because I don't, and I added the integrals of Bessel functions). From biomates at telefonica.net Thu Oct 20 02:25:47 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 20 Oct 2011 03:25:47 -0400 Subject: [Maxima] only 2 line types? (Re: Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima) In-Reply-To: <87vcrkk2ci.fsf@yeeloong.netris.org> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> <4E74B6D5.7090809@telefonica.net> <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> <4E76290C.3050807@telefonica.net> <1316441395.46505.YahooMailNeo@web125311.mail.ne1.yahoo.com> <4E77B59A.4000802@telefonica.net> <1318946998.17238.YahooMailNeo@web125319.mail.ne1.yahoo.com> <87vcrkk2ci.fsf@yeeloong.netris.org> Message-ID: <4E9FCCFB.1070206@telefonica.net> On 10/19/2011 07:07 PM, Mark H Weaver wrote: > The draw package actually accepts two other undocumented line types: > "dashes" and "dot_dash". However, these only work with the "eps" and > "eps_color" terminals as far as I can tell. Also (on my system at > least) "dot_dash" does not render as I'd expect, but rather as a plain > dashed pattern, except with shorter dashes than "dashes". > > Best, > Mark I sent to Virgil the following replay some days ago. It seems I did not clic the "Replay to all" button. I hope it clarifies the situation. ------------------ Hello, > It seems that draw2d only supports 2 line types: That's correct. > > ? line_type; > `line_type' indicates how lines are displayed; possible values are `solid' and `dots'. > > However it appears that gnuplot (which is the underlying plotting engine) Yes, this is the default renderer. > supports at least 4 (maybe more): solid, dashed, dotted, and > dot-dashed lines (see http://t16web.lanl.gov/Kawano/gnuplot/misc4-e.html for example). Those 4 types seem to be supported by common plotting tools. You can read in this same link: /* begin quote */ Some terminal cannot draw a dotted line, and some cannot change the thickness. Then the number of possible combination is limited. The following explanation is to use many kinds of lines in the postscript terminal. /* end quote */ That means that Gnuplot is not consistent in all terminals with respect to line styles. The only types accepted by all draw-supported terminals are 'solid' and 'dots', that's why these are, according to the documentation, the only accepted styles. But off-public I can tell you that you can also use types 'dashes' and 'dot_dash': draw2d( line_type = dots, explicit(x^2, x, -1, 1), line_type = solid, explicit(x^2+1, x, -1, 1), line_type = dashes, explicit(x^2+2, x, -1, 1), line_type = dot_dash, /* there is a known bug here to be fixed */ explicit(x^2+3, x, -1, 1), terminal = eps )$ But it doesn't work with some other terminals. Try for example wxt, png, and others. Although these styles can be used in eps format, the main reason for including them is to be used with the vtk renderer (experimental work), together with a fith type named 'tube', for plotting curves and segments as tubes. Examples here: http://riotorto.users.sourceforge.net/vtk/param > > Assuming that the documentation is right about this, is there a workaround to get draw2d to provide dashed, dot-dashed and any other line type supported by gnuplot? > See above. > BTW, in case you are wondering why not just use colors... the problem with colors is that certain publications have color restrictions or impose substantial fees for this service, and anyhow, one cannot be certain that all end-readers will have color at his/her disposal (may be reading a b/w photocopy or b/w printout). So, in a complex plot in which separating lines is critical it is preferable to use both color and line types. For this purpose, only two line types may be insufficient. > Of course, all these comments make sense to me. > Best, > > Virgil -- Mario From p.j.papasot at gmail.com Thu Oct 20 03:04:15 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Thu, 20 Oct 2011 11:04:15 +0300 Subject: [Maxima] float of struve_h functions? In-Reply-To: References: Message-ID: I didn't know about the Struve functions either. But looking at Maxima's documentation I see that Struve function H and modified Struve function L are mentioned in section 15.7, without any examples (unlike most of the other special functions listed in section 15.). Not sure if that means they are implemented, but if they aren't, it seems easy to compute their value numerically, using their definition in integral form. 2011/10/19 Edwin Woollett > I am using integrate to evaluate one the the > Mathematica list of NIntegrate examples: > > integrate(bessel_y(2,x),x,1,**10^4); > > which produces > > -2*bessel_y(2,10000)+(4***bessel_y(2,1)-%pi*struve_h(0,**1)*bessel_y(1,1) > -%pi*struve_h(-1,1)*bessel_y(** > 0,1)) > /2+5000*%pi*struve_h(0,10000)*** > bessel_y(1,10000) > +5000*%pi*struve_h(-1,10000)***bessel_y(0,10000) > > The floats of the bessel functions are no problem, but > the struve_h float chokes: > > (%i66) float(struve_h(0,10)); > (%o66) 0.11874368368746 > (%i67) float(struve_h(0,100)); > (%o67) -0.070878751689647 > (%i68) float(struve_h(0,1000)); > Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded > maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum > allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed > fpprec.Exceeded maximum allowed fpprec. > (%o68) 636.6197723675813***hypergeometric([1.0],[1.5,1.5]**,-250000.0) > > How can I get a numerical value for the output > of integrate for this case? > > 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 dbmaxima at gmail.com Thu Oct 20 03:27:28 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Thu, 20 Oct 2011 19:27:28 +1100 Subject: [Maxima] float of struve_h functions? In-Reply-To: References: Message-ID: <4E9FDB70.4090608@gmail.com> On 20/10/2011 7:31 AM, Edwin Woollett wrote: > I am using integrate to evaluate one the the > Mathematica list of NIntegrate examples: > > integrate(bessel_y(2,x),x,1,10^4); > > which produces > > -2*bessel_y(2,10000)+(4*bessel_y(2,1)-%pi*struve_h(0,1)*bessel_y(1,1) > > -%pi*struve_h(-1,1)*bessel_y(0,1)) > > /2+5000*%pi*struve_h(0,10000)*bessel_y(1,10000) > +5000*%pi*struve_h(-1,10000)*bessel_y(0,10000) > > The floats of the bessel functions are no problem, but > the struve_h float chokes: > > (%i66) float(struve_h(0,10)); > (%o66) 0.11874368368746 > (%i67) float(struve_h(0,100)); > (%o67) -0.070878751689647 > (%i68) float(struve_h(0,1000)); > Exceeded maximum allowed fpprec.Exceeded maximum allowed > fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed > fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed > fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec. > (%o68) 636.6197723675813*hypergeometric([1.0],[1.5,1.5],-250000.0) > > How can I get a numerical value for the output > of integrate for this case? > > Ted Woollett Sorry for the glib answer earlier. When I look at the code I see that you need to increase the variable max_fpprec, defined in share/hypergeometric/hypergeometric.lisp. It defaults to 1000 In this case 10000 is sufficient: (%i1) load('hypergeometric); (%o1) C:/msys/1.0/local/src/maxima-20111002/share/hypergeometric/hypergeometric.lisp (%i2) max_fpprec; (%o2) 1000 (%i3) struve_h(0,100.0); (%o3) - 0.070878751689647 (%i4) struve_h(0,1000.0); Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.Exceeded maximum allowed fpprec.(%o4) 636.6197723675813 hypergeometric([1.0], [1.5, 1.5], - 250000.0) (%i5) max_fpprec:10000; (%o5) 10000 (%i6) struve_h(0,1000.0); (%o6) 0.0053525371133764 From virgilinux at yahoo.com Thu Oct 20 05:56:38 2011 From: virgilinux at yahoo.com (Virgil L) Date: Thu, 20 Oct 2011 03:56:38 -0700 (PDT) Subject: [Maxima] only 2 line types? (Re: Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima) In-Reply-To: <4E9FCCFB.1070206@telefonica.net> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> <4E74B6D5.7090809@telefonica.net> <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> <4E76290C.3050807@telefonica.net> <1316441395.46505.YahooMailNeo@web125311.mail.ne1.yahoo.com> <4E77B59A.4000802@telefonica.net> <1318946998.17238.YahooMailNeo@web125319.mail.ne1.yahoo.com> <87vcrkk2ci.fsf@yeeloong.netris.org> <4E9FCCFB.1070206@telefonica.net> Message-ID: <1319108198.28653.YahooMailNeo@web125316.mail.ne1.yahoo.com> Thanks Mark and Mario: As I mentioned in an email to Mario, our server runs Maxima 5.20, which is the version provided by?Ubuntu Lucid LTS: http://packages.ubuntu.com/lucid/maxima It seems the dashes and dot_dash types were added in Maxima 5.24 which corresponds to the just released Ubuntu Oneric (11.10). 5.24 appears not to be available as an official backport either: http://packages.ubuntu.com/lucid-backports/allpackages Unless 5.24 is backported to 10.04, 5.24 is unavailable to me. I run the same OS on my personal laptop, and could perhaps install a compiled version there, but that wouldn't be helpful, since I would get errors when I run the same code on my workstation. If there is some workaround, preferably that doesn't require administrative?privileges?to implement (maybe sending a raw gnuplot command from draw2d?), it would be great to know it... also if the maintainer of the Ubuntu package is on this list, it would be great if Maxima 5.24 or more recent could be backported to 10.04 Ubuntu, which is a long-term support (LTS) release and hence favoured in certain environments that emphasise reliability.? Best, Virgil ----- Original Message ----- > From: Mario Rodriguez > To: Mark H Weaver > Cc: maxima mailing list > Sent: Thursday, October 20, 2011 9:25 AM > Subject: Re: [Maxima] only 2 line types? (Re: Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima) > > On 10/19/2011 07:07 PM, Mark H Weaver wrote: >> The draw package actually accepts two other undocumented line types: >> "dashes" and "dot_dash".? However, these only work with > the "eps" and >> "eps_color" terminals as far as I can tell.? Also (on my system > at >> least) "dot_dash" does not render as I'd expect, but rather > as a plain >> dashed pattern, except with shorter dashes than "dashes". >> >> ? ? ? Best, >> ? ? ? Mark > > I sent to Virgil the following replay some days ago. It seems I did not clic the > "Replay to all" button. I hope it clarifies the situation. From willisb at unk.edu Thu Oct 20 07:12:36 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 20 Oct 2011 07:12:36 -0500 Subject: [Maxima] float of struve_h functions? In-Reply-To: <4E9FDB70.4090608@gmail.com> References: <4E9FDB70.4090608@gmail.com>, Message-ID: Maxima won't win a speed contest for numerical evaluation of struve_h, but at least the value of struve_h(0, 1000.0b0) agrees with Wolfram alpha: (%i11) fpprec : 56$ Takes about 2 seconds on my i3: (%i12) struve_h(0, 1000.0b0), max_fpprec : 10000; (%o12) 5.3525371133763518099863310575438959362152058389955848882b-3 Wolfram alpha (input StruveH[0,1000]) (%i13) 0.0053525371133763518099863310575438959362152058389955848882b0$ (%i14) (%-%o12)/%; (%o14) -5.580619564334294774727172516159399253437892869615357299b-57 For numerical evaluation, the hypergeometric code only uses convergent power series--it uses no divergent asymptotic expansions. I think there is a useful divergent expansion for struve_h(0,x) for x --> infinity. I suppose the message "fpprec.Exceeded maximum allowed" could be changed to a suggestion to increase max_fpprec. It's sad that the message is printed multiple times, but avoiding that is hard, I think. --Barton From biomates at telefonica.net Thu Oct 20 10:33:03 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 20 Oct 2011 17:33:03 +0200 Subject: [Maxima] only 2 line types? (Re: Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima) In-Reply-To: <1319108198.28653.YahooMailNeo@web125316.mail.ne1.yahoo.com> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> <4E74B6D5.7090809@telefonica.net> <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> <4E76290C.3050807@telefonica.net> <1316441395.46505.YahooMailNeo@web125311.mail.ne1.yahoo.com> <4E77B59A.4000802@telefonica.net> <1318946998.17238.YahooMailNeo@web125319.mail.ne1.yahoo.com> <87vcrkk2ci.fsf@yeeloong.netris.org> <4E9FCCFB.1070206@telefonica.net> <1319108198.28653.YahooMailNeo@web125316.mail.ne1.yahoo.com> Message-ID: <1319124783.3290.11.camel@pc> El jue, 20-10-2011 a las 03:56 -0700, Virgil L escribi?: > Thanks Mark and Mario: > As I mentioned in an email to Mario, our server runs Maxima 5.20, which is the version provided by Ubuntu Lucid LTS: http://packages.ubuntu.com/lucid/maxima > > It seems the dashes and dot_dash types were added in Maxima 5.24 which corresponds to the just released Ubuntu Oneric (11.10). > > 5.24 appears not to be available as an official backport either: > http://packages.ubuntu.com/lucid-backports/allpackages > > Unless 5.24 is backported to 10.04, 5.24 is unavailable to me. I run the same OS on my personal laptop, and could perhaps install a compiled version there, but that wouldn't be helpful, since I would get errors when I run the same code on my workstation. > > If there is some workaround, preferably that doesn't require administrative privileges to implement (maybe sending a raw gnuplot command from draw2d?), it would be great to know it... also if the maintainer of the Ubuntu package is on this list, it would be great if Maxima 5.24 or more recent could be backported to 10.04 Ubuntu, which is a long-term support (LTS) release and hence favoured in certain environments that emphasise reliability. > > Best, > > Virgil > Yes, I think this should work: Download files draw.lisp, grcommon.lisp and vtk.lisp from the Maxima repository (folder share/draw) and place them somewhere in your user tree. Change lines 34 and 35 from draw.lisp to something similar to ($load "path_to/grcommon.lisp") ($load "path_to/vtk.lisp") Then, every time you need to draw something, write load("path_to/draw.lisp") $ and you are done. If you want to play with the vtk renderer, sudo apt-get install vtk and you are done. Let me know if it doesn't work. -- Mario From adammaj1 at o2.pl Thu Oct 20 12:36:38 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Thu, 20 Oct 2011 19:36:38 +0200 Subject: [Maxima] wiki page Message-ID: Hi, Maxima wiki page : http://maxima-project.org/en/ maxima-project.org domain registration is suspended. ?? Adam From woollett at charter.net Thu Oct 20 12:39:04 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 20 Oct 2011 10:39:04 -0700 Subject: [Maxima] float of struve_h functions? Message-ID: <86D8F910F08E46338EC7E9AE3A5531B4@edwinc367e16bd> On Oct. 20, Barton Willis wrote: > Maxima won't win a speed contest for numerical evaluation of struve_h, > but at least the > value of struve_h(0, 1000.0b0) agrees with Wolfram alpha: > > (%i11) fpprec : 56$ > > Takes about 2 seconds on my i3: > > (%i12) struve_h(0, 1000.0b0), max_fpprec : 10000; > (%o12) 5.3525371133763518099863310575438959362152058389955848882b-3 > > Wolfram alpha (input StruveH[0,1000]) > > (%i13) 0.0053525371133763518099863310575438959362152058389955848882b0$ > > (%i14) (%-%o12)/%; > (%o14) -5.580619564334294774727172516159399253437892869615357299b-57 > > For numerical evaluation, the hypergeometric code only uses convergent > power series--it > uses no divergent asymptotic expansions. I think there is a useful > divergent expansion > for struve_h(0,x) for x --> infinity. > > I suppose the message "fpprec.Exceeded maximum allowed" could be > changed to a suggestion > to increase max_fpprec. It's sad that the message is printed multiple > times, but avoiding > that is hard, I think. Using your bfloat settings I can get the x=1000 value of struve_h, but the x = 10000 value, which I really need here is *very* slow and eventually chokes as before with the same messages. By the way, I actually just tried out float after making the bfloat settings, and got a wildly wrong answer: ----------------------------------------- (%i1) (fpprec : 56,max_fpprec : 10000)$ (%i2) float(struve_h(0,10)); (%o2) 0.11874368368744 ok (%i3) display2d:false$ (%i4) float(struve_h(0,100)); (%o4) -7.2734918013969798E+23 ***not ok*** (%i5) float(struve_h(0,1000)); (%o5) 0.0053525371133764 ok (%i6) bfloat(struve_h(0,10)); (%o6) 1.1874368368746126813851171788439396082759728213500596715b-1 (%i7) bfloat(struve_h(0,100)); (%o7) -7.0878751689647343204031978078193626498395291968345567579b-2 (%i8) bfloat(struve_h(0,1000)); (%o8) 5.3525371133763518099863310575438959362152058389955848882b-3 ---------------------------------- Does the bfloat set operation then make ordinary float unreliable (even though float is not supposed to use a fpprec setting in the first place)?? In any case, the present special function behavior for numerical evaluation implies (for my nint project) that my code should search for the presence of struve_h functions in any output of integrate (which is automatically used as a first attempt (unless a flag is changed) and then interrogate the arguments to exclude the chance of attempting numerical evaluation in cases such as occur, for example, in the expression of interest: .......................................................... -2*bessel_y(2,10000) + (4*bessel_y(2,1) - %pi*struve_h(0,1)*bessel_y(1,1) - %pi*struve_h(-1,1)*bessel_y(0,1))/2 + 5000*%pi*struve_h(0,10000)*bessel_y(1,10000) + 5000*%pi*struve_h(-1,10000)*bessel_y(0,10000) ............................................................ The other lesson learned, perhaps, is that I should routinely use blfloat in the nint code, instead of float, and routinely set fpprec:20 say (I am not interested in high precision answers at this stage of the project). Ted From adammaj1 at o2.pl Thu Oct 20 12:49:49 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Thu, 20 Oct 2011 19:49:49 +0200 Subject: [Maxima] limit / Continued fraction In-Reply-To: References: Message-ID: On 18.10.2011 15:40, Stavros Macrakis wrote: > You can set up the equations for a continued fraction quite easily: > > eqs: [ a = cfdisrep([0,3,2,1000,xx]), > xx = cfdisrep([1,xx]) ] /* the repeating part */ $ > > solve(eqs,[a,xx]); Dear Stavros, Thx for solution. It gives two values.Could you tell which choose ? Best regards Adam > > > On Sun, Oct 16, 2011 at 16:25, Adam Majewski wrote: > >> Hi, >> >> I would like to find limit of Continued fraction [3,2,1000,1...] >> http://www.warwick.ac.uk/~masiay/Research/Siegel.html >> >> In maxima I can compute n-term finite fraction : >> a: >> >> [0,3,2,1000,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] >> (%o1) >> >> [0,3,2,1000,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1] >> (%i2) t:cfdisrep(a) >> (%o2) (1)/(3+(1)/(2+(1)/(1000+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+ (1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1 >> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 >> +1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/ >> (1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 >> +1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/ >> (1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 >> +1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(1 >> >> +1/1))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) >> (%i3) float(t) >> >> Can I find it's limit ? >> >> TIA >> >> Adam >> >> _______________________________________________ >> 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 Oct 20 13:05:08 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 20 Oct 2011 14:05:08 -0400 Subject: [Maxima] limit / Continued fraction In-Reply-To: References: Message-ID: You want the solution with a positive xx. Evaluate the solutions numerically to see which xx is positive. -s On Thu, Oct 20, 2011 at 13:49, Adam Majewski wrote: > On 18.10.2011 15:40, Stavros Macrakis wrote: > >> You can set up the equations for a continued fraction quite easily: >> >> eqs: [ a = cfdisrep([0,3,2,1000,xx]), >> xx = cfdisrep([1,xx]) ] /* the repeating part */ $ >> >> solve(eqs,[a,xx]); >> > > Dear Stavros, > > Thx for solution. > It gives two values.Could you tell which choose ? > > Best regards > > > Adam > > >> >> On Sun, Oct 16, 2011 at 16:25, Adam Majewski wrote: >> >> Hi, >>> >>> I would like to find limit of Continued fraction [3,2,1000,1...] >>> http://www.warwick.ac.uk/~**masiay/Research/Siegel.html >>> >>> In maxima I can compute n-term finite fraction : >>> a: >>> >>> [0,3,2,1000,1,1,1,1,1,1,1,1,1,**1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,** >>> 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,**1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,** >>> 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,**1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,** >>> 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,**1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,** >>> 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,**1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,** >>> 1,1,1,1,1] >>> (%o1) >>> >>> [0,3,2,1000,1,1,1,1,1,1,1,1,1,**1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,** >>> 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,**1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,** >>> 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,**1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,** >>> 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,**1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,** >>> 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,**1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,** >>> 1,1,1,1,1] >>> (%i2) t:cfdisrep(a) >>> (%o2) (1)/(3+(1)/(2+(1)/(1000+(1)/(**1+(1)/(1+(1)/(1+(1)/(1+(1)/(1+** >>> (1)/(1 >>> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(**1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)** >>> /(1+(1)/(1 >>> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+ (1)/(1+(1)/(1+(1)/(1+(1)/(1+(** >>> 1)/(1+(1)/(1 >>> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(**1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)** >>> /(1+(1)/(1 >>> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(**1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)** >>> /(1+(1)/(1 >>> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(**1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)** >>> /(1+(1)/(1 >>> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(**1)/(1+(1)/(1+(1)/(1+(1)/(1+(1)** >>> /(1+(1)/(1 >>> +(1)/(1+(1)/(1+(1)/(1+(1)/(1+(**1)/(1+(1)/(1+1/(1+1/(1+1/(1+1/** >>> (1+1/(1+1/(1 >>> +1/(1+1/(1+1/(1+1/(1+1/(1+1/(**1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(** >>> 1+1/(1+1/(1+1/ >>> (1+1/(1+1/(1+1/(1+1/(1+1/(1+1/**(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/** >>> (1+1/(1+1/(1 >>> +1/(1+1/(1+1/(1+1/(1+1/(1+1/(**1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(** >>> 1+1/(1+1/(1+1/ >>> (1+1/(1+1/(1+1/(1+1/(1+1/(1+1/**(1+1/(1+1/(1+1/(1+1/(1+1/(1+1/** >>> (1+1/(1+1/(1 >>> +1/(1+1/(1+1/(1+1/(1+1/(1+1/(**1+1/(1+1/(1+1/(1+1/(1+1/(1+1/(**1 >>> >>> +1/1))))))))))))))))))))))))))**))))))))))))))))))))))))))))))** >>> ))))))))))))))))))))))))))))))**))))))))))))))))))))))))))))))** >>> ))))))))))))))))))))))))))))))**))))) >>> (%i3) float(t) >>> >>> Can I find it's limit ? >>> >>> TIA >>> >>> Adam >>> >>> ______________________________**_________________ >>> 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 woollett at charter.net Thu Oct 20 14:17:16 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 20 Oct 2011 12:17:16 -0700 Subject: [Maxima] listofops? Message-ID: <812E9C4F0F3049FFA9C577ED3707D0A6@edwinc367e16bd> Maxima has listofvars to produce a list of variables. I would like a listofops to produce a list of ops, so I can easily survey an expression and see if it contains any special functions. Ted From willisb at unk.edu Thu Oct 20 14:34:13 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 20 Oct 2011 14:34:13 -0500 Subject: [Maxima] float of struve_h functions? In-Reply-To: <86D8F910F08E46338EC7E9AE3A5531B4@edwinc367e16bd> References: <86D8F910F08E46338EC7E9AE3A5531B4@edwinc367e16bd> Message-ID: "Edwin Woollett" wrote on 10/20/2011 12:39:04 PM: > (%i4) float(struve_h(0,100)); > (%o4) -7.2734918013969798E+23 ***not ok*** Thanks for catching this bug: (%i26) hypergeometric([1],[3/2,3/2], -10000.0); (%o26) 4.391887286825863*10^65 (%i28) hypergeometric([1],[3/2,3/2], -10000.0b0); (%o28) -4.0120302702491972103831671317134763299116280927551908191b-4 I'll file a report. --Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Thu Oct 20 14:46:42 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 20 Oct 2011 15:46:42 -0400 Subject: [Maxima] listofops? In-Reply-To: <812E9C4F0F3049FFA9C577ED3707D0A6@edwinc367e16bd> References: <812E9C4F0F3049FFA9C577ED3707D0A6@edwinc367e16bd> Message-ID: Something like this?: declare(union,nary)$ listofops(expr) := block([inflag:true], if mapatom(expr) then {} else adjoin(op(expr),xreduce(union,maplist(listofops,expr))))$ inflag:true uses the internal form for efficiency; be aware that listofops(-a/b) => {"*","^"} (from (-1)*a*b^(-1)) instead of {"-","/"} (from -(a/b) ). -s On Thu, Oct 20, 2011 at 15:17, Edwin Woollett wrote: > Maxima has listofvars to produce a list of > variables. > > I would like a listofops to produce a list > of ops, so I can easily survey an expression > and see if it contains any special functions. > > 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 drdieterkaiser at web.de Thu Oct 20 15:00:21 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 20 Oct 2011 22:00:21 +0200 Subject: [Maxima] float of struve_h functions? In-Reply-To: References: <86D8F910F08E46338EC7E9AE3A5531B4@edwinc367e16bd> Message-ID: <1319140821.1720.15.camel@dieter> Am Donnerstag, den 20.10.2011, 14:34 -0500 schrieb Barton Willis: > > "Edwin Woollett" wrote on 10/20/2011 12:39:04 > PM: > > > (%i4) float(struve_h(0,100)); > > (%o4) -7.2734918013969798E+23 ***not ok*** > > Thanks for catching this bug: > > (%i26) hypergeometric([1],[3/2,3/2], -10000.0); > (%o26) 4.391887286825863*10^65 > > (%i28) hypergeometric([1],[3/2,3/2], -10000.0b0); > (%o28) -4.0120302702491972103831671317134763299116280927551908191b-4 > > I'll file a report. I am the author of the implementation of the Struve functions. I am sorry about the missing documentation in English. I have written the documentation in German and for a lot of other special functions I have extended the documentation, too. Rupert Swarbrick has offered some help to translate the German documentation into English. The first function he has translated in English are `abs' and `cabs'. I will add these functions soon. This is the German documentation of struve_h: -- Funktion: struve_h (, ) Die Struve-Funktion H der Ordnung v mit dem Argument z. Siehe Abramowitz und Stegun, Handbook of Mathematical Functions, Kapitel 12. Die Definition ist inf ==== k 2 k z v + 1 \ (- 1) z H (z) = (-) > ---------------------------------- v 2 / 2 k 3 3 ==== 2 gamma(k + -) gamma(v + k + -) k = 0 2 2 Die Struve-Funktion `struve_h' ist f?r das numerische und symbolische Rechnen geeignet. Im Unterschied zu den Bessel-Funktionen ist jedoch die Implementation der Funktion `struve_h' weniger vollst?ndig. Maxima berechnet `struve_h' numerisch f?r reelle und komplexe Gleitkommazahlen als Argumente f?r v und z. Mit der Funktion `float' oder der Optionsvariablen `numer' kann die numerische Auswertung erzwungen werden, wenn die Argumente Zahlen sind. Hat die Optionsvariable `besselexpand' den Wert `true', wird die Struve-Funktion `struve_h' mit einer halbzahligen Ordnung v als Sinus- und Kosinusfunktionen entwickelt. Maxima kennt die Ableitung der Struve-Funktion `struve_h' nach dem Argument z. Siehe auch die Struve-Funktion `struve_l'. Beispiele: (%i1) struve_h(1, 0.5); (%o1) .05217374424234107 (%i2) struve_h(1, 0.5+%i); (%o2) 0.233696520211436 %i - .1522134290663428 (%i3) struve_h(3/2,x), besselexpand: true; 2 2 x sin(x) + 2 cos(x) - x - 2 (%o3) - ------------------------------ 3/2 sqrt(2) sqrt(%pi) x (%i4) diff(struve_h(v, x), x); v x (%o4) (------------------------- - struve_h(v + 1, x) v 3 sqrt(%pi) 2 gamma(v + -) 2 + struve_h(v - 1, x))/2 Dieter Kaiser From woollett at charter.net Thu Oct 20 15:52:06 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 20 Oct 2011 13:52:06 -0700 Subject: [Maxima] listofops? Message-ID: <38CE41B4E4334387ABE88664C5313D77@edwinc367e16bd> On Oct. 20, Stavros Makrakis wrote: > Something like this?: > > declare(union,nary)$ > listofops(expr) := block([inflag:true], if mapatom(expr) then {} else > adjoin(op(expr),xreduce(union,maplist(listofops,expr))))$ > > inflag:true uses the internal form for efficiency; be aware that > listofops(-a/b) => {"*","^"} (from (-1)*a*b^(-1)) instead of {"-","/"} > Actually, I asked for the wrong thing. I should have asked for something to detect the presence, in an expression, of one of Maxima's special functions (true/false). I found funp, funp1, funp2 in ...share/fourie.mac, which does the job to define spfunp (expr) ; see below: ----------------------------------------- (%i1) load(temp); (%o1) c:/work2/temp.mac (%i2) spfunp (bessel_y(2,x)); (%o2) true (%i3) spfunp (x); (%o3) false (%i4) spfunp (x*bessel_y(2,x) + bessel_j(0,x)); (%o4) true -------------------------------------------------- /* temp.mac oct. 20, 2011 code spfunp to detect special functions: return true is any are found return false otherwise */ /* funp1: code from ....share/calculus/fourie.mac */ funp1(fun,exp):=block([inflag],inflag:true, if mapatom(exp) then false else (if inpart(exp,0) = fun then true else member(true,maplist(lambda([q],funp1(fun,q)),exp))))$ spfunp (expr) := block ([spfun, spf:false], for spfun in [bessel_j,bessel_y,bessel_i,bessel_k, hankel_1,hankel_2,struve_h,struve_l, assoc_legendre_p,assoc_legendre_q, %f,gamma,gammagreek,gammaincomplete, hypergeometric,slommel,%m,%w,erfc, expintegral_e,expintegral_e1, expintegral_ei,expintegral_li, expintegral_si,expintegral_ci, expintegral_shi,expintegral_chi, kelliptic,parabolic_cylinder_d] do if funp1 (spfun,expr) then ( spf:true, return()), spf)$ ------------------------------------------------- From macrakis at alum.mit.edu Thu Oct 20 16:01:49 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 20 Oct 2011 17:01:49 -0400 Subject: [Maxima] listofops? In-Reply-To: <38CE41B4E4334387ABE88664C5313D77@edwinc367e16bd> References: <38CE41B4E4334387ABE88664C5313D77@edwinc367e16bd> Message-ID: The code below is much less efficient than using listofops and intersecting with whatever list of special functions you like. -s On Thu, Oct 20, 2011 at 16:52, Edwin Woollett wrote: > On Oct. 20, Stavros Makrakis wrote: > > > Something like this?: > > > > declare(union,nary)$ > > listofops(expr) := block([inflag:true], if mapatom(expr) then {} else > > adjoin(op(expr),xreduce(union,**maplist(listofops,expr))))$ > > > > inflag:true uses the internal form for efficiency; be aware that > > listofops(-a/b) => {"*","^"} (from (-1)*a*b^(-1)) instead of {"-","/"} > > > > Actually, I asked for the wrong thing. I should have asked for > something to detect the presence, in an expression, of one > of Maxima's special functions (true/false). > > I found funp, funp1, funp2 in ...share/fourie.mac, which does > the job to define spfunp (expr) ; see below: > > ------------------------------**----------- > (%i1) load(temp); > (%o1) c:/work2/temp.mac > > (%i2) spfunp (bessel_y(2,x)); > (%o2) true > > (%i3) spfunp (x); > (%o3) false > (%i4) spfunp (x*bessel_y(2,x) + bessel_j(0,x)); > (%o4) true > > ------------------------------**-------------------- > /* temp.mac > oct. 20, 2011 > code spfunp to detect special functions: > return true is any are found > return false otherwise > */ > > > /* funp1: code from ....share/calculus/fourie.mac */ > > funp1(fun,exp):=block([inflag]**,inflag:true, > if mapatom(exp) then false > else (if inpart(exp,0) = fun then true > else member(true,maplist(lambda([q]**,funp1(fun,q)),exp))))$ > > > spfunp (expr) := > block ([spfun, spf:false], > > for spfun in > [bessel_j,bessel_y,bessel_i,**bessel_k, > hankel_1,hankel_2,struve_h,**struve_l, > assoc_legendre_p,assoc_**legendre_q, > %f,gamma,gammagreek,**gammaincomplete, > hypergeometric,slommel,%m,%w,**erfc, > expintegral_e,expintegral_e1, > expintegral_ei,expintegral_li, > expintegral_si,expintegral_ci, > expintegral_shi,expintegral_**chi, > kelliptic,parabolic_cylinder_**d] do > > if funp1 (spfun,expr) then ( > spf:true, > return()), > spf)$ > > ------------------------------**------------------- > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdieterkaiser at web.de Thu Oct 20 16:10:45 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 20 Oct 2011 23:10:45 +0200 Subject: [Maxima] listofops? In-Reply-To: <38CE41B4E4334387ABE88664C5313D77@edwinc367e16bd> References: <38CE41B4E4334387ABE88664C5313D77@edwinc367e16bd> Message-ID: <1319145045.1720.22.camel@dieter> Am Donnerstag, den 20.10.2011, 13:52 -0700 schrieb Edwin Woollett: > On Oct. 20, Stavros Makrakis wrote: > > > Something like this?: > > > > declare(union,nary)$ > > listofops(expr) := block([inflag:true], if mapatom(expr) then {} else > > adjoin(op(expr),xreduce(union,maplist(listofops,expr))))$ > > > > inflag:true uses the internal form for efficiency; be aware that > > listofops(-a/b) => {"*","^"} (from (-1)*a*b^(-1)) instead of {"-","/"} > > > > Actually, I asked for the wrong thing. I should have asked for > something to detect the presence, in an expression, of one > of Maxima's special functions (true/false). > > I found funp, funp1, funp2 in ...share/fourie.mac, which does > the job to define spfunp (expr) ; see below: > > ----------------------------------------- > (%i1) load(temp); > (%o1) c:/work2/temp.mac > > (%i2) spfunp (bessel_y(2,x)); > (%o2) true > > (%i3) spfunp (x); > (%o3) false > (%i4) spfunp (x*bessel_y(2,x) + bessel_j(0,x)); > (%o4) true > > -------------------------------------------------- > /* temp.mac > oct. 20, 2011 > code spfunp to detect special functions: > return true is any are found > return false otherwise > */ > > > /* funp1: code from ....share/calculus/fourie.mac */ > > funp1(fun,exp):=block([inflag],inflag:true, > if mapatom(exp) then false > else (if inpart(exp,0) = fun then true > else member(true,maplist(lambda([q],funp1(fun,q)),exp))))$ > > > spfunp (expr) := > block ([spfun, spf:false], > > for spfun in > [bessel_j,bessel_y,bessel_i,bessel_k, > hankel_1,hankel_2,struve_h,struve_l, > assoc_legendre_p,assoc_legendre_q, > %f,gamma,gammagreek,gammaincomplete, > hypergeometric,slommel,%m,%w,erfc, > expintegral_e,expintegral_e1, > expintegral_ei,expintegral_li, > expintegral_si,expintegral_ci, > expintegral_shi,expintegral_chi, > kelliptic,parabolic_cylinder_d] do > > if funp1 (spfun,expr) then ( > spf:true, > return()), > spf)$ Maxima has the Lisp function isinop. I have extended this function some times ago to return not only true and false, but a whole expression. With this function the following is possible: (%i1) expr:abs(x)+bessel_y(1,y)+struve_h(0,z)+'integrate(f(x),x); (%o1) 'integrate(f(x),x)+abs(x)+bessel_y(1,y)+struve_h(0,z) (%i2) ?isinop(expr,abs); (%o2) abs(x) (%i3) ?isinop(expr,struve_h); (%o3) struve_h(0,z) (%i4) ?isinop(expr,struve_l); (%o4) false (%i5) ?isinop(expr,bessel_y); (%o5) bessel_y(1,y) (%i6) ?isinop(expr,bessel_i); (%o6) false (%i7) ?isinop(expr,nounify(integrate)); (%o7) 'integrate(f(x),x) If the operator is present, the whole expression is returned. This functions checks only for the first appearance of the operator. I think it is a nice function which we might add for the Maxima user. Dieter Kaiser From woollett at charter.net Thu Oct 20 17:25:01 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 20 Oct 2011 15:25:01 -0700 Subject: [Maxima] listofops? Message-ID: On Oct. 20, Dieter Kaiser wrote: ----------- > Maxima has the Lisp function isinop. I have extended this function some > times ago to return not only true and false, but a whole expression. > With this function the following is possible: > > (%i1) expr:abs(x)+bessel_y(1,y)+struve_h(0,z)+'integrate(f(x),x); > (%o1) 'integrate(f(x),x)+abs(x)+bessel_y(1,y)+struve_h(0,z) > > (%i2) ?isinop(expr,abs); > (%o2) abs(x) > > (%i3) ?isinop(expr,struve_h); > (%o3) struve_h(0,z) [snip] > > > If the operator is present, the whole expression is returned. This > functions checks only for the first appearance of the operator. I think > it is a nice function which we might add for the Maxima user. ----------- Thanks for the information about this Lisp function. With the code which uses ?isinop instead of funp1: ---- spfunp (expr) := block ([spfun,spf:false], for spfun in [bessel_j,bessel_y,bessel_i,bessel_k, hankel_1,hankel_2,struve_h,struve_l, assoc_legendre_p,assoc_legendre_q, %f,gamma,gammagreek,gammaincomplete, hypergeometric,slommel,%m,%w,erfc, expintegral_e,expintegral_e1, expintegral_ei,expintegral_li, expintegral_si,expintegral_ci, expintegral_shi,expintegral_chi, kelliptic,parabolic_cylinder_d] do if ?isinop(expr,spfun) # false then ( spf:true, return()), spf)$ --------------- I get same answers as before: (%i2) spfunp(bessel_y(2,x)); (%o2) true (%i3) spfunp(x); (%o3) false (%i4) spfunp(x*bessel_y(2,x)+bessel_j(0,x)); (%o4) true (%i5) expr:abs(x)+bessel_y(1,y)+struve_h(0,z)+'integrate(f(x),x)$ (%i6) spfunp(expr); (%o6) true ------------------------------------- On Oct. 20, Stavros Makrakis wrote: >The code below [referring to my funp1 code] > is much less efficient than using listofops and > intersecting with whatever list of special functions > you like. --------------------- I have used the following approach with your listofops function, but there is probably a better arrangement? ------------------------------------ declare(union,nary)$ listofops(expr) := block([inflag:true], if mapatom(expr) then {} else adjoin(op(expr),xreduce(union,maplist(listofops,expr))))$ spfunp (eexpr) := (if length ( intersect (listofops (eexpr), {bessel_j,bessel_y,bessel_i,bessel_k, hankel_1,hankel_2,struve_h,struve_l, assoc_legendre_p,assoc_legendre_q, %f,gamma,gammagreek,gammaincomplete, hypergeometric,slommel,%m,%w,erfc, expintegral_e,expintegral_e1, expintegral_ei,expintegral_li, expintegral_si,expintegral_ci, expintegral_shi,expintegral_chi, kelliptic,parabolic_cylinder_d})) > 0 then true else false)$ ------------------------------------- which produces the same output as before. Not clear to me what effects the union,nary declaration would have on any other code in the same session? Ted From macrakis at alum.mit.edu Thu Oct 20 18:34:07 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 20 Oct 2011 19:34:07 -0400 Subject: [Maxima] listofops? In-Reply-To: References: Message-ID: union nary is necesary to get xreduce(union,[]) to return {}. Barton and I will add it to the set package -- it should be standard. On Thu, Oct 20, 2011 at 18:25, Edwin Woollett wrote: > On Oct. 20, Dieter Kaiser wrote: > ----------- > > > Maxima has the Lisp function isinop. I have extended this function some > > times ago to return not only true and false, but a whole expression. > > With this function the following is possible: > > > > (%i1) expr:abs(x)+bessel_y(1,y)+**struve_h(0,z)+'integrate(f(x),**x); > > (%o1) 'integrate(f(x),x)+abs(x)+**bessel_y(1,y)+struve_h(0,z) > > > > (%i2) ?isinop(expr,abs); > > (%o2) abs(x) > > > > (%i3) ?isinop(expr,struve_h); > > (%o3) struve_h(0,z) > [snip] > > > > > > > If the operator is present, the whole expression is returned. This > > functions checks only for the first appearance of the operator. I think > > it is a nice function which we might add for the Maxima user. > ----------- > Thanks for the information about this Lisp function. > With the code which uses ?isinop > instead of funp1: > ---- > spfunp (expr) := > block ([spfun,spf:false], > > > for spfun in > [bessel_j,bessel_y,bessel_i,**bessel_k, > hankel_1,hankel_2,struve_h,**struve_l, > assoc_legendre_p,assoc_**legendre_q, > %f,gamma,gammagreek,**gammaincomplete, > hypergeometric,slommel,%m,%w,**erfc, > expintegral_e,expintegral_e1, > expintegral_ei,expintegral_li, > expintegral_si,expintegral_ci, > expintegral_shi,expintegral_**chi, > kelliptic,parabolic_cylinder_**d] do > > if ?isinop(expr,spfun) # false then ( > spf:true, > return()), > spf)$ > --------------- > I get same answers as before: > (%i2) spfunp(bessel_y(2,x)); > (%o2) true > (%i3) spfunp(x); > (%o3) false > (%i4) spfunp(x*bessel_y(2,x)+bessel_**j(0,x)); > (%o4) true > (%i5) expr:abs(x)+bessel_y(1,y)+**struve_h(0,z)+'integrate(f(x),**x)$ > (%i6) spfunp(expr); > (%o6) true > ------------------------------**------- > > On Oct. 20, Stavros Makrakis wrote: > > The code below [referring to my funp1 code] >> >> is much less efficient than using listofops and >> intersecting with whatever list of special functions >> you like. >> > --------------------- > I have used the following approach with your > listofops function, but there is probably a > better arrangement? > ------------------------------**------ > > declare(union,nary)$ > > listofops(expr) := block([inflag:true], if mapatom(expr) then {} else > adjoin(op(expr),xreduce(union,**maplist(listofops,expr))))$ > > spfunp (eexpr) := > (if length ( intersect (listofops (eexpr), > > {bessel_j,bessel_y,bessel_i,**bessel_k, > hankel_1,hankel_2,struve_h,**struve_l, > assoc_legendre_p,assoc_**legendre_q, > %f,gamma,gammagreek,**gammaincomplete, > hypergeometric,slommel,%m,%w,**erfc, > expintegral_e,expintegral_e1, > expintegral_ei,expintegral_li, > expintegral_si,expintegral_ci, > expintegral_shi,expintegral_**chi, > kelliptic,parabolic_cylinder_**d})) > 0 then > true > else false)$ > ------------------------------**------- > which produces the same output as before. > > Not clear to me what effects the union,nary > declaration would have on any other code > in the same session? > > Ted > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From virgilinux at yahoo.com Thu Oct 20 18:48:36 2011 From: virgilinux at yahoo.com (Virgil L) Date: Thu, 20 Oct 2011 16:48:36 -0700 (PDT) Subject: [Maxima] only 2 line types? (Re: Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima) In-Reply-To: <1319124783.3290.11.camel@pc> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> <4E74B6D5.7090809@telefonica.net> <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> <4E76290C.3050807@telefonica.net> <1316441395.46505.YahooMailNeo@web125311.mail.ne1.yahoo.com> <4E77B59A.4000802@telefonica.net> <1318946998.17238.YahooMailNeo@web125319.mail.ne1.yahoo.com> <87vcrkk2ci.fsf@yeeloong.netris.org> <4E9FCCFB.1070206@telefonica.net> <1319108198.28653.YahooMailNeo@web125316.mail.ne1.yahoo.com> <1319124783.3290.11.camel@pc> Message-ID: <1319154516.49135.YahooMailNeo@web125314.mail.ne1.yahoo.com> > Yes, I think this should work: > > Download files draw.lisp, grcommon.lisp and vtk.lisp from the Maxima > repository (folder share/draw) and place them somewhere in your user > tree. > > Change lines 34 and 35 from draw.lisp to something similar to > > ($load "path_to/grcommon.lisp") > ($load "path_to/vtk.lisp") > > > Then, every time you need to draw something, write > > load("path_to/draw.lisp") $ > and you are done. Thanks, Mario. I tried it in one system without using any root privilege and it seemed to have worked for your simple example, with the known issue involving dot_dash line type. A little annoyance is that it seems the load function only understands complete absolute paths. For example??load("$HOME/maxima/draw.lisp") or load("~/maxima/draw.lisp") would not work ( same internally when draw itself invokes load on lines 34, 35).?Relative paths (../ , ?./, etc) seem NOT to work either. The alias $HOME or ~ or the relative paths would be preferable, particularly w.r.t. the line 34/35 modifications, because then one modified copy of draw would work on multiple systems (provided the pertinent files are placed in the right place, such as on $HOME/maxima in this example).?Not a big deal, just a little annoyance. I suppose that user_preamble= "xxxxxxxxxx" is another approach that may perhaps be useful if not in this specific case, in similar cases, in which one may want to issue direct commands to gnuplot to achieve a functionality not provided explicitly by draw. Best, Virgil From O.Kullmann at swansea.ac.uk Thu Oct 20 19:16:11 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Fri, 21 Oct 2011 01:16:11 +0100 Subject: [Maxima] computing generating elements of ZZ_p^* ? Message-ID: <20111021001611.GA27744@cs-wsok.swan.ac.uk> Hello, I wonder whether Maxima contains the following functionality (couldn't find it): Let p be a prime number, and consider the residual field ZZ_p (residual classes modulo p with modular addition and multiplication). ZZ_p^* = {1,...,p-1} together with the multiplication is a cyclic group: now what is needed is a test to determine whether an element i is a generating element --- is this somehow in Maxima? Thanks for your attention. Oliver From volkervannek at googlemail.com Fri Oct 21 03:24:18 2011 From: volkervannek at googlemail.com (Volker van Nek) Date: Fri, 21 Oct 2011 10:24:18 +0200 Subject: [Maxima] computing generating elements of ZZ_p^* ? In-Reply-To: <20111021001611.GA27744@cs-wsok.swan.ac.uk> References: <20111021001611.GA27744@cs-wsok.swan.ac.uk> Message-ID: I attached a lisp file which allows the following session. Maybe that is what you are looking for. (%i1) load("~/Maxima/primroot.lisp")$ contains 3 functions at Maxima-level: euler_phi, primroot, primrootp (%i2) primroot(7); (%o2) 3 primroot searches for the smallest primitive root in z7*. Let us see what elements of z7* the number 3 can generate: (%i3) (z7:set(), for i:1 thru 6 do z7:adjoin(power_mod(3,i,7), z7), z7); (%o3) {1, 2, 3, 4, 5, 6} The same test for number 2: (%i4) (z7:set(), for i:1 thru 6 do z7:adjoin(power_mod(2,i,7), z7), z7); (%o4) {1, 2, 4} The number of primitive roots in z7*: (%i5) euler_phi(6); (%o5) 2 primrootp allows to find all primitive roots. It checks if a given number is a primitive root. (%i6) for i:1 thru 6 do if primrootp(i, 7) then print(i); 3 5 (%o6) done primrootp has to compute the prime factors of 6. To be more efficient in repeated computation it is possible to pass this list of factors to primrootp: (%i7) factors: ifactors(6), factors_only: true; (%o7) [2, 3] (%i8) for i:1 thru 6 do if primrootp(i, 7, factors) then print(i); 3 5 (%o8) done Volker van Nek 2011/10/21 Oliver Kullmann > Hello, > > I wonder whether Maxima contains the following functionality (couldn't > find it): > > Let p be a prime number, and consider the residual field ZZ_p (residual > classes modulo p with modular addition and multiplication). > ZZ_p^* = {1,...,p-1} together with the multiplication is a cyclic group: > now what is needed is a test to determine whether an element i is a > generating > element --- is this somehow in Maxima? > > Thanks for your attention. > > Oliver > > _______________________________________________ > 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: primroot.lisp Type: application/octet-stream Size: 2095 bytes Desc: not available URL: From biomates at telefonica.net Fri Oct 21 10:13:28 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 21 Oct 2011 17:13:28 +0200 Subject: [Maxima] only 2 line types? (Re: Multiple plots: oddities (bugs?), missing features in Xmaxima and wxMaxima) In-Reply-To: <1319154516.49135.YahooMailNeo@web125314.mail.ne1.yahoo.com> References: <1316175668.1665.YahooMailNeo@web125314.mail.ne1.yahoo.com> <4E73E1C5.40609@telefonica.net> <1316206154.18602.YahooMailNeo@web125312.mail.ne1.yahoo.com> <4E74B6D5.7090809@telefonica.net> <1316260083.6185.YahooMailNeo@web125309.mail.ne1.yahoo.com> <4E76290C.3050807@telefonica.net> <1316441395.46505.YahooMailNeo@web125311.mail.ne1.yahoo.com> <4E77B59A.4000802@telefonica.net> <1318946998.17238.YahooMailNeo@web125319.mail.ne1.yahoo.com> <87vcrkk2ci.fsf@yeeloong.netris.org> <4E9FCCFB.1070206@telefonica.net> <1319108198.28653.YahooMailNeo@web125316.mail.ne1.yahoo.com> <1319124783.3290.11.camel@pc> <1319154516.49135.YahooMailNeo@web125314.mail.ne1.yahoo.com> Message-ID: <1319210008.1573.4.camel@pc> El jue, 20-10-2011 a las 16:48 -0700, Virgil L escribi?: > Thanks, Mario. I tried it in one system without using any root privilege and it seemed to have worked for your simple example, with the known issue involving dot_dash line type. > > A little annoyance is that it seems the load function only understands complete absolute paths. > For example load("$HOME/maxima/draw.lisp") or load("~/maxima/draw.lisp") would not work ( same internally when draw itself invokes load on lines 34, 35). Relative paths (../ , ./, etc) seem NOT to work either. > > The alias $HOME or ~ or the relative paths would be preferable, When compiled with clisp, something like load("~/maxima/draw.lisp") works for me. -- Mario From robert.dodier at gmail.com Fri Oct 21 10:58:07 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 21 Oct 2011 09:58:07 -0600 Subject: [Maxima] computing generating elements of ZZ_p^* ? In-Reply-To: References: <20111021001611.GA27744@cs-wsok.swan.ac.uk> Message-ID: Oliver, perhaps you can take a look at the share package gf. I don't know if it's applicable but perhaps it's worth taking a look. best Robert Dodier From adammaj1 at o2.pl Fri Oct 21 13:56:09 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Fri, 21 Oct 2011 20:56:09 +0200 Subject: [Maxima] limit / Continued fraction In-Reply-To: References: Message-ID: Hi, I have made image ( code included on page ): http://commons.wikimedia.org/wiki/File:Golden_mean.png Regards Adam From woollett at charter.net Fri Oct 21 16:33:00 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 21 Oct 2011 14:33:00 -0700 Subject: [Maxima] integrate of bessel_i sign error? Message-ID: integrate doesn't seem to give a correct value for the integral of bessel_i, based on numerical values Maxima uses. For a small integration range and a smooth function, a rough value of the integral is base*height. Here we use a base = 1 integrating from y = 1 to y = 2, and use a height the value half way across the range: (%i1) load(nint); (%o1) "c:/work2/nint.mac" (%i2) ratprint:false$ (%i3) f(a):= fchop(expand(float(a)))$ here is the height: (%i4) f(bessel_i(1,%i*1.5)); (%o4) 0.5579365079101*%i here is the integral over a range = 1: (%i5) f(integrate(bessel_i(1,%i*y),y,1,2)); (%o5) -0.54130690741673*%i integrate appears to produce the wrong sign for this integral?? Ted Woollett From woollett at charter.net Fri Oct 21 17:51:41 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 21 Oct 2011 15:51:41 -0700 Subject: [Maxima] bessel_y sign error with integrate? Message-ID: <1FDD12820BEA4E62BC1DE6AABAC89A6B@edwinc367e16bd> On Oct. 21, 2011, I wrote about bessel_i integrate sign error. Using the same session, here is an apparent sign error when using integrate with bessel_y(2,x) . (The reasoning is the same.) first the 'height' (the 'base' is unity): (%i23) f(bessel_y(2,4)); (%o23) 0.21590359460361 (%i24) integrate (bessel_y(2,y),y,3.5,4.5); (%o24) (46650016*%pi-292890325)/445824550-(6893566*%pi-5764575)/63526475 (%i25) f(%); (%o25) -0.57840103823513 So both sign and magnitude error apparently. Ted Woollett From O.Kullmann at swansea.ac.uk Sat Oct 22 04:54:43 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 22 Oct 2011 10:54:43 +0100 Subject: [Maxima] computing generating elements of ZZ_p^* ? In-Reply-To: References: <20111021001611.GA27744@cs-wsok.swan.ac.uk> Message-ID: <20111022095443.GB27744@cs-wsok.swan.ac.uk> Hi Robert, unfortunately that package "gf" hasn't been updated for quite some time now, and quite a few of its functions are broken: load(gf); gf_set(131); gf_findprim(); fasttimes: arguments must be CRE polynomials with same variables. #0: gf_binpower(p=x,n=131)(gf.mac line 244) #1: mainpowers()(gf.mac line 346) #2: gf_findprim()(gf.mac line 438) -- an error. To debug this try: debugmode(true); So finding primitive elements is broken (at least with the default settings). Just to mention another error: gf_exp(3,-1); returns 1, and actually gf_exp(x,-1) for arbitrary x return 1 (also "gf_exp(a,-1)" returns 1). It would be nice if that package could be brought back to life (perhaps only some generic update is needed). Best Oliver On Fri, Oct 21, 2011 at 09:58:07AM -0600, Robert Dodier wrote: > Oliver, perhaps you can take a look at the share package gf. > I don't know if it's applicable but perhaps it's worth taking a look. > > best > > Robert Dodier From O.Kullmann at swansea.ac.uk Sat Oct 22 06:33:05 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 22 Oct 2011 12:33:05 +0100 Subject: [Maxima] computing generating elements of ZZ_p^* ? In-Reply-To: References: <20111021001611.GA27744@cs-wsok.swan.ac.uk> Message-ID: <20111022113305.GC27744@cs-wsok.swan.ac.uk> Hi Volker, On Fri, Oct 21, 2011 at 10:24:18AM +0200, Volker van Nek wrote: > I attached a lisp file which allows the following session. Maybe that is > what you are looking for. > (%i1) load("~/Maxima/primroot.lisp")$ > contains 3 functions at Maxima-level: euler_phi, primroot, primrootp > (%i2) primroot(7); > (%o2) 3 > primroot searches for the smallest primitive root in z7*. > The number of primitive roots in z7*: > (%i5) euler_phi(6); > (%o5) 2 > primrootp allows to find all primitive roots. It checks if a given number is > a primitive root. > > Thanks a lot. Just a few remarks: - euler_phi is also directly in Maxima, as "totient"; seems to have the same run-time. - One doesn't need to restrict the approach to prime p, but can consider all natural numbers n for which the multiplicative group ZZ_n^* is cyclic, i.e., there exists a primitive root modulo n, where additionally to n=p (p prime) one than can allow n=4,p^k,2*p^k for p > 2 (p prime). - Implementing the functionality (generalised to all possible n) directly in Maxima seems to have the same run-time, except that at least under Ecl the run-time fluctuations are enormous. Just to mention, for the records. Regards Oliver > 2011/10/21 Oliver Kullmann > > > Hello, > > > > I wonder whether Maxima contains the following functionality (couldn't > > find it): > > > > Let p be a prime number, and consider the residual field ZZ_p (residual > > classes modulo p with modular addition and multiplication). > > ZZ_p^* = {1,...,p-1} together with the multiplication is a cyclic group: > > now what is needed is a test to determine whether an element i is a > > generating > > element --- is this somehow in Maxima? > > > > Thanks for your attention. > > > > Oliver > > > > _______________________________________________ > > 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 willisb at unk.edu Sat Oct 22 06:48:37 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 22 Oct 2011 06:48:37 -0500 Subject: [Maxima] float of struve_h functions? In-Reply-To: References: , <86D8F910F08E46338EC7E9AE3A5531B4@edwinc367e16bd> Message-ID: For a one line possible fix, see http://sourceforge.net/tracker/?func=detail&aid=3426847&group_id=4933&atid=104933 (resolve confusion between bigfloat unit roundoff and binary64 unit roundoff). --Barton From O.Kullmann at swansea.ac.uk Sat Oct 22 06:53:47 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 22 Oct 2011 12:53:47 +0100 Subject: [Maxima] crazy run-time fluctuations (mostly super-slow) Message-ID: <20111022115347.GD27744@cs-wsok.swan.ac.uk> Hello, I think it was already mentioned on the mailing list that at least under Ecl Maxima becomes very inefficient after running for some time, typically by a factor of 10 slower than it should be, so one frequently needs to restart Maxima. Until now I thought that would only happen for bigger computations. However look at the following (three fresh re-starts): Maxima 5.25.1 http://maxima.sourceforge.net using Lisp ECL 11.1.1 (%i1) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 12.9080 seconds (12.9520 elapsed) (%o1) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], [315114064590027073770947,1]] (%i2) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 121.3250 seconds (121.5850 elapsed) (%o2) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], [315114064590027073770947,1]] (%i3) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 26.7130 seconds (26.7670 elapsed) (%o3) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], [315114064590027073770947,1]] (%i4) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 64.2590 seconds (64.3860 elapsed) (%o4) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], [315114064590027073770947,1]] Maxima 5.25.1 http://maxima.sourceforge.net using Lisp ECL 11.1.1 (%i1) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 62.0850 seconds (62.2240 elapsed) (%o1) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], [315114064590027073770947,1]] (%i2) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 48.7650 seconds (48.8580 elapsed) (%o2) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], [315114064590027073770947,1]] (%i3) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 115.2030 seconds (115.4290 elapsed) (%o3) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], [315114064590027073770947,1]] Maxima 5.25.1 http://maxima.sourceforge.net using Lisp ECL 11.1.1 (%i1) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 6.0920 seconds (6.1730 elapsed) (%o1) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], [315114064590027073770947,1]] (%i2) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 70.7340 seconds (70.9190 elapsed) (%o2) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], [315114064590027073770947,1]] (%i3) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 103.8050 seconds (104.0320 elapsed) (%o3) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], [315114064590027073770947,1]] One sees that it should compute the results in 6 seconds, but right from the start in can take 20 times that much. According to my experience, there are certain functions (like ifactors) which show such a behaviour, while otherwise you "only" get the slower increase in run-time, after every computation it takes a bit more. I hope somebody can look into it. Quite a lot of run-time is wasted in this way, and it creates also a bad feeling. We have experienced many examples of such behaviour, but I hope the above is convincing (and reproducible; if it really is Ecl-specific, then one should convince the Ecl-guys to fix it ...). Thanks for your attention. Oliver From O.Kullmann at swansea.ac.uk Sat Oct 22 07:25:16 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 22 Oct 2011 13:25:16 +0100 Subject: [Maxima] crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: <20111022115347.GD27744@cs-wsok.swan.ac.uk> References: <20111022115347.GD27744@cs-wsok.swan.ac.uk> Message-ID: <20111022122516.GA6159@cs-wsok.swan.ac.uk> Just a bit more data (additional to the data from my previous e-mail, which I've copied below): - The machine is an Intel i5 running with constant 2.4 GHz (monitored) and 4GB. - The initialisation-file contains "showtime : true;" and other settings. - Running the same example with CLISP in the installation as provided by Suse Linux 11.4: kullmann-0:~> 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) showtime : true; Evaluation took 0.0000 seconds (0.0000 elapsed) using 56 bytes. (%o1) true (%i2) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 151.1170 seconds (151.4321 elapsed) using 9397.813 MB. (%o2) [[2, 1], [7, 1], [107, 1], [1679641, 1], [8255453, 1], [152778774688461206737, 1], [315114064590027073770947, 1]] (%i3) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 17.4313 seconds (17.4833 elapsed) using 871.713 MB. (%o3) [[2, 1], [7, 1], [107, 1], [1679641, 1], [8255453, 1], [152778774688461206737, 1], [315114064590027073770947, 1]] (%i4) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 211.2639 seconds (211.7062 elapsed) using 12557.245 MB. (%o4) [[2, 1], [7, 1], [107, 1], [1679641, 1], [8255453, 1], [152778774688461206737, 1], [315114064590027073770947, 1]] (%i5) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); Evaluation took 265.6916 seconds (266.2212 elapsed) using 16512.327 MB. (%o5) [[2, 1], [7, 1], [107, 1], [1679641, 1], [8255453, 1], [152778774688461206737, 1], [315114064590027073770947, 1]] As you can see, it can do it in 17s, but most of the time it takes much longer. There seems to be a clear memory-management problem. And there are now two Lisp's with that behaviour (Ecl and CLisp). Oliver > Maxima 5.25.1 http://maxima.sourceforge.net > using Lisp ECL 11.1.1 > (%i1) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 12.9080 seconds (12.9520 elapsed) > (%o1) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > [315114064590027073770947,1]] > (%i2) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 121.3250 seconds (121.5850 elapsed) > (%o2) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > [315114064590027073770947,1]] > (%i3) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 26.7130 seconds (26.7670 elapsed) > (%o3) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > [315114064590027073770947,1]] > (%i4) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 64.2590 seconds (64.3860 elapsed) > (%o4) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > [315114064590027073770947,1]] > > Maxima 5.25.1 http://maxima.sourceforge.net > using Lisp ECL 11.1.1 > (%i1) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 62.0850 seconds (62.2240 elapsed) > (%o1) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > [315114064590027073770947,1]] > (%i2) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 48.7650 seconds (48.8580 elapsed) > (%o2) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > [315114064590027073770947,1]] > (%i3) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 115.2030 seconds (115.4290 elapsed) > (%o3) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > [315114064590027073770947,1]] > > Maxima 5.25.1 http://maxima.sourceforge.net > using Lisp ECL 11.1.1 > (%i1) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 6.0920 seconds (6.1730 elapsed) > (%o1) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > [315114064590027073770947,1]] > (%i2) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 70.7340 seconds (70.9190 elapsed) > (%o2) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > [315114064590027073770947,1]] > (%i3) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 103.8050 seconds (104.0320 elapsed) > (%o3) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > [315114064590027073770947,1]] > From l.couraud at gmail.com Sat Oct 22 09:13:29 2011 From: l.couraud at gmail.com (laurent couraud) Date: Sat, 22 Oct 2011 16:13:29 +0200 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: <20111022122516.GA6159@cs-wsok.swan.ac.uk> Message-ID: > -----Message d'origine----- > De?: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] De la part de > Oliver Kullmann > Envoy??: samedi 22 octobre 2011 14:25 > ??: Maxima at math.utexas.edu > Objet?: Re: [Maxima] crazy run-time fluctuations (mostly super-slow) -- a bit more data > > Just a bit more data (additional to the data from my previous e-mail, > which I've copied below): > > - The machine is an Intel i5 running with constant 2.4 GHz (monitored) > and 4GB. > - The initialisation-file contains "showtime : true;" and other settings. > - Running the same example with CLISP in the installation as provided by > Suse Linux 11.4: > > kullmann-0:~> 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) showtime : true; > Evaluation took 0.0000 seconds (0.0000 elapsed) using 56 bytes. > (%o1) true > (%i2) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 151.1170 seconds (151.4321 elapsed) using 9397.813 MB. > (%o2) [[2, 1], [7, 1], [107, 1], [1679641, 1], [8255453, 1], > [152778774688461206737, 1], [315114064590027073770947, 1]] > (%i3) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 17.4313 seconds (17.4833 elapsed) using 871.713 MB. > (%o3) [[2, 1], [7, 1], [107, 1], [1679641, 1], [8255453, 1], > [152778774688461206737, 1], [315114064590027073770947, 1]] > (%i4) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 211.2639 seconds (211.7062 elapsed) using 12557.245 MB. > (%o4) [[2, 1], [7, 1], [107, 1], [1679641, 1], [8255453, 1], > [152778774688461206737, 1], [315114064590027073770947, 1]] > (%i5) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > Evaluation took 265.6916 seconds (266.2212 elapsed) using 16512.327 MB. > (%o5) [[2, 1], [7, 1], [107, 1], [1679641, 1], [8255453, 1], > [152778774688461206737, 1], [315114064590027073770947, 1]] > > As you can see, it can do it in 17s, but most of the time it takes much longer. > There seems to be a clear memory-management problem. > > And there are now two Lisp's with that behaviour (Ecl and CLisp). > > Oliver > > > Maxima 5.25.1 http://maxima.sourceforge.net > > using Lisp ECL 11.1.1 > > (%i1) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > > Evaluation took 12.9080 seconds (12.9520 elapsed) > > (%o1) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > > [315114064590027073770947,1]] > > (%i2) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > > Evaluation took 121.3250 seconds (121.5850 elapsed) > > (%o2) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > > [315114064590027073770947,1]] > > (%i3) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > > Evaluation took 26.7130 seconds (26.7670 elapsed) > > (%o3) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > > [315114064590027073770947,1]] > > (%i4) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > > Evaluation took 64.2590 seconds (64.3860 elapsed) > > (%o4) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > > [315114064590027073770947,1]] > > > > Maxima 5.25.1 http://maxima.sourceforge.net > > using Lisp ECL 11.1.1 > > (%i1) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > > Evaluation took 62.0850 seconds (62.2240 elapsed) > > (%o1) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > > [315114064590027073770947,1]] > > (%i2) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > > Evaluation took 48.7650 seconds (48.8580 elapsed) > > (%o2) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > > [315114064590027073770947,1]] > > (%i3) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > > Evaluation took 115.2030 seconds (115.4290 elapsed) > > (%o3) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > > [315114064590027073770947,1]] > > > > Maxima 5.25.1 http://maxima.sourceforge.net > > using Lisp ECL 11.1.1 > > (%i1) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > > Evaluation took 6.0920 seconds (6.1730 elapsed) > > (%o1) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > > [315114064590027073770947,1]] > > (%i2) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > > Evaluation took 70.7340 seconds (70.9190 elapsed) > > (%o2) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > > [315114064590027073770947,1]] > > (%i3) ifactors(1000000000000000000000000000000000000000000000000000000000007-1); > > Evaluation took 103.8050 seconds (104.0320 elapsed) > > (%o3) [[2,1],[7,1],[107,1],[1679641,1],[8255453,1],[152778774688461206737,1], > > [315114064590027073770947,1]] > > Hi, I don't know more about the algorithms to factor integer but it seems Pollard's rho, Pollard's p-1 and elliptic curve algorithms use some kind of random search. Then it seems not so much surprising if computation time can change. Taking a look at ifactor.lisp it seems there is an undocumented switch save_primes. Maybe this can help you to speed up the things. Probably the function ifactor is not a good one to check "stability" of the underlying lisp. Hope This help. Laurent. > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From O.Kullmann at swansea.ac.uk Sat Oct 22 11:38:41 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 22 Oct 2011 17:38:41 +0100 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> Message-ID: <20111022163841.GE27744@cs-wsok.swan.ac.uk> Hi Laurent, true, I forgot about that randomness here. Setting save_primes to true seems to have no influence (or not a big influence) on run-times. Now I tried to store the Lisp-variable random-state to make the Lisp-function random reproducible, but the short documentation on "Lisp and Maxima" is very cryptic: It doesn't say explicitly how to use Lisp from Maxima, it only gives some hints. So I didn't get that working --- how can I save the variable random-state and set it later to that stored valued in a Maxima-session? Thanks for your help. Oliver P.S. I tried to use :lisp (let (var random-state)) and variations, but I got cryptic error messages. Not even (%i1) :lisp(random-state-p random-state) Maxima encountered a Lisp error: The variable RANDOM-STATE is unbound. works? Also (%i1) :lisp(random-state-p 'random-state) NIL fails (according to http://www.ida.liu.se/imported/cltl/clm/node133.html it should return true or false, and in this case it should be true). > Hi, > > I don't know more about the algorithms to factor integer but it seems Pollard's rho, Pollard's > p-1 and elliptic curve algorithms use some kind of random search. Then it seems not so much > surprising if computation time can change. > Taking a look at ifactor.lisp it seems there is an undocumented switch save_primes. > Maybe this can help you to speed up the things. > Probably the function ifactor is not a good one to check "stability" of the underlying lisp. > > Hope This help. > > Laurent. > From rswarbrick at gmail.com Sat Oct 22 12:46:02 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sat, 22 Oct 2011 18:46:02 +0100 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> Message-ID: Oliver Kullmann writes: > Not even > > (%i1) :lisp(random-state-p random-state) > > Maxima encountered a Lisp error: > > The variable RANDOM-STATE is unbound. > > works? I haven't tried to do anything useful with this, but special variables like this in Lisp tend to have names of the form *foo*. In particular: (%i1) :lisp (random-state-p *random-state*) T Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From drdieterkaiser at web.de Sat Oct 22 12:47:12 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 22 Oct 2011 19:47:12 +0200 Subject: [Maxima] integrate of bessel_i sign error? In-Reply-To: References: Message-ID: <1319305632.10145.2.camel@dieter> Am Freitag, den 21.10.2011, 14:33 -0700 schrieb Edwin Woollett: > integrate doesn't seem to give a correct value > for the integral of bessel_i, based on numerical > values Maxima uses. > > For a small integration range and a smooth > function, a rough value of the integral > is base*height. Here we use a base = 1 > integrating from y = 1 to y = 2, > and use a height the value > half way across the range: > > (%i1) load(nint); > (%o1) "c:/work2/nint.mac" > (%i2) ratprint:false$ > (%i3) f(a):= fchop(expand(float(a)))$ > > here is the height: > > (%i4) f(bessel_i(1,%i*1.5)); > (%o4) 0.5579365079101*%i > > here is the integral over a range = 1: > > (%i5) f(integrate(bessel_i(1,%i*y),y,1,2)); > (%o5) -0.54130690741673*%i > > integrate appears to produce the wrong sign > for this integral?? Yes, I think the integral of bessel_i(0,x) is wrong: (%i1) integrate(bessel_i(1,x),x); (%o1) - (bessel_i(0, x)) The correct answer should be bessel_i(0,x), see e. g. http://functions.wolfram.com/Bessel-TypeFunctions/BesselI/21/01/01/ I will correct it. Dieter Kaiser From O.Kullmann at swansea.ac.uk Sat Oct 22 13:14:13 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 22 Oct 2011 19:14:13 +0100 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> Message-ID: <20111022181413.GF27744@cs-wsok.swan.ac.uk> On Sat, Oct 22, 2011 at 06:46:02PM +0100, Rupert Swarbrick wrote: > Oliver Kullmann writes: > > Not even > > > > (%i1) :lisp(random-state-p random-state) > > > > Maxima encountered a Lisp error: > > > > The variable RANDOM-STATE is unbound. > > > > works? > > I haven't tried to do anything useful with this, but special variables > like this in Lisp tend to have names of the form *foo*. In particular: > > (%i1) :lisp (random-state-p *random-state*) > > T > Thanks! Making progress, but not there yet: Storing a new Lisp-random-state in a: (%i75) :lisp (setq a (make-random-state t)) # (%i75) :lisp (print a) # # Setting this fixed state: (%i75) :lisp (setq *random-state* a) # Random number with that state: (%i75) :lisp (random 10000) 4469 Resetting the state: (%i75) :lisp (setq *random-state* a) # Again with that state: (%i75) :lisp (random 10000) 2204 This should be 4469 again?? (%i75) :lisp (print *random-state*) # # This should have been changed now? And another oddity: (%i75) :lisp (make-random-state) # (%i75) :lisp (make-random-state) # According to http://www.ida.liu.se/imported/cltl/clm/node133.html when called without an argument, the function make-random-state should just return a copy of the variable *random-state*; nothing is mentioned from changing this variable as a side-effect?? Very strange. Hopefully somebody can explain this. Oliver From woollett at charter.net Sat Oct 22 13:53:10 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 22 Oct 2011 11:53:10 -0700 Subject: [Maxima] integrate of bessel_i sign error? Message-ID: <0A7E0BC049334231B6011496CFB4AC81@edwinc367e16bd> On Oct. 22, Dieter Kaiser wrote: >Yes, I think the integral of bessel_i(0,x) is wrong: > >(%i1) integrate(bessel_i(1,x),x); >(%o1) - (bessel_i(0, x)) > >The correct answer should be bessel_i(0,x), see e. g. >http://functions.wolfram.com/Bessel-TypeFunctions/BesselI/21/01/01/ > >I will correct it. I checked with Wolfram Alpha: A review of the integrate of bessel_i bug: (%i4) f(bessel_i(1,%i*1.5)); (%o4) 0.5579365079101*%i (%i5) f(integrate(bessel_i(1,%i*y),y,1,2)); (%o5) -0.54130690741673*%i integrate appears to produce the wrong sign for this integral?? Here is Wolfram Alpha answer: NIntegrate[BesselI[1,I*y],{y,1,2}] ----> %i*(bessel_j(0,1) - bessel_j(0,2)) -------> 0.541307 Check using maxima: (%i2) f(%i*(bessel_j(0,1) - bessel_j(0,2))); (%o2) 0.54130690741673*%i Ted From drdieterkaiser at web.de Sat Oct 22 14:19:47 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 22 Oct 2011 21:19:47 +0200 Subject: [Maxima] integrate of bessel_i sign error? In-Reply-To: <0A7E0BC049334231B6011496CFB4AC81@edwinc367e16bd> References: <0A7E0BC049334231B6011496CFB4AC81@edwinc367e16bd> Message-ID: <1319311187.10145.11.camel@dieter> Am Samstag, den 22.10.2011, 11:53 -0700 schrieb Edwin Woollett: > On Oct. 22, Dieter Kaiser wrote: > >Yes, I think the integral of bessel_i(0,x) is wrong: > > > >(%i1) integrate(bessel_i(1,x),x); > >(%o1) - (bessel_i(0, x)) > > > >The correct answer should be bessel_i(0,x), see e. g. > >http://functions.wolfram.com/Bessel-TypeFunctions/BesselI/21/01/01/ > > > >I will correct it. > > I checked with Wolfram Alpha: > > A review of the integrate of bessel_i bug: > > (%i4) f(bessel_i(1,%i*1.5)); > (%o4) 0.5579365079101*%i > (%i5) f(integrate(bessel_i(1,%i*y),y,1,2)); > (%o5) -0.54130690741673*%i > > integrate appears to produce the wrong sign > for this integral?? > > Here is Wolfram Alpha answer: > NIntegrate[BesselI[1,I*y],{y,1,2}] > > ----> %i*(bessel_j(0,1) - bessel_j(0,2)) > > -------> 0.541307 > > Check using maxima: > (%i2) f(%i*(bessel_j(0,1) - bessel_j(0,2))); > (%o2) 0.54130690741673*%i With a corrected formula for the integral of bessel_i(1,x) in Maxima I get: (%i2) integrate(bessel_i(1,%i*x),x,1,2); (%o2) %i*bessel_i(0,%i)-%i*bessel_i(0,2*%i) (%i3) %,numer; (%o3) .5413069074167309*%i The result is equivalent to (%i4) %i*(bessel_j(0,1) - bessel_j(0,2)), numer; (%o5) .5413069074167309*%i This is valid, because bessel_i(n,%i*x) = %i^n*bessel_j(n,x) for n an integer. Perhaps we should implement the this identity. Dieter Kaiser From drdieterkaiser at web.de Sat Oct 22 14:49:23 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 22 Oct 2011 21:49:23 +0200 Subject: [Maxima] bessel_y sign error with integrate? In-Reply-To: <1FDD12820BEA4E62BC1DE6AABAC89A6B@edwinc367e16bd> References: <1FDD12820BEA4E62BC1DE6AABAC89A6B@edwinc367e16bd> Message-ID: <1319312963.10145.16.camel@dieter> Am Freitag, den 21.10.2011, 15:51 -0700 schrieb Edwin Woollett: > On Oct. 21, 2011, I wrote about bessel_i integrate > sign error. Using the same session, here is an > apparent sign error when using integrate > with bessel_y(2,x) . (The reasoning is the same.) > > first the 'height' (the 'base' is unity): > > (%i23) f(bessel_y(2,4)); > (%o23) 0.21590359460361 > > (%i24) integrate (bessel_y(2,y),y,3.5,4.5); > (%o24) (46650016*%pi-292890325)/445824550-(6893566*%pi-5764575)/63526475 > (%i25) f(%); > (%o25) -0.57840103823513 > > So both sign and magnitude error apparently. I have done a correction of the implementation of the integral for bessel_y. The summation indices of the formula are not correct. Now I get: (%i1) integrate(bessel_y(2,x),x); (%o1) %pi*(struve_h(0,x)*bessel_y(1,x)+struve_h(-1,x)*bessel_y(0,x))*x/2 -2*bessel_y(1,x) (%i2) integrate(bessel_y(2,x),x,3.5,4.5), numer; (%o2) .2062014754631974 I have checked more integrals for an order n=0,1,2,3,4,5 and the formulas now appear to be correct. Dieter Kaiser From woollett at charter.net Sat Oct 22 15:39:12 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 22 Oct 2011 13:39:12 -0700 Subject: [Maxima] integrate of bessel_i sign error? References: <0A7E0BC049334231B6011496CFB4AC81@edwinc367e16bd> <1319311187.10145.11.camel@dieter> Message-ID: On Oct.22, 2011, Dieter Kaiser wrote: >With a corrected formula for the integral of bessel_i(1,x) in Maxima I >get: > >(%i2) integrate(bessel_i(1,%i*x),x,1,2); >(%o2) %i*bessel_i(0,%i)-%i*bessel_i(0,2*%i) >(%i3) %,numer; >(%o3) .5413069074167309*%i > >The result is equivalent to > >(%i4) %i*(bessel_j(0,1) - bessel_j(0,2)), numer; >(%o5) .5413069074167309*%i > >This is valid, because bessel_i(n,%i*x) = %i^n*bessel_j(n,x) for n an >integer. Perhaps we should implement the this identity. Yes, that would be nice. Thanks for looking at this. Ted From woollett at charter.net Sat Oct 22 15:44:10 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 22 Oct 2011 13:44:10 -0700 Subject: [Maxima] bessel_y sign error with integrate? References: <1FDD12820BEA4E62BC1DE6AABAC89A6B@edwinc367e16bd> <1319312963.10145.16.camel@dieter> Message-ID: <1FD26965AA084C098A29B08F8FD1DB05@edwinc367e16bd> On Oct. 22, 2011, Dieter Kaiser wrote: >I have done a correction of the implementation of the integral for >bessel_y. The summation indices of the formula are not correct. > >Now I get: > >(%i1) integrate(bessel_y(2,x),x); >(%o1) %pi*(struve_h(0,x)*bessel_y(1,x)+struve_h(-1,x)*bessel_y(0,x))*x/2 > -2*bessel_y(1,x) > >(%i2) integrate(bessel_y(2,x),x,3.5,4.5), numer; >(%o2) .2062014754631974 > >I have checked more integrals for an order n=0,1,2,3,4,5 and the >formulas now appear to be correct. Thanks again for looking at these bugs. I looked at Wolfram Alpha's symbolic answer for Integrate[BesselY[2,x],{x,a,b}] and tried it out in Maxima, where it gave the wrong sign but the right magnitude. This is curious, because their answer to NIntegrate[BesselY[2,y],{y,3.5,4.5}] *does* give both the right sign and magnitude. Ted From woollett at charter.net Sat Oct 22 16:20:07 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 22 Oct 2011 14:20:07 -0700 Subject: [Maxima] quad_qag and quad_qags fail with imagpart( bessel_i(1, %i*x)) arg Message-ID: <5D5CB1EAB59F47AF8916EFBBCF9F5277@edwinc367e16bd> For cases where integrate, numer fails, I am using either quad_qag or quad_qags for numerical integration in one dimension. I automatically split up any integrand into real and imaginary parts using realpart and imagpart, and later combine the answers. This has worked with bessel functions ok up to my testing of bessel_i(1,%i*x). (%i4) imagpart(bessel_i(1,%i)),numer; (%o4) 0.44005058574493 (%i6) quad_qag(imagpart(bessel_i(1,%i*x)),x,1,3,3,limit=700); (%o6) quad_qag(bessel_i(1,%i*x),x,1,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) (%i11) quad_qags(imagpart(bessel_i(1,%i*x)),x,1,3,limit=700); (%o11) quad_qags(bessel_i(1,%i*x),x,1,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) Since imagpart(bessel_i(1,%i*x)) is a real number, why can't quad_qag and quad_qags cope? Ted Woollett From macrakis at alum.mit.edu Sat Oct 22 16:36:21 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 22 Oct 2011 17:36:21 -0400 Subject: [Maxima] quad_qag and quad_qags fail with imagpart( bessel_i(1, %i*x)) arg In-Reply-To: <5D5CB1EAB59F47AF8916EFBBCF9F5277@edwinc367e16bd> References: <5D5CB1EAB59F47AF8916EFBBCF9F5277@edwinc367e16bd> Message-ID: There is a bug in imagpart. imagpart(bessel_i(1,%i*x)) should be -%i*bessel_i(1,%i*x), but imagpart is returning bessel_i(1,%i*x). Could you please report this -- see bug_report() for instructions. -s On Sat, Oct 22, 2011 at 17:20, Edwin Woollett wrote: > For cases where integrate, numer fails, I am using > either quad_qag or quad_qags for numerical integration > in one dimension. > > I automatically split up any integrand into real and > imaginary parts using realpart and imagpart, and > later combine the answers. > > This has worked with bessel functions ok up to > my testing of bessel_i(1,%i*x). > > (%i4) imagpart(bessel_i(1,%i)),**numer; > (%o4) 0.44005058574493 > > (%i6) quad_qag(imagpart(bessel_i(1,%**i*x)),x,1,3,3,limit=700); > (%o6) quad_qag(bessel_i(1,%i*x),x,1,**3,3,epsrel = 1.0E-8,epsabs = 0.0, > limit = 700) > > (%i11) quad_qags(imagpart(bessel_i(1,**%i*x)),x,1,3,limit=700); > (%o11) quad_qags(bessel_i(1,%i*x),x,**1,3,epsrel = 1.0E-8,epsabs = 0.0, > limit = 700) > > Since imagpart(bessel_i(1,%i*x)) is a real number, why can't > quad_qag and quad_qags cope? > > 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 smh at franz.com Sat Oct 22 16:44:05 2011 From: smh at franz.com (Steve Haflich) Date: Sat, 22 Oct 2011 14:44:05 -0700 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: <20111022181413.GF27744@cs-wsok.swan.ac.uk> References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> Message-ID: <18966.1319319845@gemini.franz.com> Oiliver -- Maxima currently runs on top of Common Lisp as its implementation language (despite Maxima's insistance on calling it "Lisp" nearly everywhere, dishonoring McCarthy's request that "Lisp" be used to denote this large family of languages, not any specific dialect such as "Common Lisp"). That's what Maxima's lisp operator invokes. You need to learn about the behavior of random on Common Lisp to understand what you are seeing. It would be silly to waste the time of members of the maxima list to compose explanations of what is well described in the ANS for Common Lisp. The most accessible (free) version of the ANS is available at http://www.lispworks.com/documentation/HyperSpec/Front/index.htm Please see the entires for random, random-state, *random-state*, and copy-random-state. That should explain everything. From drdieterkaiser at web.de Sat Oct 22 16:45:17 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 22 Oct 2011 23:45:17 +0200 Subject: [Maxima] quad_qag and quad_qags fail with imagpart( bessel_i(1, %i*x)) arg In-Reply-To: <5D5CB1EAB59F47AF8916EFBBCF9F5277@edwinc367e16bd> References: <5D5CB1EAB59F47AF8916EFBBCF9F5277@edwinc367e16bd> Message-ID: <1319319917.21755.9.camel@dieter> Am Samstag, den 22.10.2011, 14:20 -0700 schrieb Edwin Woollett: > For cases where integrate, numer fails, I am using > either quad_qag or quad_qags for numerical integration > in one dimension. > > I automatically split up any integrand into real and > imaginary parts using realpart and imagpart, and > later combine the answers. > > This has worked with bessel functions ok up to > my testing of bessel_i(1,%i*x). > > (%i4) imagpart(bessel_i(1,%i)),numer; > (%o4) 0.44005058574493 > > (%i6) quad_qag(imagpart(bessel_i(1,%i*x)),x,1,3,3,limit=700); > (%o6) quad_qag(bessel_i(1,%i*x),x,1,3,3,epsrel = 1.0E-8,epsabs = 0.0, > limit = 700) > > (%i11) quad_qags(imagpart(bessel_i(1,%i*x)),x,1,3,limit=700); > (%o11) quad_qags(bessel_i(1,%i*x),x,1,3,epsrel = 1.0E-8,epsabs = 0.0, > limit = 700) > > Since imagpart(bessel_i(1,%i*x)) is a real number, why can't > quad_qag and quad_qags cope? The reason is, that Maxima knows symbolically that bessel_i(1,%i*x) is a pure imaginary. Therefore the imagpart automatically simplifies: (%i1) imagpart(bessel_i(1,%i*x)); (%o1) bessel_i(1, %i x) But unfortunately because of rounding errors Maxima gets a small realpart when evaluating the function numerically. (%i3) imagpart(bessel_i(1,%i)); (%o3) bessel_i(1, %i) (%i4) %,numer; (%o4) .4400505857449336 %i + 2.694443716532522e-17 At some places of the code for the Bessel functions the numerical routines takes care of this small contributions, but not for bessel_i. I will have a look at this problem. A workaround is to use an order, which is a floating point number. Maxima only simplifies for an integer order. (%i1) imagpart(bessel_i(1.0,%i*x)); (%o1) imagpart(bessel_i(1.0, %i x)) (%i2) quad_qag(imagpart(bessel_i(1.0,%i*x)),x,1,3,3,limit=700); (%o2) [1.0252496414599, 1.138255757937468e-14, 31, 0] Dieter Kaiser From drdieterkaiser at web.de Sat Oct 22 17:01:52 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 23 Oct 2011 00:01:52 +0200 Subject: [Maxima] quad_qag and quad_qags fail with imagpart( bessel_i(1, %i*x)) arg In-Reply-To: References: <5D5CB1EAB59F47AF8916EFBBCF9F5277@edwinc367e16bd> Message-ID: <1319320912.21755.15.camel@dieter> Am Samstag, den 22.10.2011, 17:36 -0400 schrieb Stavros Macrakis: > There is a bug in imagpart. imagpart(bessel_i(1,%i*x)) should be -% > i*bessel_i(1,%i*x), but imagpart is returning bessel_i(1,%i*x). > > > Could you please report this -- see bug_report() for instructions. Yes, this is a bug. Dieter Kaiser From macrakis at alum.mit.edu Sat Oct 22 17:06:22 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 22 Oct 2011 18:06:22 -0400 Subject: [Maxima] quad_qag and quad_qags fail with imagpart( bessel_i(1, %i*x)) arg In-Reply-To: <1319319917.21755.9.camel@dieter> References: <5D5CB1EAB59F47AF8916EFBBCF9F5277@edwinc367e16bd> <1319319917.21755.9.camel@dieter> Message-ID: On Sat, Oct 22, 2011 at 17:45, Dieter Kaiser wrote: > ...The reason is, that Maxima knows symbolically that bessel_i(1,%i*x) is a > pure imaginary. Therefore the imagpart automatically simplifies: > > (%i1) imagpart(bessel_i(1,%i*x)); > (%o1) bessel_i(1, %i x) > ... Yes, b: bessel_i(1,%i*x) is pure imaginary. But the *imagpart* is real, namely b/%i = -%i*b. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Sat Oct 22 17:14:13 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 22 Oct 2011 15:14:13 -0700 Subject: [Maxima] quad_qag and quad_qags fail with imagpart( bessel_i(1, %i*x)) arg Message-ID: On Oct. 22, Dieter Kaiser wrote: ---------------------- >But unfortunately because of rounding errors Maxima gets a small >realpart when evaluating the function numerically. > >(%i3) imagpart(bessel_i(1,%i)); >(%o3) bessel_i(1, %i) >(%i4) %,numer; >(%o4) .4400505857449336 %i + 2.694443716532522e-17 > >At some places of the code for the Bessel functions the numerical >routines takes care of this small contributions, but not for bessel_i. I >will have a look at this problem. > >A workaround is to use an order, which is a floating point number. >Maxima only simplifies for an integer order. > >(%i1) imagpart(bessel_i(1.0,%i*x)); >(%o1) imagpart(bessel_i(1.0, %i x)) >(%i2) quad_qag(imagpart(bessel_i(1.0,%i*x)),x,1,3,3,limit=700); >(%o2) [1.0252496414599, 1.138255757937468e-14, 31, 0] ------------------------------------------ Thanks for the info. Your method of using 2.0 instead of 2 for the order of the bessel function works for me on a "one off" basis: (%i34) quad_qags(imagpart(bessel_i(1.0,%i*x)),x,1,3,limit=700); (%o34) [1.0252496414599,1.1382557579374678E-14,21,0] (%i35) quad_qag(imagpart(bessel_i(1.0,%i*x)),x,1,3,3,limit=700); (%o35) [1.0252496414599,1.1382557579374679E-14,31,0] but for an automated version of nintegrate, it would be painful to have to replace the integers by floats in the args of an arbitrarily complicated expression. A better workaround for my purposes is to use my fchop function from the ch. 9 software: quad_qag(fchop(imagpart(bessel_i(1.0,%i*x))),x,1,3,3,limit=700); (%o36) [1.0252496414599,1.1382557579374679E-14,31,0] (%i37) quad_qags(fchop(imagpart(bessel_i(1.0,%i*x))),x,1,3,limit=700); (%o37) [1.0252496414599,1.1382557579374678E-14,21,0] Ted From woollett at charter.net Sat Oct 22 18:16:03 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 22 Oct 2011 16:16:03 -0700 Subject: [Maxima] quad_qag and quad_qags fail with imagpart( bessel_i(1, %i*x)) arg References: <5D5CB1EAB59F47AF8916EFBBCF9F5277@edwinc367e16bd> Message-ID: <083F65CEF0F840BC82A2981CCF925258@edwinc367e16bd> On Oct. 22, 2011, Stavros Macrakis wrote: ------------------------- >There is a bug in imagpart. imagpart(bessel_i(1,%i*x)) should >be -%i*bessel_i(1,%i*x), but imagpart is >returning bessel_i(1,%i*x). > >Could you please report this -- see bug_report() for instructions. ----------------------------- Yes, I will report this. Thanks for the feedback. Ted From O.Kullmann at swansea.ac.uk Sat Oct 22 18:14:23 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 23 Oct 2011 00:14:23 +0100 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: <18966.1319319845@gemini.franz.com> References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> <18966.1319319845@gemini.franz.com> Message-ID: <20111022231423.GG27744@cs-wsok.swan.ac.uk> Dear Steve, On Sat, Oct 22, 2011 at 02:44:05PM -0700, Steve Haflich wrote: > Oiliver -- > > Maxima currently runs on top of Common Lisp as its implementation > language (despite Maxima's insistance on calling it "Lisp" nearly > everywhere, dishonoring McCarthy's request that "Lisp" be used to denote > this large family of languages, not any specific dialect such as "Common > Lisp"). That's what Maxima's lisp operator invokes. You need to learn > about the behavior of random on Common Lisp to understand what you are > seeing. It would be silly to waste the time of members of the maxima > list to compose explanations of what is well described in the ANS for > Common Lisp. I definitely do not think it would be silly to answer my question --- would I have otherwise asked my question? > > The most accessible (free) version of the ANS is available at > http://www.lispworks.com/documentation/HyperSpec/Front/index.htm Please > see the entires for random, random-state, *random-state*, and > copy-random-state. That should explain everything. Unfortunately, this doesn't say more than what I have already cited. The code which I have supplied seems to fulfil the description, and thus it would be helpful, for me and other readers, to just say in what sense the sequence of commands I gave misunderstands the spirit of Lisp. The only information seems to be that example at http://www.lispworks.com/documentation/HyperSpec/Body/v_rnd_st.htm#STrandom-stateST Okay, let's enter it: (%i1) :lisp (random-state-p *random-state*) T (%i1) :lisp (setq snap-shot (make-random-state)) # (%i1) :lisp (list (loop for i from 1 to 10 collect (random)) (let ((*random-state* snap-shot)) (loop for i from 1 to 10 collect (random))) (loop for i from 1 to 10 collect (random)) (let ((*random-state* snap-shot)) (loop for i from 1 to 10 collect (random)))) Maxima encountered a Lisp error: In form (LISP-EVAL (LIST (LOOP FOR I FROM 1 TO 10 COLLECT (RANDOM)) (LET ((*RANDOM-STATE* SNAP-SHOT)) (LOOP FOR I FROM 1 TO 10 COLLECT (RANDOM))) (LOOP FOR I FROM 1 TO 10 COLLECT (RANDOM)) (LET ((*RANDOM-STATE* SNAP-SHOT)) (LOOP FOR I FROM 1 TO 10 COLLECT (RANDOM))))) Wrong number of arguments passed to function RANDOM. This doesn't look completely trivial to me, and I think the purpose of such mailing lists is to look at such things. (This example is a typical example of bad examples given in such contexts: nothing is explicitly said, only hinted at, and to understand just a single specific point one needs to waste time to understand other things, and so on ...) To help Maxima (and my group, of course) to overcome the very specific and rather drastic efficiency problems (where finally this example might not really help, but that is to be investigated), I should not need to go into details of Lisp. I do not think that using Maxima should require understanding Lisp. Sure, one should make attempts, as I did, but Maxima sits on *top* of Lisp, replacing Lisp --- Maxima is its own language. Oliver From robert.dodier at gmail.com Sat Oct 22 19:52:37 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 22 Oct 2011 18:52:37 -0600 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: <18966.1319319845@gemini.franz.com> References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> <18966.1319319845@gemini.franz.com> Message-ID: On 10/22/11, Steve Haflich wrote: > It would be silly to waste the time of members of the maxima > list to compose explanations of what is well described in the ANS for > Common Lisp. With all due respect, there certainly isn't anything silly about it. Of course, everyone is free to ignore any request that doesn't interest them. best Robert Dodier From robert.dodier at gmail.com Sat Oct 22 20:16:28 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 22 Oct 2011 19:16:28 -0600 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: <20111022231423.GG27744@cs-wsok.swan.ac.uk> References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> <18966.1319319845@gemini.franz.com> <20111022231423.GG27744@cs-wsok.swan.ac.uk> Message-ID: On 10/22/11, Oliver Kullmann wrote: > The only information seems to be that example at > http://www.lispworks.com/documentation/HyperSpec/Body/v_rnd_st.htm#STrandom-stateST > Okay, let's enter it: > In form > (LISP-EVAL > (LIST (LOOP FOR I FROM 1 TO 10 COLLECT (RANDOM)) > (LET ((*RANDOM-STATE* SNAP-SHOT)) > (LOOP FOR I FROM 1 TO 10 COLLECT (RANDOM))) > (LOOP FOR I FROM 1 TO 10 COLLECT (RANDOM)) > (LET ((*RANDOM-STATE* SNAP-SHOT)) > (LOOP FOR I FROM 1 TO 10 COLLECT (RANDOM))))) > Wrong number of arguments passed to function RANDOM. Heh, that's a good one. RANDOM takes a least one argument, namely an upper bound. best Robert Dodier From O.Kullmann at swansea.ac.uk Sat Oct 22 21:13:02 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 23 Oct 2011 03:13:02 +0100 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: <1319331447.32267.22.camel@ubuntu> References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> <18966.1319319845@gemini.franz.com> <20111022231423.GG27744@cs-wsok.swan.ac.uk> <1319331447.32267.22.camel@ubuntu> Message-ID: <20111023021302.GH27744@cs-wsok.swan.ac.uk> Hi Bill, > ==================================================================== > > As described, LIMIT is a required argument and RANDOM-STATE is an > optional argument. The error message in your post said "Wrong number of > arguments passed to function RANDOM.", which could have been more > explicit by mentioning the number of arguments that are required. > > Here is a transcript of a session in SBCL, a free implementation of > Common Lisp: > I think I understand (basically) the syntax now -- thanks! However, the semantics I still don't understand: The original problem was to make a Maxima-function, which uses the Lisp random-function, reproducible, that is, perform the same call under the same circumstances at least twice, so that time and memory consumption for the two calls can be measured. However, with each invocation of :lisp seems to start a fresh environment, unrelated to the invocation before, so that between two Maxima-calls apparently no relation can be established between the calls of random??: (%i447) :lisp (setq ss *random-state*) # (%i447) :lisp (setq ss2 *random-state*) # (%i447) :lisp (equal ss ss2) T (%i447) :lisp (random 1000 ss) 808 (%i447) :lisp (random 1000 ss2) 57 (%i447) :lisp (equal ss ss2) T Either ss is not equal ss2, or random has hidden parameters --- but the point of the second parameter should be exactly to exclude hidden parameters? If I understand the previous example correctly (that with the syntax error), then one had some control over function random within a single call of :lisp (however also in that example I don't understand the semantics), but as the above seems to show, between different invocations of :lisp something changes?? Perhaps one shouldn't consider variable *random-state* directly, only via make-random-state? However also then everything breaks: (%i447) :lisp (setq ss (make-random-state t)) # (%i447) :lisp (setq ss2 (make-random-state ss)) # (%i447) :lisp (equal ss ss2) NIL The documentation says make-random-state when called with a state creates a copy. But apparently it doesn't do so? Perhaps variables need to be declared before? ) :lisp (defvar *ss* (make-random-state t)) *SS* (%i447) :lisp (defvar *ss2* (make-random-state *ss*)) *SS2* (%i447) :lisp (equal *ss* *ss2*) NIL Or defining a constant? (%i447) :lisp (defconstant ss (make-random-state t)) SS (%i447) :lisp (defconstant ss2 (make-random-state ss)) SS2 (%i447) :lisp (equal ss ss2) NIL It seems the Lisp binding-and-interpretation mechanism is undefeatable --- no chance to get it to do some reasonable ... Perhaps the fundamental problem is that the Lisp-documentations you find on the Internet do not consider the two levels we have in Maxima: the Maxima outer level and the Lisp inner level?? Sigh. Oliver From smh at franz.com Sat Oct 22 22:36:04 2011 From: smh at franz.com (Steve Haflich) Date: Sat, 22 Oct 2011 20:36:04 -0700 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> <18966.1319319845@gemini.franz.com> Message-ID: <27750.1319340964@gemini.franz.com> Robert Dodier wrote: On 10/22/11, Steve Haflich wrote: > It would be silly to waste the time of members of the maxima > list to compose explanations of what is well described in the ANS for > Common Lisp. With all due respect, there certainly isn't anything silly about it. Of course, everyone is free to ignore any request that doesn't interest them. Huh? I did _not_ ignore the request. I responded, giving information where to find the needed information. Unfortunately, I miswrote the function name copy-random-state instead of make-random-state. There are examples on the make-random-state documentation page which directly address Olivier's apparent misunderstanding. (Olivier, please look again.) What would be silly, I repeat, is for others to spend time writing new explanatory material when there already exist good references. My point is that Olivier should know about those references and consult them first. That's more efficient both for him and for everyone else. But Robert, your response gives me an opening to flame a little about Maxima. (Anyone with any taste should stop reading now.) About forty years ago I attended that first large public lecture by Joel Moses in MIT room 10-250 which exposed the Macsyma project to the larger community. (I suspect rjf was present as well, but I did not become acquainted with him until fifteen years later.) I had previously worked on IBM's FORMAC a few years, so the much-greater potential of MACSYMA was _exciting_! But we all know what a mess MIT and Symbolics and DOE eventually made of it. That's all ancient history, but I have a modern issue. The language of MACSYMA/MAXIMA grew up about 40 years ago. The start of "computer science" was only about 55 years ago. (This is defined arbitrarily as the time the first human sat up from Vonnegut's primordial slime (q.v. _Cat's Cradle_) and said "Wait! I am not a mathematician. I am a COMPUTER SCIENTIST!") I'm a rather inadequate mathematician, more a computer linguist, but my observation is that too much of the turbulence in current Maxima usage derives from the specious syntax, scoping, and semantics in the Maxima language. Computer technology has learned a lot about effective syntax and semantics of computer languages in the past 2/3 of its history, but Maxima has not, being frozen in time. Now, the Macsyma language was properly designed to be comfortable to mathematician and engineers, but that design has not aged well. If I were to give advice to the Maxima community (of which I hardly consider myself a member) I would say that reconsidering the design of the language would be the most important aspect if one wanted to give Maxima a long lifetime. I would not expect the Maxima community to take my advice seriously, in fact, I do not consider it (given the circumstances on the ground) to be particularly wise advice because taking it would be too disruptive. From fateman at eecs.berkeley.edu Sat Oct 22 22:46:11 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 22 Oct 2011 20:46:11 -0700 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: <27750.1319340964@gemini.franz.com> References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> <18966.1319319845@gemini.franz.com> <27750.1319340964@gemini.franz.com> Message-ID: <4EA38E03.8040308@eecs.berkeley.edu> On 10/22/11 8:36 PM, Steve Haflich wrote: > > I would not expect the Maxima community to take my advice seriously, in > fact, I do not consider it (given the circumstances on the ground) to be > particularly wise advice because taking it would be too disruptive. > _______________________________________________ It would be possible to define a new top-level Maxima language syntax and semantics mostly re-using existing stuff, though with some glitches. A new language could be designed with a variety of "modern" features. Packages. Objects. Lexical scope. etc. To avoid disruption, the old language could still be there. Interestingly, in the transition from Maclisp (and Franz Lisp) to Common Lisp, the underpinnings of Maxima were necessarily transferred from a language with dynamic scope to one with lexical scope (by default, anyway). I would not say it was done gracefully, but it was done. Yet the Maxima top level language retained dynamic scope. RJF From rswarbrick at gmail.com Sun Oct 23 06:48:09 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sun, 23 Oct 2011 12:48:09 +0100 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> <18966.1319319845@gemini.franz.com> <20111022231423.GG27744@cs-wsok.swan.ac.uk> <1319331447.32267.22.camel@ubuntu> <20111023021302.GH27744@cs-wsok.swan.ac.uk> Message-ID: Oliver Kullmann writes: > However, with each invocation of :lisp seems to start a fresh > environment, unrelated to the invocation before, so that between two > Maxima-calls apparently no relation can be established between the > calls of random??: > > (%i447) :lisp (setq ss *random-state*) > # > (%i447) :lisp (setq ss2 *random-state*) > # > (%i447) :lisp (equal ss ss2) > T > (%i447) :lisp (random 1000 ss) > 808 > (%i447) :lisp (random 1000 ss2) > 57 > (%i447) :lisp (equal ss ss2) > T If you're happy with C-like languages, the best thing is to think that ss and ss2 are like pointers to a (complicated) structure, which is also pointed to by *random-state*. Thus your two calls to random are exactly the same as if you'd called (random 1000 ss) twice. In common lisp, equality is a funny thing. You probably meant to use EQUAL-P here rather than EQUAL, but in fact you'll definitely get T every time because ss and ss2 are just pointing to the same structure. See this transcript for a way to do what I think you want: Maxima 5.25post http://maxima.sourceforge.net using Lisp SBCL 1.0.52.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) :lisp (defvar *ss1* (make-random-state t)) *SS1* (%i1) :lisp (defvar *ss2* (make-random-state t)) *SS2* (%i1) :lisp (setf *random-state* *ss1*) *** output flushed *** (I'm throwing away the output because it's big) (%i1) :lisp (defvar *frozen-ss1* (make-random-state nil)) *FROZEN-SS1* (%i1) :lisp (eq *ss1* *frozen-ss1*) NIL (%i1) :lisp (equalp *ss1* *frozen-ss1*) T (This shows that the contents of *ss1* and *frozen-ss1* are the same (as you'd expect since *frozen-ss1* is supposed to be a copy of *ss1*). But eq returns NIL, since they aren't in the same place in memory. As a result when we run the next lines, *ss1* changes but *frozen-ss1* doesn't). (%i1) :lisp (random 10) 3 (%i1) :lisp (random 10) 6 (%i1) :lisp (random 10) 5 (%i1) :lisp (random 10) 7 (%i1) :lisp (setf *random-state* *frozen-ss1*) *** output flushed *** (%i1) :lisp (random 10) 3 (%i1) :lisp (random 10) 6 (%i1) :lisp (random 10) 5 (%i1) :lisp (random 10) 7 (%i1) (Finally, let's check that *ss2* is just completely different.) (%i1) :lisp (setf *random-state* *ss2*) *** output flushed *** (%i1) :lisp (random 10) 8 (%i1) :lisp (random 10) 9 (%i1) :lisp (random 10) 5 (%i1) :lisp (random 10) 8 Tada! I hope this clears things up for you to some extent. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From O.Kullmann at swansea.ac.uk Sun Oct 23 07:28:59 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 23 Oct 2011 13:28:59 +0100 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> <18966.1319319845@gemini.franz.com> <20111022231423.GG27744@cs-wsok.swan.ac.uk> <1319331447.32267.22.camel@ubuntu> <20111023021302.GH27744@cs-wsok.swan.ac.uk> Message-ID: <20111023122859.GI27744@cs-wsok.swan.ac.uk> Hi Rupert, Thanks a lot! I'm actually aware of copy-semantics versus reference-semantics (at least I should --- I teach such things ;-)), and where an example for a "copy-based" language is C++ (the default is to think "copy"), while an example for a "reference-based" language is Java (the default is to think "reference"). My mistake was just that I implicitly assumed that Lisp would be copy-based, however it is reference-based! So I assumed the default would be to copy, and for referencing/dereferencing special operators would be used, while it is the opposite: the default is to handle references, and for copying special operators are used. Now that all becomes clear to me. It was that implicit assumption which I carried around about Lisp (in Maxima the distinction is rather blurred --- it has a lot of copy-semantics in it, and thus likely I got that impression), and that together with all the other problems (unknowns) created the confusion. Thanks! Oliver P.S. In another reply I'll use a slightly different way of storing the random-state, which a find a bit nicer. P.S.P.S. A meta-remark: I think top-posting in such e-mail replies is the best way to handle it: the nice examples below are now clear, and the reply refers to the whole thing. On Sun, Oct 23, 2011 at 12:48:09PM +0100, Rupert Swarbrick wrote: > Oliver Kullmann writes: > > However, with each invocation of :lisp seems to start a fresh > > environment, unrelated to the invocation before, so that between two > > Maxima-calls apparently no relation can be established between the > > calls of random??: > > > > (%i447) :lisp (setq ss *random-state*) > > # > > (%i447) :lisp (setq ss2 *random-state*) > > # > > (%i447) :lisp (equal ss ss2) > > T > > (%i447) :lisp (random 1000 ss) > > 808 > > (%i447) :lisp (random 1000 ss2) > > 57 > > (%i447) :lisp (equal ss ss2) > > T > > If you're happy with C-like languages, the best thing is to think that > ss and ss2 are like pointers to a (complicated) structure, which is also > pointed to by *random-state*. > > Thus your two calls to random are exactly the same as if you'd called > (random 1000 ss) twice. > > In common lisp, equality is a funny thing. You probably meant to use > EQUAL-P here rather than EQUAL, but in fact you'll definitely get T > every time because ss and ss2 are just pointing to the same structure. > > See this transcript for a way to do what I think you want: > > Maxima 5.25post http://maxima.sourceforge.net > using Lisp SBCL 1.0.52.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) :lisp (defvar *ss1* (make-random-state t)) > > *SS1* > (%i1) :lisp (defvar *ss2* (make-random-state t)) > > *SS2* > (%i1) :lisp (setf *random-state* *ss1*) > *** output flushed *** > > (I'm throwing away the output because it's big) > > (%i1) :lisp (defvar *frozen-ss1* (make-random-state nil)) > > *FROZEN-SS1* > (%i1) :lisp (eq *ss1* *frozen-ss1*) > > NIL > (%i1) :lisp (equalp *ss1* *frozen-ss1*) > > T > > (This shows that the contents of *ss1* and *frozen-ss1* are the same (as > you'd expect since *frozen-ss1* is supposed to be a copy of *ss1*). But > eq returns NIL, since they aren't in the same place in memory. As a > result when we run the next lines, *ss1* changes but *frozen-ss1* doesn't). > > (%i1) :lisp (random 10) > > 3 > (%i1) :lisp (random 10) > > 6 > (%i1) :lisp (random 10) > > 5 > (%i1) :lisp (random 10) > > 7 > (%i1) :lisp (setf *random-state* *frozen-ss1*) > *** output flushed *** > (%i1) :lisp (random 10) > > 3 > (%i1) :lisp (random 10) > > 6 > (%i1) :lisp (random 10) > > 5 > (%i1) :lisp (random 10) > > 7 > (%i1) > > (Finally, let's check that *ss2* is just completely different.) > > (%i1) :lisp (setf *random-state* *ss2*) > *** output flushed *** > (%i1) :lisp (random 10) > > 8 > (%i1) :lisp (random 10) > > 9 > (%i1) :lisp (random 10) > > 5 > (%i1) :lisp (random 10) > > 8 > > > > Tada! I hope this clears things up for you to some extent. > > Rupert From O.Kullmann at swansea.ac.uk Sun Oct 23 07:52:28 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 23 Oct 2011 13:52:28 +0100 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: <1319347353.27144.8.camel@ubuntu> References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> <18966.1319319845@gemini.franz.com> <20111022231423.GG27744@cs-wsok.swan.ac.uk> <1319331447.32267.22.camel@ubuntu> <20111023021302.GH27744@cs-wsok.swan.ac.uk> <1319347353.27144.8.camel@ubuntu> Message-ID: <20111023125228.GJ27744@cs-wsok.swan.ac.uk> Hi Bill, thanks a lot! That became clear now. (As explained in my other e-mail, I assumed Lisp would be based on copy-semantics. Again, I just top-post here, since the examples are clear now.) 1. What seems the nicest way to store a state of the random generator and to re-install that state (several times) is perhaps the following: :lisp (defvar s (make-random-state)) for storing it, and :lisp (setq *random-state* (make-random-state s)) for setting it (using the copy-mode of make-random-state). 2. Now back to the original problem: Tested in that way, ifactors behaves stable over several consecutive invocation (using the same random "seed"). So no "crazy fluctuation" here. So, actually unfortunately, that wasn't a nice-and-easy examples of the problems we encounter with Maximal slowing down (drastically). But perhaps the fluctuation for ifactors are too much (between 6 seconds and 10 minutes!), and one might be able to improve the implementation. 3. Regarding the thoughts on the general design of Maxima: From my point of view, I don't have principle problems with Maxima (except that namespaces would be really nice, and having *additionally* statically scoped variables would likely remove quite some problems). I think what is needed is a section on the general principles of Maxima and Lisp in the documention, which emphasises general issues like copy- versus reference-semantics. I think it's mainly a documentation issue. One should spend some time on programming issues and their documentation, while most Maxima documentation efforts seem to go into the mathematical side. This also has the side-effect of making examples sometimes too complicated. I don't think the Maxima examples in the documentation are as bad as the R-examples (I believe I never ever could use any example in the R-documentation --- to just see how simplest programming-parameters are involved, always complicated examples from statistics are used), but there is also the tendency to use differentiation, integration, solution of equations and so on at places where the topic is just general programming techniques and data structures. Thanks a lot for all the help! Oliver On Sun, Oct 23, 2011 at 12:22:33AM -0500, Bill Wood wrote: > On Sun, 2011-10-23 at 03:13 +0100, Oliver Kullmann wrote: > . . . > > However, with each invocation of :lisp seems to start a fresh > environment, > > unrelated to the invocation before, so that between two Maxima-calls > apparently > > no relation can be established between the calls of random??: > > > (%i447) :lisp (setq ss *random-state*) > > # > > (%i447) :lisp (setq ss2 *random-state*) > > # > > (%i447) :lisp (equal ss ss2) > > T > > (%i447) :lisp (random 1000 ss) > > 808 > > (%i447) :lisp (random 1000 ss2) > > 57 > > (%i447) :lisp (equal ss ss2) > > T > > Lisp doesn't copy structured objects unless asked. The two SETQ forms > created two references to the same structured object, the one bound to > *random-state*. When RANDOM is called on SS the side-effect change to > the state object will be visible to SS2. You can use the lisp predicate > EQ to test if two variables reference the same object. Here is the > example on my system: > > (%i1) :lisp (defvar ss *random-state*) > > SS > (%i1) :lisp (defvar ss2 *random-state*) > > SS2 > (%i1) :lisp (eq ss ss2) > > T > (%i1) :lisp (random 1000 ss) > > 308 > (%i1) :lisp (random 1000 ss2) > > 465 > (%i1) :lisp (eq ss ss2) > > T > > Again the calls to RANDOM using SS and SS2 yield different values, but > the applications of EQ show the two variables reference the same object > both before and after the two calls. Here is another example of > sharing, this time with a simple list: > > (%i1) :lisp (defvar x (list 1 2)) > > X > (%i1) :lisp (defvar y x) > > Y > (%i1) :lisp (list x y) > > ((1 2) (1 2)) > (%i1) :lisp (setf (first x) 99) > > 99 > (%i1) :lisp (list x y) > > ((99 2) (99 2)) > > The form "(setf (first x) 99)" reaches into the list x and sets its > first element to 99. As you can see, after that statement both x and y > see the list with its first element equal to 99. > > You are correct, the way to get two copies of *random-state* is to use > MAKE-RANDOM-STATE: > > (%i1) :lisp (defvar s (make-random-state)) > > S > (%i1) :lisp (defvar s2 (make-random-state)) > > S2 > (%i1) :lisp (eq s s2) > > NIL > (%i1) :lisp (equalp s s2) > > T > (%i1) :lisp (random 1000 s2) > > 669 > (%i1) :lisp (random 1000 s) > > 669 > (%i1) :lisp (equalp s s2) > > T > > Now EQ returns NIL, indicating that S and S2 are bound to two different > objects, but the predicate EQUALP, which is used to test whether two > values are structurally equivalent, shows the two states are equivalent. > Now the two calls to RANDOM return the same values, as desired, and > again EQUALP shows the two states are equivalent after each has been > side-effected once. > > Hope this helps. > > -- > Bill Wood From fateman at eecs.berkeley.edu Sun Oct 23 09:25:15 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 23 Oct 2011 07:25:15 -0700 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: <20111023125228.GJ27744@cs-wsok.swan.ac.uk> References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> <18966.1319319845@gemini.franz.com> <20111022231423.GG27744@cs-wsok.swan.ac.uk> <1319331447.32267.22.camel@ubuntu> <20111023021302.GH27744@cs-wsok.swan.ac.uk> <1319347353.27144.8.camel@ubuntu> <20111023125228.GJ27744@cs-wsok.swan.ac.uk> Message-ID: <4EA423CB.8040401@eecs.berkeley.edu> I fully expect large discrepancies between lisps on long-run-time tasks based on different implementations of storage allocation (garbage collection). Relatively short runs coupled with relatively large physical random-access memory mask the differences between GCs. For people with 4GB + computers and jobs that complete in an hour of CPU time at 2.5GHz, it may not matter at all. For jobs that fill up memory and run at "disk" speed because of page faults to disk, there may be huge discrepancies (1000X) if a better GC avoids these faults. In principle, "conservative" GCs can leave a lot of memory unusable (though I don't know if Maxima usage might cause this); GCs that do not "copy" can leave memory fragmented, etc. (There are treatises written on GC, e.g by Paul Wilson). Just googling for GC and ECL, SBCL, GCL suggests that ECL is more likely to lose than SBCL. I am unclear on the GCL situation -- it says "stratified" conservative garbage collection. The commercial Lisp systems treat GC as a serious issue and likely have a performance advantage for jobs that might run essentially indefinitely. I personally rarely run Maxima for more than a few CPU minutes. RJF From rswarbrick at gmail.com Sun Oct 23 09:33:40 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sun, 23 Oct 2011 15:33:40 +0100 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> <18966.1319319845@gemini.franz.com> <20111022231423.GG27744@cs-wsok.swan.ac.uk> <1319331447.32267.22.camel@ubuntu> <20111023021302.GH27744@cs-wsok.swan.ac.uk> <20111023122859.GI27744@cs-wsok.swan.ac.uk> Message-ID: Oliver Kullmann writes: > P.S.P.S. A meta-remark: I think top-posting in such e-mail replies is > the best way to handle it: the nice examples below are now clear, and > the reply refers to the whole thing. Well, I disagree. Anyway, that's OT. 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 Sun Oct 23 09:52:15 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sun, 23 Oct 2011 15:52:15 +0100 Subject: [Maxima] float of struve_h functions? References: <86D8F910F08E46338EC7E9AE3A5531B4@edwinc367e16bd> <1319140821.1720.15.camel@dieter> Message-ID: How about something like the following? Dieter Kaiser writes: > This is the German documentation of struve_h: > > -- Funktion: struve_h (, ) > Die Struve-Funktion H der Ordnung v mit dem Argument z. Siehe > Abramowitz und Stegun, Handbook of Mathematical Functions, Kapitel > 12. Die Definition ist > > inf > ==== k 2 k > z v + 1 \ (- 1) z > H (z) = (-) > ---------------------------------- > v 2 / 2 k 3 3 > ==== 2 gamma(k + -) gamma(v + k + -) > k = 0 2 2 > > Die Struve-Funktion `struve_h' ist f?r das numerische und > symbolische Rechnen geeignet. Im Unterschied zu den > Bessel-Funktionen ist jedoch die Implementation der Funktion > `struve_h' weniger vollst?ndig. > > Maxima berechnet `struve_h' numerisch f?r reelle und komplexe > Gleitkommazahlen als Argumente f?r v und z. Mit der Funktion > `float' oder der Optionsvariablen `numer' kann die numerische > Auswertung erzwungen werden, wenn die Argumente Zahlen sind. > > Hat die Optionsvariable `besselexpand' den Wert `true', wird die > Struve-Funktion `struve_h' mit einer halbzahligen Ordnung v als > Sinus- und Kosinusfunktionen entwickelt. > > Maxima kennt die Ableitung der Struve-Funktion `struve_h' nach dem > Argument z. > > Siehe auch die Struve-Funktion `struve_l'. > > Beispiele: > .... -- Function: struve_h (, ) The Struve function, H, of order v with argument z. See Abramowitz and Stegun, Handbook of Mathematical Functions, chapter 12. The definition is inf ==== k 2 k z v + 1 \ (- 1) z H (z) = (-) > ---------------------------------- v 2 / 2 k 3 3 ==== 2 gamma(k + -) gamma(v + k + -) k = 0 2 2 The Struve function `struve_h' is suitable for both numerical and symbolic calculations. The implementation of `struve_h' is not currently as complete as that for the Bessel functions. Maxima can find numerical values for `struve_h' for real and complex floating point arguments for v and z. To force `struve_h' to evaluate to a number when given numerical arguments, use either the `float' function or the `numer' option variable. If the option variable `besselexpand' is true and the order is a half integer, the Struve function `struve_h' is simplified to a function in sines and cosines. Maxima knows the derivative of the Struve function `struve_h' with respect to the argument z. See also the Struve function `struve_l'. Examples: ... ----------- It might be nice to specify in what way the implementation for `struve_h' is not very complete. I don't actually know anything about H_v(z), so I suspect I'm not the best person to try and work that out... 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 Sun Oct 23 12:55:50 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 23 Oct 2011 11:55:50 -0600 Subject: [Maxima] user language revisions, was: crazy run-time fluctuations (mostly super-slow) -- a bit more data Message-ID: On 10/22/11, Steve Haflich wrote: > If I were to give advice to the Maxima community (of which I hardly consider > myself a member) I would say that reconsidering the design of the > language would be the most important aspect if one wanted to give Maxima > a long lifetime. > > I would not expect the Maxima community to take my advice seriously, in > fact, I do not consider it (given the circumstances on the ground) to be > particularly wise advice because taking it would be too disruptive. Well, have at it. We have kicked around various ideas for improving the user language. My favorites at the moment are packages or namespaces and lexical scope. Make whatever suggestions you want. I am interested to hear about it. If a user language runs on top of the same Lisp core, then I would say that's not too disruptive. best Robert Dodier From andre.maute at gmx.de Sun Oct 23 13:24:16 2011 From: andre.maute at gmx.de (andre maute) Date: Sun, 23 Oct 2011 20:24:16 +0200 Subject: [Maxima] user language revisions, was: crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: References: Message-ID: <4EA45BD0.2080108@gmx.de> On 10/23/2011 07:55 PM, Robert Dodier wrote: > On 10/22/11, Steve Haflich wrote: > >> If I were to give advice to the Maxima community (of which I hardly consider >> myself a member) I would say that reconsidering the design of the >> language would be the most important aspect if one wanted to give Maxima >> a long lifetime. >> >> I would not expect the Maxima community to take my advice seriously, in >> fact, I do not consider it (given the circumstances on the ground) to be >> particularly wise advice because taking it would be too disruptive. > Well, have at it. We have kicked around various ideas for improving > the user language. My favorites at the moment are packages or > namespaces and lexical scope. Make whatever suggestions you want. > I am interested to hear about it. I take this opportunity and make the following wish: Allow a comma before the closing parenthesis of a block, i.e. make the following legal Maxima --------------------- block( print("something"), ); --------------------- This would make it easier to comment-out/disable whole code blocks. I must confess I mostly develop in C/C++ and use VIM as my favorite editor Regards Andre From woollett at charter.net Sun Oct 23 15:08:07 2011 From: woollett at charter.net (Edwin Woollett) Date: Sun, 23 Oct 2011 13:08:07 -0700 Subject: [Maxima] bessel_i (2, %i*x) or bessel_i(2, x) with integrate --> noun form Message-ID: <6ABEA423389B4322B39EDC2F543C7410@edwinc367e16bd> bessel_i(2, z) apparently doesn't have an integration rule for integrate? (%i1) load(nint); (%o1) "c:/work2/nint.mac" ------------------ bessel_i examples ------------------------ order 1 numerical: ok: (%i2) integrate (bessel_i(1,%i*x),x,1,10000); (%o2) %i*bessel_i(0,10000*%i)-%i*bessel_i(0,%i) (%i3) f(%); (%o3) -0.77229384691136*%i order 1 symbolic: ok: (%i16) integrate(bessel_i(1,x),x); (%o16) -bessel_i(0,x) (%i17) integrate(bessel_i(1,%i*x),x); (%o17) %i*bessel_i(0,%i*x) *but* order 2 numerical: * noun form:* (%i4) integrate (bessel_i(2,%i*x),x,1,3); (%o4) 'integrate(bessel_i(2,%i*x),x,1,3) order 2 symbolic: noun form: (%i14) integrate(bessel_i(2,x),x); (%o14) 'integrate(bessel_i(2,x),x) (%i15) integrate(bessel_i(2,%i*x),x); (%o15) 'integrate(bessel_i(2,%i*x),x) order 2 symbolic, imag. arg: noun form (%i5) integrate (bessel_i(2,%i*x),x,a,b); (%o5) 'integrate(bessel_i(2,%i*x),x,a,b) order 1 symbolic, imag. arg: ok (%i6) integrate (bessel_i(1,%i*x),x,a,b); (%o6) %i*bessel_i(0,%i*b)-%i*bessel_i(0,%i*a) order 2 symbolic, real arg: noun form (%i7) integrate (bessel_i(2,x),x,a,b); (%o7) 'integrate(bessel_i(2,x),x,a,b) ------------------- bessel_j example: ------------------------ (%i8) integrate (bessel_j(2,x),x,a,b); (%o8) hypergeometric([3/2],[5/2,3],-b^2/4)*b^3/24 -hypergeometric([3/2],[5/2,3],-a^2/4)*a^3/24 ------------------------- bessel_y example: -------------------------- (%i9) integrate (bessel_y(2,x),x,a,b); (%o9) ((%pi*struve_h(0,b)*bessel_y(1,b)+%pi*struve_h(-1,b)*bessel_y(0,b))*b -4*bessel_y(2,b)) /2 -((%pi*struve_h(0,a)*bessel_y(1,a)+%pi*struve_h(-1,a)*bessel_y(0,a))*a -4*bessel_y(2,a)) /2 So the case of bessel_i appears anomalous. bessel_i orders 3 and 4: (%i10) integrate (bessel_i(3,%i*x),x,1,3); (%o10) 'integrate(bessel_i(3,%i*x),x,1,3) (%i11) integrate (bessel_i(4,%i*x),x,1,3); (%o11) 'integrate(bessel_i(4,%i*x),x,1,3) (%i12) integrate (bessel_i(3,%i*x),x,1,b); (%o12) 'integrate(bessel_i(3,%i*x),x,1,b) (%i13) integrate (bessel_i(4,%i*x),x,a,b); (%o13) 'integrate(bessel_i(4,%i*x),x,a,b) Ted From drdieterkaiser at web.de Sun Oct 23 15:45:22 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 23 Oct 2011 22:45:22 +0200 Subject: [Maxima] bessel_i (2, %i*x) or bessel_i(2, x) with integrate --> noun form In-Reply-To: <6ABEA423389B4322B39EDC2F543C7410@edwinc367e16bd> References: <6ABEA423389B4322B39EDC2F543C7410@edwinc367e16bd> Message-ID: <1319402722.12798.4.camel@dieter> Am Sonntag, den 23.10.2011, 13:08 -0700 schrieb Edwin Woollett: > bessel_i(2, z) apparently doesn't have an > integration rule for integrate? > > (%i1) load(nint); > (%o1) "c:/work2/nint.mac" > > ------------------ > bessel_i examples > ------------------------ > > order 1 numerical: ok: > > (%i2) integrate (bessel_i(1,%i*x),x,1,10000); > (%o2) %i*bessel_i(0,10000*%i)-%i*bessel_i(0,%i) > (%i3) f(%); > (%o3) -0.77229384691136*%i > > order 1 symbolic: ok: > > (%i16) integrate(bessel_i(1,x),x); > (%o16) -bessel_i(0,x) > > (%i17) integrate(bessel_i(1,%i*x),x); > (%o17) %i*bessel_i(0,%i*x) > > *but* > order 2 numerical: * noun form:* > > (%i4) integrate (bessel_i(2,%i*x),x,1,3); > (%o4) 'integrate(bessel_i(2,%i*x),x,1,3) > > order 2 symbolic: noun form: > > (%i14) integrate(bessel_i(2,x),x); > (%o14) 'integrate(bessel_i(2,x),x) > > (%i15) integrate(bessel_i(2,%i*x),x); > (%o15) 'integrate(bessel_i(2,%i*x),x) > > order 2 symbolic, imag. arg: noun form > > (%i5) integrate (bessel_i(2,%i*x),x,a,b); > (%o5) 'integrate(bessel_i(2,%i*x),x,a,b) > > order 1 symbolic, imag. arg: ok > > (%i6) integrate (bessel_i(1,%i*x),x,a,b); > (%o6) %i*bessel_i(0,%i*b)-%i*bessel_i(0,%i*a) > > order 2 symbolic, real arg: noun form > > (%i7) integrate (bessel_i(2,x),x,a,b); > (%o7) 'integrate(bessel_i(2,x),x,a,b) > > ------------------- > bessel_j example: > ------------------------ > > (%i8) integrate (bessel_j(2,x),x,a,b); > (%o8) hypergeometric([3/2],[5/2,3],-b^2/4)*b^3/24 > -hypergeometric([3/2],[5/2,3],-a^2/4)*a^3/24 > > ------------------------- > bessel_y example: > -------------------------- > > (%i9) integrate (bessel_y(2,x),x,a,b); > (%o9) ((%pi*struve_h(0,b)*bessel_y(1,b)+%pi*struve_h(-1,b)*bessel_y(0,b))*b > -4*bessel_y(2,b)) > /2 > -((%pi*struve_h(0,a)*bessel_y(1,a)+%pi*struve_h(-1,a)*bessel_y(0,a))*a > -4*bessel_y(2,a)) > /2 > > So the case of bessel_i appears anomalous. > > bessel_i orders 3 and 4: > > (%i10) integrate (bessel_i(3,%i*x),x,1,3); > (%o10) 'integrate(bessel_i(3,%i*x),x,1,3) > > (%i11) integrate (bessel_i(4,%i*x),x,1,3); > (%o11) 'integrate(bessel_i(4,%i*x),x,1,3) > > (%i12) integrate (bessel_i(3,%i*x),x,1,b); > (%o12) 'integrate(bessel_i(3,%i*x),x,1,b) > > (%i13) integrate (bessel_i(4,%i*x),x,a,b); > (%o13) 'integrate(bessel_i(4,%i*x),x,a,b) Yes, the integrals you have listed are not implemented. It is possible to give solution in terms of the hypergeometric function. Barton has implemented much more support for hypergeometric functions. Therefore, it might be useful to implement the integrals. Dieter Kaiser From william.wood3 at comcast.net Sun Oct 23 16:15:39 2011 From: william.wood3 at comcast.net (Bill Wood) Date: Sun, 23 Oct 2011 16:15:39 -0500 Subject: [Maxima] user language revisions, was: crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: References: Message-ID: <1319404539.12534.11.camel@ubuntu> On Sun, 2011-10-23 at 11:55 -0600, Robert Dodier wrote: . . . > Well, have at it. We have kicked around various ideas for improving > the user language. My favorites at the moment are packages or > namespaces and lexical scope. Make whatever suggestions you want. > I am interested to hear about it. > > If a user language runs on top of the same Lisp core, then I would > say that's not too disruptive. Deciding on a nice-to-have feature or two (or 3, or 4, ...) is one thing, but a serious language design effort is something else altogether. What are the "right" primitives for a CAS? The "right" combining mechanisms? What would the "best" API look like? Is the focus to be on interactive problem exploration or on disciplined mathematical algorithm design and implementation? Language design is always difficult, always filled with compromise. The best examples exhibit design integrity, and are rarely if ever done by committee. That said, it is true that lisp's "ball-of-mud" character has stood the tests of time and fad well. -- Bill Wood From fateman at eecs.berkeley.edu Sun Oct 23 16:53:09 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 23 Oct 2011 14:53:09 -0700 Subject: [Maxima] user language revisions, In-Reply-To: <1319404539.12534.11.camel@ubuntu> References: <1319404539.12534.11.camel@ubuntu> Message-ID: <4EA48CC5.1050502@eecs.berkeley.edu> there are a number of designs that postdate the Macsyma design. Ones that come to mind .. Common Lisp Maple Mupad Mathematica Axiom, Fricas Mathcad Matlab "objected oriented"/ symbolic toolkit python Sage While designing a language by committee is perhaps not ideal, designing a language in ignorance of history (while traditional) is certainly a bad idea. RJF From dstout at hawaii.edu Sun Oct 23 17:16:07 2011 From: dstout at hawaii.edu (David R Stoutemyer) Date: Sun, 23 Oct 2011 12:16:07 -1000 Subject: [Maxima] How do I access display width? Message-ID: I am writing a function that tries alternative transformations and returns an alternative having the least estimated display width in wxMaxima as if no line breaks were required. (I take this as a crude measure of the "comprehensibility"). The absolute widths in centimeters, pixels or em-spaces don't matter. All that matters is which are shortest. The choice could depend on the current settings of "Maxima > Change 2d Display", "Edit > Options > Keep percent sign with special symbols", "Edit > Style", "Edit > Set Zoom". The easiest way for me to automatically take account of all of this is to invoke the internal interface function that computes the display boxes -- preferably before inserting line breaks -- then extract the desired metric from the result. What is the name of that function, what does it return, and how is it invoked from within Maxima? If there is no such function that doesn't also have the side effect of doing the display, then 1. How do I access the interface variables that tell me the relevent current choices set via the above menus? 2. Where do I obtain information about the widths of individual characters and kerning tables? -- Thanks in advance for any help with this. From willisb at unk.edu Sun Oct 23 18:47:35 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 23 Oct 2011 18:47:35 -0500 Subject: [Maxima] bessel_i (2, %i*x) or bessel_i(2, x) with integrate --> noun form In-Reply-To: <1319402722.12798.4.camel@dieter> References: <1319402722.12798.4.camel@dieter>, <6ABEA423389B4322B39EDC2F543C7410@edwinc367e16bd> Message-ID: The conditional return is cute, but it will flummox diff, solve, and ... Examples: (%i62) integrate(bessel_i(a,x),x); (%o62) if equal(a,-2) then (hypergeometric([3/2],[5/2,3],x^2/4)*x^3)/24 else (hypergeometric([(a+1)/2],[a+1,(a+3)/2],x^2/4)*x^(a+1))/(2^a*gamma(a+2)) (%i63) integrate(bessel_i(5,x),x); (%o63) (hypergeometric([3],[4,6],x^2/4)*x^6)/23040 (%i64) integrate(bessel_i(-2,x),x); (%o64) (hypergeometric([3/2],[5/2,3],x^2/4)*x^3)/24 What's the story with all this rat stuff.... (%i68) integrate(bessel_i(2,x),x,0,10.0); rat: replaced 10.0 by 10/1 = 10.0 rat: replaced 10.0 by 10/1 = 10.0 rat: replaced 10.0 by 10/1 = 10.0 rat: replaced 2348.932064591061 by 241940/103 = 2348.932038834952 (%o68) 241940/103 The code passes a few tests such as (%i94) integrate(bessel_i(-2,x),x); (%o94) (hypergeometric([3/2],[5/2,3],x^2/4)*x^3)/24 (%i95) bessel_i(-2,x) - diff(%,x); (%o95) -(hypergeometric([5/2],[7/2,4],x^2/4)*x^4)/240-(hypergeometric([3/2],[5/2,3],x^2/4)*x^2)/8+bessel_i(2,x) (%i96) taylor(%,x,0,13); (%o96)/T/ 0+... ;;----start--------------------------- (defun bessel-i-integral (a z) (mfuncall 'mcond (meqp a -2) (mul (opcons 'mexpt z 3) (div 1 24) (opcons '$hypergeometric (opcons 'mlist (div 3 2)) (opcons 'mlist (div 5 2) 3) (div (mul z z) 4))) t (mul (opcons 'mexpt z (add a 1)) (opcons '$hypergeometric (opcons 'mlist (div (add a 1) 2)) (opcons 'mlist (div (add a 3) 2) (add a 1)) (div (mul z z) 4)) (div 1 (mul (opcons 'mexpt 2 a) (opcons '%gamma (add a 2))))))) (putprop '%bessel_i `((a z) nil ,#'bessel-i-integral) 'integral) ;;---end--------------------------------------------------- --Barton From razif66 at gmail.com Mon Oct 24 02:31:58 2011 From: razif66 at gmail.com (razif razali) Date: Mon, 24 Oct 2011 15:31:58 +0800 Subject: [Maxima] got error when try to run calculation Message-ID: I got this error when running some calculation, -------------------------------------------------------------- *** - Program stack overflow. RESET [/build/buildd/clisp-2.48/src/eval.d:573] reset() found no driver frame (sp=0x7fff10e35670-0x7fff10e2f210) Exiting on signal 6 Aborted ------------------------------------------------------------------ what is the real problem for my case?is it because of not enough memory?but i have enough RAM(12gb) and HDD(300gb) i think...so can someone point me what is the root cause for this error? -- Regards, RAZIF RAZALI, Tutor & Master Student, Physics Department, Faculty Of Science, Universiti Teknologi Malaysia(UTM). +60199393606 From henryhom at live.cn Sat Oct 22 08:48:02 2011 From: henryhom at live.cn (-Henry Hom) Date: Sat, 22 Oct 2011 13:48:02 +0000 Subject: [Maxima] Maxima Help: Square root in square root Message-ID: (sorry if I broke etiquette) ? ? ? ? How do I simplify: ? ? ? ? 1 ? Factor ? ? ? ? ? ? ? ? ? ? ? ? (sqrt(2)+2)/(sqrt(2)+1) --> ?sqrt(2)? ? ? ? 2 ? Square root in square root ? sqrt(4-2*sqrt(3)) --> ?sqrt(3)-1 ? ? ? ? ? ?In a help file ?_Maxima and Calculus_ ? I found that 1?can be simplified by trigrat(). but in 2 trigrat() doesn't work.? ? ? ? ? How do I simplify 2? Thanks. ???- Henry From sidneym at frontiernet.net Sat Oct 22 22:24:56 2011 From: sidneym at frontiernet.net (Sidney Marshall) Date: Sat, 22 Oct 2011 23:24:56 -0400 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: <20111023021302.GH27744@cs-wsok.swan.ac.uk> References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> <18966.1319319845@gemini.franz.com> <20111022231423.GG27744@cs-wsok.swan.ac.uk> <1319331447.32267.22.camel@ubuntu> <20111023021302.GH27744@cs-wsok.swan.ac.uk> Message-ID: <19f04a$5bd3hc@out01.roch.ny.frontiernet.net> To compare random-states you need to use "equalp". Then the following works (typed directly to ACL): CG-USER(14): (SETQ S (MAKE-RANDOM-STATE T)) #S(RANDOM-STATE :MTI 624 :FIXSEED #(2560852177 155829341 4083677049 692801765 894462049 789676717 391474569 1937877941 3225661681 388099581 ...)) CG-USER(15): (SETQ SS (MAKE-RANDOM-STATE S)) #S(RANDOM-STATE :MTI 624 :FIXSEED #(2560852177 155829341 4083677049 692801765 894462049 789676717 391474569 1937877941 3225661681 388099581 ...)) CG-USER(16): (RANDOM 1000 S) 143 CG-USER(17): (RANDOM 1000 SS) 143 CG-USER(18): (equalp s ss) T CG-USER(19): (note that case is weird in this mode of Allegro Common Lisp) The predicate "equal" doesn't compare the deep structure of structures but just their pointer values in the case of random-states. --Sidney Marshall From felix.natter at smail.inf.fh-brs.de Sun Oct 23 04:26:07 2011 From: felix.natter at smail.inf.fh-brs.de (Felix Natter) Date: Sun, 23 Oct 2011 11:26:07 +0200 Subject: [Maxima] Solving simple vector-valued equations Message-ID: <87fwikf49c.fsf@bitburger.home.felix> hi, I am trying to solve a simple vector-valued equation: solve([1,1] = [p1x,p1y] + u*([p2x,p2y]-[p1x,p1y]), u); ("intersection" between (1,1) and the line defined by p1 and p2) => [[(p1x - p2x) u - p1x + 1, (p1y - p2y) u - p1y + 1] = 0] I know I can easily formulate this with two scalar equations, but I would like to solve more complicated vector equations where the vector representation is much more readable. I guess it's a limitation of maxima because: solve([(p1x - p2x) *u - p1x + 1, (p1y - p2y) *u - p1y + 1] = [0,0],u); yields: [[(p1x - p2x) u - p1x + 1, (p1y - p2y) u - p1y + 1] = 0] but is there a better way to solve this? Thanks! -- Felix Natter From dbmaxima at gmail.com Mon Oct 24 03:15:00 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Mon, 24 Oct 2011 19:15:00 +1100 Subject: [Maxima] Maxima Help: Square root in square root In-Reply-To: References: Message-ID: <4EA51E84.7070900@gmail.com> On 23/10/2011 12:48 AM, -Henry Hom wrote: > How do I simplify: > > Square root in square root sqrt(4-2*sqrt(3)) --> sqrt(3)-1 Use the sqrtdenest function. (%i1) sqrt(4-2*sqrt(3)); (%o1) sqrt(4-2*sqrt(3)) (%i2) load(sqdnst)$ (%i3) sqrtdenest(%o1); (%o3) sqrt(3)-1 From smh at franz.com Mon Oct 24 04:08:38 2011 From: smh at franz.com (Steve Haflich) Date: Mon, 24 Oct 2011 02:08:38 -0700 Subject: [Maxima] RE : crazy run-time fluctuations (mostly super-slow) -- a bit more data In-Reply-To: <19f04a$5bd3hc@out01.roch.ny.frontiernet.net> References: <20111022122516.GA6159@cs-wsok.swan.ac.uk> <20111022163841.GE27744@cs-wsok.swan.ac.uk> <20111022181413.GF27744@cs-wsok.swan.ac.uk> <18966.1319319845@gemini.franz.com> <20111022231423.GG27744@cs-wsok.swan.ac.uk> <1319331447.32267.22.camel@ubuntu> <20111023021302.GH27744@cs-wsok.swan.ac.uk> <19f04a$5bd3hc@out01.roch.ny.frontiernet.net> Message-ID: <10949.1319447318@gemini.franz.com> Sidney Marshall wrote: To compare random-states you need to use "equalp". Then the following works (typed directly to ACL): Unfortunately, this is not true of portable ANSI Common Lisp. Please see the definition of equalp in the ANS, either the Hyperspec or http://www.franz.com/support/documentation/current/ansicl/dictentr/equalp.htm and see also the definition of the class random-state at http://www.franz.com/support/documentation/current/ansicl/dictentr/random-s.htm and finally the last paragraph of Type Relationships at http://www.franz.com/support/documentation/current/ansicl/subsecti/typerela.htm Now it happens that random-state is implemented in Allegro as a structure-object, therefor two non-eq random-states can be compared with equalp which will descend the corresponding structure slots testing for equalp. But even that doesn't guarantee that the equalp test is meaningful, with the criterion being that calls to random using these random states will yield that same results. For example, the random-state structure-object might be implemented with slots that are irrelevant to the random function (e.g. a slot maintaining usage info such as the number of times this random-state had been used) causing false negatives. Other plausible implementation techniques (which I won't bother to sketch here) might result in false negatives. In other words, the result of calling equalp on two random-state object is unspecified (which in the language of the ANS means that the call will be harmless and safe, but the returned value is not meaningful). Now, why is my above rant relevant to Maxima? Maxima is implemented in unfortunate territory. Most of it has been updated over time to be coded, more or less, on top of portable ANSI Common Lisp. For various reasons, the developer and user communities want to keep it portable across several CL implementations. This is IMO a good idea, since it increases the range of platforms on which Maxima will run, and especially because one expects there will soon appear a portable CL running on tablets or smart phones. Obviously not _all_ of Maxima-supported CL implementations will appear on these platforms, but being able to pull a Maxima platform out of one's pocket would be science-fiction-worthy cool! The portability of the Maxima kernel to conforming CL implementations won't finess all the problems, of course, since these portable devices often have small screens, and probably won't implement a straightforward stdin/stdout I/O protocol -- these things are outside the ANSI specification. But still, it would be nice if the essential Maxima kernel didn't need rewriting for _any_ conforming ANSI CL implementation. That's why I suggest you and Olivier and all the other implementors should not write code that depends upon equalp applied to random states. It isn't portable, and even if every current implementation behaves as desired, you'll run the risk of an unanticipated future change in one or another implementation that will break the code, requiring tedious debugging and gigabytes of discussion on the maxima list. From willisb at unk.edu Mon Oct 24 06:53:03 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 24 Oct 2011 06:53:03 -0500 Subject: [Maxima] bessel_i (2, %i*x) or bessel_i(2, x) with integrate --> noun form In-Reply-To: References: , <1319402722.12798.4.camel@dieter>, <6ABEA423389B4322B39EDC2F543C7410@edwinc367e16bd> Message-ID: Oops...Maxima simplifies bessel_i(-2,x) --> bessel_i(2,x). So a = -2, isn't a special case for integrate(bessel_i(a,x),x). The special case (%i7) integrate(bessel_i(0,x),x); (%o7) ((bessel_i(0,x)*(%pi*struve_l(1,x)+2)-%pi*struve_l(0,x)*bessel_i(1,x))*x)/2 is more complicated than using the hypergeometric representation, I think. Thus let's try (defun bessel-i-integral (a z) "Integral of bessel_i(a,z) wrt z" (cond ((eq t (meqp a 1)) ;; integrate(bessel_i(1,z),z) = bessel_i(0,z) (opcons '%bessel_i 0 z)) ;; integrate(bessel_i(a,z),z) = hypergeometric([(a+1)/2],[a+1,(a+3)/2],x^2/4)*x^(a+1))/(2^a*gamma(a+2)) ;; Maxima simplifies bessel_i(-2,z) --> bessel_(2,z), so a = -2 isn't a special case. (t (mul (opcons 'mexpt z (add a 1)) (opcons '$hypergeometric (opcons 'mlist (div (add a 1) 2)) (opcons 'mlist (div (add a 3) 2) (add a 1)) (div (mul z z) 4)) (div 1 (mul (opcons 'mexpt 2 a) (opcons '%gamma (add a 2)))))))) --Barton From carbajal at ifi.uzh.ch Mon Oct 24 07:36:17 2011 From: carbajal at ifi.uzh.ch (Juan Pablo Carbajal) Date: Mon, 24 Oct 2011 14:36:17 +0200 Subject: [Maxima] Completing square, cube Message-ID: Hi all, It has been a long time. I was wondering what is the easies way to make Maxima complete the square and cube? I tried factor, but is not working. any ideas? Thanks -- M. Sc. Juan Pablo Carbajal ----- PhD Student University of Z?rich http://ailab.ifi.uzh.ch/carbajal/ From sangwinc at for.mat.bham.ac.uk Mon Oct 24 08:18:22 2011 From: sangwinc at for.mat.bham.ac.uk (Chris Sangwin) Date: Mon, 24 Oct 2011 14:18:22 +0100 (BST) Subject: [Maxima] Completing square, cube In-Reply-To: References: Message-ID: I'm not sure if this function already exists, but I have the following /* Write the polynomial in completed square form */ comp_square(ex,var) := block([vc], if not(atom(var)) or numberp(var) then (print("comp_square: var should be an atom but not a number. "),return(ex)), ex:ratsimp(expand(ex)), if not(polynomialp(ex,[var])) then (print("comp_square: ex should be a polynomial in var. "),return(ex)), if hipow(ex,var)#2 then (print("comp_square: ex should be a quadratic. "),return(ex)), vc:coeff(ex,var,1)/(2*coeff(ex,var,2)), return(coeff(ex,var,2)*((var+vc)^2-subst(vc,var,ex))) )$ Chris On Mon, 24 Oct 2011, Juan Pablo Carbajal wrote: > Hi all, > It has been a long time. > > I was wondering what is the easies way to make Maxima complete the > square and cube? I tried factor, but is not working. > > any ideas? > > Thanks > > > -- > M. Sc. Juan Pablo Carbajal > ----- > PhD Student > University of Z?rich > http://ailab.ifi.uzh.ch/carbajal/ > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > From maxima at etherjones.us Mon Oct 24 09:01:15 2011 From: maxima at etherjones.us (Ether Jones) Date: Mon, 24 Oct 2011 07:01:15 -0700 (PDT) Subject: [Maxima] display expression exactly as entered Message-ID: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> Hello, Is there a way to force maxima to display an expression exactly as I have entered it, rather than "simplifying" it for me? For example, when I enter (W/4)*(1/(1+x)) it displays as ? W/(4*(x+1)) Please see attached WXM file or the PNG screenshot. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: display.png Type: image/png Size: 11194 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: display.wxm Type: application/octet-stream Size: 291 bytes Desc: not available URL: From villate at fe.up.pt Mon Oct 24 09:28:33 2011 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 24 Oct 2011 15:28:33 +0100 Subject: [Maxima] display expression exactly as entered In-Reply-To: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> Message-ID: <1319466513.3658.1.camel@B233-01> On Mon, 2011-10-24 at 07:01 -0700, Ether Jones wrote: > Is there a way to force maxima to display an expression exactly as I > have entered it, rather than "simplifying" it for me? > > For example, when I enter (W/4)*(1/(1+x)) it displays as W/(4*(x > +1)) Hi, perhaps this will solve your problem? (%i2) (W/4)*(1/(1+x)); (%o2) W/(4*(x+1)) (%i3) grind(%i2); W/4*(1/(1+x))$ Regards, Jaime From macrakis at alum.mit.edu Mon Oct 24 09:49:43 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 24 Oct 2011 10:49:43 -0400 Subject: [Maxima] display expression exactly as entered In-Reply-To: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> Message-ID: You can disable Maxima's default transformations a.k.a. general simplification, by setting simp:false. However, this breaks most of Maxima's functionality. For example: (%i4) simp:false; (%o4) false (%i5) (W/4)*(1/(1+x)); (%o5) W/4*(1/(1+x)) (%i6) diff(%,x); (%o6) 'diff(1/(1+x),x,1)*(W/4)+0*(1/(1+x)) In this case, 0*(1/(1+x)) is not simplified to 0, diff(1/(1+x),x,1) is not performed. This second case may seem mysterious until you understand that Maxima normally does not use a division operator internally, but transforms it to multiplication and exponentiation -- (a/b) internally is actually a * b^-1, as you can see in the Lisp representation: (%i7) ?print(a/b)$ ((MQUOTIENT) $A $B) (%i8) simp:true$ (%i9) ?print(a/b)$ ((MTIMES SIMP) $A ((MEXPT SIMP) $B -1)) You can also block default simplifications by using the "box" function (and set boxchar:" " if you want the boxes to be invisible). But this doesn't guarantee to preserve order: (%i3) box(W/4)*box(1/(1+x)); (%o3) box(1/(x+1))*box(W/4) And Maxima functions treat boxes as unknown functions: (%i4) diff(%,x); (%o4) 'diff(box(1/(x+1)),x,1)*box(W/4) Why exactly do you want to preserve your input form? Is it because you find it more intuitive when you're manipulating the expression? Because you want to present this form as part of your output? Because you want to do transformations which depend on the form of the expression? In the last case, you might want to look at ratsubst rather than subst: (%i5) expr: (W/4)*(1/(1+x)); (%o5) W/(4*(x+1)) (%i6) subst(q,W/4,%); (%o6) W/(4*(x+1)) <<< W/4 is not syntactically present in expr (%i7) ratsubst(q,W/4,%); (%o7) q/(x+1) <<< but ratsubst recognizes it Does that help? -s On Mon, Oct 24, 2011 at 10:01, Ether Jones wrote: > Hello, > > Is there a way to force maxima to display an expression exactly as I have > entered it, rather than "simplifying" it for me? > > For example, when I enter (W/4)*(1/(1+x)) it displays as W/(4*(x+1)) > > Please see attached WXM file or the PNG screenshot. > > 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 fateman at eecs.berkeley.edu Mon Oct 24 10:14:53 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 24 Oct 2011 08:14:53 -0700 Subject: [Maxima] display expression exactly as entered In-Reply-To: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> Message-ID: <4EA580ED.3030706@eecs.berkeley.edu> On 10/24/2011 7:01 AM, Ether Jones wrote: > Hello, > > Is there a way to force maxima to display an expression exactly as I > have entered it, rather than "simplifying" it for me? > Programs that do that are text editors :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From sangwinc at for.mat.bham.ac.uk Mon Oct 24 10:41:46 2011 From: sangwinc at for.mat.bham.ac.uk (Chris Sangwin) Date: Mon, 24 Oct 2011 16:41:46 +0100 (BST) Subject: [Maxima] display expression exactly as entered In-Reply-To: <4EA580ED.3030706@eecs.berkeley.edu> References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> <4EA580ED.3030706@eecs.berkeley.edu> Message-ID: Richard! True, but perhaps the answer Ether is looking for is the command simp:false; This turns of all "simplification", and has lots and lots of side effects, which you might not want either.... Chris Sangwin On Mon, 24 Oct 2011, Richard Fateman wrote: > On 10/24/2011 7:01 AM, Ether Jones wrote: >> Hello, >> >> Is there a way to force maxima to display an expression exactly as I have >> entered it, rather than "simplifying" it for me? >> > Programs that do that are text editors :) > > > From macrakis at alum.mit.edu Mon Oct 24 10:41:38 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 24 Oct 2011 11:41:38 -0400 Subject: [Maxima] Problem with multiple results in help Message-ID: In Maxima 5.25.1, ? box gives documentation on the plot option 'box', not the Maxima function 'box', which you have to enter as ? box <1> which obviously no one is going to do. You can find the function box using ?? box but that doesn't seem right, since the name of the thing really is 'box'. I would suggest that ? xxx display documentation for *ALL* things named xxx, not just the first thing. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxima at etherjones.us Mon Oct 24 13:09:09 2011 From: maxima at etherjones.us (Ether Jones) Date: Mon, 24 Oct 2011 11:09:09 -0700 (PDT) Subject: [Maxima] display expression exactly as entered In-Reply-To: References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> Message-ID: <1319479749.33086.YahooMailNeo@web161805.mail.bf1.yahoo.com> Thanks for the suggestion Stavros. Bracketing the expression with simp:false and simp:true seems to give what I want: simp:false$ ex1: (W/4)*(1/()); simp:true$ ex1; See attached PNG screenshot for output. ________________________________ From: Stavros Macrakis To: Ether Jones Cc: maxima Sent: Monday, October 24, 2011 10:49 AM Subject: Re: [Maxima] display expression exactly as entered You can disable Maxima's default transformations a.k.a. general simplification, by setting simp:false. However, this breaks most of Maxima's functionality. ?For example: (%i4) simp:false; (%o4) false (%i5) (W/4)*(1/(1+x)); (%o5) W/4*(1/(1+x)) (%i6) diff(%,x); (%o6) 'diff(1/(1+x),x,1)*(W/4)+0*(1/(1+x)) In this case, 0*(1/(1+x)) is not simplified to 0, diff(1/(1+x),x,1) is not performed. ?This second case may seem mysterious until you understand that Maxima normally does not use a division operator internally, but transforms it to multiplication and exponentiation -- (a/b) internally is actually a * b^-1, as you can see in the Lisp representation: (%i7) ?print(a/b)$ ((MQUOTIENT) $A $B)? (%i8) simp:true$ (%i9) ?print(a/b)$ ((MTIMES SIMP) $A ((MEXPT SIMP) $B -1))? You can also block default simplifications by using the "box" function (and set boxchar:" " if you want the boxes to be invisible). But this doesn't guarantee to preserve order: (%i3) box(W/4)*box(1/(1+x)); (%o3) box(1/(x+1))*box(W/4) And Maxima functions treat boxes as unknown functions: (%i4) diff(%,x); (%o4) 'diff(box(1/(x+1)),x,1)*box(W/4) Why exactly do you want to preserve your input form? ?Is it because you find it more intuitive when you're manipulating the expression? ?Because you want to present this form as part of your output? ?Because you want to do transformations which depend on the form of the expression? In the last case, you might want to look at ratsubst rather than subst: (%i5) expr: (W/4)*(1/(1+x)); (%o5) W/(4*(x+1)) (%i6) subst(q,W/4,%); (%o6) W/(4*(x+1)) ? ? ? ? ? ? ? ? ? ? ? ? <<< W/4 is not syntactically present in expr (%i7) ratsubst(q,W/4,%); (%o7) q/(x+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? <<< but ratsubst recognizes it Does that help? ? ? ? ? ? ? -s On Mon, Oct 24, 2011 at 10:01, Ether Jones wrote: Hello, > > >Is there a way to force maxima to display an expression exactly as I have entered it, rather than "simplifying" it for me? > > >For example, when I enter (W/4)*(1/(1+x)) it displays as ? W/(4*(x+1)) > > > >Please see attached WXM file or the PNG screenshot. > > >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: -------------- next part -------------- A non-text attachment was scrubbed... Name: simp.png Type: image/png Size: 13931 bytes Desc: not available URL: From macrakis at alum.mit.edu Mon Oct 24 13:20:30 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 24 Oct 2011 14:20:30 -0400 Subject: [Maxima] display expression exactly as entered In-Reply-To: <1319479749.33086.YahooMailNeo@web161805.mail.bf1.yahoo.com> References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> <1319479749.33086.YahooMailNeo@web161805.mail.bf1.yahoo.com> Message-ID: Yes, but as soon as you 'touch' it again, it will be simplified. Why exactly do you want this? Is it to confirm that you entered the expression correctly? Then maybe something like the following would be useful? (%i2) inputprint(n):= block([simp:false], apply('display,[concat('%i,n)]))$ (%i3) x/x; (%o3) 1 (%i4) x/4*1/(x+1); (%o4) x/(4*(x+1)) (%i5) inputprint(3)$ %i3 = x/x (%i6) inputprint(4); %i4 = x/4*1/(x+1) It looks as though the playback function could have an option to print the input (not just output) expressions in 2d. Would that solve your problem? -s On Mon, Oct 24, 2011 at 14:09, Ether Jones wrote: > > Thanks for the suggestion Stavros. Bracketing the expression with > simp:false and simp:true seems to give what I want: > > simp:false$ > ex1: (W/4)*(1/()); > simp:true$ > ex1; > > See attached PNG screenshot for output. > > > ------------------------------ > *From:* Stavros Macrakis > *To:* Ether Jones > *Cc:* maxima > *Sent:* Monday, October 24, 2011 10:49 AM > *Subject:* Re: [Maxima] display expression exactly as entered > > You can disable Maxima's default transformations a.k.a. general > simplification, by setting simp:false. > > However, this breaks most of Maxima's functionality. For example: > > (%i4) simp:false; > (%o4) false > (%i5) (W/4)*(1/(1+x)); > (%o5) W/4*(1/(1+x)) > (%i6) diff(%,x); > (%o6) 'diff(1/(1+x),x,1)*(W/4)+0*(1/(1+x)) > > In this case, 0*(1/(1+x)) is not simplified to 0, diff(1/(1+x),x,1) is not > performed. This second case may seem mysterious until you understand that > Maxima normally does not use a division operator internally, but transforms > it to multiplication and exponentiation -- (a/b) internally is actually a * > b^-1, as you can see in the Lisp representation: > > (%i7) ?print(a/b)$ > ((MQUOTIENT) $A $B) > (%i8) simp:true$ > (%i9) ?print(a/b)$ > ((MTIMES SIMP) $A ((MEXPT SIMP) $B -1)) > > You can also block default simplifications by using the "box" function (and > set boxchar:" " if you want the boxes to be invisible). > > But this doesn't guarantee to preserve order: > > (%i3) box(W/4)*box(1/(1+x)); > (%o3) box(1/(x+1))*box(W/4) > > And Maxima functions treat boxes as unknown functions: > > (%i4) diff(%,x); > (%o4) 'diff(box(1/(x+1)),x,1)*box(W/4) > > Why exactly do you want to preserve your input form? Is it because you > find it more intuitive when you're manipulating the expression? Because you > want to present this form as part of your output? Because you want to do > transformations which depend on the form of the expression? > > In the last case, you might want to look at ratsubst rather than subst: > > (%i5) expr: (W/4)*(1/(1+x)); > (%o5) W/(4*(x+1)) > (%i6) subst(q,W/4,%); > (%o6) W/(4*(x+1)) <<< W/4 is not syntactically > present in expr > (%i7) ratsubst(q,W/4,%); > (%o7) q/(x+1) <<< but ratsubst recognizes it > > Does that help? > > -s > > > On Mon, Oct 24, 2011 at 10:01, Ether Jones wrote: > > Hello, > > Is there a way to force maxima to display an expression exactly as I have > entered it, rather than "simplifying" it for me? > > For example, when I enter (W/4)*(1/(1+x)) it displays as W/(4*(x+1)) > > Please see attached WXM file or the PNG screenshot. > > 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 biomates at telefonica.net Mon Oct 24 13:31:11 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Mon, 24 Oct 2011 14:31:11 -0400 Subject: [Maxima] Problem with multiple results in help In-Reply-To: References: Message-ID: <4EA5AEEF.3010000@telefonica.net> On 10/24/2011 11:41 AM, Stavros Macrakis wrote: > I would suggest that ? xxx display documentation for *ALL* things > named xxx, not just the first thing. I vote for this too. Since some plot and draw options are named equal '? opt' only shows the documentation for one of the plotting systems, which is confusing. -- Mario From maxima at etherjones.us Mon Oct 24 13:42:02 2011 From: maxima at etherjones.us (Ether Jones) Date: Mon, 24 Oct 2011 11:42:02 -0700 (PDT) Subject: [Maxima] display expression exactly as entered In-Reply-To: References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> <1319479749.33086.YahooMailNeo@web161805.mail.bf1.yahoo.com> Message-ID: <1319481722.23410.YahooMailNeo@web161801.mail.bf1.yahoo.com> Yes, but as soon as you 'touch' it again, it will be simplified. Understood, and acceptable. Why exactly do you want this? I want the expression I manually enter to appear exactly the way I typed it for three reasons, all of which you have anticipated: 1) to confirm that I entered it correctly, and 2) for me to see it in 2D the way I entered it so that I can examine it for insight as to how I want to proceed, and 3) most importantly, because I entered it the way I did for a reason, and I want it to display that way (when I first enter it).? That reason is, it corresponds more clearly with the flow of the derivation argument I am making (for example, it more closely corresponds with any figures or diagrams I have prepared). Thanks for your help. ________________________________ From: Stavros Macrakis To: Ether Jones Cc: maxima Sent: Monday, October 24, 2011 2:20 PM Subject: Re: [Maxima] display expression exactly as entered Yes, but as soon as you 'touch' it again, it will be simplified. Why exactly do you want this? ?Is it to confirm that you entered the expression correctly? ?Then maybe something like the following would be useful? (%i2) inputprint(n):= block([simp:false], apply('display,[concat('%i,n)]))$ (%i3) x/x; (%o3) 1 (%i4) x/4*1/(x+1); (%o4) x/(4*(x+1)) (%i5) inputprint(3)$ %i3 = x/x (%i6) inputprint(4); %i4 = x/4*1/(x+1) It looks as though the playback function could have an option to print the input (not just output) expressions in 2d. ?Would that solve your problem? ? ? ? ? ? ?-s On Mon, Oct 24, 2011 at 14:09, Ether Jones wrote: > >Thanks for the suggestion Stavros. Bracketing the expression with simp:false and simp:true seems to give what I want: > > >simp:false$ >ex1: (W/4)*(1/()); >simp:true$ >ex1; > > >See attached PNG screenshot for output. > > > > > >________________________________ > From: Stavros Macrakis >To: Ether Jones >Cc: maxima >Sent: Monday, October 24, 2011 10:49 AM >Subject: Re: [Maxima] display expression exactly as entered > > > >You can disable Maxima's default transformations a.k.a. general simplification, by setting simp:false. > > >However, this breaks most of Maxima's functionality. ?For example: > > >(%i4) simp:false; >(%o4) false >(%i5) (W/4)*(1/(1+x)); >(%o5) W/4*(1/(1+x)) >(%i6) diff(%,x); >(%o6) 'diff(1/(1+x),x,1)*(W/4)+0*(1/(1+x)) > > >In this case, 0*(1/(1+x)) is not simplified to 0, diff(1/(1+x),x,1) is not performed. ?This second case may seem mysterious until you understand that Maxima normally does not use a division operator internally, but transforms it to multiplication and exponentiation -- (a/b) internally is actually a * b^-1, as you can see in the Lisp representation: > > >(%i7) ?print(a/b)$ >((MQUOTIENT) $A $B)? >(%i8) simp:true$ >(%i9) ?print(a/b)$ >((MTIMES SIMP) $A ((MEXPT SIMP) $B -1))? > > >You can also block default simplifications by using the "box" function (and set boxchar:" " if you want the boxes to be invisible). > > >But this doesn't guarantee to preserve order: > > >(%i3) box(W/4)*box(1/(1+x)); >(%o3) box(1/(x+1))*box(W/4) > > >And Maxima functions treat boxes as unknown functions: > > >(%i4) diff(%,x); >(%o4) 'diff(box(1/(x+1)),x,1)*box(W/4) > > >Why exactly do you want to preserve your input form? ?Is it because you find it more intuitive when you're manipulating the expression? ?Because you want to present this form as part of your output? ?Because you want to do transformations which depend on the form of the expression? > > >In the last case, you might want to look at ratsubst rather than subst: > > >(%i5) expr: (W/4)*(1/(1+x)); >(%o5) W/(4*(x+1)) >(%i6) subst(q,W/4,%); >(%o6) W/(4*(x+1)) ? ? ? ? ? ? ? ? ? ? ? ? <<< W/4 is not syntactically present in expr >(%i7) ratsubst(q,W/4,%); >(%o7) q/(x+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? <<< but ratsubst recognizes it > > >Does that help? > > >? ? ? ? ? ? -s > > > > >On Mon, Oct 24, 2011 at 10:01, Ether Jones wrote: >Hello, >> >> >>Is there a way to force maxima to display an expression exactly as I have entered it, rather than "simplifying" it for me? >> >> >>For example, when I enter (W/4)*(1/(1+x)) it displays as ? W/(4*(x+1)) >> >> >> >>Please see attached WXM file or the PNG screenshot. >> >> >>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 toy.raymond at gmail.com Mon Oct 24 14:02:54 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 24 Oct 2011 12:02:54 -0700 Subject: [Maxima] got error when try to run calculation In-Reply-To: References: Message-ID: On Mon, Oct 24, 2011 at 12:31 AM, razif razali wrote: > I got this error when running some calculation, > -------------------------------------------------------------- > > *** - Program stack overflow. RESET > > [/build/buildd/clisp-2.48/src/eval.d:573] reset() found no driver > frame (sp=0x7fff10e35670-0x7fff10e2f210) > Exiting on signal 6 > Aborted > > ------------------------------------------------------------------ > what is the real problem for my case?is it because of not enough > memory?but i have enough RAM(12gb) and HDD(300gb) i think...so can > someone point me what is the root cause for this error? > > Sounds like user error. If you want some help, you're going to have to supply way more information besides the fact that you got an error. Maxima isn't all-knowing and all-seeing yet. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Mon Oct 24 14:28:03 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 24 Oct 2011 12:28:03 -0700 Subject: [Maxima] bessel_i (2, %i*x) or bessel_i(2, x) with integrate --> noun form Message-ID: <487FF6BDB3F747F5AB0A25478995D664@edwinc367e16bd> On Oct. 24, 6:53 CDT, 2011, Barton Willis wrote: --------------------------------------- >Oops...Maxima simplifies bessel_i(-2,x) --> bessel_i(2,x). So a = -2, isn't >a special case >for integrate(bessel_i(a,x),x). The special case > > (%i7) integrate(bessel_i(0,x),x); > (%o7) > ((bessel_i(0,x)*(%pi*struve_l(1,x)+2)-%pi*struve_l(0,x)*bessel_i(1,x))*x)/2 > >is more complicated than using the hypergeometric representation, I think. >Thus let's try > >(defun bessel-i-integral (a z) > [etc] ------------------------------- This code works for my numerical needs: 1. integration over a large range: (%i1) load(nint); (%o1) "c:/work2/nint.mac" (%i9) f(integrate(bessel_i(2,%i*x),x,1,500)); (%o9) -0.94996630633619 (%i10) f(integrate(bessel_i(3,%i*x),x,1,500)); (%o10) -0.96082031863327*%i (%i11) f(integrate(bessel_i(4,%i*x),x,1,500)); (%o11) 1.009491962084913 (%i12) f(integrate(bessel_i(5,%i*x),x,1,500)); (%o12) 1.03430327860412*%i replacing 500 >> 1000 leads to Exceeded maximum allowed fpprec error message. 2. for numerical integration, ok to use bessel_i(2,x) or bessel_i(2.0,x) which allows nint to avoid a present quadpack trap with imagpart(bessel_i). (%i16) f(integrate(bessel_i(0,%i*x),x,1,3)); (%o16) 0.4678368419201 (%i17) f(integrate(bessel_i(0.0,%i*x),x,1,3)); (%o17) 0.46783686924217 (%i18) f(integrate(bessel_i(1,%i*x),x,1,3)); (%o18) 1.0252496414599*%i (%i19) f(integrate(bessel_i(1.0,%i*x),x,1,3)); (%o19) 1.0252496414599*%i (%i20) f(integrate(bessel_i(2,%i*x),x,1,3)); (%o20) -0.6698200963581 (%i21) f(integrate(bessel_i(2.0,%i*x),x,1,3)); (%o21) -0.6698200859962 (%i22) f(integrate(bessel_i(3,%i*x),x,1,3)); (%o22) -0.28287409015192*%i (%i23) f(integrate(bessel_i(3.0,%i*x),x,1,3)); (%o23) -0.28287408738349*%i nint.mac loads nint.lisp which at present looks like: ----------------------------------------------------------- ;;;nint.lisp ;;;code from barton willis file ;;; topoly.lisp (defun $complex_number_p (e) (complex-number-p e #'$numberp)) ;;;code from barton oct. 24,2011, 6:53 CDT ;; integrate(bessel_i(a,z),z) = hypergeometric([(a+1)/2],[a+1,(a+3)/2],x^2/4)*x^(a+1))/(2^a*gamma(a+2)) ;; Maxima simplifies bessel_i(-2,z) --> bessel_(2,z), so a = -2 isn't a special case. (defun bessel-i-integral (a z) "Integral of bessel_i(a,z) wrt z" (cond ((eq t (meqp a 1)) ;; integrate(bessel_i(1,z),z) = bessel_i(0,z) (opcons '%bessel_i 0 z)) (t (mul (opcons 'mexpt z (add a 1)) (opcons '$hypergeometric (opcons 'mlist (div (add a 1) 2)) (opcons 'mlist (div (add a 3) 2) (add a 1)) (div (mul z z) 4)) (div 1 (mul (opcons 'mexpt 2 a) (opcons '%gamma (add a 2)))))))) (putprop '%bessel_i `((a z) nil ,#'bessel-i-integral) 'integral) ----------------------------------------------------------------- Ted From macrakis at alum.mit.edu Mon Oct 24 14:56:42 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 24 Oct 2011 15:56:42 -0400 Subject: [Maxima] display expression exactly as entered In-Reply-To: <1319481722.23410.YahooMailNeo@web161801.mail.bf1.yahoo.com> References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> <1319479749.33086.YahooMailNeo@web161805.mail.bf1.yahoo.com> <1319481722.23410.YahooMailNeo@web161801.mail.bf1.yahoo.com> Message-ID: Well, if that's your use case, then you might want to redefine the read-eval-print loop (if you *always* want to see the unsimplified form) or use the following macro (%i13) :lisp (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) (terpri) ',x)) (%i14) dd(x/x); x (raw) - x (%o14) 1 It prints the unsimplified form, and returns the value, whereupon it is simplified in the normal way. You will always get better replies to your queries if you explain **why** you want to do what you're asking for.... -s On Mon, Oct 24, 2011 at 14:42, Ether Jones wrote: > > Yes, but as soon as you 'touch' it again, it will be simplified. > > Understood, and acceptable. > > Why exactly do you want this? > > I want the expression I manually enter to appear exactly the way I typed it > for three reasons, all of which you have anticipated: > > 1) to confirm that I entered it correctly, and > > 2) for me to see it in 2D the way I entered it so that I can examine it for > insight as to how I want to proceed, and > > 3) most importantly, because I entered it the way I did for a reason, and I > want it to display that way (when I first enter it). That reason is, it > corresponds more clearly with the flow of the derivation argument I am > making (for example, it more closely corresponds with any figures or > diagrams I have prepared). > > Thanks for your help. > > > ------------------------------ > *From:* Stavros Macrakis > *To:* Ether Jones > *Cc:* maxima > *Sent:* Monday, October 24, 2011 2:20 PM > > *Subject:* Re: [Maxima] display expression exactly as entered > > Yes, but as soon as you 'touch' it again, it will be simplified. > > Why exactly do you want this? Is it to confirm that you entered the > expression correctly? Then maybe something like the following would be > useful? > > (%i2) inputprint(n):= block([simp:false], apply('display,[concat('%i,n)]))$ > (%i3) x/x; > (%o3) 1 > (%i4) x/4*1/(x+1); > (%o4) x/(4*(x+1)) > (%i5) inputprint(3)$ > %i3 = x/x > (%i6) inputprint(4); > %i4 = x/4*1/(x+1) > > It looks as though the playback function could have an option to print the > input (not just output) expressions in 2d. Would that solve your problem? > > -s > > On Mon, Oct 24, 2011 at 14:09, Ether Jones wrote: > > > Thanks for the suggestion Stavros. Bracketing the expression with > simp:false and simp:true seems to give what I want: > > simp:false$ > ex1: (W/4)*(1/()); > simp:true$ > ex1; > > See attached PNG screenshot for output. > > > ------------------------------ > *From:* Stavros Macrakis > *To:* Ether Jones > *Cc:* maxima > *Sent:* Monday, October 24, 2011 10:49 AM > *Subject:* Re: [Maxima] display expression exactly as entered > > You can disable Maxima's default transformations a.k.a. general > simplification, by setting simp:false. > > However, this breaks most of Maxima's functionality. For example: > > (%i4) simp:false; > (%o4) false > (%i5) (W/4)*(1/(1+x)); > (%o5) W/4*(1/(1+x)) > (%i6) diff(%,x); > (%o6) 'diff(1/(1+x),x,1)*(W/4)+0*(1/(1+x)) > > In this case, 0*(1/(1+x)) is not simplified to 0, diff(1/(1+x),x,1) is not > performed. This second case may seem mysterious until you understand that > Maxima normally does not use a division operator internally, but transforms > it to multiplication and exponentiation -- (a/b) internally is actually a * > b^-1, as you can see in the Lisp representation: > > (%i7) ?print(a/b)$ > ((MQUOTIENT) $A $B) > (%i8) simp:true$ > (%i9) ?print(a/b)$ > ((MTIMES SIMP) $A ((MEXPT SIMP) $B -1)) > > You can also block default simplifications by using the "box" function (and > set boxchar:" " if you want the boxes to be invisible). > > But this doesn't guarantee to preserve order: > > (%i3) box(W/4)*box(1/(1+x)); > (%o3) box(1/(x+1))*box(W/4) > > And Maxima functions treat boxes as unknown functions: > > (%i4) diff(%,x); > (%o4) 'diff(box(1/(x+1)),x,1)*box(W/4) > > Why exactly do you want to preserve your input form? Is it because you > find it more intuitive when you're manipulating the expression? Because you > want to present this form as part of your output? Because you want to do > transformations which depend on the form of the expression? > > In the last case, you might want to look at ratsubst rather than subst: > > (%i5) expr: (W/4)*(1/(1+x)); > (%o5) W/(4*(x+1)) > (%i6) subst(q,W/4,%); > (%o6) W/(4*(x+1)) <<< W/4 is not syntactically > present in expr > (%i7) ratsubst(q,W/4,%); > (%o7) q/(x+1) <<< but ratsubst recognizes it > > Does that help? > > -s > > > On Mon, Oct 24, 2011 at 10:01, Ether Jones wrote: > > Hello, > > Is there a way to force maxima to display an expression exactly as I have > entered it, rather than "simplifying" it for me? > > For example, when I enter (W/4)*(1/(1+x)) it displays as W/(4*(x+1)) > > Please see attached WXM file or the PNG screenshot. > > 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 p.j.papasot at gmail.com Mon Oct 24 16:12:39 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 25 Oct 2011 00:12:39 +0300 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. Message-ID: Dear community, I have written a Maxima package for solving initial value problems. The package implements a Maxima function called rkf45, which is an implementation of the Runge-Kutta-Fehlberg method of 4th-5th order. It provides adaptive step size and error control, which is something that is currently missing in Maxima. The user doesn't need to care about the integration step, as it is selected by the algorithm itself, so that the error in solution returned should be smaller that a user-specified absolute tolerance. I have tested the function thoroughly, and it works very well. Although my tries to translate the package failed so far (discussion about that is already in the list,) the non-translated version is still very fast. rkf45 comes with extensive documentation; in a 40-pages pdf file, the syntax and several examples (for both non-stiff and stiff problems) are discussed in detail. Anyone who is interested on differential equations, please use the function, if possible to solve difficult initial value problems (but not extremely stiff, as the function implements an explicit method, and, as such, it is not specifically designed for such kind of problems.) You should be able to solve difficult problems easily. Any remarks or suggestions are more than welcome. I believe it would be nice if the function is added to maxima/share, as it provides functionality not available in Maxima. All necessary files can be found in my little website, at https://sites.google.com/site/pjpapasot/maxima/libraries/rkf45 You will find the package itself, a demo file, and the documentation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon Oct 24 16:54:31 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 24 Oct 2011 15:54:31 -0600 Subject: [Maxima] got error when try to run calculation In-Reply-To: References: Message-ID: Razif, it's probably an unterminated function recursion. To solve the problem, we'd have to see the code which caused the error. best Robert Dodier From macrakis at alum.mit.edu Mon Oct 24 17:56:28 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 24 Oct 2011 18:56:28 -0400 Subject: [Maxima] display expression exactly as entered In-Reply-To: <1319496668.95809.YahooMailNeo@web161804.mail.bf1.yahoo.com> References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> <1319479749.33086.YahooMailNeo@web161805.mail.bf1.yahoo.com> <1319481722.23410.YahooMailNeo@web161801.mail.bf1.yahoo.com> <1319496668.95809.YahooMailNeo@web161804.mail.bf1.yahoo.com> Message-ID: You're missing the newline/Enter/Return between the Lisp and the Maxima statements. On Oct 24, 2011 6:51 PM, "Ether Jones" wrote: > > (%i1) :lisp (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) (terpri) > ',x)) > dd(x/x); > > Maxima encountered a Lisp error: > Error in PROGN [or a callee]: The variable DD is unbound. > Automatically continuing. > To enable the Lisp debugger set *debugger-hook* to nil. > > > See attached screenshot > > ------------------------------ > *From:* Stavros Macrakis > *To:* Ether Jones > *Cc:* maxima > *Sent:* Monday, October 24, 2011 3:56 PM > *Subject:* Re: [Maxima] display expression exactly as entered > > Well, if that's your use case, then you might want to redefine the > read-eval-print loop (if you *always* want to see the unsimplified form) or > use the following macro > > (%i13) :lisp (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) (terpri) > ',x)) > (%i14) dd(x/x); > x > (raw) - > x > > (%o14) 1 > > It prints the unsimplified form, and returns the value, whereupon it is > simplified in the normal way. > > You will always get better replies to your queries if you explain **why** > you want to do what you're asking for.... > > -s > > On Mon, Oct 24, 2011 at 14:42, Ether Jones wrote: > > > Yes, but as soon as you 'touch' it again, it will be simplified. > > Understood, and acceptable. > > Why exactly do you want this? > > I want the expression I manually enter to appear exactly the way I typed it > for three reasons, all of which you have anticipated: > > 1) to confirm that I entered it correctly, and > > 2) for me to see it in 2D the way I entered it so that I can examine it for > insight as to how I want to proceed, and > > 3) most importantly, because I entered it the way I did for a reason, and I > want it to display that way (when I first enter it). That reason is, it > corresponds more clearly with the flow of the derivation argument I am > making (for example, it more closely corresponds with any figures or > diagrams I have prepared). > > Thanks for your help. > > > ------------------------------ > *From:* Stavros Macrakis > *To:* Ether Jones > *Cc:* maxima > *Sent:* Monday, October 24, 2011 2:20 PM > > *Subject:* Re: [Maxima] display expression exactly as entered > > Yes, but as soon as you 'touch' it again, it will be simplified. > > Why exactly do you want this? Is it to confirm that you entered the > expression correctly? Then maybe something like the following would be > useful? > > (%i2) inputprint(n):= block([simp:false], apply('display,[concat('%i,n)]))$ > (%i3) x/x; > (%o3) 1 > (%i4) x/4*1/(x+1); > (%o4) x/(4*(x+1)) > (%i5) inputprint(3)$ > %i3 = x/x > (%i6) inputprint(4); > %i4 = x/4*1/(x+1) > > It looks as though the playback function could have an option to print the > input (not just output) expressions in 2d. Would that solve your problem? > > -s > > On Mon, Oct 24, 2011 at 14:09, Ether Jones wrote: > > > Thanks for the suggestion Stavros. Bracketing the expression with > simp:false and simp:true seems to give what I want: > > simp:false$ > ex1: (W/4)*(1/()); > simp:true$ > ex1; > > See attached PNG screenshot for output. > > > ------------------------------ > *From:* Stavros Macrakis > *To:* Ether Jones > *Cc:* maxima > *Sent:* Monday, October 24, 2011 10:49 AM > *Subject:* Re: [Maxima] display expression exactly as entered > > You can disable Maxima's default transformations a.k.a. general > simplification, by setting simp:false. > > However, this breaks most of Maxima's functionality. For example: > > (%i4) simp:false; > (%o4) false > (%i5) (W/4)*(1/(1+x)); > (%o5) W/4*(1/(1+x)) > (%i6) diff(%,x); > (%o6) 'diff(1/(1+x),x,1)*(W/4)+0*(1/(1+x)) > > In this case, 0*(1/(1+x)) is not simplified to 0, diff(1/(1+x),x,1) is not > performed. This second case may seem mysterious until you understand that > Maxima normally does not use a division operator internally, but transforms > it to multiplication and exponentiation -- (a/b) internally is actually a * > b^-1, as you can see in the Lisp representation: > > (%i7) ?print(a/b)$ > ((MQUOTIENT) $A $B) > (%i8) simp:true$ > (%i9) ?print(a/b)$ > ((MTIMES SIMP) $A ((MEXPT SIMP) $B -1)) > > You can also block default simplifications by using the "box" function (and > set boxchar:" " if you want the boxes to be invisible). > > But this doesn't guarantee to preserve order: > > (%i3) box(W/4)*box(1/(1+x)); > (%o3) box(1/(x+1))*box(W/4) > > And Maxima functions treat boxes as unknown functions: > > (%i4) diff(%,x); > (%o4) 'diff(box(1/(x+1)),x,1)*box(W/4) > > Why exactly do you want to preserve your input form? Is it because you > find it more intuitive when you're manipulating the expression? Because you > want to present this form as part of your output? Because you want to do > transformations which depend on the form of the expression? > > In the last case, you might want to look at ratsubst rather than subst: > > (%i5) expr: (W/4)*(1/(1+x)); > (%o5) W/(4*(x+1)) > (%i6) subst(q,W/4,%); > (%o6) W/(4*(x+1)) <<< W/4 is not syntactically > present in expr > (%i7) ratsubst(q,W/4,%); > (%o7) q/(x+1) <<< but ratsubst recognizes it > > Does that help? > > -s > > > On Mon, Oct 24, 2011 at 10:01, Ether Jones wrote: > > Hello, > > Is there a way to force maxima to display an expression exactly as I have > entered it, rather than "simplifying" it for me? > > For example, when I enter (W/4)*(1/(1+x)) it displays as W/(4*(x+1)) > > Please see attached WXM file or the PNG screenshot. > > 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 macrakis at alum.mit.edu Mon Oct 24 17:57:51 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 24 Oct 2011 18:57:51 -0400 Subject: [Maxima] display expression exactly as entered In-Reply-To: References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> <1319479749.33086.YahooMailNeo@web161805.mail.bf1.yahoo.com> <1319481722.23410.YahooMailNeo@web161801.mail.bf1.yahoo.com> <1319496668.95809.YahooMailNeo@web161804.mail.bf1.yahoo.com> Message-ID: PS Rather than screen shots, please just give a text transcript using display2d: false. On Oct 24, 2011 6:56 PM, "Stavros Macrakis" wrote: > You're missing the newline/Enter/Return between the Lisp and the Maxima > statements. > On Oct 24, 2011 6:51 PM, "Ether Jones" wrote: > >> >> (%i1) :lisp (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) >> (terpri) ',x)) >> dd(x/x); >> >> Maxima encountered a Lisp error: >> Error in PROGN [or a callee]: The variable DD is unbound. >> Automatically continuing. >> To enable the Lisp debugger set *debugger-hook* to nil. >> >> >> See attached screenshot >> >> ------------------------------ >> *From:* Stavros Macrakis >> *To:* Ether Jones >> *Cc:* maxima >> *Sent:* Monday, October 24, 2011 3:56 PM >> *Subject:* Re: [Maxima] display expression exactly as entered >> >> Well, if that's your use case, then you might want to redefine the >> read-eval-print loop (if you *always* want to see the unsimplified form) or >> use the following macro >> >> (%i13) :lisp (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) >> (terpri) ',x)) >> (%i14) dd(x/x); >> x >> (raw) - >> x >> >> (%o14) 1 >> >> It prints the unsimplified form, and returns the value, whereupon it is >> simplified in the normal way. >> >> You will always get better replies to your queries if you explain **why** >> you want to do what you're asking for.... >> >> -s >> >> On Mon, Oct 24, 2011 at 14:42, Ether Jones wrote: >> >> >> Yes, but as soon as you 'touch' it again, it will be simplified. >> >> Understood, and acceptable. >> >> Why exactly do you want this? >> >> I want the expression I manually enter to appear exactly the way I typed >> it for three reasons, all of which you have anticipated: >> >> 1) to confirm that I entered it correctly, and >> >> 2) for me to see it in 2D the way I entered it so that I can examine it >> for insight as to how I want to proceed, and >> >> 3) most importantly, because I entered it the way I did for a reason, and >> I want it to display that way (when I first enter it). That reason is, it >> corresponds more clearly with the flow of the derivation argument I am >> making (for example, it more closely corresponds with any figures or >> diagrams I have prepared). >> >> Thanks for your help. >> >> >> ------------------------------ >> *From:* Stavros Macrakis >> *To:* Ether Jones >> *Cc:* maxima >> *Sent:* Monday, October 24, 2011 2:20 PM >> >> *Subject:* Re: [Maxima] display expression exactly as entered >> >> Yes, but as soon as you 'touch' it again, it will be simplified. >> >> Why exactly do you want this? Is it to confirm that you entered the >> expression correctly? Then maybe something like the following would be >> useful? >> >> (%i2) inputprint(n):= block([simp:false], >> apply('display,[concat('%i,n)]))$ >> (%i3) x/x; >> (%o3) 1 >> (%i4) x/4*1/(x+1); >> (%o4) x/(4*(x+1)) >> (%i5) inputprint(3)$ >> %i3 = x/x >> (%i6) inputprint(4); >> %i4 = x/4*1/(x+1) >> >> It looks as though the playback function could have an option to print the >> input (not just output) expressions in 2d. Would that solve your problem? >> >> -s >> >> On Mon, Oct 24, 2011 at 14:09, Ether Jones wrote: >> >> >> Thanks for the suggestion Stavros. Bracketing the expression with >> simp:false and simp:true seems to give what I want: >> >> simp:false$ >> ex1: (W/4)*(1/()); >> simp:true$ >> ex1; >> >> See attached PNG screenshot for output. >> >> >> ------------------------------ >> *From:* Stavros Macrakis >> *To:* Ether Jones >> *Cc:* maxima >> *Sent:* Monday, October 24, 2011 10:49 AM >> *Subject:* Re: [Maxima] display expression exactly as entered >> >> You can disable Maxima's default transformations a.k.a. general >> simplification, by setting simp:false. >> >> However, this breaks most of Maxima's functionality. For example: >> >> (%i4) simp:false; >> (%o4) false >> (%i5) (W/4)*(1/(1+x)); >> (%o5) W/4*(1/(1+x)) >> (%i6) diff(%,x); >> (%o6) 'diff(1/(1+x),x,1)*(W/4)+0*(1/(1+x)) >> >> In this case, 0*(1/(1+x)) is not simplified to 0, diff(1/(1+x),x,1) is not >> performed. This second case may seem mysterious until you understand that >> Maxima normally does not use a division operator internally, but transforms >> it to multiplication and exponentiation -- (a/b) internally is actually a * >> b^-1, as you can see in the Lisp representation: >> >> (%i7) ?print(a/b)$ >> ((MQUOTIENT) $A $B) >> (%i8) simp:true$ >> (%i9) ?print(a/b)$ >> ((MTIMES SIMP) $A ((MEXPT SIMP) $B -1)) >> >> You can also block default simplifications by using the "box" function >> (and set boxchar:" " if you want the boxes to be invisible). >> >> But this doesn't guarantee to preserve order: >> >> (%i3) box(W/4)*box(1/(1+x)); >> (%o3) box(1/(x+1))*box(W/4) >> >> And Maxima functions treat boxes as unknown functions: >> >> (%i4) diff(%,x); >> (%o4) 'diff(box(1/(x+1)),x,1)*box(W/4) >> >> Why exactly do you want to preserve your input form? Is it because you >> find it more intuitive when you're manipulating the expression? Because you >> want to present this form as part of your output? Because you want to do >> transformations which depend on the form of the expression? >> >> In the last case, you might want to look at ratsubst rather than subst: >> >> (%i5) expr: (W/4)*(1/(1+x)); >> (%o5) W/(4*(x+1)) >> (%i6) subst(q,W/4,%); >> (%o6) W/(4*(x+1)) <<< W/4 is not syntactically >> present in expr >> (%i7) ratsubst(q,W/4,%); >> (%o7) q/(x+1) <<< but ratsubst recognizes it >> >> Does that help? >> >> -s >> >> >> On Mon, Oct 24, 2011 at 10:01, Ether Jones wrote: >> >> Hello, >> >> Is there a way to force maxima to display an expression exactly as I have >> entered it, rather than "simplifying" it for me? >> >> For example, when I enter (W/4)*(1/(1+x)) it displays as W/(4*(x+1)) >> >> Please see attached WXM file or the PNG screenshot. >> >> 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 macrakis at alum.mit.edu Mon Oct 24 19:54:40 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 24 Oct 2011 20:54:40 -0400 Subject: [Maxima] display expression exactly as entered In-Reply-To: References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> <1319479749.33086.YahooMailNeo@web161805.mail.bf1.yahoo.com> <1319481722.23410.YahooMailNeo@web161801.mail.bf1.yahoo.com> <1319496668.95809.YahooMailNeo@web161804.mail.bf1.yahoo.com> Message-ID: pps this may be a wxmaxima issue. Try a semicolon after the Lisp expression... On Oct 24, 2011 6:57 PM, "Stavros Macrakis" wrote: > PS Rather than screen shots, please just give a text transcript using > display2d: false. > On Oct 24, 2011 6:56 PM, "Stavros Macrakis" wrote: > >> You're missing the newline/Enter/Return between the Lisp and the Maxima >> statements. >> On Oct 24, 2011 6:51 PM, "Ether Jones" wrote: >> >>> >>> (%i1) :lisp (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) >>> (terpri) ',x)) >>> dd(x/x); >>> >>> Maxima encountered a Lisp error: >>> Error in PROGN [or a callee]: The variable DD is unbound. >>> Automatically continuing. >>> To enable the Lisp debugger set *debugger-hook* to nil. >>> >>> >>> See attached screenshot >>> >>> ------------------------------ >>> *From:* Stavros Macrakis >>> *To:* Ether Jones >>> *Cc:* maxima >>> *Sent:* Monday, October 24, 2011 3:56 PM >>> *Subject:* Re: [Maxima] display expression exactly as entered >>> >>> Well, if that's your use case, then you might want to redefine the >>> read-eval-print loop (if you *always* want to see the unsimplified form) or >>> use the following macro >>> >>> (%i13) :lisp (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) >>> (terpri) ',x)) >>> (%i14) dd(x/x); >>> x >>> (raw) - >>> x >>> >>> (%o14) 1 >>> >>> It prints the unsimplified form, and returns the value, whereupon it is >>> simplified in the normal way. >>> >>> You will always get better replies to your queries if you explain **why** >>> you want to do what you're asking for.... >>> >>> -s >>> >>> On Mon, Oct 24, 2011 at 14:42, Ether Jones wrote: >>> >>> >>> Yes, but as soon as you 'touch' it again, it will be simplified. >>> >>> Understood, and acceptable. >>> >>> Why exactly do you want this? >>> >>> I want the expression I manually enter to appear exactly the way I typed >>> it for three reasons, all of which you have anticipated: >>> >>> 1) to confirm that I entered it correctly, and >>> >>> 2) for me to see it in 2D the way I entered it so that I can examine it >>> for insight as to how I want to proceed, and >>> >>> 3) most importantly, because I entered it the way I did for a reason, and >>> I want it to display that way (when I first enter it). That reason is, it >>> corresponds more clearly with the flow of the derivation argument I am >>> making (for example, it more closely corresponds with any figures or >>> diagrams I have prepared). >>> >>> Thanks for your help. >>> >>> >>> ------------------------------ >>> *From:* Stavros Macrakis >>> *To:* Ether Jones >>> *Cc:* maxima >>> *Sent:* Monday, October 24, 2011 2:20 PM >>> >>> *Subject:* Re: [Maxima] display expression exactly as entered >>> >>> Yes, but as soon as you 'touch' it again, it will be simplified. >>> >>> Why exactly do you want this? Is it to confirm that you entered the >>> expression correctly? Then maybe something like the following would be >>> useful? >>> >>> (%i2) inputprint(n):= block([simp:false], >>> apply('display,[concat('%i,n)]))$ >>> (%i3) x/x; >>> (%o3) 1 >>> (%i4) x/4*1/(x+1); >>> (%o4) x/(4*(x+1)) >>> (%i5) inputprint(3)$ >>> %i3 = x/x >>> (%i6) inputprint(4); >>> %i4 = x/4*1/(x+1) >>> >>> It looks as though the playback function could have an option to print >>> the input (not just output) expressions in 2d. Would that solve your >>> problem? >>> >>> -s >>> >>> On Mon, Oct 24, 2011 at 14:09, Ether Jones wrote: >>> >>> >>> Thanks for the suggestion Stavros. Bracketing the expression with >>> simp:false and simp:true seems to give what I want: >>> >>> simp:false$ >>> ex1: (W/4)*(1/()); >>> simp:true$ >>> ex1; >>> >>> See attached PNG screenshot for output. >>> >>> >>> ------------------------------ >>> *From:* Stavros Macrakis >>> *To:* Ether Jones >>> *Cc:* maxima >>> *Sent:* Monday, October 24, 2011 10:49 AM >>> *Subject:* Re: [Maxima] display expression exactly as entered >>> >>> You can disable Maxima's default transformations a.k.a. general >>> simplification, by setting simp:false. >>> >>> However, this breaks most of Maxima's functionality. For example: >>> >>> (%i4) simp:false; >>> (%o4) false >>> (%i5) (W/4)*(1/(1+x)); >>> (%o5) W/4*(1/(1+x)) >>> (%i6) diff(%,x); >>> (%o6) 'diff(1/(1+x),x,1)*(W/4)+0*(1/(1+x)) >>> >>> In this case, 0*(1/(1+x)) is not simplified to 0, diff(1/(1+x),x,1) is >>> not performed. This second case may seem mysterious until you understand >>> that Maxima normally does not use a division operator internally, but >>> transforms it to multiplication and exponentiation -- (a/b) internally is >>> actually a * b^-1, as you can see in the Lisp representation: >>> >>> (%i7) ?print(a/b)$ >>> ((MQUOTIENT) $A $B) >>> (%i8) simp:true$ >>> (%i9) ?print(a/b)$ >>> ((MTIMES SIMP) $A ((MEXPT SIMP) $B -1)) >>> >>> You can also block default simplifications by using the "box" function >>> (and set boxchar:" " if you want the boxes to be invisible). >>> >>> But this doesn't guarantee to preserve order: >>> >>> (%i3) box(W/4)*box(1/(1+x)); >>> (%o3) box(1/(x+1))*box(W/4) >>> >>> And Maxima functions treat boxes as unknown functions: >>> >>> (%i4) diff(%,x); >>> (%o4) 'diff(box(1/(x+1)),x,1)*box(W/4) >>> >>> Why exactly do you want to preserve your input form? Is it because you >>> find it more intuitive when you're manipulating the expression? Because you >>> want to present this form as part of your output? Because you want to do >>> transformations which depend on the form of the expression? >>> >>> In the last case, you might want to look at ratsubst rather than subst: >>> >>> (%i5) expr: (W/4)*(1/(1+x)); >>> (%o5) W/(4*(x+1)) >>> (%i6) subst(q,W/4,%); >>> (%o6) W/(4*(x+1)) <<< W/4 is not syntactically >>> present in expr >>> (%i7) ratsubst(q,W/4,%); >>> (%o7) q/(x+1) <<< but ratsubst recognizes >>> it >>> >>> Does that help? >>> >>> -s >>> >>> >>> On Mon, Oct 24, 2011 at 10:01, Ether Jones wrote: >>> >>> Hello, >>> >>> Is there a way to force maxima to display an expression exactly as I have >>> entered it, rather than "simplifying" it for me? >>> >>> For example, when I enter (W/4)*(1/(1+x)) it displays as W/(4*(x+1)) >>> >>> Please see attached WXM file or the PNG screenshot. >>> >>> 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 maxima at etherjones.us Mon Oct 24 21:23:08 2011 From: maxima at etherjones.us (Ether Jones) Date: Mon, 24 Oct 2011 19:23:08 -0700 (PDT) Subject: [Maxima] display expression exactly as entered In-Reply-To: References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> <1319479749.33086.YahooMailNeo@web161805.mail.bf1.yahoo.com> <1319481722.23410.YahooMailNeo@web161801.mail.bf1.yahoo.com> <1319496668.95809.YahooMailNeo@web161804.mail.bf1.yahoo.com> Message-ID: <1319509388.60458.YahooMailNeo@web161804.mail.bf1.yahoo.com> Excellent. Thank you. (see attached screenshot) ________________________________ From: Stavros Macrakis To: Ether Jones Cc: maxima Sent: Monday, October 24, 2011 6:56 PM Subject: Re: [Maxima] display expression exactly as entered You're missing the newline/Enter/Return between the Lisp and the Maxima statements. On Oct 24, 2011 6:51 PM, "Ether Jones" wrote: > >(%i1) :lisp (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) (terpri) ',x)) >????? dd(x/x); > >Maxima encountered a Lisp error: >? Error in PROGN [or a callee]: The variable DD is unbound. >Automatically continuing. >To enable the Lisp debugger set *debugger-hook* to nil. > > > > >See attached screenshot > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: _simp_dd.png Type: image/png Size: 19806 bytes Desc: not available URL: From razif66 at gmail.com Mon Oct 24 22:43:45 2011 From: razif66 at gmail.com (razif razali) Date: Tue, 25 Oct 2011 11:43:45 +0800 Subject: [Maxima] got error when try to run calculation In-Reply-To: References: Message-ID: ok here i attach the file, braket.mac i put in /usr/local/share/maxima/5.24.0/share/ folder, then in maxima i give below command, (%i1)load("pnn_4"); On Tue, Oct 25, 2011 at 5:54 AM, Robert Dodier wrote: > Razif, it's probably an unterminated function recursion. > To solve the problem, we'd have to see the code which > caused the error. > > best > > Robert Dodier > -- 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_4 Type: application/octet-stream Size: 1488 bytes Desc: not available URL: From toy.raymond at gmail.com Mon Oct 24 23:14:15 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 24 Oct 2011 21:14:15 -0700 Subject: [Maxima] got error when try to run calculation In-Reply-To: References: Message-ID: <4EA63797.1060705@gmail.com> On 10/24/11 8:43 PM, razif razali wrote: > ok here i attach the file, > > braket.mac i put in /usr/local/share/maxima/5.24.0/share/ folder, > > then in maxima i give below command, > > (%i1)load("pnn_4"); I didn't have any problems with this using maxima cvs and clisp 2.49. Do you have any information on exactly where the problem is occurring? I did notice that I can't load pnn_4 twice because tellsimp complains about circular rules, which I guess is true. Ray From dlakelan at street-artists.org Mon Oct 24 23:27:03 2011 From: dlakelan at street-artists.org (dlakelan) Date: Mon, 24 Oct 2011 21:27:03 -0700 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: <4EA63A97.2000600@street-artists.org> On 10/24/2011 02:12 PM, Panagiotis Papasotiriou wrote: > Dear community, > > I have written a Maxima package for solving initial value problems. The > package implements a Maxima function called rkf45, which is an > implementation of the Runge-Kutta-Fehlberg method of 4th-5th order. ... Thank you very much for this contribution to Maxima, I hope one of the maxima developers will include it into the standard distribution as a shared package. However, rather than having a rkf45 specific share package, perhaps we should create a "numode" or other package named after the type of problem, where we can put several related numerical differential equation codes. For example perhaps the next task someone will take on will be some kind of implicit scheme for stiff systems, or someone else will produce boundary value problem solvers. Organizing shared code by the task they solve rather than the method used helps the naive user to find the code. Again thanks for your contribution, I'm sure I will have occasion to use this code soon. From toy.raymond at gmail.com Tue Oct 25 00:15:28 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 24 Oct 2011 22:15:28 -0700 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: <4EA63A97.2000600@street-artists.org> References: <4EA63A97.2000600@street-artists.org> Message-ID: <4EA645F0.3070606@gmail.com> On 10/24/11 9:27 PM, dlakelan wrote: > On 10/24/2011 02:12 PM, Panagiotis Papasotiriou wrote: >> Dear community, >> >> I have written a Maxima package for solving initial value problems. The >> package implements a Maxima function called rkf45, which is an >> implementation of the Runge-Kutta-Fehlberg method of 4th-5th order. > ... > > Thank you very much for this contribution to Maxima, I hope one of the > maxima developers will include it into the standard distribution as a > shared package. However, rather than having a rkf45 specific share > package, perhaps we should create a "numode" or other package named > after the type of problem, where we can put several related numerical > differential equation codes. For example perhaps the next task someone > will take on will be some kind of implicit scheme for stiff systems, or > someone else will produce boundary value problem solvers. colnew will do boundary value problems. This is already included in maxima. I have a translation via f2cl of odepack, which can do stiff odes. This is not in maxima but could be. > > Organizing shared code by the task they solve rather than the method > used helps the naive user to find the code. > It's unfortunate that ?? doesn't work with share packages. Then appropriately named share packages could be found. Ray From p.j.papasot at gmail.com Tue Oct 25 01:25:04 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 25 Oct 2011 09:25:04 +0300 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: <4EA63A97.2000600@street-artists.org> References: <4EA63A97.2000600@street-artists.org> Message-ID: 2011/10/25 dlakelan > On 10/24/2011 02:12 PM, Panagiotis Papasotiriou wrote: > > Dear community, > > > > I have written a Maxima package for solving initial value problems. The > > package implements a Maxima function called rkf45, which is an > > implementation of the Runge-Kutta-Fehlberg method of 4th-5th order. > ... > > Thank you very much for this contribution to Maxima, I hope one of the > maxima developers will include it into the standard distribution as a > shared package. However, rather than having a rkf45 specific share > package, perhaps we should create a "numode" or other package named > after the type of problem, where we can put several related numerical > differential equation codes. For example perhaps the next task someone > will take on will be some kind of implicit scheme for stiff systems, or > someone else will produce boundary value problem solvers. > These are actually in my plans for the near future. Specifically, I am planning to implement: (1) An improved function for cubic spline interpolation (this is more or less necessary after solving differential equations.) It should support "not-a-knot", "quadratic", "prolonged", "clamped", and "natural" splines (the latter is not really useful in most cases, but it is traditionally used a lot, although it shouldn't be.) this function should also be able to differentiate or integrate the interpolating functions. This task will also need a numerical method for solving tridiagonal systems of equations. (2) An easy-to-use function for solving boundary value problems by the shooting method. This would also need several other things, such as LU decomposition, Brent's method for computing the root of a function, and Broyden's method for solving systems of non-linear equations (mnewton could be used for that task, but I think Broyden's method is more appropriate. I'm not a big fan of Newton methods, for several reasons.) (3) A function for computing all the roots of a function within a given interval, using the Kronecker-Picard theory. This would not be restricted to polynomials. Many other things are also in my plans, but with lower priority. > Organizing shared code by the task they solve rather than the method > used helps the naive user to find the code. > I agree completely. > Again thanks for your contribution, I'm sure I will have occasion to use > this code soon. > Thank you for your kind words. > _______________________________________________ > 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 p.j.papasot at gmail.com Tue Oct 25 01:36:13 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 25 Oct 2011 09:36:13 +0300 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: <4EA63A97.2000600@street-artists.org> <4EA645F0.3070606@gmail.com> Message-ID: 2011/10/25 Raymond Toy > I have a translation via f2cl of odepack, which can do stiff odes. This > is not in maxima but could be. > Odepack is an excellent package. It would be really useful if we could use it in Maxima, but a simplifying interface would also be needed, as Odepack subroutines accept a big amount of arguments, but many of them can be set automatically, so the user doesn't need to bother about them. Interface should also provide optional arguments for full functionality. I am very familiar with Odepack and I think I can implement the interfacing function, if needed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From razif66 at gmail.com Tue Oct 25 03:27:30 2011 From: razif66 at gmail.com (razif razali) Date: Tue, 25 Oct 2011 16:27:30 +0800 Subject: [Maxima] got error when try to run calculation In-Reply-To: <4EA63797.1060705@gmail.com> References: <4EA63797.1060705@gmail.com> Message-ID: So you can run pnn_4?i cant finish pnn_4, its give error when the script at line 16...maybe i should upgrade my lisp? Can you explain more on maxima complain on circular rules? On Oct 25, 2011 12:14 PM, "Raymond Toy" wrote: > On 10/24/11 8:43 PM, razif razali wrote: > > ok here i attach the file, > > > > braket.mac i put in /usr/local/share/maxima/5.24.0/share/ folder, > > > > then in maxima i give below command, > > > > (%i1)load("pnn_4"); > > I didn't have any problems with this using maxima cvs and clisp 2.49. > > Do you have any information on exactly where the problem is occurring? > I did notice that I can't load pnn_4 twice because tellsimp complains > about circular rules, which I guess is true. > > Ray > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxima at etherjones.us Mon Oct 24 17:51:08 2011 From: maxima at etherjones.us (Ether Jones) Date: Mon, 24 Oct 2011 15:51:08 -0700 (PDT) Subject: [Maxima] display expression exactly as entered In-Reply-To: References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> <1319479749.33086.YahooMailNeo@web161805.mail.bf1.yahoo.com> <1319481722.23410.YahooMailNeo@web161801.mail.bf1.yahoo.com> Message-ID: <1319496668.95809.YahooMailNeo@web161804.mail.bf1.yahoo.com> (%i1) :lisp (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) (terpri) ',x)) ????? dd(x/x); Maxima encountered a Lisp error: ? Error in PROGN [or a callee]: The variable DD is unbound. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. See attached screenshot ________________________________ From: Stavros Macrakis To: Ether Jones Cc: maxima Sent: Monday, October 24, 2011 3:56 PM Subject: Re: [Maxima] display expression exactly as entered Well, if that's your use case, then you might want to redefine the read-eval-print loop (if you *always* want to see the unsimplified form) or use the following macro (%i13) :lisp (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) (terpri) ',x)) (%i14) dd(x/x); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?x (raw) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?x (%o14) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 1 It prints the unsimplified form, and returns the value, whereupon it is simplified in the normal way. You will always get better replies to your queries if you explain **why** you want to do what you're asking for.... ? ? ? ? ? ?-s On Mon, Oct 24, 2011 at 14:42, Ether Jones wrote: > >Yes, but as soon as you 'touch' it again, it will be simplified. > > >Understood, and acceptable. > > >Why exactly do you want this? > >I want the expression I manually enter to appear exactly the way I typed it for three reasons, all of which you have anticipated: > >1) to confirm that I entered it correctly, and > >2) for me to see it in 2D the way I entered it so that I can examine it for insight as to how I want to proceed, and > >3) most importantly, because I entered it the way I did for a reason, and I want it to display that way (when I first enter it).? That reason is, it corresponds more clearly with the flow of the derivation argument I am making (for example, it more closely corresponds with any figures or diagrams I have prepared). > >Thanks for your help. > > > > > >________________________________ >From: Stavros Macrakis >To: Ether Jones >Cc: maxima >Sent: Monday, October 24, 2011 2:20 PM > >Subject: Re: [Maxima] display expression exactly as entered > > > >Yes, but as soon as you 'touch' it again, it will be simplified. > > >Why exactly do you want this? ?Is it to confirm that you entered the expression correctly? ?Then maybe something like the following would be useful? > > >(%i2) inputprint(n):= block([simp:false], apply('display,[concat('%i,n)]))$ >(%i3) x/x; >(%o3) 1 >(%i4) x/4*1/(x+1); >(%o4) x/(4*(x+1)) >(%i5) inputprint(3)$ >%i3 = x/x >(%i6) inputprint(4); >%i4 = x/4*1/(x+1) > > >It looks as though the playback function could have an option to print the input (not just output) expressions in 2d. ?Would that solve your problem? > > >? ? ? ? ? ?-s > > >On Mon, Oct 24, 2011 at 14:09, Ether Jones wrote: > > >> >>Thanks for the suggestion Stavros. Bracketing the expression with simp:false and simp:true seems to give what I want: >> >> >>simp:false$ >>ex1: (W/4)*(1/()); >>simp:true$ >>ex1; >> >> >>See attached PNG screenshot for output. >> >> >> >> >> >>________________________________ >> From: Stavros Macrakis >>To: Ether Jones >>Cc: maxima >>Sent: Monday, October 24, 2011 10:49 AM >>Subject: Re: [Maxima] display expression exactly as entered >> >> >> >>You can disable Maxima's default transformations a.k.a. general simplification, by setting simp:false. >> >> >>However, this breaks most of Maxima's functionality. ?For example: >> >> >>(%i4) simp:false; >>(%o4) false >>(%i5) (W/4)*(1/(1+x)); >>(%o5) W/4*(1/(1+x)) >>(%i6) diff(%,x); >>(%o6) 'diff(1/(1+x),x,1)*(W/4)+0*(1/(1+x)) >> >> >>In this case, 0*(1/(1+x)) is not simplified to 0, diff(1/(1+x),x,1) is not performed. ?This second case may seem mysterious until you understand that Maxima normally does not use a division operator internally, but transforms it to multiplication and exponentiation -- (a/b) internally is actually a * b^-1, as you can see in the Lisp representation: >> >> >>(%i7) ?print(a/b)$ >>((MQUOTIENT) $A $B)? >>(%i8) simp:true$ >>(%i9) ?print(a/b)$ >>((MTIMES SIMP) $A ((MEXPT SIMP) $B -1))? >> >> >>You can also block default simplifications by using the "box" function (and set boxchar:" " if you want the boxes to be invisible). >> >> >>But this doesn't guarantee to preserve order: >> >> >>(%i3) box(W/4)*box(1/(1+x)); >>(%o3) box(1/(x+1))*box(W/4) >> >> >>And Maxima functions treat boxes as unknown functions: >> >> >>(%i4) diff(%,x); >>(%o4) 'diff(box(1/(x+1)),x,1)*box(W/4) >> >> >>Why exactly do you want to preserve your input form? ?Is it because you find it more intuitive when you're manipulating the expression? ?Because you want to present this form as part of your output? ?Because you want to do transformations which depend on the form of the expression? >> >> >>In the last case, you might want to look at ratsubst rather than subst: >> >> >>(%i5) expr: (W/4)*(1/(1+x)); >>(%o5) W/(4*(x+1)) >>(%i6) subst(q,W/4,%); >>(%o6) W/(4*(x+1)) ? ? ? ? ? ? ? ? ? ? ? ? <<< W/4 is not syntactically present in expr >>(%i7) ratsubst(q,W/4,%); >>(%o7) q/(x+1) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? <<< but ratsubst recognizes it >> >> >>Does that help? >> >> >>? ? ? ? ? ? -s >> >> >> >> >>On Mon, Oct 24, 2011 at 10:01, Ether Jones wrote: >>Hello, >>> >>> >>>Is there a way to force maxima to display an expression exactly as I have entered it, rather than "simplifying" it for me? >>> >>> >>>For example, when I enter (W/4)*(1/(1+x)) it displays as ? W/(4*(x+1)) >>> >>> >>> >>>Please see attached WXM file or the PNG screenshot. >>> >>> >>>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: -------------- next part -------------- A non-text attachment was scrubbed... Name: _lisp error.png Type: image/png Size: 18984 bytes Desc: not available URL: From luigi_marino2 at alice.it Tue Oct 25 01:41:51 2011 From: luigi_marino2 at alice.it (Luigi Marino) Date: Tue, 25 Oct 2011 08:41:51 +0200 Subject: [Maxima] Completing square, cube Message-ID: <9B77B19215B54C25A0BFF7688DB35A7B@luigi3b0e34c8e> Chris I have tried completing square but it is not correct. I tried x^2-5*x+6 and the out is: (x-5/2)^2- 99/4 The function correct is: comp_square(ex,var) := block([vc], if not(atom(var)) or numberp(var) then (print("comp_square: var should be an atom but not a number. "), return(ex)), ex:ratsimp(expand(ex)), if not(polynomialp(ex,[var])) then (print("comp_square: ex should be a polynomial in var. "), return(ex)), if hipow(ex,var)#2 then (print("comp_square: ex should be a quadratic. "), return(ex)), vc:coeff(ex,var,1)/(2*coeff(ex,var,2)), return(coeff(ex,var,2)*((var+vc)^2+coeff(ex,var,0)-coeff(ex,x,1)^2/4)) )$ Now the out is: (x^2-5/2)^2 -1/4 that is correct. Best. Luigi Marino -------------- next part -------------- An HTML attachment was scrubbed... URL: From jarmo.hurri at syk.fi Tue Oct 25 04:23:33 2011 From: jarmo.hurri at syk.fi (Jarmo Hurri) Date: Tue, 25 Oct 2011 12:23:33 +0300 Subject: [Maxima] Command completion in imaxima Message-ID: Greetings. I have missed command completion in imaxima, but today I noticed that there _should_ be one; I just can not get it to work. In imaxima, when I type integrat and type M-TAB, emacs says No completions available... What have I missed? I am running GNU Emacs 23.2.1 and have installed imaxima.el,v 1.24 2009/02/11 Thank you very much for your help in advance. -- Jarmo From rswarbrick at gmail.com Tue Oct 25 09:20:57 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Tue, 25 Oct 2011 15:20:57 +0100 Subject: [Maxima] display expression exactly as entered References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> <1319479749.33086.YahooMailNeo@web161805.mail.bf1.yahoo.com> <1319481722.23410.YahooMailNeo@web161801.mail.bf1.yahoo.com> <1319496668.95809.YahooMailNeo@web161804.mail.bf1.yahoo.com> Message-ID: Ether Jones writes: > (%i1) :lisp (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) (terpri) ',x)) > ????? dd(x/x); > > Maxima encountered a Lisp error: > ? Error in PROGN [or a callee]: The variable DD is unbound. > Automatically continuing. > To enable the Lisp debugger set *debugger-hook* to nil. That's because the dd(x/x) should have been on a new line. What you typed made the lisp try to evaluate three forms (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) (terpri) ',x)) dd (x/x) the third calls a (nonexistant) function called x/x. If the "dd" form hadn't caused your lisp implementation to error out, it would have done too. 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 Tue Oct 25 10:05:28 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 25 Oct 2011 09:05:28 -0600 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: On 10/24/11, Panagiotis Papasotiriou wrote: > I have written a Maxima package for solving initial value problems. The > package implements a Maxima function called rkf45, which is an > implementation of the Runge-Kutta-Fehlberg method of 4th-5th order. > I believe it would be nice if the function is added to maxima/share, as it > provides functionality not available in Maxima. > > All necessary files can be found in my little website, at > https://sites.google.com/site/pjpapasot/maxima/libraries/rkf45 > You will find the package itself, a demo file, and the documentation. Panagiotis, thanks for your work on this topic. I recommend that you put a copyright notice on each file and a license statement. I recommend that the license be GPL (version unstated), which is the same license under which Maxima is distributed. These notices are important for any kind of distribution, whether the package is included in Maxima or not. Also, if the package is to be included in Maxima, it is very helpful to have a list of test cases which can be evaluated by run_testsuite or batch(..., test). I am inclined to include the package in Maxima. Would others care to chime in? best Robert Dodier From macrakis at alum.mit.edu Tue Oct 25 10:11:23 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 25 Oct 2011 11:11:23 -0400 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: Panagioti, Though I admit that I'm not a user of numerical integration routines, I do want to thank you for your contribution! I agree with Robert that we should add this functionality to share; a test suite would indeed be a useful . But I would recommend that you license the package under the LGPL, not the GPL. LGPL is compatible with GPL, and protects *your* contribution, while not constraining what other software it can be used with (e.g. commercial Macsyma -- though the legal status of Maxima packages in GPL is somewhat unclear). -s On Tue, Oct 25, 2011 at 11:05, Robert Dodier wrote: > On 10/24/11, Panagiotis Papasotiriou wrote: > > > I have written a Maxima package for solving initial value problems. The > > package implements a Maxima function called rkf45, which is an > > implementation of the Runge-Kutta-Fehlberg method of 4th-5th order. > > > I believe it would be nice if the function is added to maxima/share, as > it > > provides functionality not available in Maxima. > > > > All necessary files can be found in my little website, at > > https://sites.google.com/site/pjpapasot/maxima/libraries/rkf45 > > You will find the package itself, a demo file, and the documentation. > > Panagiotis, thanks for your work on this topic. > > I recommend that you put a copyright notice on each file and a > license statement. I recommend that the license be GPL (version > unstated), which is the same license under which Maxima is > distributed. These notices are important for any kind of distribution, > whether the package is included in Maxima or not. > > Also, if the package is to be included in Maxima, it is very helpful > to have a list of test cases which can be evaluated by run_testsuite > or batch(..., test). > > I am inclined to include the package in Maxima. Would others > care to chime in? > > 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 p.j.papasot at gmail.com Tue Oct 25 10:32:00 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 25 Oct 2011 18:32:00 +0300 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: 2011/10/25 Robert Dodier > I recommend that you put a copyright notice on each file and a > license statement. I recommend that the license be GPL (version > unstated), which is the same license under which Maxima is > distributed. These notices are important for any kind of distribution, > whether the package is included in Maxima or not. > In my website it is already stated that this package (and all future packages I am planning to implement) are released under GPL (unstated version) and the accompanying pdf documentation is under GFDL (also unstated version.) I didn't put a copyright notice on each file, because I saw other packages, already included in maxima/share, without any particular notice. However, I'll do as you said. Thank you for your kind words and the information. > Also, if the package is to be included in Maxima, it is very helpful > to have a list of test cases which can be evaluated by run_testsuite > or batch(..., test). > I've already added the file rkf45.dem, demonstrating the use of rkf45 in four representative cases. More examples are included in the pdf documentation, where they are discussed in detail. A testsuite sounds good though. I will need to figure out how exactly such a testsuite is implemented, but I guess it won't take long. > I am inclined to include the package in Maxima. Would others > care to chime in? > I would be happy to contribute in Maxima. -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.j.papasot at gmail.com Tue Oct 25 10:40:58 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 25 Oct 2011 18:40:58 +0300 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: 2011/10/25 Stavros Macrakis > Panagioti, > > Though I admit that I'm not a user of numerical integration routines, I do > want to thank you for your contribution! > Thank you Stavro. We all have our favorite domain of interest. Personally, I like Maxima's symbolic capabilities, both for research and for teaching (students seem to get familiar with Maxima way easier than with Mathematica, for example.) However, I would like to be able to use numerical methods within Maxima, and I believe I can do something for it, as Numerical Analysis is my main domain of interest. > I agree with Robert that we should add this functionality to share; a test > suite would indeed be a useful . > Working on it. > But I would recommend that you license the package under the LGPL, not the > GPL. LGPL is compatible with GPL, and protects *your* contribution, while > not constraining what other software it can be used with (e.g. commercial > Macsyma -- though the legal status of Maxima packages in GPL is somewhat > unclear). > I am confused now... LGPL or GPL? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpc3 at psu.edu Tue Oct 25 10:55:27 2011 From: jpc3 at psu.edu (Joseph Cusumano) Date: Tue, 25 Oct 2011 11:55:27 -0400 Subject: [Maxima] compiler warnings in mnewton In-Reply-To: References: Message-ID: <4EA6DBEF.4010904@psu.edu> Hi all: The first time I use mnewton in a Maxima session, I get the following: ;Compiler warnings for "C:/PROGRA~1/Maxima/share/maxima/5.25.0/share/linearalgebra/linalg-extra.lisp" : ; In $VANDERMONDE_MATRIX: IGNORE declaration for unknown variable LK This does not happen on subsequent executions in the same session (i.e., without restarting Maxima), and it does not appear to have any impact on the result (which seems to be correct). I'm using wxMaxima 11.08.0 on top of Maxima 5.25.0 in Windows XP SP3, which was compiled with Clozure Common Lisp Version 1.7-r14925M (WindowsX8632). Cheers, Joe _______________________________________ Joseph Cusumano Professor of Engineering Science & Mechanics Penn State University 212 Earth & Engineering Sciences Building University Park, PA 16802 814.865.3179 (o) 814.865.9974 (f) -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Tue Oct 25 10:57:26 2011 From: villate at fe.up.pt (Jaime Villate) Date: Tue, 25 Oct 2011 16:57:26 +0100 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: <4EA6DC66.3080601@fe.up.pt> On 10/25/2011 04:05 PM, Robert Dodier wrote: > I am inclined to include the package in Maxima. Would others > care to chime in? It could be added to the current rk package in which it is based. If Panagiotis agrees, I could incorporate it as part of rk, to be used when an option adaptive45 (or something similar) was given. One thing I would change though, is the "option = value" syntax. I find it confusing for the users to mix the two different option syntaxes "[option, value]" and "option: value" in the same package. Also, the documentation is very nice, but in order to be incorporated into Maxima, we would need the LaTeX source file. Thanking Panagiotis for his contribution, best regards, Jaime From macrakis at alum.mit.edu Tue Oct 25 11:28:05 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 25 Oct 2011 12:28:05 -0400 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: Re GPL vs. LGPL etc. It depends on your attitude towards your code. If your primary goal is that the code be widely used, and you don't care what others do with it (including incorporating it into proprietary products), then you should use the least restrictive license that is compatible with GPL, e.g. BSD, Apache, etc. If your primary goal is to promote free software, and you want to discourage people from using proprietary software (commercial Macsyma, Mathematica, etc.) then you should use GPL. If your primary goal is to keep your code and any improvements to it made by anyone available to the community, then you should use LGPL. I think that the above statements would be agreed to by the proponents of any of the licenses I mention. The difference is what your goals are. -s On Tue, Oct 25, 2011 at 11:40, Panagiotis Papasotiriou < p.j.papasot at gmail.com> wrote: > 2011/10/25 Stavros Macrakis > >> Panagioti, >> >> Though I admit that I'm not a user of numerical integration routines, I do >> want to thank you for your contribution! >> > > Thank you Stavro. > We all have our favorite domain of interest. Personally, I like Maxima's > symbolic capabilities, both for research and for teaching (students seem to > get familiar with Maxima way easier than with Mathematica, for example.) > However, I would like to be able to use numerical methods within Maxima, and > I believe I can do something for it, as Numerical Analysis is my main domain > of interest. > > >> I agree with Robert that we should add this functionality to share; a test >> suite would indeed be a useful . >> > > Working on it. > > >> But I would recommend that you license the package under the LGPL, not the >> GPL. LGPL is compatible with GPL, and protects *your* contribution, while >> not constraining what other software it can be used with (e.g. commercial >> Macsyma -- though the legal status of Maxima packages in GPL is somewhat >> unclear). >> > > I am confused now... LGPL or GPL? > > _______________________________________________ > 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 p.j.papasot at gmail.com Tue Oct 25 12:09:30 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 25 Oct 2011 20:09:30 +0300 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: <4EA6DC66.3080601@fe.up.pt> References: <4EA6DC66.3080601@fe.up.pt> Message-ID: 2011/10/25 Jaime Villate > On 10/25/2011 04:05 PM, Robert Dodier wrote: > It could be added to the current rk package in which it is based. If > Panagiotis agrees, I could incorporate it as part of rk, to be used when an > option adaptive45 (or something similar) was given. > Actually, rkf45 is not based on rk; I tried to keep it compatible with rk's syntax to avoid confusion for new users, and of course both rk and rkf45 are implementing Runge-Kutta methods, but otherwise their implementation has little in common. If rkf45 is included in share, rk could still be useful for educational purposes (teaching students about the original Runge-Kutta method of fourth order, and using rk for examples of use.) Otherwise, rkf45 should be used for real work. I believe we should keep them separated, as it is the case in most Numerical Analysis packages I am aware of. If, however, you decide otherwise, I think rkf45 should be the default, and rk should be used if an option "nonadaptive" (or something similar) was given. > One thing I would change though, is the "option = value" syntax. I find it > confusing for the users to mix the two different option syntaxes "[option, > value]" and "option: value" in the same package. > rk itself has no optional arguments, but other functions in dynamics.mac do. I have seen other packages using the "option=value" syntax, instead of [option,value]. Although I personally like the "option=value" syntax, this is indeed confusing for new users, considering that one of the most used functions, plot2d, adopts the "[option,value]" syntax. It depends on where rkf45 will be put, I guess. If rkf45 is to be included in dynamics.mac, then I should definitely change the syntax for optional arguments, as Jaime suggested. To be honest though, I think that a more appropriate place for putting rkf45 would be share/numeric. It's up to you anyway. > Also, the documentation is very nice, but in order to be incorporated into > Maxima, we would need the LaTeX source file. > No problem about the LaTeX source file, I will post it as soon as we fix the details (might need minor changes, depending on how rkf45 will be included in /share.) > Thanking Panagiotis for his contribution, > Thank you Jaime. -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Tue Oct 25 12:13:26 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 25 Oct 2011 12:13:26 -0500 Subject: [Maxima] compiler warnings in mnewton In-Reply-To: <4EA6DBEF.4010904@psu.edu> References: <4EA6DBEF.4010904@psu.edu> Message-ID: You may ignore the warning. At one time, I inserted an ignore into linalg-extra to avoid a compiler warning with (I think) sbcl. This same ignore causes Clozure to issue a warning when loading linalg-extra. If an expert would tell me if the ignore is needed, I'll make the correction if needed. The code is (looking at this, I'd guess the (declare (ignore lk)) is spurious) (defun $vandermonde_matrix (l) (let ((x) (row) (acc)) (setq l (require-list l "$vandermonde_matrix")) (dolist (li l) (setq x 1 row nil) (dolist (lk l) (declare (ignore lk)) (push x row) (setq x (mul x li))) (setq row (nreverse row)) (push '(mlist) row) (push row acc)) (setq acc (nreverse acc)) (push '($matrix) acc) acc)) --Barton maxima-bounces at math.utexas.edu wrote on 10/25/2011 10:55:27 AM: > The first time I use mnewton in a Maxima session, I get the following: > ;Compiler warnings for "C:/PROGRA~1/Maxima/share/maxima/5.25.0/ > share/linearalgebra/linalg-extra.lisp" : > ; In $VANDERMONDE_MATRIX: IGNORE declaration for unknown variable LK -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.j.papasot at gmail.com Tue Oct 25 12:18:03 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Tue, 25 Oct 2011 20:18:03 +0300 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: 2011/10/25 Stavros Macrakis > Re GPL vs. LGPL etc. > > It depends on your attitude towards your code. > > If your primary goal is that the code be widely used, and you don't care > what others do with it (including incorporating it into proprietary > products), then you should use the least restrictive license that is > compatible with GPL, e.g. BSD, Apache, etc. > > If your primary goal is to promote free software, and you want to > discourage people from using proprietary software (commercial Macsyma, > Mathematica, etc.) then you should use GPL. > > If your primary goal is to keep your code and any improvements to it made > by anyone available to the community, then you should use LGPL. > > I think that the above statements would be agreed to by the proponents of > any of the licenses I mention. The difference is what your goals are. > Stavro, very useful explanations, thank you. To be honest, I dislike proprietary software, and strongly. On the other hand, I don't mind much what others will do with my code. I guess I would follow the Maxima "standard" license, although it seems a bit unclear what exactly it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Tue Oct 25 12:58:43 2011 From: woollett at charter.net (Edwin Woollett) Date: Tue, 25 Oct 2011 10:58:43 -0700 Subject: [Maxima] imagpart of bessel_i Message-ID: <63C2146B5E6E4C35B670928559D72492@edwinc367e16bd> On Oct. 24, 2011, Dieter Kaiser wrote in a bug fix message: ----------------------------------------- >Bugs item #3427581, was opened at 2011-10-23 19:39 >Message generated for change (Comment added) made by crategus >[snip] >Message: >This bug has been fixed in bessel.lisp revision 23.10.2011. > >(%i1) imagpart(bessel_i(1,%i*x)); >(%o1) -%i*bessel_i(1,%i*x) > > Nevertheless, the reported example is not solved: > >(%i2) quad_qag(imagpart(bessel_i(1,%i*x)),x,1,3,3,limit=700); >(%o2) quad_qag(-%i*bessel_i(1,%i*x),x,1,3,3,epsrel = 1.e-8,epsabs = 0.0, > limit = 700) > >The reason is a small imaginary part because of rounding errors: > >(%i3) imagpart(bessel_i(1,%i)); >(%o3) -%i*bessel_i(1,%i) >(%i4) rectform(%),numer; >(%o4) .4400505857449336-2.694443716532522e-17*%i > >For other Bessel functions Maxima knows pure real or imaginary results and >cuts off the rounding errors accordingly. This can be added for the >bessel_i function too. ---------------------------------------------------------- nint.mac is now using the new bessel.lisp. Until the rounding error problem of bessel_i is fixed, we can use a workaround suggested by you (Dieter Kaiser), namely to use a float number instead of an integer for the order of the bessel function. ------------------- (%i1) load(nint); (%o1) "c:/work2/nint.mac" (%i2) quad_qag(imagpart(bessel_i(1,%i*x)),x,1,3,3,limit=700); (%o2) quad_qag(-%i*bessel_i(1,%i*x),x,1,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) (%i3) quad_qag(imagpart(bessel_i(1.0,%i*x)),x,1,3,3,limit=700); (%o3) [1.0252496414599,1.1382557579374679E-14,31,0] (%i4) quad_qag(imagpart(bessel_i(1.0,%i*x)),x,1,10^4,3,limit=700); (%o4) [0.77229384691138,1.1418381427522419E-12,31713,0] (%i5) quad_qag(imagpart(bessel_i(2.0,%i*x)),x,1,3,3,limit=700); (%o5) [8.2026594591804487E-17,9.1067813947414708E-31,31,0] (%i6) quad_qag(imagpart(bessel_i(2.0,%i*x)),x,1,10^4,3,limit=700); (%o6) [-2.2013154155922133E-16,5.7377810005552024E-15,43369,1] (%i7) quad_qag(imagpart(bessel_i(3.0,%i*x)),x,1,3,3,limit=700); (%o7) [-0.28287409015192,3.1405332795655258E-15,31,0] (%i8) quad_qag(imagpart(bessel_i(3.0,%i*x)),x,1,10^4,3,limit=700); (%o8) [-0.98790703708805,1.0431047896924372E-12,31713,0] ------------------------------ Ted From drdieterkaiser at web.de Tue Oct 25 13:08:57 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 25 Oct 2011 20:08:57 +0200 Subject: [Maxima] imagpart of bessel_i In-Reply-To: <63C2146B5E6E4C35B670928559D72492@edwinc367e16bd> References: <63C2146B5E6E4C35B670928559D72492@edwinc367e16bd> Message-ID: <1319566138.1778.8.camel@dieter> Am Dienstag, den 25.10.2011, 10:58 -0700 schrieb Edwin Woollett: > On Oct. 24, 2011, Dieter Kaiser wrote in a bug fix message: > ----------------------------------------- > >Bugs item #3427581, was opened at 2011-10-23 19:39 > >Message generated for change (Comment added) made by crategus > >[snip] > >Message: > >This bug has been fixed in bessel.lisp revision 23.10.2011. > > > >(%i1) imagpart(bessel_i(1,%i*x)); > >(%o1) -%i*bessel_i(1,%i*x) > > > > Nevertheless, the reported example is not solved: > > > >(%i2) quad_qag(imagpart(bessel_i(1,%i*x)),x,1,3,3,limit=700); > >(%o2) quad_qag(-%i*bessel_i(1,%i*x),x,1,3,3,epsrel = 1.e-8,epsabs = 0.0, > > limit = 700) > > > >The reason is a small imaginary part because of rounding errors: > > > >(%i3) imagpart(bessel_i(1,%i)); > >(%o3) -%i*bessel_i(1,%i) > >(%i4) rectform(%),numer; > >(%o4) .4400505857449336-2.694443716532522e-17*%i > > > >For other Bessel functions Maxima knows pure real or imaginary results and > >cuts off the rounding errors accordingly. This can be added for the > >bessel_i function too. > ---------------------------------------------------------- > nint.mac is now using the new bessel.lisp. > > Until the rounding error problem of bessel_i is fixed, we can use > a workaround suggested by you (Dieter Kaiser), namely to use > a float number instead of an integer for the order of the bessel > function. > ------------------- > (%i1) load(nint); > (%o1) "c:/work2/nint.mac" > > (%i2) quad_qag(imagpart(bessel_i(1,%i*x)),x,1,3,3,limit=700); > (%o2) quad_qag(-%i*bessel_i(1,%i*x),x,1,3,3,epsrel = 1.0E-8,epsabs = 0.0, > limit = 700) > > (%i3) quad_qag(imagpart(bessel_i(1.0,%i*x)),x,1,3,3,limit=700); > (%o3) [1.0252496414599,1.1382557579374679E-14,31,0] > > (%i4) quad_qag(imagpart(bessel_i(1.0,%i*x)),x,1,10^4,3,limit=700); > (%o4) [0.77229384691138,1.1418381427522419E-12,31713,0] > > (%i5) quad_qag(imagpart(bessel_i(2.0,%i*x)),x,1,3,3,limit=700); > (%o5) [8.2026594591804487E-17,9.1067813947414708E-31,31,0] > > (%i6) quad_qag(imagpart(bessel_i(2.0,%i*x)),x,1,10^4,3,limit=700); > (%o6) [-2.2013154155922133E-16,5.7377810005552024E-15,43369,1] > > (%i7) quad_qag(imagpart(bessel_i(3.0,%i*x)),x,1,3,3,limit=700); > (%o7) [-0.28287409015192,3.1405332795655258E-15,31,0] > > (%i8) quad_qag(imagpart(bessel_i(3.0,%i*x)),x,1,10^4,3,limit=700); > (%o8) [-0.98790703708805,1.0431047896924372E-12,31713,0] > ------------------------------ Thank you for the message. I will have a second look at the implementation of besse_i to remove the rounding errors for floating point evaluation in the case of pure real or imaginary results. Dieter Kaiser From maxima at etherjones.us Tue Oct 25 13:11:55 2011 From: maxima at etherjones.us (Ether Jones) Date: Tue, 25 Oct 2011 11:11:55 -0700 (PDT) Subject: [Maxima] display expression exactly as entered In-Reply-To: References: <1319464875.76210.YahooMailNeo@web161806.mail.bf1.yahoo.com> <1319479749.33086.YahooMailNeo@web161805.mail.bf1.yahoo.com> <1319481722.23410.YahooMailNeo@web161801.mail.bf1.yahoo.com> <1319496668.95809.YahooMailNeo@web161804.mail.bf1.yahoo.com> Message-ID: <1319566315.31818.YahooMailNeo@web161804.mail.bf1.yahoo.com> > That's because the dd(x/x) should have been on a new line.? Thanks.? I did have it on a new line (in WxMaxima). To make it work in WxMaxima, I had to put it in a new cell (posted for the benefit of any other readers using WxMaxima who may want to use this) ________________________________ From: Rupert Swarbrick To: maxima at math.utexas.edu Sent: Tuesday, October 25, 2011 10:20 AM Subject: Re: [Maxima] display expression exactly as entered Ether Jones writes: > (%i1) :lisp (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) (terpri) ',x)) > ????? dd(x/x); > > Maxima encountered a Lisp error: > ? Error in PROGN [or a callee]: The variable DD is unbound. > Automatically continuing. > To enable the Lisp debugger set *debugger-hook* to nil. That's because the dd(x/x) should have been on a new line. What you typed made the lisp try to evaluate three forms (defmacro $dd (x) `(progn (displa '((mlable) Raw ,x)) (terpri) ',x)) dd (x/x) the third calls a (nonexistant) function called x/x. If the "dd" form hadn't caused your lisp implementation to error out, it would have done too. 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 robert.dodier at gmail.com Tue Oct 25 14:41:37 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 25 Oct 2011 13:41:37 -0600 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: > I guess I would follow the Maxima "standard" license, > although it seems a bit unclear what exactly it is. Bill Schelter requested from US Dept of Energy permission to distribute Maxima under terms of GPL and received from them a letter granting permission to do so; that is the DOE letter linked on the Maxima web site. So I think it is fair to say that the GPL is the standard license for Maxima, although if we go into details, it is probably not strictly necessary for non-compiled stuff. Disclaimer: I am not a lawyer. best, Robert Dodier From macrakis at alum.mit.edu Tue Oct 25 15:47:51 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 25 Oct 2011 16:47:51 -0400 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: I disagree. GPL is presumably the license for the things that Schelter added to DOE Maxima; this is the meaning of the "Copyright ...by William Schelter" line he added to the source files. Clearly he didn't hold the copyright to DOE Maxima itself. DOE Maxima itself was made available by the DOE under the GPL. It may or may not be available under other licenses as well (it may even be in the public domain given copyright law at the time it was originally written), but let's leave that aside for the moment. In any case, there is absolutely no requirement that new share packages which are not derived from existing code follow GPL. In fact, legally they probably don't even need to be "free software" as long as they are simply distributed along with Maxima, and not incorporated into distributed binaries. As the maintainers of Maxima, we can certainly decide that we will only publish in share code which has a free or open-source license; we can even decide that we require a license which is compatible with GPL. But this includes not just LGPL, but also many others. Code can also be multi-licensed under both GPL *and* other licenses which can be incompatible with GPL. Whether the code is compiled or not is irrelevant. Robert likes GPL and considers it the "standard license" for share files, but Robert does not decide for the developer community. In particular, I would object to requiring share code to be licensed under GPL. -s On Tue, Oct 25, 2011 at 15:41, Robert Dodier wrote: > > I guess I would follow the Maxima "standard" license, > > although it seems a bit unclear what exactly it is. > > Bill Schelter requested from US Dept of Energy permission to > distribute Maxima under terms of GPL and received from them > a letter granting permission to do so; that is the DOE letter > linked on the Maxima web site. > So I think it is fair to say that the GPL is the standard > license for Maxima, although if we go into details, it is probably > not strictly necessary for non-compiled stuff. > > Disclaimer: I am not a lawyer. > > 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 woollett at charter.net Tue Oct 25 16:01:38 2011 From: woollett at charter.net (Edwin Woollett) Date: Tue, 25 Oct 2011 14:01:38 -0700 Subject: [Maxima] imagpart of bessel_i Message-ID: <7F36CE3472D74C00A491688843B402C4@edwinc367e16bd> On Oct. 25, 2011, I wrote: -------------------------- >nint.mac is now using the new bessel.lisp. > >Until the rounding error problem of bessel_i is fixed, we can use >a workaround suggested by you (Dieter Kaiser), namely to use >a float number instead of an integer for the order of the bessel >function. ------------------------------ Example of the use of a float order bessel function (a temporary stratagem) implimented now in nint, in which nint automatically bypasses integrate and sends integrand to quadpack because the integrand both involves special functions and the range is greater than maxrange (due to a present float bug in hypergeometric), and the option strong_osc forces the exclusive use of quad_qag (to save time): Since the integrand is automatically separated into real and imaginary parts for use of quadpack routines, we have two parts: (%i8) nint(bessel_i(1.0,%i*x),x,1,10^4,strong_osc); " this will take a while " " this will take a while " (%o8) 0.77229384691138*%i (%i9) time(%); (%o9) [60.97] (%i10) gargL; (%o10) [[[qag,'realpart(bessel_i(1.0,%i*x)),x,1,10000,3,epsrel = 1.0E-8, limit = 700], [qag,'imagpart(bessel_i(1.0,%i*x)),x,1,10000,3,epsrel = 1.0E-8, limit = 700]]] (%i11) goutL; (%o11) [[[qag,2.0359456460377781E-16,6.1158684097826728E-15,43369,1], [qag,0.77229384691138,1.1418381427522419E-12,31713,0]]] The error return from the realpart effort is ignored because fchop(2.0359456460377781E-16) --> 0.0 and this doesn't contribute to the answer anyway. Ted Woollett From toy.raymond at gmail.com Tue Oct 25 16:01:29 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 25 Oct 2011 14:01:29 -0700 Subject: [Maxima] LIcenses [Re: A Maxima function for solving initial value problems with adaptive step size and error control.] Message-ID: On Tue, Oct 25, 2011 at 1:47 PM, Stavros Macrakis wrote: > I disagree. > > > In any case, there is absolutely no requirement that new share packages > which are not derived from existing code follow GPL. In fact, legally they > probably don't even need to be "free software" as long as they are simply > distributed along with Maxima, and not incorporated into distributed > binaries. As the maintainers of Maxima, we can certainly decide that we > will only publish in share code which has a free or open-source license; we > can even decide that we require a license which is compatible with GPL. But > this includes not just LGPL, but also many others. Code can also be > multi-licensed under both GPL *and* other licenses which can be incompatible > with GPL. Whether the code is compiled or not is irrelevant. > > Robert likes GPL and considers it the "standard license" for share files, > but Robert does not decide for the developer community. In particular, I > would object to requiring share code to be licensed under GPL. > I agree with you. For code in share, I would prefer, perhaps, GPL, but I wouldn't require it. For things in src, I would say it must be GPL since it represents the core of Maxima. Note, however, that the slatec routines are in src/numerical and these include some special functions and quadpack. The license for slateci is definitely not GPL. Perhaps they should be moved out of src into another directory? Slatec might be in the public domain so we could slap GPL over it, but that seems not nice. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Oct 25 16:25:48 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 25 Oct 2011 17:25:48 -0400 Subject: [Maxima] LIcenses [Re: A Maxima function for solving initial value problems with adaptive step size and error control.] In-Reply-To: References: Message-ID: Ray, even for the core of Maxima, GPL does not require that components be licensed under GPL. In particular, they can be licensed under any GPL-compatible license. But to avoid messiness and chaos, I'd be OK with requiring either LGPL or GPL (as well as any other licenses the author wants to multilicense under). -s On Tue, Oct 25, 2011 at 17:01, Raymond Toy wrote: > > > On Tue, Oct 25, 2011 at 1:47 PM, Stavros Macrakis wrote: > >> I disagree. >> >> >> In any case, there is absolutely no requirement that new share packages >> which are not derived from existing code follow GPL. In fact, legally they >> probably don't even need to be "free software" as long as they are simply >> distributed along with Maxima, and not incorporated into distributed >> binaries. As the maintainers of Maxima, we can certainly decide that we >> will only publish in share code which has a free or open-source license; we >> can even decide that we require a license which is compatible with GPL. But >> this includes not just LGPL, but also many others. Code can also be >> multi-licensed under both GPL *and* other licenses which can be incompatible >> with GPL. Whether the code is compiled or not is irrelevant. >> >> Robert likes GPL and considers it the "standard license" for share files, >> but Robert does not decide for the developer community. In particular, I >> would object to requiring share code to be licensed under GPL. >> > > I agree with you. For code in share, I would prefer, perhaps, GPL, but I > wouldn't require it. For things in src, I would say it must be GPL since it > represents the core of Maxima. > > Note, however, that the slatec routines are in src/numerical and these > include some special functions and quadpack. The license for slateci is > definitely not GPL. Perhaps they should be moved out of src into another > directory? Slatec might be in the public domain so we could slap GPL over > it, but that seems not nice. > > Ray > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Tue Oct 25 16:40:50 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 25 Oct 2011 14:40:50 -0700 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: <4EA72CE2.8050801@eecs.berkeley.edu> On 10/25/2011 12:41 PM, Robert Dodier wrote: >> I guess I would follow the Maxima "standard" license, >> although it seems a bit unclear what exactly it is. > Bill Schelter requested from US Dept of Energy permission to > distribute Maxima under terms of GPL and received from them > a letter granting permission to do so; that is the DOE letter > linked on the Maxima web site. > So I think it is fair to say that the GPL is the standard > license for Maxima, although if we go into details, it is probably > not strictly necessary for non-compiled stuff. > > Disclaimer: I am not a lawyer. > > best, Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima This does not tell you how to declare ownership of your code. It just says that for convenient source code distribution with Maxima, it should be possible to redistribute your code under GPL. Other agreements such as BSD, are less restrictive and essentially say that you can distribute this stuff any way you want, to anyone. I find GPL to be annoying because commercial entities sometimes refuse to take such code. I can give code to Maxima under BSD and it can be redistributed under GPL, but I could also then give the code to (say) Boeing and they can use it too. If I declare my code to be available ONLY under GPL then Boeing (or some other company) may refuse it. It is possible to say your code is available under BSD or GPL, I suppose. But I am not a lawyer either. RJF From macrakis at alum.mit.edu Tue Oct 25 16:44:14 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 25 Oct 2011 17:44:14 -0400 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: <4EA72CE2.8050801@eecs.berkeley.edu> References: <4EA72CE2.8050801@eecs.berkeley.edu> Message-ID: On Tue, Oct 25, 2011 at 17:40, Richard Fateman wrote: > ...It is possible to say your code is available under BSD or GPL, I > suppose. But I am not a lawyer either. > I am not a lawyer either, but multi-licensing is perfectly fine. You are simply saying: "I license this to you under license A, B, or C -- your choice". -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Oct 25 17:34:59 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 25 Oct 2011 15:34:59 -0700 Subject: [Maxima] LIcenses [Re: A Maxima function for solving initial value problems with adaptive step size and error control.] In-Reply-To: References: Message-ID: On Tue, Oct 25, 2011 at 2:25 PM, Stavros Macrakis wrote: > Ray, even for the core of Maxima, GPL does not require that components be > licensed under GPL. In particular, they can be licensed under any > GPL-compatible license. But to avoid messiness and chaos, I'd be OK with > requiring either LGPL or GPL (as well as any other licenses the author wants > to multilicense under). Yes, there's the "mere aggregation" clause in the GPL, and it's relatively easy to make a case that the share directory is an aggregation, but src, I think, is a more difficult case to make. Is it just mere aggregation? And how can you tell, once all the relevant parties are no longer around? But I am not a lawyer either. But for the record, anything that I have placed in src (like my elliptic functions code), is GPL. Anything that I have done in share is under some license that I haven't decided on. Possibly public domain or BSD, or LGPL. Note that f2cl-lib and the code generated by f2cl is under some license. I think it's LGPL, but I'll have to look that up. Ray > > -s > > > On Tue, Oct 25, 2011 at 17:01, Raymond Toy wrote: > >> >> >> On Tue, Oct 25, 2011 at 1:47 PM, Stavros Macrakis wrote: >> >>> I disagree. >>> >>> >>> In any case, there is absolutely no requirement that new share packages >>> which are not derived from existing code follow GPL. In fact, legally they >>> probably don't even need to be "free software" as long as they are simply >>> distributed along with Maxima, and not incorporated into distributed >>> binaries. As the maintainers of Maxima, we can certainly decide that we >>> will only publish in share code which has a free or open-source license; we >>> can even decide that we require a license which is compatible with GPL. But >>> this includes not just LGPL, but also many others. Code can also be >>> multi-licensed under both GPL *and* other licenses which can be incompatible >>> with GPL. Whether the code is compiled or not is irrelevant. >>> >>> Robert likes GPL and considers it the "standard license" for share files, >>> but Robert does not decide for the developer community. In particular, I >>> would object to requiring share code to be licensed under GPL. >>> >> >> I agree with you. For code in share, I would prefer, perhaps, GPL, but I >> wouldn't require it. For things in src, I would say it must be GPL since it >> represents the core of Maxima. >> >> Note, however, that the slatec routines are in src/numerical and these >> include some special functions and quadpack. The license for slateci is >> definitely not GPL. Perhaps they should be moved out of src into another >> directory? Slatec might be in the public domain so we could slap GPL over >> it, but that seems not nice. >> >> Ray >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vi5u0-maxima at yahoo.co.uk Tue Oct 25 17:50:33 2011 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Tue, 25 Oct 2011 23:50:33 +0100 (BST) Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: On Tue, 25 Oct 2011, Stavros Macrakis wrote: > In any case, there is absolutely no requirement that new share packages > which are not derived from existing code follow GPL. In fact, legally they > probably don't even need to be "free software" as long as they are simply > distributed along with Maxima, and not incorporated into distributed > binaries. ... except that this creates some extra work to do, explaining to recipients what they can and can't include in binaries that they later redistribute. From macrakis at alum.mit.edu Tue Oct 25 18:34:34 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 25 Oct 2011 19:34:34 -0400 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: Does anyone distribute Maxima binaries with share files preloaded? Seems like a bad idea, since some share files change default behavior our are incompatible among themselves... -s On Oct 25, 2011 6:47 PM, "Dan" wrote: > On Tue, 25 Oct 2011, Stavros Macrakis wrote: > > In any case, there is absolutely no requirement that new share packages >> which are not derived from existing code follow GPL. In fact, legally >> they >> probably don't even need to be "free software" as long as they are simply >> distributed along with Maxima, and not incorporated into distributed >> binaries. >> > > ... except that this creates some extra work to do, explaining to > recipients what they can and can't include in binaries that they later > redistribute. > ______________________________**_________________ > 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 p.j.papasot at gmail.com Wed Oct 26 02:32:53 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Wed, 26 Oct 2011 10:32:53 +0300 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: Debian distributes Maxima without share files preloaded. However, share files are destributed in a separate package, called "maxima-share", which is marked as "recommended" by Debian's main maxima package. By default, "recommended" packages are considered as dependencies, unless the user chooses otherwise. So, for most users, installing maxima means that maxima-share will be installed automatically, even if they are not aware of it. Technically, share files are not preloaded though. You still need to load a shared package before using it. By the way, Debian still distributes Maxima 5.24.0, even in Debian "testing" version, where they usually have up-to-date software. Not sure why they didn't upgrade to 5.25, I guess it's because Maxima official site still mentions 5.24 as the latest release. Does Maxima versioning system follows the old convention (odd minor version numbers to denote development releases and even minor version numbers to denote stable releases)? 2011/10/26 Stavros Macrakis > Does anyone distribute Maxima binaries with share files preloaded? Seems > like a bad idea, since some share files change default behavior our are > incompatible among themselves... > > -s > On Oct 25, 2011 6:47 PM, "Dan" wrote: > >> On Tue, 25 Oct 2011, Stavros Macrakis wrote: >> >> In any case, there is absolutely no requirement that new share packages >>> which are not derived from existing code follow GPL. In fact, legally >>> they >>> probably don't even need to be "free software" as long as they are simply >>> distributed along with Maxima, and not incorporated into distributed >>> binaries. >>> >> >> ... except that this creates some extra work to do, explaining to >> recipients what they can and can't include in binaries that they later >> redistribute. >> ______________________________**_________________ >> 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 p.j.papasot at gmail.com Wed Oct 26 02:51:49 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Wed, 26 Oct 2011 10:51:49 +0300 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: <4EA78204.9000302@gmail.com> References: <4EA63A97.2000600@street-artists.org> <4EA645F0.3070606@gmail.com> <4EA78204.9000302@gmail.com> Message-ID: 2011/10/26 Raymond Toy > Yes, an easy-to-user interface is needed. I've never used odepack for > anything so your experience will help a lot in getting a nice interface. > When I get around to adding this to maxima, I'll ask you to help with > designing a nice interface and with testing if you don't mind. > I don't mind at all. I've already written a Fortran 90 interface for DLSODAR, the most powerful subroutine included in Odepack; optional arguments are used for many things, and error messages, if any, are printed in text form, instead of the "flag" integer returned by Odepack Converting that interface to a Maxima function should be easy. Interfaces for other subroutines included in Odepack should be easy to implement as well. -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Wed Oct 26 03:18:54 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 26 Oct 2011 09:18:54 +0100 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: <4EA6DC66.3080601@fe.up.pt> Message-ID: <4EA7C26E.4040900@fe.up.pt> On 10/25/2011 06:09 PM, Panagiotis Papasotiriou wrote: > Actually, rkf45 is not based on rk; I tried to keep it compatible with > rk's syntax to avoid confusion for new users, and of course both rk > and rkf45 are implementing Runge-Kutta methods, but otherwise their > implementation has little in common. > If rkf45 is included in share, rk could still be useful for > educational purposes (teaching students about the original Runge-Kutta > method of fourth order, and using rk for examples of use.) Otherwise, > rkf45 should be used for real work. I believe we should keep them > separated, as it is the case in most Numerical Analysis packages I am > aware of. OK, I do not have any objections then. I should also point out at that in future releases rk and plotdf will be more related to each other, once I figure out an efficient way to pass data among themselves. plotdf already uses an adaptive step-size and it can also use Adams-Moulton instead of Runge-Kutta (even though it is currently disabled due to some upstanding bugs). Regards, Jaime From coolens at kahosl.be Wed Oct 26 04:12:14 2011 From: coolens at kahosl.be (Hugo Coolens) Date: Wed, 26 Oct 2011 11:12:14 +0200 Subject: [Maxima] help with evaluation of expression [newbie] In-Reply-To: References: Message-ID: I thought the following expression would evaluate as U_B, but it doesn't limit((1/T)*integrate(U_B*(1-e^(-t/tau)), t, 0, T),T,inf,plus); maybe someone here can tell me how to proceed correctly. thanks in advance hugo From daniel.dalton47 at gmail.com Wed Oct 26 04:35:40 2011 From: daniel.dalton47 at gmail.com (Daniel Dalton) Date: Wed, 26 Oct 2011 20:35:40 +1100 Subject: [Maxima] Solving some simultaneous equations Message-ID: <20111026093540.GB25968@gwsc.vic.edu.au> Hello, I need to solve the following. 3^x=x+4 My text book tells me to graph it and see where the graphs (y=x+4, and y=3^x) meet. Unfortunately, I'm blind and can't read very accurately off the graph, and thus am using maxima instead of the recommended devices by my school. I tried this: solve([y=x+4, y=3^x],[x,y]); Obtaining this: algsys: tried and failed to reduce system to a polynomial in one variable; give up. -- an error. To debug this try: debugmode(true); Can anyone recommend a way I should solve this question with maxima? Thank you, Dan From p.j.papasot at gmail.com Wed Oct 26 04:53:36 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Wed, 26 Oct 2011 12:53:36 +0300 Subject: [Maxima] help with evaluation of expression [newbie] In-Reply-To: References: Message-ID: 2011/10/26 Hugo Coolens > I thought the following expression would evaluate as U_B, but it doesn't > > limit((1/T)*integrate(U_B*(1-**e^(-t/tau)), t, 0, T),T,inf,plus); > > maybe someone here can tell me how to proceed correctly. > > thanks in advance > hugo > You are missing a "%" before "e^(-t/tau)", and thus Maxima treats e as an arbitrary variable, not the mathematical constant e=2.71828... Use limit((1/T)*integrate(U_B*(1-%e^(-t/tau)), t, 0, T),T,inf,plus); Maxima will then ask you if tau is positive or negative; Answer "positive", and you will get the result you are looking for. Another way is to type: assume(tau>0); limit((1/T)*integrate(U_B*(1-%e^(-t/tau)), t, 0, T),T,inf,plus); so that you won't asked about tau. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Wed Oct 26 05:02:02 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Wed, 26 Oct 2011 11:02:02 +0100 Subject: [Maxima] Solving some simultaneous equations References: <20111026093540.GB25968@gwsc.vic.edu.au> Message-ID: Daniel Dalton writes: > Hello, > > I need to solve the following. > > 3^x=x+4 > > My text book tells me to graph it and see where the graphs (y=x+4, and > y=3^x) meet. Unfortunately, I'm blind and can't read very accurately off > the graph, and thus am using maxima instead of the recommended devices > by my school. > > I tried this: > solve([y=x+4, y=3^x],[x,y]); > > Obtaining this: > > algsys: tried and failed to reduce system to a polynomial in one variable; give up. > -- an error. To debug this try: debugmode(true); > > Can anyone recommend a way I should solve this question with maxima? Hi, The reason that your textbook recommends solving this by looking at a graph is that the equation isn't easy to solve symbolically. (Indeed, I suspect that there isn't a solution that can be written in elementary functions, but I'm not sure how to prove that). As such, you're going to have to use some numerical method (staring at a graph basically gives you low-tech numerical root finding). Maxima has a function called find_root that will do the job for you nicely, but it needs to know where to look and it only copes with functions of one variable. Firstly, we can turn this into a problem of only one variable since y=x+4 means that x=y-4 so y=3^x gives us y = 3^(y-4). Functions like find_root actually want an expression that they can test for zero, so let's look at y - 3^(y-4). Now we need to know where to look for a root. Notice that if y < 0 the expression must be negative since 3^(anything) is positive and is being subtracted from a negative number. If y = 1, the expression is definitely positive, since 3^(-3) < 1. If y is large, the expression will be negative since 3^(y-4) grows exponentially. As a result (since the expression gives a continuous function of y), we know there must be at least two roots. Indeed, there really are only two roots, which you could check by differentiating (then the expression becomes easier to solve, because the "y" term becomes constant and you can take logarithms). Now we can finally use find_root: (%i18) find_root (y - 3^(y-4), y, 1, 10); (%o18) 5.56191876632454 (%i19) find_root (y - 3^(y-4), y, 0, 1); (%o19) .01251661588402949 Tada! Incidentally, I suspect that was slightly more information than your textbook expected you to need. In particularly, if you can look at the graph, it becomes "obvious" that there are two roots. Of course, for weirder functions, even those with perfect eyesight would need to use this sort of argument... 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 Oct 26 05:20:21 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Wed, 26 Oct 2011 21:20:21 +1100 Subject: [Maxima] Solving some simultaneous equations In-Reply-To: <20111026093540.GB25968@gwsc.vic.edu.au> References: <20111026093540.GB25968@gwsc.vic.edu.au> Message-ID: <4EA7DEE5.7010803@gmail.com> On 26/10/2011 8:35 PM, Daniel Dalton wrote: > Hello, > > I need to solve the following. > > 3^x=x+4 > > My text book tells me to graph it and see where the graphs (y=x+4, and > y=3^x) meet. Unfortunately, I'm blind and can't read very accurately off > the graph, and thus am using maxima instead of the recommended devices > by my school. > > I tried this: > solve([y=x+4, y=3^x],[x,y]); This can be solved with find_root(). Define a function f(x) = lhs - rhs Try a few values to find that a root is in interval [2,3] Find root numerically with find_root (%i1) f(x):=3^x-x-4; (%o1) f(x):=3^x-x-4 (%i2) f(0); (%o2) -3 (%i3) f(1); (%o3) -2 (%i4) f(2); (%o4) 3 (%i5) find_root(f(x),x,1,2); (%o5) 1.56191876632454 From doug.dastew at gmail.com Wed Oct 26 05:36:07 2011 From: doug.dastew at gmail.com (Doug Stewart) Date: Wed, 26 Oct 2011 06:36:07 -0400 Subject: [Maxima] Solving some simultaneous equations In-Reply-To: References: <20111026093540.GB25968@gwsc.vic.edu.au> Message-ID: On Wed, Oct 26, 2011 at 6:02 AM, Rupert Swarbrick wrote: > Daniel Dalton writes: > > Hello, > > > > I need to solve the following. > > > > 3^x=x+4 > > > > My text book tells me to graph it and see where the graphs (y=x+4, and > > y=3^x) meet. Unfortunately, I'm blind and can't read very accurately off > > the graph, and thus am using maxima instead of the recommended devices > > by my school. > > > > I tried this: > > solve([y=x+4, y=3^x],[x,y]); > > > > Obtaining this: > > > > algsys: tried and failed to reduce system to a polynomial in one > variable; give up. > > -- an error. To debug this try: debugmode(true); > > > > Can anyone recommend a way I should solve this question with maxima? > > Hi, > > The reason that your textbook recommends solving this by looking at a > graph is that the equation isn't easy to solve symbolically. (Indeed, I > suspect that there isn't a solution that can be written in elementary > functions, but I'm not sure how to prove that). > > As such, you're going to have to use some numerical method (staring at a > graph basically gives you low-tech numerical root finding). Maxima has a > function called find_root that will do the job for you nicely, but it > needs to know where to look and it only copes with functions of one > variable. > > Firstly, we can turn this into a problem of only one variable since > y=x+4 means that x=y-4 so y=3^x gives us y = 3^(y-4). Functions like > find_root actually want an expression that they can test for zero, so > let's look at y - 3^(y-4). > > Now we need to know where to look for a root. Notice that if y < 0 the > expression must be negative since 3^(anything) is positive and is being > subtracted from a negative number. If y = 1, the expression is > definitely positive, since 3^(-3) < 1. If y is large, the expression > will be negative since 3^(y-4) grows exponentially. > > As a result (since the expression gives a continuous function of y), we > know there must be at least two roots. Indeed, there really are only two > roots, which you could check by differentiating (then the expression > becomes easier to solve, because the "y" term becomes constant and you > can take logarithms). > > Now we can finally use find_root: > > (%i18) find_root (y - 3^(y-4), y, 1, 10); > (%o18) 5.56191876632454 > (%i19) find_root (y - 3^(y-4), y, 0, 1); > (%o19) .01251661588402949 > > Tada! > > Incidentally, I suspect that was slightly more information than your > textbook expected you to need. In particularly, if you can look at the > graph, it becomes "obvious" that there are two roots. Of course, for > weirder functions, even those with perfect eyesight would need to use > this sort of argument... > > > Rupert > > Rupert did an excellent reply, but let me point out that the answer that he gave is the Y value at the points where they cross. To find the x value directly you could do: (%i1) find_root(3^x-x-4,x,0,10); (%o1) 1.56191876632454 and (%i4) find_root(3^x-x-4,x,-100,00); (%o4) - 3.987483384115971 HTH Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.j.papasot at gmail.com Wed Oct 26 05:36:06 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Wed, 26 Oct 2011 13:36:06 +0300 Subject: [Maxima] Solving some simultaneous equations In-Reply-To: <20111026093540.GB25968@gwsc.vic.edu.au> References: <20111026093540.GB25968@gwsc.vic.edu.au> Message-ID: Maxima's function "solve" is for either linear systems, or non-linear systems of *polynomials*. Therefore, it cannot solve this problem. I would proceed by plotting the functions: (%i1) plot2d([x+4,3^x],[x,-5,2]); (%o1) (you might need some trial-and-error to find out the proper plotting interval). Then you can compute the exact value of both roots using find_root, as Ruper and David suggested already. Alternatively, the function "newton" can be used: (%i2) load(newton1); (%o2) /usr/share/maxima/5.24.0/share/numeric/newton1.mac (%i3) newton(x+4-3^x,x,1,1e-6); (%o3) 1.561918766327553 (%i4) newton(x+4-3^x,x,-1,1e-6); (%o4) - 3.987483564814142 You could even use multidimensional newton: (%i5) load(mnewton); (%o5) /usr/share/maxima/5.24.0/share/contrib/mnewton.mac (%i6) mnewton([y=x+4,y=3^x],[x,y],[1,1]); (%o6) [[x = 1.56191876632454, y = 5.56191876632454]] (%i7) mnewton([y=x+4,y=3^x],[x,y],[-1,1]); (%o7) [[x = - 3.987483384115971, y = 0.012516615884029]] Note, however, that there is a robust method to compute *all* the roots of a function within a given interval (the function does not need to be a polynomial - it works for any function.) That way, you won't need to bother with computing each root individually (this can be very annoying if you need to compute many roots, for example the roots of a Bessel function.) I am planning to create a Maxima package providing this functionality soon. 2011/10/26 Daniel Dalton > Hello, > > I need to solve the following. > > 3^x=x+4 > > My text book tells me to graph it and see where the graphs (y=x+4, and > y=3^x) meet. Unfortunately, I'm blind and can't read very accurately off > the graph, and thus am using maxima instead of the recommended devices > by my school. > > I tried this: > solve([y=x+4, y=3^x],[x,y]); > > Obtaining this: > > algsys: tried and failed to reduce system to a polynomial in one variable; > give up. > -- an error. To debug this try: debugmode(true); > > Can anyone recommend a way I should solve this question with maxima? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.j.papasot at gmail.com Wed Oct 26 06:49:47 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Wed, 26 Oct 2011 14:49:47 +0300 Subject: [Maxima] help with evaluation of expression [newbie] In-Reply-To: References: Message-ID: Welcome to Maxima. 2011/10/26 Hugo Coolens > Thank you very much for the help offered > > sincerely, > hugo > > > On Wed, 26 Oct 2011, Panagiotis Papasotiriou wrote: > > >> >> 2011/10/26 Hugo Coolens >> I thought the following expression would evaluate as U_B, but >> it doesn't >> >> limit((1/T)*integrate(U_B*(1-**e^(-t/tau)), t, 0, >> T),T,inf,plus); >> >> maybe someone here can tell me how to proceed correctly. >> >> thanks in advance >> hugo >> >> >> You are missing a "%" before "e^(-t/tau)", and thus Maxima treats e as an >> arbitrary variable, not the mathematical constant e=2.71828... Use >> >> limit((1/T)*integrate(U_B*(1-%**e^(-t/tau)), t, 0, T),T,inf,plus); >> >> Maxima will then ask you if tau is positive or negative; Answer >> "positive", and you will get the result you are looking for. Another way >> is to type: >> >> assume(tau>0); >> limit((1/T)*integrate(U_B*(1-%**e^(-t/tau)), t, 0, T),T,inf,plus); >> >> so that you won't asked about tau. >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Wed Oct 26 09:17:58 2011 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 26 Oct 2011 15:17:58 +0100 Subject: [Maxima] Solving some simultaneous equations In-Reply-To: <20111026093540.GB25968@gwsc.vic.edu.au> References: <20111026093540.GB25968@gwsc.vic.edu.au> Message-ID: <4EA81696.6030705@fe.up.pt> On 10/26/2011 10:35 AM, Daniel Dalton wrote: > I need to solve the following. > > 3^x=x+4 Hi Dan, here is one more answer to add up to the ones you've already received. That is an example of a transcendental equation which, as others have pointed out, can only be solved approximately, using some numerical method. Perhaps the simplest method is that of recursion, which consists of writing the equation in the form x=f(x). In your case, x = 3^x -4. You guess any initial value for x (we will try x0=1) and you then substitute that value in f(x) to find x1 and so on. In Maxima that would be: (%i1) eq: float(3^x-4)$ (%i2) x:1; (%o2) 1 (%i3) x:ev(eq); (%o3) - 1.0 (%i4) x:ev(eq); (%o4) - 3.666666666666667 (%i5) x:ev(eq); (%o5) - 3.982194449749291 (%i6) x:ev(eq); (%o6) - 3.987410444764546 (%i7) x:ev(eq); (%o7) - 3.987482381093471 (%i8) x:ev(eq); (%o8) - 3.987483370323493 which converges to the solution. The problem with this method is that it will only converge to a solution if that solution is an "attractive fixed point". It might diverge, or converge to a particular solution which is not the one you are looking for, but since it is so easy, it is always worth trying it first. In your example, there is actually a second solution. It can be found like this: instead of solving for x on the right-hand side of 3^x=x+4 solve for x on the left hand: x = log(x+4)/log(3) and repat the same method: (%i9) remvalue(x)$ (%i10) eq: float(log(x+4)/log(3))$ (%i11) x: 1; (%o11) 1 (%i12) x:ev(eq); (%o12) 1.464973520717927 (%i13) x:ev(eq); (%o13) 1.545913234256127 (%i14) x:ev(eq); (%o14) 1.559295594995721 (%i15) x:ev(eq); (%o15) 1.561489368345442 (%i16) x:ev(eq); (%o16) 1.561848490222131 (%i17) x:ev(eq); (%o17) 1.561907265173242 (%i18) x:ev(eq); (%o18) 1.561916884094625 (%i19) x:ev(eq); (%o19) 1.561918458286997 Regards, Jaime From robert.dodier at gmail.com Wed Oct 26 10:14:09 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 26 Oct 2011 09:14:09 -0600 Subject: [Maxima] LIcenses [Re: A Maxima function for solving initial value problems with adaptive step size and error control.] In-Reply-To: References: Message-ID: On 10/25/11, Raymond Toy wrote: > But for the record, anything that I have placed in src (like my elliptic > functions code), is GPL. Anything that I have done in share is under some > license that I haven't decided on. Possibly public domain or BSD, or LGPL. Um, in the interest of making life easier for those who wish to make use of those files, I hope you will put some definite copyright & license statement on them. > Note that f2cl-lib and the code generated by f2cl is under some license. I > think it's LGPL, but I'll have to look that up. Code generated by a translator or compiler is a derivative of the original source code. I don't see how the author of the translator could impose a license on the translated code. best Robert Dodier From vi5u0-maxima at yahoo.co.uk Wed Oct 26 10:28:04 2011 From: vi5u0-maxima at yahoo.co.uk (Dan) Date: Wed, 26 Oct 2011 16:28:04 +0100 (BST) Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: On Tue, 25 Oct 2011, Stavros Macrakis wrote: > Does anyone distribute Maxima binaries with share files preloaded? Seems > like a bad idea, since some share files change default behavior our are > incompatible among themselves... I don't know. I spoke because there was a mention of distributing, as part of a generally free package, some chunks of source code which, if compiled into a binary, would make it unlawful to distribute that binary. That reminded me of the contortions Debian used to go through to distribute Pine: . -- Kind regards, Dan From toy.raymond at gmail.com Wed Oct 26 10:56:42 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 26 Oct 2011 08:56:42 -0700 Subject: [Maxima] LIcenses [Re: A Maxima function for solving initial value problems with adaptive step size and error control.] In-Reply-To: References: Message-ID: On Wed, Oct 26, 2011 at 8:14 AM, Robert Dodier wrote: > On 10/25/11, Raymond Toy wrote: > > > But for the record, anything that I have placed in src (like my elliptic > > functions code), is GPL. Anything that I have done in share is under > some > > license that I haven't decided on. Possibly public domain or BSD, or > LGPL. > > Um, in the interest of making life easier for those who wish to make > use of those files, I hope you will put some definite copyright & license > statement on them. > > Yes, I will do that soon. > > Note that f2cl-lib and the code generated by f2cl is under some license. > I > > think it's LGPL, but I'll have to look that up. > > Code generated by a translator or compiler is a derivative of the original > source code. I don't see how the author of the translator could impose a > license on the translated code. > Perhaps, but I vaguely remember that the bison-generated code used to be under GPL license, partly because it was not usable without the other parts of bison. I think this was clarified some time ago so that the generated code is not under the GPL. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.j.papasot at gmail.com Wed Oct 26 13:52:19 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Wed, 26 Oct 2011 21:52:19 +0300 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: I have added a copyright notice in rkf45, as requested. GPL license is adopted, as I dislike proprietary software, so GPL seems a better choice than LGPL (not to mention Maxima itself seems to be released in GPL.) Also added a testsuite for rkf45. Expected results are obtained on a 64-bit Debian GNU/Linux system, but I have tested it on a 32-bit system as well; results differ slightly (I expected that), but the all tests are passed (I needed to set float_approx_equal_tolerance to 2e-12 for that.) The demo file was also upgraded, according to Maxima standards, and I took the opportunity to do minor changes in the pdf documentation as well. I think it is ready now. If it is going to be added in Maxima, I think the best place is in share/numeric/. There is already a package there, called "diffeq" which implements some simple numerical methods for solving differential equations, but I think rkf45 should be put on a separate package because implementation is completely different than that in diffeq. It's up to you though. I was told that the LaTeX source file for the pdf documentation will be needed as well. If rkf45 is going to be added in share, I will post the LaTeX source file as soon I will know where it is going to added (might need to do minor changes depending on that.) All necessary files can be downloaded from https://sites.google.com/site/pjpapasot/maxima/libraries/rkf45 -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Wed Oct 26 14:35:12 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 26 Oct 2011 19:35:12 -0000 Subject: [Maxima] integrate bessel_k(2,%i*y) surprise Message-ID: <19C412B300684700A0146A0F25BDEF5B@edwinc367e16bd> I am just playing around with bessel_k and don't understand the large imaginary part of the integral of bessel_k(2, %i*y) over the interval 1 <= y <= 100, based on the table of discrete values displayed below: (f(x) is just fchop(expand(float(x))) ) -------------------------------- (%i1) load(nint); (%o1) "c:/work2/nint.mac" (%i25) for y:1 step 10 thru 100 do print(" ",y," ",f(bessel_k(2,%i*y)))$ 1 0.18048997206696*%i-2.592886175491198 11 0.21841533174753*%i+0.3119789483129 21 -0.031858737423089*%i-0.27222015896945 31 0.20481495858656-0.093918476739506*%i 41 0.16377581778393*%i-0.10738879820159 51 0.0024786070162412-0.17554486214757*%i 61 0.13641169853138*%i+0.084590710242742 71 -0.064015208750726*%i-0.13429138505077 81 0.13815292462619-0.017659551649835*%i 91 0.084630268914206*%i-0.10051430087896 (%i26) f(integrate(bessel_k(2,%i*y),y,1,100)); (%o26) 1.736293756153568-2.1367387806763253E+42*%i ---------------------------------------------------------------- Where does the 10^42 come from?? Ted From woollett at charter.net Wed Oct 26 15:01:19 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 26 Oct 2011 20:01:19 -0000 Subject: [Maxima] integrate bessel_k(2,%i*y) surprise Message-ID: <35DFF8A3E0CD484B8513E600624638EF@edwinc367e16bd> On Oct. 26, 2011, I wrote: ------------------ >(%i26) f(integrate(bessel_k(2,%i*y),y,1,100)); > >(%o26) 1.736293756153568-2.1367387806763253E+42*%i >---------------------------------------------------------------- >Where does the 10^42 come from?? ---------------------------- I should have included some quad_qag output: (%i27) quad_qag(imagpart(bessel_k(2.0,%i*y)),y,1,100,3,limit=700); (%o27) [1.62942476406395,1.1838977094676129E-9,217,0] Ted From drdieterkaiser at web.de Wed Oct 26 16:28:02 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 26 Oct 2011 23:28:02 +0200 Subject: [Maxima] Documentation of struve_h was Re: float of struve_h functions? In-Reply-To: References: <86D8F910F08E46338EC7E9AE3A5531B4@edwinc367e16bd> <1319140821.1720.15.camel@dieter> Message-ID: <1319664482.5838.7.camel@dieter> Am Sonntag, den 23.10.2011, 15:52 +0100 schrieb Rupert Swarbrick: > How about something like the following? > > Dieter Kaiser writes: > > This is the German documentation of struve_h: > > > > -- Funktion: struve_h (, ) > > Die Struve-Funktion H der Ordnung v mit dem Argument z. Siehe > > Abramowitz und Stegun, Handbook of Mathematical Functions, Kapitel > > 12. Die Definition ist > > > > inf > > ==== k 2 k > > z v + 1 \ (- 1) z > > H (z) = (-) > ---------------------------------- > > v 2 / 2 k 3 3 > > ==== 2 gamma(k + -) gamma(v + k + -) > > k = 0 2 2 > > > > Die Struve-Funktion `struve_h' ist f?r das numerische und > > symbolische Rechnen geeignet. Im Unterschied zu den > > Bessel-Funktionen ist jedoch die Implementation der Funktion > > `struve_h' weniger vollst?ndig. > > > > Maxima berechnet `struve_h' numerisch f?r reelle und komplexe > > Gleitkommazahlen als Argumente f?r v und z. Mit der Funktion > > `float' oder der Optionsvariablen `numer' kann die numerische > > Auswertung erzwungen werden, wenn die Argumente Zahlen sind. > > > > Hat die Optionsvariable `besselexpand' den Wert `true', wird die > > Struve-Funktion `struve_h' mit einer halbzahligen Ordnung v als > > Sinus- und Kosinusfunktionen entwickelt. > > > > Maxima kennt die Ableitung der Struve-Funktion `struve_h' nach dem > > Argument z. > > > > Siehe auch die Struve-Funktion `struve_l'. > > > > Beispiele: > > > .... > > -- Function: struve_h (, ) > > The Struve function, H, of order v with argument z. See Abramowitz and > Stegun, Handbook of Mathematical Functions, chapter 12. The definition > is > > inf > ==== k 2 k > z v + 1 \ (- 1) z > H (z) = (-) > ---------------------------------- > v 2 / 2 k 3 3 > ==== 2 gamma(k + -) gamma(v + k + -) > k = 0 2 2 > > > The Struve function `struve_h' is suitable for both numerical and > symbolic calculations. The implementation of `struve_h' is not > currently as complete as that for the Bessel functions. > > Maxima can find numerical values for `struve_h' for real and complex > floating point arguments for v and z. To force `struve_h' to evaluate > to a number when given numerical arguments, use either the `float' > function or the `numer' option variable. > > If the option variable `besselexpand' is true and the order is a half > integer, the Struve function `struve_h' is simplified to a function in > sines and cosines. > > Maxima knows the derivative of the Struve function `struve_h' with > respect to the argument z. > > See also the Struve function `struve_l'. > > Examples: > > ... > > ----------- > > It might be nice to specify in what way the implementation for > `struve_h' is not very complete. I don't actually know anything about > H_v(z), so I suspect I'm not the best person to try and work that out... Thank your very much for the English translation. There is simply much more functionality implemented for the Bessel functions. The German documentation for Bessel J is more verbose. First the English documentation ------------------------------------------------------------------- Function: bessel_j (v, z) The Bessel function of the first kind of order v and argument z. bessel_j is defined as inf ==== k - v - 2 k v + 2 k \ (- 1) 2 z > -------------------------- / k! gamma(v + k + 1) ==== k = 0 although the infinite series is not used for computations. ------------------------------------------------------------------- And this is the German documentation: ------------------------------------------------------------------- -- Funktion: bessel_j (, ) Die Bessel-Funktion der ersten Art der Ordnung v mit dem Argument z. `bessel_j' ist definiert als inf ==== k \ (- 1) z 2 k + v J (z) = > ------------------- (-) v / k! gamma(v + k + 1) 2 ==== k = 0 Die Reihenentwicklung wird nicht f?r die numerische Berechnung genutzt. Die Bessel-Funktion `bessel_j' ist f?r das numerische und symbolische Rechnen geeignet. Maxima berechnet `bessel_j' numerisch f?r reelle und komplexe Gleitkommazahlen als Argumente f?r v und z. Mit der Funktion `float' oder der Optionsvariablen `numer' kann die numerische Auswertung erzwungen werden, wenn die Argumente ganze oder rationale Zahlen sind. Die numerische Berechnung f?r gro?e Gleitkommazahlen ist nicht implementiert. In diesem Fall gibt Maxima eine Substantivform zur?ck. `bessel_j' hat die folgenden Eigenschaften, die mit mit der Funktion `properties' angezeigt werden und auf das symbolische Rechnen Einfluss haben: `conjugate function' `bessel_j' hat Spiegelsymmetrie, wenn das Argument keine negative reelle Zahl ist. Die Spiegelsymmetrie wird zum Beispiel von der Funktion `conjugate' f?r die Vereinfachung eines Ausdrucks genutzt. `complex characteristic' Maxima kennt den Realteil und den Imagin?rteil von `bessel_j' f?r spezielle Argumente v und z. `limit function' Maxima kennt spezielle Grenzwerte der Funktion `bessel_j'. `integral' Maxima kennt das Integral der Funktion `bessel_j' f?r die Integrationsvariable z. `gradef' Maxima kennt die Ableitungen der Funktion `bessel_j' nach den Argumenten v und z. Die Vereinfachung der Bessel-Funktion `bessel_j' wird von den folgenden Optionsvariablen kontrolliert: `distribute_over' Hat die Optionsvariable `distribute_over' den Wert `true' und sind die Argumente von `bessel_j' eine Matrix, Liste oder Gleichung wird die Funktion auf die Elemente oder beiden Seiten der Gleichung angewendet. Der Standardwert ist `true'. `besselexpand' Hat die Optionsvariable `besselexpand' den Wert `true', wird `bessel_j' mit einer halbzahligen Ordnung v als Sinus- und Kosinusfunktionen entwickelt. `bessel_reduce' Hat die Optionsvariable `bessel_reduce' den Wert `true', wird `bessel_j' mit einer ganzzahligen Ordnung n nach Bessel-Funktionen `bessel_j' mit der niedrigsten Ordnung `0' und `1' entwickelt. `hypergeometric_representation' Hat die Optionsvariable `hypergeometric_representation' den Wert `true', dann wird `bessel_j' als hypergeometrische Funktion dargestellt. Weiterhin kennt Maxima die geraden und ungeraden Symmetrieeigenschaften von `bessel_j'. F?r eine ganze Zahl n vereinfacht daher `bessel_j(-n, z)' zu `(-1)^n bessel_j(n, z)'. Maxima kennt noch die Funktion `spherical_bessel_j', die im Paket `orthopoly' definiert ist. Siehe auch die anderen Bessel-Funktionen `bessel_y', `bessel_i' und `bessel_k' sowie die weiteren mit den Bessel-Funktionen verwandten Funktionen wie die Hankel-Funktionen in *note Hankel-Funktionen::, Airy-Funktionen in *note Airy-Funktionen:: und Struve-Funktionen in *note Struve-Funktionen::. Beispiele: Numerisches Rechnen mit der Bessel-Funktion. F?r gro?e Gleitkommazahlen ist die numerische Berechnung nicht implementiert. (%i1) bessel_j(1,[0.5, 0.5+%i]); (%o1) [.2422684576748739, .5124137767280905 %i + .3392601907198862] (%i2) bessel_j(1,[0.5b0, 0.5b0+%i]); (%o2) [bessel_j(1, 5.0b-1), bessel_j(1, %i + 5.0b-1)] Vereinfachungen der Bessel-Funktion mit den Optionsvariablen `besselexpand' und `bessel_reduce'. (%i3) bessel_j(1/2,x), besselexpand:true; sqrt(2) sin(x) (%o3) ----------------- sqrt(%pi) sqrt(x) (%i4) bessel_j(3,x), bessel_reduce:true; 2 bessel_j(1, x) 4 (---------------- - bessel_j(0, x)) x (%o4) ------------------------------------- - bessel_j(1, x) x Ableitungen und Integrale der Bessel-Funktion. Das letzte Beispiel zeigt die Laplace-Transformation der Bessel-Funktion mit der Funktion `laplace'. (%i5) diff(bessel_j(2,x), x); bessel_j(1, x) - bessel_j(3, x) (%o5) ------------------------------- 2 (%i6) diff(bessel_j(v,x), x); bessel_j(v - 1, x) - bessel_j(v + 1, x) (%o6) --------------------------------------- 2 (%i7) integrate(bessel_j(v,x), x); (%o7) 2 v 1 v 3 x - v - 1 v + 1 hypergeometric([- + -], [- + -, v + 1], - --) 2 x 2 2 2 2 4 ------------------------------------------------------------- v 1 (- + -) gamma(v + 1) 2 2 (%i8) laplace(bessel_j(2,t), t, s); 1 2 (1 - sqrt(-- + 1)) s 2 s (%o8) --------------------- 1 sqrt(-- + 1) 2 s Bessel-Funktionen als L?sung einer linearen Differentialgleichung zweiter Ordnung. (%i1) depends(y, x); (%o1) [y(x)] (%i2) declare(n, integer); (%o2) done (%i3) 'diff(y, x, 2)*x^2 + 'diff(y, x)*x + y*(x^2-n^2) = 0; 2 2 2 d y 2 dy (%o3) y (x - n ) + --- x + -- x = 0 2 dx dx (%i4) ode2(%, y, x); (%o4) y = %k2 bessel_y(n, x) + %k1 bessel_j(n, x) Dieter Kaiser From toy.raymond at gmail.com Wed Oct 26 22:00:43 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 26 Oct 2011 20:00:43 -0700 Subject: [Maxima] integrate bessel_k(2,%i*y) surprise In-Reply-To: <19C412B300684700A0146A0F25BDEF5B@edwinc367e16bd> References: <19C412B300684700A0146A0F25BDEF5B@edwinc367e16bd> Message-ID: <4EA8C95B.8040501@gmail.com> On 1/1/02 12:00 AM, Edwin Woollett wrote: > I am just playing around with bessel_k and don't > understand the large imaginary part of the integral > of bessel_k(2, %i*y) over the interval > 1 <= y <= 100, based on the table of discrete values displayed below: > (f(x) is just fchop(expand(float(x))) ) > -------------------------------- > (%i1) load(nint); > (%o1) "c:/work2/nint.mac" > > (%i25) for y:1 step 10 thru 100 do print(" ",y," > ",f(bessel_k(2,%i*y)))$ > > 1 0.18048997206696*%i-2.592886175491198 11 > 0.21841533174753*%i+0.3119789483129 21 > -0.031858737423089*%i-0.27222015896945 31 > 0.20481495858656-0.093918476739506*%i 41 > 0.16377581778393*%i-0.10738879820159 51 > 0.0024786070162412-0.17554486214757*%i 61 > 0.13641169853138*%i+0.084590710242742 71 > -0.064015208750726*%i-0.13429138505077 81 > 0.13815292462619-0.017659551649835*%i 91 > 0.084630268914206*%i-0.10051430087896 > (%i26) f(integrate(bessel_k(2,%i*y),y,1,100)); > > (%o26) 1.736293756153568-2.1367387806763253E+42*%i > ---------------------------------------------------------------- > Where does the 10^42 come from?? It comes from the bessel_y(1,100*%i) term that integrate produces. I checked the value of this and I think it's correct. I assume that integrate produces the incorrect result. I didn't check that. Ray From toy.raymond at gmail.com Wed Oct 26 22:08:04 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 26 Oct 2011 20:08:04 -0700 Subject: [Maxima] Printing complex numbers changed? Message-ID: <4EA8CB14.4080306@gmail.com> It seems that printing of complex numbers has changed. With maxima 5.23post, I get: (%i1) -1-2*%i; (%o1) - 2 %i - 1 With the current git version, I get -(2 %i) - 1 Was this change intentional? I kind of like the old way better. (I'd much prefer -1 - 2*%i, but that seems much harder to produce.) Ray From fippu at fippu.ch Wed Oct 26 06:24:30 2011 From: fippu at fippu.ch (Philipp E. Imhof) Date: Wed, 26 Oct 2011 13:24:30 +0200 Subject: [Maxima] Maxima eating up memory? Message-ID: <4EA7EDEE.8060403@fippu.ch> Hello! I created a program that calculates the square root of an integer modulo another integer. In order to check for mistakes, I decided to run some automatic testing, by doing a brute-force search for all roots and comparing them to the roots found by my program. During these tests, I ran into memory problems. With each iteration of the test, Maxima uses more and more memory until it finally stops, saying it cannot allocate memory. What is very strange to me, is that memory does never seem to get freed. If, for example, I run a shorter test loop which can be sucessfully completed, I would expect the amount of free memory to raise, as Maxima is 'sleeping'. But 'top' shows that this is not the case. Even after issuing reset() and kill(all), the memory stays low until I quit() Maxima. I do not think that this is related to my program, as it can easily be reproduced by for i from 1 thru 10**10 do display(ifactors(i*(1+random(10**5)))); This eats up quite some memory. After some 150MB and Ctrl-C, the memory is not freed, as described above. After issuing quit(), the 150MB immediately move from 'used' to 'free' in top. Is there anything I can do in order to free unused memory within Maxima without quit()ting ? Is this a bug? Thank you very much for your help. Best regards Philipp From aleksasd873 at gmail.com Thu Oct 27 01:43:11 2011 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Thu, 27 Oct 2011 09:43:11 +0300 Subject: [Maxima] Sequence 1, 1, 2, 7, 33, 191, 1304, 10241, ... Message-ID: Sequence 1, 1, 2, 7, 33, 191, 1304, 10241, ... (%i1) h[i,j]:=if i=j then i elseif abs(i-j)=1 then 1 else 0; (%o1) h[i,j]:=if i=j then i elseif abs(i-j)=1 then 1 else 0 (%i2) A(n):=genmatrix(lambda([i,j], h[i,j]), n, n); (%o2) A(n):=genmatrix(lambda([i,j],h[i,j]),n,n) (%i3) makelist(A(k),k,1,8)$ (%i4) map(determinant,%); (%o4) [1,1,2,7,33,191,1304,10241] **************** (%i5) load(solve_rec); (%o5) "C:/PROGRA~2/MAXIMA~1.1/share/maxima/5.25.1/share/contrib/solve_rec/solve_rec.mac" (%i6) solve_rec(d(n)=n*d(n-1)-d(n-2),d(n),d(1)=1,d(2)=1); (%o6) false ***************** (%i7) f(n):= if n=1 or n=2 then 1 else n*f(n-1)-f(n-2); (%o7) f(n):=if n=1 or n=2 then 1 else n*f(n-1)-f(n-2) (%i8) makelist(f(k),k,1,8); (%o8) [1,1,2,7,33,191,1304,10241] ****************** (%i9) a(n):=(bessel_j(n,2)*bessel_y(0,2)-bessel_j(0,2)*bessel_y(n,2))/ (bessel_j(1,2)*bessel_y(0,2)-bessel_j(0,2)*bessel_y(1,2))$ (%i10) makelist(a(k),k,1,8)$ float(%); (%o11) [1.0,1.0,1.0,2.0,7.000000000000002,33.00000000000001,191.0000000000001,1304.0] How solve recurence equation d(n)=n*d(n-1)-d(n-2) ? How simplify a(n) to integer values ? References: http://oeis.org/A058797/b058797.txt Thank you for discussion Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From recmanqc at yahoo.com Thu Oct 27 02:40:54 2011 From: recmanqc at yahoo.com (Renante Mangumpit) Date: Thu, 27 Oct 2011 15:40:54 +0800 (SGT) Subject: [Maxima] Maxima Inquiry Message-ID: <1319701254.6203.YahooMailNeo@web190010.mail.sg3.yahoo.com> Sir: Please can I ask a couple of ?information about the above-mentioned Software? ? 1. Does it support GPU acceleration? 2. Does it support distributed networking? (running the same task in parallel computing to speed up the process.) Your answer is highly appreciated. Thank you very much, Renante -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Thu Oct 27 04:06:32 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Thu, 27 Oct 2011 10:06:32 +0100 Subject: [Maxima] Maxima eating up memory? References: <4EA7EDEE.8060403@fippu.ch> Message-ID: "Philipp E. Imhof" writes: > I do not think that this is related to my program, as it can easily be > reproduced by > > for i from 1 thru 10**10 do > display(ifactors(i*(1+random(10**5)))); > > This eats up quite some memory. After some 150MB and Ctrl-C, the > memory is not freed, as described above. After issuing quit(), the > 150MB immediately move from 'used' to 'free' in top. Can you give us slightly more information about which version of Maxima and what lisp you're using? (Also, I presume this isn't wxMaxima?) On my machine, I can't reproduce this. I have Maxima 5.25post http://maxima.sourceforge.net using Lisp SBCL 1.0.52.0.debian and before running it, here is what SBCL thinks its memory usage is: (%i1) :lisp (room) Dynamic space usage is: 63,111,880 bytes. Read-only space usage is: 3,512 bytes. Static space usage is: 2,256 bytes. Control stack usage is: 2,232 bytes. Binding stack usage is: 296 bytes. Control and binding stack usage is for the current thread only. Garbage collection is currently enabled. Breakdown for dynamic space: 20,423,552 bytes for 20,383 code objects. 14,818,296 bytes for 1,852,287 cons objects. 6,132,216 bytes for 116,770 simple-vector objects. 6,106,752 bytes for 68,193 simple-character-string objects. 6,063,936 bytes for 144,657 instance objects. 9,575,296 bytes for 261,917 other objects. 63,120,048 bytes for 2,464,207 dynamic objects (space total.) and htop says: 18278 rupert 20 0 525M 63624 51308 S 0.0 2.0 0:00.23 sbcl --core /h... (the 2.0 is MEM% and 63624 means 63mb resident memory, I think). Now let it run for 1 minute of CPU time (copy and pasting your code into a terminal) 18278 rupert 20 0 525M 66584 51476 S 0.0 2.1 1:00.45 sbcl --core /h... and SBCL says: (%i2) :lisp (room) Dynamic space usage is: 67,889,152 bytes. Read-only space usage is: 3,512 bytes. Static space usage is: 2,256 bytes. Control stack usage is: 2,232 bytes. Binding stack usage is: 296 bytes. Control and binding stack usage is for the current thread only. Garbage collection is currently enabled. Breakdown for dynamic space: 20,423,552 bytes for 20,383 code objects. 16,148,280 bytes for 2,018,535 cons objects. 6,892,264 bytes for 178,769 instance objects. 6,049,784 bytes for 114,112 simple-vector objects. 5,396,480 bytes for 47,818 simple-character-string objects. 5,196,024 bytes for 572,917 bignum objects. 9,810,320 bytes for 397,568 other objects. 69,916,704 bytes for 3,350,102 dynamic objects (space total.) This doesn't seem to be the behaviour you're seeing, so maybe you can tell us a bit more about your setup? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From fippu at fippu.ch Thu Oct 27 04:40:20 2011 From: fippu at fippu.ch (Philipp E. Imhof) Date: Thu, 27 Oct 2011 11:40:20 +0200 Subject: [Maxima] Maxima eating up memory? In-Reply-To: References: <4EA7EDEE.8060403@fippu.ch> Message-ID: <4EA92704.7040002@fippu.ch> > Can you give us slightly more information about which version of Maxima > and what lisp you're using? (Also, I presume this isn't wxMaxima?) I first discovered the problem within wxMaxima and then verified with Maxima. Maxima version: 5.25.1 Maxima build date: 9:14 9/5/2011 Host type: i686-apple-darwin10.8.0 Lisp implementation type: SBCL Lisp implementation version: 1.0.47 > and before running it, here is what SBCL thinks its memory usage is: (%i1) :lism (room) Dynamic space usage is: 61,992,984 bytes. Read-only space usage is: 2,792 bytes. Static space usage is: 1,712 bytes. Control stack usage is: 1,848 bytes. Binding stack usage is: 208 bytes. Garbage collection is currently enabled. Breakdown for dynamic space: 19,079,456 bytes for 20,201 code objects. 14,691,048 bytes for 1,836,381 cons objects. 7,705,680 bytes for 75,012 simple-character-string objects. 6,030,048 bytes for 114,380 simple-vector objects. 5,694,472 bytes for 131,236 instance objects. 8,812,912 bytes for 207,821 other objects. 62,013,616 bytes for 2,385,031 dynamic objects (space total.) And top says sbcl 12M 244K 60M 102M 2147M 8478 4500 sleeping If I now copy and paste my sample, and run it for 1 minute of CPU time, top says sbcl 16M 244K 67M+ 37M 2147M 8478 4500 running The figures did not seem to change a lot, but the amount of "free" memory according to top is reduced by 70MB. They come back pretty immediately after I quit Maxima. (%i3) :lisp (room) Dynamic space usage is: 57,778,272 bytes. Read-only space usage is: 2,792 bytes. Static space usage is: 1,712 bytes. Control stack usage is: 1,848 bytes. Binding stack usage is: 208 bytes. Garbage collection is currently enabled. Breakdown for dynamic space: 19,079,456 bytes for 20,201 code objects. 13,958,944 bytes for 1,744,868 cons objects. 6,029,224 bytes for 114,373 simple-vector objects. 5,597,416 bytes for 126,446 instance objects. 3,979,576 bytes for 37,765 simple-character-string objects. 9,585,424 bytes for 424,055 other objects. 58,230,040 bytes for 2,467,708 dynamic objects (space total.) As the missing memory does not seem to be used by Maxima, could this be an OS problem? I will check it on a Linux machine. Best regards Philipp From fateman at eecs.berkeley.edu Thu Oct 27 09:43:24 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 27 Oct 2011 07:43:24 -0700 Subject: [Maxima] Sequence 1, 1, 2, 7, 33, 191, 1304, 10241, ... In-Reply-To: References: Message-ID: <4EA96E0C.1000802@eecs.berkeley.edu> On 10/26/2011 11:43 PM, Aleksas Domarkas wrote: ... There is a round() function that you can use. There is a description of a Macsyma/Maxima program to solve recurrence relations in ACM Trans. on Math Software, vol4 no 1 March 1978 pp 24-33 by John Ivie. In particular it mentions the Bessel recurrence. His program should be around in Maxima, but I don't see it in the documentation. From christophe.pouzat at gmail.com Thu Oct 27 10:47:37 2011 From: christophe.pouzat at gmail.com (Christophe Pouzat) Date: Thu, 27 Oct 2011 17:47:37 +0200 Subject: [Maxima] Re-implementing R in Maxima Message-ID: <87mxcmzbae.fsf@xtof-netbook.home> Hi all, As an heavy R (http://www.r-project.org, a very nice statistical package which is "a bit" to Scheme what Maxima is to Common Lisp) and an occasional Maxima user (for symbolic computations, etc) I recently came across a very interesting conference paper by Ross Ihaka (one of the two original R developers) and Duncan Temple Lang: "Back to the Future: Lisp as a Base for a Statistical Computing System." (http://www.stat.auckland.ac.nz/%7Eihaka/downloads/Compstat-2008.pdf). The paper goes through some of the present limitations of R (not compiled, arguments passed by values, etc) and argues in favor of a reimplementation of R as an "M-expression" layer on top of Common Lisp. This paper triggered my interest in Common Lisp (better late than never!) and made me realized that I missed a lot about the capabilities of Maxima. But I would like the opinion of the Maxima's experts here, at least the ones who have time to read Ihaka and Temple Lang's paper: aren't they proposing to re-implement Maxima (with a strong statistical flavor)? If yes, wouldn't it be more economical to adapt to Maxima some of the coolest features of R? Christophe -- Most people are not natural-born statisticians. Left to our own devices we are not very good at picking out patterns from a sea of noisy data. To put it another way, we are all too good at picking out non-existent patterns that happen to suit our purposes. Bradley Efron & Robert Tibshirani (1993) An Introduction to the Bootstrap -- Christophe Pouzat Laboratoire de physiologie c?r?brale CNRS UMR 8118 UFR biom?dicale de l'Universit? Paris-Descartes 45, rue des Saints-P?res 75006 PARIS France tel: +33 (0)1 42 86 38 28 fax: +33 (0)1 42 86 38 30 mobile: +33 (0)6 62 94 10 34 web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html From toy.raymond at gmail.com Thu Oct 27 10:56:03 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 27 Oct 2011 08:56:03 -0700 Subject: [Maxima] Maxima Inquiry In-Reply-To: <1319701254.6203.YahooMailNeo@web190010.mail.sg3.yahoo.com> References: <1319701254.6203.YahooMailNeo@web190010.mail.sg3.yahoo.com> Message-ID: On Thu, Oct 27, 2011 at 12:40 AM, Renante Mangumpit wrote: > Sir: > > Please can I ask a couple of information about the above-mentioned > Software? > > 1. Does it support GPU acceleration? > No. Well, I suppose it could if the underlying Lisp used the GPU. Seems unlikely. > 2. Does it support distributed networking? (running the same task in > parallel computing to speed up the process.) > No, not directly. But maxima has sockets so you could set things up yourself to distribute your computing across a network via sockets. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Thu Oct 27 11:55:25 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 27 Oct 2011 09:55:25 -0700 Subject: [Maxima] Maxima Inquiry In-Reply-To: References: <1319701254.6203.YahooMailNeo@web190010.mail.sg3.yahoo.com> Message-ID: <4EA98CFD.3060105@eecs.berkeley.edu> On 10/27/2011 8:56 AM, Raymond Toy wrote: > > > On Thu, Oct 27, 2011 at 12:40 AM, Renante Mangumpit > > wrote: > > Sir: > > Please can I ask a couple of information about the > above-mentioned Software? > > 1. Does it support GPU acceleration? > > > No. Well, I suppose it could if the underlying Lisp used the GPU. > Seems unlikely. Most lisps support a "foreign function interface" by which a program written in C or another language can be invoked. Given suitable support in the hardware and operating system, lisp (and thus Maxima) could use it. Using a GPU for executing run-of-the-mill lisp stuff doesn't seem attractive at first glance. > > 2. Does it support distributed networking? (running the same task > in parallel computing to speed up the process.) > > > No, not directly. But maxima has sockets so you could set things up > yourself to distribute your computing across a network via sockets. Multiprocessing is not standardized but many lisp implementations have one or more versions of this. RJF > > 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 Thu Oct 27 12:13:40 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 27 Oct 2011 10:13:40 -0700 Subject: [Maxima] integrate bessel_k(2,%i*y) surprise Message-ID: <6B581076B4B547249471E99B925F1046@edwinc367e16bd> On Oct. 26, 2011, Raymond Toy wrote: ------------------------------- >> (%o26) 1.736293756153568-2.1367387806763253E+42*%i >> ---------------------------------------------------------------- >> Where does the 10^42 come from?? > >It comes from the bessel_y(1,100*%i) term that integrate produces. I >checked the value of this and I think it's correct. I assume that >integrate produces the incorrect result. I didn't check that. ---------------------------------------------- I agree that bessel_y(1,100*%i) produces 10^42. I also assume that integrate produces the incorrect result. Wolfram alpha gives a numerical value NIntegrate[BesselK[2,y*I],{y,1,100}] ---> -1.42033 + 1.62942*I and gives the indefinite integral in terms of the hypergeomentric function: the Meijer G-function. Ted From macrakis at alum.mit.edu Thu Oct 27 12:16:20 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 27 Oct 2011 13:16:20 -0400 Subject: [Maxima] Maxima Inquiry In-Reply-To: <1319701254.6203.YahooMailNeo@web190010.mail.sg3.yahoo.com> References: <1319701254.6203.YahooMailNeo@web190010.mail.sg3.yahoo.com> Message-ID: The quick (and somewhat incomplete) answer to both questions is 'no'. But I'll ask you back: what exactly are you trying to do, why do you think Maxima is a good tool to do it, and why do you think GPU acceleration or networked calculation would be useful for that problem? If you're trying to do a purely numerical calculation, Maxima is probably not the right place to do it -- though it can be an excellent place for *setting up* a numerical computation. If you're trying to do a purely symbolic calculation, why do you think you will be limited by machine resources? Sure, inverting a 1000 x 1000 symbolic matrix would take a lot of computation, but would the result (which might be enormous) actually be useful? -s On Thu, Oct 27, 2011 at 03:40, Renante Mangumpit wrote: > Sir: > > Please can I ask a couple of information about the above-mentioned > Software? > > 1. Does it support GPU acceleration? > 2. Does it support distributed networking? (running the same task in > parallel computing to speed up the process.) > > Your answer is highly appreciated. > > Thank you very much, > > Renante > > _______________________________________________ > 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 Oct 27 14:06:41 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 27 Oct 2011 13:06:41 -0600 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: <87mxcmzbae.fsf@xtof-netbook.home> References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: I read Ihaka's paper a while ago (so I apologize for my faulty memory) and iirc he is interested in reimplementing R in Lisp in order to make it run faster. I was kind of puzzled by the that. Obviously (well, it's obvious to me anyway) the big payoff is to combine numerical and symbolic computations. I would be very interested in porting some R capabilities into Maxima. I made a half-hearted effort to implement a "data frame" construct. I guess I should finish it. Another statistical package that could benefit from combined symbolic & numerical computations is the Bayesian inference package BUGS. I made some progress (far from a complete implementation) of a scheme to attempt symbolic computation first and then fall back on a numerical scheme. (The calculations of interest are integrals.) I wrote a paper about that if you're interested. I'd be interested to hear yours or anyones thoughts about this stuff. best, Robert Dodier From drdieterkaiser at web.de Thu Oct 27 14:05:42 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 27 Oct 2011 21:05:42 +0200 Subject: [Maxima] Printing complex numbers changed? In-Reply-To: <4EA8CB14.4080306@gmail.com> References: <4EA8CB14.4080306@gmail.com> Message-ID: <1319742342.1495.11.camel@dieter> Am Mittwoch, den 26.10.2011, 20:08 -0700 schrieb Raymond Toy: > It seems that printing of complex numbers has changed. With maxima > 5.23post, I get: > > (%i1) -1-2*%i; > (%o1) - 2 %i - 1 > > With the current git version, I get > > -(2 %i) - 1 > > Was this change intentional? I kind of like the old way better. (I'd > much prefer -1 - 2*%i, but that seems much harder to produce.) Sorry, but I have introduced this bug, when implementing a msize-mminus and dim-mminus function. I have already committed a correction in displa.def revision 22.10.2011. Therefore, I get the following with the current Maxima version: (%i1) -1-2*%i; (%o1) - 2 %i - 1 (%i2) display2d:false; (%o2) false (%i3) -1-2*%i; (%o3) -2*%i-1 Dieter Kaiser From drdieterkaiser at web.de Thu Oct 27 14:18:12 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 27 Oct 2011 21:18:12 +0200 Subject: [Maxima] integrate bessel_k(2,%i*y) surprise In-Reply-To: <6B581076B4B547249471E99B925F1046@edwinc367e16bd> References: <6B581076B4B547249471E99B925F1046@edwinc367e16bd> Message-ID: <1319743092.1495.14.camel@dieter> Am Donnerstag, den 27.10.2011, 10:13 -0700 schrieb Edwin Woollett: > On Oct. 26, 2011, Raymond Toy wrote: > ------------------------------- > >> (%o26) 1.736293756153568-2.1367387806763253E+42*%i > >> ---------------------------------------------------------------- > >> Where does the 10^42 come from?? > > > >It comes from the bessel_y(1,100*%i) term that integrate produces. I > >checked the value of this and I think it's correct. I assume that > >integrate produces the incorrect result. I didn't check that. > ---------------------------------------------- > I agree that bessel_y(1,100*%i) produces 10^42. > I also assume that integrate produces the incorrect result. > > Wolfram alpha gives a numerical value > NIntegrate[BesselK[2,y*I],{y,1,100}] ---> > > -1.42033 + 1.62942*I > > and gives the indefinite integral in terms of the hypergeomentric > function: the Meijer G-function. I have already corrected the integrals for bessel_i and bessel_y. I will check the integrals for bessel_k, too. I suppose an error in the implementation of the formula. Dieter Kaiser From fateman at eecs.berkeley.edu Thu Oct 27 14:25:33 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 27 Oct 2011 12:25:33 -0700 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: <4EA9B02D.5000304@eecs.berkeley.edu> I suggest you check out http://www.jstatsoft.org/v13/i10/paper "The Health of Lisp-Stat" and the other papers in that issue. From fippu at fippu.ch Thu Oct 27 14:25:35 2011 From: fippu at fippu.ch (Philipp E. Imhof) Date: Thu, 27 Oct 2011 21:25:35 +0200 Subject: [Maxima] Maxima eating up memory? In-Reply-To: References: <4EA7EDEE.8060403@fippu.ch> Message-ID: <4EA9B02F.9080705@fippu.ch> I must apologize for having blamed Maxima, as it really seems to be an OS problem. I just took out my 3-year-old netbook (you can all imagine how "powerful" this is) and it seamlessly runs one of my tests that did not complete on a brand new 27" iMac with 4GB of RAM due to insufficient memory. Tests on two different Linux machine, one being a 7-year-old desktop computer, show that Maxima gets memory assigned, more and more during the test, but not beyond a certain limit (e.g. 15 or 20%). I have now just completed a two hour test and almost immediately after completion Maxima gave back all that used RAM to the system. Best regards Philipp PS: This time, it's GCL with 5.25 and 5.20, one on Debian, one on Ubuntu From p.j.papasot at gmail.com Thu Oct 27 14:39:05 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Thu, 27 Oct 2011 22:39:05 +0300 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: As an R user, I can tell R actually does not have any Numerical Analysis capabilities "by itself". However, many well-known and well-tested Fortran subroutines implementing numerical methods do have R interfaces. This includes virtually everything one could expect from a numerical package, including quadrature, minimization, interpolation, solution of initial- and boundary-value problems, and more. Definitely way more than what a statistician would ever need. "The R Journal" has plenty of articles about that. Apparently, what is missing is Maxima's symbolic computations (although I wonder how a statistician could really need that as well.) In general, I have serious doubts if R is still a "software environment for statistical computing and graphics", as R webpage states. it seems to me more or less similar to packages like Scilab, Octave, and others, except that the syntax is not Matlab compatible. -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdieterkaiser at web.de Thu Oct 27 14:47:53 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 27 Oct 2011 21:47:53 +0200 Subject: [Maxima] integrate bessel_k(2,%i*y) surprise In-Reply-To: <1319743092.1495.14.camel@dieter> References: <6B581076B4B547249471E99B925F1046@edwinc367e16bd> <1319743092.1495.14.camel@dieter> Message-ID: <1319744873.1495.17.camel@dieter> Am Donnerstag, den 27.10.2011, 21:18 +0200 schrieb Dieter Kaiser: > Am Donnerstag, den 27.10.2011, 10:13 -0700 schrieb Edwin Woollett: > > On Oct. 26, 2011, Raymond Toy wrote: > > ------------------------------- > > >> (%o26) 1.736293756153568-2.1367387806763253E+42*%i > > >> ---------------------------------------------------------------- > > >> Where does the 10^42 come from?? > > > > > >It comes from the bessel_y(1,100*%i) term that integrate produces. I > > >checked the value of this and I think it's correct. I assume that > > >integrate produces the incorrect result. I didn't check that. > > ---------------------------------------------- > > I agree that bessel_y(1,100*%i) produces 10^42. > > I also assume that integrate produces the incorrect result. > > > > Wolfram alpha gives a numerical value > > NIntegrate[BesselK[2,y*I],{y,1,100}] ---> > > > > -1.42033 + 1.62942*I > > > > and gives the indefinite integral in terms of the hypergeomentric > > function: the Meijer G-function. > > I have already corrected the integrals for bessel_i and bessel_y. I will > check the integrals for bessel_k, too. I suppose an error in the > implementation of the formula. I have found an error in the integral of bessel_k. After correcting the formula I get: (%i2) integrate(bessel_k(2, %i*y),y,1,100); (%o2) (2*%i-50*%pi*struve_l(0,100*%i))*bessel_k(1,100*%i) +((%pi*struve_l(0,%i)-4*%i)*bessel_k(1,%i) +%pi*struve_l(-1,%i)*bessel_k(0,%i)) /2-50*%pi*struve_l(-1,100*%i)*bessel_k(0,100*%i) (%i3) rectform(%),numer; (%o3) 1.629424764063958*%i-1.420329286158196 Wolfram alpha gets the same numerical result. I will commit the correction soon. Dieter Kaiser From biomates at telefonica.net Thu Oct 27 15:33:37 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 27 Oct 2011 22:33:37 +0200 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: <1319747617.3924.28.camel@pc> El jue, 27-10-2011 a las 13:06 -0600, Robert Dodier escribi?: > I read Ihaka's paper a while ago (so I apologize for my faulty memory) > and iirc he is interested in reimplementing R in Lisp in order to > make it run faster. I was kind of puzzled by the that. Obviously (well, it's > obvious to me anyway) the big payoff is to combine numerical and symbolic > computations. > Yes, this link appeared in this mailing list four years ago: http://www.stat.auckland.ac.nz/dsc-2007/abstracts/program.html Also, I remember someone from the R team asked in this list how to call Maxima from R, since they used Yacas, which was no longer maintained at that time. > I would be very interested in porting some R capabilities into Maxima. > I made a half-hearted effort to implement a "data frame" construct. > I guess I should finish it. 'amatrix' could be a first step, and I tried once to start from here a better statistical Maxima framework than descriptive+stats. These two packages are based on lists, rather than arrays, and they are far from being optimal for large data sets. And sooner or later, many algorithms already implemented in Maxima for, say, matrices (which are lists) should be rewritten in order to operate with arrays. It's not only a question of writing an statistical package. Another approach, also discussed in this mailing list, is to call R via foreign function calls. There were some efforts on this direction, trying to call R from Common Lisp: http://common-lisp.net/project/rclg/ The marriage of Maxima & R is a recursive question, sort of 'Ewige Wiederkunft', in Friedrich Nietzsches' words. And well, speaking of Lisp, let's remember an important person for this community, who passed away some days ago: http://spectrum.ieee.org/tech-talk/robotics/artificial-intelligence/remembering-john-mccarthy-1927-2011 -- Mario From robert.dodier at gmail.com Thu Oct 27 15:45:03 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 27 Oct 2011 14:45:03 -0600 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: <4EA9B02D.5000304@eecs.berkeley.edu> References: <87mxcmzbae.fsf@xtof-netbook.home> <4EA9B02D.5000304@eecs.berkeley.edu> Message-ID: On 10/27/11, Richard Fateman wrote: > I suggest you check out http://www.jstatsoft.org/v13/i10/paper > > "The Health of Lisp-Stat" > > and the other papers in that issue. I've looked at Lisp-Stat in the past and to be honest I don't see much that's interesting there. The fact that it's written in Lisp doesn't really change that. best Robert Dodier From ko at research.att.com Thu Oct 27 18:05:17 2011 From: ko at research.att.com (Kostas Oikonomou) Date: Thu, 27 Oct 2011 19:05:17 -0400 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: <4EA9E3AD.9030503@research.att.com> Robert, If you're thinking about BUGS, I would suggest JAGS as an alternative. It's open-source (GPL), and runs on any Unix system: http://mcmc-jags.sourceforge.net/ Kostas On 10/27/11 03:06 PM, Robert Dodier wrote: > Another statistical package that could benefit from combined > symbolic& numerical computations is the Bayesian inference > package BUGS. I made some progress (far from a complete implementation) > of a scheme to attempt symbolic computation first and then fall > back on a numerical scheme. (The calculations of interest are integrals.) > I wrote a paper about that if you're interested. > > I'd be interested to hear yours or anyones thoughts about this stuff. > > best, Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From kcrisman at gmail.com Thu Oct 27 19:47:05 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Thu, 27 Oct 2011 20:47:05 -0400 Subject: [Maxima] Re-implementing R in Maxima Message-ID: Just as a note, the R user community is several orders of magnitude larger than that of Maxima (or Sage, for that matter), and their help list (about a hundred messages a day, give or take) constantly has people asking for symbolic manipulations (and other things usually performed more traditionally by Maple/Mma/Maxima/Sage/even Matlab/Octave..). So this is not a stupid question at all. There is a R port of both sympy and Yacas, and it is possible (though not always syntactically easy) to mix R and Sage/Maxima/Ginac symbolic and other things in Sage. I'm sure there are other packages which do various symbolics, including some calculus stuff in the new (pedagogically-oriented) mosaic package, the NSF grant of which should be of independent interest to Maxima folks (see http://mosaic-web.org/). So I don't see why it wouldn't be effective to make "hooks" in Maxima (or R) to use the other one directly, and there should be interest. Rewriting R, on the other hand, makes no sense; the sheer number of *quality* user-contributed packages to R is one of its strongest suits, one that could never be replicated. (In fact, it's why so many people are ditching the proprietary guys for R. There are at least FOUR companies which intend to eventually make a profit supporting or adding on to R in some fashion.) Karl-Dieter PS to rjf: and no, it doesn't really make sense to rewrite Maxima in Python or Cython (nor does Sage do so). Just forestalling that inevitable comment :) From toy.raymond at gmail.com Fri Oct 28 00:16:57 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 27 Oct 2011 22:16:57 -0700 Subject: [Maxima] Printing complex numbers changed? In-Reply-To: <1319742342.1495.11.camel@dieter> References: <4EA8CB14.4080306@gmail.com> <1319742342.1495.11.camel@dieter> Message-ID: <4EAA3AC9.1090706@gmail.com> On 10/27/11 12:05 PM, Dieter Kaiser wrote: > Am Mittwoch, den 26.10.2011, 20:08 -0700 schrieb Raymond Toy: >> It seems that printing of complex numbers has changed. With maxima >> 5.23post, I get: >> >> (%i1) -1-2*%i; >> (%o1) - 2 %i - 1 >> >> With the current git version, I get >> >> -(2 %i) - 1 >> >> Was this change intentional? I kind of like the old way better. (I'd >> much prefer -1 - 2*%i, but that seems much harder to produce.) > Sorry, but I have introduced this bug, when implementing a msize-mminus > and dim-mminus function. I have already committed a correction in > No problem. I was just curious if this was an intentional change or just a simple bug. Thanks for the quick fix. Ray From toy.raymond at gmail.com Fri Oct 28 00:33:10 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 27 Oct 2011 22:33:10 -0700 Subject: [Maxima] LIcenses [Re: A Maxima function for solving initial value problems with adaptive step size and error control.] In-Reply-To: References: Message-ID: <4EAA3E96.1070109@gmail.com> On 10/26/11 8:14 AM, Robert Dodier wrote: > On 10/25/11, Raymond Toy wrote: > >> But for the record, anything that I have placed in src (like my elliptic >> functions code), is GPL. Anything that I have done in share is under some >> license that I haven't decided on. Possibly public domain or BSD, or LGPL. > Um, in the interest of making life easier for those who wish to make > use of those files, I hope you will put some definite copyright & license > statement on them. How do you want this done? Just put a LICENSE file in each directory stating the license? I see that coblya has a license statement in a couple of the files. That's probably not good enough since other files don't have licenses. And what do we want to do about src/numerical/slatec? I think it certainly makes it more difficult to have src not all be under the GPL. Ray From rswarbrick at gmail.com Fri Oct 28 03:28:12 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 28 Oct 2011 09:28:12 +0100 Subject: [Maxima] Re-implementing R in Maxima References: Message-ID: Karl-Dieter Crisman writes: > Rewriting R, on the other hand, makes no sense; the sheer number of > *quality* user-contributed packages to R is one of its strongest > suits, one that could never be replicated. (In fact, it's why so many > people are ditching the proprietary guys for R. There are at least > FOUR companies which intend to eventually make a profit supporting or > adding on to R in some fashion.) I suspect that you're right that rewriting R would be silly, but this isn't really an argument for that statement. After all, if I wrote a lisp-hosted implementation of the core of R, all the excellent user-contributed packages would theoretically run just fine on my implementation too... 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 Thu Oct 27 04:46:16 2011 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Thu, 27 Oct 2011 12:46:16 +0300 Subject: [Maxima] Sequence 1, 1, 2, 7, 33, 191, 1304, 10241, ... Message-ID: Sequence 1, 1, 2, 7, 33, 191, 1304, 10241, ... (%i1) h[i,j]:=if i=j then i elseif abs(i-j)=1 then 1 else 0; (%o1) h[i,j]:=if i=j then i elseif abs(i-j)=1 then 1 else 0 (%i2) A(n):=genmatrix(lambda([i,j], h[i,j]), n, n); (%o2) A(n):=genmatrix(lambda([i,j], h[i,j]),n,n) (%i3) makelist(A(k),k,1,8)$ (%i4) map(determinant,%); (%o4) [1,1,2,7,33,191,1304,10241] **************** (%i5) load(solve_rec); (%o5) "C:/PROGRA~2/MAXIMA~1.1/share/maxima/5.25.1/share/contrib/solve_rec/solve_rec.mac" (%i6) solve_rec(d(n)=n*d(n-1)-d(n-2),d(n),d(1)=1,d(2)=1); (%o6) false ***************** (%i7) f(n):= if n=1 or n=2 then 1 else n*f(n-1)-f(n-2); (%o7) f(n):=if n=1 or n=2 then 1 else n*f(n-1)-f(n-2) (%i8) makelist(f(k),k,1,8); (%o8) [1,1,2,7,33,191,1304,10241] ****************** (%i9) a(n):=(bessel_j(n,2)*bessel_y(0,2)-bessel_j(0,2)*bessel_y(n,2))/ (bessel_j(1,2)*bessel_y(0,2)-bessel_j(0,2)*bessel_y(1,2))$ (%i10) makelist(a(k),k,1,8)$ float(%); (%o11) [1.0,1.0,1.0,2.0,7.000000000000002,33.00000000000001,191.0000000000001,1304.0] How solve recurence equation d(n)=n*d(n-1)-d(n-2) ? How simplify a(n) to integer values ? References: http://oeis.org/A058797/b058797.txt I found the answer to the second question: (%i1) a(n):=(bessel_j(n,2)*bessel_y(0,2)-bessel_j(0,2)*bessel_y(n,2))/ (bessel_j(1,2)*bessel_y(0,2)-bessel_j(0,2)*bessel_y(1,2))$ (%i2) load(contrib_ode)$ (%i3) makelist(a(k),k,1,10)$ (%i4) bessimp(%); (%o4) [1,1,1,2,7,33,191,1304,10241,90865] Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From rswarbrick at gmail.com Fri Oct 28 03:35:16 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 28 Oct 2011 09:35:16 +0100 Subject: [Maxima] Sequence 1, 1, 2, 7, 33, 191, 1304, 10241, ... References: Message-ID: Sorry for the double post: Aleksas had got one version caught in the moderation queue and I didn't realise that I'd already seen it until after accepting. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From blindglobe at gmail.com Fri Oct 28 03:51:21 2011 From: blindglobe at gmail.com (A.J. Rossini) Date: Fri, 28 Oct 2011 10:51:21 +0200 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: References: Message-ID: On Fri, Oct 28, 2011 at 10:28 AM, Rupert Swarbrick wrote: > Karl-Dieter Crisman writes: >> Rewriting R, on the other hand, makes no sense; the sheer number of >> *quality* user-contributed packages to R is one of its strongest >> suits, one that could never be replicated. ?(In fact, it's why so many >> people are ditching the proprietary guys for R. ?There are at least >> FOUR companies which intend to eventually make a profit supporting or >> adding on to R in some fashion.) > > I suspect that you're right that rewriting R would be silly, but this > isn't really an argument for that statement. After all, if I wrote a > lisp-hosted implementation of the core of R, all the excellent > user-contributed packages would theoretically run just fine on my > implementation too... What would be nice, in my opinion, is a interactive compiled R-like / Lisp-Stat like system for data analysis, based on common lisp, using packages to support R-like features. I've been slowly working on that for a few years now, actually had basic computation / data / display functionalities done (including limited conditional plot tools, i.e. "lattice graphics") but it's going slow. (personal reasons - major family health crisis that I'm only now recovering from). If people are interested, see my github repo's which point in the direction I'm heading. I'd be interested in conversing with folks interesting in doing that. I'm not a de-novo hacker, I'm a package integrator. Obviously. best, -tony blindglobe at gmail.com Muttenz, Switzerland. "Commit early,commit often, and commit in a repository from which we can easily roll-back your mistakes" (AJR, 4Jan05). Drink Coffee:? Do stupid things faster with more energy! From christophe.pouzat at gmail.com Fri Oct 28 07:07:46 2011 From: christophe.pouzat at gmail.com (Christophe Pouzat) Date: Fri, 28 Oct 2011 14:07:46 +0200 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: (Robert Dodier's message of "Thu, 27 Oct 2011 13:06:41 -0600") References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: <87hb2tjp4d.fsf@xtof-netbook.home> Robert Dodier writes: > I read Ihaka's paper a while ago (so I apologize for my faulty memory) > and iirc he is interested in reimplementing R in Lisp in order to > make it run faster. I was kind of puzzled by the that. Obviously (well, it's > obvious to me anyway) the big payoff is to combine numerical and symbolic > computations. I agree with you that the capability to combine numerical and symbolic computation is a big pay-off but I also see a clear benefit in having CLisp as an underlying engine simply to make the loop run faster. > > I would be very interested in porting some R capabilities into Maxima. > I made a half-hearted effort to implement a "data frame" construct. > I guess I should finish it. > > Another statistical package that could benefit from combined > symbolic & numerical computations is the Bayesian inference > package BUGS. I made some progress (far from a complete implementation) > of a scheme to attempt symbolic computation first and then fall > back on a numerical scheme. (The calculations of interest are integrals.) > I wrote a paper about that if you're interested. > > I'd be interested to hear yours or anyones thoughts about this stuff. I fully agree on this point (the potential benefit of a software like Maxima for Bayesian inference). I've myself committed a couple of papers using the MCMC methodology (http://intl-jn.physiology.org/cgi/content/abstract/91/6/2910, http://fr.arxiv.org/abs/q-bio.QM/0405012) and I think that this approach is really challenging as far as software development is concerned since you want to leave as much freedom as possible to the user as far as model specification (likelihood function and priors) is concerned while keeping run-times reasonable on realistic data sets. As far as efficiency (run-time) is concerned, clearly doing as much as possible symbolically should help and being able to generate compiled code without too much trouble should help when the numerical methods can't be avoided. Christophe -- Most people are not natural-born statisticians. Left to our own devices we are not very good at picking out patterns from a sea of noisy data. To put it another way, we are all too good at picking out non-existent patterns that happen to suit our purposes. Bradley Efron & Robert Tibshirani (1993) An Introduction to the Bootstrap -- Christophe Pouzat Laboratoire de physiologie c?r?brale CNRS UMR 8118 UFR biom?dicale de l'Universit? Paris-Descartes 45, rue des Saints-P?res 75006 PARIS France tel: +33 (0)1 42 86 38 28 fax: +33 (0)1 42 86 38 30 mobile: +33 (0)6 62 94 10 34 web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html From christophe.pouzat at gmail.com Fri Oct 28 07:10:29 2011 From: christophe.pouzat at gmail.com (Christophe Pouzat) Date: Fri, 28 Oct 2011 14:10:29 +0200 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: <4EA9B02D.5000304@eecs.berkeley.edu> (Richard Fateman's message of "Thu, 27 Oct 2011 12:25:33 -0700") References: <87mxcmzbae.fsf@xtof-netbook.home> <4EA9B02D.5000304@eecs.berkeley.edu> Message-ID: <87d3dhjozu.fsf@xtof-netbook.home> Richard Fateman writes: > I suggest you check out http://www.jstatsoft.org/v13/i10/paper > > "The Health of Lisp-Stat" > > and the other papers in that issue. > Thanks for this pointer! It's strange that Ihaka and Temple-Lang don't site any paper of this special issue in their communication. The paper by Luke Tierney is particularly interesting. Christophe -- Most people are not natural-born statisticians. Left to our own devices we are not very good at picking out patterns from a sea of noisy data. To put it another way, we are all too good at picking out non-existent patterns that happen to suit our purposes. Bradley Efron & Robert Tibshirani (1993) An Introduction to the Bootstrap -- Christophe Pouzat Laboratoire de physiologie c?r?brale CNRS UMR 8118 UFR biom?dicale de l'Universit? Paris-Descartes 45, rue des Saints-P?res 75006 PARIS France tel: +33 (0)1 42 86 38 28 fax: +33 (0)1 42 86 38 30 mobile: +33 (0)6 62 94 10 34 web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html From christophe.pouzat at gmail.com Fri Oct 28 07:58:16 2011 From: christophe.pouzat at gmail.com (Christophe Pouzat) Date: Fri, 28 Oct 2011 14:58:16 +0200 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: (maxima-request@math.utexas.edu's message of "Thu, 27 Oct 2011 18:05:19 -0500") References: Message-ID: <878vo5jms7.fsf@xtof-netbook.home> > As an R user, I can tell R actually does not have any Numerical Analysis > capabilities "by itself". However, many well-known and well-tested Fortran > subroutines implementing numerical methods do have R interfaces. This > includes virtually everything one could expect from a numerical package, > including quadrature, minimization, interpolation, solution of initial- and > boundary-value problems, and more. Definitely way more than what a > statistician would ever need. "The R Journal" has plenty of articles about > that. > Apparently, what is missing is Maxima's symbolic computations (although I > wonder how a statistician could really need that as well.) Well, check David Andrews' web site (http://www.utstat.utoronto.ca/david/home.html) as well as his book, co-authored with James Stafford: "Symbolic Computation for Statistical Inference" OUP, 2000. > In general, I > have serious doubts if R is still a "software environment for statistical > computing and graphics", as R webpage states. it seems to me more or less > similar to packages like Scilab, Octave, and others, except that the syntax > is not Matlab compatible. I would put that differently: you can easily do with R what you would do with Scilab and Octave BUT YOU CAN DO MUCH MORE if you're interested in statistics as illustrated, for instance, by: the model formula, the graphical outputs (plot methods) of fitting functions, the implementation of the grammar of graphics, etc. The key advantage I see in Maxima when compared to R ? in addition to Maxima's built-in symbolic computation capabilities ? is precisely what motivates Ihaka to rebuilt a statistical engine on top of CLisp. I want to be able to create, without too much hassle, compiled functions that I can call from my "top level". The case was in fact very clearly made in Fateman et al (1995) "Fast Floating-Point Processing in Common Lisp" (http://www.cs.berkeley.edu/~fateman/papers/lispfloat.ps) and has recently been reformulated by Didier Vernat (2006) "Beating C in Scientific Computing Applications" (http://www.lrde.epita.fr/~didier/research/verna.06.ecoop.pdf). I'm working with relatively large data sets (the raw data can be seen as matrices 10 x 10e6 of integers or floating points) and fair amount of my pre-processing involves "simple" computations requiring loops. Of course I could do it in C (that's what I've done so far) but I would be very interested in finding a more "uniform" solution. And, as a side but important point, if C is a great language, Common Lisp is ? with due respect to the late Dennis Ritchie ? much more fun to program with. Christophe -- Most people are not natural-born statisticians. Left to our own devices we are not very good at picking out patterns from a sea of noisy data. To put it another way, we are all too good at picking out non-existent patterns that happen to suit our purposes. Bradley Efron & Robert Tibshirani (1993) An Introduction to the Bootstrap -- Christophe Pouzat Laboratoire de physiologie c?r?brale CNRS UMR 8118 UFR biom?dicale de l'Universit? Paris-Descartes 45, rue des Saints-P?res 75006 PARIS France tel: +33 (0)1 42 86 38 28 fax: +33 (0)1 42 86 38 30 mobile: +33 (0)6 62 94 10 34 web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.html From fateman at eecs.berkeley.edu Fri Oct 28 10:08:55 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 28 Oct 2011 08:08:55 -0700 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: <878vo5jms7.fsf@xtof-netbook.home> References: <878vo5jms7.fsf@xtof-netbook.home> Message-ID: <4EAAC587.8000103@eecs.berkeley.edu> two comments: Before the Macsyma Inc company gave up, it implemented what was essentially Matlab (of that time, anyway). From the documentation/ demo file: "You can use Matlab commands in Macsyma in three ways: Method 1. Macsyma can load Matlab language files. Method 2. Translate Matlab language files into Macsyma language files. Method 3. Type Matlab Commands to the Macsyma Window. " This facility was not enough to keep the company from folding. Could one have lured an actual Matlab user into using Macsyma instead? Are one's favorite programs truly portable in such circumstances? Are these questions relevant re Maxima+R projects? .............. 2nd comment. I was not aware of Vernat's paper, (which for those who choose not to spend the time to read it..) suggests that the speed difference between C and Lisp for some image processing tasks is negligible. Thanks for pointing it out. RJF From fateman at eecs.berkeley.edu Fri Oct 28 11:17:48 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 28 Oct 2011 09:17:48 -0700 Subject: [Maxima] integrate of bessel_i sign error? In-Reply-To: <1319311187.10145.11.camel@dieter> References: <0A7E0BC049334231B6011496CFB4AC81@edwinc367e16bd> <1319311187.10145.11.camel@dieter> Message-ID: <4EAAD5AC.7000100@eecs.berkeley.edu> A paper that describes an alternative to the numerical integration of bessel functions when multiplied by other functions has just been revised ... http://www.cs.berkeley.edu/~fateman/papers/byparts.pdf This might be of tangential interest to people concerned with this thread. RJF From woollett at charter.net Fri Oct 28 12:32:42 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 28 Oct 2011 10:32:42 -0700 Subject: [Maxima] integrate of bessel_i sign error? References: <0A7E0BC049334231B6011496CFB4AC81@edwinc367e16bd> <1319311187.10145.11.camel@dieter> <4EAAD5AC.7000100@eecs.berkeley.edu> Message-ID: <3EC28F8CB86B455C8A1D1AA70A6C5A62@edwinc367e16bd> On Oct. 28, Richard Fateman wrote: ---------------------------- >A paper that describes an alternative to the numerical integration of >bessel functions when multiplied by other functions has just been >revised ... >http://www.cs.berkeley.edu/~fateman/papers/byparts.pdf >This might be of tangential interest to people concerned with this thread. ---------------------- Thanks for the reference. I would like to find a way to numerically integrate cos(log(x)/x)/x over [0, 1], (ans = 0.323367) and perhaps your approach would work. Ted From fateman at eecs.berkeley.edu Fri Oct 28 12:37:03 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 28 Oct 2011 10:37:03 -0700 Subject: [Maxima] rat(q) gives (2*sqrt(17)+1)/16. factor(q), ratsimp(q) ... give quotient by zero expand(q) gives 0. Message-ID: <4EAAE83F.5030506@eecs.berkeley.edu> q: -((((-1 + sqrt(17))**2 - ((-3 + sqrt(17))*(5 + 3*sqrt(17)))/2)* (((-1 + sqrt(17))**2*(4 + sqrt(17)))/4 - ((5 + sqrt(17))*(5 + 3*sqrt(17)))/8))/ (-1 - 8*(4 + sqrt(17)) + (4 + sqrt(17))**2)**2); expand(q) gives 0 rat(q) gives (2*sqrt(17)+1)/16 ratsimp, factor, radcan, give quotient by zero. (example taken from report in mathematica news group. Mathematica is similarly befuddled.) RJF From kcrisman at gmail.com Fri Oct 28 12:51:27 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Fri, 28 Oct 2011 13:51:27 -0400 Subject: [Maxima] "Unexpected behavior of log() in complex plane" Message-ID: Hi all, There is a new Sage user who's been using quite a bit of the symbolic capabilities of Sage (=Maxima) while considering porting from Mathematica. He came across behavior along the following lines. (%i1) declare(w,real); (%o1) done (%i2) assume(w<0); (%o2) [w < 0] (%i3) limit(log(w+%i*eps),eps,0); (%o3) und (%i4) limit(log(w+%i*eps),eps,0,plus); (%o4) log(w) + %i %pi Now, the user (and several commenters at http://ask.sagemath.org/question/839/unexpected-behavior-of-log-in-complex-plane) say that this is very wrong, because it should be log(-w) (or so I understand the comments to indicate), because the i*pi takes care of the minus sign and we get the usual log of the positive real thing that's left, -w. I don't think anyone is complaining about the imaginary part being i*pi, given the usual branch cut. Well, I also know that Maxima tends to be pretty good with this sort of thing, though bugs do creep in. But I'm wondering whether there just isn't something inappropriate in how we/he are using declare, assume, and limit together, since Maxima's own documentation says that assume doesn't play well with other things. And of course maybe I'm misunderstanding the intended behavior of log here? Of course, if this *is* a bug, then I'll file a report. It does this in 5.25.0. And if I just have completely forgotten my complex analysis since the last time I taught it and this person is barking up the wrong tree, please let me know that; all you can hurt is my pride :) Thanks! From fateman at eecs.berkeley.edu Fri Oct 28 13:25:38 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 28 Oct 2011 11:25:38 -0700 Subject: [Maxima] "Unexpected behavior of log() in complex plane" In-Reply-To: References: Message-ID: <4EAAF3A2.4040609@eecs.berkeley.edu> The behavior you report below is not the behavior of the Maxima that I just tried it on, 5.23.2. It reports for an answer, log(w). Originally the limit program did not refer directly to assumptions or declarations, and so lines %i1 and %i2 should be irrelevant. Newer versions of limit, or subroutines called during the computation of limits may refer to that information. Also, originally, the limit program was aimed at computing limits of real-valued functions. If it works in other contexts, that's nice, but not something that was an original intent. So complex log -- eh, not necessarily supported. But log has multiple values, and to distinguish between log(w)+n*i*pi for odd integer n, and log(-w), is a kind of subtle point, not one that is easily handled by ... just tell me the limit, don't confuse me with, uh, the mathematics... So, one answer is: upgrade Sage to a later Maxima. Also, experts on the current limit may wish to respond. On 10/28/2011 10:51 AM, Karl-Dieter Crisman wrote: > Hi all, > > There is a new Sage user who's been using quite a bit of the symbolic > capabilities of Sage (=Maxima) while considering porting from > Mathematica. He came across behavior along the following lines. > > (%i1) declare(w,real); > (%o1) done > (%i2) assume(w<0); > (%o2) [w< 0] > (%i3) limit(log(w+%i*eps),eps,0); > (%o3) und > (%i4) limit(log(w+%i*eps),eps,0,plus); > (%o4) log(w) + %i %pi > > Now, the user (and several commenters at > http://ask.sagemath.org/question/839/unexpected-behavior-of-log-in-complex-plane) > say that this is very wrong, because it should be log(-w) (or so I > understand the comments to indicate), because the i*pi takes care of > the minus sign and we get the usual log of the positive real thing > that's left, -w. I don't think anyone is complaining about the > imaginary part being i*pi, given the usual branch cut. > > Well, I also know that Maxima tends to be pretty good with this sort > of thing, though bugs do creep in. But I'm wondering whether there > just isn't something inappropriate in how we/he are using declare, > assume, and limit together, since Maxima's own documentation says that > assume doesn't play well with other things. > > And of course maybe I'm misunderstanding the intended behavior of log here? > > Of course, if this *is* a bug, then I'll file a report. It does this in 5.25.0. > > And if I just have completely forgotten my complex analysis since the > last time I taught it and this person is barking up the wrong tree, > please let me know that; all you can hurt is my pride :) > > Thanks! > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Fri Oct 28 13:38:14 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 28 Oct 2011 14:38:14 -0400 Subject: [Maxima] rat(q) gives (2*sqrt(17)+1)/16. factor(q), ratsimp(q) ... give quotient by zero expand(q) gives 0. In-Reply-To: <4EAAE83F.5030506@eecs.berkeley.edu> References: <4EAAE83F.5030506@eecs.berkeley.edu> Message-ID: Well, (2*sqrt(17)+1)/16 is correct for almost all values of 17 :-) : Consider e17: subst(t,17,q)$ ratsimp(e17) => (2*sqrt(t)+1)/16 but factor(denom(e17)) => (t-17)^2 This is probably related to cases like this: r: (sqrt(3)+1)^2-2*sqrt(3)-4; r/r => 1 ratsimp(r) => 0 where Maxima (and apparently Mathematica as well) assumes that expr/expr => 1 regardless of what expr is. On Fri, Oct 28, 2011 at 13:37, Richard Fateman wrote: > q: -((((-1 + sqrt(17))**2 - ((-3 + sqrt(17))*(5 + 3*sqrt(17)))/2)* > (((-1 + sqrt(17))**2*(4 + sqrt(17)))/4 - > ((5 + sqrt(17))*(5 + 3*sqrt(17)))/8))/ > (-1 - 8*(4 + sqrt(17)) + (4 + sqrt(17))**2)**2); > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adammaj1 at o2.pl Fri Oct 28 13:59:26 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Fri, 28 Oct 2011 20:59:26 +0200 Subject: [Maxima] animated gif Message-ID: Hi, Can I make animated gif (or any other graphic file) by writing array to file ? like in R code : http://commons.wikimedia.org/wiki/File:Mandelbrot_Creation_Animation_%28800x600%29.gif Regards Adam From woollett at charter.net Fri Oct 28 14:17:22 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 28 Oct 2011 12:17:22 -0700 Subject: [Maxima] slatec quad_qagi error message Message-ID: <4459E0A8C87C46DEA5F9EC54557A16A4@edwinc367e16bd> Despite using the new control features to surpress slatec error messages, here is a quad_qagi example which appears to generate a error message. (I am using load ("j4save.lisp")$ and quad_j4save('control, 0)$ in nint.mac until the next Windows binary version of Maxima comes out.) ------------- (%i1) load(nint); (%o1) "c:/work2/nint.mac" (%i8) quad_qagi((sin(x+sqrt(x))+x*bessel_j(0,x^2))/(1+x),x,0,inf,limit=700); * NO PRECISION BECAUSE X IS BIG (%o8) quad_qagi((sin(x+sqrt(x))+bessel_j(0,x^2)*x)/(x+1),x,0,inf, epsrel = 1.0E-8,epsabs = 0.0,limit = 700) ----------------------------- The advertised answer to this numerical integral is (Mathematica) 0.78195 Any good ideas for using slatec (or other) to get the finite answer? Ted From kcrisman at gmail.com Fri Oct 28 15:59:46 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Fri, 28 Oct 2011 16:59:46 -0400 Subject: [Maxima] "Unexpected behavior of log() in complex plane" In-Reply-To: <4EAAF3A2.4040609@eecs.berkeley.edu> References: <4EAAF3A2.4040609@eecs.berkeley.edu> Message-ID: On Fri, Oct 28, 2011 at 2:25 PM, Richard Fateman wrote: > The behavior you report below is not the behavior of the Maxima that I just > tried it on, 5.23.2. > > It reports for an answer, log(w). Interesting. In that version I get Maxima 5.23.2 http://maxima.sourceforge.net using Lisp ECL 11.1.1 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) declare(w,real); (%o1) done (%i2) assume(w<0); (%o2) [w < 0] (%i3) limit(log(w+%i*eps),eps,0); (%o3) und (%i4) limit(log(w+%i*eps),eps,0,plus); (%o4) log(w) + %i %pi > Originally the limit program did not refer directly to assumptions or > declarations, and so > lines %i1 and %i2 should be irrelevant. ?Newer versions of limit, or > ?subroutines called during > the computation of limits may refer to that information. Yeah, that's what I figured. > Also, originally, the limit program was aimed at computing ?limits of > real-valued functions. ?If it works in other contexts, that's nice, but not > something that was an original intent. Ah, that is *definitely* interesting. > So complex log -- eh, not necessarily supported. ?But log has multiple > values, ?and to distinguish between > log(w)+n*i*pi ?for odd integer n, ? ? ?and log(-w), is a kind of subtle > point, not one that is easily handled by > > ... just tell me the limit, don't confuse me with, uh, ?the mathematics... Well, the point is that there is supposed to be a well-defined branch cut for such functions, and almost universally this is the negative real axis (see the post on ask.sagemath.org for Mathematica's computation). So that the limit would make sense, given this choice of branch. After all, if one does it numerically: sage: var('eps,w') (eps, w) sage: f(eps) = log(w+i*eps) sage: [f(e).subs(w=-1) for e in [.1,.01,.001,.0001]] [0.00497516542658397 + 3.04192400109863*I, 0.0000499975001665547 + 3.13159298690313*I, 4.99999750058881e-7 + 3.14059265392313*I, 4.99999995711264e-9 + 3.14149265359013*I] sage: [f(e).subs(w=-2) for e in [.1,.01,.001,.0001]] [0.694395620659239 + 3.09163425786785*I, 0.693159680403698 + 3.13659269525583*I, 0.693147305559930 + 3.14109265363146*I, 0.693147181809945 + 3.14154265358983*I] which sure looks like log(-(-2))+I*pi to me. This is the standard cut. > So, one answer is: ?upgrade Sage to a later Maxima. No, that doesn't make sense, because the 5.25.0 I tried is later than the Maxima in Sage. From talon at lpthe.jussieu.fr Fri Oct 28 16:57:38 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 28 Oct 2011 21:57:38 +0000 (UTC) Subject: [Maxima] "Unexpected behavior of log() in complex plane" References: <4EAAF3A2.4040609@eecs.berkeley.edu> <4EAAF3A2.4040609@eecs.berkeley.edu> Message-ID: Karl-Dieter Crisman wrote: > On Fri, Oct 28, 2011 at 2:25 PM, Richard Fateman > wrote: >> The behavior you report below is not the behavior of the Maxima that I just >> tried it on, 5.23.2. >> >> It reports for an answer, log(w). > > Interesting. In that version I get > > Maxima 5.23.2 http://maxima.sourceforge.net > using Lisp ECL 11.1.1 > 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) declare(w,real); > (%o1) done > (%i2) assume(w<0); > (%o2) [w < 0] > (%i3) limit(log(w+%i*eps),eps,0); > (%o3) und > (%i4) limit(log(w+%i*eps),eps,0,plus); > (%o4) log(w) + %i %pi > I get exactly the same on maxima 5.25.1 here, as a matter of fact. >> So complex log -- eh, not necessarily supported. ?But log has multiple >> values, ?and to distinguish between >> log(w)+n*i*pi ?for odd integer n, ? ? ?and log(-w), is a kind of subtle >> point, not one that is easily handled by >> >> ... just tell me the limit, don't confuse me with, uh, ?the mathematics... > > Well, the point is that there is supposed to be a well-defined branch > cut for such functions, This is a point where i disagree (and probably prof Fateman also). This branch cut is completely conventional. The only intrinsic datum is that there is a singularity at 0. Same as for the sqrt(x), which people say has a branch cut for x<0. But then what about sqrt((x+1)*(x-1)*(x+2)*(x-2)) for example (related to elliptic functions) or more complicated. What if i replace the roots 1, 2, etc. by 3+4*I etc. In what way are you going to say there are "canonical cuts"? For a sufficiently complex expression you will have hard time to understand things in terms of cuts, and you will be confronted to the Riemann surface which is the true object here. -- Michel Talon From woollett at charter.net Fri Oct 28 17:34:23 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 28 Oct 2011 15:34:23 -0700 Subject: [Maxima] limit of struve_h functions? Message-ID: Since the symbolic integrals of many bessel functions involve struve_h functions, it would be nice for limit to know about them. Here is an example of an integral which stalls for lack of such knowledge: ------------------------------------ (%i2) integrate(bessel_y(2,x),x,1,inf); (%o2) 'limit( (%pi*struve_h(0,x)*bessel_y(1,x) +%pi*struve_h(-1,x)*bessel_y(0,x))*x/2 -2*bessel_y(1,x), x, inf, minus) -((%pi*struve_h(0,1)-4)*bessel_y(1,1) +%pi*struve_h(-1,1)*bessel_y(0,1))/2 (%i3) limit (bessel_y(1,x),x,inf,minus); (%o3) 0 (%i4) limit (struve_h(0,x),x,inf,minus); (%o4) 'limit(struve_h(0,x),x,inf,minus) (%i5) limit (struve_h(-1,x),x,inf,minus); (%o5) 'limit(struve_h(-1,x),x,inf,minus) --------------------------------- Ted Woollett From fateman at eecs.berkeley.edu Fri Oct 28 18:07:01 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 28 Oct 2011 16:07:01 -0700 Subject: [Maxima] "Unexpected behavior of log() in complex plane" In-Reply-To: References: <4EAAF3A2.4040609@eecs.berkeley.edu> Message-ID: <4EAB3595.6030108@eecs.berkeley.edu> On 10/28/2011 1:59 PM, Karl-Dieter Crisman wrote: > On Fri, Oct 28, 2011 at 2:25 PM, Richard Fateman > wrote: >> The behavior you report below is not the behavior of the Maxima that I just >> tried it on, 5.23.2. >> >> It reports for an answer, log(w). > Interesting. In that version I get > > Maxima 5.23.2 http://maxima.sourceforge.net > using Lisp ECL 11.1.1 > 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) declare(w,real); > (%o1) done > (%i2) assume(w<0); > (%o2) [w< 0] > (%i3) limit(log(w+%i*eps),eps,0); > (%o3) und > (%i4) limit(log(w+%i*eps),eps,0,plus); > (%o4) log(w) + %i %pi In a fresh version 5.23.2 I get the same answers as you do. In the process I had running, I got log(w) rather than und. This is consistent with somehow ignoring the assume(w<0). > >> Originally the limit program did not refer directly to assumptions or >> declarations, and so >> lines %i1 and %i2 should be irrelevant. Newer versions of limit, or >> subroutines called during >> the computation of limits may refer to that information. > Yeah, that's what I figured. > >> Also, originally, the limit program was aimed at computing limits of >> real-valued functions. If it works in other contexts, that's nice, but not >> something that was an original intent. > Ah, that is *definitely* interesting. > >> So complex log -- eh, not necessarily supported. But log has multiple >> values, and to distinguish between >> log(w)+n*i*pi for odd integer n, and log(-w), is a kind of subtle >> point, not one that is easily handled by >> >> ... just tell me the limit, don't confuse me with, uh, the mathematics... > Well, the point is that there is supposed to be a well-defined branch > cut for such functions, and almost universally this is the negative > real axis (see the post on ask.sagemath.org for Mathematica's > computation). I think that anyone who has a serious interest in functions of a single complex variable and such manipulations as integration is aware that branch cuts can be moved as a matter of convenience in computations. I certainly would not refer to whatever Mathematica does as definitive in this matter. in the complex context, log(1) is n*pi*I for any integer n. (complex) log is not a function but a "multivalued function". Any treatment that tries to pick a single value is essentially doomed in some circumstances. Sqrt() is similarly going to screw up if you replace sqrt(x^2) with x, or abs(x). It is both x and -x. Asserting that x>0 does not change that, in spite of peoples' attempts to take that as a clue to sqrt()/ > So that the limit would make sense, given this choice > of branch. > > After all, if one does it numerically: > > sage: var('eps,w') > (eps, w) > sage: f(eps) = log(w+i*eps) > sage: [f(e).subs(w=-1) for e in [.1,.01,.001,.0001]] > [0.00497516542658397 + 3.04192400109863*I, 0.0000499975001665547 + > 3.13159298690313*I, 4.99999750058881e-7 + 3.14059265392313*I, > 4.99999995711264e-9 + 3.14149265359013*I] > sage: [f(e).subs(w=-2) for e in [.1,.01,.001,.0001]] > [0.694395620659239 + 3.09163425786785*I, 0.693159680403698 + > 3.13659269525583*I, 0.693147305559930 + 3.14109265363146*I, > 0.693147181809945 + 3.14154265358983*I] > > which sure looks like log(-(-2))+I*pi to me. This is the standard cut. It doesn't matter where you put the cut. log is multivalued. > >> So, one answer is: upgrade Sage to a later Maxima. > No, that doesn't make sense, because the 5.25.0 I tried is later than > the Maxima in Sage. Hm, in the future you would save us some time by indicating which Maxima was used in Sage. There is a function in Maxima called "plog". limit(plog(w+%i*eps),eps,0); gives log(-w)+%i *%pi note that with the assumption on w, plog(w) alone is log(-w) +%i*%pi. The argument of log in this expression is positive since w<0.... RJF From dbmaxima at gmail.com Fri Oct 28 20:20:44 2011 From: dbmaxima at gmail.com (David Billinghurst) Date: Sat, 29 Oct 2011 12:20:44 +1100 Subject: [Maxima] limit of struve_h functions? In-Reply-To: References: Message-ID: <4EAB54EC.7030400@gmail.com> On 29/10/2011 9:34 AM, Edwin Woollett wrote: > Since the symbolic integrals of many bessel functions > involve struve_h functions, it would be nice for limit > to know about them. Is there a suitable reference? I don't see anything explicit in: * Abramowitz and Stegun * NIST Handbook of Mathematical Functions * functions.wolfram.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From kcrisman at gmail.com Fri Oct 28 21:09:20 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Fri, 28 Oct 2011 22:09:20 -0400 Subject: [Maxima] "Unexpected behavior of log() in complex plane" In-Reply-To: <4EAB3595.6030108@eecs.berkeley.edu> References: <4EAAF3A2.4040609@eecs.berkeley.edu> <4EAB3595.6030108@eecs.berkeley.edu> Message-ID: > This is consistent with somehow ignoring the assume(w<0). Right. >> Well, the point is that there is supposed to be a well-defined branch >> cut for such functions, and almost universally this is the negative >> real axis (see the post on ask.sagemath.org for Mathematica's >> computation). Talon said: This is a point where i disagree (and probably prof Fateman also). This branch cut is completely conventional. The only intrinsic datum is that there is a singularity at 0. Same as for the sqrt(x), which people say has a branch cut for x<0. But then what about sqrt((x+1)*(x-1)*(x+2)*(x-2)) for example (related to elliptic functions) or more complicated. What if i replace the roots 1, 2, etc. by 3+4*I etc. In what way are you going to say there are "canonical cuts"? For a sufficiently complex expression you will have hard time to understand things in terms of cuts, and you will be confronted to the Riemann surface which is the true object here. > I think that anyone who has a serious interest in functions of a single > complex variable and such manipulations as integration is aware that branch > cuts can be moved as a matter of convenience in computations. > I certainly would not refer to whatever Mathematica does as definitive in > this matter. Yes, of course you are both right on this. I'm not suggesting anything of the nature (that is, that Mma is privileged in this choice), and I used 'well-defined' in the sense that people expect the IEEE versions, which I've heard (no guarantees!) are the 'usual' ones, and that if the software decides on a branch to start, one should stick with it as possible (i.e. as long as you don't go *past* the cut, which isn't the case here). But I hope you agree that it IS at least *confusing* that one thinks one has picked a branch with the assume(w<0) for w real. > in the complex context, log(1) is n*pi*I ?for any integer n. > (complex) log is not a function but a "multivalued function". ?Any treatment > that tries to pick a single value is essentially doomed in some > circumstances. ?Sqrt() is similarly going to screw up if you replace Yes. > Hm, in the future you would save us some time by indicating which Maxima was > used in Sage. Sorry, I should have been clear from the start that I wasn't using the one in Sage for the computations. > There is a function in Maxima called "plog". > > limit(plog(w+%i*eps),eps,0); > ?gives ?log(-w)+%i *%pi > > > note that with the assumption on w, plog(w) alone is > log(-w) +%i*%pi. > > The argument ?of log in this expression is positive since w<0.... Nice. Probably this is what the poster on our site is actually looking for. And I should have remembered the discussion of plog before. See http://permalink.gmane.org/gmane.comp.mathematics.maxima.general/32433 for a relevant comment from Barton. Anyway, this all is what I hoped would come from it; Maxima wants the most general answer, as usual, even with assumptions, but there *is* a way to do what is "expected" by the poster on a single-valued branch. Thanks. From toy.raymond at gmail.com Fri Oct 28 21:12:41 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 28 Oct 2011 19:12:41 -0700 Subject: [Maxima] slatec quad_qagi error message In-Reply-To: <4459E0A8C87C46DEA5F9EC54557A16A4@edwinc367e16bd> References: <4459E0A8C87C46DEA5F9EC54557A16A4@edwinc367e16bd> Message-ID: <4EAB6119.1030403@gmail.com> On 10/28/11 12:17 PM, Edwin Woollett wrote: > Despite using the new control features to surpress > slatec error messages, here is a quad_qagi example > which appears to generate a error message. > > (I am using load ("j4save.lisp")$ > and quad_j4save('control, 0)$ in nint.mac until > the next Windows binary version of Maxima comes > out.) > ------------- > (%i1) load(nint); > (%o1) "c:/work2/nint.mac" > > (%i8) > quad_qagi((sin(x+sqrt(x))+x*bessel_j(0,x^2))/(1+x),x,0,inf,limit=700); > > * NO PRECISION BECAUSE X IS BIG >From looking at the code, this looks like it's intentional. To fix this the right way, the slatec Fortran code would need to be changed. > > Any good ideas for using slatec (or other) to get the finite answer? The quadpack manual had some examples of integrating bessel functions. Basically, integrate between zeroes of the bessel functions, and sum the results, possibly using some kind of convergence acceleration technique for the sum. Not sure how effective this would for this, since it's not just f(x)*bessel(n,x). Ray From robert.dodier at gmail.com Sat Oct 29 11:11:39 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 29 Oct 2011 10:11:39 -0600 Subject: [Maxima] Problem with multiple results in help In-Reply-To: References: Message-ID: On 10/24/11, Stavros Macrakis wrote: > I would suggest that ? xxx display documentation for *ALL* things named xxx, > not just the first thing. I've pushed commit a2674edd so now ? foo displays foo and also foo if they exist. best Robert Dodier From toy.raymond at gmail.com Sat Oct 29 11:26:02 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 29 Oct 2011 09:26:02 -0700 Subject: [Maxima] [Maxima-commits] Maxima, A Computer Algebra System branch master updated. 765607874d66159c08ac5b1345e8863688645a31 In-Reply-To: References: Message-ID: <4EAC291A.70607@gmail.com> On 10/29/11 9:09 AM, Andreas Eder 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 765607874d66159c08ac5b1345e8863688645a31 (commit) > via 8333a526386da6b3e60df9f3f9e285aea13cf615 (commit) > from a2674edd749bb03ac09876bef3ee60ecbe60e422 (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. > > > replace remred by cl function delete-duplicates > > > diff --git a/src/solve.lisp b/src/solve.lisp > index 9c0cdc2..075b2fb 100644 > --- a/src/solve.lisp > +++ b/src/solve.lisp > @@ -906,7 +906,7 @@ > (defmfun $linsolve (eql varl) > (let (($ratfac)) > (setq eql (if ($listp eql) (cdr eql) (ncons eql))) > - (setq varl (if ($listp varl) (remred (cdr varl)) (ncons varl))) > + (setq varl (if ($listp varl) (delete-duplicates (cdr varl)) (ncons varl))) > (do ((varl varl (cdr varl))) > ((null varl)) > (when (mnump (car varl)) > @@ -915,11 +915,6 @@ > (make-mlist-simp) > (solvex (mapcar 'meqhk eql) varl (not $programmode) nil)))) > > -;; REMRED removes any repetition that may be in the variables list > -;; The NREVERSE is significant here for some reason? > - > -(defun remred (l) (if l (nreverse (union1 l nil)))) > - > Is this change correct? delete-duplicates doesn't seem to be the same as remred since remred reverses the result of union1. I did not check to see what union1 does, though. Perhaps it puts things in reverse so nreverse puts them back in the same order? Ray From robert.dodier at gmail.com Sat Oct 29 11:30:48 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 29 Oct 2011 10:30:48 -0600 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: <4EA6DC66.3080601@fe.up.pt> Message-ID: On 10/25/11, Panagiotis Papasotiriou wrote: > 2011/10/25 Jaime Villate >> One thing I would change though, is the "option = value" syntax. I find it >> confusing for the users to mix the two different option syntaxes "[option, >> value]" and "option: value" in the same package. The use of [foo, bar] options in plot2d is an unfortunate relic which I won't try to change at this time, but let's keep it from infiltrating other code. > rk itself has no optional arguments, but other functions in dynamics.mac do. > I have seen other packages using the "option=value" syntax, instead of > [option,value]. Although I personally like the "option=value" syntax, this > is indeed confusing for new users, considering that one of the most used > functions, plot2d, adopts the "[option,value]" syntax. It depends on where > rkf45 will be put, I guess. If rkf45 is to be included in dynamics.mac, then > I should definitely change the syntax for optional arguments, as Jaime > suggested. To be honest though, I think that a more appropriate place for > putting rkf45 would be share/numeric. It's up to you anyway. I recommend pretty strongly that you leave the foo=bar options as they are. I don't think the location of the package matters in this respect. best, Robert Dodier From robert.dodier at gmail.com Sat Oct 29 12:11:06 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 29 Oct 2011 11:11:06 -0600 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: I think we're mostly in agreement. I have some minor comments. At this time, I don't have any recommendations to change what we're doing. Disclaimer: I am not lawyer. On 10/25/11, Stavros Macrakis wrote: > In any case, there is absolutely no requirement that new share packages > which are not derived from existing code follow GPL. Agreed. > In fact, legally they probably don't even need to be "free software" > as long as they are simply distributed along with Maxima, > and not incorporated into distributed binaries. I don't mean to go into a long discussion about this (since we are not actually distributing such packages) but the question of whether or not the license of the Maxima binary (GPL) pertains to the distribution of Maxima + associated packages is quite murky: there are no clear principles, no decided cases to refer to, and I've yet to come across any qualified commentator who is willing to make a statement more definite than "I don't know, you should hire a lawyer to figure it out." Note that the situation of Maxima + packages is very similar to Python + packages. Given that Python is more widely used, there has been more discussion about licenses for Python packages; that could be a source of inspiration and/or confusion for Maxima. (Same goes for other interpreted languages.) > As the maintainers of Maxima, we can certainly decide that we > will only publish in share code which has a free or open-source license; we > can even decide that we require a license which is compatible with GPL. But > this includes not just LGPL, but also many others. Well, as long as we're using Sourceforge as a hosting service, we are obligated to release stuff under a license which conforms to their definition of free software. So given that, it's not entirely our choice. But even so, there are several licenses to choose from. > Code can also be multi-licensed under both GPL *and* other licenses > which can be incompatible with GPL. Agreed, but I would recommend against it ... the situation is confusing enough as it is. > Whether the code is compiled or not is irrelevant. Agreed, but (and again here is a point which is probably undecidable, but luckily not in need of decision) the manner in which the compiled code is distributed might be relevant. If all compiled bits are bound into one image, the license for distribution of that image would be (I suppose) somewhere in the intersection of each bit's license. But otherwise, perhaps the collection could be considered a "mere aggregation". > Robert likes GPL and considers it the "standard license" for share files, > but Robert does not decide for the developer community. Agreed. Let me add, though, that I don't have any absolute devotion to GPL; it just seems like the most comprehensible thing to do in this situation. > In particular, I would object to requiring share code to be licensed under GPL. OK by me. We just have to conform to the Sourceforge requirement for free software licenses. best Robert Dodier From robert.dodier at gmail.com Sat Oct 29 12:51:24 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 29 Oct 2011 11:51:24 -0600 Subject: [Maxima] share clean up: moving stuff around Message-ID: Hi, I'm trying to clean up maxima/share to some extent. Here's what I have done so far. If this doesn't elicit too many complaints, I'll merge & push these commits. best Robert Dodier PS. $ git log --reverse master..share-cleanup-branch-2011-10 commit 0a9ad5812354aad5088629b6115007ef2d567098 Author: robert_dodier Date: Sat Oct 8 19:03:15 2011 -0600 Share clean-up: move package stringproc out of share/contrib. commit 05172bec855ef183b0006c7f604567fa1ea57165 Author: robert_dodier Date: Sat Oct 8 19:06:00 2011 -0600 Share clean-up: move package graphs out of share/contrib. commit 3c472d469c5230fb848e33d07908dbd4ecb8bed5 Author: robert_dodier Date: Sat Oct 8 19:07:22 2011 -0600 Share clean-up: move package numericalio out of share/contrib. commit 3db5ee65933527aa46b31748c3dea0004571b3a2 Author: robert_dodier Date: Sat Oct 8 19:08:52 2011 -0600 Share clean-up: move package simplex out of share/contrib. commit 004fa9b4eb8f55846e5b69297a2afb6f6f3851f3 Author: robert_dodier Date: Sat Oct 8 19:10:09 2011 -0600 Share clean-up: move package ezunits out of share/contrib. commit 0183894c168378037121e604d91c0467f5be143c Author: robert_dodier Date: Sun Oct 9 10:44:02 2011 -0600 Share clean-up: move package bernstein out of share/contrib. commit ff5e1ffbd13de5932d394b1dc6234b8c7b34a881 Author: robert_dodier Date: Sun Oct 9 10:45:00 2011 -0600 Share clean-up: move package distrib out of share/contrib. commit 0a380b54bca7a5abe8a63a6235b6843f203ee655 Author: robert_dodier Date: Sun Oct 9 10:45:31 2011 -0600 Share clean-up: move package descriptive out of share/contrib. commit 4e9f418dc7edfb0fbd483ff59ecf62050639e064 Author: robert_dodier Date: Sun Oct 9 10:52:25 2011 -0600 Share clean-up: move package fourier_elim out of share/contrib. commit d5ca3cf10b952d8999a3305ce752e665e1cb7bf5 Author: robert_dodier Date: Sun Oct 9 10:52:59 2011 -0600 Share clean-up: move package pdiff out of share/contrib. commit 96a20fa09b3c466bbb738558f6e2bbad0378264e Author: robert_dodier Date: Sun Oct 9 10:53:48 2011 -0600 Share clean-up: move package solve_rec out of share/contrib. commit c62e501c03611dc349ab1336753a0228809792d5 Author: robert_dodier Date: Sun Oct 9 10:54:52 2011 -0600 Share clean-up: move package stats out of share/contrib. commit 663a8c8d2ead6f003a9bdb55f83ae0ea1446353b Author: robert_dodier Date: Sun Oct 9 10:58:40 2011 -0600 Share clean-up: move package amatrix out of share/contrib. commit 92e6176f9bdcaa308c7ffb6c79069769bddfa39c Author: robert_dodier Date: Sun Oct 9 11:05:43 2011 -0600 Share clean-up: move package finance out of share/contrib. commit e3e6a3047b09d515409ba6058b206450c700d052 Author: robert_dodier Date: Sun Oct 9 11:05:44 2011 -0600 Share clean-up: move package fractals out of share/contrib. commit 6e2160e648b20e3ccf0983c8aa670ad5940390e0 Author: robert_dodier Date: Sun Oct 9 11:05:44 2011 -0600 Share clean-up: move package mnewton out of share/contrib. commit 6e15b06078f37760b5fa0c89600c0019ab42259d Author: robert_dodier Date: Sun Oct 9 11:11:51 2011 -0600 Share clean-up: create share/integer_sequence and move stuff into it from share/contrib. commit e5ad1b88dafb3a502cce555aedf2bc8135118226 Author: robert_dodier Date: Sun Oct 9 11:13:19 2011 -0600 Share clean-up: create share/lsquares and move stuff into it from share/contrib. commit 698673b7827f9e5aea3de3f120acbaff7cc468e7 Author: robert_dodier Date: Sun Oct 9 11:38:21 2011 -0600 Share clean-up: create share/to_poly_solve and move stuff into it from share/contrib. commit 33e9b4f4b00688d6f36ba4d121cb669c55162b15 Author: robert_dodier Date: Sun Oct 9 11:51:19 2011 -0600 Share clean-up: create share/z_transform and move stuff into it from share/contrib. commit 7e106eedcef9d54dfeb37f2f6fd253102503f9f5 Author: robert_dodier Date: Sun Oct 9 11:52:48 2011 -0600 Share clean-up: create share/multiadditive and move stuff into it from share/contrib. commit 0cdc87aedd01d1e625c3a5bbfe60c85fa5261649 Author: robert_dodier Date: Sun Oct 9 11:55:05 2011 -0600 Share clean-up: create share/solve_rat_ineq and move stuff into it from share/contrib. commit 9c220ef0ead355ac5947fa413653ebcb3aabaf08 Author: robert_dodier Date: Sun Oct 9 11:56:39 2011 -0600 Share clean-up: move rtestdefstruct.mac into maxima/tests. commit fcfdea47546a55d67fc24fc011b974a6e841ad03 Author: robert_dodier Date: Sun Oct 9 11:59:06 2011 -0600 Share clean-up: remove share/contrib/nset; code and documentation were moved away long ago. From woollett at charter.net Sat Oct 29 13:02:40 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 29 Oct 2011 11:02:40 -0700 Subject: [Maxima] limit of struve_h functions? Message-ID: On Oct. 28, David Billinghurst wrote: ------------------------- >> Since the symbolic integrals of many bessel functions >> involve struve_h functions, it would be nice for limit >> to know about them. > >Is there a suitable reference? I don't see anything explicit in: > > * Abramowitz and Stegun > * NIST Handbook of Mathematical Functions > * functions.wolfram.com ---------------------------------------- Some references: ****** paper: Abramowitz and Stegun: pp. 496 - 502 Gradshteyn and Ryzhik, Tables of Integrals, Series, and Products, 7th ed (ed. by Jeffrey and Zwillinger) pp. 753 - 759, 942-943 G.N. Watson, A Treatise on the Theory of Bessel Functions pp. 328 - 338 ******* online: Wikipedia: http://eom.springer.de/S/s090700.htm NIST Handbook of Math. func: CH. 11: Struve and Related Functions: http://dlmf.nist.gov/11 Springer link to Encyclopedia of Math entry on Struve function: http://eom.springer.de/S/s090700.htm Wolfram alpha entry point to StruveH: http://www.wolframalpha.com/input/?i=StruveH Ted Woollett From willisb at unk.edu Sat Oct 29 13:20:55 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 29 Oct 2011 13:20:55 -0500 Subject: [Maxima] share clean up: moving stuff around In-Reply-To: References: Message-ID: All this seems great--for sometime, I've disliked the untidiness of having files in to_poly_solver scattered. Also, it's OK with me if the file name to_poly_solver.mac is changed to to_poly_solve.mac. This change might cause trouble--wxMaxima has a drop down that loads to_poly_solver, for example. Also the file topoly_solve can be deleted. Finally, I see lots of things like the following: commit 0a9ad5812354aad5088629b6115007ef2d567098 Author: robert_dodier Date: Sat Oct 8 19:03:15 2011 -0600 Share clean-up: move package stringproc out of share/contrib. Where is stringproc going? --bw From robert.dodier at gmail.com Sat Oct 29 13:22:06 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 29 Oct 2011 12:22:06 -0600 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: On 10/26/11, Panagiotis Papasotiriou wrote: > All necessary files can be downloaded from > https://sites.google.com/site/pjpapasot/maxima/libraries/rkf45 Thanks a lot for your work. I;m sorry to keep harping on this, but can you please put a copyright and license notice on each file? (and in the text of documents such as pdf's, if there are any.) Think of it this way. Suppose someone who wants to follow the rules comes across a file that you created. If there is no copyright or license notice, there are only limited things that person can do. But if you inform that person of the greater rights you are granting them, they can do much more. It is better to clearly state such rights, rather than making the user try to guess what you meant. It's probably true that there are some files in Maxima which don't have proper notices on them. That is a defect to be corrected, not something we want to extend to other works. best Robert Dodier From drdieterkaiser at web.de Sat Oct 29 13:24:51 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 29 Oct 2011 20:24:51 +0200 Subject: [Maxima] share clean up: moving stuff around In-Reply-To: References: Message-ID: <1319912691.1890.2.camel@dieter> Am Samstag, den 29.10.2011, 11:51 -0600 schrieb Robert Dodier: > Hi, I'm trying to clean up maxima/share to some extent. > Here's what I have done so far. If this doesn't elicit too > many complaints, I'll merge & push these commits. > > best Yes, it is a good idea to do these cleanups. Dieter Kaiser From maxima at etherjones.us Sat Oct 29 14:16:31 2011 From: maxima at etherjones.us (Ether Jones) Date: Sat, 29 Oct 2011 12:16:31 -0700 (PDT) Subject: [Maxima] how to use a subscripted variable in a "depends" statement Message-ID: <1319915791.47535.YahooMailNeo@web161801.mail.bf1.yahoo.com> Is there a way to use a subscripted variable in a "depends" statement?? See below: (%i1) depends(i[1],t); depends: argument must be a symbol; found: i[1] ?-- an error. To debug this try: debugmode(true); Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Oct 29 14:36:59 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 29 Oct 2011 13:36:59 -0600 Subject: [Maxima] share clean up: moving stuff around In-Reply-To: References: Message-ID: On 10/29/11, Barton Willis wrote: > All this seems great--for sometime, I've disliked the untidiness of having > files in to_poly_solver scattered. Also, it's OK with me if the file name > to_poly_solver.mac is changed to to_poly_solve.mac. > This change might cause trouble--wxMaxima has a drop > down that loads to_poly_solver, for example. Also the file topoly_solve can > be deleted. Yeah, I did something like that ... I'll take another look at it. > Finally, I see lots of things like the following: > Share clean-up: move package stringproc out of share/contrib. > > Where is stringproc going? Oh, sorry for the confusion -- all of those were moved from share/contrib/foo to share/foo. best Robert Dodier From robert.dodier at gmail.com Sat Oct 29 14:45:47 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 29 Oct 2011 13:45:47 -0600 Subject: [Maxima] how to use a subscripted variable in a "depends" statement In-Reply-To: <1319915791.47535.YahooMailNeo@web161801.mail.bf1.yahoo.com> References: <1319915791.47535.YahooMailNeo@web161801.mail.bf1.yahoo.com> Message-ID: On 10/29/11, Ether Jones wrote: > Is there a way to use a subscripted variable in a "depends" statement? No, to the best of my knowledge. depends(foo, x) puts its data (the dependency on x) on the property list of foo. (You can see that with :lisp (symbol-plist '$foo) after depends(foo, x).) That doesn't work for subscripted variables, because they are not symbols and therefore don't have a property list. There are various declarations which make use of the symbol property list, which therefore don't work for subscripted variables. I think it would be a good idea to generalize all of those declarations in some way, so that they work equally well for subscripted and unsubscripted variables. best Robert Dodier From robert.dodier at gmail.com Sat Oct 29 14:54:27 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 29 Oct 2011 13:54:27 -0600 Subject: [Maxima] Sequence 1, 1, 2, 7, 33, 191, 1304, 10241, ... In-Reply-To: References: Message-ID: On 10/27/11, Aleksas Domarkas wrote: > (%i6) solve_rec(d(n)=n*d(n-1)-d(n-2),d(n),d(1)=1,d(2)=1); > (%o6) false Unfortunately I really don't know about recurrence equations so I can't be very helpful here. Actually I have some questions of my own. What is the general realm of solvable recurrences? Can we tell by inspecting the equation that it is solvable or not? I am guessing that the solve_rec function reduces the recurrence to some related equation and then tries to solve that. Does anyone know what is the form of that equation? If so, we could figure out that solvability from that. Thanks for any info -- Robert Dodier From macrakis at alum.mit.edu Sat Oct 29 15:09:54 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 29 Oct 2011 16:09:54 -0400 Subject: [Maxima] how to use a subscripted variable in a "depends" statement In-Reply-To: References: <1319915791.47535.YahooMailNeo@web161801.mail.bf1.yahoo.com> Message-ID: Robert, I agree it would be nice to be able to declare properties of subscripted variables. I think we can solve the implementation issue once we figure out what we want the semantics to be. What semantics do you have in mind? Not sure there is a difficult problem here, but trying to think through the possibilities.... -s Suppose I declare a[i] is P: Is a[i] P for *all* i? (implicit universal quantifier) -- call this Universal Or only if the argument is identically the symbol "i"? (similar to f[i]: 23) -- call this Syntactic Or if Maxima can prove that the argument equals i? is(expr=i) implies P(a[expr]) -- call this Semantic Conversely, if I declare a[1] to have property P: Presumably a[1] is P. Does a[i] also have property P when i=1 according to the assume DB? In the Universal case, if I declare a[i] to be P, presumably declaring a[j] to be NotP causes an error. In the Universal case, does P( a[i,i] ) only apply when the two arguments are equal? Or is it universally quantified for each argument independently? What about the Semantic case? Presumably we take the usual Maxima "best effort" approach, i.e. if Maxima knows x=i, then it will treat a[x] as being P, otherwise not. If I declare a[i] to be P and a[j] to be NotP, what happens if I later assume(equal(i,j))? (Perhaps declare enters the assumption not equal(i,j)?) On Sat, Oct 29, 2011 at 15:45, Robert Dodier wrote: > On 10/29/11, Ether Jones wrote: > > > Is there a way to use a subscripted variable in a "depends" statement? > > No, to the best of my knowledge. > > depends(foo, x) puts its data (the dependency on x) on the property list of > foo. > (You can see that with :lisp (symbol-plist '$foo) after depends(foo, x).) > That doesn't work for subscripted variables, because they are not symbols > and therefore don't have a property list. > > There are various declarations which make use of the symbol property > list, which therefore don't work for subscripted variables. > I think it would be a good idea to generalize all of those declarations > in some way, so that they work equally well for subscripted and > unsubscripted variables. > > 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 fateman at eecs.berkeley.edu Sat Oct 29 15:19:51 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 29 Oct 2011 13:19:51 -0700 Subject: [Maxima] how to use a subscripted variable in a "depends" statement In-Reply-To: References: <1319915791.47535.YahooMailNeo@web161801.mail.bf1.yahoo.com> Message-ID: <4EAC5FE7.9000704@eecs.berkeley.edu> The simple solution may be to not use subscripted variables. instead of s[0], s[1], .... use s0, s1. you can even define s[n]:=concat(s,n) ............ in addition to Stavros' notes, consider this: foo(x):= block([a,b], local(a,b), depends(a[x],b[x])) or variants of it. Are the properties of symbols lexical? Also consider (assume(a>0), block([a], is (a>0)) ) etc RJF From talon at lpthe.jussieu.fr Sat Oct 29 15:30:47 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sat, 29 Oct 2011 20:30:47 +0000 (UTC) Subject: [Maxima] Sequence 1, 1, 2, 7, 33, 191, 1304, 10241, ... References: Message-ID: Robert Dodier wrote: > On 10/27/11, Aleksas Domarkas wrote: > >> (%i6) solve_rec(d(n)=n*d(n-1)-d(n-2),d(n),d(1)=1,d(2)=1); >> (%o6) false > > Unfortunately I really don't know about recurrence equations > so I can't be very helpful here. Actually I have some questions > of my own. One can find a lot of information on this problem in the book by Doron Zeilberger called AeqB , Chapter 8 "Algorithm Hyper". The book is available online at Zeilberger's site: http://www.math.upenn.edu/~wilf/AeqB.html Of course this is related to Gosper's and Zeilberger's algorithms which are implemented in maxima. -- Michel Talon From robert.dodier at gmail.com Sat Oct 29 15:44:11 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 29 Oct 2011 14:44:11 -0600 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: On 10/27/11, Panagiotis Papasotiriou wrote: > Apparently, what is missing is Maxima's symbolic computations (although I > wonder how a statistician could really need that as well.) Well, I'd like to see stuff like this: compute the mean / variance / etc of [a, b, c] where a, b, and c are symbols, intervals, objects which represent some special-purpose implementation (e.g. multiple precision numbers), expressions like 2 i + 3 j - 4 k, dimensional quantities (feet, meters, etc), or ordinary numbers, or combinations thereof. Or this: given some kind of model, derive a maximum likelihood estimator for parameters of the model, and express that as a formula or a function to compute a numerical approximation. I got into Maxima originally because I was writing a program which computed some cumulative probabilities in passing, and for that I wanted to calculate some integrals. best Robert Dodier From p.j.papasot at gmail.com Sat Oct 29 16:07:54 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Sun, 30 Oct 2011 00:07:54 +0300 Subject: [Maxima] A Maxima function for solving initial value problems with adaptive step size and error control. In-Reply-To: References: Message-ID: 2011/10/29 Robert Dodier > Thanks a lot for your work. I;m sorry to keep harping on this, > but can you please put a copyright and license notice on each file? > (and in the text of documents such as pdf's, if there are any.) > Package file rkf45.mac already had a copyright notice in the beginning, as you suggested a few days ago. I 've added a copyright notice in the pdf documentation, as well. Not sure what about the demo file and test suite. I had a look in share and it seems no demo file or test suite there has any copyright notice, so I guess it is not necessary, but correct me if I am wrong. As usual, updated files are in https://sites.google.com/site/pjpapasot/maxima/libraries/rkf45 2011/10/29 Robert Dodier > I recommend pretty strongly that you leave the foo=bar options as they are. > I don't think the location of the package matters in this respect. > I agree. Optional argument syntax is still foo=bar. Besides, that is what is used by most packages, for example quad_qags. -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Sat Oct 29 16:42:40 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 29 Oct 2011 14:42:40 -0700 Subject: [Maxima] integrate 'quotient by zero' error message Message-ID: <56BC0117DFE24668BEFABC351A19988E@edwinc367e16bd> I'm guessing the integrate code finds divide by zero here? The "quotient by zero" error message seems unclear English. ---------------------- (%i25) integrate(sin(x+sqrt(x))/(1+x),x,0,inf); `quotient' by `zero' -- an error. To debug this try: debugmode(true); (%i26) integrate(sin(x+sqrt(x))/(1+x),x,0,10); `quotient' by `zero' -- an error. To debug this try: debugmode(true); (%i27) integrate(sin(x+sqrt(x))/(1+x),x); `quotient' by `zero' -- an error. To debug this try: debugmode(true); ----------------------------------- Ted Woollett From macrakis at alum.mit.edu Sat Oct 29 16:51:36 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 29 Oct 2011 17:51:36 -0400 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: <87mxcmzbae.fsf@xtof-netbook.home> References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: I have been using R fairly heavily for a few years now, and have been using Maxima for about 40 years. There are certainly things I miss in R that Maxima has and vice versa. > ...wouldn't it be more economical to adapt to Maxima some of the coolest features of R? Depends what you consider "some of the coolest features of R". If you mean things like data frames and their handy subscripting conventions, that would be easy... unless you wanted operations on them to be as fast as in R. The first step on the Maxima side would be integrating machine arrays more cleanly into the Maxima system, as opposed to the current situation where we have 3-4 different ways of representing numeric vectors, each with slightly different attributes. If you mean the enormous library of statistical software, written partly in R and partly in lower-level languages, that would be hard unless it was done at arms-length (e.g. call out to R in a separate process). One problem is that it is famously difficult to integrate two different runtime systems which both include reference counts/garbage collection. If you mean making R compilable by taking advantage of the Lisp compiler, that is even harder, because R is not designed as a compilable language. Many functions in R do tricky things with call-by-need and environment manipulation without distinguishing between compile-time (macro expansion) and run-time (execution) semantics. R often uses symbol names (strings) to talk about symbols in ways which would be tricky to compile (though I can certainly think of some good tricks). Also, Lisp generally doesn't compile subscripting as efficiently as you'd want for heavy numeric computing. If you mean making R functionality work with symbolic objects, you would probably have to rewrite most operations. Sure, 'sum' is easy, but how about 'order' or 'quantile' or 'lm'? It would be neat to do a linear regression where some inputs were symbolic, but none of the existing R code could really be used to do this. But maybe you have something much simpler in mind...? -s On Thu, Oct 27, 2011 at 11:47, Christophe Pouzat < christophe.pouzat at gmail.com> wrote: > Hi all, > > As an heavy R (http://www.r-project.org, a very nice statistical package > which is "a bit" to Scheme what Maxima is to Common Lisp) and an > occasional Maxima user (for symbolic computations, etc) I recently came > across a very interesting conference paper by Ross Ihaka (one of the two > original R developers) and Duncan Temple Lang: "Back to the Future: Lisp > as a Base for a Statistical Computing System." > (http://www.stat.auckland.ac.nz/%7Eihaka/downloads/Compstat-2008.pdf). The > paper goes through some of the present limitations of R (not compiled, > arguments passed by values, etc) and argues in favor of a > reimplementation of R as an "M-expression" layer on top of Common > Lisp. This paper triggered my interest in Common Lisp (better late than > never!) and made me realized that I missed a lot about the capabilities > of Maxima. But I would like the opinion of the Maxima's experts here, at > least the ones who have time to read Ihaka and Temple Lang's paper: > aren't they proposing to re-implement Maxima (with a strong statistical > flavor)? If yes, wouldn't it be more economical to adapt to Maxima some > of the coolest features of R? > > Christophe > > -- > > Most people are not natural-born statisticians. Left to our own > devices we are not very good at picking out patterns from a sea of > noisy data. To put it another way, we are all too good at picking out > non-existent patterns that happen to suit our purposes. > Bradley Efron & Robert Tibshirani (1993) An Introduction to the Bootstrap > > -- > > Christophe Pouzat > Laboratoire de physiologie c?r?brale > CNRS UMR 8118 > UFR biom?dicale de l'Universit? Paris-Descartes > 45, rue des Saints-P?res > 75006 PARIS > France > > tel: +33 (0)1 42 86 38 28 > fax: +33 (0)1 42 86 38 30 > mobile: +33 (0)6 62 94 10 34 > web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.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 toy.raymond at gmail.com Sat Oct 29 17:13:44 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 29 Oct 2011 15:13:44 -0700 Subject: [Maxima] Sequence 1, 1, 2, 7, 33, 191, 1304, 10241, ... In-Reply-To: References: Message-ID: <4EAC7A98.3040600@gmail.com> On 10/27/11 2:46 AM, Aleksas Domarkas wrote: > > How solve recurence equation d(n)=n*d(n-1)-d(n-2) ? One technique is to use Z-transforms, a discrete analogue for Laplace transforms. Basically for a sequence d(n), n >= 0, the z-transform is D(z) = sum(d(n)/z^n,n,0,inf). The wikipedia entry for z-transforms contains some properties of z-transforms that will be useful. In particular d(n-k) is z^(-k)*D(z) and n*d(n) is -z*diff(D(z),z). If I did the math right, you end up with D(z) = z*exp(1/z-z). This looks related to the generating function for Bessel J. Unfortunately, it doesn't seem like you end up with the Bessel expression you gave, so I've probably made a mistake. Ray From drdieterkaiser at web.de Sat Oct 29 17:36:04 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 30 Oct 2011 00:36:04 +0200 Subject: [Maxima] [Maxima-commits] Maxima, A Computer Algebra System branch master updated. 765607874d66159c08ac5b1345e8863688645a31 In-Reply-To: <4EAC291A.70607@gmail.com> References: <4EAC291A.70607@gmail.com> Message-ID: <1319927764.1890.20.camel@dieter> Am Samstag, den 29.10.2011, 09:26 -0700 schrieb Raymond Toy: > On 10/29/11 9:09 AM, Andreas Eder 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 765607874d66159c08ac5b1345e8863688645a31 (commit) > > via 8333a526386da6b3e60df9f3f9e285aea13cf615 (commit) > > from a2674edd749bb03ac09876bef3ee60ecbe60e422 (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. > > > > > > replace remred by cl function delete-duplicates > > > > > > diff --git a/src/solve.lisp b/src/solve.lisp > > index 9c0cdc2..075b2fb 100644 > > --- a/src/solve.lisp > > +++ b/src/solve.lisp > > @@ -906,7 +906,7 @@ > > (defmfun $linsolve (eql varl) > > (let (($ratfac)) > > (setq eql (if ($listp eql) (cdr eql) (ncons eql))) > > - (setq varl (if ($listp varl) (remred (cdr varl)) (ncons varl))) > > + (setq varl (if ($listp varl) (delete-duplicates (cdr varl)) (ncons varl))) > > (do ((varl varl (cdr varl))) > > ((null varl)) > > (when (mnump (car varl)) > > @@ -915,11 +915,6 @@ > > (make-mlist-simp) > > (solvex (mapcar 'meqhk eql) varl (not $programmode) nil)))) > > > > -;; REMRED removes any repetition that may be in the variables list > > -;; The NREVERSE is significant here for some reason? > > - > > -(defun remred (l) (if l (nreverse (union1 l nil)))) > > - > > > Is this change correct? delete-duplicates doesn't seem to be the same > as remred since remred reverses the result of union1. I did not check > to see what union1 does, though. Perhaps it puts things in reverse so > nreverse puts them back in the same order? At least, for SBCL the functions can return the elements in a different order: (remred '(a b a c b)) -> (A B C) (delete-duplicates '(a b a c b)) -> (A C B) I think it is necessary to use the keyword :from-end (delete-duplicates '(a b a c b) :from-end t) -> (A B C) In addition I think the test function must be #'equal to get an equivalent result: (remred '(((mplus) a b) ((mplus) a b))) (((MPLUS) A B)) (delete-duplicates '(((mplus) a b) ((mplus) a b)) :from-end t) (((MPLUS) A B) ((MPLUS) A B)) (delete-duplicates '(((mplus) a b) ((mplus) a b)) :test #'equal :from-end t) (((MPLUS) A B)) Perhaps there are some further slightly differences. Dieter Kaiser From toy.raymond at gmail.com Sat Oct 29 17:47:02 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 29 Oct 2011 15:47:02 -0700 Subject: [Maxima] [Maxima-commits] Maxima, A Computer Algebra System branch master updated. 765607874d66159c08ac5b1345e8863688645a31 In-Reply-To: <1319927764.1890.20.camel@dieter> References: <4EAC291A.70607@gmail.com> <1319927764.1890.20.camel@dieter> Message-ID: <4EAC8266.1020308@gmail.com> On 10/29/11 3:36 PM, Dieter Kaiser wrote: > Am Samstag, den 29.10.2011, 09:26 -0700 schrieb Raymond Toy: >> On 10/29/11 9:09 AM, Andreas Eder 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 765607874d66159c08ac5b1345e8863688645a31 (commit) >>> via 8333a526386da6b3e60df9f3f9e285aea13cf615 (commit) >>> from a2674edd749bb03ac09876bef3ee60ecbe60e422 (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. >>> >>> >>> replace remred by cl function delete-duplicates >>> >>> >>> diff --git a/src/solve.lisp b/src/solve.lisp >>> index 9c0cdc2..075b2fb 100644 >>> --- a/src/solve.lisp >>> +++ b/src/solve.lisp >>> @@ -906,7 +906,7 @@ >>> (defmfun $linsolve (eql varl) >>> (let (($ratfac)) >>> (setq eql (if ($listp eql) (cdr eql) (ncons eql))) >>> - (setq varl (if ($listp varl) (remred (cdr varl)) (ncons varl))) >>> + (setq varl (if ($listp varl) (delete-duplicates (cdr varl)) (ncons varl))) >>> (do ((varl varl (cdr varl))) >>> ((null varl)) >>> (when (mnump (car varl)) >>> @@ -915,11 +915,6 @@ >>> (make-mlist-simp) >>> (solvex (mapcar 'meqhk eql) varl (not $programmode) nil)))) >>> >>> -;; REMRED removes any repetition that may be in the variables list >>> -;; The NREVERSE is significant here for some reason? >>> - >>> -(defun remred (l) (if l (nreverse (union1 l nil)))) >>> - >>> >> Is this change correct? delete-duplicates doesn't seem to be the same >> as remred since remred reverses the result of union1. I did not check >> to see what union1 does, though. Perhaps it puts things in reverse so >> nreverse puts them back in the same order? > At least, for SBCL the functions can return the elements in a different > order: > > (remred '(a b a c b)) -> (A B C) > (delete-duplicates '(a b a c b)) -> (A C B) > > I think it is necessary to use the keyword :from-end > > (delete-duplicates '(a b a c b) :from-end t) -> (A B C) > > In addition I think the test function must be #'equal to get an > equivalent result: > > (remred '(((mplus) a b) ((mplus) a b))) > (((MPLUS) A B)) > > (delete-duplicates '(((mplus) a b) ((mplus) a b)) :from-end t) > (((MPLUS) A B) ((MPLUS) A B)) > > (delete-duplicates '(((mplus) a b) ((mplus) a b)) :test > #'equal :from-end t) > (((MPLUS) A B)) > > Perhaps there are some further slightly differences. > Thanks for these tests. Unless someone *knows* that remred is always the same as delete-duplicates :from-end t, then I think the change should be reverted. Ray From p.j.papasot at gmail.com Sat Oct 29 18:07:00 2011 From: p.j.papasot at gmail.com (Panagiotis Papasotiriou) Date: Sun, 30 Oct 2011 02:07:00 +0300 Subject: [Maxima] integrate 'quotient by zero' error message In-Reply-To: <56BC0117DFE24668BEFABC351A19988E@edwinc367e16bd> References: <56BC0117DFE24668BEFABC351A19988E@edwinc367e16bd> Message-ID: 2011/10/30 Edwin Woollett > I'm guessing the integrate code finds divide by > zero here? > > The "quotient by zero" error message seems > unclear English. > ---------------------- > Integrand's denominator is obviously nonzero for any x within the integration interval. If I were to guess, I'd say that Maxima tries to compute the indefinite integral first, doing a transformation maybe. Somewhere there the error message is generated, no idea why. > (%i25) integrate(sin(x+sqrt(x))/(1+x)**,x,0,inf); > > `quotient' by `zero' > > -- an error. To debug this try: debugmode(true); > Integral is probably divergent; It seems that Integral value is oscillating around ~0.458 and never converges. This doesn't explain the error message though. > (%i26) integrate(sin(x+sqrt(x))/(1+x)**,x,0,10); > > `quotient' by `zero' > > -- an error. To debug this try: debugmode(true); > I wouldn't even try integrate() with such an integrand, to be honest. Integral for x in [0,10] can be easily computed by quad_quags and it is ~0.3911. > (%i27) integrate(sin(x+sqrt(x))/(1+x)**,x); > > `quotient' by `zero' > > -- an error. To debug this try: debugmode(true); > Indefinite integral cannot be computed analytically, but that doesn't explain why Maxima gives that error message. However, it seems the error message is generated before any try to compute the integral numerically, as I guessed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aeder at arcor.de Sat Oct 29 18:13:15 2011 From: aeder at arcor.de (aeder at arcor.de) Date: Sun, 30 Oct 2011 01:13:15 +0200 Subject: [Maxima] [Maxima-commits] Maxima, A Computer Algebra System branch master updated. 765607874d66159c08ac5b1345e8863688645a31 Message-ID: Hallo Dieter, you are right. The changed code should be like you said: (delete-duplicates (cdr varl) :test #'equal :from-end t) I comitted the wrong version - sorry for that. It was my first commit under git, after the change from CVS and I'm still struggling a little bit with the system. I hope to get it right this time. I'm sorry for the inconvenience to all. Andreas -- ceterum censeo redmondinem esse delendam. From maxima at etherjones.us Sat Oct 29 18:25:26 2011 From: maxima at etherjones.us (Ether Jones) Date: Sat, 29 Oct 2011 16:25:26 -0700 (PDT) Subject: [Maxima] how to use a subscripted variable in a "depends" statement In-Reply-To: <4EAC5FE7.9000704@eecs.berkeley.edu> References: <1319915791.47535.YahooMailNeo@web161801.mail.bf1.yahoo.com> <4EAC5FE7.9000704@eecs.berkeley.edu> Message-ID: <1319930726.52109.YahooMailNeo@web161802.mail.bf1.yahoo.com> Is there a way to make a variable display with a subscript, without the subscript being interpreted as some sort of index, so that the variable could be treated in all respects like any other variable?? It's the appearance of the output which is driving this request. -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sat Oct 29 18:41:35 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 29 Oct 2011 16:41:35 -0700 Subject: [Maxima] integrate 'quotient by zero' error message In-Reply-To: References: <56BC0117DFE24668BEFABC351A19988E@edwinc367e16bd> Message-ID: <4EAC8F2F.2040600@gmail.com> On 10/29/11 4:07 PM, Panagiotis Papasotiriou wrote: > 2011/10/30 Edwin Woollett > > > I'm guessing the integrate code finds divide by > zero here? > > The "quotient by zero" error message seems > unclear English. > ---------------------- > > > Integrand's denominator is obviously nonzero for any x within the > integration interval. If I were to guess, I'd say that Maxima tries to > compute the indefinite integral first, doing a transformation maybe. > Somewhere there the error message is generated, no idea why. To know what it's doing, you'll have to dig through the code, putting breakpoints or prints in appropriate places. To find out where the message is generated, I usually do what it says. When the error is generated, you're left in the maxima debugger. I press C-c to interrupt and look at the stack trace (> 20 levels) to see where the message was generated. It is a giant pain to debug problems in integration. The 'quotient by zero' bug is a well-known issue that is usually caused by the gcd algorithm. Sometimes changing the gcd algorithm fixes things, but sometimes not. It's probably a bug in the algorithm but no one has been able to figure it out, mostly because no one has found a simple enough problem to illustrate the error. > Indefinite integral cannot be computed analytically, but that doesn't > explain why Maxima gives that error message. However, it seems the > error message is generated before any try to compute the integral > numerically, as I guessed. integrate never computes the integral numerically. It's all symbolic, but the symbolic answer might be a number. Perhaps you had a different meaning for "numerically"? Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdieterkaiser at web.de Sat Oct 29 18:59:25 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 30 Oct 2011 01:59:25 +0200 Subject: [Maxima] integrate 'quotient by zero' error message In-Reply-To: <56BC0117DFE24668BEFABC351A19988E@edwinc367e16bd> References: <56BC0117DFE24668BEFABC351A19988E@edwinc367e16bd> Message-ID: <1319932765.1890.22.camel@dieter> Am Samstag, den 29.10.2011, 14:42 -0700 schrieb Edwin Woollett: > I'm guessing the integrate code finds divide by > zero here? > > The "quotient by zero" error message seems > unclear English. > ---------------------- > > (%i25) integrate(sin(x+sqrt(x))/(1+x),x,0,inf); > > `quotient' by `zero' > > -- an error. To debug this try: debugmode(true); > > (%i26) integrate(sin(x+sqrt(x))/(1+x),x,0,10); > > `quotient' by `zero' > > -- an error. To debug this try: debugmode(true); > > (%i27) integrate(sin(x+sqrt(x))/(1+x),x); > > `quotient' by `zero' > > -- an error. To debug this try: debugmode(true); > ----------------------------------- I do not have this problem with the current version of Maxima from git. I get noun forms for the integrals. Maxima 5.25post http://maxima.sourceforge.net using Lisp SBCL 1.0.45 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. (%i2) integrate(sin(x+sqrt(x))/(1+x),x); (%o2) 'integrate(sin(x+sqrt(x))/(x+1),x) (%i3) integrate(sin(x+sqrt(x))/(1+x),x,0,inf); (%o3) 'integrate(sin(x+sqrt(x))/(x+1),x,0,inf) (%i4) integrate(sin(x+sqrt(x))/(1+x),x,0,10); (%o4) 'integrate(sin(x+sqrt(x))/(x+1),x,0,10) Dieter Kaiser From manishajos at yahoo.co.in Sat Oct 29 23:02:42 2011 From: manishajos at yahoo.co.in (Manisha joshi) Date: Sun, 30 Oct 2011 09:32:42 +0530 (IST) Subject: [Maxima] (no subject) Message-ID: <1319947362.82274.YahooMailClassic@web94812.mail.in2.yahoo.com> sir please immediadely stop sending me the mails as i dont feel it very useful.I want to desubscribe it Manisha -------------- next part -------------- An HTML attachment was scrubbed... URL: From manishajos at yahoo.co.in Sat Oct 29 23:05:57 2011 From: manishajos at yahoo.co.in (Manisha joshi) Date: Sun, 30 Oct 2011 09:35:57 +0530 (IST) Subject: [Maxima] (no subject) In-Reply-To: <1319947362.82274.YahooMailClassic@web94812.mail.in2.yahoo.com> Message-ID: <1319947557.84490.YahooMailClassic@web94810.mail.in2.yahoo.com> sir please immediadely stop sending me the mails as i dont feel it very useful.I want to desubscribe it Manisha -----Inline Attachment Follows----- _______________________________________________ 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 Sun Oct 30 00:23:21 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 30 Oct 2011 00:23:21 -0500 Subject: [Maxima] (no subject) In-Reply-To: <1319947557.84490.YahooMailClassic@web94810.mail.in2.yahoo.com> References: <1319947557.84490.YahooMailClassic@web94810.mail.in2.yahoo.com> Message-ID: The page http://www.math.utexas.edu/mailman/listinfo/maxima gives directions for unsubscribing (look for the last text entry box). Have you tried following these directions? --Barton -----maxima-bounces at math.utexas.edu wrote: ----- sir please immediadely stop sending me the mails as i dont feel it very useful.I want to desubscribe it From andrej.vodopivec at gmail.com Sun Oct 30 01:23:53 2011 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Sun, 30 Oct 2011 07:23:53 +0100 Subject: [Maxima] Sequence 1, 1, 2, 7, 33, 191, 1304, 10241, ... In-Reply-To: References: Message-ID: On Sat, Oct 29, 2011 at 9:54 PM, Robert Dodier wrote: > On 10/27/11, Aleksas Domarkas wrote: > >> (%i6) solve_rec(d(n)=n*d(n-1)-d(n-2),d(n),d(1)=1,d(2)=1); >> (%o6) false > > Unfortunately I really don't know about recurrence equations > so I can't be very helpful here. Actually I have some questions > of my own. > > What is the general realm of solvable recurrences? > Can we tell by inspecting the equation that it is solvable or not? > > I am guessing that the solve_rec function reduces the recurrence > to some related equation and then tries to solve that. > Does anyone know what is the form of that equation? > If so, we could figure out that solvability from that. The solve_rec package implements the hyper algorithm for solving homogeneous recurrences with polynomial coefficients (such recurrences are returned by the Zeilberger package). It finds hypergeometric solutions to the recurrence. It is not possible to know in advance if the recurrence has a hypergeometric solution, but if solve_rec does not return them, then this is a proof that there are none. It also solves standard recurrences with constant coefficients, but the main purpose for solve_rec is to solve the recurrences returned by Zeilberger. Zeilberger and solve_rec are used in the simplify_sum function. Andrej From biomates at telefonica.net Sun Oct 30 04:21:47 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 30 Oct 2011 10:21:47 +0100 Subject: [Maxima] animated gif In-Reply-To: References: Message-ID: <1319966507.1834.13.camel@pc> El vie, 28-10-2011 a las 20:59 +0200, Adam Majewski escribi?: > Hi, > > Can I make animated gif (or any other graphic file) by writing array to > file ? Hello, You can use option 'terminal=animated_gif' together with the 'image' graphic object. But 'image' only admits matrices as arguments, not arrays. It wouldn't be too difficult to add arrays; in fact, 'image' admits another special object called 'picture', which is basically a 1D array. > > like in R code : > http://commons.wikimedia.org/wiki/File:Mandelbrot_Creation_Animation_%28800x600%29.gif You can't make matrix operations with arrays such these, unless you write specific functions first. -- Mario From O.Kullmann at swansea.ac.uk Sun Oct 30 12:44:30 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 30 Oct 2011 17:44:30 +0000 Subject: [Maxima] how to redirect printout into string? Message-ID: <20111030174430.GP18699@cs-wsok.swan.ac.uk> Hello, sorry, the replies by Raymond and Robert from October 10 escaped me somehow: Thanks! I wrote now the function /* Evaluate term t, and concatenate all print-output into one string: */ print2string('t) := block([S : make_string_output_stream()], with_stdout(S,ev(t)), get_output_stream_string(S))$ which collects all output of print into a string. That solves the problem. By the way, the reasons that the functions I had in mind do print, but do not return a string, are: - Some create very large files, with millions of lines. - And some just print messages, besides the real output. Thanks again for your help. Oliver From adammaj1 at o2.pl Sun Oct 30 13:41:56 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Sun, 30 Oct 2011 19:41:56 +0100 Subject: [Maxima] animated gif In-Reply-To: <1319966507.1834.13.camel@pc> References: <1319966507.1834.13.camel@pc> Message-ID: Hi, Thx for the answer. My question was inspired by vectorisation and parallel computing : 1. Fast R code : http://commons.wikimedia.org/wiki/File:Mandelbrot_Creation_Animation_%28800x600%29.gif I couldn't do the same in Maxima. Now I know that I should use vectorized code ( How can I do it in Maxima) 2.Image processing using matrices in Octave : http://www.gnu.org/software/octave/doc/interpreter/Image-Processing.html 3. Gpu in Matlab http://blogs.mathworks.com/loren/2011/07/18/a-mandelbrot-set-on-the-gpu/ 4. Vectorisation in Matlab http://www.mathworks.com/support/tech-notes/1100/1109.html I know package picture which gives Maxima basic support for image processing http://riotorto.users.sourceforge.net/gnuplot/image/index.html So my question is : How can I vectorise code in Maxima ? TIA Adam On 30.10.2011 10:21, Mario Rodriguez wrote: > El vie, 28-10-2011 a las 20:59 +0200, Adam Majewski escribi?: >> Hi, >> >> Can I make animated gif (or any other graphic file) by writing array to >> file ? > > Hello, > > You can use option 'terminal=animated_gif' together with the 'image' > graphic object. But 'image' only admits matrices as arguments, not > arrays. It wouldn't be too difficult to add arrays; in fact, 'image' > admits another special object called 'picture', which is basically a 1D > array. > > >> >> like in R code : >> http://commons.wikimedia.org/wiki/File:Mandelbrot_Creation_Animation_%28800x600%29.gif > > You can't make matrix operations with arrays such these, unless you > write specific functions first. > > -- > Mario > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From woollett at charter.net Sun Oct 30 14:02:39 2011 From: woollett at charter.net (Edwin Woollett) Date: Sun, 30 Oct 2011 12:02:39 -0700 Subject: [Maxima] integrate 'quotient by zero' error message Message-ID: <969D2D9C06D04278BE4E3C4669D74090@edwinc367e16bd> On Oct. 29, Raymond Toy wrote: --------------------------------------- > To know what it's doing, you'll have to dig through the code, putting > breakpoints or prints in appropriate places. To find out where the > message is generated, I usually do what it says. When the error is > generated, you're left in the maxima debugger. I press C-c to interrupt > and look at the stack trace (> 20 levels) to see where the message was > generated. > > It is a giant pain to debug problems in integration. The 'quotient by > zero' bug is a well-known issue that is usually caused by the gcd > algorithm. Sometimes changing the gcd algorithm fixes things, but > sometimes not. It's probably a bug in the algorithm but no one has been > able to figure it out, mostly because no one has found a simple enough ---------------------- The message is generated in rat3b.lisp, lines 150 or 172. Using search_mfiles from ch. 2 software mfiles.mac, with copy of source in c:/maxsource. ----------------------------------------- (%i1) display2d:false$ (%i2) integrate(sin(x+sqrt(x))/(1+x),x); `quotient' by `zero' -- an error. To debug this try: debugmode(true); (%i3) load(mfiles); (%o3) "c:/work2/mfiles.mac" (%i4) search_mfiles("c:/maxsource/","quotient"); ignore quotient by itself, only look for error messages: c:/maxsource/combin.lisp 864 (cond ((zerop q) (maxima-error "find-cf: quotient by zero")) c:/maxsource/float.lisp 738 (merror (intl:gettext "pquotient: attempted quotient by zero."))) c:/maxsource/rat3a.lisp 45 (t (errrjf "quotient is not exact")))) 392 when (minusp k) do (errrjf "Polynomial quotient is not exact") c:/maxsource/rat3b.lisp 150 (cond ((pzerop (car y)) (errrjf "`quotient' by `zero'")) 172 (cond ((pzerop y) (errrjf "`quotient' by `zero'")) ----------------------------------------- Evidently, all code writers like the phrase "quotient by zero" in an error message. Wouldn't "divide by zero" be more appropriate? Or even "Code fails to accomodate this case". And the message only seems appropriate as a debug message for code writers, not an informative message for the general user. Ted From drdieterkaiser at web.de Sun Oct 30 14:21:32 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 30 Oct 2011 20:21:32 +0100 Subject: [Maxima] integrate 'quotient by zero' error message In-Reply-To: <969D2D9C06D04278BE4E3C4669D74090@edwinc367e16bd> References: <969D2D9C06D04278BE4E3C4669D74090@edwinc367e16bd> Message-ID: <1320002492.7760.1.camel@dieter> Am Sonntag, den 30.10.2011, 12:02 -0700 schrieb Edwin Woollett: > On Oct. 29, Raymond Toy wrote: > --------------------------------------- > > To know what it's doing, you'll have to dig through the code, putting > > breakpoints or prints in appropriate places. To find out where the > > message is generated, I usually do what it says. When the error is > > generated, you're left in the maxima debugger. I press C-c to > interrupt > > and look at the stack trace (> 20 levels) to see where the message was > > generated. > > > > It is a giant pain to debug problems in integration. The 'quotient by > > zero' bug is a well-known issue that is usually caused by the gcd > > algorithm. Sometimes changing the gcd algorithm fixes things, but > > sometimes not. It's probably a bug in the algorithm but no one has > been > > able to figure it out, mostly because no one has found a simple enough > ---------------------- > The message is generated in rat3b.lisp, lines 150 or 172. > Using search_mfiles from ch. 2 software mfiles.mac, with > copy of source in c:/maxsource. > ----------------------------------------- > (%i1) display2d:false$ > (%i2) integrate(sin(x+sqrt(x))/(1+x),x); > `quotient' by `zero' > -- an error. To debug this try: debugmode(true); > > (%i3) load(mfiles); > (%o3) "c:/work2/mfiles.mac" > (%i4) search_mfiles("c:/maxsource/","quotient"); > > ignore quotient by itself, only look for error messages: > > c:/maxsource/combin.lisp > 864 (cond ((zerop q) (maxima-error "find-cf: quotient by zero")) > > c:/maxsource/float.lisp > 738 (merror (intl:gettext "pquotient: attempted quotient by zero."))) > > c:/maxsource/rat3a.lisp > 45 (t (errrjf "quotient is not exact")))) > 392 when (minusp k) do (errrjf "Polynomial quotient is not exact") > > c:/maxsource/rat3b.lisp > 150 (cond ((pzerop (car y)) (errrjf "`quotient' by `zero'")) > 172 (cond ((pzerop y) (errrjf "`quotient' by `zero'")) > ----------------------------------------- > > Evidently, all code writers like the phrase "quotient by zero" in an > error message. Wouldn't "divide by zero" be more appropriate? > Or even "Code fails to accomodate this case". > And the message only seems appropriate as a debug message > for code writers, not an informative message for the general user. What is the version of Maxima you are using. I dot not see the problem with the current version 5.25post. I get a noun form for the integral. Maxima 5.25post http://maxima.sourceforge.net using Lisp SBCL 1.0.45 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. (%i2) integrate(sin(x+sqrt(x))/(1+x),x); (%o2) 'integrate(sin(x+sqrt(x))/(x+1),x) Dieter Kaiser From woollett at charter.net Sun Oct 30 14:21:42 2011 From: woollett at charter.net (Edwin Woollett) Date: Sun, 30 Oct 2011 12:21:42 -0700 Subject: [Maxima] integrate 'quotient by zero' error message Message-ID: <4041359A8DD942179B788CEA9919E5EF@edwinc367e16bd> On Oct. 29, Dieter Kaiser wrote: > I do not have this problem with the current version of Maxima from git. > I get noun forms for the integrals. > > Maxima 5.25post http://maxima.sourceforge.net > using Lisp SBCL 1.0.45 > 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. > > (%i2) integrate(sin(x+sqrt(x))/(1+x),x); > (%o2) 'integrate(sin(x+sqrt(x))/(x+1),x) > (%i3) integrate(sin(x+sqrt(x))/(1+x),x,0,inf); > (%o3) 'integrate(sin(x+sqrt(x))/(x+1),x,0,inf) > (%i4) integrate(sin(x+sqrt(x))/(1+x),x,0,10); > (%o4) 'integrate(sin(x+sqrt(x))/(x+1),x,0,10) Thanks for the update, which is good news. I can delay writing an interface to integrate which catches bad news events and shields users of nint.mac from such. Ted From woollett at charter.net Sun Oct 30 14:26:59 2011 From: woollett at charter.net (Edwin Woollett) Date: Sun, 30 Oct 2011 12:26:59 -0700 Subject: [Maxima] integrate 'quotient by zero' error message References: <969D2D9C06D04278BE4E3C4669D74090@edwinc367e16bd> <1320002492.7760.1.camel@dieter> Message-ID: <4781A7D7D0F141AD93B1CDD698EE68EF@edwinc367e16bd> On Oct. 30, 2011, Dieter Kaiser wrote: ------------------- >What is the version of Maxima you are using. I dot not see the problem >with the current version 5.25post. I get a noun form for the integral. I am using the Windows binary installation for version 5.25.1GCL Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) Ted From adammaj1 at o2.pl Sun Oct 30 15:46:26 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Sun, 30 Oct 2011 21:46:26 +0100 Subject: [Maxima] Assignment Message-ID: Hi, I have made : (%i4) L:([1,2,3],[4,5,6],[0,-1,-2]); (%o4) [0, - 1, - 2] I do not know what happens here. I would like to ask for any explanations TIA Adam From O.Kullmann at swansea.ac.uk Sun Oct 30 16:10:57 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 30 Oct 2011 21:10:57 +0000 Subject: [Maxima] Assignment In-Reply-To: References: Message-ID: <20111030211057.GQ18699@cs-wsok.swan.ac.uk> On Sun, Oct 30, 2011 at 09:46:26PM +0100, Adam Majewski wrote: > I have made : > > (%i4) L:([1,2,3],[4,5,6],[0,-1,-2]); > (%o4) [0, - 1, - 2] > > I do not know what happens here. > Hi, it would be useful if you would also tell us what you wanted to achieve. Anyway: - everything in Maxima has a value - bracketing via "()" corresponds to creating compound statements in other languages, for example "{}" in C-like statements, except that no local variables are obtained - so (...) is just the list of expressions from left to right, with the last expression yielding the value of the whole expression. Oliver From fateman at eecs.berkeley.edu Sun Oct 30 17:27:40 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 30 Oct 2011 15:27:40 -0700 Subject: [Maxima] integrate 'quotient by zero' error message In-Reply-To: <969D2D9C06D04278BE4E3C4669D74090@edwinc367e16bd> References: <969D2D9C06D04278BE4E3C4669D74090@edwinc367e16bd> Message-ID: <4EADCF5C.8030507@eecs.berkeley.edu> On 10/30/2011 12:02 PM, Edwin Woollett wrote: > > Evidently, all code writers like the phrase "quotient by zero" in an > error message. Wouldn't "divide by zero" be more appropriate? Not really much better, but see below.. > Or even "Code fails to accomodate this case". That's terrible. > And the message only seems appropriate as a debug message > for code writers, not an informative message for the general user. That's probably true. I think the reason that this occurs is not that the polynomial gcd programs have a bug in them, but in how they are used. Let us say you have an expression involving sqrt(x). For purposes of the rational function package let us rename it: z1 is now sqrt(x). Next, say that the integration program in its various manipulations generates an expression exp(log(x)/2), and that rational function package renames it as z2. Let us also say that some expression is developed like (z1^2-z2^2)/ (z1-z2). The rational function package correctly computes the gcd of numerator and denominator, as z1-z2, and divides through by it. Unfortunately, a closer look at that suggests that z1-z2 (or maybe z1+z2) s equal to zero. Now different versions of the polynomial gcd program are in some cases more aware of the possibilities of algebraic dependencies of the "variables" it makes up, like z1, z2, ... and so may avoid some of these situations. in this particular example, there is a z83125 representing %e^(%i*%e^(log(x)/2)) generated as well as a z83126 representing %e^(%i*%e^(log(x)). so we have a situation where z1=z2^2 or some such thing. Bad news. whose bug is it though? Unlikely to be in rat3b.lisp whose programs expects to deal with canonical rational expressions in algebraically independent variables, and is merely reporting something incorrect that was handed to ratreduce. maybe in ratrep or newvar which attempts to collect algebraically independent components, but sometimes doesn't do a careful enough job. maybe in integrate, which neglects to simplify exp(log(x)/2) somewhere. Incidentally, the wording of that message seems peculiar "`quotient' by `zero'". Why not just "quotient by zero" or "An internal program error: quotient by zero in rational function; probably caused by unexpected algebraic dependence of internal variables". The program that is used to "throw" the errror to the top level is errrjf. My attempt to keep other people from catching that error somewhere else. The program name is err+rjf, my initials... and has been in there since 1969 or so. RJF RJF > > Ted > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Sun Oct 30 17:39:08 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 30 Oct 2011 18:39:08 -0400 Subject: [Maxima] integrate 'quotient by zero' error message In-Reply-To: <969D2D9C06D04278BE4E3C4669D74090@edwinc367e16bd> References: <969D2D9C06D04278BE4E3C4669D74090@edwinc367e16bd> Message-ID: On Sun, Oct 30, 2011 at 15:02, Edwin Woollett wrote: > ... > Evidently, all code writers like the phrase "quotient by zero" in an > error message. Wouldn't "divide by zero" be more appropriate? > Or even "Code fails to accomodate this case". > And the message only seems appropriate as a debug message > for code writers, not an informative message for the general user. > I don't know why there are quotation marks around 'quotient' and 'zero' -- I think that is new (and ugly). The reason it is "quotient by zero" and not "divide by zero" is presumably that a symbolic expression of the form EXPR/0 has been generated as an intermediate result somewhere. That is a quotient whose denominator is zero, a meaningless construction. Maxima is not actually trying to divide a number by zero, but to handle a division-expression (a quotient) which is malformed. I agree that "quotient by zero" in itself is not a useful error message for the end user. Maybe something like "Internal inconsistency detected, calculation aborted: quotient by zero" would be better. Even better if every instance of every error had a unique ID, so that when users report errors, we can be sure we're seeing the same error they're seeing, e.g. "Internal inconsistency detected, calculation aborted: quotient by zero at PQ1234". -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sun Oct 30 18:01:41 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 30 Oct 2011 16:01:41 -0700 Subject: [Maxima] integrate 'quotient by zero' error message In-Reply-To: References: <969D2D9C06D04278BE4E3C4669D74090@edwinc367e16bd> Message-ID: <4EADD755.9030001@eecs.berkeley.edu> On 10/30/2011 3:39 PM, Stavros Macrakis wrote: > . Even better if every instance of every error had a unique ID, so > that when users report errors, we can be sure we're seeing the same > error they're seeing, e.g. "Internal inconsistency detected, > calculation aborted: quotient by zero at PQ1234". well, a reference to the code will not be terribly informative. I think the message originates in one of 2 places. ratinvert which computes 1/q and ratquotient which computes p/q. a reference to the program counter won't be of much help. a reference to the denominator won't help. It is zero! For detecting the cause of the error, a programmer might get some info.. a reference to the numerator might supply some info. a backtrace might help. RJF From macrakis at alum.mit.edu Sun Oct 30 21:22:17 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 30 Oct 2011 22:22:17 -0400 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: On Sat, Oct 29, 2011 at 16:44, Robert Dodier wrote: > ...Well, I'd like to see stuff like this: compute the mean / variance / etc > of [a, b, c] where a, b, and c are symbols, intervals, objects which > represent some special-purpose implementation (e.g. multiple precision > numbers), expressions like 2 i + 3 j - 4 k, dimensional quantities > (feet, meters, etc), or ordinary numbers, or combinations thereof. > Well, yes, right now, neither Maxima nor R can deal with arbitrary-type arithmetic objects for most operations. R, though it has a wealth of object systems (some standard and others added on), has no standard functions which can operate with opaque arithmetic types. Maxima almost succeeds in supporting bigfloats everywhere it supports floats, but not quite, so adding anything that doesn't behave like a number is probably a fair amount of work (e.g. for intervals, trichotomy doesn't hold). Of course, Maxima has the advantage that it does support arbitrary symbolic expressions, so it doesn't assume things like trichotomy in general. Still, I don't see that anyone has succeeded in building a reasonably complete and efficient interval arithmetic system on top of it. A good goal, though. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From dstout at hawaii.edu Sat Oct 29 14:54:33 2011 From: dstout at hawaii.edu (David R Stoutemyer) Date: Sat, 29 Oct 2011 09:54:33 -1000 Subject: [Maxima] How do I retrieve binding powers in a Maxima function definition? Message-ID: :lisp (get '$+ 'rbp) returns the right binding power of the "+" operator, but it appears that I can use ":lisp" only at the top level. How do I retrieve and assign a right binding power to a local variable in a Maxima function definition? -- David Stoutemyer From willisb at unk.edu Mon Oct 31 05:06:07 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 31 Oct 2011 05:06:07 -0500 Subject: [Maxima] How do I retrieve binding powers in a Maxima function definition? In-Reply-To: References: Message-ID: To retrieve a binding power, try something like (%i11) ?rbp(?getopr0("+")); (%o11) 100 (%i12) ?rbp(?getopr0("*")); (%o12) 120 But ?rbp(?getopr0("+")) gives the right binding power of mplus, not as you asked $+. For assignment, maybe something similar would work, but maybe you should consider writing this part of your code in Common Lisp. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- To: maxima at math.utexas.edu From: David R Stoutemyer Sent by: maxima-bounces at math.utexas.edu Date: 10/31/2011 02:42AM Subject: [Maxima] How do I retrieve binding powers in a Maxima function definition? :lisp (get ?'$+ ?'rbp) ?returns the right binding power of the "+" operator, but it appears that I can use ":lisp" only at the top level. How do I retrieve and assign a right binding power to a local variable in a Maxima function definition? ?? -- David Stoutemyer _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Mon Oct 31 10:16:10 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 31 Oct 2011 11:16:10 -0400 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: <87mxcmzbae.fsf@xtof-netbook.home> References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: Just some general reflections on semantics rather than implementation.... R really isn't really much like Scheme in particular (as opposed to Lisps or dynamic languages in general), though the implementors of R were inspired by the Scheme implementation. You might be interested in the "R and Scheme" thread at http://tolstoy.newcastle.edu.au/R/e5/help/08/12/9464.html (erratum: a[1] => 999 should read a[1] => 1) The semantics and implementation of Maxima are related to Maclisp, an ancestor of Common Lisp. The current implementation on top of Common Lisp really doesn't use much Common Lisp functionality or conventions. The general philosophies of the two languages are very different, too: Scheme is all about simplicity, rigor, and consistency; R is all about convenience and "do what the user would want", and doesn't care much about consistency. Cf. Gabriel's reflections on "Worse is Better" and Burns' "R Inferno". Maxima is more R-like than Scheme-like in this way, with many pragmatic compromises. cf. Sussman's notation in SICM for contrast (though it is far from a complete CAS). R does lots of weird and wonderful -- and very convenient -- things with explicit manipulation of environments and unevaluated call-by-need arguments which make programs in general highly referentially opaque -- the exact opposite of a Scheme approach. -s On Thu, Oct 27, 2011 at 11:47, Christophe Pouzat < christophe.pouzat at gmail.com> wrote: > Hi all, > > As an heavy R (http://www.r-project.org, a very nice statistical package > which is "a bit" to Scheme what Maxima is to Common Lisp) and an > occasional Maxima user (for symbolic computations, etc) I recently came > across a very interesting conference paper by Ross Ihaka (one of the two > original R developers) and Duncan Temple Lang: "Back to the Future: Lisp > as a Base for a Statistical Computing System." > (http://www.stat.auckland.ac.nz/%7Eihaka/downloads/Compstat-2008.pdf). The > paper goes through some of the present limitations of R (not compiled, > arguments passed by values, etc) and argues in favor of a > reimplementation of R as an "M-expression" layer on top of Common > Lisp. This paper triggered my interest in Common Lisp (better late than > never!) and made me realized that I missed a lot about the capabilities > of Maxima. But I would like the opinion of the Maxima's experts here, at > least the ones who have time to read Ihaka and Temple Lang's paper: > aren't they proposing to re-implement Maxima (with a strong statistical > flavor)? If yes, wouldn't it be more economical to adapt to Maxima some > of the coolest features of R? > > Christophe > > -- > > Most people are not natural-born statisticians. Left to our own > devices we are not very good at picking out patterns from a sea of > noisy data. To put it another way, we are all too good at picking out > non-existent patterns that happen to suit our purposes. > Bradley Efron & Robert Tibshirani (1993) An Introduction to the Bootstrap > > -- > > Christophe Pouzat > Laboratoire de physiologie c?r?brale > CNRS UMR 8118 > UFR biom?dicale de l'Universit? Paris-Descartes > 45, rue des Saints-P?res > 75006 PARIS > France > > tel: +33 (0)1 42 86 38 28 > fax: +33 (0)1 42 86 38 30 > mobile: +33 (0)6 62 94 10 34 > web: http://www.biomedicale.univ-paris5.fr/physcerv/C_Pouzat.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 toy.raymond at gmail.com Mon Oct 31 10:46:01 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 31 Oct 2011 08:46:01 -0700 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: On Sun, Oct 30, 2011 at 7:22 PM, Stavros Macrakis wrote: > On Sat, Oct 29, 2011 at 16:44, Robert Dodier wrote: > >> ...Well, I'd like to see stuff like this: compute the mean / variance / >> etc >> of [a, b, c] where a, b, and c are symbols, intervals, objects which >> represent some special-purpose implementation (e.g. multiple precision >> numbers), expressions like 2 i + 3 j - 4 k, dimensional quantities >> (feet, meters, etc), or ordinary numbers, or combinations thereof. >> > > Well, yes, right now, neither Maxima nor R can deal with arbitrary-type > arithmetic objects for most operations. R, though it has a wealth of > object systems (some standard and others added on), has no standard > functions which can operate with opaque arithmetic types. > > Maxima almost succeeds in supporting bigfloats everywhere it supports > floats, but not quite, so adding > What's missing with bfloats? > anything that doesn't behave like a number is probably a fair amount of > work (e.g. for intervals, trichotomy doesn't hold). > > Of course, Maxima has the advantage that it does support arbitrary > symbolic expressions, so it doesn't assume things like trichotomy in > general. Still, I don't see that anyone has succeeded in building a > reasonably complete and efficient interval arithmetic system on top of it. > > Do you want symbolic intervals too? Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Oct 31 11:22:41 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 31 Oct 2011 12:22:41 -0400 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: Re: What's missing with bfloats? In all the following, I've set keepfloat:true; First of all, there are many cases where Maxima doesn't support floats OR bfloats, and converts them to rationals. For example: (%i15) integrate(x^2.1,x,0,2.3); rat: replaced 2.1 by 21/10 = 2.1 (%o15) 4.2657421262112 But diff is OK with floats and bfloats. The biggest case I can think of off the top of my head is that CREs support floats (using keepfloat:true) but not bfloats. This also means that taylor and some matrix operations also don't support bfloats. (%i3) mr:matrix([1/2,1/3],[1/4,1/5]); (%o3) matrix([1/2,1/3],[1/4,1/5]) (%i4) mf:float(mr); (%o4) matrix([0.5,0.333333333333333],[0.25,0.2]) (%i5) mb:bfloat(mr); (%o5) matrix([5.0b-1,3.333333333333333b-1],[2.5b-1,2.0b-1]) (%i6) mr^^-1; (%o6) matrix([12,-20],[-15,30]) (%i7) mf^^-1; (%o7) matrix([11.99999999999999,-19.99999999999999], [-14.99999999999999,29.99999999999998]) (%i8) mb^^-1; `rat' replaced 5.0B-1 by 1/2 = 5.0B-1 `rat' replaced 3.333333333333333B-1 by 1/3 = 3.333333333333333B-1 `rat' replaced 2.5B-1 by 1/4 = 2.5B-1 `rat' replaced 2.0B-1 by 1/5 = 2.0B-1 (%o8) matrix([12,-20],[-15,30]) (%i9) taylor(.3b0,x,0,1); `rat' replaced 3.0B-1 by 3/10 = 3.0B-1 (%o9) +3/10 solve and allroots don't support bfloats. romberg doesn't support bfloats Of course, none of the external math packages (quadpack etc.) support bfloats. That's off the top of my head. I'm sure there are others. -s On Mon, Oct 31, 2011 at 11:46, Raymond Toy wrote: > > > On Sun, Oct 30, 2011 at 7:22 PM, Stavros Macrakis wrote: > >> On Sat, Oct 29, 2011 at 16:44, Robert Dodier wrote: >> >>> ...Well, I'd like to see stuff like this: compute the mean / variance / >>> etc >>> of [a, b, c] where a, b, and c are symbols, intervals, objects which >>> represent some special-purpose implementation (e.g. multiple precision >>> numbers), expressions like 2 i + 3 j - 4 k, dimensional quantities >>> (feet, meters, etc), or ordinary numbers, or combinations thereof. >>> >> >> Well, yes, right now, neither Maxima nor R can deal with arbitrary-type >> arithmetic objects for most operations. R, though it has a wealth of >> object systems (some standard and others added on), has no standard >> functions which can operate with opaque arithmetic types. >> >> Maxima almost succeeds in supporting bigfloats everywhere it supports >> floats, but not quite, so adding >> > > What's missing with bfloats? > > >> anything that doesn't behave like a number is probably a fair amount of >> work (e.g. for intervals, trichotomy doesn't hold). >> >> Of course, Maxima has the advantage that it does support arbitrary >> symbolic expressions, so it doesn't assume things like trichotomy in >> general. Still, I don't see that anyone has succeeded in building a >> reasonably complete and efficient interval arithmetic system on top of it. >> >> > Do you want symbolic intervals too? > > Ray > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adammaj1 at o2.pl Mon Oct 31 11:30:26 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Mon, 31 Oct 2011 17:30:26 +0100 Subject: [Maxima] Assignment In-Reply-To: <20111030211057.GQ18699@cs-wsok.swan.ac.uk> References: <20111030211057.GQ18699@cs-wsok.swan.ac.uk> Message-ID: Hi, Thx for the answer. On 30.10.2011 22:10, Oliver Kullmann wrote: > On Sun, Oct 30, 2011 at 09:46:26PM +0100, Adam Majewski wrote: >> I have made : >> >> (%i4) L:([1,2,3],[4,5,6],[0,-1,-2]); >> (%o4) [0, - 1, - 2] >> >> I do not know what happens here. >> > > Hi, > > it would be useful if you would also tell us what you > wanted to achieve. I was trying to manually fill 2D-array, but instead [] i used () > > Anyway: > - everything in Maxima has a value > - bracketing via "()" corresponds to creating compound > statements in other languages, for example "{}" in > C-like statements, except that no local variables > are obtained > - so (...) is just the list of expressions from left to > right, with the last expression yielding the value > of the whole expression. > > Oliver Thx. The same behaviour is in function definition, but I didn't know that is due to (). I could't find it in Maxima doc so maybe it should be placed there. Regards Adam From macrakis at alum.mit.edu Mon Oct 31 11:32:53 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 31 Oct 2011 12:32:53 -0400 Subject: [Maxima] Assignment In-Reply-To: References: <20111030211057.GQ18699@cs-wsok.swan.ac.uk> Message-ID: >> I was trying to manually fill 2D-array, but instead [] i used () Note that "matrix" and "array" are different concepts in Maxima. Use matrix([1,2,3],[4,5,6],[0,-1,-2]) for a matrix. -s On Mon, Oct 31, 2011 at 12:30, Adam Majewski wrote: > Hi, > > Thx for the answer. > > On 30.10.2011 22:10, Oliver Kullmann wrote: > >> On Sun, Oct 30, 2011 at 09:46:26PM +0100, Adam Majewski wrote: >> >>> I have made : >>> >>> (%i4) L:([1,2,3],[4,5,6],[0,-1,-2]); >>> (%o4) [0, - 1, - 2] >>> >>> I do not know what happens here. >>> >>> >> Hi, >> >> it would be useful if you would also tell us what you >> wanted to achieve. >> > I was trying to manually fill 2D-array, but instead [] i used () > > > >> Anyway: >> - everything in Maxima has a value >> - bracketing via "()" corresponds to creating compound >> statements in other languages, for example "{}" in >> C-like statements, except that no local variables >> are obtained >> - so (...) is just the list of expressions from left to >> right, with the last expression yielding the value >> of the whole expression. >> >> Oliver >> > > Thx. The same behaviour is in function definition, but I > didn't know that is due to (). > > I could't find it in Maxima doc so maybe it should be placed there. > > Regards > > Adam > > ______________________________**_________________ > 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 Mon Oct 31 12:38:17 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 31 Oct 2011 10:38:17 -0700 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: On Mon, Oct 31, 2011 at 9:22 AM, Stavros Macrakis wrote: > Re: What's missing with bfloats? > > > solve and allroots don't support bfloats. romberg doesn't support bfloats > There is bfallroots. How would you tell romberg to use bfloats? The limits are bfloats? The tolerance is a bfloat? Some other way? > Of course, none of the external math packages (quadpack etc.) support > bfloats. > For all of the special functions that use slatec (including quadpack), I think the main issue would be the constants that are contained in the algorithms. It would be fairly difficult to recompute them to the correct precision when using bfloats. > > That's off the top of my head. I'm sure there are others. > > Yes, I"m sure there are others, now that you've pointed out some of the obvious cases. I also notice that ratepsilon is still 2e-8, even though maxima has been using double precision for years (decades?) now. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Mon Oct 31 13:32:17 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 31 Oct 2011 11:32:17 -0700 Subject: [Maxima] integrate Principal Value message Message-ID: <73EEBACF87964A4E9335FDB4156767D7@edwinc367e16bd> Is there anything simple I can do (in nint.mac) to surpress the message Principal Value which integrate issues to the console screen in, for example, (%i13) integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf); Principal Value (%o13) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) This message comes from line 1030 in defint.list with the context (1027-1031): (defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (format t "Principal Value~%") (setq pcprntd t)))) Ted Woollett From macrakis at alum.mit.edu Mon Oct 31 13:42:50 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 31 Oct 2011 14:42:50 -0400 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: On Mon, Oct 31, 2011 at 13:38, Raymond Toy wrote: > I also notice that ratepsilon is still 2e-8, even though maxima has been > using double precision for years (decades?) now. > Argh! I thought we'd agreed multiple times (starting at least as long ago as 2005) that ratepsilon should be much smaller, say 2.0e-15 (about 9 ulps). This is plenty of slop for returning "nice" rationals in the face of rounding error. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Mon Oct 31 14:50:34 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 31 Oct 2011 12:50:34 -0700 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: <4EAEFC0A.4010307@eecs.berkeley.edu> On 10/31/2011 8:46 AM, Raymond Toy wrote: > > > Do you want symbolic intervals too? > > Ray > Symbolic endpoints are probably a bad idea. The complexity of the endpoint expressions grows very fast. Building a CAS from scratch on top of some generic-arithmetic object-oriented math-hierarchy framework is a perennial project that works up to a point and then tends to fall apart for a variety of reasons. Finding a single organizing principle is not so hard. Finding one that works is harder.. RJF From rjrich at umich.edu Mon Oct 31 15:21:38 2011 From: rjrich at umich.edu (Rudy J. Richardson) Date: Mon, 31 Oct 2011 16:21:38 -0400 (EDT) Subject: [Maxima] Current Version of wxMaxima? Message-ID: To whom it may concern: I am somewhat confused regarding finding the current latest version of binary installers for wxMaxima for Win and Mac. Some of the download sites have 5.25.0 and others have 5.25.1. I had initially used the 5.25.1 installer, but somehow I ended up with an outdated version of Maxima within the installer. Subsequently, I downloaded 5.25.0, and this gave me the latest version of Maxima. Thank you for pointing me to the correct site for the latest distributions. Best regards, rjr From toy.raymond at gmail.com Mon Oct 31 15:42:24 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 31 Oct 2011 13:42:24 -0700 Subject: [Maxima] integrate Principal Value message In-Reply-To: <73EEBACF87964A4E9335FDB4156767D7@edwinc367e16bd> References: <73EEBACF87964A4E9335FDB4156767D7@edwinc367e16bd> Message-ID: On Mon, Oct 31, 2011 at 11:32 AM, Edwin Woollett wrote: > Is there anything simple I can do (in nint.mac) to > surpress the message Principal Value which integrate > issues to the console screen in, for example, > > (%i13) integrate(sin(x)*(sin(x^2)*(**sin(x^3)+1/x)+1/x),x,0,inf); > > Principal Value > > This doesn't happen to me with the current git code. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Mon Oct 31 15:46:38 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 31 Oct 2011 13:46:38 -0700 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: <4EAEFC0A.4010307@eecs.berkeley.edu> References: <87mxcmzbae.fsf@xtof-netbook.home> <4EAEFC0A.4010307@eecs.berkeley.edu> Message-ID: On Mon, Oct 31, 2011 at 12:50 PM, Richard Fateman wrote: > On 10/31/2011 8:46 AM, Raymond Toy wrote: > >> >> >> Do you want symbolic intervals too? >> >> Ray >> >> Symbolic endpoints are probably a bad idea. The complexity of the > endpoint expressions grows very fast. > That's what I was thinking. It's useful for some quick tests, but anything other than that is difficult. I have written a interval package before. It's not particularly hard to get the basics right, but the corner cases are a pain. Plus, I didn't do directed rounding; that would have added more complexity. But it did get the fact that x*x is non-negative. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Mon Oct 31 16:23:41 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 31 Oct 2011 14:23:41 -0700 Subject: [Maxima] bessel_i value at inf not known by integrate Message-ID: <6606D4E35CFE4F34B505F465F5001168@edwinc367e16bd> The integral of bessel_i(1,%i*x) over (1,inf) using integrate returns an error message that the integral is divergent. ------------------------------ (%i1) display2d:false$ (%i2) integrate(bessel_i(1,%i*x),x,1,inf); defint: integral is divergent. -- an error. To debug this try: debugmode(true); -------------------------------- The indefinite integral is: --------------------------- (%i3) vx: integrate(bessel_i(1,%i*x),x); (%o3) %i*bessel_i(0,%i*x) ---------------------------------- The value of the integral comes entirely from the lower limit: ----------------------------- (%i4) -float(subst(x=1,vx)); (%o4) -0.76519768655797*%i ----------------------------------- which is the correct answer for the integral. The upper limit should be zero, but: --------------------------------- (%i5) limit(vx,x,inf,minus); (%o5) %i*bessel_i(0,infinity) (%i6) float(%); (%o6) %i*bessel_i(0.0,infinity) -------------------------------- Ted Woollett From hbaker1 at pipeline.com Tue Nov 1 10:06:40 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Tue, 01 Nov 2011 08:06:40 -0700 Subject: [Maxima] Treat inequalities like equations? Message-ID: (%i121) y=m*x+b; (%o121) y = m x + b (%i122) %-b; (%o122) y - b = m x but (%i123) y I am trying to start an isolation of integrate behavior, error messages, etc. from the nint.mac user, and have a short function called nint_integrate. It only uses the function complex_number_p defined in nint.lisp. I get the question: "is 1 zero or nonzero? ", when the integrand is bessel_i(1,%i*x) and integrating over (1,inf). As an experiment, I also tried using bessel_i(1.0,%i*x), which produced a different error message: "integrate: variable must not be a number; found: 1". -------------------------- Maxima 5.25.1 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. 2011-11-01 (%i1) load(temp); (%o1) "c:/work2/temp.mac" (%i2) nint_integrate(bessel_i(1,%i*x),x,1,inf); Is 1 zero or nonzero? nonzero; defint: integral is divergent. #0: nint_integrate(ue=bessel_i(1,%i*x),uvar=x,ua=1,ub=inf) -- an error. To debug this try: debugmode(true); (%i3) integrate(bessel_i(1,%i*x),x); (%o3) %i*bessel_i(0,%i*x) (%i4) nint_integrate(bessel_i(1.0,%i*x),x,1,inf); rat: replaced 1.0 by 1/1 = 1.0 integrate: variable must not be a number; found: 1 #0: nint_integrate(ue=bessel_i(1.0,%i*x),uvar=x,ua=1,ub=inf)(temp.mac line 15) -- an error. To debug this try: debugmode(true); /* try range (2,inf) */ (%i5) nint_integrate(bessel_i(1,%i*x),x,2,inf); Is 1 zero or nonzero? nonzero; defint: integral is divergent. #0: nint_integrate(ue=bessel_i(1,%i*x),uvar=x,ua=2,ub=inf) -- an error. To debug this try: debugmode(true); ------------------------------------------- The file temp.mac is: --------------------------- /* temp.mac */ load("nint.lisp")$ /*********** nint_integrate *************************/ nint_integrate (ue,uvar,ua, ub) := block ([vx,vxa,vxb ], /* try to get indefinite integral first */ vx : apply ('integrate,[ue,uvar]), vxa : expand(float(rectform(subst(ua,uvar,vx)))), if complex_number_p (vxa) then ( vxb : expand(float(rectform(subst(ub,uvar,vx)))), if complex_number_p (vxb) then return (vxb - vxa)), /* otherwise use defint */ apply ('integrate,[ue,uvar,ua,ub]), expand(float(rectform(%%))))$ display2d:false$ ---------------------- The file nint.lisp is: --------------------------- ;;;nint.lisp ;;;code from barton willis file ;;; topoly.lisp (defun $complex_number_p (e) (complex-number-p e #'$numberp)) ------------------------------------ Any suggestions for a cure (ie., no need to tell maxima that 1 is nonzero) would be appreciated. Ted Woollett From woollett at charter.net Tue Nov 1 14:02:37 2011 From: woollett at charter.net (Edwin Woollett) Date: Tue, 1 Nov 2011 12:02:37 -0700 Subject: [Maxima] rectform strange question, was: strange question when using interface to integrate Message-ID: On Nov. 1, 2011, I wrote: ----------------------- >I get the question: "is 1 zero or nonzero? ", >when the integrand is bessel_i(1,%i*x) and >integrating over (1,inf). > >(%i2) nint_integrate(bessel_i(1,%i*x),x,1,inf); >Is 1 zero or nonzero? > >nonzero; >defint: integral is divergent. >#0: nint_integrate(ue=bessel_i(1,%i*x),uvar=x,ua=1,ub=inf) > -- an error. To debug this try: debugmode(true); ------------------------- debug printouts now show this question comes from rectform: ---------------------------------------- Maxima 5.25.1 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. 2011-11-01 (%i1) display2d:false$ (%i2) rectform(%i*bessel_i(0,%i*inf)); Is 1 zero or nonzero? nonzero; (%o2) %i*bessel_i(0,%i*inf) ------------------------------------- So now I need isolation from rectform messages? Ted Woollett From woollett at charter.net Tue Nov 1 15:19:02 2011 From: woollett at charter.net (Edwin Woollett) Date: Tue, 1 Nov 2011 13:19:02 -0700 Subject: [Maxima] rectform strange question Message-ID: <2B33E3B6B7EB4D02AE1976D31D2EF15E@edwinc367e16bd> On Nov. 1, 2011, I wrote: -------------------------- >debug printouts now show this question >comes from rectform: > >(%i2) rectform(%i*bessel_i(0,%i*inf)); >Is 1 zero or nonzero? > >nonzero; >(%o2) %i*bessel_i(0,%i*inf) ------------------------------------- This doesn't happen if I use limit inside the code, which replaces %i*inf by infinity. ------------------------------------- (%i7) load(temp); (%o7) "c:/work2/temp.mac" (%i8) nint_integrate(bessel_i(1,%i*x),x,1,inf); vx = %i*bessel_i(0,%i*x) vxop = "*" vxa = %i*bessel_i(0,%i) vxa = 0.76519768655797*%i vxb = %i*bessel_i(0,infinity) vxb = %i*'realpart(bessel_i(0.0,infinity)) -1.0*'imagpart(bessel_i(0.0,infinity)) use defint instead defint: integral is divergent. #0: nint_integrate(ue=bessel_i(1,%i*x),uvar=x,ua=1,ub=inf) -- an error. To debug this try: debugmode(true); (%i9) ax : %i*bessel_i(0,%i*x)$ (%i10) axb : limit(ax,x,inf,minus); (%o10) %i*bessel_i(0,infinity) (%i11) float(axb); (%o11) %i*bessel_i(0.0,infinity) (%i12) rectform(%); (%o12) %i*'realpart(bessel_i(0.0,infinity))-'imagpart(bessel_i(0.0,infinity)) ------------------------------------ using the limit form of the code, with debug printouts present: ---------------------------------------------------------------- nint_integrate (ue,uvar,ua, ub) := block ([vx,vxa,vxb,vxop ], /* try to get indefinite integral first */ vx : apply ('integrate,[ue,uvar]), display (vx), vxop : op(vx), display (vxop), if vxop # integrate then ( if ua = minf then vxa : limit (vx,uvar,minf,plus) else vxa : subst(ua,uvar,vx), display(vxa), vxa : expand(float(rectform(vxa))), display (vxa), if complex_number_p (vxa) then ( if ub = inf then vxb : limit (vx,uvar,inf,minus) else vxb : subst(ub,uvar,vx), display (vxb), vxb : expand(float(rectform(vxb))), display (vxb), if complex_number_p (vxb) then return (vxb - vxa))), /* otherwise use defint */ print(" use defint instead "), apply ('integrate,[ue,uvar,ua,ub]), expand(float(rectform(%%))))$ --------------------------------------------- So problem solved. Sorry for the noise. Ted Woollett From razif66 at gmail.com Tue Nov 1 23:32:04 2011 From: razif66 at gmail.com (razif razali) Date: Wed, 2 Nov 2011 12:32:04 +0800 Subject: [Maxima] got error when try to run calculation In-Reply-To: <4EA63797.1060705@gmail.com> References: <4EA63797.1060705@gmail.com> Message-ID: Dear Raymond Toy and Maxima users, I already update my clisp to 2.49 but still can't run my code given before... 1 questions, what is maxima cvs?is it different with standard maxima for ubuntu? On Tue, Oct 25, 2011 at 12:14 PM, Raymond Toy wrote: > On 10/24/11 8:43 PM, razif razali wrote: > > ok here i attach the file, > > > > braket.mac i put in /usr/local/share/maxima/5.24.0/share/ folder, > > > > then in maxima i give below command, > > > > (%i1)load("pnn_4"); > > I didn't have any problems with this using maxima cvs and clisp 2.49. > > Do you have any information on exactly where the problem is occurring? > I did notice that I can't load pnn_4 twice because tellsimp complains > about circular rules, which I guess is true. > > Ray > > -- 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 robert.dodier at gmail.com Tue Nov 1 23:56:25 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 1 Nov 2011 22:56:25 -0600 Subject: [Maxima] Treat inequalities like equations? In-Reply-To: References: Message-ID: There is a share package, ineq, which might be helpful. load(ineq) loads the package and demo(ineq) runs through some examples. ineq is not too complicated -- it defines simplifications rules (via tellsimp and tellsimpafter) for some basic operations on inequalities. Maybe it's enough, I don't know. Hope this helps, Robert Dodier From toy.raymond at gmail.com Wed Nov 2 00:06:37 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 01 Nov 2011 22:06:37 -0700 Subject: [Maxima] Re-implementing R in Maxima In-Reply-To: References: <87mxcmzbae.fsf@xtof-netbook.home> Message-ID: <4EB0CFDD.9020000@gmail.com> On 10/31/11 11:42 AM, Stavros Macrakis wrote: > On Mon, Oct 31, 2011 at 13:38, Raymond Toy > wrote: > > I also notice that ratepsilon is still 2e-8, even though maxima > has been using double precision for years (decades?) now. > > > Argh! I thought we'd agreed multiple times (starting at least as long > ago as 2005) that ratepsilon should be much smaller, say > 2.0e-15 (about 9 ulps). This is plenty of slop for returning "nice" > rationals in the face of rounding error. > It's been finally changed to 2d-15, after all these years. No problems with the testsuite, FWIW. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Wed Nov 2 00:08:50 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 01 Nov 2011 22:08:50 -0700 Subject: [Maxima] got error when try to run calculation In-Reply-To: References: <4EA63797.1060705@gmail.com> Message-ID: <4EB0D062.2010203@gmail.com> On 11/1/11 9:32 PM, razif razali wrote: > Dear Raymond Toy and Maxima users, > > I already update my clisp to 2.49 but still can't run my code given > before... > 1 questions, what is maxima cvs?is it different with standard maxima > for ubuntu? I guess it's not maxima cvs anymore. I meant the current version of maxima in the sourceforge git repository. I'm pretty sure this is different from what ubuntu has. Sorry, I haven't done anything more with your code. Ray From hbaker1 at pipeline.com Wed Nov 2 07:38:23 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Wed, 02 Nov 2011 05:38:23 -0700 Subject: [Maxima] Treat inequalities like equations? In-Reply-To: References: Message-ID: Cool! "ineq" seems to do nearly everything that I wanted. Thank you! This sort of behavior on inequalities seems pretty orthogonal to the rest of Maxima. How come Maxima can't just incorporate it into the standard mechanisms? I would be surprised if it broke anything. At 09:56 PM 11/1/2011, Robert Dodier wrote: >There is a share package, ineq, which might be helpful. >load(ineq) loads the package and demo(ineq) runs through some examples. > >ineq is not too complicated -- it defines simplifications rules >(via tellsimp and tellsimpafter) for some basic operations on >inequalities. Maybe it's enough, I don't know. > >Hope this helps, > >Robert Dodier From macrakis at alum.mit.edu Wed Nov 2 08:42:15 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 2 Nov 2011 09:42:15 -0400 Subject: [Maxima] Treat inequalities like equations? In-Reply-To: References: Message-ID: ineq is not particularly robust or general. For example: (a=b)*(c=d) => a*c = b*d (base Maxima, OK) With ineq, (a=b)*(c=0) (a is a (a 0 -- not clear what this should be, but probably not 0 but assume(equal(q,0))$ q*(a q*(a exp(a=b), not exp(a)=exp(b) Ineq also slows down simplification: (%i8) expand((a+b+a*b-2)^50)$ Evaluation took 0.9830 seconds (1.0200 elapsed) (%i9) load(ineq)$ tellsimp: warning: putting rules on '+' or '*' is inefficient, and may not work. ...(%i10) expand((a+b+a*b-2)^50)$ Evaluation took 2.0750 seconds (2.0940 elapsed) -s On Wed, Nov 2, 2011 at 08:38, Henry Baker wrote: > Cool! "ineq" seems to do nearly everything that I wanted. Thank you! > > This sort of behavior on inequalities seems pretty orthogonal to the rest > of Maxima. How come Maxima can't just incorporate it into the standard > mechanisms? I would be surprised if it broke anything. > > At 09:56 PM 11/1/2011, Robert Dodier wrote: > >There is a share package, ineq, which might be helpful. > >load(ineq) loads the package and demo(ineq) runs through some examples. > > > >ineq is not too complicated -- it defines simplifications rules > >(via tellsimp and tellsimpafter) for some basic operations on > >inequalities. Maybe it's enough, I don't know. > > > >Hope this helps, > > > >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 hbaker1 at pipeline.com Wed Nov 2 09:37:31 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Wed, 02 Nov 2011 07:37:31 -0700 Subject: [Maxima] Treat inequalities like equations? In-Reply-To: References: Message-ID: I wasn't thinking so much of including "ineq" itself in the standard release, so much as including the basic ideas of ineq into the standard Maxima release -- i.e., expanding the notion of "equation" into ("equation" or "inequation"). Yes, you'd have to answer positive, negative, zero questions, but only when you're utilizing this inequation functionality. At 06:42 AM 11/2/2011, Stavros Macrakis wrote: >ineq is not particularly robust or general. > >For example: > >(a=b)*(c=d) => a*c = b*d (base Maxima, OK) >With ineq, (a=b)*(c a*c=0) > >(a is a (a >0*(a 0 -- not clear what this should be, but probably not 0 > >but > >assume(equal(q,0))$ >q*(a q*(a >Of course, base Maxima doesn't do too well, either, for equation manipulation: > >exp(a=b) => exp(a=b), not exp(a)=exp(b) > >Ineq also slows down simplification: > >(%i8) expand((a+b+a*b-2)^50)$ >Evaluation took 0.9830 seconds (1.0200 elapsed) >(%i9) load(ineq)$ >tellsimp: warning: putting rules on '+' or '*' is inefficient, and may not work. >...(%i10) expand((a+b+a*b-2)^50)$ >Evaluation took 2.0750 seconds (2.0940 elapsed) > > -s > >On Wed, Nov 2, 2011 at 08:38, Henry Baker wrote: >Cool! "ineq" seems to do nearly everything that I wanted. Thank you! > >This sort of behavior on inequalities seems pretty orthogonal to the rest of Maxima. How come Maxima can't just incorporate it into the standard mechanisms? I would be surprised if it broke anything. > >At 09:56 PM 11/1/2011, Robert Dodier wrote: >>There is a share package, ineq, which might be helpful. >>load(ineq) loads the package and demo(ineq) runs through some examples. >> >>ineq is not too complicated -- it defines simplifications rules >>(via tellsimp and tellsimpafter) for some basic operations on >>inequalities. Maybe it's enough, I don't know. >> >>Hope this helps, >> >>Robert Dodier From woollett at charter.net Wed Nov 2 13:34:07 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 2 Nov 2011 11:34:07 -0700 Subject: [Maxima] how to detect op integrate with intersect or lfreeof or?? Message-ID: How can I detect the op integrate using either intersect or lfreeof or ...? I am using Stavros Macrakis' code for listofops below: ------------------ (%i1) display2d:false$ (%i2) listofops(expr) := block([inflag:true], if mapatom(expr) then {} else adjoin(op(expr),xreduce(union,maplist(listofops,expr))))$ (%i3) rr : integrate(cos(log(x)/x)/x,x); (%o3) 'integrate(cos(log(x)/x)/x,x) (%i4) lop_rr : listofops(rr); (%o4) {"*","^",cos,integrate,log} (%i5) intersect(lop_rr, {cos}); (%o5) {cos} (%i6) intersect(lop_rr, {integrate}); (%o6) {} (%i7) ll : listify (lop_rr); (%o7) ["*","^",cos,integrate,log] (%i8) lfreeof(ll,cos); (%o8) false (%i9) lfreeof(ll,integrate); (%o9) true ------------------- I have not been successful in using code like: -------------------------- vx : apply ('integrate,[ue,uvar]), vxop : op(vx), if vxop # integrate then ( if ua = minf then vxa : limit (vx,uvar,minf,plus) else vxa : subst(ua,uvar,vx), etc., etc. ---------------- which can be illustrated interactively here: ----------------- (%i10) rrop : op(rr); (%o10) integrate (%i11) if rrop # integrate then print("rrop # integrate"); rrop # integrate (%o11) "rrop # integrate" ------------------------- so I am looking for some reliable method of doing something in the code when the noun form in ***not*** returned from integrate (expr,var). Ted Woollett From macrakis at alum.mit.edu Wed Nov 2 13:41:28 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 2 Nov 2011 14:41:28 -0400 Subject: [Maxima] how to detect op integrate with intersect or lfreeof or?? In-Reply-To: References: Message-ID: Some Maxima operations have two forms, "noun" and "verb". To cover all bases, try intersect(lop_rr, {verbify('integrate),nounify('integrate)}); On Wed, Nov 2, 2011 at 14:34, Edwin Woollett wrote: > How can I detect the op integrate using either > intersect or lfreeof or ...? > > I am using Stavros Macrakis' code for listofops > below: > ------------------ > (%i1) display2d:false$ > > (%i2) listofops(expr) := block([inflag:true], if mapatom(expr) then {} else > adjoin(op(expr),xreduce(union,**maplist(listofops,expr))))$ > > (%i3) rr : integrate(cos(log(x)/x)/x,x); > (%o3) 'integrate(cos(log(x)/x)/x,x) > > (%i4) lop_rr : listofops(rr); > (%o4) {"*","^",cos,integrate,log} > > (%i5) intersect(lop_rr, {cos}); > (%o5) {cos} > > (%i6) intersect(lop_rr, {integrate}); > (%o6) {} > > (%i7) ll : listify (lop_rr); > (%o7) ["*","^",cos,integrate,log] > > (%i8) lfreeof(ll,cos); > (%o8) false > > (%i9) lfreeof(ll,integrate); > (%o9) true > ------------------- > > I have not been successful in using code like: > -------------------------- > vx : apply ('integrate,[ue,uvar]), > vxop : op(vx), > if vxop # integrate then ( > if ua = minf then > vxa : limit (vx,uvar,minf,plus) > else vxa : subst(ua,uvar,vx), > etc., etc. ---------------- > which can be illustrated interactively here: > ----------------- > (%i10) rrop : op(rr); > (%o10) integrate > > (%i11) if rrop # integrate then print("rrop # integrate"); > rrop # integrate (%o11) "rrop # integrate" > ------------------------- > so I am looking for some reliable method of doing something > in the code when the noun form in ***not*** returned from > integrate (expr,var). > > 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 dstout at hawaii.edu Wed Nov 2 14:05:56 2011 From: dstout at hawaii.edu (David R Stoutemyer) Date: Wed, 02 Nov 2011 09:05:56 -1000 Subject: [Maxima] How do I make properties(...) work within a function definition? Message-ID: /* I want to programmatically do examples such as the following to see if "nary" is a member of the property list: */ properties("+"); ["mirror symmetry", nary, rule, operator] /* But I want to obtain the properties of symbols or strings from within a function definition, without knowing the particular symbol in advance. Here is a minimal such function definition: */ propertyList(symbolOrString) := properties(symbolOrString)$ /* It doesn't work because evidently properties(...) quotes its argument: */ propertyList("+"); [value] /* Using the quote quote operator on the top-level argument doesn't work because the parser evaluates it, which is too soon: */ propertyList(''"+"); [value] /* Putting the quote quote inside the body of the function definition doesn't work because the parser evaluates it there too: */ propertyList(operator) := properties(''operator)$ propertyList("+"); [value] /* The ev(...) function causes an error message for reasons that are unclear to me: */ propertyList(operator) := properties(ev(operator))$ propertyList("+"); properties: argument must be a symbol or a string. #0: propertyList(operator=+) -- an error. To debug this try: debugmode(true); /* I wish that for every function that quotes an argument as a "convenience" there was a corresponding version that didn't! Is there a way to do what I want? */ -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Wed Nov 2 14:09:00 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 2 Nov 2011 12:09:00 -0700 Subject: [Maxima] how to detect op integrate with intersect or lfreeof or?? Message-ID: <9B50D2454E324A95BF558FC2B363167E@edwinc367e16bd> On Nov. 2, 2011, Stavros Macrakis wrote: ------------------ >Some Maxima operations have two forms, "noun" and "verb". To cover all >bases, try > > intersect(lop_rr, {verbify('integrate),nounify('integrate)}); ------------------------------- thanks for the info. Using nounify('integrate) works for this situation. ------------- (%i13) intersect(lop_rr, {verbify('integrate),nounify('integrate)}); (%o13) {integrate} (%i14) intersect(lop_rr, {nounify('integrate)}); (%o14) {integrate} (%i15) intersect(lop_rr, {verbify('integrate)}); (%o15) {} (%i16) integratep(expr) := (if length(intersect(listofops(expr),{nounify('integrate)})) > 0 then true else false)$ (%i17) rr; (%o17) 'integrate(cos(log(x)/x)/x,x) (%i18) integratep(rr); (%o18) true (%i19) not integratep(rr); (%o19) false Ted From macrakis at alum.mit.edu Wed Nov 2 14:19:51 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 2 Nov 2011 15:19:51 -0400 Subject: [Maxima] How do I make properties(...) work within a function definition? In-Reply-To: References: Message-ID: Re: I wish that for every function that quotes an argument as a "convenience" there was a corresponding version that didn't! ... or that there was no autoquoting at all... also one of my pet peevs. (%i6) xx: "+"; (%o6) "+" (%i7) apply('properties,[xx]); (%o7) ["mirror symmetry",nary,rule,operator] On Wed, Nov 2, 2011 at 15:05, David R Stoutemyer wrote: > /* I want to programmatically do examples such as the following to see if > "nary" is a member of the property list: */ > > properties("+"); > ["mirror symmetry", nary, rule, operator] > > /* But I want to obtain the properties of symbols or strings from within a > function definition, without knowing the particular symbol in advance. Here > is a minimal such function definition: */ > > propertyList(symbolOrString) := properties(symbolOrString)$ > /* It doesn't work because evidently properties(...) quotes its argument: > */ > > propertyList("+"); > [value] > > /* Using the quote quote operator on the top-level argument doesn't work > because the parser evaluates it, which is too soon: */ > > propertyList(''"+"); > [value] > > /* Putting the quote quote inside the body of the function definition > doesn't work because the parser > evaluates it there too: */ > > propertyList(operator) := properties(''operator)$ > propertyList("+"); > [value] > > /* The ev(...) function causes an error message for reasons that are > unclear to me: */ > > propertyList(operator) := properties(ev(operator))$ > > propertyList("+"); > properties: argument must be a symbol or a string. > #0: propertyList(operator=+) > -- an error. To debug this try: debugmode(true); > > /* I wish that for every function that quotes an argument as a > "convenience" there was a > corresponding version that didn't! Is there a way to do what I want? */ > > _______________________________________________ > 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 dstout at hawaii.edu Tue Nov 1 12:56:46 2011 From: dstout at hawaii.edu (David R Stoutemyer) Date: Tue, 01 Nov 2011 07:56:46 -1000 Subject: [Maxima] How do I retrieve binding powers in a Maxima function definition Message-ID: Thanks, that seems to be just what I need! I don't know the distinction between mplus and "+", or if any such pairs have different binding powers. However, I want the binding power that is used in Maxima, not Lisp. The only reason I used ?+ was that I saw it in the on-line documentation for "infix" and inferred that it was the Maxima binding power. There is other parser data that I would like to access, but can't find online documentation about how to do so. In particular, I would like to determine if a symbol is a matchfix operator, and if so, what is its companion right delimiter? For example, does all such information reside on the property list of a symbol? If so, is there a function that returns the entire property list of a symbol so that I could study it and learn the proper keys to use with get()? The reason for all of this is that I am writing a function that tries to transform an expression into a particularly narrow expression. This involves partial deparsing to compare the predicted widths. I want the program to be robust about operators added by a user, so I don't want to simply hard wire the binding powers etc. published in the on-line manual. I would also like to automatically access character widths for the currently selected display font --the subject of an earlier mailing-list query. However, I suspect that involves forbiding forays into perhaps black-box interface, xml, and operating-system code. Until and unless I find out how to do that, the user will simply have to choose between Times New Roman and pdflatex -- or else supplement my measured width properties, which is _very_ tedious. From aleksasd873 at gmail.com Wed Nov 2 05:33:56 2011 From: aleksasd873 at gmail.com (Aleksas Domarkas) Date: Wed, 2 Nov 2011 12:33:56 +0200 Subject: [Maxima] Expand of the Bessel functions when the order is integer Message-ID: Expand of the Bessel functions when the order is integer "besselexpand:true" not affect when the order is integer How expand bessel_j(2,x) to (2*bessel_j(1,x)-bessel_j(0,x)*x)/x bessel_j(3,x) to -(-8*bessel_j(1,x)+4*bessel_j(0,x)*x+bessel_j(1,x)*x^2)/x^2 bessel_j(2,2) to bessel_j(1,2)-bessel_j(0,2) bessel_j(3,2) to bessel_j(1,2)-2*bessel_j(0,2) bessel_j(4,2) to 2*bessel_j(1,2)-5*bessel_j(0,2) ? How simplify -bessel_y(6,2)*bessel_j(7,2)+bessel_y(7,2)*bessel_j(6,2) to bessel_y(1,2)*bessel_j(0,2)-bessel_y(0,2)*bessel_j(1,2) ? Aleksas D -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Wed Nov 2 16:03:32 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 02 Nov 2011 14:03:32 -0700 Subject: [Maxima] How do I make properties(...) work within a function definition? In-Reply-To: References: Message-ID: <4EB1B024.4060403@eecs.berkeley.edu> Try this r:"+"; apply(properties,[r]) RJF From fateman at eecs.berkeley.edu Wed Nov 2 16:17:20 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 02 Nov 2011 14:17:20 -0700 Subject: [Maxima] Expand of the Bessel functions when the order is integer In-Reply-To: References: Message-ID: <4EB1B360.60707@eecs.berkeley.edu> On 11/2/2011 3:33 AM, Aleksas Domarkas wrote: > Expand of the Bessel functions when the order is integer > > "besselexpand:true" not affect when the order is integer > > How expand > bessel_j(2,x) to (2*bessel_j(1,x)-bessel_j(0,x)*x)/x > bessel_j(3,x) to > -(-8*bessel_j(1,x)+4*bessel_j(0,x)*x+bessel_j(1,x)*x^2)/x^2 > bessel_j(2,2) to bessel_j(1,2)-bessel_j(0,2) > bessel_j(3,2) to bessel_j(1,2)-2*bessel_j(0,2) > bessel_j(4,2) to 2*bessel_j(1,2)-5*bessel_j(0,2) ? > > How simplify > -bessel_y(6,2)*bessel_j(7,2)+bessel_y(7,2)*bessel_j(6,2) > to > bessel_y(1,2)*bessel_j(0,2)-bessel_y(0,2)*bessel_j(1,2) ? > > Aleksas D > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima b[n](x):=2*b[n-1](x)-b[n-2](x)$ b[0](x):=bessel_j(0,x); b[1](x):=bessel_j(1,x); try b[2](2). or ratsimp(b[3](x)), which is different from your answer. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdieterkaiser at web.de Wed Nov 2 17:33:10 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 02 Nov 2011 23:33:10 +0100 Subject: [Maxima] Expand of the Bessel functions when the order is integer In-Reply-To: References: Message-ID: <1320273190.1695.6.camel@dieter> Am Mittwoch, den 02.11.2011, 12:33 +0200 schrieb Aleksas Domarkas: > Expand of the Bessel functions when the order is integer > > "besselexpand:true" not affect when the order is integer > > How expand > bessel_j(2,x) to (2*bessel_j(1,x)-bessel_j(0,x)*x)/x > bessel_j(3,x) to -(-8*bessel_j(1,x)+4*bessel_j(0,x)*x > +bessel_j(1,x)*x^2)/x^2 > bessel_j(2,2) to bessel_j(1,2)-bessel_j(0,2) > bessel_j(3,2) to bessel_j(1,2)-2*bessel_j(0,2) > bessel_j(4,2) to 2*bessel_j(1,2)-5*bessel_j(0,2) ? > > How simplify > -bessel_y(6,2)*bessel_j(7,2)+bessel_y(7,2)*bessel_j(6,2) > to > bessel_y(1,2)*bessel_j(0,2)-bessel_y(0,2)*bessel_j(1,2) ? > > Aleksas D It is the option variable bessel_reduce in combination with the function ratsimp which does the work. In the following examples the function ratsimp is used as an evaluation flag. (%i1) bessel_reduce:true$ (%i2) bessel_j(2,x); (%o2) 2*bessel_j(1,x)/x-bessel_j(0,x) (%i3) bessel_j(4,2), ratsimp; (%o3) 2*bessel_j(1,2)-5*bessel_j(0,2) (%i4) -bessel_y(6,2)*bessel_j(7,2)+bessel_y(7,2)*bessel_j(6,2), ratsimp; (%o4) bessel_j(0,2)*bessel_y(1,2)-bessel_y(0,2)*bessel_j(1,2) The option variable bessel_reduce works for other Bessel functions too. I have introduced this option variable some times ago, because with this option hypergeometric functions simplifies much better, when Bessel functions are reduced to the lowest order. I am sorry, but the English documentation is missing. There is only the German documentation available at this time: -- Optionsvariable: bessel_reduce Standardwert: `false' Hat die Optionsvariable `bessel_reduce' den Wert `true', werden Bessel-Funktionen mit einer ganzzahligen Ordnung n nach Bessel-Funktionen mit der niedrigsten Ordnung 0 und 1 entwickelt. Dieter Kaiser From toy.raymond at gmail.com Wed Nov 2 17:51:01 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 2 Nov 2011 15:51:01 -0700 Subject: [Maxima] Expand of the Bessel functions when the order is integer In-Reply-To: <1320273190.1695.6.camel@dieter> References: <1320273190.1695.6.camel@dieter> Message-ID: On Wed, Nov 2, 2011 at 3:33 PM, Dieter Kaiser wrote: > > I am sorry, but the English documentation is missing. There is only the > German documentation available at this time: > > -- Optionsvariable: bessel_reduce > Standardwert: `false' > > Hat die Optionsvariable `bessel_reduce' den Wert `true', werden > Bessel-Funktionen mit einer ganzzahligen Ordnung n nach > Bessel-Funktionen mit der niedrigsten Ordnung 0 und 1 entwickelt. > > I don't know German, but google translate gives a rough enough translation that I can understand the intent. The English version might be If the option variable 'bessel_reduce' is 'true', Bessel functions of integer order n are expressed in terms of Bessel functions of order 0 and 1. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From razif66 at gmail.com Wed Nov 2 20:22:31 2011 From: razif66 at gmail.com (razif razali) Date: Thu, 3 Nov 2011 09:22:31 +0800 Subject: [Maxima] got error when try to run calculation In-Reply-To: <4EB0D062.2010203@gmail.com> References: <4EA63797.1060705@gmail.com> <4EB0D062.2010203@gmail.com> Message-ID: i already install latest version of maxima which is 5.25.1 and compile it with clisp 2.49 in ubuntu, but then, when i run my script, i still got below error ------------------------------------------------------------------------------- *** - Program stack overflow. RESET [/build/buildd/clisp-2.49/src/eval.d:573] reset() found no driver frame (sp=0x7fff79fc50f0-0x7fff79fbed00) Exiting on signal 6 Aborted ---------------------------------------------------------------------------------- i try to run maxima in windows xp by installing current version of maxima, but then i also got ------------------------------------------------------------------------------------ Maxima encountered a Lisp error : stack overflow on value stack automatically continuing. to enable the Lisp debugger set *debugger-hook* to nil. ---------------------------------------------------------------------------------- is this the error that you encountered before Raymond? is it help if we set debugger-hook to nil?and how to set it? On Wed, Nov 2, 2011 at 1:08 PM, Raymond Toy wrote: > On 11/1/11 9:32 PM, razif razali wrote: > > Dear Raymond Toy and Maxima users, > > > > I already update my clisp to 2.49 but still can't run my code given > > before... > > 1 questions, what is maxima cvs?is it different with standard maxima > > for ubuntu? > I guess it's not maxima cvs anymore. I meant the current version of > maxima in the sourceforge git repository. I'm pretty sure this is > different from what ubuntu has. > > Sorry, I haven't done anything more with your code. > > Ray > > -- 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 razif66 at gmail.com Wed Nov 2 20:29:43 2011 From: razif66 at gmail.com (razif razali) Date: Thu, 3 Nov 2011 09:29:43 +0800 Subject: [Maxima] got error when try to run calculation In-Reply-To: References: <4EA63797.1060705@gmail.com> <4EB0D062.2010203@gmail.com> Message-ID: the error occurred when maxima try to expand equation before "expand(bra(n,0,0,n).%)$" line in "pnn_4" On Thu, Nov 3, 2011 at 9:22 AM, razif razali wrote: > i already install latest version of maxima which is 5.25.1 and compile it > with clisp 2.49 in ubuntu, > > but then, when i run my script, i still got below error > > ------------------------------------------------------------------------------- > > *** - Program stack overflow. RESET > > [/build/buildd/clisp-2.49/src/eval.d:573] reset() found no driver frame > (sp=0x7fff79fc50f0-0x7fff79fbed00) > Exiting on signal 6 > Aborted > > ---------------------------------------------------------------------------------- > > > > > > i try to run maxima in windows xp by installing current version of > maxima, but then i also got > > > ------------------------------------------------------------------------------------ > Maxima encountered a Lisp error : stack overflow on value stack > > automatically continuing. > to enable the Lisp debugger set *debugger-hook* to nil. > > ---------------------------------------------------------------------------------- > is this the error that you encountered before Raymond? is it help if we > set debugger-hook to nil?and how to set it? > > > > > On Wed, Nov 2, 2011 at 1:08 PM, Raymond Toy wrote: > >> On 11/1/11 9:32 PM, razif razali wrote: >> > Dear Raymond Toy and Maxima users, >> > >> > I already update my clisp to 2.49 but still can't run my code given >> > before... >> > 1 questions, what is maxima cvs?is it different with standard maxima >> > for ubuntu? >> I guess it's not maxima cvs anymore. I meant the current version of >> maxima in the sourceforge git repository. I'm pretty sure this is >> different from what ubuntu has. >> >> Sorry, I haven't done anything more with your code. >> >> Ray >> >> > > > -- > Regards, > > RAZIF RAZALI, > Tutor & Master Student, > Physics Department, > Faculty Of Science, > Universiti Teknologi Malaysia(UTM). > +60199393606 > > > > -- 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 talon at lpthe.jussieu.fr Thu Nov 3 12:05:10 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Thu, 3 Nov 2011 17:05:10 +0000 (UTC) Subject: [Maxima] How do I retrieve binding powers in a Maxima function definition References: Message-ID: David R Stoutemyer wrote: > Thanks, that seems to be just what I need! > > I don't know the distinction between mplus and "+", or if any such pairs have different binding powers. However, I want the binding power that is used in Maxima, not Lisp. The only reason I used ?+ was that I saw it in the on-line documentation for "infix" and inferred that it was the Maxima binding power. Perhaps this sort of thing can be useful: (%i1) :lisp(symbol-plist 'MPLUS) (TEX TEX-MPLUS COMMUTES-WITH-CONJUGATE T $NARY (# 0) MAPS-INTEGERS-TO-INTEGERS T SIGN-FUNCTION SIGN-MPLUS RBP 100 LBP 100 GRIND MSZ-MPLUS DIMENSION DIM-MPLUS TRANSLATE # References: Message-ID: Re: > For example, does all such information reside on the property list of a symbol? Yes, but you probably shouldn't try to manipulate property lists in Maxima -- there will be many cases where there are things in the property list that will confuse Maxima. Try, for example ?symbol\-plist(%e); or ?symbol\-plist(verbify("+")); -s On Tue, Nov 1, 2011 at 13:56, David R Stoutemyer wrote: > Thanks, that seems to be just what I need! > > I don't know the distinction between mplus and "+", or if any such pairs > have different binding powers. However, I want the binding power that is > used in Maxima, not Lisp. The only reason I used ?+ was that I saw it in > the on-line documentation for "infix" and inferred that it was the Maxima > binding power. > > There is other parser data that I would like to access, but can't find > online documentation about how to do so. > > In particular, I would like to determine if a symbol is a matchfix > operator, and if so, what is its companion right delimiter? > > For example, does all such information reside on the property list of a > symbol? > > If so, is there a function that returns the entire property list of a > symbol so that I could study it and learn the proper keys to use with get()? > > The reason for all of this is that I am writing a function that tries to > transform an expression into a particularly narrow expression. This > involves partial deparsing to compare the predicted widths. I want the > program to be robust about operators added by a user, so I don't want to > simply hard wire the binding powers etc. published in the on-line manual. > > I would also like to automatically access character widths for the > currently selected display font --the subject of an earlier mailing-list > query. However, I suspect that involves forbiding forays into perhaps > black-box interface, xml, and operating-system code. Until and unless I > find out how to do that, the user will simply have to choose between Times > New Roman and pdflatex -- or else supplement my measured width properties, > which is _very_ tedious. > _______________________________________________ > 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 Nov 3 12:30:00 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 3 Nov 2011 13:30:00 -0400 Subject: [Maxima] How do I retrieve binding powers in a Maxima function definition In-Reply-To: References: Message-ID: ... but I should have mentioned that *if* you know what you're looking for and *if* it is of well-behaved type (e.g. an integer), then you can do things like ?get(verbify("+"),'?rbp); On Thu, Nov 3, 2011 at 13:28, Stavros Macrakis wrote: > Re: > > > For example, does all such information reside on the property list of a > symbol? > > Yes, but you probably shouldn't try to manipulate property lists in Maxima > -- there will be many cases where there are things in the property list > that will confuse Maxima. Try, for example > > ?symbol\-plist(%e); > or > ?symbol\-plist(verbify("+")); > > -s > > > On Tue, Nov 1, 2011 at 13:56, David R Stoutemyer wrote: > >> Thanks, that seems to be just what I need! >> >> I don't know the distinction between mplus and "+", or if any such pairs >> have different binding powers. However, I want the binding power that is >> used in Maxima, not Lisp. The only reason I used ?+ was that I saw it in >> the on-line documentation for "infix" and inferred that it was the Maxima >> binding power. >> >> There is other parser data that I would like to access, but can't find >> online documentation about how to do so. >> >> In particular, I would like to determine if a symbol is a matchfix >> operator, and if so, what is its companion right delimiter? >> >> For example, does all such information reside on the property list of a >> symbol? >> >> If so, is there a function that returns the entire property list of a >> symbol so that I could study it and learn the proper keys to use with get()? >> >> The reason for all of this is that I am writing a function that tries to >> transform an expression into a particularly narrow expression. This >> involves partial deparsing to compare the predicted widths. I want the >> program to be robust about operators added by a user, so I don't want to >> simply hard wire the binding powers etc. published in the on-line manual. >> >> I would also like to automatically access character widths for the >> currently selected display font --the subject of an earlier mailing-list >> query. However, I suspect that involves forbiding forays into perhaps >> black-box interface, xml, and operating-system code. Until and unless I >> find out how to do that, the user will simply have to choose between Times >> New Roman and pdflatex -- or else supplement my measured width properties, >> which is _very_ tedious. >> _______________________________________________ >> 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 Nov 3 13:47:29 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 3 Nov 2011 11:47:29 -0700 Subject: [Maxima] float_to_round function? Message-ID: I would like to have a function float_to_round (expr) which parses the expression, and for each element z, if floatnump(z) is true, converts that element to round(z), and returns the expression. example: float_to_round (bessel_j(3.0,x)*bessel_y(2.0,x)) ---> bessel_j(3,x)*bessel_y(2,x) Ted Woollett From woollett at charter.net Thu Nov 3 13:56:03 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 3 Nov 2011 11:56:03 -0700 Subject: [Maxima] float_to_round function? Message-ID: <3D988437DD4E4B7FAF45B6DDCADBA9FD@edwinc367e16bd> On Nov. 3, 2011, I wrote: ---------------- >I would like to have a function >float_to_round (expr) which parses the >expression, and for each element z, >if floatnump(z) is true, converts that >element to round(z), and returns the expression. ---------------------------------- Let me refine the condition to: if floatnump(z) is true and abs (z - round(z)) < 1.0e-6 then z is replaced by round(z). Hence bessel_j(1/2,x) would not be affected. Ted Woollett From woollett at charter.net Thu Nov 3 14:23:10 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 3 Nov 2011 12:23:10 -0700 Subject: [Maxima] integrate Principal Value message References: <1qpsjm5o55j.fsf@iceland.freeshell.org> Message-ID: On Nov. 3, 2011, Leo wrote ----------------- >Edwin Woollett writes: >> Is there anything simple I can do (in nint.mac) to >> surpress the message Principal Value which integrate >> issues to the console screen in, for example, >> >> (%i13) integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf); >> >> Principal Value >> >> (%o13) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) >> >Redirect stdout: > >(%i5) with_stdout("/dev/null", >integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) ); > >(%o5) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) > ------------------------------------ Thanks for the suggestion, but if I use this inside shared packaged code, as in Ch. 8, I have the problem that the specification of the dump file name appears to be system dependent (at least unix vs. windows): (%i53) integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf); Principal Value (%o53) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf /* using my windows 5.25.1gcl hardware/software combo leads to error: */ (%i54) with_stdout("/dev/null", integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) ); Maxima encountered a Lisp error: Error in LET [or a callee]: Cannot create the file /dev/null. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. /* redirecting output to c:/null.txt works for my system: */ (%i55) with_stdout("c:/null.txt", integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf)); (%o55) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) So is there a refinement which detects unix, windows, mac and does the appropriate redirection of output?? Ted From woollett at charter.net Thu Nov 3 14:33:19 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 3 Nov 2011 12:33:19 -0700 Subject: [Maxima] integrate Principal Value message References: <1qpsjm5o55j.fsf@iceland.freeshell.org> Message-ID: <52EBEBC1ED7C47D6AC708B185D428D8C@edwinc367e16bd> On Nov. 3, 2011, I wrote: -------------------------------- >Thanks for the suggestion, but if I use this inside shared >packaged code, as in Ch. 8, I have the problem that the >specification of the dump file name appears to be system >dependent (at least unix vs. windows): Again using my windows 5.25.1gcl system, just using the default working folder, as in (%i56) with_stdout("null.txt", integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf)); (%o56) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) works for me. Does this also work in a unix system? Ted From drdieterkaiser at web.de Thu Nov 3 14:33:22 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 03 Nov 2011 20:33:22 +0100 Subject: [Maxima] How do I retrieve binding powers in a Maxima function definition In-Reply-To: References: Message-ID: <1320348802.1794.8.camel@dieter> Am Donnerstag, den 03.11.2011, 13:30 -0400 schrieb Stavros Macrakis: Perhaps it is of interest. This is a complete table of operators defined in nparse.lisp and their corresponding properties. The columns nud and led contain the functions, which the parser calls to get the operands. The functions matchfix, infix, postfix, ... correspond to the type of the operator. The entry `function' in these columns means a special defined function for the operator. The binding powers are lbp and rbp. pos, lpos, and rpos specifies the type of the operands and the type of the operator. Operator nud led header lbp rbp pos lpos rpos ------------------------------------------------------------------------ [ matchfix function (mlist) 200 any any ] delim-err erb-err 5 ( function function (mprogn) ) delim-err erb-err 5 ' function (mquote) '' function : infix (msetq) 180 20 any any any :: infix (mset) 180 20 any any any := infix (mdefine) 180 20 any any any ::= infix (mdefmacro) 180 20 any any any ! postfix (mfactorial) 160 expr expr !! function ($genfact) 160 ^ function (mexpt) 140 139 expr expr expr ^^ function (mncexpt) 140 139 expr expr expr . infix (mnctimes) 130 129 expr expr expr * nary (mtimes) 120 expr ** / prefix (mquotient) 120 120 expr expr expr + prefix function (mplus) 100 134 expr expr - prefix (mminus) 100 134 expr expr = infix (mequal) 80 80 clause expr expr > infix (mgreaterp) 80 80 clause expr expr >= infix (mgeqp) 80 80 clause expr expr < infix (mlessp) 80 80 clause expr expr <= infix (mleqp) 80 80 clause expr expr $ premterm-err (nodisplay) -1 ; premterm-err (display) -1 && delim-err -1 # infix (mnotequal) 80 80 clause expr expr , nary ($ev) 10 any any not prefix (mnot) 70 clause clause clause and nary (mand) 65 clause clause or nary (mor) 60 clause clause then delim-err 5 25 else delim-err 5 25 elseif delim-err 5 45 any clause if function (mcond) 200 45 any clause do parse-$do (mdo) 25 25 any for parse-$do 25 200 any from parse-$do 25 95 any in 95 step parse-$do 25 95 expr next parse-$do 25 45 any thru parse-$do 25 95 expr unless parse-$do 25 45 clause while parse-$do 25 45 clause Dieter Kaiser From willisb at unk.edu Thu Nov 3 14:45:54 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 3 Nov 2011 14:45:54 -0500 Subject: [Maxima] float_to_round function? In-Reply-To: <3D988437DD4E4B7FAF45B6DDCADBA9FD@edwinc367e16bd> References: <3D988437DD4E4B7FAF45B6DDCADBA9FD@edwinc367e16bd> Message-ID: Maybe something like: (%i24) round_some_floats(e) := scanmap(lambda([s], if floatnump(s) and abs(s-round(s)) * 10^6 < 1 then round(s) else s), e)$ (%i26) round_some_floats(bessel(1.4,x) * bessel(42.0, 12) + sqrt(33.000001 * x + y) - bessel_j(1/2, 12)); (%o26) sqrt(y+33*x)+bessel(1.4,x)*bessel(42,12)-bessel_j(1/2,12) --Barton From: "Edwin Woollett" To: "maxima mailing list" Date: 11/03/2011 01:55 PM Subject: Re: [Maxima] float_to_round function? Sent by: maxima-bounces at math.utexas.edu On Nov. 3, 2011, I wrote: ---------------- >I would like to have a function >float_to_round (expr) which parses the >expression, and for each element z, >if floatnump(z) is true, converts that >element to round(z), and returns the expression. ---------------------------------- Let me refine the condition to: if floatnump(z) is true and abs (z - round(z)) < 1.0e-6 then z is replaced by round(z). Hence bessel_j(1/2,x) would not be affected. 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 Nov 3 15:32:53 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 3 Nov 2011 13:32:53 -0700 Subject: [Maxima] float_to_round function? Message-ID: <06FF7D8D719D4187A92CC71FF6582DB7@edwinc367e16bd> On Nov. 3, 2011, Barton Willis wrote: ------------------------------ Maybe something like: (%i24) round_some_floats(e) := scanmap(lambda([s], if floatnump(s) and abs(s-round(s)) * 10^6 < 1 then round(s) else s), e)$ (%i26) round_some_floats(bessel(1.4,x) * bessel(42.0, 12) + sqrt(33.000001 * x + y) - bessel_j(1/2, 12)); (%o26) sqrt(y+33*x)+bessel(1.4,x)*bessel(42,12)-bessel_j(1/2,12) ---------------------------------------------------- Yes, that seems to work better than using rat, but not sure which would be better in practice: (%i83) round_some_floats(e) := scanmap(lambda([s], if floatnump(s) then rat(s) else s), e)$ (%i84) round_some_floats( bessel(1.4,x) * bessel(42.0, 12) + sqrt(33.000001 * x + y) - bessel_j(1/2, 12)); (%o84) sqrt(1000000*y+33000001*x)/1000+bessel(7/5,x)*bessel(42,12) -bessel_j(1/2,12) ---------------------------- Ted From willisb at unk.edu Thu Nov 3 16:20:30 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 3 Nov 2011 16:20:30 -0500 Subject: [Maxima] float_to_round function? In-Reply-To: <06FF7D8D719D4187A92CC71FF6582DB7@edwinc367e16bd> References: <06FF7D8D719D4187A92CC71FF6582DB7@edwinc367e16bd> Message-ID: A variant that uses rat: (%i45) round_some_floats(e) := scanmap(lambda([s], block([ratprint: false], if floatnump(s) and close_enough(s, rat(s)) then rat(s) else s)), e)$ (%i47) close_enough(a,b) := 10^6 * abs(a-b) < max(abs(a), abs(b))$ (%i46) round_some_floats(bessel(1.4,x) * bessel(42.0, 12) + sqrt(33.0000001 * x + y) - bessel_j(1/2, 12)); (%o46) sqrt(y+33*x)+bessel(7/5,x)*bessel(42,12)-bessel_j(1/2,12) Is this mostly a workaround for a Maxima bug / weakness? All the rounding makes me nervous. --Barton maxima-bounces at math.utexas.edu wrote on 11/03/2011 03:32:53 PM: > On Nov. 3, 2011, Barton Willis wrote: > ------------------------------ > Maybe something like: > > (%i24) round_some_floats(e) := scanmap(lambda([s], if floatnump(s) and > abs(s-round(s)) * 10^6 < 1 then round(s) else s), e)$ > > (%i26) round_some_floats(bessel(1.4,x) * bessel(42.0, 12) + > sqrt(33.000001 * x + y) - bessel_j(1/2, 12)); > > (%o26) sqrt(y+33*x)+bessel(1.4,x)*bessel(42,12)-bessel_j(1/2,12) > ---------------------------------------------------- > Yes, that seems to work better than using rat, but not sure which > would be better in practice: > > (%i83) round_some_floats(e) := scanmap(lambda([s], if floatnump(s) > then rat(s) else s), e)$ > > (%i84) round_some_floats( > bessel(1.4,x) * bessel(42.0, 12) + > sqrt(33.000001 * x + y) - bessel_j(1/2, 12)); > > > (%o84) sqrt(1000000*y+33000001*x)/1000+bessel(7/5,x)*bessel(42,12) > -bessel_j(1/2,12) > > ---------------------------- > 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 talon at lpthe.jussieu.fr Thu Nov 3 17:31:49 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Thu, 3 Nov 2011 22:31:49 +0000 (UTC) Subject: [Maxima] integrate Principal Value message References: <1qpsjm5o55j.fsf@iceland.freeshell.org> <1qpsjm5o55j.fsf@iceland.freeshell.org> <52EBEBC1ED7C47D6AC708B185D428D8C@edwinc367e16bd> Message-ID: Edwin Woollett wrote: > On Nov. 3, 2011, I wrote: > -------------------------------- >>Thanks for the suggestion, but if I use this inside shared >>packaged code, as in Ch. 8, I have the problem that the >>specification of the dump file name appears to be system >>dependent (at least unix vs. windows): > > Again using my windows 5.25.1gcl system, just using the > default working folder, as in > > (%i56) with_stdout("null.txt", > integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf)); > > (%o56) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) > > works for me. Does this also work in a unix system? > No, it creates a file called "null.txt" containing Principal Value. Replacing this by "/dev/null" works however. > Ted -- Michel Talon From woollett at charter.net Thu Nov 3 17:43:10 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 3 Nov 2011 15:43:10 -0700 Subject: [Maxima] behavior of with_stdout with quad_qagi message Message-ID: I seem to be missing some part of how with_stdout works. This example: integrate ((sin(x+sqrt(x))+x*bessel_j(0,x^2))/(1+x),x,0,inf) is being done numerically using nint, which has the definition: nint([uv]) := (with_stdout ("null2.txt", apply ('nint0, uv)))$ and the function nint0 eventually (because integrate returns a noun form) sends the real and imaginary parts to quad_qagi, which then prints a precision message to the screen (which I want to surpress). ------------------------------------ (%i129) nint((sin(x+sqrt(x))+x*bessel_j(0,x^2))/(1+x),x,0,inf); * NO PRECISION BECAUSE X IS BIG (%o129) false (%i130) with_stdout("null2.txt", apply ('nint0,[(sin(x+sqrt(x))+x*bessel_j(0,x^2))/(1+x),x,0,inf])); * NO PRECISION BECAUSE X IS BIG (%o130) false ---------------------------------- yet if I use quad_qagi in an interactive mode,with the real and imaginary parts of the integrand, no precision message is returned. --------------------- /* no message */ (%i124) apply ('quad_qagi, [realpart((sin(x+sqrt(x))+x*bessel_j(0,x^2))/(1+x)),x,0,inf]); (%o124) [2.947785631372242,9.571670899311954,5985,1] /* no message */ (%i125) apply ('quad_qagi, [imagpart((sin(x+sqrt(x))+x*bessel_j(0,x^2))/(1+x)),x,0,inf]); (%o125) [0.0,0.0,15,0] ---------------------------------- I should add that I have the calls to quad_qagi inside the code also wrapped in with_stdout(some other dump file, ). I will experiment with those, but I'm probably missing something more fundamental here. Ted Woollett From kcrisman at gmail.com Thu Nov 3 21:45:14 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Thu, 3 Nov 2011 22:45:14 -0400 Subject: [Maxima] Maxima Digest, Vol 64, Issue 6 In-Reply-To: References: Message-ID: >> Again using my windows 5.25.1gcl system, just using the >> default working folder, as in >> >> (%i56) with_stdout("null.txt", >> integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf)); >> >> (%o56) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) >> >> works for me. ?Does this also work in a unix system? >> I have a related question, sort of the reverse. Normally, integrate(sin(x)*sin(x/3)/x^2, x, 0,inf); works fine, no principal value message. Except sometimes in Sage it *does* give a principal error message (via an ECL library interface only, not interacting in the terminal). Can anyone think of what command or flag could have been set for that integral to return that? If there isn't (which I suspect), then it must be something we are sending to ECL that messes with something. Thanks! From mat.everitt at gmail.com Wed Nov 2 16:29:07 2011 From: mat.everitt at gmail.com (Matthew Everitt) Date: Wed, 2 Nov 2011 21:29:07 +0000 Subject: [Maxima] Prevent commutation of elements within non-commutative matrix multiplication. Message-ID: Hi, I'm reasonably new to working with matrices in maxima, and I'm having a problem I hope someone can help me with. It seems that the inner product is assuming that the elements of a matrix commute, so running: declare([a,b],nonscalar)$ display2d:false$ A:matrix([0,a],[b,0])$ A.A; gives matrix([a*b,0],[0,a*b]) rather than matrix([a.b,0],[0,b.a]), which is what I need. Is there any way around this? Thanks, Matthew Everitt -------------- next part -------------- An HTML attachment was scrubbed... URL: From luigi_marino2 at alice.it Thu Nov 3 04:07:09 2011 From: luigi_marino2 at alice.it (Luigi Marino) Date: Thu, 3 Nov 2011 10:07:09 +0100 Subject: [Maxima] drawdf on wxMaxima 11.08.0 Message-ID: <16A2CF2E61954BF98D33C6393BF0CBE7@luigi3b0e34c8e> I have tried drawdf on wxMaxima 11.08.0 (last release Maxima 5.25.1) but it is not work. Is it a bug ? Best regards. Luigi Marino -------------- next part -------------- An HTML attachment was scrubbed... URL: From nb0yjxtr at iceland.freeshell.org Thu Nov 3 05:46:00 2011 From: nb0yjxtr at iceland.freeshell.org (Leo) Date: Thu, 03 Nov 2011 10:46:00 +0000 Subject: [Maxima] integrate Principal Value message In-Reply-To: <73EEBACF87964A4E9335FDB4156767D7@edwinc367e16bd> (message from Edwin Woollett on Mon, 31 Oct 2011 11:32:17 -0700) Message-ID: <1qpsjm5o55j.fsf@iceland.freeshell.org> Edwin Woollett writes: > Is there anything simple I can do (in nint.mac) to > surpress the message Principal Value which integrate > issues to the console screen in, for example, > > (%i13) integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf); > > Principal Value > > (%o13) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) Redirect stdout: (%i5) with_stdout("/dev/null", integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) ); (%o5) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) -- Leo Butler leo.butler at member.ams.org SDF Public Access UNIX System - http://sdf.lonestar.org From rswarbrick at gmail.com Fri Nov 4 04:45:57 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 04 Nov 2011 09:45:57 +0000 Subject: [Maxima] Prevent commutation of elements within non-commutative matrix multiplication. References: Message-ID: Matthew Everitt writes: > Hi, > > I'm reasonably new to working with matrices in maxima, and I'm having a > problem I hope someone can help me with. > It seems that the inner product is assuming that the elements of a matrix > commute, so running: > > declare([a,b],nonscalar)$ > display2d:false$ > A:matrix([0,a],[b,0])$ > A.A; > > gives > matrix([a*b,0],[0,a*b]) > rather than matrix([a.b,0],[0,b.a]), which is what I need. Is there any way > around this? I think you want: -- Option variable: matrix_element_mult Default value: `*' `matrix_element_mult' is the operation invoked in place of multiplication in a matrix multiplication. `matrix_element_mult' can be assigned any binary operator. The assigned value may be the name of an operator enclosed in quote marks, the name of a function, or a lambda expression. The dot operator `.' is a useful choice in some contexts. See also `matrix_element_add' and `matrix_element_transpose'. then you get: Maxima 5.25post http://maxima.sourceforge.net using Lisp SBCL 1.0.52.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) A:matrix([0,a],[b,0])$ (%i2) A.A; [ a b 0 ] (%o2) [ ] [ 0 a b ] (%i3) matrix_element_mult: "."; (%o3) . (%i4) A.A; [ a . b 0 ] (%o4) [ ] [ 0 b . a ] (%i5) Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From talon at lpthe.jussieu.fr Fri Nov 4 05:33:03 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 4 Nov 2011 10:33:03 +0000 (UTC) Subject: [Maxima] Running Maxima with Slime Message-ID: Recently i have seen here some messages asking how to run maxima with slime, and some answers. Also i have searched the web and found various recipes. None worked "out of the box" for me. After having read a little inside the slime distribution i have found a very simple solution which works perfectly for me. I want to share it here for the benefit of newcomers like me who are not versed in the arcanes of lisp . Context: i run this on maxima-5.25.1 compiled with the latest sbcl available for Mac OS X. I have recompiled maxima instead of using the precompiled one available because i encountered asdl problems with that one, and once these cured, i got problems with modules compiled with different versions of sbcl. Recompiling maxima everything works OK except that maxima doesn't find gnuplot. This is solved by a symbolic link /usr/local/bin/gnuplot -> /Applications/Gnuplot.app/Contents/Resources/bin/gnuplot. On the emacs side i am using the precompiled aquamacs and the packaged slime coming with it. On the mac it works wonderfully, in my opinion. So the trick, as explained in the web is to run slime inside maxima (not the other way around) and to load it using asdl. This is done by loading in maxima the following file (of course one needs to adapt the place where slime resides, and one can choose the port number at will): lilas% cat .maxima/startswank.lisp (pushnew "/Library/Application Support/Aquamacs Emacs/SLIME/" asdf:*central-registry*) ;;(require :asdf) (require :swank) (swank:create-server :port 56789 :dont-close t :coding-system "iso-latin-1-unix") Here (required :asdf) is necessary to run that under sbcl, but not under maxima. This works as follows: lilas% maxima (%i1) load(startswank); ;; loading #P"/Users/michel/.slime/fasl/2011-09-28/sbcl-1.0.51.0-a546163-darwi n-x86/swank-backend.fasl" ;; loading #P"/Users/michel/.slime/fasl/2011-09-28/sbcl-1.0.51.0-a546163-darwi n-x86/swank-source-path-parser.fasl" ;; loading #P"/Users/michel/.slime/fasl/2011-09-28/sbcl-1.0.51.0-a546163-darwi n-x86/swank-source-file-cache.fasl" ;; loading #P"/Users/michel/.slime/fasl/2011-09-28/sbcl-1.0.51.0-a546163-darwi n-x86/swank-sbcl.fasl" ;; loading #P"/Users/michel/.slime/fasl/2011-09-28/sbcl-1.0.51.0-a546163-darwi n-x86/swank-gray.fasl" ;; loading #P"/Users/michel/.slime/fasl/2011-09-28/sbcl-1.0.51.0-a546163-darwi n-x86/swank-match.fasl" ;; loading #P"/Users/michel/.slime/fasl/2011-09-28/sbcl-1.0.51.0-a546163-darwi n-x86/swank-rpc.fasl" ;; loading #P"/Users/michel/.slime/fasl/2011-09-28/sbcl-1.0.51.0-a546163-darwi n-x86/swank.fasl" WARNING: These Swank interfaces are unimplemented: (DISASSEMBLE-FRAME INTERRUPT-THREAD RECEIVE-IF SEND SLDB-BREAK-AT-START SLDB-BREAK-ON-RETURN SPAWN) ;; Swank started at port: 56789. (%o1) /Users/michel/.maxima/startswank.lisp Finally under emacs, (configured to recognize slime, of course), one runs: M-x slime-connect and gets: Host: 127.0.0.1 Port: 56789 Which produces the slime prompt: ; SLIME 2011-09-28 MAXIMA> At the end one has two windows, one where one can type maxima code and get maxima results, the other where one can type lisp code, and which gets the debugging messages, which is extremely nice because slime has a powerful inspector. Note: this doesn't work when maxima is run from wxmaxima, for reasons i don't know, the slime freezes. But one can run maxima under emacs, by M-x maxima -- Michel Talon From talon at lpthe.jussieu.fr Fri Nov 4 05:33:02 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 4 Nov 2011 10:33:02 +0000 (UTC) Subject: [Maxima] Maxima html documentation Message-ID: Hello, when working on my maxima installation i have seen that a lot of errors occur when producing the html doc, and as a result the doc lacks some references. For example i get things like: @ref{Category: Global variables} instead of a correct reference. I have checked that the precompiled distribution of maxima for mac os x has the same problem. On the other hand the documentation on maxima web site doesn't have this problem. Could someone explain what is the procedure to get a complete documentation? There seems to be invocation of perl, python and so on to produce these references, but i have no idea of the good procedure. Thanks a lot. -- Michel Talon From rswarbrick at gmail.com Fri Nov 4 06:01:51 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 04 Nov 2011 11:01:51 +0000 Subject: [Maxima] Running Maxima with Slime References: Message-ID: Another solution (which I use) goes as follows. (1) Add Maxima to your list of lisp implementations. Here it looks like (setf slime-lisp-implementations '((sbcl ("/usr/bin/sbcl") :coding-system utf-8-unix) (maxima ("sbcl" "--core" "/home/rupert/src/not-mine/maxima/src/binary-sbcl/maxima.core"))) Obviously, if you're using something other than sbcl, you're going to have to do something slightly different. (2) Now call slime with a negative prefix argument: "M - slime". This lets you select Maxima as your implementation (with tab completion) You'll get something like the following ; SLIME 2011-09-13 CL-USER> (3) Start Maxima proper by calling (run), then hit C-c C-c to send an error and choose the "Abort" option (it's choice #4 here) CL-USER> (run) Maxima 5.25post http://maxima.sourceforge.net using Lisp SBCL 1.0.52.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) ; Evaluation aborted on NIL. MAXIMA> Doing this makes sure that all the one-time setup stuff that Maxima does to sort out paths and loading and suchlike has been done. (4) Play with your "Maximized" lisp environment. To get a normal maxima command line, just call (run) again. Unfortunately, tab completion and the like won't work, but otherwise it's perfectly workable. (But irritatingly orangey red on my emacs). Don't forget #$ $: MAXIMA> #$1+x$ ((MPLUS SIMP) 1 $X) It'll save you an awful lot of typing '()... Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From talon at lpthe.jussieu.fr Fri Nov 4 08:51:08 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 4 Nov 2011 13:51:08 +0000 (UTC) Subject: [Maxima] imaxima mode under mac os X Message-ID: 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 From robert.dodier at gmail.com Fri Nov 4 10:11:29 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 4 Nov 2011 09:11:29 -0600 Subject: [Maxima] Maxima html documentation In-Reply-To: References: Message-ID: On 11/4/11, Michel Talon wrote: > On the other hand the documentation on maxima web site doesn't have this > problem. Could someone explain what is the procedure to get a complete > documentation? There seems to be invocation of perl, python and so on to > produce these references, but i have no idea of the good procedure. "make html" in maxima/doc/info invokes Perl etc. to create the html documentation. Feel free to post whatever error messages you're getting. best Robert Dodier From woollett at charter.net Fri Nov 4 12:13:56 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 4 Nov 2011 10:13:56 -0700 Subject: [Maxima] Use of with_stdout inside function fails Message-ID: <661A9EC5AC9C48F4B11E328E1D427DF8@edwinc367e16bd> I am experimenting with a way to surpress messages from integrate, using with_stdout inside another function. Here is a simple example which does not succeed in getting with_stdout to work inside another function. quiet_mode (file,expr) is designed to emulate the classical black hole effect of using "/dev/null" as the destination file in a unix system. In this example, I want to surpress the 'Principal Value' message from integrate. (%i1) load("quiet-mode.mac"); (%o1) "quiet-mode.mac" (%i2) file_search("zzz123"); (%o2) false /* use of with_stdout inside quiet_mode does nothing */ (%i3) quiet_mode("zzz123", integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf)); Principal Value (%o3) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) (%i4) fundef(quiet_mode); (%o4) quiet_mode(ffile,e):=block([rr],rr:apply('with_stdout,[ffile,e]), ?delete\-file(ffile),rr) (%i5) file_search("zzz123"); (%o5) false /* interactive use of with_stdout surpresses the message */ (%i6) with_stdout ("zzz123", integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf)); (%o6) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) (%i7) file_search("zzz123"); (%o7) "zzz123" (%i8) printfile("zzz123")$ Principal Value --------------------------------- Ted Woollett p.s. file quiet-mode.mac ----------------------------- /* quiet-mode.mac */ quiet_mode (ffile,e) := block ([rr], rr: apply ('with_stdout, [ffile,e]), ?delete\-file (ffile), rr)$ display2d:false$ From toy.raymond at gmail.com Fri Nov 4 12:24:11 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 4 Nov 2011 10:24:11 -0700 Subject: [Maxima] integrate Principal Value message In-Reply-To: <52EBEBC1ED7C47D6AC708B185D428D8C@edwinc367e16bd> References: <1qpsjm5o55j.fsf@iceland.freeshell.org> <52EBEBC1ED7C47D6AC708B185D428D8C@edwinc367e16bd> Message-ID: On Thu, Nov 3, 2011 at 12:33 PM, Edwin Woollett wrote: > On Nov. 3, 2011, I wrote: > ------------------------------**-- > >> Thanks for the suggestion, but if I use this inside shared >> packaged code, as in Ch. 8, I have the problem that the >> specification of the dump file name appears to be system >> dependent (at least unix vs. windows): >> > > Again using my windows 5.25.1gcl system, just using the > default working folder, as in > > (%i56) with_stdout("null.txt", > integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf)); > > The "null" device in Lisp is created by make-broadcast-stream. This works for me: with_stdout(?make\-broadcast\-stream, print("Hello, world"), t); Perhaps there's already a way to create such a stream in maxima, but I couldn't find it. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri Nov 4 12:27:27 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 04 Nov 2011 10:27:27 -0700 Subject: [Maxima] Use of with_stdout inside function fails In-Reply-To: <661A9EC5AC9C48F4B11E328E1D427DF8@edwinc367e16bd> References: <661A9EC5AC9C48F4B11E328E1D427DF8@edwinc367e16bd> Message-ID: <4EB4207F.1000905@eecs.berkeley.edu> While I admire the cleverness of transferring (all) output to some other stream to avoid messages, it seems to me that this is really not the right approach. Better would be to look at all the code that does "messages" and use one of a very few standard mechanisms. Some or perhaps all of these messages could be diverted or muffled on setting on some flags. Possible categories: Emergency -- the program is going to quit. If you don't see this you will be wondering what happened, so you can't muffle this. Requires response - e.g. the much disliked "is abc pos neg or zero?" If you muffle this, the program cannot continuge. Warning - e.g. Principal value Info - e.g. some roots may be multiple? regularly displayed - e.g. %o14 or (%i15) . {what else?} Also, it would be nice if each message had a unique number so that an index of all messages could be assembled, with an explanation of their meaning, and a user could easily find the explanation. e.g. [integrate001] Principal Value [compare001] Is abc pos neg zero [rat001] rat replaced 0.5 by 1/2 On 11/4/2011 10:13 AM, Edwin Woollett wrote: > I am experimenting with a way to surpress messages > from integrate, using with_stdout inside another > function. > > Here is a simple example which does not succeed in > getting with_stdout to work inside another function. > > quiet_mode (file,expr) is designed to emulate the > classical black hole effect of using "/dev/null" as the > destination file in a unix system. > > In this example, I want to surpress the 'Principal Value' > message from integrate. > > (%i1) load("quiet-mode.mac"); > (%o1) "quiet-mode.mac" > > (%i2) file_search("zzz123"); > (%o2) false > > /* use of with_stdout inside quiet_mode does nothing */ > > (%i3) quiet_mode("zzz123", > integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf)); > > Principal Value > > (%o3) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) > > (%i4) fundef(quiet_mode); > (%o4) quiet_mode(ffile,e):=block([rr],rr:apply('with_stdout,[ffile,e]), > ?delete\-file(ffile),rr) > > (%i5) file_search("zzz123"); > (%o5) false > > /* interactive use of with_stdout surpresses the message */ > > (%i6) with_stdout ("zzz123", > integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf)); > > (%o6) 'integrate(sin(x)*(sin(x^2)*(sin(x^3)+1/x)+1/x),x,0,inf) > > (%i7) file_search("zzz123"); > (%o7) "zzz123" > > (%i8) printfile("zzz123")$ > Principal Value > --------------------------------- > > Ted Woollett > p.s. file quiet-mode.mac > ----------------------------- > /* quiet-mode.mac */ > > quiet_mode (ffile,e) := > block ([rr], > rr: apply ('with_stdout, [ffile,e]), > ?delete\-file (ffile), > rr)$ > display2d:false$ > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From biomates at telefonica.net Fri Nov 4 13:48:57 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 04 Nov 2011 19:48:57 +0100 Subject: [Maxima] drawdf on wxMaxima 11.08.0 In-Reply-To: <16A2CF2E61954BF98D33C6393BF0CBE7@luigi3b0e34c8e> References: <16A2CF2E61954BF98D33C6393BF0CBE7@luigi3b0e34c8e> Message-ID: <1320432537.1545.3.camel@pc> El jue, 03-11-2011 a las 10:07 +0100, Luigi Marino escribi?: > I have tried drawdf > on wxMaxima 11.08.0 > (last release Maxima 5.25.1) > but it is not work. > Is it a bug ? > Best regards. > Luigi Marino This session works for me: load(drawdf) $ drawdf(exp(-x)+y) $ wxdrawdf(exp(-x)+y) $ Do plot and draw work in your system? -- Mario From talon at lpthe.jussieu.fr Fri Nov 4 15:25:45 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 4 Nov 2011 20:25:45 +0000 (UTC) Subject: [Maxima] Maxima html documentation References: Message-ID: Robert Dodier wrote: > On 11/4/11, Michel Talon wrote: > >> On the other hand the documentation on maxima web site doesn't have this >> problem. Could someone explain what is the procedure to get a complete >> documentation? There seems to be invocation of perl, python and so on to >> produce these references, but i have no idea of the good procedure. > > "make html" in maxima/doc/info invokes Perl etc. to create the html > documentation. > > Feel free to post whatever error messages you're getting. > > best > > Robert Dodier There are so many error messages that it is tedious. First, i have perl and python accessible in my path. Below i transcript a much abbreviated version: (the main point is that the end result, the html files, has the same flaw as in the precompiled version available in maxima site): lilas% rm *.html lilas% make html sh extract_categories.sh maxima + TARGET_TEXI=maxima.texi ++ mktemp -d /var/folders/wb/k4m6pmh57m3_6j248b_ftk7h0000gn/T//maxima-texinfo- categories-XXXXXX + WORKING_DIRECTORY=/var/folders/wb/k4m6pmh57m3_6j248b_ftk7h0000gn/T//maxima-t exinfo-categories-sbXhW4 + cp -R Affine.texi Arrays.texi Atensor.texi Bugs.texi Command.texi Constants.texi Contexts.texi Ctensor.texi DataTypes.texi Database.texi Debugging.texi Deleted.texi Differential.texi Differentiation.texi Elliptic.texi Equations.texi Evaluation.texi Expressions.texi Floating.texi Function.texi Groups.texi Help.texi Indices.texi Input.texi ?. ?.. + for f in '*.texi' + '[' zeilberger.texi = maxima.texi ']' + sed 's/^@def\(fn\|vr\) *{[^}]*} *\([^[:blank:]]*\).*/@anchor{Item: \2}\ \0/; s/^@node *\([^,]*\).*/@anchor{Item: \1}\ \0/' zeilberger.texi + mv tmp.texi zeilberger.texi + awk '!/^@c / && !/^@c$/ && (/^@deffn/ || /^@defvr/ || /^@end deffn/ || /^@end defvr/ || /@category/ || /@node/)' + sed -f /Users/michel/Documents/maxima/maxima-5.25.1/doc/info/extract_categories1.sed + awk '-F$' -f /Users/michel/Documents/maxima/maxima-5.25.1/doc/info/extract_categories1.awk + cat Affine.texi Arrays.texi Atensor.texi Bugs.texi Command.texi Constants.texi Contexts.texi Ctensor.texi DataTypes.texi Database.texi Debugging.texi Deleted.texi Differential.texi Differentiation.texi Elliptic.texi Equations.texi Evaluation.texi Expressions.texi Floating.texi Function.texi Groups.texi Help.texi Indices.texi Input.texi Integration.texi Introduction.texi Itensor.texi Limits.texi Lists.texi Logarithms.texi MathFunctions.texi Matrices.texi Miscellaneous.texi Number.texi Numerical.texi Operators.texi Plotting.texi Polynomials.texi Program.texi Rules.texi Runtime.texi Series.texi Simplification.texi Special.texi Symmetries.texi Trigonometric.texi asympa.texi augmented_lagrangian.texi bernstein.texi bode.texi category-macros.texi cobyla.texi contrib_ode.texi defstruct.texi descriptive.texi diag.texi distrib.texi draw.texi drawdf.texi dynamics.texi ezunits.texi f90.texi finance.texi fractals.texi ggf.texi graphs.texi grobner.texi impdiff.texi implicit_plot.texi include-maxima.texi interpol.texi lapack.texi lbfgs.texi lindstedt.texi linearalgebra.texi lsquares.texi makeOrders.texi maxima.texi minpack.texi mnewton.texi nset.texi numericalio.texi opsubst.texi orthopoly.texi plotdf.texi romberg.texi simplex.texi simplifications.texi solve_rec.texi stats.texi stirling.texi stringproc.texi to_poly_solve.texi unit.texi zeilberger.texi + python tmp-make-categories.py File "tmp-make-categories.py", line 23 @deffn {Function} fast_linsolve ([@var{expr_1}, ..., @var{expr_m}], [@var{x_1}, ..., @var{x_n}]) ^ SyntaxError: invalid syntax + sed 's/^@bye//' maxima.texi + echo '@node Documentation Categories' + echo '@chapter Documentation Categories' + for f in 'Category-*.texi' + echo @include 'Category-*.texi' + echo @bye + mv tmp-target.texi maxima.texi + perl /Users/michel/Documents/maxima/maxima-5.25.1/doc/info/texi2html -split_chapter --lang=en --output=. --css-include=/Users/michel/Documents/maxima/maxima-5.25.1/doc/info/manual.css --init-file /Users/michel/Documents/maxima/maxima-5.25.1/doc/info/texi2html.init maxima.texi *** Can't find Category-*.texi, skipping (l. 7) ** menu entry without previous node: Introduction to Maxima (in ./include-maxima.texi l. 88) ** menu entry without previous node: Bug Detection and Reporting (in ./include-maxima.texi l. 89) ** menu entry without previous node: Help (in ./include-maxima.texi l. 90) ** menu entry without previous node: Command Line (in ./include-maxima.texi l. 91) ** menu entry without previous node: Data Types and Structures (in ./include-maxima.texi l. 92) ** menu entry without previous node: Expressions (in ./include-maxima.texi l. 93) ** menu entry without previous node: Operators (in ./include-maxima.texi l. 94) ** menu entry without previous node: Evaluation (in ./include-maxima.texi l. 95) ** menu entry without previous node: Simplification (in ./include-maxima.texi l. 96) ** menu entry without previous node: Mathematical Functions (in ./include-maxima.texi l. 97) ?? ** menu entry without previous node: Functions and Variables for strings (in ./stringproc.texi l. 5) ** menu entry without previous node: Functions and Variables for to_poly_solve (in ./to_poly_solve.texi l. 2) ** menu entry without previous node: Introduction to Units (in ./unit.texi l. 2) ** menu entry without previous node: Functions and Variables for Units (in ./unit.texi l. 3) ** menu entry without previous node: Introduction to zeilberger (in ./zeilberger.texi l. 2) ** menu entry without previous node: Functions and Variables for zeilberger (in ./zeilberger.texi l. 3) *** Unknown node in menu entry `Introduction to Maxima' (in ./include-maxima.texi l. 88) *** Unknown node in menu entry `Bug Detection and Reporting' (in ./include-maxima.texi l. 89) *** Unknown node in menu entry `Help' (in ./include-maxima.texi l. 90) *** Unknown node in menu entry `Command Line' (in ./include-maxima.texi l. 91) *** Unknown node in menu entry `Data Types and Structures' (in ./include-maxima.texi l. 92) *** Unknown node in menu entry `Expressions' (in ./include-maxima.texi l. 93) *** Unknown node in menu entry `Operators' (in ./include-maxima.texi l. 94) *** Unknown node in menu entry `Evaluation' (in ./include-maxima.texi l. 95) *** Unknown node in menu entry `Simplification' (in ./include-maxima.texi l. 96) *** Unknown node in menu entry `Mathematical Functions' (in ./include-maxima.texi l. 97) ?. *** Unknown node in menu entry `Functions and Variables for to_poly_solve' (in ./include-maxima.texi l. 635) *** Unknown node in menu entry `Introduction to Units' (in ./include-maxima.texi l. 639) *** Unknown node in menu entry `Functions and Variables for Units' (in ./include-maxima.texi l. 640) *** Unknown node in menu entry `Introduction to zeilberger' (in ./include-maxima.texi l. 644) *** Unknown node in menu entry `Functions and Variables for zeilberger' (in ./include-maxima.texi l. 645) *** Undefined node `Category: Help' in @ref (in ./Introduction.texi l. 194 in category) *** Unknown node in menu entry `Functions and Variables for Bug Detection and Reporting' (in ./Bugs.texi l. 2) *** Undefined node `Category: Debugging' in @ref (in ./Bugs.texi l. 53 in category) *** Undefined node `Category: Debugging' in @ref (in ./Bugs.texi l. 78 in category) *** Undefined node `Category: Global variables' in @ref (in ./Bugs.texi l. 78 in category) *** Undefined node `Category: Debugging' in @ref (in ./Bugs.texi l. 96 in category) *** Undefined node `Category: Debugging' in @ref (in ./Bugs.texi l. 110 in category) *** Unknown node in menu entry `Documentation' (in ./Help.texi l. 2) *** Unknown node in menu entry `Functions and Variables for Help' (in ./Help.texi l. 3) ?. *** Undefined node `Category: Package zeilberger' in @ref (in ./zeilberger.texi l. 414 in category) *** Undefined node `Category: Package zeilberger' in @ref (in ./zeilberger.texi l. 426 in category) *** Undefined node `Category: Package zeilberger' in @ref (in ./zeilberger.texi l. 437 in category) *** Undefined node `Category: Package zeilberger' in @ref (in ./zeilberger.texi l. 449 in category) + for f in '*.html' + grep -q 'Category: .*' maxima.html + '[' 1 = 0 ']' + for f in '*.html' + grep -q 'Category: .*' maxima_1.html + '[' 1 = 0 ']' + for f in '*.html' + grep -q 'Category: .*' maxima_10.html + '[' 1 = 0 ']' + ?. + for f in '*.html' + grep -q 'Item: .*' maxima_toc.html + '[' 1 = 0 ']' + mv maxima.html maxima_1.html maxima_10.html maxima_100.html maxima_11.html maxima_12.html maxima_13.html maxima_14.html maxima_15.html maxima_16.html maxima_17.html maxima_18.html maxima_19.html maxima_2.html maxima_20.html maxima_21.html maxima_22.html maxima_23.html maxima_24.html maxima_25.html maxima_26.html maxima_27.html maxima_28.html maxima_29.html maxima_3.html maxima_30.html maxima_31.html maxima_32.html maxima_33.html maxima_34.html maxima_35.html maxima_36.html maxima_37.html maxima_38.html maxima_39.html maxima_4.html maxima_40.html maxima_41.html maxima_42.html maxima_43.html maxima_44.html maxima_45.html maxima_46.html maxima_47.html maxima_48.html maxima_49.html maxima_5.html maxima_50.html maxima_51.html maxima_52.html maxima_53.html maxima_54.html maxima_55.html maxima_56.html maxima_57.html maxima_58.html maxima_59.html maxima_6.html maxima_60.html maxima_61.html maxima_62.html maxima_63.html maxima_64.html maxima_65.html maxima_66.html maxima_67.html maxima_68.html maxima_69.html maxima_7.html maxima_70.html maxima_71.html maxima_72.html maxima_73.html maxima_74.html maxima_75.html maxima_76.html maxima_77.html maxima_78.html maxima_79.html maxima_8.html maxima_80.html maxima_81.html maxima_82.html maxima_83.html maxima_84.html maxima_85.html maxima_86.html maxima_87.html maxima_88.html maxima_89.html maxima_9.html maxima_90.html maxima_91.html maxima_92.html maxima_93.html maxima_94.html maxima_95.html maxima_96.html maxima_97.html maxima_98.html maxima_99.html maxima_abt.html maxima_fot.html maxima_ovr.html maxima_toc.html /Users/michel/Documents/maxima/maxima-5.25.1/doc/info + cd /Users/michel/Documents/maxima/maxima-5.25.1/doc/info + set +x perl ./create_index < end of the make html command > -- Michel Talon From drdieterkaiser at web.de Fri Nov 4 16:11:14 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 04 Nov 2011 22:11:14 +0100 Subject: [Maxima] Maxima html documentation In-Reply-To: References: Message-ID: <1320441074.1621.9.camel@dieter> Am Freitag, den 04.11.2011, 20:25 +0000 schrieb Michel Talon: > Robert Dodier wrote: > > On 11/4/11, Michel Talon wrote: > > > >> On the other hand the documentation on maxima web site doesn't have this > >> problem. Could someone explain what is the procedure to get a complete > >> documentation? There seems to be invocation of perl, python and so on to > >> produce these references, but i have no idea of the good procedure. > > > > "make html" in maxima/doc/info invokes Perl etc. to create the html > > documentation. > > > > Feel free to post whatever error messages you're getting. > > > > best > > > > Robert Dodier > > There are so many error messages that it is tedious. First, i have perl and > python accessible in my path. Below i transcript a much abbreviated version: > (the main point is that the end result, the html files, has the same flaw as > in the precompiled version available in maxima site): > > lilas% rm *.html > lilas% make html > sh extract_categories.sh maxima > + TARGET_TEXI=maxima.texi > ++ mktemp -d /var/folders/wb/k4m6pmh57m3_6j248b_ftk7h0000gn/T//maxima-texinfo- > categories-XXXXXX > + WORKING_DIRECTORY=/var/folders/wb/k4m6pmh57m3_6j248b_ftk7h0000gn/T//maxima-t > exinfo-categories-sbXhW4 > + cp -R Affine.texi Arrays.texi Atensor.texi Bugs.texi Command.texi > Constants.texi Contexts.texi Ctensor.texi DataTypes.texi Database.texi > Debugging.texi Deleted.texi Differential.texi Differentiation.texi > Elliptic.texi Equations.texi Evaluation.texi Expressions.texi Floating.texi > Function.texi Groups.texi Help.texi Indices.texi Input.texi ?. > ?.. > > + for f in '*.texi' > + '[' zeilberger.texi = maxima.texi ']' > + sed 's/^@def\(fn\|vr\) *{[^}]*} *\([^[:blank:]]*\).*/@anchor{Item: \2}\ > \0/; s/^@node *\([^,]*\).*/@anchor{Item: \1}\ > \0/' zeilberger.texi > + mv tmp.texi zeilberger.texi > + awk '!/^@c / && !/^@c$/ && (/^@deffn/ || /^@defvr/ || /^@end deffn/ || > /^@end defvr/ || /@category/ || /@node/)' > + sed -f > /Users/michel/Documents/maxima/maxima-5.25.1/doc/info/extract_categories1.sed > + awk '-F$' -f > /Users/michel/Documents/maxima/maxima-5.25.1/doc/info/extract_categories1.awk > + cat Affine.texi Arrays.texi Atensor.texi Bugs.texi Command.texi > Constants.texi Contexts.texi Ctensor.texi DataTypes.texi Database.texi > Debugging.texi Deleted.texi Differential.texi Differentiation.texi > Elliptic.texi Equations.texi Evaluation.texi Expressions.texi Floating.texi > Function.texi Groups.texi Help.texi Indices.texi Input.texi Integration.texi > Introduction.texi Itensor.texi Limits.texi Lists.texi Logarithms.texi > MathFunctions.texi Matrices.texi Miscellaneous.texi Number.texi Numerical.texi > Operators.texi Plotting.texi Polynomials.texi Program.texi Rules.texi > Runtime.texi Series.texi Simplification.texi Special.texi Symmetries.texi > Trigonometric.texi asympa.texi augmented_lagrangian.texi bernstein.texi > bode.texi category-macros.texi cobyla.texi contrib_ode.texi defstruct.texi > descriptive.texi diag.texi distrib.texi draw.texi drawdf.texi dynamics.texi > ezunits.texi f90.texi finance.texi fractals.texi ggf.texi graphs.texi > grobner.texi impdiff.texi implicit_plot.texi include-maxima.texi interpol.texi > lapack.texi lbfgs.texi lindstedt.texi linearalgebra.texi lsquares.texi > makeOrders.texi maxima.texi minpack.texi mnewton.texi nset.texi > numericalio.texi opsubst.texi orthopoly.texi plotdf.texi romberg.texi > simplex.texi simplifications.texi solve_rec.texi stats.texi stirling.texi > stringproc.texi to_poly_solve.texi unit.texi zeilberger.texi > + python tmp-make-categories.py > File "tmp-make-categories.py", line 23 > @deffn {Function} fast_linsolve ([@var{expr_1}, ..., @var{expr_m}], > [@var{x_1}, ..., @var{x_n}]) > ^ > SyntaxError: invalid syntax > + sed 's/^@bye//' maxima.texi > + echo '@node Documentation Categories' > + echo '@chapter Documentation Categories' > + for f in 'Category-*.texi' > + echo @include 'Category-*.texi' > + echo @bye > + mv tmp-target.texi maxima.texi > + perl /Users/michel/Documents/maxima/maxima-5.25.1/doc/info/texi2html > -split_chapter --lang=en --output=. > --css-include=/Users/michel/Documents/maxima/maxima-5.25.1/doc/info/manual.css > --init-file > /Users/michel/Documents/maxima/maxima-5.25.1/doc/info/texi2html.init > maxima.texi > *** Can't find Category-*.texi, skipping (l. 7) > ** menu entry without previous node: Introduction to Maxima (in > ./include-maxima.texi l. 88) > ** menu entry without previous node: Bug Detection and Reporting (in > ./include-maxima.texi l. 89) > ** menu entry without previous node: Help (in ./include-maxima.texi l. 90) > ** menu entry without previous node: Command Line (in ./include-maxima.texi l. > 91) > ** menu entry without previous node: Data Types and Structures (in > ./include-maxima.texi l. 92) > ** menu entry without previous node: Expressions (in ./include-maxima.texi l. > 93) > ** menu entry without previous node: Operators (in ./include-maxima.texi l. > 94) > ** menu entry without previous node: Evaluation (in ./include-maxima.texi l. > 95) > ** menu entry without previous node: Simplification (in ./include-maxima.texi > l. 96) > ** menu entry without previous node: Mathematical Functions (in > ./include-maxima.texi l. 97) ?? > > ** menu entry without previous node: Functions and Variables for strings (in > ./stringproc.texi l. 5) > ** menu entry without previous node: Functions and Variables for to_poly_solve > (in ./to_poly_solve.texi l. 2) > ** menu entry without previous node: Introduction to Units (in ./unit.texi l. > 2) > ** menu entry without previous node: Functions and Variables for Units (in > ./unit.texi l. 3) > ** menu entry without previous node: Introduction to zeilberger (in > ./zeilberger.texi l. 2) > ** menu entry without previous node: Functions and Variables for zeilberger > (in ./zeilberger.texi l. 3) > *** Unknown node in menu entry `Introduction to Maxima' (in > ./include-maxima.texi l. 88) > *** Unknown node in menu entry `Bug Detection and Reporting' (in > ./include-maxima.texi l. 89) > *** Unknown node in menu entry `Help' (in ./include-maxima.texi l. 90) > *** Unknown node in menu entry `Command Line' (in ./include-maxima.texi l. 91) > *** Unknown node in menu entry `Data Types and Structures' (in > ./include-maxima.texi l. 92) > *** Unknown node in menu entry `Expressions' (in ./include-maxima.texi l. 93) > *** Unknown node in menu entry `Operators' (in ./include-maxima.texi l. 94) > *** Unknown node in menu entry `Evaluation' (in ./include-maxima.texi l. 95) > *** Unknown node in menu entry `Simplification' (in ./include-maxima.texi l. > 96) > *** Unknown node in menu entry `Mathematical Functions' (in > ./include-maxima.texi l. 97) > ?. > *** Unknown node in menu entry `Functions and Variables for to_poly_solve' (in > ./include-maxima.texi l. 635) > *** Unknown node in menu entry `Introduction to Units' (in > ./include-maxima.texi l. 639) > *** Unknown node in menu entry `Functions and Variables for Units' (in > ./include-maxima.texi l. 640) > *** Unknown node in menu entry `Introduction to zeilberger' (in > ./include-maxima.texi l. 644) > *** Unknown node in menu entry `Functions and Variables for zeilberger' (in > ./include-maxima.texi l. 645) > *** Undefined node `Category: Help' in @ref (in ./Introduction.texi l. 194 in > category) > *** Unknown node in menu entry `Functions and Variables for Bug Detection and > Reporting' (in ./Bugs.texi l. 2) > *** Undefined node `Category: Debugging' in @ref (in ./Bugs.texi l. 53 in > category) > *** Undefined node `Category: Debugging' in @ref (in ./Bugs.texi l. 78 in > category) > *** Undefined node `Category: Global variables' in @ref (in ./Bugs.texi l. 78 > in category) > *** Undefined node `Category: Debugging' in @ref (in ./Bugs.texi l. 96 in > category) > *** Undefined node `Category: Debugging' in @ref (in ./Bugs.texi l. 110 in > category) > *** Unknown node in menu entry `Documentation' (in ./Help.texi l. 2) > *** Unknown node in menu entry `Functions and Variables for Help' (in > ./Help.texi l. 3) > ?. > > > *** Undefined node `Category: Package zeilberger' in @ref (in > ./zeilberger.texi l. 414 in category) > *** Undefined node `Category: Package zeilberger' in @ref (in > ./zeilberger.texi l. 426 in category) > *** Undefined node `Category: Package zeilberger' in @ref (in > ./zeilberger.texi l. 437 in category) > *** Undefined node `Category: Package zeilberger' in @ref (in > ./zeilberger.texi l. 449 in category) > + for f in '*.html' > + grep -q 'Category: .*' maxima.html > + '[' 1 = 0 ']' > + for f in '*.html' > + grep -q 'Category: .*' maxima_1.html > + '[' 1 = 0 ']' > + for f in '*.html' > + grep -q 'Category: .*' maxima_10.html > + '[' 1 = 0 ']' > + > ?. > > + for f in '*.html' > + grep -q 'Item: .*' maxima_toc.html > + '[' 1 = 0 ']' > + mv maxima.html maxima_1.html maxima_10.html maxima_100.html maxima_11.html > maxima_12.html maxima_13.html maxima_14.html maxima_15.html maxima_16.html > maxima_17.html maxima_18.html maxima_19.html maxima_2.html maxima_20.html > maxima_21.html maxima_22.html maxima_23.html maxima_24.html maxima_25.html > maxima_26.html maxima_27.html maxima_28.html maxima_29.html maxima_3.html > maxima_30.html maxima_31.html maxima_32.html maxima_33.html maxima_34.html > maxima_35.html maxima_36.html maxima_37.html maxima_38.html maxima_39.html > maxima_4.html maxima_40.html maxima_41.html maxima_42.html maxima_43.html > maxima_44.html maxima_45.html maxima_46.html maxima_47.html maxima_48.html > maxima_49.html maxima_5.html maxima_50.html maxima_51.html maxima_52.html > maxima_53.html maxima_54.html maxima_55.html maxima_56.html maxima_57.html > maxima_58.html maxima_59.html maxima_6.html maxima_60.html maxima_61.html > maxima_62.html maxima_63.html maxima_64.html maxima_65.html maxima_66.html > maxima_67.html maxima_68.html maxima_69.html maxima_7.html maxima_70.html > maxima_71.html maxima_72.html maxima_73.html maxima_74.html maxima_75.html > maxima_76.html maxima_77.html maxima_78.html maxima_79.html maxima_8.html > maxima_80.html maxima_81.html maxima_82.html maxima_83.html maxima_84.html > maxima_85.html maxima_86.html maxima_87.html maxima_88.html maxima_89.html > maxima_9.html maxima_90.html maxima_91.html maxima_92.html maxima_93.html > maxima_94.html maxima_95.html maxima_96.html maxima_97.html maxima_98.html > maxima_99.html maxima_abt.html maxima_fot.html maxima_ovr.html maxima_toc.html > /Users/michel/Documents/maxima/maxima-5.25.1/doc/info > + cd /Users/michel/Documents/maxima/maxima-5.25.1/doc/info > + set +x > perl ./create_index > > < end of the make html command > Most messages are generated from the building of the categories. I have always ignored all these messages. I have cut out the categories for the German manual, because the categories do not work for the German manual. Without the categories I get the following with the command `make html': dieter at dieter:~/Maxima/maxima/doc/info/de$ make html perl texi2html -split_chapter --lang=de --output=. --css-include=../manual.css --init-file ../texi2html.init maxima.texi *** Undefined node `iframe_flag' in @ref (in ./Itensor.de.texi l. 1254 in mref) *** Undefined node `vect_coords' in @ref (in ./Itensor.de.texi l. 1411 in mref) *** Undefined node `iframe_flag' in @ref (in ./Itensor.de.texi l. 1467 in mref) dieter at dieter:~/Maxima/maxima/doc/info/de$ At this time the definition of three nodes is missing. There are no more problems in the German manual. Without the categories in the English manual there are no problems too. Dieter Kaiser From woollett at charter.net Fri Nov 4 17:14:22 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 4 Nov 2011 15:14:22 -0700 Subject: [Maxima] Use of with_stdout inside function fails Message-ID: On Nov. 4, 2011, Richard Fateman wrote: ---------- >Some or perhaps all of these messages could be diverted or muffled on >setting on some flags. > >Possible categories: > >Emergency -- the program is going to quit. If you don't see this you >will be wondering what happened, so you can't muffle this. > >Requires response - e.g. the much disliked "is abc pos neg or >zero?" If you muffle this, the program cannot continuge. ----------------- Thanks for the dose of reality. If flags would allow selective surpression of some of the messages, that would be the best bet. The occasional need to ask the user sign etc questions is something I have been ignoring, and this unique feature of Maxima should be allowed to always be part of a call to integrate. I plan to abandon blanket surpression efforts as a waste of time. Ted From talon at lpthe.jussieu.fr Fri Nov 4 20:10:19 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sat, 5 Nov 2011 01:10:19 +0000 (UTC) Subject: [Maxima] Maxima html documentation References: <1320441074.1621.9.camel@dieter> Message-ID: Dieter Kaiser wrote: > Most messages are generated from the building of the categories. I have > always ignored all these messages. I have cut out the categories for the > German manual, because the categories do not work for the German manual. > Without the categories I get the following with the command `make html': > > dieter at dieter:~/Maxima/maxima/doc/info/de$ make html > perl texi2html -split_chapter --lang=de --output=. > --css-include=../manual.css --init-file ../texi2html.init maxima.texi > *** Undefined node `iframe_flag' in @ref (in ./Itensor.de.texi l. 1254 > in mref) > *** Undefined node `vect_coords' in @ref (in ./Itensor.de.texi l. 1411 > in mref) > *** Undefined node `iframe_flag' in @ref (in ./Itensor.de.texi l. 1467 > in mref) > dieter at dieter:~/Maxima/maxima/doc/info/de$ > > At this time the definition of three nodes is missing. There are no more > problems in the German manual. Without the categories in the English > manual there are no problems too. > Indeed all the messages are produced running the command sh extract_categories.sh maxima This is for a large part because the shell is marked to trace execution of commands, but of course there are errors. The first error is produced when filtering Affine.texi through various sed and awk filters. The following @deffn {Function} fast_linsolve ([@var{expr_1}, ..., @var{expr_m}], [@var{x_1}, ..., @var{x_n}]) is filtered incorrectly and gets verbatim in the python file tmp-make-categories.py which appears in a temporary directory. It thus begins like: categories = {} foo = [] for x in items: foo.append ([items[0], x]) try: categories ["Polynomials"] . extend (foo) except KeyError: categories ["Polynomials"] = foo foo = [] for x in items: foo.append ([items[0], x]) try: categories ["Groebner bases"] . extend (foo) except KeyError: categories ["Groebner bases"] = foo foo = [] for x in items: foo.append ([items[0], x]) try: categories ["Share packages"] . extend (foo) except KeyError: categories ["Share packages"] = foo foo = [] for x in items: foo.append ([items[0], x]) try: categories ["Package affine"] . extend (foo) except KeyError: categories ["Package affine"] = foo @deffn {Function} fast_linsolve ([@var{expr_1}, ..., @var{expr_m}], [@var{x_1}, ..., @var{x_n}]) ?.. The first statements are intended to enter the various categories in an associative array and are OK. But the @deffn if of course syntactically incorrect for python which stops immediately here. Then no categories are defined and all the rest of the scripts is bound to fail horribly. So to solve the problem one has to understand why the above line is not filtered by sed and awk like other lines are. How is it possible that it works on some installations, apparently? Perhaps a different version of sed and awk like gawk? The regular expressions here are too messy for my understanding at the moment. -- Michel Talon From ichikawa.yuji at gmail.com Fri Nov 4 21:44:12 2011 From: ichikawa.yuji at gmail.com (ICHIKAWA, Yuji) Date: Sat, 5 Nov 2011 11:44:12 +0900 Subject: [Maxima] Maxima html documentation In-Reply-To: References: <1320441074.1621.9.camel@dieter> Message-ID: <77433130-8AB0-4631-A904-4759EF85FEB2@gmail.com> Hi, On Mac, I am using gsed of MacPorts rather than /usr/bin/sed in extract_categories.sh and avoid the problems. I forgot the reason, I wonder some incompatibility about regular expression. By the way, if warnings of empty argument for @opencatbox and @closecatbox annoy you, you can add the following lines right after the line of python execution. -- # fixed warings about @opencatbox and @closecatbox for f in *.texi; do gsed 's/^@opencatbox/@opencatbox {}/; s/^@closecatbox/@closecatbox {}/' "$f" > tmp.texi mv tmp.texi "$f" done -- - ICHIKAWA, Yuji On 2011/11/05, at 10:10, Michel Talon wrote: > Dieter Kaiser wrote: >> Most messages are generated from the building of the categories. I have >> always ignored all these messages. I have cut out the categories for the >> German manual, because the categories do not work for the German manual. >> Without the categories I get the following with the command `make html': >> >> dieter at dieter:~/Maxima/maxima/doc/info/de$ make html >> perl texi2html -split_chapter --lang=de --output=. >> --css-include=../manual.css --init-file ../texi2html.init maxima.texi >> *** Undefined node `iframe_flag' in @ref (in ./Itensor.de.texi l. 1254 >> in mref) >> *** Undefined node `vect_coords' in @ref (in ./Itensor.de.texi l. 1411 >> in mref) >> *** Undefined node `iframe_flag' in @ref (in ./Itensor.de.texi l. 1467 >> in mref) >> dieter at dieter:~/Maxima/maxima/doc/info/de$ >> >> At this time the definition of three nodes is missing. There are no more >> problems in the German manual. Without the categories in the English >> manual there are no problems too. >> > > > Indeed all the messages are produced running the command > sh extract_categories.sh maxima > > This is for a large part because the shell is marked to trace execution of > commands, but of course there are errors. The first error is produced when > filtering Affine.texi through various sed and awk filters. > > The following > @deffn {Function} fast_linsolve ([@var{expr_1}, ..., @var{expr_m}], > [@var{x_1}, ..., @var{x_n}]) > > is filtered incorrectly and gets verbatim in the python file > tmp-make-categories.py which appears in a temporary directory. > > It thus begins like: > > categories = {} > > foo = [] > for x in items: foo.append ([items[0], x]) > try: categories ["Polynomials"] . extend (foo) > except KeyError: categories ["Polynomials"] = foo > > foo = [] > for x in items: foo.append ([items[0], x]) > try: categories ["Groebner bases"] . extend (foo) > except KeyError: categories ["Groebner bases"] = foo > > foo = [] > for x in items: foo.append ([items[0], x]) > try: categories ["Share packages"] . extend (foo) > except KeyError: categories ["Share packages"] = foo > > foo = [] > for x in items: foo.append ([items[0], x]) > try: categories ["Package affine"] . extend (foo) > except KeyError: categories ["Package affine"] = foo > > @deffn {Function} fast_linsolve ([@var{expr_1}, ..., @var{expr_m}], > [@var{x_1}, ..., @var{x_n}]) > > ?.. > > > The first statements are intended to enter the various categories in an > associative array and are OK. But the @deffn if of course syntactically > incorrect for python which stops immediately here. > > Then no categories are defined and all the rest of the scripts is bound to > fail horribly. > > So to solve the problem one has to understand why the above line is not > filtered by sed and awk like other lines are. How is it possible that it works > on some installations, apparently? Perhaps a different version of sed and awk > like gawk? The regular expressions here are too messy for my understanding at > the moment. > > > > -- > Michel Talon > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From davidblubaugh2000 at yahoo.com Sat Nov 5 00:03:41 2011 From: davidblubaugh2000 at yahoo.com (David Blubaugh) Date: Fri, 4 Nov 2011 22:03:41 -0700 (PDT) Subject: [Maxima] LISP Development Message-ID: <1320469421.15352.YahooMailClassic@web113301.mail.gq1.yahoo.com> I was wondering as to how one does lisp development within Maxima ?? ? Has anyone ever integrated ACL2 within MAXIMA ?? David Blubaugh -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sat Nov 5 01:46:23 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 04 Nov 2011 23:46:23 -0700 Subject: [Maxima] LISP Development In-Reply-To: <1320469421.15352.YahooMailClassic@web113301.mail.gq1.yahoo.com> References: <1320469421.15352.YahooMailClassic@web113301.mail.gq1.yahoo.com> Message-ID: <4EB4DBBF.9010801@gmail.com> On 11/4/11 10:03 PM, David Blubaugh wrote: > I was wondering as to how one does lisp development within Maxima ?? > Probably like doing lisp development anywhere else. I don't think of it as being different, just because it's maxima. What are you thinking of doing? > > Has anyone ever integrated ACL2 within MAXIMA ?? > Not that I know of. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From adammaj1 at o2.pl Sat Nov 5 03:14:03 2011 From: adammaj1 at o2.pl (Adam Majewski) Date: Sat, 05 Nov 2011 09:14:03 +0100 Subject: [Maxima] LISP Development In-Reply-To: <1320469421.15352.YahooMailClassic@web113301.mail.gq1.yahoo.com> References: <1320469421.15352.YahooMailClassic@web113301.mail.gq1.yahoo.com> Message-ID: On 05.11.2011 06:03, David Blubaugh wrote: > I was wondering as to how one does lisp development within Maxima ?? > Has anyone ever integrated ACL2 within MAXIMA ?? > David Blubaugh > > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima Hi, This is what I have found about connections between Lisp and Maxima : http://fraktal.republika.pl/maxima_lisp.html HTH Adam From talon at lpthe.jussieu.fr Sat Nov 5 03:55:23 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sat, 5 Nov 2011 08:55:23 +0000 (UTC) Subject: [Maxima] Maxima html documentation References: <1320441074.1621.9.camel@dieter> <1320441074.1621.9.camel@dieter> <77433130-8AB0-4631-A904-4759EF85FEB2@gmail.com> Message-ID: ICHIKAWA, Yuji wrote: > Hi, > > On Mac, I am using gsed of MacPorts rather than /usr/bin/sed in extract_categories.sh and avoid the problems. > I forgot the reason, I wonder some incompatibility about regular expression. > > > By the way, if warnings of empty argument for @opencatbox and @closecatbox annoy you, you can add the following lines right after the line of python execution. > Indeed i have just checked that the same problem occurs on FreeBSD, and that using gawk has no effect. So the problem is with sed, as you noted, one must use the gnu version. In Mac Os X it is the FreeBSD version. -- Michel Talon From talon at lpthe.jussieu.fr Sat Nov 5 04:25:41 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sat, 5 Nov 2011 09:25:41 +0000 (UTC) Subject: [Maxima] Maxima html documentation References: <1320441074.1621.9.camel@dieter> <1320441074.1621.9.camel@dieter> <77433130-8AB0-4631-A904-4759EF85FEB2@gmail.com> Message-ID: Michel Talon wrote: > ICHIKAWA, Yuji wrote: >> Hi, >> >> On Mac, I am using gsed of MacPorts rather than /usr/bin/sed in > extract_categories.sh and avoid the problems. >> I forgot the reason, I wonder some incompatibility about regular expression. >> >> >> By the way, if warnings of empty argument for @opencatbox and @closecatbox > annoy you, you can add the following lines right after the line of python > execution. >> > > Indeed i have just checked that the same problem occurs on FreeBSD, and that > using gawk has no effect. So the problem is with sed, as you noted, one must > use the gnu version. In Mac Os X it is the FreeBSD version. > In fact i have just done make html on a Linux box, here everything goes OK and in particular there is no error in python execution. The categories are correctly filled in the html files. I have simply overwrited the installed html files with the Linux ones. -- Michel Talon From O.Kullmann at swansea.ac.uk Sat Nov 5 05:04:23 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 5 Nov 2011 10:04:23 +0000 Subject: [Maxima] writefile does not write Message-ID: <20111105100423.GA18945@cs-wsok.swan.ac.uk> Hello, with Maxima 5.25.1 under Ecl 11.1.1 writefile creates an empty file upon being called, but then nothing happens, the file stays empty whatever happens (also after closefile). The facility of writefile would actually be very desired. Is there another command which achieves the effect? Perhaps something Ecl-specific could be written? (The motivation is the following: Again and again we are losing computations which already run for hours/days because of for example a laptop-crash when running remotely. The (Linux-)program screen unfortunately doesn't help --- again and again the connection is completely lost, no possibility to reconnect, while actually Maxima is still running. These computations most of the time emerge in an interactive session, so batchmode would be very inconvenient. If writefile would work, then this would solve the problem (and it could be automated, always on startup logging to a file with the timestamp in the name).) Thanks for your attention. Oliver From fateman at eecs.berkeley.edu Sat Nov 5 09:00:09 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 05 Nov 2011 07:00:09 -0700 Subject: [Maxima] LISP Development In-Reply-To: <4EB4DBBF.9010801@gmail.com> References: <1320469421.15352.YahooMailClassic@web113301.mail.gq1.yahoo.com> <4EB4DBBF.9010801@gmail.com> Message-ID: <4EB54169.2080208@eecs.berkeley.edu> On 11/4/2011 11:46 PM, Raymond Toy wrote: > On 11/4/11 10:03 PM, David Blubaugh wrote: >> I was wondering as to how one does lisp development within Maxima ?? >> > Probably like doing lisp development anywhere else. I don't think of > it as being different, just because it's maxima. What are you > thinking of doing? >> >> Has anyone ever integrated ACL2 within MAXIMA ?? >> > > Not that I know of. > > Ray > Since Bill Schelter was interested in ACL2 and Macsyma both, and tuned Kyoto Common Lisp into Austin-Kyoto Common Lisp (which became GCL), and Austin is geographical home for ACL, I would expect that at least one of the lisps under Maxima (GCL) would run ACL2 with little or no change. Since Maxima and ACL2 deal with different kinds of objects, ordinarily, "integrating" them would require some thought. I too don't know of anyone who has done it. RJF -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sat Nov 5 10:38:16 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 05 Nov 2011 08:38:16 -0700 Subject: [Maxima] writefile does not write In-Reply-To: <20111105100423.GA18945@cs-wsok.swan.ac.uk> References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> Message-ID: <4EB55868.6060905@gmail.com> On 11/5/11 3:04 AM, Oliver Kullmann wrote: > Hello, > > with Maxima 5.25.1 under Ecl 11.1.1 writefile creates an empty file > upon being called, but then nothing happens, the file stays empty > whatever happens (also after closefile). > > The facility of writefile would actually be very desired. > Is there another command which achieves the effect? Perhaps > something Ecl-specific could be written? Sounds like a bug in ecl. I did a very quick test with writefile using maxima and cmucl. The output file is not empty. Ray From robert.dodier at gmail.com Sat Nov 5 12:05:10 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 5 Nov 2011 11:05:10 -0600 Subject: [Maxima] writefile does not write In-Reply-To: <4EB55868.6060905@gmail.com> References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <4EB55868.6060905@gmail.com> Message-ID: On 11/5/11, Raymond Toy wrote: > Sounds like a bug in ecl. I did a very quick test with writefile using > maxima and cmucl. The output file is not empty. I just tried (dribble "/tmp/foo.log") in ECL 11.1.1 (Ubuntu) and it puts nothing into the file. (Maxima writefile punts to dribble iirc.) Actually iirc that behavior is conformant with the CL spec, which doesn't require that DRIBBLE do anything at all iirc. Be that as it may, it would certainly be useful if it did something. best Robert Dodier From maxima at etherjones.us Sat Nov 5 12:20:21 2011 From: maxima at etherjones.us (Ether Jones) Date: Sat, 5 Nov 2011 10:20:21 -0700 (PDT) Subject: [Maxima] does a searchable database of this mailing list exist? Message-ID: <1320513621.99445.YahooMailNeo@web161802.mail.bf1.yahoo.com> Are all of the posts to this mailing list stored on a server somewhere? Are they in a database that can be searched by posting date, author, subject, and body, using boolean logic? Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From O.Kullmann at swansea.ac.uk Sat Nov 5 12:28:26 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 5 Nov 2011 17:28:26 +0000 Subject: [Maxima] writefile does not write In-Reply-To: References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <4EB55868.6060905@gmail.com> Message-ID: <20111105172826.GD18945@cs-wsok.swan.ac.uk> I definitely don't know much (at all) about the Lisp standard, but the only information I could find which sounds like a standard is http://www.lispworks.com/documentation/HyperSpec/Body/f_dribbl.htm and there it says Either binds *standard-input* and *standard-output* or takes other appropriate action, so as to send a record of the input/output interaction to a file named by pathname. dribble is intended to create a readable record of an interactive session. This is vagues, but it says "takes appropriate action", which should be something. Oliver On Sat, Nov 05, 2011 at 11:05:10AM -0600, Robert Dodier wrote: > On 11/5/11, Raymond Toy wrote: > > > Sounds like a bug in ecl. I did a very quick test with writefile using > > maxima and cmucl. The output file is not empty. > > I just tried (dribble "/tmp/foo.log") in ECL 11.1.1 (Ubuntu) and > it puts nothing into the file. (Maxima writefile punts to dribble iirc.) > > Actually iirc that behavior is conformant with the CL spec, > which doesn't require that DRIBBLE do anything at all iirc. > Be that as it may, it would certainly be useful if it did something. > > best > From drdieterkaiser at web.de Sat Nov 5 14:22:07 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 05 Nov 2011 20:22:07 +0100 Subject: [Maxima] writefile does not write In-Reply-To: <20111105172826.GD18945@cs-wsok.swan.ac.uk> References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <4EB55868.6060905@gmail.com> <20111105172826.GD18945@cs-wsok.swan.ac.uk> Message-ID: <1320520927.18661.3.camel@dieter> Am Samstag, den 05.11.2011, 17:28 +0000 schrieb Oliver Kullmann: > I definitely don't know much (at all) about the Lisp standard, > but the only information I could find which sounds like a standard is > > http://www.lispworks.com/documentation/HyperSpec/Body/f_dribbl.htm > > and there it says > > Either binds *standard-input* and *standard-output* or takes other appropriate action, so as to send a record of the input/output interaction to a file named by pathname. dribble is intended to create a readable record of an interactive session. > > This is vagues, but it says "takes appropriate action", which should > be something. > > Oliver Maxima has an alternative function with the name appendfile. It works like the function writefile, but does not use the underlying Lisp function dribble. Dieter Kaiser From O.Kullmann at swansea.ac.uk Sat Nov 5 14:44:23 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 5 Nov 2011 19:44:23 +0000 Subject: [Maxima] writefile does not write In-Reply-To: <1320520927.18661.3.camel@dieter> References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <4EB55868.6060905@gmail.com> <20111105172826.GD18945@cs-wsok.swan.ac.uk> <1320520927.18661.3.camel@dieter> Message-ID: <20111105194423.GE18945@cs-wsok.swan.ac.uk> > Maxima has an alternative function with the name appendfile. It works > like the function writefile, but does not use the underlying Lisp > function dribble. > > Dieter Kaiser > Apparently it uses dribble (and also nothing is written to file): (%i3) appendfile("Test.log"); /* Starts dribbling to Test.log (2011/11/5, 20:40:47).*/ some stuff ... (%i6) closefile(); /*Finished dribbling to Test.log.*/ Still Test.log is empty. Oliver From drdieterkaiser at web.de Sat Nov 5 15:07:09 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 05 Nov 2011 21:07:09 +0100 Subject: [Maxima] writefile does not write In-Reply-To: <20111105194423.GE18945@cs-wsok.swan.ac.uk> References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <4EB55868.6060905@gmail.com> <20111105172826.GD18945@cs-wsok.swan.ac.uk> <1320520927.18661.3.camel@dieter> <20111105194423.GE18945@cs-wsok.swan.ac.uk> Message-ID: <1320523629.18661.22.camel@dieter> Am Samstag, den 05.11.2011, 19:44 +0000 schrieb Oliver Kullmann: > > Maxima has an alternative function with the name appendfile. It works > > like the function writefile, but does not use the underlying Lisp > > function dribble. > > > > Dieter Kaiser > > > > Apparently it uses dribble (and also nothing is written to file): > (%i3) appendfile("Test.log"); > /* Starts dribbling to Test.log (2011/11/5, 20:40:47).*/ > some stuff ... > > (%i6) closefile(); > /*Finished dribbling to Test.log.*/ > > Still Test.log is empty. > > Oliver The following is the implementation of the Maxima function appendfile. There is no call to the Lisp function dribble. The message comes from the function itself. appendfile opens a two-way-stream. The function closefile checks if the dribble file was opened by Lisp dribble or the Maxima function appendfile and closes the file accordingly. But you are right I do not get an output on my system with Linux and SBCL. The function appendfile seems not to work. (defmfun $appendfile (name) (if (and (symbolp name) (member (char (symbol-name name) 0) '(#\$) :test #'char=)) (setq name (maxima-string name))) (if $appendfile (merror (intl:gettext "appendfile: already in appendfile, you must call closefile first."))) (let ((stream (open name :direction :output :if-exists :append :if-does-not-exist :create))) (setq *appendfile-data* (list stream *terminal-io* name)) (setq $appendfile (make-two-way-stream (make-echo-stream *terminal-io* stream) (make-broadcast-stream *terminal-io* stream)) *terminal-io* $appendfile) (multiple-value-bind (sec min hour day month year) (get-decoded-time) (format t (intl:gettext "~&/* Starts dribbling to ~A (~d/~d/~d, ~d:~d:~d).*/~&") name year month day hour min sec)) '$done)) Dieter Kaiser From robert.dodier at gmail.com Sat Nov 5 15:30:01 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 5 Nov 2011 14:30:01 -0600 Subject: [Maxima] does a searchable database of this mailing list exist? In-Reply-To: <1320513621.99445.YahooMailNeo@web161802.mail.bf1.yahoo.com> References: <1320513621.99445.YahooMailNeo@web161802.mail.bf1.yahoo.com> Message-ID: On 11/5/11, Ether Jones wrote: > > > Are all of the posts to this mailing list stored on a server somewhere? > > Are they in a database that can be searched by posting date, author, > subject, and body, using boolean logic? Well, it's not searchable but there is an archive of messages which you can find from: http://maxima.sourceforge.net/maximalist.html if I remember correctly. best Robert From O.Kullmann at swansea.ac.uk Sat Nov 5 17:08:14 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 5 Nov 2011 22:08:14 +0000 Subject: [Maxima] [Ecls-list] writefile does not write In-Reply-To: References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <4EB55868.6060905@gmail.com> Message-ID: <20111105220814.GF18945@cs-wsok.swan.ac.uk> > > I just tried (dribble "/tmp/foo.log") in ECL 11.1.1 (Ubuntu) and > > it puts nothing into the file. (Maxima writefile punts to dribble iirc.) > > > > ECL used to bind the wrong variable. This was fixed a few months ago in > CVS/git. > > Juanjo > I have pulled Ecl via > ADDRESS=anonymous at ecls.cvs.sourceforge.net:/cvsroot/ecls > cvs -z3 -d:pserver:$ADDRESS checkout ecl compiled it, and built Maxima with it, however nothing changed: writefile still just creates the empty file, and otherwise nothing happens. Oliver From woollett at charter.net Sat Nov 5 18:14:59 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 5 Nov 2011 16:14:59 -0700 Subject: [Maxima] Comparison of quad_qag with bessel functions using integer or float orders Message-ID: We compare using integer order with using float order for the realpart (bessel_u (n,x)) and the imagpart (bessel_u (n,x)) for u = j, i, k, and y, when using quag_qag. ------------------------- case bessel_j(0,z): can use either integer or float for realpart(bessel_j(0,z)), for z = x or %i*x imagpart(bessel_j(0,z)), for z = x or %i*x -------------------------------- case bessel_j(1,z): can use either integer or float for realpart(bessel_j(1,z)) for z = x or %i*x but not for imagpart: arg x: (yes,yes) (%i110) quad_qag(imagpart(bessel_j(1,x)),x,0,3,3,limit=700); (%o110) [0.0,0.0,31,0] (%i111) quad_qag(imagpart(bessel_j(1.0,x)),x,0,3,3,limit=700); (%o111) [0.0,0.0,31,0] arg %i*x: (no,yes) (%i112) quad_qag(imagpart(bessel_j(1,%i*x)),x,0,3,3,limit=700); (%o112) quad_qag(bessel_j(1,%i*x),x,0,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) (%i113) quad_qag(imagpart(bessel_j(1.0,%i*x)),x,0,3,3,limit=700); (%o113) [3.880792585865024,4.3085452826219503E-14,31,0] ------------------------------- case bessel_j(2,z): can use either integer or float for realpart(bessel_j(2,z)), for z = x or %i*x or for imagpart(bessel_j(2,z)), for z = x or %i*x ------------------------------ case bessel_j(3,z) can use either integer or float for realpart(bessel_j(3,z)) for z = x or %i*x but not for imagpart: arg x: (yes,yes) (%i126) quad_qag(imagpart(bessel_j(3,x)),x,0,3,3,limit=700); (%o126) [0.0,0.0,31,0] (%i127) quad_qag(imagpart(bessel_j(3.0,x)),x,0,3,3,limit=700); (%o127) [0.0,0.0,31,0] arg %i*x: (no,yes) (%i128) quad_qag(imagpart(bessel_j(3,%i*x)),x,0,3,3,limit=700); (%o128) quad_qag(bessel_j(3,%i*x),x,0,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) (%i129) quad_qag(imagpart(bessel_j(3.0,%i*x)),x,0,3,3,limit=700); (%o129) [-0.60963229599488,6.7682781156861259E-15,31,0] --------------------------------------------- ================================ ============================== bessel_i(n,z) comparison of integer or float ------------------------------------------- case bessel_i(0,z) (yes,yes), (yes,no), (no,yes) realpart (yes,yes) and (no,yes) arg x: (yes,yes) (%i45) quad_qag(realpart(bessel_i(0,x)),x,0,3,3,limit=700); (%o45) [6.160961491502393,6.8400413016949048E-14,31,0] (%i48) quad_qag(realpart(bessel_i(0.0,x)),x,0,3,3,limit=700); (%o48) [6.160961491502393,6.8400413016949048E-14,31,0] arg %i*x: (no,yes) (%i46) quad_qag(realpart(bessel_i(0,%i*x)),x,0,3,3,limit=700); (%o46) quad_qag(bessel_i(0,%i*x),x,0,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) (%i47) quad_qag(realpart(bessel_i(0.0,%i*x)),x,0,3,3,limit=700); (%o47) [1.387567252009865,1.7248014181203231E-14,31,0] imagpart (yes,yes) and (yes,no) arg x: (yes,yes) (%i49) quad_qag(imagpart(bessel_i(0,x)),x,0,3,3,limit=700); (%o49) [0.0,0.0,31,0] (%i50) quad_qag(imagpart(bessel_i(0.0,x)),x,0,3,3,limit=700); (%o50) [0.0,0.0,31,0] arg %i*x (yes, no and hangs) (%i51) quad_qag(imagpart(bessel_i(0,%i*x)),x,0,3,3,limit=700); (%o51) [0.0,0.0,31,0] (%i52) quad_qag(imagpart(bessel_i(0.0,%i*x)),x,0,3,3,limit=700); (%o52) quad_qag('imagpart(bessel_i(0.0,%i*x)),x,0,3,3,epsrel = 1.0E-8, epsabs = 0.0,limit = 700) (had to use ctrl-g to end hang on last one) ----------------------------------------------- case bessel_i(1,z) (yes,yes), (yes,no) and (no,yes) realpart (yes,yes) and (yes,no) arg x: (yes,yes) (%i53) quad_qag(realpart(bessel_i(1,x)),x,0,3,3,limit=700); (%o53) [3.880792585865024,4.3085452826219503E-14,31,0] (%i54) quad_qag(realpart(bessel_i(1.0,x)),x,0,3,3,limit=700); (%o54) [3.880792585865024,4.3085452826219503E-14,31,0] arg %i*x (yes, no and hangs) (%i55) quad_qag(realpart(bessel_i(1,%i*x)),x,0,3,3,limit=700); (%o55) [0.0,0.0,31,0] (%i56) quad_qag(realpart(bessel_i(1.0,%i*x)),x,0,3,3,limit=700); (%o56) quad_qag('realpart(bessel_i(1.0,%i*x)),x,0,3,3,epsrel = 1.0E-8, epsabs = 0.0,limit = 700) (had to use ctrl-g to escape last one) imagpart (yes,yes) and (no,yes) arg x :(yes,yes) (%i57) quad_qag(imagpart(bessel_i(1,x)),x,0,3,3,limit=700); (%o57) [0.0,0.0,31,0] (%i58) quad_qag(imagpart(bessel_i(1.0,x)),x,0,3,3,limit=700); (%o58) [0.0,0.0,31,0] arg %i*x: (no,yes) (%i59) quad_qag(imagpart(bessel_i(1,%i*x)),x,0,3,3,limit=700); (%o59) quad_qag(bessel_i(1,%i*x),x,0,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) (%i60) quad_qag(imagpart(bessel_i(1.0,%i*x)),x,0,3,3,limit=700); (%o60) [1.260051954901933,1.3989386925560662E-14,31,0] ------------------------------------------- case bessel_i(2,z) (yes,yes) and (no,yes) can use either integer or float for imagpart(bessel_j(1,z)) for z = x or %i*x but not for realpart: arg x: (yes,yes) (%i61) quad_qag(realpart(bessel_i(2,x)),x,0,3,3,limit=700); (%o61) [1.745778943302825,1.9382039787605724E-14,31,0] (%i62) quad_qag(realpart(bessel_i(2.0,x)),x,0,3,3,limit=700); (%o62) [1.745778943302825,1.9382039787605724E-14,31,0] arg %i*x: (no, yes) (%i63) quad_qag(realpart(bessel_i(2,%i*x)),x,0,3,3,limit=700); (%o63) quad_qag(bessel_i(2,%i*x),x,0,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) (%i64) quad_qag(realpart(bessel_i(2.0,%i*x)),x,0,3,3,limit=700); (%o64) [-0.70944933495799,7.8764698647536805E-15,31,0] ----------------------------------- case bessel_i(3,z) can use either integer or float for realpart(bessel_j(1,z)) for z = x or %i*x but not for imagpart: arg x: (yes,yes) (%i73) quad_qag(imagpart(bessel_i(3,x)),x,0,3,3,limit=700); (%o73) [0.0,0.0,31,0] (%i74) quad_qag(imagpart(bessel_i(3.0,x)),x,0,3,3,limit=700); (%o74) [0.0,0.0,31,0] arg %i*x (no,yes) (%i75) quad_qag(imagpart(bessel_i(3,%i*x)),x,0,3,3,limit=700); (%o75) quad_qag(bessel_i(3,%i*x),x,0,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) (%i76) quad_qag(imagpart(bessel_i(3.0,%i*x)),x,0,3,3,limit=700); (%o76) [-0.28786943373015,3.1959927341301972E-15,31,0] ----------------------------------------------- case bessel_i(4,z) can use either integer or float for imagpart(bessel_j(1,z)) for z = x or %i*x but not for realpart: arg x: (yes,yes) (%i130) quad_qag(realpart(bessel_i(4,x)),x,0,3,3,limit=700); (%o130) [0.17372831568919,1.9287717610748791E-15,31,0] (%i131) quad_qag(realpart(bessel_i(4.0,x)),x,0,3,3,limit=700); (%o131) [0.17372831568919,1.9287717610748791E-15,31,0] arg %i*x: (no,yes) (%i132) quad_qag(realpart(bessel_i(4,%i*x)),x,0,3,3,limit=700); (%o132) quad_qag(bessel_i(4,%i*x),x,0,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) (%i133) quad_qag(realpart(bessel_i(4.0,%i*x)),x,0,3,3,limit=700); (%o133) [0.091323890447489,1.0138988587314746E-15,31,0] ================================ ================================== bessel_k and bessel_y (for examples tested) work equally well with either integer or float orders. ===================== Ted Woollett From dstout at hawaii.edu Sat Nov 5 19:08:47 2011 From: dstout at hawaii.edu (David R Stoutemyer) Date: Sat, 05 Nov 2011 14:08:47 -1000 Subject: [Maxima] op(box(x)) --> box, but is(op(box(x)) = box) --> false. Message-ID: op(box(x)) --> box, but is(op(box(x)) = box) --> false. Also is(op(box(x)) = 'box) --> false, and is(op(box(x)) = "box") --> false. How can I programmatically detect that op(expression) is box? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dstout at hawaii.edu Sat Nov 5 19:10:12 2011 From: dstout at hawaii.edu (David R Stoutemyer) Date: Sat, 05 Nov 2011 14:10:12 -1000 Subject: [Maxima] op(box(x)) --> box, but is(op(box(x)) = box) --> false. Message-ID: op(box(x)) --> box, but is(op(box(x)) = box) --> false. Also is(op(box(x)) = 'box) --> false, and is(op(box(x)) = "box") --> false. How can I programmatically detect that op(expression) is box? From O.Kullmann at swansea.ac.uk Sat Nov 5 19:27:05 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 6 Nov 2011 00:27:05 +0000 Subject: [Maxima] [Ecls-list] writefile does not write In-Reply-To: References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <4EB55868.6060905@gmail.com> <20111105220814.GF18945@cs-wsok.swan.ac.uk> Message-ID: <20111106002705.GG18945@cs-wsok.swan.ac.uk> On Sat, Nov 05, 2011 at 11:13:04PM +0100, Juan Jose Garcia-Ripoll wrote: > On Sat, Nov 5, 2011 at 11:08 PM, Oliver Kullmann > wrote: > > > > > compiled it, and built Maxima with it, however nothing changed: > > writefile still just creates the empty file, and otherwise nothing > > happens. > > > Please understand that my email was not an answer of whatever writefile > problem there is, but rather to the first email stating the problem with > dribble. All I got is that email in a conversation that apparently was > already going on but where all I could see is a discussion about dribble. > > If the problem is stated better, then I might feel motivated to have a look > at it, but cross-posting to a different list in the middle of a > conversation leads to insatisfactory answers for everybody, typically. > > BTW, I am _not_ subscribed to the maxima mailing list. > The problem is that writefile() in Maxima does not work (just creates an empty file, and never writes to it) under Ecl (now also using the newest version from cvs), while it works for example with CLisp. And writefile uses (apparently) dribble(). Now actually dribble works with the newest Ecl (while it doesn't work with an older form of 11.1.1). As you said, that problems seems fixed. Still, Maxima gets dribble working with writefile under CLisp, not under Ecl? However, since dribble works with the newest form of Ecl, perhaps the problem is with Maxima? Oliver From O.Kullmann at swansea.ac.uk Sat Nov 5 19:37:58 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 6 Nov 2011 00:37:58 +0000 Subject: [Maxima] [Ecls-list] writefile does not write In-Reply-To: <20111106002705.GG18945@cs-wsok.swan.ac.uk> References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <4EB55868.6060905@gmail.com> <20111105220814.GF18945@cs-wsok.swan.ac.uk> <20111106002705.GG18945@cs-wsok.swan.ac.uk> Message-ID: <20111106003758.GA21391@cs-wsok.swan.ac.uk> > > The problem is that writefile() in Maxima does not work (just creates an > empty file, and never writes to it) under Ecl (now also > using the newest version from cvs), while it works for example with CLisp. > And writefile uses (apparently) dribble(). > Here is the definition of writefile (in macsys.lisp): (defmfun $writefile (x) (let ((msg (dribble (maxima-string x)))) (format t "~&~A~&" msg) '$done)) And closefile: (defmfun $closefile () (cond ($appendfile (cond ((eq $appendfile *terminal-io*) (format t (intl:gettext "~&/*Finished dribbling to ~A.*/~&") (nth 2 *appendfile-data*)) (setq *terminal-io* (nth 1 *appendfile-data*))) (t (warn "*TERMINAL-IO* was rebound while APPENDFILE is on.~%~ You may miss some dribble output."))) (close (nth 0 *appendfile-data*)) (setq *appendfile-data* nil $appendfile nil)) (t (let ((msg (dribble))) (format t "~&~A~&" msg)))) '$done) Don't know why this works with CLisp but not with Ecl. Oliver From willisb at unk.edu Sat Nov 5 19:56:13 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 5 Nov 2011 19:56:13 -0500 Subject: [Maxima] op(box(x)) --> box, but is(op(box(x)) = box) --> false. In-Reply-To: References: Message-ID: It's a bug: (%i13) ?print(op(box(x))); MBOX (%o13) box A workaround: (%i14) :lisp(defun $boxp (x) (and (consp x) (consp (car x)) (eq 'mbox (caar x)))) $BOXP (%i14) boxp(box(x)); (%o14) true --Barton -----maxima-bounces at math.utexas.edu wrote: ----- To: maxima at math.utexas.edu From: David R Stoutemyer Sent by: maxima-bounces at math.utexas.edu Date: 11/05/2011 07:10PM Subject: [Maxima] op(box(x)) --> box, but is(op(box(x)) = box) --> false. op(box(x)) --> box, but is(op(box(x)) = box) --> false. ? Also is(op(box(x)) = 'box) --> false, and is(op(box(x)) = "box") --> false. ? How can I programmatically detect that op(expression) is box? _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From O.Kullmann at swansea.ac.uk Sat Nov 5 19:57:58 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 6 Nov 2011 00:57:58 +0000 Subject: [Maxima] [Ecls-list] writefile does not write In-Reply-To: <20111106003758.GA21391@cs-wsok.swan.ac.uk> References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <4EB55868.6060905@gmail.com> <20111105220814.GF18945@cs-wsok.swan.ac.uk> <20111106002705.GG18945@cs-wsok.swan.ac.uk> <20111106003758.GA21391@cs-wsok.swan.ac.uk> Message-ID: <20111106005758.GB21391@cs-wsok.swan.ac.uk> Perhaps the problem is just what http://www.lispworks.com/documentation/HyperSpec/Body/f_dribbl.htm says at the bottom: dribble is intended primarily for interactive debugging; its effect cannot be relied upon when used in a program. So that dribble does work with the Ecl command-line doesn't mean that it will work with the Maxima command-line, I guess (and I guess that was what Robert said at the beginning). Oliver On Sun, Nov 06, 2011 at 12:37:58AM +0000, Oliver Kullmann wrote: > > > > The problem is that writefile() in Maxima does not work (just creates an > > empty file, and never writes to it) under Ecl (now also > > using the newest version from cvs), while it works for example with CLisp. > > And writefile uses (apparently) dribble(). > > > Here is the definition of writefile (in macsys.lisp): > > (defmfun $writefile (x) > (let ((msg (dribble (maxima-string x)))) > (format t "~&~A~&" msg) > '$done)) > > Don't know why this works with CLisp but not with Ecl. > From fateman at eecs.berkeley.edu Sat Nov 5 21:40:55 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sat, 05 Nov 2011 19:40:55 -0700 Subject: [Maxima] op(box(x)) --> box, but is(op(box(x)) = box) --> false. In-Reply-To: References: Message-ID: <4EB5F3B7.7000204@eecs.berkeley.edu> On 11/5/2011 5:10 PM, David R Stoutemyer wrote: > op(box(x)) --> box, but is(op(box(x)) = box) --> false. > > Also is(op(box(x)) = 'box) --> false, > and is(op(box(x)) = "box") --> false. > > How can I programmatically detect that op(expression) is box? > _______________________________________________ > try is(op(box(x))=?mbox) RJF From willisb at unk.edu Sun Nov 6 04:39:39 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 6 Nov 2011 04:39:39 -0600 Subject: [Maxima] op(box(x)) --> box, but is(op(box(x)) = box) --> false. In-Reply-To: <4EB5F3B7.7000204@eecs.berkeley.edu> References: <4EB5F3B7.7000204@eecs.berkeley.edu>, Message-ID: My boxp function returns false for all CRE inputs; Richard's is(op(box(x))=?mbox) should work correctly for a CRE input. You could do :lisp(setf (get 'mbox 'op) '$box) Then is(op(box(x))='box) --> true and is(op(rat(box(x)))='box) --> true. --Barton -----maxima-bounces at math.utexas.edu wrote: ----- try is(op(box(x))=?mbox) RJF From macrakis at alum.mit.edu Sun Nov 6 12:01:27 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 6 Nov 2011 13:01:27 -0500 Subject: [Maxima] does a searchable database of this mailing list exist? In-Reply-To: References: <1320513621.99445.YahooMailNeo@web161802.mail.bf1.yahoo.com> Message-ID: > On 11/5/11, Ether Jones wrote: >> Are all of the posts to this mailing list stored on a server somewhere? http://www.math.utexas.edu/pipermail/maxima/ >> Are they in a database that can be searched by posting date, author, >> subject, and body, using boolean logic? On Google, use [site:www.math.utexas.edu/pipermail/maxima/ TOPIC], e.g. postings about gfactor. This is not a fancy parametric search, but regular Google keyword search which of course supports AND/OR/NOT, e.g. [site: www.math.utexas.edu/pipermail/maxima/ (factor OR gfactor) -integrate] finds postings which mention factor or gfactor, but not integrate . To search by date, I do *not* recommend Google's date searching feature, which seems to over-restrict the result set. But adding a year to the search can be helpful, e.g. [site:www.math.utexas.edu/pipermail/maxima/TOPIC 2011] or [site: www.math.utexas.edu/pipermail/maxima/ TOPIC 2011 OR 2010]. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Nov 6 12:07:46 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 6 Nov 2011 13:07:46 -0500 Subject: [Maxima] op(box(x)) --> box, but is(op(box(x)) = box) --> false. In-Reply-To: References: <4EB5F3B7.7000204@eecs.berkeley.edu> Message-ID: The most obvious (and I think simplest) way to do this is: boxop: op(box(x))$ is(op(...)=boxop); But I agree that this is a bug. -s On Sun, Nov 6, 2011 at 05:39, Barton Willis wrote: > My boxp function returns false for all CRE inputs; Richard's > is(op(box(x))=?mbox) should work correctly for > a CRE input. You could do > > :lisp(setf (get 'mbox 'op) '$box) > > Then is(op(box(x))='box) --> true and is(op(rat(box(x)))='box) --> true. > > --Barton > > -----maxima-bounces at math.utexas.edu wrote: ----- > > try is(op(box(x))=?mbox) > > 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 O.Kullmann at swansea.ac.uk Sun Nov 6 16:22:31 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 6 Nov 2011 22:22:31 +0000 Subject: [Maxima] [Ecls-list] writefile does not write In-Reply-To: References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <4EB55868.6060905@gmail.com> <20111105220814.GF18945@cs-wsok.swan.ac.uk> <20111106002705.GG18945@cs-wsok.swan.ac.uk> <20111106003758.GA21391@cs-wsok.swan.ac.uk> Message-ID: <20111106222231.GB32071@cs-wsok.swan.ac.uk> Hello, I have now again pulled the latest Ecl from CVS, and built with it Maxima 5.22.1, 5.23.2, 5.25.1, using it in plain vanilla form, via rmaxima, and using my initialisation file, and in all nine cases always the same: the file is opened correctly (path is handled correctly), and never anything is written into it. For example: kullmann-0:bin> ./maxima ;;; Loading #P"/home/kullmann/OKplatform/ExternalSources/Installations/Ecl/11.1.1.2/lib/ecl-11.1.1/sb-bsd-sockets.fas" ;;; Loading #P"/home/kullmann/OKplatform/ExternalSources/Installations/Ecl/11.1.1.2/lib/ecl-11.1.1/sockets.fas" ;;; Loading #P"/home/kullmann/OKplatform/ExternalSources/Installations/Ecl/11.1.1.2/lib/ecl-11.1.1/defsystem.fas" ;;; Loading #P"/home/kullmann/OKplatform/ExternalSources/Installations/Ecl/11.1.1.2/lib/ecl-11.1.1/cmp.fas" Maxima 5.23.2 http://maxima.sourceforge.net using Lisp ECL 11.1.1 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) writefile("Test.log"); Starts dribbling to Test.log (2011/11/6, 23:11:37). NIL Evaluation took 0.0000 seconds (0.0340 elapsed) (%o1) done (%i2) 10!; Evaluation took 0.0000 seconds (0.0000 elapsed) (%o2) 3628800 (%i3) closefile(); Finished dribbling to Test.log. NIL Evaluation took 0.0000 seconds (0.0000 elapsed) (%o3) done (%i4) kullmann-0:bin> cat Test.log [EMPTY] Ecl built with gcc 4.5.3, Linux version > uname -a Linux csltok.swansea.ac.uk 2.6.39.3-0.5-desktop #1 SMP PREEMPT Sun Jul 31 02:04:11 BST 2011 x86_64 x86_64 x86_64 GNU/Linux ?? > $ ./maxima-local > ;;; Loading #P"/Users/jjgarcia/lib/ecl-11.1.1/sb-bsd-sockets.fas" > ;;; Loading #P"/Users/jjgarcia/lib/ecl-11.1.1/sockets.fas" > ;;; Loading #P"/Users/jjgarcia/lib/ecl-11.1.1/defsystem.fas" > ;;; Loading #P"/Users/jjgarcia/lib/ecl-11.1.1/cmp.fas" > Maxima 5.23post http://maxima.sourceforge.net > using Lisp ECL 11.1.1 > 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) writefile("~/foo.log"); > > Starts dribbling to /Users/jjgarcia/foo.log (2011/11/6, 9:55:42). > NIL > (%o1) done > (%i2) 3 > 4 > > stdin:3393291:incorrect syntax: 4 is not an infix operator > (%i2) 4; > > (%o2) 4 > (%i3) 5; > > (%o3) 5 > (%i4) closefile(); > > NIL > (%o4) done Until here looks as above (except that 5.23post was as far as I remember just an intermediate version; but I don't believe that's important). > (%i5) $ cat ~/foo.log > > Starts dribbling to /Users/jjgarcia/foo.log (2011/11/6, 9:55:42). > NIL > (%o1) done > (%i2) > stdin:3393291:incorrect syntax: 4 is not an infix operator > (%i2) > (%o2) 4 > (%i3) > (%o3) 5 > (%i4) > Finished dribbling to /Users/jjgarcia/foo.log.$ Here now there is just nothing. Do you have a 32-bit machine? ?? Oliver From rswarbrick at gmail.com Sun Nov 6 16:34:59 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Sun, 06 Nov 2011 22:34:59 +0000 Subject: [Maxima] does a searchable database of this mailing list exist? References: <1320513621.99445.YahooMailNeo@web161802.mail.bf1.yahoo.com> Message-ID: Ether Jones writes: > Are all of the posts to this mailing list stored on a server somewhere? > > Are they in a database that can be searched by posting date, author, > subject, and body, using boolean logic? > > Thank you. I'm surprised neither response you've had mentioned gmane. See here: http://dir.gmane.org/gmane.comp.mathematics.maxima.general If you want a description of how to do structured searches, see http://search.gmane.org/ 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 Sun Nov 6 16:36:03 2011 From: woollett at charter.net (Edwin Woollett) Date: Sun, 6 Nov 2011 14:36:03 -0800 Subject: [Maxima] Comparison of quad_qag with bessel functions using integer or float orders Message-ID: On Nov. 5, 2011, I wrote: ------------------ >We compare using integer order with using >float order for the realpart (bessel_u (n,x)) and >the imagpart (bessel_u (n,x)) for u = j, i, k, and y, > when using quag_qag. -------------------------- The motivation is to know ahead of time that we can use either integer or float orders for all our bessel functions. At present, we cannot, depending on the particular bessel function and order, and arg. The test reported Nov. 5 was based on the Windows binary 5.25.1gcl, without adding the improved bessel.lisp which I downloaded from git Oct. 29. That Nov. 4 test showed that bessel_y and bessel_k didn't care about how the integral order value was supplied, but both bessel_j and bessel_i cared, in some cases, when the arg was %i*x. Loading in the new bessel.lisp cures the two cases found for bessel_j, but does not cure the seven cases found for bessel_i. Let's use the simplified notation: RP(b_u( n,z)) means realpart(bessel_u(n,z)) IP (b_u (n,z)) means imagpart (bessel_u (n,z)) I x means %i*x =========================== We summarize the status first for the bessel_j cases. 1. IP (b_j (1,I x)) is cured by new bessel.lisp (%i50) quad_qag(imagpart(bessel_j(1,%i*x)),x,0,3,3,limit=700); (%o50) [3.880792585865024,4.3085452826219503E-14,31,0] (%i51) float(imagpart(bessel_j(1,%i*2))); (%o51) 1.590636854637329 2. IP (b_j (3, I x)) is cured by new bessel.lisp (%i53) quad_qag(imagpart(bessel_j(3,%i*x)),x,0,3,3,limit=700); (%o53) [-0.60963229599488,6.7682781156861259E-15,31,0] (%i54) float(imagpart(bessel_j(3,%i*2))); (%o54) -0.21273995923985 =========================== We next summarize the status for the bessel_i cases. 3. RP (b_i (0, I x)) not cured (%i55) quad_qag(realpart(bessel_i(0,%i*x)),x,0,3,3,limit=700); (%o55) quad_qag(bessel_i(0,%i*x),x,0,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) 4. IP (b_i (0.0, I x)) not cured and still hangs (%i56) quad_qag(imagpart(bessel_i(0.0,%i*x)),x,0,3,3,limit=700); (%o56) quad_qag('imagpart(bessel_i(0.0,%i*x)),x,0,3,3,epsrel = 1.0E-8, epsabs = 0.0,limit = 700) 5. RP (b_i (1.0, I x)) not cured (%i58) quad_qag(realpart(bessel_i(1.0,%i*x)),x,0,3,3,limit=700); (%o58) quad_qag('realpart(bessel_i(1.0,%i*x)),x,0,3,3,epsrel = 1.0E-8, epsabs = 0.0,limit = 700) 6. IP (b_i (1, I x)) not cured and shows incorrect float behavior (%i60) quad_qag(imagpart(bessel_i(1,%i*x)),x,0,3,3,limit=700); (%o60) quad_qag(-%i*bessel_i(1,%i*x),x,0,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) ??? (%i85) expand (float(imagpart(bessel_i(1,%i*2)))); ??? (%o85) 0.57672480775687-3.5313043199302822E-17*%i 7. RP (b_i (2, I x)) not cured (%i62) quad_qag(realpart(bessel_i(2,%i*x)),x,0,3,3,limit=700); (%o62) quad_qag(bessel_i(2,%i*x),x,0,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) 8. IP (b_i (3, I x)) not cured and shows incorrect float behavior (%i64) quad_qag(imagpart(bessel_i(3,%i*x)),x,0,3,3,limit=700); (%o64) quad_qag(-%i*bessel_i(3,%i*x),x,0,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) ??? (%i71) expand(float(imagpart(bessel_i(3,%i*2)))); ??? (%o71) 2.3685708388328505E-17*%i-0.1289432494744 9. RP (b_i (4, I x)) not cured and shows incorrect float behavior (%i66) quad_qag(realpart(bessel_i(4,%i*x)),x,0,3,3,limit=700); (%o66) quad_qag(bessel_i(4,%i*x),x,0,3,3,epsrel = 1.0E-8,epsabs = 0.0, limit = 700) ??? (%i68) float(realpart(bessel_i(4,%i*2))); ??? (%o68) 0.033995719807568-8.3262748958227084E-18*%i ------------------------------------------------------------- Most of the problem cases of b_i return good values (ie., not a noun form) if the float order is used. However two of these problem b_i cases are anomalous, in that the float order use returns a noun form, while the integer order use returns a good result. These two cases are #4 and #5. Ted Woollett From luigi_marino2 at alice.it Sat Nov 5 09:32:30 2011 From: luigi_marino2 at alice.it (Luigi Marino) Date: Sat, 5 Nov 2011 15:32:30 +0100 Subject: [Maxima] lapack package and other Message-ID: <696575CD1CD14AE18A5F070BC2FD9732@luigi3b0e34c8e> Hi Robert It is the first time that lapack is loaded and compiled but some commands do not work: e.g. dgeqrf (matrix) Another question about this message: ;Compiler warnings for "C:/Programmi/Maxima-5.25.1/share/maxima/5.25.1/share/linearalgebra/linalg-extra.lisp" : ; In $VANDERMONDE_MATRIX: IGNORE declaration for unknown variable LK ;Compiler warnings for "C:/Programmi/Maxima-5.25.1/share/maxima/5.25.1/share/linearalgebra/linalg-extra.lisp" : ; In $VANDERMONDE_MATRIX: Unused lexical variable LK It is a bug for Maxima 5.25.1 ? Best. Luigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From mat.everitt at gmail.com Sat Nov 5 09:42:12 2011 From: mat.everitt at gmail.com (Matthew Everitt) Date: Sat, 5 Nov 2011 14:42:12 +0000 Subject: [Maxima] Prevent commutation of elements within non-commutative matrix multiplication. In-Reply-To: References: Message-ID: Hi, Thank you! That was exactly what I was loking for. I must have been reading the wrong sections of the manual! Thanks again, Matthew On Wed, Nov 2, 2011 at 9:29 PM, Matthew Everitt wrote: > Hi, > > I'm reasonably new to working with matrices in maxima, and I'm having a > problem I hope someone can help me with. > It seems that the inner product is assuming that the elements of a matrix > commute, so running: > > declare([a,b],nonscalar)$ > display2d:false$ > A:matrix([0,a],[b,0])$ > A.A; > > gives > matrix([a*b,0],[0,a*b]) > rather than matrix([a.b,0],[0,b.a]), which is what I need. Is there any > way around this? > > Thanks, > Matthew Everitt > -------------- next part -------------- An HTML attachment was scrubbed... URL: From juanjose.garciaripoll at googlemail.com Sat Nov 5 15:01:37 2011 From: juanjose.garciaripoll at googlemail.com (Juan Jose Garcia-Ripoll) Date: Sat, 5 Nov 2011 21:01:37 +0100 Subject: [Maxima] [Ecls-list] writefile does not write In-Reply-To: References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <4EB55868.6060905@gmail.com> Message-ID: On Sat, Nov 5, 2011 at 6:05 PM, Robert Dodier wrote: > On 11/5/11, Raymond Toy wrote: > > > Sounds like a bug in ecl. I did a very quick test with writefile using > > maxima and cmucl. The output file is not empty. > > I just tried (dribble "/tmp/foo.log") in ECL 11.1.1 (Ubuntu) and > it puts nothing into the file. (Maxima writefile punts to dribble iirc.) > ECL used to bind the wrong variable. This was fixed a few months ago in CVS/git. Juanjo -- Instituto de F?sica Fundamental, CSIC c/ Serrano, 113b, Madrid 28006 (Spain) http://juanjose.garciaripoll.googlepages.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From juanjose.garciaripoll at googlemail.com Sun Nov 6 03:03:42 2011 From: juanjose.garciaripoll at googlemail.com (Juan Jose Garcia-Ripoll) Date: Sun, 6 Nov 2011 10:03:42 +0100 Subject: [Maxima] [Ecls-list] writefile does not write In-Reply-To: <20111106003758.GA21391@cs-wsok.swan.ac.uk> References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <4EB55868.6060905@gmail.com> <20111105220814.GF18945@cs-wsok.swan.ac.uk> <20111106002705.GG18945@cs-wsok.swan.ac.uk> <20111106003758.GA21391@cs-wsok.swan.ac.uk> Message-ID: On Sun, Nov 6, 2011 at 1:37 AM, Oliver Kullmann wrote: > Don't know why this works with CLisp but not with Ecl. > Definitely works for me (see below). But ECL does not build Maxima without one of the latest patches I uploaded. Juanjo $ ./maxima-local ;;; Loading #P"/Users/jjgarcia/lib/ecl-11.1.1/sb-bsd-sockets.fas" ;;; Loading #P"/Users/jjgarcia/lib/ecl-11.1.1/sockets.fas" ;;; Loading #P"/Users/jjgarcia/lib/ecl-11.1.1/defsystem.fas" ;;; Loading #P"/Users/jjgarcia/lib/ecl-11.1.1/cmp.fas" Maxima 5.23post http://maxima.sourceforge.net using Lisp ECL 11.1.1 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) writefile("~/foo.log"); Starts dribbling to /Users/jjgarcia/foo.log (2011/11/6, 9:55:42). NIL (%o1) done (%i2) 3 4 stdin:3393291:incorrect syntax: 4 is not an infix operator (%i2) 4; (%o2) 4 (%i3) 5; (%o3) 5 (%i4) closefile(); NIL (%o4) done (%i5) $ cat ~/foo.log Starts dribbling to /Users/jjgarcia/foo.log (2011/11/6, 9:55:42). NIL (%o1) done (%i2) stdin:3393291:incorrect syntax: 4 is not an infix operator (%i2) (%o2) 4 (%i3) (%o3) 5 (%i4) Finished dribbling to /Users/jjgarcia/foo.log.$ -- Instituto de F?sica Fundamental, CSIC c/ Serrano, 113b, Madrid 28006 (Spain) http://juanjose.garciaripoll.googlepages.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From l.butler at cmich.edu Sun Nov 6 10:42:03 2011 From: l.butler at cmich.edu (Leo Butler) Date: Sun, 06 Nov 2011 11:42:03 -0500 Subject: [Maxima] writefile does not write References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> Message-ID: <874nyhqk2s.fsf@cmich.edu> Oliver Kullmann writes: > Hello, > > with Maxima 5.25.1 under Ecl 11.1.1 writefile creates an empty file > upon being called, but then nothing happens, the file stays empty > whatever happens (also after closefile). > > The facility of writefile would actually be very desired. > Is there another command which achieves the effect? Perhaps > something Ecl-specific could be written? > > (The motivation is the following: Again and again we are losing > computations which already run for hours/days because of for > example a laptop-crash when running remotely. The (Linux-)program > screen unfortunately doesn't help --- again and again the connection > is completely lost, no possibility to reconnect, while actually Maxima > is still running. These computations most of the time emerge in an interactive > session, so batchmode would be very inconvenient. If writefile would work, > then this would solve the problem (and it could be automated, always on > startup logging to a file with the timestamp in the name).) To be honest, your description seems odd. Do you mean that you are unable to re-attach to your screen session? Do you try screen -R -D? If your screen session has died, all its children should be dead, too. It would be helpful to know exactly what you are doing to try to reattach to screen. Anyhow, here are a few suggestions: 1. Start emacs in server mode (emacs --daemon), use emacsclient to attach to the emacs session, and run maxima inside emacs. 2. Start a swank server in maxima (as Michel Talon suggested), run your code, and you can re-attach to the maxima process through slime. 3. Run maxima inside emacs inside screen. 4. do some combination of 1--3. Personally, I do 1 + 3 on a day-to-day basis and I can't recall when I last had a problem reattaching to screen. Leo From O.Kullmann at swansea.ac.uk Sun Nov 6 17:21:29 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 6 Nov 2011 23:21:29 +0000 Subject: [Maxima] writefile does not write In-Reply-To: <874nyhqk2s.fsf@cmich.edu> References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <874nyhqk2s.fsf@cmich.edu> Message-ID: <20111106232129.GC32071@cs-wsok.swan.ac.uk> > > (The motivation is the following: Again and again we are losing > > computations which already run for hours/days because of for > > example a laptop-crash when running remotely. The (Linux-)program > > screen unfortunately doesn't help --- again and again the connection > > is completely lost, no possibility to reconnect, while actually Maxima > > is still running. These computations most of the time emerge in an interactive > > session, so batchmode would be very inconvenient. If writefile would work, > > then this would solve the problem (and it could be automated, always on > > startup logging to a file with the timestamp in the name).) > > To be honest, your description seems odd. Do you mean that you are > unable to re-attach to your screen session? Do you try screen -R -D? If > your screen session has died, all its children should be dead, too. It > would be helpful to know exactly what you are doing to try to reattach > to screen. > I start and re-attach with the same command, namely ssh -t user at computer /usr/bin/screen -xRR It happened several times, but such things are not reconstructible. Perhaps the sessions were not detached, and then screen could not handle the sudden death of the connection(?). Now I always detach (via Ctrl-a-d), don't leave connections open, and until now there were no further problems. So let's hope that solved the problem. Nevertheless, having a logging facility (which we would then always enable by default), would be great. > Anyhow, here are a few suggestions: > > 1. Start emacs in server mode (emacs --daemon), use emacsclient to > attach to the emacs session, and run maxima inside emacs. > 2. Start a swank server in maxima (as Michel Talon suggested), > run your code, and you can re-attach to the maxima process through > slime. > 3. Run maxima inside emacs inside screen. > 4. do some combination of 1--3. > > Personally, I do 1 + 3 on a day-to-day basis and I can't recall when I > last had a problem reattaching to screen. > I use xemacs, but only as text-editor, and otherwise I prefer konsole-windows. Hoping that by consistently detaching and re-attaching the screen-problems are gone, just using screen hopefully suffices. But a student in my group uses (x)emacs in such a way, and perhaps he can use this tip. Thanks for your help. Oliver From O.Kullmann at swansea.ac.uk Sun Nov 6 17:31:24 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 6 Nov 2011 23:31:24 +0000 Subject: [Maxima] [Ecls-list] writefile does not write In-Reply-To: References: <4EB55868.6060905@gmail.com> <20111105220814.GF18945@cs-wsok.swan.ac.uk> <20111106002705.GG18945@cs-wsok.swan.ac.uk> <20111106003758.GA21391@cs-wsok.swan.ac.uk> <20111106222231.GB32071@cs-wsok.swan.ac.uk> Message-ID: <20111106233124.GD32071@cs-wsok.swan.ac.uk> > > Could you please ensure no initialization file is loaded? That could easily > screw the comparison. > Sure, I mentioned the other possibilities just for completeness. By the way, an observation regarding Ecl: It got slower from January to now. 25/1/2011 we pulled a recent version of Ecl from cvs, built Maxima with it and used it until now. Running our Maxima test-suite always took less than 310s; I just repeated it 5 times, and got between 304s and 308s (measured by time (process time)). Now with the newest Ecl I get always times between 321s and 328s, and so it got roughly 6% slower. Just to mention. Oliver From l.butler at cmich.edu Sun Nov 6 19:27:21 2011 From: l.butler at cmich.edu (Leo Butler) Date: Sun, 6 Nov 2011 20:27:21 -0500 Subject: [Maxima] writefile does not write In-Reply-To: <20111106232129.GC32071@cs-wsok.swan.ac.uk> (Oliver Kullmann's message of "Sun, 6 Nov 2011 23:21:29 +0000") References: <20111105100423.GA18945@cs-wsok.swan.ac.uk> <874nyhqk2s.fsf@cmich.edu> <20111106232129.GC32071@cs-wsok.swan.ac.uk> Message-ID: <87r51kpvra.fsf@cmich.edu> Oliver Kullmann writes: > I start and re-attach with the same command, namely > > ssh -t user at computer /usr/bin/screen -xRR > > It happened several times, but such things are not reconstructible. > Perhaps the sessions were not detached, and then screen could not > handle the sudden death of the connection(?). > Now I always detach (via Ctrl-a-d), don't leave connections open, > and until now there were no further problems. So let's hope that > solved the problem. > If you run screen -R -D this will force a detachment and then a re-attachment of your session. If you don't forcibly detach sessions which screen thinks are open (say, becaues your ssh connection dropped), then you won't be able to re-attach. > > I use xemacs, but only as text-editor, and otherwise I prefer konsole-windows. > Hoping that by consistently detaching and re-attaching the screen-problems > are gone, just using screen hopefully suffices. Yeah, I once preferred to work like this, but konsole &co are really just a poor imitation of an emacs shell buffer (no tongue in cheek). Anyhow, chacun a son gout. From toy.raymond at gmail.com Mon Nov 7 13:50:47 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 7 Nov 2011 11:50:47 -0800 Subject: [Maxima] lapack package and other In-Reply-To: <696575CD1CD14AE18A5F070BC2FD9732@luigi3b0e34c8e> References: <696575CD1CD14AE18A5F070BC2FD9732@luigi3b0e34c8e> Message-ID: On Sat, Nov 5, 2011 at 7:32 AM, Luigi Marino wrote: > ** > Hi Robert > It is the first time that lapack is loaded and compiled > but some commands do not work: > e.g. dgeqrf (matrix) > It would have been useful if you had given an example, but I can confirm that there is a problem with dgeqrf. The example in the documentation doesn't work for me either. If you find other issues, please let us know. I'll look into it. > > Another question about this message: > > ;Compiler warnings for > "C:/Programmi/Maxima-5.25.1/share/maxima/5.25.1/share/linearalgebra/linalg-extra.lisp" > : > ; In $VANDERMONDE_MATRIX: IGNORE declaration for unknown variable LK > ;Compiler warnings for > "C:/Programmi/Maxima-5.25.1/share/maxima/5.25.1/share/linearalgebra/linalg-extra.lisp" > : > ; In $VANDERMONDE_MATRIX: Unused lexical variable LK > > It is a bug for Maxima 5.25.1 ? > These are harmless, but should probably be fixed. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Mon Nov 7 14:58:00 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 7 Nov 2011 12:58:00 -0800 Subject: [Maxima] Comparison of *integrate* with bessel functions using integer and float orders Message-ID: <2AC12C69A1D64C6D858B7CDA2F43A2E9@edwinc367e16bd> comparison of integrate with bessel functions using integer and float orders --------------------------- SUMMARY: Using new bessel.lisp and Barton Willis' new besselI.lisp (see below), both bessel_j and bessel_i yield a good answer for either integral or float order. Both bessel_k and bessel_y produce a noun form when a float order is used. -------------------------------------------- DETAILS: ========================= case bessel_j (n,z) as arg to integrate: produces good answers for either integral or float order ========================= for z = x = real, (%i2) integrate(bessel_j(0,x),x); (%o2) (bessel_j(0,x)*(2-%pi*struve_h(1,x))+%pi*struve_h(0,x)*bessel_j(1,x))*x /2 (%i3) integrate(bessel_j(0.0,x),x); (%o3) 1.0*hypergeometric([0.5],[1.0,1.5],-x^2/4)*x -------------------------------- for z = %i*x = imaginary (%i15) integrate(bessel_j(0,%i*x),x); (%o15) (bessel_j(0,%i*x)*(2-%pi*struve_h(1,%i*x)) +%pi*struve_h(0,%i*x)*bessel_j(1,%i*x)) *x /2 (%i68) integrate(bessel_j(0.0,%i*x),x); (%o68) 1.0*hypergeometric([0.5],[1.0,1.5],x^2/4)*x ====================================== case bessel_i (n,z) : get answer with either integral or float order =============================== (MUST use Barton Willis' new besselI.lisp) for z = x: (%i1) (display2d:false,ratprint:false,ratepsilon:2.0e-15)$ (%i2) integrate(bessel_i(4,x),x); (%o2) 'integrate(bessel_i(4,x),x) (%i3) load("bessel.lisp"); (%o3) "bessel.lisp" (%i4) integrate(bessel_i(4,x),x); (%o4) 'integrate(bessel_i(4,x),x) (%i5) load("besselI.lisp"); (%o5) "besselI.lisp" (%i6) integrate(bessel_i(4,x),x); (%o6) hypergeometric([5/2],[7/2,5],x^2/4)*x^5/1920 (%i7) integrate(bessel_i(4.0,x),x); (%o7) 5.2083333333333333E-4*hypergeometric([2.5],[3.5,5.0],x^2/4)*x^5.0 (%i25) integrate(bessel_i(0,x),x); (%o25) hypergeometric([1/2],[1,3/2],x^2/4)*x (%i26) integrate(bessel_i(0.0,x),x); (%o26) 1.0*hypergeometric([0.5],[1.0,1.5],x^2/4)*x for z = %i*x: (%i46) integrate(bessel_i(4,%i*x),x); (%o46) hypergeometric([5/2],[7/2,5],-x^2/4)*x^5/1920 (%i47) integrate(bessel_i(4.0,%i*x),x); (%o47) -5.2083333333333333E-4*%i*hypergeometric([2.5],[3.5,5.0],-x^2/4) *(%i*x)^5.0 ====================================== case bessel_k (n,z): only integral order gets answer =============================== for z = x only integral order is done (%i14) integrate(bessel_k(0,x),x); (%o14) %pi*(struve_l(0,x)*bessel_k(1,x)+struve_l(-1,x)*bessel_k(0,x))*x/2 (%i15) integrate(bessel_k(0.0,x),x); (%o15) 'integrate(bessel_k(0.0,x),x) -------------------------------------- for z = %i*x only integral order is done (%i9) integrate(bessel_k(0,%i*x),x); (%o9) %pi*(struve_l(0,%i*x)*bessel_k(1,%i*x) +struve_l(-1,%i*x)*bessel_k(0,%i*x))*x /2 (%i10) integrate(bessel_k(0.0,%i*x),x); (%o10) 'integrate(bessel_k(0.0,%i*x),x) ===================================== case bessel_y (n,z): only integral order gets answer =============================== for z = x (%i20) integrate(bessel_y(0,x),x); (%o20) %pi*(struve_h(0,x)*bessel_y(1,x)+struve_h(-1,x)*bessel_y(0,x))*x/2 (%i21) integrate(bessel_y(0.0,x),x); (%o21) 'integrate(bessel_y(0.0,x),x) -------------------------------------- for z = %i*x (%i15) integrate(bessel_y(0,%i*x),x); (%o15) %pi*(struve_h(0,%i*x)*bessel_y(1,%i*x) +struve_h(-1,%i*x)*bessel_y(0,%i*x))*x /2 (%i16) integrate(bessel_y(0.0,%i*x),x); (%o16) 'integrate(bessel_y(0.0,%i*x),x) -------------------------------------- Ted Woollett -------------------------------- p.s. Barton Willis' code besselI.lisp ----------------------------------- ;;; file besselI.lisp ;;;code from barton willis, oct. 24, 2011 ;; integrate(bessel_i(a,z),z) = hypergeometric([(a+1)/2],[a+1,(a+3)/2],x^2/4)*x^(a+1))/(2^a*gamma(a+2)) ;; Maxima simplifies bessel_i(-2,z) --> bessel_(2,z), so a = -2 isn't a special case. (defun bessel-i-integral (a z) "Integral of bessel_i(a,z) wrt z" (cond ((eq t (meqp a 1)) ;; integrate(bessel_i(1,z),z) = bessel_i(0,z) (opcons '%bessel_i 0 z)) (t (mul (opcons 'mexpt z (add a 1)) (opcons '$hypergeometric (opcons 'mlist (div (add a 1) 2)) (opcons 'mlist (div (add a 3) 2) (add a 1)) (div (mul z z) 4)) (div 1 (mul (opcons 'mexpt 2 a) (opcons '%gamma (add a 2)))))))) (putprop '%bessel_i `((a z) nil ,#'bessel-i-integral) 'integral) ------------------------------------------------------- From O.Kullmann at swansea.ac.uk Mon Nov 7 16:13:12 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Mon, 7 Nov 2011 22:13:12 +0000 Subject: [Maxima] [Ecls-list] writefile does not write In-Reply-To: References: <4EB55868.6060905@gmail.com> <20111105220814.GF18945@cs-wsok.swan.ac.uk> <20111106002705.GG18945@cs-wsok.swan.ac.uk> <20111106003758.GA21391@cs-wsok.swan.ac.uk> <20111106222231.GB32071@cs-wsok.swan.ac.uk> Message-ID: <20111107221312.GE20179@cs-wsok.swan.ac.uk> Okay, I pulled Ecl from git, with current ID ea0fdff00734051a1c775c2740ddb2a92122e93c Now writefile in Maxima works: ------------------------------------------------------------- (%i1) writefile("Test.log"); Starts dribbling to Test.log (2011/11/7, 18:44:40). NIL Evaluation took 0.0010 seconds (0.0000 elapsed) (%o1) done (%i2) 10!; Evaluation took 0.0000 seconds (0.0000 elapsed) (%o2) 3628800 (%i3) 100!; Evaluation took 0.0000 seconds (0.0000 elapsed) (%o3) 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 (%i4) closefile(); NIL Evaluation took 0.0000 seconds (0.0000 elapsed) (%o4) done kullmann-0:OKplatform> cat Test.log Starts dribbling to Test.log (2011/11/7, 18:44:40). NIL Evaluation took 0.0010 seconds (0.0000 elapsed) (%o1) done (%i2) Evaluation took 0.0000 seconds (0.0000 elapsed) (%o2) 3628800 (%i3) Evaluation took 0.0000 seconds (0.0000 elapsed) (%o3) 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 (%i4) Finished dribbling to Test.log.kullmann-0:OKplatform> ------------------------------------------------------------ Would be good if also the input would appear (and a concluding end-of-line after closefile() would likely also be good). W.r.t. speed: This version seems 3% faster (on our test-set) then the Ecl-version I got from CVS (still 3% slower than the January-version). On Mon, Nov 07, 2011 at 12:05:06PM +0100, Juan Jose Garcia-Ripoll wrote: > Just a brief question: did you use ECL from git or from CVS? It seems the > later repository has become somewhat obsolete. I cannot really say, because > I have a firewall that prevents me from using CVS in the office, but I > checked again with Linux/Ubuntu on a 64-bit machine and everything works > fine with Maxima. I guess the information at http://ecls.sourceforge.net/download.html should be updated: My impression from that page was that the cvs-archive is the authoritative one, while the git-archives would only mirror it. Thanks for your help! Oliver -- 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 Nov 8 00:34:10 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 07 Nov 2011 22:34:10 -0800 Subject: [Maxima] lapack package and other In-Reply-To: References: <696575CD1CD14AE18A5F070BC2FD9732@luigi3b0e34c8e> Message-ID: <4EB8CD62.2010402@gmail.com> On 11/7/11 11:50 AM, Raymond Toy wrote: > > > On Sat, Nov 5, 2011 at 7:32 AM, Luigi Marino > wrote: > > __ > Hi Robert > It is the first time that lapack is loaded and compiled > but some commands do not work: > e.g. dgeqrf (matrix) > > > It would have been useful if you had given an example, but I can confirm > that there is a problem with dgeqrf. The example in the documentation > doesn't work for me either. If you find other issues, please let us know. > > I'll look into it. Found the problem. It's fixed in the git repo now. If you need the fix now, I'd recommend obtaining the fixed version from git. Ray From toy.raymond at gmail.com Tue Nov 8 00:34:10 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 07 Nov 2011 22:34:10 -0800 Subject: [Maxima] lapack package and other In-Reply-To: References: <696575CD1CD14AE18A5F070BC2FD9732@luigi3b0e34c8e> Message-ID: <4EB8CD62.2010402@gmail.com> On 11/7/11 11:50 AM, Raymond Toy wrote: > > > On Sat, Nov 5, 2011 at 7:32 AM, Luigi Marino > wrote: > > __ > Hi Robert > It is the first time that lapack is loaded and compiled > but some commands do not work: > e.g. dgeqrf (matrix) > > > It would have been useful if you had given an example, but I can confirm > that there is a problem with dgeqrf. The example in the documentation > doesn't work for me either. If you find other issues, please let us know. > > I'll look into it. Found the problem. It's fixed in the git repo now. If you need the fix now, I'd recommend obtaining the fixed version from git. Ray From juanjose.garciaripoll at googlemail.com Tue Nov 8 03:35:52 2011 From: juanjose.garciaripoll at googlemail.com (Juan Jose Garcia-Ripoll) Date: Tue, 8 Nov 2011 10:35:52 +0100 Subject: [Maxima] [Ecls-list] writefile does not write In-Reply-To: <20111107221312.GE20179@cs-wsok.swan.ac.uk> References: <4EB55868.6060905@gmail.com> <20111105220814.GF18945@cs-wsok.swan.ac.uk> <20111106002705.GG18945@cs-wsok.swan.ac.uk> <20111106003758.GA21391@cs-wsok.swan.ac.uk> <20111106222231.GB32071@cs-wsok.swan.ac.uk> <20111107221312.GE20179@cs-wsok.swan.ac.uk> Message-ID: On Mon, Nov 7, 2011 at 11:13 PM, Oliver Kullmann wrote: > Would be good if also the input would appear (and a concluding end-of-line > after closefile() would likely also be good). > I am afraid this is Maxima's fault. For some reason it is reading for a stream other than *standard-input* and does not allow the lisp to change that value. Without this, dribble may not work. See below: Maxima 5.25post http://maxima.sourceforge.net using Lisp ECL 11.1.1 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 (trace mread) (MREAD) (%i1) 3; 1> (MREAD # (NIL)) <1 (MREAD ((DISPLAYINPUT (0 "stdin" SRC)) NIL 3)) (%o1) 3 (%i2) :lisp (defparameter *my-echo* (make-echo-stream *standard-input* *standard-output*)) *MY-ECHO* (%i2) :lisp (setf *standard-input* *my-echo*) # (%i2) 4; 1> (MREAD # (NIL)) <1 (MREAD ((DISPLAYINPUT (0 "stdin" SRC)) NIL 4)) (%o2) 4 -- Instituto de F?sica Fundamental, CSIC c/ Serrano, 113b, Madrid 28006 (Spain) http://juanjose.garciaripoll.googlepages.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Tue Nov 8 12:17:24 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 8 Nov 2011 10:17:24 -0800 Subject: [Maxima] Helping out with Maxima In-Reply-To: <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> References: <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> Message-ID: Hi Conrad, thanks for offering to help out. I've taken the liberty of forwarding your message to the Maxima mailing list. If anyone would like to help Conrad figure out some things to work on, that would be terrific. There are two general directions that come to mind. One is that Maxima needs continuous maintenance to ensure that its multitude of pieces, assembled over many years and touched by many hands, continues to function as a whole. The other is that you may have some particular experience to work on a particular topic. Perhaps you can tell us a little bit about your background. Lisp is not too terribly different from other programming languages so if you have experience in programming, I think you'll be able to grasp Lisp as well. All the best, Robert Dodier On 11/5/11, Conrad Schiff wrote: > Robert, > > Hello my name is Conrad Schiff. I very much appreciate the effort that > all of you put into Maxima as an open source CAS. I was wondering if there > was any way that I might be able to help. I've got a great deal of > experience with the development of scientific software and while I'm only a > beginner at Lisp but I might be able to help with documentation and testing. > > > Thanks, > Conrad From rich.hennessy at verizon.net Tue Nov 8 12:58:05 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 08 Nov 2011 13:58:05 -0500 Subject: [Maxima] Third party code link broken Message-ID: I used to go to http://maxima.sourceforge.net/3rdpartycode.html and I could click on pw.mac and it would take me to a page I wrote about pw.mac. The link is now broken and clicking it takes you to some page in Russian that says this domain name is available. Has someone moved this page. Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Tue Nov 8 14:55:38 2011 From: woollett at charter.net (Edwin Woollett) Date: Tue, 8 Nov 2011 12:55:38 -0800 Subject: [Maxima] integrate bessel_j errcatch? Message-ID: Is it possible to return an error in bessel.lisp when, for example, the numerical value of a bessel function is so large that the code/system can't cope, and the answer returned for a calculation is completely wrong? The example below deals only with integrate with bessel_j, but the same problem can occur with other bessel functions. Here we compute the integral of bessel_j(1,%i*x) over larger and larger ranges, until we get an obscure error message and a completely wrong answer. ------------------------------ (%i29) float(integrate(bessel_j(1,%i*x),x,1,10)); (%o29) 2814.450562588503*%i (%i30) float(integrate(bessel_j(1,%i*x),x,1,100)); (%o30) 1.0737517071310738E+42*%i (%i31) float(integrate(bessel_j(1,%i*x),x,1,500)); (%o31) 2.5048094765700785E+215*%i (%i32) float(integrate(bessel_j(1,%i*x),x,1,700)); (%o32) 1.5295933476718737E+302*%i (%i33) float(integrate(bessel_j(1,%i*x),x,1,800)); zbesj ierr = 2 (%o33) -1.266065877752008*%i (%i34) errcatch (float(integrate(bessel_j(1,%i*x),x,1,800))); zbesj ierr = 2 (%o34) [-1.266065877752008*%i] --------------------------------------- The actual answer is about %i*3.8e345, whereas the returned answer is the wrong sign and magnitude. Ted Woollett From fateman at eecs.berkeley.edu Tue Nov 8 15:42:24 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 08 Nov 2011 13:42:24 -0800 Subject: [Maxima] integrate bessel_j errcatch? In-Reply-To: References: Message-ID: <4EB9A240.3010601@eecs.berkeley.edu> On 11/8/2011 12:55 PM, Edwin Woollett wrote: > Is it possible to return an error in bessel.lisp > when, for example, the numerical value of > a bessel function is so large that the code/system > can't cope, and the answer returned for a calculation > is completely wrong? > The "right" solution is to roll over to another computer program that uses bigfloats and an appropriate algorithm for the argument values, and gives the right answer. (This is one of the things that Mathematica claims to do.) RJF From rich.hennessy at verizon.net Tue Nov 8 19:17:12 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 08 Nov 2011 20:17:12 -0500 Subject: [Maxima] Third party code link broken Message-ID: Well, I guess the wiki is dead. There is an older copy of the page in question at http://sourceforge.net/apps/mediawiki/piecewisefunc/index.php?title=Main_Page I have to update it but not much has changed. Can the link on third party code be updated to link to this page instead? Rich From: Richard Hennessy Sent: Tuesday, November 08, 2011 1:58 PM To: Maxima List Subject: [Maxima] Third party code link broken I used to go to http://maxima.sourceforge.net/3rdpartycode.html and I could click on pw.mac and it would take me to a page I wrote about pw.mac. The link is now broken and clicking it takes you to some page in Russian that says this domain name is available. Has someone moved this page. 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 toy.raymond at gmail.com Wed Nov 9 00:41:38 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 08 Nov 2011 22:41:38 -0800 Subject: [Maxima] integrate bessel_j errcatch? In-Reply-To: <4EB9A240.3010601@eecs.berkeley.edu> References: <4EB9A240.3010601@eecs.berkeley.edu> Message-ID: <4EBA20A2.10804@gmail.com> On 11/8/11 1:42 PM, Richard Fateman wrote: > On 11/8/2011 12:55 PM, Edwin Woollett wrote: >> Is it possible to return an error in bessel.lisp >> when, for example, the numerical value of >> a bessel function is so large that the code/system >> can't cope, and the answer returned for a calculation >> is completely wrong? >> > The "right" solution is to roll over to another computer program that > uses bigfloats and an appropriate algorithm for the argument values, > and gives the right answer. (This is one of the things that > Mathematica claims to do.) > On the other hand, I think there's an expectation that floats are reasonably fast. If they automatically overflowed to bfloats, then suddenly everything gets slower. That would go against my expectations. But if we signaled an error, as Ted suggests, then the user could catch it and do something about it, including conversion to bfloats. Ray From rjwiltsh at glam.ac.uk Wed Nov 9 02:42:33 2011 From: rjwiltsh at glam.ac.uk (Wiltshire R J (AT)) Date: Wed, 9 Nov 2011 08:42:33 +0000 Subject: [Maxima] Problem running symmgrp2009.max with recent versions of Maxima In-Reply-To: References: Message-ID: <3C6A1C9C-859B-4880-B0B2-2AC7B5964311@glam.ac.uk> Dear Maxima First - it's a great package! My problem relates to the package symmgrp2009.max which runs fines using Maxima versions up to 5.20.1 but does not work for recent versions because of an apparent problem with the 'depends' function. Details of this package can be found at: http://inside.mines.edu/~whereman/software.html The following section gives a little more detail about the problem: W. Hereman and B. Huard, symmgrp2009.max [http://inside.mines.edu/%7Ewhereman/new.gif] : A Macsyma/Maxima program for the calculation of Lie point symmetries of large systems of differential equations (2009). The package symmgrp2009.max works under both the commercial computer algebra system Macsyma and Maxima, a computer algebra system which can be freely downloaded from SourceForge. Notes: Maxima v. 5.16.3 is prefered because wmMaxima (0.7.6) is easier to work with. The code symmgrp2009.max has been tested (and works fine) for Maxima versions 5.16.3 through 5.20.1. WARNING: the code does NOT WORK under Maxima v. 5.21.0 through 5.23.2 (due to a problem with the depends function which hopefully will be fixed in v. 5.24.0). Data and command files are available for either Macsyma (MacsymaFiles) or Maxima (MaximaFiles). The package symmgrp.max (written in 1991) was updated in 2006. Are you aware of this problem and if so do you know how to fix it. Any help would be greatly appreciated. Best regards - Ron Wiltshire Ron Wiltshire Professor of Applied Mathematics Head of Research Faculty of Advanced Technology University of Glamorgan Pontypridd CF37 1DL tel: +44 1443 482256 email: rjwiltsh at glam.ac.uk On 9 Nov 2011, at 06:41, maxima-request at math.utexas.edu wrote: Send Maxima mailing list submissions to maxima at math.utexas.edu To subscribe or unsubscribe via the World Wide Web, visit http://www.math.utexas.edu/mailman/listinfo/maxima or, via email, send a message with subject or body 'help' to maxima-request at math.utexas.edu You can reach the person managing the list at maxima-owner at math.utexas.edu When replying, please edit your Subject line so it is more specific than "Re: Contents of Maxima digest..." Today's Topics: 1. Re: [Ecls-list] writefile does not write (Juan Jose Garcia-Ripoll) 2. Re: Helping out with Maxima (Robert Dodier) 3. Third party code link broken (Richard Hennessy) 4. integrate bessel_j errcatch? (Edwin Woollett) 5. Re: integrate bessel_j errcatch? (Richard Fateman) 6. Re: Third party code link broken (Richard Hennessy) 7. Re: integrate bessel_j errcatch? (Raymond Toy) ---------------------------------------------------------------------- Message: 1 Date: Tue, 8 Nov 2011 10:35:52 +0100 From: Juan Jose Garcia-Ripoll To: Oliver Kullmann Cc: maxima at math.utexas.edu Subject: Re: [Maxima] [Ecls-list] writefile does not write Message-ID: Content-Type: text/plain; charset="iso-8859-1" On Mon, Nov 7, 2011 at 11:13 PM, Oliver Kullmann wrote: Would be good if also the input would appear (and a concluding end-of-line after closefile() would likely also be good). I am afraid this is Maxima's fault. For some reason it is reading for a stream other than *standard-input* and does not allow the lisp to change that value. Without this, dribble may not work. See below: Maxima 5.25post http://maxima.sourceforge.net using Lisp ECL 11.1.1 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 (trace mread) (MREAD) (%i1) 3; 1> (MREAD # (NIL)) <1 (MREAD ((DISPLAYINPUT (0 "stdin" SRC)) NIL 3)) (%o1) 3 (%i2) :lisp (defparameter *my-echo* (make-echo-stream *standard-input* *standard-output*)) *MY-ECHO* (%i2) :lisp (setf *standard-input* *my-echo*) # (%i2) 4; 1> (MREAD # (NIL)) <1 (MREAD ((DISPLAYINPUT (0 "stdin" SRC)) NIL 4)) (%o2) 4 -- Instituto de F?sica Fundamental, CSIC c/ Serrano, 113b, Madrid 28006 (Spain) http://juanjose.garciaripoll.googlepages.com -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Tue, 8 Nov 2011 10:17:24 -0800 From: Robert Dodier To: Conrad Schiff Cc: Maxima Mailing List Subject: Re: [Maxima] Helping out with Maxima Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Hi Conrad, thanks for offering to help out. I've taken the liberty of forwarding your message to the Maxima mailing list. If anyone would like to help Conrad figure out some things to work on, that would be terrific. There are two general directions that come to mind. One is that Maxima needs continuous maintenance to ensure that its multitude of pieces, assembled over many years and touched by many hands, continues to function as a whole. The other is that you may have some particular experience to work on a particular topic. Perhaps you can tell us a little bit about your background. Lisp is not too terribly different from other programming languages so if you have experience in programming, I think you'll be able to grasp Lisp as well. All the best, Robert Dodier On 11/5/11, Conrad Schiff wrote: Robert, Hello my name is Conrad Schiff. I very much appreciate the effort that all of you put into Maxima as an open source CAS. I was wondering if there was any way that I might be able to help. I've got a great deal of experience with the development of scientific software and while I'm only a beginner at Lisp but I might be able to help with documentation and testing. Thanks, Conrad ------------------------------ Message: 3 Date: Tue, 08 Nov 2011 13:58:05 -0500 From: "Richard Hennessy" To: "Maxima List" Subject: [Maxima] Third party code link broken Message-ID: Content-Type: text/plain; charset="iso-8859-1" I used to go to http://maxima.sourceforge.net/3rdpartycode.html and I could click on pw.mac and it would take me to a page I wrote about pw.mac. The link is now broken and clicking it takes you to some page in Russian that says this domain name is available. Has someone moved this page. Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 4 Date: Tue, 8 Nov 2011 12:55:38 -0800 From: "Edwin Woollett" To: "maxima mailing list" Subject: [Maxima] integrate bessel_j errcatch? Message-ID: Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Is it possible to return an error in bessel.lisp when, for example, the numerical value of a bessel function is so large that the code/system can't cope, and the answer returned for a calculation is completely wrong? The example below deals only with integrate with bessel_j, but the same problem can occur with other bessel functions. Here we compute the integral of bessel_j(1,%i*x) over larger and larger ranges, until we get an obscure error message and a completely wrong answer. ------------------------------ (%i29) float(integrate(bessel_j(1,%i*x),x,1,10)); (%o29) 2814.450562588503*%i (%i30) float(integrate(bessel_j(1,%i*x),x,1,100)); (%o30) 1.0737517071310738E+42*%i (%i31) float(integrate(bessel_j(1,%i*x),x,1,500)); (%o31) 2.5048094765700785E+215*%i (%i32) float(integrate(bessel_j(1,%i*x),x,1,700)); (%o32) 1.5295933476718737E+302*%i (%i33) float(integrate(bessel_j(1,%i*x),x,1,800)); zbesj ierr = 2 (%o33) -1.266065877752008*%i (%i34) errcatch (float(integrate(bessel_j(1,%i*x),x,1,800))); zbesj ierr = 2 (%o34) [-1.266065877752008*%i] --------------------------------------- The actual answer is about %i*3.8e345, whereas the returned answer is the wrong sign and magnitude. Ted Woollett ------------------------------ Message: 5 Date: Tue, 08 Nov 2011 13:42:24 -0800 From: Richard Fateman To: maxima at math.utexas.edu Subject: Re: [Maxima] integrate bessel_j errcatch? Message-ID: <4EB9A240.3010601 at eecs.berkeley.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 11/8/2011 12:55 PM, Edwin Woollett wrote: Is it possible to return an error in bessel.lisp when, for example, the numerical value of a bessel function is so large that the code/system can't cope, and the answer returned for a calculation is completely wrong? The "right" solution is to roll over to another computer program that uses bigfloats and an appropriate algorithm for the argument values, and gives the right answer. (This is one of the things that Mathematica claims to do.) RJF ------------------------------ Message: 6 Date: Tue, 08 Nov 2011 20:17:12 -0500 From: "Richard Hennessy" To: "Maxima List" Subject: Re: [Maxima] Third party code link broken Message-ID: Content-Type: text/plain; charset="iso-8859-1" Well, I guess the wiki is dead. There is an older copy of the page in question at http://sourceforge.net/apps/mediawiki/piecewisefunc/index.php?title=Main_Page I have to update it but not much has changed. Can the link on third party code be updated to link to this page instead? Rich From: Richard Hennessy Sent: Tuesday, November 08, 2011 1:58 PM To: Maxima List Subject: [Maxima] Third party code link broken I used to go to http://maxima.sourceforge.net/3rdpartycode.html and I could click on pw.mac and it would take me to a page I wrote about pw.mac. The link is now broken and clicking it takes you to some page in Russian that says this domain name is available. Has someone moved this page. 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: ------------------------------ Message: 7 Date: Tue, 08 Nov 2011 22:41:38 -0800 From: Raymond Toy To: maxima at math.utexas.edu Subject: Re: [Maxima] integrate bessel_j errcatch? Message-ID: <4EBA20A2.10804 at gmail.com> Content-Type: text/plain; charset=ISO-8859-1 On 11/8/11 1:42 PM, Richard Fateman wrote: On 11/8/2011 12:55 PM, Edwin Woollett wrote: Is it possible to return an error in bessel.lisp when, for example, the numerical value of a bessel function is so large that the code/system can't cope, and the answer returned for a calculation is completely wrong? The "right" solution is to roll over to another computer program that uses bigfloats and an appropriate algorithm for the argument values, and gives the right answer. (This is one of the things that Mathematica claims to do.) On the other hand, I think there's an expectation that floats are reasonably fast. If they automatically overflowed to bfloats, then suddenly everything gets slower. That would go against my expectations. But if we signaled an error, as Ted suggests, then the user could catch it and do something about it, including conversion to bfloats. Ray ------------------------------ _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima End of Maxima Digest, Vol 64, Issue 16 ************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Wed Nov 9 08:37:38 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 09 Nov 2011 06:37:38 -0800 Subject: [Maxima] integrate bessel_j errcatch? In-Reply-To: <4EBA20A2.10804@gmail.com> References: <4EB9A240.3010601@eecs.berkeley.edu> <4EBA20A2.10804@gmail.com> Message-ID: <4EBA9032.50507@eecs.berkeley.edu> On 11/8/2011 10:41 PM, Raymond Toy wrote: > On 11/8/11 1:42 PM, Richard Fateman wrote: >> On 11/8/2011 12:55 PM, Edwin Woollett wrote: >>> Is it possible to return an error in bessel.lisp >>> when, for example, the numerical value of >>> a bessel function is so large that the code/system >>> can't cope, and the answer returned for a calculation >>> is completely wrong? >>> >> The "right" solution is to roll over to another computer program that >> uses bigfloats and an appropriate algorithm for the argument values, >> and gives the right answer. (This is one of the things that >> Mathematica claims to do.) >> > On the other hand, I think there's an expectation that floats are > reasonably fast. If they automatically overflowed to bfloats, then > suddenly everything gets slower. It would be noticeably slower when they DID overflow to bfloats, but should be just as fast for double-floats. > That would go against my expectations. > > But if we signaled an error, as Ted suggests, then the user could catch > it and do something about it, including conversion to bfloats. Not so easy to do, unless the error message was something like ... argument wxyz too big for bessel_j(pqr,wxyz), but if you really want to know, its bigfloat value is ab........b1234. I think that your suggestion -- which is, I think, that the user re-do the whole problem in bigfloats -- seems unnecessarily painful, and also requires something that Maxima does not have, which is a complete coverage of all floating point library routines in bigfloat arithmetic. As you know, we can't just run the FORTRAN 2 Lisp stuff in bfloat -- most algorithms/ constants are not adequate for anything of higher precision than machine double-floats. While I recognize that people might hope for fast computing, they are, after all, using a computer algebra system and might be willing to wait for an answer that is "correct" if possible. But my proposal is more long terml thinking than a proposal to "fix this bug". > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From kd.gregson at btinternet.com Wed Nov 9 10:23:25 2011 From: kd.gregson at btinternet.com (Kevin Gregson) Date: Wed, 9 Nov 2011 16:23:25 -0000 Subject: [Maxima] Problem with translate_file() in Maxima-5.25.1 Message-ID: <232EBD868C1D4432B80D5F210CB8DB54@kevinbde323ea7> Hello, I have an adaptive Runge-Kutta function for Maxima which I wrote a while ago. The recent posts in the "Lisp programming and Emacs" thread encouraged me to try to produce a quicker translated/compiled version using flonum arrays. However I encountered a problem with translate_file() using Maxima-5.25.1. My attached rkck() function translates, compiles and runs when used interactively. But attempting to load the .LISP file produced by translate_file() results in loadfile failed to load ... -- an error ... The .UNLISP file doesn't record a problem. There is no problem with translate_file() using Maxima-5.20.1. The problem occurs in 5.25.1 with CLISP-2.48 on Linux and with GLC-2.6.8 on Windows XP. On comparing the .LISP files produced by 5.25.1 and 5.20.1, I noticed that in a number of places my 5.25.1 version has hashes where the 5.20.1 version has code. The first # in the attached rkck-25.LISP corresponds to (MAP1 (GETOPR (TRD-MSYMEVAL $NUMBERP '$NUMBERP)) (ADD* $Y $K1)) in rkck-20.LISP. The next # corresponds to (MARRAYREF $XRAHM 1). There are quite a few more cases. I originally had catch() and errcatch() in the function. They made translate_file() give up altogether. On 14th October, on the "Lisp Programming and Emacs" thread, Panagiotis Papasotiriou gave an example function, foo(), and noted that the line define(funmake(f_rhs,cons(interval[1],funcs)),odes), didn't translate. If you do the consing beforehand,as vars:cons(interval[1],funcs), define(funmake(f_rhs,vars),odes), it will translate, but trying to run the translated code produces Error in APPLY [or a callee]: The function MDEFINE is undefined. In interactive mode (vars:[x,y],odes:[xy])$ then :lisp (MEVAL '(($DEFINE) (($FUNMAKE) $F_RHS $VARS) $ODES)); does the define-funmake, but I haven't managed to make ?MEVAL work. Q1) How can MEVAL be used in program mode? Giving up on define, f_rhs:buildq([v1:vars,v2:odes],lambda(v1,v2)), translates and runs. The problem with this is that the 4th order Runge-Kutta program, rk, (the last function in .../share/dynamics/dynamics.mac) uses define(funmake(f_rk_4,cons(domain[1],state)),odes), translate(f_rk_4), in order to translate the function after it has been defined. This is desirable to speed up evaluation of f_rk which provides the derivative values. However it's no use calling translate(f_rhs) after the buildq-lambda statement, in this case f_rhs isn't a function. Q2) Is there any way of translating an anonymous function and attaching a name to it? The simple solution is to make the derivative evaluation function an input parameter, and leave it up to the user to translate it or compile it beforehand. But, in order to get a fast, array based function it seems better to build it in the program, as rk does, rather than rely on the user. Then the translation problem returns. Thank you for Maxima and any assistance you can offer Kevin Gregson -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: rkck.mac Type: application/octet-stream Size: 8703 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: rkck-20.LISP Type: application/octet-stream Size: 16810 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: rkck-25.LISP Type: application/octet-stream Size: 20065 bytes Desc: not available URL: From toy.raymond at gmail.com Wed Nov 9 12:20:49 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 9 Nov 2011 10:20:49 -0800 Subject: [Maxima] integrate bessel_j errcatch? In-Reply-To: <4EBA9032.50507@eecs.berkeley.edu> References: <4EB9A240.3010601@eecs.berkeley.edu> <4EBA20A2.10804@gmail.com> <4EBA9032.50507@eecs.berkeley.edu> Message-ID: On Wed, Nov 9, 2011 at 6:37 AM, Richard Fateman wrote: > On 11/8/2011 10:41 PM, Raymond Toy wrote: > >> On 11/8/11 1:42 PM, Richard Fateman wrote: >> >>> On 11/8/2011 12:55 PM, Edwin Woollett wrote: >>> >>>> Is it possible to return an error in bessel.lisp >>>> when, for example, the numerical value of >>>> a bessel function is so large that the code/system >>>> can't cope, and the answer returned for a calculation >>>> is completely wrong? >>>> >>>> The "right" solution is to roll over to another computer program that >>> uses bigfloats and an appropriate algorithm for the argument values, >>> and gives the right answer. (This is one of the things that >>> Mathematica claims to do.) >>> >>> On the other hand, I think there's an expectation that floats are >> reasonably fast. If they automatically overflowed to bfloats, then >> suddenly everything gets slower. >> > It would be noticeably slower when they DID overflow to bfloats, but > should be just as fast for double-floats. I think it depends on the code. But in this particular case, I agree. But if the bessel_i function is buried deep in some other Lisp code, then it could be potentially slower because the caller now has to deal with whether bessel_i returns a float or a bigfloat. May not be significant, but that's hard to tell without a test case. > > That would go against my expectations. >> >> But if we signaled an error, as Ted suggests, then the user could catch >> it and do something about it, including conversion to bfloats. >> > Not so easy to do, unless the error message was something like ... > argument wxyz too big for bessel_j(pqr,wxyz), but if you really want to > know, its bigfloat value is ab........b1234. I think that In this case, zbesj is returning an error code of 2, which means overflow. We could easily signal float overflow error which the user could catch and just redo the bessel_i computation in bfloats. Which we would have to do anyway. The user could continue the rest of the computation in bigfloats fairly easily. > your suggestion -- which is, I think, that the user re-do the whole > problem in bigfloats -- seems unnecessarily painful, and also requires > something that Maxima does not have, which is a complete coverage of all > floating point library routines in bigfloat arithmetic. As you know, we > can't just run the FORTRAN 2 Lisp stuff in bfloat -- most algorithms/ > constants are not adequate for anything of higher precision than machine > double-floats. > The lack of bigfloat routines for all of the special functions is a different problem. I know that Barton's hypergeometric code could be used to evaluate them, but it seems unnecessarily slow to use hypergeometrics to evaluate these common special functions. It would, however, be a reasonable workaround for this lack of coverage. > > While I recognize that people might hope for fast computing, they are, > after all, using a computer algebra system and might be willing to wait for > an answer that is "correct" if possible. > > But my proposal is more long terml thinking than a proposal to "fix this > bug". > Agreed. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Wed Nov 9 12:33:14 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 09 Nov 2011 10:33:14 -0800 Subject: [Maxima] integrate bessel_j errcatch? In-Reply-To: References: <4EB9A240.3010601@eecs.berkeley.edu> <4EBA20A2.10804@gmail.com> <4EBA9032.50507@eecs.berkeley.edu> Message-ID: <4EBAC76A.6070102@eecs.berkeley.edu> On 11/9/2011 10:20 AM, Raymond Toy wrote:.... .... > > The lack of bigfloat routines for all of the special functions is a > different problem. I know that Barton's hypergeometric code could be > used to evaluate them, but it seems unnecessarily slow to use > hypergeometrics to evaluate these common special functions. It would, > however, be a reasonable workaround for this lack of coverage. I think this is what Mathematica does for a whole bunch of stuff. I have reported bugs in their code where this scheme gives small but significant errors ... in particular some f(x) which mathematically should be real for real x but returns a complex value. You might think this would be not so bad, e.g. realpart + epsilon*I. But if the realpart is O(epsilon), the answer is, in terms of relative error, way off. > > While I recognize that people might hope for fast computing, they > are, after all, using a computer algebra system and might be > willing to wait for an answer that is "correct" if possible. > > But my proposal is more long terml thinking than a proposal to > "fix this bug". > > > Agreed. > > Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Wed Nov 9 12:38:43 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 9 Nov 2011 10:38:43 -0800 Subject: [Maxima] integrate bessel_j errcatch? In-Reply-To: <4EBAC76A.6070102@eecs.berkeley.edu> References: <4EB9A240.3010601@eecs.berkeley.edu> <4EBA20A2.10804@gmail.com> <4EBA9032.50507@eecs.berkeley.edu> <4EBAC76A.6070102@eecs.berkeley.edu> Message-ID: On Wed, Nov 9, 2011 at 10:33 AM, Richard Fateman wrote: > On 11/9/2011 10:20 AM, Raymond Toy wrote:.... > .... > > > > The lack of bigfloat routines for all of the special functions is a > different problem. I know that Barton's hypergeometric code could be used > to evaluate them, but it seems unnecessarily slow to use hypergeometrics to > evaluate these common special functions. It would, however, be a > reasonable workaround for this lack of coverage. > > I think this is what Mathematica does for a whole bunch of stuff. I have > reported bugs in their code where this scheme gives small but significant > errors ... in particular some f(x) which mathematically should be real for > real x but returns a complex value. > I guess that's the problem with using hypergeometrics. Any special properties of the function are lost. I suppose you could try to fix up the result of the hypergeometric, but I don't know how well that would work. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Wed Nov 9 12:49:51 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 9 Nov 2011 10:49:51 -0800 Subject: [Maxima] Problem with translate_file() in Maxima-5.25.1 In-Reply-To: <232EBD868C1D4432B80D5F210CB8DB54@kevinbde323ea7> References: <232EBD868C1D4432B80D5F210CB8DB54@kevinbde323ea7> Message-ID: On 11/9/11, Kevin Gregson wrote: > On comparing the .LISP files produced by 5.25.1 and 5.20.1, I noticed that > in a number of places my 5.25.1 version has hashes where the 5.20.1 version has > code. Well, the presence of #'s in the translate_file output is governed by a Lisp special (global) variables *PRINT-LEVEL* and *PRINT-LENGTH*. It appears the values currently assigned to these aren't suitable for the translator. Probably it is trivial to fix it: we just need to wrap this around the output: (let ((*print-level* nil) (*print-depth* nil)) (declare (special *print-level* *print-depth*)) (print foo)) where FOO is the translator output. Maybe someone has already fixed that. I can't check it at the moment. > Q1) How can MEVAL be used in program mode? Not sure what you mean by "program mode". Let's back up -- what are you trying to accomplish? > Q2) Is there any way of translating an anonymous function and attaching a > name to it? Well, if I remember correctly, Maxima lambda expressions are translated to Lisp lambda expressions. If you want to a named function, I suppose you could do something like: (defun $make_named_function (name body) (let ((my-lisp-lambda ($translate body))) (setf (symbol-function name) my-lisp-lambda))) Disclaimer: I didn't actually try the above code. Hope this helps -- Robert Dodier From willisb at unk.edu Wed Nov 9 14:44:27 2011 From: willisb at unk.edu (Barton Willis) Date: Wed, 9 Nov 2011 14:44:27 -0600 Subject: [Maxima] integrate bessel_j errcatch? In-Reply-To: References: , <4EB9A240.3010601@eecs.berkeley.edu> <4EBA20A2.10804@gmail.com> <4EBA9032.50507@eecs.berkeley.edu> <4EBAC76A.6070102@eecs.berkeley.edu> Message-ID: In addition to being slow, only the 2F1 hypergeometric function analytically continues to outside the convergence disk. --Barton From drdieterkaiser at web.de Wed Nov 9 14:51:07 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 09 Nov 2011 21:51:07 +0100 Subject: [Maxima] Problem running symmgrp2009.max with recent versions of Maxima In-Reply-To: <3C6A1C9C-859B-4880-B0B2-2AC7B5964311@glam.ac.uk> References: <3C6A1C9C-859B-4880-B0B2-2AC7B5964311@glam.ac.uk> Message-ID: <1320871867.1825.24.camel@dieter> Am Mittwoch, den 09.11.2011, 08:42 +0000 schrieb Wiltshire R J (AT): > Dear Maxima > > > First - it's a great package! > > > My problem relates to the package symmgrp2009.max which runs fines > using Maxima versions up to 5.20.1 but does not work for recent > versions because of an apparent problem with the 'depends' function. > Details of this package can be found at: > > > > > http://inside.mines.edu/~whereman/software.html > > > The following section gives a little more detail about the problem: > > > > > > > W. Hereman and B. Huard, symmgrp2009.max : A Macsyma/Maxima program for the calculation of Lie point symmetries of large smstems of differential equations (2009). The package symmgrp2009.max works under both the commercial computer algebra system Macsyma and Maxima, a computer algebra system which can be freely downloaded from SourceForge. > Notes: Maxima v. 5.16.3 is prefered because wmMaxima (0.7.6) is easier > to work with. The code symmgrp2009.max has been tested (and works > fine) for Maxima versions 5.16.3 through 5.20.1. WARNING: the code > does NOT WORK under Maxima v. 5.21.0 through 5.23.2 (due to a problem > with the depends function which hopefully will be fixed in v. 5.24.0). > Data and command files are available for either Macsyma > (MacsymaFiles)or Maxima (MaximaFiles). The package symmgrp.max > (written in 1991) was updated in 2006. > > > > Are you aware of this problem and if so do you know how to fix it. Any > help would be greatly appreciated. > > > Best regards - Ron Wiltshire The problem is that the functionality of the Maxima function depends in versiosn before Maxima 5.21 had several bugs, e.g. ID: 893633 - depends(a,[b,b,b]) ID: 2805600 - depends() partially prevents diff() to work One point was that depends did not correctly recurse over indirect dependencies. Another point was, that Maxima could crash, when expressions were part of the declared dependencies. The dependencies are stored as a property of a symbol on the Lisp property-list. Because of this, a clean implementation which take into account indirect dependencies can only accept symbols, but no expressions in dependencies. I had no look into the code which has problems with the implementation of depends. Perhaps we can get a small example which shows the problem. In the Maxima tensor packages the Maxima functions for a the derivative are replaced with own versions, because of problems with the standard functions. Perhaps, this might be a way to solve the described problem. Dieter Kaiser From biomates at telefonica.net Wed Nov 9 18:19:33 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 10 Nov 2011 01:19:33 +0100 Subject: [Maxima] Third party code link broken In-Reply-To: References: Message-ID: <1320884373.2441.6.camel@pc> El mar, 08-11-2011 a las 20:17 -0500, Richard Hennessy escribi?: > Well, I guess the wiki is dead. There is an older copy of the page in > question at > http://sourceforge.net/apps/mediawiki/piecewisefunc/index.php?title=Main_Page I have to update it but not much has changed. Can the link on third party code be updated to link to this page instead? > Done. The Maxima wiki is in http://sourceforge.net/apps/mediawiki/maxima -- Mario From rich.hennessy at verizon.net Wed Nov 9 19:25:20 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Wed, 09 Nov 2011 20:25:20 -0500 Subject: [Maxima] Third party code link broken In-Reply-To: <1320884373.2441.6.camel@pc> References: <1320884373.2441.6.camel@pc> Message-ID: I don't have rights to edit my submissions in this new wiki. Can you add me as a contributor? Rich -----Original Message----- From: Mario Rodriguez Sent: Wednesday, November 09, 2011 7:19 PM To: Richard Hennessy Cc: Maxima List Subject: Re: [Maxima] Third party code link broken El mar, 08-11-2011 a las 20:17 -0500, Richard Hennessy escribi?: > Well, I guess the wiki is dead. There is an older copy of the page in > question at > http://sourceforge.net/apps/mediawiki/piecewisefunc/index.php?title=Main_Page > I have to update it but not much has changed. Can the link on third party > code be updated to link to this page instead? > Done. The Maxima wiki is in http://sourceforge.net/apps/mediawiki/maxima -- Mario From O.Kullmann at swansea.ac.uk Thu Nov 10 04:09:24 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Thu, 10 Nov 2011 10:09:24 +0000 Subject: [Maxima] [Ecls-list] writefile does not write In-Reply-To: References: <20111105220814.GF18945@cs-wsok.swan.ac.uk> <20111106002705.GG18945@cs-wsok.swan.ac.uk> <20111106003758.GA21391@cs-wsok.swan.ac.uk> <20111106222231.GB32071@cs-wsok.swan.ac.uk> <20111107221312.GE20179@cs-wsok.swan.ac.uk> Message-ID: <20111110100924.GU26100@cs-wsok.swan.ac.uk> On Tue, Nov 08, 2011 at 10:35:52AM +0100, Juan Jose Garcia-Ripoll wrote: > On Mon, Nov 7, 2011 at 11:13 PM, Oliver Kullmann > wrote: > > > Would be good if also the input would appear (and a concluding end-of-line > > after closefile() would likely also be good). > > > > I am afraid this is Maxima's fault. For some reason it is reading for a > stream other than *standard-input* and does not allow the lisp to change > that value. Without this, dribble may not work. See below: > > Maxima 5.25post http://maxima.sourceforge.net > using Lisp ECL 11.1.1 > 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 (trace mread) > > (MREAD) > (%i1) 3; > > 1> (MREAD # (NIL)) > <1 (MREAD ((DISPLAYINPUT (0 "stdin" SRC)) NIL 3)) > (%o1) 3 > (%i2) :lisp (defparameter *my-echo* (make-echo-stream *standard-input* > *standard-output*)) > > *MY-ECHO* > (%i2) :lisp (setf *standard-input* *my-echo*) > > # > (%i2) 4; > > 1> (MREAD # (NIL)) > <1 (MREAD ((DISPLAYINPUT (0 "stdin" SRC)) NIL 4)) > (%o2) 4 > Thanks for looking into it. Okay, then when logging in Maxima, then one should use display(t) for the computation of term t, which then shows also the input. Thanks for your help! Oliver From dtc-maxima at scieneer.com Thu Nov 10 07:21:13 2011 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Fri, 11 Nov 2011 00:21:13 +1100 Subject: [Maxima] Support for lower case CL variations. Message-ID: <4EBBCFC9.8070506@scieneer.com> Further changes have been pushed for the support of CL implementations with a mode or variation in which the standard CL symbol names are lower case. This has been tested on a Scieneer CL variation and passes all the tests. An attempt has also been made to support Allegro CL modern mode, but this is untested - if there are any issue then please let me know and they should be simple to correct. Regards Douglas Crosher From dtc-maxima at scieneer.com Thu Nov 10 08:09:37 2011 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Fri, 11 Nov 2011 01:09:37 +1100 Subject: [Maxima] Building maxima with 'flonum as 'long-float or 'double-double. Message-ID: <4EBBDB21.4090703@scieneer.com> Some further changes have been pushed for the support of building maxima with 'flonum as 'long-float or 'double-double. The translated Fortran code also needs to be modified. In the past, modified translated lisp files with the 'double-float type replaced by 'long-float were distributed separately, but these changes are incompatible with the main maxima code which requires support for the 'double-float type. A new approach has the potential to suit the standard build using a 'flonum type of 'double-float and also 'long-float and the CMUCL 'double-double types. The Fortran doubles can be translated to the CL maxima 'flonum type and Fortran double constants translated to CL floats with an 'E' exponent tag so that they are read in the default float format which will be the 'flonum type. Further the Fortran doubles can be emitted in there full precision rather then being rounded off to lower precision during translation. The f2cl translator has been modified to support this, so it is a simple matter to rebuild the translated lisp files. Patches to the main lisp files translated from Fortran are temporarily available at the link below in case anyone is interested: http://www.scieneer.com/files/maxima-lf-patch2.txt.gz Patches to f2cl are available below. Note this could use some cleaning up, and there are other approaches that would give the same result: http://www.scieneer.com/files/f2cl-patch2.txt.gz Regards Douglas Crosher From cheater00 at gmail.com Thu Nov 10 08:18:33 2011 From: cheater00 at gmail.com (cheater cheater) Date: Thu, 10 Nov 2011 15:18:33 +0100 Subject: [Maxima] Removing arbitrary values / Hello List Message-ID: Hi guys! I have just subscribed to the mailing list. Recently I've been using Maxima a lot for analyzing the performance of computer algorithms. I'm surprised at how easy it is to master. There are, however, some things that are non-obvious. I have run into a problem which I cannot get past, though. You see, I am using Maxima to do some curve fitting, and then count an integral. However, sometimes the curve fits have parameters which turn out to be "arbitrary". This isn't really so, but I guess the newton-raphson gets confused around 0. For example it'll return things such as: 3^2 + 0.22e-40*%r21 where obviously any small changes to r21 will not change the complete value at all (the changes to %r21 get truncated). The objective of the maxima code I am executing is to calculate those integrals and put them out to stdout and have the Python script (which does a lot of other work) take these numbers and continue analysis. Of course, Python cannot interpret %r21 and throws exceptions. Therefore I thought I would just plug something into those arbitrary values. I did something like this: arbitrary_values: [%r0 = 1, %r1 = 1, ..., %r30 = 1] output: ev(calculated_integral,arbitrary_values,nouns,numer) however, when I do that, I get lisp reporting errors - floating point overflow: Maxima encountered a Lisp error: arithmetic error FLOATING-POINT-OVERFLOW signalled Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. (note the formatting may be incorrect because of the way my program gets this output from maxima through stdout) What can I do? I am on Ubuntu GNU/Linux 10.04 and I understand that maxima is using the SBCL - Steel Bank Common Lisp - to run its computational engine. If anyone has any ideas, I would be very thankful. You'd help not only me but also the users of the software which will be released under GPL. Thanks for reading! From cheater00 at gmail.com Thu Nov 10 08:22:48 2011 From: cheater00 at gmail.com (cheater cheater) Date: Thu, 10 Nov 2011 15:22:48 +0100 Subject: [Maxima] Removing arbitrary values / Hello List In-Reply-To: References: Message-ID: Hi again, I have noticed that a lot of people post this info when talking about issues in maxima: (%i1) build_info(); Maxima version: 5.25.1 Maxima build date: 14:1 8/29/2011 Host type: x86_64-unknown-linux-gnu Lisp implementation type: SBCL Lisp implementation version: 1.0.29.11.debian Cheers On Thu, Nov 10, 2011 at 15:18, cheater cheater wrote: > Hi guys! I have just subscribed to the mailing list. Recently I've > been using Maxima a lot for analyzing the performance of computer > algorithms. I'm surprised at how easy it is to master. There are, > however, some things that are non-obvious. > > I have run into a problem which I cannot get past, though. You see, I > am using Maxima to do some curve fitting, and then count an integral. > However, sometimes the curve fits have parameters which turn out to be > "arbitrary". This isn't really so, but I guess the newton-raphson gets > confused around 0. For example it'll return things such as: > > 3^2 + 0.22e-40*%r21 ? ? ?where obviously any small changes to r21 will > not change the complete value at all (the changes to %r21 get > truncated). > > The objective of the maxima code I am executing is to calculate those > integrals and put them out to stdout and have the Python script (which > does a lot of other work) take these numbers and continue analysis. Of > course, Python cannot interpret %r21 and throws exceptions. Therefore > I thought I would just plug something into those arbitrary values. I > did something like this: > > arbitrary_values: [%r0 = 1, %r1 = 1, ..., %r30 = 1] > > output: ev(calculated_integral,arbitrary_values,nouns,numer) > > however, when I do that, I get lisp reporting errors - floating point overflow: > > Maxima encountered a Lisp error: > ? arithmetic error FLOATING-POINT-OVERFLOW signalled > Automatically continuing. To enable the Lisp debugger set > *debugger-hook* to nil. > > (note the formatting may be incorrect because of the way my program > gets this output from maxima through stdout) > > What can I do? > > I am on Ubuntu GNU/Linux 10.04 and I understand that maxima is using > the SBCL - Steel Bank Common Lisp - to run its computational engine. > > If anyone has any ideas, I would be very thankful. You'd help not only > me but also the users of the software which will be released under > GPL. > > Thanks for reading! > From fateman at eecs.berkeley.edu Thu Nov 10 08:35:23 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 10 Nov 2011 06:35:23 -0800 Subject: [Maxima] Removing arbitrary values / Hello List In-Reply-To: References: Message-ID: <4EBBE12B.6030801@eecs.berkeley.edu> On 11/10/2011 6:22 AM, cheater cheater wrote: > Hi again, I have noticed that a lot of people post this info ... It would probably be more useful if you indicated what program you were running. In particular, if your output truly includes 3^2, rather than 9, perhaps you have turned off simplification, in which case many programs will not operate normally. It could be that using values like 1.0 rather than 1 will help, but that is just a guess. From cheater00 at gmail.com Thu Nov 10 09:07:16 2011 From: cheater00 at gmail.com (cheater cheater) Date: Thu, 10 Nov 2011 16:07:16 +0100 Subject: [Maxima] Removing arbitrary values / Hello List In-Reply-To: <4EBBE12B.6030801@eecs.berkeley.edu> References: <4EBBE12B.6030801@eecs.berkeley.edu> Message-ID: Hey, sorry, no - you're right - I just made up that number on the fly, because I didn't have the actual output handy. This is the kind of output with the arbitrary values that I get sometimes: ["c_c", (8.643714722839287e-6*(2313820*%r18^2*%e^(20*%r19)-1416) -20*%r18^2*%e^(20*%r19)+0.0122395) ^2, [.001111111111111111*(1000*%r18^2*%e^(1000*%r19)-100*%r18^2*%e^(100*%r19)), ((450000*%r18^2*%r19^2-1000*%r18^2*%r19+%r18^2)*%e^(1000*%r19) +(45000*%r18^2*%r19^2+100*%r18^2*%r19-%r18^2)*%e^(100*%r19)) /%r19^2], "\"[[a = %r18,b = %r19,c = -8.643714722839287e-6*(2313820*%r18^2*%e^(20*%r19)-1416)]]\""] Here I am trying to fit this: y = a^2 * x * exp(b * x) + c using lsquares, with the parameters being guessed indicated as [a, b, c]. In this case, you can see the parameter array guessed by lsquares: [[a = %r18,b = %r19,c = -8.643714722839287e-6*(2313820*%r18^2*%e^(20*%r19)-1416)]] and also the error calculated by lsquares for that specific fit: (8.643714722839287e-6*(2313820*%r18^2*%e^(20*%r19)-1416) -20*%r18^2*%e^(20*%r19)+0.0122395) ^2 and then an integral counted using the fit: it's basically the area between the function's graph - let's say f(x), between x=100, x=1000, and a straight line which goes from f(100) to f(1000). Also the slope of the mentioned straight line is put out. The integral is: ((450000*%r18^2*%r19^2-1000*%r18^2*%r19+%r18^2)*%e^(1000*%r19) +(45000*%r18^2*%r19^2+100*%r18^2*%r19-%r18^2)*%e^(100*%r19)) /%r19^2 and the slope is: .001111111111111111*(1000*%r18^2*%e^(1000*%r19)-100*%r18^2*%e^(100*%r19)) Does this help any further? I get this sort of error from many fits that I run; I'm not sure where to go with this. On Thu, Nov 10, 2011 at 15:35, Richard Fateman wrote: > On 11/10/2011 6:22 AM, cheater cheater wrote: >> >> Hi again, I have noticed that a lot of people post this info > > ... > > It would probably be more useful if you indicated what program you were > running. > In particular, if your output truly includes ?3^2, ?rather than 9, ?perhaps > you have turned > off simplification, in which case many programs will not operate normally. > > It could be that ?using values like 1.0 ? ? rather than 1 ? ? will help, but > that is just a guess. > > From biomates at telefonica.net Thu Nov 10 09:28:06 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 10 Nov 2011 16:28:06 +0100 Subject: [Maxima] Third party code link broken In-Reply-To: References: <1320884373.2441.6.camel@pc> Message-ID: <1320938886.1567.3.camel@pc> El mi?, 09-11-2011 a las 20:25 -0500, Richard Hennessy escribi?: > I don't have rights to edit my submissions in this new wiki. Can you add me > as a contributor? > > Rich Sorry Richard, I don't know how to do that. And I don't even know if I have the necessary privileges to do that. Perhaps one of the administrators can help you. -- Mario From macrakis at alum.mit.edu Thu Nov 10 09:25:26 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 10 Nov 2011 10:25:26 -0500 Subject: [Maxima] Removing arbitrary values / Hello List In-Reply-To: References: <4EBBE12B.6030801@eecs.berkeley.edu> Message-ID: The best way to get help is to provide a *reproducible* report -- not just the output, but also the *exact input* that generates it. Mentioning that something is the "kind of output...I get sometimes" and " I am trying to fit this...using lsquares" (without specifying how you are calling lsquares) requires us to guess what you're doing, which isn't a very reliable way to diagnose issues. Please reproduce the problem in a *fresh* Maxima (to be sure that there isn't some previous input that changes the results) and report the inputs. Thanks, -s On Thu, Nov 10, 2011 at 10:07, cheater cheater wrote: > Hey, sorry, no - you're right - I just made up that number on the fly, > because I didn't have the actual output handy. > > This is the kind of output with the arbitrary values that I get sometimes: > > ["c_c", (8.643714722839287e-6*(2313820*%r18^2*%e^(20*%r19)-1416) > -20*%r18^2*%e^(20*%r19)+0.0122395) ^2, > [.001111111111111111*(1000*%r18^2*%e^(1000*%r19)-100*%r18^2*%e^(100*%r19)), > ((450000*%r18^2*%r19^2-1000*%r18^2*%r19+%r18^2)*%e^(1000*%r19) > +(45000*%r18^2*%r19^2+100*%r18^2*%r19-%r18^2)*%e^(100*%r19)) > /%r19^2], "\"[[a = %r18,b = %r19,c = > -8.643714722839287e-6*(2313820*%r18^2*%e^(20*%r19)-1416)]]\""] > > Here I am trying to fit this: > > y = a^2 * x * exp(b * x) + c > using lsquares, with the parameters being guessed indicated as [a, b, c]. > > In this case, you can see the parameter array guessed by lsquares: > [[a = %r18,b = %r19,c = > -8.643714722839287e-6*(2313820*%r18^2*%e^(20*%r19)-1416)]] > > and also the error calculated by lsquares for that specific fit: > > (8.643714722839287e-6*(2313820*%r18^2*%e^(20*%r19)-1416) > -20*%r18^2*%e^(20*%r19)+0.0122395) ^2 > > and then an integral counted using the fit: it's basically the area > between the function's graph - let's say f(x), between x=100, x=1000, > and a straight line which goes from f(100) to f(1000). Also the slope > of the mentioned straight line is put out. The integral is: > > ((450000*%r18^2*%r19^2-1000*%r18^2*%r19+%r18^2)*%e^(1000*%r19) > +(45000*%r18^2*%r19^2+100*%r18^2*%r19-%r18^2)*%e^(100*%r19)) > /%r19^2 > > and the slope is: > > .001111111111111111*(1000*%r18^2*%e^(1000*%r19)-100*%r18^2*%e^(100*%r19)) > > Does this help any further? > > I get this sort of error from many fits that I run; I'm not sure where > to go with this. > > > On Thu, Nov 10, 2011 at 15:35, Richard Fateman > wrote: > > On 11/10/2011 6:22 AM, cheater cheater wrote: > >> > >> Hi again, I have noticed that a lot of people post this info > > > > ... > > > > It would probably be more useful if you indicated what program you were > > running. > > In particular, if your output truly includes 3^2, rather than 9, > perhaps > > you have turned > > off simplification, in which case many programs will not operate > normally. > > > > It could be that using values like 1.0 rather than 1 will help, > but > > that is just a guess. > > > > > _______________________________________________ > 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 Thu Nov 10 09:27:52 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 10 Nov 2011 07:27:52 -0800 Subject: [Maxima] Removing arbitrary values / Hello List In-Reply-To: References: <4EBBE12B.6030801@eecs.berkeley.edu> Message-ID: <4EBBED78.2020801@eecs.berkeley.edu> In the example output you provided, you have the sub-expression %e^(1000*%r19). If %r19 = 1, this cannot be computed in double float. It is about 1.97 x 10^434. The largest double float is about 1.8 x 10 ^ 308. Good luck. PS In the future, it would be good if you could provide exactly the commands you use, so someone else could try to duplicate your problem. From cheater00 at gmail.com Thu Nov 10 09:41:25 2011 From: cheater00 at gmail.com (cheater cheater) Date: Thu, 10 Nov 2011 16:41:25 +0100 Subject: [Maxima] Removing arbitrary values / Hello List In-Reply-To: <4EBBED78.2020801@eecs.berkeley.edu> References: <4EBBE12B.6030801@eecs.berkeley.edu> <4EBBED78.2020801@eecs.berkeley.edu> Message-ID: Indeed, I do have this overflow there. Interesting. Maybe I should try substituting all arbitrary values for some sort of smallest-possible floating point value? But then I could get an underflow, right? All of the parameters I use are of positive exponents, so I shouldn't get overflows this way... let me think about it for a second. But really, the problem is that lsquares is marking those values as arbitrary. It's using newton-raphson after all - it should have some internal state where those "arbitrary" values do compute to something. Is there a way to get those out? Maybe I could use a different solver? The whole point of this program is that I have a statistical series, and a list of functions that I fit against the data using lsquares: FC: [] $ FC: endcons(["a_a", [a, b ], y = a^2 * (x)^0.5 + b], FC) $ FC: endcons(["a_b", [a, b ], y = a^2 * (x ) + b], FC) $ FC: endcons(["a_c", [a, b, u], y = a^2 * (x - u)^2 + b], FC) $ FC: endcons(["a_d", [a, b, u], y = a^2 * (x - u)^3 + b], FC) $ FC: endcons(["a_e", [a, b ], y = a^2 * (x )^4 + b], FC) $ FC: endcons(["b_a", [a, b], y = a^2 * log(0.0001 + x^2) + b], FC) $ FC: endcons(["b_b", [a, b], y = a^2 * x^0.5 * log(0.0001 + x^2) + b], FC) $ FC: endcons(["b_c", [a, b], y = a^2 * x * log(0.0001 + x^2) + b], FC) $ FC: endcons(["b_d", [a, b], y = a^2 * x^2 * log(0.0001 + x^2) + b], FC) $ FC: endcons(["c_a", [a, b, c], y = a^2 * exp(b * x) + c], FC) $ /*FC: endcons(["c_b", [a, b, c], y = a^2 * x^0.5 * exp(b * x) + c], FC) $*/ FC: endcons(["c_c", [a, b, c], y = a^2 * x * exp(b * x) + c], FC) $ FC: endcons(["c_d", [a, b, c], y = a^2 * x^2 * exp(b * x) + c], FC) $ There are some issues with lsquares already - for example it doesn't allow you to narrow down the search space, that's why I have to use e.g. "a^2" and not just "a" above. Maybe there's something "better" than lsquares? Another idea - which I will try now - follows: The overflows I got in this example are from the integral. Maybe if I get numerize the values (the guessed parameters, in this case a and b) before the integral is calculated, then the integral could "work". Stavros, here's an example input that "breaks": ((450000*%r18^2*%r19^2-1000*%r18^2*%r19+%r18^2)*%e^(1000*%r19) +(45000*%r18^2*%r19^2+100*%r18^2*%r19-%r18^2)*%e^(100*%r19)) /%r19^2,[%r18 = 1.1, %r19 = 1.1]; $ maxima Maxima 5.25.1 http://maxima.sourceforge.net using Lisp SBCL 1.0.29.11.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) ((450000*%r18^2*%r19^2-1000*%r18^2*%r19+%r18^2)*%e^(1000*%r19) +(45000*%r18^2*%r19^2+100*%r18^2*%r19-%r18^2)*%e^(100*%r19)) /%r19^2,[%r18 = 1.1, %r19 = 1.1]; Maxima encountered a Lisp error: arithmetic error FLOATING-POINT-OVERFLOW signalled Automatically continuing. Thanks for the very useful responses so far guys. On Thu, Nov 10, 2011 at 16:27, Richard Fateman wrote: > > > In the example output you provided, you have the sub-expression > %e^(1000*%r19). > If %r19 = 1, ? this cannot be computed in double float. ?It is about 1.97 x > 10^434. > The largest double float is about 1.8 x 10 ^ 308. > > Good luck. > > PS > In the future, it would be good if you could provide exactly the commands > you use, so someone else could try to duplicate your problem. > From macrakis at alum.mit.edu Thu Nov 10 09:54:54 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 10 Nov 2011 10:54:54 -0500 Subject: [Maxima] Removing arbitrary values / Hello List In-Reply-To: References: <4EBBE12B.6030801@eecs.berkeley.edu> <4EBBED78.2020801@eecs.berkeley.edu> Message-ID: Re your example that "breaks", this just causes float overflow -- after all, %e^1000 is itself a float overflow (bfloat(%e^1000) => 2b434). Evaluate with bfloats and there is no problem: expr: ((450000*%r18^2*%r19^2-1000*%r18^2*%r19+%r18^2)*%e^(1000*%r19) +(45000*%r18^2*%r19^2+100*%r18^2*%r19-%r18^2)*%e^(100*%r19)) /%r19^2$ bfloat(expr),[%r18 = 1.1b0, %r19 = 1.1b0]; => 2.877733197731823b483 But you still haven't shown us how you're using lsquares to get your problematic expression. And I'm not clear on what you're trying to accomplish. -s On Thu, Nov 10, 2011 at 10:41, cheater cheater wrote: > %r18 = 1.1, %r19 = 1.1]; -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Thu Nov 10 10:16:15 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 10 Nov 2011 08:16:15 -0800 Subject: [Maxima] Removing arbitrary values / Hello List In-Reply-To: References: <4EBBE12B.6030801@eecs.berkeley.edu> <4EBBED78.2020801@eecs.berkeley.edu> Message-ID: <4EBBF8CF.4090407@eecs.berkeley.edu> On 11/10/2011 7:41 AM, cheater cheater wrote: > Indeed, I do have this overflow there. Interesting. ... You still haven't provided the command(s) that produce the output. Any result that looks like p(x)*exp(100*r1) + q(x)*exp(1000*r2) is extremely likely to be nonsensical unless r1=r2=0. My guess is that you have to think about what you are asking and what the answer means, (if anything). I am personally not familiar with lsquares, and I cannot have any useful comments about the use of newton-raphson within it. From cheater00 at gmail.com Thu Nov 10 10:40:38 2011 From: cheater00 at gmail.com (cheater cheater) Date: Thu, 10 Nov 2011 17:40:38 +0100 Subject: [Maxima] Removing arbitrary values / Hello List In-Reply-To: <4EBBF8CF.4090407@eecs.berkeley.edu> References: <4EBBE12B.6030801@eecs.berkeley.edu> <4EBBED78.2020801@eecs.berkeley.edu> <4EBBF8CF.4090407@eecs.berkeley.edu> Message-ID: Hey Richard, On Thu, Nov 10, 2011 at 17:16, Richard Fateman wrote: > On 11/10/2011 7:41 AM, cheater cheater wrote: >> >> Indeed, I do have this overflow there. Interesting. > > ... > You still haven't provided the command(s) that produce the output. I realize - sorry about that. I'm in the process of putting everything up in a repository. Please bear with me. > Any result that looks like p(x)*exp(100*r1) + q(x)*exp(1000*r2) is > extremely likely to be nonsensical unless r1=r2=0. > > My guess is that you have to ?think about what you are asking and what the > answer means, (if anything). > > I am personally not familiar with lsquares, and I cannot have any useful > comments about the use of newton-raphson within it. What do you use or recommend for curve fitting like what I'm doing? I have a set of points, and I have an equation of the form y = f(x, a, b, c, ... z) where a ... z are arbitrary parameters (sometimes it's just a, b, and c, like above). Thanks From renekaelin at gmx.ch Thu Nov 10 10:51:34 2011 From: renekaelin at gmx.ch (rene kaelin) Date: Thu, 10 Nov 2011 17:51:34 +0100 Subject: [Maxima] sqrt vs ^0.5 In-Reply-To: References: Message-ID: Dear maxima users Why don't both expressions simplify to zero? (%i1) sqrt(0.1)-sqrt(1/10); (%o1) .3162277660168379-1/sqrt(10) (%i2) 0.1^0.5-(1/10)^0.5; (%o2) 0.0 Manual: Function: SQRT (X) the square root of X. It is represented internally by X^(1/2). Also see ROOTSCONTRACT. RADEXPAND[TRUE] - if TRUE will cause nth roots of factors of a product which are powers of n to be pulled outside of the radical, e.g. SQRT(16*X^2) will become 4*X only if RADEXPAND is TRUE. Maxima version: 5.21.1 Maxima build date: 16:28 5/16/2010 Host type: i686-apple-darwin10.3.0 Lisp implementation type: SBCL Lisp implementation version: 1.0.38 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cheater00 at gmail.com Thu Nov 10 11:30:43 2011 From: cheater00 at gmail.com (cheater cheater) Date: Thu, 10 Nov 2011 18:30:43 +0100 Subject: [Maxima] sqrt vs ^0.5 In-Reply-To: References: Message-ID: Hi Rene, they do: (%i1) sqrt(0.1)-sqrt(1/10); (%o1) .3162277660168379 - 1/sqrt(10) (%i2) ev(sqrt(0.1)-sqrt(1/10),numer); (%o2) 0.0 You just have to invoke numeric evaluation. Hope this helps On Thu, Nov 10, 2011 at 17:51, rene kaelin wrote: > Dear maxima users > Why don't both expressions simplify to zero? > (%i1)?sqrt(0.1)-sqrt(1/10); > (%o1) .3162277660168379-1/sqrt(10) > (%i2)?0.1^0.5-(1/10)^0.5; > (%o2) 0.0 > Manual: > Function:?SQRT?(X)the square root of X. It is represented internally by > X^(1/2). Also see ROOTSCONTRACT. RADEXPAND[TRUE] - if TRUE will cause nth > roots of factors of a product which are powers of n to be pulled outside of > the radical, e.g. SQRT(16*X^2) will become 4*X only if RADEXPAND is TRUE. > Maxima version: 5.21.1Maxima build date: 16:28 5/16/2010Host type: > i686-apple-darwin10.3.0Lisp implementation type: SBCLLisp implementation > version: 1.0.38 > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > From fateman at eecs.berkeley.edu Thu Nov 10 12:04:31 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 10 Nov 2011 10:04:31 -0800 Subject: [Maxima] sqrt vs ^0.5 In-Reply-To: References: Message-ID: <4EBC122F.5000708@eecs.berkeley.edu> On 11/10/2011 9:30 AM, cheater cheater wrote: > Hi Rene, > they do: > > (%i1) sqrt(0.1)-sqrt(1/10); > (%o1) .3162277660168379 - 1/sqrt(10) > (%i2) ev(sqrt(0.1)-sqrt(1/10),numer); > (%o2) 0.0 > > You just have to invoke numeric evaluation. > > Hope this helps Actually, 0.1 is not equal to 1/10. 0.1 is a floating point number which is converted to double-float binary, in which internal form it is exactly equal to 3602879701896397/2^55. This is NOT exactly equal to 1/10. They differ by 1/180143985094819840 or 1/(5*2^55). The only way 0.1 - 1/10 is computed as zero is if the user forces exact numbers be converted to nearby floating-point numbers. In this case the two values coincide. > On Thu, Nov 10, 2011 at 17:51, rene kaelin wrote: >> Dear maxima users >> Why don't both expressions simplify to zero? >> (%i1) sqrt(0.1)-sqrt(1/10); >> (%o1) .3162277660168379-1/sqrt(10) >> (%i2) 0.1^0.5-(1/10)^0.5; >> (%o2) 0.0 >> Manual: >> Function: SQRT (X)the square root of X. It is represented internally by >> X^(1/2). Also see ROOTSCONTRACT. RADEXPAND[TRUE] - if TRUE will cause nth >> roots of factors of a product which are powers of n to be pulled outside of >> the radical, e.g. SQRT(16*X^2) will become 4*X only if RADEXPAND is TRUE. >> Maxima version: 5.21.1Maxima build date: 16:28 5/16/2010Host type: >> i686-apple-darwin10.3.0Lisp implementation type: SBCLLisp implementation >> version: 1.0.38 >> >> >> _______________________________________________ >> 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 cheater00 at gmail.com Thu Nov 10 12:15:38 2011 From: cheater00 at gmail.com (cheater cheater) Date: Thu, 10 Nov 2011 19:15:38 +0100 Subject: [Maxima] sqrt vs ^0.5 In-Reply-To: <4EBC122F.5000708@eecs.berkeley.edu> References: <4EBC122F.5000708@eecs.berkeley.edu> Message-ID: That seems to be the default then, doesn't it? Cheers On Thu, Nov 10, 2011 at 19:04, Richard Fateman wrote: > On 11/10/2011 9:30 AM, cheater cheater wrote: >> >> Hi Rene, >> they do: >> >> (%i1) sqrt(0.1)-sqrt(1/10); >> (%o1) ? ? ? ? ? ? ? ? ? ?.3162277660168379 - 1/sqrt(10) >> (%i2) ev(sqrt(0.1)-sqrt(1/10),numer); >> (%o2) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0.0 >> >> You just have to invoke numeric evaluation. >> >> Hope this helps > > Actually, 0.1 is not equal to 1/10. > > 0.1 ?is a floating point number which is converted to double-float binary, > in which internal form it is > exactly equal to 3602879701896397/2^55. > > This is NOT exactly equal to 1/10. They differ by 1/180143985094819840 or > 1/(5*2^55). > > The only way 0.1 - 1/10 is computed as zero is if the user forces exact > numbers be converted to nearby floating-point numbers. ?In this case the two > values coincide. > > > > > > >> On Thu, Nov 10, 2011 at 17:51, rene kaelin ?wrote: >>> >>> Dear maxima users >>> Why don't both expressions simplify to zero? >>> (%i1) sqrt(0.1)-sqrt(1/10); >>> (%o1) .3162277660168379-1/sqrt(10) >>> (%i2) 0.1^0.5-(1/10)^0.5; >>> (%o2) 0.0 >>> Manual: >>> Function: SQRT (X)the square root of X. It is represented internally by >>> X^(1/2). Also see ROOTSCONTRACT. RADEXPAND[TRUE] - if TRUE will cause nth >>> roots of factors of a product which are powers of n to be pulled outside >>> of >>> the radical, e.g. SQRT(16*X^2) will become 4*X only if RADEXPAND is TRUE. >>> Maxima version: 5.21.1Maxima build date: 16:28 5/16/2010Host type: >>> i686-apple-darwin10.3.0Lisp implementation type: SBCLLisp implementation >>> version: 1.0.38 >>> >>> >>> _______________________________________________ >>> 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 junglejesus93 at gmail.com Thu Nov 10 12:23:34 2011 From: junglejesus93 at gmail.com (Casey Coleman) Date: Thu, 10 Nov 2011 10:23:34 -0800 Subject: [Maxima] The homotopy derivative Message-ID: <707E7657-429F-42EA-B410-CACE0950585F@gmail.com> Hello Maxima. I am a new member of the mailing list, so please forgive me if I do something stupid. I have become very interested in the Homotopy Analysis Method, which is a powerful tool for analyzing nonlinear systems. The basic principle is to use homotopy to continuously transform a guess solution into the correct one. In the case of differential equations, one begins by constructing a power series in the homotopy parameter q with an unknown function of x as the coefficient of q^k. One then repeatedly takes the homotopy derivative of both sides, thus building a series of recurrence relations from which the unknown functions of x can be built. The solution to the problem is the homotopy series when q=1. Here is my problem: I wish to automate the homotopy derivative, whose properties can be derived from the ordinary derivative. Here is the definition of the homotopy derivative: Let y be a homotopy series. D[m](y)=1/m!d^m(y)/dq^m | q=0 The main property here is that the nth homotopy derivative of a homotopy series is the nth function of x in that series. There are, theoretically, infinitely many of these functions. I've tried constructing the series using Maxima's sum function. The problem is that an arbitrary power series like that is meaningless to maxima, and the homotopy derivative, as I've defined it, just returns zero every time. To start things off, how could I represent an undetermined power series in Maxima (do I necessarily have to truncate the series first? I don't have to when doing calculations by hand, so why should I?) -- thank you for your patients, Casey From ph0enix2011-list at yahoo.cn Thu Nov 10 12:26:22 2011 From: ph0enix2011-list at yahoo.cn (Pheonix) Date: Thu, 10 Nov 2011 13:26:22 -0500 Subject: [Maxima] sqrt vs ^0.5 In-Reply-To: <4EBC122F.5000708@eecs.berkeley.edu> References: <4EBC122F.5000708@eecs.berkeley.edu> Message-ID: <1320949630.26474.4.camel@MathHacker.dhcp.nd.edu> On Thu, 2011-11-10 at 10:04 -0800, Richard Fateman wrote: > > > > Hope this helps > > Actually, 0.1 is not equal to 1/10. > > 0.1 is a floating point number which is converted to double-float > binary, in which internal form it is > exactly equal to 3602879701896397/2^55. > > This is NOT exactly equal to 1/10. They differ by 1/180143985094819840 > or 1/(5*2^55). Hi Richard, In what way do you get the exact internal representation of double-float 0.1 inside maxima ? Dan From macrakis at alum.mit.edu Thu Nov 10 13:07:21 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 10 Nov 2011 14:07:21 -0500 Subject: [Maxima] sqrt vs ^0.5 In-Reply-To: <1320949630.26474.4.camel@MathHacker.dhcp.nd.edu> References: <4EBC122F.5000708@eecs.berkeley.edu> <1320949630.26474.4.camel@MathHacker.dhcp.nd.edu> Message-ID: rationalize(.1) => 3602879701896397 / 36028797018963968 On Thu, Nov 10, 2011 at 13:26, Pheonix wrote: > On Thu, 2011-11-10 at 10:04 -0800, Richard Fateman wrote: > > > > > > Hope this helps > > > > Actually, 0.1 is not equal to 1/10. > > > > 0.1 is a floating point number which is converted to double-float > > binary, in which internal form it is > > exactly equal to 3602879701896397/2^55. > > > > This is NOT exactly equal to 1/10. They differ by 1/180143985094819840 > > or 1/(5*2^55). > > Hi Richard, > > In what way do you get the exact internal representation of double-float > 0.1 inside maxima ? > > Dan > > _______________________________________________ > 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 Thu Nov 10 13:07:56 2011 From: l_butler at users.sourceforge.net (Leo Butler) Date: Thu, 10 Nov 2011 19:07:56 +0000 Subject: [Maxima] Removing arbitrary values / Hello List In-Reply-To: (message from cheater cheater on Thu, 10 Nov 2011 16:41:25 +0100) Message-ID: <1qpmxc3okxf.fsf@iceland.freeshell.org> Cheater, see the discussion here http://meta.tex.stackexchange.com/questions/228/ive-just-been-told-i-have-to-write-a-minimal-example-what-is-that on 'minimal working example'. In debugging code, you need to sort the wheat from the chaff (rather like Newton-Raphson does), cut out the extraneous bits until you have a small bit of code that reproduces the error/problem you are seeing. At that point, if you are still at nines, please post a question with the code. Most times you won't need to, because you will have found and fixed the problem. cheater cheater writes: > Indeed, I do have this overflow there. Interesting. Maybe I should try > substituting all arbitrary values for some sort of smallest-possible > floating point value? But then I could get an underflow, right? All of > the parameters I use are of positive exponents, so I shouldn't get > overflows this way... let me think about it for a second. > > But really, the problem is that lsquares is marking those values as > arbitrary. It's using newton-raphson after all - it should have some > internal state where those "arbitrary" values do compute to something. No, if you recall, Newton-Raphson inverts the Jacobian/solves a system of linear equations at each iteration. This is likely where the arbitary constants are appearing. This means your starting points, model or both are likely poorly specified. -- Leo Butler SDF Public Access UNIX System - http://sdf.lonestar.org From macrakis at alum.mit.edu Thu Nov 10 13:14:40 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 10 Nov 2011 14:14:40 -0500 Subject: [Maxima] sqrt vs ^0.5 In-Reply-To: References: <4EBC122F.5000708@eecs.berkeley.edu> Message-ID: *What* "seems to be the default"? -s On Thu, Nov 10, 2011 at 13:15, cheater cheater wrote: > That seems to be the default then, doesn't it? > > Cheers > > On Thu, Nov 10, 2011 at 19:04, Richard Fateman > wrote: > > On 11/10/2011 9:30 AM, cheater cheater wrote: > >> > >> Hi Rene, > >> they do: > >> > >> (%i1) sqrt(0.1)-sqrt(1/10); > >> (%o1) .3162277660168379 - 1/sqrt(10) > >> (%i2) ev(sqrt(0.1)-sqrt(1/10),numer); > >> (%o2) 0.0 > >> > >> You just have to invoke numeric evaluation. > >> > >> Hope this helps > > > > Actually, 0.1 is not equal to 1/10. > > > > 0.1 is a floating point number which is converted to double-float > binary, > > in which internal form it is > > exactly equal to 3602879701896397/2^55. > > > > This is NOT exactly equal to 1/10. They differ by 1/180143985094819840 or > > 1/(5*2^55). > > > > The only way 0.1 - 1/10 is computed as zero is if the user forces exact > > numbers be converted to nearby floating-point numbers. In this case the > two > > values coincide. > > > > > > > > > > > > > >> On Thu, Nov 10, 2011 at 17:51, rene kaelin wrote: > >>> > >>> Dear maxima users > >>> Why don't both expressions simplify to zero? > >>> (%i1) sqrt(0.1)-sqrt(1/10); > >>> (%o1) .3162277660168379-1/sqrt(10) > >>> (%i2) 0.1^0.5-(1/10)^0.5; > >>> (%o2) 0.0 > >>> Manual: > >>> Function: SQRT (X)the square root of X. It is represented internally by > >>> X^(1/2). Also see ROOTSCONTRACT. RADEXPAND[TRUE] - if TRUE will cause > nth > >>> roots of factors of a product which are powers of n to be pulled > outside > >>> of > >>> the radical, e.g. SQRT(16*X^2) will become 4*X only if RADEXPAND is > TRUE. > >>> Maxima version: 5.21.1Maxima build date: 16:28 5/16/2010Host type: > >>> i686-apple-darwin10.3.0Lisp implementation type: SBCLLisp > implementation > >>> version: 1.0.38 > >>> > >>> > >>> _______________________________________________ > >>> 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 woollett at charter.net Thu Nov 10 14:00:18 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 10 Nov 2011 12:00:18 -0800 Subject: [Maxima] feature request: imagpart (bessel_y) Message-ID: Maxima knows that imagpart ( bessel_j(1,x)) is identically zero (since x is by default real). This allows much faster use of quad_qag via nint, as shown below, as compared with the analogous calculation for bessel_y. In the following, details=true, so information about method appears. ---------------------------------- (%i1) load(nint); (%o1) "c:/work2/nint.mac" /* case bessel_j */ (%i2) imagpart(bessel_j(1,x)); (%o2) 0 (%i3) imagpart(bessel_j(2,sqrt(2)*x)); (%o3) 0 (%i4) nint(bessel_j(1,x)*bessel_j(2,sqrt(2)*x),x,1,1000,strong_osc); quad_qag (%o4) 0.47382488780922 (%i5) time(%); (%o5) [6.42] (%i6) goutL; (%o6) [[qag,0.47382488780922,3.0088677226459195E-9,7843,0]] (%i7) gargL; (%o7) [[qag,bessel_j(1,x)*bessel_j(2,sqrt(2)*x),x,1,1000,3,epsrel = 1.0E-8, limit = 700]] /* case bessel_y */ (%i8) imagpart(bessel_y(1,x)); (%o8) 'imagpart(bessel_y(1,x)) (%i9) imagpart(bessel_y(2,sqrt(2)*x)); (%o9) 'imagpart(bessel_y(2,sqrt(2)*x)) (%i10) nint(bessel_y(1,x)*bessel_y(2,sqrt(2)*x),x,1,1000,strong_osc); quad_qag (%o10) 0.44737052335548 (%i11) time(%); (%o11) [19.78] (%i12) goutL; (%o12) [[[qag,0.44737052335548,3.0438548004320586E-9,7905,0], [qag,0.0,0.0,31,0]]] (%i13) gargL; (%o13) [[[qag, 'realpart(bessel_y(1,x))*'realpart(bessel_y(2,sqrt(2)*x)) -'imagpart(bessel_y(1,x))*'imagpart(bessel_y(2,sqrt(2)*x)),x,1, 1000,3,epsrel = 1.0E-8,limit = 700], [qag, 'imagpart(bessel_y(1,x))*'realpart(bessel_y(2,sqrt(2)*x)) +'realpart(bessel_y(1,x))*'imagpart(bessel_y(2,sqrt(2)*x)),x,1, 1000,3,epsrel = 1.0E-8,limit = 700]]] ----------------------------------------------------------- Hence the feature request: Add imagpart knowledge to bessel_y code and simplification. Ted Woollett From kd.gregson at btinternet.com Thu Nov 10 14:35:23 2011 From: kd.gregson at btinternet.com (Kevin Gregson) Date: Thu, 10 Nov 2011 20:35:23 -0000 Subject: [Maxima] Problem with translate_file() in Maxima-5.25.1 Message-ID: On 9th Nov 2011, Robert Dodier wrote: > Not sure what you mean by "program mode". > Let's back up -- what are you trying to accomplish? Sorry for not being clear. By "program mode" I mean "within a Maxima function". Following rk, I am trying to write a Maxima function foo1 which will construct and translate another function foo2, such that foo1 can also be translated. So: foo1(u,v):=block( define(funmake(foo2,[x,y]),x+y), translate(foo2), foo2(u,v)); Maxima interprets this OK. But after translate(foo1); calling foo1(2,3) produces Error in APPLY [or a callee]: The function MDEFINE is undefined. Since the interpreter can manage it, I thought that the solution to this was to replace define(etc), with ?meval(something), but I didn't know what the something was. After receiving your reply, I realised that it should be: ?meval('(define(funmake(foo2,[x,y]),x+y))), Then, after translate(foo1), things work. If the translate(foo2) call is omitted, things still work in Maxima-5.25.1, but -5.20.1 needs to be told that foo2 is a function by calling it as apply(foo2,[u,v]), which produces an inconsequential translator warning. ?meval() seems a useful way of dealing with expressions that the interpreter handles, but the translator doesn't. In answer to my query on how to translate and name an anonymous function, Robert Dodier wrote: > I suppose you could do something like: > > (defun $make_named_function (name body) > (let ((my-lisp-lambda ($translate body))) > (setf (symbol-function name) my-lisp-lambda))) > > Disclaimer: I didn't actually try the above code. Unfortunately, calling make_named_function() produces Error in LET [or a callee]: The function $TRANSLATE is undefined. Is this because $translate is a special evaluation form? But, with an answer to the ?meval problem, I don't need this translation. Thank you for your help, Kevin Gregson -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdieterkaiser at web.de Thu Nov 10 14:39:21 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 10 Nov 2011 21:39:21 +0100 Subject: [Maxima] feature request: imagpart (bessel_y) In-Reply-To: References: Message-ID: <1320957561.2089.2.camel@dieter> Am Donnerstag, den 10.11.2011, 12:00 -0800 schrieb Edwin Woollett: > > Hence the feature request: > > Add imagpart knowledge to bessel_y code > and simplification. > > Ted Woollett The imaginary part of bessel_y(n,x) is zero only for a positive argument x. Maxima already has this knowledge: (%i1) imagpart(bessel_y(1, x)); (%o1) imagpart(bessel_y(1, x)) (%i2) assume(x>0); (%o2) [x > 0] (%i3) imagpart(bessel_y(1, x)); (%o3) 0 Dieter Kaiser From drdieterkaiser at web.de Thu Nov 10 14:47:38 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 10 Nov 2011 21:47:38 +0100 Subject: [Maxima] Problem running symmgrp2009.max with recent versions of Maxima In-Reply-To: References: <3C6A1C9C-859B-4880-B0B2-2AC7B5964311@glam.ac.uk> <1320871867.1825.24.camel@dieter> Message-ID: <1320958058.2089.7.camel@dieter> Am Donnerstag, den 10.11.2011, 08:44 +0000 schrieb Wiltshire R J (AT): > Dear Dieter, > > > Thanks for your reply and certainly what you describe is compatible > with the following error message which I get when I run the program > (Maxima 5.25.0 on a Mac): > > > > > depends: argument must be a symbol; found x[1] > #0: symmetry(ind1=1,ind2=0,ind3=0)(symmgrp2009.max line 924) > -- an error. To debug this try: debugmode(true); > I had a look at the problem in general. I will try an implementation of dependencies which allows subscripted variables in addition. I need some days. Dieter Kaiser From rswarbrick at gmail.com Thu Nov 10 15:03:04 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Thu, 10 Nov 2011 21:03:04 +0000 Subject: [Maxima] The homotopy derivative References: <707E7657-429F-42EA-B410-CACE0950585F@gmail.com> Message-ID: Casey Coleman writes: > There are, theoretically, infinitely many of these functions. I've > tried constructing the series using Maxima's sum function. The problem > is that an arbitrary power series like that is meaningless to maxima, > and the homotopy derivative, as I've defined it, just returns zero > every time. > > To start things off, how could I represent an undetermined power > series in Maxima (do I necessarily have to truncate the series first? > I don't have to when doing calculations by hand, so why should I?) Hi, I haven't got any code to contribute (I seem to have deleted it(!)), but I would suggest working with an expression for the n'th term in the sequence rather than with the sum itself. If you haven't got a formula for that, I can't really see how you could meaningfully talk about the entire sum either. The disadvantage of this approach is that if F and G are formal power series in R[[x]], say, then FG has n'th term given by a sum with finitely many terms, but not a fixed number. Maxima doesn't seem to be great at dealing with such things... Oh, the one other thing I'd suggest is to avoid subscripted variables like a[n]. They behave weirdly (if helpfully, at times) and it's really easy to start getting bizarre results with them! > -- thank you for your patients, > Casey Well, I have no patients to hand, but the cider on my right has supplied me with some patience... :-) Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From cheater00 at gmail.com Thu Nov 10 15:15:33 2011 From: cheater00 at gmail.com (cheater cheater) Date: Thu, 10 Nov 2011 22:15:33 +0100 Subject: [Maxima] sqrt vs ^0.5 In-Reply-To: References: <4EBC122F.5000708@eecs.berkeley.edu> Message-ID: The only thing that was argued to be or not be on, which is: > The only way 0.1 - 1/10 is computed as zero is if the user forces exact > numbers be converted to nearby floating-point numbers. In this case the > two > values coincide. Cheers! On Thu, Nov 10, 2011 at 20:14, Stavros Macrakis wrote: > *What* "seems to be the default"? > ? ? ? ? ? ?-s > On Thu, Nov 10, 2011 at 13:15, cheater cheater wrote: >> >> That seems to be the default then, doesn't it? >> >> Cheers >> >> On Thu, Nov 10, 2011 at 19:04, Richard Fateman >> wrote: >> > On 11/10/2011 9:30 AM, cheater cheater wrote: >> >> >> >> Hi Rene, >> >> they do: >> >> >> >> (%i1) sqrt(0.1)-sqrt(1/10); >> >> (%o1) ? ? ? ? ? ? ? ? ? ?.3162277660168379 - 1/sqrt(10) >> >> (%i2) ev(sqrt(0.1)-sqrt(1/10),numer); >> >> (%o2) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0.0 >> >> >> >> You just have to invoke numeric evaluation. >> >> >> >> Hope this helps >> > >> > Actually, 0.1 is not equal to 1/10. >> > >> > 0.1 ?is a floating point number which is converted to double-float >> > binary, >> > in which internal form it is >> > exactly equal to 3602879701896397/2^55. >> > >> > This is NOT exactly equal to 1/10. They differ by 1/180143985094819840 >> > or >> > 1/(5*2^55). >> > >> > The only way 0.1 - 1/10 is computed as zero is if the user forces exact >> > numbers be converted to nearby floating-point numbers. ?In this case the >> > two >> > values coincide. >> > >> > >> > >> > >> > >> > >> >> On Thu, Nov 10, 2011 at 17:51, rene kaelin ?wrote: >> >>> >> >>> Dear maxima users >> >>> Why don't both expressions simplify to zero? >> >>> (%i1) sqrt(0.1)-sqrt(1/10); >> >>> (%o1) .3162277660168379-1/sqrt(10) >> >>> (%i2) 0.1^0.5-(1/10)^0.5; >> >>> (%o2) 0.0 >> >>> Manual: >> >>> Function: SQRT (X)the square root of X. It is represented internally >> >>> by >> >>> X^(1/2). Also see ROOTSCONTRACT. RADEXPAND[TRUE] - if TRUE will cause >> >>> nth >> >>> roots of factors of a product which are powers of n to be pulled >> >>> outside >> >>> of >> >>> the radical, e.g. SQRT(16*X^2) will become 4*X only if RADEXPAND is >> >>> TRUE. >> >>> Maxima version: 5.21.1Maxima build date: 16:28 5/16/2010Host type: >> >>> i686-apple-darwin10.3.0Lisp implementation type: SBCLLisp >> >>> implementation >> >>> version: 1.0.38 >> >>> >> >>> >> >>> _______________________________________________ >> >>> 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 macrakis at alum.mit.edu Thu Nov 10 15:27:39 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 10 Nov 2011 16:27:39 -0500 Subject: [Maxima] sqrt vs ^0.5 In-Reply-To: References: <4EBC122F.5000708@eecs.berkeley.edu> Message-ID: I don't recall any argument about something being on or off -- what do you have in mind? That mixed arithmetic between rationals and floats converts to floats? Yes, that is Maxima's behavior and as far as I know that can't be turned off -- so there is no 'default'. Unfortunately, constant expressions which are not literal rationals don't participate in this behavior: sqrt(5.0) - sqrt(5) does not simplify to 0. In my opinion, it should. -s On Thu, Nov 10, 2011 at 16:15, cheater cheater wrote: > The only thing that was argued to be or not be on, which is: > > > The only way 0.1 - 1/10 is computed as zero is if the user forces exact > > numbers be converted to nearby floating-point numbers. In this case the > > two > > values coincide. > > Cheers! > > On Thu, Nov 10, 2011 at 20:14, Stavros Macrakis > wrote: > > *What* "seems to be the default"? > > -s > > On Thu, Nov 10, 2011 at 13:15, cheater cheater > wrote: > >> > >> That seems to be the default then, doesn't it? > >> > >> Cheers > >> > >> On Thu, Nov 10, 2011 at 19:04, Richard Fateman > >> wrote: > >> > On 11/10/2011 9:30 AM, cheater cheater wrote: > >> >> > >> >> Hi Rene, > >> >> they do: > >> >> > >> >> (%i1) sqrt(0.1)-sqrt(1/10); > >> >> (%o1) .3162277660168379 - 1/sqrt(10) > >> >> (%i2) ev(sqrt(0.1)-sqrt(1/10),numer); > >> >> (%o2) 0.0 > >> >> > >> >> You just have to invoke numeric evaluation. > >> >> > >> >> Hope this helps > >> > > >> > Actually, 0.1 is not equal to 1/10. > >> > > >> > 0.1 is a floating point number which is converted to double-float > >> > binary, > >> > in which internal form it is > >> > exactly equal to 3602879701896397/2^55. > >> > > >> > This is NOT exactly equal to 1/10. They differ by 1/180143985094819840 > >> > or > >> > 1/(5*2^55). > >> > > >> > The only way 0.1 - 1/10 is computed as zero is if the user forces > exact > >> > numbers be converted to nearby floating-point numbers. In this case > the > >> > two > >> > values coincide. > >> > > >> > > >> > > >> > > >> > > >> > > >> >> On Thu, Nov 10, 2011 at 17:51, rene kaelin > wrote: > >> >>> > >> >>> Dear maxima users > >> >>> Why don't both expressions simplify to zero? > >> >>> (%i1) sqrt(0.1)-sqrt(1/10); > >> >>> (%o1) .3162277660168379-1/sqrt(10) > >> >>> (%i2) 0.1^0.5-(1/10)^0.5; > >> >>> (%o2) 0.0 > >> >>> Manual: > >> >>> Function: SQRT (X)the square root of X. It is represented internally > >> >>> by > >> >>> X^(1/2). Also see ROOTSCONTRACT. RADEXPAND[TRUE] - if TRUE will > cause > >> >>> nth > >> >>> roots of factors of a product which are powers of n to be pulled > >> >>> outside > >> >>> of > >> >>> the radical, e.g. SQRT(16*X^2) will become 4*X only if RADEXPAND is > >> >>> TRUE. > >> >>> Maxima version: 5.21.1Maxima build date: 16:28 5/16/2010Host type: > >> >>> i686-apple-darwin10.3.0Lisp implementation type: SBCLLisp > >> >>> implementation > >> >>> version: 1.0.38 > >> >>> > >> >>> > >> >>> _______________________________________________ > >> >>> 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 villate at fe.up.pt Thu Nov 10 16:26:07 2011 From: villate at fe.up.pt (Jaime Villate) Date: Thu, 10 Nov 2011 22:26:07 +0000 Subject: [Maxima] pop and push? Message-ID: <4EBC4F7F.8080506@fe.up.pt> Hi, while updating the manual section on Lists, I noticed that the pop() and push() functions described in the manual do not seem to make part of core Maxima anymore: (%i2) pop([1,2,3]); (%o2) pop([1,2,3]) (%i3) push(0, [1,2,3]); (%o3) push(0, [1,2,3]) have they been moved to some additional package, or were they removed? Cheers, Jaime From willisb at unk.edu Thu Nov 10 17:17:12 2011 From: willisb at unk.edu (Barton Willis) Date: Thu, 10 Nov 2011 17:17:12 -0600 Subject: [Maxima] pop and push? In-Reply-To: <4EBC4F7F.8080506@fe.up.pt> References: <4EBC4F7F.8080506@fe.up.pt> Message-ID: To use pop or push, manually load the basic package--that is load('basic) . --Barton -----maxima-bounces at math.utexas.edu wrote: ----- To: Maxima From: Jaime Villate Sent by: maxima-bounces at math.utexas.edu Date: 11/10/2011 04:26PM Subject: [Maxima] pop and push? Hi, while updating the manual section on Lists, I noticed that the pop() and push() functions described in the manual do not seem to make part of core Maxima anymore: ?? ?(%i2) pop([1,2,3]); ?? ?(%o2) pop([1,2,3]) ?? ?(%i3) push(0, [1,2,3]); ?? ?(%o3) push(0, [1,2,3]) have they been moved to some additional package, or were they removed? Cheers, Jaime _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From junglejesus93 at gmail.com Thu Nov 10 17:53:29 2011 From: junglejesus93 at gmail.com (Casey Coleman) Date: Thu, 10 Nov 2011 15:53:29 -0800 Subject: [Maxima] The Homotopy Derivative Message-ID: <30FF92FE-E05D-4478-9CDE-E64E087BB321@gmail.com> I can't work with nth-term formulas because I don't know the series beforehand. I have to solve for each of the coefficients of q^n, which in this case are each functions of a single variable x. I do this (in theory) by setting up an infinite chain of linear recurrence relations. This infinite chain is obtained by taking the homotopy derivative(s) of the so called zeroth-order deformation equation: (1-q)L[y-u[0]] = qhN[y] Which has the following properties: q is the homotopy parameter ranging from 0 to 1 L is an auxiliary linear operator (independent of q) which I choose u[0] is my initial guess solution N[y] is the nonlinear operator I'm interested in solving y is a homotopy series whose coefficients are to be determined (in such a way that it solves N[y]=0. h is the convergence control parameter, which is basically just an iteration factor. The principle task at hand is to compute D[m](N[y]) for any m. Doing so is easy in principle since only three operations are needed: 1.) D[m](y) = y[m], the coefficient of q^m. This is true for any power series in q. 2.) Taking derivatives of quantities like e^y (for strongly nonlinear problems?) 3.) determining the coefficients of series defined by ordinary algebraic expressions like y^2. So here is what I'm talking about: y = y[0] + y[1]q + y[2]q^2 + y[3]q^3 +... y[0] is a guess, so I know what it is. Using the deformation equations, which are governed primarily by the linear operator I choose and my initial guess, I will find the y[n], for any n that I choose, recursively (the y[n]'s are functions of x in this case). When I ask, say, for the second homotopy derivative of y^2, I should get y[1]^2 + 2y[0]y[2] (remember, it's the derivative at q=0, so all other terms vanish). The problem is that the only way I can think of to get these kind of results is to predefine a finite series, which isn't very dynamic in the long run. You see, these calculations can become monstrous within just a few terms (after all, every previous solution contributes to the next one). It would be ideal if I could find the first few terms, see if that gets me close enough, and then, if necessary, just add the next few terms without having to recalculate the whole process. The problem is that when I begin with a truncated series, I may find that I need more terms than I can obtain accurately, which means I'd have to recalculate the whole problem. So how about those sums? Is there a way to express an unknown infinite sum in an algebraically useful way in Maxima? Maybe think in these terms: Let y and z be power series in q. D(m, y*z) := block( step one: calculate the resultant series out to order m step two: choose the coefficient of q^m and return it (simplified) ); Damn, that's actually a pretty good start...any thoughts at all would be greatly appreciated. -- Casey From fateman at eecs.berkeley.edu Thu Nov 10 18:20:07 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Thu, 10 Nov 2011 16:20:07 -0800 Subject: [Maxima] sqrt vs ^0.5 In-Reply-To: References: <4EBC122F.5000708@eecs.berkeley.edu> Message-ID: <4EBC6A37.2020701@eecs.berkeley.edu> On 11/10/2011 1:27 PM, Stavros Macrakis wrote: > I don't recall any argument about something being on or off -- what do > you have in mind? > > That mixed arithmetic between rationals and floats converts to floats? > Yes, that is Maxima's behavior and as far as I know that can't be > turned off -- so there is no 'default'. Unfortunately, constant > expressions which are not literal rationals don't participate in this > behavior: sqrt(5.0) - sqrt(5) does not simplify to 0. In my opinion, > it should. > > -s Interesting suggestion. It seems to me that it would make the following 2 commands synonymous: %,numer %+0.0 If so, maybe that tells us how your idea could be implemented. Or might also warn us about unintended consequences. (Looks OK to me..) From gravmath at yahoo.com Thu Nov 10 19:27:33 2011 From: gravmath at yahoo.com (Conrad Schiff) Date: Thu, 10 Nov 2011 17:27:33 -0800 (PST) Subject: [Maxima] Helping out with Maxima In-Reply-To: References: <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> Message-ID: <1320974853.98193.YahooMailNeo@web113317.mail.gq1.yahoo.com> Hello All, ? In response to Robert's request, I'll say a little about myself. Educational background: ?I have a PhD in theoretical physics from the University of Maryland. ?My field of study was General Relativity with an emphasis on numerical modeling and the ADM decomposition. ?In my dissertation, I worked on how to model extended fluid objects, such as a white dwarf, in motion about massive and super-massive black holes and determined possible finite-size corrections to the orbital motion of these systems as potential gravitational wave sources.? Work background: ?For the last 21 years or so (even while I earned my PhD), I've worked at the Goddard Space Flight Center in Flight Dynamics. ?I was the lead trajectory designer on the ACE, WMAP, and JWST missions, and contributed significantly to the trajectories of the Clementine and GPM missions. ?I am currently the Flight Dynamics lead for the Magnetospheric MultiScale mission. Much of this work has centered on the development of analytical and numerical models of the motion of spacecraft and the maneuvers needed to achieve their desired orbits. ?Along the way, I've picked up a deal of experience working on large scale scientific pieces of software. Interests: ?Gravity, orbital mechanics, and general relativity; scientific software, automation, & artificial intelligence; dynamical systems and chaos; physics education and mentoring I hope that this helps and I hope ?might be able to contribute to Maxima. Thanks, Conrad ________________________________ From: Robert Dodier To: Conrad Schiff Cc: Maxima Mailing List Sent: Tuesday, November 8, 2011 1:17 PM Subject: Re: Helping out with Maxima Hi Conrad, thanks for offering to help out. I've taken the liberty of forwarding your message to the Maxima mailing list. If anyone would like to help Conrad figure out some things to work on, that would be terrific. There are two general directions that come to mind. One is that Maxima needs continuous maintenance to ensure that its multitude of pieces, assembled over many years and touched by many hands, continues to function as a whole. The other is that you may have some particular experience to work on a particular topic. Perhaps you can tell us a little bit about your background. Lisp is not too terribly different from other programming languages so if you have experience in programming, I think you'll be able to grasp Lisp as well. All the best, Robert Dodier On 11/5/11, Conrad Schiff wrote: > Robert, > >? Hello my name is Conrad Schiff.? I very much appreciate the effort that > all of you put into Maxima as an open source CAS.? I was wondering if there > was any way that I might be able to help.? I've got a great deal of > experience with the development of scientific software and while I'm only a > beginner at Lisp but I might be able to help with documentation and testing. > > > Thanks, > Conrad -------------- next part -------------- An HTML attachment was scrubbed... URL: From villate at fe.up.pt Fri Nov 11 02:52:26 2011 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 11 Nov 2011 08:52:26 +0000 Subject: [Maxima] pop and push? In-Reply-To: References: <4EBC4F7F.8080506@fe.up.pt> Message-ID: <4EBCE24A.4000007@fe.up.pt> On 11/10/2011 11:17 PM, Barton Willis wrote: > To use pop or push, manually load the basic package--that is load('basic) . Thanks, Barton. I will add that information to the manual then. Regards, Jaime From rswarbrick at gmail.com Fri Nov 11 02:57:25 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 11 Nov 2011 08:57:25 +0000 Subject: [Maxima] The Homotopy Derivative References: <30FF92FE-E05D-4478-9CDE-E64E087BB321@gmail.com> Message-ID: Casey Coleman writes: > So how about those sums? Is there a way to express an unknown infinite > sum in an algebraically useful way in Maxima? You mean like say "Right, a(n) is going to represent the (unknown) n'th term in my series"? Yep. You just call it a(n)... There's no reason you have to define it in advance. > Maybe think in these terms: Let y and z be power series in q. > D(m, y*z) := block( > step one: calculate the resultant series out to order m > step two: choose the coefficient of q^m and return it (simplified) > ); > > Damn, that's actually a pretty good start...any thoughts at all would > be greatly appreciated. Ok, well if you do this you should ignore my previous comment and make sure you use Maxima's memoizing a[n] functionality. Otherwise, this approach will be very inefficient. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From talon at lpthe.jussieu.fr Fri Nov 11 04:23:14 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 11 Nov 2011 10:23:14 +0000 (UTC) Subject: [Maxima] Helping out with Maxima References: <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320974853.98193.YahooMailNeo@web113317.mail.gq1.yahoo.com> Message-ID: Conrad Schiff wrote: > I hope that this helps and I hope ?might be able to contribute to Maxima. > > > Thanks, > Conrad Let me throw some ideas about things i have been interested in recently related to maxima. Something which has been discussed several times here and could be worked on is adding the ability to do integrals resulting in elliptic functions. Code in partially working state has been shown in the mailing list by Prof. Fateman and R. Toy, if i remember well. The mathematics of this game are completely straightforward, very easily accesssible, and i suppose it is a good problem to learn the maxima insides. Another subject which is more related to numerical analysis is to investigate if one could devise something systematic to directly compile the Fortran programs used in maxima (lapack, etc.) and link them into maxima. Apparently this is somewhat lisp specific, but it seems that most free systems use sbcl nowadays, so this should be a good starting point. The problem is that the conversion of fortran to lisp followed by lisp compilation produces poor performance, and one gets better experience with scientific python, for example. On the same theme, all these fortran programs are very old and assume that "double precision" is the ultimate end of scientific computation precision. However in many computations nowadays, double precision is dramatically insufficient. Fortunately maxima has "big floats" so that computations entirely done in maxima can bypass the precision problems. But this rules away all the converted fortran code. For example you can diagonalize big matrices with the help of the fortran routines, but the result is essentially random, however it is obtained rapidly. If the matrix is symmetric you can use eigens_by_jacobi, written in lisp, which i think supports bigfloats, and get correct results but at great length of time. Finally a well known algorithm which is not implemented at all in maxima for the computation of eigenvalues of big matrices is Arnoldi with restart. The Fortran program is available. Another approach to these questions is to export the computation to external programs in fortran or C. To this aim there exists the program gentran in share/contrib. It was broken in modern maxima, but it has been partially repaired recently. I think it still needs work, for example i think the conversion to fortran works but the conversion to C doesn't. It should be rather easy to locate the correction which have been applied to the fortran producing code, and do the same in the C producing code. The problem is that gentran is written in some old dialect of lisp which needs to be modernized. Then it would be nice and useful to play a bit with gentran and produce some good documentation. -- Michel Talon From talon at lpthe.jussieu.fr Fri Nov 11 04:23:17 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 11 Nov 2011 10:23:17 +0000 (UTC) Subject: [Maxima] The Homotopy Derivative References: <30FF92FE-E05D-4478-9CDE-E64E087BB321@gmail.com> Message-ID: Casey Coleman wrote: > I can't work with nth-term formulas because I don't know the series beforehand. I have to solve for each of the coefficients of q^n, which in this case are each functions of a single variable x. I do this (in theory) by setting up an infinite chain of linear recurrence relations. This infinite chain is obtained by taking the homotopy derivative(s) of the so called zeroth-order deformation equation: > > (1-q)L[y-u[0]] = qhN[y] > > Which has the following properties: > q is the homotopy parameter ranging from 0 to 1 > L is an auxiliary linear operator (independent of q) which I choose > u[0] is my initial guess solution > N[y] is the nonlinear operator I'm interested in solving > y is a homotopy series whose coefficients are to be determined (in such a way that it solves N[y]=0. > h is the convergence control parameter, which is basically just an iteration factor. > > The principle task at hand is to compute D[m](N[y]) for any m. Doing so is easy in principle since only three operations are needed: > 1.) D[m](y) = y[m], the coefficient of q^m. This is true for any power series in q. > 2.) Taking derivatives of quantities like e^y (for strongly nonlinear problems?) > 3.) determining the coefficients of series defined by ordinary algebraic expressions like y^2. > > So here is what I'm talking about: > y = y[0] + y[1]q + y[2]q^2 + y[3]q^3 +... > y[0] is a guess, so I know what it is. Using the deformation equations, which are governed primarily by the linear operator I choose and my initial guess, I will find the y[n], for any n that I choose, recursively (the y[n]'s are functions of x in this case If this may be of any help, here is an example of a similar problem, in which the Kowalevski top equations are "solved" by plugging a Laurent series (the so-called Kowalevsky-Painlev? criterion) and recursively solving them. /* The aim is to show that one can find Laurent developments for the dynamical * variables p, q, r, etc. of the Kowalevski top, in the cases where the * determinant of the recursive system has sufficiently many integer roots */ tt: elapsed_real_time (); /* The matrix of the recursive system */ Mat: matrix( [(m-1)*A, -A1*r, -A1*q, 0, z, -y], [-B1*r, (m-1)*B, -B1*p, -z, 0, x], [-C1*q, -C1*p, (m-1)*C, y, -x, 0], [0, h, -g, m-2, -r, q], [-h, 0, f, r, m-2, -p], [g, -f, 0, -q, p, m-2] ); Mat: subst([A1 = B-C, B1 = C-A, C1 = A-B], %)$ /* to get %i^2 = -1 */ algebraic: true$ /* the first Kowalevski solution */ Mat1: subst([B=A, A=2*C, y=0, z=0, h=0, q=%i*p, r=2*%i, f=-2*C/x, g=-2*%i*C/x] , Mat)$ Det1: factor(determinant(Mat1)); /* The second Kowalevski solution */ Mat2: subst([B=A, A=2*C, y=0, z=0, q=2*%i, r=0, f=-4*C/x, g=0, h=4*%i*C/x, p=0], Mat)$ Det2: factor(determinant(Mat2)); /* Now we need to solve the recursive equations for the Laurent series */ /* this is a column vector, the unknowns */ v: matrix([p[m]], [q[m]], [r[m]], [f[m]], [g[m]], [h[m]])$ /* note that v[1] = [p[m]] and part(v[1],1) = p[m] */ /* the right hand side of the recursion relations, starting with 0 */ w: [P[m], Q[m], R[m], F[m], G[m], H[m]]$ P[1]: 0$ Q[1]:0$ R[1]: 0$ F[1]: 0$ G[1]: 0$ H[1]: 0$ vars: makelist(part(v[j],1), j, 1, 6)$ print ( "The first Kowalevski case.")$ /* We solve the first Kowalevski case */ eqns: makelist(part((Mat1.v)[j],1) = w[j], j, 1, 6)$ /* solve for m=1 */ solve(subst(m=1, eqns), subst(m=1, vars))$ /* assign the solution to vars, :: evaluates right and left */ /* Can be removed by setting: globalsolve:true */ subst(m = 1, vars) :: map(rhs, %[1])$ print("First iteration. Vars:", %)$ /* now for m=2,3,4 */ for mm from 2 thru 4 do ( P[mm]: C*sum(q[j]*r[mm-j], j, 1, mm-1), Q[mm]: -C*sum(p[j]*r[mm-j], j, 1, mm-1), R[mm]: 0, F[mm]: sum(r[j]*g[mm-j] - q[j]*h[mm-j], j, 1, mm-1), G[mm]: sum(p[j]*h[mm-j] - r[j]*f[mm-j], j, 1, mm-1), H[mm]: sum(q[j]*f[mm-j] - p[j]*g[mm-j], j, 1, mm-1), solve(ev(subst(m=mm, eqns)), subst(m=mm, vars)), /* in a block, % has to be replaced by %% */ subst(m=mm, vars) :: map(rhs, %%[1]) )$ /* Display the Laurent solution */ print ( "Laurent solution depending on 5 parameters, p, %r1, %r2, %r3, %r4")$ [p[0], q[0], r[0], f[0], g[0], h[0]]: [p, %i*p, 2*%i, -2*C/x, -2*%i*C/x, 0]$ for j in [p, q, r] do block([z], z: fullmap(ev, j[0]/t + j[1] + t*j[2] + t^2*j[3] + t^3*j[4]), print(j, "(t) = ", expandwrt_factored(z, t, p)), define(ev(j(t)), z) )$ /* this is for the check below */ for j in [f, g, h] do block([z], z: fullmap(ev, j[0]/t^2 + j[1]/t + j[2] + t*j[3] + t^2*j[4]), print(j, "(t) = ", expandwrt_factored(z, t, p)), define(ev(j(t)), z) )$ print ( "Checking integrals of motion.")$ /* Check that weight has constant magnitude, this is central for Poisson */ taylor(f(t)^2 + g(t)^2 + h(t)^2, t, 0, 0); /* Notice no terms in 1/t^4, 1/t^3, 1/t^2, 1/t !!! */ /* Check another integral of motion, in the centre of Poisson algebra */ taylor(2*C*(p(t)*f(t)+q(t)*g(t))+C*r(t)*h(t), t, 0, 1); /* Notice no terms in 1/t^3, 1/t^2, 1/t, t !!! */ /* The phase space is thus or real dimension 4 and not 6. In the integrable * case there are 2 integrals of motion */ /* Check the energy integral of motion */ taylor( C*r(t)^2+2*C*((p(t))^2+(q(t))^2) -2*x*f(t), t, 0, 2); /* Notice no terms in 1/t^2, 1/t, t, t^2 !!! */ /* Check the new Kowalevski integral of motion */ taylor( ((p(t)+%i*q(t))^2+x*(f(t)+%i*g(t))/C)*((p(t)-%i*q(t))^2+x*(f(t)-%i*g(t))/C), t, 0, 0); /* Notice no terms in 1/t^4, 1/t^3, 1/t^2, 1/t !!! */ ttt: elapsed_real_time ()$ ttt -tt; print ( "Now the second Kowalewski case." )$ /* We solve the second Kowalevski case */ /* Reset variables */ kill(allbut (Mat2, w, ttt))$ v: matrix([p[m]], [q[m]], [r[m]], [f[m]], [g[m]], [h[m]])$ w: [P[m], Q[m], R[m], F[m], G[m], H[m]]$ P[1]: 0$ Q[1]:0$ R[1]: 0$ F[1]: 0$ G[1]: 0$ H[1]: 0$ vars: makelist(part(v[j],1), j, 1, 6)$ eqns: makelist(part((Mat2.v)[j],1) = w[j], j, 1, 6)$ /* solve for m=1 */ solve(subst(m=1, eqns), subst(m=1, vars))$ /* assign the solution to vars, :: evaluates right and left */ subst(m = 1, vars) :: map(rhs, %[1])$ print("First iteration. Vars:", %)$ /* now for m=2,3,4 . Note the determinant vanishes to second order at m=2, * better find 2 solutions here. */ for mm from 2 thru 4 do ( P[mm]: C*sum(q[j]*r[mm-j], j, 1, mm-1), Q[mm]: -C*sum(p[j]*r[mm-j], j, 1, mm-1), R[mm]: 0, F[mm]: sum(r[j]*g[mm-j] - q[j]*h[mm-j], j, 1, mm-1), G[mm]: sum(p[j]*h[mm-j] - r[j]*f[mm-j], j, 1, mm-1), H[mm]: sum(q[j]*f[mm-j] - p[j]*g[mm-j], j, 1, mm-1), solve(ev(subst(m=mm, eqns)), subst(m=mm, vars)), subst(m=mm, vars) :: map(rhs, %%[1]) )$ /* Display the Laurent solution */ print ( "Laurent solution depending on 4 parameters, %r5, %r6, %r7, %r8")$ [p[0], q[0], r[0], f[0], g[0], h[0]]: [0, 2*%i, 0, -4*C/x, 0, 4*%i*C/x]$ for j in [p, q, r] do block([z], z: fullmap(ev, j[0]/t + j[1] + t*j[2] + t^2*j[3] + t^3*j[4]), print(j, "(t) = ", expandwrt_factored(z, t, p)), define(ev(j(t)), z) )$ /* this is for the check below */ for j in [f, g, h] do block([z], z: fullmap(ev, j[0]/t^2 + j[1]/t + j[2] + t*j[3] + t^2*j[4]), print(j, "(t) = ", expandwrt_factored(z, t, p)), define(ev(j(t)), z) )$ print ( "Checking integrals of motion.")$ taylor(f(t)^2 + g(t)^2 + h(t)^2, t, 0, 0); taylor(2*C*(p(t)*f(t)+q(t)*g(t))+C*r(t)*h(t), t, 0, 1); taylor( C*r(t)^2+2*C*((p(t))^2+(q(t))^2) -2*x*f(t), t, 0, 2); taylor( ((p(t)+%i*q(t))^2+x*(f(t)+%i*g(t))/C)*((p(t)-%i*q(t))^2+x*(f(t)-%i*g(t))/C), t, 0, 0); elapsed_real_time () - ttt; -- Michel Talon From talon at lpthe.jussieu.fr Fri Nov 11 04:23:17 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 11 Nov 2011 10:23:17 +0000 (UTC) Subject: [Maxima] Removing arbitrary values / Hello List References: Message-ID: cheater cheater wrote: > Hi again, I have noticed that a lot of people post this info when > talking about issues in maxima: > > (%i1) build_info(); > > Maxima version: 5.25.1 > Maxima build date: 14:1 8/29/2011 > Host type: x86_64-unknown-linux-gnu > Lisp implementation type: SBCL > Lisp implementation version: 1.0.29.11.debian > > Cheers > > On Thu, Nov 10, 2011 at 15:18, cheater cheater wrote: >> Hi guys! I have just subscribed to the mailing list. Recently I've >> been using Maxima a lot for analyzing the performance of computer >> algorithms. I'm surprised at how easy it is to master. There are, >> however, some things that are non-obvious. >> >> I have run into a problem which I cannot get past, though. You see, I >> am using Maxima to do some curve fitting, and then count an integral. >> However, sometimes the curve fits have parameters which turn out to be >> "arbitrary". This isn't really so, but I guess the newton-raphson gets >> confused around 0. For example it'll return things such as: >> >> 3^2 + 0.22e-40*%r21 ? ? ?where obviously any small changes to r21 will >> not change the complete value at all (the changes to %r21 get >> truncated). >> >> The objective of the maxima code I am executing is to calculate those >> integrals and put them out to stdout and have the Python script (which >> does a lot of other work) take these numbers and continue analysis. Of >> course, Python cannot interpret %r21 and throws exceptions. Therefore >> I thought I would just plug something into those arbitrary values. I >> did something like this: Why not filtering the answer in the python script and replacing occurences of %r by 1 here? The advantage is that it is very easy ... >>> re.sub(r'%r[0-9]+','1','3^2 + 0.22e-40*%r21') '3^2 + 0.22e-40*1' -- Michel Talon From fateman at eecs.berkeley.edu Fri Nov 11 08:39:03 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 11 Nov 2011 06:39:03 -0800 Subject: [Maxima] Helping out with Maxima In-Reply-To: References: <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320974853.98193.YahooMailNeo@web113317.mail.gq1.yahoo.com> Message-ID: <4EBD3387.10507@eecs.berkeley.edu> On 11/11/2011 2:23 AM, Michel Talon wrote: > Conrad Schiff wrote: >> I hope that this helps and I hope might be able to contribute to Maxima. >> >> >> Thanks, >> Conrad > Let me throw some ideas about things i have been interested in recently > related to maxima. > > Something which has been discussed several times here and could be worked on > is adding the ability to do integrals resulting in elliptic functions. Code in > partially working state has been shown in the mailing list by Prof. Fateman > and R. Toy, if i remember well. The mathematics of this game are completely > straightforward, very easily accesssible, and i suppose it is a good problem > to learn the maxima insides. > > Another subject which is more related to numerical analysis is to investigate > if one could devise something systematic to directly compile the Fortran > programs used in maxima (lapack, etc.) and link them into maxima. Apparently > this is somewhat lisp specific, but it seems that most free systems use > sbcl nowadays, so this should be a good starting point. The problem is that > the conversion of fortran to lisp followed by lisp compilation produces poor > performance, and one gets better experience with scientific python, for > example. If you assume SBCL, then you can use its foreign function interface http://www.sbcl.org/manual/Introduction-to-the-Foreign-Function-Interface.html#Introduction-to-the-Foreign-Function-Interface to directly link to FORTRAN. On the other hand, SBCL support for Windows, according to this page http://www.sbcl.org/platform-table.html is "port in progress" so it appears SBCL is not supported on the operating system used by the vast majority of Maxima users. Another possibility is to examine UFFI to see if that can be used with most of the common lisps. There may be some objection from some people to the idea of having FORTRAN code compiled into binary somehow included in Maxima. I think it is worth it, not to deny the possibility of difficulties regarding which FORTRAN compiler etc etc. I dislike the idea of relying on awk, perl, make ... all of whose functions should be done in Common Lisp... > > On the same theme, all these fortran programs are very old and assume that > "double precision" is the ultimate end of scientific computation precision. > However in many computations nowadays, double precision is dramatically > insufficient. Fortunately maxima has "big floats" so that computations > entirely done in maxima can bypass the precision problems. But this rules away > all the converted fortran code. Not all. Some code should work fine. > For example you can diagonalize big matrices > with the help of the fortran routines, but the result is essentially random, > however it is obtained rapidly. If the matrix is symmetric you can use > eigens_by_jacobi, written in lisp, which i think supports bigfloats, and > get correct results but at great length of time. Finally a well known > algorithm which is not implemented at all in maxima for the computation of > eigenvalues of big matrices is Arnoldi with restart. The Fortran program is > available. Studying what Mathematica does (or purports to do) may help. The issue for bigfloat code is often that the algorithm needed when the required precision is not known until the subroutine is called is entirely different from the algorithms for a fixed precision known far in advance. > > > Another approach to these questions is to export the computation to external > programs in fortran or C. To this aim there exists the program gentran > in share/contrib. It was broken in modern maxima, but it has been partially > repaired recently. I think it still needs work, for example i think the > conversion to fortran works but the conversion to C doesn't. It should be > rather easy to locate the correction which have been applied to the fortran > producing code, and do the same in the C producing code. The problem is that > gentran is written in some old dialect of lisp which needs to be modernized. > Then it would be nice and useful to play a bit with gentran and produce some > good documentation. > > > I think we should have a place where suggested projects are collected. Is this something for the Maxima wiki? RJF From rswarbrick at gmail.com Fri Nov 11 08:52:00 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 11 Nov 2011 14:52:00 +0000 Subject: [Maxima] Helping out with Maxima References: <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320974853.98193.YahooMailNeo@web113317.mail.gq1.yahoo.com> <4EBD3387.10507@eecs.berkeley.edu> Message-ID: Richard Fateman writes: > If you assume SBCL, then you can use its foreign function interface > http://www.sbcl.org/manual/Introduction-to-the-Foreign-Function-Interface.html#Introduction-to-the-Foreign-Function-Interface > to directly link to FORTRAN. Or maybe try to use CFFI, which gives you a better chance of being able to port your work to other lisps. > > On the other hand, SBCL support for Windows, according to this page > http://www.sbcl.org/platform-table.html is "port in progress" so it > appears SBCL is not supported on the operating system used by the vast > majority of Maxima users. The good news is that SBCL works fine on Windows in practice. I think that in theory there's some racy timing bug or something that they were/are worried about (at least, there used to be a bizarre warning about a "kitten of death" when you started it...). I think you should take the orangey box to mean that, while they have something that works, they also have unincorporated patches that might make everything much better. That said, SBCL's definition of "mostly works" is still streets ahead of what GCL can do... > Another possibility is to examine UFFI to see if that can be used with > most of the common lisps. > There may be some objection from some people to the idea of having > FORTRAN code compiled into > binary somehow included in Maxima. I think it is worth it, not to > deny the possibility of difficulties regarding > which FORTRAN compiler etc etc. I dislike the idea of relying on > awk, perl, make ... all of whose functions should be done in Common > Lisp... Well, another solution would be to use ASDF or the like to make it something that can be included via a load() form or similar. Then we could ditch anything Make-ish but not have a massive binary. 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 Nov 11 09:18:32 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Fri, 11 Nov 2011 15:18:32 +0000 Subject: [Maxima] Helping out with Maxima References: <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320974853.98193.YahooMailNeo@web113317.mail.gq1.yahoo.com> <4EBD3387.10507@eecs.berkeley.edu> Message-ID: Rupert Swarbrick writes: >> On the other hand, SBCL support for Windows, according to this page >> http://www.sbcl.org/platform-table.html is "port in progress" so it >> appears SBCL is not supported on the operating system used by the vast >> majority of Maxima users. > > The good news is that SBCL works fine on Windows in practice. I think > that in theory there's some racy timing bug or something that they > were/are worried about (at least, there used to be a bizarre warning > about a "kitten of death" when you started it...). I think you should > take the orangey box to mean that, while they have something that works, > they also have unincorporated patches that might make everything much > better. That said, SBCL's definition of "mostly works" is still streets > ahead of what GCL can do... Replying to myself, if you want to know slightly more about what's going on with SBCL and Windows, see the following thread on the SBCL devel list: http://comments.gmane.org/gmane.lisp.steel-bank.devel/16354 Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From toy.raymond at gmail.com Fri Nov 11 10:54:58 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 11 Nov 2011 08:54:58 -0800 Subject: [Maxima] Helping out with Maxima In-Reply-To: <4EBD3387.10507@eecs.berkeley.edu> References: <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320974853.98193.YahooMailNeo@web113317.mail.gq1.yahoo.com> <4EBD3387.10507@eecs.berkeley.edu> Message-ID: On Fri, Nov 11, 2011 at 6:39 AM, Richard Fateman wrote: > > On the other hand, SBCL support for Windows, according to this page > http://www.sbcl.org/platform-**table.html > is "port in progress" so it appears SBCL is not supported on the > operating system > used by the vast majority of Maxima users. > I would choose ccl. It's fully supported (with commercial support if that's important to you) on Windows and Linux and Mac OS X. That probably covers 99 and 44/100% of the users. (Yes, I made that up.) Another possibility is to examine UFFI to see if that can be used with most > of the common lisps. > There may be some objection from some people to the idea of having FORTRAN > code compiled into > binary somehow included in Maxima. I think it is worth it, not to deny > the possibility of difficulties regarding > which FORTRAN compiler etc etc. I dislike the idea of relying on awk, > perl, make ... all of whose functions should be done in Common Lisp... I don't know of any lisp that would allow you to add foreign code directly into the binary. Most will support loading of libraries, though. Getting all of the right compiler options to the Fortran compiler can be fairly difficult. At least autoconf and friends have done the dirty work of figuring that out so you don't have to do the same thing yourself in Lisp. Yes, you can refuse to support other compilers, but even different versions of the same compiler have different options. (I, for one, like choice. If you want only implementation, please be sure that you make everyone drive exactly the same car first.) > > > > > > >> On the same theme, all these fortran programs are very old and assume that >> "double precision" is the ultimate end of scientific computation >> precision. >> However in many computations nowadays, double precision is dramatically >> insufficient. Fortunately maxima has "big floats" so that computations >> entirely done in maxima can bypass the precision problems. But this rules >> away >> all the converted fortran code. >> > Not all. Some code should work fine. > > Indeed. Sometime back I wrote a little script to go and massage the lapack (f2cl) code to support bigfloat arithmetic instead of doubles. I think I did one quick test computing the eigenvalues. It worked. And if you're whining about how slow the f2cl code is, be sure to whine even louder. :-) (That's the generic "you".) I think we have to remember that maxima is about symbolic computations. If you're just crunching numbers, you should probably be using something else, with, maybe, some kind of IPC to maxima. >> > I think we should have a place where suggested projects are collected. Is > this something for the Maxima wiki? > If not, there should be. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From acimmarusti at gmail.com Fri Nov 11 11:11:22 2011 From: acimmarusti at gmail.com (Andres Cimmarusti) Date: Fri, 11 Nov 2011 12:11:22 -0500 Subject: [Maxima] compute eigenvalues numerically Message-ID: Dear maxima users, I've been working on some calculations that eventually lead to a 5x5 matrix, whose components can be complex. The next step is to calculate the eigenvalues and possibly the eigenvectors. The built-in maxima functions: eigenvalues and eigenvectors immediately fail, even when the matrix has all real components. It says "solve is unable to find the roots of the characteristic polynomial". I looked at "dgeev" which uses lapack, and it worked superbly when the matrix components are real, but gave me errors when they were complex, as expected. Sadly dgeev only works for integers and floating point. Is there any other tool/function that will compute these things numerically? I deally I would want to later plot each eigenvalue as a function of one or two parameters. Perhaps maxima is not the appropriate tool to do this anymore (my original hope was to compute things analytically, but that's pretty much out the window now).. care to suggest a good way to go? As an additional thing, in an earlier stage of my work (which proved wrong), I was able to reduce the characteristic polynomial to a 4th order equation. Wikipedia says, analytical solutions are possible (http://en.wikipedia.org/wiki/Quartic_function#Summary_of_Ferrari.27s_method) through something known as the Ferrari's method. However, when I tried using 'solve' with this quartic polynomial, maxima just couldn't do it. After many minutes, maxima simply crashed...(it was disconnected from WxMaxima) I have to say that the coefficients of the polynomial were quite lengthy, but I feel it should have worked...Naturally when I try a general quartic polynomial like listed in the wikipedia article, things work fine, though I get warned the expression is too long to display. What are the limitations here?...it really is just a lot of algebra... Now, in the case of quintic polynomials, which brings me back to my original question, 'solve' can't even do this: solve( z^5 -z -1 = 0 , z); This is a well known quintic polynomial whose roots cannot be obtained analytically by any means, but they should be possible, numerically. Is there a way to get the roots using solve or other tool in maxima? if so, can I "instruct" eigenvalues / eigenvectors to use this instead of plain solve? I'm using Maxima 5.21.1 on Debian Squeeze. GCL 2.6.7 Thanks for your input Andres From toy.raymond at gmail.com Fri Nov 11 12:05:02 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 11 Nov 2011 10:05:02 -0800 Subject: [Maxima] compute eigenvalues numerically In-Reply-To: References: Message-ID: On Fri, Nov 11, 2011 at 9:11 AM, Andres Cimmarusti wrote: > Dear maxima users, > > I've been working on some calculations that eventually lead to a 5x5 > matrix, whose components can be complex. The next step is to calculate > the eigenvalues and possibly the eigenvectors. > > The built-in maxima functions: eigenvalues and eigenvectors > immediately fail, even when the matrix has all real components. It > says "solve is unable to find the roots of the characteristic > polynomial". > > I looked at "dgeev" which uses lapack, and it worked superbly when the > matrix components are real, but gave me errors when they were complex, > as expected. Sadly dgeev only works for integers and floating point. > Of course, lapack has a version for complex matrixes, but no one has hooked that up for maxima. It's not difficult to do, but will take a little bit of time. I cannot do that until later next week at the earliest. > > As an additional thing, in an earlier stage of my work (which proved > wrong), I was able to reduce the characteristic polynomial to a 4th > order equation. Wikipedia says, analytical solutions are possible > ( > http://en.wikipedia.org/wiki/Quartic_function#Summary_of_Ferrari.27s_method > ) > through something known as the Ferrari's method. However, when I tried > using 'solve' with this quartic polynomial, maxima just couldn't do > it. After many minutes, maxima simply crashed...(it was disconnected > from WxMaxima) > solve should be able to produce the roots. It could be a bug. Can you send the quartic that solve couldn't solve? > > I have to say that the coefficients of the polynomial were quite > lengthy, but I feel it should have worked...Naturally when I try a > general quartic polynomial like listed in the wikipedia article, > things work fine, though I get warned the expression is too long to > display. What are the limitations here?...it really is just a lot of > algebra... > That's a display problem. You can do display2d:false, or grind(). But it will be very messy. But if you're eventually going to want numerical results, presumably all of the variables in your quartic will be replaced by numbers. It may be better to replace them with numbers in the quartic before you try to solve the quartic. > > Now, in the case of quintic polynomials, which brings me back to my > original question, 'solve' can't even do this: > > solve( z^5 -z -1 = 0 , z); > > This is a well known quintic polynomial whose roots cannot be obtained > analytically by any means, but they should be possible, numerically. > Is there a way to get the roots using solve or other tool in maxima? > Look for allroots or bf_allroots. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Fri Nov 11 12:20:28 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 11 Nov 2011 13:20:28 -0500 Subject: [Maxima] compute eigenvalues numerically In-Reply-To: References: Message-ID: On Fri, Nov 11, 2011 at 12:11, Andres Cimmarusti wrote: > ...The built-in maxima functions: eigenvalues and eigenvectors > immediately fail, even when the matrix has all real components. It > says "solve is unable to find the roots of the characteristic > polynomial". > Maxima is oriented to symbolic, not numerical, calculations. Quintic polynomials cannot in general be solved symbolically (with the usual elementary functions). This is why Maxima complains for general 5x5 matrices. On the other hand, if the input is explicitly approximate (using floating-point numbers), I agree that Maxima should use approximate methods. The simple workaround is to calculate the characteristic polynomial with charpoly(matrix,var) and then use a numeric rootfinder on the resulting polynomial (e.g. allroots). But direct numeric eigenvalue calculation will be faster and more accurate. > ... when I tried using 'solve' with this quartic polynomial, maxima just > couldn't do it. I suspect that Maxima had no problem doing it, but WxMaxima was unable to display the result. ...I get warned the expression is too long to display. Again, this is probably a problem with the WxMaxima front end. > ...This is a well known quintic polynomial whose roots cannot be obtained > analytically by any means, but they should be possible, numerically. > See above -- solve is explicitly a *symbolic* solver. You can use allroots or realroots for numerical calculation of roots. By the way, if your ultimate goal is numerical roots of polynomials (whether for eigenvalues or other applications), in general it is *not* a good idea to first calculate the roots symbolically then substitute floating-point numbers. As a general rule, this will produce less precise results, sometimes *much* less precise, than using something like realroots or allroots. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Fri Nov 11 12:39:59 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 11 Nov 2011 18:39:59 +0000 (UTC) Subject: [Maxima] compute eigenvalues numerically References: Message-ID: Andres Cimmarusti wrote: > Dear maxima users, > > I've been working on some calculations that eventually lead to a 5x5 > matrix, whose components can be complex. The next step is to calculate > the eigenvalues and possibly the eigenvectors. > > The built-in maxima functions: eigenvalues and eigenvectors > immediately fail, even when the matrix has all real components. It > says "solve is unable to find the roots of the characteristic > polynomial". > > I looked at "dgeev" which uses lapack, and it worked superbly when the > matrix components are real, but gave me errors when they were complex, > as expected. Sadly dgeev only works for integers and floating point. > > Is there any other tool/function that will compute these things > numerically? I deally I would want to later plot each eigenvalue as a > function of one or two parameters. > Perhaps maxima is not the appropriate tool to do this anymore (my > original hope was to compute things analytically, but that's pretty > much out the window now).. care to suggest a good way to go? > If the matrix is symmetric you can use the Jacobi procedure, eigens_by_jacobi which is quite general. Otherwise you have dgeev which will work OK for matrices up to 100x100, roughly. If you have very big matrices, like 1000x1000 it may become very difficult. Small matrices like you are describing should be trivial. However if you expect symbolic answers you cannot go further than 4x4 in general, and even then you must be extra lucky to get something. I have spent enormous time to get answers with a 4x4 matrix (related to the Lax pair for the Kowalevski top) using maple, and still in that case the characteristic polynomial is biquadratic, so it should be easy. Symbolic programs become very awkward as soon as you have square roots, so more complicated stuff is frequently out of question. In fact in such cases, computation by hand is frequently better performing. If on the other hand the computation is rational, then symbolic program can do thaings you will never dream doing by hand. -- Michel Talon From woollett at charter.net Fri Nov 11 13:02:05 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 11 Nov 2011 11:02:05 -0800 Subject: [Maxima] feature request: imagpart (bessel_y) Message-ID: <846EE2E5A7F5484A98E898BB9042397C@edwinc367e16bd> On Nov. 10, 2011, Dieter Kaiser wrote: >>(%i10) nint(bessel_y(1,x)*bessel_y(2,sqrt(2)*x),x,1,1000,strong_osc); >> quad_qag >>(%o10) 0.44737052335548 >> >>(%i11) time(%); >>(%o11) [19.78] >> >>(%i12) goutL; >>(%o12) [[[qag,0.44737052335548,3.0438548004320586E-9,7905,0], >> [qag,0.0,0.0,31,0]]] >> >>(%i13) gargL; >>(%o13) [[[qag, >> 'realpart(bessel_y(1,x))*'realpart(bessel_y(2,sqrt(2)*x)) >> -'imagpart(bessel_y(1,x))*'imagpart(bessel_y(2,sqrt(2)*x)),x,1, >> 1000,3,epsrel = 1.0E-8,limit = 700], >> [qag, >> 'imagpart(bessel_y(1,x))*'realpart(bessel_y(2,sqrt(2)*x)) >> +'realpart(bessel_y(1,x))*'imagpart(bessel_y(2,sqrt(2)*x)),x,1, >The imaginary part of bessel_y(n,x) is zero only for a positive argument >x. Maxima already has this knowledge: > >(%i1) imagpart(bessel_y(1, x)); >(%o1) imagpart(bessel_y(1, x)) >(%i2) assume(x>0); >(%o2) [x > 0] >(%i3) imagpart(bessel_y(1, x)); >(%o3) 0 > > Thanks for the guidance. Have incorporated an assume inside the nint code, and get better results: (%i1) load(nint); (%o1) "c:/work2/nint.mac" (%i2) nint(bessel_y(1,x)*bessel_y(2,sqrt(2)*x),x,1,1000,strong_osc); quad_qag (%o2) 0.44737052335548 (%i3) time(%); (%o3) [10.92] (%i4) goutL; (%o4) [[qag,0.44737052335548,3.0438548004320586E-9,7905,0]] (%i5) gargL; (%o5) [[qag,bessel_y(1,x)*bessel_y(2,sqrt(2)*x),x,1,1000,3,epsrel = 1.0E-8, limit = 700]] Ted From talon at lpthe.jussieu.fr Fri Nov 11 13:05:16 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 11 Nov 2011 19:05:16 +0000 (UTC) Subject: [Maxima] Helping out with Maxima References: <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320974853.98193.YahooMailNeo@web113317.mail.gq1.yahoo.com> <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320974853.98193.YahooMailNeo@web113317.mail.gq1.yahoo.com> <4EBD3387.10507@eecs.berkeley.edu> Message-ID: Richard Fateman wrote: > > If you assume SBCL, then you can use its foreign function interface > http://www.sbcl.org/manual/Introduction-to-the-Foreign-Function-Interface.ht ml#Introduction-to-the-Foreign-Function-Interface > to directly link to FORTRAN. > > On the other hand, SBCL support for Windows, according to this page > http://www.sbcl.org/platform-table.html > is "port in progress" so it appears SBCL is not supported on the > operating system > used by the vast majority of Maxima users. > Another possibility is to examine UFFI to see if that can be used with > most of the common lisps. > There may be some objection from some people to the idea of having > FORTRAN code compiled into > binary somehow included in Maxima. I think it is worth it, not to deny > the possibility of difficulties regarding > which FORTRAN compiler etc etc. I dislike the idea of relying on awk, > perl, make ... all of whose functions should be done in Common Lisp... Although i don't know anything about that, there is supposed to be a comman foreign function interface working with Allegro, CMUCL, SBCL, ECL, http://common-lisp.net/project/cffi/manual/cffi-manual.html and swig has a module which can do the wrapping in an automated wayhttp://http://www.swig.org/Doc1.3/Lisp.html#Lisp_nn11 It can also wrap for clisp, which covers Windows use, i think. -- Michel Talon From fateman at eecs.berkeley.edu Fri Nov 11 13:19:15 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 11 Nov 2011 11:19:15 -0800 Subject: [Maxima] Helping out with Maxima In-Reply-To: References: <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320974853.98193.YahooMailNeo@web113317.mail.gq1.yahoo.com> <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320974853.98193.YahooMailNeo@web113317.mail.gq1.yahoo.com> <4EBD3387.10507@eecs.berkeley.edu> Message-ID: <4EBD7533.1060601@eecs.berkeley.edu> On 11/11/2011 11:05 AM, Michel Talon wrote: > > Although i don't know anything about that, there is supposed to be a comman > foreign function interface working with Allegro, CMUCL, SBCL, ECL, > http://common-lisp.net/project/cffi/manual/cffi-manual.html > and swig has a module which can do the wrapping in an automated > wayhttp://http://www.swig.org/Doc1.3/Lisp.html#Lisp_nn11 > It can also wrap for clisp, which covers Windows use, i think. > > I have not tried CFFI. I have used only one FFI, in Allegro Common Lisp. My understanding as of a few years ago was that CFFI or UFFI supported only a subset of features. I do not know how this has changed over time, or if any of the features matter to Maxima. I would encourage someone to look at it though! From O.Kullmann at swansea.ac.uk Fri Nov 11 15:02:59 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Fri, 11 Nov 2011 21:02:59 +0000 Subject: [Maxima] Question regarding Sbcl Message-ID: <20111111210259.GM20179@cs-wsok.swan.ac.uk> Hello, when trying to build Sbcl on a Linux system using clisp it seemed first to work, but then, late in the build, I got sbcl-1.0.52-source.tar.bz2 > cd sbcl-1.0.52 > sh make.sh "clisp" Bye. //testing for consistency of first and second GENESIS passes //header files match between first and second GENESIS -- good real 40m15.446s user 39m16.092s sys 0m51.738s //entering make-target-2.sh //doing warm init - compilation phase mmap: Cannot allocate memory ensure_space: failed to validate 8589869056 bytes at 0x1000000000 (hint: Try "ulimit -a"; maybe you should increase memory limits.) where sbcl-1.0.52> ulimit -a core file size (blocks, -c) unlimited data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 30378 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) 3329364 open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 30378 virtual memory (kbytes, -v) 4821120 file locks (-x) unlimited So the error doesn't seem to make sense. HOWEVER, anyway, the only point for us trying Sbcl is that we are looking for an open-source Lisp (usable for Maxima) faster than Ecl. And I got the impression that Sbcl can't be faster then Ecl, or am I wrong? If Sbcl is not faster than Ecl, then we don't need to install Sbcl, and the above problem is moot. Thanks for your attention. Oliver From toy.raymond at gmail.com Fri Nov 11 15:11:21 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 11 Nov 2011 13:11:21 -0800 Subject: [Maxima] Question regarding Sbcl In-Reply-To: <20111111210259.GM20179@cs-wsok.swan.ac.uk> References: <20111111210259.GM20179@cs-wsok.swan.ac.uk> Message-ID: On Fri, Nov 11, 2011 at 1:02 PM, Oliver Kullmann wrote: > Hello, > > when trying to build Sbcl on a Linux system using clisp it seemed first > to work, but then, late in the build, I got > > sbcl-1.0.52-source.tar.bz2 > > cd sbcl-1.0.52 > > sh make.sh "clisp" > Seems to me you should be asking on the sbcl list instead of maxima. IIRC clisp cannot build sbcl, but cmucl or ccl can. Or just go grab a binary of sbcl (or cmucl or ccl). > > HOWEVER, anyway, the only point for us trying Sbcl is that we are > looking for an open-source Lisp (usable for Maxima) faster than Ecl. > And I got the impression that Sbcl can't be faster then Ecl, or > am I wrong? > If the testsuite is any indication, sbcl and cmucl are faster than ecl. Can't remember if ccl is or not. But also, it used to be that gcl ran the testsuite faster than any of these. Don't know if that's true anymore. However, I think the testsuite these days consists of a lot of number crunching code, so that might bias the results if you're doing symbolic stuff. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Fri Nov 11 16:00:58 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 11 Nov 2011 14:00:58 -0800 Subject: [Maxima] bessel.lisp error codes and noisy quad_qagi Message-ID: <877602A8BB6C4E64B1192C71F32E9906@edwinc367e16bd> Raymond Toy reported that ierr = 2 indicated overflow in bessel.lisp. What do the rest of the ierr values returned in bessel.lisp indicate? In particular, I am interested in 3 and 4. Are these error codes common to other parts of Maxima lisp code? I am getting many pages of the message: zbesk ierr = 3 when calling quad_qagi with the real part of bessel_k(2,%i*x): -------------------------------- Maxima 5.25.1 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. 2011-11-11 (%i1) display2d:false$ (%i2) quad_qagi(bessel_k(2,%i*x),x,1,inf); (%o2) quad_qagi(bessel_k(2,%i*x),x,1,inf,epsrel = 1.0E-8,epsabs = 0.0, limit = 200) (%i3) assume(x>0)$ (%i4) realpart(bessel_k(2,%i*x)); (%o4) 'realpart(bessel_k(2,%i*x)) (%i5) quad_qagi(realpart(bessel_k(2,%i*x)),x,1,inf); zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 zbesk ierr = 3 ...continues for about 20 pages of output ... finally: ***MESSAGE FROM ROUTINE DQAGI IN LIBRARY SLATEC. ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED * ABNORMAL RETURN * ERROR NUMBER = 5 * ***END OF MESSAGE (%o5) [-311.0051190974822,70.21683385597015,5985,5] Is there a *quieter way* I can use quad_qagi for this calculation? The asserted Mathematica answer to this numerical integral is -1.45355 + 1.50855*%i Ted Woollett From toy.raymond at gmail.com Fri Nov 11 16:10:33 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 11 Nov 2011 14:10:33 -0800 Subject: [Maxima] bessel.lisp error codes and noisy quad_qagi In-Reply-To: <877602A8BB6C4E64B1192C71F32E9906@edwinc367e16bd> References: <877602A8BB6C4E64B1192C71F32E9906@edwinc367e16bd> Message-ID: On Fri, Nov 11, 2011 at 2:00 PM, Edwin Woollett wrote: > > > Raymond Toy reported that ierr = 2 indicated > overflow in bessel.lisp. > > What do the rest of the ierr values returned > in bessel.lisp indicate? > > In particular, I am interested in 3 and 4. > zbesk is in zbesk.f in src/numerical/slatec/fortran. From the comments there: C IERR - Error flag C IERR=0 Normal return - COMPUTATION COMPLETED C IERR=1 Input error - NO COMPUTATION C IERR=2 Overflow - NO COMPUTATION C (abs(Z) too small and/or FNU+N-1 C too large) C IERR=3 Precision warning - COMPUTATION COMPLETED C (Result has half precision or less C because abs(Z) or FNU+N-1 is large) C IERR=4 Precision error - NO COMPUTATION C (Result has no precision because C abs(Z) or FNU+N-1 is too large) C IERR=5 Algorithmic error - NO COMPUTATION C (Termination condition not met) C Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Fri Nov 11 16:13:19 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 11 Nov 2011 14:13:19 -0800 Subject: [Maxima] bessel.lisp error codes and noisy quad_qagi Message-ID: On Nov. 11, 2011 I wrote ----------------------- > (%i5) quad_qagi(realpart(bessel_k(2,%i*x)),x,1,inf); [snip] >(%o5) [-311.0051190974822,70.21683385597015,5985,5] > >Is there a *quieter way* I can use quad_qagi for this >calculation? > >The asserted Mathematica answer to this numerical integral >is -1.45355 + 1.50855*%i --------------------------- Since only the real part is being evaluated, the asserted Mathematica answer is -1.45355. Ted From O.Kullmann at swansea.ac.uk Fri Nov 11 16:20:48 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Fri, 11 Nov 2011 22:20:48 +0000 Subject: [Maxima] Question regarding Sbcl In-Reply-To: References: <20111111210259.GM20179@cs-wsok.swan.ac.uk> Message-ID: <20111111222047.GP20179@cs-wsok.swan.ac.uk> > Seems to me you should be asking on the sbcl list instead of maxima. IIRC > clisp cannot build sbcl, but cmucl or ccl can. > sure, but the main question was (below) whether it might be worth the effort at all (w.r.t. Maxima). And I also thought there might be some general interest in these issues. >From my point of view, the situation using Lisp seems pretty bad (see below). > Or just go grab a binary of sbcl (or cmucl or ccl). > I do not use binaries for various reasons (taking them altogether): 1. All we are doing is going to be redistributed, and we want to provide a complete and (nearly) automated build. 2. It seems to me essential for the spirit of open-source to be able to build from sources (what is the source-code good for otherwise?). 3. I do not trust a system without the sources (working sources that is). 4. I do not trust the quality of a system which can not be built from sources (I think one should make an effort like Sage, or actually also our "library", to provide everything that it needed in a "standard Linux environment"). If the bigger Linux distributions have it, also fine with us. Now from this point of view only CLisp is fully available --- it is available in the larger Linux distributions, and it builds from sources. Next comes Ecl, which can be built from sources. And that seems to be it: - Cmucl requires a binary (and at least for Suse it doesn't seem to be available). - CCL again requires a binary and doesn't seem to available via Suse. - Leaves Sbcl as last chance. According to their homepage, CLisp should actually work. Stop, I see they only mention "CLISP 2.33.2" ... Anyway, I'll contact Sbcl. > > > > HOWEVER, anyway, the only point for us trying Sbcl is that we are > > looking for an open-source Lisp (usable for Maxima) faster than Ecl. > > And I got the impression that Sbcl can't be faster then Ecl, or > > am I wrong? > > > > If the testsuite is any indication, sbcl and cmucl are faster than ecl. > Can't remember if ccl is or not. But also, it used to be that gcl ran the > testsuite faster than any of these. Don't know if that's true anymore. > > However, I think the testsuite these days consists of a lot of number > crunching code, so that might bias the results if you're doing symbolic > stuff. > Thanks for this information! I'll try ... (and if I manage to install Sbcl, I'll report on the speed w.r.t. (our) Maxima-applications). Oliver From toy.raymond at gmail.com Fri Nov 11 16:21:36 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 11 Nov 2011 14:21:36 -0800 Subject: [Maxima] bessel.lisp error codes and noisy quad_qagi In-Reply-To: <877602A8BB6C4E64B1192C71F32E9906@edwinc367e16bd> References: <877602A8BB6C4E64B1192C71F32E9906@edwinc367e16bd> Message-ID: On Fri, Nov 11, 2011 at 2:00 PM, Edwin Woollett wrote: > > > ... finally: > > ***MESSAGE FROM ROUTINE DQAGI IN LIBRARY SLATEC. > ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED > * ABNORMAL RETURN > * ERROR NUMBER = 5 > * ***END OF MESSAGE > > (%o5) [-311.0051190974822,70.**21683385597015,5985,5] > > Is there a *quieter way* I can use quad_qagi for this > calculation? > Right now you get to go and remove the print from bessel-k in src/bessel.lisp. :-( Rather than doing these fixes one at a time, perhaps it's time to consider what maxima should do with these kinds of errors and fix them all at once. I certainly don't want the message to be removed; there needs to be some way to inform the user about issues. This is what needs to be designed. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Fri Nov 11 16:33:24 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 11 Nov 2011 17:33:24 -0500 Subject: [Maxima] Why does 'matrix' evaluate its arguments anomalously? Message-ID: The matrix function evaluates its arguments anomalously: x1: 'x2$ apply('matrix,'[[x1]]) => matrix([x2]) Compare this with other functions with n arguments: apply('append,'[[x1]]) => [x1] This is because matrix is defined as an mspec, evaluating its own arguments: (defmspec $matrix (L) ... (let ((rows (mapcar #'meval (cdr L)))) ,,,) while append is defined like this: (defmfun $append (&rest args)...) I suspect this is purely a historical artifact from an ancient version of MacLisp/meval which didn't have &rest arguments. Can anyone think of a reason that matrix shouldn't be simply this: (defmfun $matrix (&rest rows) ;; special case not necessary for 0 rows (dolist (row rows) (if (not ($listp row)) (merror (intl:gettext "matrix: row must be a list; found: ~M") row))) (matcheck rows) (cons '($matrix) rows)) -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Fri Nov 11 16:47:08 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 11 Nov 2011 14:47:08 -0800 Subject: [Maxima] bessel.lisp error codes and noisy quad_qagi Message-ID: <5D9B7AB6D1994401A4885B8D9C16DFB9@edwinc367e16bd> On Nov. 11, 2011, Raymond Toy wrote: -------------------------------------- >> ... finally: >> >> ***MESSAGE FROM ROUTINE DQAGI IN LIBRARY SLATEC. >> ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED >> * ABNORMAL RETURN >> * ERROR NUMBER = 5 >> * ***END OF MESSAGE >> >> (%o5) [-311.0051190974822,70.**21683385597015,5985,5] >> >> Is there a *quieter way* I can use quad_qagi for this >> calculation? >> > >Right now you get to go and remove the print from bessel-k in >src/bessel.lisp. :-( > >Rather than doing these fixes one at a time, perhaps it's time to >consider >what maxima should do with these kinds of errors and fix them all at >once. >I certainly don't want the message to be removed; there needs to be some >way to inform the user about issues. This is what needs to be designed. > ------------------------------- I am relying on the error code (fourth element of returned list) returned by quad_qagi to make a decision about what to do next inside nint. That's really all the information I need from quad_qagi. The rest of the zbesk ierr = stuff is not needed, nor is the final ***MESSAGE FROM ROUTINE DQAGI IN LIBRARY SLATEC. For my purposes, this is noise. Other programs which call bessel-k may profit from the micro error messages produced. A global flag (which would allow an application which only needs the macro information provided in the list returned by quad_qagi to turn off the additional micro info) would be useful. Ted From smh at franz.com Fri Nov 11 16:58:47 2011 From: smh at franz.com (Steve Haflich) Date: Fri, 11 Nov 2011 14:58:47 -0800 Subject: [Maxima] Question regarding Sbcl In-Reply-To: <20111111222047.GP20179@cs-wsok.swan.ac.uk> References: <20111111210259.GM20179@cs-wsok.swan.ac.uk> <20111111222047.GP20179@cs-wsok.swan.ac.uk> Message-ID: <1315.1321052327@gemini.franz.com> Oliver Kullmann wrote: From my point of view, the situation using Lisp seems pretty bad (see below). > Or just go grab a binary of sbcl (or cmucl or ccl). I do not use binaries for various reasons (taking them altogether): Yes you do, unless you compiled one of those "bigger Linux distributions" entirely from sources. If you managed to do that without starting with some prebuilt binary Linux distribution, I'd like to know how you accomplished this feat. What has you tied up in knots is your need to bootstrap, and while the starting boundary you have chosen (a working binary Linux, C compiler, etc.) is a reasonable one, it is also arbitrary. Once you have built any open source Common Lisp using a binary, that implementation should be capable of rebuilding itself (thereby guranteeing the build is clean, if that is your concern). This is absolutely no different from building a Linux and C compiler from sources. By the way, the language you are trying to build is called "Common Lisp", not "Lisp". The recently departed John McCarthy asked the Common Lisp community (at least) to recognize that "Lisp" denotes a family of languages, and that he did not want any particular single dialect to appropriate the name. From O.Kullmann at swansea.ac.uk Fri Nov 11 17:21:41 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Fri, 11 Nov 2011 23:21:41 +0000 Subject: [Maxima] Question regarding Sbcl In-Reply-To: <1315.1321052327@gemini.franz.com> References: <20111111210259.GM20179@cs-wsok.swan.ac.uk> <20111111222047.GP20179@cs-wsok.swan.ac.uk> <1315.1321052327@gemini.franz.com> Message-ID: <20111111232141.GQ20179@cs-wsok.swan.ac.uk> On Fri, Nov 11, 2011 at 02:58:47PM -0800, Steve Haflich wrote: > Oliver Kullmann wrote: > > From my point of view, the situation using Lisp seems pretty bad (see below). > > > Or just go grab a binary of sbcl (or cmucl or ccl). > > I do not use binaries for various reasons (taking them altogether): > > Yes you do, unless you compiled one of those "bigger Linux > distributions" entirely from sources. If you managed to do that without > starting with some prebuilt binary Linux distribution, I'd like to know > how you accomplished this feat. > > What has you tied up in knots is your need to bootstrap, and while the > starting boundary you have chosen (a working binary Linux, C compiler, > etc.) is a reasonable one, it is also arbitrary. Once you have built > any open source Common Lisp using a binary, that implementation should > be capable of rebuilding itself (thereby guaranteeing the build is clean, > if that is your concern). This is absolutely no different from building > a Linux and C compiler from sources. > There is an essential difference, namely regarding the situation: Linux is widely and freely available, worldwide. And it is essential part of the open-source ecosystem. So we base our system on Linux and what comes naturally with it, that is, C, make and so on. One often finds the illusion in programmers/mathematicians circles of "rationality without the need to decisions", and then everything becomes equal (perhaps "you have to use binaries anyway" would be an example). We want to support Linux and its ecosystem, and this is a fundamental decision. I wanted just to emphasise this necessity for fundamental decisions. Likely, the nature of these decisions is not of general interest to this mailing list. And, of course, one can decide differently (hopefully consciously). As I said, I just want to point out the necessity of (political) decisions, from which then other things follow. If one takes the decision to treat Lisp as more "fundamental" than Linux, then of course the world looks different. There is not so much what one can do here (in this context, anyway). So my statement that the situation is "pretty bad" has to be taken from that point of view, but then it is valid, and perhaps informative for some (while others can consider the situation as not "pretty bad"). >From a purely pragmatic point of view, one could try to create systems for automatic download of binaries. ... But I fear with that kind of stuff I might have already strained the patience of this mailing list too much. Thanks anyway for your thoughts! Oliver From toy.raymond at gmail.com Fri Nov 11 17:29:50 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 11 Nov 2011 15:29:50 -0800 Subject: [Maxima] bessel.lisp error codes and noisy quad_qagi In-Reply-To: <5D9B7AB6D1994401A4885B8D9C16DFB9@edwinc367e16bd> References: <5D9B7AB6D1994401A4885B8D9C16DFB9@edwinc367e16bd> Message-ID: On Fri, Nov 11, 2011 at 2:47 PM, Edwin Woollett wrote: > On Nov. 11, 2011, Raymond Toy wrote: > ------------------------------**-------- > >> ... finally: >>> >>> ***MESSAGE FROM ROUTINE DQAGI IN LIBRARY SLATEC. >>> ***INFORMATIVE MESSAGE, PROG CONTINUES, TRACEBACK REQUESTED >>> * ABNORMAL RETURN >>> * ERROR NUMBER = 5 >>> * ***END OF MESSAGE >>> >>> (%o5) [-311.0051190974822,70.****21683385597015,5985,5] >>> >>> >>> Is there a *quieter way* I can use quad_qagi for this >>> calculation? >>> >>> >> Right now you get to go and remove the print from bessel-k in >> src/bessel.lisp. :-( >> >> Rather than doing these fixes one at a time, perhaps it's time to >> consider >> what maxima should do with these kinds of errors and fix them all at >> once. >> I certainly don't want the message to be removed; there needs to be some >> way to inform the user about issues. This is what needs to be designed. >> >> ------------------------------**- > I am relying on the error code (fourth element of returned list) > returned by quad_qagi to make a decision about what to do next inside > nint. That's really all the information I need from > quad_qagi. The rest of the zbesk ierr = stuff is not needed, > nor is the final ***MESSAGE FROM ROUTINE DQAGI IN LIBRARY SLATEC. > For my purposes, this is noise. > I was thinking of slightly bigger picture than your nint. Right now, that message is the only way to know that zbesk might not be doing what you think it is. There ought to be a way for a program to determine that. For you particular issue, I also see no reason for quad_qagi to continue doing any more computations with bogus results from zbesk. If zbesk could indicate failure, then quad_qagi could immediately return failure. That would be more robust for your purposes. It's hard to tell if quad_qagi would return success even if zbesk was completely failing. Worst case: zbesk is totally broken and returns 0 for everything. quad_qagi would think everything was fine and give a nice "reliable" answer. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Fri Nov 11 17:46:12 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 11 Nov 2011 15:46:12 -0800 Subject: [Maxima] Why does 'matrix' evaluate its arguments anomalously? In-Reply-To: References: Message-ID: On 11/11/11, Stavros Macrakis wrote: > The matrix function evaluates its arguments anomalously: OK by me to change it to make it an ordinary Lisp function. best Robert Dodier From robert.dodier at gmail.com Fri Nov 11 17:50:35 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 11 Nov 2011 15:50:35 -0800 Subject: [Maxima] Problem with translate_file() in Maxima-5.25.1 In-Reply-To: References: Message-ID: On 11/10/11, Kevin Gregson wrote: > foo1(u,v):=block( > define(funmake(foo2,[x,y]),x+y), > translate(foo2), > foo2(u,v)); > Maxima interprets this OK. But after > translate(foo1); > calling foo1(2,3) produces > Error in APPLY [or a callee]: The function MDEFINE is undefined. Well, this is a bug in the translator; it is generating invalid Lisp code. I recommend pretty strongly that you shouldn't try to work around it. I'm pretty sure there is very little to gain in execution speed, and working around the bug will make your code substantially more complex & less comprehensible. > In answer to my query on how to translate and name an anonymous function, > Robert Dodier wrote: > >> I suppose you could do something like: >> >> (defun $make_named_function (name body) >> (let ((my-lisp-lambda ($translate body))) >> (setf (symbol-function name) my-lisp-lambda))) >> >> Disclaimer: I didn't actually try the above code. > > Unfortunately, calling make_named_function() produces > Error in LET [or a callee]: The function $TRANSLATE is undefined. > Is this because $translate is a special evaluation form? Probably so -- perhaps replacing ($translate foo) with (mfuncall '$translate foo) is enough to fix it. I'll take another look at this problem in a few days. best, Robert Dodier From robert.dodier at gmail.com Fri Nov 11 17:59:19 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 11 Nov 2011 15:59:19 -0800 Subject: [Maxima] Question regarding Sbcl In-Reply-To: <20111111210259.GM20179@cs-wsok.swan.ac.uk> References: <20111111210259.GM20179@cs-wsok.swan.ac.uk> Message-ID: On 11/11/11, Oliver Kullmann wrote: > HOWEVER, anyway, the only point for us trying Sbcl is that we are > looking for an open-source Lisp (usable for Maxima) faster than Ecl. > And I got the impression that Sbcl can't be faster then Ecl, or > am I wrong? > > If Sbcl is not faster than Ecl, then we don't need to install Sbcl, > and the above problem is moot. I don't remember whether ECL is faster than SBCL or vice versa. In any event, if I recall correctly, the difference is something like 25 % on the Maxima test suite. So my guess is that there is not much to gain by trying to get SBCL to work. Clisp is, by far, the slowest of the Lisp implementations; it is something like 1/3 the speed of GCL on the Maxima test suite. That's worth considering, if speed is a consideration. But all the others that I've worked with (ECL, GCL, CCL, SBCL) are not so different from each other. Well, there is also ABCL, which is very, very slow; something like 1/10 the speed of GCL on the Maxima test suite. FWIW Robert Dodier From O.Kullmann at swansea.ac.uk Fri Nov 11 18:39:00 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 12 Nov 2011 00:39:00 +0000 Subject: [Maxima] Question regarding Sbcl In-Reply-To: References: <20111111210259.GM20179@cs-wsok.swan.ac.uk> Message-ID: <20111112003900.GU20179@cs-wsok.swan.ac.uk> > I don't remember whether ECL is faster than SBCL or vice versa. > In any event, if I recall correctly, the difference is something like > 25 % on the Maxima test suite. > So my guess is that there is not much to gain by trying to get SBCL to work. > Thanks for the information. Since I already started looking at SBCL, I'll try to get it working (with some effort). Who knows, perhaps for our usage of Maxima it might be different (basically "processing big lists of sets"). > Clisp is, by far, the slowest of the Lisp implementations; it is something > like 1/3 the speed of GCL on the Maxima test suite. > That's worth considering, if speed is a consideration. > But all the others that I've worked with (ECL, GCL, CCL, SBCL) > are not so different from each other. > I just tried to install GCL, but failed. It's rather old, 2.6.7 is from 2005, and the build failures are reported also elsewhere, with some patches "somewhere" (if only people would write complete e-mails --- nearly everything written for example in the context of Linux distributions like Debian is unreadable for an outsider), so I don't follow this up. So well, we have invested already quite some time into ECL, so I guess we have to stick to it. Thanks Oliver P.S. http://www.gnu.org/software/gcl/ is very outdated, speaking only about 2.6.7, while on their mailing lists they mention 2.7 and other versions. One could try to fight with their cvs-code, but it's all so old, doesn't enthuse me much ... From A.G.Grozin at inp.nsk.su Fri Nov 11 22:27:45 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Sat, 12 Nov 2011 11:27:45 +0700 (NOVT) Subject: [Maxima] Question regarding Sbcl In-Reply-To: <20111111210259.GM20179@cs-wsok.swan.ac.uk> References: <20111111210259.GM20179@cs-wsok.swan.ac.uk> Message-ID: On Fri, 11 Nov 2011, Oliver Kullmann wrote: > HOWEVER, anyway, the only point for us trying Sbcl is that we are > looking for an open-source Lisp (usable for Maxima) faster than Ecl. > And I got the impression that Sbcl can't be faster then Ecl, or > am I wrong? Quoting myself: On my box (Intel E5300 2.6Ghz), testsuite real times (in seconds) and failed tests are sbcl-1.0.50 204 rtest16 (386, 387) gcl-2.6.8_pre 208 cmucl-20b_p001 211 clozurecl-1.7 293 rtest_gamma (673) ecl-11.1.1 404 rtest8 (126, 127) clisp-2.49 628 If the testsuite is representative, ecl is 2 times slower than sbcl. Andrey From A.G.Grozin at inp.nsk.su Fri Nov 11 22:34:17 2011 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Sat, 12 Nov 2011 11:34:17 +0700 (NOVT) Subject: [Maxima] Question regarding Sbcl In-Reply-To: <20111111222047.GP20179@cs-wsok.swan.ac.uk> References: <20111111210259.GM20179@cs-wsok.swan.ac.uk> <20111111222047.GP20179@cs-wsok.swan.ac.uk> Message-ID: On Fri, 11 Nov 2011, Oliver Kullmann wrote: > I do not use binaries for various reasons (taking them altogether): > 1. All we are doing is going to be redistributed, and we want to provide > a complete and (nearly) automated build. > 2. It seems to me essential for the spirit of open-source to be able to > build from sources (what is the source-code good for otherwise?). > 3. I do not trust a system without the sources (working sources that is). > 4. I do not trust the quality of a system which can not be built from > sources (I think one should make an effort like Sage, or actually also > our "library", to provide everything that it needed in a "standard Linux > environment"). I completely agree with your points. This is why I am a Gentoo Linux developer. Gentoo has sbcl (as well as cmucl, ccl, ecl, clisp). The approach taken by the sbcl ebuild is: 1. Download the appropriate sbcl binary; 2. Compile the sbcl source with it; 3. Throw away the downloaded binary, and use the locally compiled one. I don't think this disqualifies sbcl. I don't use binaries which I have not compiled locally, on my computer. And sbcl (and hence sbcl-maxima) don't violate this principle. Andrey From nb0yjxtr at iceland.freeshell.org Fri Nov 11 11:31:35 2011 From: nb0yjxtr at iceland.freeshell.org (Leo) Date: Fri, 11 Nov 2011 17:31:35 +0000 Subject: [Maxima] compute eigenvalues numerically In-Reply-To: (message from Andres Cimmarusti on Fri, 11 Nov 2011 12:11:22 -0500) Message-ID: <1qpfwhuo9ag.fsf@iceland.freeshell.org> Andres Cimmarusti writes: > Dear maxima users, > > I've been working on some calculations that eventually lead to a 5x5 > matrix, whose components can be complex. The next step is to calculate > the eigenvalues and possibly the eigenvectors. > > The built-in maxima functions: eigenvalues and eigenvectors > immediately fail, even when the matrix has all real components. It > says "solve is unable to find the roots of the characteristic > polynomial". > > I looked at "dgeev" which uses lapack, and it worked superbly when the > matrix components are real, but gave me errors when they were complex, > as expected. Sadly dgeev only works for integers and floating point. Try mnewton: (%i2) load('mnewton); (%o2) /home/work/maxima/sandbox/maxima-current-release/share/contrib/mnewton.mac (%i3) mnewton([z^5-z-1],[z],[1]); (%o3) [[z = 1.167303978261419]] (%i4) subst(%,z^5-z-1); (%o4) 4.440892098500626e-16 (%i5) mnewton([z^5-z-1],[z],[1+%i]); (%o5) [[z = .3524715460317263 %i - .7648844336005847]] (%i6) subst(%,z^5-z-1); 5 (%o6) - .3524715460317263 %i + (.3524715460317263 %i - .7648844336005847) - .2351155663994153 (%i7) expand(%); (%o7) 1.110223024625157e-16 - 2.220446049250313e-16 %i (%i8) Leo > > Is there any other tool/function that will compute these things > numerically? I deally I would want to later plot each eigenvalue as a > function of one or two parameters. > Perhaps maxima is not the appropriate tool to do this anymore (my > original hope was to compute things analytically, but that's pretty > much out the window now).. care to suggest a good way to go? > > As an additional thing, in an earlier stage of my work (which proved > wrong), I was able to reduce the characteristic polynomial to a 4th > order equation. Wikipedia says, analytical solutions are possible > (http://en.wikipedia.org/wiki/Quartic_function#Summary_of_Ferrari.27s_method) > through something known as the Ferrari's method. However, when I tried > using 'solve' with this quartic polynomial, maxima just couldn't do > it. After many minutes, maxima simply crashed...(it was disconnected > from WxMaxima) > > I have to say that the coefficients of the polynomial were quite > lengthy, but I feel it should have worked...Naturally when I try a > general quartic polynomial like listed in the wikipedia article, > things work fine, though I get warned the expression is too long to > display. What are the limitations here?...it really is just a lot of > algebra... > > Now, in the case of quintic polynomials, which brings me back to my > original question, 'solve' can't even do this: > > solve( z^5 -z -1 = 0 , z); > > This is a well known quintic polynomial whose roots cannot be obtained > analytically by any means, but they should be possible, numerically. > Is there a way to get the roots using solve or other tool in maxima? > if so, can I "instruct" eigenvalues / eigenvectors to use this instead > of plain solve? > > I'm using Maxima 5.21.1 on Debian Squeeze. GCL 2.6.7 > > Thanks for your input > > Andres > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Leo Butler leo.butler at member.ams.org SDF Public Access UNIX System - http://sdf.lonestar.org From peddrovallle at yahoo.com Fri Nov 11 14:45:07 2011 From: peddrovallle at yahoo.com (Peddro Vallle hondo) Date: Fri, 11 Nov 2011 20:45:07 +0000 (GMT) Subject: [Maxima] Helping out with Maxima Message-ID: <1321044307.15125.YahooMailNeo@web132505.mail.ird.yahoo.com> There is a recent post in planet.lisp.org about using cffi to use a R library by Tamas k Papp (by the way, there is a post in the mailing list by Tamas in 2009). See ** below As R is growing quickly and can use easily libraries in C and fortran, it seems that a maxima to R translator is a winning point. ------------------------------------ ** Third paragraph from ?http://tkpapp.blogspot.com/2011/11/new-and-updated-libraries.html Realizing that implementing special functions in Common Lisp is perhaps not the best use of my time, I decided to use a foreign library for this purpose in cl-random. I chose R's standalone math library, with an SWIG-generated wrapper (it took about 30 minutes to have this library running, SWIG is amazing). I made the result available as a small standalone library called cl-rmath in case anyone else wants to use it. I really appreciate that the R developers made this available as a standalone library, it makes my life muc for example, the univariate normal now has the syntax (r-normal mean variance) instead of the standard deviation, to be more consistent with the multivariate case. On 11/11/2011 11:05 AM, Michel Talon wrote: >>Although i don't know anything about that, there is supposed to be a comman >foreign function interface working with Allegro, CMUCL, SBCL, ECL, >http://common-lisp.net/project/cffi/manual/cffi-manual.html >and swig has a module which can do the wrapping in an automated >wayhttp://http://www.swig.org/Doc1.3/Lisp.html#Lisp_nn11 >It can also wrap for clisp, which covers Windows use, i think. >>I have not tried CFFI. I have used only one FFI, in Allegro Common Lisp. My understanding as of a few years ago was that CFFI or UFFI supported only a subset of features. I do not know how this has changed over time, or if any of the features matter to Maxima. I would encourage someone to look at it though! -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Sat Nov 12 03:59:20 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sat, 12 Nov 2011 09:59:20 +0000 (UTC) Subject: [Maxima] Helping out with Maxima References: <1321044307.15125.YahooMailNeo@web132505.mail.ird.yahoo.com> Message-ID: Peddro Vallle hondo wrote: > There is a recent post in planet.lisp.org about using cffi to use > a R library by Tamas k Papp (by the way, there is a post in > the mailing list by Tamas in 2009). See ** below > > As R is growing quickly and can use easily libraries in C and fortran, > it seems that a maxima to R translator is a winning point. > > ------------------------------------ > ** Third paragraph from > ?http://tkpapp.blogspot.com/2011/11/new-and-updated-libraries.html Indeed i have taken a look at the swig generated wrapper in: https://github.com/tpapp/cl-rmath/blob/master/cl-rmath.lisp it is impressive, all the more when you realize that the cl-math.i which drives the thing is < 30 lines! An example like this shows that this could be a very efficient way to enhance maxima with little effort. In fact this is the way through which scientific python has stormed the scientific community, using external C or fortran programs wrapped with swig or f2py. This way one benefits of the full speed of the core of the computation. There is another tool in the python bag of tricks which allows to intersperse quasi C code and python code to enhance the speed of critical sections of the code, see for example pyrex: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/About.htm l or weave, etc. The following example is particularly nice: http://www.scipy.org/PerformancePython The timings given at the end of the article are particularly relevant for our discussion. You will see here that the timings of the computation programmed with matlab or octave, which have an expression interpreter somewhat analogous to the one in maxima, are very poor. Using python plus inlined C for the critical section gives result as fast as straight C. I think that the lesson is also valid for maxima. I am sure that similar tricks could be developed for lisp, since it is a more powerful language than python. -- Michel Talon From drdieterkaiser at web.de Sat Nov 12 04:27:42 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 12 Nov 2011 11:27:42 +0100 Subject: [Maxima] Committing the file sharefiles.mk Message-ID: <1321093662.2792.14.camel@dieter> In the last commits I have observed that the file sharefiles.mk has been committed. I think this is not necessary, because this file will be automatically generated and will be different for every developer. I have always ignored this file and I have not committed it. But if the file is committed by another developer, I always get a problem when pulling the changes, because of inconsistencies between the file in the repository and my local version. Perhaps, we can tell git that this file should not be included in a regularly update. One solution is not to commit changes and to ignore local changes. Dieter Kaiser From drdieterkaiser at web.de Sat Nov 12 06:42:32 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 12 Nov 2011 13:42:32 +0100 Subject: [Maxima] Problem running symmgrp2009.max with recent versions of Maxima In-Reply-To: <9DACA6C5-7EF7-41CC-96AC-AA288EB36323@glam.ac.uk> References: <3C6A1C9C-859B-4880-B0B2-2AC7B5964311@glam.ac.uk> <1320871867.1825.24.camel@dieter> <1320958058.2089.7.camel@dieter> <9DACA6C5-7EF7-41CC-96AC-AA288EB36323@glam.ac.uk> Message-ID: <1321101752.2792.27.camel@dieter> Am Freitag, den 11.11.2011, 08:20 +0000 schrieb Wiltshire R J (AT): > > On 10 Nov 2011, at 20:47, Dieter Kaiser wrote: > > > Am Donnerstag, den 10.11.2011, 08:44 +0000 schrieb Wiltshire R J (AT): > >> Dear Dieter, > >> > >> > >> Thanks for your reply and certainly what you describe is compatible > >> with the following error message which I get when I run the program > >> (Maxima 5.25.0 on a Mac): > >> > >> > >> > >> > >> depends: argument must be a symbol; found x[1] > >> #0: symmetry(ind1=1,ind2=0,ind3=0)(symmgrp2009.max line 924) > >> -- an error. To debug this try: debugmode(true); > >> > > > > I had a look at the problem in general. I will try an implementation of > > dependencies which allows subscripted variables in addition. I need some > > days. > > > > Dieter Kaiser > > > > > Thanks for taking time to look at this problem. > > Ron Wiltshire I have committed a change to the function depends, which allows subscripted variables. These are examples: (%i1) depends(g,f,f,[x[1],x[2],x[3]],x,t); (%o1) [g(f),f(x[1],x[2],x[3]),x(t)] (%i2) diff(g,f); (%o2) 'diff(g,f,1) (%i3) diff(f,x[1]); (%o3) 'diff(f,x[1],1) (%i4) diff(x[1],t); (%o4) 'diff(x[1],t,1) (%i5) diff(f,x[1],1,x[2],1,x[3],1); (%o5) 'diff(f,x[1],1,x[2],1,x[3],1) (%i6) diff(f,t); (%o6) 'diff(x[3],t,1)*'diff(f,x[3],1)+'diff(x[2],t,1)*'diff(f,x[2],1) +'diff(x[1],t,1)*'diff(f,x[1],1) (%i7) diff(g,t); (%o7) ('diff(x[3],t,1)*'diff(f,x[3],1)+'diff(x[2],t,1)*'diff(f,x[2],1) +'diff(x[1],t,1)*'diff(f,x[1],1)) *'diff(g,f,1) I have added some more examples to the test file rtest5.mac. I have loaded your file "symmgrp2009.mac" (Be aware, that I have changed the extension from .max to .mac, because .mac is the default for Maxima batch files). Maxima 5.25post http://maxima.sourceforge.net using Lisp SBCL 1.0.45 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) load("symmgrp2009.mac"); Code symmgrp2009.max of Janurary 1, 2010 is being loaded. Code symmgrp2009.max of January 1, 2010 was successfully loaded. (%o1) symmgrp2009.mac Now, It would be nice when I could get some simple examples and the expected results, which I can type into the console to test the package. I have not installed wxMaxima at this time. Dieter Kaiser From O.Kullmann at swansea.ac.uk Sat Nov 12 11:51:28 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 12 Nov 2011 17:51:28 +0000 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) Message-ID: <20111112175128.GX20179@cs-wsok.swan.ac.uk> Hello, while trying various Lisp's (not finished yet) a problem showed up which we had for a long time, but could ignore, due to just using one Lisp, namely what is the definition of "sort"?: First it says Sorts a list according to a predicate `P' of two arguments, such that `

([k], [k + 1])' is `true' for any two successive elements. This *excludes* the use of orderlessp, which is nevertheless the key example, since orderlessp is a *strict* order, i.e. "<", not "<=": orderlessp(1,1); false According to the sentence above one needed to use "<=", not "<", or otherwise sort would be undefined on a list of equal elements, say sort([1,1]) would be undefined. In the light of the discussion below, I guess what is meant here is P(L[k+1],L[k]) is false. Furthermore it says If the predicate

is not a total order on the elements of , then `sort' might run to completion without error, but the result is undefined. `sort' complains if the predicate evaluates to something other than `true' or `false'. However "total order" is itself unspecified here, since it is not said (and in fact, as shown above, inconsistent), whether a strict (irreflexive) order or an "normal" (reflexive) order is meant. Since orderlessp should be the prime example, I guess a "strict total order" is meant. This is also algorithmically sensible, since only when x I need to solve linear polynomial Diophantine equations, which can be done via an extended polynomial gcd if necessary. Such functions are used extensively in ezgcd, integration etc., so I know that they are in there somewhere, but I can't find such functions in the online Maxima manual. -- best regards, david stoutemyer -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Sat Nov 12 15:02:01 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 12 Nov 2011 13:02:01 -0800 Subject: [Maxima] bessel.lisp error codes and noisy quad_qagi Message-ID: On Nov. 11, 2011, Raymond Toy wrote: ------------ >> quad_qagi. The rest of the zbesk ierr = stuff is not needed, >> nor is the final ***MESSAGE FROM ROUTINE DQAGI IN LIBRARY SLATEC. >> For my purposes, this is noise. >> > >I was thinking of slightly bigger picture than your nint. Right now, >that >message is the only way to know that zbesk might not be doing what you >think it is. There ought to be a way for a program to determine that. > >For you particular issue, I also see no reason for quad_qagi to continue >doing any more computations with bogus results from zbesk. If zbesk >could >indicate failure, then quad_qagi could immediately return failure. That >would be more robust for your purposes. It's hard to tell if quad_qagi >would return success even if zbesk was completely failing. Worst case: >zbesk is totally broken and returns 0 for everything. quad_qagi would >think everything was fine and give a nice "reliable" answer. > ---------------------- I agree that a wider and deeper approach would be valuable. A possible approach to quiet mode error handling with Maxima special functions is sketched out below: We need: 1. a global list, spfun_errL, by default empty 2. a global flag, spfun_quiet_mode, by default false When a layered package program (such as nint) calls quad_qagi, etc, the calling program first sets spfun_quiet_mode:true and makes sure that spfun_errL is an empty list (length zero). Inside quad_qagi, for example, between each successive refinement of the value of the numerical integral (increase in number of mesh points, etc.) quad_qagi examines the global list spfun_errL to see if it is empty or has length greater than zero, in which case quad_qagi, etc, returns with an error code of 6. (See below for how spfun_errL gets populated with sublists.) Although in principle, the action taken by a program which calls special functions could vary, depending on the contents of spfun_errL, quad_qagi could just return a list with the approximation reached at the previous iteration, except that an error code = 6 would be used as the fourth element of the list returned. If the program calling quad_qagi is nint, that error code = 6 return from quad_qagi would trigger an appropriate message to the user of the program, and nint would be responsible for resetting the list spfun_errL to an empty list before further calls, and also setting the flag spfun_quiet_mode to its default value false before exiting the program. Populating spfun_errL: Each of the Maxima special functions is given an id number (bessel-j,1) (bessel-y,2), (bessel-i,3), (bessel-k,4), etc in their code. When a Maxima special function (such as bessel-k) detects an error code such as is returned from zbesk.lisp, and if spfun_quiet_mode is true, then instead of printing an error message to the console, bessel-k conses the sublist [id-num, bessel-fun-order,bessel-fun-arg,ierr] into spfun_errL and returns something appropriate (perhaps 0.0) to quad_qagi. If the integrand needs calls to more than one special function, and if more than one such call results in an error, then more than one sublist will appear in spfun_errL. An interactive user of numerical values of Bessel functions would have the option of depending on the usual printed error warning, or of using the same spfun_quiet_mode. In the latter case, the populated list spfun_errL could be used for diagnostics, including the improvement of the bessel function routines. If the list spfun_errL is actually initially a Lisp list, then the corresponding Maxima list could be created via a plain words translation of the id-num value and ierr value into, for example, bessel_k, overflow or underflow. If all Maxima special functions adopted a common meaning for numerical error return numbers, the job would be simplified. Ted From smh at franz.com Sat Nov 12 15:14:19 2011 From: smh at franz.com (Steve Haflich) Date: Sat, 12 Nov 2011 13:14:19 -0800 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: <20111112175128.GX20179@cs-wsok.swan.ac.uk> References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> Message-ID: <16992.1321132459@gemini.franz.com> Oliver Kullmann wrote: while trying various Lisp's (not finished yet) a problem showed up which we had for a long time, but could ignore, due to just using one Lisp, namely what is the definition of "sort"?: I assume, since you are asking the Maxima list, you are concerned about some particular implementation that purports to be an implementation of ANSI Common Lisp. But it isn't at all clear to what documentation your message refers. ANSI Common Lisp has a well-done specification that covers most of these issues. It is available (in ugly pdf, and for a fee) from ANSI, but it is also available in a slightly earlier version (essentially the files that were submitted to ANSI, just before ANSI slapped their headers and footers and copyrights on it -- they are identical in all technical specifications) from various places like Franz and Lispworks. (The latter is the well-known Hyperspec.) Now, some of the popular "Common Lisp" implementations predate the final ANS and don't purport entirely to conform, but for most language details the ANS is the first place you should look. Thereafter, check the implementation documentation to see if it deviates significantly. The definition of ANSI CL sort and stable-sort are here: http://www.franz.com/support/documentation/current/ansicl/dictentr/sortstab.htm The definition of "purports" can be found starting here: http://www.franz.com/support/documentation/current/ansicl/dictentr/features.htm First it says ... Your specific questions about sort are certainly reasonable questions, but you should read the ANS requirements first, and then sEe whethere this particular implementation deviates in any significant way. IMO, Maxima should be written for the ANS specification except in the rare cases where implementation details beoome significant. These cases shuld be rare! Dependence on implementation details exposes Maxima to future contusions when that implementation changes out from under it. From O.Kullmann at swansea.ac.uk Sat Nov 12 15:19:55 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 12 Nov 2011 21:19:55 +0000 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: <16992.1321132459@gemini.franz.com> References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <16992.1321132459@gemini.franz.com> Message-ID: <20111112211955.GZ20179@cs-wsok.swan.ac.uk> Obviously, I am referring to the MAXIMA documentation: ----------------------------------------------------------- (%i2) ? sort -- Function: sort (,

) -- Function: sort () Sorts a list according to a predicate `P' of two arguments, such that `

([k], [k + 1])' is `true' for any two successive elements. The predicate may be specified as the name of a function or binary infix operator, or as a `lambda' expression. If specified as the name of an operator, the name is enclosed in "double quotes". The sorted list is returned as a new object; the argument is not modified. To construct the return value, `sort' makes a shallow copy of the elements of . If the predicate

is not a total order on the elements of , then `sort' might run to completion without error, but the result is undefined. `sort' complains if the predicate evaluates to something other than `true' or `false'. `sort ()' is equivalent to `sort (, orderlessp)'. That is, the default sorting order is ascending, as determined by `orderlessp'. All Maxima atoms and expressions are comparable under `orderlessp'. The predicate `ordergreatp' sorts a list in descending order. The predicate `ordermagnitudep' sorts Maxima numbers, constant symbols with a numerical value, or expressions which can be evaluated to a constant by magnitude. All other elements of the list are sorted by `orderlessp'. The predicate `"<"' allows the ordering by magnitude too, but does not order completely if elements in the list are not comparable under `"<"'. Examples: (%i1) sort ([11, -17, 29b0, 7.55, 3, -5/2, b + a, 9 * c, 19 - 3 * x]); 5 (%o1) [- 17, - -, 3, 7.55, 11, 2.9b1, b + a, 9 c, 19 - 3 x] 2 (%i2) sort ([11, -17, 29b0, 7.55, 3, -5/2, b + a, 9*c, 19 - 3*x], ordergreatp); 5 (%o2) [19 - 3 x, 9 c, b + a, 2.9b1, 11, 7.55, 3, - -, - 17] 2 (%i3) sort ([%pi, 3, 4, %e, %gamma]); (%o3) [3, 4, %e, %gamma, %pi] (%i4) sort ([%pi, 3, 4, %e, %gamma], "<"); (%o4) [%gamma, %e, 3, %pi, 4] (%i5) my_list: [[aa,hh,uu], [ee,cc], [zz,xx,mm,cc], [%pi,%e]]; (%o5) [[aa, hh, uu], [ee, cc], [zz, xx, mm, cc], [%pi, %e]] (%i6) sort (my_list); (%o6) [[%pi, %e], [aa, hh, uu], [ee, cc], [zz, xx, mm, cc]] (%i7) sort (my_list, lambda ([a, b], orderlessp (reverse (a), reverse (b)))); (%o7) [[%pi, %e], [ee, cc], [zz, xx, mm, cc], [aa, hh, uu]] Order Maxima numbers, constants, and constants expressions by magnitude, and all other elements in ascending sorting order: (%i8) sort([%i,1+%i,2*x,minf,inf,%e,sin(1),0,1,2,3,1.0,1.0b0], ordermagnitudep); (%o8) [minf, 0, sin(1), 1, 1.0, 1.0b0, 2, %e, 3, inf, %i, %i + 1, 2 x] ----------------------------- I must say I find it a bit strange, the tendency to assume that the question must be wrong in some sense. On Sat, Nov 12, 2011 at 01:14:19PM -0800, Steve Haflich wrote: > Oliver Kullmann wrote: > > while trying various Lisp's (not finished yet) a problem showed up which > we had for a long time, but could ignore, due to just using > one Lisp, namely what is the definition of "sort"?: > > I assume, since you are asking the Maxima list, you are concerned about > some particular implementation that purports to be an implementation of > ANSI Common Lisp. But it isn't at all clear to what documentation your > message refers. > I was not speaking about Lisp, but about Maxima. > ANSI Common Lisp has a well-done specification that covers most of these > issues. It is available (in ugly pdf, and for a fee) from ANSI, but it > is also available in a slightly earlier version (essentially the files > that were submitted to ANSI, just before ANSI slapped their headers and > footers and copyrights on it -- they are identical in all technical > specifications) from various places like Franz and Lispworks. (The > latter is the well-known Hyperspec.) > I do not know how Maxima-sort is implemented, and that is a question for the Maxima-implementers, not for me. > > Your specific questions about sort are certainly reasonable questions, > but you should read the ANS requirements first, why should I do this? > and then sEe whethere > this particular implementation deviates in any significant way. IMO, > Maxima should be written for the ANS specification except in the rare > cases where implementation details beoome significant. These cases > shuld be rare! Dependence on implementation details exposes Maxima to > future contusions when that implementation changes out from under it. Exactly! Thus Maxima needs precise specifications of the MAXIMA functions. Oliver -- 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 O.Kullmann at swansea.ac.uk Sat Nov 12 16:29:16 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 12 Nov 2011 22:29:16 +0000 Subject: [Maxima] Maxima-function logxor does not work under Sbcl Message-ID: <20111112222916.GA20179@cs-wsok.swan.ac.uk> Hello, Maxima 5.25.1 http://maxima.sourceforge.net using Lisp SBCL 1.0.53 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. STYLE-WARNING: redefining MAXIMA::ADD-LINEINFO in DEFUN STYLE-WARNING: redefining MAXIMA::$LOAD in DEFUN (%i1) load(functs); Evaluation took 0.0180 seconds (0.0190 elapsed) using 3.045 MB. (%o1) "/home/kullmann/OKplatform/ExternalSources/Installations/Maxima/sbcl/5.25.1/share/maxima/5.25.1/share/simplification/functs.mac" (%i2) logxor(1,1); Evaluation took 0.0000 seconds (0.0010 elapsed) using 0 bytes. (%o2) 1 which should return 0, which it does under CLisp and Ecl, e.g. Maxima 5.25.1 http://maxima.sourceforge.net using Lisp ECL 11.1.1 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) load(functs); Evaluation took 0.0150 seconds (0.0180 elapsed) (%o1) "/home/kullmann/OKplatform/ExternalSources/Installations/Maxima/ecl/5.25.1/share/maxima/5.25.1/share/simplification/functs.mac" (%i2) logxor(1,1); Evaluation took 0.0000 seconds (0.0000 elapsed) (%o2) 0 The Maxima-buid using Sbcl (built using CLisp) passed all tests except of one, a numerical value close by to the given one. Many tests of my system also passed, and I can't see any systematic issue here. Oliver From willisb at unk.edu Sat Nov 12 17:23:03 2011 From: willisb at unk.edu (Barton Willis) Date: Sat, 12 Nov 2011 17:23:03 -0600 Subject: [Maxima] crazy inputs to maxima-substitute In-Reply-To: <1315.1321052327@gemini.franz.com> References: <1315.1321052327@gemini.franz.com>, <20111111210259.GM20179@cs-wsok.swan.ac.uk> <20111111222047.GP20179@cs-wsok.swan.ac.uk> Message-ID: Oh, by the way: The source code comment to maxima-substitute (defined in comm.lisp) says "The args to SUBSTITUTE are assumed to be simplified." Oops--not only is that untrue, but maxima-substitute sometimes receives arguments that invalid maxima expressions; for example integrate(cos(2*x)*cos(x),x); .... 1> (MAXIMA-SUBSTITUTE (%COS SIMP) B ((MTIMES SIMP) ((MPLUS SIMP) ((MTIMES SIMP) ((RAT SIMP) 1 2) ((%SIN SIMP) $X)) ((MTIMES SIMP) ((RAT SIMP) 1 6) ((%SIN SIMP) ((MTIMES SIMP) 3 $X)))) A)) Additionally, the substitution functions maxima-substitute, subst1, and subst2 are mostly the same, but different. Ugh. --Barton From talon at lpthe.jussieu.fr Sat Nov 12 17:33:41 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sat, 12 Nov 2011 23:33:41 +0000 (UTC) Subject: [Maxima] Maxima-function logxor does not work under Sbcl References: <20111112222916.GA20179@cs-wsok.swan.ac.uk> Message-ID: Oliver Kullmann wrote: > Hello, > > Maxima 5.25.1 http://maxima.sourceforge.net > using Lisp SBCL 1.0.53 > 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. > STYLE-WARNING: redefining MAXIMA::ADD-LINEINFO in DEFUN > STYLE-WARNING: redefining MAXIMA::$LOAD in DEFUN > (%i1) load(functs); > Evaluation took 0.0180 seconds (0.0190 elapsed) using 3.045 MB. > (%o1) "/home/kullmann/OKplatform/ExternalSources/Installations/Maxima/sbcl/5 .25.1/share/maxima/5.25.1/share/simplification/functs.mac" > (%i2) logxor(1,1); > Evaluation took 0.0000 seconds (0.0010 elapsed) using 0 bytes. > (%o2) 1 > > which should return 0, which it does under CLisp and Ecl, e.g. > I have the same result on my machine, however when i do the same computation directly in lisp the result is Ok lilas% sbcl This is SBCL 1.0.51.0-a546163, an implementation of ANSI Common Lisp. More information about SBCL is available at . SBCL is free software, provided as is, with absolutely no warranty. It is mostly in the public domain; some portions are provided under BSD-style licenses. See the CREDITS and COPYING files in the distribution for more information. * (boole boole-xor 1 1) 0 * (boole boole-xor 1 2) 3 * So an error creeps in the file functs.mac or whatever. An indication, in functs.mac one finds the definition logxor(x,y):=?boole(6,x,y)$ which i think means (boole 6 x y) in lisp. But in maxima-sbcl i get: lilas% maxima (%i1) :lisp (print cl:boole-xor) 8 The CLHS says that the values of stuff like boole-xor is "implementation dependant". This means that the definition in funcs.mac is buggy, it should specify boole-xor and not an absolute number like 6, which changes from implementaion to implementation. In short someone should fx the definition of logand, logor and logxor in funcs.mac, and replace 1, 7, 6 by appropriate lisp constants, boole-and boole-ior boole-xor. -- Michel Talon From dtc-maxima at scieneer.com Sat Nov 12 17:40:29 2011 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Sun, 13 Nov 2011 10:40:29 +1100 Subject: [Maxima] Maxima-function logxor does not work under Sbcl In-Reply-To: <20111112222916.GA20179@cs-wsok.swan.ac.uk> References: <20111112222916.GA20179@cs-wsok.swan.ac.uk> Message-ID: <4EBF03ED.2090805@scieneer.com> Hello Oliver, Numerical constants were being used that vary between CL implementations. Please try the following: logical&& logand(x,y):=?boole(?boole\-and,x,y)$ logor(x,y):=?boole(?boole\-ior,x,y)$ logxor(x,y):=?boole(?boole\-xor,x,y)$ Regards Douglas Crosher On 13/11/11 09:29, Oliver Kullmann wrote: > Hello, > > Maxima 5.25.1 http://maxima.sourceforge.net > using Lisp SBCL 1.0.53 > 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. > STYLE-WARNING: redefining MAXIMA::ADD-LINEINFO in DEFUN > STYLE-WARNING: redefining MAXIMA::$LOAD in DEFUN > (%i1) load(functs); > Evaluation took 0.0180 seconds (0.0190 elapsed) using 3.045 MB. > (%o1) "/home/kullmann/OKplatform/ExternalSources/Installations/Maxima/sbcl/5.25.1/share/maxima/5.25.1/share/simplification/functs.mac" > (%i2) logxor(1,1); > Evaluation took 0.0000 seconds (0.0010 elapsed) using 0 bytes. > (%o2) 1 > > which should return 0, which it does under CLisp and Ecl, e.g. > > Maxima 5.25.1 http://maxima.sourceforge.net > using Lisp ECL 11.1.1 > 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) load(functs); > Evaluation took 0.0150 seconds (0.0180 elapsed) > (%o1) "/home/kullmann/OKplatform/ExternalSources/Installations/Maxima/ecl/5.25.1/share/maxima/5.25.1/share/simplification/functs.mac" > (%i2) logxor(1,1); > Evaluation took 0.0000 seconds (0.0000 elapsed) > (%o2) 0 > > > The Maxima-buid using Sbcl (built using CLisp) passed all tests except of one, > a numerical value close by to the given one. > > Many tests of my system also passed, and I can't see any systematic issue here. > > Oliver > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From O.Kullmann at swansea.ac.uk Sat Nov 12 17:53:36 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sat, 12 Nov 2011 23:53:36 +0000 Subject: [Maxima] Question regarding Sbcl In-Reply-To: References: <20111111210259.GM20179@cs-wsok.swan.ac.uk> Message-ID: <20111112235336.GB20179@cs-wsok.swan.ac.uk> > On my box (Intel E5300 2.6Ghz), testsuite real times (in seconds) > and failed tests are > > sbcl-1.0.50 204 rtest16 (386, 387) > gcl-2.6.8_pre 208 > cmucl-20b_p001 211 > clozurecl-1.7 293 rtest_gamma (673) > ecl-11.1.1 404 rtest8 (126, 127) > clisp-2.49 628 > > If the testsuite is representative, ecl is 2 times slower than sbcl. > > Andrey In our setting (with our mix of applications, typically list- and set-processing) I get for the comparison of Ecl (11.1.1) and Sbcl (1.0.53): - Sbcl needs roughly 50% more time with loading files (especially for our tests that's not so nice, since every test runs on its own and loads a lot of files). - Sbcl is around 30% faster (sometimes more, sometimes less, but seems to be around that). So for our applications the advantage is not so great. Oliver From O.Kullmann at swansea.ac.uk Sat Nov 12 18:05:10 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 13 Nov 2011 00:05:10 +0000 Subject: [Maxima] Question regarding Sbcl In-Reply-To: References: <20111111210259.GM20179@cs-wsok.swan.ac.uk> <20111111222047.GP20179@cs-wsok.swan.ac.uk> Message-ID: <20111113000510.GC20179@cs-wsok.swan.ac.uk> > I completely agree with your points. This is why I am a Gentoo Linux > developer. > > Gentoo has sbcl (as well as cmucl, ccl, ecl, clisp). The approach > taken by the sbcl ebuild is: > That's impressive; if I have more time, then I'll try Gentoo. > 1. Download the appropriate sbcl binary; > 2. Compile the sbcl source with it; > 3. Throw away the downloaded binary, and use the locally compiled one. > > I don't think this disqualifies sbcl. I don't use binaries which I > have not compiled locally, on my computer. And sbcl (and hence > sbcl-maxima) don't violate this principle. > There's only the problem that it's harder to automatise. Anyway, in this case we got it working with CLisp. Oliver -- 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 O.Kullmann at swansea.ac.uk Sat Nov 12 18:13:37 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 13 Nov 2011 00:13:37 +0000 Subject: [Maxima] Question regarding Sbcl In-Reply-To: References: Message-ID: <20111113001337.GD20179@cs-wsok.swan.ac.uk> > > So the error doesn't seem to make sense. > > AFAICS sbcl wants to grab 8 GB of memory and limit for virtual > memory is 4.8 GB, no wonder that allocation fails. This is > known problem with SuSe (which you seem to be using). I think it shouldn't grab 8 GB when it has the information that that is not available (and it shouldn't need it). > The > simplest workaround is: > > ulimit -v unlimited > Yes, that worked, thanks (though I have a bit of a problem with that). > Concerning speed: sbcl is my main platform for developing FriCAS. > On FriCAS testsuite sbcl (with default speed/safety setting) is > about 3 times as fast as ECL (with safety lowerd to 1 -- note > that ECL default is 2 which results in much slower code). > But of course speed factor depends on actual code, and > may be quite different for Maxima (on specific routines I > frequently see ratios very far from average). > As I've written in my other e-mail, on the mixture of our applications Sbcl is only 30% faster than Ecl (but needs 50% more time with loading files). That's interesting about the Ecl safety level --- I guess that needed to be lowered when building Maxima, and it's not so clear how to do that? And when running Maxima, would one need a preloaded lisp-file with the appropriate instruction? Thanks for your help. Oliver From kcrisman at gmail.com Sat Nov 12 21:10:40 2011 From: kcrisman at gmail.com (Karl-Dieter Crisman) Date: Sat, 12 Nov 2011 22:10:40 -0500 Subject: [Maxima] Indefinite integral is known and not weird, but definite integral won't go Message-ID: Dear list, Title sums it up, and see below for exact issue. It seems odd that Maxima knows the indefinite integral, that said antiderivative doesn't have a domain issue near the endpoints (and looks like a pretty routine u-substitution), but the definite integral doesn't use the FTC. [Maple, Sympy, and Mathematica both do and say =1/2.] At the same time, maybe there is some branch issue or something going on here? As usual, hesitant to cry "bug" where multivalued functions are involved... so I'd be grateful for advice. Thanks for any help, I'll file a bug report if need be! (Originally from a sage-support thread.) Maxima 5.25.0 http://maxima.sourceforge.net using Lisp SBCL 1.0.24 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(1/(sqrt(x)*((1+sqrt(x))^2)),x,1,1); (%o1) 0 (%i2) integrate(1/(sqrt(x)*((1+sqrt(x))^2)),x,1,9); 9 / [ 1 (%o2) I ---------------------- dx ] 2 / (sqrt(x) + 1) sqrt(x) 1 (%i3) integrate(1/(sqrt(x)*((1+sqrt(x))^2)),x); 2 (%o3) - ----------- sqrt(x) + 1 From smh at franz.com Sat Nov 12 22:02:43 2011 From: smh at franz.com (Steve Haflich) Date: Sat, 12 Nov 2011 20:02:43 -0800 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: <20111112211955.GZ20179@cs-wsok.swan.ac.uk> References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <16992.1321132459@gemini.franz.com> <20111112211955.GZ20179@cs-wsok.swan.ac.uk> Message-ID: <27484.1321156963@gemini.franz.com> Oliver Kullmann wrote: Obviously, I am referring to the MAXIMA documentation: (I'm in danger of acting like a troll, which is not my intention. Apology in advance.) This appears to be the definition of maxima sort: (defmfun $sort (l &optional (f 'lessthan)) (let ((llist l) comparfun bfun ($prederror t)) (unless ($listp llist) (merror (intl:gettext "sort: first argument must be a list; found: ~M") llist)) (setq llist (copy-list (cdr llist)) comparfun (mfunction1 (setq bfun (getopr f)))) (when (member bfun '(lessthan great) :test #'eq) (setq llist (mapcar #'ratdisrep llist))) (cons '(mlist) (sort llist comparfun)))) Despite the murk of the Maxima documentation (which probably predates the ANS) all the actual sorting is performed by the Common Lisp sort function. (Significant exception is that Maxima sort is non-destructive, which CL sort is allowed to be destuctive.) So if you want to know how sort behaves in these various edge cases with a conforming ANSI CL, the ANS is where you'd have to look. BTW, the ANS informally defines sort tability. The function cl:sort does not guarantee stability, which cl:stable-sort does. On some implemnentations, perhaps most. these functions are the same. (Yes, in a more-perfect world, Maxima documentation would be accurate, complete, and current. If so, then this world must fail to be at least one of the above. I hope this won't come as a shock to anyone.) So the current question could be resolved with one of these three choices: 1) Rewrite $sort to conform to the Maxima documentation, in a way that is portable to all ANSI-conformant implementations. 2) Rewrite the documentation to agree (other than the copy-list) with the ANSI definition. 3) Ignore this minor discrepency for the time being, because more important issues require atention in Maxima source and documentation. I guess (3) could be essentially a troll, but these choices offerred sincerely. Sorry about that. From toy.raymond at gmail.com Sat Nov 12 23:00:56 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 12 Nov 2011 21:00:56 -0800 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: <27484.1321156963@gemini.franz.com> References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <16992.1321132459@gemini.franz.com> <20111112211955.GZ20179@cs-wsok.swan.ac.uk> <27484.1321156963@gemini.franz.com> Message-ID: On Nov 12, 2011 8:03 PM, "Steve Haflich" wrote: > > So the current question could be resolved with one of these three choices: > > 1) Rewrite $sort to conform to the Maxima documentation, in a way that > is portable to all ANSI-conformant implementations. > > 2) Rewrite the documentation to agree (other than the copy-list) with > the ANSI definition. > > 3) Ignore this minor discrepency for the time being, because more > important issues require atention in Maxima source and documentation. > (4) Use cl:stable-sort. (Perhaps that's what (1) is saying.) > I guess (3) could be essentially a troll, but these choices offerred > sincerely. Sorry about that. That's always an option, troll or not. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From smh at franz.com Sat Nov 12 23:32:03 2011 From: smh at franz.com (Steve Haflich) Date: Sat, 12 Nov 2011 21:32:03 -0800 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <16992.1321132459@gemini.franz.com> <20111112211955.GZ20179@cs-wsok.swan.ac.uk> <27484.1321156963@gemini.franz.com> Message-ID: <29486.1321162323@gemini.franz.com> Raymond Toy wrote: (4) Use cl:stable-sort. (Perhaps that's what (1) is saying.) Certainly, but that addresses only one of the Kullmann's concerns. The guaranteed behavior with a sort function that provides only partial ordering is still effectively defined by the ANS, not the Maxima dos. This dependency of Maxima on ANSI CL might be seen as a deficiency in Maxima, but I propose that (where it can be) it is a useful partitioning of semantics. Maxima was first defined more than 40 years ago on a Lisp with irrational semantics. The Lisp community learned a lot between that time and the specification of ANSI CL (a little less than 20 years ago) and I propose that where ANSI CL semantics do not impinge on Maxima's focus on symbolic mathematics, ANSI CL semantics should be adopted. It simplifies the total universe. From O.Kullmann at swansea.ac.uk Sun Nov 13 03:13:53 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 13 Nov 2011 09:13:53 +0000 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: <27484.1321156963@gemini.franz.com> References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <16992.1321132459@gemini.franz.com> <20111112211955.GZ20179@cs-wsok.swan.ac.uk> <27484.1321156963@gemini.franz.com> Message-ID: <20111113091353.GE20179@cs-wsok.swan.ac.uk> On Sat, Nov 12, 2011 at 08:02:43PM -0800, Steve Haflich wrote: > Oliver Kullmann wrote: > > Obviously, I am referring to the MAXIMA documentation: > > (I'm in danger of acting like a troll, which is not my intention. > Apology in advance.) > I made not only the observation, that the Maxima documentation is unusable, but I also proposed how to fix it. And this in a way, which establishes what should always be the goal: not to refer to some implementation, but to a (relatively) well-defined semantics, independent of any implementation. The productive answer then would be to say what the intended semantics is, and to investigate the actual semantics, which results then in an improvement of the documentation at least, and perhaps even of the code. > This appears to be the definition of maxima sort: > > (defmfun $sort (l &optional (f 'lessthan)) > (let ((llist l) comparfun bfun ($prederror t)) > (unless ($listp llist) > (merror (intl:gettext "sort: first argument must be a list; found: ~M") llist)) > (setq llist (copy-list (cdr llist)) > comparfun > (mfunction1 (setq bfun (getopr f)))) > (when (member bfun '(lessthan great) :test #'eq) > (setq llist (mapcar #'ratdisrep llist))) > (cons '(mlist) (sort llist comparfun)))) > > Despite the murk of the Maxima documentation (which probably predates > the ANS) all the actual sorting is performed by the Common Lisp sort > function. Even if it just would call the Lisp sorting function, this would not guarantee anything: the question is then about the environment (the term system) and about the components involved. Both are not well-defined (they have only an operational meaning in the Maxima-world, subject to permanent adaptation on practical grounds), and thus the need to specify the *contract*. > (Significant exception is that Maxima sort is > non-destructive, which CL sort is allowed to be destuctive.) So if you > want to know how sort behaves in these various edge cases with a > conforming ANSI CL, the ANS is where you'd have to look. > > BTW, the ANS informally defines sort tability. The function cl:sort > does not guarantee stability, which cl:stable-sort does. On some > implemnentations, perhaps most. these functions are the same. > > (Yes, in a more-perfect world, Maxima documentation would be accurate, > complete, and current. If so, then this world must fail to be at least > one of the above. I hope this won't come as a shock to anyone.) > Sounds like the reaction of a current politician to me: when pointing out an error, reacting with cynism that the world is not perfect, and only a fool could expect otherwise. I always hoped (and still do so) that Maxima is part of mathematics, and that whatever happens, when speaking to a mathematician the least common denominator is always truth (and its simpler cousine, correctness). > So the current question could be resolved with one of these three choices: > > 1) Rewrite $sort to conform to the Maxima documentation, in a way that > is portable to all ANSI-conformant implementations. > > 2) Rewrite the documentation to agree (other than the copy-list) with > the ANSI definition. > This doesn't include the obvious thing to do, to *correct* the Maxima documentation (this is also the easiest thing to do). > 3) Ignore this minor discrepency for the time being, because more > important issues require atention in Maxima source and documentation. > > I guess (3) could be essentially a troll, but these choices offerred > sincerely. Sorry about that. I fear that (3) might be the preferred solution, given the unwillingness to engage with the semantics (I started with a semantical question, and proposed an answer, but yet the only reaction where the Lisp-mantra "read the code" and referral to some documents (which can't contain the answer)). Before writing my request, I wouldn't have imagined that "Ignore this" would have been considered. For a mathematician, correctness is the ultimate barrier, and pointing out an error, a minor in a lecture script, a major in a paper, must always cause the immediate desire to fix it. Learning from that experience, and thinking through my past experiences with Maxima, I developed now a little theory: there is a kind of psychotic split in Maxima (and thus in its community), into what is "mathematical" about Maxima, and what is "not" (the latter being some kind of dark subconsciouness). Things relating to the perceived mathematical side can be discussed in therms of truth and correctness, and this is widely done on the mailing list. Things relating to the non-mathematical side can and must not be considered in terms of truths, perhaps better are not discussed (mentioned) at all. One sees a degeneration into a hackish attitude ("read the code" or "read that document", without discussion of what's in the document --- where programming standards are notoriously vague), and a rather strong emotional "disavowal". In a sense "of course" one has to take also my position into accout, as a "computer scientist": from that point of view "of course" the underlying programming infrastructure must be thought of in terms of truth and correctness, is a mathematical construct in the same sense as numbers and polynomials are. This shows also in our Maxima code (just counted, out of interest: about 700 files with total 80000 lines), where in our context the sort-function is much more important than, say, the solve- or the defint-function. I guess now that the above interpretation won't change much. So well, then I assume that my interpretation (that of the strict weak order) is basically correct (at least for our practical purposes, where terms are always simple). Perhaps we write our own sorting-functions (at Maxima-level). Nevertheless, thanks for the time spent. Oliver From O.Kullmann at swansea.ac.uk Sun Nov 13 03:35:27 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 13 Nov 2011 09:35:27 +0000 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <16992.1321132459@gemini.franz.com> <20111112211955.GZ20179@cs-wsok.swan.ac.uk> <27484.1321156963@gemini.franz.com> Message-ID: <20111113093527.GF20179@cs-wsok.swan.ac.uk> > (4) Use cl:stable-sort. (Perhaps that's what (1) is saying.) > Reading 37.1 Lisp and Maxima Maxima is written in Lisp, and it is easy to access Lisp functions and variables from Maxima and vice versa. my closest guess is stably sort [1,3,2] is :lisp (stable-sort #$[1,3,2]$ #$orderlessp$); Maxima encountered a Lisp error: The value MLIST is not of type LIST. In 5.4.1 Introduction to Lists Lists are the basic building block for Maxima and Lisp. All data types other than arrays, hash tables, numbers are represented as Lisp lists, These Lisp lists have the form it says Internally this corresponds to a Lisp list of the form ((MLIST) 1 2 7 ((MPLUS) $X $Y )) however it is not said what "corresponds" means. Guessing from the above there are two types MLIST and LIST, where apparently "MLIST" stands for Maxima-list. So the "corresponds" would be "is", but then "a Lisp list", namely an MLIST, appears not to be Lisp list, namely a LIST? It seems the Maxima-documentation doesn't speak about the conversion? Best Oliver From O.Kullmann at swansea.ac.uk Sun Nov 13 04:16:38 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 13 Nov 2011 10:16:38 +0000 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: <29486.1321162323@gemini.franz.com> References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <16992.1321132459@gemini.franz.com> <20111112211955.GZ20179@cs-wsok.swan.ac.uk> <27484.1321156963@gemini.franz.com> <29486.1321162323@gemini.franz.com> Message-ID: <20111113101638.GG20179@cs-wsok.swan.ac.uk> On Sat, Nov 12, 2011 at 09:32:03PM -0800, Steve Haflich wrote: > Raymond Toy wrote: > > (4) Use cl:stable-sort. (Perhaps that's what (1) is saying.) > > Certainly, but that addresses only one of the Kullmann's concerns. The > guaranteed behavior with a sort function that provides only partial > ordering is still effectively defined by the ANS, not the Maxima dos. > > This dependency of Maxima on ANSI CL might be seen as a deficiency in > Maxima, but I propose that (where it can be) it is a useful partitioning > of semantics. Maxima was first defined more than 40 years ago on a Lisp > with irrational semantics. The Lisp community learned a lot between > that time and the specification of ANSI CL (a little less than 20 years > ago) and I propose that where ANSI CL semantics do not impinge on > Maxima's focus on symbolic mathematics, ANSI CL semantics should be > adopted. It simplifies the total universe. I can understand the attempt to re-use semantical constructs, but one should keep in mind: - The Maxima documentation must stay independent of that (amongst other things, otherwise it would become unreadable for almost all users). - Since Maxima creates its own universe, a reasonable effort should always be spent on taking that into account. - Since standard-texts are highly circular and ambiguous, the contract with the user of some component (typically a function) must be made explicit (not left to "read the code" or "read that document"). Documentation should be an ongoing effort, permanently improved, for example as the result of such a discussion. Perhaps there are institutional barriers in the Maxima evironment, preventing easy changes of documentation? I guess the main problem is that the documentation does not happen at the same place where the code is. Employing a system like Doxygen could improve this. Yet, as it seems to me, the documentation in Maxima is a separate world, perhaps mostly disregarded by the experts. Oliver From O.Kullmann at swansea.ac.uk Sun Nov 13 04:18:38 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 13 Nov 2011 10:18:38 +0000 Subject: [Maxima] Maxima-function logxor does not work under Sbcl In-Reply-To: <4EBF03ED.2090805@scieneer.com> References: <20111112222916.GA20179@cs-wsok.swan.ac.uk> <4EBF03ED.2090805@scieneer.com> Message-ID: <20111113101838.GH20179@cs-wsok.swan.ac.uk> On Sun, Nov 13, 2011 at 10:40:29AM +1100, Douglas Crosher wrote: > Hello Oliver, > > Numerical constants were being used that vary between CL implementations. Please try the following: > > logical&& logand(x,y):=?boole(?boole\-and,x,y)$ > logor(x,y):=?boole(?boole\-ior,x,y)$ > logxor(x,y):=?boole(?boole\-xor,x,y)$ > > Regards > Douglas Crosher > > Hello Douglas, thanks! I've used the above definitions to define our own versions of these functions. Best Oliver From luasjian at gmail.com Sun Nov 13 08:17:45 2011 From: luasjian at gmail.com (Luasjian) Date: Sun, 13 Nov 2011 15:17:45 +0100 Subject: [Maxima] Implicit multiplication Message-ID: Hey everybody, is it possible to do a multiplication without an asterik? I don't mean a function call but something like 2n understood as 2*n or a(b+c) as a*(b+c) Thanks in advance. Luajian -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Sun Nov 13 08:28:38 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sun, 13 Nov 2011 14:28:38 +0000 (UTC) Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <16992.1321132459@gemini.franz.com> <20111112211955.GZ20179@cs-wsok.swan.ac.uk> <27484.1321156963@gemini.franz.com> <20111112175128.GX20179@cs-wsok.swan.ac.uk> <16992.1321132459@gemini.franz.com> <20111112211955.GZ20179@cs-wsok.swan.ac.uk> <27484.1321156963@gemini.franz.com> <20111113091353.GE20179@cs-wsok.swan.ac.uk> Message-ID: Oliver Kullmann wrote: > > Sounds like the reaction of a current politician to me: when pointing > out an error, reacting with cynism that the world is not perfect, > and only a fool could expect otherwise. > Which is true > I always hoped (and still do so) that Maxima is part of mathematics, > and that whatever happens, when speaking to a mathematician the > least common denominator is always truth (and its simpler cousine, > correctness). I don't think computer science has much to do with mathematics. It may have to do with some branches of mathematics, like discrete maths or formal logic. But it is also close to physics, a domain where the "politician" maxim above is quite appropriate. > Things relating to the perceived mathematical side can be discussed in > therms of truth and correctness, and this is widely done on the mailing list. > Things relating to the non-mathematical side can and must not be considered > in terms of truths, perhaps better are not discussed (mentioned) at all. > One sees a degeneration into a hackish attitude ("read the code" or "read > that document", without discussion of what's in the document --- where > programming standards are notoriously vague), and a rather strong > emotional "disavowal". > > It happens that maxima is free software, a quality which is appreciated by a number of people. This means that: - we don't pay for it, and as a consequence we don't have a contractual relation with the authors, which would allow to ask for correction of bugs (note that most paying software has so called "licences" such that the authors deny all responsibility about the bugs in their work). - but conversely we are allowed to look at the source code, and perhaps fix it at least for us. This is the "hackish" attitude you are complaining above, but you have to contrast it with the situation for paying software, e.g. mathematica, where you don't have the slightest idea what is inside the box, and have to cope with the bugs without any hope of a fix. For the case of the documentation, it is even easier, anyone, even without any competence in programming can play with maxima and document what they are finding. Personnally i don't like the official documentation, i find it almost impossible to understand in the sections dealing with pattern matching and similar advanced stuff. However i am not going to complain about the work Robert Dodier has invested in these sections, because i am not able to do any better, and it is not tomorrow that i will know these things inside out like he does. The biggest problem is that it is hard to discover useful functions or variables. This is the first complaint i have heard from colleagues "it is impossible to find anything in the doc". The "Categories" stuff in the html documentation is a useful tool to help hypernavigate the doc, but the root problem is the general organization, which is difficult to get fine. All those problems seem to me far more important than the eventual correctness of the documentation of some obscure feature. -- Michel Talon From talon at lpthe.jussieu.fr Sun Nov 13 08:28:38 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sun, 13 Nov 2011 14:28:38 +0000 (UTC) Subject: [Maxima] Question regarding Sbcl References: <20111111210259.GM20179@cs-wsok.swan.ac.uk> <20111111210259.GM20179@cs-wsok.swan.ac.uk> <20111112235336.GB20179@cs-wsok.swan.ac.uk> Message-ID: Oliver Kullmann wrote: >> On my box (Intel E5300 2.6Ghz), testsuite real times (in seconds) >> and failed tests are >> >> sbcl-1.0.50 204 rtest16 (386, 387) >> gcl-2.6.8_pre 208 >> cmucl-20b_p001 211 >> clozurecl-1.7 293 rtest_gamma (673) >> ecl-11.1.1 404 rtest8 (126, 127) >> clisp-2.49 628 >> >> If the testsuite is representative, ecl is 2 times slower than sbcl. >> >> Andrey > > In our setting (with our mix of applications, typically list- and set-processing) > I get for the comparison of Ecl (11.1.1) and Sbcl (1.0.53): > > - Sbcl needs roughly 50% more time with loading files (especially for our > tests that's not so nice, since every test runs on its own and loads a > lot of files). > - Sbcl is around 30% faster (sometimes more, sometimes less, but seems to > be around that). > > So for our applications the advantage is not so great. > > Oliver Here is an extreme example, i think there must be an error somewhere but anyways, on this example (extracted from batch("grobner.demo") ) i see a huge speed advantage for sbcl (some years ago, cmucl was faster than sbcl on this example). The example is interesting since it is a pure big symbolic computation. I would expect clisp to take ages on this one. I have checked i don't have precompiled grobner.fasl or the like. Of course both are on the same machine: niobe% rlwrap bin/maxima Maxima 5.25.1 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. (%i1) load(grobner); Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $ (%o1) /home/michel/pub/maxima-5.25.1/share/maxima/5.25.1/share/contrib/Grobner\ /grobner.lisp (%i2) showtime:all; (%i3) ev(poly_grobner([- 1 + z^3 + y^4 + x^5 , - 1 + z^2 + y^3 + x^3 ], [x, y, z]), poly_coefficient_ring = 'ring_of_integers); Evaluation took 85.8400 seconds (85.8600 elapsed) using 1337.651 MB. 3 4 5 2 3 3 3 2 2 4 2 3 2 (%o3) [z + y + x - 1, z + y + x - 1, z - x z + y - x y + x - 1, .......... niobe% rlwrap bin/maxima -l sbcl Maxima 5.25.1 http://maxima.sourceforge.net using Lisp SBCL 1.0.43 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) load(grobner); Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $ (%o1) share/maxima/5.25.1/share/contrib/Grobner/grobner.lisp (%i2) showtime:all; Evaluation took 0.0000 seconds (0.0000 elapsed) using 0 bytes. (%o2) all (%i3) ev(poly_grobner([- 1 + z^3 + y^4 + x^5 , - 1 + z^2 + y^3 + x^3 ], [x, y, z]), poly_coefficient_ring = 'ring_of_integers); Evaluation took 1.1320 seconds (1.4790 elapsed) using 88.820 MB. 3 4 5 2 3 3 3 2 2 4 2 3 2 (%o3) [z + y + x - 1, z + y + x - 1, z - x z + y - x y + x - 1, ...... -- Michel Talon From fateman at eecs.berkeley.edu Sun Nov 13 08:59:14 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 13 Nov 2011 06:59:14 -0800 Subject: [Maxima] Implicit multiplication In-Reply-To: References: Message-ID: <4EBFDB42.7040702@eecs.berkeley.edu> On 11/13/2011 6:17 AM, Luasjian wrote: > Hey everybody, > > is it possible to do a multiplication without an asterik? > I don't mean a function call but something like 2n understood as 2*n > or a(b+c) as a*(b+c) > > Thanks in advance. > Luajian > This is probably a bad idea unless you have another syntax in mind for sin(x), which usually does not mean sin*x. Mathematica does this, requiring the user to type Sin[x]. Is that what you want? It is certainly possible to write another parser for Maxima. Or use the Mathematica parser written in Lisp that I've posted, or that someone else posted on sourceforge (Mockmma). RJF From luasjian at gmail.com Sun Nov 13 09:14:55 2011 From: luasjian at gmail.com (Luasjian) Date: Sun, 13 Nov 2011 16:14:55 +0100 Subject: [Maxima] Implicit multiplication In-Reply-To: <4EBFDB42.7040702@eecs.berkeley.edu> References: <4EBFDB42.7040702@eecs.berkeley.edu> Message-ID: Hm.. thanks for the hint. But in my case maxima get's it input from an formula editor which represents it's data in openmath and parses it to mathematical expressions. This parser produces output like n(n+1). So probalby the problem is exactly at this point. Or is there a alternative to get openmath into maxima (directly to the input or its syntax)? 2011/11/13 Richard Fateman > On 11/13/2011 6:17 AM, Luasjian wrote: > >> Hey everybody, >> >> is it possible to do a multiplication without an asterik? >> I don't mean a function call but something like 2n understood as 2*n >> or a(b+c) as a*(b+c) >> >> Thanks in advance. >> Luajian >> >> > This is probably a bad idea unless you have another syntax in mind for > sin(x), which usually does not mean sin*x. > > Mathematica does this, requiring the user to type Sin[x]. > > Is that what you want? > > It is certainly possible to write another parser for Maxima. Or use the > Mathematica parser written in Lisp that I've posted, or that someone else > posted on sourceforge (Mockmma). > > RJF > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Sun Nov 13 09:34:09 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Sun, 13 Nov 2011 07:34:09 -0800 Subject: [Maxima] Implicit multiplication In-Reply-To: References: <4EBFDB42.7040702@eecs.berkeley.edu> Message-ID: <4EBFE371.1000600@eecs.berkeley.edu> On 11/13/2011 7:14 AM, Luasjian wrote: > Hm.. > thanks for the hint. But in my case maxima get's it input from an > formula editor which represents it's data in openmath and parses it to > mathematical expressions. If some parser takes as input n*(n+1) and produces n(n+1), then you should not use that parser because somewhere along the way, it is wrong. > This parser produces output like n(n+1). So probalby the problem is > exactly at this point. Or is there a alternative to get openmath into > maxima (directly to the input or its syntax)? I suspect you are doing something WAY wrong. If you have a correct openmath parser, then it presumably generates some kind of huge openmath data for example, sin(x) becomes This is quite different from the data that would be generated by sin * (x). If you want to convert openmath to Maxima, you should NOT do it by converting openmath to an ambiguous text string. You could do it by converting to an unambiguous text string, or taking the openmath structure and generating Maxima's internal form. In this case it would be a lisp expression, ((%sin) $x). IN my opinion, that would be the right way. While I doubt that English is your first language, I hope you don't mind a correction... You seem to like apostrophes too much. The word " it's " is a contraction for "it is" and has nothing to do with possessives, ever. You should learn to use "its". Also "get's" is not a word. RJF > 2011/11/13 Richard Fateman > > > On 11/13/2011 6:17 AM, Luasjian wrote: > > Hey everybody, > > is it possible to do a multiplication without an asterik? > I don't mean a function call but something like 2n understood > as 2*n > or a(b+c) as a*(b+c) > > Thanks in advance. > Luajian > > > This is probably a bad idea unless you have another syntax in mind > for sin(x), which usually does not mean sin*x. > > Mathematica does this, requiring the user to type Sin[x]. > > Is that what you want? > > It is certainly possible to write another parser for Maxima. Or > use the Mathematica parser written in Lisp that I've posted, or > that someone else posted on sourceforge (Mockmma). > > RJF > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luasjian at gmail.com Sun Nov 13 10:00:39 2011 From: luasjian at gmail.com (Luasjian) Date: Sun, 13 Nov 2011 17:00:39 +0100 Subject: [Maxima] Implicit multiplication In-Reply-To: <4EBFE371.1000600@eecs.berkeley.edu> References: <4EBFDB42.7040702@eecs.berkeley.edu> <4EBFE371.1000600@eecs.berkeley.edu> Message-ID: Hm.. If some parser takes as input n*(n+1) and produces n(n+1), then you should > not use that parser because somewhere along the way, it is wrong. > you're right. But I have to :( It's more an WYSIWYG editor for math expressions. Often users are generating inputs like n(n+1) but meaning n*(n+1). I hoped maxima can help me solve this inadequacy of the input mechanism. But it seems there is no way on this layer. > I suspect you are doing something WAY wrong. If you have a correct > openmath parser, then it presumably generates some kind of huge openmath > data for example, sin(x) becomes > > > > > > > > > This is quite different from the data that would be generated by sin * (x). > > If the users types the "*" everything is fine. > > > If you want to convert openmath to Maxima, you should NOT do it by converting openmath > to an ambiguous text string. You could do it by converting to an unambiguous text string, > or taking the openmath structure and generating Maxima's internal form. In this case it would > be a lisp expression, ((%sin) $x). IN my opinion, that would be the right way. > > Understood. > > While I doubt that English is your first language, I hope you don't mind a correction... > You seem to like apostrophes too much. The word " it's " is a contraction for "it is" > and has nothing to do with possessives, ever. > > You should learn to use "its". Also "get's" is not a word. > > Thanks in advance. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sun Nov 13 12:54:37 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 13 Nov 2011 10:54:37 -0800 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <16992.1321132459@gemini.franz.com> <20111112211955.GZ20179@cs-wsok.swan.ac.uk> <27484.1321156963@gemini.franz.com> Message-ID: On 11/12/11, Raymond Toy wrote: > On Nov 12, 2011 8:03 PM, "Steve Haflich" wrote: >> 1) Rewrite $sort to conform to the Maxima documentation, in a way that >> is portable to all ANSI-conformant implementations. >> >> 2) Rewrite the documentation to agree (other than the copy-list) with >> the ANSI definition. Well, as it happens, I wrote the current version of the documentation for "sort", in an attempt to get the documentation to conform to the code. At this point I am inclined to adjust the documentation so that it describes a useful, comprehensible function, and then adjust the code so that it conforms to the documentation. I suspect that in both cases the changes are minor. >> 3) Ignore this minor discrepency for the time being, because more >> important issues require atention in Maxima source and documentation. Nah. Fixing up "sort" is really no big deal. Now that it has come to our attention, let's just go ahead and do it. > (4) Use cl:stable-sort. (Perhaps that's what (1) is saying.) As part of the revised "sort" description, I recommend very strongly to say that "sort" is a stable sort. Incidentally, I am very strongly opposed to having another version of "sort" which is not a stable sort. FWIW Robert Dodier From robert.dodier at gmail.com Sun Nov 13 13:03:14 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 13 Nov 2011 11:03:14 -0800 Subject: [Maxima] Committing the file sharefiles.mk In-Reply-To: <1321093662.2792.14.camel@dieter> References: <1321093662.2792.14.camel@dieter> Message-ID: On 11/12/11, Dieter Kaiser wrote: > In the last commits I have observed that the file sharefiles.mk has been > committed. I think this is not necessary, because this file will be > automatically generated and will be different for every developer. Yeah -- automatically-generated files cause trouble ... I think it's OK to have such files committed to Git (in case some system cannot regenerate them) but it seems like we can reduce the Git noise by committing foo.in (let's say) for any such file foo. I guess we would arrange for make to copy foo.in to foo, then attempt to regenerate it. I think this topic came up not too long ago, but I don't remember what was the resolution. best Robert Dodier From robert.dodier at gmail.com Sun Nov 13 13:09:29 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 13 Nov 2011 11:09:29 -0800 Subject: [Maxima] Implicit multiplication In-Reply-To: References: <4EBFDB42.7040702@eecs.berkeley.edu> Message-ID: On 11/13/11, Luasjian wrote: > thanks for the hint. But in my case maxima get's it input from an formula > editor which represents it's data in openmath and parses it to mathematical > expressions. > This parser produces output like n(n+1). So probalby the problem is exactly > at this point. Or is there a alternative to get openmath into maxima > (directly to the input or its syntax)? I don't completely understand what is going on here, but it sounds like you have: (user input) --> (openmath) --> (text string) --> (Maxima) If you have OpenMath which is XML if I recall correctly, just skip the conversion to a text string and proceed directly to Maxima. I think there is some code in maxima/share to convert OpenMath XML to Maxima expressions. (Or maybe it goes in the other direction ... I don't remember for sure.) In any event, if you have XML at hand, skip the text conversion and go directly to Maxima. best Robert Dodier From O.Kullmann at swansea.ac.uk Sun Nov 13 13:17:04 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 13 Nov 2011 19:17:04 +0000 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <16992.1321132459@gemini.franz.com> <20111112211955.GZ20179@cs-wsok.swan.ac.uk> <27484.1321156963@gemini.franz.com> Message-ID: <20111113191704.GJ20179@cs-wsok.swan.ac.uk> > > (4) Use cl:stable-sort. (Perhaps that's what (1) is saying.) > > As part of the revised "sort" description, I recommend very strongly > to say that "sort" is a stable sort. Incidentally, I am very strongly > opposed to having another version of "sort" which is not a stable sort. > This seems very sensible to me: - We actually assumed until now that sort would be stable, and use this at quite a few places. Now with Ecl, CLisp and Sbcl, all our tests pass, so that looks rather stable. - The only advantage of unstable sort is some time- and memory-savings. Now these savings are relatively small, and matter only for rather large data sets. So it seems in the spirit of Maxima to do the stable thing. - I guess if sort was used until now, then perhaps quite a few people assumed stability at least intuitively. And fixing it as stable doesn't seem to break anything (while allowing unstable sorts perhaps would). Oliver From luasjian at gmail.com Sun Nov 13 13:30:16 2011 From: luasjian at gmail.com (Luasjian) Date: Sun, 13 Nov 2011 20:30:16 +0100 Subject: [Maxima] Implicit multiplication In-Reply-To: References: <4EBFDB42.7040702@eecs.berkeley.edu> Message-ID: Hey, thanks for your answer. > (user input) --> (openmath) --> (text string) --> (Maxima) > correct > I think there is some code in maxima/share to convert OpenMath XML > to Maxima expressions. (Or maybe it goes in the other direction ... > I don't remember for sure.) > Hm.. maybe you can give me another hint for it?! Until now, I only found functionality to get MathML out (not in). > In any event, if you have XML at hand, skip the text conversion > and go directly to Maxima. > It would be so nice if this is already possible. -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Sun Nov 13 13:46:16 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 13 Nov 2011 11:46:16 -0800 Subject: [Maxima] Committing the file sharefiles.mk In-Reply-To: References: <1321093662.2792.14.camel@dieter> Message-ID: I think automake needs it. I think I tried sharefiles.mk.in but that didn't work. Ray On Nov 13, 2011 11:03 AM, "Robert Dodier" wrote: > On 11/12/11, Dieter Kaiser wrote: > > > In the last commits I have observed that the file sharefiles.mk has been > > committed. I think this is not necessary, because this file will be > > automatically generated and will be different for every developer. > > Yeah -- automatically-generated files cause trouble ... > I think it's OK to have such files committed to Git > (in case some system cannot regenerate them) > but it seems like we can reduce the Git noise by committing > foo.in (let's say) for any such file foo. I guess we would > arrange for make to copy foo.in to foo, then attempt to > regenerate it. I think this topic came up not too long ago, > but I don't remember what was the resolution. > > 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 talon at lpthe.jussieu.fr Mon Nov 14 08:04:03 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Mon, 14 Nov 2011 14:04:03 +0000 (UTC) Subject: [Maxima] Question regarding Sbcl References: <20111111210259.GM20179@cs-wsok.swan.ac.uk> <20111111210259.GM20179@cs-wsok.swan.ac.uk> <20111112235336.GB20179@cs-wsok.swan.ac.uk> <20111111210259.GM20179@cs-wsok.swan.ac.uk> <20111111210259.GM20179@cs-wsok.swan.ac.uk> <20111112235336.GB20179@cs-wsok.swan.ac.uk> Message-ID: Michel Talon wrote: > Oliver Kullmann wrote: > > Here is an extreme example, i think there must be an error somewhere but > anyways, on this example (extracted from batch("grobner.demo") ) i see > a huge speed advantage for sbcl (some years ago, cmucl was faster than > sbcl on this example). The example is interesting since it is a pure big > symbolic computation. I would expect clisp to take ages on this one. > I have checked i don't have precompiled grobner.fasl > or the like. Of course both are on the same machine: > As was to be speculated the explanation is that sbcl compiles grobner.lisp without being instructed to do it, so one needs to compare with cmucl with compiled grobner. Then sbcl is always faster but the difference is more reasonable. On the same apple machine, maxima-5.25.1 with latest cmucl and sbcl: cmucl: (%i8) compile_file("grobner.lisp"); (%o8) [grobner.lisp, /Users/michel/grobner.sse2f] (%i9) :lisp(load "grobner.sse2f") Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $ T (%i9) ev(poly_grobner([- 1 + z^3 + y^4 + x^5 , - 1 + z^2 + y^3 + x^3 ],[x, y, z]), poly_coefficient_ring = 'ring_of_integers);Evaluation took 1.1300 seconds (1.1400 elapsed) using 131.275 MB. ?. sbcl: (%i2) showtime:all; Evaluation took 0.0000 seconds (0.0000 elapsed) using 0 bytes. (%o2) all (%i3) ev(poly_grobner([- 1 + z^3 + y^4 + x^5 , - 1 + z^2 + y^3 + x^3 ],[x, y, z]), poly_coefficient_ring = 'ring_of_integers); Evaluation took 0.5360 seconds (0.5740 elapsed) using 89.044 MB. Note that, on this symbolic computation program, which produces huge output, sbcl is twice as fast as cmucl. So the timing differences may be much larger than what is asserted in this thread. The second -obvious- comment is that compiling makes a huge time difference (on this machine the uncompiled grobner runs for 28s), but also a huge memory difference (1337.651 MB against 131.275 MB). This may give an idea of the performance of clisp on such programs, since it is probably even worse than uncompiled cmucl. Oliver asserted that sbcl is slower to load a bunch of his files. Maybe this is because it compiles stuff on the fly, at it does here for grobner.lisp P.S. There is a bug in the documentation for Grobner. It begins by: A tutorial on Groebner Bases can be found at http://www.geocities.com/CapeCanaveral/Hall/3131/ But, of course the link is no more working. I have found another copy here: http://www.starbacks.ca/CapeCanaveral/Hall/3131/ and http://www.iisdavinci.it/ thanks to Google! I have done a copy in order to avoid further loss: http://www.lpthe.jussieu.fr/~talon/g_bases.html http://www.lpthe.jussieu.fr/~talon/orderings.html http://www.lpthe.jussieu.fr/~talon/buchberger.html http://www.lpthe.jussieu.fr/~talon/Ideals.html http://www.lpthe.jussieu.fr/~talon/GB_Properties.html http://www.lpthe.jussieu.fr/~talon/Division.html which seem to form a complete set, and to be rather easy reading. There is also an applet on iisdavinci http://www.iisdavinci.it/jeometry/groebner_applet.html -- Michel Talon From rswarbrick at gmail.com Mon Nov 14 08:27:09 2011 From: rswarbrick at gmail.com (Rupert Swarbrick) Date: Mon, 14 Nov 2011 14:27:09 +0000 Subject: [Maxima] Maxima-function logxor does not work under Sbcl References: <20111112222916.GA20179@cs-wsok.swan.ac.uk> <4EBF03ED.2090805@scieneer.com> <20111113101838.GH20179@cs-wsok.swan.ac.uk> Message-ID: Oliver Kullmann writes: > On Sun, Nov 13, 2011 at 10:40:29AM +1100, Douglas Crosher wrote: >> Hello Oliver, >> >> Numerical constants were being used that vary between CL >> implementations. Please try the following: >> >> logical&& logand(x,y):=?boole(?boole\-and,x,y)$ >> logor(x,y):=?boole(?boole\-ior,x,y)$ >> logxor(x,y):=?boole(?boole\-xor,x,y)$ >> >> Regards >> Douglas Crosher > > Hello Douglas, > > thanks! I've used the above definitions to define our own versions > of these functions. > > Best > > Oliver That's fine, but if you use Maxima from the current tree for testing, you'll see that the most recent commit is: commit 3d37105604192bd83eca92229bb75faeb014235e Author: Douglas Crosher Commit: Douglas Crosher o logand, logor, logxor: fix the lisp constant references. diff --git a/share/simplification/functs.mac b/share/simplification/functs.mac index 6090050..c9156b8 100644 --- a/share/simplification/functs.mac +++ b/share/simplification/functs.mac @@ -30,9 +30,9 @@ rational&& rational(z):=block([n,d,cd,ratfac], d:rat(n/ratdisrep(d*cd)), if ratp(z) then d else ratdisrep(d))$ -logical&& logand(x,y):=?boole(boole-and,x,y)$ - logor(x,y):=?boole(boole-ior,x,y)$ - logxor(x,y):=?boole(boole-xor,x,y)$ +logical&& logand(x,y):=?boole(?boole\-and,x,y)$ + logor(x,y):=?boole(?boole\-ior,x,y)$ + logxor(x,y):=?boole(?boole\-xor,x,y)$ nonzeroandfreeof&& nonzeroandfreeof(x,e):=is(e#0 and freeof(x,e))$ Douglas committed this patch about six minutes before he replied to you. Are you sure that it's worth your while hacking around bugs that are promptly fixed, rather than relying on the new code? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 315 bytes Desc: not available URL: From feboccaccio at gmail.com Mon Nov 14 10:36:57 2011 From: feboccaccio at gmail.com (Fernanda Farias) Date: Mon, 14 Nov 2011 14:36:57 -0200 Subject: [Maxima] solve Message-ID: Dear list members, I have been trying to use "solve" with 24 equations and expecting maxima to give me 18 unknown variables. But when I try to do this all at once it does not work, all I get is "[ ]". For the simplest case, I can give the code which equations (about 3 or 6) are necessary for obtaining one variable correctly, but this is enough since I am looking for the general case. I wrote the equations as following and I give the values for 8 points (giving the total of 24 equations), for example: One given point: eq1: I(deltax,0) = f(i+1,j)$ eq2: DxI(deltax,0) = dxf(i+1,j)$ eq3: DyI(deltax,0) = dyf(i+1,j)$ Equations: I(x,y):=f+dxf*x+dyf*y+(1/2)*(d2xf*x^2+2*dxyf*x*y+d2yf*y^2)+(1/6)*(d3xf*x^3+3*d2xyf*x^2*y+3*dx2yf*x*y^2+d3yf*y^3)+(1/24)*(d4xf*x^4+4*d3xyf*x^3*y+6*d2x2yf*x^2*y^2+4*dx3yf*x*y^3+d4yf*y^4)+(1/120)*(d5xf*x^5+5*d4xyf*x^4*y+10*d3x2yf*x^3*y^2+10*d2x3yf*x^2*y^3+5*dx4yf*x*y^4+d5yf*y^5)$ DxI(x,y):=dxf+d2xf*x+dxyf*y+(1/2)*(d3xf*x^2+2*d2xyf*x*y+dx2yf*y^2)+(1/6)*(d4xf*x^3+3*d3xyf*x^2*y+3*d2x2yf*x*y^2+dx3yf*y^3)+(1/24)*(d5xf*x^4+4*d4xyf*x^3*y+6*d3x2yf*x^2*y^2+4*d2x3yf*x*y^3+dx4yf*y^4)$ DyI(x,y):=dyf+dxyf*x+d2yf*y+(1/2)*(d2xyf*x^2+2*dx2yf*x*y+d3yf*y^2)+(1/6)*(d3xyf*x^3+3*d2x2yf*x^2*y+3*dx3yf*x*y^2+d4yf*y^3)+(1/24)*(d4xyf*x^4+4*d3x2yf*x^3*y+6*d2x3yf*x^2*y^2+4*dx4yf*x*y^3+d5yf*y^4)$ Any ideas? Regards. -- -------------- next part -------------- An HTML attachment was scrubbed... URL: From feboccaccio at gmail.com Mon Nov 14 10:59:23 2011 From: feboccaccio at gmail.com (Fernanda Farias) Date: Mon, 14 Nov 2011 14:59:23 -0200 Subject: [Maxima] Fwd: solve In-Reply-To: References: <4EC145CC.1050109@eecs.berkeley.edu> Message-ID: I must warn you that could not do it in a uglier way. I was in a hurry. linsolve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11,eq12,eq13,eq14,eq15,eq16,eq17,eq18,eq19,eq20,eq21,eq22,eq23,eq24],[dxyf,d2xf,d2yf,d3xf,d2xyf,dx2yf,d3yf,d4xf,d3xyf,d2x2yf,dx3yf,d4yf,d5xf,d4xyf,d3x2yf,d2x3yf,dx4yf,d5yf]); 2011/11/14 Richard Fateman > what command did you give solve? > > -- Msc Fernanda Farias DMM-PEMM/COPPE/UFRJ -- Msc Fernanda Farias DMM-PEMM/COPPE/UFRJ -------------- next part -------------- An HTML attachment was scrubbed... URL: From feboccaccio at gmail.com Mon Nov 14 11:04:50 2011 From: feboccaccio at gmail.com (Fernanda Farias) Date: Mon, 14 Nov 2011 15:04:50 -0200 Subject: [Maxima] solve In-Reply-To: <4EC14861.8050205@eecs.berkeley.edu> References: <4EC145CC.1050109@eecs.berkeley.edu> <4EC14861.8050205@eecs.berkeley.edu> Message-ID: Thank you Richard. I am sure the equations are linear an that they have a solution, I am just trying to reproduce what is in the paper: Kondoh Y. et al (1994). I don`t think that maxima has a problem with more equations than variables. Don't tell me. Post it. Are you sure the equations are linear in those variables? Are you sure the equations are consistent and have a solution? If there are 24 equations you should have 24 variables. ---------- Forwarded message ---------- From: Richard Fateman Date: 2011/11/14 Subject: Re: [Maxima] solve To: Fernanda Farias On 11/14/2011 8:53 AM, Fernanda Farias wrote: I must warn you that could not do it in a uglier way. I was in a hurry. linsolve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11,eq12,eq13,eq14,eq15,eq16,eq17,eq18,eq19,eq20,eq21,eq22,eq23,eq24],[dxyf,d2xf,d2yf,d3xf,d2xyf,dx2yf,d3yf,d4xf,d3xyf,d2x2yf,dx3yf,d4yf,d5xf,d4xyf,d3x2yf,d2x3yf,dx4yf,d5yf]); 2011/11/14 Richard Fateman > what command did you give solve? > > -- Msc Fernanda Farias DMM-PEMM/COPPE/UFRJ Don't tell me. Post it. Are you sure the equations are linear in those variables? Are you sure the equations are consistent and have a solution? If there are 24 equations you should have 24 variables. -- Msc Fernanda Farias DMM-PEMM/COPPE/UFRJ -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Nov 14 11:05:24 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 14 Nov 2011 12:05:24 -0500 Subject: [Maxima] solve In-Reply-To: References: Message-ID: Could you please include a self-contained, reproducible example (ideally minimal)? That might help us figure out the problem. It would also be useful to report the version of Maxima you are using -- use bug_report() to get that information. By self-contained and reproducible, I mean that it can be run as a batch file in a fresh Maxima and doesn't require the tester to guess at appropriate parameter values, etc. -s On Mon, Nov 14, 2011 at 11:36, Fernanda Farias wrote: > Dear list members, > > I have been trying to use "solve" with 24 equations and expecting maxima > to give me 18 unknown variables. But when I try to do this all at once it > does not work, all I get is "[ ]". For the simplest case, I can give the > code which equations (about 3 or 6) are necessary for obtaining one > variable correctly, but this is enough since I am looking for the general > case. > > I wrote the equations as following and I give the values for 8 points > (giving the total of 24 equations), for example: > > One given point: > eq1: I(deltax,0) = f(i+1,j)$ > eq2: DxI(deltax,0) = dxf(i+1,j)$ > eq3: DyI(deltax,0) = dyf(i+1,j)$ > > Equations: > > I(x,y):=f+dxf*x+dyf*y+(1/2)*(d2xf*x^2+2*dxyf*x*y+d2yf*y^2)+(1/6)*(d3xf*x^3+3*d2xyf*x^2*y+3*dx2yf*x*y^2+d3yf*y^3)+(1/24)*(d4xf*x^4+4*d3xyf*x^3*y+6*d2x2yf*x^2*y^2+4*dx3yf*x*y^3+d4yf*y^4)+(1/120)*(d5xf*x^5+5*d4xyf*x^4*y+10*d3x2yf*x^3*y^2+10*d2x3yf*x^2*y^3+5*dx4yf*x*y^4+d5yf*y^5)$ > > > DxI(x,y):=dxf+d2xf*x+dxyf*y+(1/2)*(d3xf*x^2+2*d2xyf*x*y+dx2yf*y^2)+(1/6)*(d4xf*x^3+3*d3xyf*x^2*y+3*d2x2yf*x*y^2+dx3yf*y^3)+(1/24)*(d5xf*x^4+4*d4xyf*x^3*y+6*d3x2yf*x^2*y^2+4*d2x3yf*x*y^3+dx4yf*y^4)$ > > > DyI(x,y):=dyf+dxyf*x+d2yf*y+(1/2)*(d2xyf*x^2+2*dx2yf*x*y+d3yf*y^2)+(1/6)*(d3xyf*x^3+3*d2x2yf*x^2*y+3*dx3yf*x*y^2+d4yf*y^3)+(1/24)*(d4xyf*x^4+4*d3x2yf*x^3*y+6*d2x3yf*x^2*y^2+4*dx4yf*x*y^3+d5yf*y^4)$ > > Any ideas? > > Regards. > -- > > > > > > _______________________________________________ > 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 feboccaccio at gmail.com Mon Nov 14 11:13:57 2011 From: feboccaccio at gmail.com (Fernanda Farias) Date: Mon, 14 Nov 2011 15:13:57 -0200 Subject: [Maxima] solve In-Reply-To: References: Message-ID: Maxima 5.20.1. The minimal version of it is: I(x,y):=f+dxf*x+dyf*y+(1/2)*(d2xf*x^2+2*dxyf*x*y+d2yf*y^2)+(1/6)*(d3xf*x^3+3*d2xyf*x^2*y+3*dx2yf*x*y^2+d3yf*y^3)+(1/24)*(d4xf*x^4+4*d3xyf*x^3*y+6*d2x2yf*x^2*y^2+4*dx3yf*x*y^3+d4yf*y^4)+(1/120)*(d5xf*x^5+5*d4xyf*x^4*y+10*d3x2yf*x^3*y^2+10*d2x3yf*x^2*y^3+5*dx4yf*x*y^4+d5yf*y^5)$ DxI(x,y):=dxf+d2xf*x+dxyf*y+(1/2)*(d3xf*x^2+2*d2xyf*x*y+dx2yf*y^2)+(1/6)*(d4xf*x^3+3*d3xyf*x^2*y+3*d2x2yf*x*y^2+dx3yf*y^3)+(1/24)*(d5xf*x^4+4*d4xyf*x^3*y+6*d3x2yf*x^2*y^2+4*d2x3yf*x*y^3+dx4yf*y^4)$ DyI(x,y):=dyf+dxyf*x+d2yf*y+(1/2)*(d2xyf*x^2+2*dx2yf*x*y+d3yf*y^2)+(1/6)*(d3xyf*x^3+3*d2x2yf*x^2*y+3*dx3yf*x*y^2+d4yf*y^3)+(1/24)*(d4xyf*x^4+4*d3x2yf*x^3*y+6*d2x3yf*x^2*y^2+4*dx4yf*x*y^3+d5yf*y^4)$ eq1: I(deltax,0) = f(i+1,j)$ eq2: DxI(deltax,0) = dxf(i+1,j)$ eq3: DyI(deltax,0) = dyf(i+1,j)$ eq4: I(0,deltay) = f(i,j+1)$ eq5: DxI(0,deltay) = dxf(i,j+1)$ eq6: DyI(0,deltay) = dyf(i,j+1)$ eq7: I(deltax,deltay) = f(i+1,j+1)$ eq8: DxI(deltax,deltay) = dxf(i+1,j+1)$ eq9: DyI(deltax,deltay) = dyf(i+1,j+1)$ eq10: I(-deltax,-deltay) = f(i-1,j-1)$ eq11: DxI(-deltax,-deltay) = dxf(i-1,j-1)$ eq12: DyI(-deltax,-deltay) = dyf(i-1,j-1)$ eq13: I(-deltax,0) = f(i-1,j)$ eq14: DxI(-deltax,0) = dxf(i-1,j)$ eq15: DyI(-deltax,0) = dyf(i-1,j)$ eq16: I(deltax,-deltay) = f(i+1,j-1)$ eq17: DxI(deltax,-deltay) = dxf(i+1,j-1)$ eq18: DyI(deltax,-deltay) = dyf(i+1,j-1)$ eq19: I(0,-deltay) = f(i,j-1)$ eq20: DxI(0,-deltay) = dxf(i,j-1)$ eq21: DyI(0,-deltay) = dyf(i,j-1)$ eq22: I(-deltax,deltay) = f(i-1,j+1)$ eq23: DxI(-deltax,deltay) = dxf(i-1,j+1)$ eq24: DyI(-deltax,deltay) = dyf(i-1,j+1)$ linsolve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11,eq12,eq13,eq14,eq15,eq16,eq17,eq18,eq19,eq20,eq21,eq22,eq23,eq24],[dxyf,d2xf,d2yf,d3xf,d2xyf,dx2yf,d3yf,d4xf,d3xyf,d2x2yf,dx3yf,d4yf,d5xf,d4xyf,d3x2yf,d2x3yf,dx4yf,d5yf]); 2011/11/14 Stavros Macrakis > Could you please include a self-contained, reproducible example (ideally > minimal)? That might help us figure out the problem. It would also be > useful to report the version of Maxima you are using -- use bug_report() to > get that information. > > By self-contained and reproducible, I mean that it can be run as a batch > file in a fresh Maxima and doesn't require the tester to guess at > appropriate parameter values, etc. > > -s > > On Mon, Nov 14, 2011 at 11:36, Fernanda Farias wrote: > >> Dear list members, >> >> I have been trying to use "solve" with 24 equations and expecting maxima >> to give me 18 unknown variables. But when I try to do this all at once it >> does not work, all I get is "[ ]". For the simplest case, I can give the >> code which equations (about 3 or 6) are necessary for obtaining one >> variable correctly, but this is enough since I am looking for the general >> case. >> >> I wrote the equations as following and I give the values for 8 points >> (giving the total of 24 equations), for example: >> >> One given point: >> eq1: I(deltax,0) = f(i+1,j)$ >> eq2: DxI(deltax,0) = dxf(i+1,j)$ >> eq3: DyI(deltax,0) = dyf(i+1,j)$ >> >> Equations: >> >> I(x,y):=f+dxf*x+dyf*y+(1/2)*(d2xf*x^2+2*dxyf*x*y+d2yf*y^2)+(1/6)*(d3xf*x^3+3*d2xyf*x^2*y+3*dx2yf*x*y^2+d3yf*y^3)+(1/24)*(d4xf*x^4+4*d3xyf*x^3*y+6*d2x2yf*x^2*y^2+4*dx3yf*x*y^3+d4yf*y^4)+(1/120)*(d5xf*x^5+5*d4xyf*x^4*y+10*d3x2yf*x^3*y^2+10*d2x3yf*x^2*y^3+5*dx4yf*x*y^4+d5yf*y^5)$ >> >> >> DxI(x,y):=dxf+d2xf*x+dxyf*y+(1/2)*(d3xf*x^2+2*d2xyf*x*y+dx2yf*y^2)+(1/6)*(d4xf*x^3+3*d3xyf*x^2*y+3*d2x2yf*x*y^2+dx3yf*y^3)+(1/24)*(d5xf*x^4+4*d4xyf*x^3*y+6*d3x2yf*x^2*y^2+4*d2x3yf*x*y^3+dx4yf*y^4)$ >> >> >> DyI(x,y):=dyf+dxyf*x+d2yf*y+(1/2)*(d2xyf*x^2+2*dx2yf*x*y+d3yf*y^2)+(1/6)*(d3xyf*x^3+3*d2x2yf*x^2*y+3*dx3yf*x*y^2+d4yf*y^3)+(1/24)*(d4xyf*x^4+4*d3x2yf*x^3*y+6*d2x3yf*x^2*y^2+4*dx4yf*x*y^3+d5yf*y^4)$ >> >> Any ideas? >> >> Regards. >> -- >> >> >> >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> > -- Msc Fernanda Farias DMM-PEMM/COPPE/UFRJ -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbowyer at olynet.com Mon Nov 14 13:39:53 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Mon, 14 Nov 2011 11:39:53 -0800 Subject: [Maxima] ECL Message-ID: <4EC16E89.9000306@olynet.com> Hello again, maxima users: I'm trying ECL as an experiment because I see that it has the ability to generate stand-alone executable programs by compiling to 'c' rather than saved lisp core images that other lisps use and I'm wondering if that might be something that can be done with the maxima installation somehow. I don't know very much about what might be involved so I'm asking in relative ignorance of what the possibilities are of using that mode of generating a stand-alone executable of the maxima program. I'm sure I need to know a lot more about what I'm asking before I can even ask an intelligent question on the subject, so this is just a 'dumb' question at the moment. Thanks for any insights you may have, Paul Bowyer From fateman at eecs.berkeley.edu Mon Nov 14 14:29:11 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Mon, 14 Nov 2011 12:29:11 -0800 Subject: [Maxima] ECL In-Reply-To: <4EC16E89.9000306@olynet.com> References: <4EC16E89.9000306@olynet.com> Message-ID: <4EC17A17.704@eecs.berkeley.edu> On 11/14/11 11:39 AM, Paul Bowyer wrote: > Hello again, maxima users: > > I'm trying ECL as an experiment because I see that it has the ability > to generate stand-alone executable programs by compiling to 'c' rather > than saved lisp core images that other lisps use and I'm wondering if > that might be something that can be done with the maxima installation > somehow. > > I don't know very much about what might be involved so I'm asking in > relative ignorance of what the possibilities are of using that mode of > generating a stand-alone executable of the maxima program. > > I'm sure I need to know a lot more about what I'm asking before I can > even ask an intelligent question on the subject, so this is just a > 'dumb' question at the moment. > > Thanks for any insights you may have, > > Paul Bowyer > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima pretty much a pointless exercise if you are to be faithful to what Maxima does. Since Maxima can execute commands like :lisp ... insert here anything that can be done by lisp.... your stand-alone executable would have to include all of lisp, anyway. RJF From pbowyer at olynet.com Mon Nov 14 14:43:14 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Mon, 14 Nov 2011 12:43:14 -0800 Subject: [Maxima] ECL In-Reply-To: <4EC17A17.704@eecs.berkeley.edu> References: <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> Message-ID: <4EC17D62.9020602@olynet.com> On 11/14/2011 12:29 PM, Richard Fateman wrote: > On 11/14/11 11:39 AM, Paul Bowyer wrote: >> Hello again, maxima users: >> >> I'm trying ECL as an experiment because I see that it has the ability >> to generate stand-alone executable programs by compiling to 'c' >> rather than saved lisp core images that other lisps use and I'm >> wondering if that might be something that can be done with the maxima >> installation somehow. >> >> I don't know very much about what might be involved so I'm asking in >> relative ignorance of what the possibilities are of using that mode >> of generating a stand-alone executable of the maxima program. >> >> I'm sure I need to know a lot more about what I'm asking before I can >> even ask an intelligent question on the subject, so this is just a >> 'dumb' question at the moment. >> >> Thanks for any insights you may have, >> >> Paul Bowyer >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima > pretty much a pointless exercise if you are to be faithful to what > Maxima does. > Since Maxima can execute commands like > > :lisp ... insert here anything that can be done by lisp.... > > your stand-alone executable would have to include all of lisp, anyway. > > RJF > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > RJF I hadn't thought of that aspect of maxima. I haven't used maxima to call lisp directly, so barring that usage, would compiling maxima down to a stand-alone executable be practical? Paul Bowyer From macrakis at alum.mit.edu Mon Nov 14 15:06:18 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 14 Nov 2011 16:06:18 -0500 Subject: [Maxima] ECL In-Reply-To: <4EC17D62.9020602@olynet.com> References: <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> <4EC17D62.9020602@olynet.com> Message-ID: What exactly is your goal, and why would a "stand-alone executable" be better for your needs than a saved core image? And what exactly do you think the difference is between a stand-alone executable for Maxima and a saved core image? After all, a full-function Maxima system needs most of the functionality of the underlying Lisp system, including things like garbage collection which require certain low-level runtime conventions to be respected. And Maxima needs 'eval' if you're going to allow the user to define functions in Maxima and translate them into Lisp. This is ignoring explicit escape mechanisms like :lisp and ?atoms. -s On Mon, Nov 14, 2011 at 15:43, Paul Bowyer wrote: > On 11/14/2011 12:29 PM, Richard Fateman wrote: > >> On 11/14/11 11:39 AM, Paul Bowyer wrote: >> >>> Hello again, maxima users: >>> >>> I'm trying ECL as an experiment because I see that it has the ability to >>> generate stand-alone executable programs by compiling to 'c' rather than >>> saved lisp core images that other lisps use and I'm wondering if that might >>> be something that can be done with the maxima installation somehow. >>> >>> I don't know very much about what might be involved so I'm asking in >>> relative ignorance of what the possibilities are of using that mode of >>> generating a stand-alone executable of the maxima program. >>> >>> I'm sure I need to know a lot more about what I'm asking before I can >>> even ask an intelligent question on the subject, so this is just a 'dumb' >>> question at the moment. >>> >>> Thanks for any insights you may have, >>> >>> Paul Bowyer >>> >>> ______________________________**_________________ >>> Maxima mailing list >>> Maxima at math.utexas.edu >>> http://www.math.utexas.edu/**mailman/listinfo/maxima >>> >> pretty much a pointless exercise if you are to be faithful to what Maxima >> does. >> Since Maxima can execute commands like >> >> :lisp ... insert here anything that can be done by lisp.... >> >> your stand-alone executable would have to include all of lisp, anyway. >> >> RJF >> >> ______________________________**_________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/**mailman/listinfo/maxima >> >> RJF > > I hadn't thought of that aspect of maxima. > > I haven't used maxima to call lisp directly, so barring that usage, would > compiling maxima down to a stand-alone executable be practical? > > > Paul Bowyer > > ______________________________**_________________ > 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 Mon Nov 14 15:07:23 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 14 Nov 2011 13:07:23 -0800 Subject: [Maxima] ECL In-Reply-To: <4EC17D62.9020602@olynet.com> References: <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> <4EC17D62.9020602@olynet.com> Message-ID: On Mon, Nov 14, 2011 at 12:43 PM, Paul Bowyer wrote: > > > I haven't used maxima to call lisp directly, so barring that usage, would > compiling maxima down to a stand-alone executable be practical? > Maxima running with gcl does this. But as Richard points out, it contains gcl (including compiler) and maxima all in one. Maxima with cmucl can also create a "standalone" executable. Not exactly sure what you're trying to achieve and why you don't want a maxima core file. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbowyer at olynet.com Mon Nov 14 15:40:41 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Mon, 14 Nov 2011 13:40:41 -0800 Subject: [Maxima] ECL In-Reply-To: References: <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> <4EC17D62.9020602@olynet.com> Message-ID: <4EC18AD9.3010102@olynet.com> On 11/14/2011 01:06 PM, Stavros Macrakis wrote: > What exactly is your goal, and why would a "stand-alone executable" be > better for your needs than a saved core image? > > And what exactly do you think the difference is between a stand-alone > executable for Maxima and a saved core image? After all, a > full-function Maxima system needs most of the functionality of the > underlying Lisp system, including things like garbage collection which > require certain low-level runtime conventions to be respected. And > Maxima needs 'eval' if you're going to allow the user to define > functions in Maxima and translate them into Lisp. This is ignoring > explicit escape mechanisms like :lisp and ?atoms. > > -s > > On Mon, Nov 14, 2011 at 15:43, Paul Bowyer > wrote: > > On 11/14/2011 12:29 PM, Richard Fateman wrote: > > On 11/14/11 11:39 AM, Paul Bowyer wrote: > > Hello again, maxima users: > > I'm trying ECL as an experiment because I see that it has > the ability to generate stand-alone executable programs by > compiling to 'c' rather than saved lisp core images that > other lisps use and I'm wondering if that might be > something that can be done with the maxima installation > somehow. > > I don't know very much about what might be involved so I'm > asking in relative ignorance of what the possibilities are > of using that mode of generating a stand-alone executable > of the maxima program. > > I'm sure I need to know a lot more about what I'm asking > before I can even ask an intelligent question on the > subject, so this is just a 'dumb' question at the moment. > > Thanks for any insights you may have, > > Paul Bowyer > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > pretty much a pointless exercise if you are to be faithful to > what Maxima does. > Since Maxima can execute commands like > > :lisp ... insert here anything that can be done by lisp.... > > your stand-alone executable would have to include all of lisp, > anyway. > > RJF > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > RJF > > I hadn't thought of that aspect of maxima. > > I haven't used maxima to call lisp directly, so barring that > usage, would compiling maxima down to a stand-alone executable be > practical? > > > Paul Bowyer > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > Stavros, Ray: I'm uncertain what my goals might be because I don't yet know enough about the subject. I was only asking what the possibilities were. I experiment with different things on my computer to see what I can do and this looked interesting because my experience with lisp core images (not much experience though) has been that they tend to be very large. I would be much happier with common lisp written applications if I could get past the very large core images required for executables. Ray wrote: Maxima running with gcl does this. But as Richard points out, it contains gcl (including compiler) and maxima all in one. Maxima with cmucl can also create a "standalone" executable. I was unaware that gcl already did this, but I think it makes sense because it was very fast on my computer when I used it. I sometimes attempt to write code that does some mathematics and rather than re-inventing the wheel I thought it would/could be interesting to use already written open-source software such as portions of maxima (providing I could understand which portions I needed and had the okey-doaky to do so) in something I might try writing. I'm just pondering the possibilities at the moment without any clear-cut directions to my mental meanderings. Paul Bowyer -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Nov 14 16:06:08 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 14 Nov 2011 17:06:08 -0500 Subject: [Maxima] ECL In-Reply-To: <4EC18AD9.3010102@olynet.com> References: <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> <4EC17D62.9020602@olynet.com> <4EC18AD9.3010102@olynet.com> Message-ID: "Would you tell me, please, which way I ought to go from here?" "That depends a good deal on where you want to get to," said the Cat. "I don?t much care where--" said Alice. "Then it doesn?t matter which way you go," said the Cat. On Mon, Nov 14, 2011 at 16:40, Paul Bowyer wrote: > On 11/14/2011 01:06 PM, Stavros Macrakis wrote: > > What exactly is your goal, and why would a "stand-alone executable" be > better for your needs than a saved core image? > > And what exactly do you think the difference is between a stand-alone > executable for Maxima and a saved core image? After all, a full-function > Maxima system needs most of the functionality of the underlying Lisp > system, including things like garbage collection which require certain > low-level runtime conventions to be respected. And Maxima needs 'eval' if > you're going to allow the user to define functions in Maxima and translate > them into Lisp. This is ignoring explicit escape mechanisms like :lisp and > ?atoms. > > -s > > On Mon, Nov 14, 2011 at 15:43, Paul Bowyer wrote: > >> On 11/14/2011 12:29 PM, Richard Fateman wrote: >> >>> On 11/14/11 11:39 AM, Paul Bowyer wrote: >>> >>>> Hello again, maxima users: >>>> >>>> I'm trying ECL as an experiment because I see that it has the ability >>>> to generate stand-alone executable programs by compiling to 'c' rather than >>>> saved lisp core images that other lisps use and I'm wondering if that might >>>> be something that can be done with the maxima installation somehow. >>>> >>>> I don't know very much about what might be involved so I'm asking in >>>> relative ignorance of what the possibilities are of using that mode of >>>> generating a stand-alone executable of the maxima program. >>>> >>>> I'm sure I need to know a lot more about what I'm asking before I can >>>> even ask an intelligent question on the subject, so this is just a 'dumb' >>>> question at the moment. >>>> >>>> Thanks for any insights you may have, >>>> >>>> Paul Bowyer >>>> >>>> _______________________________________________ >>>> Maxima mailing list >>>> Maxima at math.utexas.edu >>>> http://www.math.utexas.edu/mailman/listinfo/maxima >>>> >>> pretty much a pointless exercise if you are to be faithful to what >>> Maxima does. >>> Since Maxima can execute commands like >>> >>> :lisp ... insert here anything that can be done by lisp.... >>> >>> your stand-alone executable would have to include all of lisp, anyway. >>> >>> RJF >>> >>> _______________________________________________ >>> Maxima mailing list >>> Maxima at math.utexas.edu >>> http://www.math.utexas.edu/mailman/listinfo/maxima >>> >>> RJF >> >> I hadn't thought of that aspect of maxima. >> >> I haven't used maxima to call lisp directly, so barring that usage, would >> compiling maxima down to a stand-alone executable be practical? >> >> >> Paul Bowyer >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > > Stavros, Ray: > > I'm uncertain what my goals might be because I don't yet know enough about > the subject. I was only asking what the possibilities were. > > I experiment with different things on my computer to see what I can do and > this looked interesting because my experience with lisp core images (not > much experience though) has been that they tend to be very large. I would > be much happier with common lisp written applications if I could get past > the very large core images required for executables. > > > Ray wrote: > Maxima running with gcl does this. But as Richard points out, it contains > gcl (including compiler) and maxima all in one. Maxima with cmucl can also > create a "standalone" executable. > > I was unaware that gcl already did this, but I think it makes sense > because it was very fast on my computer when I used it. > > I sometimes attempt to write code that does some mathematics and rather > than re-inventing the wheel I thought it would/could be interesting to use > already written open-source software such as portions of maxima (providing > I could understand which portions I needed and had the okey-doaky to do so) > in something I might try writing. > > I'm just pondering the possibilities at the moment without any clear-cut > directions to my mental meanderings. > > Paul Bowyer > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Mon Nov 14 16:13:09 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 14 Nov 2011 14:13:09 -0800 Subject: [Maxima] ECL In-Reply-To: <4EC18AD9.3010102@olynet.com> References: <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> <4EC17D62.9020602@olynet.com> <4EC18AD9.3010102@olynet.com> Message-ID: On Mon, Nov 14, 2011 at 1:40 PM, Paul Bowyer wrote: > > Stavros, Ray: > > I'm uncertain what my goals might be because I don't yet know enough about > the subject. I was only asking what the possibilities were. > > I experiment with different things on my computer to see what I can do and > this looked interesting because my experience with lisp core images (not > much experience though) has been that they tend to be very large. I would > be much happier with common lisp written applications if I could get past > the very large core images required for executables. > I don't think the executables are really any smaller than the lisp images. And by modern standards, a lisp image isn't so large anymore. > > > Ray wrote: > Maxima running with gcl does this. But as Richard points out, it contains > gcl (including compiler) and maxima all in one. Maxima with cmucl can also > create a "standalone" executable. > > I was unaware that gcl already did this, but I think it makes sense > because it was very fast on my computer when I used it. > Your sense is wrong. The fact that gcl was an executable doesn't make it any faster. Sbcl and cmucl are as fast (roughly) as gcl (was) and they use images. > > I sometimes attempt to write code that does some mathematics and rather > than re-inventing the wheel I thought it would/could be interesting to use > already written open-source software such as portions of maxima (providing > I could understand which portions I needed and had the okey-doaky to do so) > in something I might try writing. > Maxima is gpl so you can do what you want with it as long as your stuff is gpl. But maxima is pretty tangled together so it would be hard to extract out a little part. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Mon Nov 14 16:56:38 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Mon, 14 Nov 2011 17:56:38 -0500 Subject: [Maxima] solve In-Reply-To: References: Message-ID: <2B5C0B4C121F4DF5BD32365C3FC6A62C@RichsLaptop> Hi, (%i35) length(listofvars([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11,eq12,eq13,eq14,eq15,eq16,eq17,eq18,eq19,eq20,eq21,eq22,eq23,eq24])); (%o35) 25 (%i36) length(listofvars([dxyf,d2xf,d2yf,d3xf,d2xyf,dx2yf,d3yf,d4xf,d3xyf,d2x2yf,dx3yf,d4yf,d5xf,d4xyf,d3x2yf,d2x3yf,dx4yf,d5yf])); (%o36) 18 This will not work. The number of equations has to match the length of the list of variables to solve. (%o36) would have to be equal to 24. You can try adding some of your other variables (which you have, there are 25 altogether as shown in (%o35)) that you did not include to the list to solve. Even if you don?t care what they work out to, you have to have the number of equations = number of variables passed to solve. Rich From: Fernanda Farias Sent: Monday, November 14, 2011 12:13 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] solve Maxima 5.20.1. The minimal version of it is: I(x,y):=f+dxf*x+dyf*y+(1/2)*(d2xf*x^2+2*dxyf*x*y+d2yf*y^2)+(1/6)*(d3xf*x^3+3*d2xyf*x^2*y+3*dx2yf*x*y^2+d3yf*y^3)+(1/24)*(d4xf*x^4+4*d3xyf*x^3*y+6*d2x2yf*x^2*y^2+4*dx3yf*x*y^3+d4yf*y^4)+(1/120)*(d5xf*x^5+5*d4xyf*x^4*y+10*d3x2yf*x^3*y^2+10*d2x3yf*x^2*y^3+5*dx4yf*x*y^4+d5yf*y^5)$ DxI(x,y):=dxf+d2xf*x+dxyf*y+(1/2)*(d3xf*x^2+2*d2xyf*x*y+dx2yf*y^2)+(1/6)*(d4xf*x^3+3*d3xyf*x^2*y+3*d2x2yf*x*y^2+dx3yf*y^3)+(1/24)*(d5xf*x^4+4*d4xyf*x^3*y+6*d3x2yf*x^2*y^2+4*d2x3yf*x*y^3+dx4yf*y^4)$ DyI(x,y):=dyf+dxyf*x+d2yf*y+(1/2)*(d2xyf*x^2+2*dx2yf*x*y+d3yf*y^2)+(1/6)*(d3xyf*x^3+3*d2x2yf*x^2*y+3*dx3yf*x*y^2+d4yf*y^3)+(1/24)*(d4xyf*x^4+4*d3x2yf*x^3*y+6*d2x3yf*x^2*y^2+4*dx4yf*x*y^3+d5yf*y^4)$ eq1: I(deltax,0) = f(i+1,j)$ eq2: DxI(deltax,0) = dxf(i+1,j)$ eq3: DyI(deltax,0) = dyf(i+1,j)$ eq4: I(0,deltay) = f(i,j+1)$ eq5: DxI(0,deltay) = dxf(i,j+1)$ eq6: DyI(0,deltay) = dyf(i,j+1)$ eq7: I(deltax,deltay) = f(i+1,j+1)$ eq8: DxI(deltax,deltay) = dxf(i+1,j+1)$ eq9: DyI(deltax,deltay) = dyf(i+1,j+1)$ eq10: I(-deltax,-deltay) = f(i-1,j-1)$ eq11: DxI(-deltax,-deltay) = dxf(i-1,j-1)$ eq12: DyI(-deltax,-deltay) = dyf(i-1,j-1)$ eq13: I(-deltax,0) = f(i-1,j)$ eq14: DxI(-deltax,0) = dxf(i-1,j)$ eq15: DyI(-deltax,0) = dyf(i-1,j)$ eq16: I(deltax,-deltay) = f(i+1,j-1)$ eq17: DxI(deltax,-deltay) = dxf(i+1,j-1)$ eq18: DyI(deltax,-deltay) = dyf(i+1,j-1)$ eq19: I(0,-deltay) = f(i,j-1)$ eq20: DxI(0,-deltay) = dxf(i,j-1)$ eq21: DyI(0,-deltay) = dyf(i,j-1)$ eq22: I(-deltax,deltay) = f(i-1,j+1)$ eq23: DxI(-deltax,deltay) = dxf(i-1,j+1)$ eq24: DyI(-deltax,deltay) = dyf(i-1,j+1)$ linsolve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10,eq11,eq12,eq13,eq14,eq15,eq16,eq17,eq18,eq19,eq20,eq21,eq22,eq23,eq24],[dxyf,d2xf,d2yf,d3xf,d2xyf,dx2yf,d3yf,d4xf,d3xyf,d2x2yf,dx3yf,d4yf,d5xf,d4xyf,d3x2yf,d2x3yf,dx4yf,d5yf]); 2011/11/14 Stavros Macrakis Could you please include a self-contained, reproducible example (ideally minimal)? That might help us figure out the problem. It would also be useful to report the version of Maxima you are using -- use bug_report() to get that information. By self-contained and reproducible, I mean that it can be run as a batch file in a fresh Maxima and doesn't require the tester to guess at appropriate parameter values, etc. -s On Mon, Nov 14, 2011 at 11:36, Fernanda Farias wrote: Dear list members, I have been trying to use "solve" with 24 equations and expecting maxima to give me 18 unknown variables. But when I try to do this all at once it does not work, all I get is "[ ]". For the simplest case, I can give the code which equations (about 3 or 6) are necessary for obtaining one variable correctly, but this is enough since I am looking for the general case. I wrote the equations as following and I give the values for 8 points (giving the total of 24 equations), for example: One given point: eq1: I(deltax,0) = f(i+1,j)$ eq2: DxI(deltax,0) = dxf(i+1,j)$ eq3: DyI(deltax,0) = dyf(i+1,j)$ Equations: I(x,y):=f+dxf*x+dyf*y+(1/2)*(d2xf*x^2+2*dxyf*x*y+d2yf*y^2)+(1/6)*(d3xf*x^3+3*d2xyf*x^2*y+3*dx2yf*x*y^2+d3yf*y^3)+(1/24)*(d4xf*x^4+4*d3xyf*x^3*y+6*d2x2yf*x^2*y^2+4*dx3yf*x*y^3+d4yf*y^4)+(1/120)*(d5xf*x^5+5*d4xyf*x^4*y+10*d3x2yf*x^3*y^2+10*d2x3yf*x^2*y^3+5*dx4yf*x*y^4+d5yf*y^5)$ DxI(x,y):=dxf+d2xf*x+dxyf*y+(1/2)*(d3xf*x^2+2*d2xyf*x*y+dx2yf*y^2)+(1/6)*(d4xf*x^3+3*d3xyf*x^2*y+3*d2x2yf*x*y^2+dx3yf*y^3)+(1/24)*(d5xf*x^4+4*d4xyf*x^3*y+6*d3x2yf*x^2*y^2+4*d2x3yf*x*y^3+dx4yf*y^4)$ DyI(x,y):=dyf+dxyf*x+d2yf*y+(1/2)*(d2xyf*x^2+2*dx2yf*x*y+d3yf*y^2)+(1/6)*(d3xyf*x^3+3*d2x2yf*x^2*y+3*dx3yf*x*y^2+d4yf*y^3)+(1/24)*(d4xyf*x^4+4*d3x2yf*x^3*y+6*d2x3yf*x^2*y^2+4*dx4yf*x*y^3+d5yf*y^4)$ Any ideas? Regards. -- _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima -- Msc Fernanda Farias DMM-PEMM/COPPE/UFRJ -------------------------------------------------------------------------------- _______________________________________________ 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 Mon Nov 14 17:04:42 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Mon, 14 Nov 2011 15:04:42 -0800 Subject: [Maxima] ECL In-Reply-To: References: <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> <4EC17D62.9020602@olynet.com> <4EC18AD9.3010102@olynet.com> Message-ID: <4EC19E8A.7070101@olynet.com> Stavros: Thanks for the input. I appreciate a good fable occasionally. If/when I know more about my question, I'll ask for more directions... Paul On 11/14/2011 02:06 PM, Stavros Macrakis wrote: > "Would you tell me, please, which way I ought to go from here?" > "That depends a good deal on where you want to get to," said the Cat. > "I don?t much care where--" said Alice. > "Then it doesn?t matter which way you go," said the Cat. > On Mon, Nov 14, 2011 at 16:40, Paul Bowyer > wrote: > > On 11/14/2011 01:06 PM, Stavros Macrakis wrote: >> What exactly is your goal, and why would a "stand-alone >> executable" be better for your needs than a saved core image? >> >> And what exactly do you think the difference is between a >> stand-alone executable for Maxima and a saved core image? After >> all, a full-function Maxima system needs most of the >> functionality of the underlying Lisp system, including things >> like garbage collection which require certain low-level runtime >> conventions to be respected. And Maxima needs 'eval' if you're >> going to allow the user to define functions in Maxima and >> translate them into Lisp. This is ignoring explicit escape >> mechanisms like :lisp and ?atoms. >> >> -s >> >> On Mon, Nov 14, 2011 at 15:43, Paul Bowyer > > wrote: >> >> On 11/14/2011 12:29 PM, Richard Fateman wrote: >> >> On 11/14/11 11:39 AM, Paul Bowyer wrote: >> >> Hello again, maxima users: >> >> I'm trying ECL as an experiment because I see that it >> has the ability to generate stand-alone executable >> programs by compiling to 'c' rather than saved lisp >> core images that other lisps use and I'm wondering if >> that might be something that can be done with the >> maxima installation somehow. >> >> I don't know very much about what might be involved >> so I'm asking in relative ignorance of what the >> possibilities are of using that mode of generating a >> stand-alone executable of the maxima program. >> >> I'm sure I need to know a lot more about what I'm >> asking before I can even ask an intelligent question >> on the subject, so this is just a 'dumb' question at >> the moment. >> >> Thanks for any insights you may have, >> >> Paul Bowyer >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> pretty much a pointless exercise if you are to be >> faithful to what Maxima does. >> Since Maxima can execute commands like >> >> :lisp ... insert here anything that can be done by >> lisp.... >> >> your stand-alone executable would have to include all of >> lisp, anyway. >> >> RJF >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> RJF >> >> I hadn't thought of that aspect of maxima. >> >> I haven't used maxima to call lisp directly, so barring that >> usage, would compiling maxima down to a stand-alone >> executable be practical? >> >> >> Paul Bowyer >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> > Stavros, Ray: > > I'm uncertain what my goals might be because I don't yet know > enough about the subject. I was only asking what the possibilities > were. > > I experiment with different things on my computer to see what I > can do and this looked interesting because my experience with lisp > core images (not much experience though) has been that they tend > to be very large. I would be much happier with common lisp written > applications if I could get past the very large core images > required for executables. > > > Ray wrote: > Maxima running with gcl does this. But as Richard points out, it > contains gcl (including compiler) and maxima all in one. Maxima > with cmucl can also create a "standalone" executable. > > I was unaware that gcl already did this, but I think it makes > sense because it was very fast on my computer when I used it. > > I sometimes attempt to write code that does some mathematics and > rather than re-inventing the wheel I thought it would/could be > interesting to use already written open-source software such as > portions of maxima (providing I could understand which portions I > needed and had the okey-doaky to do so) in something I might try > writing. > > I'm just pondering the possibilities at the moment without any > clear-cut directions to my mental meanderings. > > Paul Bowyer > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Nov 14 17:28:40 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 14 Nov 2011 18:28:40 -0500 Subject: [Maxima] solve In-Reply-To: <2B5C0B4C121F4DF5BD32365C3FC6A62C@RichsLaptop> References: <2B5C0B4C121F4DF5BD32365C3FC6A62C@RichsLaptop> Message-ID: On Mon, Nov 14, 2011 at 17:56, Richard Hennessy wrote: > This will not work. The number of equations has to match the length of > the list of variables to solve. > That is not quite true. There can be more variables than equations, in which case arbitrary numbers may be part of the solution: %i10) linsolve([a=b,b=c],[a,b,c]); (%o10) [a = %r4,b = %r4,c = %r4] There can be fewer variables than equations, in which case some of the equations must be redundant for there to be a solution: (%i13) linsolve([a=b,b=c,a=c],[a,b]); solve: dependent equations eliminated: (3) (%o13) [a = c,b = c] But the solutions must be true for *all* values of variables which are not being solved for -- you can call those variables "parameters". For example, the following has zero solutions (%i14) linsolve([a=b,b=c,x=3],[a,b]); (%o14) [] because there is no way x=3 can be made true for all x. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From rich.hennessy at verizon.net Mon Nov 14 17:37:54 2011 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Mon, 14 Nov 2011 18:37:54 -0500 Subject: [Maxima] solve In-Reply-To: References: <2B5C0B4C121F4DF5BD32365C3FC6A62C@RichsLaptop> Message-ID: <08E244D5FFF741C5A1A73659724E7D72@RichsLaptop> On Mon, Nov 14, 2011 at 17:56, Richard Hennessy wrote: This will not work. The number of equations has to match the length of the list of variables to solve. That is not quite true. There can be more variables than equations, in which case arbitrary numbers may be part of the solution: %i10) linsolve([a=b,b=c],[a,b,c]); (%o10) [a = %r4,b = %r4,c = %r4] There can be fewer variables than equations, in which case some of the equations must be redundant for there to be a solution: (%i13) linsolve([a=b,b=c,a=c],[a,b]); solve: dependent equations eliminated: (3) (%o13) [a = c,b = c] But the solutions must be true for *all* values of variables which are not being solved for -- you can call those variables "parameters". For example, the following has zero solutions (%i14) linsolve([a=b,b=c,x=3],[a,b]); (%o14) [] because there is no way x=3 can be made true for all x. Of course, there are some exceptions, but I was assuming the claim that the equations are independent is true. I have not checked that assumption. I have not checked for linearity either BTW. Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: From talon at lpthe.jussieu.fr Tue Nov 15 06:32:11 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 15 Nov 2011 12:32:11 +0000 (UTC) Subject: [Maxima] ECL References: <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> <4EC17D62.9020602@olynet.com> <4EC18AD9.3010102@olynet.com> <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> <4EC17D62.9020602@olynet.com> <4EC18AD9.3010102@olynet.com> Message-ID: Raymond Toy wrote: >> >> Stavros, Ray: >> >> I'm uncertain what my goals might be because I don't yet know enough about >> the subject. I was only asking what the possibilities were. >> >> I experiment with different things on my computer to see what I can do and >> this looked interesting because my experience with lisp core images (not >> much experience though) has been that they tend to be very large. I would >> be much happier with common lisp written applications if I could get past >> the very large core images required for executables. >> > > I don't think the executables are really any smaller than the lisp images. > And by modern standards, a lisp image isn't so large anymore. > > Maybe what is in his mind is the desire for a special purpose lisp which is just competent enough for running a CAS, but doesn't care about other functions. This could allow to have a smaller executable at the end, and perhaps faster, i don't know. I think this is the way reduce works, it is based on a smaller lisp, and moreover using traditional syntax i think, not the (((lispish))) one. Anyways, if he is looking for that, maxima is not the appropriate place. The maxima image is of the order of 40 Megs while maple for example takes something like 1 Meg in the command line version. niobe% ps ux USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND michel 49509 0,0 0,1 3548 1904 1 I+ 10:29 0:00,01 ./cmaple michel 49510 0,0 0,2 5732 3888 1 I+ 10:29 0:00,03 ./mserver -kpipe 4 The reduce binary here is only 9.6 Megs, but it links shared libraries, in particular X11 libraries, so that reduce starts here with a larger 24 Megs consumption USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND michel 21506 0,1 0,6 2610156 23848 s001 S+ 10:41 0:02.57 ./reduce Now maxima starts in fact with a lower memory consumption, since not all pages of maxima.core are mapped to memory, here only 9.2 Megs USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND michel 21800 0,0 0,2 2207164 9232 s001 S+ 1:26 0:00.03 sbcl --core /usr/local/lib/maxima/5.25 So at the end of the day, one may not care too much about the size of maxima.core. As soon as you do a big computations, the memory consumption explodes anyway, whatever program you are using. -- Michel Talon From luigi_marino2 at alice.it Mon Nov 14 05:06:13 2011 From: luigi_marino2 at alice.it (Luigi Marino) Date: Mon, 14 Nov 2011 12:06:13 +0100 Subject: [Maxima] Montecarlo method Message-ID: <7C1A35697D6C48D48E981896F4E9A1CB@luigi3b0e34c8e> Hi All It is possible in Maxima a Montecarlo method (e. g. block for approx Pi) ? Best wishes Luigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Nov 15 07:37:06 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 15 Nov 2011 08:37:06 -0500 Subject: [Maxima] Montecarlo method In-Reply-To: <7C1A35697D6C48D48E981896F4E9A1CB@luigi3b0e34c8e> References: <7C1A35697D6C48D48E981896F4E9A1CB@luigi3b0e34c8e> Message-ID: Maxima has a general-purpose programming language which would allow you to write a Monte Carlo simulation for estimating pi. You might want to read chapter 8 of the Maxima book at http://michel.gosse.free.fr/documentation/fichiers/maximabook.pdf for an introduction to programming in Maxima. -s On Mon, Nov 14, 2011 at 06:06, Luigi Marino wrote: > ** > Hi All > It is possible in Maxima > a Montecarlo method > (e. g. block for approx > Pi) ? > Best wishes > Luigi > > _______________________________________________ > 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 Nov 15 08:07:16 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 15 Nov 2011 09:07:16 -0500 Subject: [Maxima] ECL In-Reply-To: References: <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> <4EC17D62.9020602@olynet.com> <4EC18AD9.3010102@olynet.com> Message-ID: On Tue, Nov 15, 2011 at 07:32, Michel Talon wrote: > ...The maxima image is of the order of 40 Megs... > It is a mystery to me why Maxima takes so much memory (on Windows it's 16 MB, but that's still a lot). After all, Macsyma in 1982 (which is 90% of what Maxima is today) ran in something like 150kW (36-bit). One Cons cell took one word; assuming 8-byte Cons cells, and assuming proportional expansion of machine code (which seems excessive), that's the equivalent of 1.2 MB. Then again, MacLisp took something like 50kW and a GCL command line takes 5.6 MB -- don't know how much of that is extra Common Lisp functionality, how much is 'optional' components being preloaded (the compiler? documentation?), how much is less economical coding style (MacLisp was written in very tight assembler), and how much is simply larger default heap size. The good news is of course that by *current* standards, 16MB is tiny; the trivial game FreeCell takes 100MB (!). I can buy 8GB RAM for $50, and it is 1000x faster than the Macsyma group's 2MB RAM that cost $100,000+. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From hbaker1 at pipeline.com Tue Nov 15 08:25:35 2011 From: hbaker1 at pipeline.com (Henry Baker) Date: Tue, 15 Nov 2011 06:25:35 -0800 Subject: [Maxima] ECL In-Reply-To: References: <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> <4EC17D62.9020602@olynet.com> <4EC18AD9.3010102@olynet.com> Message-ID: The density of modern instruction code is much less than in 1982. Also, the cons cells have gotten a lot larger. Finally, the libraries for talking to the operating system have gotten a lot larger. We've almost reached the tipping point again, where an 'interpreter' would make sense. The 'interpreter' would run completely in a cache, where the hardware would essentially 'compile it on the fly' into less compact, but more easily executed instructions. Such an interpreter would run faster, because it would avoid much of the instruction fetch overhead. Also, better coding of cons cells would make better use of the data caches. The reason why this works is that fetching from non-cache is 1-2 orders of magnitude more expensive than fetching from a cache. You have plenty of time to decode even relatively complex encoding of cons cells. If you could somehow utilize modern 'GPU' (Graphics Processing Units) to aid in the execution of code -- e.g., in garbage collection, array processing, etc. -- you could speed things up by factors of 100x. Even laptops costing less than $1000 today have pretty powerful graphics capabilities, which now process 32-bit IEEE floats. At 06:07 AM 11/15/2011, Stavros Macrakis wrote: >On Tue, Nov 15, 2011 at 07:32, Michel Talon wrote: >...The maxima image is of the order of 40 Megs... > >It is a mystery to me why Maxima takes so much memory (on Windows it's 16 MB, but that's still a lot). After all, Macsyma in 1982 (which is 90% of what Maxima is today) ran in something like 150kW (36-bit). One Cons cell took one word; assuming 8-byte Cons cells, and assuming proportional expansion of machine code (which seems excessive), that's the equivalent of 1.2 MB. > >Then again, MacLisp took something like 50kW and a GCL command line takes 5.6 MB -- don't know how much of that is extra Common Lisp functionality, how much is 'optional' components being preloaded (the compiler? documentation?), how much is less economical coding style (MacLisp was written in very tight assembler), and how much is simply larger default heap size. > >The good news is of course that by *current* standards, 16MB is tiny; the trivial game FreeCell takes 100MB (!). I can buy 8GB RAM for $50, and it is 1000x faster than the Macsyma group's 2MB RAM that cost $100,000+. > > -s From toy.raymond at gmail.com Tue Nov 15 11:06:52 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 15 Nov 2011 09:06:52 -0800 Subject: [Maxima] bessel.lisp error codes and noisy quad_qagi In-Reply-To: References: Message-ID: On Sat, Nov 12, 2011 at 1:02 PM, Edwin Woollett wrote: > > I agree that a wider and deeper approach would be valuable. > > A possible approach to quiet mode error handling > with Maxima special functions is sketched out > below: > > We need: > > 1. a global list, spfun_errL, by default empty > > 2. a global flag, spfun_quiet_mode, by default false > [snip some details] > > When a Maxima special function (such as bessel-k) detects an error code > such as is returned from zbesk.lisp, and if spfun_quiet_mode > is true, then instead of printing an error message to > the console, bessel-k conses the sublist [id-num, > bessel-fun-order,bessel-fun-**arg,ierr] > into spfun_errL and returns something appropriate > (perhaps 0.0) to quad_qagi. > I don't think this would work out very well. I think this implies that everything everywhere needs to know how to deal with your new lists. If they don't, then zbesk would silently return 0.0 to the caller and everything would appear to be fine. That would be a great source of erroneous results being returned. I haven't given this a lot of thought, but I was thinking of just signaling an error. We could have a small set of numerical errors that routines could catch and do something with. For the routines that don't know how to deal with the error, the error would propagate to the top and you'd get a maxima error. In this way, the routines that care can do something appropriate, and the routines that don't care or don't yet know will never return an erroneous result because they don't handle the error. This also means there's no need to ever print an error message. The error message (and routine name, etc.) could be part of the error object itself. (This is from the Lisp side. I'm not sure how that would work from the maxima side. Maybe we can provide a way for maxima to deal with these error objects.) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Nov 15 11:25:35 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 15 Nov 2011 09:25:35 -0800 Subject: [Maxima] ECL In-Reply-To: References: <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> <4EC17D62.9020602@olynet.com> <4EC18AD9.3010102@olynet.com> Message-ID: On Tue, Nov 15, 2011 at 6:07 AM, Stavros Macrakis wrote: > On Tue, Nov 15, 2011 at 07:32, Michel Talon wrote: > >> ...The maxima image is of the order of 40 Megs... >> > > It is a mystery to me why Maxima takes so much memory (on Windows it's 16 > MB, but that's still a lot). After all, Macsyma in 1982 (which is 90% of > what Maxima is today) ran in something like 150kW (36-bit). One Cons cell > took one word; assuming 8-byte Cons cells, and assuming proportional > expansion of machine code (which seems excessive), that's the equivalent of > 1.2 MB. > > CMUCL (and presumably most other free 32-bit lisps) still use 8-byte cons cells. I think 64-bit lisps typically now use 16-byte cons cells. I think gcl used 12-byte cons cells (1 word for a cons cell tag, and 1 word each for the car and cdr.) > Then again, MacLisp took something like 50kW and a GCL command line takes > 5.6 MB -- don't know how much of that is extra Common Lisp functionality, > how much is 'optional' components being preloaded (the compiler? > documentation?), how much is less economical coding style (MacLisp was > written in very tight assembler), and how much is simply larger default > heap size. > The current CMUCL core is 29MB. Of that, about 5 MB goes into supporting unicode and the 16-bit strings for the docstrings. This also includes the compiler and CLOS. I think CLOS is some 6 MB. The compiler is some 13 MB. That leaves about 7 MB for the core runtime. To get the real size, I'd have to do a build without all of the features. Unfortunately, maxima now uses CLOS in some parts, and, at least for CMUCL, that requires that the compiler be available, so the size can't be reduced. Perhaps other lisps don't require the compiler to support CLOS. Also, Rob Maclachlan (leader of the CMUCL project) said he had implemented a tree shaker for CMUCL. At the time (decades ago), it only saved a couple of MB. > > The good news is of course that by *current* standards, 16MB is tiny; the > trivial game FreeCell takes 100MB (!). I can buy 8GB RAM for $50, and it > is 1000x faster than the Macsyma group's 2MB RAM that cost $100,000+. > > Yow! I knew RAM was expensive back then, but I didn't know how expensive! (Is that $100K in current dollars or 60's dollars?) This is why I no longer stress a 40-50MB lisp image that can do so much more than FreeCell can. :-) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Tue Nov 15 15:11:56 2011 From: woollett at charter.net (Edwin Woollett) Date: Tue, 15 Nov 2011 13:11:56 -0800 Subject: [Maxima] error in elliptic_e ? Message-ID: Perhaps I am not invoking elliptic_e correctly, but it appears that the definition given in the help manual does not agree with interactive use of elliptic_e. ------------------------------ Maxima 5.25.1 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) e (phi,mm) := nint (sqrt (1-mm*sin(x)^2),x,0,phi)$ (%i3) e(2,0.1); (%o3) 1.9392708750601 (%i4) float(elliptic_e(2,0.1)); (%o4) 1.122244398735427 ----------------------------------- Also, I tried Wolfram alpha, which gives N[EllipticE[2, 0.1]] -------> 1.939270875060100.. Ted Woollett From toy.raymond at gmail.com Tue Nov 15 15:59:34 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 15 Nov 2011 13:59:34 -0800 Subject: [Maxima] error in elliptic_e ? In-Reply-To: References: Message-ID: On Tue, Nov 15, 2011 at 1:11 PM, Edwin Woollett wrote: > Perhaps I am not invoking elliptic_e > correctly, but it appears that the definition > given in the help manual does not agree > with interactive use of elliptic_e. > Looks like a bug. Not sure what the problem is, though. Could you file a bug report on sourceforge? Thanks, Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Tue Nov 15 16:21:27 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 15 Nov 2011 17:21:27 -0500 Subject: [Maxima] ECL In-Reply-To: References: <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> <4EC17D62.9020602@olynet.com> <4EC18AD9.3010102@olynet.com> Message-ID: On Tue, Nov 15, 2011 at 12:25, Raymond Toy wrote: > The good news is of course that by *current* standards, 16MB is tiny; the >> trivial game FreeCell takes 100MB (!). I can buy 8GB RAM for $50, and it >> is 1000x faster than the Macsyma group's 2MB RAM that cost $100,000+. >> > > Yow! I knew RAM was expensive back then, but I didn't know how > expensive! (Is that $100K in current dollars or 60's dollars?) > Moore's Law, baby: 8GB/$50 = 160e6 B/$; 2MB/$100k = 20 B/$. 1-(160e6/20)^-(1/(2011-1974)) = 35%/year. For real (inflation-adjusted) dollars, multiply $100k by 4.6, giving 37.5%/year. Moore's Law is usually cited as "doubles in 18 months", which is -37%/year. The $100k+ for 512kW is my vague memory in nominal dollars of the cost of MIT-ML's enormous :-) core memory in 1974 (?). MIT-ML was the first dedicated Macsyma machine, bought by a consortium as a shared resource used across the ARPAnet. Fateman may remember the figures better. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Tue Nov 15 16:45:28 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 15 Nov 2011 14:45:28 -0800 Subject: [Maxima] error in elliptic_e ? In-Reply-To: References: Message-ID: On Tue, Nov 15, 2011 at 1:59 PM, Raymond Toy wrote: > > > On Tue, Nov 15, 2011 at 1:11 PM, Edwin Woollett wrote: > >> Perhaps I am not invoking elliptic_e >> correctly, but it appears that the definition >> given in the help manual does not agree >> with interactive use of elliptic_e. >> > > Looks like a bug. Not sure what the problem is, though. > It's because elliptic_e doesn't handle the quasi-periodicity of elliptic_e. I think elliptic_k has the same problem. I'll fix this soon. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Tue Nov 15 20:09:58 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 15 Nov 2011 18:09:58 -0800 Subject: [Maxima] ECL In-Reply-To: References: <4EC16E89.9000306@olynet.com> <4EC17A17.704@eecs.berkeley.edu> <4EC17D62.9020602@olynet.com> <4EC18AD9.3010102@olynet.com> Message-ID: <4EC31B76.3020101@eecs.berkeley.edu> On 11/15/11 2:21 PM, Stavros Macrakis wrote: > On Tue, Nov 15, 2011 at 12:25, Raymond Toy > wrote: > > The good news is of course that by *current* standards, 16MB > is tiny; the trivial game FreeCell takes 100MB (!). I can buy > 8GB RAM for $50, and it is 1000x faster than the Macsyma > group's 2MB RAM that cost $100,000+. > > > Yow! I knew RAM was expensive back then, but I didn't know how > expensive! (Is that $100K in current dollars or 60's dollars?) > > > Moore's Law, baby: 8GB/$50 = 160e6 B/$; 2MB/$100k = 20 B/$. > 1-(160e6/20)^-(1/(2011-1974)) = 35%/year. For real > (inflation-adjusted) dollars, multiply $100k by 4.6, giving > 37.5%/year. Moore's Law is usually cited as "doubles in 18 months", > which is -37%/year. > > The $100k+ for 512kW is my vague memory in nominal dollars of the cost > of MIT-ML's enormous :-) core memory in 1974 (?). MIT-ML was the > first dedicated Macsyma machine, bought by a consortium as a shared > resource used across the ARPAnet. Fateman may remember the figures > better. > > -s > I don't recall the mit-ml cost. That was probably magnetic core memory, like 1 micro-second access time. There's got to be gobs of historical info on the internet. Dunno about prices exactly. I think that in 1978 the first vax 11/780 at Berkeley (Ernie CoVax) cost about $250,000. Of that, perhaps $50k was for a very wide versatec dot printer that was intended for IC layouts. I suspect Ernie had about 512k bytes of memory. -------------- next part -------------- An HTML attachment was scrubbed... URL: From piminusmeson at bk.ru Wed Nov 16 01:27:14 2011 From: piminusmeson at bk.ru (Dmitry Shkirmanov) Date: Wed, 16 Nov 2011 11:27:14 +0400 Subject: [Maxima] diff() in itensor In-Reply-To: References: Message-ID: <4EC365D2.90307@bk.ru> Hello, list, i would like to use the diff() function within the itensor package, but it returns the unexpected answer. Let's consider the code: (%i1) load(itensor); (%o1) /usr/local/share/maxima/5.25.1/share/tensor/itensor.lisp (%i2) test: exp(R([i,j],[])*a([],[i])*b([],[j]))$ (%i3) ishow(test); i j a b R i j (%t3) %e a([], [i]) b([], [j]) R([i, j], []) (%o3) %e (%i4) res:contract(diff(test,a([],[m])))$ (%i5) ishow(rename(res)); i %1 a b R %1 i %1 (%t5) b %e R m %1 a([], [i]) b([], [%1]) R([i, %1], []) (%o5) b([], [%1]) %e R([m, %1], []) (%i6) ================================= The result of this calculation is a([], [i]) b([], [%1]) R([i,%1], []) (%o5) b([], [%1]) %e R([m,%1], []), but the correct answer is something like a([], [i]) b([], [%1]) R([i,%1], []) (%o5) b([], [%2]) %e R([m,%2], []). So, the diff() function does not rename dummy indices. Is there any way to rename dummy indices automatically? -------------- next part -------------- An HTML attachment was scrubbed... URL: From amandine at mycable.ch Tue Nov 15 14:13:13 2011 From: amandine at mycable.ch (GP) Date: Tue, 15 Nov 2011 20:13:13 +0000 (UTC) Subject: [Maxima] Operating Maxima out of another program by a TCP connection References: <200801101315.m0ADFiIt003377@post.webmailer.de> Message-ID: ssteiner.com> writes: > > Dear Maxima experts, > > I'd like to operate Maxima out of a self-programmed software by using a TCP connection. I use Windows > 2000/XP. According to the source code of wxMaxima, it should be possible to start maxima in something like > a "server mode" in which it allows connecting to it through a tcp connection. But I still haven't succeeded > in starting Maxima this way. What are the correct command line parameters for maxima.exe to make Maxima > accept tcp connections on port xy (e.g. 4010)? I already tried > maxima -eval "(maxima::start-server 4040)" -eval "(run)" -f > [=> error message: Error in SYSTEM::SET-UP-TOP-LEVEL [or a callee]: Could not connect] > and > maxima -s 4010 > [=> Maxima just quits, nothing happens] > but both command lines don't work. How to make Maxima become operatable using a TCP connection? > > Thanks a lot! > > Bye, > Sebastian > You need to modify the maxima.bat file in order to have it working : set prefix=C:\Program Files\Maxima-5.24.0 set maxima_prefix=C:\Program Files\Maxima-5.24.0 then modify the following : :dogcl from %maxima_imagesdir% to "%maxima_imagedir%" : quotes are missing and the batch file cannot be run "%maxima_imagesdir%"\binary-gcl\maxima.exe -eval..... From talon at lpthe.jussieu.fr Wed Nov 16 04:39:23 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 16 Nov 2011 10:39:23 +0000 (UTC) Subject: [Maxima] Operating Maxima out of another program by a TCP connection References: <200801101315.m0ADFiIt003377@post.webmailer.de> <200801101315.m0ADFiIt003377@post.webmailer.de> Message-ID: GP wrote: > ssteiner.com> writes: > >> >> Dear Maxima experts, >> >> I'd like to operate Maxima out of a self-programmed software by using a TCP > connection. I use Windows Last time i tried, the invocation that worked for me was described as such: " First you open a listening socket, for example with netcat nc -l 8888 Then you connect maxima to the socket in the following way: maxima -r ":lisp (setup-client 8888)" Here you execute the function setup-client defined in server.lisp which connects to port 8888. " I have just checked this works on my laptop. But using maxima -s or the like did not work. I cannot help you on the Windows side. -- Michel Talon From robert.dodier at gmail.com Wed Nov 16 10:25:31 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 16 Nov 2011 09:25:31 -0700 Subject: [Maxima] Implicit multiplication In-Reply-To: References: <4EBFDB42.7040702@eecs.berkeley.edu> Message-ID: On 11/13/11, Luasjian wrote: > Until now, I only found functionality to get MathML out (not in). > >> In any event, if you have XML at hand, skip the text conversion >> and go directly to Maxima. > > It would be so nice if this is already possible. Looks like share/contrib/maximaMathML has code to parse MathML input as well as create output. The parser appears to be in mathml-maxima.lisp. The comment at the end of maximaMathML.lisp says: ;;; enables mathml content code input to maxima ;;; use the command mathml(); followed by ... from stdin Let us know how it works out! best Robert Dodier From acimmarusti at gmail.com Wed Nov 16 11:20:43 2011 From: acimmarusti at gmail.com (Andres Cimmarusti) Date: Wed, 16 Nov 2011 12:20:43 -0500 Subject: [Maxima] compute eigenvalues numerically In-Reply-To: References: Message-ID: Dear all, First of all thank you for all your answers. I managed to solve the problem using allroots as you pointed out. However I don't have eigenvectors now. Here are a few responses on your comments > Of course, lapack has a version for complex matrixes, but no one has hooked > that up for maxima.? It's not difficult to do, but will take a little bit of > time.? I cannot do that until later next week at the earliest. That would really make my day and I think it would be useful for other users. I suppose I can use lapack directly without using maxima, but the reason for using maxima in the first place, is that before doing numerical solutions, there's a decent bit of algebra involved. >> As an additional thing, in an earlier stage of my work (which proved >> wrong), I was able to reduce the characteristic polynomial to a 4th >> order equation. Wikipedia says, analytical solutions are possible >> >> (http://en.wikipedia.org/wiki/Quartic_function#Summary_of_Ferrari.27s_method) >> through something known as the Ferrari's method. However, when I tried >> using 'solve' with this quartic polynomial, maxima just couldn't do >> it. After many minutes, maxima simply crashed...(it was disconnected >> from WxMaxima) > > solve should be able to produce the roots.? It could be a bug.? Can you send > the quartic that solve couldn't solve? > >> >> I have to say that the coefficients of the polynomial were quite >> lengthy, but I feel it should have worked...Naturally when I try a >> general quartic polynomial like listed in the wikipedia article, >> things work fine, though I get warned the expression is too long to >> display. What are the limitations here?...it really is just a lot of >> algebra... > > That's a display problem.? You can do display2d:false, or grind(). > But it will be very messy.? But if you're eventually going to want numerical > results, presumably all of the variables in your quartic will be replaced by > numbers.? It may be better to replace them with numbers in the quartic > before you try to solve the quartic. I believe you are right. It's a display problem. Both the terminal interface of maxima and WxMaxima failed to display the incredibly bulky expression. I don't really care about this anymore. Despite solving the problem with allroots, I had to resort to a rather convoluted process to plot these eigenvalues as function of a parameter. Let me try to explain: /*** Characteristic equation for finding the eigenvalues ***/ char_eq(k,gpar,gperp,t,d,C,x) := ''( expand( charpoly( perturb_mat(k,gpar,gperp,t,d,C,x) , z ) ) )$ auto_val(k,gpar,gperp,t,d,C,y) := allroots( char_eq( k , gpar , gperp , t , d , C , float( xtp(y,C,d,t) ) ) , z ); Thus, auto_val is an array of all eigenvalues (5, because perturb_mat is 5x5) as a function of the parameters in question. Now, my next step was to plot, say the first eigenvalue as a function of d keeping the other parameters fixed. So I tried the following: plot2d( realpart( rhs( auto_val( 3.0 , 6.0 , 3.0 , 0 , d , 3.0 , 30.0 )[1] ) ) , [d, -20.0 , 20.0] ); This immediately failed. The error message: allroots: expected a polynomial in one variable; found variables [ d , z ] Is there a way to circumvent this limitation? so that allroots gets the numerical value of d it expects? My rather messy workaround involved creating an array for the d values and then creating another one with the outputs from auto_val. Then putting these into text files and using gnuplot externally to plot the results. I also did this intentionally to have the numerical results stored somewhere without having to re-run my maxima code. Thanks Andres From robert.dodier at gmail.com Wed Nov 16 11:44:29 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 16 Nov 2011 10:44:29 -0700 Subject: [Maxima] compute eigenvalues numerically In-Reply-To: References: Message-ID: Probably you can circumvent the error by delay evaluation of allroots. Here are some ideas. I didn't try any of these. (1) defined a function FOO(d) := realpart(etc etc); then plot2d(FOO, [d, ...]) (i.e. not FOO(d) which evaluates FOO right away) (2) plot2d('(realpart(...)), [d, ...]) (quote plot2d's argument) (3) plot2d(lambda([d], realpart(...)), [d, ...]) Hope this helps, Robert Dodier From vttoth at vttoth.com Wed Nov 16 11:59:10 2011 From: vttoth at vttoth.com (Viktor T. Toth) Date: Wed, 16 Nov 2011 12:59:10 -0500 Subject: [Maxima] diff() in itensor In-Reply-To: <4EC365D2.90307@bk.ru> References: <4EC365D2.90307@bk.ru> Message-ID: <01a401cca489$8d6d7f20$a8487d60$@vttoth.com> Dmitry, Unfortunately, the itensor package cannot deal reliably with tensor expressions as function arguments. Most importantly, it does not know how to reconcile indices that appear in argument lists vs. indices that appear elsewhere. Take this simple example, for instance: (%i2) exp(a([i],[]))*x([],[i]); a([i], []) (%o2) x([], [i]) %e (%i3) rename(%); a([i], []) (%o3) x([], [i]) %e As you can see, itensor does not recognize that the indices in the exponent and the multiplication factor can be reconciled. So consider it either a limitation or a bug, but these are the kind of problems that unfortunately itensor is not well equipped to deal with at present. Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Dmitry Shkirmanov Sent: Wednesday, November 16, 2011 2:27 AM To: maxima at math.utexas.edu Subject: [Maxima] diff() in itensor Hello, list, i would like to use the diff() function within the itensor package, but it returns the unexpected answer. Let's consider the code: (%i1) load(itensor); (%o1) /usr/local/share/maxima/5.25.1/share/tensor/itensor.lisp (%i2) test: exp(R([i,j],[])*a([],[i])*b([],[j]))$ (%i3) ishow(test); i j a b R i j (%t3) %e a([], [i]) b([], [j]) R([i, j], []) (%o3) %e (%i4) res:contract(diff(test,a([],[m])))$ (%i5) ishow(rename(res)); i %1 a b R %1 i %1 (%t5) b %e R m %1 a([], [i]) b([], [%1]) R([i, %1], []) (%o5) b([], [%1]) %e R([m, %1], []) (%i6) ================================= The result of this calculation is a([], [i]) b([], [%1]) R([i, %1], []) (%o5) b([], [%1]) %e R([m, %1], []), but the correct answer is something like a([], [i]) b([], [%1]) R([i, %1], []) (%o5) b([], [%2]) %e R([m, %2], []). So, the diff() function does not rename dummy indices. Is there any way to rename dummy indices automatically? From drdieterkaiser at web.de Wed Nov 16 12:47:07 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 16 Nov 2011 19:47:07 +0100 Subject: [Maxima] Problem running symmgrp2009.max with recent versions of Maxima In-Reply-To: <5EA84392-1F18-4AFC-8105-28D4AF8551AF@glam.ac.uk> References: <3C6A1C9C-859B-4880-B0B2-2AC7B5964311@glam.ac.uk> <1320871867.1825.24.camel@dieter> <1320958058.2089.7.camel@dieter> <9DACA6C5-7EF7-41CC-96AC-AA288EB36323@glam.ac.uk> <1321101752.2792.27.camel@dieter> <56E5B2D3-84A3-41E0-9C8A-5C6949C295A8@glam.ac.uk> <5EA84392-1F18-4AFC-8105-28D4AF8551AF@glam.ac.uk> Message-ID: <1321469227.1750.5.camel@dieter> Am Dienstag, den 15.11.2011, 12:51 +0000 schrieb Wiltshire R J (AT): > I do hope the files I have sent you are helpful. Please let me know if they are not and I shall see if I can provide alternatives. > > Ron Wiltshire > > On 13 Nov 2011, at 15:05, wrote: I have extracted out of the informations the following test example. The files are renamed to fit the standard extensions of Maxima. load("symmgrp2009.mac")$ load("h_hd.mac")$ symmetry(1,0,0)$ printeqn(lode)$ The following shows a complete session in a Maxima console. I think it works correctly. There seems to be no problem. (%i1) load("symmgrp2009.mac")$ Code symmgrp2009.max of Janurary 1, 2010 is being loaded. Code symmgrp2009.max of January 1, 2010 was successfully loaded. (%i2) load("h_hd.mac")$ (%i3) symmetry(1,0,0)$ Code runs under the commercial software Macsyma as well as the public domain software Maxima (version 3.16.3 or higher). Please report problems to Willy Hereman, whereman at mines.edu. ----------------------------------------------------------------- Computation started. Execution may be slow for complicated cases! ----------------------------------------------------------------- /*********************************************************/ /* Welcome to the Macsyma program for the computation */ /* of Lie-point symmetries of differential equations */ /* Written by Benoit Champagne and Willy Hereman */ /* Code adjusted for the public domain software Maxima */ /* by Benoit Huard and Willy Hereman */ /* Project supervision: Pavel Winternitz */ /* Version 3.1 released on January 1, 2010 */ /* Program name: symmgrp2009.max */ /* Copyright 1991-2009 */ /*********************************************************/ ----------------------------------------------------------------- Computation started. Execution may be slow for complicated cases! ----------------------------------------------------------------- *** Number of determining equations before simplifications: 21 . *** Number determining eqs. in lode[1] before removing duplicates: 7 Number determining eqs. in lode[1] after removing duplicates: 6 Number determining eqs. in lode[2] before removing duplicates: 14 Number determining eqs. in lode[2] after removing duplicates: 13 List of factors that were canceled: [u[1]^2,u[1]^3,u[1]^6] Number of determining equations after simplifications: 8 Number of determining equations before removing duplicates: 8 Number of determining equations after removing duplicates: 8 Number of determining equations before resorting lode: 8 Number of determining equations after resorting lode: 8 *** Number of determining equations after all simplifications: 8 . *** *** These determining equations are stored in lode. *** (%i4) printeqn(lode)$ Equation 1 : 'diff(eta[2],u[1],1) = 0 Equation 2 : 'diff(eta[2],x[1],1) = 0 Equation 3 : 'diff(eta[1],u[1],1) = 0 Equation 4 : 'diff(phi[1],u[1],2) = 0 Equation 5 : 'diff(phi[1],u[1],1,x[1],1)-'diff(eta[1],x[1],2) = 0 Equation 6 : 'diff(phi[1],x[2],1)-u[1]^3*'diff(phi[1],x[1],3) = 0 Equation 7 : 3*u[1]^3*'diff(phi[1],u[1],1,x[1],2)+'diff(eta[1],x[2],1) -u[1]^3*'diff(eta[1],x[1],3) = 0 Equation 8 : u[1]*'diff(eta[2],x[2],1)-3*u[1]*'diff(eta[1],x[1],1)+3*phi[1] = 0 Dieter Kaiser From horatio at familiedeskranichs.info Wed Nov 16 14:49:30 2011 From: horatio at familiedeskranichs.info (horatio at familiedeskranichs.info) Date: Wed, 16 Nov 2011 13:49:30 -0700 Subject: [Maxima] manipulating output of a quadratic expression after factor to a general form Message-ID: <20111116134930.6e2f1f46dbf8ae1df63ea750893b8632.2e66798a90.wbe@email02.secureserver.net> An HTML attachment was scrubbed... URL: From woollett at charter.net Wed Nov 16 16:11:24 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 16 Nov 2011 14:11:24 -0800 Subject: [Maxima] Using integrate with sqrt Message-ID: Using integrate when the integrand is the square root of a complex expression leads to a numerical error: the real part is not correct. The real part should be about 2.65, as shown by quad_qags. ------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) display2d:false$ /*** wrong real part ****/ (%i2) float(rectform(integrate(sqrt(-1+%i*x),x,-2,3))); (%o2) 1.358288937752039*%i+1.318001741143204 /*** correct real part ****/ (%i3) er : realpart(sqrt(-1+%i*x)); (%o3) (x^2+1)^(1/4)*cos(atan2(x,-1)/2) (%i4) quad_qags(er,x,-2,3); (%o4) [2.651335074475815,3.3310687541643347E-10,399,0] (%i5) ei : imagpart(sqrt(-1+%i*x)); (%o5) (x^2+1)^(1/4)*sin(atan2(x,-1)/2) (%i6) quad_qags(ei,x,-2,3); (%o6) [1.358288937752036,2.1181538745196349E-9,483,0] ----------------------------------- Is there a way to use integrate for this kind of integrand which will allow the correct real part to be obtained? Ted Woollett (%o6) [1.358288937752036,2.1181538745196349E-9,483,0] From woollett at charter.net Wed Nov 16 16:54:47 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 16 Nov 2011 14:54:47 -0800 Subject: [Maxima] detect sqrt in expression? Message-ID: <0DDDAE9A11284DBA8DBCFA10473FC6BB@edwinc367e16bd> I need a way to detect the op sqrt in an expression. So far, neither ?isinop or listofops seems to work: --------------------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) display2d:false$ (%i2) ?isinop(a*bessel_j(0,x),bessel_j); (%o2) bessel_j(0,x) (%i3) ?isinop(a*sqrt(x),sqrt); (%o3) false (%i4) ?isinop(sqrt(x^2),sqrt); (%o4) false (%i5) load(nint); (%o5) "c:/work2/nint.mac" (%i6) listofops(a*sqrt(x^2+y^2)/b); (%o6) {"*","+","^"} (%i7) listofops(a*bessel_j(0,x)/c); (%o7) {"*","^",bessel_j} ------------------------------------- Ted Woollett From woollett at charter.net Wed Nov 16 17:00:40 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 16 Nov 2011 15:00:40 -0800 Subject: [Maxima] Using integrate with sqrt Message-ID: On Nov. 16, 2011, I wrote ------------------ >Is there a way to use integrate for this kind >of integrand which will allow the correct >real part to be obtained? ------------------ The above message was sent by mistake. The integral of a multiple valued function like sqrt(e) needs special care to stay on the same branch, and instead I am trying to avoid using integrate at all (in nint) when the integrand contains sqrt. Ted From drdieterkaiser at web.de Wed Nov 16 17:03:30 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 17 Nov 2011 00:03:30 +0100 Subject: [Maxima] Problem running symmgrp2009.max with recent versions of Maxima In-Reply-To: <3E6B021C-FE95-4BAA-BEA1-F1927F324CF1@glam.ac.uk> References: <3C6A1C9C-859B-4880-B0B2-2AC7B5964311@glam.ac.uk> <1320871867.1825.24.camel@dieter> <1320958058.2089.7.camel@dieter> <9DACA6C5-7EF7-41CC-96AC-AA288EB36323@glam.ac.uk> <1321101752.2792.27.camel@dieter> <56E5B2D3-84A3-41E0-9C8A-5C6949C295A8@glam.ac.uk> <5EA84392-1F18-4AFC-8105-28D4AF8551AF@glam.ac.uk> <1321469227.1750.5.camel@dieter> <3E6B021C-FE95-4BAA-BEA1-F1927F324CF1@glam.ac.uk> Message-ID: <1321484610.1750.19.camel@dieter> Am Mittwoch, den 16.11.2011, 22:43 +0000 schrieb Wiltshire R J (AT): > > Dieter Kaiser > > Your output (for the Harry Dym equation) is definitely correct and so > certainly exactly what is required and I am very pleased about this! > However for me I still cannot get the new depends function to work > (using a Maxima console, v5.25 on my mac). When I type > depends(f,[x[1],x[2]]) etc I get the same old error message (depends - > expects a symbol). Is the new depends available to me or is the case > the new implementation is so far only available to you as a program > developer?? Please advise. > > Thank you - Ron Wiltshire The change of the code will be part of the next release of Maxima that is Maxima 5.26. I think, this version will come in December 2011. I am working with Maxima 5.25post, which includes all changes since the last version 5.25.1. As an alternative you can copy the following Lisp function into a file and load the file with the Maxima command `load'. E. g. if you save the function in a file "depends.lisp", you can load the new function with load("depends.lisp"). You might get a warning about redefining the function, but that does not matter. This is the function you have to copy into a file: (defun i-$dependencies (l &aux res) (dolist (z l) (cond ((atom z) (merror (intl:gettext "depends: argument must be a non-atomic expression; found ~M") z)) (t (do ((zz z (cdr zz)) (y nil)) ((null zz) (mputprop (caar z) (setq y (reverse y)) 'depends) (setq res (push (cons (ncons (caar z)) y) res)) (unless (cdr $dependencies) (setq $dependencies (copy-list '((mlist simp))))) (add2lnc (cons (cons (caar z) nil) y) $dependencies)) (cond ((and ($subvarp (cadr zz)) (not (member (caar (cadr zz)) y))) (setq y (push (cadr zz) y))) ((not (symbolp (cadr zz))) (merror (intl:gettext "depends: argument must be a symbol; found ~M") (cadr zz))) ((and (cadr zz) (not (member (cadr zz) y))) (setq y (push (cadr zz) y)))))))) (cons '(mlist simp) (reverse res))) Dieter Kaiser From toy.raymond at gmail.com Wed Nov 16 17:16:01 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 16 Nov 2011 15:16:01 -0800 Subject: [Maxima] detect sqrt in expression? In-Reply-To: <0DDDAE9A11284DBA8DBCFA10473FC6BB@edwinc367e16bd> References: <0DDDAE9A11284DBA8DBCFA10473FC6BB@edwinc367e16bd> Message-ID: On Wed, Nov 16, 2011 at 2:54 PM, Edwin Woollett wrote: > I need a way to detect the op sqrt in an expression. > > So far, neither ?isinop or listofops seems to work: > ------------------------------**--------------- > Maxima 5.25.1 http://maxima.sourceforge.net > using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) > > (%i1) display2d:false$ > > (%i2) ?isinop(a*bessel_j(0,x),**bessel_j); > > (%o2) bessel_j(0,x) > > (%i3) ?isinop(a*sqrt(x),sqrt); > > (%o3) false > If you want to know what's happening, try the following: (%i2) sqrt(x); (%o2) sqrt(x) (%i3) :lisp $%o2 ((MEXPT SIMP) $X ((RAT SIMP) 1 2)) Thus, sqrt is converted internally to, essentially, x^(1/2). (%i3) ?isinop(a*sqrt(x),?mexpt); (%o3) sqrt(x) This doesn't check that the exponent is 1/2, though. > > (%i4) ?isinop(sqrt(x^2),sqrt); > > (%o4) false > This fails because sqrt(x^2) has already been simplified to abs(x) by the time isinop sees it. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From drdieterkaiser at web.de Wed Nov 16 17:25:45 2011 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 17 Nov 2011 00:25:45 +0100 Subject: [Maxima] detect sqrt in expression? In-Reply-To: <0DDDAE9A11284DBA8DBCFA10473FC6BB@edwinc367e16bd> References: <0DDDAE9A11284DBA8DBCFA10473FC6BB@edwinc367e16bd> Message-ID: <1321485945.1750.35.camel@dieter> Am Mittwoch, den 16.11.2011, 14:54 -0800 schrieb Edwin Woollett: > I need a way to detect the op sqrt in an expression. > > So far, neither ?isinop or listofops seems to work: > --------------------------------------------- > Maxima 5.25.1 http://maxima.sourceforge.net > using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) > > (%i1) display2d:false$ > > (%i2) ?isinop(a*bessel_j(0,x),bessel_j); > > (%o2) bessel_j(0,x) > > (%i3) ?isinop(a*sqrt(x),sqrt); > > (%o3) false > > (%i4) ?isinop(sqrt(x^2),sqrt); > > (%o4) false > > (%i5) load(nint); > > (%o5) "c:/work2/nint.mac" > > (%i6) listofops(a*sqrt(x^2+y^2)/b); > > (%o6) {"*","+","^"} > > (%i7) listofops(a*bessel_j(0,x)/c); > > (%o7) {"*","^",bessel_j} > ------------------------------------- Maxima does not know an internal SQRT operator. SQRT is only displayed and can be part of an input, but internally in Maxima the SQRT function is represented as the power function x^(1/2) and the internal form is ((mexpt) x ((rat) 1 2). There is some documentation about the internal and external representation of Maxima expressions in the manual. The Lisp function isinop gives the result the following way: (%i1) ?isinop(a*x^(1/2), ?getopr("^")); (%o1) sqrt(x) But any other power function will be a result too: (%i2) ?isinop(a*x^(1/3), ?getopr("^")); (%o2) x^(1/3) In addition it is necessary to transform the name "^" of the operator to the internal symbol MEXPT. This has been done with the Lisp function getopr: (%i3) ?getopr("^"); (%o3) ?mexpt An alternativ is the Maxima function dispform, see the Maxima manual. This functions transforms an expression into the external representation which contains the SQRT function: (%i4) ?isinop(dispform(a*sqrt(x)), sqrt); (%o4) sqrt(x) (%i5) ?isinop(dispform(a*x^(1/2)), sqrt); (%o5) sqrt(x) With the function dispform a power function with an exponent different from 1/2 gives the result false: (%i6) ?isinop(dispform(a*x^(1/3)), sqrt); (%o6) false I see you are using the Lisp function isinop. Perhaps it is desirable to have an equivalent Maxima function which can do even some more work like the transformation of the names of operators into the internal format. Dieter Kaiser From macrakis at alum.mit.edu Wed Nov 16 17:35:18 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 16 Nov 2011 18:35:18 -0500 Subject: [Maxima] detect sqrt in expression? In-Reply-To: References: <0DDDAE9A11284DBA8DBCFA10473FC6BB@edwinc367e16bd> Message-ID: As Ray says, "sqrt" is just the external form; internally, it is x^(1/2). To "detect the op sqrt" in an expression, you'll need to specify more clearly what you mean by "the op sqrt". Do you mean all cases where Maxima uses sqrt as part of the external form? For example, Maxima displays x^(-1/2) as 1/sqrt(x) -- does that "contain the operator sqrt" for your purposes? On the other hand, it displays sqrt(x)^a as x^(a/2) -- does that contain the operator sqrt for your purposes? How about sqrt(sqrt(x)) == x^(1/4) or sqrt(x^(1/3)) == x^(1/6)? For your purposes, do you want to count one sqrt or two in sqrt(x*y) == sqrt(x)*sqrt(y) (with assume(x>0,y>0))? The simplest answer to your question is something like this: has_sqrt(ex):= if mapatom(ex) then false else if op(ex)='sqrt then true else any_of(maplist(has_sqrt,ex))$ any_of(list) := member(true,list)$ It turns out this is horrifically inefficient (because of the way op works for inflag:false), but that may not matter. If it does matter, then something like this: has_sqrt(ex):= block([inflag:true], if mapatom(ex) then false else if op(ex)="^" then is(part(ex,2)=1/2) else any_of(maplist(has_sqrt,ex))$ any_of(list) := member(true,list))$ Of course the exact logic of is(part(ex,2)=1/2) will need to be adjusted based on your definition. -s On Wed, Nov 16, 2011 at 18:16, Raymond Toy wrote: > > > On Wed, Nov 16, 2011 at 2:54 PM, Edwin Woollett wrote: > >> I need a way to detect the op sqrt in an expression. >> >> So far, neither ?isinop or listofops seems to work: >> ------------------------------**--------------- >> Maxima 5.25.1 http://maxima.sourceforge.net >> using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) >> >> (%i1) display2d:false$ >> >> (%i2) ?isinop(a*bessel_j(0,x),**bessel_j); >> >> (%o2) bessel_j(0,x) >> >> (%i3) ?isinop(a*sqrt(x),sqrt); >> >> (%o3) false >> > > If you want to know what's happening, try the following: > > (%i2) sqrt(x); > > (%o2) sqrt(x) > (%i3) :lisp $%o2 > > ((MEXPT SIMP) $X ((RAT SIMP) 1 2)) > > Thus, sqrt is converted internally to, essentially, x^(1/2). > > (%i3) ?isinop(a*sqrt(x),?mexpt); > > (%o3) sqrt(x) > > This doesn't check that the exponent is 1/2, though. > >> >> (%i4) ?isinop(sqrt(x^2),sqrt); >> >> (%o4) false >> > This fails because sqrt(x^2) has already been simplified to abs(x) by the > time isinop sees it. > > 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 Wed Nov 16 17:36:45 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 16 Nov 2011 18:36:45 -0500 Subject: [Maxima] detect sqrt in expression? In-Reply-To: <0DDDAE9A11284DBA8DBCFA10473FC6BB@edwinc367e16bd> References: <0DDDAE9A11284DBA8DBCFA10473FC6BB@edwinc367e16bd> Message-ID: Why are you using the internal function ?isinop -- it is in general a bad idea to use internal Maxima functions unless you are familiar with the Lisp code yourself. As for listofops, it depends how exactly you ended up defining that.... -s On Wed, Nov 16, 2011 at 17:54, Edwin Woollett wrote: > I need a way to detect the op sqrt in an expression. > > So far, neither ?isinop or listofops seems to work: > ------------------------------**--------------- > Maxima 5.25.1 http://maxima.sourceforge.net > using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) > > (%i1) display2d:false$ > > (%i2) ?isinop(a*bessel_j(0,x),**bessel_j); > > (%o2) bessel_j(0,x) > > (%i3) ?isinop(a*sqrt(x),sqrt); > > (%o3) false > > (%i4) ?isinop(sqrt(x^2),sqrt); > > (%o4) false > > (%i5) load(nint); > > (%o5) "c:/work2/nint.mac" > > (%i6) listofops(a*sqrt(x^2+y^2)/b); > > (%o6) {"*","+","^"} > > (%i7) listofops(a*bessel_j(0,x)/c); > > (%o7) {"*","^",bessel_j} > ------------------------------**------- > > 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 Wed Nov 16 18:03:29 2011 From: woollett at charter.net (Edwin Woollett) Date: Wed, 16 Nov 2011 16:03:29 -0800 Subject: [Maxima] detect sqrt in expression? Message-ID: <48CEA6BCFA47478684A41578EB897A5B@edwinc367e16bd> On Nov. 16, 2011, Stavros Macrakis wrote: --------------- >Why are you using the internal function ?isinop -- it is in general a bad >idea to use internal Maxima functions unless you are familiar with the Lisp >code yourself. > >As for listofops, it depends how exactly you ended up defining that.... ------------------------- Dieter suggested the use of ?isinop earlier in another context. The current def of listofops is your code: listofops(expr) := block([inflag:true], if mapatom(expr) then {} else adjoin(op(expr),xreduce(union,maplist(listofops,expr))))$ ------------------ On Nov. 16, Dieter Kaiser wrote: --------------------- >An alternativ is the Maxima function dispform, see the Maxima manual. >This functions transforms an expression into the external representation >which contains the SQRT function: ------------------------ Sometimes the dispform method does not work. --------------------- (%i12) ?isinop(dispform(a*sqrt(a)),sqrt); (%o12) false (%i5) ?isinop(dispform(a*sqrt(a^2)),sqrt); (%o5) false (%i6) ?isinop(dispform(sqrt(a^2)),sqrt); (%o6) false ------------------------------ Ted From macrakis at alum.mit.edu Wed Nov 16 20:04:17 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 16 Nov 2011 21:04:17 -0500 Subject: [Maxima] detect sqrt in expression? In-Reply-To: <48CEA6BCFA47478684A41578EB897A5B@edwinc367e16bd> References: <48CEA6BCFA47478684A41578EB897A5B@edwinc367e16bd> Message-ID: On Wed, Nov 16, 2011 at 19:03, Edwin Woollett wrote: > On Nov. 16, 2011, Stavros Macrakis wrote: > --------------- > > Why are you using the internal function ?isinop -- it is in general a bad >> idea to use internal Maxima functions unless you are familiar with the >> Lisp >> code yourself. >> >> As for listofops, it depends how exactly you ended up defining that.... >> > ------------------------- > Dieter suggested the use of ?isinop earlier in another context. > As I say, I think it is a bad idea unless you actually know the internals pretty well. > The current def of listofops is your code: > > listofops(expr) := block([inflag:true], if mapatom(expr) then {} else > adjoin(op(expr),xreduce(union,**maplist(listofops,expr))))$ > Note that this uses inflag:true. Yes, so this has op(sqrt(x)) => "^" > ------------------ > On Nov. 16, Dieter Kaiser wrote: > --------------------- > > An alternativ is the Maxima function dispform, see the Maxima manual. >> This functions transforms an expression into the external representation >> which contains the SQRT function: >> > ------------------------ > Sometimes the dispform method does not work. > --------------------- > (%i12) ?isinop(dispform(a*sqrt(a)),**sqrt); > a*sqrt(a) simplifies to a^(3/2) -- see my earlier discussion about what exactly you mean by "including the operator 'sqrt' ". So perhaps you want to write code recognizing a^(3/2) as "including a sqrt". How about sqrt(sqrt(a)) = a^(1/4)? Do you want that to be considered as "including the operator sqrt? Surely you don't want sqrt(a)*sqrt(a) (i.e. a) to be considered as "including the operator sqrt"? As for dispform, please review the documentation. If you want dispform to work recursively, you must use dispform(... , all). -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Wed Nov 16 20:41:23 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 16 Nov 2011 21:41:23 -0500 Subject: [Maxima] manipulating output of a quadratic expression after factor to a general form In-Reply-To: <20111116134930.6e2f1f46dbf8ae1df63ea750893b8632.2e66798a90.wbe@email02.secureserver.net> References: <20111116134930.6e2f1f46dbf8ae1df63ea750893b8632.2e66798a90.wbe@email02.secureserver.net> Message-ID: First of all, welcome to the Maxima community! Re "why this is not easily possible". There are many ways to represent expressions. Factor chooses a canonical one, namely a rational function (polynomial divided by polynomial). After all, (x+1)/x = x*(1+1/x^2) = (1/x)*(x^2+1) = 1 + 1/x etc. An even simpler case: x^3/y^2 = x*(x/y)^2 = (x^(3/2)/y)^2 etc. And for that matter, if it didn't choose a canonical form, why wouldn't it return e.g. (x+1)*(1+1/x)/x instead of (x+1)^2/x^2 or (1+1/x)^2? In fact, for your example, Maxima doesn't even "think of" (2*a*x+b)^2/(4*a^2) as a quotient, but as a product of three multiplicands: 1/4, a^-2, and (2*a*x+b)^2. That said, it certainly *is* possible to transform from one form to the other by explicit (programmatic) transformations.... -s On Wed, Nov 16, 2011 at 15:49, wrote: > I have this worksheet: > > Maxima 5.24.0 http://maxima.sourceforge.net > using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (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) a * x^2 + b * x + c = 0; > 2 > (%o1) a x + b x + c = 0 > (%i2) % - c; > 2 > (%o2) a x + b x = - c > (%i3) % / a; > 2 > a x + b x c > (%o3) ---------- = - - > a a > (%i4) expand(lhs(%)) = rhs(%); > 2 b x c > (%o4) x + --- = - - > a a > (%i5) % + b^2/(2*a)^2; > 2 2 > 2 b x b b c > (%o5) x + --- + ---- = ---- - - > a 2 2 a > 4 a 4 a > (%i6) factor(lhs(%)) = rhs(%); > 2 2 > (2 a x + b) b c > (%o6) ------------ = ---- - - > 2 2 a > 4 a 4 a > (%i7) > > > but I would like to have the last expression as: > > (%i7) (x + b/(2*a))^2 = rhs(%); > > > 2 > > > b 2 b c > > > (%o7) (x + ---) = ---- - - > > > 2 a 2 a > > > 4 a > > > (%i8) > > So, if anyone knows a simple solution, or why this is not easily possible, > please share. > 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 dtc-maxima at scieneer.com Wed Nov 16 23:58:21 2011 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Thu, 17 Nov 2011 16:58:21 +1100 Subject: [Maxima] Lapack results with extended precision calculations. Message-ID: <4EC4A27D.7040004@scieneer.com> With patches to the Fortran libraries it is possible to build Maxima using extended precision float types (of the CL implementation) for the 'flonum type, and below are some timing and accuracy results for a Lapack test across a range of CL implementations and choices for the Maxima 'flonum type. The Scieneer CL 80 long-floats give a little extra precision without a significant performance loss. The CMU CL 128 bit double-double floats roughly double the precision but slows the test by roughly 50 times. CLISP has arbitrary precision long-floats and an example result at 1024 bits is given but slows the test over 500 times - some people have requested this precision and this is one option. CLISP is a lot faster at lower precisions and to be fair a result is also given for 128 bit long-floats and it is only about three times slower than CMU CL's double-double float test but more accurate. So with this approach there are a range of precisions and performances available if you are prepared to change the CL implementations to suit. The test code is: load(lapack); load(diag); display2d:false; m:genmatrix(lambda([i,j],i + j),75,75)$ (showtime: all, [s, u, vt]: dgesvd(m,true,true))$ showtime: false$ err: u . diag(copylist(s)) . vt - m$ print("SVD maximum error: ", lmax(abs(list_matrix_entries(err))))$ m: u . diag(makelist (i,i,0,74)) . vt$ (showtime: all, [s, u, vt]: dgesvd(m,true,true))$ showtime: false$ err: u . diag(copylist(s)) . vt - m$ print("SVD maximum error: ", lmax(abs(list_matrix_entries(err))))$ Results sorted in order of accuracy. Scieneer CL 64 bit double-float: Evaluation took 0.0663 seconds (0.0667 elapsed) using 2.495 MB SVD maximum error: 8.615330671091215e-14 CMU CL 64 bit double-float: Evaluation took 0.1100 seconds (0.1100 elapsed) using 2.172 MB. SVD maximum error: 7.499556531342932e-14 Scieneer CL 80 bit long-float: Evaluation took 0.0857 seconds (0.0862 elapsed) using 4.149 MB. SVD maximum error: 6.3317406873153458946e-17 CMU CL 128 bit double-double-float: Evaluation took 3.7900 seconds (3.8200 elapsed) using 1197.207 MB. SVD maximum error: 2.08160671365194490153019875164e-28 CLISP 128 bit long-float: Evaluation took 9.2346 seconds (9.2966 elapsed) using 455.671 MB. SVD maximum error: 2.72714689390770701848746876635560997254E-36 CLISP 1024 bit long-float: Evaluation took 47.6238 seconds (47.8930 elapsed) using 2010.281 MB. SVD maximum error: 7.1202363472230444258887446954636930055014...E-306 From talon at lpthe.jussieu.fr Thu Nov 17 03:49:59 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Thu, 17 Nov 2011 09:49:59 +0000 (UTC) Subject: [Maxima] Lapack results with extended precision calculations. References: <4EC4A27D.7040004@scieneer.com> Message-ID: Douglas Crosher wrote: > With patches to the Fortran libraries it is possible to build Maxima using extended precision float types (of the CL implementation) > for the 'flonum type, and below are some timing and accuracy results for a Lapack test across a range of CL implementations and > choices for the Maxima 'flonum type. The Scieneer CL 80 long-floats give a little extra precision without a significant performance > loss. The CMU CL 128 bit double-double floats roughly double the precision but slows the test by roughly 50 times. CLISP has > arbitrary precision long-floats and an example result at 1024 bits is given but slows the test over 500 times - some people have > requested this precision and this is one option. CLISP is a lot faster at lower precisions and to be fair a result is also given for > 128 bit long-floats and it is only about three times slower than CMU CL's double-double float test but more accurate. So with this > approach there are a range of precisions and performances available if you are prepared to change the CL implementations to suit. > This is very interesting, i think it solves the problem i mentioned (diagonalizing matrices of order 1000x1000 which are very far from random, so that the eigenvalues are very sensitive to calculational errors) using clisp and a lot of time (which is no problem). Getting many digits correct on the eigenvalues is not important, but having at least 2 or 3 digits correct at the end of the computation is not obvious at all. -- Michel Talon From toy.raymond at gmail.com Thu Nov 17 10:54:15 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 17 Nov 2011 08:54:15 -0800 Subject: [Maxima] Lapack results with extended precision calculations. In-Reply-To: References: <4EC4A27D.7040004@scieneer.com> Message-ID: On Thu, Nov 17, 2011 at 1:49 AM, Michel Talon wrote: > Douglas Crosher wrote: > > With patches to the Fortran libraries it is possible to build Maxima > using > extended precision float types (of the CL implementation) > > for the 'flonum type, and below are some timing and accuracy results for > a > Lapack test across a range of CL implementations and > > choices for the Maxima 'flonum type. The Scieneer CL 80 long-floats > give a > little extra precision without a significant performance > > loss. The CMU CL 128 bit double-double floats roughly double the > precision > but slows the test by roughly 50 times. CLISP has > > arbitrary precision long-floats and an example result at 1024 bits is > given > but slows the test over 500 times - some people have > > requested this precision and this is one option. CLISP is a lot faster at > lower precisions and to be fair a result is also given for > > 128 bit long-floats and it is only about three times slower than CMU CL's > double-double float test but more accurate. So with this > > approach there are a range of precisions and performances available if > you > are prepared to change the CL implementations to suit. > > > > > This is very interesting, i think it solves the problem i mentioned > (diagonalizing matrices of order 1000x1000 which are very far from random, > so > that the eigenvalues are very sensitive to calculational errors) using > clisp and a lot of time (which is no problem). Getting many digits correct > on the eigenvalues is not important, but having at least 2 or 3 digits > correct > at the end of the computation is not obvious at all. > > This is really interesting. It would be interesting to see how lapack would work with bigfloats, especially compared to clisp's builtin long-floats. I suspect it would be quite a bit slower, but could be used by other lisps. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Thu Nov 17 11:05:22 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 17 Nov 2011 09:05:22 -0800 Subject: [Maxima] error in elliptic_e ? In-Reply-To: References: Message-ID: On Tue, Nov 15, 2011 at 2:45 PM, Raymond Toy wrote: > > > On Tue, Nov 15, 2011 at 1:59 PM, Raymond Toy wrote: > >> >> >> On Tue, Nov 15, 2011 at 1:11 PM, Edwin Woollett wrote: >> >>> Perhaps I am not invoking elliptic_e >>> correctly, but it appears that the definition >>> given in the help manual does not agree >>> with interactive use of elliptic_e. >>> >> >> Looks like a bug. Not sure what the problem is, though. >> > > It's because elliptic_e doesn't handle the quasi-periodicity of > elliptic_e. I think elliptic_k has the same problem. I'll fix this soon. > > Fixed in git. Also fixed the same problem with elliptic_f. But there's still a problem with symbolic computations. elliptic_e(%pi,1) returns 0. It should return 2. This is caused by elliptic_e(x,1) simplifying to sin(x). Should we return something complicated like sin(x-%pi*round(x/%pi)) + 2*round(x/%pi)? (I see there's also a bug: elliptic_ec(1) should return 1 but doesn't.) Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Thu Nov 17 15:45:28 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 17 Nov 2011 14:45:28 -0700 Subject: [Maxima] error in elliptic_e ? In-Reply-To: References: Message-ID: I think it's preferable to return something messy and correct, rather than something simple and incorrect. Ideally the messy return value is something that can be simplified in the presence of further information (e.g. value assigned to x) although I don't think that's an absolute requirement. FWIW Robert Dodier On 11/17/11, Raymond Toy wrote: > On Tue, Nov 15, 2011 at 2:45 PM, Raymond Toy wrote: > >> >> >> On Tue, Nov 15, 2011 at 1:59 PM, Raymond Toy wrote: >> >>> >>> >>> On Tue, Nov 15, 2011 at 1:11 PM, Edwin Woollett >>> wrote: >>> >>>> Perhaps I am not invoking elliptic_e >>>> correctly, but it appears that the definition >>>> given in the help manual does not agree >>>> with interactive use of elliptic_e. >>>> >>> >>> Looks like a bug. Not sure what the problem is, though. >>> >> >> It's because elliptic_e doesn't handle the quasi-periodicity of >> elliptic_e. I think elliptic_k has the same problem. I'll fix this soon. >> >> > Fixed in git. Also fixed the same problem with elliptic_f. > > But there's still a problem with symbolic computations. elliptic_e(%pi,1) > returns 0. It should return 2. This is caused by elliptic_e(x,1) > simplifying to sin(x). Should we return something complicated like > sin(x-%pi*round(x/%pi)) + 2*round(x/%pi)? > > (I see there's also a bug: elliptic_ec(1) should return 1 but doesn't.) > > Ray > From woollett at charter.net Thu Nov 17 15:59:10 2011 From: woollett at charter.net (Edwin Woollett) Date: Thu, 17 Nov 2011 13:59:10 -0800 Subject: [Maxima] detect sqrt in expression? Message-ID: On Nov. 16, 2011, Stavros Macrakis wrote ---------------------- >a*sqrt(a) simplifies to a^(3/2) -- see my earlier discussion about what >exactly you mean by "including the operator 'sqrt' ". So perhaps you want >to write code recognizing a^(3/2) as "including a sqrt". How about >sqrt(sqrt(a)) = a^(1/4)? Do you want that to be considered as "including >the operator sqrt? Surely you don't want sqrt(a)*sqrt(a) (i.e. a) to be >considered as "including the operator sqrt"? ------------------------------- I should have defined my goal, which is to have a filter in the nint program which allows me to bypass the use of integrate if the integrand expr contains multiple valued functions. For integrands which pass through the filter, nint uses: float (rectform (integrate (expr,var,a,b))) which can spit out completely wrong answers if expr contains multiple valued functions. So I need a filter function which returns true if at least one multiple valued function is found, and otherwise returns false. Thus I need a function which will detect 1. inverse trig functions which contain somewhere the (real) variable of integration var. 2. inverse hyperbolic trig functions which contain somewhere the variable of integration var. 3. log which contains somewhere the variable of integration var. 4. complex or (real and irrational) exponents so look for a. f(var)^(n/m) b. f(var)^g(var,%i) which hopefully will catch (almost?) all cases of f(var,%i)^g(var,%i) = exp (g(var,%i)) * log (f(var,%i)) Clearly this kind of filter will be rather complicated. The payoff is the speed advantage of using integrate instead of quadpack for many integrands which users submit to nint. Ted From macrakis at alum.mit.edu Thu Nov 17 16:38:58 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 17 Nov 2011 17:38:58 -0500 Subject: [Maxima] detect sqrt in expression? In-Reply-To: References: Message-ID: On Thu, Nov 17, 2011 at 16:59, Edwin Woollett wrote: > ...I should have defined my goal, ...if the integrand expr contains > multiple > valued functions. > ...Clearly this kind of filter will be rather complicated.... > Really? It seems pretty straightforward to me, something like hasmultival(ex,var) := if mapatom(ex) then false else if member(inop(ex), '[log, asin, acos, asinh, etc. etc.] ) and member(var,listofvars(ex)) then true else if inop(ex) = "^" and ... else ...recursive case... Not very complicated. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Thu Nov 17 18:41:25 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 17 Nov 2011 16:41:25 -0800 Subject: [Maxima] error in elliptic_e ? In-Reply-To: References: Message-ID: On Thu, Nov 17, 2011 at 1:45 PM, Robert Dodier wrote: > I think it's preferable to return something messy and correct, > rather than something simple and incorrect. > Ideally the messy return value is something that can be > simplified in the presence of further information > (e.g. value assigned to x) although I don't think that's > an absolute requirement. > > I think elliptic_e(x,m) where x is a number (or %pi) should return the messy expression that might be simplified. But I would hate it if elliptic_e(x,m) always simplified to elliptic_e(x-%pi*round(x/%pi),m)+2*round(x/%pi)*elliptic_ec(m) for symbolic x and m. When x is a number (or %pi, %gamma, %e, etc.), maxima can do something reasonable. I think this is a decent tradeoff. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Thu Nov 17 23:51:22 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 17 Nov 2011 22:51:22 -0700 Subject: [Maxima] error in elliptic_e ? In-Reply-To: References: Message-ID: On 11/17/11, Raymond Toy wrote: > I think elliptic_e(x,m) where x is a number (or %pi) should return the > messy expression that might be simplified. But I would hate it if > elliptic_e(x,m) always simplified to > elliptic_e(x-%pi*round(x/%pi),m)+2*round(x/%pi)*elliptic_ec(m) for symbolic > x and m. When x is a number (or %pi, %gamma, %e, etc.), maxima can do > something reasonable. Of course, we're under no obligation to produce a mess whenever it's possible. Not simplifying an expression is correct too. But if an expression simplifies, I hope it simplifies to something correct. The suggested policy for elliptic_e (simplify when x is a constant) seems reasonable, although I have to confess I really know very little about it. Something which is not really possible today, which seems like it would be useful, would be a simplification system in which it's easy to enable and disable simplifications (including built-in ones), and to see which simplifications are in effect. Then super-messy simplifications could be kept on the shelf, but easily enabled by a user who really wants them. best, Robert Dodier From robert.dodier at gmail.com Fri Nov 18 00:48:25 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 17 Nov 2011 23:48:25 -0700 Subject: [Maxima] how to use a subscripted variable in a "depends" statement In-Reply-To: <1319930726.52109.YahooMailNeo@web161802.mail.bf1.yahoo.com> References: <1319915791.47535.YahooMailNeo@web161801.mail.bf1.yahoo.com> <4EAC5FE7.9000704@eecs.berkeley.edu> <1319930726.52109.YahooMailNeo@web161802.mail.bf1.yahoo.com> Message-ID: On 10/29/11, Ether Jones wrote: > Is there a way to make a variable display with a subscript, without the > subscript being interpreted as some sort of index, so that the variable > could be treated in all respects like any other variable? It's the > appearance of the output which is driving this request. It depends on which display method you are using. If it is TeX (via TeXmath or imaxima) then you can assign a string to be pasted into the TeX output. e.g. texput(x_1, "x_1"); which TeX displays as a subscript. If you are using wxMaxima I think there is some equivalent property you could set. If you are using the usual Maxima pretty printer, it is possible, via a hook in the display code; see DIMENSION-ATOM in maxima/src/displa.lisp. I can explain it if you want. best Robert Dodier From anorman728 at gmail.com Fri Nov 18 02:00:50 2011 From: anorman728 at gmail.com (Andrew Norman) Date: Fri, 18 Nov 2011 02:00:50 -0600 Subject: [Maxima] For loops skipping steps Message-ID: I've never used this before, so sorry if I'm doing it wrong, but I have a problem that I absolutely cannot figure out. It took me awhile to condense my problem down to something quick and easy to explain. Using the draw package with multiplot_mode(screen) and set_draw_defaults(xrange=[-10,10],yrange=[-10,10]), if I define a function b(k):= for j:-10 thru 10 do draw2d( points( [ [ j,k ] ] )); It should (and it does) create a line of points along the line y=k. But if I then evaluate for k:-10 thru 10 do b(k); Then it works (mostly) for the first couple of lines, but then it skips almost all of the points. This is the basic idea, but it has other effects. It's causing me some headaches in some 3d plots. Any ideas on either what I'm doing wrong or how I can work around this? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anorman728 at gmail.com Fri Nov 18 02:01:51 2011 From: anorman728 at gmail.com (Andrew Norman) Date: Fri, 18 Nov 2011 02:01:51 -0600 Subject: [Maxima] For loops skipping steps Message-ID: I've never used this before, so sorry if I'm doing it wrong, but I have a problem that I absolutely cannot figure out. It took me awhile to condense my problem down to something quick and easy to explain. Using the draw package with multiplot_mode(screen) and set_draw_defaults(xrange=[-10,10],yrange=[-10,10]), if I define a function b(k):= for j:-10 thru 10 do draw2d( points( [ [ j,k ] ] )); It should (and it does) create a line of points along the line y=k. But if I then evaluate for k:-10 thru 10 do b(k); Then it works (mostly) for the first couple of lines, but then it skips almost all of the points. This is the basic idea, but it has other effects. It's causing me some headaches in some 3d plots. Any ideas on either what I'm doing wrong or how I can work around this? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anorman728 at gmail.com Fri Nov 18 02:00:50 2011 From: anorman728 at gmail.com (Andrew Norman) Date: Fri, 18 Nov 2011 02:00:50 -0600 Subject: [Maxima] For loops skipping steps Message-ID: I've never used this before, so sorry if I'm doing it wrong, but I have a problem that I absolutely cannot figure out. It took me awhile to condense my problem down to something quick and easy to explain. Using the draw package with multiplot_mode(screen) and set_draw_defaults(xrange=[-10,10],yrange=[-10,10]), if I define a function b(k):= for j:-10 thru 10 do draw2d( points( [ [ j,k ] ] )); It should (and it does) create a line of points along the line y=k. But if I then evaluate for k:-10 thru 10 do b(k); Then it works (mostly) for the first couple of lines, but then it skips almost all of the points. This is the basic idea, but it has other effects. It's causing me some headaches in some 3d plots. Any ideas on either what I'm doing wrong or how I can work around this? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anorman728 at gmail.com Fri Nov 18 02:00:50 2011 From: anorman728 at gmail.com (Andrew Norman) Date: Fri, 18 Nov 2011 02:00:50 -0600 Subject: [Maxima] For loops skipping steps Message-ID: I've never used this before, so sorry if I'm doing it wrong, but I have a problem that I absolutely cannot figure out. It took me awhile to condense my problem down to something quick and easy to explain. Using the draw package with multiplot_mode(screen) and set_draw_defaults(xrange=[-10,10],yrange=[-10,10]), if I define a function b(k):= for j:-10 thru 10 do draw2d( points( [ [ j,k ] ] )); It should (and it does) create a line of points along the line y=k. But if I then evaluate for k:-10 thru 10 do b(k); Then it works (mostly) for the first couple of lines, but then it skips almost all of the points. This is the basic idea, but it has other effects. It's causing me some headaches in some 3d plots. Any ideas on either what I'm doing wrong or how I can work around this? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fateman at eecs.berkeley.edu Fri Nov 18 08:48:36 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Fri, 18 Nov 2011 06:48:36 -0800 Subject: [Maxima] error in elliptic_e ? /simplification heuristics In-Reply-To: References: Message-ID: <4EC67044.8060101@eecs.berkeley.edu> Mathematica has two commands, Simplify and FullSimplify, which attempt to produce a simpler expression (measure of simplicity can be specified by user) with various options. There is also something called FunctionExpand, which may be worth looking at as well. In case it is not obvious, these techniques can run up your computing time substantially. In my limited experience with them, they are generally useful only for expressions which are initially rather small, to see if there is an expression that is even smaller. And even then, they may not do the right thing. I was experimenting with Bessel function identities. Some work, some don't. A project for a student? RJF On 11/17/2011 9:51 PM, Robert Dodier wrote: > On 11/17/11, Raymond Toy wrote: > >> I think elliptic_e(x,m) where x is a number (or %pi) should return the >> messy expression that might be simplified. But I would hate it if >> elliptic_e(x,m) always simplified to >> elliptic_e(x-%pi*round(x/%pi),m)+2*round(x/%pi)*elliptic_ec(m) for symbolic >> x and m. When x is a number (or %pi, %gamma, %e, etc.), maxima can do >> something reasonable. > Of course, we're under no obligation to produce a mess whenever it's possible. > Not simplifying an expression is correct too. But if an expression simplifies, > I hope it simplifies to something correct. > > The suggested policy for elliptic_e (simplify when x is a constant) seems > reasonable, although I have to confess I really know very little about it. > > Something which is not really possible today, which seems like it would > be useful, would be a simplification system in which it's easy to enable > and disable simplifications (including built-in ones), and to see which > simplifications are in effect. Then super-messy simplifications could be > kept on the shelf, but easily enabled by a user who really wants them. > > best, > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From jan.mueller at math.uni-dortmund.de Fri Nov 18 09:38:17 2011 From: jan.mueller at math.uni-dortmund.de (Jan Mueller) Date: Fri, 18 Nov 2011 16:38:17 +0100 Subject: [Maxima] Webstart Message-ID: <8D5837E5-FE93-470B-9F6B-83DB8DF1E422@math.uni-dortmund.de> Hi all, would it be possible to create a Maxima webstart version (such like geogebra has)? I am often using Maxima in school and it would be comfortable to use an "actual" version where is no need to reinstall it in the schools network bw Jan From macrakis at alum.mit.edu Fri Nov 18 09:44:16 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 18 Nov 2011 10:44:16 -0500 Subject: [Maxima] manipulating output of a quadratic expression after factor to a general form In-Reply-To: References: <20111116134930.6e2f1f46dbf8ae1df63ea750893b8632.2e66798a90.wbe@email02.secureserver.net> Message-ID: Inspired by Horatio's query, I have extended my 'divthru' package to handle his case. To use it, just save it somewhere and do load("...pathname..."). Divthru means "divide through", and changes things of the form a/b to the form quotient+remainder/b. It turns out that this is often a useful transformation. For example, divthru((x+1)/x) => 1+1/x. In that case, it is the same result as multthru. But in more complicated cases, it may be different: (%i1) expr: (x^2+1)/(x+1) $ (%i2) multthru(expr); (%o2) x^2/(x+1)+1/(x+1) (%i3) divthru(expr); (%o3) 2/(x+1)+x-1 Or: (%i44) expr:(x^2+1)/(x^2-1); (%o44) (x^2+1)/(x^2-1) (%i45) multthru(expr); (%o45) x^2/(x^2-1)+1/(x^2-1) (%i46) divthru(expr); (%o46) 2/((x-1)*(x+1))+1 <<< factors by default (%i47) map(ratsimp,%); (%o47) 2/(x^2-1)+1 <<< expand each term (%i48) partfrac(expr,x); <<< another useful transformation (%o48) -1/(x+1)+1/(x-1)+1 When the numerator and denominator are taken to powers, it performs divthru of the bases, not the whole expression: (%i4) divthru( (x^2+1)^3 / (x+1)^3 ); (%o4) (2/(x+1)+x-1)^3 This is different from dividing out the numerator and denominator as is: (%i9) dd:divide( num: (x^2+1)^3, denom: (x+1)^3); (%o9) [x^3-3*x^2+9*x-19,36*x^2+48*x+20] (%i10) dd[1]+dd[2]/ denom; (%o10) x^3+(36*x^2+48*x+20)/(x+1)^3-3*x^2+9*x-19 If the powers are different, it takes the common part (min of powers): (%i5) divthru( (x^2+1)^3 / (x+1)^2 ); (%o5) (x^2+1)*(2/(x+1)+x-1)^2 This works even for symbolic powers: (%i6) divthru( (x^2+1)^3 / (x+1)^a ); (%o6) (x+1)^min(0,3-a)*(x^2+1)^max(0,3-a)*(2/(x+1)+x-1)^min(3,a) (%i7) divthru( (x^2+1)^(a+1) / (x+1)^a ); (%o7) (x^2+1)*(2/(x+1)+x-1)^a The form of the result can be controlled by telling Maxima the relative value of the exponents: (%i28) expr:(x-1)^(a+b)/x^a; (%o28) (x-1)^(b+a)/x^a (%i29) divthru(expr); (%o29) (1-1/x)^min(a,b+a)*(x-1)^max(0,b)*x^min(0,b) (%i30) assume(b>0)$ (%i31) divthru(expr); (%o31) (1-1/x)^a*(x-1)^b (%i32) forget(b>0)$assume(b<0)$ (%i34) divthru(expr); (%o34) (1-1/x)^(b+a)*x^b Please let me know if you encounter any problems with divthru, or have ideas on how to improve or extend it. -s On Wed, Nov 16, 2011 at 21:41, Stavros Macrakis wrote: > First of all, welcome to the Maxima community! > > Re "why this is not easily possible". There are many ways to represent > expressions. Factor chooses a canonical one, namely a rational function > (polynomial divided by polynomial). After all, (x+1)/x = x*(1+1/x^2) = > (1/x)*(x^2+1) = 1 + 1/x etc. An even simpler case: x^3/y^2 = x*(x/y)^2 = > (x^(3/2)/y)^2 etc. And for that matter, if it didn't choose a canonical > form, why wouldn't it return e.g. (x+1)*(1+1/x)/x instead of (x+1)^2/x^2 > or (1+1/x)^2? > > In fact, for your example, Maxima doesn't even "think > of" (2*a*x+b)^2/(4*a^2) as a quotient, but as a product of three > multiplicands: 1/4, a^-2, and (2*a*x+b)^2. > > That said, it certainly *is* possible to transform from one form to the > other by explicit (programmatic) transformations.... > > -s > > > On Wed, Nov 16, 2011 at 15:49, wrote: > >> I have this worksheet: >> >> Maxima 5.24.0 http://maxima.sourceforge.net >> using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (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) a * x^2 + b * x + c = 0; >> 2 >> (%o1) a x + b x + c = 0 >> (%i2) % - c; >> 2 >> (%o2) a x + b x = - c >> (%i3) % / a; >> 2 >> a x + b x c >> (%o3) ---------- = - - >> a a >> (%i4) expand(lhs(%)) = rhs(%); >> 2 b x c >> (%o4) x + --- = - - >> a a >> (%i5) % + b^2/(2*a)^2; >> 2 2 >> 2 b x b b c >> (%o5) x + --- + ---- = ---- - - >> a 2 2 a >> 4 a 4 a >> (%i6) factor(lhs(%)) = rhs(%); >> 2 2 >> (2 a x + b) b c >> (%o6) ------------ = ---- - - >> 2 2 a >> 4 a 4 a >> (%i7) >> >> >> but I would like to have the last expression as: >> >> (%i7) (x + b/(2*a))^2 = rhs(%); >> >> >> 2 >> >> >> b 2 b c >> >> >> (%o7) (x + ---) = ---- - - >> >> >> 2 a 2 a >> >> >> 4 a >> >> >> (%i8) >> >> So, if anyone knows a simple solution, or why this is not easily >> possible, please share. >> 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: divthru.mac Type: application/octet-stream Size: 2951 bytes Desc: not available URL: From robert.dodier at gmail.com Fri Nov 18 09:51:06 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 18 Nov 2011 08:51:06 -0700 Subject: [Maxima] For loops skipping steps In-Reply-To: References: Message-ID: On 11/18/11, Andrew Norman wrote: > It took me awhile to condense my problem down to something quick and easy > to explain. Using the draw package with multiplot_mode(screen) and > set_draw_defaults(xrange=[-10,10],yrange=[-10,10]), if I define a function > > b(k):= > for j:-10 thru 10 do > draw2d( points( [ [ j,k ] ] )); > > It should (and it does) create a line of points along the line y=k. But if > I then evaluate > > for k:-10 thru 10 do b(k); > > Then it works (mostly) for the first couple of lines, but then it skips > almost all of the points. My first guess (emphasis on guess) is that this is the result of a race condition: many plotting commands write to temporary files and then those files are processed by Gnuplot. Maybe the output from one iteration is clobbering another before Gnuplot has a chance to read it? What happens if you put in a delay, e.g. read(); (then you have to enter something like "0;" to continue). There might be a way to tell draw to pipe the data directly to Gnuplot without using a file. I don't know how to do that. best Robert Dodier From robert.dodier at gmail.com Fri Nov 18 10:09:18 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 18 Nov 2011 09:09:18 -0700 Subject: [Maxima] Helping out with Maxima In-Reply-To: <1320974853.98193.YahooMailNeo@web113317.mail.gq1.yahoo.com> References: <1320532185.39884.YahooMailNeo@web113304.mail.gq1.yahoo.com> <1320974853.98193.YahooMailNeo@web113317.mail.gq1.yahoo.com> Message-ID: Conrad, thanks a lot for your interest in Maxima. I suggest that you get started by just watching the mailing list and solving problems that people bring up. There's no requirement of a certain level of experience, just jump right in whenever you feel you have something useful to contribute. As you can see there are always a lot of questions, some have obvious answers but a lot of them don't. I think that's a good way for you to learn about Maxima. Over time perhaps you will get some ideas about larger-scale projects that you could work on. It's clear that you have expertise in many topics but it's not clear how to apply that to Maxima; I think that over time it will become clearer. You can also trawl through the bug reports at the Sourceforge project site, although the mailing list is perhaps more fun due to social interaction. I'd like to make this same suggestion to anyone else who is interested in contributing to Maxima. All the best, Robert Dodier On 11/10/11, Conrad Schiff wrote: > Hello All, > > In response to Robert's request, I'll say a little about myself. > > Educational background: I have a PhD in theoretical physics from the > University of Maryland. My field of study was General Relativity with an > emphasis on numerical modeling and the ADM decomposition. In my > dissertation, I worked on how to model extended fluid objects, such as a > white dwarf, in motion about massive and super-massive black holes and > determined possible finite-size corrections to the orbital motion of these > systems as potential gravitational wave sources. > > Work background: For the last 21 years or so (even while I earned my PhD), > I've worked at the Goddard Space Flight Center in Flight Dynamics. I was > the lead trajectory designer on the ACE, WMAP, and JWST missions, and > contributed significantly to the trajectories of the Clementine and GPM > missions. I am currently the Flight Dynamics lead for the Magnetospheric > MultiScale mission. Much of this work has centered on the development of > analytical and numerical models of the motion of spacecraft and the > maneuvers needed to achieve their desired orbits. Along the way, I've > picked up a deal of experience working on large scale scientific pieces of > software. > > Interests: Gravity, orbital mechanics, and general relativity; scientific > software, automation, & artificial intelligence; dynamical systems and > chaos; physics education and mentoring > > I hope that this helps and I hope might be able to contribute to Maxima. > > > Thanks, > Conrad From toy.raymond at gmail.com Fri Nov 18 10:36:19 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 18 Nov 2011 08:36:19 -0800 Subject: [Maxima] error in elliptic_e ? In-Reply-To: References: Message-ID: On Thu, Nov 17, 2011 at 9:51 PM, Robert Dodier wrote: > On 11/17/11, Raymond Toy wrote: > > > I think elliptic_e(x,m) where x is a number (or %pi) should return the > > messy expression that might be simplified. But I would hate it if > > elliptic_e(x,m) always simplified to > > elliptic_e(x-%pi*round(x/%pi),m)+2*round(x/%pi)*elliptic_ec(m) for > symbolic > > x and m. When x is a number (or %pi, %gamma, %e, etc.), maxima can do > > something reasonable. > > Of course, we're under no obligation to produce a mess whenever it's > possible. > Not simplifying an expression is correct too. But if an expression > simplifies, > I hope it simplifies to something correct. > > The suggested policy for elliptic_e (simplify when x is a constant) seems > reasonable, although I have to confess I really know very little about it. > > Something which is not really possible today, which seems like it would > be useful, would be a simplification system in which it's easy to enable > and disable simplifications (including built-in ones), and to see which > simplifications are in effect. Then super-messy simplifications could be > kept on the shelf, but easily enabled by a user who really wants them. > > That would be nice to have. It would also, perhaps, unify the huge collection that we have today of randomly named flags that controls how expressions are simplified. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From pbowyer at olynet.com Fri Nov 18 11:29:24 2011 From: pbowyer at olynet.com (Paul Bowyer) Date: Fri, 18 Nov 2011 09:29:24 -0800 Subject: [Maxima] Webstart In-Reply-To: <8D5837E5-FE93-470B-9F6B-83DB8DF1E422@math.uni-dortmund.de> References: <8D5837E5-FE93-470B-9F6B-83DB8DF1E422@math.uni-dortmund.de> Message-ID: <4EC695F4.20107@olynet.com> On 11/18/2011 07:38 AM, Jan Mueller wrote: > Hi all, > would it be possible to create a Maxima webstart version (such like geogebra has)? I am often using Maxima in school and it would be comfortable to use an "actual" version where is no need to reinstall it in the schools network > bw > Jan > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > Jan I stumbled across this a while back that might be what you are looking for. http://www.vroomlab.com:8081/nhome/# Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Fri Nov 18 11:46:48 2011 From: woollett at charter.net (Edwin Woollett) Date: Fri, 18 Nov 2011 09:46:48 -0800 Subject: [Maxima] detect sqrt in expression? Message-ID: <6ACE847DAE164B78AACEC6BFE496C7BE@edwinc367e16bd> On Nov. 17, 2011, Stavros Macrakis wrote ---------------------- >>...Clearly this kind of filter will be rather complicated.... >> > >Really? It seems pretty straightforward to me, something like > >hasmultival(ex,var) := if mapatom(ex) then false > >else if member(inop(ex), '[log, asin, acos, asinh, etc. etc.] ) and >member(var,listofvars(ex)) then true > >else if inop(ex) = "^" and ... > >else ...recursive case... > >Not very complicated. ---------------------------- Thanks for the suggestions. Ted From biomates at telefonica.net Fri Nov 18 13:28:54 2011 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 18 Nov 2011 20:28:54 +0100 Subject: [Maxima] For loops skipping steps In-Reply-To: References: Message-ID: <1321644534.2373.31.camel@pc> El vie, 18-11-2011 a las 08:51 -0700, Robert Dodier escribi?: > On 11/18/11, Andrew Norman wrote: > > > It took me awhile to condense my problem down to something quick and easy > > to explain. Using the draw package with multiplot_mode(screen) and > > set_draw_defaults(xrange=[-10,10],yrange=[-10,10]), if I define a function > > > > b(k):= > > for j:-10 thru 10 do > > draw2d( points( [ [ j,k ] ] )); > > > > It should (and it does) create a line of points along the line y=k. But if > > I then evaluate > > > > for k:-10 thru 10 do b(k); > > > > Then it works (mostly) for the first couple of lines, but then it skips > > almost all of the points. > > My first guess (emphasis on guess) is that this is the result of a > race condition: many plotting commands write to temporary files > and then those files are processed by Gnuplot. Maybe the output > from one iteration is clobbering another before Gnuplot has a > chance to read it? What happens if you put in a delay, e.g. read(); > (then you have to enter something like "0;" to continue). > There might be a way to tell draw to pipe the data directly to Gnuplot > without using a file. I don't know how to do that. Hello, I can take a look at it. In fact, in the first versions of draw, data were sent to Gnuplot via the pipe. But writing the coordinates in separate files, thus avoiding interferences, gives the same wrong behavior. We also need to write the gnuplot scripts in different files to get acceptable results. So let's play with options 'data_file_name' and 'gnuplot_file_name'. The problem with this workaround is that a lot of files will be generated. Andrew, you can try something similar to this session: /* Create a temporary file */ system("mkdir tmp_maxima") $ /* tell Maxima where to place temporal files */ maxima_tempdir: "tmp_maxima" $ /* load draw and set defaults */ load(draw) $ set_draw_defaults(xrange=[-11,11],yrange=[-11,11]) $ /* write the plotting function */ b():= for j:-10 thru 10 do for k: -10 thru 10 do draw2d( data_file_name = sconcat("data_",j,"_",k), gnuplot_file_name = sconcat("gnuplot_",j,"_",k), points( [ [ j,k ] ] )); /* set plot mode and call b */ multiplot_mode(screen) $ b() $ /* remove the temporary files */ system("rm -r tmp_maxima") $ When I remove one of the options 'data_file_name' or 'gnuplot_file_name', gnuplot starts its random behavior just in the moment when the outer loop of 'b' returns the message 'done' and the Maxima prompt appears again. But using the two options, even when 'b' terminates, Gnuplot remains plotting the points normally. You can make further calculations with Maxima while Gnuplot is still working. -- Mario From anorman728 at gmail.com Fri Nov 18 16:37:00 2011 From: anorman728 at gmail.com (Andrew Norman) Date: Fri, 18 Nov 2011 16:37:00 -0600 Subject: [Maxima] For loops skipping steps In-Reply-To: <1321644534.2373.31.camel@pc> References: <1321644534.2373.31.camel@pc> Message-ID: Thank you very much. My previous solution based on Robert's insights was to do an arbitrary but long-lasting "for" loop that kept Maxima busy so it didn't overwhelm Gnuplot (which I forgot to reply-all when I explained it, so I didn't send it to the maxima email address). This worked, but it was very CPU intensive and slow. This new solution is much faster and easier. And I would have never guessed it myself. It also works in the specific draw3d command that brought this problem to my attention to begin with. Now I can continue my graduate project. Thanks again, I really appreciate both of your guys' help. --Andrew On Fri, Nov 18, 2011 at 1:28 PM, Mario Rodriguez wrote: > El vie, 18-11-2011 a las 08:51 -0700, Robert Dodier escribi?: > > On 11/18/11, Andrew Norman wrote: > > > > > It took me awhile to condense my problem down to something quick and > easy > > > to explain. Using the draw package with multiplot_mode(screen) and > > > set_draw_defaults(xrange=[-10,10],yrange=[-10,10]), if I define a > function > > > > > > b(k):= > > > for j:-10 thru 10 do > > > draw2d( points( [ [ j,k ] ] )); > > > > > > It should (and it does) create a line of points along the line y=k. > But if > > > I then evaluate > > > > > > for k:-10 thru 10 do b(k); > > > > > > Then it works (mostly) for the first couple of lines, but then it skips > > > almost all of the points. > > > > My first guess (emphasis on guess) is that this is the result of a > > race condition: many plotting commands write to temporary files > > and then those files are processed by Gnuplot. Maybe the output > > from one iteration is clobbering another before Gnuplot has a > > chance to read it? What happens if you put in a delay, e.g. read(); > > (then you have to enter something like "0;" to continue). > > > There might be a way to tell draw to pipe the data directly to Gnuplot > > without using a file. I don't know how to do that. > > > > Hello, > > I can take a look at it. In fact, in the first versions of draw, data > were sent to Gnuplot via the pipe. > > But writing the coordinates in separate files, thus avoiding > interferences, gives the same wrong behavior. We also need to write the > gnuplot scripts in different files to get acceptable results. So let's > play with options 'data_file_name' and 'gnuplot_file_name'. > > The problem with this workaround is that a lot of files will be > generated. > > Andrew, you can try something similar to this session: > > > > /* Create a temporary file */ > system("mkdir tmp_maxima") $ > > /* tell Maxima where to place temporal files */ > maxima_tempdir: "tmp_maxima" $ > > /* load draw and set defaults */ > load(draw) $ > set_draw_defaults(xrange=[-11,11],yrange=[-11,11]) $ > > /* write the plotting function */ > b():= > for j:-10 thru 10 do > for k: -10 thru 10 do > draw2d( data_file_name = sconcat("data_",j,"_",k), > gnuplot_file_name = sconcat("gnuplot_",j,"_",k), > points( [ [ j,k ] ] )); > > /* set plot mode and call b */ > multiplot_mode(screen) $ > b() $ > > /* remove the temporary files */ > system("rm -r tmp_maxima") $ > > > When I remove one of the options 'data_file_name' or > 'gnuplot_file_name', gnuplot starts its random behavior just in the > moment when the outer loop of 'b' returns the message 'done' and the > Maxima prompt appears again. But using the two options, even when 'b' > terminates, Gnuplot remains plotting the points normally. You can make > further calculations with Maxima while Gnuplot is still working. > > > -- > Mario > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maxima at etherjones.us Sat Nov 19 13:34:25 2011 From: maxima at etherjones.us (Ether Jones) Date: Sat, 19 Nov 2011 11:34:25 -0800 (PST) Subject: [Maxima] tricks for getting "solve" to work? Message-ID: <1321731265.76111.YahooMailNeo@web161801.mail.bf1.yahoo.com> Is there a way to solve q1 & q2 for alpha? (%i4) did not work neither did (%i7) Thank you. (%i1) kill(all)$ display2d: false; (%o1) false (%i2) q1: T*cos(theta) = F*cos(alpha); (%o2) cos(theta)*T = cos(alpha)*F (%i3) q2: M = T*sin(theta)+F*sin(alpha); (%o3) M = sin(theta)*T+sin(alpha)*F (%i4) solve([q1,q2],alpha); (%o4) [] (%i5) _T: rhs(solve(q1,T)[1]); (%o5) cos(alpha)*F/cos(theta) (%i6) q2a: subst(_T,T,q2); (%o6) M = cos(alpha)*sin(theta)*F/cos(theta)+sin(alpha)*F (%i7) solve(q2a,alpha); (%o7) [sin(alpha) = -(cos(alpha)*sin(theta)*F-cos(theta)*M)/(cos(theta)*F)] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: z3.mac Type: application/octet-stream Size: 207 bytes Desc: not available URL: From macrakis at alum.mit.edu Sat Nov 19 13:45:25 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 19 Nov 2011 14:45:25 -0500 Subject: [Maxima] tricks for getting "solve" to work? In-Reply-To: <1321731265.76111.YahooMailNeo@web161801.mail.bf1.yahoo.com> References: <1321731265.76111.YahooMailNeo@web161801.mail.bf1.yahoo.com> Message-ID: (%i1) q1: T*cos(theta) = F*cos(alpha)$ (%i2) q2: M = T*sin(theta)+F*sin(alpha)$ (%i3) eqs:[q1,q2]$ (%i4) eqs1: subst([alpha=asin(sinalpha),theta=asin(sintheta)],eqs); (%o4) [sqrt(1-sintheta^2)*T = sqrt(1-sinalpha^2)*F,M = sintheta*T+sinalpha*F] (%i5) load(to_poly_solver)$ (%i6) to_poly_solve(eqs1,[sintheta,sinalpha]); (%o6) %union(%if(?%and(-%pi/2 < parg(-sqrt(-T+M+F)*sqrt(T-M+F)*sqrt(T+M-F)*sqrt(T+M+F)/(2*M*T)),-%pi/2 < parg(-sqrt(-T^4+(2*M^2+2*F^2)*T^2-M^4+2*F^2*M^2-F^4)/(2*F*M)), parg(-sqrt(-T+M+F)*sqrt(T-M+F)*sqrt(T+M-F)*sqrt(T+M+F)/(2*M*T)) <= %pi/2,parg(-sqrt(-T^4+(2*M^2+2*F^2)*T^2-M^4+2*F^2*M^2-F^4)/(2*F*M)) <= %pi/2), [sinalpha = -(T^2-M^2-F^2)/(2*F*M),sintheta = (T^2+M^2-F^2)/(2*M*T)],%union()), %if(?%and(-%pi/2 < parg(sqrt(-T+M+F)*sqrt(T-M+F)*sqrt(T+M-F)*sqrt(T+M+F)/(M*T)),-%pi/2 < parg(sqrt(-T^4+(2*M^2+2*F^2)*T^2-M^4+2*F^2*M^2-F^4)/(F*M)), parg(sqrt(-T+M+F)*sqrt(T-M+F)*sqrt(T+M-F)*sqrt(T+M+F)/(M*T)) <= %pi/2,parg(sqrt(-T^4+(2*M^2+2*F^2)*T^2-M^4+2*F^2*M^2-F^4)/(F*M)) <= %pi/2), [sinalpha = -(T^2-M^2-F^2)/(2*F*M),sintheta = (T^2+M^2-F^2)/(2*M*T)],%union())) Note that most of the length of the result comes from the *conditions* around the variables, which you can probably ignore, especially since the first two cases have the same value.... (%i7) part(%o6,1,2); (%o7) [sinalpha = -(T^2-M^2-F^2)/(2*F*M),sintheta = (T^2+M^2-F^2)/(2*M*T)] (%i8) part(%o6,2,2); (%o8) [sinalpha = -(T^2-M^2-F^2)/(2*F*M),sintheta = (T^2+M^2-F^2)/(2*M*T)] -s On Sat, Nov 19, 2011 at 14:34, Ether Jones wrote: > q2: M = T*sin(theta)+F*sin(alpha); -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Nov 19 15:14:16 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 19 Nov 2011 14:14:16 -0700 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: <20111112175128.GX20179@cs-wsok.swan.ac.uk> References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> Message-ID: I've pushed the following changes to the implementation and documentation of sort in an attempt to address the questions raised a few days ago. Hope this helps. If further discussion is needed, well, have at it. best Robert Dodier PS. diff --git a/doc/info/Lists.texi b/doc/info/Lists.texi index 861f280..81d25bc 100644 --- a/doc/info/Lists.texi +++ b/doc/info/Lists.texi @@ -889,7 +889,7 @@ See @mref{first} for more details. @deffnx {Function} sort (@var{L}) Sorts a list @var{L} according to a predicate @code{P} of two arguments, such -that @code{@var{P} (@var{L}[k], @var{L}[k + 1])} is @code{true} for any two +that @code{@var{P}(@var{L}[k + 1], @var{L}[k])} is @code{false} for any two successive elements. The predicate may be specified as the name of a function or binary infix operator, or as a @code{lambda} expression. If specified as the name of an operator, the name is enclosed in "double quotes". @@ -900,11 +900,16 @@ the elements of @var{L}. @c DUNNO IF WE NEED TO GO INTO THE IMPLICATIONS OF SHALLOW COPY HERE ... @c MIGHT CONSIDER A REF FOR TOTAL ORDER HERE -If the predicate @var{P} is not a total order on the elements of @var{L}, then - at code{sort} might run to completion without error, but the result is undefined. +It is assumed the predicate @var{P} is a strict total order on the elements of @var{L}. +If not, @code{sort} might run to completion without error, but the result is undefined. @code{sort} complains if the predicate evaluates to something other than @code{true} or @code{false}. + at code{sort} is a stable sort: +if two elements @var{x} and @var{y} are equivalent in the sense that + at code{@var{P}(@var{x}, @var{y})} and @code{@var{P}(@var{y}, @var{x})} are both @code{false}, +then the relative order of @var{x} and @var{y} in @var{L} is preserved by @code{sort}. + @code{sort (@var{L})} is equivalent to @code{sort (@var{L}, orderlessp)}. That is, the default sorting order is ascending, as determined by @mrefdot{orderlessp} All Maxima atoms and expressions are comparable under diff --git a/src/mstuff.lisp b/src/mstuff.lisp index 2dbba30..82b4184 100644 --- a/src/mstuff.lisp +++ b/src/mstuff.lisp @@ -21,7 +21,7 @@ (mfunction1 (setq bfun (getopr f)))) (when (member bfun '(lessthan great) :test #'eq) (setq llist (mapcar #'ratdisrep llist))) - (cons '(mlist) (sort llist comparfun)))) + (cons '(mlist) (stable-sort llist comparfun)))) ;; cmulisp does not like the closure version. Clisp insists on the ;; closure version. Gcl likes either... For the moment we will From robert.dodier at gmail.com Sat Nov 19 16:14:30 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 19 Nov 2011 15:14:30 -0700 Subject: [Maxima] Why does 'matrix' evaluate its arguments anomalously? In-Reply-To: References: Message-ID: On 11/11/11, Stavros Macrakis wrote: > Can anyone think of a reason that matrix shouldn't be simply this: > > (defmfun $matrix (&rest rows) OK, I remember now why matrix isn't an ordinary function. GCL has a limitation of 64 arguments for a function, so attempting to define a matrix with > 64 rows triggers an error. That bug was noticed and a work around put in place; see commit message below. If there is a better way to handle the situation, while still keeping it workable for GCL, I'd be interested to hear about it. best Robert Dodier PS. commit 9bcad16b9eedcb8725197313808bc88fe1ce6b88 Author: robert_dodier Date: Thu Oct 12 15:18:45 2006 +0000 (1) Work around GCL number of arguments limitation in $matrix. src/mlisp.lisp: change $matrix from defun to defmspec, and evaluate arguments within $matrix. From point of view of caller, $matrix should work same as before (but without bug). tests/rtest2.mac: new test cases for matrix function. (2) Avoid unintended upper/lower case inversion in declare(foo, alphabetic) (in src/mlisp.lisp). Also process all characters in a string instead of just one at a time. From macrakis at alum.mit.edu Sat Nov 19 17:06:39 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 19 Nov 2011 18:06:39 -0500 Subject: [Maxima] Why does 'matrix' evaluate its arguments anomalously? In-Reply-To: References: Message-ID: Yuck. Yuck. Yuck. Is that really true? GCL has no way of handling > 64 args? I suppose one way of handling that is simply to say that it is an implementation restriction.... But if we want to preserve both correct semantics and no arbitrary implementation restrictions, I suppose we could make $matrix into a Maxima function, like this: (mputprop '$matrix '((lambda) ((mlist) ((mlist) $x)) ((build_matrix) $x)) 'mexpr) (defmfun build_matrix (rows) (if (not ($listp rows)) (merror "check_matrix -- internal error ~M" rows) (setq rows (cdr rows))) (dolist (row rows) (if (not ($listp row)) (merror (intl:gettext "matrix: row must be a list; found: ~M") row))) (matcheck rows) (cons '($matrix) rows)) Pretty ugly. Is there a better way? -s On Sat, Nov 19, 2011 at 17:14, Robert Dodier wrote: > On 11/11/11, Stavros Macrakis wrote: > > > Can anyone think of a reason that matrix shouldn't be simply this: > > > > (defmfun $matrix (&rest rows) > > OK, I remember now why matrix isn't an ordinary function. > GCL has a limitation of 64 arguments for a function, so attempting > to define a matrix with > 64 rows triggers an error. > That bug was noticed and a work around put in place; see commit message > below. > If there is a better way to handle the situation, while still keeping it > workable for GCL, I'd be interested to hear about it. > > best > > Robert Dodier > > PS. > commit 9bcad16b9eedcb8725197313808bc88fe1ce6b88 > Author: robert_dodier > Date: Thu Oct 12 15:18:45 2006 +0000 > > (1) Work around GCL number of arguments limitation in $matrix. > src/mlisp.lisp: change $matrix from defun to defmspec, and > evaluate arguments within $matrix. > From point of view of caller, $matrix should work same as before > (but without bug). > tests/rtest2.mac: new test cases for matrix function. > > (2) Avoid unintended upper/lower case inversion in declare(foo, > alphabetic) (in src/mlisp.lisp). > Also process all characters in a string instead of just one at a time. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sat Nov 19 17:32:10 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 19 Nov 2011 16:32:10 -0700 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> Message-ID: On 11/19/11, Stavros Macrakis wrote: > For those of us not running git, could you send out the plain text of the > new version? No problem. Here's the formatted text for the new version. I've omitted the examples since I didn't change that part. best Robert PS. -- Function: sort (,

) -- Function: sort () Sorts a list according to a predicate `P' of two arguments, such that `

([k + 1], [k])' is `false' for any two successive elements. The predicate may be specified as the name of a function or binary infix operator, or as a `lambda' expression. If specified as the name of an operator, the name is enclosed in "double quotes". The sorted list is returned as a new object; the argument is not modified. To construct the return value, `sort' makes a shallow copy of the elements of . It is assumed the predicate

is a strict total order on the elements of . If not, `sort' might run to completion without error, but the result is undefined. `sort' complains if the predicate evaluates to something other than `true' or `false'. `sort' is a stable sort: if two elements and are equivalent in the sense that `

(, )' and `

(, )' are both `false', then the relative order of and in is preserved by `sort'. `sort ()' is equivalent to `sort (, orderlessp)'. That is, the default sorting order is ascending, as determined by `orderlessp'. All Maxima atoms and expressions are comparable under `orderlessp'. The predicate `ordergreatp' sorts a list in descending order. The predicate `ordermagnitudep' sorts Maxima numbers, constant symbols with a numerical value, or expressions which can be evaluated to a constant by magnitude. All other elements of the list are sorted by `orderlessp'. The predicate `"<"' allows the ordering by magnitude too, but does not order completely if elements in the list are not comparable under `"<"'. From woollett at charter.net Sat Nov 19 18:07:30 2011 From: woollett at charter.net (Edwin Woollett) Date: Sat, 19 Nov 2011 16:07:30 -0800 Subject: [Maxima] detect sqrt in expression? Message-ID: <5D26B49DE4B24569B05681C97E4C87BB@edwinc367e16bd> On Nov. 17, Stavros Macrakis wrote: ----------------- >Really? It seems pretty straightforward to me, something like > >hasmultival(ex,var) := if mapatom(ex) then false > >else if member(inop(ex), '[log, asin, acos, asinh, etc. etc.] ) and >member(var,listofvars(ex)) then true > >else if inop(ex) = "^" and ... > >else ...recursive case... ---------------------------------- Thanks for the suggested framework. So far, the code seems to be meeting my goal, but bugs will probably show up when I make it part of nint. ---------------------------------------------- (%i1) load(hasmultv); (%o1) "c:/work2/hasmultv.mac" (%i2) multival(a,x); (%o2) false (%i3) multival(sqrt(x),x); (%o3) true (%i4) multival(x*sqrt(x),x); (%o4) true (%i5) multival(x*sqrt(x^2),x); (%o5) false (%i6) multival(a^x,x); (%o6) false (%i7) multival(a^(%i*x),x); (%o7) false (%i8) multival(a^(2/3),x); (%o8) false (%i9) multival(x^(2/3),x); (%o9) true (%i10) multival(x^x,x); (%o10) false (%i11) multival(x^(%i*x),x); (%o11) true (%i12) multival(x^(%i*sin(x)),x); (%o12) true (%i13) multival(log(x),x); (%o13) true (%i14) multival(sqrt(x)*log(x),x); (%o14) true (%i15) multival(acos(x),x); (%o15) true (%i16) multival(x^acos(x),x); (%o16) true ------------------------------------- with the code: any_of(list) := member(true,list)$ /* multival(e,x) returns true if a potentially multiple valued function of x is detected in expression e */ multival(ex,var) := block([inflag:true,listconstvars:true], if mapatom(ex) then false else if member(op(ex), '[log, acos,acosh,acot,acoth,acsc,acsch, asec,asech,asin,asinh,atan,atan2,atanh] ) and member(var,listofvars(ex)) then true else if op(ex) = "^" and mvp(ex,var) then true else any_of(maplist(lambda ([u],multival(u,var)),ex)))$ /* complexvar(ee,vv) returns true if ee contains both variable vv and %i */ complexvar(ee,vv) := block([listconstvars:true], if mapatom(ee) then false else if member (vv,listofvars(ee)) and member(%i,listofvars(ee)) then true else any_of(maplist(lambda ([u],complexvar(u,vv)),ee)))$ /* mvp(e,v) returns true if e = f^g has either the form f(x)^g(x,%i) or f(x)^(p/q) */ mvp (e,v) := block([inflag:true], /* disp("mvp"), display (e,v), */ if mapatom(e) then false else if length(e) = 1 then false else if atom(part(e,2)) then false else if member(v,listofvars(part(e,1))) and op(part(e,2)) = "/" then true else if member(v,listofvars(part(e,1))) and complexvar(part(e,2),v) then true else any_of(maplist(lambda ([u],mvp(u,v)),e)))$ ----------------------------------- Ted From O.Kullmann at swansea.ac.uk Sat Nov 19 18:12:24 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 20 Nov 2011 00:12:24 +0000 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> Message-ID: <20111120001224.GE4936@cs-wsok.swan.ac.uk> Hi Robert, I have a few problems with the formulations: > > -- Function: sort (,

) > -- Function: sort () > Sorts a list according to a predicate `P' of two arguments, > such that `

([k + 1], [k])' is `false' for any two > successive elements. The predicate may be specified as the name > of a function or binary infix operator, or as a `lambda' > expression. If specified as the name of an operator, the name is > enclosed in "double quotes". > I do not understand the last sentence: I guess it should be "the name must be enclosed in "double quotes"." > The sorted list is returned as a new object; the argument is > not modified. To construct the return value, `sort' makes a > shallow copy of the elements of . > > It is assumed the predicate

is a strict total order on the > elements of . If not, `sort' might run to completion without > error, but the result is undefined. `sort' complains if the > predicate evaluates to something other than `true' or `false'. > > `sort' is a stable sort: if two elements and are > equivalent in the sense that `

(, )' and `

(, )' > are both `false', then the relative order of and in is > preserved by `sort'. > > `sort ()' is equivalent to `sort (, orderlessp)'. That is, > the default sorting order is ascending, as determined by > `orderlessp'. All Maxima atoms and expressions are comparable > under `orderlessp'. > > The predicate `ordergreatp' sorts a list in descending order. The > predicate `ordermagnitudep' sorts Maxima numbers, constant symbols > with a numerical value, or expressions which can be evaluated to a > constant by magnitude. What is the difference between ordergreatp and ordermagnitudep ? Actually, one should ask what is the difference between orderlessp and ordermagnitudep; is the former more general? What is the recommendation? In general I think that such a list of sentences, when not actually shown that we have a list of independent sentences, is rather misleading. There seems to be some prejudice against the use of real lists (with some form of enumeration or bullets), for example it seems at Wikipedia the opinion is that paragraphs are to be preferred --- I think exactly the opposite is true: lists, enumerations etc. are great, paragraphs are bad (if there is not really a strong connection between the sentences, and often in technical writing there is actually not much connection between the sentences). > All other elements of the list are > sorted by `orderlessp'. To what does "All other elements" refer to? There are two sentences in the paragraph before this statement, but I can't see how "All other elements" refer to them. And I can't see what these "other elements" are. > The predicate `"<"' allows the ordering > by magnitude too, but does not order completely if elements in the > list are not comparable under `"<"'. Shouldn't one say "but is not applicable if ..."? "does not order completely" sounds "kind of okayish". Oliver From macrakis at alum.mit.edu Sat Nov 19 18:46:26 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 19 Nov 2011 19:46:26 -0500 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> Message-ID: On Sat, Nov 19, 2011 at 18:32, Robert Dodier wrote: Comments in line: > -- Function: sort (,

) > > Sorts a list according to a predicate `P' of two arguments, > such that `

([k + 1], [k])' is `false' for any two > successive elements. > I'm afraid this definition is incorrect. After all, L= [1,1] is sorted according to "<=", but P(L[2],L[1]) is true. And what is the purpose of saying "any two successive elements" when we already have L[k+1] and L[k]? Also, "L" is being used in the same sentence to mean two very different things: the input list and the output list. All in all, very confusing. Why not something simpler like: Sorts a list using an ordering function P of two arguments, which defines a "less than or equals" relation. More precisely, if P(a,b) and P(b,a) are both true, then the order of a and b remains the same as in the input ("stable sort"). Otherwise, a comes before b if P(a,b). (This also makes the discussion of stable sort below unnecessary.) The predicate may be specified as the name > of a function or binary infix operator, or as a `lambda' > expression. If specified as the name of an operator, the name is > enclosed in "double quotes". > Adding an example might help: e.g. "<". > The sorted list is returned as a new object; the argument is > not modified. To construct the return value, `sort' makes a > shallow copy of the elements of . > The doc should mention that it is a shallow copy -- this is pervasive in Maxima; cf. cons, append, matrix, [], etc. etc. Anyway, the vast majority of readers won't know what "shallow copy" means. It is assumed the predicate

is a strict total order on the > elements of . No, it is assumed that P is total, but not strict -- i.e. it is like <=, not <. (Otherwise we wouldn't have to specify stability.) > If not, `sort' might run to completion without > error, but the result is undefined. `sort' complains if the > predicate evaluates to something other than `true' or `false'. > Instead of "complains", how about "gives an error"? "Complains" could mean "prints a warning". > `sort' is a stable sort: if two elements and are > equivalent in the sense that `

(, )' and `

(, )' > are both `false', then the relative order of and in is > preserved by `sort'. > No, this is incorrect. If P(x,y) and P(y,x) are both false, then P is not a total order (strict or otherwise), and all bets are off. > `sort ()' is equivalent to `sort (, orderlessp)'. That is, > the default sorting order is ascending, as determined by > `orderlessp'. All Maxima atoms and expressions are comparable > under `orderlessp'. > > The predicate `ordergreatp' sorts a list in descending order. The > predicate `ordermagnitudep' sorts Maxima numbers, constant symbols > with a numerical value, or expressions which can be evaluated to a > constant by magnitude. All other elements of the list are > sorted by `orderlessp'. The predicate `"<"' allows the ordering > by magnitude too, but does not order completely if elements in the > list are not comparable under `"<"'. > This is misleading -- it implies that "<" uses the same kind of "magnitude" as "ordermagnitudep". But it also takes into account the "assume" database, which ordermagnitudep does not (why not? yes, it is more expensive if there are non-constants in the list, but simplifies the semantics). It is also incorrect: it does not "not order completely" if they are not comparable, it gives an error: sort([a,b,c],"<") => Unable to evaluate predicate Hope this helps. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: From O.Kullmann at swansea.ac.uk Sat Nov 19 19:18:33 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 20 Nov 2011 01:18:33 +0000 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> Message-ID: <20111120011833.GF4936@cs-wsok.swan.ac.uk> On Sat, Nov 19, 2011 at 07:46:26PM -0500, Stavros Macrakis wrote: > On Sat, Nov 19, 2011 at 18:32, Robert Dodier wrote: > > Comments in line: > ? > > ?-- Function: sort (,

) > > ? ? Sorts a list according to a predicate `P' of two arguments, > ? ? such that `

([k + 1], [k])' is `false' for any two > ? ? successive elements. > > > I'm afraid this definition is incorrect. ?After all,?L= [1,1] is sorted > according to "<=", but P(L[2],L[1]) is true. ?And what is the purpose of saying > "any two successive elements" when we already have L[k+1] and L[k]?? Also, "L" > is being used in the same sentence to mean two very different things: the input > list and the output list. ?All in all, very confusing. ?Why not something > simpler like: > No, the definition is correct: "<=" can not be used by "sort", but yields undefined behaviour. How to construct a good example, to demonstrate this? The best I'm aware of at the moment is to show that different Lisp's yield different results: cmp(x,y):=is(first(x) <= first(y)); sort([[1,1],[1,2]],cmp); Ecl yields [[1,1],[1,2]] Sbcl yields [[1,2],[1,1]] However with the correct definition cmp(x,y) := is(first(x) < first(y)); both yield [[1,1],[1,2]] > ? ? Sorts a list using an ordering function P of two arguments, which > defines a "less than or equals" relation. ?More precisely, if P(a,b) and P(b,a) > are both true, then the order of a and b remains the same as in the input > ("stable sort"). ?Otherwise, a comes before b if P(a,b). > If both P(a,b) and P(b,a) are true, then we have undefined behaviour. ? > (This also makes the discussion of stable sort below unnecessary.) > > > ?The predicate may be specified as the name > ? ? of a function or binary infix operator, or as a `lambda' > ? ? expression. ?If specified as the name of an operator, the name is > ? ? enclosed in "double quotes". > > > Adding an example might help: e.g. "<".? > Whatever you do, one can not have "<=" and "<" at the same time. ? > > ? ? It is assumed the predicate

is a strict total order on the > ? ? elements of . > > > No, it is assumed that P is total, but not strict -- i.e. it is like <=, not <. > ?(Otherwise we wouldn't have to specify stability.) > Yes, it is strict. Sorting always considers strict orders. For strict orders equivalence x~y is defined as not(x > ?If not, `sort' might run to completion without > ? ? error, but the result is undefined. ?`sort' complains if the > ? ? predicate evaluates to something other than `true' or `false'. > > ? > Instead of "complains", how about "gives an error"? ?"Complains" could mean > "prints a warning". > ? > > ? ? `sort' is a stable sort: if two elements and are > ? ? equivalent in the sense that `

(, )' and `

(, )' > ? ? are both `false', then the relative order of and in is > ? ? preserved by `sort'. > > > No, this is incorrect. ?If P(x,y) and P(y,x) are both false, then P is not a > total order (strict or otherwise), and all bets are off. > This is called a "strict weak order", and is fully sufficient for all sorting purposes. If your statement above would be true, then sort([1,1]) would be undefined --- given that orderlessp is used! orderlessp(1,1); false? > > ? ? `sort ()' is equivalent to `sort (, orderlessp)'. ?That is, > ? ? the default sorting order is ascending, as determined by > ? ? `orderlessp'. ? ?All Maxima atoms and expressions are comparable > ? ? under `orderlessp'. > Oliver From O.Kullmann at swansea.ac.uk Sat Nov 19 19:28:11 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 20 Nov 2011 01:28:11 +0000 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: <20111120011833.GF4936@cs-wsok.swan.ac.uk> References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <20111120011833.GF4936@cs-wsok.swan.ac.uk> Message-ID: <20111120012811.GA27308@cs-wsok.swan.ac.uk> At http://www.lispworks.com/documentation/HyperSpec/Body/f_sort_.htm it says Predicate should return true if and only if the first argument is strictly less than the second (in some appropriate sense). (It's sloppy in the sense that "appropriate sense" it not defined.) Also http://www.gnu.org/software/emacs/manual/html_node/cl/Sorting-Sequences.html says . predicate should return true (non-nil) if and only if its first argument is less than (not equal to) its second argument. You can also look into Knuth's "The Art of Computer Programming". Most precisely it's in the C++ standard. Basing sorting on strict weak ordering (see http://en.wikipedia.org/wiki/Strict_weak_order) is also done at http://en.wikipedia.org/wiki/Sorting Oliver On Sun, Nov 20, 2011 at 01:18:33AM +0000, Oliver Kullmann wrote: > On Sat, Nov 19, 2011 at 07:46:26PM -0500, Stavros Macrakis wrote: > > On Sat, Nov 19, 2011 at 18:32, Robert Dodier wrote: > > > > Comments in line: > > ? > > > > ?-- Function: sort (,

) > > > > ? ? Sorts a list according to a predicate `P' of two arguments, > > ? ? such that `

([k + 1], [k])' is `false' for any two > > ? ? successive elements. > > > > > > I'm afraid this definition is incorrect. ?After all,?L= [1,1] is sorted > > according to "<=", but P(L[2],L[1]) is true. ?And what is the purpose of saying > > "any two successive elements" when we already have L[k+1] and L[k]?? Also, "L" > > is being used in the same sentence to mean two very different things: the input > > list and the output list. ?All in all, very confusing. ?Why not something > > simpler like: > > > > No, the definition is correct: "<=" can not be used by "sort", but yields > undefined behaviour. > > How to construct a good example, to demonstrate this? > The best I'm aware of at the moment is to show that different Lisp's > yield different results: > > cmp(x,y):=is(first(x) <= first(y)); > sort([[1,1],[1,2]],cmp); > > Ecl yields > [[1,1],[1,2]] > Sbcl yields > [[1,2],[1,1]] > > However with the correct definition > cmp(x,y) := is(first(x) < first(y)); > both yield > [[1,1],[1,2]] > > > ? ? Sorts a list using an ordering function P of two arguments, which > > defines a "less than or equals" relation. ?More precisely, if P(a,b) and P(b,a) > > are both true, then the order of a and b remains the same as in the input > > ("stable sort"). ?Otherwise, a comes before b if P(a,b). > > > > If both P(a,b) and P(b,a) are true, then we have undefined behaviour. > ? > > (This also makes the discussion of stable sort below unnecessary.) > > > > > > ?The predicate may be specified as the name > > ? ? of a function or binary infix operator, or as a `lambda' > > ? ? expression. ?If specified as the name of an operator, the name is > > ? ? enclosed in "double quotes". > > > > > > Adding an example might help: e.g. "<".? > > > > Whatever you do, one can not have "<=" and "<" at the same time. > ? > > > > ? ? It is assumed the predicate

is a strict total order on the > > ? ? elements of . > > > > > > No, it is assumed that P is total, but not strict -- i.e. it is like <=, not <. > > ?(Otherwise we wouldn't have to specify stability.) > > > > Yes, it is strict. Sorting always considers strict orders. For strict orders > equivalence x~y is defined as not(x equivalent elements. > > > > > ?If not, `sort' might run to completion without > > ? ? error, but the result is undefined. ?`sort' complains if the > > ? ? predicate evaluates to something other than `true' or `false'. > > > > ? > > Instead of "complains", how about "gives an error"? ?"Complains" could mean > > "prints a warning". > > ? > > > > ? ? `sort' is a stable sort: if two elements and are > > ? ? equivalent in the sense that `

(, )' and `

(, )' > > ? ? are both `false', then the relative order of and in is > > ? ? preserved by `sort'. > > > > > > No, this is incorrect. ?If P(x,y) and P(y,x) are both false, then P is not a > > total order (strict or otherwise), and all bets are off. > > > > This is called a "strict weak order", and is fully sufficient for all > sorting purposes. > > If your statement above would be true, then sort([1,1]) would be undefined --- > given that orderlessp is used! > > orderlessp(1,1); > false? > > > > > ? ? `sort ()' is equivalent to `sort (, orderlessp)'. ?That is, > > ? ? the default sorting order is ascending, as determined by > > ? ? `orderlessp'. ? ?All Maxima atoms and expressions are comparable > > ? ? under `orderlessp'. > > > > Oliver -- 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 macrakis at alum.mit.edu Sat Nov 19 20:46:47 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 19 Nov 2011 21:46:47 -0500 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: <20111120012811.GA27308@cs-wsok.swan.ac.uk> References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <20111120011833.GF4936@cs-wsok.swan.ac.uk> <20111120012811.GA27308@cs-wsok.swan.ac.uk> Message-ID: Argh! Sorry for jumping so quickly to (incorrect) conclusions. I don't know why, but I assumed that "<=" was an acceptable predicate for 'sort'. My other errors follow from that. Let me propose wording that reflects your corrections: -- Function: sort (,

) -- Function: sort () Sorts a list using a predicate function

of two arguments which defines a strict total order. If

(a,b) is true, then a will appear before b in the result. If neither

(a,b) nor

(b,a) is true, then a and b are equivalent, and will appear in the same order as in the input (that is, 'sort' is a stable sort). If both P(a,b) and P(b,a) can be true, then P is not a valid sort predicate, and the result is undefined, though 'sort' may not signal an error. If P(a,b) is not true or false for some a and b, sort signals an error. The predicate function may be specified as the name of a function (e.g. 'orderlessp), a quoted binary infix operator (e.g. "<"), or as a `lambda' expression (e.g. lambda([a,b],a[1] is not modified. ---------------------------------- On Sat, Nov 19, 2011 at 20:28, Oliver Kullmann wrote: > At > > http://www.lispworks.com/documentation/HyperSpec/Body/f_sort_.htm > > it says > > Predicate should return true if and only if the first argument is strictly > less than the second (in some appropriate sense). > > (It's sloppy in the sense that "appropriate sense" it not defined.) > > Also > > > http://www.gnu.org/software/emacs/manual/html_node/cl/Sorting-Sequences.html > > says > > . predicate should return true (non-nil) if and only if its first argument > is less than (not equal to) its second argument. > > You can also look into Knuth's "The Art of Computer Programming". > Most precisely it's in the C++ standard. > > Basing sorting on strict weak ordering (see > http://en.wikipedia.org/wiki/Strict_weak_order) > is also done at > http://en.wikipedia.org/wiki/Sorting > > Oliver > > On Sun, Nov 20, 2011 at 01:18:33AM +0000, Oliver Kullmann wrote: > > On Sat, Nov 19, 2011 at 07:46:26PM -0500, Stavros Macrakis wrote: > > > On Sat, Nov 19, 2011 at 18:32, Robert Dodier > wrote: > > > > > > Comments in line: > > > > > > > > > -- Function: sort (,

) > > > > > > Sorts a list according to a predicate `P' of two arguments, > > > such that `

([k + 1], [k])' is `false' for any two > > > successive elements. > > > > > > > > > I'm afraid this definition is incorrect. After all, L= [1,1] is sorted > > > according to "<=", but P(L[2],L[1]) is true. And what is the purpose > of saying > > > "any two successive elements" when we already have L[k+1] and L[k]? > Also, "L" > > > is being used in the same sentence to mean two very different things: > the input > > > list and the output list. All in all, very confusing. Why not > something > > > simpler like: > > > > > > > No, the definition is correct: "<=" can not be used by "sort", but yields > > undefined behaviour. > > > > How to construct a good example, to demonstrate this? > > The best I'm aware of at the moment is to show that different Lisp's > > yield different results: > > > > cmp(x,y):=is(first(x) <= first(y)); > > sort([[1,1],[1,2]],cmp); > > > > Ecl yields > > [[1,1],[1,2]] > > Sbcl yields > > [[1,2],[1,1]] > > > > However with the correct definition > > cmp(x,y) := is(first(x) < first(y)); > > both yield > > [[1,1],[1,2]] > > > > > Sorts a list using an ordering function P of two arguments, > which > > > defines a "less than or equals" relation. More precisely, if P(a,b) > and P(b,a) > > > are both true, then the order of a and b remains the same as in the > input > > > ("stable sort"). Otherwise, a comes before b if P(a,b). > > > > > > > If both P(a,b) and P(b,a) are true, then we have undefined behaviour. > > > > > (This also makes the discussion of stable sort below unnecessary.) > > > > > > > > > The predicate may be specified as the name > > > of a function or binary infix operator, or as a `lambda' > > > expression. If specified as the name of an operator, the name > is > > > enclosed in "double quotes". > > > > > > > > > Adding an example might help: e.g. "<". > > > > > > > Whatever you do, one can not have "<=" and "<" at the same time. > > > > > > > > It is assumed the predicate

is a strict total order on the > > > elements of . > > > > > > > > > No, it is assumed that P is total, but not strict -- i.e. it is like > <=, not <. > > > (Otherwise we wouldn't have to specify stability.) > > > > > > > Yes, it is strict. Sorting always considers strict orders. For strict > orders > > equivalence x~y is defined as not(x > equivalent elements. > > > > > > > > If not, `sort' might run to completion without > > > error, but the result is undefined. `sort' complains if the > > > predicate evaluates to something other than `true' or `false'. > > > > > > > > > Instead of "complains", how about "gives an error"? "Complains" could > mean > > > "prints a warning". > > > > > > > > > `sort' is a stable sort: if two elements and are > > > equivalent in the sense that `

(, )' and `

(, > )' > > > are both `false', then the relative order of and in > is > > > preserved by `sort'. > > > > > > > > > No, this is incorrect. If P(x,y) and P(y,x) are both false, then P is > not a > > > total order (strict or otherwise), and all bets are off. > > > > > > > This is called a "strict weak order", and is fully sufficient for all > > sorting purposes. > > > > If your statement above would be true, then sort([1,1]) would be > undefined --- > > given that orderlessp is used! > > > > orderlessp(1,1); > > false > > > > > > > > `sort ()' is equivalent to `sort (, orderlessp)'. That > is, > > > the default sorting order is ascending, as determined by > > > `orderlessp'. All Maxima atoms and expressions are > comparable > > > under `orderlessp'. > > > > > > > Oliver > > -- > 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/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sat Nov 19 21:03:23 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 19 Nov 2011 22:03:23 -0500 Subject: [Maxima] detect sqrt in expression? In-Reply-To: <5D26B49DE4B24569B05681C97E4C87BB@edwinc367e16bd> References: <5D26B49DE4B24569B05681C97E4C87BB@edwinc367e16bd> Message-ID: Looks good! Here are some test cases you may find interesting -- I'm not sure what your intended behavior is in these cases: multival(x^(1/2+a),x) => false multival(x^(a/2),x) => false (what if a=1?) multival(x^a,x) => false (what if a=1/2?) multival((-1)^(1/3),x), domain:'complex => false multival(x^%i,x) => false Up to you.... -s On Sat, Nov 19, 2011 at 19:07, Edwin Woollett wrote: > On Nov. 17, Stavros Macrakis wrote: > ----------------- > > Really? It seems pretty straightforward to me, something like >> >> hasmultival(ex,var) := if mapatom(ex) then false >> >> else if member(inop(ex), '[log, asin, acos, asinh, etc. etc.] ) and >> member(var,listofvars(ex)) then true >> >> else if inop(ex) = "^" and ... >> >> else ...recursive case... >> > ------------------------------**---- > Thanks for the suggested framework. > So far, the code seems to be meeting my > goal, but bugs will probably show up > when I make it part of nint. > > ------------------------------**---------------- > (%i1) load(hasmultv); > > (%o1) "c:/work2/hasmultv.mac" > (%i2) multival(a,x); > > (%o2) false > (%i3) multival(sqrt(x),x); > > (%o3) true > (%i4) multival(x*sqrt(x),x); > > (%o4) true > (%i5) multival(x*sqrt(x^2),x); > > (%o5) false > (%i6) multival(a^x,x); > > (%o6) false > (%i7) multival(a^(%i*x),x); > > (%o7) false > (%i8) multival(a^(2/3),x); > > (%o8) false > (%i9) multival(x^(2/3),x); > > (%o9) true > (%i10) multival(x^x,x); > > (%o10) false > (%i11) multival(x^(%i*x),x); > > (%o11) true > (%i12) multival(x^(%i*sin(x)),x); > > (%o12) true > (%i13) multival(log(x),x); > > (%o13) true > > (%i14) multival(sqrt(x)*log(x),x); > > (%o14) true > (%i15) multival(acos(x),x); > > (%o15) true > (%i16) multival(x^acos(x),x); > > (%o16) true > ------------------------------**------- > with the code: > > any_of(list) := member(true,list)$ > > /* multival(e,x) returns true if a potentially multiple valued > function of x is detected in expression e */ > > > multival(ex,var) := block([inflag:true,**listconstvars:true], > > if mapatom(ex) then false > > else if member(op(ex), '[log, acos,acosh,acot,acoth,acsc,**acsch, > asec,asech,asin,asinh,atan,**atan2,atanh] ) and > member(var,listofvars(ex)) then true > > else if op(ex) = "^" and mvp(ex,var) then true > > else any_of(maplist(lambda ([u],multival(u,var)),ex)))$ > > > > /* complexvar(ee,vv) returns true if > ee contains both variable vv and %i */ > > > complexvar(ee,vv) := block([listconstvars:true], > > if mapatom(ee) then false > > else if member (vv,listofvars(ee)) and member(%i,listofvars(ee)) > then true > > else any_of(maplist(lambda ([u],complexvar(u,vv)),ee)))$ > > > > /* mvp(e,v) returns true if e = f^g has either the > form f(x)^g(x,%i) or f(x)^(p/q) */ > > mvp (e,v) := block([inflag:true], > > /* disp("mvp"), > display (e,v), > */ > > if mapatom(e) then false > > else if length(e) = 1 then false > > else if atom(part(e,2)) then false > > else if member(v,listofvars(part(e,1))**) and > op(part(e,2)) = "/" then true > > else if member(v,listofvars(part(e,1))**) and > complexvar(part(e,2),v) then true > > > else any_of(maplist(lambda ([u],mvp(u,v)),e)))$ > > ------------------------------**----- > Ted > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From smh at franz.com Sat Nov 19 21:37:29 2011 From: smh at franz.com (Steve Haflich) Date: Sat, 19 Nov 2011 19:37:29 -0800 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <20111120011833.GF4936@cs-wsok.swan.ac.uk> <20111120012811.GA27308@cs-wsok.swan.ac.uk> Message-ID: <27729.1321760249@gemini.franz.com> Stavros Macrakis wrote: If P(a,b) is not true or false for some a and b, sort signals an error. >From where do you infer this behavior? It is _not_ something about cl:stable-sort guaranteed by the ANS (assuming the Maxima call to sort has not been rewitten to wrap the predicate to test for this). On the other hand, in ANSI CL there are no possible objects which are neither "true" nor "false", in the sense of "generalized boolean" which is what the sort predicate is required to return. Therefore the provision would be meaningless. On Sat, Nov 19, 2011 at 20:28, Oliver Kullmann wrote: Predicate should return true if and only if the first argument is strictly less than the second (in some appropriate sense). (It's sloppy in the sense that "appropriate sense" it not defined.) "Appropriate sense" here means that sort predicate determines the desired ordering. That sense is opaque to and of no concern to sort itself. From toy.raymond at gmail.com Sat Nov 19 21:47:34 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 19 Nov 2011 19:47:34 -0800 Subject: [Maxima] detect sqrt in expression? In-Reply-To: <5D26B49DE4B24569B05681C97E4C87BB@edwinc367e16bd> References: <5D26B49DE4B24569B05681C97E4C87BB@edwinc367e16bd> Message-ID: <4EC87856.9020803@gmail.com> On 11/19/11 4:07 PM, Edwin Woollett wrote: If multival really means multi-valued function, then aren't all of the following wrong? Shouldn't they return true because they are multivalued? > (%i5) multival(x*sqrt(x^2),x); > > (%o5) false > (%i6) multival(a^x,x); > > (%o6) false > (%i7) multival(a^(%i*x),x); > > (%o7) false > > (%i10) multival(x^x,x); > > (%o10) false Ray From O.Kullmann at swansea.ac.uk Sun Nov 20 03:23:35 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 20 Nov 2011 09:23:35 +0000 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <20111120011833.GF4936@cs-wsok.swan.ac.uk> <20111120012811.GA27308@cs-wsok.swan.ac.uk> Message-ID: <20111120092334.GA4157@cs-wsok.swan.ac.uk> On Sat, Nov 19, 2011 at 09:46:47PM -0500, Stavros Macrakis wrote: > Argh! ?Sorry for jumping so quickly to (incorrect) conclusions. > > I don't know why, but I assumed that "<=" was an acceptable predicate for > 'sort'. The current documentation suggests in the first part that <= is to be used. (So in some early parts of our library we used "<="; upon reflection I decided that it must be "<", which we used that from then on, and I created a todo for this inconsistency in the Maxima-documentation, which wasn't acted upon until finally when using also Sbcl we got errors.) > > Let me propose wording that reflects your corrections: > > ?-- Function: sort (,

) > ?-- Function: sort () > > Sorts a list using a predicate function

of two arguments which defines > a strict total order. ?If

(a,b) is true, then a will appear before b in the > result. ?If neither

(a,b) nor

(b,a) is true, then a and b are equivalent, > and will appear in the same order as in the input (that is, 'sort' is a stable > sort). > > If both P(a,b) and P(b,a) can be true, then P is not a valid sort predicate, > and the result is undefined, though 'sort' may not signal an error. ?If P(a,b) > is not true or false for some a and b, sort signals an error. > As Steve already pointed out, that P(a,b) must be true or false is a prerequisite, and without it the computation is undefined, but we can not make guarantees about the occurrence of an error. Typically for specifications of programs one uses only positive conditions, what happens for sure if the prerequisites are met. It is rare, and typically best to be avoided, to make guarantees in case the prerequisites are not fulfilled. For example in our case, if we define cmp(x,y) := if x=1 and y=3 then 7 else true; then sort([1,2,3],cmp); at least under Ecl works, i.e., returns the correct result. (While cmp(x,y):=7 will result in "Unable to evaluate predicate 7".) So, at least if the documentation should be easy-going, I would just specific what must hold, and not what will happen in the negative case. If Maxima would be used to steer my nuclear power station or your airplane, then one needed also to state something about the negative case: "undefined behaviour" (the computer might melt down when a bad P is provided (sending out first tons of spam)), or, on the other end, a false result might be returned but otherwise it is guaranteed that the system is still perfectly working. It is hardly possible to make the second guarantee (P might have side effects). And given the nature of Maxima, and that it happens not to steer my nuclear power station, I propose just to say something about the prerequisites. That is actually a bit problematic. I would prefer to use "strict weak ordering". That would be found when making an Internet search. For "strict total order" we get http://en.wikipedia.org/wiki/Total_order, and there it says (which I think correctly reflects usage in mathematics and computer science), that a strict total order involves the use of "=". However we do not need "=" for sorting --- the point of "strict weak ordering" is to avoid to have "=" as a prerequisite (that is, actually *two* predicates would be involved), but to derive equivalence between objects implicitly. And actually it would be good to give early an example of "<" (perhaps simply stating "< can be used, but not <="). So my favourite paragraph for the conditions on P would be (something like that): --- P should fulfil the conditions of a strict weak ordering (so "<" may be used, but not "<="). --- Then the above two paragraphs could be replaced by the following single paragraph: --- Sorts a list using a predicate function

of two arguments which defines a "strict weak ordering" (so "<" may be used, but not "<="). If

(a,b) is true, then a will appear before b in the result. ?If neither

(a,b) nor

(b,a) is true, then a and b are equivalent, and will appear in the same order as in the input (that is, 'sort' is a stable sort). --- On the one hand, we now give some precise information (that on "strict weak ordering", which can be found easily on the Internet, and is through the history of computation strongly associated with sorting). And on the other hand, that little piece of information the user perhaps just wants, namely "Just tell me, < or <= ?!?", occurs early enough. (I think documentation should give quick answers to common use-cases. There should be no need to derive something.) Finally, if I understand Steve correctly, then he suggests not to make such assumptions on P, which might be unnecessarily strong, but just to follow the Lisp-spirit --- use whatever P you wish, if it happens to establish an order. A main problem is that this depends on the sorting algorithm used. I would strongly prefer to give an explicit definition (so create a little world of meaning, so to speak). The user might still correctly infer that for example P(a,b) is only involved on elements found in the list to be sorted ... > The predicate function may be specified as the name?of a function (e.g. > 'orderlessp), a quoted binary infix operator (e.g. "<"), or as a > `lambda'?expression (e.g. lambda([a,b],a[1] But the fact, that orderlessp is the default in case P is not given, should be mentioned. > The sorted list is returned as a new object; the argument is?not modified. > Oliver From O.Kullmann at swansea.ac.uk Sun Nov 20 03:31:24 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 20 Nov 2011 09:31:24 +0000 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: <27729.1321760249@gemini.franz.com> References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <20111120011833.GF4936@cs-wsok.swan.ac.uk> <20111120012811.GA27308@cs-wsok.swan.ac.uk> <27729.1321760249@gemini.franz.com> Message-ID: <20111120093124.GB4157@cs-wsok.swan.ac.uk> On Sat, Nov 19, 2011 at 07:37:29PM -0800, Steve Haflich wrote: > Stavros Macrakis wrote: > > If P(a,b) is not true or false for some a and b, sort signals an error. > > >From where do you infer this behavior? It is _not_ something about > cl:stable-sort guaranteed by the ANS (assuming the Maxima call to sort > has not been rewitten to wrap the predicate to test for this). > > On the other hand, in ANSI CL there are no possible objects which are > neither "true" nor "false", in the sense of "generalized boolean" which > is what the sort predicate is required to return. Therefore the > provision would be meaningless. > If I understand you correctly, then everything would be implicitly converted by ANSI CL into a boolean, however we get (%i1) sort([1,2],lambda([x,y],7)); Unable to evaluate predicate 7 So it seems sensible to me to require that the predicate must always return "true" or "false". However, as stated in my other e-mail, I agree with not to specify what happens if the predicate is not "good". > On Sat, Nov 19, 2011 at 20:28, Oliver Kullmann wrote: > > Predicate should return true if and only if the first argument is > strictly less than the second (in some appropriate sense). > > (It's sloppy in the sense that "appropriate sense" it not defined.) > > "Appropriate sense" here means that sort predicate determines the > desired ordering. "determines" in what sense? > That sense is opaque to and of no concern to sort > itself. As I interprete it in my other e-mail (to Stavros), that would say "use anything which happens to work with the algorithm", and that would depend on the implementation of sort. As I propose in my other e-mail, I think using the common understanding of sorting and its prerequisites would be best. Oliver From renegrothmann at gmail.com Sat Nov 19 06:49:25 2011 From: renegrothmann at gmail.com (Rene Grothmann) Date: Sat, 19 Nov 2011 13:49:25 +0100 Subject: [Maxima] Overwrite builtin Functions Message-ID: I am trying to get help this way. I hope the answer appears in my mailbox. I am not subscribed to the list. How can I overwrite a Maxima functions, e.g. to extend its functionality, something like hessian(f,[v]) := if length(v)=0 then hessian(f,listofvars(f)) else hessian(f,v[1]) Wouldn't that be a recursive definition? Rene Grothmann -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Sun Nov 20 07:38:55 2011 From: willisb at unk.edu (Barton Willis) Date: Sun, 20 Nov 2011 07:38:55 -0600 Subject: [Maxima] Overwrite builtin Functions In-Reply-To: References: Message-ID: > How can I overwrite a Maxima functions, e.g. to extend its functionality, something like > hessian(f,[v]) := if length(v)=0 then hessian(f,listofvars(f)) else hessian(f,v[1]) > Wouldn't that be a recursive definition? Indeed, your definition of hessian can cause an infinite loop. Your options: (1) name your function something like my_hessian; for example my_hessian(f,[v]) := if emptyp(v) then hessian(f, block([listconstantvars : false], listofvars(f))) else if emptyp(rest(v)) then hessian(f, first(v)) else error("huh?"); (2) Modify the definition of hessian (defined in share/linearalgebra/linalg-extra.lisp). Either you'll need to live with the inconsistency between your hessian and Maxima, or try to convince the Maxima developers that your definition is better. --Barton From lutz.euler at freenet.de Sun Nov 20 15:09:58 2011 From: lutz.euler at freenet.de (Lutz Euler) Date: Sun, 20 Nov 2011 22:09:58 +0100 Subject: [Maxima] "letsimp" honors "modulus" only partially? Message-ID: <20169.27814.14392.646626@localhost.localdomain> Hi, I am trying to calculate x^31 in the finite field with 125 elements, (Z/5Z)[x]/(x^3 - x - 2). I don't know the canonical way to deal with fields of this kind in Maxima, but I found "letsimp" and the variable "modulus" and that nearly works. This is Maxima 5.25.1: (%i1) display2d:false$ (%i2) let (x^3, x + 2); (%o2) ?mtext(x^3,?\ \-\-\>\ ,x+2) First, without "modulus" to show the unreduced coefficients: (%i3) letsimp (x^31); (%o3) 75020*x^2+114205*x+98642 Trying the reduction modulo 5 in one go: (%i4) letsimp (x^31), modulus:5; (%o4) 400*x^2-135*x+2 The coefficients are different but Maxima didn't notice that the first two are zero. This is no problem as I can use "ratsimp" to finish the job: (%i5) ratsimp(%), modulus:5; (%o5) 2 So, although I got my result, I would like to ask: 1. Shouldn't "letsimp" honor "modulus" either completely or not at all? Is this documented somewhere? 2. Is this the best way to work in finite fields constructed as quotient rings? Thanks in advance, Lutz From robert.dodier at gmail.com Sun Nov 20 15:25:47 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 20 Nov 2011 14:25:47 -0700 Subject: [Maxima] Overwrite builtin Functions In-Reply-To: References: Message-ID: On 11/19/11, Rene Grothmann wrote: > How can I overwrite a Maxima functions, e.g. to extend its functionality, > something like > > hessian(f,[v]) := if length(v)=0 then hessian(f,listofvars(f)) else > hessian(f,v[1]) Well, you can try this. The share package "namespaces" is an experimental package which exposes the Lisp package machinery. (A Lisp package is what's called a namespace in other languages.) load (namespaces); in_namespace (foo); hessian(e, [v]) := if emptyp (v) then maxima|hessian (e, listofvars (e)) else maxima|hessian (e, v); in_namespace (maxima); foo|hessian (x*y^2); => matrix([0,2*y],[2*y,2*x]) Here x|y means symbol y in namespace x. Hope this is useful in some way. Robert Dodier From O.Kullmann at swansea.ac.uk Sun Nov 20 15:29:03 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 20 Nov 2011 21:29:03 +0000 Subject: [Maxima] "letsimp" honors "modulus" only partially? In-Reply-To: <20169.27814.14392.646626@localhost.localdomain> References: <20169.27814.14392.646626@localhost.localdomain> Message-ID: <20111120212903.GB13862@cs-wsok.swan.ac.uk> Hi, there is the package "gf" which would do all of this --- unfortunately it is broken, and only some of the functions work. The package-functions are also very slow. To work with finite fields in the context of AES (Rijndael), we found it finally much easier (and computationally much faster) to develop our own simple system: See the Internet mirror http://cs.swan.ac.uk/~csoliver/ok-sat-library/internet_html/doc/doxygen_html/de/ddc/ByteField_8mac_source.html for the basic functions regarding "the" finite field with 256 elements. We do not use "let" or something like that, but explicit representations and explicit computations. Oliver P.S. The code of the above module is not stand-alone but includes other modules as stated by the include-commands. But they are only simple tools, and they are all available via the Internet mirror. You can also get the OKlibrary http://www.ok-sat-library.org/ which installs everything for you (on a Linux system), Maxima, gcc, SAT solvers, R, Sage, ..., but you should also find everything on the Internet. Or you just download it, without installing, and then you have all our Maxima-code locally. On Sun, Nov 20, 2011 at 10:09:58PM +0100, Lutz Euler wrote: > Hi, > > I am trying to calculate x^31 in the finite field with 125 elements, > (Z/5Z)[x]/(x^3 - x - 2). I don't know the canonical way to deal with > fields of this kind in Maxima, but I found "letsimp" and the variable > "modulus" and that nearly works. This is Maxima 5.25.1: > > (%i1) display2d:false$ > (%i2) let (x^3, x + 2); > (%o2) ?mtext(x^3,?\ \-\-\>\ ,x+2) > > First, without "modulus" to show the unreduced coefficients: > > (%i3) letsimp (x^31); > (%o3) 75020*x^2+114205*x+98642 > > Trying the reduction modulo 5 in one go: > > (%i4) letsimp (x^31), modulus:5; > (%o4) 400*x^2-135*x+2 > > The coefficients are different but Maxima didn't notice that the > first two are zero. This is no problem as I can use "ratsimp" to > finish the job: > > (%i5) ratsimp(%), modulus:5; > (%o5) 2 > > So, although I got my result, I would like to ask: > > 1. Shouldn't "letsimp" honor "modulus" either completely or not at all? > Is this documented somewhere? > 2. Is this the best way to work in finite fields constructed as > quotient rings? > > Thanks in advance, > > Lutz > _______________________________________________ > 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 macrakis at alum.mit.edu Sun Nov 20 15:31:23 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 20 Nov 2011 16:31:23 -0500 Subject: [Maxima] "letsimp" honors "modulus" only partially? In-Reply-To: <20169.27814.14392.646626@localhost.localdomain> References: <20169.27814.14392.646626@localhost.localdomain> Message-ID: Thanks for your note. I believe the issue here is that 'modulus' is only applied to expressions in canonical rational form (CRE) -- expressions created using 'rat'. Ans sure enough, if you use letsimp on your problem with a 'rat' argument, you get the desired result: let (x^3, x + 2)$ letsimp(rat(x^31)), modulus:5 => 2 In general, if you are working with polynomials and rational functions in expanded form, the CRE form is the best to use. -s On Sun, Nov 20, 2011 at 16:09, Lutz Euler wrote: > let (x^3, x + 2); -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Sun Nov 20 15:56:46 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 20 Nov 2011 16:56:46 -0500 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: <27729.1321760249@gemini.franz.com> References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <20111120011833.GF4936@cs-wsok.swan.ac.uk> <20111120012811.GA27308@cs-wsok.swan.ac.uk> <27729.1321760249@gemini.franz.com> Message-ID: On Sat, Nov 19, 2011 at 22:37, Steve Haflich wrote: > Stavros Macrakis wrote: > > If P(a,b) is not true or false for some a and b, sort signals an error. > > From where do you infer this behavior? It is _not_ something about > cl:stable-sort guaranteed by the ANS (assuming the Maxima call to sort > has not been rewitten to wrap the predicate to test for this). > Well, yes, Maxima sort doesn't simply call the underlying Lisp's sort. What made you think it did? > On the other hand, in ANSI CL there are no possible objects which are > neither "true" nor "false", in the sense of "generalized boolean" which > is what the sort predicate is required to return. Therefore the > provision would be meaningless. > Maxima is not an implementation of ANSI CL (or any other Lisp), and does not follow the Lisp convention that all non-NIL objects represent TRUE. > > On Sat, Nov 19, 2011 at 20:28, Oliver Kullmann > wrote: > > Predicate should return true if and only if the first argument is > strictly less than the second (in some appropriate sense). > > (It's sloppy in the sense that "appropriate sense" it not defined.) > > "Appropriate sense" here means that sort predicate determines the > desired ordering. That sense is opaque to and of no concern to sort > itself. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Sun Nov 20 16:02:50 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 20 Nov 2011 15:02:50 -0700 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: <27729.1321760249@gemini.franz.com> References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <20111120011833.GF4936@cs-wsok.swan.ac.uk> <20111120012811.GA27308@cs-wsok.swan.ac.uk> <27729.1321760249@gemini.franz.com> Message-ID: On 11/19/11, Steve Haflich wrote: > Stavros Macrakis wrote: > > If P(a,b) is not true or false for some a and b, sort signals an error. > > From where do you infer this behavior? It is _not_ something about > cl:stable-sort guaranteed by the ANS (assuming the Maxima call to sort > has not been rewitten to wrap the predicate to test for this). Maxima wraps the predicate before calling STABLE-SORT so that non-Boolean values trigger an error. > On Sat, Nov 19, 2011 at 20:28, Oliver Kullmann > wrote: > > Predicate should return true if and only if the first argument is > strictly less than the second (in some appropriate sense). > > (It's sloppy in the sense that "appropriate sense" it not defined.) > > "Appropriate sense" here means that sort predicate determines the > desired ordering. That sense is opaque to and of no concern to sort > itself. The spec could avoid the abiguity by saying that P(a, b) returns T iff b is a successor of a in the sort order. Come to think of it, the spec could avoid talking about what the predicate "should" do, and simply say that the result is the order induced by the predicate (assuming the predicate satisfies the requirements stated elsewhere, which amount to saying it's a strict weak order; thanks Oliver). FWIW Robert Dodier From macrakis at alum.mit.edu Sun Nov 20 16:20:16 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 20 Nov 2011 17:20:16 -0500 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <20111120011833.GF4936@cs-wsok.swan.ac.uk> <20111120012811.GA27308@cs-wsok.swan.ac.uk> Message-ID: Given Oliver's and Robert's comments, how about the following language: -- Function: sort (,

) > -- Function: sort () > > Sorts a list using a predicate function

of two arguments which > defines a strict weak order. Thus, "<" is a valid P, but "<=" is not. P(a,b) > must return either true or false for any choice of a and b in . If >

(a,b) is true, then a will appear before b in the result. If neither >

(a,b) nor

(b,a) is true, then a and b are equivalent, and will appear > in the same order as in the input (that is, 'sort' is a stable sort). > > If both P(a,b) and P(b,a) are true, then P is not a valid sort predicate, > and the result is undefined, though 'sort' will generally not signal an > error. > > The predicate function may be specified as the name of a function (e.g. > 'orderlessp), a quoted binary infix operator (e.g. "<"), or as a `lambda' expression > (e.g. lambda([a,b],a[1] > The sorted list is returned as a new object; the argument is not > modified. > sort() is equivalent to sort(,'orderlessp) Common predicates used with sort include: * orderlessp -- canonical ordering applicable to all Maxima objects * ordergreaterp -- the negation of orderlessp * ordermagnitudep -- orders by numerical magnitude when known; objects of unknown magnitude come at the end, in orderlessp order. Does not consult the 'assume' database. * "<" -- orders by numerical magnitude; does consult the 'assume' database. Does not allow objects of unknown magnitude. > > ---------------------------------- > > On Sat, Nov 19, 2011 at 20:28, Oliver Kullmann wrote: > >> At >> >> http://www.lispworks.com/documentation/HyperSpec/Body/f_sort_.htm >> >> it says >> >> Predicate should return true if and only if the first argument is >> strictly less than the second (in some appropriate sense). >> >> (It's sloppy in the sense that "appropriate sense" it not defined.) >> >> Also >> >> >> http://www.gnu.org/software/emacs/manual/html_node/cl/Sorting-Sequences.html >> >> says >> >> . predicate should return true (non-nil) if and only if its first >> argument is less than (not equal to) its second argument. >> >> You can also look into Knuth's "The Art of Computer Programming". >> Most precisely it's in the C++ standard. >> >> Basing sorting on strict weak ordering (see >> http://en.wikipedia.org/wiki/Strict_weak_order) >> is also done at >> http://en.wikipedia.org/wiki/Sorting >> >> Oliver >> >> On Sun, Nov 20, 2011 at 01:18:33AM +0000, Oliver Kullmann wrote: >> > On Sat, Nov 19, 2011 at 07:46:26PM -0500, Stavros Macrakis wrote: >> > > On Sat, Nov 19, 2011 at 18:32, Robert Dodier >> wrote: >> > > >> > > Comments in line: >> > > >> > > >> > > -- Function: sort (,

) >> > > >> > > Sorts a list according to a predicate `P' of two >> arguments, >> > > such that `

([k + 1], [k])' is `false' for any two >> > > successive elements. >> > > >> > > >> > > I'm afraid this definition is incorrect. After all, L= [1,1] is >> sorted >> > > according to "<=", but P(L[2],L[1]) is true. And what is the purpose >> of saying >> > > "any two successive elements" when we already have L[k+1] and L[k]? >> Also, "L" >> > > is being used in the same sentence to mean two very different things: >> the input >> > > list and the output list. All in all, very confusing. Why not >> something >> > > simpler like: >> > > >> > >> > No, the definition is correct: "<=" can not be used by "sort", but >> yields >> > undefined behaviour. >> > >> > How to construct a good example, to demonstrate this? >> > The best I'm aware of at the moment is to show that different Lisp's >> > yield different results: >> > >> > cmp(x,y):=is(first(x) <= first(y)); >> > sort([[1,1],[1,2]],cmp); >> > >> > Ecl yields >> > [[1,1],[1,2]] >> > Sbcl yields >> > [[1,2],[1,1]] >> > >> > However with the correct definition >> > cmp(x,y) := is(first(x) < first(y)); >> > both yield >> > [[1,1],[1,2]] >> > >> > > Sorts a list using an ordering function P of two arguments, >> which >> > > defines a "less than or equals" relation. More precisely, if P(a,b) >> and P(b,a) >> > > are both true, then the order of a and b remains the same as in the >> input >> > > ("stable sort"). Otherwise, a comes before b if P(a,b). >> > > >> > >> > If both P(a,b) and P(b,a) are true, then we have undefined behaviour. >> > >> > > (This also makes the discussion of stable sort below unnecessary.) >> > > >> > > >> > > The predicate may be specified as the name >> > > of a function or binary infix operator, or as a `lambda' >> > > expression. If specified as the name of an operator, the >> name is >> > > enclosed in "double quotes". >> > > >> > > >> > > Adding an example might help: e.g. "<". >> > > >> > >> > Whatever you do, one can not have "<=" and "<" at the same time. >> > >> > > >> > > It is assumed the predicate

is a strict total order on the >> > > elements of . >> > > >> > > >> > > No, it is assumed that P is total, but not strict -- i.e. it is like >> <=, not <. >> > > (Otherwise we wouldn't have to specify stability.) >> > > >> > >> > Yes, it is strict. Sorting always considers strict orders. For strict >> orders >> > equivalence x~y is defined as not(x> > equivalent elements. >> > >> > > >> > > If not, `sort' might run to completion without >> > > error, but the result is undefined. `sort' complains if the >> > > predicate evaluates to something other than `true' or `false'. >> > > >> > > >> > > Instead of "complains", how about "gives an error"? "Complains" >> could mean >> > > "prints a warning". >> > > >> > > >> > > `sort' is a stable sort: if two elements and are >> > > equivalent in the sense that `

(, )' and `

(, >> )' >> > > are both `false', then the relative order of and in >> is >> > > preserved by `sort'. >> > > >> > > >> > > No, this is incorrect. If P(x,y) and P(y,x) are both false, then P >> is not a >> > > total order (strict or otherwise), and all bets are off. >> > > >> > >> > This is called a "strict weak order", and is fully sufficient for all >> > sorting purposes. >> > >> > If your statement above would be true, then sort([1,1]) would be >> undefined --- >> > given that orderlessp is used! >> > >> > orderlessp(1,1); >> > false >> > >> > > >> > > `sort ()' is equivalent to `sort (, orderlessp)'. That >> is, >> > > the default sorting order is ascending, as determined by >> > > `orderlessp'. All Maxima atoms and expressions are >> comparable >> > > under `orderlessp'. >> > > >> > >> > Oliver >> >> -- >> 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/ >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From O.Kullmann at swansea.ac.uk Sun Nov 20 16:33:43 2011 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Sun, 20 Nov 2011 22:33:43 +0000 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <20111120011833.GF4936@cs-wsok.swan.ac.uk> <20111120012811.GA27308@cs-wsok.swan.ac.uk> Message-ID: <20111120223343.GC13862@cs-wsok.swan.ac.uk> Seems good to me, but some tiny issues: On Sun, Nov 20, 2011 at 05:20:16PM -0500, Stavros Macrakis wrote: > Given Oliver's and Robert's comments, how about the following language: > > > ?-- Function: sort (,

) > ?-- Function: sort () > I am not sure about the usage of "

(a,b)" versus "P(a,b)". I never knew what the brackets do here ... Anyway, breaking the line after P, before (a,b), should be avoided. > Sorts a list using a predicate function

of two arguments which > defines a strict weak order. ?Thus,?"<" is a valid P, but "<=" is not.??P > (a,b) must return either true or false for any choice of a and b in .?If >

(a,b) is true, then a will appear before b in the result. ?If neither >

(a,b) nor

(b,a) is true, then a and b are equivalent, and will appear > in the same order as in the input (that is, 'sort' is a stable sort). > > > If both P(a,b) and P(b,a) are true, then P is not a valid sort predicate, > and the result is undefined, though 'sort' will generally not signal an > error. ? > > The predicate function may be specified as the name?of a function (e.g. > 'orderlessp), a quoted binary infix operator (e.g. "<"), or as a > `lambda'?expression (e.g. lambda([a,b],a[1] > The sorted list is returned as a new object; the argument is?not > modified. > > > sort() is equivalent to sort(,'orderlessp) > > Common predicates used with sort include: > > * orderlessp -- canonical ordering applicable to all Maxima objects > * ordergreaterp -- the negation of orderlessp Must be * ordergreatp -- the transposed (reversed) of orderlessp (not the negation). Oliver P.S. Until now I though one had to use lambda([a,b], is(a[1] * ordermagnitudep -- orders by numerical magnitude when known; objects of > unknown magnitude come at the end, in orderlessp order. ?Does not consult the > 'assume' database. > * "<" -- orders by numerical magnitude; does consult the 'assume' database. > ?Does not allow objects of unknown magnitude.? > > > ---------------------------------- > > On Sat, Nov 19, 2011 at 20:28, Oliver Kullmann > wrote: > > At > > http://www.lispworks.com/documentation/HyperSpec/Body/f_sort_.htm > > it says > > Predicate should return true if and only if the first argument is > strictly less than the second (in some appropriate sense). > > (It's sloppy in the sense that "appropriate sense" it not defined.) > > Also > > http://www.gnu.org/software/emacs/manual/html_node/cl/ > Sorting-Sequences.html > > says > > . predicate should return true (non-nil) if and only if its first > argument is less than (not equal to) its second argument. > > You can also look into Knuth's "The Art of Computer Programming". > Most precisely it's in the C++ standard. > > Basing sorting on strict weak ordering (see http://en.wikipedia.org/ > wiki/Strict_weak_order) > is also done at > http://en.wikipedia.org/wiki/Sorting > > Oliver > > On Sun, Nov 20, 2011 at 01:18:33AM +0000, Oliver Kullmann wrote: > > On Sat, Nov 19, 2011 at 07:46:26PM -0500, Stavros Macrakis wrote: > > > On Sat, Nov 19, 2011 at 18:32, Robert Dodier < > robert.dodier at gmail.com> wrote: > > > > > > Comments in line: > > > ? > > > > > > ? ? ?-- Function: sort (,

) > > > > > > ? ? ? ? Sorts a list according to a predicate `P' of two > arguments, > > > ? ? ? ? such that `

([k + 1], [k])' is `false' for any two > > > ? ? ? ? successive elements. > > > > > > > > > I'm afraid this definition is incorrect. ?After all,?L= [1,1] is > sorted > > > according to "<=", but P(L[2],L[1]) is true. ?And what is the > purpose of saying > > > "any two successive elements" when we already have L[k+1] and L[k]? > ? Also, "L" > > > is being used in the same sentence to mean two very different > things: the input > > > list and the output list. ?All in all, very confusing. ?Why not > something > > > simpler like: > > > > > > > No, the definition is correct: "<=" can not be used by "sort", but > yields > > undefined behaviour. > > > > How to construct a good example, to demonstrate this? > > The best I'm aware of at the moment is to show that different Lisp's > > yield different results: > > > > cmp(x,y):=is(first(x) <= first(y)); > > sort([[1,1],[1,2]],cmp); > > > > Ecl yields > > [[1,1],[1,2]] > > Sbcl yields > > [[1,2],[1,1]] > > > > However with the correct definition > > cmp(x,y) := is(first(x) < first(y)); > > both yield > > [[1,1],[1,2]] > > > > > ? ? Sorts a list using an ordering function P of two arguments, > which > > > defines a "less than or equals" relation. ?More precisely, if P > (a,b) and P(b,a) > > > are both true, then the order of a and b remains the same as in the > input > > > ("stable sort"). ?Otherwise, a comes before b if P(a,b). > > > > > > > If both P(a,b) and P(b,a) are true, then we have undefined behaviour. > > ? > > > (This also makes the discussion of stable sort below unnecessary.) > > > > > > > > > ? ? ?The predicate may be specified as the name > > > ? ? ? ? of a function or binary infix operator, or as a `lambda' > > > ? ? ? ? expression. ?If specified as the name of an operator, the > name is > > > ? ? ? ? enclosed in "double quotes". > > > > > > > > > Adding an example might help: e.g. "<".? > > > > > > > Whatever you do, one can not have "<=" and "<" at the same time. > > ? > > > > > > ? ? ? ? It is assumed the predicate

is a strict total order on > the > > > ? ? ? ? elements of . > > > > > > > > > No, it is assumed that P is total, but not strict -- i.e. it is > like <=, not <. > > > ?(Otherwise we wouldn't have to specify stability.) > > > > > > > Yes, it is strict. Sorting always considers strict orders. For strict > orders > > equivalence x~y is defined as not(x concerns > > equivalent elements. > > > > > > > > ? ? ?If not, `sort' might run to completion without > > > ? ? ? ? error, but the result is undefined. ?`sort' complains if > the > > > ? ? ? ? predicate evaluates to something other than `true' or > `false'. > > > > > > ? > > > Instead of "complains", how about "gives an error"? ?"Complains" > could mean > > > "prints a warning". > > > ? > > > > > > ? ? ? ? `sort' is a stable sort: if two elements and are > > > ? ? ? ? equivalent in the sense that `

(, )' and `

(, > )' > > > ? ? ? ? are both `false', then the relative order of and in > is > > > ? ? ? ? preserved by `sort'. > > > > > > > > > No, this is incorrect. ?If P(x,y) and P(y,x) are both false, then P > is not a > > > total order (strict or otherwise), and all bets are off. > > > > > > > This is called a "strict weak order", and is fully sufficient for all > > sorting purposes. > > > > If your statement above would be true, then sort([1,1]) would be > undefined --- > > given that orderlessp is used! > > > > orderlessp(1,1); > > ? false? > > > > > > > > ? ? ? ? `sort ()' is equivalent to `sort (, orderlessp)'. > ?That is, > > > ? ? ? ? the default sorting order is ascending, as determined by > > > ? ? ? ? `orderlessp'. ? ?All Maxima atoms and expressions are > comparable > > > ? ? ? ? under `orderlessp'. > > > > > > > Oliver > > -- > 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/ > > > > -- 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 macrakis at alum.mit.edu Sun Nov 20 17:59:22 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 20 Nov 2011 18:59:22 -0500 Subject: [Maxima] inconsistent definition of "sort" (and what about stability?) In-Reply-To: <20111120223343.GC13862@cs-wsok.swan.ac.uk> References: <20111112175128.GX20179@cs-wsok.swan.ac.uk> <20111120011833.GF4936@cs-wsok.swan.ac.uk> <20111120012811.GA27308@cs-wsok.swan.ac.uk> <20111120223343.GC13862@cs-wsok.swan.ac.uk> Message-ID: On Sun, Nov 20, 2011 at 17:33, Oliver Kullmann wrote: > Seems good to me, but some tiny issues: > > On Sun, Nov 20, 2011 at 05:20:16PM -0500, Stavros Macrakis wrote: > > Given Oliver's and Robert's comments, how about the following language: > > > > > > ?-- Function: sort (,

) > > ?-- Function: sort () > > > > I am not sure about the usage of "

(a,b)" versus "P(a,b)". > I never knew what the brackets do here ... > In Maxima doc, formal arguments are enclosed in <>, presumably to avoid confusion with literals. All instances of P should be

. > Anyway, breaking the line after P, before (a,b), should be avoided. > Agreed -- presumably that will not happen when this is all poured into the correct documentation markup language. > Sorts a list using a predicate function

of two arguments which > > defines a strict weak order. ?Thus,?"<" is a valid P, but "<=" is > not.??P > > (a,b) must return either true or false for any choice of a and b in > .?If > >

(a,b) is true, then a will appear before b in the result. ?If > neither > >

(a,b) nor

(b,a) is true, then a and b are equivalent, and will > appear > > in the same order as in the input (that is, 'sort' is a stable sort). > > > > > > If both P(a,b) and P(b,a) are true, then P is not a valid sort > predicate, > > and the result is undefined, though 'sort' will generally not signal > an > > error. ? > > > > The predicate function may be specified as the name?of a function > (e.g. > > 'orderlessp), a quoted binary infix operator (e.g. "<"), or as a > > `lambda'?expression (e.g. lambda([a,b],a[1] > > > The sorted list is returned as a new object; the argument is?not > > modified. > > > > > > sort() is equivalent to sort(,'orderlessp) > > > > Common predicates used with sort include: > > > > * orderlessp -- canonical ordering applicable to all Maxima objects > > * ordergreaterp -- the negation of orderlessp > > Must be > > * ordergreatp -- the transposed (reversed) of orderlessp > (not the negation). > Agreed. -s Oliver > > P.S. Until now I though one had to use > lambda([a,b], is(a[1] ? Apparently not ... > > > * ordermagnitudep -- orders by numerical magnitude when known; objects of > > unknown magnitude come at the end, in orderlessp order. ?Does not > consult the > > 'assume' database. > > * "<" -- orders by numerical magnitude; does consult the 'assume' > database. > > ?Does not allow objects of unknown magnitude.? > > > > > > ---------------------------------- > > > > On Sat, Nov 19, 2011 at 20:28, Oliver Kullmann < > O.Kullmann at swansea.ac.uk> > > wrote: > > > > At > > > > > http://www.lispworks.com/documentation/HyperSpec/Body/f_sort_.htm > > > > it says > > > > Predicate should return true if and only if the first argument is > > strictly less than the second (in some appropriate sense). > > > > (It's sloppy in the sense that "appropriate sense" it not > defined.) > > > > Also > > > > http://www.gnu.org/software/emacs/manual/html_node/cl/ > > Sorting-Sequences.html > > > > says > > > > . predicate should return true (non-nil) if and only if its first > > argument is less than (not equal to) its second argument. > > > > You can also look into Knuth's "The Art of Computer Programming". > > Most precisely it's in the C++ standard. > > > > Basing sorting on strict weak ordering (see > http://en.wikipedia.org/ > > wiki/Strict_weak_order) > > is also done at > > http://en.wikipedia.org/wiki/Sorting > > > > Oliver > > > > On Sun, Nov 20, 2011 at 01:18:33AM +0000, Oliver Kullmann wrote: > > > On Sat, Nov 19, 2011 at 07:46:26PM -0500, Stavros Macrakis > wrote: > > > > On Sat, Nov 19, 2011 at 18:32, Robert Dodier < > > robert.dodier at gmail.com> wrote: > > > > > > > > Comments in line: > > > > ? > > > > > > > > ? ? ?-- Function: sort (,

) > > > > > > > > ? ? ? ? Sorts a list according to a predicate `P' of two > > arguments, > > > > ? ? ? ? such that `

([k + 1], [k])' is `false' for > any two > > > > ? ? ? ? successive elements. > > > > > > > > > > > > I'm afraid this definition is incorrect. ?After all,?L= > [1,1] is > > sorted > > > > according to "<=", but P(L[2],L[1]) is true. ?And what is the > > purpose of saying > > > > "any two successive elements" when we already have L[k+1] > and L[k]? > > ? Also, "L" > > > > is being used in the same sentence to mean two very different > > things: the input > > > > list and the output list. ?All in all, very confusing. ?Why > not > > something > > > > simpler like: > > > > > > > > > > No, the definition is correct: "<=" can not be used by "sort", > but > > yields > > > undefined behaviour. > > > > > > How to construct a good example, to demonstrate this? > > > The best I'm aware of at the moment is to show that different > Lisp's > > > yield different results: > > > > > > cmp(x,y):=is(first(x) <= first(y)); > > > sort([[1,1],[1,2]],cmp); > > > > > > Ecl yields > > > [[1,1],[1,2]] > > > Sbcl yields > > > [[1,2],[1,1]] > > > > > > However with the correct definition > > > cmp(x,y) := is(first(x) < first(y)); > > > both yield > > > [[1,1],[1,2]] > > > > > > > ? ? Sorts a list using an ordering function P of two > arguments, > > which > > > > defines a "less than or equals" relation. ?More precisely, > if P > > (a,b) and P(b,a) > > > > are both true, then the order of a and b remains the same as > in the > > input > > > > ("stable sort"). ?Otherwise, a comes before b if P(a,b). > > > > > > > > > > If both P(a,b) and P(b,a) are true, then we have undefined > behaviour. > > > ? > > > > (This also makes the discussion of stable sort below > unnecessary.) > > > > > > > > > > > > ? ? ?The predicate may be specified as the name > > > > ? ? ? ? of a function or binary infix operator, or as a > `lambda' > > > > ? ? ? ? expression. ?If specified as the name of an > operator, the > > name is > > > > ? ? ? ? enclosed in "double quotes". > > > > > > > > > > > > Adding an example might help: e.g. "<".? > > > > > > > > > > Whatever you do, one can not have "<=" and "<" at the same > time. > > > ? > > > > > > > > ? ? ? ? It is assumed the predicate

is a strict total > order on > > the > > > > ? ? ? ? elements of . > > > > > > > > > > > > No, it is assumed that P is total, but not strict -- i.e. it > is > > like <=, not <. > > > > ?(Otherwise we wouldn't have to specify stability.) > > > > > > > > > > Yes, it is strict. Sorting always considers strict orders. For > strict > > orders > > > equivalence x~y is defined as not(x > concerns > > > equivalent elements. > > > > > > > > > > > ? ? ?If not, `sort' might run to completion without > > > > ? ? ? ? error, but the result is undefined. ?`sort' > complains if > > the > > > > ? ? ? ? predicate evaluates to something other than `true' or > > `false'. > > > > > > > > ? > > > > Instead of "complains", how about "gives an error"? > ?"Complains" > > could mean > > > > "prints a warning". > > > > ? > > > > > > > > ? ? ? ? `sort' is a stable sort: if two elements and > are > > > > ? ? ? ? equivalent in the sense that `

(, )' and > `

(, > > )' > > > > ? ? ? ? are both `false', then the relative order of and > in > > is > > > > ? ? ? ? preserved by `sort'. > > > > > > > > > > > > No, this is incorrect. ?If P(x,y) and P(y,x) are both false, > then P > > is not a > > > > total order (strict or otherwise), and all bets are off. > > > > > > > > > > This is called a "strict weak order", and is fully sufficient > for all > > > sorting purposes. > > > > > > If your statement above would be true, then sort([1,1]) would > be > > undefined --- > > > given that orderlessp is used! > > > > > > orderlessp(1,1); > > > ? false? > > > > > > > > > > > ? ? ? ? `sort ()' is equivalent to `sort (, > orderlessp)'. > > ?That is, > > > > ? ? ? ? the default sorting order is ascending, as > determined by > > > > ? ? ? ? `orderlessp'. ? ?All Maxima atoms and expressions are > > comparable > > > > ? ? ? ? under `orderlessp'. > > > > > > > > > > Oliver > > > > -- > > 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/ > > > > > > > > > > -- > 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/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon Nov 21 00:05:33 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 20 Nov 2011 23:05:33 -0700 Subject: [Maxima] another revision of the documentation for "sort" Message-ID: FWIW. I've pushed the following. I tried to take into account various comments made about previous versions. I've tried to apply the following general guidelines which I have also applied (inconsistently) to other documentation: * separate exposition and examples * examples recapitulate exposition * order exposition by decreasing importance * be precise, be complete, get to the point Doubtless if you look hard enough you will see that I've violated my own guidelines. I apologize in advance. Thanks a lot to everyone who has contributed to the discussion. HTH Robert Dodier PS. -- Function: sort (,

) -- Function: sort () Sorts a list according to a predicate `P' of two arguments which defines a strict weak order on the elements of . If `

(a, b)' is `true', then `a' appears before `b' in the result. If neither `

(a, b)' nor `

(b, a)' are `true', then `a' and `b' are equivalent, and appear in the result in the same order as in the input. That is, `sort' is a stable sort. If `

(a, b)' and `

(b, a)' are both `true' for some elements of , then

is not a valid sort predicate, and the result is undefined. If `

(a, b)' is something other than `true' or `false', `sort' signals an error. The predicate may be specified as the name of a function or binary infix operator, or as a `lambda' expression. If specified as the name of an operator, the name must be enclosed in double quotes. The sorted list is returned as a new object; the argument is not modified. `sort()' is equivalent to `sort(, orderlessp)'. The default sorting order is ascending, as determined by `orderlessp'. The predicate `ordergreatp' sorts a list in descending order. All Maxima atoms and expressions are comparable under `orderlessp' and `ordergreatp'. Operators `<' and `>' order numbers, constants, and constant expressions by magnitude. Note that `orderlessp' and `ordergreatp' do not order numbers, constants, and constant expressions by magnitude. `ordermagnitudep' orders numbers, constants, and constant expressions the same as `<', and all other elements the same as `orderlessp'. Examples: `sort' sorts a list according to a predicate of two arguments which defines a strict weak order on the elements of the list. (%i1) sort ([1, a, b, 2, 3, c], 'orderlessp); (%o1) [1, 2, 3, a, b, c] (%i2) sort ([1, a, b, 2, 3, c], 'ordergreatp); (%o2) [c, b, a, 3, 2, 1] The predicate may be specified as the name of a function or binary infix operator, or as a `lambda' expression. If specified as the name of an operator, the name must be enclosed in double quotes. (%i1) L : [[1, x], [3, y], [4, w], [2, z]]; (%o1) [[1, x], [3, y], [4, w], [2, z]] (%i2) foo (a, b) := a[1] > b[1]; (%o2) foo(a, b) := a > b 1 1 (%i3) sort (L, 'foo); (%o3) [[4, w], [3, y], [2, z], [1, x]] (%i4) infix (">>"); (%o4) >> (%i5) a >> b := a[1] > b[1]; (%o5) a >> b := a > b 1 1 (%i6) sort (L, ">>"); (%o6) [[4, w], [3, y], [2, z], [1, x]] (%i7) sort (L, lambda ([a, b], a[1] > b[1])); (%o7) [[4, w], [3, y], [2, z], [1, x]] `sort()' is equivalent to `sort(, orderlessp)'. (%i1) L : [a, 2*b, -5, 7, 1 + %e, %pi]; (%o1) [a, 2 b, - 5, 7, %e + 1, %pi] (%i2) sort (L); (%o2) [- 5, 7, %e + 1, %pi, a, 2 b] (%i3) sort (L, 'orderlessp); (%o3) [- 5, 7, %e + 1, %pi, a, 2 b] The default sorting order is ascending, as determined by `orderlessp'. The predicate `ordergreatp' sorts a list in descending order. (%i1) L : [a, 2*b, -5, 7, 1 + %e, %pi]; (%o1) [a, 2 b, - 5, 7, %e + 1, %pi] (%i2) sort (L); (%o2) [- 5, 7, %e + 1, %pi, a, 2 b] (%i3) sort (L, 'ordergreatp); (%o3) [2 b, a, %pi, %e + 1, 7, - 5] All Maxima atoms and expressions are comparable under `orderlessp' and `ordergreatp'. (%i1) L : [11, -17, 29b0, 9*c, 7.55, foo(x, y), -5/2, b + a]; 5 (%o1) [11, - 17, 2.9b1, 9 c, 7.55, foo(x, y), - -, b + a] 2 (%i2) sort (L, orderlessp); 5 (%o2) [- 17, - -, 7.55, 11, 2.9b1, b + a, 9 c, foo(x, y)] 2 (%i3) sort (L, ordergreatp); 5 (%o3) [foo(x, y), 9 c, b + a, 2.9b1, 11, 7.55, - -, - 17] 2 Operators `<' and `>' order numbers, constants, and constant expressions by magnitude. Note that `orderlessp' and `ordergreatp' do not order numbers, constants, and constant expressions by magnitude. (%i1) L : [%pi, 3, 4, %e, %gamma]; (%o1) [%pi, 3, 4, %e, %gamma] (%i2) sort (L, ">"); (%o2) [4, %pi, 3, %e, %gamma] (%i3) sort (L, ordergreatp); (%o3) [%pi, %gamma, %e, 4, 3] `ordermagnitudep' orders numbers, constants, and constant expressions the same as `<', and all other elements the same as `orderlessp'. (%i1) L : [%i, 1+%i, 2*x, minf, inf, %e, sin(1), 0, 1, 2, 3, 1.0, 1.0b0]; (%o1) [%i, %i + 1, 2 x, minf, inf, %e, sin(1), 0, 1, 2, 3, 1.0, 1.0b0] (%i2) sort (L, ordermagnitudep); (%o2) [minf, 0, sin(1), 1, 1.0, 1.0b0, 2, %e, 3, inf, %i, %i + 1, 2 x] (%i3) sort (L, orderlessp); (%o3) [0, 1, 1.0, 2, 3, %e, %i, %i + 1, inf, minf, sin(1), 1.0b0, 2 x] From lutz.euler at freenet.de Mon Nov 21 10:07:23 2011 From: lutz.euler at freenet.de (Lutz Euler) Date: Mon, 21 Nov 2011 17:07:23 +0100 Subject: [Maxima] "letsimp" honors "modulus" only partially? References: <20169.27814.14392.646626@localhost.localdomain> <20111120212903.GB13862@cs-wsok.swan.ac.uk> Message-ID: <20170.30523.137478.450014@localhost.localdomain> Hi Stavros and Oliver, thanks for the fast answers to my mail. Both are very useful. I wrote: > I am trying to calculate x^31 in the finite field with 125 elements, > (Z/5Z)[x]/(x^3 - x - 2). I don't know the canonical way to deal with > fields of this kind in Maxima, but I found "letsimp" and the variable > "modulus" and that nearly works. Stavros wrote: > I believe the issue here is that 'modulus' is only applied to > expressions in canonical rational form (CRE) -- expressions > created using 'rat'. Yes, this explains why letsimp only partially reduces the numbers with respect to "modulus". I have read up more on "rat" and CRE in the documentation now, so thank you for the pointer. Now, the letsimp-based method very easily gets way too slow; while it can do the 31th power, with for example the 50th it didn't return an answer after several minutes. So thanks to Oliver for pointing me to "gf". You wrote: > there is the package "gf" which would do all of this --- > unfortunately it is broken, and only some of the functions work. > > The package-functions are also very slow. I have now tried "gf" very successfully. It seems way sufficient for my needs, for example exponentiation is instantaneous and it even can calculate a logarithm in GF(p^3) with p of the order of 2^32 within a minute or so (with p chosen such that the prime factors of p^3 - 1 are 2, (p - 1)/2 and p^2 + p + 1). My interest is mostly in interactively experimenting with some simple calculations to get a better understanding of the structure of the multiplicative group in these fields, so this amount of performance is sufficient for me. Thanks again! Yours, Lutz From macrakis at alum.mit.edu Mon Nov 21 10:32:15 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 21 Nov 2011 11:32:15 -0500 Subject: [Maxima] "letsimp" honors "modulus" only partially? In-Reply-To: <20170.30523.137478.450014@localhost.localdomain> References: <20169.27814.14392.646626@localhost.localdomain> <20111120212903.GB13862@cs-wsok.swan.ac.uk> <20170.30523.137478.450014@localhost.localdomain> Message-ID: I am surprised that letsimp is so slow. Glad to hear that the 'gf' package solves your problem. But if you want to do the original calculation faster, you can code up the reduction (iterative ratsubst) very simply yourself: iratsubst(a,b,c,modulus):= (a:rat(a),b:rat(b),c:rat(c), while(c # (c:ratsubst(a,b,c))) do 1, c); On my installation (Maxima 5.25.1 GCL 2.6.8, Windows Vista, Intel 8400 3GHz) iratsubst(x+2,x^3,x^3000,1009) => -426*x^2-479*x+97 takes under 1/2 second. Unfortunately, it runs into some limitations with ratsubst: ratsubst(x+2,x^3,x^3030),modulus:1009; Maxima encountered a Lisp error: Error in PROGN [or a callee]: Bind stack overflow. This is one of those rare cases where requesting a larger stack may actually be the correct solution -- but I'm afraid I can't help with that. -s On Mon, Nov 21, 2011 at 11:07, Lutz Euler wrote: > Hi Stavros and Oliver, > > thanks for the fast answers to my mail. Both are very useful. > > I wrote: > > > I am trying to calculate x^31 in the finite field with 125 elements, > > (Z/5Z)[x]/(x^3 - x - 2). I don't know the canonical way to deal with > > fields of this kind in Maxima, but I found "letsimp" and the variable > > "modulus" and that nearly works. > > Stavros wrote: > > > I believe the issue here is that 'modulus' is only applied to > > expressions in canonical rational form (CRE) -- expressions > > created using 'rat'. > > Yes, this explains why letsimp only partially reduces the numbers > with respect to "modulus". I have read up more on "rat" and CRE in > the documentation now, so thank you for the pointer. > > Now, the letsimp-based method very easily gets way too slow; > while it can do the 31th power, with for example the 50th it didn't > return an answer after several minutes. > > So thanks to Oliver for pointing me to "gf". You wrote: > > > there is the package "gf" which would do all of this --- > > unfortunately it is broken, and only some of the functions work. > > > > The package-functions are also very slow. > > I have now tried "gf" very successfully. It seems way sufficient for > my needs, for example exponentiation is instantaneous and it even > can calculate a logarithm in GF(p^3) with p of the order of 2^32 > within a minute or so (with p chosen such that the prime factors > of p^3 - 1 are 2, (p - 1)/2 and p^2 + p + 1). > > My interest is mostly in interactively experimenting with some simple > calculations to get a better understanding of the structure of the > multiplicative group in these fields, so this amount of performance > is sufficient for me. > > Thanks again! Yours, > > Lutz > _______________________________________________ > 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 luigi_marino2 at alice.it Mon Nov 21 11:10:38 2011 From: luigi_marino2 at alice.it (Luigi Marino) Date: Mon, 21 Nov 2011 18:10:38 +0100 Subject: [Maxima] "letsimp" honors "modulus" only partially? Message-ID: Hi Stavros On my PC works fine: ratsubst(x+2,x^3,x^3030),modulus:1009; out: x^1010+2*x^1009+2*x+4 Best. Luigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From lutz.euler at freenet.de Mon Nov 21 13:05:03 2011 From: lutz.euler at freenet.de (Lutz Euler) Date: Mon, 21 Nov 2011 20:05:03 +0100 Subject: [Maxima] "letsimp" honors "modulus" only partially? In-Reply-To: References: <20169.27814.14392.646626@localhost.localdomain> <20111120212903.GB13862@cs-wsok.swan.ac.uk> <20170.30523.137478.450014@localhost.localdomain> Message-ID: <20170.41183.989164.391037@localhost.localdomain> Hi, Stavros Macrakis wrote: > But if you want to do the original calculation faster, you can code up > the reduction (iterative ratsubst) very simply yourself: > > iratsubst(a,b,c,modulus):= > (a:rat(a),b:rat(b),c:rat(c), > while(c # (c:ratsubst(a,b,c))) do 1, > c); I see. That's really simple! Exponentiation in GF(5^3) is instantaneous with it. > Unfortunately, it runs into some limitations with ratsubst: > > ratsubst(x+2,x^3,x^3030),modulus:1009; > Maxima encountered a Lisp error: > Error in PROGN [or a callee]: Bind stack overflow. Same here. Anyway, specialising on exponentiation, it should be possible to implement bottom-up square-and-multiply, reducing (using either ratsubst or letsimp) after each step. This way the inputs to these functions are always so small that they won't run into any restriction. But gf already does something to this effect and my intent at present is to avoid additional programming and use what's already available. Thanks again, Lutz From woollett at charter.net Mon Nov 21 13:30:09 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 21 Nov 2011 11:30:09 -0800 Subject: [Maxima] coping with messages from integrate Message-ID: <065CAC896F454AD4BB6FD329766B4C4A@edwinc367e16bd> I'm not complaining, and I know Maxima needs user input to proceed, even though the answer does not depend on the user's input. I guess the user of integrate should use these questions from Maxima as an indication that the definite integral below should be checked using other means? --------------------------------------------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) integrate(acos(%i*x),x,-2,3); Is W35620 positive or negative? pos; Is W37394 positive or negative? pos; (%o1) %i*(-3*log(sqrt(10)+3)-2*log(sqrt(5)-2)+sqrt(10)-sqrt(5))+5*%pi/2 (%i3) float(rectform(integrate(acos(%i*x),x,-2,3))); Is W40485 positive or negative? pos; Is W42259 positive or negative? neg; (%o3) 7.853981633974483-1.641858744669991*%i (%i4) float(rectform(integrate(acos(%i*x),x,-2,3))); Is W44437 positive or negative? neg; Is W46056 positive or negative? pos; (%o4) 7.853981633974483-1.641858744669991*%i (%i5) float(rectform(integrate(acos(%i*x),x,-2,3))); Is W49147 positive or negative? neg; Is W50766 positive or negative? neg; (%o5) 7.853981633974483-1.641858744669991*%i -------------------------------------------------------------- One way to check just the floating point answer is using quad_qag, for example, as in: ---------------------------------------------- (%i6) check(ex,var,v1,v2) := (print(" integrate = ", float(rectform(integrate(ex,var,v1,v2)))), print(" quad real = ", part(quad_qag(realpart(ex),var,v1,v2,3),1)), print(" quad imag = ", part(quad_qag(imagpart(ex),var,v1,v2,3),1)))$ (%i7) check(acos(%i*x),x,-2,3)$ Is W52944 positive or negative? pos; Is W54718 positive or negative? pos; integrate = 7.853981633974483-1.641858744669991*%i quad real = 7.853981633974482 quad imag = -1.64185874466999 ----------------------------------------- Ted Woollett From willisb at unk.edu Mon Nov 21 13:49:30 2011 From: willisb at unk.edu (Barton Willis) Date: Mon, 21 Nov 2011 13:49:30 -0600 Subject: [Maxima] coping with messages from integrate In-Reply-To: <065CAC896F454AD4BB6FD329766B4C4A@edwinc367e16bd> References: <065CAC896F454AD4BB6FD329766B4C4A@edwinc367e16bd> Message-ID: maxima-bounces at math.utexas.edu wrote on 11/21/2011 01:30:09 PM: > (%i1) integrate(acos(%i*x),x,-2,3); > > Is W35620 positive or negative? Maxima should neverask about the sign of an expression that involves an internally generated variable. This is a bug--you should report it. --Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: From macrakis at alum.mit.edu Mon Nov 21 13:56:01 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 21 Nov 2011 14:56:01 -0500 Subject: [Maxima] coping with messages from integrate In-Reply-To: <065CAC896F454AD4BB6FD329766B4C4A@edwinc367e16bd> References: <065CAC896F454AD4BB6FD329766B4C4A@edwinc367e16bd> Message-ID: Maxima should never be asking questions involving variables that don't appear in the input -- that is a bug. On Mon, Nov 21, 2011 at 14:30, Edwin Woollett wrote: > I'm not complaining, and I know Maxima needs user input > to proceed, even though the answer does not depend on > the user's input. > > I guess the user of integrate should use these > questions from Maxima as an indication that the definite integral > below should be checked using other means? > ------------------------------**------------------------------**--------- > Maxima 5.25.1 http://maxima.sourceforge.net > using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) > > > (%i1) integrate(acos(%i*x),x,-2,3); > > Is W35620 positive or negative? > > pos; > Is W37394 positive or negative? > > pos; > (%o1) %i*(-3*log(sqrt(10)+3)-2*log(**sqrt(5)-2)+sqrt(10)-sqrt(5))+** > 5*%pi/2 > > (%i3) float(rectform(integrate(acos(**%i*x),x,-2,3))); > > Is W40485 positive or negative? > > pos; > Is W42259 positive or negative? > > neg; > (%o3) 7.853981633974483-1.**641858744669991*%i > (%i4) float(rectform(integrate(acos(**%i*x),x,-2,3))); > > Is W44437 positive or negative? > > neg; > Is W46056 positive or negative? > > pos; > (%o4) 7.853981633974483-1.**641858744669991*%i > (%i5) float(rectform(integrate(acos(**%i*x),x,-2,3))); > > Is W49147 positive or negative? > > neg; > Is W50766 positive or negative? > > neg; > (%o5) 7.853981633974483-1.**641858744669991*%i > ------------------------------**------------------------------**-- > One way to check just the floating point answer is > using quad_qag, for example, as in: > ------------------------------**---------------- > > (%i6) check(ex,var,v1,v2) := > (print(" integrate = ", > float(rectform(integrate(ex,**var,v1,v2)))), > > print(" quad real = ", > part(quad_qag(realpart(ex),**var,v1,v2,3),1)), > > print(" quad imag = ", > part(quad_qag(imagpart(ex),**var,v1,v2,3),1)))$ > > (%i7) check(acos(%i*x),x,-2,3)$ > > Is W52944 positive or negative? > > pos; > Is W54718 positive or negative? > > pos; > integrate = 7.853981633974483-1.**641858744669991*%i > quad real = 7.853981633974482 > quad imag = -1.64185874466999 > ------------------------------**----------- > > > 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 Mon Nov 21 13:56:43 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 21 Nov 2011 11:56:43 -0800 Subject: [Maxima] integrate hangs with acos(1+%i*x) Message-ID: <0EAC06A7BB444E4B820C29BDD85AAE8B@edwinc367e16bd> 1. noun form returned ok: (%i9) integrate(acos(1+%i*x),x,1,2); (%o9) 'integrate(acos(%i*x+1),x,1,2) 2. Maxima hangs and used ^C in console mode to get back prompt. (%i10) integrate(acos(1+%i*x),x,-1,2); Maxima encountered a Lisp error: Console interrupt. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. Ted Woollett (v.5.25.1gcl, windows) From jcvtrip at gmail.com Mon Nov 21 14:06:28 2011 From: jcvtrip at gmail.com (juan carlos valenzuela) Date: Mon, 21 Nov 2011 21:06:28 +0100 Subject: [Maxima] SIMBOLIC INTEGRAL: Is this a bug??? Message-ID: Hello, I found some problem when integrating: integrate(integrate(sqrt(4*x^2-y^2),x, y,1), y, 0,1) and integrate(integrate(sqrt(4*x^2-y^2),y,0,x),x,0,1) Both are the same integral in a triangle {0 From toy.raymond at gmail.com Mon Nov 21 14:17:48 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 21 Nov 2011 12:17:48 -0800 Subject: [Maxima] coping with messages from integrate In-Reply-To: References: <065CAC896F454AD4BB6FD329766B4C4A@edwinc367e16bd> Message-ID: On Mon, Nov 21, 2011 at 11:49 AM, Barton Willis wrote: > maxima-bounces at math.utexas.edu wrote on 11/21/2011 01:30:09 PM: > > > > (%i1) integrate(acos(%i*x),x,-2,3); > > > > Is W35620 positive or negative? > > Maxima should* never*ask about the sign of an expression that involves > an internally generated variable. This is a bug--you should report it. FWIW, Maxima doesn't ask this question for me with the latest sources. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From toy.raymond at gmail.com Mon Nov 21 14:21:15 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 21 Nov 2011 12:21:15 -0800 Subject: [Maxima] integrate hangs with acos(1+%i*x) In-Reply-To: <0EAC06A7BB444E4B820C29BDD85AAE8B@edwinc367e16bd> References: <0EAC06A7BB444E4B820C29BDD85AAE8B@edwinc367e16bd> Message-ID: On Mon, Nov 21, 2011 at 11:56 AM, Edwin Woollett wrote: > 1. noun form returned ok: > > (%i9) integrate(acos(1+%i*x),x,1,2); > > (%o9) 'integrate(acos(%i*x+1),x,1,2) > > 2. Maxima hangs and used ^C in console mode > to get back prompt. > > (%i10) integrate(acos(1+%i*x),x,-1,2)**; > > Maxima encountered a Lisp error: > > I don't see this with the current sources. For both, maxima returns an answer. Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Mon Nov 21 17:05:56 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 21 Nov 2011 16:05:56 -0700 Subject: [Maxima] integrate hangs with acos(1+%i*x) In-Reply-To: References: <0EAC06A7BB444E4B820C29BDD85AAE8B@edwinc367e16bd> Message-ID: For the record, integrate(acos(1+%i*x),x,-1,2); appears to hang (although I suspect it is in some kind of nonterminating loop). Maxima version: 5.25.1 Maxima build date: 11:9 8/28/2011 Host type: i686-redhat-linux-gnu Lisp implementation type: CLISP Lisp implementation version: 2.48 (2009-07-28) (built 3459348196) (memory 3523540177) best Robert Dodier From woollett at charter.net Mon Nov 21 17:17:58 2011 From: woollett at charter.net (Edwin Woollett) Date: Mon, 21 Nov 2011 15:17:58 -0800 Subject: [Maxima] detect sqrt in expression? Message-ID: <078838C316D4407C8967B598652F8F12@edwinc367e16bd> On Nov. 19, Raymond Toy wrote: --------------------------- >If multival really means multi-valued function, then aren't all of the >following wrong? Shouldn't they return true because they are multivalued? My description of this function must include that it is only to be used in the context of nint, that is numerical integration, in which the integrand is stuff which evaluates to numbers except for the (real!) variable of integration (here, x), and the limits of integration are either minf, inf, or things which evaluate to numbers. Constructing a function which could be used generally with Maxima to detect a multiple valued function in the widest possible context was not my goal. I am just concerned with avoiding integrate for a numerical definite integral when there is a possibility of a wrong answer. >> (%i5) multival(x*sqrt(x^2),x); >> >> (%o5) false this case would never be tested inside nint because it would already be simplified before multival ever looked at it. (%i2) x*sqrt(x^2); (%o2) x*abs(x) will be a single valued real number if x is real (which it is in nint), and (%i4) multival(x*abs(x),x); (%o4) false >> (%i6) multival(a^x,x); >> >> (%o6) false It was misleading to use an undefined symbol a in my tests, since such cannot legally appear in the integrand for the case of getting a number from a definite integral. Instead I should have used real or imaginary numbers, or %e or %pi. >> (%i7) multival(a^(%i*x),x); >> >> (%o7) false >> the case a^(%i*x) includes cases where a is a number or %pi or %e, in the latter case exp(%i*x) is an entire function 3^(%i*x) = exp(log(3^(%i*x))) = exp(%i*x*log(3)) is also an entire function If a = %i, then multival should return true. My first version returned wrong results for both %i^x and x^x. This second version has cures. ------------------------------------------------- Maxima 5.25.1 http://maxima.sourceforge.net using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL) (%i1) load(hasmultv); (%o1) "c:/work2/hasmultv.mac" (%i2) multival(%i^x,x); (%o2) true (%i3) multival((3*%i)^x,x); (%o3) true (%i4) multival((3+%i)^x,x); (%o4) true (%i5) multival(3^x,x); (%o5) false (%i6) multival(3^(%i*x),x); (%o6) false (%i7) multival(%i^(x^2),x); (%o7) true (%i8) multival(x^(3+1/2),x); (%o8) true (%i9) multival(x^%i,x); (%o9) true (%i10) multival(x^x,x); (%o10) true (%i11) multival(sqrt(x),x); (%o11) true (%i12) multival(x*sqrt(x),x); (%o12) true (%i13) multival(x*sqrt(x^2),x); (%o13) false (%i14) multival(5^(2/3),x); (%o14) false (%i15) multival(%pi^(2/3),x); (%o15) false (%i16) multival(x^(2/3),x); (%o16) true (%i17) multival(x^(%i*x),x); (%o17) true (%i18) multival(x^(%i*sin(x)),x); (%o18) true (%i19) multival(log(x),x); (%o19) true (%i20) multival(sqrt(x)*log(x),x); (%o20) true (%i21) multival(acos(x),x); (%o21) true (%i22) multival(x^acos(x),x); (%o22) true ============================= with the code any_of(list) := member(true,list)$ /* multival(e,x) returns true if a potentially multiple valued function of x is detected in expression e */ multival(ex,var) := block([inflag:true,listconstvars:true], if debug then print(" multival, ex = ",ex), if mapatom(ex) then false else if member(op(ex), '[log, acos,acosh,acot,acoth,acsc,acsch, asec,asech,asin,asinh,atan,atan2,atanh] ) and member(var,listofvars(ex)) then true else if op(ex) = "^" and mvp(ex,var) then true else any_of(maplist(lambda ([u],multival(u,var)),ex)))$ /* version 2 mvp(e,v) mvp(e,v) returns true if e = f^g has either the form %i^g(x), f(%i)^g(x), f(x)^g with g # integer */ mvp (e,v) := block([inflag:true], if debug then print(" mvp, e = ",e), if mapatom(e) then false else if length(e) = 1 then false else if part(e,1) = -1 and member(v,listofvars(part(e,2))) then true else if lfreeof ([v,%i], part (e,1)) then false else if integerp(part(e,2)) then false else if member(v,listofvars(part(e,1))) and not integerp(part(e,2)) then true else if member(%i,listofvars(part(e,1))) and member(v,listofvars(part(e,2))) then true else any_of(maplist(lambda ([u],mvp(u,v)),e)))$ debug:false$ ----------------------------------------- Ted From talon at lpthe.jussieu.fr Tue Nov 22 09:03:58 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 22 Nov 2011 15:03:58 +0000 (UTC) Subject: [Maxima] integrate hangs with acos(1+%i*x) References: <0EAC06A7BB444E4B820C29BDD85AAE8B@edwinc367e16bd> <0EAC06A7BB444E4B820C29BDD85AAE8B@edwinc367e16bd> Message-ID: Robert Dodier wrote: > integrate(acos(1+%i*x),x,-1,2); hangs. Indeed i see the same here under sbcl and maxima 5.25.1. I have a backtrace which supports looping always on the same computation: 0: (SB-KERNEL:TWO-ARG-+ -4199579596574115072 -317738973225728000) 1: (CPLUS -4199579596574115072 -317738973225728000) 2: (PCPLUS -317738973225728000 -4199579596574115072) 3: (PPLUS -317738973225728000 -4199579596574115072) 4: (PPLUS1 (14 -317738973225728000 10 1470207527488473600 6 -197927315224332800) (14 -4199579596574115072 10 10377946040669729152 6 -940439922132963072 2 2014186520221184)) 5: (PPLUS1 (18 -4497499316480000 14 -317738973225728000 10 1470207527488473600 6 -197927315224332800) (18 -111090916028310400 14 -4199579596574115072 10 10377946040669729152 6 -940439922132963072 2 2014186520221184)) 6: (PPLUS (#:|cos(atan(2/(?g3298-1))/2)3381| 18 -111090916028310400 14 -4199579596574115072 10 10377946040669729152 6 -940439922132963072 2 2014186520221184) (#:|cos(atan(2/(?g3298-1))/2)3381| 18 -4497499316480000 14 -317738973225728000 10 1470207527488473600 6 -197927315224332800)) 7: (PTIMES1 (44 (#:|cos(atan(2/(?g3298-1))/2)3381| 1 3548232542740416) 43 (#:|cos(atan(2/(?g3298-1))/2)3381| 2 6479997022956096) 42 (#:|cos(atan(2/(?g3298-1))/2)3381| 3 -3222785130866112) 41 (#:|cos(atan(2/(?g3298-1))/2)3381| 4 -12202858201253952 0 321141710217408) 40 (#:|cos(atan(2/(?g3298-1))/2)3381| 5 -50326150422114432 1 1581529052717568) 39 (#:|cos(atan(2/(?g3298-1))/2)3381| 6 -79274235964789632 2 1223110823844288) ...) (28 -1150000 27 (#:|cos(atan(2/(?g3298-1))/2)3381| 1 -4350000) 26 (#:|cos(atan(2/(?g3298-1))/2)3381| 2 -4350000) 25 (#:|cos(atan(2/(?g3298-1))/2)3381| 3 -4850000) 24 (#:|cos(atan(2/(?g3298-1))/2)3381| 4 -7150000 0 -50000) 23 (#:|cos(atan(2/(?g3298-1))/2)3381| 5 -14050000 1 -400000) ...)) 8: (PTIMES (#:|sin(atan(2/(?g3298-1))/2)3382| 44 (#:|cos(atan(2/(?g3298-1))/2)3381| 1 3548232542740416) 43 (#:|cos(atan(2/(?g3298-1))/2)3381| 2 6479997022956096) 42 (#:|cos(atan(2/(?g3298-1))/2)3381| 3 -3222785130866112) 41 (#:|cos(atan(2/(?g3298-1))/2)3381| 4 -12202858201253952 0 321141710217408) 40 (#:|cos(atan(2/(?g3298-1))/2)3381| 5 -50326150422114432 1 1581529052717568) 39 ...) (#:|sin(atan(2/(?g3298-1))/2)3382| 28 -1150000 27 (#:|cos(atan(2/(?g3298-1))/2)3381| 1 -4350000) 26 (#:|cos(atan(2/(?g3298-1))/2)3381| 2 -4350000) 25 (#:|cos(atan(2/(?g3298-1))/2)3381| 3 -4850000) 24 (#:|cos(atan(2/(?g3298-1))/2)3381| 4 -7150000 0 -50000) 23 ...)) 9: (PTIMES1 (28 (#:|sin(atan(2/(?g3298-1))/2)3382| 28 4 26 (#:|cos(atan(2/(?g3298-1))/2)3381| 2 8) 24 (#:|cos(atan(2/(?g3298-1))/2)3381| 4 20)) 27 (#:|sin(atan(2/(?g3298-1))/2)3382| 28 -112 27 (#:|cos(atan(2/(?g3298-1))/2)3381| 1 -16) 26 (#:|cos(atan(2/(?g3298-1))/2)3381| 2 -224) 25 (#:|cos(atan(2/(?g3298-1))/2)3381| 3 -32) 24 (#:|cos(atan(2/(?g3298-1))/2)3381| 4 -560) 23 ...) 26 (#:|sin(atan(2/(?g3298-1))/2)3382| 28 1608 27 (#:|cos(atan(2/(?g3298-1))/2)3381| 1 432) 26 (#:|cos(atan(2/(?g3298-1))/2)3381| 2 3224) 25 (#:|cos(atan(2/(?g3298-1))/2)3381| 3 864) 24 (#:|cos(atan(2/(?g3298-1))/2)3381| 4 8056 0 8) 23 ...) 25 (#:|sin(atan(2/(?g3298-1))/2)3382| 28 -15600 27 (#:|cos(atan(2/(?g3298-1))/2)3381| 1 -6000) 26 ??. -- Michel Talon From fateman at eecs.berkeley.edu Tue Nov 22 09:36:17 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Tue, 22 Nov 2011 07:36:17 -0800 Subject: [Maxima] integrate hangs with acos(1+%i*x) In-Reply-To: References: <0EAC06A7BB444E4B820C29BDD85AAE8B@edwinc367e16bd> <0EAC06A7BB444E4B820C29BDD85AAE8B@edwinc367e16bd> Message-ID: <4ECBC171.9060401@eecs.berkeley.edu> On 11/22/2011 7:03 AM, Michel Talon wrote: > Robert Dodier wrote: >> integrate(acos(1+%i*x),x,-1,2); > hangs. > > Indeed i see the same here under sbcl and maxima 5.25.1. > I have a backtrace which supports looping always on the same computation: > > > 0: (SB-KERNEL:TWO-ARG-+ -4199579596574115072 -317738973225728000) > 1: (CPLUS -4199579596574115072 -317738973225728000) > 2: (PCPLUS -317738973225728000 -4199579596574115072) > 3: (PPLUS -317738973225728000 -4199579596574115072) > 4: (PPLUS1 > (14 -317738973225728000 10 1470207527488473600 6 -197927315224332800) > (14 -4199579596574115072 10 10377946040669729152 6 -940439922132963072 2 > .... snip It would be most surprising if the bug were in ptimes or pplus, which are multiplying and adding polynomials. One might question how this integration problem was transformed so as to need the multiplication of polynomials of degrees 44 and 27, repeatedly. From alserkli at inbox.ru Tue Nov 22 09:56:30 2011 From: alserkli at inbox.ru (Alexander Klimov) Date: Tue, 22 Nov 2011 17:56:30 +0200 Subject: [Maxima] Patch to handle "cf(sqrt(8))" as cf of sqrt Message-ID: Before the patch, "sqrt(8)" was handled by cf as 2*sqrt(2) and thus the cflength promise was broken: cf(sqrt(8)); /* 3 */ with the patch it is handled as sqrt: cf(sqrt(8)); /* [2, 1, 4] */ Btw, apparently, this mailing list cannot be found from ==> Mailing Lists I guess it is a good idea to somehow mention it. -- Regards, ASK From toy.raymond at gmail.com Tue Nov 22 10:42:52 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 22 Nov 2011 08:42:52 -0800 Subject: [Maxima] integrate hangs with acos(1+%i*x) In-Reply-To: <4ECBC171.9060401@eecs.berkeley.edu> References: <0EAC06A7BB444E4B820C29BDD85AAE8B@edwinc367e16bd> <4ECBC171.9060401@eecs.berkeley.edu> Message-ID: Is it worth trying to debug this? I do not see this problem with the current sources. In fact, I get log(2*sqrt(2*%i+1)-2*%i-2)+2*acos(2*%i+1)-acos(%i-1) -log(-2*%i+2*sqrt(4-4*%i)+4)+%pi -%i*sqrt(2*%i+1)+sqrt(4-4*%i)*%i And integrate(acos(1+%i*x),x) is %i*(%i*log(2*sqrt(x^2-2*%i*x)+2*x-2*%i)+sqrt(x^2-2*%i*x))+x *acos(%i*x+1) This appears to be correct as the derivative is acos(1+%i*x). Ray On Tue, Nov 22, 2011 at 7:36 AM, Richard Fateman wrote: > On 11/22/2011 7:03 AM, Michel Talon wrote: > >> Robert Dodier wrote: >> >>> integrate(acos(1+%i*x),x,-1,2)**; >>> >> hangs. >> >> Indeed i see the same here under sbcl and maxima 5.25.1. >> I have a backtrace which supports looping always on the same computation: >> >> >> 0: (SB-KERNEL:TWO-ARG-+ -4199579596574115072 -317738973225728000) >> 1: (CPLUS -4199579596574115072 -317738973225728000) >> 2: (PCPLUS -317738973225728000 -4199579596574115072) >> 3: (PPLUS -317738973225728000 -4199579596574115072) >> 4: (PPLUS1 >> (14 -317738973225728000 10 1470207527488473600 6 -197927315224332800) >> (14 -4199579596574115072 10 10377946040669729152 6 >> -940439922132963072 2 >> >> .... snip > > It would be most surprising if the bug were in ptimes or pplus, which are > multiplying and adding polynomials. > > One might question how this integration problem was transformed so as to > need the multiplication > of polynomials of degrees 44 and 27, repeatedly. > > > > ______________________________**_________________ > 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 Tue Nov 22 10:59:51 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 22 Nov 2011 08:59:51 -0800 Subject: [Maxima] More specific maxima version string Message-ID: Now that we are using git, I would like to propose that the maxima version string contained in *autoconf-version* be more automatic and precise. Currently, it's updated by hand (and has the value of 5.25post). With git we can use 'git describe --dirty' to create a version for us that describes the src version. (This doesn't quite work; more on that below.) My current tree says "branch-5_25-base-212-g233544b-dirty". The "dirty" part says I have local changes in the tree, branch-5_25-base was the last tag, 212 is the number of commits since then and 233544b is the git SHA1 hash of that commit. Implementing this is simple. We need autoconf to check that git is available. If so, we can generate the appropriate version. If git is not available, we can just use the (hand-maintained) 5.25post. There is one issue mentioned above. Currently, we have to use "git describe --tags --dirty" instead of "git describe --dirty" because there are no annotated tags. We should probably create annotated tags when tag the releases. Ray diff --git a/configure.in b/configure.in index 9249641..7d14896 100644 --- a/configure.in +++ b/configure.in @@ -75,6 +75,13 @@ if test x"${clisp}" = xtrue ; then fi fi +dnl Append a git version to the version, if we have git available. +AC_CHECK_PROG(have_git, git, yes, no) + +case ${have_git} in + yes) VERSION=${VERSION}-`git describe --tags --dirty` ;; +esac + dnl n.b. cmucl_default_name is hardcoded in "with" message cmucl_default_name=lisp CMUCL_RUNTIME=lisp -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.dodier at gmail.com Tue Nov 22 12:27:40 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 22 Nov 2011 11:27:40 -0700 Subject: [Maxima] computing generating elements of ZZ_p^* ? In-Reply-To: <20111022095443.GB27744@cs-wsok.swan.ac.uk> References: <20111021001611.GA27744@cs-wsok.swan.ac.uk> <20111022095443.GB27744@cs-wsok.swan.ac.uk> Message-ID: On 10/22/11, Oliver Kullmann wrote: > Hi Robert, > > unfortunately that package "gf" hasn't been updated for quite > some time now, and quite a few of its functions are broken: > > load(gf); > gf_set(131); > gf_findprim(); > > fasttimes: arguments must be CRE polynomials with same variables. > #0: gf_binpower(p=x,n=131)(gf.mac line 244) > #1: mainpowers()(gf.mac line 346) > #2: gf_findprim()(gf.mac line 438) > -- an error. To debug this try: debugmode(true); > > So finding primitive elements is broken (at least with the > default settings). Hmm. I see that gf can run its own test cases (gf_test and gf_hard_test) so it's not completely broken. Looks like gf_set(p) and gf_set(p, m(x)) are handled differently. Help me understand what to expect from gf_findprim. In the absence of a polynomial m(x) supplied to gf_set, what should gf_findprim return? Is there a meaningful default value for m(x) so that gf_set(p) then calls gf_set(p, ) ? best Robert Dodier From willisb at unk.edu Tue Nov 22 14:41:05 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 22 Nov 2011 14:41:05 -0600 Subject: [Maxima] makeset & makelist In-Reply-To: References: , <0EAC06A7BB444E4B820C29BDD85AAE8B@edwinc367e16bd> Message-ID: I was looking for a solution to bug 3439895: http://sourceforge.net/tracker/?func=detail&aid=3439895&group_id=4933&atid=104933 I guess the issue is that makelist is a defmspec function and makeset is a defun function. For inspiration, I looked at the source for makelist :( (1) Possibly makelist is too flexible; for example (midly silly) (%i1) makelist(i+j, i+j, [1,2,3]); (%o1) [1,2,3] But (total weirdness) (%i2) makelist(integrate(f(x),x), integrate(f(x),x), [1,2,3]); (%o2) [integrate(f(x),x),integrate(f(x),x),integrate(f(x),x)] Quoting the first integrate allows this to return [1,2,3]. Try explaining that in the user documentation. Finally, (%i4) makelist(2,2,[1,2,3]); Only symbols can be bound; found: 2 Compare this to makelist(i+j, i+j, [1,2,3]) --> [1,2,3] (i+j can be bound either). (2) The call to $ev in makelist had bothered me since the Clinton administration. The unredacted: (unlike current makelist, no calls to $ev; runs the testsuite & share testsuite OK) (defmspec $makelist (l) (let* ((fn (pop l)) (e (if l (pop l) nil)) (k (if l (pop l) nil)) (lo (if l (meval (pop l)) nil)) (hi (if l (meval (pop l)) nil)) (step (if l (meval (pop l)) 1)) (lf) (n) (q nil)) (if l (wna-err (car fn))) (if (and k (not (or (symbolp k) ($subvarp k)))) (merror (intl:gettext "makelist: second argument must be symbol; found: ~M") k)) (if lo (setq lf (let (($opsubst t)) (maxima-substitute (gensym) k `((lambda) ((mlist) ,k) ,e))))) ;;(if lo (setq lf (subst (gensym) k `((lambda) ((mlist) ,k) ,e) :test #'alike1))) (cond (hi (setq n (add 1 (take '($floor) (div (sub hi lo) step)))) (if (not (integerp n)) (merror (intl:gettext "makelist: noninteger number of list members"))) (dotimes (i n) (push (mfuncall lf (add lo (mul i step))) q)) (setq q (reverse q))) (lo (setq q (mapcar #'(lambda (s) (mfuncall lf s)) (margs lo)))) (t (setq k (cond (k k) (e 1) (t 0))) (if (integerp k) (dotimes (i k) (push e q)) (merror (intl:gettext "makelist: noninteger number of list members"))))) (push '(mlist) q))) ;; defmspec automatically simplifies, I think. (3) One difference between this makelist and the current makelist: (%i1) a : 6$ (%i2) makelist(a[i], a[i], [1,2,3]); apply: found a evaluates to 6 where a function was expected. (%i3) load("stuff-and-junk/makelist.lisp")$ ( (%i4) makelist(a[i], a[i], [1,2,3]); (%o4) [1,2,3] (4) Advice? Makeset is a function that didn't need to be written, I think. And so it goes. I could pattern makeset off my version of makelist? --Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: From willisb at unk.edu Tue Nov 22 14:52:48 2011 From: willisb at unk.edu (Barton Willis) Date: Tue, 22 Nov 2011 14:52:48 -0600 Subject: [Maxima] makeset & makelist In-Reply-To: References: , <0EAC06A7BB444E4B820C29BDD85AAE8B@edwinc367e16bd> Message-ID: If you enjoy breaking stuff: (using my unredacted $makelist) (%i3) makelist(?mplus + 1, ?mplus,1,10); apply: found g6265438 evaluates to 1 where a function was expected. -- an error. To debug this try: debugmode(true); --Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: From woollett at charter.net Tue Nov 22 18:19:56 2011 From: woollett at charter.net (Edwin Woollett) Date: Tue, 22 Nov 2011 16:19:56 -0800 Subject: [Maxima] real and imag part of acosh(x) for real x Message-ID: Maxima thinks the real part of acosh(x) is just acosh(x) and that the imaginary part of acosh(x) is zero. In the range 0.1 <= x <= 0.9 acosh(x) is imaginary, although floating point errors shows a negligible real part. As a result quad_qag cannot cope with acosh(x) in this range. ---------------------------------------------------------- (%i1) realpart(acosh(x)); (%o1) acosh(x) (%i2) imagpart(acosh(x)); (%o2) 0 (%i3) for v:0.1 step 0.1 thru 0.9 do print (" ",v," ",float(acosh(v)))$ 0.1 1.470628905633337*%i 0.2 1.369438406004566*%i 0.3 1.266103672779499*%i 0.4 1.159279480727409*%i 0.5 1.047197551196598*%i-1.1102230246251565E-16 0.6 0.92729521800161*%i 0.7 0.79539883018414*%i+2.2204460492503128E-16 0.8 0.64350110879328*%i 0.9 0.45102681179626*%i-1.1102230246251565E-16 (%i4) quad_qag(acosh(x),x,0.2,0.5,3); (%o4) quad_qag(acosh(x),x,0.2,0.5,3,epsrel = 1.0E-8,epsabs = 0.0,limit = 200) (%i5) quad_qag(imagpart(acosh(x)),x,0.2,0.5,3); (%o5) [0.0,0.0,31,0] (%i6) quad_qag(realpart(acosh(x)),x,0.2,0.5,3); (%o6) quad_qag(acosh(x),x,0.2,0.5,3,epsrel = 1.0E-8,epsabs = 0.0,limit = 200) ---------------- Ted Woollett (v. 5.25.1, Windows) From robert.dodier at gmail.com Wed Nov 23 00:54:10 2011 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 22 Nov 2011 23:54:10 -0700 Subject: [Maxima] More specific maxima version string In-Reply-To: References: Message-ID: On 11/22/11, Raymond Toy wrote: > Now that we are using git, I would like to propose that the maxima version > string contained in *autoconf-version* be more automatic and precise. OK by me. > There is one issue mentioned above. Currently, we have to use "git > describe --tags --dirty" instead of "git describe --dirty" because there > are no annotated tags. We should probably create annotated tags when tag > the releases. I don't know anything about annotated tags. I'm guessing it means attaching an arbitrary string to a tag. If so, I'm against it. I'd rather the version were entirely mechanical. best Robert Dodier From alserkli at inbox.ru Wed Nov 23 05:13:41 2011 From: alserkli at inbox.ru (Alexander Klimov) Date: Wed, 23 Nov 2011 13:13:41 +0200 Subject: [Maxima] More specific maxima version string In-Reply-To: References: Message-ID: On Tue, 22 Nov 2011, Robert Dodier wrote: > > There is one issue mentioned above. Currently, we have to use "git > > describe --tags --dirty" instead of "git describe --dirty" because there > > are no annotated tags. We should probably create annotated tags when tag > > the releases. > > I don't know anything about annotated tags. I'm guessing it means > attaching an arbitrary string to a tag. If so, I'm against it. > I'd rather the version were entirely mechanical. For releases you do need annotated tags to keep information who and when made the release (it is probably a good idea to sign releases). The "string" can be simply the name of the version. To get the tag of the latest tagged commit use: $ git describe --tags $(git rev-list --tags --max-count=1) version-5_25_1 -- Regards, ASK From talon at lpthe.jussieu.fr Wed Nov 23 10:07:23 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 23 Nov 2011 16:07:23 +0000 (UTC) Subject: [Maxima] Integration problem Message-ID: While looking for information on maxima stuff, i fall on a message from Fateman http://www.math.utexas.edu/pipermail/maxima/2001/000479.html so, ten years ago, who complains that several CAS give false answers for the integral integrate(1/sqrt(2-2*cos(x)),x,-%pi/2,%pi/2) I have just tried it on maxima-5.25.1 and it gives: Principal Value (%o3) 0 This is one more problematic result compared to Fateman's list! We have the indication that a principal value occurs somewhere. In fact in the middle of the integration range we have a problem at x=0 where 2-2*cos(x) ~ x^2 and thus we have 1/sqrt(1/x^2) ~ 1/x Which is a divergent integral, as Fateman says. If we postulate that sqrt(x)>0 for x>0, the integral is clearly divergent. If we model the integrand to 1/x around x=0, that is, we choose a change of sign when crossing 0, then this is coherent with a principal value, and indeed the function becomes antisymmetric in x-> -x and the integral is rightly 0. One more problem related to the multivaluedness of square roots. What do you think is the most correct or most convenient way to treat this integral in maxima? -- Michel Talon From toy.raymond at gmail.com Wed Nov 23 14:01:47 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 23 Nov 2011 12:01:47 -0800 Subject: [Maxima] More specific maxima version string In-Reply-To: References: Message-ID: <4ECD512B.7080704@gmail.com> On 11/22/11 10:54 PM, Robert Dodier wrote: > On 11/22/11, Raymond Toy wrote: > >> Now that we are using git, I would like to propose that the maxima version >> string contained in *autoconf-version* be more automatic and precise. > > OK by me. > >> There is one issue mentioned above. Currently, we have to use "git >> describe --tags --dirty" instead of "git describe --dirty" because there >> are no annotated tags. We should probably create annotated tags when tag >> the releases. > > I don't know anything about annotated tags. I'm guessing it means > attaching an arbitrary string to a tag. If so, I'm against it. > I'd rather the version were entirely mechanical. I think all you need to do is say "git tag -a -m " to enter as an annotation for the tag. I assume you've just been doing "git tag ". Not sure what you mean by mechanical. I don't think I'm proposing any change on your part except to use -a and -m. You could even make the comment the tag name. Or whatever. This means you have to tag before you build. It might also mean that versions will always say "dirty" because of the sharefiles.mk issue which we haven't resolved yet. But is useful when someone ways 5.25post doesn't work and someone else says 5.25post does because we can see that the 5.25post versions are actually different via build_info(). Ray From toy.raymond at gmail.com Wed Nov 23 14:01:47 2011 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 23 Nov 2011 12:01:47 -0800 Subject: [Maxima] More specific maxima version string In-Reply-To: References: Message-ID: <4ECD512B.7080704@gmail.com> On 11/22/11 10:54 PM, Robert Dodier wrote: > On 11/22/11, Raymond Toy wrote: > >> Now that we are using git, I would like to propose that the maxima version >> string contained in *autoconf-version* be more automatic and precise. > > OK by me. > >> There is one issue mentioned above. Currently, we have to use "git >> describe --tags --dirty" instead of "git describe --dirty" because there >> are no annotated tags. We should probably create annotated tags when tag >> the releases. > > I don't know anything about annotated tags. I'm guessing it means > attaching an arbitrary string to a tag. If so, I'm against it. > I'd rather the version were entirely mechanical. I think all you need to do is say "git tag -a -m " to enter as an annotation for the tag. I assume you've just been doing "git tag ". Not sure what you mean by mechanical. I don't think I'm proposing any change on your part except to use -a and -m. You could even make the comment the tag name. Or whatever. This means you have to tag before you build. It might also mean that versions will always say "dirty" because of the sharefiles.mk issue which we haven't resolved yet. But is useful when someone ways 5.25post doesn't work and someone else says 5.25post does because we can see that the 5.25post versions are actually different via build_info(). Ray From dcarrera at gmail.com Wed Nov 23 15:53:20 2011 From: dcarrera at gmail.com (Daniel Carrera) Date: Wed, 23 Nov 2011 22:53:20 +0100 Subject: [Maxima] Cannot use "diff" in a function assignment. Message-ID: <4ECD6B50.7030207@gmail.com> Hello, I'm pretty new to Maxima and I wonder why the following doesn't work: (%i1) f(x) := x^3 + 2*x^2 + x - 1; (%o1) ... (%i2) df(x) := diff( f(x), x ) (%o2) ... (%i3) df(2); diff: second argument must be a variable; found 2 I don't understand why this is a problem. It seems like a fairly natural thing to want to do - differentiate a function and use the result as a new function. Strange, because I seem to be able to use diff(f(x),x) in other similar contexts: (%i4) linsolve( [diff( f(x),x) = 2], [x] ); (%o4) [ x = 1/4] (%i5) plot2d( diff(f(x),x), [x,-1,1] ); (%o5) Any ideas? Cheers, Daniel. -- I'm not overweight, I'm undertall. From macrakis at alum.mit.edu Wed Nov 23 16:15:52 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 23 Nov 2011 17:15:52 -0500 Subject: [Maxima] Cannot use "diff" in a function assignment. In-Reply-To: <4ECD6B50.7030207@gmail.com> References: <4ECD6B50.7030207@gmail.com> Message-ID: This is a difficult point for many new users. It appears that you want to define a mathematical function f and then define a mathematical function df which is df/dx. The simplest and most Maxima-like way of doing this is NOT to use use function-definition (which is really subroutine-definition). You'd do it something like this: f: x^3 + 2*x^2 + x - 1; df: diff(f,x)$ Now to get the value of f at a given value, you'd do subst([x=3],f); for df, subst([x=3],df). Another way is ev(f,x=3) and ev(df,x=3), but I don't recommend that (long discussion). Another approach, if you really want to define subroutines, is: f(x) := x^3 + 2*x^2 + x - 1; define(df(x), diff(f(x),x))$ Now you can write f(3) and df(3). Another way to write the "define" is df(x) := ''(diff(f(x),x))$ but I don't recommend that. In particular, it won't work as you expect within programs. Note that in BOTH approaches above, if you redefine f, it will not redefine df! Well, if I go on, I think I will make things more rather than less confusing.... -s On Wed, Nov 23, 2011 at 16:53, Daniel Carrera wrote: > Hello, > > I'm pretty new to Maxima and I wonder why the following doesn't work: > > (%i1) f(x) := x^3 + 2*x^2 + x - 1; > (%o1) ... > > (%i2) df(x) := diff( f(x), x ) > (%o2) ... > > (%i3) df(2); > diff: second argument must be a variable; found 2 > > > > I don't understand why this is a problem. It seems like a fairly natural > thing to want to do - differentiate a function and use the result as a new > function. Strange, because I seem to be able to use diff(f(x),x) in other > similar contexts: > > (%i4) linsolve( [diff( f(x),x) = 2], [x] ); > (%o4) [ x = 1/4] > > (%i5) plot2d( diff(f(x),x), [x,-1,1] ); > (%o5) > > > Any ideas? > > Cheers, > Daniel. > -- > I'm not overweight, I'm undertall. > ______________________________**_________________ > 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 Nov 23 16:37:11 2011 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 23 Nov 2011 22:37:11 +0000 (UTC) Subject: [Maxima] Cannot use "diff" in a function assignment. References: <4ECD6B50.7030207@gmail.com> Message-ID: Daniel Carrera wrote: > Hello, > > I'm pretty new to Maxima and I wonder why the following doesn't work: > > (%i1) f(x) := x^3 + 2*x^2 + x - 1; > (%o1) ... > > (%i2) df(x) := diff( f(x), x ) > (%o2) ... > > (%i3) df(2); > diff: second argument must be a variable; found 2 > > maxima functions are very bizarre objects, in particular evaluation is considerably deferred. In the case above i think that df(x) remains diff(f(x),x) unevaluated, so that when you compute df(2) you get diff(f(2),2) producing the error message you see: the second argument of diff is 2 and not a variable. I think this is because maxima functions are represented internally by mdefine which is "defined" via defmspec, a device which doesn't evaluate the arguments. This causes all sorts of problems when you want to do anything non trivial with maxima functions. Using expressions is far easier. For example if you write (%i11) y: df(x); 2 (%o11) 3 x + 4 x + 1 (%i12) y,x=2; (%o12) 21 > > I don't understand why this is a problem. It seems like a fairly natural > thing to want to do - differentiate a function and use the result as a > new function. Strange, because I seem to be able to use diff(f(x),x) in > other similar contexts: > > (%i4) linsolve( [diff( f(x),x) = 2], [x] ); > (%o4) [ x = 1/4] > > (%i5) plot2d( diff(f(x),x), [x,-1,1] ); > (%o5) > plot passes the functions to be plotted via coerce-float-fun which does all sorts of contortions to evaluate the maxima functions. The typical invocation which does that in plot.lisp looks like: (catch 'errorsw (,float-fun (maybe-realpart (mapply ',expr (list , at gensym-args) t)))))) Besides using new arguments to the functions this runs mapply which is a fundamental maxima evaluation procedure, takes the real part of the result if it is complex and coerces the result to float. I suppose linsolve does something similar i have not checked. > > Any ideas? > > Cheers, > Daniel. -- Michel Talon From dcarrera at gmail.com Wed Nov 23 16:39:37 2011 From: dcarrera at gmail.com (Daniel Carrera) Date: Wed, 23 Nov 2011 23:39:37 +0100 Subject: [Maxima] Cannot use "diff" in a function assignment. In-Reply-To: References: <4ECD6B50.7030207@gmail.com> Message-ID: <4ECD7629.9050203@gmail.com> Thanks. Is there a reason why it is like that? It seems very strange to type "subst([x=3],f)" for what is conceptually a function call. Another question: When you write: define(df(x), diff(f(x),x))$ What does the "$" mean? The 'define' call seems to work without it... In fact... the "$" seems to simply suppress output. Is that all it does? Is there a reason why I shouldn't use the "define" method? It looks clearest to me, and it seems to work well. This is my program: ----------------------- m(x) := a3*x^3 + a4 * x^4 + a5 * x^5 + a6 * x^6 + a7 * x^7; define(dm(x), diff(m(x),x)); define(F(x), expand(m(x)/x^2)); define(dF(x), diff(F(x),x)); define(ddF(x), diff(dF(x),x)); linsolve( [m(1)=1, dm(1)=0, ddF(1)=6, m(1/2)=5/6, dm(1/2)=10/9], [ a3, a4, a5, a6, a7 ] ); ----------------------- If I were to rewrite this using 'substr([x=1],dm)=0' I think the result would be very hard to read. Cheers, Daniel. On 11/23/2011 11:15 PM, Stavros Macrakis wrote: > This is a difficult point for many new users. > > It appears that you want to define a mathematical function f and then > define a mathematical function df which is df/dx. The simplest and most > Maxima-like way of doing this is NOT to use use function-definition (which > is really subroutine-definition). You'd do it something like this: > > f: x^3 + 2*x^2 + x - 1; > df: diff(f,x)$ > > > Now to get the value of f at a given value, you'd do subst([x=3],f); for > df, subst([x=3],df). Another way is ev(f,x=3) and ev(df,x=3), but I don't > recommend that (long discussion). > > Another approach, if you really want to define subroutines, is: > > f(x) := x^3 + 2*x^2 + x - 1; > define(df(x), diff(f(x),x))$ > > > Now you can write f(3) and df(3). > > Another way to write the "define" is > > df(x) := ''(diff(f(x),x))$ > > but I don't recommend that. In particular, it won't work as you expect > within programs. > > Note that in BOTH approaches above, if you redefine f, it will not redefine > df! > > Well, if I go on, I think I will make things more rather than less > confusing.... > > -s > > > > On Wed, Nov 23, 2011 at 16:53, Daniel Carrera wrote: > >> Hello, >> >> I'm pretty new to Maxima and I wonder why the following doesn't work: >> >> (%i1) f(x) := x^3 + 2*x^2 + x - 1; >> (%o1) ... >> >> (%i2) df(x) := diff( f(x), x ) >> (%o2) ... >> >> (%i3) df(2); >> diff: second argument must be a variable; found 2 >> >> >> >> I don't understand why this is a problem. It seems like a fairly natural >> thing to want to do - differentiate a function and use the result as a new >> function. Strange, because I seem to be able to use diff(f(x),x) in other >> similar contexts: >> >> (%i4) linsolve( [diff( f(x),x) = 2], [x] ); >> (%o4) [ x = 1/4] >> >> (%i5) plot2d( diff(f(x),x), [x,-1,1] ); >> (%o5) >> >> >> Any ideas? >> >> Cheers, >> Daniel. >> -- >> I'm not overweight, I'm undertall. >> ______________________________**_________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/**mailman/listinfo/maxima >> > -- I'm not overweight, I'm undertall. From dcarrera at gmail.com Wed Nov 23 16:52:49 2011 From: dcarrera at gmail.com (Daniel Carrera) Date: Wed, 23 Nov 2011 23:52:49 +0100 Subject: [Maxima] Cannot use "diff" in a function assignment. In-Reply-To: References: <4ECD6B50.7030207@gmail.com> Message-ID: <4ECD7941.7040705@gmail.com> Hi Michael, On 11/23/2011 11:37 PM, Michel Talon wrote: > maxima functions are very bizarre objects, in particular evaluation is > considerably deferred. In the case above i think that df(x) remains > diff(f(x),x) unevaluated, so that when you compute df(2) you get > diff(f(2),2) producing the error message you see: the second argument of diff > is 2 and not a variable. I see... weird. Is it possible to force Maxima to evaluate diff(f(x),x) ? I just tried using "ev" and "expand", but neither one worked. > I think this is because maxima functions are represented internally by mdefine > which is "defined" via defmspec, a device which doesn't evaluate the > arguments. This causes all sorts of problems when you want to do anything non > trivial with maxima functions. Using expressions is far easier. For example if > you write > (%i11) y: df(x); > 2 > (%o11) 3 x + 4 x + 1 > (%i12) y,x=2; > (%o12) 21 My problem is very simple. I want to find a polynomial that meets a set of conditions: ----------------------- m(x) := a3*x3 + a4 * x4 + a5 * x5 + a6 * x6 + a7 * x7; define(dm(x), diff(m(x),x)); define(F(x), expand(m(x)/x2)); define(dF(x), diff(F(x),x)); define(ddF(x), diff(dF(x),x)); linsolve( [m(1)=1, dm(1)=0, ddF(1)=6, m(1/2)=5/6, dm(1/2)=10/9], [ a3, a4, a5, a6, a7 ] ); ----------------------- How would you have done this using expressions? It's not obvious to me how that would work. > plot passes the functions to be plotted via coerce-float-fun which does all > sorts of contortions to evaluate the maxima functions. The typical invocation > which does that in plot.lisp looks like: > (catch 'errorsw > (,float-fun > (maybe-realpart (mapply ',expr (list , at gensym-args) t)))))) > Besides using new arguments to the functions this runs mapply which is a > fundamental maxima evaluation procedure, takes the real part of the result if > it is complex and coerces the result to float. I suppose linsolve does > something similar i have not checked. Sounds complicated. I don't understand why evaluating procedures is so difficult. To my naive mind, it sounds like something simple. Cheers, Daniel. -- I'm not overweight, I'm undertall. From fateman at eecs.berkeley.edu Wed Nov 23 17:05:25 2011 From: fateman at eecs.berkeley.edu (Richard Fateman) Date: Wed, 23 Nov 2011 15:05:25 -0800 Subject: [Maxima] Cannot use "diff" in a function assignment. In-Reply-To: <4ECD7941.7040705@gmail.com> References: <4ECD6B50.7030207@gmail.com> <4ECD7941.7040705@gmail.com> Message-ID: <4ECD7C35.50602@eecs.berkeley.edu> Unless you are a good deal more sophisticated, simply do not use define. Use assignment, for which Maxima uses a colon (:). For example, dm1 : at( diff(m(x),x), x=1) although as you have defined m, diff(m(x),x) is 0. From macrakis at alum.mit.edu Wed Nov 23 17:09:54 2011 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 23 Nov 2011 18:09:54 -0500 Subject: [Maxima] Cannot use "diff" in a function assignment. In-Reply-To: <4ECD7941.7040705@gmail.com> References: <4ECD6B50.7030207@gmail.com> <4ECD7941.7040705@gmail.com> Message-ID: I started writing an answer to the "philosophical" question, and realized that I really couldn't do it justice without spending some time with it. I disagree with Michel that Maxima defined functions are "very bizarre objects". They are simply standard programming functions (a.k.a. subroutines); mdefine semantics are standard programming function definitions. They are NOT, and are not intended to be, "mathematical" functions. For better or worse, though, they share the same syntax, so we have both print(3) and sin(3), though those are really very very different concepts. Not to mention diff(f(x),x), which again shares the same syntax, but acts rather differently. The quick answer is: Maxima is not designed to handle mathematical functions like f(x)=a*x using the function definition mechanism. As for > Is it possible to force Maxima to evaluate diff(f(x),x) ? I just tried using "ev" and "expand", but neither one worked. What do you mean by "evaluate diff(f(x),x)"? Do you mean "determine the symbolic derivative of f(x)?" Or do you mean "determine the value of the derivative at a particular value"? I think you mean the latter. Though it is possible to do all this using the function syntax, it really works much better to use expressions. The answer to your problem is very simple -- just don't fight the Maxima approach: m: a3*x3 + a4 * x4 + a5 * x5 + a6 * x6 + a7 * x7; dm: diff(m,x); F: m/x2; dF: diff(F,x); ddF: diff(dF,x); linsolve( [subst(1,x,m)=1, subst(1,x,dm)=0, subst(1,x,ddF)=6, subst(1/2,x,m)=5/6, subst(1/2,x,dm=10/9], [ a3, a4, a5, a6, a7 ] ); Re: "Sounds complicated. I don't understand why evaluating procedures is so difficult. To my naive mind, it sounds like something simple." I don't understand why you are studying the code of coerce-float-fun. But the short answer is: users expect many things to be "automagic", and that gets hard. Users generally don't want to think about things like variable scope, for example. -s On Wed, Nov 23, 2011 at 17:52, Daniel Carrera wrote: > Hi Michael, > > > On 11/23/2011 11:37 PM, Michel Talon wrote: > >> maxima functions are very bizarre objects, in particular evaluation is >> considerably deferred. In the case above i think that df(x) remains >> diff(f(x),x) unevaluated, so that when you compute df(2) you get >> diff(f(2),2) producing the error message you see: the second argument of >> diff >> is 2 and not a variable. >> > > I see... weird. > > Is it possible to force Maxima to evaluate diff(f(x),x) ? I just tried > using "ev" and "expand", but neither one worked. > > > > I think this is because maxima functions are represented internally by >> mdefine >> which is "defined" via defmspec, a device which doesn't evaluate the >> arguments. This causes all sorts of problems when you want to do anything >> non >> trivial with maxima functions. Using expressions is far easier. For >> example if >> you write >> (%i11) y: df(x); >> 2 >> (%o11) 3 x + 4 x + 1 >> (%i12) y,x=2; >> (%o12) 21 >> > > > My problem is very simple. I want to find a polynomial that meets a set of > conditions: > > ----------------------- > m(x) := a3*x3 + a4 * x4 + a5 * x5 + a6 * x6 + a7 * x7; > > define(dm(x), diff(m(x),x)); > define(F(x), expand(m(x)/x2)); > > define(dF(x), diff(F(x),x)); > define(ddF(x), diff(dF(x),x)); > > linsolve( [m(1)=1, dm(1)=0, ddF(1)=6, m(1/2)=5/6, dm(1/2)=10/9], > [ a3, a4, a5, a6, a7 ] ); > ----------------------- > > > How would you have done this using expressions? It's not obvious to me how > that would work. > > > > plot passes the functions to be plotted via coerce-float-fun which does >> all >> sorts of contortions to evaluate the maxima functions. The typical >> invocation >> which does that in plot.lisp looks like: >> (catch 'errorsw >> (,float-fun >> (maybe-realpart (mapply ',expr (list , at gensym-args) t)))))) >> Besides using new arguments to the functions this runs mapply which is a >> fundamental maxima evaluation procedure, takes the real part of the >> result if >> it is complex and coerces the result to float. I suppose linsolve does >> something similar i have not checked. >> > > Sounds complicated. I don't understand why evaluating procedures is so > difficult. To my naive mind, it sounds like something simple. > > > Cheers, > Daniel. > -- > I'm not overweight, I'm undertall. > ______________________________**_________________ > Maxima mailing list > Maxima