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); $$\left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< 0 \\ \mathbf{false}& \mathrm{otherwise}\end{array}\right.$$ (%o2) false (%i3) tex (if x < 0 then foo else bar); $$\left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< 0 \\ {\it bar}& \mathrm{otherwise}\end{array}\right.$$ (%o3) false (%i4) tex (if x < 0 then foo elseif x > 0 then bar else baz); $$\left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< 0 \\ {\it bar} & \mathrm{if}\; x>0 \\ {\it baz}& \mathrm{otherwise} \end{array}\right.$$ (%o4) false (%i5) tex (if x < 0 then foo else if x > 0 then bar else baz); $$\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.$$ 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 "~%\$$~%") . ,(format nil "~%\$$~%"))) + +(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); > > $$> \left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< > 0 \\ \mathbf{false}& \mathrm{otherwise}\end{array}\right. >$$ > > (%o2) false > (%i3) tex (if x < 0 then foo else bar); > > $$> \left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< > 0 \\ {\it bar}& \mathrm{otherwise}\end{array}\right. >$$ > > (%o3) false > (%i4) tex (if x < 0 then foo elseif x > 0 then bar else baz); > > $$> \left\{\begin{array}{ll}{\it foo} & \mathrm{if}\; x< > 0 \\ {\it bar} & \mathrm{if}\; x>0 \\ {\it baz}& \mathrm{otherwise} > \end{array}\right. >$$ > > (%o4) false > (%i5) tex (if x < 0 then foo else if x > 0 then bar else baz); > > $$> \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. >$$ > > > 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 "~%\$$~%") . ,(format nil > "~%\$$~%"))) > + > +(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