From omorr at uns.ns.ac.yu Tue Jan 1 02:01:59 2008 From: omorr at uns.ns.ac.yu (Radovan Omorjan) Date: Tue, 01 Jan 2008 00:01:59 -0800 Subject: [Maxima] Solving linear algebraic eqns. in vector (matrix) notation ? In-Reply-To: <4777404C.8000500@uns.ns.ac.yu> References: <4777404C.8000500@uns.ns.ac.yu> Message-ID: <4779F377.1020506@uns.ns.ac.yu> I've figured out myself how to solve this. It took me some time to realise that equations and unknowns have to be in lists in order to solve them with "solve" or "linsolve". I also realised that I do not need "eigen". Something like transforming matrix m into equation list like: (%i9) eqns : makelist(m[i][1]=0,i,1,6); (%o9) [- n2 + n1 - eps = 0, - n2 + n1 - eps + eps = 0, 1 1 1 2 2 2 1 eps eps 2 1 - n2 + n1 + eps = 0, - n2 + n1 + eps = 0, - n2 + n1 - ---- - ---- = 0, 3 3 2 4 4 1 5 5 2 2 n1 - n2 = 0] 6 6 and solving by: (%i10) linsolve(eqns,n2); (%o10) [n2 = n1 - eps , n2 = n1 - eps + eps , n2 = n1 + eps , 1 1 1 2 2 2 1 3 3 2 - 2 n1 + eps + eps 5 2 1 n2 = n1 + eps , n2 = - ---------------------, n2 = n1 ] 4 4 1 5 2 6 6 will do the job. I should have read the manual more carefuly, sorry. Anyway, I've learned some new things. Radovan Radovan Omorjan wrote: > Dear all! > > I am trying to solve some simple linear algebraic system of equations > using array, vector, matrix notation. > Here is my first attempt: > > (%i1) n1:makelist(n1[k],k,1,6); > (%o1) [n1 , n1 , n1 , n1 , n1 , n1 ] > 1 2 3 4 5 6 > (%i2) n2:makelist(n2[k],k,1,6); > (%o2) [n2 , n2 , n2 , n2 , n2 , n2 ] > 1 2 3 4 5 6 > (%i3) load(eigen); > (%o3) D:/PROGRA~1/MAXIMA~1.0/share/maxima/5.12.0/share/matrix/eigen.mac > (%i4) n1:columnvector(n1); > [ n1 ] > [ 1 ] > [ ] > [ n1 ] > [ 2 ] > [ ] > [ n1 ] > [ 3 ] > (%o4) [ ] > [ n1 ] > [ 4 ] > [ ] > [ n1 ] > [ 5 ] > [ ] > [ n1 ] > [ 6 ] > (%i5) n2:columnvector(n2); > [ n2 ] > [ 1 ] > [ ] > [ n2 ] > [ 2 ] > [ ] > [ n2 ] > [ 3 ] > (%o5) [ ] > [ n2 ] > [ 4 ] > [ ] > [ n2 ] > [ 5 ] > [ ] > [ n2 ] > [ 6 ] > (%i6) S: matrix([-1,0],[1,-1],[0,1],[1,0],[-1/2,-1/2],[0,0]); > [ - 1 0 ] > [ ] > [ 1 - 1 ] > [ ] > [ 0 1 ] > [ ] > (%o6) [ 1 0 ] > [ ] > [ 1 1 ] > [- - - - ] > [ 2 2 ] > [ ] > [ 0 0 ] > (%i7) eps:columnvector(makelist(eps[k],k,1,2)); > [ eps ] > [ 1 ] > (%o7) [ ] > [ eps ] > [ 2 ] > (%i8) m: n1-n2+S.eps; > [ - n2 + n1 - eps ] > [ 1 1 1 ] > [ ] > [ - n2 + n1 - eps + eps ] > [ 2 2 2 1 ] > [ ] > [ - n2 + n1 + eps ] > [ 3 3 2 ] > [ ] > (%o8) [ - n2 + n1 + eps ] > [ 4 4 1 ] > [ ] > [ eps eps ] > [ 2 1 ] > [ - n2 + n1 - ---- - ---- ] > [ 5 5 2 2 ] > [ ] > [ n1 - n2 ] > [ 6 6 ] > > So far so good!. I was trying to figure out how to solve the column > vector m (every element equals to 0) ie. 6 linear equations in 6 > variables. What should I do in order to find, say, vector n2[k],k,1,6 > (I know how to assign values to other variables - if needed)?. On the > other hand, I suppose there must be some other, more elegant way to > work with and solve equations with indexed variables. I might missing > something but could not find in Maxima book or help any examples of > this kind. > > Any comments are appreciated. > Regards,Radovan > From vttoth at vttoth.com Tue Jan 1 17:26:24 2008 From: vttoth at vttoth.com (Viktor T. Toth) Date: Tue, 1 Jan 2008 18:26:24 -0500 Subject: [Maxima] itensor - contracting antisymmetric and symmetric indices In-Reply-To: References: Message-ID: <086e01c84ccd$b9b98910$03fca6c7@VTTOTH.COM> In theory, Itensor should be able to do this: (%i1) load(itensor)$ (%i2) decsym(A,2,0,[anti(all)],[]); (%o2) done (%i3) decsym(S,0,2,[],[sym(all)]); (%o3) done (%i4) ishow(A([i,j],[])*S([],[i,j]))$ i j (%t4) S A i j (%i5) canform(%); (%o5) 0 Well, it doesn't, not yet anyway. It's on my rather longish to-do list. In the meantime, here's an alternative that may be sometimes useful: (%i1) load(itensor)$ (%i2) decsym(S,0,2,[],[sym(all)]); (%o2) done (%i3) components(A([i,j],[]),1/2*(aa([i,j],[])-aa([j,i],[]))); (%o3) done (%i4) ishow('A([i,j],[])*S([],[i,j]))$ i j (%t4) S A i j (%i5) canform(ev(%,A)); (%o5) 0 Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Michal Kowalski Sent: Sunday, December 30, 2007 2:15 PM To: maxima at math.utexas.edu Subject: [Maxima] itensor - contracting antisymmetric and symmetric indices It is well known that contracting two antisymmetric indices with two symmetric ones yields zero. Could itensor package recognize this property? I was unable to get any positive results... (Despite forcing some defcon rules for particular tensors, but I need to learn Maxima about this contraction law in general). Thanks for help, M.D. _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From nanorobocop at gmail.com Tue Jan 1 09:19:10 2008 From: nanorobocop at gmail.com (Mansur Marvanov) Date: Tue, 1 Jan 2008 18:19:10 +0300 Subject: [Maxima] matrices to plot'ing list Message-ID: <478707370801010719m2675a279w911d0553211c4b28@mail.gmail.com> Hello! I have 2 matrix 11x1: (%i1) x:matrix([-3.6],[-3.08],[-2.56],[-2.04],[-1.52],[-1],[-0.48],[0.04],[0.56],[1.08],[1.6])$ (%i2) y:matrix([-2.397],[-0.401],[-0.577],[-1.268],[-0.933],[-0.359],[1.107],[1.300],[1.703],[-0.299],[-1.417])$ What's the easy way to plot this 11 points? My problem is to transform this 2 matrices to this style: (%i12) xx:[10, 20, 30, 40, 50]$ (%i13) yy:[.6, .9, 1.1, 1.3, 1.4]$ (%i14) xy:[[10,.6], [20,.9], [30,1.1], [40,1.3], [50,1.4]]$ From LindnerW at t-online.de Wed Jan 2 02:01:00 2008 From: LindnerW at t-online.de (Wolfgang Lindner) Date: 02 Jan 2008 08:01 GMT Subject: [Maxima] matrices to plot'ing list In-Reply-To: <478707370801010719m2675a279w911d0553211c4b28@mail.gmail.com> References: <478707370801010719m2675a279w911d0553211c4b28@mail.gmail.com> Message-ID: <1J9yXi-1vFj1M0@fwd35.aul.t-online.de> dear Mansur, please look at the functions of package 'draw', e.g. points. There you will find many examples. Package 'descriptive' should offer possibilities, too. HTH Wolfgang "Mansur Marvanov" schrieb: > Hello! > > I have 2 matrix 11x1: > > (%i1) x:matrix([-3.6],[-3.08],[-2.56],[-2.04],[-1.52],[-1],[-0.48],[0.04],[0.56],[1.08],[1.6])$ > > (%i2) y:matrix([-2.397],[-0.401],[-0.577],[-1.268],[-0.933],[-0.359],[1.107],[1.300],[1.703],[-0.299],[-1.417])$ > > What's the easy way to plot this 11 points? My problem is to transform > this 2 matrices to this style: > > (%i12) xx:[10, 20, 30, 40, 50]$ > (%i13) yy:[.6, .9, 1.1, 1.3, 1.4]$ > (%i14) xy:[[10,.6], [20,.9], [30,1.1], [40,1.3], [50,1.4]]$ > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From willisb at unk.edu Wed Jan 2 05:19:42 2008 From: willisb at unk.edu (Barton Willis) Date: Wed, 2 Jan 2008 05:19:42 -0600 Subject: [Maxima] Rounding In-Reply-To: <719BF03D-86E8-4B8D-8EFA-F92B6404E7A0@gmx.net> References: <719BF03D-86E8-4B8D-8EFA-F92B6404E7A0@gmx.net> Message-ID: Try ceiling, floor, and round. Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: maxima at math.utexas.edu >From: Holger Schulz >Sent by: maxima-bounces at math.utexas.edu >Date: 01/02/2008 05:45AM >Subject: [Maxima] Rounding > >I haven't found functions for rounding/truncating rational numbers >yet. Are there some? How are they called? > >Thanks > >hs >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From van.nek at arcor.de Wed Jan 2 05:28:27 2008 From: van.nek at arcor.de (van Nek) Date: Wed, 02 Jan 2008 12:28:27 +0100 Subject: [Maxima] Rounding In-Reply-To: <719BF03D-86E8-4B8D-8EFA-F92B6404E7A0@gmx.net> Message-ID: <477B836B.19497.6B7EFB@van.nek.arcor.de> Holger, there are 'floor' and 'ceiling', which do what their names suggest. (%i1) floor(-22/3); (%o1) - 8 (%i2) ceiling(-22/3); (%o2) - 7 They can deal with more than only rational numbers. Type ? floor or ? ceiling for more information. Also there are 'fix' and 'entier' (two names for one function), which as far as I know do nothing different than 'floor'. Volker van Nek Am 2 Jan 2008 um 11:45 hat Holger Schulz geschrieben: > I haven't found functions for rounding/truncating rational numbers > yet. Are there some? How are they called? > > Thanks > > hs > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From biomates at telefonica.net Wed Jan 2 06:04:06 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 02 Jan 2008 13:04:06 +0100 Subject: [Maxima] matrices to plot'ing list In-Reply-To: <478707370801010719m2675a279w911d0553211c4b28@mail.gmail.com> References: <478707370801010719m2675a279w911d0553211c4b28@mail.gmail.com> Message-ID: <477B7DB6.9000201@telefonica.net> > (%i1) x:matrix([-3.6],[-3.08],[-2.56],[-2.04],[-1.52],[-1],[-0.48],[0.04],[0.56],[1.08],[1.6])$ > > (%i2) y:matrix([-2.397],[-0.401],[-0.577],[-1.268],[-0.933],[-0.359],[1.107],[1.300],[1.703],[-0.299],[-1.417])$ > > What's the easy way to plot this 11 points? > load(draw)$ draw2d(points(addcol(x,y)))$ -- Mario Rodriguez Riotorto www.biomates.net From villate at fe.up.pt Wed Jan 2 06:27:46 2008 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 02 Jan 2008 12:27:46 +0000 Subject: [Maxima] matrices to plot'ing list In-Reply-To: <478707370801010719m2675a279w911d0553211c4b28@mail.gmail.com> References: <478707370801010719m2675a279w911d0553211c4b28@mail.gmail.com> Message-ID: <1199276866.6207.10.camel@bethe> On Tue, 2008-01-01 at 18:19 +0300, Mansur Marvanov wrote: > I have 2 matrix 11x1: > > (%i1) x:matrix([-3.6],[-3.08],[-2.56],[-2.04],[-1.52],[-1],[-0.48],[0.04],[0.56],[1.08],[1.6])$ > > (%i2) y:matrix([-2.397],[-0.401],[-0.577],[-1.268],[-0.933],[-0.359],[1.107],[1.300],[1.703],[-0.299],[-1.417])$ > > What's the easy way to plot this 11 points? My problem is to transform > this 2 matrices to this style: > > (%i12) xx:[10, 20, 30, 40, 50]$ > (%i13) yy:[.6, .9, 1.1, 1.3, 1.4]$ > (%i14) xy:[[10,.6], [20,.9], [30,1.1], [40,1.3], [50,1.4]]$ Wolfgang Lindner has already told you what he thinks is the easiest way. In my opinion, the easiest way is the following: (%i3) xx: transpose(x)[1]$ (%i4) yy: transpose(y)[1]$ (%i5) plot2d([discrete,xx,yy],[style,points])$ Regards, Jaime Villate From villate at fe.up.pt Wed Jan 2 09:39:05 2008 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 02 Jan 2008 15:39:05 +0000 Subject: [Maxima] Evaluating boolean expressions In-Reply-To: References: Message-ID: <1199288345.7251.6.camel@bethe> On Wed, 2008-01-02 at 13:50 +0100, Holger Schulz wrote: > but that doesn't work for boolean expression. I expected 5>3 to be > evaluated to true. But it wasn't: > > > (%i42) 5>3; > > (%o42) 5>3 > > Is there any trick to force the evaluation of boolean expressions? (%i1) is(5>3); (%o1) true From biomates at telefonica.net Wed Jan 2 09:41:40 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 02 Jan 2008 16:41:40 +0100 Subject: [Maxima] Evaluating boolean expressions In-Reply-To: References: Message-ID: <477BB0B4.5040709@telefonica.net> Holger Schulz escribi?: > Numeric expressions are evaluated, like > > (%i37) 5-3; > > (%o37) 2 > > but that doesn't work for boolean expression. I expected 5>3 to be > evaluated to true. But it wasn't: > > > (%i42) 5>3; > > (%o42) 5>3 > > Is there any trick to force the evaluation of boolean expressions? > > try is(5>3); The 'is' command is not necessary in other contexts: if 5>3 then 1 else 0; or 5>3 or 2>4; -- Mario Rodriguez Riotorto www.biomates.net From macrakis at alum.mit.edu Wed Jan 2 10:32:24 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 2 Jan 2008 11:32:24 -0500 Subject: [Maxima] matrices to plot'ing list In-Reply-To: <478707370801010719m2675a279w911d0553211c4b28@mail.gmail.com> References: <478707370801010719m2675a279w911d0553211c4b28@mail.gmail.com> Message-ID: <8b356f880801020832i32ea83d0n849cae0cab7ee6f3@mail.gmail.com> On Jan 1, 2008 10:19 AM, Mansur Marvanov wrote: > I have 2 matrix 11x1: > (%i1) x:matrix([-3.6],[-3.08],[-2.56],[-2.04],[-1.52],[-1],[-0.48],[0.04 > ],[0.56],[1.08],[1.6])$ > (%i2) y:matrix([-2.397],[-0.401],[-0.577],[-1.268],[-0.933],[-0.359],[ > 1.107],[1.300],[1.703],[-0.299],[-1.417])$ > What's the easy way to plot this 11 points? My problem is to transform > this 2 matrices to this style: > > (%i12) xx:[10, 20, 30, 40, 50]$ > (%i13) yy:[.6, .9, 1.1, 1.3, 1.4]$ > (%i14) xy:[[10,.6], [20,.9], [30,1.1], [40,1.3], [50,1.4]]$ > I'll answer about the structural transformations -- not things specific to plotting. In Maxima, a matrix is represented as the operator "matrix" applied to a list of rows, each of which is a list of columns. So to convert m: matrix([1],[2],[3]) to the list [1,2,3] you have quite a few options: 1) The most direct, general, generalizable, and straightforward: makelist( m[i,1], i, 1, length(m) ) 2) Taking advantage of the matrix representation: maplist(first,m) or equivalently maplist(lambda([r],r[1]), m) 3) Taking advantage of the matrix representation a different way: transpose(m)[1] or first(transpose(m)) 4) Getting trickier: apply(append,args(m)) or xreduce(append,args(m)) I would recommend approach (1) because it relies the least on the peculiarities of Maxima's representation, acts consistently with other representations (hasharrays) and other dimensions of matrix, and generalizes naturally to a plethora of cases, e.g. extract the diagonal elements makelist(m[i,i],i,1,length(m))) or extract pairs from two matrices makelist( [m[i,1], n[i,1]], i, 1, length(m) ) The other ones are cute shortcuts -- and some are more efficient (but who cares) -- but are brittle and don't teach you techniques you can use in other cases. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080102/f5468b20/attachment.htm From macrakis at alum.mit.edu Wed Jan 2 10:48:19 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 2 Jan 2008 11:48:19 -0500 Subject: [Maxima] Rounding In-Reply-To: <719BF03D-86E8-4B8D-8EFA-F92B6404E7A0@gmx.net> References: <719BF03D-86E8-4B8D-8EFA-F92B6404E7A0@gmx.net> Message-ID: <8b356f880801020848w7cfba8depc99766dffa22da2c@mail.gmail.com> On Jan 2, 2008 5:45 AM, Holger Schulz wrote: > I haven't found functions for rounding/truncating rational numbers > yet. Are there some? How are they called? > ceiling: next largest integer floor: next smallest integer truncate: next integer closer to 0 round: nearest integer, preferring evens to odds for ties (if you want old-fashioned rounding, use floor(x+1/2) ) x -5/3 -1/2 -1/3 0 1/2 3/2 5/2 8/3 ceiling -1 0 0 0 1 2 3 3 floor -2 -1 -1 0 0 1 2 2 truncate -1 0 0 0 0 1 2 2 round -2 0 0 0 0 2 2 3 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080102/8fd32816/attachment.htm From macrakis at alum.mit.edu Wed Jan 2 13:00:23 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 2 Jan 2008 14:00:23 -0500 Subject: [Maxima] Rounding In-Reply-To: <9152CD25-28EC-4C40-B818-86BA7613DBDC@gmx.net> References: <719BF03D-86E8-4B8D-8EFA-F92B6404E7A0@gmx.net> <8b356f880801020848w7cfba8depc99766dffa22da2c@mail.gmail.com> <9152CD25-28EC-4C40-B818-86BA7613DBDC@gmx.net> Message-ID: <8b356f880801021100x1a3a43efn4f686af17d401277@mail.gmail.com> This method, called *round-to-even, unbiased rounding*, *convergent rounding *, or *statistician's rounding* avoids biasing results upwards. See the relevant section in the Wikipedia article Rounding . -s On Jan 2, 2008 1:44 PM, Holger Schulz wrote: > > Am 2008-01-02 um 17:48 schrieb Stavros Macrakis: > > > round: nearest integer, preferring evens to odds for ties > > Why is that defined this way? > > Thanks. > > hs > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080102/ca141f9a/attachment.htm From macrakis at alum.mit.edu Wed Jan 2 13:01:32 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 2 Jan 2008 14:01:32 -0500 Subject: [Maxima] Rounding In-Reply-To: <8b356f880801021100x1a3a43efn4f686af17d401277@mail.gmail.com> References: <719BF03D-86E8-4B8D-8EFA-F92B6404E7A0@gmx.net> <8b356f880801020848w7cfba8depc99766dffa22da2c@mail.gmail.com> <9152CD25-28EC-4C40-B818-86BA7613DBDC@gmx.net> <8b356f880801021100x1a3a43efn4f686af17d401277@mail.gmail.com> Message-ID: <8b356f880801021101o77728c85n8afceb89795f0fda@mail.gmail.com> And anyway, if you want the rounding-up method, it is easy enough to write as floor(x+1/2). On Jan 2, 2008 2:00 PM, Stavros Macrakis wrote: > This method, called *round-to-even, unbiased rounding*, *convergent > rounding*, or *statistician's rounding* avoids biasing results upwards. > See the relevant section in the Wikipedia article Rounding > . > > -s > > > On Jan 2, 2008 1:44 PM, Holger Schulz wrote: > > > > > Am 2008-01-02 um 17:48 schrieb Stavros Macrakis: > > > > > round: nearest integer, preferring evens to odds for ties > > > > Why is that defined this way? > > > > Thanks. > > > > hs > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080102/728c4601/attachment.htm From robledo.jaime at gmail.com Wed Jan 2 21:44:53 2008 From: robledo.jaime at gmail.com (Jaime Robledo) Date: Wed, 2 Jan 2008 19:44:53 -0800 Subject: [Maxima] Maxima's unacceptable error Message-ID: In Maxima, the polynomial (x-4)^2*(x-2)^3*(x-1)*(x+3) has two complex roots and only one integer root. Try it yourself: %i1 (x-4)^2*(x-2)^3*(x-1)*(x+3); %i2 allroots(%); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080102/ea2d1f84/attachment.htm From biomates at telefonica.net Thu Jan 3 10:50:59 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 03 Jan 2008 17:50:59 +0100 Subject: [Maxima] Maxima's unacceptable error In-Reply-To: References: Message-ID: <477D1273.70100@telefonica.net> Jaime Robledo escribi?: > In Maxima, the polynomial (x-4)^2*(x-2)^3*(x-1)*(x+3) has two complex roots > and only one integer root. Try it yourself: > > %i1 (x-4)^2*(x-2)^3*(x-1)*(x+3); > %i2 allroots(%); Hello, allroots is a numerical solver and roots are approximate. See that imaginary parts are near zero. I don't know if it is possible to control its accuracy; maybe someone in the list can tell us something about this. According to documentation, you can try allroots(%i*p) and compare results. A symbolic solver gives better results: (%i6) (x-4)^2*(x-2)^3*(x-1)*(x+3)$ (%i7) solve(%); (%o7) [x = - 3, x = 1, x = 2, x = 4] Jaime, I have passed your post to the Maxima mailing list, since obviously your message is not spam. If you are interested in participating in this mailing list, please proceed with your subscription at http://maxima.sourceforge.net/maximalist.html Thanks a lot for your interest in Maxima. - Mario Rodriguez Riotorto www.biomates.net From raymond.toy at ericsson.com Thu Jan 3 10:59:18 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Thu, 03 Jan 2008 11:59:18 -0500 Subject: [Maxima] Maxima's unacceptable error In-Reply-To: References: Message-ID: <477D1466.8050004@ericsson.com> Jaime Robledo wrote: > In Maxima, the polynomial (x-4)^2*(x-2)^3*(x-1)*(x+3) has two complex roots > and only one integer root. Try it yourself: > > %i1 (x-4)^2*(x-2)^3*(x-1)*(x+3); > %i2 allroots(%); I get: [x = .9999999999999992, x = 4.2734553247153e-5 %i + 1.99995756513013, x = 1.99995756513013 - 4.2734553247153e-5 %i, x = 2.000084872600651, x = 3.99994945773703, x = - 2.999999999941612, x = 4.000050539343674] which looks like a root near 1, -3, two roots near 4 and 3 roots near 2. The repeated roots usually makes the polynomial ill conditioned for a numerical root finder. If you wanted exact roots, perhaps solve would produce the results you're looking for? Ray From raymond.toy at ericsson.com Thu Jan 3 11:07:35 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Thu, 03 Jan 2008 12:07:35 -0500 Subject: [Maxima] Maxima's unacceptable error In-Reply-To: <477D1273.70100@telefonica.net> References: <477D1273.70100@telefonica.net> Message-ID: <477D1657.4060501@ericsson.com> Mario Rodriguez wrote: > Jaime Robledo escribi?: >> In Maxima, the polynomial (x-4)^2*(x-2)^3*(x-1)*(x+3) has two complex roots >> and only one integer root. Try it yourself: >> >> %i1 (x-4)^2*(x-2)^3*(x-1)*(x+3); >> %i2 allroots(%); > Hello, > > allroots is a numerical solver and roots are approximate. See that > imaginary parts are near zero. I don't know if it is possible to control > its accuracy; maybe someone in the list can tell us something about this. An alternative might be to use polyroots, which you can get from load(jtroot3). This is essentially the same algorithm as allroots, but supports bfloat arithmetic. If I set fpprec to 32, I get the roots: [9.9999999999999999999999999999999b-1 - 4.2370458776519188767231514736868b-33 %i, 2.0967098044841547417705251129837b-11 %i + 1.999999999996426866873956584756b0, 1.9509670336642699191457056558385b-31 %i - 3.0000000000000000000000000000005b0, 1.9999999999836285277997026851267b0 - 1.3577973543378557813146327177067b-11 %i, 2.0000000000199446053263407300922b0 - 7.3891245014629895950001484527873b-12 %i, 4.8135821109982436660981576396279b-15 %i + 4.0000000000000008869298470996269b0, 3.9999999999999991130701529003988b0 - 4.8135821109982534157333151111319b-15 %i] And prt_root_error tells me that the estimated errors in the roots are: [8.234297913969850316964397927954b-31, 4.9446128309052513207164850565785b-9, 6.0819981869720905951308760004527b-31, 4.9736209677990489185125295584204b-9, 4.8869211713208376093083688645524b-9, 3.5862126603415141455614873576955b-15, 3.57319044991954585353389212079b-15] Thus, the single root at 1 is very accurate, as is the single root at -3. The rest have reduced accuracy because they are repeated. Ray From biomates at telefonica.net Thu Jan 3 11:18:28 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 03 Jan 2008 18:18:28 +0100 Subject: [Maxima] Maxima's unacceptable error In-Reply-To: <477D1657.4060501@ericsson.com> References: <477D1273.70100@telefonica.net> <477D1657.4060501@ericsson.com> Message-ID: <477D18E4.9050609@telefonica.net> > An alternative might be to use polyroots, which you can get from > load(jtroot3). This is essentially the same algorithm as allroots, > but supports bfloat arithmetic. If I set fpprec to 32, I get the roots: > Thanks! I didn't know anything about polyroots. -- Mario Rodriguez Riotorto www.biomates.net From macrakis at alum.mit.edu Thu Jan 3 12:40:27 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 3 Jan 2008 13:40:27 -0500 Subject: [Maxima] Maxima's unacceptable error In-Reply-To: References: Message-ID: <8b356f880801031040x212f3723p385b8142e3bdc36a@mail.gmail.com> Maxima has several different ways to solve equations. If you want an exact solution (when there is one), try solve: eq: (x-4)^2*(x-2)^3*(x-1)*(x+3)$ solve(eq,x) => [x=2,x=4,x=-3,x=1] If you want to find real roots numerically, use realroots, which in this case produces exact results: realroots(eq,x) => [x=2,x=4,x=-3,x=1] If you want to find complex roots numerically, use allroots: [x = 1.0,x = 4.273455E-5*%i+1.99996,x = 1.99996-4.273455E-5*%i, x = 2.00008,x = 3.99995,x = -3.0,x = 4.00005] These roots differ from the exact roots by [7.77E-16, 6.02E-5, 6.02E-5, 8.49E-5, 5.05E-5, 5.84E-11, 5.05E-5] which is not bad for a numerical approximation in the complex plane. If you follow the suggestion in the documentation for allroots and try allroots(%i*eq), you get even closer, with the differences being: [4.0E-15, 3.46E-7, 1.74E-7, 1.73E-7, 1.31E-9, 4.81E-15, 1.31E-9] -s On Jan 2, 2008 10:44 PM, Jaime Robledo wrote: > In Maxima, the polynomial (x-4)^2*(x-2)^3*(x-1)*(x+3) has two complex > roots > and only one integer root. Try it yourself: > > %i1 (x-4)^2*(x-2)^3*(x-1)*(x+3); > %i2 allroots(%); > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080103/cb0c3107/attachment.htm From sen1 at math.msu.edu Fri Jan 4 10:07:29 2008 From: sen1 at math.msu.edu (S. Newhouse) Date: Fri, 04 Jan 2008 11:07:29 -0500 Subject: [Maxima] implicit derivative problem Message-ID: <477E59C1.5060107@math.msu.edu> Hello, The package 'impdiff.mac' is supposed to do implicit derivatives. Either it does not work in the current version of maxima, or I son't know how to use it. I tried the example in the source file given by the following lines /* the following example will fill the array f with derivatives array(f,2,3,function) f[0,0]:x^2+y^3-z^4=0 implicit_derivative(f,[x,y],[2,3],z) */ (%i2) load(impdiff); (%o2) /usr/local/share/maxima/5.14.0/share/contrib/impdiff.mac (%i3) array(f,2,3,function); (%o3) f (%i4) f[0,0]:x^2+y^3-z^4=0; 4 3 2 (%o4) - z + y + x = 0 (%i5) implicit_derivative(f,[x,y],[2,3],z); Second argument to `fillarray' must be an array or list: makeOrders([x, y], [2, 3]) #0: implicit_derivative(f=f,indvarlist=[x,y],orderlist=[2,3],depvar=z)(impdiff.mac line 36) -- an error. To debug this try debugmode(true); Any suggestions? TIA, -sen From rswarbrick at googlemail.com Fri Jan 4 10:11:46 2008 From: rswarbrick at googlemail.com (Rupert Swarbrick) Date: Fri, 04 Jan 2008 16:11:46 +0000 Subject: [Maxima] Bug 607079 In-Reply-To: References: <1198887738.3271.70.camel@herring> Message-ID: <1199463106.4071.2.camel@herring> Drat, I'm an idiot and just sent this to Robert Dodier before. So here it is for the whole list, because I think the questions at the end are relevant. On a different topic, has anyone had a chance to look at my post re bug 580721? I'm very happy to alter what I did etc. but I think it's a worthwhile change and would love to see it committed. Rupert On Sat, 2007-12-29 at 09:47 -0700, Robert Dodier wrote: > On 12/28/07, Rupert Swarbrick wrote: > > > This just requires a trivial call to delete-duplicates at the > > appropriate place. To find the appropriate place was less than trivial, > > so I reformatted $solve and added comments (apart from the addition of > > the delete-duplicates call, there's no code _changes_ just > > reformatting). > > Rupert, thanks a lot for looking into this. At this point I'd like to > recommend that you separate the diff into two diffs: one which only > changes comments and format, and one which has the functional changes. > That way it is much easier to see what is going on when examining > the cvs history. Although there have been many cvs commits which > mix functional and non-functional changes, it's not too late to start > separating them. > Hokey dokey! Sorry I didn't at first - I had to reformat the function to understand it so that came first! :P So there are three states: HEAD ---------->-\---------------\ (v1.17) | | |<-1.diff v | (teeny) | | | functionality --<-/ | <- 3.diff changed -->-\ | | | |<-2.diff v | | formatting ----<-/---------------/ too Hope this stellar ascii art makes sense! The diffs are attached. A question for Andrej if he's reading this: 1. Why are you dropping the nzlist stuff? I didn't really understand it, so I presume it's pointless, but can you explain what it did/was supposed to do? 2. (More important) Do you want to use *eql or eql on line 130? I'm not sure though so this is a genuine question! A question for everyone (!) I don't understand the idiom such as at the top of solve where the prog defines local variables $keepfloat and $ratfac. These variables aren't used again in this function. Does this stop changes in a called function propagating globally or something? Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: 1.diff Type: text/x-patch Size: 681 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080104/82abeb6c/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 2.diff Type: text/x-patch Size: 5699 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080104/82abeb6c/attachment-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 3.diff Type: text/x-patch Size: 5679 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080104/82abeb6c/attachment-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 307 bytes Desc: This is a digitally signed message part Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080104/82abeb6c/attachment.pgp From raymond.toy at ericsson.com Fri Jan 4 10:19:19 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Fri, 04 Jan 2008 11:19:19 -0500 Subject: [Maxima] Bug 607079 In-Reply-To: <1199463106.4071.2.camel@herring> References: <1198887738.3271.70.camel@herring> <1199463106.4071.2.camel@herring> Message-ID: <477E5C87.3000104@ericsson.com> Rupert Swarbrick wrote: > I don't understand the idiom such as at the top of solve where the prog > defines local variables $keepfloat and $ratfac. These variables aren't > used again in this function. Does this stop changes in a called function > propagating globally or something? prog binds those variables to nil by default. And since $keepfloat and $ratfac are special variables, they're bound to nil for all the functions called by solve. Ray From andrej.vodopivec at gmail.com Fri Jan 4 10:48:10 2008 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Fri, 4 Jan 2008 17:48:10 +0100 Subject: [Maxima] Bug 607079 In-Reply-To: <1199463106.4071.2.camel@herring> References: <1198887738.3271.70.camel@herring> <1199463106.4071.2.camel@herring> Message-ID: <7775b21a0801040848s4369dc47j79fdbcab12455457@mail.gmail.com> On Jan 4, 2008 5:11 PM, Rupert Swarbrick wrote: > A question for Andrej if he's reading this: > > 1. Why are you dropping the nzlist stuff? I didn't really understand it, > so I presume it's pointless, but can you explain what it did/was > supposed to do? > 2. (More important) Do you want to use *eql or eql on line 130? I'm not > sure though so this is a genuine question! > *eql is a a maxima list of original equations. eql is a lisp list of equations (actually rhs - lhs). nzlist was a macro which counted the number of non-trivial equations in *eql. All this was used when solve did not get a list of variables to solve for, so it had to get the variables from the list of equations. It did this by calling listofvars on *eql or eql. This is obviously a bug since eql is not a maxima list. The difference between the new behavior and the old is only when all equations are trivial and there is no list of variables. The new behavior is correct and the old one caused bug 1856636. I think this was intended to optimize the calls to listofvars. listofvars(a=b) could take a long time when a-b=0. HTH, -- Andrej From rswarbrick at googlemail.com Fri Jan 4 12:00:21 2008 From: rswarbrick at googlemail.com (Rupert Swarbrick) Date: Fri, 04 Jan 2008 18:00:21 +0000 Subject: [Maxima] Bug 607079 In-Reply-To: <7775b21a0801040848s4369dc47j79fdbcab12455457@mail.gmail.com> References: <1198887738.3271.70.camel@herring> <1199463106.4071.2.camel@herring> <7775b21a0801040848s4369dc47j79fdbcab12455457@mail.gmail.com> Message-ID: <1199469621.12395.0.camel@herring> On Fri, 2008-01-04 at 17:48 +0100, Andrej Vodopivec wrote: > On Jan 4, 2008 5:11 PM, Rupert Swarbrick wrote: > > A question for Andrej if he's reading this: > > > > 1. Why are you dropping the nzlist stuff? I didn't really understand it, > > so I presume it's pointless, but can you explain what it did/was > > supposed to do? > > 2. (More important) Do you want to use *eql or eql on line 130? I'm not > > sure though so this is a genuine question! > > > > *eql is a a maxima list of original equations. eql is a lisp list of > equations (actually rhs - lhs). nzlist was a macro which counted the > number of non-trivial equations in *eql. All this was used when solve > did not get a list of variables to solve for, so it had to get the > variables from the list of equations. It did this by calling > listofvars on *eql or eql. This is obviously a bug since eql is not a > maxima list. The difference between the new behavior and the old is > only when all equations are trivial and there is no list of variables. > The new behavior is correct and the old one caused bug 1856636. I > think this was intended to optimize the calls to listofvars. > listofvars(a=b) could take a long time when a-b=0. > > HTH, Ah, thanks. That makes much more sense now. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 307 bytes Desc: This is a digitally signed message part Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080104/8c7e667e/attachment.pgp From jordigh at gmail.com Sat Jan 5 11:39:20 2008 From: jordigh at gmail.com (=?ISO-8859-1?Q?Jordi_Guti=E9rrez_Hermoso?=) Date: Sat, 5 Jan 2008 11:39:20 -0600 Subject: [Maxima] Simplifying complex expressions Message-ID: <9543b3a40801050939o60458b5ah7fa277ca331ffaf@mail.gmail.com> Is there an easy way to get Maxima to say that (1-i)/(1+i) = i? - Jordi G. H. From robert.dodier at gmail.com Sat Jan 5 11:50:54 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 5 Jan 2008 10:50:54 -0700 Subject: [Maxima] implicit derivative problem In-Reply-To: <477E59C1.5060107@math.msu.edu> References: <477E59C1.5060107@math.msu.edu> Message-ID: On 1/4/08, S. Newhouse wrote: > /* the following example will fill the array f with derivatives > array(f,2,3,function) > f[0,0]:x^2+y^3-z^4=0 > implicit_derivative(f,[x,y],[2,3],z) */ > > (%i2) load(impdiff); > (%o2) /usr/local/share/maxima/5.14.0/share/contrib/impdiff.mac > (%i3) array(f,2,3,function); > (%o3) f > (%i4) f[0,0]:x^2+y^3-z^4=0; > 4 3 2 > (%o4) - z + y + x = 0 > (%i5) implicit_derivative(f,[x,y],[2,3],z); > > Second argument to `fillarray' must be an array or list: > makeOrders([x, y], [2, 3]) > #0: > implicit_derivative(f=f,indvarlist=[x,y],orderlist=[2,3],depvar=z)(impdiff.mac > line 36) > -- an error. To debug this try debugmode(true); I think there are 2 problems here. (1) You need load("makeOrders") first. (2) The array(f,2,3,function) isn't needed by Maxima, and its presence triggers an error about something not being an array. Seems to work OK if it is omitted. (%i1) display2d : false; (%o1) false (%i2) load (impdiff); (%o2) "/usr/local/share/maxima/5.14.0cvs/share/contrib/impdiff.mac" (%i3) load ("makeOrders"); (%o3) "/usr/local/share/maxima/5.14.0cvs/share/contrib/makeOrders.mac" (%i4) f[0,0] : x^2 + y^3 - z^4 = 0; (%o4) -z^4+y^3+x^2 = 0 (%i5) implicit_derivative (f, [x, y], [2, 3], z); (%o5) munlocal() (%i6) arrayinfo (f); (%o6) [hashed,2,[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3], [2,0],[2,1],[2,2],[2,3]] (%i7) listarray (f); (%o7) [-z^4+y^3+x^2 = 0,3*y^2/(4*z^3), (24*y*z^4-27*y^4)/(16*z^7), (96*z^8-648*y^3*z^4+567*y^6)/(64*z^11),x/(2*z^3), -9*x*y^2/(8*z^7),-(72*x*y*z^4-189*x*y^4)/(32*z^11), -(288*x*z^8-4536*x*y^3*z^4+6237*x*y^6)/(128*z^15), (2*z^4-3*x^2)/(4*z^7),-(18*y^2*z^4-63*x^2*y^2)/(16*z^11), -(144*y*z^8+(-378*y^4-504*x^2*y)*z^4+2079*x^2*y^4) /(64*z^15), -(576*z^12+(-9072*y^3-2016*x^2)*z^8 +(12474*y^6+49896*x^2*y^3)*z^4-93555*x^2*y^6) /(256*z^19)] It seems strange for implicit_derivative to return munlocal(). Hmm. Hope this helps, Robert Dodier From macrakis at alum.mit.edu Sat Jan 5 12:21:58 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 5 Jan 2008 13:21:58 -0500 Subject: [Maxima] Simplifying complex expressions In-Reply-To: <9543b3a40801050939o60458b5ah7fa277ca331ffaf@mail.gmail.com> References: <9543b3a40801050939o60458b5ah7fa277ca331ffaf@mail.gmail.com> Message-ID: <8b356f880801051021k439e94et7f49a76d1c5707c7@mail.gmail.com> On Jan 5, 2008 12:39 PM, Jordi Guti?rrez Hermoso wrote: Is there an easy way to get Maxima to say that (1-i)/(1+i) = i? No, I'm afraid not. Perhaps because it is actually -i. :-) Remember that Maxima represents sqrt(-1) as %i: rectform((1-%i)/(1+%i)) => -%i Another way is: rat((1-%i)/(1+%i)), algebraic => -%i. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080105/1b2bc11e/attachment.htm From sen1 at math.msu.edu Sat Jan 5 12:51:52 2008 From: sen1 at math.msu.edu (S. Newhouse) Date: Sat, 05 Jan 2008 13:51:52 -0500 Subject: [Maxima] implicit derivative problem In-Reply-To: References: <477E59C1.5060107@math.msu.edu> Message-ID: <477FD1C8.9010703@math.msu.edu> Robert Dodier wrote: > On 1/4/08, S. Newhouse wrote: > > >> /* the following example will fill the array f with derivatives >> array(f,2,3,function) >> f[0,0]:x^2+y^3-z^4=0 >> implicit_derivative(f,[x,y],[2,3],z) */ >> >> (%i2) load(impdiff); >> (%o2) /usr/local/share/maxima/5.14.0/share/contrib/impdiff.mac >> (%i3) array(f,2,3,function); >> (%o3) f >> (%i4) f[0,0]:x^2+y^3-z^4=0; >> 4 3 2 >> (%o4) - z + y + x = 0 >> (%i5) implicit_derivative(f,[x,y],[2,3],z); >> >> Second argument to `fillarray' must be an array or list: >> makeOrders([x, y], [2, 3]) >> #0: >> implicit_derivative(f=f,indvarlist=[x,y],orderlist=[2,3],depvar=z)(impdiff.mac >> line 36) >> -- an error. To debug this try debugmode(true); >> > > I think there are 2 problems here. > (1) You need load("makeOrders") first. > (2) The array(f,2,3,function) isn't needed by Maxima, and its presence > triggers an error about something not being an array. Seems to work > OK if it is omitted. > > (%i1) display2d : false; > (%o1) false > (%i2) load (impdiff); > (%o2) "/usr/local/share/maxima/5.14.0cvs/share/contrib/impdiff.mac" > (%i3) load ("makeOrders"); > (%o3) "/usr/local/share/maxima/5.14.0cvs/share/contrib/makeOrders.mac" > (%i4) f[0,0] : x^2 + y^3 - z^4 = 0; > (%o4) -z^4+y^3+x^2 = 0 > (%i5) implicit_derivative (f, [x, y], [2, 3], z); > (%o5) munlocal() > (%i6) arrayinfo (f); > (%o6) [hashed,2,[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3], > [2,0],[2,1],[2,2],[2,3]] > (%i7) listarray (f); > (%o7) [-z^4+y^3+x^2 = 0,3*y^2/(4*z^3), > (24*y*z^4-27*y^4)/(16*z^7), > (96*z^8-648*y^3*z^4+567*y^6)/(64*z^11),x/(2*z^3), > -9*x*y^2/(8*z^7),-(72*x*y*z^4-189*x*y^4)/(32*z^11), > -(288*x*z^8-4536*x*y^3*z^4+6237*x*y^6)/(128*z^15), > (2*z^4-3*x^2)/(4*z^7),-(18*y^2*z^4-63*x^2*y^2)/(16*z^11), > -(144*y*z^8+(-378*y^4-504*x^2*y)*z^4+2079*x^2*y^4) > /(64*z^15), > -(576*z^12+(-9072*y^3-2016*x^2)*z^8 > +(12474*y^6+49896*x^2*y^3)*z^4-93555*x^2*y^6) > /(256*z^19)] > > > It seems strange for implicit_derivative to return munlocal(). Hmm. > > Hope this helps, > > Robert Dodier > . > > Hi Robert, Your solution works--thanks. Actually, I looked at the source for impdiff.mac and it contains two functions 'mlocal' and 'munlocal' which don't seem to be needed. Apparently they are lisp funcions defined in mlisp.lisp. I removed them from impdiff.mac, saved the modified version as 'my_impdiff.mac'. This versions seems to work fine with your method, so I don't see the need for mlocal and munlocal anyway. -sen From dan.stanger at ieee.org Sat Jan 5 17:40:48 2008 From: dan.stanger at ieee.org (Dan Stanger) Date: Sat, 05 Jan 2008 18:40:48 -0500 Subject: [Maxima] implicit derivative problem In-Reply-To: <477FD1C8.9010703@math.msu.edu> References: <477E59C1.5060107@math.msu.edu> <477FD1C8.9010703@math.msu.edu> Message-ID: <47801580.3080409@ieee.org> Hello All, The purpose of mlocal and munlocal was to get this code to work with the commercial macsyma, for which it was originally written. local is used to keep array definitions from becoming global, which is necessary for the commercial macsyma as unnamed arrays were never implemented. Commercial macsyma support seems to be less and less useful, as development has stopped on it. Dan Stanger S. Newhouse wrote: >Robert Dodier wrote: > > >>On 1/4/08, S. Newhouse wrote: >> >> >> >> >>>/* the following example will fill the array f with derivatives >>>array(f,2,3,function) >>>f[0,0]:x^2+y^3-z^4=0 >>>implicit_derivative(f,[x,y],[2,3],z) */ >>> >>>(%i2) load(impdiff); >>>(%o2) /usr/local/share/maxima/5.14.0/share/contrib/impdiff.mac >>>(%i3) array(f,2,3,function); >>>(%o3) f >>>(%i4) f[0,0]:x^2+y^3-z^4=0; >>> 4 3 2 >>>(%o4) - z + y + x = 0 >>>(%i5) implicit_derivative(f,[x,y],[2,3],z); >>> >>>Second argument to `fillarray' must be an array or list: >>>makeOrders([x, y], [2, 3]) >>>#0: >>>implicit_derivative(f=f,indvarlist=[x,y],orderlist=[2,3],depvar=z)(impdiff.mac >>>line 36) >>> -- an error. To debug this try debugmode(true); >>> >>> >>> >>I think there are 2 problems here. >>(1) You need load("makeOrders") first. >>(2) The array(f,2,3,function) isn't needed by Maxima, and its presence >>triggers an error about something not being an array. Seems to work >>OK if it is omitted. >> >>(%i1) display2d : false; >>(%o1) false >>(%i2) load (impdiff); >>(%o2) "/usr/local/share/maxima/5.14.0cvs/share/contrib/impdiff.mac" >>(%i3) load ("makeOrders"); >>(%o3) "/usr/local/share/maxima/5.14.0cvs/share/contrib/makeOrders.mac" >>(%i4) f[0,0] : x^2 + y^3 - z^4 = 0; >>(%o4) -z^4+y^3+x^2 = 0 >>(%i5) implicit_derivative (f, [x, y], [2, 3], z); >>(%o5) munlocal() >>(%i6) arrayinfo (f); >>(%o6) [hashed,2,[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3], >> [2,0],[2,1],[2,2],[2,3]] >>(%i7) listarray (f); >>(%o7) [-z^4+y^3+x^2 = 0,3*y^2/(4*z^3), >> (24*y*z^4-27*y^4)/(16*z^7), >> (96*z^8-648*y^3*z^4+567*y^6)/(64*z^11),x/(2*z^3), >> -9*x*y^2/(8*z^7),-(72*x*y*z^4-189*x*y^4)/(32*z^11), >> -(288*x*z^8-4536*x*y^3*z^4+6237*x*y^6)/(128*z^15), >> (2*z^4-3*x^2)/(4*z^7),-(18*y^2*z^4-63*x^2*y^2)/(16*z^11), >> -(144*y*z^8+(-378*y^4-504*x^2*y)*z^4+2079*x^2*y^4) >> /(64*z^15), >> -(576*z^12+(-9072*y^3-2016*x^2)*z^8 >> +(12474*y^6+49896*x^2*y^3)*z^4-93555*x^2*y^6) >> /(256*z^19)] >> >> >>It seems strange for implicit_derivative to return munlocal(). Hmm. >> >>Hope this helps, >> >>Robert Dodier >>. >> >> >> >> >Hi Robert, > Your solution works--thanks. Actually, I looked at the source for >impdiff.mac and it contains two functions 'mlocal' and 'munlocal' which >don't seem to be needed. Apparently they are lisp funcions defined in >mlisp.lisp. I removed them from impdiff.mac, saved the modified >version as 'my_impdiff.mac'. This versions seems to work fine with your >method, so I don't see the need for mlocal and munlocal anyway. > >-sen >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima > > > From jordigh at gmail.com Sat Jan 5 23:19:22 2008 From: jordigh at gmail.com (=?ISO-8859-1?Q?Jordi_Guti=E9rrez_Hermoso?=) Date: Sat, 5 Jan 2008 23:19:22 -0600 Subject: [Maxima] Simplifying complex expressions In-Reply-To: <8b356f880801051021k439e94et7f49a76d1c5707c7@mail.gmail.com> References: <9543b3a40801050939o60458b5ah7fa277ca331ffaf@mail.gmail.com> <8b356f880801051021k439e94et7f49a76d1c5707c7@mail.gmail.com> Message-ID: <9543b3a40801052119neaa4744ve8e40d23ad6f5b47@mail.gmail.com> On 05/01/2008, Stavros Macrakis wrote: > On Jan 5, 2008 12:39 PM, Jordi Guti?rrez Hermoso wrote: > Is there an easy way to get Maxima to say that (1-i)/(1+i) = i? > > No, I'm afraid not. Perhaps because it is actually -i. :-) > > Remember that Maxima represents sqrt(-1) as %i: > > rectform((1-%i)/(1+%i)) => -%i > > Another way is: > > rat((1-%i)/(1+%i)), algebraic => -%i. > On 05/01/2008, J. Simons wrote: > Hello Jordi, > Perhaps you can try it by the menu-option Simplify-- Complex Simplify : rectorm and rat. Two more I didn't know of. *sigh* Sometimes I wish Maxima had an all-encompassing "simplify" function with reasonable defaults. There's ratsimp, radcan, rectform, rat, and who knows what else I'm missing that I don't know about. I guess it's no wonder that the simplification routines are one of the few things that Maple locks up in its kernel: these things are just hard. Thank you Stavros and Jos? for your replies. - Jordi G. H. From walter.wegscheider at ph-noe.ac.at Sun Jan 6 09:33:53 2008 From: walter.wegscheider at ph-noe.ac.at (Walter Wegscheider) Date: Sun, 6 Jan 2008 16:33:53 +0100 Subject: [Maxima] Product - strange behaviour Message-ID: <001501c85079$8b418150$6500a8c0@wwquadcore> I tried to compute (%i1) product(3*k,k,1,n), simpproduct; Nothing happens - MAXIMA delivers only the input instead of 3^n*n! But: (%i2) product(3,k,1,n), simpproduct; (%o2) 3^n (%i3) product(k,k,1,n), simpproduct; (%o3) n! Why is Maxima able to compute all parts, but not the whole given product? Thank you very much for more insight. Walter Wegscheider PH-NOe, www.austromath.at From robert.dodier at gmail.com Sun Jan 6 17:01:21 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 6 Jan 2008 16:01:21 -0700 Subject: [Maxima] Bug 607079 In-Reply-To: <1198887738.3271.70.camel@herring> References: <1198887738.3271.70.camel@herring> Message-ID: On 12/28/07, Rupert Swarbrick wrote: > This just requires a trivial call to delete-duplicates at the > appropriate place. To find the appropriate place was less than trivial, > so I reformatted $solve and added comments (apart from the addition of > the delete-duplicates call, there's no code _changes_ just > reformatting). Hi Rupert, thanks for your work on this topic. I've committed the patches for solve.lisp which you sent & put a test case into the test suite. Let us know if you have other bug fixes, & keep up the good work. Robert Dodier From phhs80 at gmail.com Sun Jan 6 18:33:04 2008 From: phhs80 at gmail.com (Paul Smith) Date: Mon, 7 Jan 2008 00:33:04 +0000 Subject: [Maxima] Can Maxima solve this optimization problem? Message-ID: <6ade6f6c0801061633w432e6af6s260ca82543a2a5ce@mail.gmail.com> Dear All, I am trying to solve the following maximization problem with Maxima: find x(t) (continuous) that maximizes the integral of x(t) with t from 0 to 1, subject to the constraints dx/dt = u, |u| <= 1, x(0) = x(1) = 0. The analytical solution can be obtained easily, but I am trying to understand whether Maxima is able to solve numerically problems like this one. I have tried to find an approximate solution through discretization of the objective function but with no success so far. Thanks in advance, Paul From robert.dodier at gmail.com Sun Jan 6 20:49:17 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 6 Jan 2008 19:49:17 -0700 Subject: [Maxima] Bug 580721 fixed, I think In-Reply-To: <1198846798.3271.54.camel@herring> References: <1198846798.3271.54.camel@herring> Message-ID: On 12/28/07, Rupert Swarbrick wrote: > I think I've fixed bug 580721. Currently, simp-%tan and simp-%cot look > at form and one of the attempted simplifications is that if form is > tan(u) or cot(u) where u is linear in %pi (as measured by linearp), it > calls %piargs-tan/cot. Rupert, I've applied the patch for src/trigi.lisp to my local sandbox and it seems to work OK and also doesn't change any of the existing test cases, so that's good. However, I see that you have hooked the argument reduction into SIMP-%TAN so it happens when %piargs = true which is the default. On the other hand sin and cos with the same arguments are not reduced by default, but rather by trigexpand. I am inclined to recommend that tan and cot are not reduced automatically in this case, but if you want to argue for making the reduction automatic, I might change my mind. > 1) The code wasn't documented at all: does anyone know if I'm right > about what everything does? I don't know much specifically about the trig code so I can't comment on this, I'm afraid. > 2) I never did quite work out what one of the tests in %piargs-tan/cot > actually did: there's a comment beginning I _think_ on line 593. Anyone > know? See (1). > 3) I defined some utility functions, specifically filter-sum, > constant-linear-p and has-constant-linear-term. Do any of them already > exist in maxima and I just didn't find them? If not, where should they > go? In particular filter-sum looks like it might be more generally > applicable. I wouldn't be surprised if such functions have been written repeatedly over the years, but I don't know of any. A duplicate of this kind isn't much of a problem, as long as it solves at least the problem you have in mind, and doesn't cause trouble for existing stuff. You might take a look at the code in trigexpand which handles sin(%pi/2 + x*%pi) --> cos(%pi*x) since it is presumably doing the same thing. > 4) If this patch is good, should I also write a test in the test_suite? Yes, that's always a good idea. Thanks for your help, Robert Dodier From yhonda at mac.com Mon Jan 7 08:09:16 2008 From: yhonda at mac.com (Yasuaki Honda) Date: Mon, 7 Jan 2008 23:09:16 +0900 Subject: [Maxima] imaxima announcements In-Reply-To: References: <8F6ED83B-8108-4920-AA4F-664FB967582D@mac.com> Message-ID: Hi Robert san, I am sorry for the very late response. I was out for year-end and new year vacation. Comments inlined below. On 2007/12/29, at 2:27, Robert Dodier wrote: > On 12/27/07, Yasuaki Honda wrote: > >> - As maxima-5.14.0 is released, I confirmed that imaxima- >> imath-0.98.tar.gz is compatible with maxima 5.14.0 used with >> breqn097a.zip. Combination of them has passed the full test for >> imaxima. > > Terrific, I'm glad to hear it. I have tried the new imaxima > and it seems to work fine. > > A few weeks ago you wrote, > >> My plan is like the following: >> As soon as I make the imaxima and imath to work with the latest >> breqn, >> I will release the work as 0.99. Then, I will ask Robert san to >> import >> the files into Maxima CVS. >> >> Since the 5.14.0 is already in preparation phase, I feel the above to >> happen for 5.15.0 release. > > I guess the imaxima version number is actually 0.98, but that is > not important. I will import imaxima 0.98 into Maxima CVS now. > We'll have to work out the Makefile.am and other packaging problems. Today or tomorrow, I will announce 0.99, which maintains some documentation. It would be nice if you can import this package. > I will import only imaxima, not breqn. I am a little bit worried about > importing breqn, so I will assume breqn is separate from Maxima, > unless someone wants to convince me otherwise. Do you have any specific issues / concerns regarding the possible inclusion of breqn package into Maxima? The breqn097a.zip is distributed from my site and users can download it separately anyway. I am, however, planning to take advantage of the possibility to distribute it with imaxima-imath so that breqn is automatically installed. So, I want to convince you... It would be a good to hear from you any specifice concerns and start discussing. Yasuaki Honda, Chiba, Japan > > > Thanks a lot for your work on Imaxima. I appreciate it a lot. > > best > > Robert Dodier From A.G.Grozin at inp.nsk.su Mon Jan 7 08:50:49 2008 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Mon, 7 Jan 2008 20:50:49 +0600 (NOVT) Subject: [Maxima] building maxima with gcl Message-ID: Hello *, Recently, I cannot build maxima with gcl. In the past, this worked OK. Then I uninstalled gcl and installed it again, and things no longer work. I have ANSI gcl from Gentoo; it is 2.6.7 with a large patch taken from Debian, so that it is practically 2.6.8. Here is what I get when I try to compile maxima-5.14.0: grozin at laptop ~/maxima-5.14.0 $ ./configure --enable-gcl Summary: GCL enabled. Executable name: "gcl" default lisp: gcl wish executable name: "wish" grozin at laptop ~/maxima-5.14.0 $ make Making all in src make[1]: Entering directory `/home/grozin/maxima-5.14.0/src' test -d binary-gcl || mkdir binary-gcl test -d binary-gcl/numerical || mkdir binary-gcl/numerical test -d binary-gcl/numerical/slatec || mkdir binary-gcl/numerical/slatec gcl -batch -eval '(progn (load "../lisp-utils/defsystem.lisp") (compiler::emit-fn t) (funcall (intern (symbol-name :operate-on-system) :mk) "maxima" :compile :verbose t) (compiler::make-all-proclaims "*/*.fn" "*/*/*/*.fn"))' && \ gcl -batch -eval '(progn (load "../lisp-utils/defsystem.lisp") (funcall (intern (symbol-name :operate-on-system) :mk) "maxima" :load :verbose t) (when (fboundp (quote si::sgc-on))(si::sgc-on t)) (si:save-system "binary-gcl/maxima"))' Warning: REQUIRE is being redefined. Error in PROGN [or a callee]: Can't open file "/usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.data" Fast links are on: do (use-fast-links nil) for debugging Broken at PROGN. Type :H for Help. 1 (Continue) Retry loading file "/usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.o". 2 (Abort) Return to top level. dbl:>> Can anybody give a hint what's going wrong? The most strange thing is that some time ago, before re-installing gcl (the same version), everything worked smoothly. I also tried to do grozin at laptop ~/maxima-5.14.0 $ ./configure --enable-gcl --enable-gcl-alt-link Summary: GCL enabled. Executable name: "gcl" GCL alternative linking method enabled. default lisp: gcl wish executable name: "wish" grozin at laptop ~/maxima-5.14.0 $ make It seems that most of the process was successful. However, at the end I got ; - Providing system maxima binary-gcl/cl-info.o: In function `init_code': cl-info.c:(.text+0x0): multiple definition of `init_code' binary-gcl/nregex.o:nregex.c:(.text+0x0): first defined here binary-gcl/sloop.o: In function `init_code': sloop.c:(.text+0x0): multiple definition of `init_code' binary-gcl/nregex.o:nregex.c:(.text+0x0): first defined here binary-gcl/lmdcls.o: In function `init_code': lmdcls.c:(.text+0x0): multiple definition of `init_code' binary-gcl/nregex.o:nregex.c:(.text+0x0): first defined here binary-gcl/openmath.o: In function `init_code': openmath.c:(.text+0x0): multiple definition of `init_code' binary-gcl/nregex.o:nregex.c:(.text+0x0): first defined here collect2: ld returned 1 exit status sh: ./binary-gcl/raw_maxima: No such file or directory Error in LET* [or a callee]: Cannot delete the file #p"./binary-gcl/raw_maxima": "No such file or directory". Fast links are on: do (use-fast-links nil) for debugging Broken at DELETE-FILE. Type :H for Help. 1 (Abort) Return to top level. dbl:>> So, this alternative linking method also fails. What is the difference between the two methods? How is each of them supposed to work? Happy new year to *, Andrey From willisb at unk.edu Mon Jan 7 08:57:25 2008 From: willisb at unk.edu (Barton Willis) Date: Mon, 7 Jan 2008 08:57:25 -0600 Subject: [Maxima] Product - strange behaviour In-Reply-To: <001501c85079$8b418150$6500a8c0@wwquadcore> References: <001501c85079$8b418150$6500a8c0@wwquadcore> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I tried to compute > >(%i1) product(3*k,k,1,n), simpproduct; >Nothing happens - MAXIMA delivers only the input instead of 3^n*n! > >But: >(%i2) product(3,k,1,n), simpproduct; >(%o2) 3^n >(%i3) product(k,k,1,n), simpproduct; >(%o3) n! > >Why is Maxima able to compute all parts, but not the whole given product? Simpproduct isn't all that smart. Here is another case that simpproduct misses: (%i79) product(k/(k + 1),k,1,n),simpproduct; (%o79) product(k/(k+1),k,1,n) I'm unaware of an easy workaround for these cases. Why is simpproduct unable to simplify these products? I think it's because nobody has volunteered to extend simpproduct. Barton From yhonda at mac.com Mon Jan 7 09:27:07 2008 From: yhonda at mac.com (Yasuaki Honda) Date: Tue, 8 Jan 2008 00:27:07 +0900 Subject: [Maxima] imaxima-imath-0.99, and update on "Easy install on Windows XP" page Message-ID: Dear all, I am pleased to announce the release of imaxima-imath-0.99.tar.gz. You can obtain it from the donwload page of the web site: http://members3.jcom.home.ne.jp/imaxima This release is to update the documentation. No technical change was made since 0.98. As breqn package has a new home at CTAN and also distributed as breqn097a.zip from the imaxima web site, any mention to AMS ftp site were removed. Also, some files did not have copyright statements, so they are added. Otherwise, 0.99 is the same as 0.98. Also, I have updated imaxima web site "Easy Install on Windows XP". The update simplifies the install process in such a way that all the external programs such as MiKTeX, Ghostscript, and Maxima be installed in their default installation places under c:/Program Files/. This gets real simple!! Enjoy! Yasuaki Honda, Chiba, Japan http://members3.jcom.home.ne.jp/imaxima From andrej.vodopivec at gmail.com Mon Jan 7 11:32:32 2008 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Mon, 7 Jan 2008 18:32:32 +0100 Subject: [Maxima] Can Maxima solve this optimization problem? In-Reply-To: <6ade6f6c0801061633w432e6af6s260ca82543a2a5ce@mail.gmail.com> References: <6ade6f6c0801061633w432e6af6s260ca82543a2a5ce@mail.gmail.com> Message-ID: <7775b21a0801070932x6889ce28gcfcc0f97e79b7730@mail.gmail.com> You can try like this: You are maximizing the area under u(t) from 0 to 1 under two conditions: u(0)=u(1)=0 and |du/dt|<=1. Take discrete set of points x[1]=0, ..., x[N]=1 such that x[i+1]=x[i]+h, where h=1/(N-1). Let u[i]=u(x[i]). Approximate the derivative du/dt at x[i] with (u[i+1]-u[i])/h. The conditions on the derivatives are now -h < u[i+1]-u[i] < h. The area under the curve is approximated with area=sum((u[i]+u[i+1])*h/2, i, 1, N-1). Along with the conditions u[0]=u[N]=0 this is a linear program. You can solve it as shown below (with N=51): (%i1) load(draw)$ (%i2) load(simplex)$ (%i3) N : 51$ h : 1.0/(N-1)$ vals : makelist(concat(u, i), i, 1, N)$ ineq : append( makelist(vals[i+1]-vals[i] < h, i, 1, N-1), makelist(vals[i+1]-vals[i] > -h, i, 1, N-1))$ eq : [vals[1]=0, vals[N]=0]$ conditions : append(ineq, eq)$ area : sum((vals[i]+vals[i+1])*h/2, i, 1, N-1)$ (%i10) [ar, va] : maximize_lp(area, conditions)$ (%i11) data : makelist([(i-1)*h, assoc(vals[i], va)], i, 1, N)$ (%i12) draw2d(points_joined = true, point_size=0, points(data)); HTH Andrej On Jan 7, 2008 1:33 AM, Paul Smith wrote: > Dear All, > > I am trying to solve the following maximization problem with Maxima: > > find x(t) (continuous) that maximizes the > > integral of x(t) with t from 0 to 1, > > subject to the constraints > > dx/dt = u, > > |u| <= 1, > > x(0) = x(1) = 0. > > The analytical solution can be obtained easily, but I am trying to > understand whether Maxima is able to solve numerically problems like > this one. I have tried to find an approximate solution through > discretization of the objective function but with no success so far. > > Thanks in advance, > > Paul > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Mon Jan 7 21:27:55 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 7 Jan 2008 20:27:55 -0700 Subject: [Maxima] "load" with guards etc. ?? In-Reply-To: <20071221143416.GY30793@cs-wsok.swansea.ac.uk> References: <20071221143416.GY30793@cs-wsok.swansea.ac.uk> Message-ID: On 12/21/07, Oliver Kullmann wrote: > So "load" is the equivalent of "#include" in the C/C++ world. > However, apparently there is no functionality concerned with > preventing multiple inclusions (especially circular inclusions)? > > I wonder how other users deal with that problem --- everybody writes > his little utilities to handle this, I guess? Or are some underlying > clisp-mechanisms used? I've tinkered with a namespace mechanism for Maxima which is based on the Lisp package system. The current version of it is in cvs. http://maxima.cvs.sourceforge.net/maxima/maxima/share/contrib/namespaces I am hoping this could be useful for encapsulating add-on programs. Here is an example session. (%i1) load (namespaces)$ (%i2) in_namespace (); (%o2) # (%i3) in_namespace (Foo); (%o3) #<$Foo package> ($%i4) aa : 1234; (%o4) 1234 ($%i5) f (x) := aa - x; (%o5) f(x) := aa - x ($%i6) export (f); (%o6) [maxima|true] ($%i7) in_namespace (maxima); (%o7) # (%i8) functions; (%o8) [Foo|f(Foo|x)] (%i9) values; (%o9) [Foo|aa] (%i10) symbols (Foo); (%o10) [Foo|, Foo|%i3, Foo|%i4, Foo|%i5, Foo|%i6, Foo|%i7, Foo|%o3, Foo|%o4, Foo|%o5, Foo|%o6, Foo|aa, Foo|f, Foo|x] (%i11) external_symbols (Foo); (%o11) [Foo|f] (%i12) aa : 9876; (%o12) 9876 (%i13) Foo|aa; (%o13) 1234 (%i14) values; (%o14) [Foo|aa, aa] (%i15) f (1); (%o15) f(1) (%i16) import (Foo); (%o16) [[Foo|f]] (%i17) f (1); (%o17) 1233 There are some rough edges but I think it is not too far from workable. In particular the stuff about exporting symbols from the :maxima package is probably confused; either too many symbols or too few, I'm not sure which. Someone who understands the Lisp package system better than me is invited to make suggestions about that or anything else. Specifically about loading something just once, there is load_namespace(foo) which calls load(foo) only if there is not already a namespace named foo. Dunno if it handles circular dependencies correctly. Comments in namespaces.lisp provide more info and examples, and there is a test script rtest_namespaces.mac as well. HTH Robert Dodier From robert.dodier at gmail.com Mon Jan 7 22:31:50 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 7 Jan 2008 21:31:50 -0700 Subject: [Maxima] imaxima announcements In-Reply-To: References: <8F6ED83B-8108-4920-AA4F-664FB967582D@mac.com> Message-ID: On 1/7/08, Yasuaki Honda wrote: > I am sorry for the very late response. No problem, Yasuaki! The wheels of Maxima grind slowly, but exceedingly fine. 8^) > Today or tomorrow, I will announce 0.99, which maintains some > documentation. It would be nice if you can import this package. OK, no problem, I'll import 0.99. > > I will import only imaxima, not breqn. I am a little bit worried about > > importing breqn, so I will assume breqn is separate from Maxima, > > unless someone wants to convince me otherwise. > > Do you have any specific issues / concerns regarding the possible > inclusion of breqn package into Maxima? Well, the problems that I see are that it is fairly large (approx 1 M), it is under development, it can be used independently of Maxima, and it is part of a system (LaTeX) which has its own installation process. breqn really seems like something which wants to be installed separately. How much work is it to get breqn installed? If it is something comparable to yum or apt-get or getting Perl stuff from CPAN then I would say that suggests we don't need to include it with Maxima. That said, Maxima already includes some other stuff, such as a copy of texi2html. That's unfortunate, but I guess it sets a precedent. For the record, I don't see any license problem with breqn (now that it has a clearly stated license). Thanks a lot for your work on Imaxima. best Robert From camm at enhanced.com Tue Jan 8 01:26:00 2008 From: camm at enhanced.com (Camm Maguire) Date: 08 Jan 2008 02:26:00 -0500 Subject: [Maxima] [Gcl-devel] building maxima with gcl In-Reply-To: References: Message-ID: <54bq7wixrr.fsf@intech19.enhanced.com> Greetings! Just a quick note here -- cannot reproduce this yet, the gcl stuff appears to work fine, but the Debian package build now bombs at: Making all in info make[3]: Entering directory `/fix/t1/camm/maxima-5.14.0/doc/info' make[4]: Entering directory `/fix/t1/camm/maxima-5.14.0/doc/info' restore=: && backupdir=".am$$" && \ am__cwd=`pwd` && cd . && \ rm -rf $backupdir && mkdir $backupdir && \ if (/bin/sh /fix/t1/camm/maxima-5.14.0/missing --run makeinfo --version) >/dev/null 2>&1; then \ for f in maxima.info maxima.info-[0-9] maxima.info-[0-9][0-9] maxima.i[0-9] maxima.i[0-9][0-9]; do \ if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$am__cwd"; \ if /bin/sh /fix/t1/camm/maxima-5.14.0/missing --run makeinfo -I . \ -o maxima.info maxima.texi; \ then \ rc=0; \ cd .; \ else \ rc=$?; \ cd . && \ $restore $backupdir/* `echo "./maxima.info" | sed 's|[^/]*$||'`; \ fi; \ rm -rf $backupdir; exit $rc /fix/t1/camm/maxima-5.14.0/doc/info//Introduction.texi:194: Unknown command `opencatbox'. /fix/t1/camm/maxima-5.14.0/doc/info//Introduction.texi:195: Unknown command `category'. /fix/t1/camm/maxima-5.14.0/doc/info//Introduction.texi:195: Misplaced {. /fix/t1/camm/maxima-5.14.0/doc/info//Introduction.texi:195: Misplaced }. /fix/t1/camm/maxima-5.14.0/doc/info//Introduction.texi:196: Unknown command `closecatbox'. /fix/t1/camm/maxima-5.14.0/doc/info//Bugs.texi:34: Unknown command `opencatbox'. /fix/t1/camm/maxima-5.14.0/doc/info//Bugs.texi:35: Unknown command `category'. /fix/t1/camm/maxima-5.14.0/doc/info//Bugs.texi:35: Misplaced {. /fix/t1/camm/maxima-5.14.0/doc/info//Bugs.texi:35: Misplaced }. /fix/t1/camm/maxima-5.14.0/doc/info//Bugs.texi:36: Unknown command `closecatbox'. /fix/t1/camm/maxima-5.14.0/doc/info//Bugs.texi:57: Unknown command `opencatbox'. /fix/t1/camm/maxima-5.14.0/doc/info//Bugs.texi:58: Unknown command `category'. /fix/t1/camm/maxima-5.14.0/doc/info//Bugs.texi:58: Misplaced {. Take care, "Andrey G. Grozin" writes: > Hello *, > > Recently, I cannot build maxima with gcl. In the past, this worked OK. > Then I uninstalled gcl and installed it again, and things no longer > work. I have ANSI gcl from Gentoo; it is 2.6.7 with a large patch taken > from Debian, so that it is practically 2.6.8. Here is what I get when > I try to compile maxima-5.14.0: > > grozin at laptop ~/maxima-5.14.0 $ ./configure --enable-gcl > > Summary: > GCL enabled. Executable name: "gcl" > default lisp: gcl > wish executable name: "wish" > grozin at laptop ~/maxima-5.14.0 $ make > Making all in src > make[1]: Entering directory `/home/grozin/maxima-5.14.0/src' > test -d binary-gcl || mkdir binary-gcl > test -d binary-gcl/numerical || mkdir binary-gcl/numerical > test -d binary-gcl/numerical/slatec || mkdir binary-gcl/numerical/slatec > gcl -batch -eval '(progn (load "../lisp-utils/defsystem.lisp") (compiler::emit-fn t) (funcall (intern (symbol-name :operate-on-system) :mk) "maxima" :compile :verbose t) (compiler::make-all-proclaims "*/*.fn" "*/*/*/*.fn"))' && \ > gcl -batch -eval '(progn (load "../lisp-utils/defsystem.lisp") (funcall (intern (symbol-name :operate-on-system) :mk) "maxima" :load :verbose t) (when (fboundp (quote si::sgc-on))(si::sgc-on t)) (si:save-system "binary-gcl/maxima"))' > > Warning: > REQUIRE is being redefined. > Error in PROGN [or a callee]: Can't open file "/usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.data" > > Fast links are on: do (use-fast-links nil) for debugging > Broken at PROGN. Type :H for Help. > 1 (Continue) Retry loading file "/usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.o". > 2 (Abort) Return to top level. > dbl:>> > > Can anybody give a hint what's going wrong? The most strange thing is > that some time ago, before re-installing gcl (the same version), everything > worked smoothly. > > I also tried to do > > grozin at laptop ~/maxima-5.14.0 $ ./configure --enable-gcl --enable-gcl-alt-link > > Summary: > GCL enabled. Executable name: "gcl" > GCL alternative linking method enabled. > default lisp: gcl > wish executable name: "wish" > grozin at laptop ~/maxima-5.14.0 $ make > > It seems that most of the process was successful. However, at the end > I got > > ; - Providing system maxima > binary-gcl/cl-info.o: In function `init_code': > cl-info.c:(.text+0x0): multiple definition of `init_code' > binary-gcl/nregex.o:nregex.c:(.text+0x0): first defined here > binary-gcl/sloop.o: In function `init_code': > sloop.c:(.text+0x0): multiple definition of `init_code' > binary-gcl/nregex.o:nregex.c:(.text+0x0): first defined here > binary-gcl/lmdcls.o: In function `init_code': > lmdcls.c:(.text+0x0): multiple definition of `init_code' > binary-gcl/nregex.o:nregex.c:(.text+0x0): first defined here > > binary-gcl/openmath.o: In function `init_code': > openmath.c:(.text+0x0): multiple definition of `init_code' > binary-gcl/nregex.o:nregex.c:(.text+0x0): first defined here > collect2: ld returned 1 exit status > sh: ./binary-gcl/raw_maxima: No such file or directory > Error in LET* [or a callee]: Cannot delete the file #p"./binary-gcl/raw_maxima": "No such file or directory". > > Fast links are on: do (use-fast-links nil) for debugging > Broken at DELETE-FILE. Type :H for Help. > 1 (Abort) Return to top level. > dbl:>> > > So, this alternative linking method also fails. What is the difference > between the two methods? How is each of them supposed to work? > > Happy new year to *, > Andrey > > > _______________________________________________ > Gcl-devel mailing list > Gcl-devel at gnu.org > http://lists.gnu.org/mailman/listinfo/gcl-devel > > > -- Camm Maguire camm at enhanced.com ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah From A.G.Grozin at inp.nsk.su Tue Jan 8 02:16:58 2008 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Tue, 8 Jan 2008 14:16:58 +0600 (NOVT) Subject: [Maxima] [Gcl-devel] building maxima with gcl In-Reply-To: <54bq7wixrr.fsf@intech19.enhanced.com> References: <54bq7wixrr.fsf@intech19.enhanced.com> Message-ID: On Tue, 8 Jan 2008, Camm Maguire wrote: > Just a quick note here -- cannot reproduce this yet, the gcl stuff > appears to work fine, This is the most strange thing: everything worked fine, then I un-installed gcl and installed it again (the same version!), and it does not work. I am not the first person having this problem - there is a bug in the Gentoo bugzilla about this. I am ready to investigate, but don't know where to start. Andrey From phhs80 at gmail.com Tue Jan 8 06:38:17 2008 From: phhs80 at gmail.com (Paul Smith) Date: Tue, 8 Jan 2008 12:38:17 +0000 Subject: [Maxima] Can Maxima solve this optimization problem? In-Reply-To: <7775b21a0801070932x6889ce28gcfcc0f97e79b7730@mail.gmail.com> References: <6ade6f6c0801061633w432e6af6s260ca82543a2a5ce@mail.gmail.com> <7775b21a0801070932x6889ce28gcfcc0f97e79b7730@mail.gmail.com> Message-ID: <6ade6f6c0801080438l3e38e494t175e3b29071e56fb@mail.gmail.com> Thanks, Andrej, for your clever solution. But suppose now that instead of integral of x(t) with t from 0 to 1, you have the following objective function: integral of sin( x(t) ) with t from 0 to 1. Is Maxima still able to solve the maximization problem? Paul On Jan 7, 2008 5:32 PM, Andrej Vodopivec wrote: > You can try like this: > > You are maximizing the area under u(t) from 0 to 1 under two > conditions: u(0)=u(1)=0 and |du/dt|<=1. Take discrete set of points > x[1]=0, ..., x[N]=1 such that x[i+1]=x[i]+h, where h=1/(N-1). Let > u[i]=u(x[i]). Approximate the derivative du/dt at x[i] with > (u[i+1]-u[i])/h. The conditions on the derivatives are now -h < > u[i+1]-u[i] < h. The area under the curve is approximated with > area=sum((u[i]+u[i+1])*h/2, i, 1, N-1). Along with the conditions > u[0]=u[N]=0 this is a linear program. You can solve it as shown below > (with N=51): > > (%i1) load(draw)$ > (%i2) load(simplex)$ > (%i3) N : 51$ > h : 1.0/(N-1)$ > vals : makelist(concat(u, i), i, 1, N)$ > ineq : append( > makelist(vals[i+1]-vals[i] < h, i, 1, N-1), > makelist(vals[i+1]-vals[i] > -h, i, 1, N-1))$ > eq : [vals[1]=0, vals[N]=0]$ > conditions : append(ineq, eq)$ > area : sum((vals[i]+vals[i+1])*h/2, i, 1, N-1)$ > (%i10) [ar, va] : maximize_lp(area, conditions)$ > (%i11) data : makelist([(i-1)*h, assoc(vals[i], va)], i, 1, N)$ > (%i12) draw2d(points_joined = true, point_size=0, points(data)); > > HTH > > Andrej > > > On Jan 7, 2008 1:33 AM, Paul Smith wrote: > > Dear All, > > > > I am trying to solve the following maximization problem with Maxima: > > > > find x(t) (continuous) that maximizes the > > > > integral of x(t) with t from 0 to 1, > > > > subject to the constraints > > > > dx/dt = u, > > > > |u| <= 1, > > > > x(0) = x(1) = 0. > > > > The analytical solution can be obtained easily, but I am trying to > > understand whether Maxima is able to solve numerically problems like > > this one. I have tried to find an approximate solution through > > discretization of the objective function but with no success so far. > > > > Thanks in advance, > > > > Paul > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > From Bart.Vandewoestyne at telenet.be Tue Jan 8 07:59:03 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Tue, 8 Jan 2008 14:59:03 +0100 Subject: [Maxima] defining functions of s variables Message-ID: <20080108135903.GA16752@simba> Dear list, As a newcomer to Maxima, I am trying to define a function of s variables. I know functions of multiple variables can be defined for example as follows: f(x,y) := x^1*y^2; I can then calculate for example mixed partial derivatives as follows: diff(f(x,y), x, 1, y, 1); Now my problem is that I want to be able to define functions of s variables, where s is a parameter defined by the user. For example (in *non-maxima* notation): f(x[1],...,x[s]) := x[1]^1*x[2]^2*...*x[s]^s; := product(x[i]^i); I then want to be able to compute certain partial derivatives of the s-dimensional functions I define. Is this at all possible with Maxima and what is the correct way of doing this? Thanks, Bart -- "Share what you know. Learn what you don't." From willisb at unk.edu Tue Jan 8 09:25:40 2008 From: willisb at unk.edu (Barton Willis) Date: Tue, 8 Jan 2008 09:25:40 -0600 Subject: [Maxima] defining functions of s variables In-Reply-To: <20080108135903.GA16752@simba> References: <20080108135903.GA16752@simba> Message-ID: Welcome to Maxima. Here is a function that sums its arguments (%i1) sum_it_up([x]) := apply("+",x)$ (%i2) sum_it_up(1,2,3); (%o2) 6 (%i3) sum_it_up(); (%o3) 0 (%i4) sum_it_up(a,b); (%o4) b+a If you want a function that has one or more arguments, try: (the [x] argument must be last and there can only be one [] argument) (%i5) sum_it_up_and_divide_by(z,[x]) := apply("+",x) / z$ (%i6) sum_it_up_and_divide_by(7,a,b,c,d); (%o6) (d+c+b+a)/7 And for your example, try: (%i10) f([x]) := apply("*", map("^",x, makelist(k,k,1,length(x)))); (%i11) f(a,b,c); (%o11) a*b^2*c^3 (%i12) f(); (%o12) 1 (%i13) f(a); (%o13) a Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: maxima at math.utexas.edu >From: Bart Vandewoestyne >Sent by: maxima-bounces at math.utexas.edu >Date: 01/08/2008 07:59AM >Subject: [Maxima] defining functions of s variables > >Dear list, > >As a newcomer to Maxima, I am trying to define a function of s >variables. > >I know functions of multiple variables can be defined for example >as follows: > >f(x,y) := x^1*y^2; > >I can then calculate for example mixed partial derivatives as >follows: > >diff(f(x,y), x, 1, y, 1); > >Now my problem is that I want to be able to define functions of s >variables, where s is a parameter defined by the user. For >example (in *non-maxima* notation): > >f(x[1],...,x[s]) := x[1]^1*x[2]^2*...*x[s]^s; > > := product(x[i]^i); > >I then want to be able to compute certain partial derivatives of >the s-dimensional functions I define. > >Is this at all possible with Maxima and what is the correct way >of doing this? > >Thanks, >Bart > >-- > "Share what you know. Learn what you don't." >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From Bart.Vandewoestyne at telenet.be Tue Jan 8 09:48:05 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Tue, 8 Jan 2008 16:48:05 +0100 Subject: [Maxima] defining functions of s variables In-Reply-To: References: <20080108135903.GA16752@simba> Message-ID: <20080108154805.GA19365@simba> On Tue, Jan 08, 2008 at 09:25:40AM -0600, Barton Willis wrote: > Welcome to Maxima. Here is a function that sums its arguments > > [... snip explanation ...] Barton, Thanks for the explanation. In the meanwhile, I had also found that I can indeed do something like: (%i1) f([x]) := product(x[i]^i, i, 1, length(x)); i (%o1) f([x]) := product(x , i, 1, length(x)) i (%i2) f(1, 2, 3); (%o2) 108 But now I want to go one step further and be able to calculate partial derivatives for an arbitrary s-dimensional function (as it is defined by the user in his command for defining f([x])). And this is where I'm stuck. Take the dimension of x to be three, then the function as I define it above is: f(x) = x[1]^1 * x[2]^2 * x[3]^3 and then i want to be able to calculate for example the first partial derivative to x[1], being: x[2]^2 * x[3]^3 However, if I try (%i3) diff(f(x), x[1], 1); (%o3) 0 (%i4) diff(f([x]), x[1], 1); (%o4) [0] These results are not what I expect them to be... I want to be able to do this for whatever partial derivative I need and for whatever function I a user defines, so not only for the above example as I have given it. Any help welcome! Bart -- "Share what you know. Learn what you don't." From A.G.Grozin at inp.nsk.su Tue Jan 8 10:05:46 2008 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Tue, 8 Jan 2008 22:05:46 +0600 (NOVT) Subject: [Maxima] TeXmacs and maxima-5.14.0 Message-ID: Hello *, In order to run maxima-5.14.0 from TeXmacs, you should apply the following trivial patch. Those who already have TeXmacs installed can just edit 2 scripts, maxima_detect and tm_maxima (they usually live in /usr/libexec/TeXmacs/bin/). You don't need to recompile anything. Joris, I hope you will include this patch to cvs. By the way, what do you all think - if we drop support of *really* ancient versions of maxima (<=5.9.2), then the scripts can be greatly simplified. This still leaves a lot of supported versions - 5.9.3 to 5.14.0. Maybe, it's time to do this? Happy new year, Andrey -------------- next part -------------- diff -U2 --recursive TeXmacs-1.0.6.12-src-orig/plugins/maxima/bin/maxima_detect TeXmacs-1.0.6.12-src/plugins/maxima/bin/maxima_detect --- TeXmacs-1.0.6.12-src-orig/plugins/maxima/bin/maxima_detect 2007-11-05 15:21:32.000000000 +0600 +++ TeXmacs-1.0.6.12-src/plugins/maxima/bin/maxima_detect 2008-01-09 04:43:10.000000000 +0600 @@ -63,7 +63,8 @@ version 5.11 version 5.12 -version 5.13" >/dev/null +version 5.13 +version 5.14" >/dev/null then - # 5.9.1 or 5.9.2 or 5.9.3 or 5.10 or 5.11 or 5.12 or 5.13 + # 5.9.1 or 5.9.2 or 5.9.3 or 5.10 or 5.11 or 5.12 or 5.13 or 5.14 maxima -d | grep -F 'maxima-htmldir=' | sed -e \ 's/maxima-htmldir=/"/' -e 's|$|/maxima_toc.html"|' diff -U2 --recursive TeXmacs-1.0.6.12-src-orig/plugins/maxima/bin/tm_maxima TeXmacs-1.0.6.12-src/plugins/maxima/bin/tm_maxima --- TeXmacs-1.0.6.12-src-orig/plugins/maxima/bin/tm_maxima 2007-11-05 15:21:32.000000000 +0600 +++ TeXmacs-1.0.6.12-src/plugins/maxima/bin/tm_maxima 2008-01-09 04:43:10.000000000 +0600 @@ -18,5 +18,5 @@ 5.9.1.1* | 5.9.2* | 5.9.3*) exec maxima -u $1 -l $2 -p "$TEXMACS_MAXIMA_PATH/texmacs-maxima-5.9.2.lisp";; 5.10.*) exec maxima -u $1 -l $2 -p "$TEXMACS_MAXIMA_PATH/texmacs-maxima-5.10.0.lisp";; - 5.11.* | 5.12.* | 5.13.*) exec maxima -u $1 -l $2 -p "$TEXMACS_MAXIMA_PATH/texmacs-maxima-5.11.0.lisp";; + 5.11.* | 5.12.* | 5.13.* | 5.14.*) exec maxima -u $1 -l $2 -p "$TEXMACS_MAXIMA_PATH/texmacs-maxima-5.11.0.lisp";; cygwin) exec maxima.bat -p "`echo $TEXMACS_MAXIMA_PATH/texmacs-maxima-5.11.0.lisp|cygpath --windows -f -`";; From Bart.Vandewoestyne at telenet.be Tue Jan 8 10:19:55 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Tue, 8 Jan 2008 17:19:55 +0100 Subject: [Maxima] Maxima Digest, Vol 18, Issue 10 In-Reply-To: References: Message-ID: <20080108161955.GA19862@simba> On Tue, Jan 08, 2008 at 09:48:09AM -0600, maxima-request at math.utexas.edu wrote: > > Message: 8 > Date: Tue, 8 Jan 2008 16:48:05 +0100 > From: Bart Vandewoestyne > Subject: Re: [Maxima] defining functions of s variables > To: Barton Willis > Cc: maxima at math.utexas.edu > Message-ID: <20080108154805.GA19365 at simba> > Content-Type: text/plain; charset=us-ascii > > On Tue, Jan 08, 2008 at 09:25:40AM -0600, Barton Willis wrote: > > Welcome to Maxima. Here is a function that sums its arguments > > > > [... snip explanation ...] > > Barton, > > Thanks for the explanation. In the meanwhile, I had also found > that I can indeed do something like: > > > (%i1) f([x]) := product(x[i]^i, i, 1, length(x)); > i > (%o1) f([x]) := product(x , i, 1, length(x)) > i > (%i2) f(1, 2, 3); > (%o2) 108 > > > But now I want to go one step further and be able to calculate partial > derivatives for an arbitrary s-dimensional function (as it is defined by > the user in his command for defining f([x])). And this is where I'm stuck. > > Take the dimension of x to be three, then the function as I define it > above is: > > f(x) = x[1]^1 * x[2]^2 * x[3]^3 > > and then i want to be able to calculate for example the first partial > derivative to x[1], being: > > x[2]^2 * x[3]^3 > > However, if I try > > (%i3) diff(f(x), x[1], 1); > (%o3) 0 > (%i4) diff(f([x]), x[1], 1); > (%o4) [0] > > These results are not what I expect them to be... > I want to be able to do this for whatever partial derivative I need and > for whatever function I a user defines, so not only for the above example > as I have given it. > > Any help welcome! > Bart OK. I think I am making progress in struggling with the syntax :-) I think I can do what I need as follows: First, I can define my function for general dimensions as follows: f([x]) := product(x[i]^i, i, 1, length(x))$ Then, to compute the partial derivatives I need, i can use the makelist function to do something like this: diff(apply(f, makelist(x[k], k, 1, s)), x[1], 1, x[2], 1); This seems to do quite what I need. If people have any comments on the way I am doing this or if anybody has some improvements, then I would be glad to hear. Regards, Bart -- "Share what you know. Learn what you don't." From macrakis at alum.mit.edu Tue Jan 8 10:38:43 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 8 Jan 2008 11:38:43 -0500 Subject: [Maxima] defining functions of s variables In-Reply-To: References: <20080108135903.GA16752@simba> Message-ID: <8b356f880801080838i3b75c2b0s373e1ebbbec8b79c@mail.gmail.com> On Jan 8, 2008 10:25 AM, Barton Willis wrote: > (%i1) sum_it_up([x]) := apply("+",x)$ ... > If you want a function that has one or more arguments, try: > (the [x] argument must be last and there can only be one [] > argument) Depending on your requirements, you may want to use Barton's approach of defining a function which is called with s arguments, e.g. f(x1,x2,x3) using the f([l]):=... syntax, or a function which is called with one argument, a vector, e.g. f([x1,x2,x3]), using simply f(l):=.... My general preference would be for the latter, because it means you can conveniently treat the argument vector as an object, e.g. f( argvec . matrix) length(argvec) => ... Maxima does also support apply(f, argvec), but if you are mostly manipulating vectors, this is not as convenient. The apply("+", ...) trick works nicely for n-ary functions like "+" and the like, but you might also want to consider using sum(x[i],i,1,length(x)) and rreduce(f, x) == f(x[1],f(x[2],...)) (also lreduce -- all of which Barton wrote, by the way). (%i10) f([x]) := apply("*", map("^",x, makelist(k,k,1,length(x)))); > Or product( x[k]^k, k, 1, length(x)) As for f(x) := x[1]^1 * x[2]^2 * x[3]^3 diff(f(x), x[1], 1); This works for me. By the way, if your x's are strictly formal, it might be easier to manipulate *expressions* than functions, e.g. f: product(x[k]^k, i,1,3); diff(f,x[2]) => 2*x[1]*x[2]*x[3]^3 Let us know if you have other issues. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080108/2aec8bf3/attachment.htm From raymond.toy at ericsson.com Tue Jan 8 11:22:29 2008 From: raymond.toy at ericsson.com (Raymond Toy RT/EUS) Date: Tue, 08 Jan 2008 12:22:29 -0500 Subject: [Maxima] Keyword arguments? Message-ID: One of the bug reports says that the quadpack routines should allow the user to set epsabs (absolute error limit) value for the quadpack routines. Currently, the routines take optional positional arguments. This works fine, and the extra epsabs arg could be placed at the end, to preserve compatibility. However, this isn't very nice, especially since the second optional arg is limit, which is not normally changed. I was wondering about implementing a keyword argument scheme. Something like quad_qags(f,x,a,b, epsrel=1d-8, epsabs=1d-8, limit=500) Everything after the b argument is optional, and sets the appropriate value. The order is not important, just like Lisp keyword args. This basically gets translated into a Lisp call like (quad-qags f x a b :epsrel 1d-8 :epsabs 1d-8 :limit 500). The function quad-qags would decide if other keyword args are allowed or not. I know this would be different from what plot2d does, which basically uses the syntax [a,b] instead of a = b. What do people think about this? Should quadpack more optional positional args? This new keyword arg scheme? Use the plot2d style? Ray From twidlar at yahoo.com Tue Jan 8 11:57:25 2008 From: twidlar at yahoo.com (Thomas Widlar) Date: Tue, 8 Jan 2008 09:57:25 -0800 (PST) Subject: [Maxima] assume() question. In-Reply-To: <6ade6f6c0801080438l3e38e494t175e3b29071e56fb@mail.gmail.com> Message-ID: <869733.52955.qm@web35401.mail.mud.yahoo.com> We use Maxima version: 5.13.99rc2. The function ?assume? works for <, > etc, but not for the operators ?equal? and ?notequal? as it should according to the online help. Example: (%i22) assume (z equal 3); Incorrect syntax: EQUAL is not an infix operator assumeSpace(zSpaceequalSpace ^ (%i22) assume (z > 3); (%o22) [z>3] (%i23) What are we getting wrong? Thanks. From macrakis at alum.mit.edu Tue Jan 8 12:23:45 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 8 Jan 2008 13:23:45 -0500 Subject: [Maxima] assume() question. In-Reply-To: <869733.52955.qm@web35401.mail.mud.yahoo.com> References: <6ade6f6c0801080438l3e38e494t175e3b29071e56fb@mail.gmail.com> <869733.52955.qm@web35401.mail.mud.yahoo.com> Message-ID: <8b356f880801081023t78779e43saac143df4b9e53f1@mail.gmail.com> Um, equal is not an infix operator. Try assume( equal(a,b) ) On 1/8/08, Thomas Widlar wrote: > We use Maxima version: 5.13.99rc2. > > The function "assume" works for <, > etc, but not for > the operators "equal" and "notequal" as it should > according to the online help. > > Example: > > (%i22) assume (z equal 3); > Incorrect syntax: EQUAL is not an infix operator > assumeSpace(zSpaceequalSpace > ^ > (%i22) assume (z > 3); > (%o22) [z>3] > (%i23) > > What are we getting wrong? > > Thanks. > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Sent from Gmail for mobile | mobile.google.com From robert.dodier at gmail.com Tue Jan 8 12:36:55 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 8 Jan 2008 11:36:55 -0700 Subject: [Maxima] assume() question. In-Reply-To: <869733.52955.qm@web35401.mail.mud.yahoo.com> References: <6ade6f6c0801080438l3e38e494t175e3b29071e56fb@mail.gmail.com> <869733.52955.qm@web35401.mail.mud.yahoo.com> Message-ID: On Jan 8, 2008 10:57 AM, Thomas Widlar wrote: > (%i22) assume (z equal 3); > Incorrect syntax: EQUAL is not an infix operator Oh, you have to write it as assume(equal(z, 3)) or assume(notequal(z, 3)). Hmm, maybe equal and notequal should be infix operators -- but that is a separate question. Be advised that the assume system is not very strong -- I don't know how much Maxima can do with that. HTH Robert Dodier From robert.dodier at gmail.com Tue Jan 8 12:39:34 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 8 Jan 2008 11:39:34 -0700 Subject: [Maxima] Keyword arguments? In-Reply-To: References: Message-ID: On Jan 8, 2008 10:22 AM, Raymond Toy (RT/EUS) wrote: > Something like > > quad_qags(f,x,a,b, epsrel=1d-8, epsabs=1d-8, limit=500) Looks good to me. > I know this would be different from what plot2d does, which basically > uses the syntax [a,b] instead of a = b. I've never liked the [a, b] notation. Thanks for working on this. Robert From robert.dodier at gmail.com Tue Jan 8 12:42:22 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 8 Jan 2008 11:42:22 -0700 Subject: [Maxima] TeXmacs and maxima-5.14.0 In-Reply-To: References: Message-ID: On Jan 8, 2008 9:05 AM, Andrey G. Grozin wrote: > In order to run maxima-5.14.0 from TeXmacs, you should apply the following > trivial patch. > > Those who already have TeXmacs installed can just edit 2 scripts, > maxima_detect and tm_maxima (they usually live in > /usr/libexec/TeXmacs/bin/). You don't need to recompile anything. Is there a way to make TeXmacs detect any version of Maxima? It seems troublesome to have to modify TeXmacs for each Maxima release. > By the way, what do you all think - if we drop support of *really* ancient > versions of maxima (<=5.9.2), then the scripts can be greatly simplified. > This still leaves a lot of supported versions - 5.9.3 to 5.14.0. Maybe, > it's time to do this? OK by me, but I rarely use TeXmacs. Thanks a lot for working on TeXmacs, I appreciate it. Robert From robert.dodier at gmail.com Tue Jan 8 12:47:50 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 8 Jan 2008 11:47:50 -0700 Subject: [Maxima] [Gcl-devel] building maxima with gcl In-Reply-To: <54bq7wixrr.fsf@intech19.enhanced.com> References: <54bq7wixrr.fsf@intech19.enhanced.com> Message-ID: On 08 Jan 2008 02:26:00 -0500, Camm Maguire wrote: > Just a quick note here -- cannot reproduce this yet, the gcl stuff > appears to work fine, but the Debian package build now bombs at: > /fix/t1/camm/maxima-5.14.0/doc/info//Introduction.texi:194: Unknown command `opencatbox'. > /fix/t1/camm/maxima-5.14.0/doc/info//Introduction.texi:195: Unknown command `category'. @opencatbox and @category are defined in doc/info/category-macros.texi -- I don't know why that file should be missing. It is present in CVS and in the maxima-5.14.0.tar.gz tarblob. I don't know anything about the Debian build process, but for the record it is not necessary to build the reference manual documentation since the tarball contains the .info and .html generated from the .texi files. HTH Robert Dodier From amundson at users.sourceforge.net Tue Jan 8 13:30:11 2008 From: amundson at users.sourceforge.net (James Amundson) Date: Tue, 08 Jan 2008 13:30:11 -0600 Subject: [Maxima] Keyword arguments? In-Reply-To: References: Message-ID: <20080108133011.14b23e1c@abacus4> On Tue, 08 Jan 2008 12:22:29 -0500 raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) wrote: > I was wondering about implementing a keyword argument scheme. > Something like > > quad_qags(f,x,a,b, epsrel=1d-8, epsabs=1d-8, limit=500) I think that's a great idea. I've wanted that for a long time. It seems to me that quad_qags(f,x,a,b, epsrel:1d-8, epsabs:1d-8, limit:500) (i.e., using ':' for assignment instead of '=') would be more consistent with the rest of the Maxima syntax. --Jim From macrakis at alum.mit.edu Tue Jan 8 13:46:07 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 8 Jan 2008 14:46:07 -0500 Subject: [Maxima] Keyword arguments? In-Reply-To: <20080108133011.14b23e1c@abacus4> References: <20080108133011.14b23e1c@abacus4> Message-ID: <8b356f880801081146t5d62c075nbd63076dd4df0477@mail.gmail.com> On Jan 8, 2008 2:30 PM, James Amundson wrote: > > Something like > > quad_qags(f,x,a,b, epsrel=1d-8, epsabs=1d-8, limit=500) > > I think that's a great idea. I've wanted that for a long time. It seems > to me that > > quad_qags(f,x,a,b, epsrel:1d-8, epsabs:1d-8, limit:500) > > (i.e., using ':' for assignment instead of '=') would be more > consistent with the rest of the Maxima syntax. > Unless the function quotes its arguments (which is almost always a bad idea), this won't work, because the ":" operator will be executed during argument evaluation, so quad_qags will see the arguments as [ f, x, a, b, 1d-8, 1d-8, 500 ] that is, the keywords will be gone. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080108/10ce7f62/attachment.htm From andre.maute at gmx.de Tue Jan 8 13:49:51 2008 From: andre.maute at gmx.de (andre maute) Date: Tue, 8 Jan 2008 20:49:51 +0100 Subject: [Maxima] defining functions of s variables In-Reply-To: <8b356f880801080838i3b75c2b0s373e1ebbbec8b79c@mail.gmail.com> References: <20080108135903.GA16752@simba> <8b356f880801080838i3b75c2b0s373e1ebbbec8b79c@mail.gmail.com> Message-ID: <200801082049.51294.andre.maute@gmx.de> Hi Bart, perhaps you are seeking the - makelist-concat construct for creating s variables - apply-buildq-lambda construct for evaluation of the function --------------------- snip ----------------- f(x) := block( [res, k], res : 1, for k : 1 thru length(x) do block( res : res * x[k]^k ), return( res ) ); s : 6; /* variables */ x : makelist( concat(x,i), i, 1, s ); /* derivatives */ for k : 1 thru s do block( print( k, " ", diff(f(x),x[k]) ) ); /* evaluation, e.g. f( [1, ..., 1] ) */ g : f(x); p : makelist( 1, i, 1, s ); result : apply( buildq( [x,g], lambda(x,g) ), p ); --------------------- snip ----------------- Regards Andre From van.nek at arcor.de Tue Jan 8 14:28:29 2008 From: van.nek at arcor.de (van Nek) Date: Tue, 08 Jan 2008 21:28:29 +0100 Subject: [Maxima] round bug? Message-ID: <4783EAFD.7320.14B7DA2@van.nek.arcor.de> I found Maxima 5.14.0 http://maxima.sourceforge.net Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL) (%i1) map(round, [1.b0, 1.1b1, 1.11b2, 10.b-1, 100.b-2]); (%o1) [round(1.0b0), round(1.1b1), round(1.11b2), round(1.0b0), round(1.0b0)] Is that known? Volker van Nek From raymond.toy at ericsson.com Tue Jan 8 15:12:41 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 08 Jan 2008 16:12:41 -0500 Subject: [Maxima] Keyword arguments? In-Reply-To: <20080108133011.14b23e1c@abacus4> References: <20080108133011.14b23e1c@abacus4> Message-ID: <4783E749.30200@ericsson.com> James Amundson wrote: > On Tue, 08 Jan 2008 12:22:29 -0500 > raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) wrote: > >> I was wondering about implementing a keyword argument scheme. >> Something like >> >> quad_qags(f,x,a,b, epsrel=1d-8, epsabs=1d-8, limit=500) > > I think that's a great idea. I've wanted that for a long time. It seems > to me that Hello, James! Long time no see! Just a note that, as I have it implemented today, this is only supported in Lisp. (Maxima functions can parse out the keywords itself.) Basically quad_qags(f,x,a,b,epsrel=1d-8) is wrapper which eventually does (apply 'quad-qags-internal f x a b $epsrel 1d-8) and quad-qags-internal is a Lisp function: (defun quad-qags-internal (f x a b &key (($epsrel epsrel) 1d-8)) ) So if call quad_qags(f,x,a,b,foobar=27), you get a Lisp error about an unknown keyword $foobar. This could be changed so quad-qags-internal allows other keywords but ignores them. This isn't so nice. Or a check could be done (probably should be done) for valid keywords and a maxima error is thrown instead of a Lisp error. Oh, and you, of course, get weird results if you actually have a variable called epsabs. Then you have to do quad_qags(..., 'epsabs = 1d-8). Of course, my proposal changes the interface to the quadpack routines. That's not usually a very nice thing to do to people. I assume, however, that most people don't use the extra arguments today anyway, but I could be wrong. Ray From fateman at cs.berkeley.edu Tue Jan 8 15:20:50 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Tue, 08 Jan 2008 13:20:50 -0800 Subject: [Maxima] round bug? In-Reply-To: <4783EAFD.7320.14B7DA2@van.nek.arcor.de> References: <4783EAFD.7320.14B7DA2@van.nek.arcor.de> Message-ID: <4783E932.2010806@cs.berkeley.edu> I'm not sure what you want. Perhaps you would like to convert the bigfloats to a rational number and choose the closest integer to that number? you could do ratepsilon:0$ round(rat(1.1b1)); If you mean to change the precision and have the bigfloat rounded to that precision... van Nek wrote: > I found > > Maxima 5.14.0 http://maxima.sourceforge.net > Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL) > > (%i1) map(round, [1.b0, 1.1b1, 1.11b2, 10.b-1, 100.b-2]); > (%o1) [round(1.0b0), round(1.1b1), round(1.11b2), round(1.0b0), round(1.0b0)] > > Is that known? > > Volker van Nek > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From willisb at unk.edu Tue Jan 8 16:29:38 2008 From: willisb at unk.edu (Barton Willis) Date: Tue, 8 Jan 2008 16:29:38 -0600 Subject: [Maxima] round bug? In-Reply-To: <4783EAFD.7320.14B7DA2@van.nek.arcor.de> References: <4783EAFD.7320.14B7DA2@van.nek.arcor.de> Message-ID: This is a bug (unreported, I think). If you could, please file a bug report. You can assign me the task of fixing it. Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: Maxima at math.utexas.edu >From: "van Nek" >Sent by: maxima-bounces at math.utexas.edu >Date: 01/08/2008 02:28PM >Subject: [Maxima] round bug? > >I found > >Maxima 5.14.0 http://maxima.sourceforge.net >Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL) > >(%i1) map(round, [1.b0, 1.1b1, 1.11b2, 10.b-1, 100.b-2]); >(%o1) [round(1.0b0), round(1.1b1), round(1.11b2), round(1.0b0), >round(1.0b0)] > >Is that known? > >Volker van Nek >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From ismaelgf at adinet.com.uy Tue Jan 8 21:27:09 2008 From: ismaelgf at adinet.com.uy (Ismael Garrido) Date: Wed, 09 Jan 2008 01:27:09 -0200 Subject: [Maxima] Maxima Spanish examples Message-ID: <47843F0D.6010702@adinet.com.uy> Hello I've uploaded some materials I used to give a talk about Maxima at my University at the following URL: http://wiki.universidadlibre.org.ar/index.php?title=Maxima_Ejemplos It's all written in Spanish, though it could be easily translated. Ismael From A.G.Grozin at inp.nsk.su Tue Jan 8 22:33:17 2008 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Wed, 9 Jan 2008 10:33:17 +0600 (NOVT) Subject: [Maxima] TeXmacs and maxima-5.14.0 In-Reply-To: References: Message-ID: On Tue, 8 Jan 2008, Robert Dodier wrote: > Is there a way to make TeXmacs detect any version of Maxima? > It seems troublesome to have to modify TeXmacs for each Maxima release. Yes there is, if we drop support of maxima versions <=5.9.2. Then the "modern" behaviour can be assumed, and no patches will be needed to run a new version of maxima (of course, unless there are some backward-incompatible changes in mactex.lisp, but this should be a rare case). Andrey From Bart.Vandewoestyne at telenet.be Wed Jan 9 06:23:11 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Wed, 9 Jan 2008 13:23:11 +0100 Subject: [Maxima] displaying a function Message-ID: <20080109122311.GA4767@forsythe> Dear list, Still taking my first steps with Maxima and definitely refusing to resort to Maple, I am setting up some simple examples before I try to implement the bigger thing that I am working on. The purpose for me is to get a feel for and try to understand how Maxima works. Consider the following example where I have an s-dimensional function f(x) from which i create a new s-dimensional function f_periodized(x) by using a certain recursion: s: 2$ f(x) := product(x[i]^i, i, 1, s)$ phi[0](x) := f(x)$ for j:1 thru s do phi[j](x) := phi[j-1](x) + f(x)$ dispfun(phi[s])$ f_periodized(x) := phi[s](x)$ dispfun(f_periodized)$ Starting from an arbitrary f(x), I would like to see how f_periodized(x) looks like. For my given example, the dispfun(phi[s]) command gives me s 2 (%t6) phi (x) := 3 x x s 1 2 Which is what I need. However, the dispfun(f_periodized) command only gives (%t8) f_periodized(x) := phi (x) s Why is this and how can i also display f_periodized(x) in terms of the x_i? Thanks, Bart -- "Share what you know. Learn what you don't." From willisb at unk.edu Wed Jan 9 08:03:30 2008 From: willisb at unk.edu (Barton Willis) Date: Wed, 9 Jan 2008 08:03:30 -0600 Subject: [Maxima] displaying a function In-Reply-To: <20080109122311.GA4767@forsythe> References: <20080109122311.GA4767@forsythe> Message-ID: You can do (%i8) phi[0](x); (%o8) x[1]*x[2]^2 (%i9) phi[42](x); (%o9) 43*x[1]*x[2]^2 Is this enough? Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: maxima at math.utexas.edu >From: Bart Vandewoestyne >Sent by: maxima-bounces at math.utexas.edu >Date: 01/09/2008 06:23AM >Subject: [Maxima] displaying a function > >Dear list, > >Still taking my first steps with Maxima and definitely refusing >to resort to Maple, I am setting up some simple examples before I >try to implement the bigger thing that I am working on. The >purpose for me is to get a feel for and try to understand how >Maxima works. > >Consider the following example where I have an s-dimensional >function f(x) from which i create a new s-dimensional function >f_periodized(x) by using a certain recursion: > > >s: 2$ >f(x) := product(x[i]^i, i, 1, s)$ > >phi[0](x) := f(x)$ >for j:1 thru s do > phi[j](x) := phi[j-1](x) + f(x)$ > >dispfun(phi[s])$ > >f_periodized(x) := phi[s](x)$ >dispfun(f_periodized)$ > > >Starting from an arbitrary f(x), I would like to see how f_periodized(x) >looks like. For my given example, the dispfun(phi[s]) command gives me > > s > 2 >(%t6) phi (x) := 3 x x > s 1 2 > > >Which is what I need. However, the dispfun(f_periodized) command only >gives > >(%t8) f_periodized(x) := phi (x) > s > >Why is this and how can i also display f_periodized(x) in terms of the >x_i? > >Thanks, >Bart > >-- > "Share what you know. Learn what you don't." >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From Bart.Vandewoestyne at telenet.be Wed Jan 9 08:51:20 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Wed, 9 Jan 2008 15:51:20 +0100 Subject: [Maxima] displaying a function In-Reply-To: References: <20080109122311.GA4767@forsythe> Message-ID: <20080109145119.GA5113@forsythe> On Wed, Jan 09, 2008 at 08:03:30AM -0600, Barton Willis wrote: > You can do > > (%i8) phi[0](x); > (%o8) x[1]*x[2]^2 > > (%i9) phi[42](x); > (%o9) 43*x[1]*x[2]^2 > > Is this enough? Yes, thanks. That seems OK. Regards, Bart -- "Share what you know. Learn what you don't." From biomates at telefonica.net Wed Jan 9 09:10:38 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 09 Jan 2008 16:10:38 +0100 Subject: [Maxima] Maxima Spanish examples In-Reply-To: <47843F0D.6010702@adinet.com.uy> References: <47843F0D.6010702@adinet.com.uy> Message-ID: <4784E3EE.1090502@telefonica.net> Ismael Garrido escribi?: > Hello > > I've uploaded some materials I used to give a talk about Maxima at my > University at the following URL: > http://wiki.universidadlibre.org.ar/index.php?title=Maxima_Ejemplos > > It's all written in Spanish, though it could be easily translated. > > > Ismael Gracias Ismael, One question: is this a permanent link? -- Mario Rodriguez Riotorto www.biomates.net From macrakis at alum.mit.edu Wed Jan 9 09:40:27 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 9 Jan 2008 10:40:27 -0500 Subject: [Maxima] displaying a function In-Reply-To: References: <20080109122311.GA4767@forsythe> Message-ID: <8b356f880801090740s40589c8ax8daf083d936ca4c3@mail.gmail.com> By the way, you should keep in mind that in Maxima, functions defined with a subscript, e.g. f[i](x) := ... or g[i] := ... are memoized, that is, they save any calculated values for future use (to avoid recalculation). This is very useful to avoid exponentially many recalculations in double recursions etc. (see example below). BUT!!! You must be careful. If you change the definition of g, or if the value of g depends on parameters which may change, the memoized values will no longer be correct: you need to remarray(g) and redefine g in that case. -s Example of memoized function fib(x):=(print(x),if x<1 then 1 else fib(x-1)+fib(x-2))$ <<< not memoized fb[x] := (print(x),if x<1 then 1 else fb[x-1]+fb[x-2])$ <<< memoized (%i15) fib(3); 3 2 1 0 - 1 0 1 0 - 1 <<<<< 9 calls to fib (%o15) 5 (%i16) fib(3); 3 2 1 0 - 1 0 1 0 - 1 <<<<< still 9 calls (%o16) 5 (%i17) fb[3]; 3 2 1 0 - 1 <<<< only 5 calls to fb, since some values are needed more than once (%o17) 5 (%i18) fb[3]; <<<< no calls to fb because fb[3] is saved (%o18) 5 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080109/d837c5f3/attachment.htm From yhonda at mac.com Wed Jan 9 09:43:29 2008 From: yhonda at mac.com (Yasuaki Honda) Date: Thu, 10 Jan 2008 00:43:29 +0900 Subject: [Maxima] imaxima announcements In-Reply-To: References: <8F6ED83B-8108-4920-AA4F-664FB967582D@mac.com> Message-ID: <7D86C987-9233-4960-B73D-57F9A68643F4@mac.com> Hi Robert san, On 2008/01/08, at 13:31, Robert Dodier wrote: >> Today or tomorrow, I will announce 0.99, which maintains some >> documentation. It would be nice if you can import this package. > > OK, no problem, I'll import 0.99. Thanks! >>> I will import only imaxima, not breqn. I am a little bit worried >>> about >>> importing breqn, so I will assume breqn is separate from Maxima, >>> unless someone wants to convince me otherwise. >> >> Do you have any specific issues / concerns regarding the possible >> inclusion of breqn package into Maxima? > > Well, the problems that I see are that it is fairly large (approx 1 > M), > it is under development, it can be used independently of Maxima, > and it is part of a system (LaTeX) which has its own installation > process. > breqn really seems like something which wants to be installed > separately. > > How much work is it to get breqn installed? If it is something > comparable > to yum or apt-get or getting Perl stuff from CPAN then I would say > that > suggests we don't need to include it with Maxima. I didn't notice the issue of the size! The reason it is large is that it includes documents in PDF. I created an absolute minimum package based on breqn097a as an experiment, and its size is 36KB. For the legal reason, I may need to include *.dtx files. Adding *.dtx to the zip archive makes the size of the archive 122KB. What do you think, 122KB is acceptable talking about the size? 36KB? As for the installation process, today, no TeX system includes breqn package for the unknown copyright status issue. I hope they include breqn soon. Also, many linux distributions contain tex distributions, but not always up to date. So I think there are a lot of chances for end users to install tex system without breqn packages for a year or two. Looking at CTAN quickly, it seems they do not provide any package installation service. So, until breqn is incorporated widely in tex systems, I would prefer to distribute it with imaxima, and hopefully maxima if it includes imaxima. I will ask Morten if either 36KB or 122KB packages are OK to distribute, from license point of view. Yasuaki Honda, Chiba, Japan From robert.dodier at gmail.com Wed Jan 9 10:09:16 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 9 Jan 2008 09:09:16 -0700 Subject: [Maxima] imaxima announcements In-Reply-To: <7D86C987-9233-4960-B73D-57F9A68643F4@mac.com> References: <8F6ED83B-8108-4920-AA4F-664FB967582D@mac.com> <7D86C987-9233-4960-B73D-57F9A68643F4@mac.com> Message-ID: On 1/9/08, Yasuaki Honda wrote: > I will ask Morten if either 36KB or 122KB packages are OK to > distribute, from license point of view. Hi Yasuaki, thanks for your reply. On considering this I agree that we should incorporate either the 36K or 122K breqn packages. Let us know what you find out from Morten. best Robert From Bart.Vandewoestyne at telenet.be Wed Jan 9 10:34:04 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Wed, 9 Jan 2008 17:34:04 +0100 Subject: [Maxima] request for comments/improvements/style of first Maxima script Message-ID: <20080109163404.GA6094@forsythe> Dear list, After some experimenting and with some help of people on this list, i think I have managed to do what I wanted to do with Maxima. The thing that I wanted to do was to start from one function f(x) and create another function phi(x) using some special formula that contains partial derivatives of f(x). The description of how it exactly is done together with my Maxima implementation can be found at http://www.cs.kuleuven.be/~bartv/stuff/bernoulli/ Summarized, the main purpose of the script is, given an input function f(x) in s dimensions, show how the output function phi(x) (called f_periodized(x) in the script) looks like. Things seem to work, but I am always careful... therefore, since these are my first steps with Maxima, I would appreciate comments on and suggestions for improvement of my Maxima script. Especially things like... * possible errors or problems that could occur * coding style: suggestions for improving the readability * better ways of implementing what I have implemented ... are very welcome! Regards, Bart -- "Share what you know. Learn what you don't." From macrakis at alum.mit.edu Wed Jan 9 13:54:50 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 9 Jan 2008 14:54:50 -0500 Subject: [Maxima] request for comments/improvements/style of first Maxima script In-Reply-To: <20080109163404.GA6094@forsythe> References: <20080109163404.GA6094@forsythe> Message-ID: <8b356f880801091154s3e0fddafy7d56d675d2ed256c@mail.gmail.com> Thanks for sharing your source with us. Here's how I would do it: P(x, n) := bernpoly(x, n+1)/(n+1)!$ phi[i,s,alpha] := if i=0 then product(x[i]^5,i,1,s) else phi[i-1,s,alpha] + sum( sum( (-1)^ni * P(x[i],ai) * subst( x[i]=ni, diff(phi[i-1,s,alpha], x[i], ai) ), ni, 0, 1), ai, 0, alpha-1)$ phi[2,2,2]; => x[1]^5*x[2]^5-5*(x[1]^2-x[1]+1/6)*x[2]^5/2-(x[1]-1/2)*x[2]^5 -(5*x[1]^5-25*(x[1]^2-x[1]+1/6)/2-5*(x[1]-1/2))*(x[2]^2-x[2]+1/6)/2 -(x[1]^5-5*(x[1]^2-x[1]+1/6)/2-x[1]+1/2)*(x[2]-1/2) Notice that phi does not have an (x) argument -- it is not needed, we simply manipulate *expressions*. Also, no loop is needed: recursion with memoizing is enough. Finally, I have added s and alpha as subscripts to phi so that the same run can have different values of s and alpha without running into the memoizing issue I mentioned earlier. Hope this is helpful. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080109/fc55e9aa/attachment.htm From mh.ctan at gmail.com Wed Jan 9 17:40:11 2008 From: mh.ctan at gmail.com (=?ISO-8859-1?Q?Morten_H=F8gholm?=) Date: Thu, 10 Jan 2008 00:40:11 +0100 Subject: [Maxima] imaxima announcements In-Reply-To: References: <8F6ED83B-8108-4920-AA4F-664FB967582D@mac.com> <7D86C987-9233-4960-B73D-57F9A68643F4@mac.com> Message-ID: <0537C2FA-3F12-4F37-8D90-C49A9162294D@gmail.com> On Jan 9, 2008, at 5:09 PM, Robert Dodier wrote: Hi Robert and Yasuaki, > On 1/9/08, Yasuaki Honda wrote: > >> I will ask Morten if either 36KB or 122KB packages are OK to >> distribute, from license point of view. > > Hi Yasuaki, thanks for your reply. On considering this I agree that > we should incorporate either the 36K or 122K breqn packages. > Let us know what you find out from Morten. Oh, he is listening on this list... :-) Just been very busy with diaper changing etc. as we have a newborn daughter on our hands. LPPL 1.3 is a good, clear license when it comes to things like this. It's not ideal for everything but for our purpose of stability and maintainability it is. Clause 3 of the "CONDITIONS ON DISTRIBUTION AND MODIFICATION" section reads: 3. You may distribute a Compiled Work that has been generated from a complete, unmodified copy of the Work as distributed under Clause 2 above, as long as that Compiled Work is distributed in such a way that the recipients may install the Compiled Work on their system exactly as it would have been installed if they generated a Compiled Work directly from the Work. Since I have not been completely clear about what constitutes the Compiled Work, I think for the time being it is best to include the dtx files plus the generated runtime files with extensions sty and sym. Best, Morten Maintainer email for questions regarding the "mh" packages on CTAN: breqn, empheq, mathtools, etc. From ismaelgfk at gmail.com Tue Jan 8 21:25:38 2008 From: ismaelgfk at gmail.com (Ismael Garrido) Date: Wed, 09 Jan 2008 01:25:38 -0200 Subject: [Maxima] Maxima Spanish examples Message-ID: <47843EB2.4040308@gmail.com> Hello I've uploaded some materials I used to give a talk about Maxima at my University at the following URL: http://wiki.universidadlibre.org.ar/index.php?title=Maxima_Ejemplos It's all written in Spanish, though it could be easily translated. Ismael From ismaelgf at adinet.com.uy Wed Jan 9 18:50:25 2008 From: ismaelgf at adinet.com.uy (Ismael Garrido) Date: Wed, 09 Jan 2008 22:50:25 -0200 Subject: [Maxima] Maxima Spanish examples In-Reply-To: <4784E3EE.1090502@telefonica.net> References: <47843F0D.6010702@adinet.com.uy> <4784E3EE.1090502@telefonica.net> Message-ID: <47856BD1.6060600@adinet.com.uy> Mario Rodriguez escribi?: > Ismael Garrido escribi?: >> Hello >> >> I've uploaded some materials I used to give a talk about Maxima at my >> University at the following URL: >> http://wiki.universidadlibre.org.ar/index.php?title=Maxima_Ejemplos >> >> It's all written in Spanish, though it could be easily translated. >> >> >> Ismael > Gracias Ismael, > > One question: is this a permanent link? > In short: yes. In long: For as long as the "Universidad Libre" proyect is alive, the wiki will be live and the content will remain there. As is the nature of wikis, it might get improved sometime in the future. Ismael From maxima-list at ssteiner.com Thu Jan 10 07:15:44 2008 From: maxima-list at ssteiner.com (maxima-list at ssteiner.com) Date: Thu, 10 Jan 2008 14:15:44 +0100 (MET) Subject: [Maxima] Operating Maxima out of another program by a TCP connection Message-ID: <200801101315.m0ADFiIt003377@post.webmailer.de> Dear Maxima experts, I'd like to operate Maxima out of a self-programmed software by using a TCP connection. I use Windows 2000/XP. According to the source code of wxMaxima, it should be possible to start maxima in something like a "server mode" in which it allows connecting to it through a tcp connection. But I still haven't succeeded in starting Maxima this way. What are the correct command line parameters for maxima.exe to make Maxima accept tcp connections on port xy (e.g. 4010)? I already tried maxima -eval "(maxima::start-server 4040)" -eval "(run)" -f [=> error message: Error in SYSTEM::SET-UP-TOP-LEVEL [or a callee]: Could not connect] and maxima -s 4010 [=> Maxima just quits, nothing happens] but both command lines don't work. How to make Maxima become operatable using a TCP connection? Thanks a lot! Bye, Sebastian From Bart.Vandewoestyne at telenet.be Thu Jan 10 08:39:46 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Thu, 10 Jan 2008 15:39:46 +0100 Subject: [Maxima] request for comments/improvements/style of first Maxima script In-Reply-To: <8b356f880801091154s3e0fddafy7d56d675d2ed256c@mail.gmail.com> References: <20080109163404.GA6094@forsythe> <8b356f880801091154s3e0fddafy7d56d675d2ed256c@mail.gmail.com> Message-ID: <20080110143946.GA12780@forsythe> On Wed, Jan 09, 2008 at 02:54:50PM -0500, Stavros Macrakis wrote: > > Thanks for sharing your source with us. > Here's how I would do it: > > P(x, n) := bernpoly(x, n+1)/(n+1)!$ > phi[i,s,alpha] := > if i=0 then product(x[i]^5,i,1,s) > else > phi[i-1,s,alpha] > + > sum( > sum( (-1)^ni * P(x[i],ai) * subst( x[i]=ni, > diff(phi[i-1,s,alpha], x[i], ai) ), > ni, 0, 1), > ai, 0, alpha-1)$ > phi[2,2,2]; => > x[1]^5*x[2]^5-5*(x[1]^2-x[1]+1/6)*x[2]^5/2-(x[1]-1/2)*x[2]^5 > > -(5*x[1]^5-25*(x[1]^2-x[1]+1/6)/2-5*(x[1]-1/2))*(x[2]^2-x[2]+1/6)/2 > -(x[1]^5-5*(x[1]^2-x[1]+1/6)/2-x[1]+1/2)*(x[2]-1/2) > > Notice that phi does not have an (x) argument -- it is not needed, we > simply manipulate *expressions*. Also, no loop is needed: recursion > with memoizing is enough. Finally, I have added s and alpha as > subscripts to phi so that the same run can have different values of s > and alpha without running into the memoizing issue I mentioned > earlier. Thanks. While slightly adapting your version and playing around with it, i noticed a difference in behavior between your version and mine when for example the dimension s is larger than one. The function that I create has a special property that I have added at the end of the postscript which can be found online at http://www.cs.kuleuven.be/~bartv/stuff/bernoulli/periodizing_with_bernoulli_polynomials.ps Now both your and my script that implement this can be found at http://www.cs.kuleuven.be/~bartv/stuff/bernoulli/ Notice that the integral for the function (x[1]*x[2])^2 in two dimensions is 1/9. For alpha large enough (i take it 5 in the scripts, which should be ok) we then have that the newly constructed function should also exactly be this value of 1/9. Your script seems to show that result. My script however does not. It gives a value of 1/25 instead of 1/9 and I cannot see what I am doing wrong. Does anybody see what I'm doing wrong in my script http://www.cs.kuleuven.be/~bartv/stuff/bernoulli/method_with_bernoulli_polynomials.mac compared to the apparently correct functioning script http://www.cs.kuleuven.be/~bartv/stuff/bernoulli/method_with_bernoulli_polynomials2.mac based on Stavros' method? Thanks! Bart -- "Share what you know. Learn what you don't." From robert.dodier at gmail.com Thu Jan 10 09:51:45 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 10 Jan 2008 08:51:45 -0700 Subject: [Maxima] TeXmacs and maxima-5.14.0 In-Reply-To: References: Message-ID: On 1/8/08, Andrey G. Grozin wrote: > On Tue, 8 Jan 2008, Robert Dodier wrote: > > Is there a way to make TeXmacs detect any version of Maxima? > > It seems troublesome to have to modify TeXmacs for each Maxima release. > Yes there is, if we drop support of maxima versions <=5.9.2. Then the > "modern" behaviour can be assumed, and no patches will be needed to run a > new version of maxima (of course, unless there are some > backward-incompatible changes in mactex.lisp, but this should be a rare > case). It seems, then, that dropping support for versions <= 5.9.2 would be a good move at this point. I'm in favor of it. By the way, what constitutes a backward-incompatible change in mactex.lisp? best, Robert Dodier From willisb at unk.edu Thu Jan 10 10:48:32 2008 From: willisb at unk.edu (Barton Willis) Date: Thu, 10 Jan 2008 10:48:32 -0600 Subject: [Maxima] erf & trigsign Message-ID: The option variable trigsign controls the application of the reflection rule to erf. The user documentation doesn't mention this. I was going to fix SF bug 1860250. Unless somebody can convince me otherwise, I'll keep the undocumented trigsign flag in simperf. Maybe somebody would like to do build an coherent scheme for controlling reflection simplifications. (%i2) erf(-x), trigsign : true; (%o2) -erf(x) (%i3) erf(-x), trigsign : false; (%o3) erf(-x) Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080110/1ae91c76/attachment.htm From macrakis at alum.mit.edu Thu Jan 10 11:33:58 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 10 Jan 2008 12:33:58 -0500 Subject: [Maxima] request for comments/improvements/style of first Maxima script In-Reply-To: <20080110143946.GA12780@forsythe> References: <20080109163404.GA6094@forsythe> <8b356f880801091154s3e0fddafy7d56d675d2ed256c@mail.gmail.com> <20080110143946.GA12780@forsythe> Message-ID: <8b356f880801100933n2a0b106coc2d677dce1f7e9e5@mail.gmail.com> > Thanks. While slightly adapting your version and playing around > with it, i noticed a difference in behavior between your version > and mine when for example the dimension s is larger than one. Your definition of phi[0] is f(x). You define f(x) as product((x[1]*x[2])^2, i, 1, s)$ When s=2, this is (x[1]*x[2])^4. In my code, phi[0,...] is product((x[1]*x[2]), i, 1, s). -s From yhonda at mac.com Thu Jan 10 11:42:31 2008 From: yhonda at mac.com (Yasuaki Honda) Date: Fri, 11 Jan 2008 02:42:31 +0900 Subject: [Maxima] imaxima announcements In-Reply-To: <0537C2FA-3F12-4F37-8D90-C49A9162294D@gmail.com> References: <8F6ED83B-8108-4920-AA4F-664FB967582D@mac.com> <7D86C987-9233-4960-B73D-57F9A68643F4@mac.com> <0537C2FA-3F12-4F37-8D90-C49A9162294D@gmail.com> Message-ID: Hi Morten, On 2008/01/10, at 8:40, Morten H?gholm wrote: > On Jan 9, 2008, at 5:09 PM, Robert Dodier wrote: > > Hi Robert and Yasuaki, > >> On 1/9/08, Yasuaki Honda wrote: >> >>> I will ask Morten if either 36KB or 122KB packages are OK to >>> distribute, from license point of view. >> >> Hi Yasuaki, thanks for your reply. On considering this I agree that >> we should incorporate either the 36K or 122K breqn packages. >> Let us know what you find out from Morten. > > Oh, he is listening on this list... :-) Just been very busy with > diaper changing etc. as we have a newborn daughter on our hands. Congratulations for your newborn daughter!! I understand you must be busy taking care of her. Enjoy! > LPPL 1.3 is a good, clear license when it comes to things like this. > It's not ideal for everything but for our purpose of stability and > maintainability it is. > > Clause 3 of the "CONDITIONS ON DISTRIBUTION AND MODIFICATION" section > reads: > > 3. You may distribute a Compiled Work that has been generated from a > complete, unmodified copy of the Work as distributed under Clause 2 > above, as long as that Compiled Work is distributed in such a way that > the recipients may install the Compiled Work on their system exactly > as it would have been installed if they generated a Compiled Work > directly from the Work. > > > Since I have not been completely clear about what constitutes the > Compiled Work, I think for the time being it is best to include the > dtx files plus the generated runtime files with extensions sty and > sym. OK. I agree with you. I will create this 122KB package as breqn097a.zip. This smaller one will replace the currently distributed (744KB) package on my imaxima web site. Then I will post the URL. I hope Robert san to pick it up and import it into Maxima CVS. Thanks, Morten san for responding. best regards, Yasuaki Honda, Chiba, Japan > > > > > Best, > Morten > Maintainer email for questions regarding the "mh" packages > on CTAN: breqn, empheq, mathtools, etc. > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From andrej.vodopivec at gmail.com Thu Jan 10 14:48:51 2008 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Thu, 10 Jan 2008 21:48:51 +0100 Subject: [Maxima] Can Maxima solve this optimization problem? In-Reply-To: <6ade6f6c0801080438l3e38e494t175e3b29071e56fb@mail.gmail.com> References: <6ade6f6c0801061633w432e6af6s260ca82543a2a5ce@mail.gmail.com> <7775b21a0801070932x6889ce28gcfcc0f97e79b7730@mail.gmail.com> <6ade6f6c0801080438l3e38e494t175e3b29071e56fb@mail.gmail.com> Message-ID: <7775b21a0801101248m54dc455fgffddb264392bf528@mail.gmail.com> I believe that maxima is not capable of solving a linearly constrained program unless it is a linear program (or if the constrains are all equalities). Andrej On Jan 8, 2008 1:38 PM, Paul Smith wrote: > Thanks, Andrej, for your clever solution. But suppose now that instead of > > integral of x(t) with t from 0 to 1, > > you have the following objective function: > > integral of sin( x(t) ) with t from 0 to 1. > > Is Maxima still able to solve the maximization problem? From andrej.vodopivec at gmail.com Thu Jan 10 14:49:50 2008 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Thu, 10 Jan 2008 21:49:50 +0100 Subject: [Maxima] Operating Maxima out of another program by a TCP connection In-Reply-To: <200801101315.m0ADFiIt003377@post.webmailer.de> References: <200801101315.m0ADFiIt003377@post.webmailer.de> Message-ID: <7775b21a0801101249n5610a659m12855aa0ab372944@mail.gmail.com> maxima -s 4010 does not start a socket server on port 4010 but it tries to connect to a server on port 4010 (since there is no server running on that port you get the error "Could not connect"). Your program needs to start a socket server to which maxima then connects with this command. Andrej On Jan 10, 2008 2:15 PM, wrote: > Dear Maxima experts, > > I'd like to operate Maxima out of a self-programmed software by using a TCP connection. I use Windows 2000/XP. According to the source code of wxMaxima, it should be possible to start maxima in something like a "server mode" in which it allows connecting to it through a tcp connection. But I still haven't succeeded in starting Maxima this way. What are the correct command line parameters for maxima.exe to make Maxima accept tcp connections on port xy (e.g. 4010)? I already tried > maxima -eval "(maxima::start-server 4040)" -eval "(run)" -f > [=> error message: Error in SYSTEM::SET-UP-TOP-LEVEL [or a callee]: Could not connect] > and > maxima -s 4010 > [=> Maxima just quits, nothing happens] > but both command lines don't work. How to make Maxima become operatable using a TCP connection? > > Thanks a lot! > > Bye, > Sebastian > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From vdhoeven at texmacs.org Thu Jan 10 16:12:23 2008 From: vdhoeven at texmacs.org (Joris van der Hoeven) Date: Thu, 10 Jan 2008 23:12:23 +0100 Subject: [Maxima] TeXmacs and maxima-5.14.0 In-Reply-To: References: Message-ID: <20080110221223.GL15515@barah.math.u-psud.fr> On Tue, Jan 08, 2008 at 10:05:46PM +0600, Andrey G. Grozin wrote: > In order to run maxima-5.14.0 from TeXmacs, you should apply the following > trivial patch. Applied for the next version. > By the way, what do you all think - if we drop support of *really* ancient > versions of maxima (<=5.9.2), then the scripts can be greatly simplified. > This still leaves a lot of supported versions - 5.9.3 to 5.14.0. Maybe, > it's time to do this? [vdhoeven at alcazar src]$ maxima --version Maxima 5.9.0 Hmm, when I will buy I need machine ;^) > Happy new year, Happy new year to everybody too, --Joris From phhs80 at gmail.com Thu Jan 10 16:48:23 2008 From: phhs80 at gmail.com (Paul Smith) Date: Thu, 10 Jan 2008 22:48:23 +0000 Subject: [Maxima] Can Maxima solve this optimization problem? In-Reply-To: <7775b21a0801101248m54dc455fgffddb264392bf528@mail.gmail.com> References: <6ade6f6c0801061633w432e6af6s260ca82543a2a5ce@mail.gmail.com> <7775b21a0801070932x6889ce28gcfcc0f97e79b7730@mail.gmail.com> <6ade6f6c0801080438l3e38e494t175e3b29071e56fb@mail.gmail.com> <7775b21a0801101248m54dc455fgffddb264392bf528@mail.gmail.com> Message-ID: <6ade6f6c0801101448m22dbcbfcxc327d502173b6088@mail.gmail.com> On Jan 10, 2008 8:48 PM, Andrej Vodopivec wrote: > I believe that maxima is not capable of solving a linearly constrained > program unless it is a linear program (or if the constrains are all > equalities). Thanks, Andrej, for the information. Paul > On Jan 8, 2008 1:38 PM, Paul Smith wrote: > > Thanks, Andrej, for your clever solution. But suppose now that instead of > > > > integral of x(t) with t from 0 to 1, > > > > you have the following objective function: > > > > integral of sin( x(t) ) with t from 0 to 1. > > > > Is Maxima still able to solve the maximization problem? > From willisb at unk.edu Thu Jan 10 18:50:02 2008 From: willisb at unk.edu (Barton Willis) Date: Thu, 10 Jan 2008 18:50:02 -0600 Subject: [Maxima] taylor(x,x,0,1)^2 =/= taylor(x^2,x,0,1); Message-ID: Is there an easy way to get Maxima to do taylor(x,x,0,1)^2 --> 0 + ... instead of x^2 + ...? I could send taylor(x,x,0,1)^2 back through taylor, but that seems inefficient. (%i5) [taylor(x,x,0,1)^2, taylor(x^2,x,0,1)]; (%o5) [x^2+...,0+...] Barton From Bart.Vandewoestyne at telenet.be Fri Jan 11 04:12:29 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Fri, 11 Jan 2008 11:12:29 +0100 Subject: [Maxima] request for comments/improvements/style of first Maxima script In-Reply-To: <8b356f880801100933n2a0b106coc2d677dce1f7e9e5@mail.gmail.com> References: <20080109163404.GA6094@forsythe> <8b356f880801091154s3e0fddafy7d56d675d2ed256c@mail.gmail.com> <20080110143946.GA12780@forsythe> <8b356f880801100933n2a0b106coc2d677dce1f7e9e5@mail.gmail.com> Message-ID: <20080111101229.GB18331@forsythe> On Thu, Jan 10, 2008 at 12:33:58PM -0500, Stavros Macrakis wrote: > > Thanks. While slightly adapting your version and playing around > > with it, i noticed a difference in behavior between your version > > and mine when for example the dimension s is larger than one. > > Your definition of phi[0] is f(x). You define f(x) as > > product((x[1]*x[2])^2, i, 1, s)$ > > When s=2, this is (x[1]*x[2])^4. > > In my code, phi[0,...] is product((x[1]*x[2]), i, 1, s). Thanks! A while after posting my question to this list and before I saw your answer, I have also `discovered' this error. Changing f(x) to the correct expression solved the problem. Thanks! Bart -- "Share what you know. Learn what you don't." From jcano at agt.uva.es Fri Jan 11 07:28:00 2008 From: jcano at agt.uva.es (jcano) Date: Fri, 11 Jan 2008 14:28:00 +0100 Subject: [Maxima] file #P"/usr/local/info/maxima.info-5" does not exist Message-ID: <47876EE0.70909@agt.uva.es> I have build maxima 5.14.0 form sources in linux (slackware11.0): ./configure --enable-clisp --enable-cmucl LANG=C make LANG=C make install Maxima start correctly but the command "describe" do not work: I cannot get help also from emacs. Is this behaviour a problem with my installation or it is intended? jose$ maxima ;; Loading file /home/jose/.clisprc.lisp ... ;; Loading file /home/jose/documentos/sysadministration/Lisp/librerias/asdf.lisp ... ;; Loaded file /home/jose/documentos/sysadministration/Lisp/librerias/asdf.lisp ;; Loaded file /home/jose/.clisprc.lisp Maxima 5.14.0 http://maxima.sourceforge.net Using Lisp CLISP 2.39 (2006-07-16) 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) describe(draw); Maxima encountered a Lisp error: OPEN: file #P"/usr/local/info/maxima.info-5" does not exist Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. -- Jose M. CANO TORRES Dpto. Algebra, Geometria y Topologia Fac. Ciencias. Univ. de Valladolid. 47005-Valladolid. Spain e-mail:jcano at agt.uva.es From willisb at unk.edu Fri Jan 11 08:29:42 2008 From: willisb at unk.edu (Barton Willis) Date: Fri, 11 Jan 2008 08:29:42 -0600 Subject: [Maxima] taylor(x,x,0,1)^2 =/= taylor(x^2,x,0,1); In-Reply-To: References: Message-ID: I discovered that: (%i1) p : taylor(x,x,0,1); (%o1) x+... (%i2) p * p; (%o2) x^2+... (%i3) taylor(%); (%o3) x^2+... But (%i4) q : taylor(x,[x],0,1); (%o4) x+... (%i5) q * q; (%o5) x^2+... (%i6) taylor(%); (%o6) 0+... Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: maxima at math.utexas.edu >From: Barton Willis >Sent by: maxima-bounces at math.utexas.edu >Date: 01/10/2008 06:50PM >Subject: [Maxima] taylor(x,x,0,1)^2 =/= taylor(x^2,x,0,1); > >Is there an easy way to get Maxima to do taylor(x,x,0,1)^2 --> 0 + ... >instead of x^2 + ...? I could send taylor(x,x,0,1)^2 back >through taylor, but that seems inefficient. > >(%i5) [taylor(x,x,0,1)^2, taylor(x^2,x,0,1)]; >(%o5) [x^2+...,0+...] > >Barton >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From yhonda at mac.com Fri Jan 11 10:04:35 2008 From: yhonda at mac.com (Yasuaki Honda) Date: Sat, 12 Jan 2008 01:04:35 +0900 Subject: [Maxima] imaxima announcements In-Reply-To: References: <8F6ED83B-8108-4920-AA4F-664FB967582D@mac.com> <7D86C987-9233-4960-B73D-57F9A68643F4@mac.com> <0537C2FA-3F12-4F37-8D90-C49A9162294D@gmail.com> Message-ID: Dear Robert san, Morten san, > OK. I agree with you. I will create this 122KB package as > breqn097a.zip. > This smaller one will replace the currently distributed (744KB) > package > on my imaxima web site. Then I will post the URL. I hope Robert san to > pick it > up and import it into Maxima CVS. I put the 122KB version of breqn097a.zip at: http://members3.jcom.home.ne.jp/imaxima/breqn097a.zip Yasuaki Honda, Chiba, Japan > > > Thanks, Morten san for responding. > > best regards, > > Yasuaki Honda, Chiba, Japan > >> >> >> >> >> Best, >> Morten >> Maintainer email for questions regarding the "mh" packages >> on CTAN: breqn, empheq, mathtools, etc. >> _______________________________________________ >> 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: http://www.math.utexas.edu/pipermail/maxima/attachments/20080112/c43edbcd/attachment.htm From much at mat.uni.torun.pl Fri Jan 11 18:11:13 2008 From: much at mat.uni.torun.pl (much at mat.uni.torun.pl) Date: Sat, 12 Jan 2008 01:11:13 +0100 Subject: [Maxima] plot2d options Message-ID: <20080112011113.2nt4au3v5es0sckg@www.mat.uni.torun.pl> I try to force maxima to plot graphs of many constant functions without the description which line represents which function. Can I achieve this with wxMaxima interface? (I dont use XMaxima and I dont know graphics programming underlying gnuplot). Below is the code: reset(f,x); f(x):=4*x*(1-x); //dynamical system reset(aa,dll,dlls,Aa,Aalf); aa:0.745; //starting point dlls:400; //cut-off the beginning of orbit dll:480; //cut-off the infinite tail Aa[0]:aa; for i thru dll do Aa[i]:f(Aa[i-1]); //find the orbit Aalf:makelist(Aa[i],i,dlls,dll); plot2d(Aalf,[x,0,1],[y,0,1]); //this plots ,,the chaotic Balmer ;) lines" //to show the behavior of the orbit Unfortunately it shows more chaos than desirable due to default configuration of gnuplot. I dont want those labels of functions. Best, I would like to choose which of plotted functions are described and how - e.g. why I cant get simply letter g when plotting earlier defined function g instead of lengthy full formula? Of course two alternative ways to illustrate the chaos might look as follows: ---------------------- reset(dl,a,a1,b,c); a:0.745; a1:0.745001; b:0.755; dl:10; reset(A,A1,B,D); A[0]:a; A1[0]:a1; D[0]:A1[0]-A[0]; B[0]:b; for i thru dl do (A[i]:f(A[i-1]),A1[i]:f(A1[i-1]),D[i]:A1[i]-A[i],B[i]:f(B[i-1])); reset(Alf,Alf1,Bet,Dalet); arg:makelist(i,i,0,dl); Alf:makelist(A[i],i,0,dl); Alf1:makelist(A1[i],i,0,dl); Dalet:makelist(D[i],i,0,dl); Bet:makelist(B[i],i,0,dl); plot2d([[discrete,arg,Alf],[discrete,arg,Alf1],[discrete,arg,Bet],c],[x,0,dl],[y,0,1]); plot2d([discrete,arg,Dalet]); ------------------------------- But I want them all. Best regards, K.Le\'sniak ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From robert.dodier at gmail.com Fri Jan 11 22:12:12 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 11 Jan 2008 21:12:12 -0700 Subject: [Maxima] plot2d options In-Reply-To: <20080112011113.2nt4au3v5es0sckg@www.mat.uni.torun.pl> References: <20080112011113.2nt4au3v5es0sckg@www.mat.uni.torun.pl> Message-ID: On 1/11/08, much at mat.uni.torun.pl wrote: > I try to force maxima to plot graphs of many constant functions > without the description which line represents which function. Well, you can try plot2d(..., [gnuplot_preamble, "set nokey"]) to tell Gnuplot to omit the list of lines and their associated expressions. However I suspect that there are other, bigger problems here ... > reset(f,x); You want kill(f, x) here -- reset is something else. > plot2d(Aalf,[x,0,1],[y,0,1]); //this plots ,,the chaotic Balmer ;) lines" Not sure what you were hoping to see here. Maybe you'll need to explain in more detail. Here's a wild guess. Aalf1 : append (rest (Aalf), [0]); plot2d ([discrete, join (Aalf, Aalf), join (Aalf, Aalf1)]); > why I cant get simply letter g when plotting earlier > defined function g instead of lengthy full formula? If you write plot2d(g(x), ...) then plot2d sees whatever you see when you evaluate g(x) -- typically some expression. If you write plot2d(g, ...) i.e. you just name the function, then plot2d sees the g, and labels the line accordingly. > plot2d([[discrete,arg,Alf],[discrete,arg,Alf1],[discrete,arg,Bet],c],[x,0,dl],[y,0,1]); Not sure what this should show -- when I try it, Maxima complains that c is undefined. I'm sorry that plotting is kind of clumsy. You might take a look at the draw package which has a more general and, I hope, easier to use syntax. ? draw at the interactive prompt should show some info. HTH Robert Dodier From milan at eskimo.com Fri Jan 11 22:25:13 2008 From: milan at eskimo.com (Milan Lukic) Date: Fri, 11 Jan 2008 20:25:13 -0800 Subject: [Maxima] plot2d options In-Reply-To: <20080112011113.2nt4au3v5es0sckg@www.mat.uni.torun.pl>; from much@mat.uni.torun.pl on Sat, Jan 12, 2008 at 01:11:13AM +0100 References: <20080112011113.2nt4au3v5es0sckg@www.mat.uni.torun.pl> Message-ID: <20080111202513.B25755@eskimo.com> Have you tried to play with Maxima's Dynamics package - ?? dynamics load(dynamics); HTH, Milan * much at mat.uni.torun.pl <much at mat.uni.torun.pl> [2008-01-12 01:11:13 +0100]: > I try to force maxima to plot graphs of many constant functions > without the description which line represents which function. Can I > achieve this with wxMaxima interface? (I dont use XMaxima and I dont > know graphics programming underlying gnuplot). > Below is the code: > > reset(f,x); > f(x):=4*x*(1-x); //dynamical system > reset(aa,dll,dlls,Aa,Aalf); > aa:0.745; //starting point > dlls:400; //cut-off the beginning of orbit > dll:480; //cut-off the infinite tail > Aa[0]:aa; > for i thru dll do Aa[i]:f(Aa[i-1]); //find the orbit > Aalf:makelist(Aa[i],i,dlls,dll); > plot2d(Aalf,[x,0,1],[y,0,1]); //this plots ,,the chaotic Balmer ;) lines" > //to show the behavior of the orbit > > Unfortunately it shows more chaos than desirable due to > default configuration of gnuplot. I dont want those labels of functions. > Best, I would like to choose which of plotted functions are described > and how - e.g. why I cant get simply letter g when plotting earlier > defined function g instead of lengthy full formula? > > Of course two alternative ways to illustrate the chaos might look as follows: > ---------------------- > reset(dl,a,a1,b,c); > a:0.745; > a1:0.745001; > b:0.755; > dl:10; > reset(A,A1,B,D); > A[0]:a; > A1[0]:a1; > D[0]:A1[0]-A[0]; > B[0]:b; > for i thru dl do > (A[i]:f(A[i-1]),A1[i]:f(A1[i-1]),D[i]:A1[i]-A[i],B[i]:f(B[i-1])); > reset(Alf,Alf1,Bet,Dalet); > arg:makelist(i,i,0,dl); > Alf:makelist(A[i],i,0,dl); > Alf1:makelist(A1[i],i,0,dl); > Dalet:makelist(D[i],i,0,dl); > Bet:makelist(B[i],i,0,dl); > plot2d([[discrete,arg,Alf],[discrete,arg,Alf1],[discrete,arg,Bet],c],[x,0,dl],[y,0,1]); > plot2d([discrete,arg,Dalet]); > ------------------------------- > But I want them all. > > Best regards, K.Le\'sniak > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- From robert.dodier at gmail.com Fri Jan 11 23:10:13 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 11 Jan 2008 22:10:13 -0700 Subject: [Maxima] file #P"/usr/local/info/maxima.info-5" does not exist In-Reply-To: <47876EE0.70909@agt.uva.es> References: <47876EE0.70909@agt.uva.es> Message-ID: On 1/11/08, jcano wrote: > OPEN: file #P"/usr/local/info/maxima.info-5" does not exist Well, apparently Maxima successfully loaded its index file (maxima-index.lisp) which told it to look for maxima.info-5 ... Is maxima.info-5 actually present in /usr/local/info ? Is it somewhere else? e.g. /usr/info, /usr/local/info/es If it was not installed anywhere -- is it somewhere in the build directory? The info files are in the maxima-5.14.0.tar.gz and maxima-5.14.0-i386-1_slack11.0.tgz at Sourceforge, so it should not be necessary to rebuild the info files. Did you obtain the source code from one of those tar files or did you obtain it from CVS? What does :lisp *MAXIMA-INFODIR* :lisp *MAXIMA-LANG-SUBDIR* show? Sorry I can't be more helpful. Robert Dodier From robert.dodier at gmail.com Fri Jan 11 23:19:10 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 11 Jan 2008 22:19:10 -0700 Subject: [Maxima] TeXmacs and maxima-5.14.0 In-Reply-To: <20080110221223.GL15515@barah.math.u-psud.fr> References: <20080110221223.GL15515@barah.math.u-psud.fr> Message-ID: On 1/10/08, Joris van der Hoeven wrote: > On Tue, Jan 08, 2008 at 10:05:46PM +0600, Andrey G. Grozin wrote: > > By the way, what do you all think - if we drop support of *really* ancient > > versions of maxima (<=5.9.2), then the scripts can be greatly simplified. > > This still leaves a lot of supported versions - 5.9.3 to 5.14.0. Maybe, > > it's time to do this? > > [vdhoeven at alcazar src]$ maxima --version > Maxima 5.9.0 > > Hmm, when I will buy I need machine ;^) Joris, I'm sorry, but I can't tell what you mean here. Can you please say whether you are in favor of the suggestion to drop support for versions of Maxima up to and including 5.9.2 ?? It's up to you, but it seems like it would be beneficial to TeXmacs if it did not have to be modified for each new Maxima release. All the best, Robert Dodier From vdhoeven at texmacs.org Sat Jan 12 07:10:56 2008 From: vdhoeven at texmacs.org (Joris van der Hoeven) Date: Sat, 12 Jan 2008 14:10:56 +0100 Subject: [Maxima] TeXmacs and maxima-5.14.0 In-Reply-To: References: <20080110221223.GL15515@barah.math.u-psud.fr> Message-ID: <20080112131056.GD4698@barah.math.u-psud.fr> On Fri, Jan 11, 2008 at 10:19:10PM -0700, Robert Dodier wrote: > On 1/10/08, Joris van der Hoeven wrote: > > > On Tue, Jan 08, 2008 at 10:05:46PM +0600, Andrey G. Grozin wrote: > > > > By the way, what do you all think - if we drop support of *really* ancient > > > versions of maxima (<=5.9.2), then the scripts can be greatly simplified. > > > This still leaves a lot of supported versions - 5.9.3 to 5.14.0. Maybe, > > > it's time to do this? > > > > [vdhoeven at alcazar src]$ maxima --version > > Maxima 5.9.0 > > > > Hmm, when I will buy I need machine ;^) > > Joris, I'm sorry, but I can't tell what you mean here. I meant, when I will buy a new machine (I must have been really tired when answering). > Can you please say whether you are in favor of the suggestion to > drop support for versions of Maxima up to and including 5.9.2 ?? At the moment not, because my criterion for what is an "old version" is whether I still use such a version on one of my machines. I think this is a reasonable criterion for (lazy) users who install (or get installed) what they need when buying a new computer, but don't change their installation afterwards. > It's up to you, but it seems like it would be beneficial to TeXmacs > if it did not have to be modified for each new Maxima release. Another solution might be to simply anticipate some of the upcoming version numbers ;^) Best wishes, Joris From areiner at tph.tuwien.ac.at Sat Jan 12 08:01:26 2008 From: areiner at tph.tuwien.ac.at (Albert Reiner) Date: Sat, 12 Jan 2008 15:01:26 +0100 Subject: [Maxima] TeXmacs and maxima-5.14.0 In-Reply-To: <20080112131056.GD4698@barah.math.u-psud.fr> References: <20080110221223.GL15515@barah.math.u-psud.fr> <20080112131056.GD4698@barah.math.u-psud.fr> Message-ID: <20080112140126.GA7698@tph.tuwien.ac.at> Personally I don't use TeXmacs and so don't care whether support for slightly dated versions of Maxima is dropped or not. However: On Sat, Jan 12, 2008 at 02:10:56PM +0100, Joris van der Hoeven wrote: > At the moment not, because my criterion for what is an "old version" > is whether I still use such a version on one of my machines. > I think this is a reasonable criterion for (lazy) users who install > (or get installed) what they need when buying a new computer, > but don't change their installation afterwards. While I am all for maintaining compatibility as long as is feasible, I somehow find it hard to believe that a quintessentially `lazy' user would update TeXmacs without updating Maxima proper. So the `lazy' person's old computer will presumably just stay with the old version of TeXmacs anyway (which will, I suppose, still be available online for a long time in case someone, somewhere might need or prefer it). Best regards, Albert. From A.G.Grozin at inp.nsk.su Sat Jan 12 08:01:28 2008 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Sat, 12 Jan 2008 20:01:28 +0600 (NOVT) Subject: [Maxima] [Gcl-devel] building maxima with gcl In-Reply-To: References: <54bq7wixrr.fsf@intech19.enhanced.com> Message-ID: Hello *, I am trying to understand what's happening. In a freshly-unpacked maxima-5.14.0 directory, I created binary-gcl, binary-gcl/numerical, and binary-gcl/numerical/slatec subdirectories. Then grozin at laptop ~/maxima-5.14.0 $ cd src grozin at laptop ~/maxima-5.14.0/src $ gcl GCL (GNU Common Lisp) 2.6.8 ANSI Nov 28 2007 17:42:17 Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl) Binary License: GPL due to GPL'ed components: (XGCL READLINE BFD UNEXEC) Modifications of this banner must retain notice of a compatible license Dedicated to the memory of W. Schelter Use (help) to get some basic information on how to use GCL. Temporary directory for compiler files set to /tmp/ >(load "../lisp-utils/defsystem.lisp") Loading ../lisp-utils/defsystem.lisp Warning: REQUIRE is being redefined. Finished loading ../lisp-utils/defsystem.lisp T >(compiler::emit-fn t) Loading /usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.o Error in EVAL [or a callee]: Can't open file "/usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.data" Fast links are on: do (use-fast-links nil) for debugging Broken at EVAL. Type :H for Help. 1 (Continue) Retry loading file "/usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.o". 2 (Abort) Return to top level. dbl:>> So, the error happens when calling (compiler::emit-fn t). From where does this specific path /usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.o appear? It certainly is not present in ../lisp-utils/defsystem.lisp. It seems that it's hardcoded somewhere in gcl. Can somebody help me to find this place? Andrey From A.G.Grozin at inp.nsk.su Sat Jan 12 08:35:02 2008 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Sat, 12 Jan 2008 20:35:02 +0600 (NOVT) Subject: [Maxima] [Gcl-devel] building maxima with gcl In-Reply-To: References: <54bq7wixrr.fsf@intech19.enhanced.com> Message-ID: Sorry, I was stupid. maxima is not involved at all. ANSI gcl in Gentoo (produced by compiling from sources: gcl-2.6.7 plus Debian patches 34) is broken. If I simply start it and say grozin at laptop ~/maxima-5.14.0/src $ gcl GCL (GNU Common Lisp) 2.6.8 ANSI Nov 28 2007 17:42:17 Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl) Binary License: GPL due to GPL'ed components: (XGCL READLINE BFD UNEXEC) Modifications of this banner must retain notice of a compatible license Dedicated to the memory of W. Schelter Use (help) to get some basic information on how to use GCL. Temporary directory for compiler files set to /tmp/ >(compiler::emit-fn t) Loading /usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.o Error in EVAL [or a callee]: Can't open file "/usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.data" Fast links are on: do (use-fast-links nil) for debugging Broken at EVAL. Type :H for Help. 1 (Continue) Retry loading file "/usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.o". 2 (Abort) Return to top level. dbl:>> I get the same error. gcl cannot load gcl_collectfn.o . The process by which gcl is compiled in Gentoo seems rather straightforward: 1. Unpack gcl-2.6.7 2. Apply Debian patch 34 3. Apply some patch to configure which fixes http://bugs.gentoo.org/103483 . The comment about it says: The LANG vars aren't reset early enough so when sed tries to use [a-zA-Z] in option parsing, it may break. 4. Replace all gcl-doc by gcl-2.6.7-r3 in info/makefile 5. Configure. On my system, for example, ./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-tkconfig=/usr/lib --enable-tclconfig=/usr/lib --enable-locbfd --disable-dynsysbfd --disable-statsysbfd --enable-dynsysgmp --enable-readline --with-x --disable-debug --enable-ansi --enable-xdr=no --enable-infodir=/usr/share/info --enable-emacsdir=/usr/share/emacs/site-lisp/gcl --build=i686-pc-linux-gnu 6. make 7. Some sed'ding of gcl.1 man page 8. make DESTDIR="${D}" install where ${D} is some temporary tree used by portage; later,everything will be copied to / by ebuild. Plus some details: emacs support, etc. Nothing very special. But the resulting gcl is broken - it cannot load gcl_collectfn.o . Could somebody help me to repair gcl on Gentoo? Andrey From vvzhy at netorn.ru Sat Jan 12 10:13:47 2008 From: vvzhy at netorn.ru (Vadim V. Zhytnikov) Date: Sat, 12 Jan 2008 19:13:47 +0300 Subject: [Maxima] [TeXmacs] Re: TeXmacs and maxima-5.14.0 In-Reply-To: <20080112131056.GD4698@barah.math.u-psud.fr> References: <20080110221223.GL15515@barah.math.u-psud.fr> <20080112131056.GD4698@barah.math.u-psud.fr> Message-ID: <4788E73B.6090001@netorn.ru> Joris van der Hoeven writes: > On Fri, Jan 11, 2008 at 10:19:10PM -0700, Robert Dodier wrote: >> On 1/10/08, Joris van der Hoeven wrote: >> >>> On Tue, Jan 08, 2008 at 10:05:46PM +0600, Andrey G. Grozin wrote: >>>> By the way, what do you all think - if we drop support of *really* ancient >>>> versions of maxima (<=5.9.2), then the scripts can be greatly simplified. >>>> This still leaves a lot of supported versions - 5.9.3 to 5.14.0. Maybe, >>>> it's time to do this? >>> [vdhoeven at alcazar src]$ maxima --version >>> Maxima 5.9.0 >>> >>> Hmm, when I will buy I need machine ;^) >> Joris, I'm sorry, but I can't tell what you mean here. > > I meant, when I will buy a new machine (I must have been really tired when answering). > >> Can you please say whether you are in favor of the suggestion to >> drop support for versions of Maxima up to and including 5.9.2 ?? > > At the moment not, because my criterion for what is an "old version" > is whether I still use such a version on one of my machines. > I think this is a reasonable criterion for (lazy) users who install > (or get installed) what they need when buying a new computer, > but don't change their installation afterwards. > >> It's up to you, but it seems like it would be beneficial to TeXmacs >> if it did not have to be modified for each new Maxima release. > > Another solution might be to simply anticipate some of > the upcoming version numbers ;^) > Jokes aside. IMHO this is really the best approach. I maintain Maxima nad TeXmacs for ALT Linux distro for several years. And I always build TeXmacs with tiny patch which modifies behaviour of tm_maxima in simple way. If Maxima version doesn't match known version tm_maxima doesn't barf "Unknown Maxima version" but tries to start Maxima with the latest version of interface package - texmacs-maxima-5.11.0.lisp at present. -- Vadim V. Zhytnikov From van.nek at arcor.de Sat Jan 12 11:23:01 2008 From: van.nek at arcor.de (van Nek) Date: Sat, 12 Jan 2008 18:23:01 +0100 Subject: [Maxima] Maxima parser and global parameters Message-ID: <47890585.16576.1B2D65C@van.nek.arcor.de> (%i1) ( fpprec:100, [fpprec, 1.123456890123456890123456890b0] ); (%o1) [100, 1.123456890123457b0] (%i2) ( ibase:2, [ibase, 11111111] ); (%o2) [2, 11111111] This shows me that in a first step the complete expression is read and parsed and in a second step the expressions are evaluated from left to right. Is it generally possible, that expressions like fpprec:100 can have an influence on the parser inside of the same expression, or can it only have effect on the next read in expression? Volker van Nek -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080112/e503fc2d/attachment.htm From fateman at cs.berkeley.edu Sat Jan 12 12:36:15 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Sat, 12 Jan 2008 10:36:15 -0800 Subject: [Maxima] Maxima parser and global parameters In-Reply-To: <47890585.16576.1B2D65C@van.nek.arcor.de> References: <47890585.16576.1B2D65C@van.nek.arcor.de> Message-ID: <006701c8554a$03fdba80$0300a8c0@RJFE510> try ( ''(fpprec:100), [fpprec, 1.123456890123456890123456890b0] ); That is two ' [apostrophe or single-quote). _____ From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of van Nek Sent: Saturday, January 12, 2008 9:23 AM To: Maxima at math.utexas.edu Subject: [Maxima] Maxima parser and global parameters (%i1) ( fpprec:100, [fpprec, 1.123456890123456890123456890b0] ); (%o1) [100, 1.123456890123457b0] (%i2) ( ibase:2, [ibase, 11111111] ); (%o2) [2, 11111111] This shows me that in a first step the complete expression is read and parsed and in a second step the expressions are evaluated from left to right. Is it generally possible, that expressions like fpprec:100 can have an influence on the parser inside of the same expression, or can it only have effect on the next read in expression? Volker van Nek -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080112/3776b10f/attachment.htm From biomates at telefonica.net Sat Jan 12 15:30:24 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Sat, 12 Jan 2008 22:30:24 +0100 Subject: [Maxima] plot2d options In-Reply-To: <20080112011113.2nt4au3v5es0sckg@www.mat.uni.torun.pl> References: <20080112011113.2nt4au3v5es0sckg@www.mat.uni.torun.pl> Message-ID: <47893170.3070202@telefonica.net> much at mat.uni.torun.pl escribi?: > I try to force maxima to plot graphs of many constant functions > without the description which line represents which function. Can I > achieve this with wxMaxima interface? (I dont use XMaxima and I dont > know graphics programming underlying gnuplot). > Below is the code: > > reset(f,x); > f(x):=4*x*(1-x); //dynamical system > reset(aa,dll,dlls,Aa,Aalf); > aa:0.745; //starting point > dlls:400; //cut-off the beginning of orbit > dll:480; //cut-off the infinite tail > Aa[0]:aa; > for i thru dll do Aa[i]:f(Aa[i-1]); //find the orbit > Aalf:makelist(Aa[i],i,dlls,dll); > plot2d(Aalf,[x,0,1],[y,0,1]); //this plots ,,the chaotic Balmer ;) lines" > //to show the behavior of the orbit > You can try: load(draw); draw2d(points_joined=true, points(Aalf)); Here is another alternative for building and rendering list Aalf: (w[1]:0.745, w[n]:= 4.0*w[n-1]*(1-w[n-1]))$ Aalf: makelist(w[k], k, dlls, dll)$ draw2d(points_joined=true,points(Aalf))$ Package draw needs gnuplot 4.2 or later. hth -- Mario Rodriguez Riotorto www.biomates.net From biomates at telefonica.net Sat Jan 12 17:10:43 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 13 Jan 2008 00:10:43 +0100 Subject: [Maxima] Problems with info files Message-ID: <478948F3.3050304@telefonica.net> Hi, I always use the help system in Spanish without any problems. But I get some strange behaviour when I switch to the English system (today's cvs maxima): ------------------------------------ Maxima 5.14.0cvs http://maxima.sourceforge.net Using Lisp CLISP 2.41 (2006-10-13) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) :lisp (setf *maxima-lang-subdir* "") (%i1) ? sqrt ressions 6.1 Introduction to Expressions =============================== There are a number of reserved words which cannot be used as variable names. Their use would cause a possibly cryptic syntax error. integrate next from diff in at limit sum for and elseif There are also some inexact matches for `sqrt'. Try `?? sqrt' to see them. (%o1) true ------------------------------------ Even worse, in a previous compilation (cvs maxima of some days ago), when I asked for draw, I got the documentation on cspline; this was the information in maxima-index.lisp about draw and cspline: ("draw" . ("maxima.info-5" 271202 1778 "Functions and Variables for draw")) ("cspline" . ("maxima.info-6" 87887 4486 "Functions and Variables for interpol")) That is, knowing that the info was in maxima.info-5, it returned text from maxima.info-6. Yet another (possibly related) problem: files "maxima.info-?" contain some control characters; in fact, I cannot open maxima.info-8 with my usual text editor (gedit), which complains something about character encoding (I use ubuntu + utf8). I have to open it with emacs to read its contents. Shouldn't these files be in plain text? -- Mario Rodriguez Riotorto www.biomates.net From robert.dodier at gmail.com Sat Jan 12 20:36:15 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 12 Jan 2008 19:36:15 -0700 Subject: [Maxima] Problems with info files In-Reply-To: <478948F3.3050304@telefonica.net> References: <478948F3.3050304@telefonica.net> Message-ID: On 1/12/08, Mario Rodriguez wrote: > (%i1) :lisp (setf *maxima-lang-subdir* "") > (%i1) ? sqrt I'm pretty sure that Maxima has loaded the index from one place and the info text from another. What does :lisp (symbol-plist 'cl-info::cause-maxima-index-to-load) report -- does it show the autoload property pointing to es or es.utf8 ?? I'm guessing you can repair the damage by pointing the autoload property at the English-language info directory, or by changing environment variables outside of Maxima and restarting. > Even worse, in a previous compilation (cvs maxima of some days ago), > when I asked for draw, I got the documentation on cspline; this was the > information in maxima-index.lisp about draw and cspline: > > ("draw" . ("maxima.info-5" 271202 1778 "Functions and Variables for draw")) > ("cspline" . ("maxima.info-6" 87887 4486 "Functions and Variables for > interpol")) Well, that seems like a different error. I guess we'll have sort out the previous error and then come back to this. > Yet another (possibly related) problem: files "maxima.info-?" contain > some control characters; Makeinfo throws "unit separator" characters (037) into the .info output to mark the beginning of each node. I don't remember if there are any other non-printing characters emitted by makeinfo. best Robert From A.G.Grozin at inp.nsk.su Sat Jan 12 23:39:36 2008 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Sun, 13 Jan 2008 11:39:36 +0600 (NOVT) Subject: [Maxima] [TeXmacs] Re: TeXmacs and maxima-5.14.0 In-Reply-To: <4788E73B.6090001@netorn.ru> References: <20080110221223.GL15515@barah.math.u-psud.fr> <20080112131056.GD4698@barah.math.u-psud.fr> <4788E73B.6090001@netorn.ru> Message-ID: On Sat, 12 Jan 2008, Vadim V. Zhytnikov wrote: >> Another solution might be to simply anticipate some of >> the upcoming version numbers ;^) > Jokes aside. IMHO this is really the best approach. > I maintain Maxima nad TeXmacs for ALT Linux distro for > several years. And I always build TeXmacs with tiny patch > which modifies behaviour of tm_maxima in simple way. > If Maxima version doesn't match known version tm_maxima > doesn't barf "Unknown Maxima version" but tries to start > Maxima with the latest version of interface package - > texmacs-maxima-5.11.0.lisp at present. It is easy to do this in tm_maxima (and I think I'll do this change). However, the logic of maxima_detect help will be broken. Currently, if a maxima which understands --list-avail is detected (this means 5.9.0 or later), maxima --list-avail is called, and the result is grepped for good versions (meaning 5.9.3 or later) which understand -d. The list of good versions should be known at this point, and should be updated when a new version appears. It would be a mistake to grep for bad versions (5.9.0, 5.9.1, 5.9.2 - their list is finite and never changes). Suppose a user has 5.9.0 and 5.14.0 installed. Then maxima -d will work, because the default is the latest version. But grepping for 5.9.0 will give a false positive. Perhaps, I'll have to parse the output of maxima --list-avail separate individual components of versions, and compare them as numbers - if a version >= 5.9.3 is found, everything's OK (with a natural numerical interpretation of >=, which can be implemented in sh, with some effort. And don't forget rc1, cvs and other suffixes.) Andrey From vvzhy at mail.ru Sun Jan 13 02:56:02 2008 From: vvzhy at mail.ru (Vadim V. Zhytnikov) Date: Sun, 13 Jan 2008 11:56:02 +0300 Subject: [Maxima] Problems with info files In-Reply-To: <478948F3.3050304@telefonica.net> References: <478948F3.3050304@telefonica.net> Message-ID: <4789D222.6010709@mail.ru> Mario Rodriguez writes: > I always use the help system in Spanish without any problems. But I get > some strange behaviour when I switch to the English system (today's cvs > maxima): > > ------------------------------------ > Maxima 5.14.0cvs http://maxima.sourceforge.net > Using Lisp CLISP 2.41 (2006-10-13) > Distributed under the GNU Public License. See the file COPYING. > Dedicated to the memory of William Schelter. > The function bug_report() provides bug reporting information. > (%i1) :lisp (setf *maxima-lang-subdir* "") > (%i1) ? sqrt > The clean way to start maxima with English is to start it in English locale LANG=en_US maxima -- Vadim V. Zhytnikov From vvzhy at mail.ru Sun Jan 13 03:50:42 2008 From: vvzhy at mail.ru (Vadim V. Zhytnikov) Date: Sun, 13 Jan 2008 12:50:42 +0300 Subject: [Maxima] Problems with info files In-Reply-To: <4789D222.6010709@mail.ru> References: <478948F3.3050304@telefonica.net> <4789D222.6010709@mail.ru> Message-ID: <4789DEF2.5000607@mail.ru> Vadim V. Zhytnikov writes: > Mario Rodriguez writes: >> I always use the help system in Spanish without any problems. But I get >> some strange behaviour when I switch to the English system (today's cvs >> maxima): >> >> ------------------------------------ >> Maxima 5.14.0cvs http://maxima.sourceforge.net >> Using Lisp CLISP 2.41 (2006-10-13) >> Distributed under the GNU Public License. See the file COPYING. >> Dedicated to the memory of William Schelter. >> The function bug_report() provides bug reporting information. >> (%i1) :lisp (setf *maxima-lang-subdir* "") >> (%i1) ? sqrt >> > > The clean way to start maxima with English is to start it > in English locale > > LANG=en_US maxima > Yet another way is to set environment variable MAXIMA_LANG_SUBDIR to empty string: MAXIMA_LANG_SUBDIR="" export MAXIMA_LANG_SUBDIR or just export MAXIMA_LANG_SUBDIR="" in bash. -- Vadim V. Zhytnikov From biomates at telefonica.net Sun Jan 13 11:01:02 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 13 Jan 2008 18:01:02 +0100 Subject: [Maxima] Problems with info files In-Reply-To: References: <478948F3.3050304@telefonica.net> Message-ID: <478A43CE.6040608@telefonica.net> > I'm pretty sure that Maxima has loaded the index from one > place and the info text from another. What does > > :lisp (symbol-plist 'cl-info::cause-maxima-index-to-load) > > report -- does it show the autoload property pointing to es or es.utf8 ?? > Affirmative: (%i1) :lisp (symbol-plist 'cl-info::cause-maxima-index-to-load) (AUTOLOAD /usr/local/share/info/es.utf8/maxima-index.lisp) (%i1) :lisp (setf *maxima-lang-subdir* "") (%i1) :lisp (symbol-plist 'cl-info::cause-maxima-index-to-load) (AUTOLOAD /usr/local/share/info/es.utf8/maxima-index.lisp) > I'm guessing you can repair the damage by pointing the autoload > property at the English-language info directory, or by changing > environment variables outside of Maxima and restarting. > > Yes, this works. I thought setting variable *maxima-lang-subdir* to an empty string should make the job. -- Mario Rodriguez Riotorto www.biomates.net From maxima-list at ssteiner.com Sun Jan 13 12:14:36 2008 From: maxima-list at ssteiner.com (maxima-list at ssteiner.com) Date: Sun, 13 Jan 2008 19:14:36 +0100 (MET) Subject: [Maxima] Operating Maxima out of another program by a TCP connection Message-ID: <200801131814.m0DIEaH5014189@post.webmailer.de> Thank you! It works perfectly! ----- original message -------- Subject: Re: [Maxima] Operating Maxima out of another program by a TCP connection Sent: Thu, Jan 10, 2008 From: Andrej Vodopivec > maxima -s 4010 does not start a socket server on port 4010 but it > tries to connect to a server on port 4010 (since there is no server > running on that port you get the error "Could not connect"). Your > program needs to start a socket server to which maxima then connects > with this command. > > Andrej From johanbeke at hotmail.com Sun Jan 13 08:20:11 2008 From: johanbeke at hotmail.com (Johan Beke) Date: Sun, 13 Jan 2008 14:20:11 +0000 Subject: [Maxima] question Message-ID: When I try to integrate som functions (part of a double integral) and I fill in some bounds, maxima always keeps asking: is ...... positive, negative or zero. Can this question turned off? Johan _________________________________________________________________ Een gelukkig nieuwjaar vanwege Windows Live...Download het nu gratis! http://get.live.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080113/6354cc87/attachment.htm From blindstein at gmail.com Sun Jan 13 17:04:24 2008 From: blindstein at gmail.com (Justin Harford) Date: Sun, 13 Jan 2008 15:04:24 -0800 Subject: [Maxima] changing maxima display to plaintext notation Message-ID: Hello Is there a way to change the way that maxima displays output to a plaintext format. LaTeX would be really nice, but I can work with other forms of plaintext if necessary. I am a new member to the list, and a new user to maxima. I am blind and depend on the built in screenreading program called voiceover in the mac os x operating system. I installed maxima through macports. It is the command line version. Everything seems to work really well until I get an output that has some sort of spacial effect to it. The best example I can provide is superscripts. type factor(4); The output is something like a 2, with another 2 above it. With a screenreader that can only handle math one line at a time, and with the fact that the superscript is on a different line to the number, this may only make since because there is only one number/superscript to deal with. I forsee that this will become more complicated with answers that show more of this. So again, if I could change this so that it would for example show 2^2 instead of 2 2 It would really make this more usable. Regards Justin Harford Where I come from, we believe all sorts of things that aren't true; we call it history. Wicked From macrakis at alum.mit.edu Sun Jan 13 17:11:15 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 13 Jan 2008 18:11:15 -0500 Subject: [Maxima] changing maxima display to plaintext notation In-Reply-To: References: Message-ID: <8b356f880801131511v41c455dak435790019fa5a897@mail.gmail.com> Welcome to Maxima! display2d:false$ tells Maxima to output in a simple linear form with line-breaking and indentation. You can produce a completely linear form without line-breaking using the string function. You can produce the Tex form using the tex function. There are also front-ends that actually format the output using Tex, but I presume that a screenreader would have no way of dealing with that. -s From blindstein at gmail.com Sun Jan 13 17:34:39 2008 From: blindstein at gmail.com (Justin Harford) Date: Sun, 13 Jan 2008 15:34:39 -0800 Subject: [Maxima] changing maxima display to plaintext notation In-Reply-To: <8b356f880801131511v41c455dak435790019fa5a897@mail.gmail.com> References: <8b356f880801131511v41c455dak435790019fa5a897@mail.gmail.com> Message-ID: <7F7603C9-5F58-4D04-AD52-C6D63C716605@gmail.com> Hello Thanks for the fix. Much easier to read. I've definitely tried one gui wxmaxima. Practically everything was accessible with the exception of the answer view. So I could enter something, but I couldn't read the output. Not very useful really. Anyway, the commandline is somewhat more of a challenge to me, but I think if I learned it, it would be much more productive than gui anyway. Regards Justin Harford On Jan 13, 2008, at 3:11 PM, Stavros Macrakis wrote: > Welcome to Maxima! > > display2d:false$ > > tells Maxima to output in a simple linear form with line-breaking and > indentation. You can produce a completely linear form without > line-breaking using the string function. You can produce the Tex form > using the tex function. There are also front-ends that actually format > the output using Tex, but I presume that a screenreader would have no > way of dealing with that. > > -s From harald at lefant.net Sun Jan 13 17:40:23 2008 From: harald at lefant.net (Harald Geyer) Date: Mon, 14 Jan 2008 00:40:23 +0100 Subject: [Maxima] changing maxima display to plaintext notation In-Reply-To: References: Message-ID: Hello Justin, > I am a new member to the list, and a new user to maxima. I am blind > and depend on the built in screenreading program called voiceover in > the mac os x operating system. I installed maxima through macports. > It is the command line version. > Everything seems to work really well until I get an output that has > some sort of spacial effect to it. The best example I can provide is > superscripts. type > > factor(4); > > The output is something like a 2, with another 2 above it. That's a good start. Try setting display2d:false; This will cause maxima to output everything line by line. The output format is pretty similiar to the input syntax. There is also the function tex() which takes an expression as argument and returns what could be its TeX representation. Perhaps this is useful too? If you have any feedback on how to make maxima (or some resources like the wiki or the this mailing list - quoting style comes to mind) more accessible, I would be interested to know. Harald From blindstein at gmail.com Sun Jan 13 18:27:02 2008 From: blindstein at gmail.com (Justin Harford) Date: Sun, 13 Jan 2008 16:27:02 -0800 Subject: [Maxima] changing maxima display to plaintext notation In-Reply-To: References: Message-ID: <5BF3DE7B-73B6-4CCC-B16F-312622853F17@gmail.com> Harald I have tried the tex function and wonder if there isn't something to show it in latex 2.09 format. I'm experiencing a strange dialectic shock here reading tex. For example, , instead of \times or \cdot to show multiplication \over instead of \frac{numerator}{denominator} to show fractions. 3*y instead of 3y I I am reading the quickstart manual pdf file to learn more about this. It looks like it is showing it in that cute spacial style. It also looks like it was done in LaTeX. Would someone happen to have a code file I could look at? Regards Justin Harford On Jan 13, 2008, at 3:40 PM, Harald Geyer wrote: > Hello Justin, > >> I am a new member to the list, and a new user to maxima. I am blind >> and depend on the built in screenreading program called voiceover in >> the mac os x operating system. I installed maxima through macports. >> It is the command line version. > >> Everything seems to work really well until I get an output that has >> some sort of spacial effect to it. The best example I can provide is >> superscripts. type >> >> factor(4); >> >> The output is something like a 2, with another 2 above it. > > That's a good start. Try setting > display2d:false; > > This will cause maxima to output everything line by line. The > output format is pretty similiar to the input syntax. > > There is also the function tex() which takes an expression as > argument and returns what could be its TeX representation. Perhaps > this is useful too? > > If you have any feedback on how to make maxima (or some resources > like the wiki or the this mailing list - quoting style comes to > mind) more accessible, I would be interested to know. > > Harald > From A.G.Grozin at inp.nsk.su Mon Jan 14 01:33:15 2008 From: A.G.Grozin at inp.nsk.su (Andrey G. Grozin) Date: Mon, 14 Jan 2008 13:33:15 +0600 (NOVT) Subject: [Maxima] Gentoo gcl broken (was Re: [Gcl-devel] building maxima with gcl) In-Reply-To: References: <54bq7wixrr.fsf@intech19.enhanced.com> Message-ID: OK, I've upgraded to the Debian patch 36. No improvement: grozin at gandalf ~ $ gcl GCL (GNU Common Lisp) 2.6.8 ANSI Jan 14 2008 20:10:42 Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl) Binary License: GPL due to GPL'ed components: (XGCL READLINE BFD UNEXEC) Modifications of this banner must retain notice of a compatible license Dedicated to the memory of W. Schelter Use (help) to get some basic information on how to use GCL. Temporary directory for compiler files set to /tmp/ >(SI:use-fast-links nil) NIL >(compiler::emit-fn t) Loading /usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.o Error in SYSTEM::ALOAD [or a callee]: Can't open file "/usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.data" Broken at INVOKE-DEBUGGER. Type :H for Help. 1 (Continue) Retry loading file "/usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.o". 2 (Abort) Return to top level. dbl:>>:b Backtrace: funcall > system:top-level > eval > system::aload > conditions::clcs-load > conditions::clcs-universal-error-handler > error > INVOKE-DEBUGGER NIL Can anybody help? What should be in /usr/lib/gcl-2.6.8/cmpnew/gcl_collectfn.data ? (and, by the way, why such a strange path: ..../xgcl-2/../.... ?) Andrey From vdhoeven at texmacs.org Mon Jan 14 04:03:42 2008 From: vdhoeven at texmacs.org (Joris van der Hoeven) Date: Mon, 14 Jan 2008 11:03:42 +0100 Subject: [Maxima] [TeXmacs] Re: TeXmacs and maxima-5.14.0 In-Reply-To: References: <20080110221223.GL15515@barah.math.u-psud.fr> <20080112131056.GD4698@barah.math.u-psud.fr> <4788E73B.6090001@netorn.ru> Message-ID: <20080114100342.GC2832@barah.math.u-psud.fr> On Sun, Jan 13, 2008 at 11:39:36AM +0600, Andrey G. Grozin wrote: > On Sat, 12 Jan 2008, Vadim V. Zhytnikov wrote: > >> Another solution might be to simply anticipate some of > >> the upcoming version numbers ;^) > >Jokes aside. IMHO this is really the best approach. > >I maintain Maxima nad TeXmacs for ALT Linux distro for > >several years. And I always build TeXmacs with tiny patch > >which modifies behaviour of tm_maxima in simple way. > >If Maxima version doesn't match known version tm_maxima > >doesn't barf "Unknown Maxima version" but tries to start > >Maxima with the latest version of interface package - > >texmacs-maxima-5.11.0.lisp at present. > It is easy to do this in tm_maxima (and I think I'll do this change). > However, the logic of > maxima_detect help > will be broken. Currently, if a maxima which understands --list-avail is > detected (this means 5.9.0 or later), > maxima --list-avail > is called, and the result is grepped for good versions (meaning 5.9.3 or > later) which understand -d. The list of good versions should be known at > this point, and should be updated when a new version appears. It would be > a mistake to grep for bad versions (5.9.0, 5.9.1, 5.9.2 - their list is > finite and never changes). Suppose a user has 5.9.0 and 5.14.0 installed. > Then > maxima -d > will work, because the default is the latest version. But grepping for > 5.9.0 will give a false positive. > > Perhaps, I'll have to parse the output of > maxima --list-avail > separate individual components of versions, and compare them as numbers - > if a version >= 5.9.3 is found, everything's OK (with a natural numerical > interpretation of >=, which can be implemented in sh, with some effort. > And don't forget rc1, cvs and other suffixes.) My idea was rather to simply add versions 5.14, 5.15, 5.16, ..., 6.0, 6.1, ... even though they are not yet there. Only when we a new version comes up with something uncompatible, it will be necessary to change something. Best wishes, Joris From jcano at agt.uva.es Mon Jan 14 04:05:03 2008 From: jcano at agt.uva.es (jcano) Date: Mon, 14 Jan 2008 11:05:03 +0100 Subject: [Maxima] file #P"/usr/local/info/maxima.info-5" does not exist In-Reply-To: References: <47876EE0.70909@agt.uva.es> Message-ID: <478B33CF.8040008@agt.uva.es> > On 1/11/08, jcano wrote: > > >> OPEN: file #P"/usr/local/info/maxima.info-5" does not exist >> I do not know what has been actually happen. The maxima.info-* files were not installed, but after redoing a LANG=C make install these files has been successufully installed and now my problem is solved. Thanks for your help, j. cano From Bart.Vandewoestyne at telenet.be Mon Jan 14 04:34:37 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Mon, 14 Jan 2008 11:34:37 +0100 Subject: [Maxima] question In-Reply-To: References: Message-ID: <20080114103437.GB409@simba> On Mon, Jan 14, 2008 at 04:05:09AM -0600, maxima-request at math.utexas.edu wrote: > > When I try to integrate som functions (part of a double integral) and I > fill in some bounds, maxima always keeps asking: is ...... positive, > negative or zero. > > Can this question turned off? > > Johan Johan, Are you using `integrate' or `dblint' to calculate the double integral? Can you be more specific and maybe show us the exact command you are using? I'm also wondering if it makes sense to ignore the question. If you are able to give Maxima hints about the sign of some parameters, then my guess is that it will be able to give you a cleaner expression for the answer... Best wishes, Bart Vandewoestyne PS: if you are the `Johan Beke' working at the PIH in Belgium, then i am a former student of yours ;-) -- "Share what you know. Learn what you don't." From pxrist at gmail.com Mon Jan 14 03:43:21 2008 From: pxrist at gmail.com (Panagiotis Christopoulos) Date: Mon, 14 Jan 2008 11:43:21 +0200 Subject: [Maxima] Gentoo gcl broken (was Re: [Gcl-devel] building maxima with gcl) In-Reply-To: References: <54bq7wixrr.fsf@intech19.enhanced.com> Message-ID: <20080114094321.GA20644@Vereniki.lan> On 13:33 Mon 14 Jan , Andrey G. Grozin wrote: > Can anybody help? What should be in > /usr/lib/gcl-2.6.8/cmpnew/gcl_collectfn.data ? > (and, by the way, why such a strange path: ..../xgcl-2/../.... ?) There is a new version of gcl in gentoo lisp's overlay. Plz, stop doing this, and go through the right way, which is gentoo's bugzilla. Soon the situation you describe will be fixed in gentoo. Panagiotis Christopoulos Gentoo contributor. From harald at lefant.net Mon Jan 14 08:18:48 2008 From: harald at lefant.net (Harald Geyer) Date: Mon, 14 Jan 2008 15:18:48 +0100 Subject: [Maxima] changing maxima display to plaintext notation In-Reply-To: <5BF3DE7B-73B6-4CCC-B16F-312622853F17@gmail.com> References: <5BF3DE7B-73B6-4CCC-B16F-312622853F17@gmail.com> Message-ID: Hi Justin, > I have tried the tex function and wonder if there isn't something to > show it in latex 2.09 format. I'm experiencing a strange dialectic > shock here reading tex. For example, this comes up quite often on this mailing list. Various people have already tried to improve tex(). Perhaps one of them can comment on this. Ideally we would have a general tex() function that can output various formats. Right now we have to fork tex() every time somebody with special needs shows up. > , instead of \times or \cdot to show multiplication > > \over instead of \frac{numerator}{denominator} to show fractions. > > 3*y instead of 3y > > I I am reading the quickstart manual pdf file to learn more about > this. It looks like it is showing it in that cute spacial style. It > also looks like it was done in LaTeX. Would someone happen to have a > code file I could look at? I'm not sure which file you mean. Perhaps intromax.pdf by Rand? If it is being distributed with Maxima, then all the sources need to be publicly available. If you are only interested in individual files then perhaps the best way is to download it from the cvs webinterface at sourceforge. The link is: http://maxima.cvs.sourceforge.net/maxima/maxima/ The link for intromax.ltx is: http://maxima.cvs.sourceforge.net/maxima/maxima/doc/intromax/intromax.ltx?revision=1.5 Harald From harald at lefant.net Mon Jan 14 08:25:49 2008 From: harald at lefant.net (Harald Geyer) Date: Mon, 14 Jan 2008 15:25:49 +0100 Subject: [Maxima] question In-Reply-To: References: Message-ID: Hi Johan, > When I try to integrate som functions (part of a double integral) > and I fill in some bounds, maxima always keeps asking: > is ...... positive, negative or zero. > > Can this question turned off? In general it can't be turned off. AFAIK there is some work in progress to return conditional expressions in such cases, but I don't think it is mature yet. OTOH you can avoid specific questions by telling maxima the answer beforehand: Use assume(a>0) to tell maxima that a is positive. There are more examples how to use assume() in the manual. HTH, Harald From raymond.toy at ericsson.com Mon Jan 14 08:36:38 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Mon, 14 Jan 2008 09:36:38 -0500 Subject: [Maxima] Keyword arguments? In-Reply-To: References: Message-ID: <478B7376.7090604@ericsson.com> Robert Dodier wrote: > On Jan 8, 2008 10:22 AM, Raymond Toy (RT/EUS) wrote: > >> Something like >> >> quad_qags(f,x,a,b, epsrel=1d-8, epsabs=1d-8, limit=500) > > Looks good to me. > >> I know this would be different from what plot2d does, which basically >> uses the syntax [a,b] instead of a = b. > > I've never liked the [a, b] notation. > I've checked in these changes to quadpack with corresponding changes for the documentation and tests. I wasn't exactly sure how to handle unknown keywords, so unknown keywords or badly formed keyword args cause a maxima error. This is an incompatible change for quadpack. I hope this doesn't cause problems for people. If it does please let us know and we'll see what we can do about it. (Revert change, new names for the new interface, etc.) Ray From camm at enhanced.com Mon Jan 14 08:49:02 2008 From: camm at enhanced.com (Camm Maguire) Date: 14 Jan 2008 09:49:02 -0500 Subject: [Maxima] Gentoo gcl broken (was Re: [Gcl-devel] building maxima with gcl) In-Reply-To: References: <54bq7wixrr.fsf@intech19.enhanced.com> Message-ID: <543at031k1.fsf@intech19.enhanced.com> Greetings! I believe the issue here is that the collectfn.o module has been stripped. GCL appends initialization data to its compiled object modules by default -- if missing, then .data files are sought. GCL itself installs the .o file alone, and typically package installers run strip on such objects unless instructed to do otherwise. The weird path results from the si::*load-path* order: >si::*load-path* ("/usr/lib/gcl-2.6.8/xgcl-2/" "/usr/lib/gcl-2.6.8/lsp/" "/usr/lib/gcl-2.6.8/gcl-tk/" "/usr/lib/gcl-2.6.8/cmpnew/") This is harmless, AFAICT. Take care, "Andrey G. Grozin" writes: > OK, I've upgraded to the Debian patch 36. No improvement: > > grozin at gandalf ~ $ gcl > GCL (GNU Common Lisp) 2.6.8 ANSI Jan 14 2008 20:10:42 > Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl) > Binary License: GPL due to GPL'ed components: (XGCL READLINE BFD UNEXEC) > Modifications of this banner must retain notice of a compatible license > Dedicated to the memory of W. Schelter > > Use (help) to get some basic information on how to use GCL. > Temporary directory for compiler files set to /tmp/ > > >(SI:use-fast-links nil) > > NIL > > >(compiler::emit-fn t) > > Loading /usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.o > Error in SYSTEM::ALOAD [or a callee]: Can't open file > "/usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.data" > > Broken at INVOKE-DEBUGGER. Type :H for Help. > 1 (Continue) Retry loading file > "/usr/lib/gcl-2.6.8/xgcl-2/../cmpnew/gcl_collectfn.o". > 2 (Abort) Return to top level. > dbl:>>:b > Backtrace: funcall > system:top-level > eval > system::aload > > conditions::clcs-load > conditions::clcs-universal-error-handler > > error > INVOKE-DEBUGGER > NIL > > Can anybody help? What should be in > /usr/lib/gcl-2.6.8/cmpnew/gcl_collectfn.data ? > (and, by the way, why such a strange path: ..../xgcl-2/../.... ?) > > Andrey > > > > > -- Camm Maguire camm at enhanced.com ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah From O.Kullmann at swansea.ac.uk Mon Jan 14 09:34:15 2008 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Mon, 14 Jan 2008 15:34:15 +0000 Subject: [Maxima] basic Maxima/Lisp bug Message-ID: <20080114153415.GD9710@cs-wsok.swansea.ac.uk> Hello, I've extracted the following nasty bug: _____________________________ Maxima/5.14.0/bin> ./maxima Maxima 5.14.0 http://maxima.sourceforge.net Using Lisp CLISP 2.43 (2007-11-18) 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) not f([1]); Maxima encountered a Lisp error: *** - Lisp stack overflow. RESET [1]> ______________________________ The evaluation of the term "not f([1])" (with f undefined) should just be the term itself. I hope something can be done about that. Oliver From fateman at cs.berkeley.edu Mon Jan 14 09:57:25 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Mon, 14 Jan 2008 07:57:25 -0800 Subject: [Maxima] changing maxima display to plaintext notation In-Reply-To: <7F7603C9-5F58-4D04-AD52-C6D63C716605@gmail.com> References: <8b356f880801131511v41c455dak435790019fa5a897@mail.gmail.com> <7F7603C9-5F58-4D04-AD52-C6D63C716605@gmail.com> Message-ID: <00f601c856c6$28a27d30$0300a8c0@RJFE510> depending on what you use for a computer, it may be possible to use a lisp program that speaks math. a program I use happens to use SASDK/SALT from Microsoft Windows, but it is not part of maxima now. http://www.cs.berkeley.edu/~fateman/papers/speakmath.pdf There is also a program called MathSpeak; http://www.mathspeak.org which I have not used, gut I don't know if it work with maxima. From pxrist at gmail.com Mon Jan 14 09:00:59 2008 From: pxrist at gmail.com (Panagiotis Christopoulos) Date: Mon, 14 Jan 2008 17:00:59 +0200 Subject: [Maxima] Gentoo gcl broken (was Re: [Gcl-devel] building maxima with gcl) In-Reply-To: <543at031k1.fsf@intech19.enhanced.com> References: <54bq7wixrr.fsf@intech19.enhanced.com> <543at031k1.fsf@intech19.enhanced.com> Message-ID: <20080114150059.GA22209@Vereniki.lan> Hi Camm, On 09:49 Mon 14 Jan , Camm Maguire wrote: > Greetings! > > I believe the issue here is that the collectfn.o module has been > stripped. GCL appends initialization data to its compiled object > modules by default -- if missing, then .data files are sought. GCL > itself installs the .o file alone, and typically package installers > run strip on such objects unless instructed to do otherwise. > Yeap, that was the problem. Panagiotis From villate at fe.up.pt Mon Jan 14 11:11:04 2008 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 14 Jan 2008 17:11:04 +0000 Subject: [Maxima] plot2d options In-Reply-To: References: <20080112011113.2nt4au3v5es0sckg@www.mat.uni.torun.pl> Message-ID: <1200330664.6219.24.camel@bethe> On Fri, 2008-01-11 at 21:12 -0700, Robert Dodier wrote: > On 1/11/08, much at mat.uni.torun.pl wrote: > > > I try to force maxima to plot graphs of many constant functions > > without the description which line represents which function. > > Well, you can try plot2d(..., [gnuplot_preamble, "set nokey"]) to > tell Gnuplot to omit the list of lines and their associated expressions. Even better, use: plot2d(...,[legend,false]) it works both in gnuplot and openmath (it is documented in the manual). > Of course two alternative ways to illustrate the chaos might look as follows... Take a look at these two graphs: (%i1) f(x):=4*x*(1-x)$ (%i2) x:0.745$ (%i3) for i thru 400 do x:f(x)$ (%i4) x; (%o4) 0.99522128492706 (%i5) load(dynamics)$ (%i6) staircase(f('x),x,80)$ (%i7) x; (%o7) 0.99522128492706 (%i8) evolution(f('x),x,80)$ You don't need Xmaxima. Either gnuplot or openmath will work. Regards, Jaime Villate From mikolg at sibmail.com Mon Jan 14 11:28:02 2008 From: mikolg at sibmail.com (Mikhail Maroukhine) Date: Mon, 14 Jan 2008 23:28:02 +0600 Subject: [Maxima] question In-Reply-To: References: Message-ID: <478B9BA2.9020202@sibmail.com> Hello, Harald Geyer wrote: > Hi Johan, >> When I try to integrate som functions (part of a double integral) >> and I fill in some bounds, maxima always keeps asking: >> is ...... positive, negative or zero. >> >> Can this question turned off? >> > > In general it can't be turned off. AFAIK there is some work in progress > to return conditional expressions in such cases, but I don't think it > is mature yet. > > OTOH you can avoid specific questions by telling maxima the answer > beforehand: Use assume(a>0) to tell maxima that a is positive. There > are more examples how to use assume() in the manual May we say maxima to check all possible variants (positive, negative and zero)? Mikhail From robert.dodier at gmail.com Mon Jan 14 11:50:33 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 14 Jan 2008 10:50:33 -0700 Subject: [Maxima] question In-Reply-To: References: Message-ID: On Jan 13, 2008 7:20 AM, Johan Beke wrote: > When I try to integrate som functions (part of a double integral) and I > fill in some bounds, maxima always keeps asking: is ...... positive, > negative or zero. > > Can this question turned off? In general, no. However if Maxima is asking about the sign of a symbol (as opposed to a more general expression) then you can set a default response via assume_pos and assume_pos_pred. After asking a question, Maxima returns just one result. I think it would be more useful to compute a result for each alternative and return something like: if a > 0 then result1 elseif a < 0 then result2 ... I have made an attempt to implement such a scheme -- I'll post more about that later. By the way, what is the integral in question? best, Robert Dodier From robert.dodier at gmail.com Mon Jan 14 20:48:57 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 14 Jan 2008 19:48:57 -0700 Subject: [Maxima] [Maxima-users] Statistical Analysis. In-Reply-To: <1200328702.14556.5.camel@P5K> References: <1200328702.14556.5.camel@P5K> Message-ID: On Jan 14, 2008 9:38 AM, Leroy Wolins wrote: > It seems that MAXIMA is well suited for doing many common types of least > squares analysis (e.g., regression, analysis of variance). Much of the > necessary code could be adapted from IML, SAS, etc. Is anyone working on > this? Hi Leroy, thanks for your interest in Maxima. There are some add-on packages for statistics, namely, stats (statistical tests), descriptive (descriptive statistics), and lsquares (least squares problems). The reference manual (http://maxima.sourceforge.net/docs.shtml) has some info about those packages. We are still developing statistical functions for Maxima so if you have any ideas or comments we would be interested to hear about it. By the way, most discussion about Maxima takes place on the maxima at math.utexas.edu mailing list. Sign up page: http://maxima.sourceforge.net/maximalist.html Hope this helps, Robert Dodier From robert.dodier at gmail.com Mon Jan 14 20:50:00 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 14 Jan 2008 19:50:00 -0700 Subject: [Maxima] basic Maxima/Lisp bug In-Reply-To: <20080114153415.GD9710@cs-wsok.swansea.ac.uk> References: <20080114153415.GD9710@cs-wsok.swansea.ac.uk> Message-ID: On Jan 14, 2008 8:34 AM, Oliver Kullmann wrote: > (%i1) not f([1]); > Maxima encountered a Lisp error: > *** - Lisp stack overflow. RESET Hi Oliver, thanks for pointing out this error. I will take a look at it. Robert Dodier From willisb at unk.edu Mon Jan 14 21:06:14 2008 From: willisb at unk.edu (Barton Willis) Date: Mon, 14 Jan 2008 21:06:14 -0600 Subject: [Maxima] basic Maxima/Lisp bug In-Reply-To: References: <20080114153415.GD9710@cs-wsok.swansea.ac.uk>, Message-ID: See also SF bug 1726550. Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: "Oliver Kullmann" >From: "Robert Dodier" >Sent by: maxima-bounces at math.utexas.edu >Date: 01/14/2008 08:50PM >cc: maxima at math.utexas.edu >Subject: Re: [Maxima] basic Maxima/Lisp bug > >On Jan 14, 2008 8:34 AM, Oliver Kullmann wrote: > >> (%i1) not f([1]); >> Maxima encountered a Lisp error: >> *** - Lisp stack overflow. RESET > >Hi Oliver, thanks for pointing out this error. I will take a look at it. > >Robert Dodier >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Mon Jan 14 22:09:45 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 14 Jan 2008 21:09:45 -0700 Subject: [Maxima] question In-Reply-To: References: Message-ID: On 1/13/08, Johan Beke wrote: > When I try to integrate som functions (part of a double integral) and I > fill in some bounds, maxima always keeps asking: is ...... positive, > negative or zero. > > Can this question turned off? Here are some results after loading a package I wrote which captures most queries from Maxima and turns them into conditional expressions. asksign (x); => if x < 0 then neg elseif equal(x,0) then zero else pos asksign (abs (x)); => if equal(x,0) then zero else pos realpart (sqrt (25 - x^2 - y^2)); => if y^2+x^2-25 < 0 then sqrt(-y^2-x^2+25) elseif equal(y^2+x^2-25,0) then 0 else 0 integrate (exp(a*x), x, 0, inf); => if a < 0 then -1/a elseif equal(a,0) then 0 else ?merror("Integral is divergent") integrate (x^k, x); => if equal(k+1,0) then log(x) else x^(k+1)/(k+1) integrate (x^k, x, 1, b); => if k < 0 then integrate(x^k,x,1,b) elseif equal(k,0) then b^(k+1)/(k+1)-1/(k+1) else b^(k+1)/(k+1)-1/(k+1) limit (a * x, x, inf); => if a < 0 then minf elseif equal(a,0) then 0 else inf limit (x^a, x, inf); => if a < 0 then 0 elseif equal(a,0) then 1 else inf tlimit (s/(1 + s^2) / sinh (s*T), s, inf); => if T < 0 then tlimit(s/((s^2+1)*sinh(s*T)),s,inf) elseif equal(T,0) then 0 else 0 ode2 ('diff(y, x, 2) + a*y = c* x, y, x); => if a < 0 then y = %k1*%e^(%i*sqrt(a)*x) +%k2*%e^-(%i*sqrt(a)*x)+c*x/a elseif equal(a,0) then y = c*x^3/6+%k2*x+%k1 else y = %k1*sin(sqrt(a)*x)+%k2*cos(sqrt(a)*x)+c*x/a As it stands the code more or less works from the user's point of view although it could be slicker (e.g. merging equivalent branches, expansion of branches into sub-branches). The major drawback is that the code works by throwing the asked-about expression (instead of waiting for user input). Throwing something can mess up the state of Maxima -- e.g. assumptions made via assume(...) are not cleaned up. I don't know for sure what to do; one way to finesse the problem is to introduce constructs such as (limit (...), integrate (....), solve (...)) assuming (a > 0, b < 0); which would put assume(...) and the beginning and forget(...) at the end, and ensure that forget is always called, even if something is thrown. it has been claimed, on this august mailing list, that ordinary Maxima conditional expressions if ... then ... else are not appropriate for expressing stuff like the result of limit(x^n, x, inf) and that instead a different notation, with different evaluation and simplification policies, is needed. Not sure about that. FWIW Robert Dodier From Bart.Vandewoestyne at telenet.be Tue Jan 15 04:23:24 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Tue, 15 Jan 2008 11:23:24 +0100 Subject: [Maxima] seeing simpler expressions for products Message-ID: <20080115102324.GB6456@simba> Dear list, I am using the factor command to get a nice expression for a certain s-dimensional function, for example with s=3 i can have: (%i10) factor(f_periodized(x)) (%o10) 4 2 4 2 4 2 (6 x - 12 x + 6 x + 1) (6 x - 12 x + 6 x + 1) (6 x - 12 x + 6 x + 1) 1 1 1 2 2 2 3 3 3 ----------------------------------------------------------------------------- 8 This output is already very nice, but it would even be nicer if Maxima could 'discover' that the polynomials in x[1], x[2] and x[3] are in fact all three the same, and write the output as 3 4 2 /===\ 6 x - 12 x + 6 x + 1 ! ! i i i (%o1) ! ! ----------------------- ! ! 2 i = 1 Is this possible with Maxima and if 'yes', how do i do it? Thanks, Bart -- "Share what you know. Learn what you don't." From willisb at unk.edu Tue Jan 15 05:10:48 2008 From: willisb at unk.edu (Barton Willis) Date: Tue, 15 Jan 2008 05:10:48 -0600 Subject: [Maxima] seeing simpler expressions for products In-Reply-To: <20080115102324.GB6456@simba> References: <20080115102324.GB6456@simba> Message-ID: I don't know of an easy way to do this. Actually, I can't think of any simplifications that convert a non-product into a product (by product, I mean an expression e such that op(e) = product). Can it be done? Oh sure. It's just a small matter of programming. If you try, let us know how it turns out. Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: maxima at math.utexas.edu >From: Bart Vandewoestyne >Sent by: maxima-bounces at math.utexas.edu >Date: 01/15/2008 04:23AM >Subject: [Maxima] seeing simpler expressions for products > >Dear list, > >I am using the factor command to get a nice expression for a >certain s-dimensional function, for example with s=3 i can have: > >(%i10) factor(f_periodized(x)) >(%o10) > 4 2 4 2 4 2 > (6 x - 12 x + 6 x + 1) (6 x - 12 x + 6 x + 1) (6 x - 12 x + 6 x >+ 1) > 1 1 1 2 2 2 3 3 3 > >-------------------------------------------------------------------------- >--- > 8 > >This output is already very nice, but it would even be nicer if Maxima >could >'discover' that the polynomials in x[1], x[2] and x[3] are in fact all >three >the same, and write the output as > > 3 4 2 > /===\ 6 x - 12 x + 6 x + 1 > ! ! i i i >(%o1) ! ! ----------------------- > ! ! 2 > i = 1 > > >Is this possible with Maxima and if 'yes', how do i do it? > >Thanks, >Bart > >-- > "Share what you know. Learn what you don't." >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Tue Jan 15 09:55:34 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 15 Jan 2008 10:55:34 -0500 Subject: [Maxima] request for comments/improvements/style of first Maxima script In-Reply-To: <20080115101022.GA6456@simba> References: <20080109163404.GA6094@forsythe> <8b356f880801091154s3e0fddafy7d56d675d2ed256c@mail.gmail.com> <20080110143946.GA12780@forsythe> <8b356f880801100933n2a0b106coc2d677dce1f7e9e5@mail.gmail.com> <20080111101229.GB18331@forsythe> <8b356f880801111108m6a6985c3t743b9497ce070d57@mail.gmail.com> <20080115101022.GA6456@simba> Message-ID: <8b356f880801150755p7a6a7b45kd08974efbfb72ee6@mail.gmail.com> On Jan 15, 2008 5:10 AM, Bart Vandewoestyne wrote: > On Fri, Jan 11, 2008 at 02:08:12PM -0500, Stavros Macrakis wrote: > > ...you might want to look at factor(phi[...]). It factors very nicely. > > Thanks for pointing me to the factor() command! ... > My goal is to find functions f(x) that lead to 'simple or > manageable' expressions for phi(x) so that I can easily implement > them in for example Fortran and perform numerical experiments > with them. If you can define a metric for 'simple' and some sort of procedure for generating candidate functions, you can certainly search through the space of possible functions. You may also want to search (combinatorially) through the space of possible simplifications. I wrote some simple examples of this some time ago on the list and will try to find them. I think Costas Frangos and Barton Willis have also worked on things like this. Be careful, though, sometimes symbolically 'simple or manageable' expressions are not numerically well-behaved. -s From van.nek at arcor.de Tue Jan 15 11:58:46 2008 From: van.nek at arcor.de (van Nek) Date: Tue, 15 Jan 2008 18:58:46 +0100 Subject: [Maxima] Maxima parser and global parameters In-Reply-To: <006701c8554a$03fdba80$0300a8c0@RJFE510> References: <47890585.16576.1B2D65C@van.nek.arcor.de> Message-ID: <478D0266.13081.1FB3F29@van.nek.arcor.de> Richard, thank you for your answer. I played around with it and tried to find a way to change the precision just locally in a block and to preserve the original fpprec in top level. The workaround I found for defining a function with different local fpprec was a three step definition: (%i1) save_global: fpprec$ (%i2) foo():= block( [fpprec:20], ''(fpprec:20), print(1.12345678901234567890b0, bfloat(%pi)) )$ (%i3) fpprec: save_global$ Now foo works as intended. (%i4) foo()$ 1.1234567890123456789b0 3.1415926535897932385b0 Is there a more elegant way? Volker van Nek Am 12 Jan 2008 um 10:36 hat Richard Fateman geschrieben: > > try > ( ''(fpprec:100), [fpprec, 1.123456890123456890123456890b0] ); > That is two ' [apostrophe or single-quote). > > > > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] > On Behalf Of van Nek > Sent: Saturday, January 12, 2008 9:23 AM > To: Maxima at math.utexas.edu > Subject: [Maxima] Maxima parser and global parameters > > > > (%i1) ( fpprec:100, [fpprec, 1.123456890123456890123456890b0] > ); > (%o1) [100, 1.123456890123457b0] > (%i2) ( ibase:2, [ibase, 11111111] ); > (%o2) [2, 11111111] > > > This shows me that in a first step the complete expression is > read and parsed and in a > second step the expressions are evaluated from left to right. > > Is it generally possible, that expressions like fpprec:100 can > have an influence on the > parser inside of the same expression, or can it only have effect > on the next read in > expression? > > Volker van Nek From biomates at telefonica.net Tue Jan 15 12:17:56 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Tue, 15 Jan 2008 19:17:56 +0100 Subject: [Maxima] [Maxima-users] Statistical Analysis. In-Reply-To: References: <1200328702.14556.5.camel@P5K> Message-ID: <478CF8D4.5070404@telefonica.net> >> It seems that MAXIMA is well suited for doing many common types of least >> squares analysis (e.g., regression, analysis of variance). Much of the >> necessary code could be adapted from IML, SAS, etc. Is anyone working on >> this? >> > > Hi Leroy, thanks for your interest in Maxima. There are some add-on > packages for statistics, namely, stats (statistical tests), descriptive > (descriptive statistics), and lsquares (least squares problems). > The reference manual (http://maxima.sourceforge.net/docs.shtml) > has some info about those packages. We are still developing > statistical functions for Maxima so if you have any ideas or comments > we would be interested to hear about it. > The stats package contains only a few inferential procedures. I have not worked on it last year for two main reasons: a) I needed a flexible drawing tool for plotting statistical graphics; so I began writing the draw package (now that nobody is hearing me, I can confess!). But this package is taken me more time than expected. b) Some users asked me why should I write new procedures in Maxima/Lisp, when there are so good and tested programs such as R (written in C). At this point I am not sure what to do with stats. Should we continue with the development of stats? or should we wait for a foreign functions call system in Maxima to call R routines? (I have no idea how hard will it be to implement this second alternative.) Mario From dlakelan at street-artists.org Tue Jan 15 13:29:18 2008 From: dlakelan at street-artists.org (dlakelan) Date: Tue, 15 Jan 2008 11:29:18 -0800 Subject: [Maxima] [Maxima-users] Statistical Analysis. In-Reply-To: <478CF8D4.5070404@telefonica.net> References: <1200328702.14556.5.camel@P5K> <478CF8D4.5070404@telefonica.net> Message-ID: <478D098E.5020900@street-artists.org> Mario Rodriguez wrote: > >>> It seems that MAXIMA is well suited for doing many common types of least >>> squares analysis (e.g., regression, analysis of variance). Much of the >>> necessary code could be adapted from IML, SAS, etc. Is anyone working on >>> this?... > > The stats package contains only a few inferential procedures. I have not > worked on it last year for two main reasons: > > a) I needed a flexible drawing tool for plotting statistical graphics; > so I began writing the draw package (now that nobody is hearing me, I > can confess!). But this package is taken me more time than expected. > > b) Some users asked me why should I write new procedures in Maxima/Lisp, > when there are so good and tested programs such as R (written in C). > > At this point I am not sure what to do with stats. Should we continue > with the development of stats? or should we wait for a foreign functions > call system in Maxima to call R routines? (I have no idea how hard will > it be to implement this second alternative.) Calling the R routines would be great, especially because statisticians are constantly working on R's code. It's where the action is in statistical computing. On the other hand, I've found some useful things that maxima can do with respect to bayesian methods that can be easier than in R. For example, I was doing some bayesian inference by numerical normalization of the posterior distribution, and using quadpack, rationals, and bigfloats can be extremely helpful. Naive integration of likelihood functions is prone to underflow (since they're the product of a lot of probabilities which are often very small) and having maxima's numerical types allows for a relatively simple and therefore understandable implementation of posterior inference. I'd like to work some more on this type of thing over the next few months. As far as I can see, Bayesian methods are the future of statistics. if maxima can become strong in this one area due to its useful symbolic, and numerical combination, that would be great. From macrakis at alum.mit.edu Tue Jan 15 13:40:52 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 15 Jan 2008 14:40:52 -0500 Subject: [Maxima] [Maxima-users] Statistical Analysis. In-Reply-To: <478CF8D4.5070404@telefonica.net> References: <1200328702.14556.5.camel@P5K> <478CF8D4.5070404@telefonica.net> Message-ID: <8b356f880801151140r7538b287k45dc639376211d8c@mail.gmail.com> There is one excellent reason to write code within Maxima (either in the Maxima language or in Lisp): to take advantage of Maxima's unique core functionality, namely symbolic mathematics. Then there are some less good reasons. There is the convenience of coding arbitrary-precision (bigfloat) and rational arithmetic in Maxima, where the syntax is identical to that of integers/floats. (Though some other languages support operator overloading, e.g. C++.) There is the ease of interfacing to other Maxima and Lisp code. But it is a great pity that it is not easier to interface to outside packages in all our underlying Lisps (though I understand there has been progress). Recoding things in Maxima/Lisp is a waste of time and effort. That said, even when the foreign function interfaces become available on all platforms, and are reliable and easy to use, there is still the issue of writing clean interfaces to their data types and functions. For instance, R has a sophisticated system of data frames which it would be nice to expose to the Maxima user but which corresponds to nothing standard in Maxima. Even if R did the heavy lifting, we'd still need Maxima-side routines for manipulating data frames in a natural way. -s From fateman at cs.berkeley.edu Tue Jan 15 15:05:37 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 15 Jan 2008 13:05:37 -0800 Subject: [Maxima] Maxima parser and global parameters In-Reply-To: <478D0266.13081.1FB3F29@van.nek.arcor.de> References: <47890585.16576.1B2D65C@van.nek.arcor.de> <478D0266.13081.1FB3F29@van.nek.arcor.de> Message-ID: <013f01c857ba$61427ce0$0300a8c0@RJFE510> If all you want to do is compute an ANSWER to some precision, you do not need such an elaborate construction. piprec(fpprec) /* compute pi to given precision by binding fpprec*/ := bfloat(%pi); piprec(100); The convoluted stuff has only to do with parsing numbers at the time a function is defined or a line is typed by the user. If you want to define a program foo that has very long bfloat constants in it, you could do this: block([fpprec],(''(fpprec:1000), foo(x):= 1.2345677889089080980980989080b0*x+6564654.3453423252353345343535345); or something like that. then foo will always have those high-precision constants. > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] On Behalf Of van Nek > Sent: Tuesday, January 15, 2008 9:59 AM > To: fateman at EECS.Berkeley.EDU > Cc: Maxima at math.utexas.edu > Subject: Re: [Maxima] Maxima parser and global parameters > > Richard, > > thank you for your answer. I played around with it and tried > to find a way to change the > precision just locally in a block and to preserve the > original fpprec in top level. > > The workaround I found for defining a function with different > local fpprec was a three step > definition: > > (%i1) save_global: fpprec$ > (%i2) foo():= block( [fpprec:20], ''(fpprec:20), > print(1.12345678901234567890b0, bfloat(%pi)) )$ > (%i3) fpprec: save_global$ > > Now foo works as intended. > > (%i4) foo()$ > 1.1234567890123456789b0 3.1415926535897932385b0 > > Is there a more elegant way? > > Volker van Nek > > > Am 12 Jan 2008 um 10:36 hat Richard Fateman geschrieben: > > > > > try > > ( ''(fpprec:100), [fpprec, 1.123456890123456890123456890b0] ); > > That is two ' [apostrophe or single-quote). > > > > > > > > From: maxima-bounces at math.utexas.edu > > [mailto:maxima-bounces at math.utexas.edu] > > On Behalf Of van Nek > > Sent: Saturday, January 12, 2008 9:23 AM > > To: Maxima at math.utexas.edu > > Subject: [Maxima] Maxima parser and global parameters > > > > > > > > (%i1) ( fpprec:100, [fpprec, 1.123456890123456890123456890b0] > > ); > > (%o1) [100, 1.123456890123457b0] > > (%i2) ( ibase:2, [ibase, 11111111] ); > > (%o2) [2, 11111111] > > > > > > This shows me that in a first step the complete expression is > > read and parsed and in a > > second step the expressions are evaluated from left to right. > > > > Is it generally possible, that expressions like fpprec:100 can > > have an influence on the > > parser inside of the same expression, or can it only have effect > > on the next read in > > expression? > > > > Volker van Nek > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From blindglobe at gmail.com Tue Jan 15 15:19:18 2008 From: blindglobe at gmail.com (A.J. Rossini) Date: Tue, 15 Jan 2008 22:19:18 +0100 Subject: [Maxima] [Maxima-users] Statistical Analysis. In-Reply-To: <8b356f880801151140r7538b287k45dc639376211d8c@mail.gmail.com> References: <1200328702.14556.5.camel@P5K> <478CF8D4.5070404@telefonica.net> <8b356f880801151140r7538b287k45dc639376211d8c@mail.gmail.com> Message-ID: <1abe3fa90801151319k51320c7cw7573d0f2736e5c46@mail.gmail.com> On Jan 15, 2008 8:40 PM, Stavros Macrakis wrote: > There is one excellent reason to write code within Maxima (either in > the Maxima language or in Lisp): to take advantage of Maxima's unique > core functionality, namely symbolic mathematics. > > Then there are some less good reasons. > > There is the convenience of coding arbitrary-precision (bigfloat) and > rational arithmetic in Maxima, where the syntax is identical to that > of integers/floats. (Though some other languages support operator > overloading, e.g. C++.) > > There is the ease of interfacing to other Maxima and Lisp code. But it > is a great pity that it is not easier to interface to outside packages > in all our underlying Lisps (though I understand there has been > progress). Recoding things in Maxima/Lisp is a waste of time and > effort. > > That said, even when the foreign function interfaces become available > on all platforms, and are reliable and easy to use, there is still the > issue of writing clean interfaces to their data types and functions. > For instance, R has a sophisticated system of data frames which it > would be nice to expose to the Maxima user but which corresponds to > nothing standard in Maxima. Even if R did the heavy lifting, we'd > still need Maxima-side routines for manipulating data frames in a > natural way. Which reminds me to ask -- where do I look to see how to integrate Common Lisp packages with Maxima? Is there any docs on it? The first page of google hits were not relevant... (3 reasons -- I've been working with a Common Lisp <-> R gateway, mostly R called from Common Lisp; I'm slowly working on a port/update of LispStat from XLisp to Common Lisp, and I've got a strong interest in leveraging Maxima from the CommonLispStat code base at some point, probably next year given my other commitments). At some point I'll have an alpha version of a similar tool to R, but completely CL based, mostly for my amusement. And I can cheat if I can leverage both R and Maxima. best, -tony blindglobe at gmail.com Muttenz, Switzerland. "Commit early,commit often, and commit in a repository from which we can easily roll-back your mistakes" (AJR, 4Jan05). Drink Coffee: Do stupid things faster with more energy! From macrakis at alum.mit.edu Tue Jan 15 15:24:55 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 15 Jan 2008 16:24:55 -0500 Subject: [Maxima] Maxima parser and global parameters In-Reply-To: <478D0266.13081.1FB3F29@van.nek.arcor.de> References: <47890585.16576.1B2D65C@van.nek.arcor.de> <006701c8554a$03fdba80$0300a8c0@RJFE510> <478D0266.13081.1FB3F29@van.nek.arcor.de> Message-ID: <8b356f880801151324q5528bbd4hbfa21cf7d9c48ca9@mail.gmail.com> On Jan 15, 2008 12:58 PM, van Nek wrote: > The workaround I found for defining a function with different local > fpprec was a three step definition:... > Is there a more elegant way? Changing the calculational precision locally is very straightforward: block([fpprec:100], bfloat(%pi) ) Changing the precision of *reading literal constants* is a little harder. There are three approaches: 1) use ''(fpprec:...) to change the precision before parsing the rest of the expression. I find this very ugly and dangerous (like many uses of ''). And though you can do this "locally" in the sense of limiting it to one high-level input, you have no more control than that. 2) use exact notation instead of floating notation for your numbers, e.g. block([fpprec:100], bfloat( sqrt(1000000000000000000001*10^-21) ) ); 3) use eval_string or parse_string: I find (2) the most elegant, but perhaps a little clumsy notationally. I wonder if it might be useful to define (e.g.) 1.234x23 ('x' for exact) to mean precisely the rational number 1234*10^(23-3). -s From toy.raymond at gmail.com Tue Jan 15 15:37:07 2008 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 15 Jan 2008 16:37:07 -0500 Subject: [Maxima] [Maxima-users] Statistical Analysis. In-Reply-To: <1abe3fa90801151319k51320c7cw7573d0f2736e5c46@mail.gmail.com> References: <1200328702.14556.5.camel@P5K> <478CF8D4.5070404@telefonica.net> <8b356f880801151140r7538b287k45dc639376211d8c@mail.gmail.com> <1abe3fa90801151319k51320c7cw7573d0f2736e5c46@mail.gmail.com> Message-ID: <478D2783.8030105@gmail.com> A.J. Rossini wrote: > On Jan 15, 2008 8:40 PM, Stavros Macrakis wrote: > >> There is one excellent reason to write code within Maxima (either in >> the Maxima language or in Lisp): to take advantage of Maxima's unique >> core functionality, namely symbolic mathematics. >> >> Then there are some less good reasons. >> >> There is the convenience of coding arbitrary-precision (bigfloat) and >> rational arithmetic in Maxima, where the syntax is identical to that >> of integers/floats. (Though some other languages support operator >> overloading, e.g. C++.) >> >> There is the ease of interfacing to other Maxima and Lisp code. But it >> is a great pity that it is not easier to interface to outside packages >> in all our underlying Lisps (though I understand there has been >> progress). Recoding things in Maxima/Lisp is a waste of time and >> effort. >> >> That said, even when the foreign function interfaces become available >> on all platforms, and are reliable and easy to use, there is still the >> issue of writing clean interfaces to their data types and functions. >> For instance, R has a sophisticated system of data frames which it >> would be nice to expose to the Maxima user but which corresponds to >> nothing standard in Maxima. Even if R did the heavy lifting, we'd >> still need Maxima-side routines for manipulating data frames in a >> natural way. >> > > > Which reminds me to ask -- where do I look to see how to integrate > Common Lisp packages with Maxima? Is there any docs on it? The > first page of google hits were not relevant... > > How do you want to integrate it? You'll probably get better answers if you have a simple concrete example. Ray From toy.raymond at gmail.com Tue Jan 15 17:05:35 2008 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 15 Jan 2008 18:05:35 -0500 Subject: [Maxima] Maxima parser and global parameters In-Reply-To: <8b356f880801151324q5528bbd4hbfa21cf7d9c48ca9@mail.gmail.com> References: <47890585.16576.1B2D65C@van.nek.arcor.de> <006701c8554a$03fdba80$0300a8c0@RJFE510> <478D0266.13081.1FB3F29@van.nek.arcor.de> <8b356f880801151324q5528bbd4hbfa21cf7d9c48ca9@mail.gmail.com> Message-ID: <478D3C3F.2040706@gmail.com> Stavros Macrakis wrote: > 2) use exact notation instead of floating notation for your numbers, e.g. > > block([fpprec:100], > bfloat( sqrt(1000000000000000000001*10^-21) ) ); > > 3) use eval_string or parse_string: > > I find (2) the most elegant, but perhaps a little clumsy notationally. > > I wonder if it might be useful to define (e.g.) 1.234x23 ('x' for > exact) to mean precisely the rational number 1234*10^(23-3). > Some time ago, I suggested (in passing) to use 1.234r23 ("r" for rational). I think this (either r or x) would be quite easy to implement. Of course, printing the numbers wouldn't preserve the "r" notation. Ray From fateman at cs.berkeley.edu Tue Jan 15 18:57:02 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 15 Jan 2008 16:57:02 -0800 Subject: [Maxima] Maxima parser and global parameters In-Reply-To: <478D3C3F.2040706@gmail.com> References: <47890585.16576.1B2D65C@van.nek.arcor.de> <006701c8554a$03fdba80$0300a8c0@RJFE510> <478D0266.13081.1FB3F29@van.nek.arcor.de> <8b356f880801151324q5528bbd4hbfa21cf7d9c48ca9@mail.gmail.com> <478D3C3F.2040706@gmail.com> Message-ID: <015e01c857da$b509e230$0300a8c0@RJFE510> I think there is a kind of problem with Ray's proposal. Namely, if someone writing 0.1r0 (or 1/10) expects that the number would be exactly 1/10. There is no way in binary floats to do that. This is a problem in the perception of the effect, not in implementing something, though. I agree with Ray that parsing would be relatively easy; between the two of us we have written at least 2 such programs recently.:) > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Raymond Toy > Sent: Tuesday, January 15, 2008 3:06 PM > To: Stavros Macrakis > Cc: fateman at EECS.Berkeley.EDU; Maxima at math.utexas.edu; van Nek > Subject: Re: [Maxima] Maxima parser and global parameters > > Stavros Macrakis wrote: > > 2) use exact notation instead of floating notation for your > numbers, e.g. > > > > block([fpprec:100], > > bfloat( sqrt(1000000000000000000001*10^-21) ) ); > > > > 3) use eval_string or parse_string: > > > > I find (2) the most elegant, but perhaps a little clumsy > notationally. > > > > I wonder if it might be useful to define (e.g.) 1.234x23 ('x' for > > exact) to mean precisely the rational number 1234*10^(23-3). > > > Some time ago, I suggested (in passing) to use 1.234r23 ("r" for > rational). I think this (either r or x) would be quite easy to > implement. Of course, printing the numbers wouldn't preserve the "r" > notation. > > > Ray > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From macrakis at alum.mit.edu Tue Jan 15 19:34:45 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 15 Jan 2008 20:34:45 -0500 Subject: [Maxima] Maxima parser and global parameters In-Reply-To: <015e01c857da$b509e230$0300a8c0@RJFE510> References: <47890585.16576.1B2D65C@van.nek.arcor.de> <006701c8554a$03fdba80$0300a8c0@RJFE510> <478D0266.13081.1FB3F29@van.nek.arcor.de> <8b356f880801151324q5528bbd4hbfa21cf7d9c48ca9@mail.gmail.com> <478D3C3F.2040706@gmail.com> <015e01c857da$b509e230$0300a8c0@RJFE510> Message-ID: <8b356f880801151734k1aced6ffncfe1a20afed54daf@mail.gmail.com> I believe both Ray's and my proposal are in fact that it be exactly 1/10, that is that its internal form be ((rat simp) 1 10) and its printed form be 1/10. For that matter, it could be ((rat simp decimal) 1 10) and print as 0.1 -- though users would probably be confused that 1r-1 / 3 printed as 1/30.... -s On 1/15/08, Richard Fateman wrote: > I think there is a kind of problem with Ray's proposal. Namely, if someone > writing 0.1r0 (or 1/10) expects that the number would be exactly 1/10. > There is no way in binary floats to do that. > > This is a problem in the perception of the effect, not in implementing > something, though. > I agree with Ray that parsing would be relatively easy; between the two of > us we have written at least 2 such programs recently.:) > > > > > -----Original Message----- > > From: maxima-bounces at math.utexas.edu > > [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Raymond Toy > > Sent: Tuesday, January 15, 2008 3:06 PM > > To: Stavros Macrakis > > Cc: fateman at EECS.Berkeley.EDU; Maxima at math.utexas.edu; van Nek > > Subject: Re: [Maxima] Maxima parser and global parameters > > > > Stavros Macrakis wrote: > > > 2) use exact notation instead of floating notation for your > > numbers, e.g. > > > > > > block([fpprec:100], > > > bfloat( sqrt(1000000000000000000001*10^-21) ) ); > > > > > > 3) use eval_string or parse_string: > > > > > > I find (2) the most elegant, but perhaps a little clumsy > > notationally. > > > > > > I wonder if it might be useful to define (e.g.) 1.234x23 ('x' for > > > exact) to mean precisely the rational number 1234*10^(23-3). > > > > > Some time ago, I suggested (in passing) to use 1.234r23 ("r" for > > rational). I think this (either r or x) would be quite easy to > > implement. Of course, printing the numbers wouldn't preserve the "r" > > notation. > > > > > > Ray > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > > > -- Sent from Gmail for mobile | mobile.google.com From ko at research.att.com Tue Jan 15 19:52:12 2008 From: ko at research.att.com (Kostas Oikonomou) Date: Tue, 15 Jan 2008 20:52:12 -0500 Subject: [Maxima] strange behavior of tex() Message-ID: <478D634C.6030903@research.att.com> With maxima 5.14, I get the following behavior with tex(): (%i7) tex(expand((a+b+c)^3)); $$c^3+3\,b\,c^2+3\,a\,c^2+3\,b^2\,c+6\,a\,b\,c+3\,a^2\,c+b^3+3\,a\,b^2 +3\,a^2\,b+a^3$$ (%o7) false (%i8) ordergreat(a,b,c); (%o8) done (%i9) tex(expand((a+b+c)^3)); $${\it \_103a}^3+3\,{\it \_102b}\,{\it \_103a}^2+3\,{\it \_101c}\, {\it \_103a}^2+3\,{\it \_102b}^2\,{\it \_103a}+6\,{\it \_101c}\, {\it \_102b}\,{\it \_103a}+3\,{\it \_101c}^2\,{\it \_103a}+ {\it \_102b}^3+3\,{\it \_101c}\,{\it \_102b}^2+3\,{\it \_101c}^2\, {\it \_102b}+{\it \_101c}^3$$ (%o9) false (%i10) The first output is fine, but what are the _101, _102, etc in the second output? Kostas From shaftoe at nurfuerspam.de Wed Jan 16 07:29:03 2008 From: shaftoe at nurfuerspam.de (AmyShaftoe Chevalier) Date: Wed, 16 Jan 2008 14:29:03 +0100 Subject: [Maxima] runtime error on maxima/sbcl Message-ID: <200801161429.04070.shaftoe@nurfuerspam.de> Hi! I have been using maxima before and after some initial problems everything was running fine. Now I got a problem, I am not able to solve. After updating my system, I discovered after a time maxima produces an error on startup, that should be known to those who are using it more often than I do: ---snip--- > maxima fatal error encountered in SBCL pid 4595(tid 3085163232): can't load .core for different runtime, sorry Welcome to LDB, a low-level debugger for the Lisp runtime environment. ldb> --snap--- Using maxima 5.14.0 from gentoo-overlay flags: sbcl tk unicode sbcl 1.0.13 (1.0.9 tested producing the same error) flags: doc ldb source threads unicode I tested to ship around this by for example using gcl, but it does not compile then. Is there anybody who can help me? From rupert.swarbrick at lineone.net Wed Jan 16 07:59:33 2008 From: rupert.swarbrick at lineone.net (Rupert Swarbrick) Date: Wed, 16 Jan 2008 13:59:33 +0000 Subject: [Maxima] runtime error on maxima/sbcl In-Reply-To: <200801161429.04070.shaftoe@nurfuerspam.de> References: <200801161429.04070.shaftoe@nurfuerspam.de> Message-ID: <20080116135933.0eadc75e@herring> On Wed, 16 Jan 2008 14:29:03 +0100 AmyShaftoe Chevalier wrote: > ---snip--- > > maxima > fatal error encountered in SBCL pid 4595(tid 3085163232): > can't load .core for different runtime, sorry > > Welcome to LDB, a low-level debugger for the Lisp runtime environment. > ldb> > --snap--- > Using maxima 5.14.0 from gentoo-overlay > flags: sbcl tk unicode > > sbcl 1.0.13 (1.0.9 tested producing the same error) > flags: doc ldb source threads unicode > > I tested to ship around this by for example using gcl, but it does > not compile then. > > Is there anybody who can help me? I think the problem is that you've upgraded sbcl without recompiling/upgrading maxima. Maxima's "program" that is run is actually a memory dump of a lisp image which has loaded all the relevant libraries. To fix this problem, try recompiling maxima. Incidentally, if you're running debian unstable, there was an sbcl upgrade a couple of days ago which would have done this - I only realised when my precompiled slime stopped working. Rupert From pebbles at schattenlauf.de Wed Jan 16 08:49:46 2008 From: pebbles at schattenlauf.de (Hanno Behrens) Date: Wed, 16 Jan 2008 15:49:46 +0100 Subject: [Maxima] runtime error on maxima/sbcl In-Reply-To: <20080116135933.0eadc75e@herring> References: <200801161429.04070.shaftoe@nurfuerspam.de> <20080116135933.0eadc75e@herring> Message-ID: <200801161549.46412.pebbles@schattenlauf.de> Am Mittwoch, 16. Januar 2008 schrieb Rupert Swarbrick: > > ---snip--- > > fatal error encountered in SBCL pid 4595(tid 3085163232): > > can't load .core for different runtime, sorry > > > > Welcome to LDB, a low-level debugger for the Lisp runtime environment. > > ldb> > > --snap--- > > Using maxima 5.14.0 from gentoo-overlay > > flags: sbcl tk unicode > > > > sbcl 1.0.13 (1.0.9 tested producing the same error) > > flags: doc ldb source threads unicode > > > > I tested to ship around this by for example using gcl, but it does > > not compile then. > > > > Is there anybody who can help me? > > I think the problem is that you've upgraded sbcl without > recompiling/upgrading maxima. Maxima's "program" that is run is > actually a memory dump of a lisp image which has loaded all the > relevant libraries. pretext - due to serverproblems with this mailinglist, I switched my mailaddress, don't get confused by this. :) > To fix this problem, try recompiling maxima. Incidentally, if you're > running debian unstable, there was an sbcl upgrade a couple of days ago > which would have done this - I only realised when my precompiled slime > stopped working. I recompiled maxima and the problem didn't solve. ---snip--- usr # ls -l /usr/lib/maxima/5.14.0/binary-sbcl/ insgesamt 44160 -rw-r--r-- 1 root root 45215756 16. Jan 15:14 maxima.core ---snap--- As you can see I made shure the maxima.core is up to date. I tried the recompile before and it did not change the behaviour, so I was not astonished that this was not helping. But - gee! - I think I just discoverd a trace what might happened by accident: ---snip--- blackhound usr # ls -l lib/maxima/5.14.0/binary-sbcl/ insgesamt 44160 -rw-r--r-- 1 root root 45215756 16. Jan 15:14 maxima.core blackhound usr # sbcl --version SBCL 1.0.13-gentoo blackhound usr # maxima --version fatal error encountered in SBCL pid 16767(tid 3085163232): can't load .core for different runtime, sorry Welcome to LDB, a low-level debugger for the Lisp runtime environment. ldb> quit Really quit? [y] y blackhound usr # maxima -v + '[' sbcl = clisp ']' + '[' sbcl = cmucl ']' + '[' sbcl = scl ']' + '[' sbcl = gcl ']' + '[' sbcl = acl ']' + '[' sbcl = openmcl ']' + '[' sbcl = sbcl ']' + exec sbcl --core /usr/local/lib/maxima/5.13.0cvs/binary-sbcl/maxima.core --noinform --end-runtime-options --eval '(cl-user::run)' --end-toplevel-options -v '' '' '' '' '' '' '' '' fatal error encountered in SBCL pid 16784(tid 3085163232): can't load .core for different runtime, sorry Welcome to LDB, a low-level debugger for the Lisp runtime environment. ldb> quit Really quit? [y] y ---snap--- Look at this: sbcl is called by --core and pointing to the wrong core. This must be the result of the last time I asked for help. HaraldG was telling me to change something on the calling parameter, what I do not remember now (around 2-3 months ago). And this should be the reason for this error. But where? Hanno -- Hanno Behrens - Hamburg http://pebbles.schattenlauf.de/ Ceterum censeo microsoft esse delendam From raymond.toy at ericsson.com Wed Jan 16 08:55:58 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Wed, 16 Jan 2008 09:55:58 -0500 Subject: [Maxima] runtime error on maxima/sbcl In-Reply-To: <200801161549.46412.pebbles@schattenlauf.de> References: <200801161429.04070.shaftoe@nurfuerspam.de> <20080116135933.0eadc75e@herring> <200801161549.46412.pebbles@schattenlauf.de> Message-ID: <478E1AFE.4090000@ericsson.com> Hanno Behrens wrote: >> To fix this problem, try recompiling maxima. Incidentally, if you're >> running debian unstable, there was an sbcl upgrade a couple of days ago >> which would have done this - I only realised when my precompiled slime >> stopped working. > > I recompiled maxima and the problem didn't solve. If you recompiled maxima, try using maxima-local in the maxima directory. This will at least tell you if it's working. Did you run "make install" to install maxima into the usual place? Ray From pebbles at schattenlauf.de Wed Jan 16 09:09:47 2008 From: pebbles at schattenlauf.de (Hanno Behrens) Date: Wed, 16 Jan 2008 16:09:47 +0100 Subject: [Maxima] runtime error on maxima/sbcl In-Reply-To: <478E1AFE.4090000@ericsson.com> References: <200801161429.04070.shaftoe@nurfuerspam.de> <200801161549.46412.pebbles@schattenlauf.de> <478E1AFE.4090000@ericsson.com> Message-ID: <200801161609.47777.pebbles@schattenlauf.de> Am Mittwoch, 16. Januar 2008 schrieb Raymond Toy (RT/EUS): > Hanno Behrens wrote: > >> To fix this problem, try recompiling maxima. Incidentally, if you're > >> running debian unstable, there was an sbcl upgrade a couple of days ago > >> which would have done this - I only realised when my precompiled slime > >> stopped working. > > > > I recompiled maxima and the problem didn't solve. > > If you recompiled maxima, try using maxima-local in the maxima > directory. This will at least tell you if it's working. > > Did you run "make install" to install maxima into the usual place? I did not run any make by hand, I let it do gentoo/portage/layman with the installed scientific overlay, in which maxima 5.14.0 is part of and simply emerged maxima. The last time I did it by checking out the cvs by hand and compiling it by hand. But that way brings normally some troubles when the rest of the system is updating (just as it happend this time). I think I solved the problem, which was quite easy after all. Should have seen it earlier. Before using the portage-version I was using the cvs-version of maxima. Those worked in /usr/local/bin, which is earlier in the path. The new versions compiled to /usr/bin and were not called. I removed the old ones and now its working fine: ---snip--- > maxima --version Maxima 5.14.0 ---snap--- After all this I suggest, that "maxima --version" should work even without a working core. That would have made me able to find this error earlier. But anyway - I'm happy now and going to check all my code on the new version. Hopefully I don't have questions of the kind "does not work" again. :D And thanks for the help! Great! Hanno From biomates at telefonica.net Wed Jan 16 09:14:33 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 16 Jan 2008 16:14:33 +0100 Subject: [Maxima] [Maxima-users] Statistical Analysis. In-Reply-To: <8b356f880801151140r7538b287k45dc639376211d8c@mail.gmail.com> References: <1200328702.14556.5.camel@P5K> <478CF8D4.5070404@telefonica.net> <8b356f880801151140r7538b287k45dc639376211d8c@mail.gmail.com> Message-ID: <478E1F59.20309@telefonica.net> Thanks for your opinions, Daniel and Stavros. I see the general feeling is that both approaches are complementary. With respect to the frame object, I remember Robert expressed a similar idea time ago; at that time I didn't implement it, but perhaps it's a good starting point to reinforce all this statistical stuff. Even if we don't have the foreign function interface at this moment, packages stats and descriptive could take advantage of frames. Thanks to both, ... ... and to Aristotle, who taught us that the virtue is in the middle of two extremes. -- Mario Rodriguez Riotorto www.biomates.net From robert.dodier at gmail.com Wed Jan 16 09:45:23 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 16 Jan 2008 08:45:23 -0700 Subject: [Maxima] [Maxima-users] Statistical Analysis. In-Reply-To: <478CF8D4.5070404@telefonica.net> References: <1200328702.14556.5.camel@P5K> <478CF8D4.5070404@telefonica.net> Message-ID: On 1/15/08, Mario Rodriguez wrote: > At this point I am not sure what to do with stats. Should we continue > with the development of stats? or should we wait for a foreign functions > call system in Maxima to call R routines? (I have no idea how hard will > it be to implement this second alternative.) The strength of Maxima compared to R is that Maxima is symbolic throughout and R is not. It seems to me that any statistical function would ideally return either a numerical or a symbolic result depending on the arguments. Maxima can call R to handle the numeric case but we're on our own for the symbolic case. So I think there is a lot of value in statistical functions for Maxima. An external numerical library can help, but it can't displace Maxima entirely. FWIW Robert From robert.dodier at gmail.com Wed Jan 16 09:55:24 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 16 Jan 2008 08:55:24 -0700 Subject: [Maxima] [Maxima-users] Statistical Analysis. In-Reply-To: <478D098E.5020900@street-artists.org> References: <1200328702.14556.5.camel@P5K> <478CF8D4.5070404@telefonica.net> <478D098E.5020900@street-artists.org> Message-ID: On 1/15/08, dlakelan wrote: > As far as I can see, Bayesian methods are the future of statistics. if > maxima can become strong in this one area due to its useful symbolic, > and numerical combination, that would be great. Bayesian inference is an excellent example of a problem domain which can benefit from mixed symbolic and numerical methods. The game, as I see it, is to express or represent the problem in Maxima, apply some well-known rules, return a symbolic result if that's what the rules yield, otherwise carry out a numerical approximation. Bayesian inference is much more regular than frequentist stuff, so it is especially susceptible to automation. Many practical problems can be expressed as belief (probability) or value (utility) calculations. If Maxima were equipped to handle probability and utility calculations, a wide range of practical applications would result. FWIW Robert From robert.dodier at gmail.com Wed Jan 16 10:04:52 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 16 Jan 2008 09:04:52 -0700 Subject: [Maxima] [Maxima-users] Statistical Analysis. In-Reply-To: <1abe3fa90801151319k51320c7cw7573d0f2736e5c46@mail.gmail.com> References: <1200328702.14556.5.camel@P5K> <478CF8D4.5070404@telefonica.net> <8b356f880801151140r7538b287k45dc639376211d8c@mail.gmail.com> <1abe3fa90801151319k51320c7cw7573d0f2736e5c46@mail.gmail.com> Message-ID: On 1/15/08, A.J. Rossini wrote: > Which reminds me to ask -- where do I look to see how to integrate > Common Lisp packages with Maxima? There are some notes in the reference manual under the heading "Lisp and Maxima", and also in a tutorial named "Minimal Maxima". You can find both documents at: http://maxima.sourceforge.net/docs.shtml See also these pages at the Maxima wiki: http://maxima.sourceforge.net/wiki/index.php/Maxima%20internals http://maxima.sourceforge.net/wiki/index.php/outline%20of%20Maxima%20internals Sorry that this stuff isn't better organized. I guess we should merge it together .... > (3 reasons -- I've been working with a Common Lisp <-> R gateway, > mostly R called from Common Lisp; I'm slowly working on a port/update > of LispStat from XLisp to Common Lisp, and I've got a strong interest > in leveraging Maxima from the CommonLispStat code base at some point, > probably next year given my other commitments). What is the mechanism for communicating between CL and R ? Is it a foreign function interface or a pipe or what? best, Robert Dodier From robert.dodier at gmail.com Wed Jan 16 10:11:23 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 16 Jan 2008 09:11:23 -0700 Subject: [Maxima] [Maxima-users] Statistical Analysis. In-Reply-To: <478E1F59.20309@telefonica.net> References: <1200328702.14556.5.camel@P5K> <478CF8D4.5070404@telefonica.net> <8b356f880801151140r7538b287k45dc639376211d8c@mail.gmail.com> <478E1F59.20309@telefonica.net> Message-ID: On 1/16/08, Mario Rodriguez wrote: > With respect to the frame object, I remember Robert expressed a similar > idea time ago; at that time I didn't implement it, but perhaps it's a > good starting point to reinforce all this statistical stuff. Even if we > don't have the foreign function interface at this moment, packages stats > and descriptive could take advantage of frames. I haven't made any progress on the data frame stuff, since I was working on a revised matrix type (share/contrib/amatrix) which could be the basis of a data frame ... Maybe now is a good time to get started on the data frame. I think it would be straightforward to implement in Maxima. best Robert From villate at fe.up.pt Wed Jan 16 10:16:56 2008 From: villate at fe.up.pt (Jaime Villate) Date: Wed, 16 Jan 2008 16:16:56 +0000 Subject: [Maxima] Maxima parser and global parameters In-Reply-To: <8b356f880801151324q5528bbd4hbfa21cf7d9c48ca9@mail.gmail.com> References: <47890585.16576.1B2D65C@van.nek.arcor.de> <006701c8554a$03fdba80$0300a8c0@RJFE510> <478D0266.13081.1FB3F29@van.nek.arcor.de> <8b356f880801151324q5528bbd4hbfa21cf7d9c48ca9@mail.gmail.com> Message-ID: <1200500216.6437.27.camel@bethe> On Tue, 2008-01-15 at 16:24 -0500, Stavros Macrakis wrote: > I wonder if it might be useful to define (e.g.) 1.234x23 ('x' for > exact) to mean precisely the rational number 1234*10^(23-3). I think that would be very useful. Another example of its potential use is: (%i1) solve(1.2343*x=2); `rat' replaced 1.2343 by 5916/4793 = 1.23430002086376 (%o1) [x = 4793/2958] as you know, from time to time some new user of Maxima appears in this list asking us why 1.2343 was not replaced by 12343/10000 and why they didn't get the "right" answer [x = 20000/12343] It would be very nice if we could tell them to use: solve(1.2343x0*x=2) or even just 1.2343x as a short notation for 12343/10000 The problem I see is the proposed notation. Very often users forget to write the * operator; if the wrote 1.2343x5 meaning 1.2343*x*5 they would no longer get the current error message but would get surprising results. Regards, Jaime From Bart.Vandewoestyne at telenet.be Wed Jan 16 10:33:15 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Wed, 16 Jan 2008 17:33:15 +0100 Subject: [Maxima] sum of binomials: not calculated? Message-ID: <20080116163314.GA22091@forsythe> Hello all, Today, I was trying the following sum with Maxima: bartv at eeklo:~/maxima$ maxima Maxima 5.10.0 http://maxima.sourceforge.net Using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (aka GCL) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. This is a development version of Maxima. The function bug_report() provides bug reporting information. (%i1) sum( binomial(s, k), k, 1, s); s ==== \ (%o1) > binomial(s, k) / ==== k = 1 Apparently, the version of Maxima that I have does not calculate the expression. Maple seems able to do it: bartv at vonneumann:~$ maple |\^/| Maple 11 (IBM INTEL LINUX) ._|\| |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2007 \ MAPLE / All rights reserved. Maple is a trademark of <____ ____> Waterloo Maple Inc. | Type ? for help. > sum( binomial(s, k), k=1..s); s -1 + 2 Is there a way to find this same result with Maxima also? I really would like to start using Maxima for all my symbolic calculations... Thanks, Bart -- "Share what you know. Learn what you don't." From macrakis at alum.mit.edu Wed Jan 16 11:05:37 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 16 Jan 2008 12:05:37 -0500 Subject: [Maxima] sum of binomials: not calculated? In-Reply-To: <20080116163314.GA22091@forsythe> References: <20080116163314.GA22091@forsythe> Message-ID: <8b356f880801160905n62f068adl6a101eccd7e1689d@mail.gmail.com> On Jan 16, 2008 11:33 AM, Bart Vandewoestyne wrote: > (%i1) sum( binomial(s, k), k, 1, s); ... > Apparently, the version of Maxima that I have does not calculate the expression. By default, Maxima only performs trivial simplifications of sums (e.g. sum(a,i,1,n) => a*n). If you turn on simpsum, it does a few more: sum( binomial(s, k), k, 1, s), simpsum:true; => 2^s-1 There are also more powerful summing methods available: nusum (n^4*4^n/binomial(2*n,n), n, 0, n) => 2*(n+1)*(63*n^4+112*n^3+18*n^2-22*n+3)*4^n/(693*binomial(2*n,n))-2/(3*11*7) Or: qq: sum (n^4*4^n/binomial(2*n,n), n, 0, n); (comes back unsimplified) Try simpsum: expand(qq,0,0),simpsum:true (still unsimplified) Try nusum: subst(nusum,nounify(sum),qq),eval; => 2*(n+1)*(63*n^4+112*n^3+18*n^2-22*n+3)*4^n/(693*binomial(2*n,n))-2/(3*11*7) You might also want to look at the documentation for Zeilberger and GosperSum. ? zeilberger => -- Function: Zeilberger (, , ) Attempts to compute the indefinite hypergeometric summation of . ... --------- -s From robert.dodier at gmail.com Wed Jan 16 15:45:01 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 16 Jan 2008 14:45:01 -0700 Subject: [Maxima] sum of binomials: not calculated? In-Reply-To: <20080116163314.GA22091@forsythe> References: <20080116163314.GA22091@forsythe> Message-ID: On Jan 16, 2008 9:33 AM, Bart Vandewoestyne wrote: > (%i1) sum( binomial(s, k), k, 1, s); > s > ==== > \ > (%o1) > binomial(s, k) > / > ==== > k = 1 As explained by Stavros, Maxima doesn't apply many simplifications to summations. The methods he mentioned are all applied by an add-on function named simplify_sum. load (simplify_sum); sum (binomial(s, k), k, 1, s); => (summation expression) simplify_sum (%); => 2^s - 1 > I really would like to start using Maxima for all my symbolic > calculations... That is entirely laudable, and I hope it works out for you. Be advised, however, that there are many known bugs in Maxima. We are working on it, and making steady progress, but there is a lot to do. best, Robert Dodier From raymond.toy at ericsson.com Wed Jan 16 15:50:32 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Wed, 16 Jan 2008 16:50:32 -0500 Subject: [Maxima] strange behavior of tex() In-Reply-To: <478D634C.6030903@research.att.com> References: <478D634C.6030903@research.att.com> Message-ID: <478E7C28.4090808@ericsson.com> Kostas Oikonomou wrote: > With maxima 5.14, I get the following behavior with tex(): > > (%i7) tex(expand((a+b+c)^3)); > $$c^3+3\,b\,c^2+3\,a\,c^2+3\,b^2\,c+6\,a\,b\,c+3\,a^2\,c+b^3+3\,a\,b^2 > +3\,a^2\,b+a^3$$ > (%o7) false > (%i8) ordergreat(a,b,c); > (%o8) done > (%i9) tex(expand((a+b+c)^3)); > $${\it \_103a}^3+3\,{\it \_102b}\,{\it \_103a}^2+3\,{\it > \_101c}\, > {\it \_103a}^2+3\,{\it \_102b}^2\,{\it \_103a}+6\,{\it > \_101c}\, > {\it \_102b}\,{\it \_103a}+3\,{\it \_101c}^2\,{\it \_103a}+ > {\it \_102b}^3+3\,{\it \_101c}\,{\it \_102b}^2+3\,{\it > \_101c}^2\, > {\it \_102b}+{\it \_101c}^3$$ > (%o9) false > (%i10) > > The first output is fine, but what are the _101, _102, etc > in the second output? They come from how ordergreat works. It prepends those numbers to the variable names so that the display function (or something) displays the variables in the order that you want. I guess tex needs to be taught about that so that it doesn't put those numbers there. Ray From ko at research.att.com Wed Jan 16 15:50:21 2008 From: ko at research.att.com (Kostas Oikonomou) Date: Wed, 16 Jan 2008 16:50:21 -0500 Subject: [Maxima] strange behavior of tex() In-Reply-To: References: <478D634C.6030903@research.att.com> Message-ID: <478E7C1D.9080806@research.att.com> Thanks Robert. I see that the important function is "makorder" in comm2.lisp. But I have no idea how to modify it! Kostas Robert Dodier wrote: > On 1/15/08, Kostas Oikonomou wrote: > >> (%i8) ordergreat(a,b,c); >> (%o8) done >> (%i9) tex(expand((a+b+c)^3)); >> $${\it \_103a}^3+3\,{\it \_102b}\,{\it \_103a}^2+3\,{\it >> \_101c}\, > > Oh, ordergreat creates a new symbol _nnnfoo for each foo that > it processes and then makes _nnnfoo an alias of foo so that it > appears as foo in ordinary output. I guess ordergreat should > also assign a TEXWORD property to _nnnfoo to make it display > as foo in tex output. > > A workaround is to assign the tex property by hand, e.g.: > texput (?_103a, "a"); > > I'll put this on my to-do list, but if someone beats me to it > I won't be upset. > > best, > > Robert Dodier From willisb at unk.edu Wed Jan 16 16:21:48 2008 From: willisb at unk.edu (Barton Willis) Date: Wed, 16 Jan 2008 16:21:48 -0600 Subject: [Maxima] strange behavior of tex() In-Reply-To: <478E7C1D.9080806@research.att.com> Message-ID: See SF bug 955404: http://sourceforge.net/tracker/index.php?func=detail&aid=955404&group_id=4933&atid=104933 the proposed fix doesn't work anymore. Barton maxima-bounces at math.utexas.edu wrote on 01/16/2008 03:50:21 PM: > Thanks Robert. I see that the important function is > "makorder" in comm2.lisp. > But I have no idea how to modify it! > > Kostas > > Robert Dodier wrote: > > On 1/15/08, Kostas Oikonomou wrote: > > > >> (%i8) ordergreat(a,b,c); > >> (%o8) done > >> (%i9) tex(expand((a+b+c)^3)); > >> $${\it \_103a}^3+3\,{\it \_102b}\,{\it \_103a}^2+3\,{\it > >> \_101c}\, > > > > Oh, ordergreat creates a new symbol _nnnfoo for each foo that > > it processes and then makes _nnnfoo an alias of foo so that it > > appears as foo in ordinary output. I guess ordergreat should > > also assign a TEXWORD property to _nnnfoo to make it display > > as foo in tex output. > > > > A workaround is to assign the tex property by hand, e.g.: > > texput (?_103a, "a"); > > > > I'll put this on my to-do list, but if someone beats me to it > > I won't be upset. > > > > best, > > > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080116/17e23ad8/attachment.htm From blindglobe at gmail.com Wed Jan 16 16:22:59 2008 From: blindglobe at gmail.com (A.J. Rossini) Date: Wed, 16 Jan 2008 23:22:59 +0100 Subject: [Maxima] [Maxima-users] Statistical Analysis. In-Reply-To: References: <1200328702.14556.5.camel@P5K> <478CF8D4.5070404@telefonica.net> <8b356f880801151140r7538b287k45dc639376211d8c@mail.gmail.com> <1abe3fa90801151319k51320c7cw7573d0f2736e5c46@mail.gmail.com> Message-ID: <1abe3fa90801161422sd1ad9f8vbbdf5176f12e2f97@mail.gmail.com> On Jan 16, 2008 5:04 PM, Robert Dodier wrote: > On 1/15/08, A.J. Rossini wrote: > > > Which reminds me to ask -- where do I look to see how to integrate > > Common Lisp packages with Maxima? > > There are some notes in the reference manual under the heading > "Lisp and Maxima", and also in a tutorial named "Minimal Maxima". > You can find both documents at: http://maxima.sourceforge.net/docs.shtml > See also these pages at the Maxima wiki: > http://maxima.sourceforge.net/wiki/index.php/Maxima%20internals > http://maxima.sourceforge.net/wiki/index.php/outline%20of%20Maxima%20internals > Sorry that this stuff isn't better organized. I guess we should merge > it together .... This is exactly what I'm looking for at this point. To answer Ray's question in a round-about indirect way, the first use case I have is for ODE and integral simplification, i.e. I'd like to be able to send a CL form specifying one or the other, and get a simplified form back. I'm assuming that I might need to appropriately translate or embed, but in a sense, I'd like to be able to do something like write a MaximaWrapper package which I could then do: (setf OldFunction '(form denoting in lisp notation (some expression) to (simplify) which would be ODE, integral, or mixed)) (setf newFunction (Tony'sMaximaWrapper::simplify OldFunction) for later eval'ing of the newFunction in the right closure/environment. Basically, stripping away the current Maxima notation into something more directly CL-like. Robert hit it on the head elsewhere in this thread -- one statistical application I'm quite keen on is Bayesian nonlinear heirarchical regression analysis where the mean form is ODE specified. (kinetics equations in systems biology and pharmacokinetics). > > (3 reasons -- I've been working with a Common Lisp <-> R gateway, > > mostly R called from Common Lisp; I'm slowly working on a port/update > > of LispStat from XLisp to Common Lisp, and I've got a strong interest > > in leveraging Maxima from the CommonLispStat code base at some point, > > probably next year given my other commitments). > > What is the mechanism for communicating between CL and R ? > Is it a foreign function interface or a pipe or what? Built on CFFI. (there's another one out there built directly using SBCL's FFI as well). best, -tony blindglobe at gmail.com Muttenz, Switzerland. "Commit early,commit often, and commit in a repository from which we can easily roll-back your mistakes" (AJR, 4Jan05). Drink Coffee: Do stupid things faster with more energy! From umut.tabak at gmail.com Wed Jan 16 17:51:55 2008 From: umut.tabak at gmail.com (Umut TABAK) Date: Thu, 17 Jan 2008 00:51:55 +0100 Subject: [Maxima] derivative of a matrix Message-ID: Dear all, I am a rather new user. I am trying to take the derivative of a matrix w.r.ta variable, say ksi, but diff(Matrix,ksi,2) does not seem to work. Any help is appreciated Rgds, Umut -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080117/bf49efbd/attachment.htm From willisb at unk.edu Wed Jan 16 18:37:54 2008 From: willisb at unk.edu (Barton Willis) Date: Wed, 16 Jan 2008 18:37:54 -0600 Subject: [Maxima] derivative of a matrix In-Reply-To: References: Message-ID: Maybe this will help you get started: (%i1) diff(matrix([1,x],[x^2,x^3]),x); (%o1) matrix([0,1],[2*x,3*x^2]) (%i2) diff(matrix([1,x],[x^2,x^3]),x,2); (%o2) matrix([0,0],[2,6*x]) Let us know if it doesn't. Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: maxima at math.utexas.edu >From: "Umut TABAK" >Sent by: maxima-bounces at math.utexas.edu >Date: 01/16/2008 05:51PM >Subject: [Maxima] derivative of a matrix > >Dear all, > >I am a rather new user. I am trying to take the derivative of a matrix >w.r.t a variable, say ksi, > >but diff(Matrix,ksi,2) > >does not seem to work. > >Any help is appreciated > >Rgds, > > >Umut > >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From umut.tabak at gmail.com Wed Jan 16 19:55:43 2008 From: umut.tabak at gmail.com (Umut TABAK) Date: Thu, 17 Jan 2008 02:55:43 +0100 Subject: [Maxima] representation of matrix outputs Message-ID: Dear all, >From the below given script I can get the mass matrix correctly(I mean in a matrix format in some column output), but I could not get the stiffness like the mass matrix. Can someone comment on this? Rgds, n1:(1/8)*(1-eta)*(1-eta)*(2-ksi-eta-ksi^2-eta^2)$ n2:(-1/8)*a*(1-eta)^2*(-1-ksi)*(1-eta)$ n3:(-1/8)*b*(1-eta)^2*(-1-eta)*(1-eta)^2$ n4:(1/8)*(1+eta)*(1-eta)*(2+ksi-eta-ksi^2-eta^2)$ n5:(1/8)*a*(1+eta)^2*(ksi-1)*(1-eta)$ n6:(-1/8)*b*(1+eta)^2*(-1-eta)*(1-eta)^2$ n7:(1/8)*(1+eta)*(1+eta)*(2+ksi+eta-ksi^2-eta^2)$ n8:(1/8)*a*(1+eta)^2*(ksi-1)^2*(eta+1)$ n9:(1/8)*b*(1+eta)^2*(eta-1)*(1+eta)^2$ n10:(1/8)*(1-eta)*(1+eta)*(2-ksi+eta-ksi^2-eta^2)$ n11:-(1/8)*a*(1-eta)*(-ksi-1)*(eta+1)$ n12:(1/8)*b*(1-eta)^2*(eta-1)*(eta+1)^2$ N:matrix([n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12])$ mass_integrand:transpose(N).N$ mass:ro*t*a*b*integrate(integrate(mass_integrand,ksi,-1,1),eta,-1,1); bc1:diff(N,ksi,2); bc2:diff(N,eta,2); bc3:diff(N,ksi,eta); B:matrix([bc1], [bc2], [bc3]); D:E*t^3/(12*(1-nu^2))$ C:matrix([1, nu, 0],[ nu, 1, 0],[0, 0, (1-nu)/2])$ stiffness_integrand:transpose(B).C.B$ stiffness:D*a*b*integrate(integrate(stiffness_integrand,ksi,-1,1),eta,-1,1)$ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080117/b05cd71c/attachment.htm From robert.dodier at gmail.com Wed Jan 16 22:54:28 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 16 Jan 2008 21:54:28 -0700 Subject: [Maxima] strange behavior of tex() In-Reply-To: References: <478E7C1D.9080806@research.att.com> Message-ID: On 1/16/08, Barton Willis wrote: > See SF bug 955404: > the proposed fix doesn't work anymore. Barton, I'm not sure what you mean here. It appears the interesting bit in the code shown in the bug report is (if (symbolp x) (setq x (or (get x 'reversealias) x))) which, when pasted into the current version of mactex, seems to have the right result. (%i7) ordergreat (f, u, b, a, r); (%o7) done (%i8) f+u+b+a+r; (%o8) f + u + b + a + r (%i9) tex (%); $$f+u+b+a+r$$ (%o9) false What did you have in mind when you wrote above that the fix no longer works? Robert From willisb at unk.edu Thu Jan 17 04:32:32 2008 From: willisb at unk.edu (Barton Willis) Date: Thu, 17 Jan 2008 04:32:32 -0600 Subject: [Maxima] representation of matrix outputs In-Reply-To: References: Message-ID: Maybe you want bc3 : diff(N,ksi,2) instead of bc3 : diff(N,ksi,eta)? Barton -----maxima-bounces at math.utexas.edu wrote: ----- >bc1:diff(N,ksi,2); >bc2:diff(N,eta,2); >bc3:diff(N,ksi,eta); From willisb at unk.edu Thu Jan 17 04:39:43 2008 From: willisb at unk.edu (Barton Willis) Date: Thu, 17 Jan 2008 04:39:43 -0600 Subject: [Maxima] strange behavior of tex() In-Reply-To: References: <478E7C1D.9080806@research.att.com> , Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >What did you have in mind when you wrote above that the >fix no longer works? When I tried the fix, I didn't extract just the patch (the (if (symbolp x) (setq x (or (get x 'reversealias) x))) stuff). I redefined tex-atom using the entire posted function. I think tex-atom has changed in the past 3.5 years. Thanks for taking care of this. Barton From ko at research.att.com Thu Jan 17 08:42:59 2008 From: ko at research.att.com (Kostas Oikonomou) Date: Thu, 17 Jan 2008 09:42:59 -0500 Subject: [Maxima] strange behavior of tex() In-Reply-To: References: <478E7C1D.9080806@research.att.com> , Message-ID: <478F6973.1060501@research.att.com> Barton, Does maxima have a way other than ordergreat() to order the variables in a multivariate polynomial? (My question about the TeX form was motivated by the fact that I was trying to order the variables while using Texmacs as a front end.) Kostas Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > >> What did you have in mind when you wrote above that the >> fix no longer works? > > When I tried the fix, I didn't extract just the patch (the > (if (symbolp x) (setq x (or (get x 'reversealias) x))) stuff). > I redefined tex-atom using the entire posted function. I think tex-atom > has changed in the past 3.5 years. > > Thanks for taking care of this. > > Barton > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Thu Jan 17 09:06:40 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 17 Jan 2008 10:06:40 -0500 Subject: [Maxima] strange behavior of tex() In-Reply-To: <478F6973.1060501@research.att.com> References: <478E7C1D.9080806@research.att.com> <478F6973.1060501@research.att.com> Message-ID: <8b356f880801170706n415afd37q159d69461043015b@mail.gmail.com> On Jan 17, 2008 9:42 AM, Kostas Oikonomou wrote: > Does maxima have a way other than ordergreat() to order the > variables in a multivariate polynomial? If canonical rational expression (CRE) form will work for you, take a look at rat(..., var1, var2, ...) and at ratvars. CRE form is a polynomial of polynomials: p:x+x*y+y^2+1 => y^2+x*y+x+1 rat(p,x,y) => y^2+x*y+x+1 rat(p,y,x) => (y+1)*x+y^2+1 Otherwise, I think you have to use ordergreat. Still, variables should print correctly despite ordergreat. Best, -s From ko at research.att.com Thu Jan 17 09:44:50 2008 From: ko at research.att.com (Kostas Oikonomou) Date: Thu, 17 Jan 2008 10:44:50 -0500 Subject: [Maxima] strange behavior of tex() In-Reply-To: <8b356f880801170706n415afd37q159d69461043015b@mail.gmail.com> References: <478E7C1D.9080806@research.att.com> <478F6973.1060501@research.att.com> <8b356f880801170706n415afd37q159d69461043015b@mail.gmail.com> Message-ID: <478F77F2.9030308@research.att.com> Stavro, rat() doesn't seems to do what I want. I have this function f3(a,r) := block([n], n:length(a), sum(sum(sum((a[i]+a[j]+a[k])*r[i]*r[j]*r[k], k,j+1,n), j,i+1,n), i,1,n) ) and I am trying to arrange f3([a[1],a[2],a[3],a[4]],[r[1],r[2],r[3],r[4]]) so that the a's come before the r's, i.e. like (a1+a2+a3)r1r2r3 + (a1+a2+a4)r1r2r4 + ... Maybe this is not possible? Kostas Stavros Macrakis wrote: > On Jan 17, 2008 9:42 AM, Kostas Oikonomou wrote: >> Does maxima have a way other than ordergreat() to order the >> variables in a multivariate polynomial? > > If canonical rational expression (CRE) form will work for you, take a > look at rat(..., var1, var2, ...) and at ratvars. CRE form is a > polynomial of polynomials: > > p:x+x*y+y^2+1 > => y^2+x*y+x+1 > rat(p,x,y) > => y^2+x*y+x+1 > rat(p,y,x) > => (y+1)*x+y^2+1 > > Otherwise, I think you have to use ordergreat. Still, variables should > print correctly despite ordergreat. > > Best, > > -s From macrakis at alum.mit.edu Thu Jan 17 10:13:02 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 17 Jan 2008 11:13:02 -0500 Subject: [Maxima] strange behavior of tex() In-Reply-To: <478F77F2.9030308@research.att.com> References: <478E7C1D.9080806@research.att.com> <478F6973.1060501@research.att.com> <8b356f880801170706n415afd37q159d69461043015b@mail.gmail.com> <478F77F2.9030308@research.att.com> Message-ID: <8b356f880801170813r2885b20avb8147a95c49ac2a6@mail.gmail.com> Kosta, In general, it is hard to force Maxima to organize things in a certain way, but if you're willing to program in simp:false mode, you can organize them in arbitrary ways, e.g.: reorder_product(ex):= block([simp:false], make_simplified(reorder_product1(ex)))$ reorder_product1(ex):= if mapatom(ex) then ex elseif op(ex)="*" then apply("*", sort(args(ex), lambda([a,b], if subvarp(a) and subvarp(b) then orderlessp(a,b) elseif subvarp(a) then false elseif subvarp(b) then true else orderlessp(a,b)))) else map(reorder_product,ex)$ make_simplified(ex):= if atom(ex) then ex else ?cons(?list(?caar(ex),?simp),?cdr(ex))$ The results of reorder_product will display the way you specify, but should be resimplified before you perform any algebraic calculations on them using expand(expr,0,0). That said, I find it weird that Maxima orders r[1]*r[2]*(a[2]+a[1]) as r[1]*(a[2]+a[1])*r[2] This should be fixable internally, but I haven't looked into it. -s On Jan 17, 2008 10:44 AM, Kostas Oikonomou wrote: > (a1+a2+a3)r1r2r3 + (a1+a2+a4)r1r2r4 + ... > Maybe this is not possible? From van.nek at arcor.de Fri Jan 18 11:10:37 2008 From: van.nek at arcor.de (van Nek) Date: Fri, 18 Jan 2008 18:10:37 +0100 Subject: [Maxima] still not fixed: [ maxima-Bugs-1867942 ] round doesn't evaluate 1.0b0 In-Reply-To: Message-ID: <4790EB9D.12299.1284AD4@van.nek.arcor.de> Hi, I didn't find the bug 1867942 in the tracker anymore. Sorry to say, but it's not fixed. I loaded the latest CVS version including the line ((eq lb ub) lb) ;; For floats that are integers, .... (%i1) load("D:\\volker\\CVS\\maxima\\maxima\\src\\nummod.lisp"); (%o1) D:\volker\CVS\maxima\maxima\src\nummod.lisp (%i2) round(12345.b0); (%o2) round(1.2345b4) Or did I something wrong? Volker van Nek Am 10 Jan 2008 um 8:35 hat SourceForge.net geschrieben: > Bugs item #1867942, was opened at 2008-01-09 15:22 > Message generated for change (Comment added) made by willisbl > You can respond by visiting: > https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1867942 > &group_id=4933 > > Please note that this message will contain a full copy of the > comment thread, > including the initial issue submission, for this request, > not just the latest update. > Category: Lisp Core - Floating point > Group: None > >Status: Closed > >Resolution: Fixed > Priority: 5 > Private: No > Submitted By: Volker van Nek (van_nek) > Assigned to: Barton Willis (willisbl) > Summary: round doesn't evaluate 1.0b0 > > Initial Comment: > round doesn't when the argument is a bigfloat with an integer number > value. > > examples: > > map(round, [1.b0, 1.1b1, 1.11b2, 10.b-1, 100.b-2]); > [round(1.0b0), round(1.1b1), round(1.11b2), round(1.0b0), > round(1.0b0)] > > Volker van Nek > > -------------------------------------------------------------------- > -- > > >Comment By: Barton Willis (willisbl) > Date: 2008-01-10 10:35 > > Message: > Logged In: YES > user_id=895922 > Originator: NO > > Yes, simp-round didn't handle the case where the floor and ceiling > of the > number is the same. > I fixed this and appened regression tests to rtest_round for this > bug. > > -------------------------------------------------------------------- > -- > > Comment By: Raymond Toy (rtoy) > Date: 2008-01-09 16:10 > > Message: > Logged In: YES > user_id=28849 > Originator: NO > > This fails also for floats that are integers. > > I think the problem is in simp-round which doesn't handle the case > where > the floor and ceiling of the number are the same. > > -------------------------------------------------------------------- > -- > > Comment By: Raymond Toy (rtoy) > Date: 2008-01-09 15:59 > > Message: > Logged In: YES > user_id=28849 > Originator: NO > > This fails also for floats that are integers. > > I think the problem is in simp-round which doesn't handle the case > where > the floor and ceiling of the number are the same. > > -------------------------------------------------------------------- > -- > > You can respond by visiting: > https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1867942 > &group_id=4933 From van.nek at arcor.de Fri Jan 18 11:24:51 2008 From: van.nek at arcor.de (van Nek) Date: Fri, 18 Jan 2008 18:24:51 +0100 Subject: [Maxima] still not fixed: [ maxima-Bugs-1867942 ] round doesn't evaluate 1.0b0 In-Reply-To: <4790EB9D.12299.1284AD4@van.nek.arcor.de> References: Message-ID: <4790EEF3.7306.1355499@van.nek.arcor.de> The problem seems to be fixed, if eq will be replaced by = ((= lb ub) lb) ;; For floats that are integers, .... lb and ub are not the same objects. Volker van Nek Am 18 Jan 2008 um 18:10 hat van Nek geschrieben: > Hi, > > I didn't find the bug 1867942 in the tracker anymore. Sorry to say, > but it's not fixed. > > I loaded the latest CVS version including the line > ((eq lb ub) lb) ;; For floats that are integers, .... > > (%i1) load("D:\\volker\\CVS\\maxima\\maxima\\src\\nummod.lisp"); > (%o1) D:\volker\CVS\maxima\maxima\src\nummod.lisp > (%i2) round(12345.b0); > (%o2) round(1.2345b4) > > Or did I something wrong? > > Volker van Nek > > > Am 10 Jan 2008 um 8:35 hat SourceForge.net geschrieben: > > > Bugs item #1867942, was opened at 2008-01-09 15:22 > > Message generated for change (Comment added) made by willisbl > > You can respond by visiting: > > > https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1867942 > > &group_id=4933 > > > > Please note that this message will contain a full copy of the > > comment thread, > > including the initial issue submission, for this request, > > not just the latest update. > > Category: Lisp Core - Floating point > > Group: None > > >Status: Closed > > >Resolution: Fixed > > Priority: 5 > > Private: No > > Submitted By: Volker van Nek (van_nek) > > Assigned to: Barton Willis (willisbl) > > Summary: round doesn't evaluate 1.0b0 > > > > Initial Comment: > > round doesn't when the argument is a bigfloat with an integer > number > > value. > > > > examples: > > > > map(round, [1.b0, 1.1b1, 1.11b2, 10.b-1, 100.b-2]); > > [round(1.0b0), round(1.1b1), round(1.11b2), round(1.0b0), > > round(1.0b0)] > > > > Volker van Nek > > > > > -------------------------------------------------------------------- > > -- > > > > >Comment By: Barton Willis (willisbl) > > Date: 2008-01-10 10:35 > > > > Message: > > Logged In: YES > > user_id=895922 > > Originator: NO > > > > Yes, simp-round didn't handle the case where the floor and > ceiling > > of the > > number is the same. > > I fixed this and appened regression tests to rtest_round for > this > > bug. > > > > > -------------------------------------------------------------------- > > -- > > > > Comment By: Raymond Toy (rtoy) > > Date: 2008-01-09 16:10 > > > > Message: > > Logged In: YES > > user_id=28849 > > Originator: NO > > > > This fails also for floats that are integers. > > > > I think the problem is in simp-round which doesn't handle the > case > > where > > the floor and ceiling of the number are the same. > > > > > -------------------------------------------------------------------- > > -- > > > > Comment By: Raymond Toy (rtoy) > > Date: 2008-01-09 15:59 > > > > Message: > > Logged In: YES > > user_id=28849 > > Originator: NO > > > > This fails also for floats that are integers. > > > > I think the problem is in simp-round which doesn't handle the > case > > where > > the floor and ceiling of the number are the same. > > > > > -------------------------------------------------------------------- > > -- > > > > You can respond by visiting: > > > https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1867942 > > &group_id=4933 > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080118/434e01af/attachment-0001.htm From willisb at unk.edu Fri Jan 18 11:24:42 2008 From: willisb at unk.edu (Barton Willis) Date: Fri, 18 Jan 2008 11:24:42 -0600 Subject: [Maxima] still not fixed: [ maxima-Bugs-1867942 ] round doesn't evaluate 1.0b0 In-Reply-To: <4790EB9D.12299.1284AD4@van.nek.arcor.de> Message-ID: I think it should be ((equal lb ub) lb). I'll fix it. Sorry about that. BW maxima-bounces at math.utexas.edu wrote on 01/18/2008 11:10:37 AM: > Hi, > > I didn't find the bug 1867942 in the tracker anymore. Sorry to say, > but it's not fixed. > > I loaded the latest CVS version including the line > ((eq lb ub) lb) ;; For floats that are integers, .... > > (%i1) load("D:\\volker\\CVS\\maxima\\maxima\\src\\nummod.lisp"); > (%o1) D:\volker\CVS\maxima\maxima\src\nummod.lisp > (%i2) round(12345.b0); > (%o2) round(1.2345b4) > > Or did I something wrong? > > Volker van Nek > > > Am 10 Jan 2008 um 8:35 hat SourceForge.net geschrieben: > > > Bugs item #1867942, was opened at 2008-01-09 15:22 > > Message generated for change (Comment added) made by willisbl > > You can respond by visiting: > > https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1867942 > > &group_id=4933 > > > > Please note that this message will contain a full copy of the > > comment thread, > > including the initial issue submission, for this request, > > not just the latest update. > > Category: Lisp Core - Floating point > > Group: None > > >Status: Closed > > >Resolution: Fixed > > Priority: 5 > > Private: No > > Submitted By: Volker van Nek (van_nek) > > Assigned to: Barton Willis (willisbl) > > Summary: round doesn't evaluate 1.0b0 > > > > Initial Comment: > > round doesn't when the argument is a bigfloat with an integer number > > value. > > > > examples: > > > > map(round, [1.b0, 1.1b1, 1.11b2, 10.b-1, 100.b-2]); > > [round(1.0b0), round(1.1b1), round(1.11b2), round(1.0b0), > > round(1.0b0)] > > > > Volker van Nek > > > > -------------------------------------------------------------------- > > -- > > > > >Comment By: Barton Willis (willisbl) > > Date: 2008-01-10 10:35 > > > > Message: > > Logged In: YES > > user_id=895922 > > Originator: NO > > > > Yes, simp-round didn't handle the case where the floor and ceiling > > of the > > number is the same. > > I fixed this and appened regression tests to rtest_round for this > > bug. > > > > -------------------------------------------------------------------- > > -- > > > > Comment By: Raymond Toy (rtoy) > > Date: 2008-01-09 16:10 > > > > Message: > > Logged In: YES > > user_id=28849 > > Originator: NO > > > > This fails also for floats that are integers. > > > > I think the problem is in simp-round which doesn't handle the case > > where > > the floor and ceiling of the number are the same. > > > > -------------------------------------------------------------------- > > -- > > > > Comment By: Raymond Toy (rtoy) > > Date: 2008-01-09 15:59 > > > > Message: > > Logged In: YES > > user_id=28849 > > Originator: NO > > > > This fails also for floats that are integers. > > > > I think the problem is in simp-round which doesn't handle the case > > where > > the floor and ceiling of the number are the same. > > > > -------------------------------------------------------------------- > > -- > > > > You can respond by visiting: > > https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1867942 > > &group_id=4933 > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080118/61f81059/attachment.htm From jonasforssell at yahoo.se Sat Jan 19 12:18:13 2008 From: jonasforssell at yahoo.se (Jonas Forssell) Date: Sat, 19 Jan 2008 19:18:13 +0100 (CET) Subject: [Maxima] Ellipse question Message-ID: <523354.80114.qm@web27312.mail.ukl.yahoo.com> I am using Maxima to find an algebraic solution to an ellipse passing through three points. The implicit form of an ellipse with center (uc,vc), angle a and ratio k between major and minor axis lengths is: G := k^2*((u-uc)^2*sin(a)^2-(u-uc)*(v-vc)*sin(2*a)+(v-vc)^2*cos(a)^2)+(u-uc)^2*cos(a)^2+(v-vc)^2*sin(a)^2+(u-uc)*(v-vc)*sin(2*a)-D=0 Assume three points with coordinates (u1,v1) (u2,v2) (u3,v3) which the ellipse passes through with k and a given. I then need to determine uc,vc and D So, I generate three equations substituting u for u1 and v for v1 and so on. After that I use linsolve to get the solution for uc,vc and D. The equations get very long. My problem is that these equations does not seem to give the right answer numerically. I try three points and using the derived values for uc,vc and D does not solve G to be equal to 0. Could this be a bug in Maxima or am I missing something fundamental? Thanks /Jonas Forssell, Gothenburg, Sweden --------------------------------- Ta semester! - s?k efter resor hos Yahoo! Shopping. J?mf?r pris p? flygbiljetter och hotellrum: http://shopping.yahoo.se/c-169901-resor-biljetter.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080119/cb6fdd3f/attachment.htm From jonasforssell at yahoo.se Sat Jan 19 12:41:26 2008 From: jonasforssell at yahoo.se (Jonas Forssell) Date: Sat, 19 Jan 2008 19:41:26 +0100 (CET) Subject: [Maxima] Ellipse question In-Reply-To: <523354.80114.qm@web27312.mail.ukl.yahoo.com> Message-ID: <263095.27616.qm@web27308.mail.ukl.yahoo.com> I've attached the session describing the issue. /Jonas --------------------------------- G?r det l?ngsamt? Skaffa dig en snabbare bredbandsuppkoppling. S?k och j?mf?r hos Yahoo! Shopping. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080119/086951c0/attachment-0001.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: untitled.wxm Type: application/octet-stream Size: 20693 bytes Desc: 995905591-untitled.wxm Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080119/086951c0/attachment-0001.obj From erom at earthlink.net Sat Jan 19 14:04:12 2008 From: erom at earthlink.net (Edward A. Romana) Date: Sat, 19 Jan 2008 12:04:12 -0800 Subject: [Maxima] Ellipse question In-Reply-To: <523354.80114.qm@web27312.mail.ukl.yahoo.com> References: <523354.80114.qm@web27312.mail.ukl.yahoo.com> Message-ID: ~~~ Jonas I seem to think 5 variables are needed to place an ellipse in the 2 dimensional plane. Say for example: the coordinates of 2 foci, and the sum of the distances form the foci to the ellipse for a total of 5 variables, say [fu1,fv1,fu2,fv2,D]. Another possibility as you describe is: the coordinates of the center, the semi major axis ratio, the ellipse orientation angle, and the constant D, also for 5 variables [uc,vc,a,k,D]. I seem to think that with given 3 points on the ellipse 6 variables are determined and so in principle one should be able to solve for the 5 variables that define the solution ellipse. What I do not understand how only 3 proposed solution variables [uc,vc,D] can define a generalized ellipse on the plane. I guess I do not understand D. Interesting problem. Ed ~~~ At 10:18 AM 1/19/2008, Jonas Forssell wrote: >I am using Maxima to find an algebraic solution to an ellipse passing through three points. > >The implicit form of an ellipse with center (uc,vc), angle a and ratio k between major and minor axis lengths is: > >G := k^2*((u-uc)^2*sin(a)^2-(u-uc)*(v-vc)*sin(2*a)+(v-vc)^2*cos(a)^2)+(u-uc)^2*cos(a)^2+(v-vc)^2*sin(a)^2+(u-uc)*(v-vc)*sin(2*a)-D=0 > >Assume three points with coordinates (u1,v1) (u2,v2) (u3,v3) which the ellipse passes through with k and a given. I then need to determine uc,vc and D > >So, I generate three equations substituting u for u1 and v for v1 and so on. >After that I use linsolve to get the solution for uc,vc and D. >The equations get very long. > >My problem is that these equations does not seem to give the right answer numerically. I try three points and using the derived values for uc,vc and D does not solve G to be equal to 0. > >Could this be a bug in Maxima or am I missing something fundamental? > >Thanks >/Jonas Forssell, Gothenburg, Sweden > > >Ta semester! - s?k efter resor hos Yahoo! Shopping. >J?mf?r pris p? flygbiljetter och hotellrum: http://shopping.yahoo.se/c-169901-resor-biljetter.html >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From erom at earthlink.net Sat Jan 19 14:56:52 2008 From: erom at earthlink.net (Edward A. Romana) Date: Sat, 19 Jan 2008 12:56:52 -0800 Subject: [Maxima] Ellipse question Message-ID: ~~~ I think I answered my own question k and a are given! ~~~ Jonas I seem to think 5 variables are needed to place an ellipse in the 2 dimensional plane. Say for example: the coordinates of 2 foci, and the sum of the distances form the foci to the ellipse for a total of 5 variables, say [fu1,fv1,fu2,fv2,D]. Another possibility as you describe is: the coordinates of the center, the semi major axis ratio, the ellipse orientation angle, and the constant D, also for 5 variables [uc,vc,a,k,D]. I seem to think that with given 3 points on the ellipse 6 variables are determined and so in principle one should be able to solve for the 5 variables that define the solution ellipse. What I do not understand how only 3 proposed solution variables [uc,vc,D] can define a generalized ellipse on the plane. I guess I do not understand D. Interesting problem. Ed ~~~ At 10:18 AM 1/19/2008, Jonas Forssell wrote: >I am using Maxima to find an algebraic solution to an ellipse passing through three points. > >The implicit form of an ellipse with center (uc,vc), angle a and ratio k between major and minor axis lengths is: > >G := k^2*((u-uc)^2*sin(a)^2-(u-uc)*(v-vc)*sin(2*a)+(v-vc)^2*cos(a)^2)+(u-uc)^2*cos(a)^2+(v-vc)^2*sin(a)^2+(u-uc)*(v-vc)*sin(2*a)-D=0 > >Assume three points with coordinates (u1,v1) (u2,v2) (u3,v3) which the ellipse passes through with k and a given. I then need to determine uc,vc and D > >So, I generate three equations substituting u for u1 and v for v1 and so on. >After that I use linsolve to get the solution for uc,vc and D. >The equations get very long. > >My problem is that these equations does not seem to give the right answer numerically. I try three points and using the derived values for uc,vc and D does not solve G to be equal to 0. > >Could this be a bug in Maxima or am I missing something fundamental? > >Thanks >/Jonas Forssell, Gothenburg, Sweden > > >Ta semester! - s?k efter resor hos Yahoo! Shopping. >J?mf?r pris p? flygbiljetter och hotellrum: http://shopping.yahoo.se/c-169901-resor-biljetter.html >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From van.nek at arcor.de Sun Jan 20 05:15:59 2008 From: van.nek at arcor.de (van Nek) Date: Sun, 20 Jan 2008 12:15:59 +0100 Subject: [Maxima] stringproc revision Message-ID: <47933B7F.18168.AF6CFF@van.nek.arcor.de> I have uploaded a revision of the add-on package stringproc. 1. bugs 1796372 and 1820014 are fixed. 2. all functions are wrapped in some error checking 3. function printf now converts real bigfloat parameters automatically to float (%i20) printf(true, "|~25 at a|~25,5f|~%", bf, bf), bf:2.5b0^25$ | 8.8817841970012531E9| 8881784197.00125| 4. bprintf: a new function for printing formatted bigfloats. Some examples: (%i10) fpprec:100$ (%i11) bprintf(true, 5.5b0^25); 3228993995007387460.5247453153133392333984375 (%o11) false (%i12) bprintf(true, 2^-50)$ 0.00000000000000088817841970012523233890533447265625 With fpprec chosen accordingly and without optional parameters real bigfloats are printed as they are - but without b0 by default. Real constants are converted to bigfloats. Like in printf the first arg may be true, false or a stream to a file. Three optional parameters are false by default. The first sets the display resp. string width, the second the decimal places. (%i13) (printf(true,"|"), bprintf(true, 5.5b0^25, 45, 5), printf(true,"|"))$ | 3228993995007387460.52475| If the third is set to true, "b0" is added and the returned string can be parsed. (%i14) bprintf(false, 5.5b0^25, false, 20, true); (%o14) 3228993995007387460.52474531531333923340b0 (%i15) parse_string(%); (%o15) 3.2289939950073874605247453153133392334b18 To check it out, for some examples you might need the latest nummod.lisp fix. Volker van Nek -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080120/09c4e4ef/attachment.htm From george.leeman at sbcglobal.net Sun Jan 20 07:26:21 2008 From: george.leeman at sbcglobal.net (George Leeman) Date: Sun, 20 Jan 2008 08:26:21 -0500 Subject: [Maxima] Factorization in extension fields Message-ID: <000601c85b68$0c3d9cf0$6401a8c0@Dimension8400> If we let p=10*x^2+17*x+3, Maxima properly computes factor(p)=(2*x+3)*(5*x+1). Its algorithm can be interpreted as finding factorizations if the field of rational numbers (by Gauss' lemma it suffices to find factorizations over the integers). However, in the field Q(sqrt(2)), i.e. all numbers of the form r1+r2*sqrt(2), where r1 and r2 are rational, another factorization is possible, e.g. p=(-2+2*sqrt(2))*x-3+3*sqrt(2))*((5+5*sqrt(2))*x+1+sqrt(2)). Is it possible to get Maxima to find such factorizations? One could do so manually for a fixed entension field by setting up a set of simultaneous equations to be solved, but I wonder if there is a quicker, more elegant approach, in which Maxima even discovers the right extension field. Thanks, George Leeman From macrakis at alum.mit.edu Sun Jan 20 08:20:28 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 20 Jan 2008 09:20:28 -0500 Subject: [Maxima] Factorization in extension fields In-Reply-To: <000601c85b68$0c3d9cf0$6401a8c0@Dimension8400> References: <000601c85b68$0c3d9cf0$6401a8c0@Dimension8400> Message-ID: <8b356f880801200620m58a119d1n4369d165971492ed@mail.gmail.com> ? Factor will show you the documentation for 'factor'. Try factor(p, q^2-2 ) for example. -s On 1/20/08, George Leeman wrote: > If we let p=10*x^2+17*x+3, Maxima properly computes > factor(p)=(2*x+3)*(5*x+1). Its algorithm can be interpreted as finding > factorizations if the field of rational numbers (by Gauss' lemma it suffices > to find factorizations over the integers). However, in the field > Q(sqrt(2)), i.e. all numbers of the form r1+r2*sqrt(2), where r1 and r2 are > rational, another factorization is possible, e.g. > p=(-2+2*sqrt(2))*x-3+3*sqrt(2))*((5+5*sqrt(2))*x+1+sqrt(2)). Is it possible > to get Maxima to find such factorizations? One could do so manually for a > fixed entension field by setting up a set of simultaneous equations to be > solved, but I wonder if there is a quicker, more elegant approach, in which > Maxima even discovers the right extension field. > Thanks, George Leeman > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Sent from Gmail for mobile | mobile.google.com From macrakis at alum.mit.edu Sun Jan 20 14:48:33 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 20 Jan 2008 15:48:33 -0500 Subject: [Maxima] Factorization in extension fields In-Reply-To: <000601c85b68$0c3d9cf0$6401a8c0@Dimension8400> References: <000601c85b68$0c3d9cf0$6401a8c0@Dimension8400> Message-ID: <8b356f880801201248k5e1da09elb9c6aad52b7a0117@mail.gmail.com> On Jan 20, 2008 8:26 AM, George Leeman wrote: > If we let p=10*x^2+17*x+3, Maxima properly computes > factor(p)=(2*x+3)*(5*x+1).... > ...However, in the field Q(sqrt(2)), i.e. all numbers of the form > r1+r2*sqrt(2), where r1 and r2 are > rational, another factorization is possible, e.g. > p=(-2+2*sqrt(2))*x-3+3*sqrt(2))*((5+5*sqrt(2))*x+1+sqrt(2)). Is it possible > to get Maxima to find such factorizations? Sorry, I didn't read your original email thoroughly enough. The factorization you give, ((-2+2*sqrt(2))*x-3+3*sqrt(2))*((5+5*sqrt(2))*x+1+sqrt(2)); is simply r*(2*x+3)*s*(5*x+1), where r=sqrt(2)-1 and s=sqrt(2)+1; r*s=1. This is not a distinct factorization, any more than (2*x+2)*(x-1) and (x+2)*(2*x-2) are distinct factorizations of 2*x^2-2. As for the general question, if you have a polynomial irreducible over the integers, you can always express its roots in terms of one of its roots e.g .: factor( x^5-x-1, q^5-q-1 ) => (x-q)*(x^4+q*x^3+q^2*x^2+q^3*x+q^4-1) or factor(x^8+1,q^8+1) => (x-q)*(x+q)*(x-q^3)*(x+q^3)*(x-q^5)*(x+q^5)*(x-q^7)*(x+q^7) -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080120/7e68d0eb/attachment.htm From josie.huddleston at durham.ac.uk Mon Jan 21 10:20:20 2008 From: josie.huddleston at durham.ac.uk (josie.huddleston at durham.ac.uk) Date: Mon, 21 Jan 2008 16:20:20 +0000 Subject: [Maxima] Request for itensor's symtry.lisp In-Reply-To: <1198370121.476dad4922e5d@webmailimpa.dur.ac.uk> References: <1198370121.476dad4922e5d@webmailimpa.dur.ac.uk> Message-ID: <1200932420.4794c644cab6e@webmailimpa.dur.ac.uk> Hiya - I've been working on a program with itensor using my own indices that are specified to have certain properties outside the scope of itensor. My problem is that when using canform to simplify using tensor symmetries, any internal indices are automatically turned into normal itensor dummies, thus losing all the properties I've set for them. So I was wondering if the symmetry workings of canform (and particularly internal function canprod, which I think is where the trouble lies) could be separated from the renaming features somehow, so that one could be called without the other? Or if they can't, perhaps a new optional argument to canform that would suppress renaming tendencies...? If this modification isn't wanted for the released version, could I at least have a hint of what'll need changing to create my own version of canform for my program? Thanks, Josie From jan.bessai at tu-dortmund.de Sun Jan 20 11:17:05 2008 From: jan.bessai at tu-dortmund.de (Jan Bessai) Date: Sun, 20 Jan 2008 18:17:05 +0100 Subject: [Maxima] Feature request: cosh(asinh(x)) = sqrt(x^2+1) Message-ID: <47938211.2080208@tu-dortmund.de> Hi, Maxima is able to differentiate asinh(x) correctly, but does not know the equation cosh(asinh(x)) = sqrt(x^2 + 1) (at least not in 5.13.0) which is usually needed to do that. Could you add it, please? Thanks, Jan cosh(asinh(x)) = sqrt(1 - sinh?(asinh(x))) = sqrt(1 - x?) From vttoth at vttoth.com Mon Jan 21 17:48:35 2008 From: vttoth at vttoth.com (Viktor T. Toth) Date: Mon, 21 Jan 2008 18:48:35 -0500 Subject: [Maxima] Request for itensor's symtry.lisp In-Reply-To: <1200932420.4794c644cab6e@webmailimpa.dur.ac.uk> References: <1198370121.476dad4922e5d@webmailimpa.dur.ac.uk> <1200932420.4794c644cab6e@webmailimpa.dur.ac.uk> Message-ID: <003401c85c88$2300ecf0$03fca6c7@VTTOTH.COM> Dear Josie, I fear that what you're asking for would be very difficult to implement (to say the least); for canform, the renaming of indices is an essential part of the simplification process, as this is how canform creates a "normalized" version of tensor (sub)expressions before elimination. Without renaming, canform would become essentially worthless. By way of one particular example, suppose we have a sum of two subexpressions, one using i the other using j as dummy indices, for which we set properties. Suppose that canform recognizes that after renaming/rearranging, the two subexpressions are really the same, and can be combined into one. Which name should it then use for the dummy index, i or j? If it preserves both, it cannot do the simplification, since the two subexpressions remain different, defeating the basic idea behind bringing tensors to CANonical FORM for simplification. Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of josie.huddleston at durham.ac.uk Sent: Monday, January 21, 2008 11:20 AM To: maxima at math.utexas.edu Subject: [Maxima] Request for itensor's symtry.lisp Hiya - I've been working on a program with itensor using my own indices that are specified to have certain properties outside the scope of itensor. My problem is that when using canform to simplify using tensor symmetries, any internal indices are automatically turned into normal itensor dummies, thus losing all the properties I've set for them. So I was wondering if the symmetry workings of canform (and particularly internal function canprod, which I think is where the trouble lies) could be separated from the renaming features somehow, so that one could be called without the other? Or if they can't, perhaps a new optional argument to canform that would suppress renaming tendencies...? If this modification isn't wanted for the released version, could I at least have a hint of what'll need changing to create my own version of canform for my program? Thanks, Josie _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From willisb at unk.edu Mon Jan 21 18:26:57 2008 From: willisb at unk.edu (Barton Willis) Date: Mon, 21 Jan 2008 18:26:57 -0600 Subject: [Maxima] Feature request: cosh(asinh(x)) = sqrt(x^2+1) In-Reply-To: <47938211.2080208@tu-dortmund.de> References: <47938211.2080208@tu-dortmund.de> Message-ID: Maybe you can do want you need with tellsimpafter: (%i1) matchdeclare(x,true)$ (%i2) tellsimpafter(cosh(asinh(x)) , sqrt(x^2 + 1)); (%o2) [coshrule1,simp-%cosh] (%i3) cosh(asinh(a)); (%o3) sqrt(a^2+1) Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: maxima at math.utexas.edu >From: Jan Bessai >Sent by: maxima-bounces at math.utexas.edu >Date: 01/20/2008 11:17AM >Subject: [Maxima] Feature request: cosh(asinh(x)) = sqrt(x^2+1) > >Hi, >Maxima is able to differentiate asinh(x) correctly, but does not know >the equation cosh(asinh(x)) = sqrt(x^2 + 1) (at least not in 5.13.0) >which is usually needed to do that. >Could you add it, please? >Thanks, > Jan > >cosh(asinh(x)) = sqrt(1 - sinh?(asinh(x))) = sqrt(1 - x?) >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Mon Jan 21 18:58:01 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 21 Jan 2008 17:58:01 -0700 Subject: [Maxima] Feature request: cosh(asinh(x)) = sqrt(x^2+1) In-Reply-To: <47938211.2080208@tu-dortmund.de> References: <47938211.2080208@tu-dortmund.de> Message-ID: On 1/20/08, Jan Bessai wrote: > Maxima is able to differentiate asinh(x) correctly, but does not know > the equation cosh(asinh(x)) = sqrt(x^2 + 1) (at least not in 5.13.0) > which is usually needed to do that. tellsimpafter as mentioned by Barton is one way to implement that Identity. Here is another way. matchdeclare(x,true)$ defrule (r1, cosh(asinh(x)) , sqrt(x^2 + 1)); Now the rule r1 is applied only when specifically requested (while tellsimp / tellsimpafter rules are always applied). 1/(1+cosh(asinh(1-u))); => 1/(1+cosh(asinh(1-u))); apply1 (%, r1); => 1/(sqrt((u-1)^2+1)+1) If you have a collection of identities r1, r2, r3, ... you could make up a function to apply all of them, e.g. simplify_hyperbolic_fcns (expr) := apply1 (expr, r1, r2, r3, ...) Note the function to apply rules is named apply1. There is also a function "apply" which is different. Hope this helps, Robert From macrakis at alum.mit.edu Mon Jan 21 19:05:06 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 21 Jan 2008 20:05:06 -0500 Subject: [Maxima] Feature request: cosh(asinh(x)) = sqrt(x^2+1) In-Reply-To: <47938211.2080208@tu-dortmund.de> References: <47938211.2080208@tu-dortmund.de> Message-ID: <8b356f880801211705x55e72b85oab2b85fcb1a2be66@mail.gmail.com> On Jan 20, 2008 12:17 PM, Jan Bessai wrote: > Maxima is able to differentiate asinh(x) correctly, but does not know > the equation cosh(asinh(x)) = sqrt(x^2 + 1) (at least not in 5.13.0) > which is usually needed to do that. Try: ex: cosh(asinh(x)); ex,exponentialize,logarc => (1/(sqrt(x^2+1)+x)+sqrt(x^2+1)+x)/2 ratsimp(%),algebraic => sqrt(x^2+1) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080121/e039d281/attachment.htm From jordigh at gmail.com Mon Jan 21 22:04:25 2008 From: jordigh at gmail.com (=?ISO-8859-1?Q?Jordi_Guti=E9rrez_Hermoso?=) Date: Mon, 21 Jan 2008 22:04:25 -0600 Subject: [Maxima] Finding roots of sextic in radicals Message-ID: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> If my calculations are correct, the roots of x^6 + 3*x^5 + 6*x^4 + 3*x^3 + 9*x +9 should all be expressible by radicals. In fact, they are all polynomials in terms of 2^(1/3) and a cube root of unity. How can I make Maxima tell me what the roots actually are? - Jordi G. H. From blindstein at gmail.com Mon Jan 21 22:46:52 2008 From: blindstein at gmail.com (Justin Harford) Date: Mon, 21 Jan 2008 20:46:52 -0800 Subject: [Maxima] showing decimals of irrational numbers and irregular fractions Message-ID: Hello When I type something like sqrt(2) or 3/2 maxima shows it exactly as I wrote it. Is there a way I can make it show the results in decimal form? Regards Justin Harford A man's memory is bound to be a distortion of his past in accordance with his present interests, and the most faithful autobiography is likely to mirror less what a man was than what he has become. Fawn M. Brodie From al at beshenov.ru Tue Jan 22 04:10:58 2008 From: al at beshenov.ru (Alexey Beshenov) Date: Tue, 22 Jan 2008 13:10:58 +0300 Subject: [Maxima] showing decimals of irrational numbers and irregular fractions In-Reply-To: References: Message-ID: <200801221311.07435@beshenov> On Tuesday 22 January 2008 07:46, Justin Harford wrote: > When I type something like > sqrt(2) > or > 3/2 > maxima shows it exactly as I wrote it. Is there a way I can make it > show the results in decimal form? float/bfloat? (%i1) sqrt(2); (%o1) sqrt(2) (%i2) float(%o1); (%o2) 1.414213562373095 -- Alexey Beshenov http://beshenov.ru/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080122/adb251a8/attachment.pgp From al at beshenov.ru Tue Jan 22 04:31:51 2008 From: al at beshenov.ru (Alexey Beshenov) Date: Tue, 22 Jan 2008 13:31:51 +0300 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> Message-ID: <200801221332.01440@beshenov> On Tuesday 22 January 2008 07:04, Jordi Guti?rrez Hermoso wrote: > If my calculations are correct, the roots of x^6 + 3*x^5 + 6*x^4 + > 3*x^3 + 9*x + 9 should all be expressible by radicals. In fact, they > are all polynomials in terms of 2^(1/3) and a cube root of unity. > > How can I make Maxima tell me what the roots actually are? There's no general solution in radicals to polynomial equations of degree 5 or higher, so it seems that you should use numerical methods: (%i1) allroots (x^6 + 3*x^5 + 6*x^4 + 3*x^3 + 9*x +9); (%o1) [x = 0.86602540378444 %i + 0.75992104989487, x = 0.75992104989487 - 0.86602540378444 %i, x = 0.22509823218729 %i - 1.129960524947437, x = - 0.22509823218729 %i - 1.129960524947437, x = 1.95714903975616 %i - 1.129960524947437, x = - 1.95714903975616 %i - 1.129960524947437] -- Alexey Beshenov http://beshenov.ru/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080122/3f0c63ec/attachment.pgp From sen1 at math.msu.edu Tue Jan 22 06:38:52 2008 From: sen1 at math.msu.edu (S. Newhouse) Date: Tue, 22 Jan 2008 07:38:52 -0500 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> Message-ID: <4795E3DC.1060105@math.msu.edu> Jordi Guti?rrez Hermoso wrote: > If my calculations are correct, the roots of x^6 + 3*x^5 + 6*x^4 + > 3*x^3 + 9*x +9 should all be expressible by radicals. In fact, they > are all polynomials in terms of 2^(1/3) and a cube root of unity. > > How can I make Maxima tell me what the roots actually are? > > - Jordi G. H. > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > Using the fact that the roots are polynomials in 2^(1/3), the following commands makes the list sol_list of roots. The list sol_test tests that they are indeed the roots. p:x^6+3*x^5+6*x^4+3*x^3+9*x+9; p(i):=part(factor(p,q^3-2),i); p(i):=part(factor(p,q^3-2),i); s(i):= solve(subst(q=2^(1/3),p(i)),x); r(i,j):= part(s(i),j,2); sol_list: [r(1,1),r(1,2),r(2,1),r(2,2), r(3,1),r(3,2)]; test(i,j):= ratsimp(ev(subst(x = r(i,j),p))); sol_test: [test(1,1),test(1,2),test(2,1),test(2,2),test(3,1),test(3,2)]; -sen From george.leeman at sbcglobal.net Tue Jan 22 08:21:06 2008 From: george.leeman at sbcglobal.net (George Leeman) Date: Tue, 22 Jan 2008 09:21:06 -0500 Subject: [Maxima] showing decimals of irrational numbers and irregularfractions Message-ID: <000301c85d02$0767cca0$6401a8c0@Dimension8400> > When I type something like > sqrt(2) > or > 3/2 > maxima shows it exactly as I wrote it. Is there a way I can make it > show the results in decimal form? > Regards > Justin Harford Justin, sqrt(2), numer; 3/2, numer; should do what you want. George Leeman From ldevlaming at geomatrix.com Tue Jan 22 08:43:01 2008 From: ldevlaming at geomatrix.com (Len de Vlaming) Date: Tue, 22 Jan 2008 06:43:01 -0800 Subject: [Maxima] Maxima Digest, Vol 18, Issue 34 In-Reply-To: Message-ID: <57F450F4E0A70C44B805FFE9AF0C5432FFC4C6@gmxmail1.geomatrix.com> > float/bfloat? > (%i1) sqrt(2); > (%o1) sqrt(2) > (%i2) float(%o1); > (%o2) 1.414213562373095 Okay, I'll jump in and show my ignorance to the world. Can someone please explain (using small words) to this non-mathematician what the distinction is between floats and bigfloats, and why one would select one over the other? I've pored over the documentation but have not been able to divine an answer simple enough for me to grasp. Thanks Len de Vlaming Engineer-playing-in-the-maxima-sandbox -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080122/9355a4f2/attachment.htm From al at beshenov.ru Tue Jan 22 09:02:43 2008 From: al at beshenov.ru (Alexey Beshenov) Date: Tue, 22 Jan 2008 18:02:43 +0300 Subject: [Maxima] Maxima Digest, Vol 18, Issue 34 In-Reply-To: <57F450F4E0A70C44B805FFE9AF0C5432FFC4C6@gmxmail1.geomatrix.com> References: <57F450F4E0A70C44B805FFE9AF0C5432FFC4C6@gmxmail1.geomatrix.com> Message-ID: <200801221802.55300@beshenov> On Tuesday 22 January 2008 17:43, Len de Vlaming wrote: > > float/bfloat? > > > > (%i1) sqrt(2); > > (%o1) sqrt(2) > > (%i2) float(%o1); > > (%o2) 1.414213562373095 > > Okay, I'll jump in and show my ignorance to the world. Can someone > please explain (using small words) to this non-mathematician what the > distinction is between floats and bigfloats, and why one would select > one over the other? I've pored over the documentation but have not been > able to divine an answer simple enough for me to grasp. bfloat is an arbitrary precision type with fpprec significant digits: (%i1) float(%pi); (%o1) 3.141592653589793 (%i2) bfloat(%pi); (%o2) 3.141592653589793b0 (%i3) fpprec : 100; (%o3) 100 (%i4) float(%pi); (%o4) 3.141592653589793 (%i5) bfloat(%pi); (%o5) 3.1415926535897932384626433832795028841971693993751058209749445923078164\ 06286208998628034825342117068b0 See the Maxima Manual, section 10 ("Floating Point"). -- Alexey Beshenov http://beshenov.ru/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080122/c8e743f5/attachment.pgp From raymond.toy at ericsson.com Tue Jan 22 09:08:09 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 22 Jan 2008 10:08:09 -0500 Subject: [Maxima] Feature request: cosh(asinh(x)) = sqrt(x^2+1) In-Reply-To: References: <47938211.2080208@tu-dortmund.de> Message-ID: <479606D9.80009@ericsson.com> Robert Dodier wrote: > On 1/20/08, Jan Bessai wrote: > >> Maxima is able to differentiate asinh(x) correctly, but does not know >> the equation cosh(asinh(x)) = sqrt(x^2 + 1) (at least not in 5.13.0) >> which is usually needed to do that. > > tellsimpafter as mentioned by Barton is one way to implement that Identity. > Here is another way. This begs the question: Should maxima already know this and if so, how should it be done? I think it would be easy to add this rule in trigo.lisp, but is that the right thing to do? Ray From macrakis at alum.mit.edu Tue Jan 22 09:54:28 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 22 Jan 2008 10:54:28 -0500 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <4795E3DC.1060105@math.msu.edu> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <4795E3DC.1060105@math.msu.edu> Message-ID: <8b356f880801220754s7bbef158yc6ffdf5c801a0dc9@mail.gmail.com> On Jan 22, 2008 7:38 AM, S. Newhouse wrote: > Jordi Guti?rrez Hermoso wrote: > ...the roots of x^6 + 3*x^5 + 6*x^4 + 3*x^3 + 9*x +9 should all be > expressible by radicals.... > > > Using the fact that the roots are polynomials in 2^(1/3), the following > commands makes the list sol_list of roots. > Nice solution! Maxima actually lets you do this even more simply: p: x^6+3*x^5+6*x^4+3*x^3+9*x+9; p2: factor(p,q^3-2)$ solve(subst(q=2^(1/3),p2),x); -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080122/c3156ba9/attachment.htm From macrakis at alum.mit.edu Tue Jan 22 10:06:03 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 22 Jan 2008 11:06:03 -0500 Subject: [Maxima] showing decimals of irrational numbers and irregular fractions In-Reply-To: References: Message-ID: <8b356f880801220806h17b8ce2dq4de3264f03d59e2c@mail.gmail.com> On Jan 21, 2008 11:46 PM, Justin Harford wrote: > When I type something like > sqrt(2) > or > 3/2 > maxima shows it exactly as I wrote it. Is there a way I can make it > show the results in decimal form? > Yes, use float(...) or ev(...,numer). Maxima doesn't do this by default because Maxima keeps everything in *exact* form until you tell it you want an approximate numeric computation. This permits its results to be more accurate: (float(sqrt(2)))^2-2 => 4.4408920985006262E-16 approximate answer sqrt(2)^2-2 => 0 exact answer sin(10^100*%pi) => 0 exact answer sin(float(10^100*%pi)) => -0.2538 approximate answer Most computer programs use the floating-point approximation, which makes them faster than Maxima for numerical computations, but less accurate. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080122/23bad79c/attachment.htm From macrakis at alum.mit.edu Tue Jan 22 10:16:01 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 22 Jan 2008 11:16:01 -0500 Subject: [Maxima] Feature request: cosh(asinh(x)) = sqrt(x^2+1) In-Reply-To: <479606D9.80009@ericsson.com> References: <47938211.2080208@tu-dortmund.de> <479606D9.80009@ericsson.com> Message-ID: <8b356f880801220816h6f06d321mc95fe2568afbc5a@mail.gmail.com> On Jan 22, 2008 10:08 AM, Raymond Toy (RT/EUS) wrote: > >> cosh(asinh(x)) = sqrt(x^2 + 1) > > Should maxima already know this and if so, how > should it be done? I think it would be easy to add this rule in > trigo.lisp, but is that the right thing to do? > Sure, why not? And the simplification should respect triginverses. I'm assuming no one wants the written-out forms of asinh(cosh(x)), atan(sinh(x)), etc. to be built-in, though. They are rather messy and you might as well use logarc/exponentialize. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080122/2dc3d556/attachment.htm From raymond.toy at ericsson.com Tue Jan 22 11:29:30 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 22 Jan 2008 12:29:30 -0500 Subject: [Maxima] Feature request: cosh(asinh(x)) = sqrt(x^2+1) In-Reply-To: <8b356f880801220816h6f06d321mc95fe2568afbc5a@mail.gmail.com> References: <47938211.2080208@tu-dortmund.de> <479606D9.80009@ericsson.com> <8b356f880801220816h6f06d321mc95fe2568afbc5a@mail.gmail.com> Message-ID: <479627FA.6050000@ericsson.com> Stavros Macrakis wrote: > On Jan 22, 2008 10:08 AM, Raymond Toy (RT/EUS) > wrote: > > >> cosh(asinh(x)) = sqrt(x^2 + 1) > > > > Should maxima already know this and if so, how > should it be done? I think it would be easy to add this rule in > trigo.lisp, but is that the right thing to do? > > > Sure, why not? And the simplification should respect triginverses. I'm Mostly because rules are relatively simple to explain to people. But I know lisp better than maxima, so for me, changing trigo is easier. :-) > assuming no one wants the written-out forms of asinh(cosh(x)), > atan(sinh(x)), etc. to be built-in, though. They are rather messy and > you might as well use logarc/exponentialize. I was only thinking about cosh(asinh(x)) and sinh(acosh(x)). Maybe a few others. I'm not sure that sinh(acosh(x)) has the right branch cuts. When I apply exponentialize, logarc, and ratsimp, I get sqrt(x-1)*sqrt(x+1). I'll have to think about whether this result is correct.... Ray From biomates at telefonica.net Tue Jan 22 14:47:13 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Tue, 22 Jan 2008 21:47:13 +0100 Subject: [Maxima] showing decimals of irrational numbers and irregularfractions In-Reply-To: <000301c85d02$0767cca0$6401a8c0@Dimension8400> References: <000301c85d02$0767cca0$6401a8c0@Dimension8400> Message-ID: <47965651.90401@telefonica.net> George Leeman escribi?: >> When I type something like >> sqrt(2) >> or >> 3/2 >> maxima shows it exactly as I wrote it. Is there a way I can make it >> show the results in decimal form? >> Regards >> Justin Harford >> > > Justin, > sqrt(2), numer; > 3/2, numer; > should do what you want. or... (%i1) numer:true$ (%i2) sqrt(2); (%o2) 1.414213562373095 (%i3) 3/2; (%o3) 1.5 (%i4) numer:false$ /* restore default value */ (%i5) sqrt(2); (%o5) sqrt(2) (%i6) 3/2; 3 (%o6) - 2 -- Mario Rodriguez Riotorto www.biomates.net From dlakelan at street-artists.org Tue Jan 22 18:41:46 2008 From: dlakelan at street-artists.org (dlakelan) Date: Tue, 22 Jan 2008 16:41:46 -0800 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> Message-ID: <47968D4A.6090307@street-artists.org> Jordi Guti?rrez Hermoso wrote: > If my calculations are correct, the roots of x^6 + 3*x^5 + 6*x^4 + > 3*x^3 + 9*x +9 should all be expressible by radicals. In fact, they > are all polynomials in terms of 2^(1/3) and a cube root of unity. > > How can I make Maxima tell me what the roots actually are? I'm not sure how to get maxima to find the symbolic expressions for the roots, but as a first step, you can try 'allroots' which gives numerical approximations. hope that helps, Dan From josie.huddleston at durham.ac.uk Wed Jan 23 06:21:48 2008 From: josie.huddleston at durham.ac.uk (josie.huddleston at durham.ac.uk) Date: Wed, 23 Jan 2008 12:21:48 +0000 Subject: [Maxima] Request for itensor's symtry.lisp Message-ID: <1201090908.4797315c2e610@webmailimpa.dur.ac.uk> I suppose what I'm trying to do is rather different from what canform actually does (so yes, I guess perhaps it wouldn't be that useful a feature to add in to canform itself, since if the option was turned on then it wouldn't actually be bringing things into canonical form!). Basically I just want indices sorted within individual tensors (I have special routines for renaming already), and it struck me that this is half of what canform does. I'm currently having a play around with the LISP code in canform, canten and canprod (while having to teach myself a lot of the language at the same time!) to create functions for my program to use - by basically just getting rid of the calls to repeat1. Can you think of any cases where the functions would produce non-equivalent tensor expressions if repeat1 isn't called? Unless there's a better way to do this sorting quickly if it isn't tied in with renaming...? Josie Quoting "Viktor T. Toth" : > > Dear Josie, > > I fear that what you're asking for would be very difficult to implement (to > say the least); for canform, the renaming of indices is an essential part of > the simplification process, as this is how canform creates a "normalized" > version of tensor (sub)expressions before elimination. Without renaming, > canform would become essentially worthless. > > By way of one particular example, suppose we have a sum of two > subexpressions, one using i the other using j as dummy indices, for which we > set properties. Suppose that canform recognizes that after > renaming/rearranging, the two subexpressions are really the same, and can be > combined into one. Which name should it then use for the dummy index, i or > j? If it preserves both, it cannot do the simplification, since the two > subexpressions remain different, defeating the basic idea behind bringing > tensors to CANonical FORM for simplification. > > > Viktor > > > > From macrakis at alum.mit.edu Wed Jan 23 09:00:51 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 23 Jan 2008 10:00:51 -0500 Subject: [Maxima] expand in ev Message-ID: <8b356f880801230700t57ce1dfbm34fb7444946ae451@mail.gmail.com> Currently, ev(...,expand) is equivalent to ev(...,expop:maxposex,expon:maxnegex). This means that expansion is active throughout the evaluation of ..., which sometimes gives surprising results: ex:(x+1)^2*(x-1)^2; part(ex,1),expand => x^4 equivalent to part(ex,1),expop:maxposex,expon:maxnegex equivalent in effect to part(expand(ex),1) cf. part(ex,1),ratsimp => x^2-2*x+1 equivalent to ratsimp(part(ex,1)) I think it would be more consistent and thus easier to understand if expand worked like every other command in ev, namely that it called the command *after* evaluating the expression. EV would remain weird and confusing in other ways, but at least this would be simpler.... -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080123/da68deae/attachment.htm From jordigh at gmail.com Wed Jan 23 12:15:51 2008 From: jordigh at gmail.com (=?ISO-8859-1?Q?Jordi_Guti=E9rrez_Hermoso?=) Date: Wed, 23 Jan 2008 12:15:51 -0600 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <8b356f880801220754s7bbef158yc6ffdf5c801a0dc9@mail.gmail.com> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <4795E3DC.1060105@math.msu.edu> <8b356f880801220754s7bbef158yc6ffdf5c801a0dc9@mail.gmail.com> Message-ID: <9543b3a40801231015n748ffcd6mfe5530058683d28@mail.gmail.com> On 22/01/2008, Stavros Macrakis wrote: > p: x^6+3*x^5+6*x^4+3*x^3+9*x+9; > p2: factor(p,q^3-2)$ > solve(subst(q=2^(1/3),p2),x); Sweet, I didn't know you could give hints to the factor function. Good to know. As for those of you who offered numerical solutions, yes, there is no general formula for a quintic or higher, but this wasn't a general polynomial, but a very specific one. It's the minimal polynomial for 2^(1/3) + exp(2*%pi*%i/3) over the rationals. :-) Thank you for your help, - Jordi G. H. From willisb at unk.edu Wed Jan 23 12:24:51 2008 From: willisb at unk.edu (Barton Willis) Date: Wed, 23 Jan 2008 12:24:51 -0600 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <9543b3a40801231015n748ffcd6mfe5530058683d28@mail.gmail.com> Message-ID: A to_poly amusement: (%i118) x=-(2^(1/3)*(sqrt(3)*%i+1)+sqrt(3)*%i+1)/2; (%o118) x=(-2^(1/3)*(sqrt(3)*%i+1)-sqrt(3)*%i-1)/2 (%i119) to_poly(%); (%o119) [[x-(-(%i*%g33+1)*%g34-%i*%g33-1)/2,2=%g34^3,3=%g33^2],[-%pi/3 On 22/01/2008, Stavros Macrakis wrote: > > p: x^6+3*x^5+6*x^4+3*x^3+9*x+9; > > p2: factor(p,q^3-2)$ > > solve(subst(q=2^(1/3),p2),x); > > Sweet, I didn't know you could give hints to the factor function. > Good to know. > > As for those of you who offered numerical solutions, yes, there is no > general formula for a quintic or higher, but this wasn't a general > polynomial, but a very specific one. It's the minimal polynomial for > 2^(1/3) + exp(2*%pi*%i/3) over the rationals. :-) > > Thank you for your help, > - Jordi G. H. > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080123/c40bed41/attachment.htm From robert.dodier at gmail.com Wed Jan 23 19:10:58 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 23 Jan 2008 18:10:58 -0700 Subject: [Maxima] expand in ev In-Reply-To: <8b356f880801230700t57ce1dfbm34fb7444946ae451@mail.gmail.com> References: <8b356f880801230700t57ce1dfbm34fb7444946ae451@mail.gmail.com> Message-ID: On Jan 23, 2008 8:00 AM, Stavros Macrakis wrote: > I think it would be more consistent and thus easier to understand if expand > worked like every other command in ev, namely that it called the command > *after* evaluating the expression. OK by me. > EV would remain weird and confusing in other ways, but at least this would > be simpler.... We could probably cut out some more of the nuttiness in ev -- I doubt if all of the obscure options are being used. Robert From rupert.swarbrick at lineone.net Wed Jan 23 20:15:41 2008 From: rupert.swarbrick at lineone.net (Rupert Swarbrick) Date: Thu, 24 Jan 2008 02:15:41 +0000 Subject: [Maxima] simp.lisp Message-ID: <20080124021541.1e155acf@herring> Hi, Firstly I need to apologise to Robert Dodier, whose email I forgot to reply to: and then it was a couple of days ago. However, I decided that I really needed to understand Maxima's simplification routines better, so I've been slowly working my way down simp.lisp. To ensure I read and understand, I've been writing documentation strings for the functions as I go, along with reindenting them for readability. I'm on plusin at the moment - the going's slow! But it's interesting. I've got a couple of general questions (actually, now I've written stuff, it's a question and some remarks): 1) When I finally reach the bottom, would there be interest in uploading the docced file to cvs? I'm being really careful not to add/change code, so the only change to the sexps is a string at the start of each defun. Thus although it would be an enormous patch/change (think every line of code), there would actually be no change to the program, just the addition of docs! 2) There are lots of smallish utility functions in simp.lisp, in particular predicates like mplusp and the like. As a general comment, I think it might be nice to group up, say, predicates in a file of their own for reuse - I'm sure we'd find the same code with different names in different parts of the tree. 3) Some of this code involves lots of copy-paste - in particular the predicates like ratnump and mplusp, which just check (caar x) - I think this stuff would be quite amenable to "macroization", which would mean other tests on the caar could be performed trivially. 4) Goto! Aargh! I never realised _how_ incredibly difficult it is to understand code with gotos - for example uses them heavily. Although I understand the code is working currently, I think it's worth going through this sort of thing and tidying it - after all, if I found a bug somewhere in the middle of simp.lisp: in plusin, say, I'd just groan and try to ignore it: the code's just so complicated that it's incredibly hard to keep in one's head at once (unless this is just me being rubbish!) 5) (ahah there was another question) Can anyone explain the idiom of writing a defun containing just a ((lambda (x) ....) nil)) as in eqtest? Is it just a way of doing let for ancient lisp interpreters that didn't have it? That was quite a long post... Anyway, I'm intending to carry on cranking through simp.lisp because I?want to understand it, but I was wondering if anyone would be interested in the results! Rupert From David.Billinghurst at riotinto.com Wed Jan 23 20:23:07 2008 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Thu, 24 Jan 2008 13:23:07 +1100 Subject: [Maxima] simp.lisp References: <20080124021541.1e155acf@herring> Message-ID: <026DCC31AB859648A6F16C0E5CD2580D012A809C@calttsv025.cal.riotinto.org> > From: Rupert Swarbrick > 2) There are lots of smallish utility functions in simp.lisp, in > particular predicates like mplusp and the like. As a general comment, I > think it might be nice to group up, say, predicates in a file of their > own for reuse - I'm sure we'd find the same code with different names > in different parts of the tree. I would find this useful. There is significant duplication. David NOTICE This e-mail and any attachments are private and confidential and may contain privileged information. If you are not an authorised recipient, the copying or distribution of this e-mail and any attachments is prohibited and you must not read, print or act in reliance on this e-mail or attachments. This notice should not be removed. From toy.raymond at gmail.com Wed Jan 23 20:40:00 2008 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 23 Jan 2008 21:40:00 -0500 Subject: [Maxima] simp.lisp In-Reply-To: <20080124021541.1e155acf@herring> References: <20080124021541.1e155acf@herring> Message-ID: <4797FA80.40009@gmail.com> Rupert Swarbrick wrote: > 1) When I finally reach the bottom, would there be interest in > uploading the docced file to cvs? I'm being really careful not to > add/change code, so the only change to the sexps is a string at the > start of each defun. Thus although it would be an enormous patch/change > (think every line of code), there would actually be no change to the > program, just the addition of docs! > Very much so! I wish more people would do that when they fix a bug in some hairy piece of code. (I'm guilty of that.) > 2) There are lots of smallish utility functions in simp.lisp, in > particular predicates like mplusp and the like. As a general comment, I > think it might be nice to group up, say, predicates in a file of their > own for reuse - I'm sure we'd find the same code with different names > in different parts of the tree. > I think there's lots of little bits of code that are like that. Some even have the same names but slightly different bodies. Combining them into one would be good, if someone really understand the differences. This is probably historical baggage. Someone added something but didn't know about an equivalent function somewhere else. > 4) Goto! Aargh! I never realised _how_ incredibly difficult it is to > understand code with gotos - for example uses them heavily. Although I > understand the code is working currently, I think it's worth going > through this sort of thing and tidying it - after all, if I found a bug > somewhere in the middle of simp.lisp: in plusin, say, I'd just groan > and try to ignore it: the code's just so complicated that it's > incredibly hard to keep in one's head at once (unless this is just me > being rubbish!) > I think it's a good idea, but needs to be done with extreme caution. I've made "trivial" changes that were actually wrong, but weren't covered by the testsuite. > 5) (ahah there was another question) Can anyone explain the idiom of > writing a defun containing just a ((lambda (x) ....) nil)) as in > eqtest? Is it just a way of doing let for ancient lisp interpreters > that didn't have it? > It's from old Lisp implementations. Richard Fateman, I think, explained this somewhere. I know Andreas has been fixing them here and there. Ray From robert.dodier at gmail.com Thu Jan 24 00:02:04 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 23 Jan 2008 23:02:04 -0700 Subject: [Maxima] simp.lisp In-Reply-To: <20080124021541.1e155acf@herring> References: <20080124021541.1e155acf@herring> Message-ID: On 1/23/08, Rupert Swarbrick wrote: > Firstly I need to apologise to Robert Dodier, whose email I forgot to > reply to: and then it was a couple of days ago. Hi Rupert, no need for apologies. Things happen when people have time for them. > 1) When I finally reach the bottom, would there be interest in > uploading the docced file to cvs? I'm being really careful not to > add/change code, so the only change to the sexps is a string at the > start of each defun. Thus although it would be an enormous patch/change > (think every line of code), there would actually be no change to the > program, just the addition of docs! Doc strings and comments sound like a good idea. I'm pretty sure reformatting code is not. Reformatting obscures the history of code and makes it harder to see what substantial changes there have been. > 2) There are lots of smallish utility functions in simp.lisp, in > particular predicates like mplusp and the like. As a general comment, I > think it might be nice to group up, say, predicates in a file of their > own for reuse - I'm sure we'd find the same code with different names > in different parts of the tree. That sounds good ... > 3) Some of this code involves lots of copy-paste - in particular the > predicates like ratnump and mplusp, which just check (caar x) - I think > this stuff would be quite amenable to "macroization", which would mean > other tests on the caar could be performed trivially. I dunno. The presence of macros makes debugging harder, and there is a lot of debugging to be done. I doubt if the greater speed outweighs the debugging problem plus whatever effort has to be invested in recoding stuff. > 4) Goto! Aargh! I never realised _how_ incredibly difficult it is to > understand code with gotos - for example uses them heavily. Although I > understand the code is working currently, I think it's worth going > through this sort of thing and tidying it - after all, if I found a bug > somewhere in the middle of simp.lisp: in plusin, say, I'd just groan > and try to ignore it: the code's just so complicated that it's > incredibly hard to keep in one's head at once (unless this is just me > being rubbish!) Recoding stuff for clarity has to be carried out with great care. I don't know if it's worth the trouble to rework low-level stuff. I think a bigger payoff would come from stepping back and considering the simplification system as a whole. Maxima's simplification stuff has three substantial limitiations: it is not easy to extend with new rules, it is difficult to retract existing rules, and it is extremely difficult to know what are the rules implemented by the existing Lisp code. Making progress on these problems requires understanding the simplification system, but the meaning of specific (FOO (GO FOO)) constructs doesn't really matter. > 5) (ahah there was another question) Can anyone explain the idiom of > writing a defun containing just a ((lambda (x) ....) nil)) as in > eqtest? Is it just a way of doing let for ancient lisp interpreters > that didn't have it? Yes, I'm pretty sure it's a LET-like construct. Thanks a lot for your interest in Maxima! Robert Dodier From macrakis at alum.mit.edu Thu Jan 24 11:03:57 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 24 Jan 2008 12:03:57 -0500 Subject: [Maxima] simp.lisp In-Reply-To: <20080124021541.1e155acf@herring> References: <20080124021541.1e155acf@herring> Message-ID: <8b356f880801240903h459b8498o198073e2920a1aac@mail.gmail.com> On Jan 23, 2008 9:15 PM, Rupert Swarbrick wrote: > However, I decided that I really needed to understand > Maxima's simplification routines better, so I've been slowly working my > way down simp.lisp. To ensure I read and understand, I've been writing > documentation strings for the functions as I go, along with reindenting > them for readability. > Adding documentation to the CVS tree is a good idea as long, of course, as it is correct. Can you tell the cvs diff tool to ignore space? If not, changing indentation makes it hard to compare versions. Then again, even adding end-of-line comments makes comparisons harder. Maybe best to stick to ;; and ;;; comments on separate lines. 2) There are lots of smallish utility functions in simp.lisp, in > particular predicates like mplusp and the like. As a general comment, I > think it might be nice to group up, say, predicates in a file of their > own for reuse - I'm sure we'd find the same code with different names > in different parts of the tree. Yes, there is lots of redundant code. And there are at least four "standard" packages of utility functions: opers/mopers (which I wrote the ancestor of 30+ years ago); mrgmac (Mike Genesereth); rzmac (Rich Zippel); strmac (? most of these aren't used anywhere and include dangerous ops like make-***-simp). Though in theory I like the idea of making everything consistent, again this will cause a lot of code change that doesn't reflect functionality change. If we do this, it should be in one big push on a very well-tested, stable version, not randomly checked in. Also, it should be decided by the group. Your "good taste" may not correspond to others' "good taste". 3) Some of this code involves lots of copy-paste - in particular the > predicates like ratnump and mplusp, which just check (caar x) - I think > this stuff would be quite amenable to "macroization", which would mean > other tests on the caar could be performed trivially. > Let's not worry about microoptimizations like this, though they are tempting. Ideally, we should be able to have the compiler auto-inline when appropriate. (I know, this depends on things like build order.) 4) Goto! Aargh! I never realised _how_ incredibly difficult it is to > understand code with gotos - for example uses them heavily. Although I > understand the code is working currently, I think it's worth going > through this sort of thing and tidying it - after all, if I found a bug > somewhere in the middle of simp.lisp: in plusin, say, I'd just groan > and try to ignore it: the code's just so complicated that it's > incredibly hard to keep in one's head at once (unless this is just me > being rubbish!) The code is hard to understand in many places. This also means that it is hard to rewrite correctly. And again, changing code without changing functionality makes for distracting diffs. The interactions among the simplification routines can be subtle, so something that seems like an improvement may in fact break other things. I'd recommend you take some *specific* bugs that have been documented and fix them as locally as possible (i.e. don't rewrite everything). For example, making sure that 2/sqrt(2) simplifies to sqrt(2) without breaking anything else. 5) (ahah there was another question) Can anyone explain the idiom of > writing a defun containing just a ((lambda (x) ....) nil)) ((lambda (a b c) ...) av bv cv) == (let ((a av) (b bv) (c cv)) ...) Let was introduced into MacLisp sometime in the early 1970's, after a lot of Maxima code had already been written. The semantics are precisely the same; let has the readability advantage of putting the a's close to the av's. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080124/3f2e85f1/attachment-0001.htm From raymond.toy at ericsson.com Thu Jan 24 11:20:22 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Thu, 24 Jan 2008 12:20:22 -0500 Subject: [Maxima] simp.lisp In-Reply-To: <8b356f880801240903h459b8498o198073e2920a1aac@mail.gmail.com> References: <20080124021541.1e155acf@herring> <8b356f880801240903h459b8498o198073e2920a1aac@mail.gmail.com> Message-ID: <4798C8D6.8000203@ericsson.com> Stavros Macrakis wrote: > On Jan 23, 2008 9:15 PM, Rupert Swarbrick 3) Some of this code involves lots of copy-paste - in particular the > predicates like ratnump and mplusp, which just check (caar x) - I think > this stuff would be quite amenable to "macroization", which would mean > other tests on the caar could be performed trivially. > > > Let's not worry about microoptimizations like this, though they are > tempting. Ideally, we should be able to have the compiler auto-inline > when appropriate. (I know, this depends on things like build order.) Hmm. I had assumed he meant to write a macro (or macrolet) to write the various predicates, not to make the various predicates into macros. This would make sense to me. I definitely agree with Stavros' comment about microoptimization, though. Ray From maxima-list at ssteiner.com Thu Jan 24 12:15:37 2008 From: maxima-list at ssteiner.com (maxima-list at ssteiner.com) Date: Thu, 24 Jan 2008 19:15:37 +0100 (MET) Subject: [Maxima] Formatting of a computed result Message-ID: <200801241815.m0OIFbZ4020586@post.webmailer.de> Hi, if I let Maxima solve an equation like "0=3*x^2-4" it returns a result which occupies several lines. Screenshot of an example: http://www.braunsen.net/sst/maximaergebnis.png How to make Maxima output the result (e.g. result of a solve(...)-operation) as a single-line expression like "[x=-2/sqrt(3),x=2/sqrt(3)]"? Many thanks in advance! Sebastian From macrakis at alum.mit.edu Thu Jan 24 13:05:23 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 24 Jan 2008 14:05:23 -0500 Subject: [Maxima] simp.lisp In-Reply-To: <4798C8D6.8000203@ericsson.com> References: <20080124021541.1e155acf@herring> <8b356f880801240903h459b8498o198073e2920a1aac@mail.gmail.com> <4798C8D6.8000203@ericsson.com> Message-ID: <8b356f880801241105g2f27fc7at585269a92606a7a7@mail.gmail.com> > > Hmm. I had assumed he meant to write a macro (or macrolet) to write the > various predicates, not to make the various predicates into macros. > This would make sense to me. > I thought he meant that if they were macros, then common subexpression elimination would avoid redundant caar calculations -- is that right, Rupert? -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080124/66ee296e/attachment.htm From maxima-list at ssteiner.com Thu Jan 24 13:29:55 2008 From: maxima-list at ssteiner.com (maxima-list at ssteiner.com) Date: Thu, 24 Jan 2008 20:29:55 +0100 (MET) Subject: [Maxima] Formatting of a computed result Message-ID: <200801241929.m0OJTtj4008092@post.webmailer.de> Thanks a lot! ----- original message -------- Subject: Re: [Maxima] Formatting of a computed result Sent: Do, 24. Jan 2008 From: Stavros Macrakis To convert to a 1-line string (which you can't compute with): string( ... ); To have Maxima give all its output in linear form: display2d:false$ From fateman at cs.berkeley.edu Thu Jan 24 13:48:02 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Thu, 24 Jan 2008 11:48:02 -0800 Subject: [Maxima] simp.lisp In-Reply-To: <4798C8D6.8000203@ericsson.com> References: <20080124021541.1e155acf@herring> <8b356f880801240903h459b8498o198073e2920a1aac@mail.gmail.com> <4798C8D6.8000203@ericsson.com> Message-ID: <4798EB72.8080204@cs.berkeley.edu> I wonder about changing simp.lisp to allow for structures like CLOS objects. That is ((mplus) obj1 obj2 obj3) could work even if obj1 obj2 and obj3 are (atomic) objects distinguishable not by their CAAR but by their types. This might not be viable and we should think of ((mplus) ((the-type-of-obj1) obj1) ... ((the-type-of-obj2) obj2 ) ....)) thoughts? RJF Raymond Toy (RT/EUS) wrote: > Stavros Macrakis wrote: > >> On Jan 23, 2008 9:15 PM, Rupert Swarbrick > > > >> 3) Some of this code involves lots of copy-paste - in particular the >> predicates like ratnump and mplusp, which just check (caar x) - I think >> this stuff would be quite amenable to "macroization", which would mean >> other tests on the caar could be performed trivially. >> >> >> Let's not worry about microoptimizations like this, though they are >> tempting. Ideally, we should be able to have the compiler auto-inline >> when appropriate. (I know, this depends on things like build order.) >> > > Hmm. I had assumed he meant to write a macro (or macrolet) to write the > various predicates, not to make the various predicates into macros. > This would make sense to me. > > I definitely agree with Stavros' comment about microoptimization, though. > > Ray > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From fateman at cs.berkeley.edu Thu Jan 24 13:50:30 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Thu, 24 Jan 2008 11:50:30 -0800 Subject: [Maxima] simp.lisp In-Reply-To: <8b356f880801240903h459b8498o198073e2920a1aac@mail.gmail.com> References: <20080124021541.1e155acf@herring> <8b356f880801240903h459b8498o198073e2920a1aac@mail.gmail.com> Message-ID: <4798EC06.9040500@cs.berkeley.edu> I suggest that all comments not by the author of a program be SIGNED by the commentor. Maybe even comments by the author should be signed, as well as authorship of programs. Someone reading the source code might think that Bill Schelter wrote the whole thing, rather than transforming it to common lisp, plus adding neat stuff that he DID write.. RJF Stavros Macrakis wrote: > On Jan 23, 2008 9:15 PM, Rupert Swarbrick > > > wrote: > > However, I decided that I really needed to understand > Maxima's simplification routines better, so I've been slowly > working my > way down simp.lisp. To ensure I read and understand, I've been writing > documentation strings for the functions as I go, along with > reindenting > them for readability. > > > Adding documentation to the CVS tree is a good idea as long, of > course, as it is correct. > Can you tell the cvs diff tool to ignore space? If not, changing > indentation makes it hard to compare versions. > Then again, even adding end-of-line comments makes comparisons harder. > Maybe best to stick to ;; and ;;; comments on separate lines. > > 2) There are lots of smallish utility functions in simp.lisp, in > particular predicates like mplusp and the like. As a general > comment, I > think it might be nice to group up, say, predicates in a file of their > own for reuse - I'm sure we'd find the same code with different names > in different parts of the tree. > > > Yes, there is lots of redundant code. And there are at least four > "standard" packages of utility functions: opers/mopers (which I wrote > the ancestor of 30+ years ago); mrgmac (Mike Genesereth); rzmac (Rich > Zippel); strmac (? most of these aren't used anywhere and include > dangerous ops like make-***-simp). > > Though in theory I like the idea of making everything consistent, > again this will cause a lot of code change that doesn't reflect > functionality change. If we do this, it should be in one big push on > a very well-tested, stable version, not randomly checked in. Also, it > should be decided by the group. Your "good taste" may not correspond > to others' "good taste". > > 3) Some of this code involves lots of copy-paste - in particular the > predicates like ratnump and mplusp, which just check (caar x) - I > think > this stuff would be quite amenable to "macroization", which would mean > other tests on the caar could be performed trivially. > > > Let's not worry about microoptimizations like this, though they are > tempting. Ideally, we should be able to have the compiler auto-inline > when appropriate. (I know, this depends on things like build order.) > > 4) Goto! Aargh! I never realised _how_ incredibly difficult it is to > understand code with gotos - for example uses them heavily. > Although I > understand the code is working currently, I think it's worth going > through this sort of thing and tidying it - after all, if I found > a bug > somewhere in the middle of simp.lisp: in plusin, say, I'd just groan > and try to ignore it: the code's just so complicated that it's > incredibly hard to keep in one's head at once (unless this is just me > being rubbish!) > > > The code is hard to understand in many places. This also means that it > is hard to rewrite correctly. And again, changing code without > changing functionality makes for distracting diffs. The interactions > among the simplification routines can be subtle, so something that > seems like an improvement may in fact break other things. > > I'd recommend you take some *specific* bugs that have been documented > and fix them as locally as possible (i.e. don't rewrite everything). > For example, making sure that 2/sqrt(2) simplifies to sqrt(2) without > breaking anything else. > > 5) (ahah there was another question) Can anyone explain the idiom of > writing a defun containing just a ((lambda (x) ....) nil)) > > > ((lambda (a b c) ...) av bv cv) == (let ((a av) (b bv) (c cv)) ...) > > Let was introduced into MacLisp sometime in the early 1970's, after a > lot of Maxima code had already been written. The semantics are > precisely the same; let has the readability advantage of putting the > a's close to the av's. > > -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: http://www.math.utexas.edu/pipermail/maxima/attachments/20080124/3f239945/attachment.htm From jordigh at gmail.com Thu Jan 24 13:53:04 2008 From: jordigh at gmail.com (=?ISO-8859-1?Q?Jordi_Guti=E9rrez_Hermoso?=) Date: Thu, 24 Jan 2008 13:53:04 -0600 Subject: [Maxima] solving sextic by radicals In-Reply-To: <4798E6D3.1060009@skynet.be> References: <4797137C.6090804@skynet.be> <9543b3a40801231033q150bfe27l6a477f9073a308db@mail.gmail.com> <4798E6D3.1060009@skynet.be> Message-ID: <9543b3a40801241153s5c9f1340sae15b3c4f2b0acc7@mail.gmail.com> Let's move the discussion back to the list... On 24/01/2008, Hugo Coolens wrote: > The thing is, I have a whole family of polynomials related to an > electrical network and I'd love to see a general method to solve > them (factorize or determine the roots) starting from the coefficients, > I don't know much about Galois theory but it would be great just to see > it work on an example like I sent you, maybe then I'll get the necessary > insight This doesn't seem like an easy question in general. Of course if you can find enough roots by radicals until your polynomial is of degree 4 or less, then you have found them all. In general, I think we would first need routines for computing Galois groups of polynomials of small degrees. Last time I checked, Maple had routines for computing Galois groups of polynomials of degree up to 9, but I don't know if Maxima has any such thing. Using tricks such as computing discriminants and other assorted methods, it's possible to automate the computation of the Galois group for polynomials. A decomposition series for the Galois group, if it exists (i.e. if it's soluble), can then give a clue on what radicals the solution will be, although I don't have details for this. I would have to grep the literature to see if I can find anything about computer algorithms for solutions by radicals or determine that they're impossible. It's an interesting problem, and I'm sure someone else has already solved it or worked on it extensively. Anyone else, please feel free to contribute further thoughts. - Jordi G. H. From willisb at unk.edu Thu Jan 24 14:07:45 2008 From: willisb at unk.edu (Barton Willis) Date: Thu, 24 Jan 2008 14:07:45 -0600 Subject: [Maxima] simp.lisp In-Reply-To: <20080124021541.1e155acf@herring> Message-ID: One thing that would be useful: As you work through simp.lisp, write tests that try to reach every branch of the main functions (addk, timesk, for example...). That would be a valuable contribution, I think. Currently, our (so called) regression tests are pretty much hit-or-miss. One thing to watch for in simp.lisp: look for bugs similar to http://sourceforge.net/tracker/index.php?func=detail&aid=1372477&group_id=4933&atid=104933 They are pretty easy to spot and to fix. It's tempting the change Maxima to make it look nicer. But it's easy to break stuff that the testsuite doesn't catch. I've done that lots of times. And there is code in share and elsewhere that the testsuite doesn't even try to check. Be careful. Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080124/3fdd55d5/attachment-0001.htm From raymond-rogers at idexx.com Thu Jan 24 14:15:47 2008 From: raymond-rogers at idexx.com (Rogers, Raymond) Date: Thu, 24 Jan 2008 15:15:47 -0500 Subject: [Maxima] solving sextic by radicals In-Reply-To: <9543b3a40801241153s5c9f1340sae15b3c4f2b0acc7@mail.gmail.com> References: <4797137C.6090804@skynet.be><9543b3a40801231033q150bfe27l6a477f9073a308db@mail.gmail.com><4798E6D3.1060009@skynet.be> <9543b3a40801241153s5c9f1340sae15b3c4f2b0acc7@mail.gmail.com> Message-ID: <79FBAE1FB074294FB54941CEF4AA5D8101C0BD92@Verona.namerica.idexxi.com> > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Jordi > Guti?rrez Hermoso > Sent: Thursday, January 24, 2008 2:53 PM > To: Hugo Coolens > Cc: maxima list > Subject: Re: [Maxima] solving sextic by radicals > > Let's move the discussion back to the list... > > On 24/01/2008, Hugo Coolens wrote: > > The thing is, I have a whole family of polynomials related to an > > electrical network and I'd love to see a general method to solve > > them (factorize or determine the roots) starting from the > coefficients, > > I don't know much about Galois theory but it would be great > just to see > > it work on an example like I sent you, maybe then I'll get > the necessary > > insight > > > This doesn't seem like an easy question in general. Of course if you > can find enough roots by radicals until your polynomial is of degree 4 > or less, then you have found them all. In general, I think we would > first need routines for computing Galois groups of polynomials of > small degrees. Last time I checked, Maple had routines for computing > Galois groups of polynomials of degree up to 9, but I don't know if > Maxima has any such thing. > > Using tricks such as computing discriminants and other assorted > methods, it's possible to automate the computation of the Galois group > for polynomials. A decomposition series for the Galois group, if it > exists (i.e. if it's soluble), can then give a clue on what radicals > the solution will be, although I don't have details for this. > > I would have to grep the literature to see if I can find anything > about computer algorithms for solutions by radicals or determine that > they're impossible. It's an interesting problem, and I'm sure someone > else has already solved it or worked on it extensively. > > Anyone else, please feel free to contribute further thoughts. > > - Jordi G. H. If I were doing it I would use the Algebraic Geometry tools in Maxima (or other programs) to convert the polynomials to triangular system f0(x0)=0,f1(x0,1)=0,f2(x2,x1,x0)=0 .. etc I just looked at the wikipeda article on Groebner basis: http://en.wikipedia.org/wiki/Gr%C3%B6bner_basis I can't do any better; in particular look at "Solving equations" and "Conversion of parametric equations". Be aware that certain situations (double zeros/duplicated varieties I think) cause Maxima, Maple, and Axiom to wander off into no return land. I hope to find out why when I retire (hopefully shortly). This is personal experience and I am not willing to defend it right now. RayR From rupert.swarbrick at lineone.net Thu Jan 24 14:20:40 2008 From: rupert.swarbrick at lineone.net (Rupert Swarbrick) Date: Thu, 24 Jan 2008 20:20:40 +0000 Subject: [Maxima] simp.lisp In-Reply-To: <4798C8D6.8000203@ericsson.com> References: <20080124021541.1e155acf@herring> <8b356f880801240903h459b8498o198073e2920a1aac@mail.gmail.com> <4798C8D6.8000203@ericsson.com> Message-ID: <20080124202040.62210cbd@herring> On Thu, 24 Jan 2008 12:20:22 -0500 "Raymond Toy (RT/EUS)" wrote: > Stavros Macrakis wrote: > > On Jan 23, 2008 9:15 PM, Rupert Swarbrick > > > > 3) Some of this code involves lots of copy-paste - in > > particular the predicates like ratnump and mplusp, which just check > > (caar x) - I think this stuff would be quite amenable to > > "macroization", which would mean other tests on the caar could be > > performed trivially. > > > > > > Let's not worry about microoptimizations like this, though they are > > tempting. Ideally, we should be able to have the compiler > > auto-inline when appropriate. (I know, this depends on things like > > build order.) > > Hmm. I had assumed he meant to write a macro (or macrolet) to write > the various predicates, not to make the various predicates into > macros. This would make sense to me. Yes, that is what I meant. It was just an example of where I?think large hunks of identical code could be made slightly more transparent - after all, a macro called say "caar-is-p" or a better name would apply to quite a few of them. This was only meant as an example though - I?agree there are much more pressing issues, including bugs to sort out. Rupert From macrakis at alum.mit.edu Thu Jan 24 14:27:58 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 24 Jan 2008 15:27:58 -0500 Subject: [Maxima] simp.lisp In-Reply-To: References: <20080124021541.1e155acf@herring> Message-ID: <8b356f880801241227q16dc77ccrf96db14c752c064b@mail.gmail.com> On Jan 24, 2008 3:07 PM, Barton Willis wrote: > > One thing that would be useful: As you work through simp.lisp, > write tests that try to reach every branch of the main > functions (addk, timesk, for example...). That would be a valuable > contribution Excellent suggestion! This will be very useful to the project as well as helping Rupert understand the code. One thing to watch for in simp.lisp: look for bugs similar to ... Yes, very little code should be either adding a simp flag explicitly or assuming that simplification is not needed. > But it's easy to break stuff that the testsuite doesn't catch. Agreed! And with a proper testsuite, we could address longstanding (bug report is 4+ years old; bug itself is 30+ years old!) bugs like Nontransitivity of orderlessp/great (776441): q: x^2; r: (x+1)^2; s: x*(x+2); (q+s+r)-(q+s+r) ==> x^2-x^2 Various solutions have been proposed, but presumably the reason none of them has been implemented (in 5.13 at least) is that we don't know how existing simplifier depends (subtly, perhaps) on the current 'great' behavior. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080124/aca06eb6/attachment.htm From rupert.swarbrick at lineone.net Thu Jan 24 14:28:41 2008 From: rupert.swarbrick at lineone.net (Rupert Swarbrick) Date: Thu, 24 Jan 2008 20:28:41 +0000 Subject: [Maxima] simp.lisp In-Reply-To: References: <20080124021541.1e155acf@herring> Message-ID: <20080124202841.475ca8f4@herring> On Thu, 24 Jan 2008 14:07:45 -0600 Barton Willis wrote: > One thing that would be useful: As you work through simp.lisp, > write tests that try to reach every branch of the main > functions (addk, timesk, for example...). That would be a valuable > contribution, I think. Currently, our (so called) regression > tests are pretty much hit-or-miss. > > One thing to watch for in simp.lisp: look for bugs similar to > > > http://sourceforge.net/tracker/index.php?func=detail&aid=1372477&group_id=4933&atid=104933 > > They are pretty easy to spot and to fix. > > It's tempting the change Maxima to make it look nicer. But it's > easy to break stuff that the testsuite doesn't catch. I've done > that lots of times. And there is code in share and elsewhere > that the testsuite doesn't even try to check. Be careful. > > Barton > Ah that's a really good idea! I'll try and do that as I go. There are some problems though. For example I noticed that (*red1 '((rat) 0 0)) => 0. This isn't necessarily a problem, but should one write a test for it? Anyway, about dangerous changes, my immediate aims were to read and understand the whole file, after which I'd understand a bit better how everything fitted together. Rupert From macrakis at alum.mit.edu Thu Jan 24 14:32:20 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 24 Jan 2008 15:32:20 -0500 Subject: [Maxima] simp.lisp In-Reply-To: <20080124202040.62210cbd@herring> References: <20080124021541.1e155acf@herring> <8b356f880801240903h459b8498o198073e2920a1aac@mail.gmail.com> <4798C8D6.8000203@ericsson.com> <20080124202040.62210cbd@herring> Message-ID: <8b356f880801241232s60a931cbo2540235ba21457c2@mail.gmail.com> On Jan 24, 2008 3:20 PM, Rupert Swarbrick wrote: > Yes, that is what I meant. It was just an example of where Ithink > large hunks of identical code could be made slightly more transparent - > after all, a macro called say "caar-is-p" or a better name would apply > to quite a few of them. > You mean, replace (defmfun mplusp (x) (and (not (atom x)) (eq (caar x) 'mplus))) with (defmfun mplusp (x) (caar-is-p x 'mplus)) or replace ...((mplusp expr)...) with ...((caar-is-p expr 'mplus) ...) Either of these seems quite pointless. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080124/8520244e/attachment.htm From rupert.swarbrick at lineone.net Thu Jan 24 14:45:54 2008 From: rupert.swarbrick at lineone.net (Rupert Swarbrick) Date: Thu, 24 Jan 2008 20:45:54 +0000 Subject: [Maxima] simp.lisp In-Reply-To: <8b356f880801240903h459b8498o198073e2920a1aac@mail.gmail.com> References: <20080124021541.1e155acf@herring> <8b356f880801240903h459b8498o198073e2920a1aac@mail.gmail.com> Message-ID: <20080124204554.415891a7@herring> On Thu, 24 Jan 2008 12:03:57 -0500 "Stavros Macrakis" wrote: > Adding documentation to the CVS tree is a good idea as long, of > course, as it is correct. > Can you tell the cvs diff tool to ignore space? If not, changing > indentation makes it hard to compare versions. > Then again, even adding end-of-line comments makes comparisons harder. > Maybe best to stick to ;; and ;;; comments on separate lines. I don't think you can tell CVS to ignore space, sadly. My thought was that at the moment simp.lisp (and no doubt other files) are rather hairy, so it might be worth making exactly one "doc+reformat" commit, which was possibly huge, but didn't contain _any_ code changes whatsoever. Then, although it would look a bit awful in CVS, it'd still be safe as it physically couldn't introduce regressions. Indeed, one could separate the doc and reformat steps themselves. I really would argue for reformatting though: code like this: (defmfun simplifya (x y) (cond ((atom x) (cond ((and (eq x '$%pi) $numer) %pi-val) (t x))) ((not $simp) x) ... is rather difficult to parse by eye and contains a lot of functionality on each line, the second being a problem with diff-based version control systems. > > 2) There are lots of smallish utility functions in simp.lisp, in > > particular predicates like mplusp and the like. As a general > > comment, I think it might be nice to group up, say, predicates in a > > file of their own for reuse - I'm sure we'd find the same code with > > different names in different parts of the tree. > > > Yes, there is lots of redundant code. And there are at least four > "standard" packages of utility functions: opers/mopers (which I wrote > the ancestor of 30+ years ago); mrgmac (Mike Genesereth); rzmac (Rich > Zippel); strmac (? most of these aren't used anywhere and include > dangerous ops like make-***-simp). > > Though in theory I like the idea of making everything consistent, > again this will cause a lot of code change that doesn't reflect > functionality change. If we do this, it should be in one big push on > a very well-tested, stable version, not randomly checked in. Also, it > should be decided by the group. Your "good taste" may not correspond > to others' "good taste". Yikes! That's quite impressive! But seriously, I think there are two possibly conflicting priorities here. One is absolute: there should be no regressions. However, if we can, I?think we'd gain a vast amount by refactoring and combining this sort of code: the whole tree would slowly get easier to read and, more importantly, understand enough to fix bugs in. I completely agree about the good taste comment. Although I think there are some things that are objective: when writing new code avoid gotos maybe :) (Yes, I know that the stuff I'm moaning about was probably written in the '70s when e.g. loop didn't exist) > > 3) Some of this code involves lots of copy-paste - in particular the > > predicates like ratnump and mplusp, which just check (caar x) - I > > think this stuff would be quite amenable to "macroization", which > > would mean other tests on the caar could be performed trivially. > > > > Let's not worry about microoptimizations like this, though they are > tempting. Ideally, we should be able to have the compiler auto-inline > when appropriate. (I know, this depends on things like build order.) (I think I may have answered this somewhere else, but what I meant was that you could elide a lot of code by writing a macro or two here and there for this sort of stuff, making the whole lot easier to read. Anyway, that's low priority I agree). > > 4) Goto! Aargh! I never realised _how_ incredibly difficult it is to > > understand code with gotos - for example uses them heavily. > > Although I understand the code is working currently, I think it's > > worth going through this sort of thing and tidying it - after all, > > if I found a bug somewhere in the middle of simp.lisp: in plusin, > > say, I'd just groan and try to ignore it: the code's just so > > complicated that it's incredibly hard to keep in one's head at once > > (unless this is just me being rubbish!) > > > The code is hard to understand in many places. This also means that > it is hard to rewrite correctly. And again, changing code without > changing functionality makes for distracting diffs. The interactions > among the simplification routines can be subtle, so something that > seems like an improvement may in fact break other things. > > I'd recommend you take some *specific* bugs that have been documented > and fix them as locally as possible (i.e. don't rewrite everything). > For example, making sure that 2/sqrt(2) simplifies to sqrt(2) without > breaking anything else. I sort of agree, and sort of don't. (Sorry!) Firstly, I agree that there's absolutely no point in changing code just for the fun of it. However, I'm not so sure that every change needs to "add functionality". The mere existence of ancient bugs in the sf tracker suggests that some of them are fundamentally hard to fix with the current architecture, which is understood by maybe only a couple of people (you and Richard Fateman maybe?). Simplifying the lot of it might not be as much of a waste of time and as dangerous and pointless an exercise as you suggest? > > 5) (ahah there was another question) Can anyone explain the idiom of > > writing a defun containing just a ((lambda (x) ....) nil)) > > > ((lambda (a b c) ...) av bv cv) == (let ((a av) (b bv) (c cv)) ...) > > Let was introduced into MacLisp sometime in the early 1970's, after a > lot of Maxima code had already been written. The semantics are > precisely the same; let has the readability advantage of putting the > a's close to the av's. > > -s Ah! I wondered if that was it! Thanks Rupert From raymond.toy at ericsson.com Thu Jan 24 14:54:30 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Thu, 24 Jan 2008 15:54:30 -0500 Subject: [Maxima] simp.lisp In-Reply-To: <20080124204554.415891a7@herring> References: <20080124021541.1e155acf@herring> <8b356f880801240903h459b8498o198073e2920a1aac@mail.gmail.com> <20080124204554.415891a7@herring> Message-ID: <4798FB06.9070803@ericsson.com> Rupert Swarbrick wrote: > On Thu, 24 Jan 2008 12:03:57 -0500 > "Stavros Macrakis" wrote: > >> Adding documentation to the CVS tree is a good idea as long, of >> course, as it is correct. >> Can you tell the cvs diff tool to ignore space? If not, changing >> indentation makes it hard to compare versions. >> Then again, even adding end-of-line comments makes comparisons harder. >> Maybe best to stick to ;; and ;;; comments on separate lines. > > I don't think you can tell CVS to ignore space, sadly. My thought was cvs diff -b -B will ignore all changes in white space (-b) and blank lines (-B). This assumes the diff you are using supports these options. GNU diff does. Look at the manpage for your diff program to see what it supports. Ray From macrakis at alum.mit.edu Thu Jan 24 14:55:37 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 24 Jan 2008 15:55:37 -0500 Subject: [Maxima] simp.lisp In-Reply-To: <20080124202841.475ca8f4@herring> References: <20080124021541.1e155acf@herring> <20080124202841.475ca8f4@herring> Message-ID: <8b356f880801241255n25386a64h815d6bd08b680f68@mail.gmail.com> On Jan 24, 2008 3:28 PM, Rupert Swarbrick wrote: > For example I noticed that (*red1 '((rat) 0 0)) => 0. This isn't > necessarily a problem, but should one write a test for it? > This implies that a precondition of *red1 is that the denominator is not 0. If you really wanted full checking: 1) add code to give an error in *red for d=0 (it would be nice if there were a better mechanism for asserting preconditions) 2) but don't check that n, d are integers, because gcd does the check 2a) the truly paranoid would check anyway, because some future version of CL might allow rational or Gaussian integer arguments to gcd 3) try to prove to myself that *red/*red1 is never called with d=0 4) in *red1, check that there are exactly 2 arts to rat (1) is the only one that seems worth doing, though. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080124/cf821f09/attachment.htm From andrej.vodopivec at gmail.com Thu Jan 24 15:07:57 2008 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Thu, 24 Jan 2008 22:07:57 +0100 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> Message-ID: <7775b21a0801241307u7d7640a3we9a4771556bb279e@mail.gmail.com> On Jan 22, 2008 5:04 AM, Jordi Guti?rrez Hermoso wrote: > If my calculations are correct, the roots of x^6 + 3*x^5 + 6*x^4 + > 3*x^3 + 9*x +9 should all be expressible by radicals. In fact, they > are all polynomials in terms of 2^(1/3) and a cube root of unity. > > How can I make Maxima tell me what the roots actually are? I don't know how to compute the roots in radicals, but I have some code which can sometimes guess how they look like from their numerical values: (%i1) load(identify)$ (%i2) x^6 + 3*x^5 + 6*x^4 + 3*x^3 + 9*x + 9$ (%i3) allroots(%)$ (%i4) identify(%); (%o4) [x=(sqrt(3)*%i)/2+(3*2^(1/3)-3/2)/3,x=(3*2^(1/3)-3/2)/3-(sqrt(3)*%i)/2,x=.2250982321872863*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^(1/3)-3/2)/3- .2250982321872863*%i,x=1.95714903975616*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^(1/3)-3/2)/3-1.95714903975616*%i] (%i5) subst(first(%), %o2), ratsimp; <-- you need to check if we guessed correctly (%o5) 0 After you have two roots written with radicals you should be able to solve the polynomial of degree 4 to get others. identify works mostly like the identify from maple but I think is less powerfull. If you would find it interesting let me know. -- Andrej From macrakis at alum.mit.edu Thu Jan 24 15:24:21 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 24 Jan 2008 16:24:21 -0500 Subject: [Maxima] simp.lisp In-Reply-To: <20080124204554.415891a7@herring> References: <20080124021541.1e155acf@herring> <8b356f880801240903h459b8498o198073e2920a1aac@mail.gmail.com> <20080124204554.415891a7@herring> Message-ID: <8b356f880801241324w57ea5711s55f2a7d99621c6c2@mail.gmail.com> On Jan 24, 2008 3:45 PM, Rupert Swarbrick wrote: > I really would argue for reformatting though: code like this: > > (defmfun simplifya (x y) > (cond ((atom x) (cond ((and (eq x '$%pi) $numer) %pi-val) (t x))) > ((not $simp) x) > ... > > is rather difficult to parse by eye and contains a lot of functionality > on each line, the second being a problem with diff-based version > control systems. > I suppose you'd prefer something like: (defmfun simplifya (x y) (cond ((atom x) (cond ((and (eq x '$%pi) $numer ) %pi-val ) (t x ) ) ) I *detest* code formatted like this (and have had to read a bunch of it in a Java environment). It has so much whitespace added that you can't see the big picture. But perhaps you just want: (defmfun simplifya (x y) (cond ((atom x) (cond ((and (eq x '$%pi) $numer) %pi-val) (t x))) ... Though I simply dislike this much whitespace (don't detest it), I still find the original version easier to read, because one simple idea (atoms simplify to themselves except for %pi under $numer) is expressed in one simple line. Do you see what I mean about different taste in formatting? > Yikes! That's quite impressive! But seriously, I think there are two > possibly conflicting priorities here. One is absolute: there should be > no regressions. However, if we can, Ithink we'd gain a vast amount by > refactoring and combining this sort of code: the whole tree would > slowly get easier to read and, more importantly, understand enough to > fix bugs in. I understand the argument (after all, it's why I wrote opers in the first place -- before that, code looked like (simplifya (list '(mplus) a b) nil) ) but alas most of the difficulty in understanding the code is because the logic is complicated, there are lots of global variables, etc. > I completely agree about the good taste comment. Although I think there > are some things that are objective: when writing new code avoid gotos > maybe :) (Yes, I know that the stuff I'm moaning about was probably > written in the '70s when e.g. loop didn't exist) If the choice is between the weird complexities of loop and the difficulty of understanding goto, I'm not sure I'd prefer loop consistently. But most of the goto's in simp probably can't be expressed by loop in any straightforward way anyway. Multiple mutually recursive functions would probably be required; and if you want to avoid global variables (certainly a good idea in general), you'd probably also have long variable lists.... I'm not sure what a cleaner version would look like. And general simplification is one of the few places where efficiency might actually matter even today.... > I'd recommend you take some *specific* bugs that have been documented > > and fix them as locally as possible (i.e. don't rewrite everything). > > For example, making sure that 2/sqrt(2) simplifies to sqrt(2) without > > breaking anything else. > > I sort of agree, and sort of don't. (Sorry!) Firstly, I agree that > there's absolutely no point in changing code just for the fun of it. > However, I'm not so sure that every change needs to "add > functionality". The mere existence of ancient bugs in the sf tracker > suggests that some of them are fundamentally hard to fix with the > current architecture, which is understood by maybe only a couple of > people (you and Richard Fateman maybe?). > Changing "architecture" is quite a different matter from making local changes which replace m+ by add and goto by loop. And an architectural change would be an especially good reason to first have a good test suite. The general simplifier, by the way, dates from before the Macsyma/Maxima itself, to a fellow named Korsvold. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080124/f1794a7b/attachment.htm From nikos.ap at gmail.com Thu Jan 24 15:28:41 2008 From: nikos.ap at gmail.com (Nikos Apostolakis) Date: Thu, 24 Jan 2008 16:28:41 -0500 Subject: [Maxima] solving sextic by radicals References: <4797137C.6090804@skynet.be> <9543b3a40801231033q150bfe27l6a477f9073a308db@mail.gmail.com> <4798E6D3.1060009@skynet.be> <9543b3a40801241153s5c9f1340sae15b3c4f2b0acc7@mail.gmail.com> Message-ID: <87abmuykty.fsf@Sullivan.bcc.cuny.edu> "Jordi Guti?rrez Hermoso" writes: > Let's move the discussion back to the list... > > On 24/01/2008, Hugo Coolens wrote: >> The thing is, I have a whole family of polynomials related to an >> electrical network and I'd love to see a general method to solve >> them (factorize or determine the roots) starting from the coefficients, >> I don't know much about Galois theory but it would be great just to see >> it work on an example like I sent you, maybe then I'll get the necessary >> insight > > > This doesn't seem like an easy question in general. Of course if you > can find enough roots by radicals until your polynomial is of degree 4 > or less, then you have found them all. In general, I think we would > first need routines for computing Galois groups of polynomials of > small degrees. Last time I checked, Maple had routines for computing > Galois groups of polynomials of degree up to 9, but I don't know if > Maxima has any such thing. > > Using tricks such as computing discriminants and other assorted > methods, it's possible to automate the computation of the Galois group > for polynomials. A decomposition series for the Galois group, if it > exists (i.e. if it's soluble), can then give a clue on what radicals > the solution will be, although I don't have details for this. > > I would have to grep the literature to see if I can find anything > about computer algorithms for solutions by radicals or determine that > they're impossible. It's an interesting problem, and I'm sure someone > else has already solved it or worked on it extensively. > > Anyone else, please feel free to contribute further thoughts. > GAP has functions for computing the Galois group of a polynomial. For example gap> x := Indeterminate(Rationals);; gap> GaloisType(x^10-5*x^4-4); 37 gap> g := TransitiveGroup(10, last); [2^4]S(5) gap> GeneratorsOfGroup(g); [ (2,7)(5,10), (1,3,5,7,9)(2,4,6,8,10), (2,10)(5,7) ] gap> IsSolvable(g); false Since finding Galois groups is computationally hard, GAP also provides probabilistic methods that return a list of the most likely Galois Groups: gap> f:=x^10-8*x^9+27*x^6-33*x^3+34*x-7;; gap> ProbabilityShapes(f); [ 45 ] gap> TransitiveGroup(10, 45); S10 HTH, Nikos > - Jordi G. H. From rupert.swarbrick at lineone.net Thu Jan 24 16:23:56 2008 From: rupert.swarbrick at lineone.net (Rupert Swarbrick) Date: Thu, 24 Jan 2008 22:23:56 +0000 Subject: [Maxima] Tab width Message-ID: <20080124222356.60fbc8a3@herring> This is a small question, but am I right in thinking maxima uses a tab-width of 8 in general? (This _really_ _really_ isn't a complaint - I just want to see the same indentation as everyone else.) Rupert From dan1990 at gmail.com Thu Jan 24 09:35:05 2008 From: dan1990 at gmail.com (Dan Soendergaard) Date: Thu, 24 Jan 2008 16:35:05 +0100 Subject: [Maxima] Solving equation numerically Message-ID: <482d80410801240735u2dd04860nfb34e957f33c5f90@mail.gmail.com> Hi, I'm completely new to Maxima. I use it as a Mathcad replacement in Linux which I am truly happy about. Today, I was in class given the task to solve the given equation for x, sin(x) + x = 2.5*x + 1.5 In Maxima I entered, > solve(sin(x) + x = 2.5*x + 1.5, x); which gives me, x = 5 * sin(x) + 7.5 Isn't it possible to solve this equation numerically? I know that I should get three results for x since there are three intersection points. How do I solve this kind of calculation using Maxima? -- Sincerely, Dan Sondergaard From tomtorfs at tomsweb.net Thu Jan 24 17:11:27 2008 From: tomtorfs at tomsweb.net (Tom Torfs) Date: Fri, 25 Jan 2008 00:11:27 +0100 Subject: [Maxima] help on using maxima to solve systems of equations Message-ID: <47991B1F.9030902@tomsweb.net> Hello All, I'm new to using Maxima. I tried to use the program to solve systems of equations, but I'm not succesful. I've reduced my problem to a very simple example: (%i1) e1:y=a*x+b; (%o1) y=a*x+b (%i2) e2:a=c; (%o2) a=c (%i3) solve(e1,a); (%o3) [a=(y-b)/x] (%i4) solve([e1,e2],a); Inconsistent equations: [1] -- an error. To debug this try debugmode(true); (%i5) solve([e1,e2],c); Inconsistent equations: [1] -- an error. To debug this try debugmode(true); Can anybody advise me what I should do to get a solution to such a system of equations? (the real equations will be more complicated of course) Thanks, Tom From harald at lefant.net Thu Jan 24 20:24:11 2008 From: harald at lefant.net (Harald Geyer) Date: Fri, 25 Jan 2008 03:24:11 +0100 Subject: [Maxima] help on using maxima to solve systems of equations In-Reply-To: <47991B1F.9030902@tomsweb.net> References: <47991B1F.9030902@tomsweb.net> Message-ID: Hi Tom, welcome to maxima and thanks for posting a minimal example, that makes it much easier to answer. > I'm new to using Maxima. I tried to use the program to solve systems of > equations, but I'm not succesful. > I've reduced my problem to a very simple example: > > (%i1) e1:y=a*x+b; > (%o1) y=a*x+b > (%i2) e2:a=c; > (%o2) a=c > (%i3) solve(e1,a); > (%o3) [a=(y-b)/x] > (%i4) solve([e1,e2],a); > Inconsistent equations: [1] > -- an error. To debug this try debugmode(true); Maxima treats any symbol not mentioned as variable as arbitrary parameter. It finds out that [e1, e2] is not consistent for arbitrary values of b, c, x, y. Any of them is determined by the three others so just pick one as additional variable. For example: (%i10) solve([e1,e2],[a,c]); (%o10) [[a = (y-b)/x,c = (y-b)/x]] HTH, Harald From blindstein at gmail.com Thu Jan 24 21:21:00 2008 From: blindstein at gmail.com (Justin Harford) Date: Thu, 24 Jan 2008 19:21:00 -0800 Subject: [Maxima] Solving equation numerically In-Reply-To: <482d80410801240735u2dd04860nfb34e957f33c5f90@mail.gmail.com> References: <482d80410801240735u2dd04860nfb34e957f33c5f90@mail.gmail.com> Message-ID: (question), numer ; Justin Harford the chancellor?s job has come to be defined as "providing parking for faculty, sex for the students, and athletics for the alumni." Klark Kerr? 1957 On Jan 24, 2008, at 7:35 AM, Dan Soendergaard wrote: > Hi, > > I'm completely new to Maxima. I use it as a Mathcad replacement in > Linux which I am truly happy about. Today, I was in class given the > task to solve the given equation for x, > > sin(x) + x = 2.5*x + 1.5 > > In Maxima I entered, > >> solve(sin(x) + x = 2.5*x + 1.5, x); > > which gives me, > > x = 5 * sin(x) + 7.5 > > Isn't it possible to solve this equation numerically? I know that I > should get three results for x since there are three intersection > points. How do I solve this kind of calculation using Maxima? > > -- > Sincerely, > > Dan Sondergaard > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From sen1 at math.msu.edu Thu Jan 24 22:58:29 2008 From: sen1 at math.msu.edu (S. Newhouse) Date: Thu, 24 Jan 2008 23:58:29 -0500 Subject: [Maxima] Solving equation numerically In-Reply-To: References: <482d80410801240735u2dd04860nfb34e957f33c5f90@mail.gmail.com> Message-ID: <47996C75.2060905@math.msu.edu> Justin Harford wrote: > (question), numer ; > Justin Harford > > the chancellor?s job has come to be defined as "providing parking for > faculty, sex for the students, and athletics for the alumni." > Klark Kerr? 1957 > > On Jan 24, 2008, at 7:35 AM, Dan Soendergaard wrote: > > >> Hi, >> >> I'm completely new to Maxima. I use it as a Mathcad replacement in >> Linux which I am truly happy about. Today, I was in class given the >> task to solve the given equation for x, >> >> sin(x) + x = 2.5*x + 1.5 >> >> In Maxima I entered, >> >> >>> solve(sin(x) + x = 2.5*x + 1.5, x); >>> >> which gives me, >> >> x = 5 * sin(x) + 7.5 >> >> Isn't it possible to solve this equation numerically? I know that I >> should get three results for x since there are three intersection >> points. How do I solve this kind of calculation using Maxima? >> >> %i12) find_root(sin(x)+x-2.5*x - 1.5,x,-3,3); (%o12) - 1.663786360949127 HTH, -sen From robert.dodier at gmail.com Fri Jan 25 00:37:21 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 24 Jan 2008 23:37:21 -0700 Subject: [Maxima] Solving equation numerically In-Reply-To: <482d80410801240735u2dd04860nfb34e957f33c5f90@mail.gmail.com> References: <482d80410801240735u2dd04860nfb34e957f33c5f90@mail.gmail.com> Message-ID: On 1/24/08, Dan Soendergaard wrote: > I'm completely new to Maxima. I use it as a Mathcad replacement in > Linux which I am truly happy about. I would be interested to hear if there is anything in Mathcad which you miss in Maxima. >Today, I was in class given the > task to solve the given equation for x, > > sin(x) + x = 2.5*x + 1.5 > > In Maxima I entered, > > > solve(sin(x) + x = 2.5*x + 1.5, x); > > which gives me, > > x = 5 * sin(x) + 7.5 Hmm. x = 5 * sin(x) + 7.5 doesn't appear to be equivalent to sin(x) + x = 2.5*x + 1.5 ... Is there a typo somewhere? > Isn't it possible to solve this equation numerically? I know that I > should get three results for x since there are three intersection > points. I think you can plot the stuff returned by solve, plot2d ([5*sin(x) + 7.5, x], [x, 0, 10]); let's say, and use that to guess a range or ranges for find_root. (find_root only tries to find one root.) best, Robert Dodier From andre.maute at gmx.de Fri Jan 25 03:59:27 2008 From: andre.maute at gmx.de (andre maute) Date: Fri, 25 Jan 2008 10:59:27 +0100 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <7775b21a0801241307u7d7640a3we9a4771556bb279e@mail.gmail.com> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <7775b21a0801241307u7d7640a3we9a4771556bb279e@mail.gmail.com> Message-ID: <200801251059.27387.andre.maute@gmx.de> On Thursday 24 January 2008, Andrej Vodopivec wrote: > On Jan 22, 2008 5:04 AM, Jordi Guti?rrez Hermoso wrote: > > If my calculations are correct, the roots of x^6 + 3*x^5 + 6*x^4 + > > 3*x^3 + 9*x +9 should all be expressible by radicals. In fact, they > > are all polynomials in terms of 2^(1/3) and a cube root of unity. > > > > How can I make Maxima tell me what the roots actually are? > > I don't know how to compute the roots in radicals, but I have some > code which can sometimes guess how they look like from their numerical > values: > > (%i1) load(identify)$ > (%i2) x^6 + 3*x^5 + 6*x^4 + 3*x^3 + 9*x + 9$ > (%i3) allroots(%)$ > (%i4) identify(%); > (%o4) > [x=(sqrt(3)*%i)/2+(3*2^(1/3)-3/2)/3,x=(3*2^(1/3)-3/2)/3-(sqrt(3)*%i)/2,x=.2 >250982321872863*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^(1/3)-3/2)/3- > .2250982321872863*%i,x=1.95714903975616*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^(1/3) >-3/2)/3-1.95714903975616*%i] (%i5) subst(first(%), %o2), ratsimp; <-- you > need to check if we > guessed correctly > (%o5) 0 > > After you have two roots written with radicals you should be able to > solve the polynomial of degree 4 to get others. > > identify works mostly like the identify from maple but I think is less > powerfull. If you would find it interesting let me know. Perhaps you could check what your identify function gives for the sixth legendre polynomial. 231*x^6/16-315*x^4/16+105*x^2/16-5/16 I have not seen the roots written in radicals, yet. Andre From macrakis at alum.mit.edu Fri Jan 25 04:11:48 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 25 Jan 2008 05:11:48 -0500 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <200801251059.27387.andre.maute@gmx.de> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <7775b21a0801241307u7d7640a3we9a4771556bb279e@mail.gmail.com> <200801251059.27387.andre.maute@gmx.de> Message-ID: <8b356f880801250211x371e776l7a33fa8e263d0ec3@mail.gmail.com> Have you tried solve? This polynomial is the functional composition of lower-degree polys so should easily be handled by solve. No need for numerical solutions and identify. Take a look at the doc for polydecomp if you're interested. -s On 1/25/08, andre maute wrote: > On Thursday 24 January 2008, Andrej Vodopivec wrote: > > On Jan 22, 2008 5:04 AM, Jordi Guti?rrez Hermoso > wrote: > > > If my calculations are correct, the roots of x^6 + 3*x^5 + 6*x^4 + > > > 3*x^3 + 9*x +9 should all be expressible by radicals. In fact, they > > > are all polynomials in terms of 2^(1/3) and a cube root of unity. > > > > > > How can I make Maxima tell me what the roots actually are? > > > > I don't know how to compute the roots in radicals, but I have some > > code which can sometimes guess how they look like from their numerical > > values: > > > > (%i1) load(identify)$ > > (%i2) x^6 + 3*x^5 + 6*x^4 + 3*x^3 + 9*x + 9$ > > (%i3) allroots(%)$ > > (%i4) identify(%); > > (%o4) > > > [x=(sqrt(3)*%i)/2+(3*2^(1/3)-3/2)/3,x=(3*2^(1/3)-3/2)/3-(sqrt(3)*%i)/2,x=.2 > >250982321872863*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^(1/3)-3/2)/3- > > > .2250982321872863*%i,x=1.95714903975616*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^(1/3) > >-3/2)/3-1.95714903975616*%i] (%i5) subst(first(%), %o2), ratsimp; <-- you > > need to check if we > > guessed correctly > > (%o5) 0 > > > > After you have two roots written with radicals you should be able to > > solve the polynomial of degree 4 to get others. > > > > identify works mostly like the identify from maple but I think is less > > powerfull. If you would find it interesting let me know. > > Perhaps you could check > what your identify function gives for the sixth legendre polynomial. > > 231*x^6/16-315*x^4/16+105*x^2/16-5/16 > > I have not seen the roots written in radicals, yet. > > Andre > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Sent from Gmail for mobile | mobile.google.com From Bart.Vandewoestyne at telenet.be Fri Jan 25 04:13:31 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Fri, 25 Jan 2008 11:13:31 +0100 Subject: [Maxima] vi and Maxima syntax highlighting? Message-ID: <20080125101331.GA8798@simba> Hello all, I am using the following versions of vi as a text editor for my source code: bartv at vonneumann:~$ vi --version | grep compiled VIM - Vi IMproved 7.0 (2006 May 7, compiled Sep 24 2006 14:00:29) bartv at archimedes:~$ vi --version | grep compiled VIM - Vi IMproved 7.1 (2007 May 12, compiled Oct 5 2007 00:50:42) I give all my Maxima scripts a .mac extension. However, I have the impression that the syntax highlighting is not really good or working... most of the code is syntax hightlighted in lightblue in my setup. Does anybody know if it is possible to get better syntax highlighting for Maxima in vi? And what is the 'official' extension to give to a Maxima script? Thanks, Bart -- "Share what you know. Learn what you don't." From andre.maute at gmx.de Fri Jan 25 04:29:28 2008 From: andre.maute at gmx.de (andre maute) Date: Fri, 25 Jan 2008 11:29:28 +0100 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <8b356f880801250211x371e776l7a33fa8e263d0ec3@mail.gmail.com> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <200801251059.27387.andre.maute@gmx.de> <8b356f880801250211x371e776l7a33fa8e263d0ec3@mail.gmail.com> Message-ID: <200801251129.28484.andre.maute@gmx.de> On Friday 25 January 2008, you wrote: > Have you tried solve? This polynomial is the functional composition of > lower-degree polys so should easily be handled by solve. No need for > numerical solutions and identify. Take a look at the doc for > polydecomp if you're interested. solve gives long lists of roots involving %i it's known that the roots of the legendre polynomials are real, so what i want to see is no %i. polydecomp is no help either. Andre > > -s > > On 1/25/08, andre maute wrote: > > On Thursday 24 January 2008, Andrej Vodopivec wrote: > > > On Jan 22, 2008 5:04 AM, Jordi Guti?rrez Hermoso > > > > wrote: > > > > If my calculations are correct, the roots of x^6 + 3*x^5 + 6*x^4 + > > > > 3*x^3 + 9*x +9 should all be expressible by radicals. In fact, they > > > > are all polynomials in terms of 2^(1/3) and a cube root of unity. > > > > > > > > How can I make Maxima tell me what the roots actually are? > > > > > > I don't know how to compute the roots in radicals, but I have some > > > code which can sometimes guess how they look like from their numerical > > > values: > > > > > > (%i1) load(identify)$ > > > (%i2) x^6 + 3*x^5 + 6*x^4 + 3*x^3 + 9*x + 9$ > > > (%i3) allroots(%)$ > > > (%i4) identify(%); > > > (%o4) > > > > [x=(sqrt(3)*%i)/2+(3*2^(1/3)-3/2)/3,x=(3*2^(1/3)-3/2)/3-(sqrt(3)*%i)/2,x= > >.2 > > > > >250982321872863*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^(1/3)-3/2)/3- > > > > .2250982321872863*%i,x=1.95714903975616*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^(1/ > >3) > > > > >-3/2)/3-1.95714903975616*%i] (%i5) subst(first(%), %o2), ratsimp; <-- > > > you need to check if we > > > guessed correctly > > > (%o5) 0 > > > > > > After you have two roots written with radicals you should be able to > > > solve the polynomial of degree 4 to get others. > > > > > > identify works mostly like the identify from maple but I think is less > > > powerfull. If you would find it interesting let me know. > > > > Perhaps you could check > > what your identify function gives for the sixth legendre polynomial. > > > > 231*x^6/16-315*x^4/16+105*x^2/16-5/16 > > > > I have not seen the roots written in radicals, yet. > > > > Andre > > > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima From villate at fe.up.pt Fri Jan 25 05:17:14 2008 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 25 Jan 2008 11:17:14 +0000 Subject: [Maxima] Formatting of a computed result In-Reply-To: <200801241815.m0OIFbZ4020586@post.webmailer.de> References: <200801241815.m0OIFbZ4020586@post.webmailer.de> Message-ID: <1201259834.6379.7.camel@bethe> On Thu, 2008-01-24 at 19:15 +0100, maxima-list at ssteiner.com wrote: > if I let Maxima solve an equation like "0=3*x^2-4" it returns a result > which occupies several lines. > Screenshot of an example: > http://www.braunsen.net/sst/maximaergebnis.png > How to make Maxima output the result (e.g. result of a > solve(...)-operation) as a single-line expression like > "[x=-2/sqrt(3),x=2/sqrt(3)]"? display2d:false$ solve(3*x^2-4); Cheers, Jaime From toy.raymond at gmail.com Fri Jan 25 06:47:11 2008 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 25 Jan 2008 07:47:11 -0500 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <200801251129.28484.andre.maute@gmx.de> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <200801251059.27387.andre.maute@gmx.de> <8b356f880801250211x371e776l7a33fa8e263d0ec3@mail.gmail.com> <200801251129.28484.andre.maute@gmx.de> Message-ID: <4799DA4F.7000404@gmail.com> andre maute wrote: > On Friday 25 January 2008, you wrote: > >> Have you tried solve? This polynomial is the functional composition of >> lower-degree polys so should easily be handled by solve. No need for >> numerical solutions and identify. Take a look at the doc for >> polydecomp if you're interested. >> > > solve gives long lists of roots involving %i > it's known that the roots of the legendre polynomials are real, > so what i want to see is no %i. > > This seems to work for me: ratsimp(rectform(solve(legendre_p(6,x),x))); The answer appears to be free of %i, although really quite messy. Ray From Bart.Vandewoestyne at telenet.be Fri Jan 25 07:00:02 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Fri, 25 Jan 2008 14:00:02 +0100 Subject: [Maxima] maxima-index.list could not be found Message-ID: <20080125130002.GA13062@simba> Hello list, Today, our sysadmins installed the maxima package on one of our Ubuntu 7.10 (codename gutsy) machines. The maxima version that is included and used is bartv at archimedes:~$ maxima --version Maxima 5.12.0 The following maxima-doc package is installed: bartv at archimedes:~$ dpkg --list | grep maxima-doc ii maxima-doc 5.12.0-1ubuntu2 A computer algebra system -- documentation However, when i try to access the documentation for a certain command, i get an error saying that /usr/share/info/maxima-index.lisp could not be found: (%i1) ? integrate Could not find `/usr/share/info/maxima-index.lisp' using paths in file_search_lisp,system. -- an error. To debug this try debugmode(true); I see however that there are several maxima-index.lisp.gz in the maxima-doc package: bartv at archimedes:~$ dpkg -L maxima-doc | grep maxima-index.lisp /usr/share/doc/maxima-doc/es/maxima-index.lisp.gz /usr/share/doc/maxima-doc/es.utf8/maxima-index.lisp.gz /usr/share/doc/maxima-doc/pt/maxima-index.lisp.gz /usr/share/doc/maxima-doc/pt.utf8/maxima-index.lisp.gz /usr/share/doc/maxima-doc/info/maxima-index.lisp.gz The problem is that it seems gzipped and not in the right location. I assume unzipping maxima-index.lisp.gz and moving it to /usr/share/info is the quickest solution to this problem? Secondly, taken into account that our sysadmins might have to install maxima on quite some other computers, what is the best way to solve this problem? Manually installing the .deb and then each time unzipping and copying might be cumbersome... Thanks, Bart -- "Share what you know. Learn what you don't." From Bart.Vandewoestyne at telenet.be Fri Jan 25 07:23:50 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Fri, 25 Jan 2008 14:23:50 +0100 Subject: [Maxima] change of variables for integration Message-ID: <20080125132350.GA13981@simba> Hello list, I am experimenting with the changevar command. I'm trying to find out if i can also make it work for s-dimensional integration. In one dimension, things are simple. We can for example do: depends(f, x)$ 'integrate(f(x), x, 0, 2); changevar(%, y-x/2, y, x); Which changes 2 / [ (%i2) I f(x) dx ] / 0 into 1 / [ (%o3) 2 I f(2 y) dy ] / 0 But can a similar thing be done for s-dimensional integrals too? Take for example the function: s: 3; f(x) := product(x[i], i, 1, s); Then I have found that I can integrate it using integrate(integrate(integrate(f(x), x[1], 0, 2), x[2], 0, 2), x[3], 0, 2); My first question is if the above command can be written shorter and for more general (maybe even unspecified, sumbolic?) s (suppose you want to play with the s-value, how would you change the integrate command?). My second question is then how to apply the variable transformation y = x/2 for each of the variables and see the transformed expression for the integral? Thanks for your advice, Bart -- "Share what you know. Learn what you don't." From andre.maute at gmx.de Fri Jan 25 08:10:46 2008 From: andre.maute at gmx.de (andre maute) Date: Fri, 25 Jan 2008 15:10:46 +0100 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <8b356f880801250439t88ba311j6cdf9843e6fe2508@mail.gmail.com> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <200801251127.44499.andre.maute@gmx.de> <8b356f880801250439t88ba311j6cdf9843e6fe2508@mail.gmail.com> Message-ID: <200801251510.46165.andre.maute@gmx.de> What i did -------- snip ---------- p : 231*x^6/16-315*x^4/16+105*x^2/16-5/16; z : solve(p=0,x); z[1]; z1 : radcan(z[1]), algebraic; z2 : ratsimp(z[1]), algebraic; z3 : ratsimp(rectform(z[1])); -------- snip ---------- z1 and z2 contain nevertheless %i. z3 introduces trigonometric functions which i dislike as much as the %i i want an expression only involving radicals, no %i and no other auxilliary functions i'm not aware if the trigonometric expressions have a representation only involving radicals no %i and no other auxilliary functions what i have in mind is something like the following for the fifth legendre polynomial (%i10) p5:x^5/8-35*x^3/4+15*x/8; (%o10) 63*x^5/8-35*x^3/4+15*x/8; (%i11) z5:solve(p5 = 0,x); (%o11) [x = -sqrt(2*sqrt(70)+35)/(3*sqrt(7)), x = sqrt(2*sqrt(70)+35)/(3*sqrt(7)), x = -sqrt(35-2*sqrt(70))/(3*sqrt(7)), x = sqrt(35-2*sqrt(70))/(3*sqrt(7)),x = 0] Andre On Friday 25 January 2008, Stavros Macrakis wrote: > Did you try radcan and/or ratsimp(zz),algebraic? > > On 1/25/08, andre maute wrote: > > On Friday 25 January 2008, you wrote: > > > Have you tried solve? This polynomial is the functional composition of > > > lower-degree polys so should easily be handled by solve. No need for > > > numerical solutions and identify. Take a look at the doc for > > > polydecomp if you're interested. > > > > solve gives long lists of roots involving %i > > it's known that the roots of the legendre polynomials are real, > > so what i want to see is no %i. > > > > polydecomp is no help either. > > > > Andre > > > > > -s > > > > > > On 1/25/08, andre maute wrote: > > > > On Thursday 24 January 2008, Andrej Vodopivec wrote: > > > > > On Jan 22, 2008 5:04 AM, Jordi Guti?rrez Hermoso > > > > > > > > > > > > > wrote: > > > > > > If my calculations are correct, the roots of x^6 + 3*x^5 + 6*x^4 > > > > > > + 3*x^3 + 9*x +9 should all be expressible by radicals. In fact, > > > > > > they are all polynomials in terms of 2^(1/3) and a cube root of > > > > > > unity. > > > > > > > > > > > > How can I make Maxima tell me what the roots actually are? > > > > > > > > > > I don't know how to compute the roots in radicals, but I have some > > > > > code which can sometimes guess how they look like from their > > > > > numerical values: > > > > > > > > > > (%i1) load(identify)$ > > > > > (%i2) x^6 + 3*x^5 + 6*x^4 + 3*x^3 + 9*x + 9$ > > > > > (%i3) allroots(%)$ > > > > > (%i4) identify(%); > > > > > (%o4) > > > > [x=(sqrt(3)*%i)/2+(3*2^(1/3)-3/2)/3,x=(3*2^(1/3)-3/2)/3-(sqrt(3)*%i)/2,x= > > > > > >.2 > > > > > > > > >250982321872863*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^(1/3)-3/2)/3- > > > > .2250982321872863*%i,x=1.95714903975616*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^(1/ > > > > > >3) > > > > > > > > >-3/2)/3-1.95714903975616*%i] (%i5) subst(first(%), %o2), ratsimp; > > > > > <-- you need to check if we > > > > > guessed correctly > > > > > (%o5) 0 > > > > > > > > > > After you have two roots written with radicals you should be able > > > > > to solve the polynomial of degree 4 to get others. > > > > > > > > > > identify works mostly like the identify from maple but I think is > > > > > less powerfull. If you would find it interesting let me know. > > > > > > > > Perhaps you could check > > > > what your identify function gives for the sixth legendre polynomial. > > > > > > > > 231*x^6/16-315*x^4/16+105*x^2/16-5/16 > > > > > > > > I have not seen the roots written in radicals, yet. > > > > > > > > Andre > > > > > > > > _______________________________________________ > > > > Maxima mailing list > > > > Maxima at math.utexas.edu > > > > http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Fri Jan 25 09:27:59 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 25 Jan 2008 08:27:59 -0700 Subject: [Maxima] vi and Maxima syntax highlighting? In-Reply-To: <20080125101331.GA8798@simba> References: <20080125101331.GA8798@simba> Message-ID: On 1/25/08, Bart Vandewoestyne wrote: > However, I have the impression that the syntax highlighting is not really good > or working... most of the code is syntax hightlighted in lightblue in my setup. The light blue stuff is vim's default colorization. Seems like an odd choice, but oh well. > Does anybody know if it is possible to get better syntax highlighting for > Maxima in vi? And what is the 'official' extension to give to a Maxima script? I believe there is a maxima.vim syntax colorization file in vim 7. If not it should be available from the vim web site, and if that fails, I'll email mine to you. Most of the scripts in the Maxima distribution are named .mac. A few are named .dem (demonstration). Here is my ~/.vim/filetype.vim which tells vim to colorize those files: if exists("did_load_filetypes") finish endif augroup filetypedetect au! BufRead,BufNewFile *.mac setfiletype maxima au! BufRead,BufNewFile *.dem setfiletype maxima augroup END Vim doesn't associate .mac with Maxima by default because .mac was already used by some assembler language (if I recall correctly). Hope this helps, Robert Dodier From robert.dodier at gmail.com Fri Jan 25 09:40:02 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 25 Jan 2008 08:40:02 -0700 Subject: [Maxima] maxima-index.list could not be found In-Reply-To: <20080125130002.GA13062@simba> References: <20080125130002.GA13062@simba> Message-ID: On 1/25/08, Bart Vandewoestyne wrote: > bartv at archimedes:~$ dpkg -L maxima-doc | grep maxima-index.lisp > /usr/share/doc/maxima-doc/es/maxima-index.lisp.gz > /usr/share/doc/maxima-doc/es.utf8/maxima-index.lisp.gz > /usr/share/doc/maxima-doc/pt/maxima-index.lisp.gz > /usr/share/doc/maxima-doc/pt.utf8/maxima-index.lisp.gz > /usr/share/doc/maxima-doc/info/maxima-index.lisp.gz > > The problem is that it seems gzipped and not in the right location. > I assume unzipping maxima-index.lisp.gz and moving it to > /usr/share/info is the quickest solution to this problem? Yes -- the maxima-index.lisp must be unzipped. Maxima can read it from /usr/share/doc/maxima-doc if you assign an obscure variable in Maxima ... probably easier to just move all the stuff the location in which Maxima is looking for it. All of the maxima*.info* files must also be unzipped. I guess Maxima should try to read gzip'd files but that's a feature that would be in a future release. > Secondly, taken into account that our sysadmins might have to > install maxima on quite some other computers, Well, I am happy to hear that. I hope everyone finds Maxima fun & useful. > what is the best way to solve this problem? Manually installing > the .deb and then each time unzipping and copying might be > cumbersome... Maybe there is a way to repackage the stuff after unzipping and moving it around. Certainly you should inform the source of your package that they need to package the info stuff unzipped, and either put the files where Maxima expects to find them or build Maxima to look for the files in a non-standard location. best Robert Dodier From nikos.ap at gmail.com Fri Jan 25 09:46:56 2008 From: nikos.ap at gmail.com (Nikos Apostolakis) Date: Fri, 25 Jan 2008 10:46:56 -0500 Subject: [Maxima] Finding roots of sextic in radicals References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <200801251127.44499.andre.maute@gmx.de> <8b356f880801250439t88ba311j6cdf9843e6fe2508@mail.gmail.com> <200801251510.46165.andre.maute@gmx.de> Message-ID: <873aslykjz.fsf@Sullivan.bcc.cuny.edu> andre maute writes: > What i did > > -------- snip ---------- > p : 231*x^6/16-315*x^4/16+105*x^2/16-5/16; > > z : solve(p=0,x); > > z[1]; > > z1 : radcan(z[1]), algebraic; > z2 : ratsimp(z[1]), algebraic; > z3 : ratsimp(rectform(z[1])); > -------- snip ---------- > > z1 and z2 contain nevertheless %i. > z3 introduces trigonometric functions > which i dislike as much as the %i > > i want an expression only involving radicals, > no %i and no other auxilliary functions > > i'm not aware if the trigonometric expressions > have a representation only involving radicals > no %i and no other auxilliary functions > Actually in z3, all sines and cosines occur in the form sin(atan(expr)) and cos(atan(expr)) where expr are some expresions involving square roots. So using pythagorean theorem one can in principle get an expression involving only radicals from that. So I guess the next question is: is there a global variable that setting it true will cause maxima to simplify sin(atan(x)) to x/sqrt(1-x^2)? Nikos From tomtorfs at tomsweb.net Fri Jan 25 02:00:24 2008 From: tomtorfs at tomsweb.net (Tom Torfs) Date: Fri, 25 Jan 2008 09:00:24 +0100 Subject: [Maxima] help on using maxima to solve systems of equations In-Reply-To: <47991B1F.9030902@tomsweb.net> References: <47991B1F.9030902@tomsweb.net> Message-ID: <47999718.3040805@tomsweb.net> Harald wrote: >Maxima treats any symbol not mentioned as variable as arbitrary parameter. >It finds out that [e1, e2] is not consistent for arbitrary values >of b, c, x, y. Any of them is determined by the three others so just >pick one as additional variable. For example: >(%i10) solve([e1,e2],[a,c]); >(%o10) [[a = (y-b)/x,c = (y-b)/x]] Thanks, that helps! I have another question (again a simplified example): (%i1) e1:x2=x*cos(phi)-y*sin(phi); (%o1) x2=cos(phi)*x-sin(phi)*y (%i2) e2:y2=x*sin(phi)+y*cos(phi); (%o2) y2=cos(phi)*y+sin(phi)*x (%i3) solve([e1,e2],[x,y]); (%o3) [[x=(sin(phi)*y2+cos(phi)*x2)/(sin(phi)^2+cos(phi)^2),y=-(sin(phi)*x2-cos(phi)*y2)/(sin(phi)^2+cos(phi)^2)]] How can I get Maxima to recognize that sin(phi)^2+cos(phi)^2 = 1 ? Without this type of simplification, the solutions of my system will get huge and ugly. greetings, Tom From villate at fe.up.pt Fri Jan 25 10:05:02 2008 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 25 Jan 2008 16:05:02 +0000 Subject: [Maxima] maxima-index.list could not be found In-Reply-To: <20080125130002.GA13062@simba> References: <20080125130002.GA13062@simba> Message-ID: <1201277102.6379.26.camel@bethe> On Fri, 2008-01-25 at 14:00 +0100, Bart Vandewoestyne wrote: > The problem is that it seems gzipped and not in the right location. > I assume unzipping maxima-index.lisp.gz and moving it to > /usr/share/info is the quickest solution to this problem? > > Secondly, taken into account that our sysadmins might have to install > maxima > on quite some other computers, what is the best way to solve this > problem? Manually installing the .deb and then each time > unzipping and copying might be cumbersome... I had the same problem when I installed Ubuntu in the 12 PCs in our physics lab where we use Maxima intensively. I wrote a shell script with the following content: sudo apt-get install maxima maxima-doc maxima-share gnuplot-x11 xmaxima sudo gunzip /usr/share/doc/maxima-doc/info/maxima-index.lisp.gz cd /usr/share/info sudo ln -s /usr/share/doc/maxima-doc/info/maxima-index.lisp I then transfer the script to each PC and do a "source maximascript" Notice that Maxima in Debian/Ubuntu is very minimalist, which leads to problems: the maxima package depends on gnuplot, but the regular gnuplot in Debian will be of no use in Maxima; you need gnuplot-x11. If you do not install maxima-share, a lot of the functions described in the manual will not work. And even if you never run the program xmaxima, plotdf in the dynamics package will not work without it. Regards, Jaime Villate From raymond.toy at ericsson.com Fri Jan 25 10:10:00 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Fri, 25 Jan 2008 11:10:00 -0500 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <873aslykjz.fsf@Sullivan.bcc.cuny.edu> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <200801251127.44499.andre.maute@gmx.de> <8b356f880801250439t88ba311j6cdf9843e6fe2508@mail.gmail.com> <200801251510.46165.andre.maute@gmx.de> <873aslykjz.fsf@Sullivan.bcc.cuny.edu> Message-ID: <479A09D8.3070006@ericsson.com> Nikos Apostolakis wrote: > Actually in z3, all sines and cosines occur in the form > sin(atan(expr)) and cos(atan(expr)) where expr are some expresions > involving square roots. So using pythagorean theorem one can in > principle get an expression involving only radicals from that. > > So I guess the next question is: is there a global variable that > setting it true will cause maxima to simplify sin(atan(x)) to > x/sqrt(1-x^2)? sin(atan(x)) already returns x/sqrt(1-x^2). But the expressions aren't sin(atan(x)). They're sin(atan(x)/3). To simplify that, I think you need to solve a cubic, which will probably give another expression containing sin's. Ray From raymond.toy at ericsson.com Fri Jan 25 10:11:17 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Fri, 25 Jan 2008 11:11:17 -0500 Subject: [Maxima] help on using maxima to solve systems of equations In-Reply-To: <47999718.3040805@tomsweb.net> References: <47991B1F.9030902@tomsweb.net> <47999718.3040805@tomsweb.net> Message-ID: <479A0A25.5000505@ericsson.com> Tom Torfs wrote: > > How can I get Maxima to recognize that sin(phi)^2+cos(phi)^2 = 1 ? Without this type of simplification, the solutions of my system will get huge and ugly. trigsimp(sin(x)^2+cos(x)^2) -> 1 You may want to try "?? trig" to find out about some other trig simplifications routines. Ray From Bart.Vandewoestyne at telenet.be Fri Jan 25 10:11:39 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Fri, 25 Jan 2008 17:11:39 +0100 Subject: [Maxima] maxima-index.list could not be found In-Reply-To: References: <20080125130002.GA13062@simba> Message-ID: <20080125161139.GA30569@forsythe> On Fri, Jan 25, 2008 at 08:40:02AM -0700, Robert Dodier wrote: > > Yes -- the maxima-index.lisp must be unzipped. > Maxima can read it from /usr/share/doc/maxima-doc if you assign > an obscure variable in Maxima ... probably easier to just move > all the stuff the location in which Maxima is looking for it. > > All of the maxima*.info* files must also be unzipped. > I guess Maxima should try to read gzip'd files but that's a feature > that would be in a future release. Hmm... that is strange... on *another* computer running an older release of Ubuntu, namely bartv at eeklo:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 7.04 Release: 7.04 Codename: feisty I have the following files: bartv at eeklo:~$ dpkg -L maxima-doc | grep maxima\.info /usr/share/info/es/maxima.info-2.gz /usr/share/info/es/maxima.info-3.gz /usr/share/info/es/maxima.info-4.gz /usr/share/info/es/maxima.info-5.gz /usr/share/info/es/maxima.info-6.gz /usr/share/info/es/maxima.info-7.gz /usr/share/info/es/maxima.info.gz /usr/share/info/es/maxima.info-1.gz /usr/share/info/es.utf8/maxima.info-2.gz /usr/share/info/es.utf8/maxima.info-3.gz /usr/share/info/es.utf8/maxima.info-4.gz /usr/share/info/es.utf8/maxima.info-5.gz /usr/share/info/es.utf8/maxima.info-6.gz /usr/share/info/es.utf8/maxima.info-7.gz /usr/share/info/es.utf8/maxima.info.gz /usr/share/info/es.utf8/maxima.info-1.gz /usr/share/info/pt/maxima.info-2.gz /usr/share/info/pt/maxima.info-3.gz /usr/share/info/pt/maxima.info-4.gz /usr/share/info/pt/maxima.info-5.gz /usr/share/info/pt/maxima.info-6.gz /usr/share/info/pt/maxima.info-7.gz /usr/share/info/pt/maxima.info.gz /usr/share/info/pt/maxima.info-1.gz /usr/share/info/pt.utf8/maxima.info-2.gz /usr/share/info/pt.utf8/maxima.info-3.gz /usr/share/info/pt.utf8/maxima.info-4.gz /usr/share/info/pt.utf8/maxima.info-5.gz /usr/share/info/pt.utf8/maxima.info-6.gz /usr/share/info/pt.utf8/maxima.info-7.gz /usr/share/info/pt.utf8/maxima.info.gz /usr/share/info/pt.utf8/maxima.info-1.gz /usr/share/info/maxima.info-2.gz /usr/share/info/maxima.info-3.gz /usr/share/info/maxima.info-4.gz /usr/share/info/maxima.info-5.gz /usr/share/info/maxima.info-6.gz /usr/share/info/maxima.info-7.gz /usr/share/info/maxima.info.gz /usr/share/info/maxima.info-1.gz There seems to be no maxima-index.lisp file: bartv at eeklo:~$ locate maxima-index.lisp bartv at eeklo:~$ The version of maxima installed is bartv at eeklo:~$ maxima Maxima 5.10.0 http://maxima.sourceforge.net Using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (aka GCL) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. This is a development version of Maxima. The function bug_report() provides bug reporting information. and it seems that the help function within Maxima *is* working: (%i1) ? integrate 0: integrate :(maxima.info)Definitions for Integration. 1: integrate_use_rootsof :Definitions for Integration. Enter space-separated numbers, `all' or `none': Are you sure the maxima*info* files must be unzipped??? (I cannot try right now since our sysadmin already went home and I have no access to the specific directories...) Regards, Bart -- "Share what you know. Learn what you don't." From harald at lefant.net Fri Jan 25 10:15:52 2008 From: harald at lefant.net (Harald Geyer) Date: Fri, 25 Jan 2008 17:15:52 +0100 Subject: [Maxima] maxima-index.list could not be found In-Reply-To: <20080125130002.GA13062@simba> References: <20080125130002.GA13062@simba> Message-ID: Hi Bart, > bartv at archimedes:~$ maxima --version > Maxima 5.12.0 > > bartv at archimedes:~$ dpkg --list | grep maxima-doc > ii maxima-doc 5.12.0-1ubuntu2 > > However, when i try to > access the documentation for a certain command, i get an error > saying that /usr/share/info/maxima-index.lisp could not be found: this problem is already known and reported to the debian (and ubuntu) bug trackers. From the bug log it appears it is fixed in versions >=5.13.0-2 which currently are only available for the developement version of ubuntu. > Secondly, taken into account that our sysadmins might have to install maxima > on quite some other computers, what is the best way to solve this > problem? Manually installing the .deb and then each time > unzipping and copying might be cumbersome... Installing a newer version of ubuntu or debian is one possibility. If that is not an option, then I recommend to backport the package: Take the latest debian source package (or any other version you see fit your needs) and build it with the version of ubuntu, you want to use it on. The resulting binary packages should work on any ubuntu system that is the same version as the one used to build them. Once you have the binary packages built you can easily install them on all the other computers. HTH, Harald From ldevlaming at geomatrix.com Fri Jan 25 11:12:25 2008 From: ldevlaming at geomatrix.com (Len de Vlaming) Date: Fri, 25 Jan 2008 09:12:25 -0800 Subject: [Maxima] seeking help with solving implicit equation Message-ID: <57F450F4E0A70C44B805FFE9AF0C5432FFC916@gmxmail1.geomatrix.com> Folks, I'm writing a routine which makes use of the Colebrook equation for calculating friction factors: 1/sqrt(f) = -2log(e/3.7D + 2.51 / (Re*sqrt(f)) In other words, the equation is implicit in the friction factor f. How do I properly define the equation and solve for f once I have defined e, D, Re? I thought it was as simple as 1/sqrt(f):= ..etc.., define the other variables via the : operator and solve (%,f) but this makes Maxima swear at me. It seems like this should be fairly straightforward root finding, but then again I am not a mathematician and there's likely some fundamental problem staring me full in the face. A clue for the clueless? Thanks Len Len de Vlaming Project Consultant Geomatrix Consultants 420 Weber St. N, Unit G Waterloo, Ontario N2L 4E7 Tel 519 886 7500 ext 224 Cell 519 729 7048 **new** Fax 519 886 7419 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080125/d16f6be0/attachment.htm From macrakis at alum.mit.edu Fri Jan 25 11:24:52 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 25 Jan 2008 12:24:52 -0500 Subject: [Maxima] seeking help with solving implicit equation In-Reply-To: <57F450F4E0A70C44B805FFE9AF0C5432FFC916@gmxmail1.geomatrix.com> References: <57F450F4E0A70C44B805FFE9AF0C5432FFC916@gmxmail1.geomatrix.com> Message-ID: <8b356f880801250924i409f1d03k96d45c648ea6b153@mail.gmail.com> Maxima always prefers to find exact symbolic solutions. This is a transcendental equation and has no exact symbolic solutions, so Maxima gives up (in what sense does it "make Maxima swear at you"?) So you should take a look at the documentation for numerical solutions, assuming that when you say "define" e, Re, D, you mean assigning them a specific numerical value. Try ? find_root for more information. -s On Jan 25, 2008 12:12 PM, Len de Vlaming wrote: > 1/sqrt(f) = -2log(e/3.7D + 2.51 / (Re*sqrt(f))In other words, the > equation is implicit in the friction factor f. > How do I properly define the equation and solve for f once I have defined e, > D, Re? I thought it was as simple as > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080125/0a35a809/attachment.htm From aeder at arcor.de Fri Jan 25 11:29:21 2008 From: aeder at arcor.de (Andreas Eder) Date: Fri, 25 Jan 2008 18:29:21 +0100 Subject: [Maxima] todd-coxeter Message-ID: <51885.1201282161@staffa.eder.local> There are two almost identical copies of the file todd-coxter.lisp in the maxima source; one in the src directory, the other in share/affine. The difference is - apart from white-space - that the version in share uses sloop instead of loop. Does anyone know why things are the way they are? Am I missing something? Can we remove the one in share/affine ` best wishes for the weekend 'Andreas -- Wherever I lay my .emacs, there's my $HOME. From nikos.ap at gmail.com Fri Jan 25 11:53:45 2008 From: nikos.ap at gmail.com (Nikos Apostolakis) Date: Fri, 25 Jan 2008 12:53:45 -0500 Subject: [Maxima] Finding roots of sextic in radicals References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <200801251127.44499.andre.maute@gmx.de> <8b356f880801250439t88ba311j6cdf9843e6fe2508@mail.gmail.com> <200801251510.46165.andre.maute@gmx.de> <873aslykjz.fsf@Sullivan.bcc.cuny.edu> <479A09D8.3070006@ericsson.com> Message-ID: <87y7adx046.fsf@Sullivan.bcc.cuny.edu> "Raymond Toy (RT/EUS)" writes: > Nikos Apostolakis wrote: >> Actually in z3, all sines and cosines occur in the form >> sin(atan(expr)) and cos(atan(expr)) where expr are some expresions >> involving square roots. So using pythagorean theorem one can in >> principle get an expression involving only radicals from that. >> >> So I guess the next question is: is there a global variable that >> setting it true will cause maxima to simplify sin(atan(x)) to >> x/sqrt(1-x^2)? > > sin(atan(x)) already returns x/sqrt(1-x^2). > Great! > But the expressions aren't sin(atan(x)). They're sin(atan(x)/3). Indeed. I should have been more carefull. > To simplify that, I think you need to solve a cubic, which will > probably give another expression containing sin's. > Right! If a = sin(x/3) and c =sin(x) then a is the soloution of the equation: 3a - 4a^3 = c, Sorry for the noise, Nikos From raymond-rogers at idexx.com Fri Jan 25 13:06:56 2008 From: raymond-rogers at idexx.com (Rogers, Raymond) Date: Fri, 25 Jan 2008 14:06:56 -0500 Subject: [Maxima] seeking help with solving implicit equation In-Reply-To: <57F450F4E0A70C44B805FFE9AF0C5432FFC916@gmxmail1.geomatrix.com> References: <57F450F4E0A70C44B805FFE9AF0C5432FFC916@gmxmail1.geomatrix.com> Message-ID: <79FBAE1FB074294FB54941CEF4AA5D8101C0BF96@Verona.namerica.idexxi.com> : [Maxima] seeking help with solving implicit equation Folks, I'm writing a routine which makes use of the Colebrook equation for calculating friction factors: 1/sqrt(f) = -2log(e/3.7D + 2.51 / (Re*sqrt(f)) In other words, the equation is implicit in the friction factor f. How do I properly define the equation and solve for f once I have defined e, D, Re? I thought it was as simple as 1/sqrt(f):= ..etc.., define the other variables via the : operator and solve (%,f) but this makes Maxima swear at me. It seems like this should be fairly straightforward root finding, but then again I am not a mathematician and there's likely some fundamental problem staring me full in the face. A clue for the clueless? Thanks Len Len de Vlaming Project Consultant If you expand the log 1/sqrt(f) -log(sqrt(f)) = g(e,D,Re) which looks to be solvable as Lambert's function. RayR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080125/10b993a4/attachment.htm From raymond-rogers at idexx.com Fri Jan 25 13:19:22 2008 From: raymond-rogers at idexx.com (Rogers, Raymond) Date: Fri, 25 Jan 2008 14:19:22 -0500 Subject: [Maxima] seeking help with solving implicit equation In-Reply-To: <79FBAE1FB074294FB54941CEF4AA5D8101C0BF96@Verona.namerica.idexxi.com> References: <57F450F4E0A70C44B805FFE9AF0C5432FFC916@gmxmail1.geomatrix.com> <79FBAE1FB074294FB54941CEF4AA5D8101C0BF96@Verona.namerica.idexxi.com> Message-ID: <79FBAE1FB074294FB54941CEF4AA5D8101C0BFA6@Verona.namerica.idexxi.com> ________________________________ From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Rogers, Raymond Sent: Friday, January 25, 2008 2:07 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] seeking help with solving implicit equation : [Maxima] seeking help with solving implicit equation Folks, I'm writing a routine which makes use of the Colebrook equation for calculating friction factors: 1/sqrt(f) = -2log(e/3.7D + 2.51 / (Re*sqrt(f)) In other words, the equation is implicit in the friction factor f. How do I properly define the equation and solve for f once I have defined e, D, Re? I thought it was as simple as 1/sqrt(f):= ..etc.., define the other variables via the : operator and solve (%,f) but this makes Maxima swear at me. It seems like this should be fairly straightforward root finding, but then again I am not a mathematician and there's likely some fundamental problem staring me full in the face. A clue for the clueless? Thanks Len Len de Vlaming Project Consultant If you expand the log 1/sqrt(f) -log(sqrt(f)) = g(e,D,Re) which looks to be solvable as Lambert's function. RayR Sorry, I misparsed the equation. It's a little more complicated. RayR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080125/a24fb3b3/attachment.htm From macrakis at alum.mit.edu Fri Jan 25 13:59:40 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 25 Jan 2008 14:59:40 -0500 Subject: [Maxima] seeking help with solving implicit equation In-Reply-To: <79FBAE1FB074294FB54941CEF4AA5D8101C0BF96@Verona.namerica.idexxi.com> References: <57F450F4E0A70C44B805FFE9AF0C5432FFC916@gmxmail1.geomatrix.com> <79FBAE1FB074294FB54941CEF4AA5D8101C0BF96@Verona.namerica.idexxi.com> Message-ID: <8b356f880801251159o55da3adejd9febc6ca301db89@mail.gmail.com> On Jan 25, 2008 2:06 PM, Rogers, Raymond wrote: > If you expand the log > 1/sqrt(f) -log(sqrt(f)) = g(e,D,Re) > which looks to be solvable as Lambert's function. > > Even if that is true, Maxima doesn't know anything about the Lambert W function: it doesn't use it to solve equations, doesn't know anything about its simplification, and doesn't know how to evaluate it numerically.... -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080125/6dd58513/attachment.htm From dlakelan at street-artists.org Fri Jan 25 22:43:31 2008 From: dlakelan at street-artists.org (dlakelan) Date: Fri, 25 Jan 2008 20:43:31 -0800 Subject: [Maxima] seeking help with solving implicit equation In-Reply-To: <57F450F4E0A70C44B805FFE9AF0C5432FFC916@gmxmail1.geomatrix.com> References: <57F450F4E0A70C44B805FFE9AF0C5432FFC916@gmxmail1.geomatrix.com> Message-ID: <479ABA73.20009@street-artists.org> Len de Vlaming wrote: > Folks, > > > > I?m writing a routine which makes use of the Colebrook equation for > calculating friction factors: > 1/sqrt(f) = -2log(e/3.7D + 2.51 / (Re*sqrt(f)) Ah hydraulics... an excellent use for maxima, but can only be solved by numerical methods. here's an example of how to solve for f after plugging in Re=17000, e=.01, and D=.25. Note than in maxima "log" means natural log. However this equation is defined in terms of log base 10 I believe. (%i1) eqn:1/sqrt(f)+2*log(e/D/3.7+2.51/Re/sqrt(f))/log(10); .2702702702702702 e 2.51 2 log(------------------- + ----------) D sqrt(f) Re 1 (%o1) --------------------------------------- + ------- log(10) sqrt(f) (%i2) find_root( subst([e=.01,D=.25,Re=17000],eqn),f,1e-7,1); (%o2) .06617475278925225 (%i3) From rupert.swarbrick at lineone.net Sat Jan 26 09:29:09 2008 From: rupert.swarbrick at lineone.net (Rupert Swarbrick) Date: Sat, 26 Jan 2008 15:29:09 +0000 Subject: [Maxima] Testing framework for lisp code too Message-ID: <20080126152909.3feeaa9f@herring> Hi, I'm attaching a patch to current HEAD which adds support for lisp unit tests to go with the existing .mac ones. Basically, the changes are in mload.lisp - after a ;;;;; Test framework definitions ;;;;; banner. The interface for putting in lisp unit tests is that 1) You add your .lisp file to the tests directory 2) Add the name of that file (sans .lisp) to $testsuite_lisp_files in testsuite.lisp 3) Fill your file with calls to test-forms-equal. For example, (test-forms-equal "bfloatp false" nil ($bfloatp 1) ($bfloatp '$x) ($bfloatp #$1/2$) ($bfloatp #$0.7$)) (test-forms-equal "this will fail" nil t) where the string is just a name tag to make it easier to find failures (failures also get tagged with the test # in the file). I hope this will be considered suitable for inclusion - it would make adding tests to the internals a lot less painful than having to sort of code it all up from maxima code. Obviously, more tests could be added as well as test-forms-equal - I couldn't think of anything else immediately, so decided to get this working to start with. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: lisp-testing.diff Type: text/x-patch Size: 10661 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080126/7c18447d/attachment.bin From toy.raymond at gmail.com Sat Jan 26 10:03:32 2008 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 26 Jan 2008 11:03:32 -0500 Subject: [Maxima] Tab width In-Reply-To: <20080124222356.60fbc8a3@herring> References: <20080124222356.60fbc8a3@herring> Message-ID: <479B59D4.5050503@gmail.com> Rupert Swarbrick wrote: > This is a small question, but am I right in thinking maxima uses a > tab-width of 8 in general? > > Good question. I don't know what the "official" value is, but I use a tab-width of 8. And all Lisp code that I've ever seen seems to use that. Or uses spaces instead of tabs---I never really had to look. Ray From toy.raymond at gmail.com Sat Jan 26 10:06:34 2008 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 26 Jan 2008 11:06:34 -0500 Subject: [Maxima] Testing framework for lisp code too In-Reply-To: <20080126152909.3feeaa9f@herring> References: <20080126152909.3feeaa9f@herring> Message-ID: <479B5A8A.1060901@gmail.com> Rupert Swarbrick wrote: > Hi, > > I'm attaching a patch to current HEAD which adds support for lisp unit > tests to go with the existing .mac ones. > I think it would be nice, if someone has figured out enough about the lisp code to make a test, to also add a corresponding maxima test that would go through that lisp function, if possible. Also, if we're adding a lisp level unit test, should we consider some of the already existing Lisp unit test frameworks? I've only used RT (see cliki.net) but it works fine for what I wanted. Ray From sen1 at math.msu.edu Sat Jan 26 10:11:17 2008 From: sen1 at math.msu.edu (S. Newhouse) Date: Sat, 26 Jan 2008 11:11:17 -0500 Subject: [Maxima] question about the use of bfloat Message-ID: <479B5BA5.6000709@math.msu.edu> Hello, I asked this kind of question before in a less specific way. Maybe there is a better answer to the question as posed in this message. I am developing a set of routines for interval arithmetic with extended precision using bfloat. For instance, if one defines the sum of intervals [a,b], [c,d] (with 0 < a < b and 0 < c < d) as Iplus([a,b],[c,d])=[a+c, b+d], then I would define bIplus([a,b],[c,d]) = [bfloat(a)+bfloat(c), bfloat(b) + bfloat(d)] etc. It seems that I have to put in 'bfloat' in every representation of a real number. Is there a way to declare all variables to be evaluated using 'bfloat' without simply applying 'bfloat' to every occurrence? TIA, -sen From toy.raymond at gmail.com Sat Jan 26 10:31:52 2008 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 26 Jan 2008 11:31:52 -0500 Subject: [Maxima] question about the use of bfloat In-Reply-To: <479B5BA5.6000709@math.msu.edu> References: <479B5BA5.6000709@math.msu.edu> Message-ID: <479B6078.8060606@gmail.com> S. Newhouse wrote: > It seems that I have to put in 'bfloat' in every representation of a > real number. > > Is there a way to declare all variables to be evaluated using 'bfloat' > without simply applying 'bfloat' to every occurrence? > > > Not that I know of. But bfloat's are contagious so any mixed operation with a bfloat makes the result a bfloat. Ray From Martin.Bund at danfoss.com Fri Jan 25 10:09:09 2008 From: Martin.Bund at danfoss.com (Bund Martin) Date: Fri, 25 Jan 2008 17:09:09 +0100 Subject: [Maxima] help on solving an equation containing exponential functions In-Reply-To: <47999718.3040805@tomsweb.net> References: <47991B1F.9030902@tomsweb.net> <47999718.3040805@tomsweb.net> Message-ID: Hi, I am looking for a way to do the following: eqn:U2=(Rn*Ub*%e^B(1/T-1/Tn))/(Rn*%e^B(1/T-1/Tn)+Rv); solve(eqn, T); Maxima gives me the result []. However, my collegue says he found a solution with Mathematica. Can I do something similar with Maxima? Thanks in advance for your help on this probably simple problem - Martin From wally at mpi.int.pl Fri Jan 25 11:27:45 2008 From: wally at mpi.int.pl (wally) Date: Fri, 25 Jan 2008 18:27:45 +0100 Subject: [Maxima] sequence of variables Message-ID: <200801251827.46022.wally@mpi.int.pl> Hi, Why do Maxima change sequence of variables ? e.g. (a + b)? gives (b + a)? (a - b)? gives (a - b)? no exchange (a +b) * (a+b) givews : (b+ a)? (a + b +c)? gives (c + b + a)? can i change this behavior ? regards wally From klin at umd.edu Sat Jan 26 08:54:06 2008 From: klin at umd.edu (Kun Lin ) Date: Sat, 26 Jan 2008 09:54:06 -0500 Subject: [Maxima] uninstalling a previous maxima version Message-ID: Hi all, I just updated my Maxima version to 5.14 from 5.13. Is there a recommended way to remove the previous version. I am using Ubuntu. - Kun From klin at umd.edu Sat Jan 26 10:11:04 2008 From: klin at umd.edu (Kun Lin ) Date: Sat, 26 Jan 2008 11:11:04 -0500 Subject: [Maxima] converting to 2-d list or array Message-ID: Hi all, In maxima a 2X2 matrix [1 2] [3 4] is represented as (($matrix simp) ((mlist simp) 1 2) (mlist simp) 3 4)) how do i covert it into a 2-d array or a nested list( is there an exisiting function that does this?) like #2A((1 2) (3 4)) or '((1 2) (3 4)) ? - Kun From robert.dodier at gmail.com Sat Jan 26 10:37:08 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 26 Jan 2008 09:37:08 -0700 Subject: [Maxima] seeking help with solving implicit equation In-Reply-To: <479ABA73.20009@street-artists.org> References: <57F450F4E0A70C44B805FFE9AF0C5432FFC916@gmxmail1.geomatrix.com> <479ABA73.20009@street-artists.org> Message-ID: On 1/25/08, dlakelan wrote: > here's an example of how to solve for f after plugging in Re=17000, > e=.01, and D=.25. Note than in maxima "log" means natural log. However > this equation is defined in terms of log base 10 I believe. As it happens there is an add-on package for log10. See the comment header of share/contrib/log10.mac for more info. (%i1) display2d : false; (%o1) false (%i2) load (log10); (%o2) "/usr/local/share/maxima/5.14.0cvs/share/contrib/log10.mac" (%i3) eqn : 1/sqrt(f) + 2*log10(e/D/3.7 + 2.51/Re/sqrt(f)); (%o3) 2*log10(.2702702702702702*e/D+2.51/(sqrt(f)*Re))+1/sqrt(f) (%i4) find_root (eqn, f, 1e-7, 1), e=.01, D=.25, Re=17000; (%o4) .06617475278925225 HTH Robert Dodier From robert.dodier at gmail.com Sat Jan 26 10:52:15 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 26 Jan 2008 09:52:15 -0700 Subject: [Maxima] todd-coxeter In-Reply-To: <51885.1201282161@staffa.eder.local> References: <51885.1201282161@staffa.eder.local> Message-ID: On 1/25/08, Andreas Eder wrote: > There are two almost identical copies of the file todd-coxter.lisp > in the maxima source; one in the src directory, the other in > share/affine. > The difference is - apart from white-space - that the version in > share uses sloop instead of loop. Looks like src/todd-coxeter.lisp has also been slightly polished in other ways as well. > Does anyone know why things are the way they are? Am I missing > something? I'm guessing src/todd-coxeter.lisp was put there by Bill Schelter. The cvs log for share/affine says that all of Schelter's affine package was committed later. > Can we remove the one in share/affine ` My recommendation is to remove share/affine/todd-coxeter.lisp and move src/todd-coxeter.lisp to share/affine. Thanks for taking a look at this. Robert From willisb at unk.edu Sat Jan 26 11:05:08 2008 From: willisb at unk.edu (Barton Willis) Date: Sat, 26 Jan 2008 11:05:08 -0600 Subject: [Maxima] help on solving an equation containing exponential functions In-Reply-To: References: <47991B1F.9030902@tomsweb.net> <47999718.3040805@tomsweb.net>, Message-ID: Is your equation is missing a multiplication between B and (1/T - 1/Tn)? If so, Maxima solves eqn: (%i1) eqn:U2=(Rn*Ub*%e^(B*(1/T-1/Tn)))/(Rn*%e^(B * (1/T-1/Tn))+Rv); (%o1) U2=(Rn*Ub*%e^(B*(1/T-1/Tn)))/(Rn*%e^(B*(1/T-1/Tn))+Rv) (%i2) solve(eqn,T); (%o2) [T=(Tn*B)/(Tn*log((Rv*U2)/(Rn*Ub-Rn*U2))+B)] Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: >From: "Bund Martin" >Sent by: maxima-bounces at math.utexas.edu >Date: 01/25/2008 10:09AM >Subject: [Maxima] help on solving an equation containing >exponential functions > >Hi, > >I am looking for a way to do the following: > >eqn:U2=(Rn*Ub*%e^B(1/T-1/Tn))/(Rn*%e^B(1/T-1/Tn)+Rv); >solve(eqn, T); > >Maxima gives me the result []. However, my collegue says he found a >solution with Mathematica. Can I do something similar with Maxima? > >Thanks in advance for your help on this probably simple problem >- Martin > >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Sat Jan 26 11:16:41 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 26 Jan 2008 10:16:41 -0700 Subject: [Maxima] question about the use of bfloat In-Reply-To: <479B5BA5.6000709@math.msu.edu> References: <479B5BA5.6000709@math.msu.edu> Message-ID: On 1/26/08, S. Newhouse wrote: > For instance, if one defines the sum of intervals [a,b], [c,d] (with 0 > < a < b and 0 < c < d) as > Iplus([a,b],[c,d])=[a+c, b+d], > then I would define > bIplus([a,b],[c,d]) = [bfloat(a)+bfloat(c), bfloat(b) + bfloat(d)] (On a tangent: this shows a "destructuring bind" style of function definition that could be generally useful. Maxima can do something similar with pattern matching but expressed in Maxima's pattern matching language, it is quite a bit more obscure.) > It seems that I have to put in 'bfloat' in every representation of a > real number. > > Is there a way to declare all variables to be evaluated using 'bfloat' > without simply applying 'bfloat' to every occurrence? Not that I know of. Another way to approach this is to define an operator, let's say "bf+", which applies bigfloat conversion to its arguments, e.g. nary ("bf+"); "bf+" ([L]) := apply ("+", bfloat (L)); 1 bf+ %pi bf+ %e; => 6.859874482048838b0 bIplus (I1, I2) := [I1[1] bf+ I2[1], I1[2] bf+ I2[2]]; bIplus ([%e, 10], [1, %pi]); => [3.718281828459045b0, 1.314159265358979b1] Writing "bf+" has the advantage that one can tell from reading an isolated expression (e.g. I1[2] bf+ I2[2]) that bigfloat conversion is applied to the arguments. If the conversion were controlled by some global variable, you would have to read the whole program and keep the global state in mind when reading each expression. (This is a general argument against global variables btw.) I wonder if you really need to enforce bigfloat arithmetic. Users might expect, extrapolating from Maxima's general treatment of integers and rationals, that an operation on exact intervals yields another exact interval. HTH Robert From willisb at unk.edu Sat Jan 26 11:27:01 2008 From: willisb at unk.edu (Barton Willis) Date: Sat, 26 Jan 2008 11:27:01 -0600 Subject: [Maxima] converting to 2-d list or array In-Reply-To: References: Message-ID: If there is a standard way to do this, I can't think of it. This might work: (%i3) mat : matrix([1,2],[3,4]); (%o3) matrix([1,2],[3,4]) (%i9) load(linearalgebra)$ (%i10) :lisp(maxima-to-array $mat); #2A((1 2) (3 4)) It's poor practice to use non user level functions. This is especially true when they are in /share and not /src. Such functions might change or be expunged without notice. Also, Maxima's support for CL arrays is full of bugs, I think. So be careful with that too. Before you get carried away, try searching the bug list for things like use_fast_arrays. Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: "maxima at math.utexas.edu" >From: "Kun Lin " >Sent by: maxima-bounces at math.utexas.edu >Date: 01/26/2008 10:11AM >Subject: [Maxima] converting to 2-d list or array > >Hi all, > > In maxima a 2X2 matrix > [1 2] > [3 4] >is represented as (($matrix simp) > ((mlist simp) 1 2) > (mlist simp) 3 4)) > >how do i covert it into a 2-d array or a nested list( is there an >exisiting function that does this?) > >like #2A((1 2) (3 4)) or '((1 2) (3 4)) ? > >- Kun >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From rupert.swarbrick at lineone.net Sat Jan 26 12:01:59 2008 From: rupert.swarbrick at lineone.net (Rupert Swarbrick) Date: Sat, 26 Jan 2008 18:01:59 +0000 Subject: [Maxima] uninstalling a previous maxima version In-Reply-To: References: Message-ID: <20080126180159.6e444bd3@herring> On Sat, 26 Jan 2008 09:54:06 -0500 "Kun Lin " wrote: > Hi all, > > I just updated my Maxima version to 5.14 from 5.13. Is there a > recommended way to remove the previous version. > > I am using Ubuntu. > > > - Kun Hi, you'll need to give a bit more information. If you mean that you used the ubuntu package each time, then ubuntu's packaging system (apt) will have deleted the old one while upgrading already. If you compiled them both from source, then it's a less trivial problem. Possibly someone else who knows more about the project can let you know exactly what files will have been installed and need getting rid of. Rupert From sen1 at math.msu.edu Sat Jan 26 12:16:39 2008 From: sen1 at math.msu.edu (S. Newhouse) Date: Sat, 26 Jan 2008 13:16:39 -0500 Subject: [Maxima] question about the use of bfloat In-Reply-To: References: <479B5BA5.6000709@math.msu.edu> Message-ID: <479B7907.4050905@math.msu.edu> Robert Dodier wrote: > On 1/26/08, S. Newhouse wrote: > > >> For instance, if one defines the sum of intervals [a,b], [c,d] (with 0 >> < a < b and 0 < c < d) as >> Iplus([a,b],[c,d])=[a+c, b+d], >> then I would define >> bIplus([a,b],[c,d]) = [bfloat(a)+bfloat(c), bfloat(b) + bfloat(d)] >> > > (On a tangent: this shows a "destructuring bind" style of function definition > that could be generally useful. Maxima can do something similar with > pattern matching but expressed in Maxima's pattern matching language, > it is quite a bit more obscure.) > > >> It seems that I have to put in 'bfloat' in every representation of a >> real number. >> >> Is there a way to declare all variables to be evaluated using 'bfloat' >> without simply applying 'bfloat' to every occurrence? >> > > Not that I know of. Another way to approach this is to define an > operator, let's say "bf+", which applies bigfloat conversion to its > arguments, e.g. > > nary ("bf+"); > "bf+" ([L]) := apply ("+", bfloat (L)); > > 1 bf+ %pi bf+ %e; > => 6.859874482048838b0 > > bIplus (I1, I2) := [I1[1] bf+ I2[1], I1[2] bf+ I2[2]]; > bIplus ([%e, 10], [1, %pi]); > => [3.718281828459045b0, 1.314159265358979b1] > > Writing "bf+" has the advantage that one can tell from reading > an isolated expression (e.g. I1[2] bf+ I2[2]) that bigfloat conversion > is applied to the arguments. If the conversion were controlled by > some global variable, you would have to read the whole program > and keep the global state in mind when reading each expression. > (This is a general argument against global variables btw.) > > I wonder if you really need to enforce bigfloat arithmetic. > Users might expect, extrapolating from Maxima's general treatment > of integers and rationals, that an operation on exact intervals > yields another exact interval. > > HTH > > Robert > . > > Thanks for the answer. The ideas you mentioned may be very helpful. On the need for bfloat, the issue is speed. I want to use maxima as an aid to rigorous computation for Dynamical Systems (i.e., iteration of maps and solutions of differential equations) Consider the following. (%i282) Nest(f, x, n) := block(for i thru n do x : f(x), val : x); Evaluation took 0.00 seconds (0.00 elapsed) using 152 bytes. (%o282) Nest(f, x, n) := block(for i thru n do x : f(x), val : x) (%i283) showtime: true; Evaluation took 0.00 seconds (0.00 elapsed) using 56 bytes. (%o283) true (%i284) f(x):= 4*x*(1-x); Evaluation took 0.00 seconds (0.00 elapsed) using 152 bytes. (%o284) f(x) := 4 x (1 - x) (%i285) ff(x):= bfloat(4)*bfloat(x)*(bfloat(1)-bfloat(x)); Evaluation took 0.00 seconds (0.00 elapsed) using 152 bytes. (%o285) ff(x) := bf(4) bf(x) (bf(1) - bf(x)) (%i286) fpprec: 50; Evaluation took 0.00 seconds (0.00 elapsed) using 344 bytes. (%o286) 50 (%i287) Nest(f,1/5,19)$ Evaluation took 38.75 seconds (38.75 elapsed) using 24.966 MB. (%i288) Nest(ff,bfloat(.2),19)$ Evaluation took 0.01 seconds (0.00 elapsed) using 74.375 KB. The function 'Nest(f,x,n)' computes the nth iterate of the point x for the function f(x). In rational arithmetic this is terribly slow--the 19th iterate for f(x):= 4*x*(1-x) for x = 1/5 took almost 39 seconds. My guess is that trying to do this on a 3d differential equation with an extended precision 4th order Runge-Kutta (stepsize=.01, number of steps 100) would be unbearable. But the bfloat version of 'Nest(f,.2,19)' took only 0.01 seconds even with precision of 50 digits. If anyone can tell me how to speed up the rational arithmetic version, I would be delighted. I tried 'compile(all)' but it made no real difference. I wonder if the problem might be that in rational arithmetic repeated many times, the rational numbers get very large numerators and denominators. Would this be related to the slowness? Thanks, -sen From fateman at cs.berkeley.edu Sat Jan 26 14:01:20 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Sat, 26 Jan 2008 12:01:20 -0800 Subject: [Maxima] question about the use of bfloat In-Reply-To: References: <479B5BA5.6000709@math.msu.edu> Message-ID: <479B9190.3010202@cs.berkeley.edu> If a,b,c,d are all bfloats, or even if only one of a,c and one of b,d are bfloats, then [a+c,b+d] is all you have to do. If they are not, why would you round the endpoints of an interval, potentially losing some of it? Nevertheless.. If a, b,c,d are all double-floats or rationals or integers or .... then all you have to do is [bfloat(a+c), bfloat(b+d)] But bfloats are not all the same, since they depend on fpprec. Also what you are doing is actually "wrong" because of rounding issues, if you want rigorous intervals. Are you aware of the work by Chee Yap (at NYU) or other work on geometric calculations, e.g. at Berkeley, Jonathan Shewchuk? And yes, iterated rational computations often make numerator and denominator grow in size. Finding a "small" approximation to a rational number is often possible, though. Robert Dodier wrote: > On 1/26/08, S. Newhouse wrote: > > >> For instance, if one defines the sum of intervals [a,b], [c,d] (with 0 >> < a < b and 0 < c < d) as >> Iplus([a,b],[c,d])=[a+c, b+d], >> then I would define >> bIplus([a,b],[c,d]) = [bfloat(a)+bfloat(c), bfloat(b) + bfloat(d)] >> > > (On a tangent: this shows a "destructuring bind" style of function definition > that could be generally useful. Maxima can do something similar with > pattern matching but expressed in Maxima's pattern matching language, > it is quite a bit more obscure.) > > >> It seems that I have to put in 'bfloat' in every representation of a >> real number. >> >> Is there a way to declare all variables to be evaluated using 'bfloat' >> without simply applying 'bfloat' to every occurrence? >> > > Not that I know of. Another way to approach this is to define an > operator, let's say "bf+", which applies bigfloat conversion to its > arguments, e.g. > > nary ("bf+"); > "bf+" ([L]) := apply ("+", bfloat (L)); > > 1 bf+ %pi bf+ %e; > => 6.859874482048838b0 > > bIplus (I1, I2) := [I1[1] bf+ I2[1], I1[2] bf+ I2[2]]; > bIplus ([%e, 10], [1, %pi]); > => [3.718281828459045b0, 1.314159265358979b1] > > Writing "bf+" has the advantage that one can tell from reading > an isolated expression (e.g. I1[2] bf+ I2[2]) that bigfloat conversion > is applied to the arguments. If the conversion were controlled by > some global variable, you would have to read the whole program > and keep the global state in mind when reading each expression. > (This is a general argument against global variables btw.) > > I wonder if you really need to enforce bigfloat arithmetic. > Users might expect, extrapolating from Maxima's general treatment > of integers and rationals, that an operation on exact intervals > yields another exact interval. > > HTH > > Robert > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From robert.dodier at gmail.com Sat Jan 26 14:36:36 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 26 Jan 2008 13:36:36 -0700 Subject: [Maxima] sequence of variables In-Reply-To: <200801251827.46022.wally@mpi.int.pl> References: <200801251827.46022.wally@mpi.int.pl> Message-ID: On 1/25/08, wally wrote: > Why do Maxima change sequence of variables ? Hi Wally. There are two things going on here. One is that Maxima tries to arrange expressions into a so-called canonical form. The other is that Maxima has ideas about how to display the canonical form of an expression. > can i change this behavior ? Yes, via the global flag "powerdisp". powerdisp : false; a + b + c; => c + b + a powerdisp : true; a + b + c; => a + b + c To judge by the name, powerdisp was invented to control the display of polynomials. But it actually affects all "+" expressions. ?? disp finds some info about powerdisp and other display variables. HTH Robert Dodier From macrakis at alum.mit.edu Sat Jan 26 14:40:53 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 26 Jan 2008 15:40:53 -0500 Subject: [Maxima] Tab width In-Reply-To: <20080124222356.60fbc8a3@herring> References: <20080124222356.60fbc8a3@herring> Message-ID: <8b356f880801261240i4c773712r6a270eb40fa1e881@mail.gmail.com> Yes, tab means move to the next column position divisible by 8. So N tabs at the beginning of a line is equivalent to 8*N spaces. This is a very widespread convention at least on Digital/DEC and Unix systems. -s On 1/24/08, Rupert Swarbrick wrote: > This is a small question, but am I right in thinking maxima uses a > tab-width of 8 in general? > > (This _really_ _really_ isn't a complaint - I just want to see the same > indentation as everyone else.) > > Rupert > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Sent from Gmail for mobile | mobile.google.com From woollett at charter.net Sat Jan 26 15:44:23 2008 From: woollett at charter.net (Edwin Woollett) Date: Sat, 26 Jan 2008 13:44:23 -0800 Subject: [Maxima] factor over complex numbers? Message-ID: <000301c86064$9dcea1e0$0d00a8c0@edwinc367e16bd> Is there any option I can set to get factor(expr1) -> (-%i + x)^5 (%i + x)^5 instead of getting (1 + x^2)^5 ? (%i1) display2d:false$ (%i2) expr1 : expand( (1+x^2)^5 ); (%o2) x^10 + 5*x^8 + 10*x^6 + 10*x^4 + 5*x^2 + 1 (%i3) solve(expr1,x); (%o3) [x = -%i,x = %i] (%i4) multiplicities; (%o4) [5,5] (%i5) factor( expr1 ); (%o5) (x^2+1)^5 I am thinking of something analogous to the Mathematica Factor option GaussianIntegers -> True TIA Ted Woollett From milan at eskimo.com Sat Jan 26 15:55:30 2008 From: milan at eskimo.com (Milan Lukic) Date: Sat, 26 Jan 2008 13:55:30 -0800 Subject: [Maxima] factor over complex numbers? In-Reply-To: <000301c86064$9dcea1e0$0d00a8c0@edwinc367e16bd>; from woollett@charter.net on Sat, Jan 26, 2008 at 01:44:23PM -0800 References: <000301c86064$9dcea1e0$0d00a8c0@edwinc367e16bd> Message-ID: <20080126135530.B2165@eskimo.com> * Edwin Woollett <woollett at charter.net> [2008-01-26 13:44:23 -0800]: > Is there any option I can set to get factor(expr1) -> (-%i + x)^5 (%i + > x)^5 > instead of getting (1 + x^2)^5 ? > factor(expr1,x^2+1); Milan > (%i1) display2d:false$ > > (%i2) expr1 : expand( (1+x^2)^5 ); > > (%o2) x^10 + 5*x^8 + 10*x^6 + 10*x^4 + 5*x^2 + > 1 > (%i3) solve(expr1,x); > > (%o3) [x = -%i,x = %i] > > (%i4) multiplicities; > > (%o4) [5,5] > > (%i5) factor( expr1 ); > > (%o5) (x^2+1)^5 > > I am thinking of something analogous to the Mathematica Factor option > GaussianIntegers -> True > > TIA > Ted Woollett > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- From klin at umd.edu Sat Jan 26 12:20:09 2008 From: klin at umd.edu (Kun Lin) Date: Sat, 26 Jan 2008 13:20:09 -0500 Subject: [Maxima] uninstalling a previous maxima version In-Reply-To: <20080126180159.6e444bd3@herring> References: <20080126180159.6e444bd3@herring> Message-ID: <479B79D9.1060406@umd.edu> Hi all, I installed from source. I was hoping the make file has an uninstall target :-). - Kun Rupert Swarbrick wrote: > On Sat, 26 Jan 2008 09:54:06 -0500 > "Kun Lin " wrote: > > >> Hi all, >> >> I just updated my Maxima version to 5.14 from 5.13. Is there a >> recommended way to remove the previous version. >> >> I am using Ubuntu. >> >> >> - Kun >> > > Hi, you'll need to give a bit more information. If you mean that you > used the ubuntu package each time, then ubuntu's packaging system (apt) > will have deleted the old one while upgrading already. > > If you compiled them both from source, then it's a less trivial > problem. Possibly someone else who knows more about the project can let > you know exactly what files will have been installed and need getting > rid of. > > Rupert > From rupert.swarbrick at lineone.net Sat Jan 26 09:29:09 2008 From: rupert.swarbrick at lineone.net (Rupert Swarbrick) Date: Sat, 26 Jan 2008 15:29:09 +0000 Subject: [Maxima] Testing framework for lisp code too Message-ID: <20080126152909.3feeaa9f@herring> Hi, I'm attaching a patch to current HEAD which adds support for lisp unit tests to go with the existing .mac ones. Basically, the changes are in mload.lisp - after a ;;;;; Test framework definitions ;;;;; banner. The interface for putting in lisp unit tests is that 1) You add your .lisp file to the tests directory 2) Add the name of that file (sans .lisp) to $testsuite_lisp_files in testsuite.lisp 3) Fill your file with calls to test-forms-equal. For example, (test-forms-equal "bfloatp false" nil ($bfloatp 1) ($bfloatp '$x) ($bfloatp #$1/2$) ($bfloatp #$0.7$)) (test-forms-equal "this will fail" nil t) where the string is just a name tag to make it easier to find failures (failures also get tagged with the test # in the file). I hope this will be considered suitable for inclusion - it would make adding tests to the internals a lot less painful than having to sort of code it all up from maxima code. Obviously, more tests could be added as well as test-forms-equal - I couldn't think of anything else immediately, so decided to get this working to start with. Rupert -------------- next part -------------- A non-text attachment was scrubbed... Name: lisp-testing.diff Type: text/x-patch Size: 10661 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080126/7c18447d/attachment-0003.bin From sen1 at math.msu.edu Sat Jan 26 16:21:03 2008 From: sen1 at math.msu.edu (S. Newhouse) Date: Sat, 26 Jan 2008 17:21:03 -0500 Subject: [Maxima] question about the use of bfloat In-Reply-To: <479B9190.3010202@cs.berkeley.edu> References: <479B5BA5.6000709@math.msu.edu> <479B9190.3010202@cs.berkeley.edu> Message-ID: <479BB24F.4030703@math.msu.edu> R Fateman wrote: > If a,b,c,d are all bfloats, or even if only one of a,c and one of > b,d are bfloats, then [a+c,b+d] is all you have to do. If they are > not, why would you round the endpoints of an interval, potentially > losing some of it? > > Nevertheless.. If a, b,c,d are all double-floats or rationals or > integers or .... > > then all you have to do is [bfloat(a+c), bfloat(b+d)] > > But bfloats are not all the same, since they depend on fpprec. > > Also what you are doing is actually "wrong" because of rounding issues, > if you want rigorous intervals. > Are you aware of the work by Chee Yap (at NYU) or other work on > geometric calculations, e.g. > at Berkeley, Jonathan Shewchuk? > > > And yes, iterated rational computations often make numerator and > denominator grow in size. > > > Finding a "small" approximation to a rational number is often possible, > though. > > Robert Dodier wrote: > >> On 1/26/08, S. Newhouse wrote: >> >> >> >>> For instance, if one defines the sum of intervals [a,b], [c,d] (with 0 >>> < a < b and 0 < c < d) as >>> Iplus([a,b],[c,d])=[a+c, b+d], >>> then I would define >>> bIplus([a,b],[c,d]) = [bfloat(a)+bfloat(c), bfloat(b) + bfloat(d)] >>> >>> >> (On a tangent: this shows a "destructuring bind" style of function definition >> that could be generally useful. Maxima can do something similar with >> pattern matching but expressed in Maxima's pattern matching language, >> it is quite a bit more obscure.) >> >> >> >>> It seems that I have to put in 'bfloat' in every representation of a >>> real number. >>> >>> Is there a way to declare all variables to be evaluated using 'bfloat' >>> without simply applying 'bfloat' to every occurrence? >>> >>> >> Not that I know of. Another way to approach this is to define an >> operator, let's say "bf+", which applies bigfloat conversion to its >> arguments, e.g. >> >> nary ("bf+"); >> "bf+" ([L]) := apply ("+", bfloat (L)); >> >> 1 bf+ %pi bf+ %e; >> => 6.859874482048838b0 >> >> bIplus (I1, I2) := [I1[1] bf+ I2[1], I1[2] bf+ I2[2]]; >> bIplus ([%e, 10], [1, %pi]); >> => [3.718281828459045b0, 1.314159265358979b1] >> >> Writing "bf+" has the advantage that one can tell from reading >> an isolated expression (e.g. I1[2] bf+ I2[2]) that bigfloat conversion >> is applied to the arguments. If the conversion were controlled by >> some global variable, you would have to read the whole program >> and keep the global state in mind when reading each expression. >> (This is a general argument against global variables btw.) >> >> I wonder if you really need to enforce bigfloat arithmetic. >> Users might expect, extrapolating from Maxima's general treatment >> of integers and rationals, that an operation on exact intervals >> yields another exact interval. >> >> HTH >> >> Robert >> _______________________________________________ >> 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 > . > > Thanks for the comments. I was not aware of the work of Chee Yap and Shewchuk. I'll look at their papers. But let me way that the example I used before was only to simplify the code to make the question about declaring variables easy to understand. My current defintions of Iplus and bIplus are actually the following. Iplus(x,y):=[ x[1]+y[1]-r_err*(abs(x[1])+abs(y[1])), x[2]+y[2]+r_err*(abs(x[1])+abs(y[1]))]; bIplus(x,y):= [ bf(x[1])+bf(y[1])-bf(r_err)*( bf(abs(x[1]))+ bf(abs(y[1]))), bf(x[2])+bf(y[2])+bf(r_err)*(bf(abs(x[1]))+bf(abs(y[1])))]; Of course, I have them for Iminus, Iprod, Idiv, etc and evaluations of polynomials as well. Here r_err is set to give a particular round-off error: e.g. fpprec: 16, r_err: 1e-16 or fpprec: 50, r_err: 1e-40 (less to avoid the dropping off of the last few bits and get a generous enclosure) Do these still look wrong to you? I am hoping that I get rigorous enclosures of the actual floating point (and big floating point) calculations, but I haven't checked closely yet. I am using that, if op represents a standard arithmetic operation and fop represents its floating point counterpart with precistion eps, then x fop y = (1 + eps)*(x op y) as long as x and y are not too big or too small (I was going to look at this more closely when I get to actually claim something rigorous, but maybe I should do this now). I got this with a quick reading of Kahan's IEEE standard paper. Again, am I missing something here? I did not try yet to go through all the arguments needed to try to prove the statements in Kahan's paper, and I hope I did not misunderstand his paper. For rational data a, b, since bfloat(a+b) only does one conversion, it seems that bfloat(a+b) is closer to the actual sum a+b than bfloat(a) + bfloat(b), so I'll change the definitions accordingly. However, by taking a few extra bits off as in the (fpprec: 50, r_err: 1e-40), isn't the difference between (bfloat(a+b) and bfloat(a) + bfloat(b)) not important? Incidentally, I tried Robert's suggestions about 'bf+', etc. and they work fine, but in doing many operations, the code is about 10% slower than putting the bfloats in directly. I guess this is because the bfloat conversions are done with every operation in maxima whereas using the bfloats for addition directly does many operations in the underlying lisp. I find these kinds of discussions, very useful, but if they are more appropriately done by private email--off the maxima list-- I am happy to do that. Comments? TIA, -sen From woollett at charter.net Sat Jan 26 18:22:12 2008 From: woollett at charter.net (Edwin Woollett) Date: Sat, 26 Jan 2008 16:22:12 -0800 Subject: [Maxima] factor over complex numbers? References: <000301c86064$9dcea1e0$0d00a8c0@edwinc367e16bd> <479BABBB.2090607@cs.berkeley.edu> Message-ID: <000301c8607a$a99cc7c0$0d00a8c0@edwinc367e16bd> thanks, Richard, gfactor(expr1) --> exactly what I wanted -------------- (%i4) display2d:false$ (%i5) gfactor(expr1); (%o5) (x-%i)^5*(x+%i)^5 -------------- ted ----- Original Message ----- From: "R Fateman" To: "Edwin Woollett" Sent: Saturday, January 26, 2008 1:52 PM Subject: Re: [Maxima] factor over complex numbers? > have you tried gfactor? > > Edwin Woollett wrote: >> Is there any option I can set to get factor(expr1) -> (-%i + x)^5 (%i + >> x)^5 >> instead of getting (1 + x^2)^5 ? >> >> (%i1) display2d:false$ >> >> (%i2) expr1 : expand( (1+x^2)^5 ); >> >> (%o2) x^10 + 5*x^8 + 10*x^6 + 10*x^4 + 5*x^2 + >> 1 >> (%i3) solve(expr1,x); >> >> (%o3) [x = -%i,x = %i] >> >> (%i4) multiplicities; >> >> (%o4) [5,5] >> >> (%i5) factor( expr1 ); >> >> (%o5) (x^2+1)^5 >> >> I am thinking of something analogous to the Mathematica Factor option >> GaussianIntegers -> True >> >> TIA >> Ted Woollett From fateman at cs.berkeley.edu Sat Jan 26 19:09:33 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Sat, 26 Jan 2008 17:09:33 -0800 Subject: [Maxima] question about the use of bfloat In-Reply-To: <479BB24F.4030703@math.msu.edu> References: <479B5BA5.6000709@math.msu.edu> <479B9190.3010202@cs.berkeley.edu> <479BB24F.4030703@math.msu.edu> Message-ID: <479BD9CD.1070606@cs.berkeley.edu> I think that your programs are way too elaborate. if a+b is a correctly rounded answer, then a lower bound on a+b is to adjust by one unit in the last place. (or even half a unit if you can do that.) IEEE floats and bfloats are correctly rounded. or should be. From sen1 at math.msu.edu Sat Jan 26 20:49:16 2008 From: sen1 at math.msu.edu (S. Newhouse) Date: Sat, 26 Jan 2008 21:49:16 -0500 Subject: [Maxima] question about the use of bfloat In-Reply-To: <479BD9CD.1070606@cs.berkeley.edu> References: <479B5BA5.6000709@math.msu.edu> <479B9190.3010202@cs.berkeley.edu> <479BB24F.4030703@math.msu.edu> <479BD9CD.1070606@cs.berkeley.edu> Message-ID: <479BF12C.6010509@math.msu.edu> R Fateman wrote: > I think that your programs are way too elaborate. > if a+b is a correctly rounded answer, then a lower bound on a+b is to > adjust by one unit in the last place. (or even half a unit if you can > do that.) > > IEEE floats and bfloats are correctly rounded. > or should be. > > > I see that the IEEE 754 standard gives precise rounding rules for up to 80 bits (extended precision), but I don't see anything about higher precision than 80 bits. Where is the source file for bfloat? TIA, -sen From robert.dodier at gmail.com Sat Jan 26 20:56:55 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 26 Jan 2008 19:56:55 -0700 Subject: [Maxima] question about the use of bfloat In-Reply-To: <479BB24F.4030703@math.msu.edu> References: <479B5BA5.6000709@math.msu.edu> <479B9190.3010202@cs.berkeley.edu> <479BB24F.4030703@math.msu.edu> Message-ID: On 1/26/08, S. Newhouse wrote: > I find these kinds of discussions, very useful, but if they are more > appropriately done by private email--off the maxima list-- I am happy to > do that. I don't see any problem with conducting discussions about specific technical problems on the mailing list. Other people can throw in their $0.02 and the results are preserved in the mailing list archive. Wrt mailing list conversations let me remark that it helps a lot to trim quoted text to just the stuff to which one wishes to respond. best Robert Dodier From toy.raymond at gmail.com Sat Jan 26 21:12:53 2008 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 26 Jan 2008 22:12:53 -0500 Subject: [Maxima] question about the use of bfloat In-Reply-To: <479BF12C.6010509@math.msu.edu> References: <479B5BA5.6000709@math.msu.edu> <479B9190.3010202@cs.berkeley.edu> <479BB24F.4030703@math.msu.edu> <479BD9CD.1070606@cs.berkeley.edu> <479BF12C.6010509@math.msu.edu> Message-ID: <479BF6B5.7070308@gmail.com> S. Newhouse wrote: > R Fateman wrote: > >> I think that your programs are way too elaborate. >> if a+b is a correctly rounded answer, then a lower bound on a+b is to >> adjust by one unit in the last place. (or even half a unit if you can >> do that.) >> >> IEEE floats and bfloats are correctly rounded. >> or should be. >> >> >> >> > I see that the IEEE 754 standard gives precise rounding rules for up to > 80 bits (extended precision), but I don't see anything about higher > precision than 80 bits. > Where is the source file for bfloat? > > src/float.lisp. Richard Fateman wrote most (all?) of that, so if he says they're correctly rounded, they are correctly rounded, barring bugs, of course. I think bfloat uses the same rules for rounding as IEEE 754. Ray From oldenburg at ph-heidelberg.de Sun Jan 27 03:40:09 2008 From: oldenburg at ph-heidelberg.de (Reinhard Oldenburg) Date: Sun, 27 Jan 2008 10:40:09 +0100 Subject: [Maxima] Maxima on the Asus EEEPC Message-ID: <479C5179.3050100@ph-heidelberg.de> Dear Maxima Group, I suggest to produce an easy to install version of Maxima for the Asus EEEPC. This little Linux machine is interesting for (high) schools as a more powerful alternative to computer algebra based calculators. It comes packaged with a dynamic geometry system but not with a computer agebra system. However, the EEEPC has no rpm and thus it is difficult to install Maxima on it. I hardly can find the time to do this, anybody else? Reinhard Oldenburg From pebbles at schattenlauf.de Sun Jan 27 05:10:07 2008 From: pebbles at schattenlauf.de (Hanno Behrens) Date: Sun, 27 Jan 2008 12:10:07 +0100 Subject: [Maxima] Simple question: modulo Message-ID: <200801271210.08302.pebbles@schattenlauf.de> Sorry for such a simple question, but I really can't find the modulo function in maxima. Scanned all documentation but I must be blind or something. For integers like in C 5%4 -> 1 m: matrix( [15,2,7], [8,10,23], [0,2,8]); [12,0,8]*m; Should give the values modulo 26. Can someone help? Really basic problem... Hanno -- Hanno Behrens - Hamburg http://pebbles.schattenlauf.de/ Ceterum censeo microsoft esse delendam From amca01 at gmail.com Sun Jan 27 05:27:47 2008 From: amca01 at gmail.com (Alasdair McAndrew) Date: Sun, 27 Jan 2008 22:27:47 +1100 Subject: [Maxima] Simple question: modulo In-Reply-To: <200801271210.08302.pebbles@schattenlauf.de> References: <200801271210.08302.pebbles@schattenlauf.de> Message-ID: <1d67a53c0801270327k3b35dd44u9613699254842403@mail.gmail.com> "mod" is the modulo function. If you want to apply mod 26 to a matrix m, use matrixmap: matrixmap(lambda([x],mod(x,26)),m); If you don't like the lambda construction you can always create a little function first: mod26(x):=mod(x,26); matrixmap(mod26,m); Hope this helps, Alasdair On Jan 27, 2008 10:10 PM, Hanno Behrens wrote: > Sorry for such a simple question, but I really can't find the modulo > function > in maxima. Scanned all documentation but I must be blind or something. > > For integers like in C 5%4 -> 1 > > m: matrix( [15,2,7], [8,10,23], [0,2,8]); > > [12,0,8]*m; > > Should give the values modulo 26. > > Can someone help? Really basic problem... > > Hanno > -- > Hanno Behrens - Hamburg http://pebbles.schattenlauf.de/ > Ceterum censeo microsoft esse delendam > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080127/1b3f792c/attachment-0001.htm From pebbles at schattenlauf.de Sun Jan 27 05:48:58 2008 From: pebbles at schattenlauf.de (Hanno Behrens) Date: Sun, 27 Jan 2008 12:48:58 +0100 Subject: [Maxima] Simple question: modulo In-Reply-To: <1d67a53c0801270327k3b35dd44u9613699254842403@mail.gmail.com> References: <200801271210.08302.pebbles@schattenlauf.de> <1d67a53c0801270327k3b35dd44u9613699254842403@mail.gmail.com> Message-ID: <200801271248.59009.pebbles@schattenlauf.de> Am Sonntag, 27. Januar 2008 schrieb Alasdair McAndrew: > "mod" is the modulo function. If you want to apply mod 26 to a matrix m, > use matrixmap: > > matrixmap(lambda([x],mod(x,26)),m); > > If you don't like the lambda construction you can always create a little > function first: > > mod26(x):=mod(x,26); > matrixmap(mod26,m); > > Hope this helps, > Alasdair (%i21) m: matrix( [15,2,7], [8,10,23], [0,2,8]); (%i22) matrixmap(lambda([x],mod(x,26)),[12,0,8]*m); (%o22) matrix([24,24,6],[0,0,0],[0,16,12]) Perfect! Why didn't mod(x,y) work, when I tried it? Must have make some simple mistakes I can't remember. The lambda construction would have been beyond my very basic maxima-skills anyway. But I understand the principle now. Thanks, Alasdair. Hanno -- Hanno Behrens - Hamburg http://pebbles.schattenlauf.de/ Ceterum censeo microsoft esse delendam From novakyu at gmail.com Sun Jan 27 05:59:26 2008 From: novakyu at gmail.com (novakyu) Date: Sun, 27 Jan 2008 03:59:26 -0800 Subject: [Maxima] Maxima on the Asus EEEPC In-Reply-To: <479C5179.3050100@ph-heidelberg.de> References: <479C5179.3050100@ph-heidelberg.de> Message-ID: <90e0394c0801270359s5c69fcfbt6ee53dc5360fb266@mail.gmail.com> On Jan 27, 2008 1:40 AM, Reinhard Oldenburg wrote: > system. However, the EEEPC has no rpm and thus it is difficult to > install Maxima on it. EeePC may not come with RPM, but as I recall, it has some minimalist version of Xandros, a Debian-based distro, on it. Why couldn't one install Maxima with a .deb (and surely there are plenty of .deb packages out there)? Or, better yet, students who want to extend the capabilities of EeePC may find that replacing the OS with Debian (here's one forum thread: http://forum.eeeuser.com/viewtopic.php?pid=94965) serves them much better in the long run---after installing Debian, not only can they install maxima with simple "apt-get install maxima", but other numerical packages, such as GNU Octave, and more general tools like Python. Regards, Andrzej P.S. I am not an EeePC owner. I read a lot about it and would like to have one, but I am saving for a new notebook, so I can't. :( From aeder at arcor.de Sun Jan 27 06:17:29 2008 From: aeder at arcor.de (Andreas Eder) Date: Sun, 27 Jan 2008 13:17:29 +0100 Subject: [Maxima] todd-coxeter In-Reply-To: References: <51885.1201282161@staffa.eder.local> Message-ID: <31889.1201436249@staffa.eder.local> Hi Robert, you wrote >My recommendation is to remove share/affine/todd-coxeter.lisp >and move src/todd-coxeter.lisp to share/affine. Since I am not so very well versed in administrative CVS issues, would you please do that? I don't want to mess CVS up. >Thanks for taking a look at this. Always a pleasure :-) In fact, there is still a lot to do with todd-coxeter.lisp. The example in the source does not seem to work or maybe just takes a lot of time - I have to investigate further. There also seems to be premature optimisation at work. 'Andreas From areiner at tph.tuwien.ac.at Sun Jan 27 06:21:05 2008 From: areiner at tph.tuwien.ac.at (Albert Reiner) Date: Sun, 27 Jan 2008 13:21:05 +0100 Subject: [Maxima] question about the use of bfloat In-Reply-To: <479B7907.4050905@math.msu.edu> References: <479B5BA5.6000709@math.msu.edu> <479B7907.4050905@math.msu.edu> Message-ID: <20080127122105.GA19244@tph.tuwien.ac.at> On Sat, Jan 26, 2008 at 01:16:39PM -0500, S. Newhouse wrote: > On the need for bfloat, the issue is speed. As a user (not that I consider this kind of interval arithmetic useful, but that is another issue), I would expect to get exact results for exact inputs, to get floats for float inputs, and to get bfloats for bfloat inputs, with all intervening computations done with the same fpprec. So in my view it is a mistake to allow the user to enter exact rationals when you actually want bfloats. If you really think that automatic conversion might be nice for some particular application, you can still define some frontend function that performs the conversion: frontend_function(a, ..) := the_real_function(bfloat(a), ...) where the_real_function does all the work but knows that it can rely on consistent numeric types. Regards, Albert. From michel.gosse at free.fr Sun Jan 27 06:50:23 2008 From: michel.gosse at free.fr (Michel Gosse) Date: Sun, 27 Jan 2008 13:50:23 +0100 Subject: [Maxima] Maxima on the Asus EEEPC In-Reply-To: <479C5179.3050100@ph-heidelberg.de> References: <479C5179.3050100@ph-heidelberg.de> Message-ID: <200801271350.24009.michel.gosse@free.fr> Easy to install on the EEEPC without changing the original xandros : CRTL ALT T for the terminal sudo kwrite /etc/apt/sources.list add the line : deb http://http.us.debian.org/debian stable main contrib non-free save the file sudo synaptic all the programs for debian may be chosen and installed. I select maxima + wxmaxima, and then apply. After that, maxima and wxmaxima work very well (in a terminal, i type wxmaxima). Best regards Le Sunday 27 January 2008 10:40:09 Reinhard Oldenburg, vous avez ?crit?: > Dear Maxima Group, > > I suggest to produce an easy to install version of Maxima for the Asus > EEEPC. > This little Linux machine is interesting for (high) schools as a more > powerful alternative to computer algebra based calculators. It comes > packaged with a dynamic geometry system but not with a computer agebra > system. However, the EEEPC has no rpm and thus it is difficult to > install Maxima on it. > I hardly can find the time to do this, anybody else? > > Reinhard Oldenburg > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From rswarbrick at googlemail.com Sun Jan 27 09:58:08 2008 From: rswarbrick at googlemail.com (Rupert Swarbrick) Date: Sun, 27 Jan 2008 15:58:08 +0000 Subject: [Maxima] Testing stuff Message-ID: <20080127155808.76c944f1@herring> Hi, I was just wondering if anyone else had comments about lisp/maxima tests? Specifically: - Should there be a test framework allowing one to make tests in lisp - If so, roll our own or use an existing one - possibly via asdf-install or something? - If not, what's the best way to write tests for internal functions from a .mac file? Should it just be lines starting with :lisp ? Rupert From robert.dodier at gmail.com Sun Jan 27 10:54:46 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 27 Jan 2008 09:54:46 -0700 Subject: [Maxima] Testing stuff In-Reply-To: <20080127155808.76c944f1@herring> References: <20080127155808.76c944f1@herring> Message-ID: On 1/27/08, Rupert Swarbrick wrote: > - Should there be a test framework allowing one to make tests in lisp > - If so, roll our own or use an existing one - possibly via > asdf-install or something? > - If not, what's the best way to write tests for internal functions > from a .mac file? Should it just be lines starting with :lisp ? I'm in favor of making it possible to test Lisp functions. We can merge that capability into the existing Maxima unit test framework by recognizing :lisp in test scripts. I'm pretty sure a new, separate Lisp test framework is unnecessary. At present run_testsuite barfs on :lisp in a test script, but that should be relatively easy to fix. best Robert From marik at mendelu.cz Sun Jan 27 14:07:52 2008 From: marik at mendelu.cz (Robert Marik) Date: Sun, 27 Jan 2008 21:07:52 +0100 (MET) Subject: [Maxima] Maxima: textbook Message-ID: Hello is there any book about Maxima? I have the Maxima manual (which is too long) and Minimal Maxima by Robert Dodier (which is very nice and explains many things which are not clear from the voluminious manual, but it is too short). I have visited Docs part on maxima homepage. Is there any printed textbook about Maxima (in English or German)? Thanks. Robert From woollett at charter.net Sun Jan 27 15:01:45 2008 From: woollett at charter.net (Edwin Woollett) Date: Sun, 27 Jan 2008 13:01:45 -0800 Subject: [Maxima] factor over complex numbers? Message-ID: <000301c86127$d3ea5df0$0d00a8c0@edwinc367e16bd> Hi Milan, >> Is there any option I can set to get factor(expr1) -> (-%i + x)^5 (%i + >> x)^5 >> instead of getting (1 + x^2)^5 ? >> >factor(expr1,x^2+1); >Milan I get factor(expr1,x^2+1); --> 0 ted ----------------- (%i1) display2d:false$ (%i2) expr1 : expand( (1+x^2)^5 ); (%o2) x^10+5*x^8+10*x^6+10*x^4+5*x^2+1 (%i3) factor( expr1 ); (%o3) (x^2+1)^5 (%i4) gfactor( expr1 ); (%o4) (x-%i)^5*(x+%i)^5 (%i5) factor( expr1, x^2 + 1 ); (%o5) 0 -------------------- From macrakis at alum.mit.edu Sun Jan 27 16:26:01 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 27 Jan 2008 17:26:01 -0500 Subject: [Maxima] factor over complex numbers? In-Reply-To: <000301c86127$d3ea5df0$0d00a8c0@edwinc367e16bd> References: <000301c86127$d3ea5df0$0d00a8c0@edwinc367e16bd> Message-ID: <8b356f880801271426p4d6ff874i5ea14b9611c052d5@mail.gmail.com> On Jan 27, 2008 4:01 PM, Edwin Woollett wrote: > >> Is there any option I can set to get factor(expr1) -> (-%i + x)^5 (%i > + x)^5 > >> instead of getting (1 + x^2)^5 ? > >factor(expr1,x^2+1); > > I get factor(expr1,x^2+1); --> 0 > The meaning of factor(ppp,qqq) is "factor ppp over the polynomial ring where qqq=0". For example: factor ( x^2 - 2*p*x +2 , p^2-2 ) => (x - p)^2 So if you do factor(x^3+1,x^3+1) you will naturally get 0, since you've told Maxima that x^3+1 = 0. If you want to introduce a new quantity, you need to use a different variable name, e.g. factor(x^4+1,q^2+1) => (x^2 - q) * (x^2 + q) -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080127/f07f4326/attachment.htm From nikos.ap at gmail.com Sun Jan 27 16:29:15 2008 From: nikos.ap at gmail.com (Nikos Apostolakis) Date: Sun, 27 Jan 2008 17:29:15 -0500 Subject: [Maxima] factor over complex numbers? References: <000301c86127$d3ea5df0$0d00a8c0@edwinc367e16bd> Message-ID: <87tzkyx5qc.fsf@Sullivan.bcc.cuny.edu> "Edwin Woollett" writes: >>> Is there any option I can set to get factor(expr1) -> (-%i + x)^5 (%i + >>> x)^5 >>> instead of getting (1 + x^2)^5 ? >>> > >>factor(expr1,x^2+1); I think that this should actually be: factor(expr1, i^2+1); then you get: (x-i)^5*(x+i)^5 and then you can do subst(i=%i, %); to get (x-%i)^5*(x+%i)^5 > >>Milan > > I get factor(expr1,x^2+1); --> 0 > I think the documentation of factor is a bit misleading at this point. `factor(expr1,x^2+1)' does not exactly factor expr1 over the integers with a solution of `x^2 +1' adjoined; ir rather appeats to factor expr1 over the integers with an new element *called `x'* wich is a solution to `x^2+1' adjoined. So if expr1 already contains a variable `x' this variable is effectively set to be a solution of `x^2+1'. For example: factor(x^2-20, a^2-5); ==> (x-2*a)*(x+2*a) factor(x^2-20, x^2-5); ==> -3*5 BTW, is the last result a bug? Nikos From macrakis at alum.mit.edu Sun Jan 27 16:58:04 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 27 Jan 2008 17:58:04 -0500 Subject: [Maxima] factor over complex numbers? In-Reply-To: <87tzkyx5qc.fsf@Sullivan.bcc.cuny.edu> References: <000301c86127$d3ea5df0$0d00a8c0@edwinc367e16bd> <87tzkyx5qc.fsf@Sullivan.bcc.cuny.edu> Message-ID: <8b356f880801271458t53493dfcl3ed72454fa4fee85@mail.gmail.com> On Jan 27, 2008 5:29 PM, Nikos Apostolakis wrote: > factor(expr1, i^2+1);...and then you can do subst(i=%i, %); to get > (x-%i)^5*(x+%i)^5 > For this case, you can just use gfactor. factor(x^2-20, a^2-5); ==> (x-2*a)*(x+2*a) > factor(x^2-20, x^2-5); ==> -3*5 > > BTW, is the last result a bug? > Well, yes and no. Since x^2-5 == 0, x^2-20 == -15, and factor(-15) = -3*5, it is mathematically correct. That said, factoring over the integers is only supposed to happen when the argument is an integer, and the (intentionally) unsimplified form -3*5 can confuse other calculations. So it is a bug, though I'd say a minor one. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080127/7df0e090/attachment.htm From rswarbrick at googlemail.com Sun Jan 27 17:19:34 2008 From: rswarbrick at googlemail.com (Rupert Swarbrick) Date: Sun, 27 Jan 2008 23:19:34 +0000 Subject: [Maxima] Testing stuff In-Reply-To: <20080127155808.76c944f1@herring> References: <20080127155808.76c944f1@herring> Message-ID: <20080127231934.58f2d283@herring> (Aargh! I can't cope with reply all. Sorry if anyone gets this twice...) On Sun, 27 Jan 2008 09:54:46 -0700 "Robert Dodier" wrote: > > At present run_testsuite barfs on :lisp in a test script, but that > should be relatively easy to fix. Ok, I've just had a good look at the code. Lines beginning with ":" are recognised in normal use by dbm-read (!!) in mdebug.lisp, specifically in the cond case lines 312-381. test-batch reads in "lines" of input using mread (called at line 332 of mload.lisp and defined at line 732 of nparse.lisp), which gets an expression's worth from the stream and then returns it in parsed form. However, mread doesn't process stuff that was assigned via defbreak, which is how :lisp gets recognised normally. Now, dbm-read basically tests for weird stuff starting with : or ? and then passes the buck to mread, so there's not as much duplication of functionality as it sounds. So the questions are: 1) What magic symbols (:, ?, ??) do you want to recognise in test-batch? 2) For those that you do wish to recognise, do you want to recognise everything? E.g. :help doesn't really make much sense from a test file. I think a nice solution (once we know what to be matching) is to take some of the "special match" functionality out of dbm-read and make it into a more general function, which you can tell which of :,?,?? to recognise and possibly which specific :blah commands to support. Then we can call that func. from test-batch instead. I don't want to start coding until someone reckons it's a good idea, but I think it's not too many hours of work and would enjoy trying to get it working, so I'd love to hear what you all think. Rupert From macrakis at alum.mit.edu Sun Jan 27 17:21:09 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 27 Jan 2008 18:21:09 -0500 Subject: [Maxima] question about the use of bfloat In-Reply-To: <479B7907.4050905@math.msu.edu> References: <479B5BA5.6000709@math.msu.edu> <479B7907.4050905@math.msu.edu> Message-ID: <8b356f880801271521p504f4e6v460d25237fc60d93@mail.gmail.com> On Jan 26, 2008 1:16 PM, S. Newhouse wrote: > >> Is there a way to declare all variables to be evaluated using 'bfloat' > >> without simply applying 'bfloat' to every occurrence? > bfloat has nothing to do with variables or evaluation; it is a function that converts *values* to their bfloat equivalent. In Maxima (unlike some languages), assigning a value to a variable, or getting the value of a variable, never converts the value. On the other hand, Maxima *does* have the concept of type contagion for numbers. For all arithmetic operations Op, Op(rational,float) => float; Op(rational,bfloat) => bfloat; Op(float,bfloat) => bfloat. The glitch in this scheme is that *symbolic* constants like %pi and %e and exact numeric expressions like sqrt(2) do not participate in this scheme -- though arguably any operation between an exact and an approximate quantity should result in an approximate one, e.g. sqrt(2)+1.0 => 2.414. On the need for bfloat, the issue is speed. I want to use maxima as an > aid to rigorous computation for Dynamical Systems (i.e., iteration of > maps and solutions of differential equations) > A few comments on your code: > Nest(f, x, n) := block(for i thru n do x : f(x), val : x); Why does this function modify the global variable "val"? Is this a return-value convention in some other language? Also, in Maxima, the iteration variable is local. So you can simply write Nest(f, x, n) := ( for i thru n do x : f(x), x ); > (%i284) f(x):= 4*x*(1-x); > (%i285) ff(x):= bfloat(4)*bfloat(x)*(bfloat(1)-bfloat(x)); > (%i287) Nest(f,1/5,19)$ > Evaluation took 38.75 seconds (38.75 elapsed) using 24.966 MB. > Yes, this is giving you the *exact* result. It is the price of precision... > (%i288) Nest(ff,bfloat(.2),19)$ > Evaluation took 0.01 seconds (0.00 elapsed) using 74.375 KB. Try Nest(f,bfloat(1/5),19). This will be as fast as your ff. I wonder if the problem might be that in rational arithmetic repeated > many times, the rational numbers get very large numerators and > denominators. Would this be related to the slowness? > Yes. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080127/237c70cc/attachment.htm From macrakis at alum.mit.edu Sun Jan 27 18:06:49 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 27 Jan 2008 19:06:49 -0500 Subject: [Maxima] Simple question: modulo In-Reply-To: <200801271248.59009.pebbles@schattenlauf.de> References: <200801271210.08302.pebbles@schattenlauf.de> <1d67a53c0801270327k3b35dd44u9613699254842403@mail.gmail.com> <200801271248.59009.pebbles@schattenlauf.de> Message-ID: <8b356f880801271606o4381d84en172d4342b77161ac@mail.gmail.com> On Jan 27, 2008 6:48 AM, Hanno Behrens wrote: > Perfect! Why didn't mod(x,y) work, when I tried it? Perhaps you were using an old version of Maxima? The mod function has been changed.... Another way to perform modular arithmetic is to set a global modulus, which applies to all calculations on Canonical Rational Expressions, which you create using rat(...). For example: m: matrix( [15,2,7], [8,10,23], [0,2,8])$ determinant(m) => 494 <<<<<<<<< calculate over Z modulus:23; => 23 rm:rat(m); => matrix([-8,2,7],[8,10,0],[0,2,8]) determinant(rm); <<<<<<<<<<<< calculate over Z23 => 11 rm^^-1; <<<<<<<<<<<<<< inverse over Z23 => matrix([1,4,2],[-10,-10,3],[-9,-9,8]) rm . rm^^-1; => matrix([1,0,0],[0,1,0],[0,0,1]) -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080127/0687a470/attachment-0001.htm From phhs80 at gmail.com Sun Jan 27 18:07:43 2008 From: phhs80 at gmail.com (Paul Smith) Date: Mon, 28 Jan 2008 00:07:43 +0000 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <7775b21a0801241307u7d7640a3we9a4771556bb279e@mail.gmail.com> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <7775b21a0801241307u7d7640a3we9a4771556bb279e@mail.gmail.com> Message-ID: <6ade6f6c0801271607x3f5d3facm8b90cf81604fadee@mail.gmail.com> On Jan 24, 2008 9:07 PM, Andrej Vodopivec wrote: > On Jan 22, 2008 5:04 AM, Jordi Guti?rrez Hermoso wrote: > > If my calculations are correct, the roots of x^6 + 3*x^5 + 6*x^4 + > > 3*x^3 + 9*x +9 should all be expressible by radicals. In fact, they > > are all polynomials in terms of 2^(1/3) and a cube root of unity. > > > > How can I make Maxima tell me what the roots actually are? > > I don't know how to compute the roots in radicals, but I have some > code which can sometimes guess how they look like from their numerical > values: > > (%i1) load(identify)$ > (%i2) x^6 + 3*x^5 + 6*x^4 + 3*x^3 + 9*x + 9$ > (%i3) allroots(%)$ > (%i4) identify(%); > (%o4) [x=(sqrt(3)*%i)/2+(3*2^(1/3)-3/2)/3,x=(3*2^(1/3)-3/2)/3-(sqrt(3)*%i)/2,x=.2250982321872863*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^(1/3)-3/2)/3- > .2250982321872863*%i,x=1.95714903975616*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^(1/3)-3/2)/3-1.95714903975616*%i] > (%i5) subst(first(%), %o2), ratsimp; <-- you need to check if we > guessed correctly > (%o5) 0 > > After you have two roots written with radicals you should be able to > solve the polynomial of degree 4 to get others. > > identify works mostly like the identify from maple but I think is less > powerfull. If you would find it interesting let me know. And where from can one get your identify package? Paul From robert.dodier at gmail.com Sun Jan 27 18:26:55 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 27 Jan 2008 17:26:55 -0700 Subject: [Maxima] todd-coxeter In-Reply-To: <31889.1201436249@staffa.eder.local> References: <51885.1201282161@staffa.eder.local> <31889.1201436249@staffa.eder.local> Message-ID: On 1/27/08, Andreas Eder wrote: > >My recommendation is to remove share/affine/todd-coxeter.lisp > >and move src/todd-coxeter.lisp to share/affine. > > Since I am not so very well versed in administrative CVS issues, > would you please do that? I don't want to mess CVS up. Actually it's easy to do. To add a file you have to execute cvs add, then cvs commit. Likewise to remove a file, cvs rm, then cvs commit. As it happens, CVS does not have a "move" command; to get the same effect (except that the commit history is not carried along) you would do cvs rm for one file, cvs add for the other, and cvs commit for both. So I think the follow should be enough in the present circumstances. mv src/todd-coxeter.lisp share/affine (now edit src/Makefile.am, src/maxima.system, and all src/*-depends.mk files to remove todd-coxeter) cvs rm src/todd-coxeter.lisp cvs commit src share/affine If it doesn't work out, let me know & I'll take a look at it. Thanks for your help, Robert From milan at eskimo.com Sun Jan 27 20:56:59 2008 From: milan at eskimo.com (Milan Lukic) Date: Sun, 27 Jan 2008 18:56:59 -0800 Subject: [Maxima] factor over complex numbers? In-Reply-To: <000301c86127$d3ea5df0$0d00a8c0@edwinc367e16bd>; from woollett@charter.net on Sun, Jan 27, 2008 at 01:01:45PM -0800 References: <000301c86127$d3ea5df0$0d00a8c0@edwinc367e16bd> Message-ID: <20080127185659.C10301@eskimo.com> Sorry for the noise. I made a stupid error when preparing my post yesterday. Milan * Edwin Woollett <woollett at charter.net> [2008-01-27 13:01:45 -0800]: > Hi Milan, > > >> Is there any option I can set to get factor(expr1) -> (-%i + x)^5 (%i + > >> x)^5 > >> instead of getting (1 + x^2)^5 ? > >> > > >factor(expr1,x^2+1); > > >Milan > > I get factor(expr1,x^2+1); --> 0 > > ted > ----------------- > (%i1) display2d:false$ > (%i2) expr1 : expand( (1+x^2)^5 ); > (%o2) x^10+5*x^8+10*x^6+10*x^4+5*x^2+1 > > (%i3) factor( expr1 ); > (%o3) (x^2+1)^5 > > (%i4) gfactor( expr1 ); > (%o4) (x-%i)^5*(x+%i)^5 > > (%i5) factor( expr1, x^2 + 1 ); > (%o5) 0 > -------------------- > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- From macrakis at alum.mit.edu Sun Jan 27 21:01:27 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 27 Jan 2008 22:01:27 -0500 Subject: [Maxima] question about the use of bfloat In-Reply-To: <8b356f880801271521p504f4e6v460d25237fc60d93@mail.gmail.com> References: <479B5BA5.6000709@math.msu.edu> <479B7907.4050905@math.msu.edu> <8b356f880801271521p504f4e6v460d25237fc60d93@mail.gmail.com> Message-ID: <8b356f880801271901h392d8b13ne29ceccd3840c601@mail.gmail.com> > > Nest(f, x, n) := ( for i thru n do x : f(x), x ); > Since you don't use i, you can even simplify to: := (thru n do x: f(x), x) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080127/1f80a940/attachment.htm From sen1 at math.msu.edu Sun Jan 27 21:12:42 2008 From: sen1 at math.msu.edu (S. Newhouse) Date: Sun, 27 Jan 2008 22:12:42 -0500 Subject: [Maxima] extracting the monomials from a multivariable polynomial Message-ID: <479D482A.1030208@math.msu.edu> Hello, Is there a function which will extract the list of monomials in a multivariable polynomial? For instance, I would like to get the following results for the indicated polynomials: p: 2*x^2*y^2 -> [2*x^2*y^2] p: 2 + x^2 + y --> [2, x^2, y] p: x*y + 3*x^3 - y^4 --> [x*y, 3*x^3, - y^4] TIA, -sen From robert.dodier at gmail.com Sun Jan 27 22:31:06 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 27 Jan 2008 21:31:06 -0700 Subject: [Maxima] Simple question: modulo In-Reply-To: <8b356f880801271606o4381d84en172d4342b77161ac@mail.gmail.com> References: <200801271210.08302.pebbles@schattenlauf.de> <1d67a53c0801270327k3b35dd44u9613699254842403@mail.gmail.com> <200801271248.59009.pebbles@schattenlauf.de> <8b356f880801271606o4381d84en172d4342b77161ac@mail.gmail.com> Message-ID: On 1/27/08, Stavros Macrakis wrote: > m: matrix( [15,2,7], [8,10,23], [0,2,8])$ > determinant(m) => 494 <<<<<<<<< calculate over Z > modulus:23; > => 23 > rm:rat(m); > => matrix([-8,2,7],[8,10,0],[0,2,8]) > determinant(rm); <<<<<<<<<<<< calculate over Z23 > => 11 > rm^^-1; <<<<<<<<<<<<<< inverse over Z23 > => matrix([1,4,2],[-10,-10,3],[-9,-9,8]) > rm . rm^^-1; > => matrix([1,0,0],[0,1,0],[0,0,1]) Stavros, I'm adding these examples to the testsuite, if that's OK with you. I've noticed something that seems like a bug. rm is a CRE matrix and some functions of rm, e.g. determinant(rm) and rm . rm^^-1 are also CRE's, but rm^^-1 is not. Shouldn't rm^^-1 also be a CRE matrix? In contrast, invert(rm) does yield a CRE matrix; I guess rm^^-1 goes down a different path in the code. Maybe foo^^-1 should simply punt to invert(foo) ?? There is the global flag ratmx which seems to effectively coerce ordinary matrices to CRE, but apart from that it seems like operations on CRE matrices should yield CRE's. best, Robert From macrakis at alum.mit.edu Sun Jan 27 22:31:55 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 27 Jan 2008 23:31:55 -0500 Subject: [Maxima] extracting the monomials from a multivariable polynomial In-Reply-To: <479D482A.1030208@math.msu.edu> References: <479D482A.1030208@math.msu.edu> Message-ID: <8b356f880801272031y1c0cb386k47e95e1100a82a7f@mail.gmail.com> > > Is there a function which will extract the list of monomials in a > multivariable polynomial? For instance...: > > p: 2*x^2*y^2 -> [2*x^2*y^2] > p: 2 + x^2 + y --> [2, x^2, y] > p: x*y + 3*x^3 - y^4 --> [x*y, 3*x^3, - y^4] > In these cases, the monomials are simply the arguments to the "+" function, so "args" will work: args( 2 + x^2 + y ) => [2, x^2, y] However, this won't work in cases like args( x + %pi + 1) => [1, %pi, x] args( sqrt(2)*x + x ) => [sqrt(2)*x, x] args( a*x + x ) => [a*x, x] <<< where a is a parameter, not a variable ...where you'll first need to collect coefficients using facsum, check whether the result is a sum, and collect the constant terms (by multiplying the whole thing by a dummy variable): monomials(p,vars) := block([inflag:true], p: apply('facsum,cons('?zwzwz * p, vars)), if mapatom(p) or op(p)#"+" then [p / '?zwzwz] else args( p ) / '?zwzwz ) monomials((x+y+a+%pi+1)^2,[x,y]) => [ (a+%pi+1)^2, 2*(a+%pi+1)*x, x^2, 2*(a+%pi+1)*y, 2*x*y, y^2 ] Is this what you had in mind? You might also want to look at the ratcoef function for a different way of cutting up polynomials. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080127/8ac53920/attachment.htm From macrakis at alum.mit.edu Sun Jan 27 22:42:01 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 27 Jan 2008 23:42:01 -0500 Subject: [Maxima] Simple question: modulo In-Reply-To: References: <200801271210.08302.pebbles@schattenlauf.de> <1d67a53c0801270327k3b35dd44u9613699254842403@mail.gmail.com> <200801271248.59009.pebbles@schattenlauf.de> <8b356f880801271606o4381d84en172d4342b77161ac@mail.gmail.com> Message-ID: <8b356f880801272042i25ab6c23qf9cadc78dc90a7b5@mail.gmail.com> On Jan 27, 2008 11:31 PM, Robert Dodier wrote: > Stavros, I'm adding these examples to the testsuite, if that's OK with > you. > Fine with me. > Shouldn't rat(m)^^-1 also be a CRE matrix? > Yes. I noticed the bug but hadn't gotten round to documenting it, sorry. > In contrast, invert(rm) does yield a CRE matrix; .... Maybe foo^^-1 should > simply punt to invert(foo) ?? If I remember correctly, ^^-1 and invert use different methods, which are appropriate in different cases. I'd rather have the methods be chosen via YAAGV (yet another global variable) than via different operators. > it seems like operations on CRE matrices should yield CRE's. > Agreed. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080127/d6bebc85/attachment.htm From robert.dodier at gmail.com Sun Jan 27 23:18:20 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 27 Jan 2008 22:18:20 -0700 Subject: [Maxima] Maxima: textbook In-Reply-To: References: Message-ID: On 1/27/08, Robert Marik wrote: > I have visited Docs part on maxima homepage. Is there any printed textbook > about Maxima (in English or German)? Robert, I don't know of any book-length treatments that I can recommend. Maybe the web site of Walter Wegscheider is helpful to you -- it seems extensive and well-organized. See: http://www.austromath.at/daten/maxima/index.htm There is "The Maxima Book" which is linked from the Maxima docs web page, but I don't recommend it. Maybe someone (I'm guessing a single author will provide the necessary focus) will write another book. Hope this helps, Robert Dodier From dfaden at gmail.com Mon Jan 28 04:19:26 2008 From: dfaden at gmail.com (David Faden) Date: Mon, 28 Jan 2008 04:19:26 -0600 Subject: [Maxima] creating a diagonal matrix Message-ID: <6730abff0801280219h2afe0019tb85d3811cfc42515@mail.gmail.com> Hi, Sorry if I have missed a FAQ, but is there is a function in Maxima which allows (non-interactive) construction of a diagonal matrix with arbitrary values down the diagonal? I have settled on the following for the moment (comments welcome): diag(d) := block([n], n : length(d), genmatrix(lambda([i, j], if i = j then d[i] else 0), n, n)) Thanks much. David P.S.: On the subject of Maxima-relevant textbooks, I have found "Macsyma for statisticians" by Barbara Heller (QA276.4 H45 1991) helpful. From willisb at unk.edu Mon Jan 28 05:35:44 2008 From: willisb at unk.edu (Barton Willis) Date: Mon, 28 Jan 2008 05:35:44 -0600 Subject: [Maxima] creating a diagonal matrix In-Reply-To: <6730abff0801280219h2afe0019tb85d3811cfc42515@mail.gmail.com> References: <6730abff0801280219h2afe0019tb85d3811cfc42515@mail.gmail.com> Message-ID: The function 'diag' should work. To use it, you'll need to load "diag" (%i6) load(diag)$ (%i7) m : diag([a,b]); (%o7) matrix([a,0],[0,b]) Given a list of matrices, diag doesn't return a block matrix: (%i8) diag([m,m]); (%o8) matrix([a,0,0,0],[0,b,0,0],[0,0,a,0],[0,0,0,b]) The function diag_matrix should also work -- this function autoloads. Unlike 'diag,' the function 'diag_matrix' n arguments (instead of a single list) (%i9) diag_matrix(a,b); (%o9) matrix([a,0],[0,b]) When the arguments to diag_matrix are matrices, it returns a block matrix: (%i10) diag_matrix(m,m); (%o10) matrix([matrix([a,0],[0,b]),matrix([0,0],[0,0])],[matrix([0,0],[0,0]),matrix([a,0],[0,b])]) The function diag_matrix tries to detect problems: (%i11) diag_matrix(m,1); All arguments to 'diag_matrix' must either be unblocked matrices or non-matrices It's not good that Maxima has two functions for creating a diagonal matrix. These things happen. Blame me :) Barton -----maxima-bounces at math.utexas.edu wrote: ----- but is there is a function in Maxima >which allows (non-interactive) construction of a diagonal matrix with >arbitrary values down the diagonal? From Bart.Vandewoestyne at telenet.be Mon Jan 28 06:19:28 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Mon, 28 Jan 2008 13:19:28 +0100 Subject: [Maxima] how to simplify this? Message-ID: <20080128121928.GA481@simba> Hello list, I have a Maxima script that creates a function f_periodized(x) out of a function f(x): http://www.cs.kuleuven.be/~bartv/stuff/bernoulli/method_with_bernoulli_polynomials.mac I would like to implement f_periodized(x) without too much effort into Fortran 95. For the parameters I need (s up to 10 and alpha=5) the expression for f_periodized(x) seems unmanageable and super-long. I am not sure if maybe there's some kind of structure in the expression that can be used to write a `cleaner' expression for f_periodized(x). My question to this group is if anybody knows about ways/commands to simplify the expression f_periodized(x) so that i could implement it in Fortran 95. Any advice welcome! Bart -- "Share what you know. Learn what you don't." From macrakis at alum.mit.edu Mon Jan 28 07:12:10 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 28 Jan 2008 08:12:10 -0500 Subject: [Maxima] how to simplify this? In-Reply-To: <20080128121928.GA481@simba> References: <20080128121928.GA481@simba> Message-ID: <8b356f880801280512h7ed23d1ie9f49b2676fa198f@mail.gmail.com> I haven't looked at your expression (I'm on a blackberry), but... Have you tried 'optimize'? Other methods to reorganize an expression include factor, factorsum, rat (allows chhosing main vrbl etc). -s On 1/28/08, Bart Vandewoestyne wrote: > Hello list, > > I have a Maxima script that creates a function f_periodized(x) > out of a function f(x): > > http://www.cs.kuleuven.be/~bartv/stuff/bernoulli/method_with_bernoulli_polynomials.mac > > I would like to implement f_periodized(x) without too much effort > into Fortran 95. > > For the parameters I need (s up to 10 and alpha=5) the expression > for f_periodized(x) seems unmanageable and super-long. > > I am not sure if maybe there's some kind of structure in > the expression that can be used to write a `cleaner' expression > for f_periodized(x). > > My question to this group is if anybody knows about ways/commands > to simplify the expression f_periodized(x) so that i could implement it > in Fortran 95. > > Any advice welcome! > Bart > > -- > "Share what you know. Learn what you don't." > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Sent from Gmail for mobile | mobile.google.com From wally at mpi.int.pl Sun Jan 27 08:59:36 2008 From: wally at mpi.int.pl (wally) Date: Sun, 27 Jan 2008 15:59:36 +0100 Subject: [Maxima] sequence of variables Message-ID: <200801271559.36682.wally@mpi.int.pl> Hi Robert thx for the information, but how i have to change this flag ? ( is there an conf file or during start up} cheers wally From aac.campos at gmail.com Mon Jan 28 05:48:31 2008 From: aac.campos at gmail.com (Alexandre Campos) Date: Mon, 28 Jan 2008 12:48:31 +0100 Subject: [Maxima] optimization function Message-ID: Hi !! exists in maxima something to optimize a function (non-linear) constrained to some equations and inequations ? Thanks in advance! alexandre -- "No man can serve two masters; for either he will hate the one, and love the other; or else he will hold to the one, and despise the other. Ye cannot serve God and mammon." Matthew 6:24 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080128/a80d328f/attachment.htm From amundson at users.sourceforge.net Mon Jan 28 08:42:51 2008 From: amundson at users.sourceforge.net (James Amundson) Date: Mon, 28 Jan 2008 08:42:51 -0600 Subject: [Maxima] uninstalling a previous maxima version In-Reply-To: <479B79D9.1060406@umd.edu> References: <20080126180159.6e444bd3@herring> <479B79D9.1060406@umd.edu> Message-ID: <479DE9EB.4000405@users.sourceforge.net> Kun Lin wrote: > Hi all, > > I installed from source. I was hoping the make > file has an uninstall target :-). > It does. make uninstall should do the trick. Note, however, that *files* are uninstalled, but directories are left behind. --Jim From vadim at vkonovalov.ru Sun Jan 27 17:41:09 2008 From: vadim at vkonovalov.ru (vadrer) Date: Sun, 27 Jan 2008 23:41:09 +0000 Subject: [Maxima] Testing stuff In-Reply-To: <20080127155808.76c944f1@herring> References: <20080127155808.76c944f1@herring> Message-ID: <479D1695.4000907@vkonovalov.ru> Rupert Swarbrick wrote: > I was just wondering if anyone else had comments about lisp/maxima > tests? Specifically: > > - Should there be a test framework allowing one to make tests in lisp > - If so, roll our own or use an existing one - possibly via > asdf-install or something? > - If not, what's the best way to write tests for internal functions > from a .mac file? Should it just be lines starting with :lisp ? There's some "coverage" technique, which is visually very interesting: see how it works for some Perl file: http://www.test-smoke.org/perlcover31666/-home-abeltje-Test-Smoke-perl-current-gcov-pp_hot-c.html I wonder if this is possible for LISP also? If yes, this could be very fruitful for such tasks you're observing to implement. BR, Vadim From macrakis at alum.mit.edu Mon Jan 28 10:55:48 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 28 Jan 2008 11:55:48 -0500 Subject: [Maxima] extracting the monomials from a multivariable polynomial In-Reply-To: <479D65F7.8070800@math.msu.edu> References: <479D482A.1030208@math.msu.edu> <8b356f880801272031y1c0cb386k47e95e1100a82a7f@mail.gmail.com> <479D65F7.8070800@math.msu.edu> Message-ID: <8b356f880801280855s110273e6m9e3d1783e8431b18@mail.gmail.com> On Jan 28, 2008 12:19 AM, S. Newhouse wrote: > Modifying your monomials(p,vars) to monomials(p.listofvars(p)) seems to > do exactly what I wanted. It seems a bit strange that this is not a > standard function in maxima. > Well, Maxima has a variety of ways of analyzing and reorganizing polynomials, including rat (and ratvars), ratcoeff, coeff, factor (with facexpand on or off), horner, etc. I suppose 'monomials' or 'list_monomials' (analogous to list_nc_monomials) could easily be added to the facexp package if it's generally useful. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080128/78953fb8/attachment.htm From macrakis at alum.mit.edu Mon Jan 28 10:57:40 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 28 Jan 2008 11:57:40 -0500 Subject: [Maxima] Mentioning load package in doc Message-ID: <8b356f880801280857h405adaeepb4f83ad3ac21602b@mail.gmail.com> ? list_nc_monomials doesn't mention that you need to load a package to define this function, or what package to load. It would be nice if the online doc *systematically* mentioned this. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080128/5ddc3683/attachment.htm From twidlar at yahoo.com Mon Jan 28 11:58:06 2008 From: twidlar at yahoo.com (Thomas Widlar) Date: Mon, 28 Jan 2008 09:58:06 -0800 (PST) Subject: [Maxima] product rule for diff In-Reply-To: <005201c86014$336f1730$05b2a8c0@moss> Message-ID: <999704.84573.qm@web35413.mail.mud.yahoo.com> We are trying to learn the Maxima vector package. Looking at output lines %o8 and %o11 in the attached wxmaxima pdf, we see o the product rule of differentiation is applied for the scalar product (%o11). o but it is not applied for the vector product (%o8). What are we doing wrong? Thanks -------------- next part -------------- A non-text attachment was scrubbed... Name: vector-test.pdf Type: application/pdf Size: 11670 bytes Desc: 4094418813-vector-test.pdf Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080128/b737fa6e/attachment-0001.pdf From twidlar at yahoo.com Mon Jan 28 12:22:06 2008 From: twidlar at yahoo.com (Thomas Widlar) Date: Mon, 28 Jan 2008 10:22:06 -0800 (PST) Subject: [Maxima] array arguments to function Message-ID: <882346.96237.qm@web35403.mail.mud.yahoo.com> Can an array be passed to a function to work on, g(f)? Or must one pass the elements of arrays, g(f[1],f[2])? Thanks. From woollett at charter.net Mon Jan 28 12:38:49 2008 From: woollett at charter.net (Edwin Woollett) Date: Mon, 28 Jan 2008 10:38:49 -0800 Subject: [Maxima] factor over complex numbers? References: <000301c86127$d3ea5df0$0d00a8c0@edwinc367e16bd> <8b356f880801271426p4d6ff874i5ea14b9611c052d5@mail.gmail.com> Message-ID: <001901c861dd$067c3850$0d00a8c0@edwinc367e16bd> Stavros Macrakis wrote: > > The meaning of factor(ppp,qqq) is "factor ppp over the polynomial ring > where > qqq=0". > > For example: > > factor ( x^2 - 2*p*x +2 , p^2-2 ) => (x - p)^2 > > So if you do factor(x^3+1,x^3+1) you will naturally get 0, since you've > told > Maxima that x^3+1 = 0. > > If you want to introduce a new quantity, you need to use a different > variable name, e.g. > > factor(x^4+1,q^2+1) => (x^2 - q) * (x^2 + q) > > -s ----------------- thanks for the helpful explanation, which complements your recent discussion of factor on the mailing list. So Maxima's gfactor(...) is equivalent to ------------ mygfactor(expr) := subst(q = %i, factor(expr, q^2 + 1 ) )$ ---------------------------- mygfactor(expr1); ---> (x-%i)^5*(x+%i)^5 ted From alexandre at emc.ufsc.br Tue Jan 29 02:33:15 2008 From: alexandre at emc.ufsc.br (Alexandre Campos) Date: Tue, 29 Jan 2008 09:33:15 +0100 Subject: [Maxima] optimization function Message-ID: Hi people!! exists in maxima something to optimize a function (non-linear) constrained to some equations and/or inequations ? Thanks in advance! alexandre -- "No man can serve two masters; for either he will hate the one, and love the other; or else he will hold to the one, and despise the other. Ye cannot serve God and mammon." Matthew 6:24 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080129/afd1d0c0/attachment.htm From LindnerW at t-online.de Tue Jan 29 04:15:00 2008 From: LindnerW at t-online.de (Wolfgang Lindner) Date: 29 Jan 2008 10:15 GMT Subject: [Maxima] optimization function In-Reply-To: References: Message-ID: <1JJnUA-0i0NG40@fwd32.aul.t-online.de> "Alexandre Campos" schrieb: <> hello Alexandre, maybe 'augmented-lagrangian' will be your friend. You will find examples in the Maxima help file. HTH Wolfgang From andrej.vodopivec at gmail.com Tue Jan 29 07:31:07 2008 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Tue, 29 Jan 2008 14:31:07 +0100 Subject: [Maxima] product rule for diff In-Reply-To: <999704.84573.qm@web35413.mail.mud.yahoo.com> References: <005201c86014$336f1730$05b2a8c0@moss> <999704.84573.qm@web35413.mail.mud.yahoo.com> Message-ID: <7775b21a0801290531m4787e754xad1fdc59528a17be@mail.gmail.com> How the vector product is differentiated is controlled by a variable called vect_cross: (%i1) load(vect)$ (%i2) depends([X,Y], t)$ (%i3) diff(X~Y, t); (%o3) 'diff(X~Y,t,1) (%i4) vect_cross:true; (%o4) true (%i5) diff(X~Y, t); (%o5) ('diff(X,t,1))~Y+X~('diff(Y,t,1)) The vect package should probably set vect_cross to true. HTH, Andrej On Jan 28, 2008 6:58 PM, Thomas Widlar wrote: > We are trying to learn the Maxima vector package. > Looking at output lines %o8 and %o11 in the attached > wxmaxima pdf, we see > > o the product rule of differentiation is applied for > the scalar product (%o11). > o but it is not applied for the vector product (%o8). > > What are we doing wrong? > > Thanks > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Tue Jan 29 09:12:08 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 29 Jan 2008 08:12:08 -0700 Subject: [Maxima] product rule for diff In-Reply-To: <7775b21a0801290531m4787e754xad1fdc59528a17be@mail.gmail.com> References: <005201c86014$336f1730$05b2a8c0@moss> <999704.84573.qm@web35413.mail.mud.yahoo.com> <7775b21a0801290531m4787e754xad1fdc59528a17be@mail.gmail.com> Message-ID: On 1/29/08, Andrej Vodopivec wrote: > How the vector product is differentiated is controlled by a variable > called vect_cross: > The vect package should probably set vect_cross to true. OK by me to change it if you want. Thanks for pointing it out. Is there a context in which vect_cross=false is really appropriate? Can we just get rid of vect_cross entirely? Robert From robert.dodier at gmail.com Tue Jan 29 09:23:36 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 29 Jan 2008 08:23:36 -0700 Subject: [Maxima] optimization function In-Reply-To: References: Message-ID: On 1/29/08, Alexandre Campos wrote: > exists in maxima something to optimize a function (non-linear) > constrained to some equations and/or inequations ? There is augmented_lagrangian_method which can solve problems with equality constraints on a nonlinear objective function. For inequality constraints, there isn't anything in Maxima to directly solve such problems. Maybe you can try to rephrase the problem as an unconstrained problem, e.g. a constraint x > 0 could be translated into an unconstrained variable y = log(x). I don't know if that is possible in general. Or maybe the objective function is close enough to linear so you could apply the simplex method, which Maxima has. augmented_lagrangian_method is not the strongest method for problems with equality constraints. I think there are some web sites which describe various methods. HTH Robert Dodier From robert.dodier at gmail.com Tue Jan 29 09:41:28 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 29 Jan 2008 08:41:28 -0700 Subject: [Maxima] array arguments to function In-Reply-To: <882346.96237.qm@web35403.mail.mud.yahoo.com> References: <882346.96237.qm@web35403.mail.mud.yahoo.com> Message-ID: On 1/28/08, Thomas Widlar wrote: > Can an array be passed to a function to work on, g(f)? > > Or must one pass the elements of arrays, g(f[1],f[2])? Maxima doesn't handle array arguments consistently. Consider this: g(x) := x[1] : 1234; Whether g changes the actual argument depends on the kind of object that the actual argument is. If x is a list or a so-called "fast" array, it is changed, but if x is an ordinary declared or undeclared array, it is not. This behavior is a bug. I don't know if g should consistently change the actual argument or consistently not change it, but I am sure that it should be consistent. If you only want to read values in an array argument, I think there is no problem. So maybe you can tell us what you are trying to do. best Robert From tpapp at Princeton.EDU Tue Jan 29 09:51:57 2008 From: tpapp at Princeton.EDU (Tamas K Papp) Date: Tue, 29 Jan 2008 10:51:57 -0500 Subject: [Maxima] optimization function In-Reply-To: References: Message-ID: <20080129155157.GA10537@pu100877.student.princeton.edu> On Tue, Jan 29, 2008 at 08:23:36AM -0700, Robert Dodier wrote: > On 1/29/08, Alexandre Campos wrote: > > > exists in maxima something to optimize a function (non-linear) > > constrained to some equations and/or inequations ? > > There is augmented_lagrangian_method which can solve problems with > equality constraints on a nonlinear objective function. > For inequality constraints, there isn't anything in Maxima to directly > solve such problems. Maybe you can try to rephrase the problem > as an unconstrained problem, e.g. a constraint x > 0 could be > translated into an unconstrained variable y = log(x). I don't know > if that is possible in general. > > Or maybe the objective function is close enough to linear so you > could apply the simplex method, which Maxima has. > > augmented_lagrangian_method is not the strongest method for > problems with equality constraints. I think there are some web > sites which describe various methods. I find the Nocedal-Wright book (2006 is the latest edition) a great reference for nonlinear problems. Judd, Kenneth L: Numerical methods in economics gives a good overview in the relevant chapter. Sometimes solving the first order conditions as a nonlinear system of equations works for small (2-5 unknowns) systems. Maybe if the OP posted the problem, it would be easier to help. Nonlinear optimization problems with constraints are very tricky in general. There exist methods for certain cases, eg convexity of the objective function. HTH, Tamas From raymond.toy at ericsson.com Tue Jan 29 14:49:10 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 29 Jan 2008 15:49:10 -0500 Subject: [Maxima] [Maxima-commits] CVS: maxima/src todd-coxeter.lisp, 1.11, 1.12 In-Reply-To: References: Message-ID: <479F9146.8030903@ericsson.com> Andreas Eder wrote: > Update of /cvsroot/maxima/maxima/src > In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1681/src > > Modified Files: > todd-coxeter.lisp > Log Message: > > > converted pseudo datastructure in $todd_coxeter_state to using a defstruct; > removed unnecessary macros. It looks like $todd_coxeter_state is some variable that the user is allowed to see. Will changing it to a defstruct still work for users? Ray From twidlar at yahoo.com Tue Jan 29 16:36:51 2008 From: twidlar at yahoo.com (Thomas Widlar) Date: Tue, 29 Jan 2008 14:36:51 -0800 (PST) Subject: [Maxima] array arguments to function In-Reply-To: Message-ID: <67525.82848.qm@web35414.mail.mud.yahoo.com> Robert Dodier: > Maxima doesn't handle array arguments consistently. > ... If you only want to read values in an array > argument, I think there is no problem. So maybe > you can tell us what you are trying to do. We want to pass arrays to a subroutine (a function) by reference not by value, that is, we need to give the address of the actuall array(s) so that the routine can access and modify them. If there was only one array in question, we could pass it in by value (a copy or readonly) and return the modification as a return value. But we need to mangle and few arrays at a time. Is that possible? From robert.dodier at gmail.com Tue Jan 29 22:50:01 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 29 Jan 2008 21:50:01 -0700 Subject: [Maxima] array arguments to function In-Reply-To: <67525.82848.qm@web35414.mail.mud.yahoo.com> References: <67525.82848.qm@web35414.mail.mud.yahoo.com> Message-ID: On 1/29/08, Thomas Widlar wrote: > We want to pass arrays to a subroutine (a function) > by reference not by value, that is, we need to give > the address of the actuall array(s) so that the > routine can access and modify them. Whether or not that has the intended effect depends on what kind of arrays you have. Bear in mind that lists and matrices act like arrays but arrays are distinct from lists and matrices in Maxima. My advice is to use lists or matrices if you need one or two indices, respectively, and to use arrays as created by make_array if you need more indices. Hope this helps, Robert From dan1990 at gmail.com Tue Jan 29 15:35:15 2008 From: dan1990 at gmail.com (Dan Soendergaard) Date: Tue, 29 Jan 2008 22:35:15 +0100 Subject: [Maxima] Save functions for later use? Message-ID: <482d80410801291335g36453dc0m7023137afea5e08b@mail.gmail.com> Hi, As an old Mathcad user I'm used to save some of my most used formulas as a worksheet. Is there some similar functionality in Maxima? Basically, when I've defined a function, is it possible to save that function somewhere, close maxima, open it again, and use that function? I quite often use the Quadratic Formula at school and it's really a pain to re-type it almost every day. Besides that, Maxima is a really great piece of work! -- Sincerely, Dan Sondergaard From Bart.Vandewoestyne at telenet.be Wed Jan 30 03:20:37 2008 From: Bart.Vandewoestyne at telenet.be (Bart Vandewoestyne) Date: Wed, 30 Jan 2008 10:20:37 +0100 Subject: [Maxima] factoring coefficients Message-ID: <20080130092037.GA10668@simba> Hello list, Consider the function (%i19) f(x) := (sin(x))^6; 6 (%o19) f(x) := sin (x) I take the sixth derivative of it and simplify it a bit, so that I have (%i20) rat(trigreduce(diff(f(x), x, 6))); (%o20)/R/ 1458 cos(6 x) - 768 cos(4 x) + 30 cos(2 x) This is already nice. But to discover structure in the jth order derivatives, it would be interesting to see the coefficients in this expression factored. So 6 1458 should become 2 3 and so on. Is this possible with Maxima? Thanks, Bart PS: if by the way anybody knows a nice and general expression for the jth order derivative of (sin(x))^n then I would be highly interested! From andre.maute at gmx.de Wed Jan 30 10:19:36 2008 From: andre.maute at gmx.de (andre maute) Date: Wed, 30 Jan 2008 17:19:36 +0100 Subject: [Maxima] Finding roots of sextic in radicals In-Reply-To: <200801251510.46165.andre.maute@gmx.de> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <8b356f880801250439t88ba311j6cdf9843e6fe2508@mail.gmail.com> <200801251510.46165.andre.maute@gmx.de> Message-ID: <200801301719.36468.andre.maute@gmx.de> I searched for the roots of the sixth legendre polynomial expressed using real radicals (see below) o.k. this is clearly not possible due to a theorem about the "Casus irreducibilis" for cubic polynomials which states that if all three roots are real, then there is at least one which can't be expressed using real radicals. search Google for proofs. Regards Andre On Friday 25 January 2008, andre maute wrote: > What i did > > -------- snip ---------- > p : 231*x^6/16-315*x^4/16+105*x^2/16-5/16; > > z : solve(p=0,x); > > z[1]; > > z1 : radcan(z[1]), algebraic; > z2 : ratsimp(z[1]), algebraic; > z3 : ratsimp(rectform(z[1])); > -------- snip ---------- > > z1 and z2 contain nevertheless %i. > z3 introduces trigonometric functions > which i dislike as much as the %i > > i want an expression only involving radicals, > no %i and no other auxilliary functions > > i'm not aware if the trigonometric expressions > have a representation only involving radicals > no %i and no other auxilliary functions > > what i have in mind > is something like the following for the fifth legendre polynomial > > (%i10) p5:x^5/8-35*x^3/4+15*x/8; > (%o10) 63*x^5/8-35*x^3/4+15*x/8; > (%i11) z5:solve(p5 = 0,x); > (%o11) [x = -sqrt(2*sqrt(70)+35)/(3*sqrt(7)), > x = sqrt(2*sqrt(70)+35)/(3*sqrt(7)), > x = -sqrt(35-2*sqrt(70))/(3*sqrt(7)), > x = sqrt(35-2*sqrt(70))/(3*sqrt(7)),x = 0] > > > Andre > > On Friday 25 January 2008, Stavros Macrakis wrote: > > Did you try radcan and/or ratsimp(zz),algebraic? > > > > On 1/25/08, andre maute wrote: > > > On Friday 25 January 2008, you wrote: > > > > Have you tried solve? This polynomial is the functional composition > > > > of lower-degree polys so should easily be handled by solve. No need > > > > for numerical solutions and identify. Take a look at the doc for > > > > polydecomp if you're interested. > > > > > > solve gives long lists of roots involving %i > > > it's known that the roots of the legendre polynomials are real, > > > so what i want to see is no %i. > > > > > > polydecomp is no help either. > > > > > > Andre > > > > > > > -s > > > > > > > > On 1/25/08, andre maute wrote: > > > > > On Thursday 24 January 2008, Andrej Vodopivec wrote: > > > > > > On Jan 22, 2008 5:04 AM, Jordi Guti?rrez Hermoso > > > > > > > > > > > > > > > > wrote: > > > > > > > If my calculations are correct, the roots of x^6 + 3*x^5 + > > > > > > > 6*x^4 + 3*x^3 + 9*x +9 should all be expressible by radicals. > > > > > > > In fact, they are all polynomials in terms of 2^(1/3) and a > > > > > > > cube root of unity. > > > > > > > > > > > > > > How can I make Maxima tell me what the roots actually are? > > > > > > > > > > > > I don't know how to compute the roots in radicals, but I have > > > > > > some code which can sometimes guess how they look like from their > > > > > > numerical values: > > > > > > > > > > > > (%i1) load(identify)$ > > > > > > (%i2) x^6 + 3*x^5 + 6*x^4 + 3*x^3 + 9*x + 9$ > > > > > > (%i3) allroots(%)$ > > > > > > (%i4) identify(%); > > > > > > (%o4) > > > > > > [x=(sqrt(3)*%i)/2+(3*2^(1/3)-3/2)/3,x=(3*2^(1/3)-3/2)/3-(sqrt(3)*%i)/2, > > >x= > > > > > > > >.2 > > > > > > > > > > >250982321872863*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^(1/3)-3/2)/3- > > > > > > .2250982321872863*%i,x=1.95714903975616*%i+(-3/4^(1/3)-3/2)/3,x=(-3/4^( > > >1/ > > > > > > > >3) > > > > > > > > > > >-3/2)/3-1.95714903975616*%i] (%i5) subst(first(%), %o2), ratsimp; > > > > > > <-- you need to check if we > > > > > > guessed correctly > > > > > > (%o5) 0 > > > > > > > > > > > > After you have two roots written with radicals you should be able > > > > > > to solve the polynomial of degree 4 to get others. > > > > > > > > > > > > identify works mostly like the identify from maple but I think is > > > > > > less powerfull. If you would find it interesting let me know. > > > > > > > > > > Perhaps you could check > > > > > what your identify function gives for the sixth legendre > > > > > polynomial. > > > > > > > > > > 231*x^6/16-315*x^4/16+105*x^2/16-5/16 > > > > > > > > > > I have not seen the roots written in radicals, yet. > > > > > > > > > > Andre > > > > > > > > > > _______________________________________________ > > > > > 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 Wed Jan 30 11:02:01 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 30 Jan 2008 10:02:01 -0700 Subject: [Maxima] Save functions for later use? In-Reply-To: <482d80410801291335g36453dc0m7023137afea5e08b@mail.gmail.com> References: <482d80410801291335g36453dc0m7023137afea5e08b@mail.gmail.com> Message-ID: On Jan 29, 2008 2:35 PM, Dan Soendergaard wrote: > As an old Mathcad user I'm used to save some of my most used formulas > as a worksheet. Is there some similar functionality in Maxima? > Basically, when I've defined a function, is it possible to save that > function somewhere, close maxima, open it again, and use that > function? Dan, probably the easiest thing is grind(myfunction) which prints the function definition, then copy & paste that into a file. Then next time you want to use that function, load("myfile.mac") loads it. There are other ways to achieve that effect, but I think that is simplest. best Robert Dodier From twidlar at yahoo.com Wed Jan 30 11:19:40 2008 From: twidlar at yahoo.com (Thomas Widlar) Date: Wed, 30 Jan 2008 09:19:40 -0800 (PST) Subject: [Maxima] array arguments to function In-Reply-To: Message-ID: <801719.83635.qm@web35404.mail.mud.yahoo.com> I'm not sure I understand the answer. Is it possible to pass arrays, lists or matrices to a function and have the function modify the actual array, list or matrix? In other words, are arrays, lists or matrices passed by value, reference or both? Is there a special syntax? --- Robert Dodier wrote: > On 1/29/08, Thomas Widlar wrote: > > > We want to pass arrays to a subroutine (a > function) > > by reference not by value, that is, we need to > give > > the address of the actuall array(s) so that the > > routine can access and modify them. > > Whether or not that has the intended effect depends > on what > kind of arrays you have. Bear in mind that lists and > matrices > act like arrays but arrays are distinct from lists > and > matrices in Maxima. My advice is to use lists or > matrices if > you need one or two indices, respectively, and to > use arrays > as created by make_array if you need more indices. > > Hope this helps, > > Robert > From O.Kullmann at swansea.ac.uk Wed Jan 30 11:41:15 2008 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Wed, 30 Jan 2008 17:41:15 +0000 Subject: [Maxima] array arguments to function In-Reply-To: <801719.83635.qm@web35404.mail.mud.yahoo.com> References: <801719.83635.qm@web35404.mail.mud.yahoo.com> Message-ID: <20080130174115.GK22052@cs-wsok.swansea.ac.uk> As far as I know, lists and matrices are always passed by reference: (%i1) f(L) := L[1] : 77; (%o1) f(L) := L : 77 1 (%i2) a : [1,2,3]; (%o2) [1, 2, 3] (%i3) f(a); (%o3) 77 (%i4) a; (%o4) [77, 2, 3] (%i5) b : matrix([1,2],[3,4]); [ 1 2 ] (%o5) [ ] [ 3 4 ] (%i6) g(M) := M[1,1] : 77; (%o6) g(M) := M : 77 1, 1 (%i7) g(b); (%o7) 77 (%i8) b; [ 77 2 ] (%o8) [ ] [ 3 4 ] I don't use arrays (since these are only global objects), so I don't know about them. Oliver On Wed, Jan 30, 2008 at 09:19:40AM -0800, Thomas Widlar wrote: > I'm not sure I understand the answer. Is it possible > to pass arrays, lists or matrices to a function and > have the function modify the actual array, list or > matrix? > > In other words, are arrays, lists or matrices passed > by value, reference or both? Is there a special > syntax? > > > --- Robert Dodier wrote: > > > On 1/29/08, Thomas Widlar wrote: > > > > > We want to pass arrays to a subroutine (a > > function) > > > by reference not by value, that is, we need to > > give > > > the address of the actual array(s) so that the > > > routine can access and modify them. > > > > Whether or not that has the intended effect depends > > on what > > kind of arrays you have. Bear in mind that lists and > > matrices > > act like arrays but arrays are distinct from lists > > and > > matrices in Maxima. My advice is to use lists or > > matrices if > > you need one or two indices, respectively, and to > > use arrays > > as created by make_array if you need more indices. > > > > Hope this helps, > > > > Robert > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Wed Jan 30 21:24:53 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 30 Jan 2008 20:24:53 -0700 Subject: [Maxima] array arguments to function In-Reply-To: <801719.83635.qm@web35404.mail.mud.yahoo.com> References: <801719.83635.qm@web35404.mail.mud.yahoo.com> Message-ID: On 1/30/08, Thomas Widlar wrote: > I'm not sure I understand the answer. Is it possible > to pass arrays, lists or matrices to a function and > have the function modify the actual array, list or matrix? Yes. If the argument is a list, a matrix, or an array created by make_array, then the actual argument is modified by functions which modify the formal argument. There are other special cases which I won't try to enumerate now. > In other words, are arrays, lists or matrices passed > by value, reference or both? It turns out the problem has more to do with Maxima's evaluation policy and the implementation of arrays. The treatment of arrays is a mess. I hope we can clean it up eventually. best Robert Dodier From robert.dodier at gmail.com Wed Jan 30 21:35:21 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 30 Jan 2008 20:35:21 -0700 Subject: [Maxima] [Maxima-commits] CVS: maxima/src todd-coxeter.lisp, 1.11, 1.12 In-Reply-To: <479F9146.8030903@ericsson.com> References: <479F9146.8030903@ericsson.com> Message-ID: On 1/29/08, Raymond Toy (RT/EUS) wrote: > > converted pseudo datastructure in $todd_coxeter_state to using a defstruct; > > removed unnecessary macros. > > It looks like $todd_coxeter_state is some variable that the user is > allowed to see. Will changing it to a defstruct still work for users? Well, not entirely, but it doesn;t really bother me. Before, todd_coxeter_state was just an array, so you would need to know which element corresponds to which named quantity. At least the Lisp structure shows that. But there isn't a way to access the slots of the structure except via Lisp. So that's a drawback. It seems like it would be easy to make Maxima understand Lisp structures. A display function could format a structure as foo(bar=baz, mumble=blurf, ...). Slots could be accessed via an operator, say "@", e.g. foo at bar. A Maxima defstruct function would probably just punt to Lisp DEFSTRUCT. Maybe I'm underestimating the work involved, but hey, that's just another word for optimism. FWIW Robert From jcano at agt.uva.es Thu Jan 31 04:08:56 2008 From: jcano at agt.uva.es (jcano) Date: Thu, 31 Jan 2008 11:08:56 +0100 Subject: [Maxima] How to evaluate a noun expresion Message-ID: <47A19E38.4020806@agt.uva.es> I use a modified version of the newdiff function found in the Maxima book section 7.11. This function output some noun form and after that I have problems to evaluate expresions. My problem can be described with the following function: F(x):=block([inflag:true], if atom(x)=true then 'F(x) else if inpart(x,0)="+" then map(F,x) else 'F(x)); Hence (%i2) F(a+b); (%o2) F(b) + F(a) Assume that I have constructed some expresion like (%i3) expr:subst(x=a+b,F(x)); (%o3) F(b + a) Now I dont know how to evaluate expr in order to obtain F(b)+F(a) : (%i4) ev(expr,eval); (%o4) F(b + a) (%i5) ev(expr,nouns); *** - Program stack overflow. RESET and also ev(expr,F) enter in an endless loop. Some help ? jose cano From willisb at unk.edu Thu Jan 31 04:48:54 2008 From: willisb at unk.edu (Barton Willis) Date: Thu, 31 Jan 2008 04:48:54 -0600 Subject: [Maxima] How to evaluate a noun expresion In-Reply-To: <47A19E38.4020806@agt.uva.es> References: <47A19E38.4020806@agt.uva.es> Message-ID: To prevent your function from entering an infinite loop, you need to replace 'F(x) with funmake(F,[x]). Thus (%i34) F(x):=block([inflag:true], if atom(x)=true then funmake(F,[x]) else if inpart(x,0)="+" then map(F,x) else funmake(F,[x]))$ (%i35) F(a+b); (%o35) F(b)+F(a) (%i36) expr:subst(x=a+b,F(x)); (%o36) F(b+a) (%i37) ev(expr,nouns); (%o37) F(b)+F(a) Not that it really matters, but here is a shorter version of F: (%i38) ff(x) := block([inflag : true], if atom(x) or not op(x) = "+" then funmake(ff,[x]) else map(ff, x)); Also, you can declare a function to be additive or multiadditive; for example (%i42) declare(g,multiadditive)$ (%i43) g(x+y,a+b); (%o43) g(y,b)+g(y,a)+g(x,b)+g(x,a) (%i44) g(x+y+z,a+b); (%o44) g(z,b)+g(z,a)+g(y,b)+g(y,a)+g(x,b)+g(x,a) Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: maxima at math.utexas.edu >From: jcano >Sent by: maxima-bounces at math.utexas.edu >Date: 01/31/2008 04:08AM >Subject: [Maxima] How to evaluate a noun expresion > >I use a modified version of the newdiff function found in the Maxima >book section 7.11. >This function output some noun form and after that I have problems to >evaluate expresions. > >My problem can be described with the following function: > >F(x):=block([inflag:true], > if atom(x)=true then 'F(x) > else > if inpart(x,0)="+" then map(F,x) > else 'F(x)); > >Hence > >(%i2) F(a+b); >(%o2) F(b) + F(a) > >Assume that I have constructed some expresion like > >(%i3) expr:subst(x=a+b,F(x)); >(%o3) F(b + a) > >Now I dont know how to evaluate expr in order to obtain F(b)+F(a) : > >(%i4) ev(expr,eval); >(%o4) F(b + a) >(%i5) ev(expr,nouns); > >*** - Program stack overflow. RESET >and also ev(expr,F) enter in an endless loop. > >Some help ? > >jose cano >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From schulte-martin at web.de Wed Jan 30 15:39:03 2008 From: schulte-martin at web.de (Martin Schulte) Date: Wed, 30 Jan 2008 22:39:03 +0100 Subject: [Maxima] pattern recognition Message-ID: <47A0EE77.2060102@web.de> Hello, is there something like 'pattern recognition' implement in MAXIMA. A simple example, I have the function DIFF(f,x), which knows the rules for the derivation of products and quotients. Is it possible, that MAXIMA identifys the typ of f (product, quotient, composite)? How is the MAXIMA internal design of a function? Thanks for help, Martin P.S.: I hope "pattern recognition" is the right word/translation, in german it is "Mustererkennung" From dan1990 at gmail.com Thu Jan 31 03:34:35 2008 From: dan1990 at gmail.com (Dan Soendergaard) Date: Thu, 31 Jan 2008 10:34:35 +0100 Subject: [Maxima] Save functions for later use? In-Reply-To: References: <482d80410801291335g36453dc0m7023137afea5e08b@mail.gmail.com> Message-ID: <482d80410801310134s7e99cd2awb8dd60dc1e1663e6@mail.gmail.com> > Dan, probably the easiest thing is grind(myfunction) which prints > the function definition, then copy & paste that into a file. > Then next time you want to use that function, load("myfile.mac") > loads it. There are other ways to achieve that effect, > but I think that is simplest. Thanks, that's exactly what I was looking for. I also realised a small side-effect of this, I can share the .mac file with my fellow students which I really think will help them start using Maxima. -- Sincerely, Dan Sondergaard From robert.dodier at gmail.com Thu Jan 31 09:56:01 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 31 Jan 2008 08:56:01 -0700 Subject: [Maxima] How to evaluate a noun expresion In-Reply-To: References: <47A19E38.4020806@agt.uva.es> Message-ID: On 1/31/08, Barton Willis wrote: > (%i42) declare(g,multiadditive)$ > > (%i43) g(x+y,a+b); > (%o43) g(y,b)+g(y,a)+g(x,b)+g(x,a) > > (%i44) g(x+y+z,a+b); > (%o44) g(z,b)+g(z,a)+g(y,b)+g(y,a)+g(x,b)+g(x,a) Good heavens! Where is this hidden? ... Oh, it's in share/contrib. load(multiadditive) finds it. Thanks, Barton! Robert From robert.dodier at gmail.com Thu Jan 31 10:24:05 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 31 Jan 2008 09:24:05 -0700 Subject: [Maxima] How to evaluate a noun expresion In-Reply-To: <47A19E38.4020806@agt.uva.es> References: <47A19E38.4020806@agt.uva.es> Message-ID: On 1/31/08, jcano wrote: > I use a modified version of the newdiff function found in the Maxima > book section 7.11. > This function output some noun form and after that I have problems to > evaluate expresions. > > My problem can be described with the following function: > > F(x):=block([inflag:true], > if atom(x)=true then 'F(x) > else > if inpart(x,0)="+" then map(F,x) > else 'F(x)); I see the "Maxima Book" encourages more than one weak practice. The right way to make F an additive function is to use the simplifier. The multiadditive declaration which Barton mentioned is exactly the right thing. If there were no multiadditive package, you could make a simplification rule via tellsimp or defrule. Maxima is an algebra system to the extent that it can work out the implications of declarations such as "F is additive". Users should try to take advantage of that; it's not really necessary, nor desirable, to clutter every function with generic algebraic stuff. Maybe if you tell us what your goal is here, we can offer some more specific advice. best, Robert Dodier From raymond.toy at ericsson.com Thu Jan 31 10:37:42 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Thu, 31 Jan 2008 11:37:42 -0500 Subject: [Maxima] pattern recognition In-Reply-To: <47A0EE77.2060102@web.de> References: <47A0EE77.2060102@web.de> Message-ID: <47A1F956.202@ericsson.com> Martin Schulte wrote: > Hello, > is there something like 'pattern recognition' implement in MAXIMA. > A simple example, I have the function DIFF(f,x), which knows the rules > for the derivation of products and quotients. Is it possible, that > MAXIMA identifys the typ of f (product, quotient, composite)? How is the > MAXIMA internal design of a function? > Thanks for help, Yes, maxima has some pattern recognition. The stuff for rules implements some pattern recognition. Also op can help you with identifying the type. op(a + b + c) -> + See the documentation for op, defrule, tellsimp, and related functions. Perhaps that has what you want. Perhaps others who know this far better than I can give some hints too. Ray From fateman at cs.berkeley.edu Thu Jan 31 13:00:56 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Thu, 31 Jan 2008 11:00:56 -0800 Subject: [Maxima] pattern recognition In-Reply-To: <47A1F956.202@ericsson.com> References: <47A0EE77.2060102@web.de> <47A1F956.202@ericsson.com> Message-ID: <47A21AE8.1050201@cs.berkeley.edu> In English, "pattern recognition" has to do with images. You probably mean "pattern matching" which is available, as Ray says in tellsimp, defmatch, etc. There is also a lisp program that does special matching inside the indefinite integration program, and maybe also in power series expansion, called M1, probably in the file sin.lisp or sinint.lisp. RJF Raymond Toy (RT/EUS) wrote: > Martin Schulte wrote: > >> Hello, >> is there something like 'pattern recognition' implement in MAXIMA. >> A simple example, I have the function DIFF(f,x), which knows the rules >> for the derivation of products and quotients. Is it possible, that >> MAXIMA identifys the typ of f (product, quotient, composite)? How is the >> MAXIMA internal design of a function? >> Thanks for help, >> > > Yes, maxima has some pattern recognition. The stuff for rules > implements some pattern recognition. > > Also op can help you with identifying the type. > > op(a + b + c) -> + > > See the documentation for op, defrule, tellsimp, and related functions. > Perhaps that has what you want. > > Perhaps others who know this far better than I can give some hints too. > > Ray > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080131/501e9b17/attachment.htm From willisb at unk.edu Thu Jan 31 14:21:35 2008 From: willisb at unk.edu (Barton Willis) Date: Thu, 31 Jan 2008 14:21:35 -0600 Subject: [Maxima] How to evaluate a noun expresion In-Reply-To: Message-ID: I should have mentioned that for what Jose needed, declare(F, additive) works: (%i9) declare(gg,additive)$ (%i10) gg(a+b,x); (%o10) gg(b,x)+gg(a,x) (%i11) gg(a,x+y); (%o11) gg(a,y+x) Barton "Robert Dodier" wrote on 01/31/2008 09:56:01 AM: > On 1/31/08, Barton Willis wrote: > > > (%i42) declare(g,multiadditive)$ > > > > (%i43) g(x+y,a+b); > > (%o43) g(y,b)+g(y,a)+g(x,b)+g(x,a) > > > > (%i44) g(x+y+z,a+b); > > (%o44) g(z,b)+g(z,a)+g(y,b)+g(y,a)+g(x,b)+g(x,a) > > Good heavens! Where is this hidden? ... Oh, it's in share/contrib. > load(multiadditive) finds it. Thanks, Barton! > > Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080131/04f12f33/attachment.htm From woollett at charter.net Thu Jan 31 14:46:11 2008 From: woollett at charter.net (Edwin Woollett) Date: Thu, 31 Jan 2008 12:46:11 -0800 Subject: [Maxima] unprotect conjugate? Message-ID: <000301c8644a$50ece8c0$0d00a8c0@edwinc367e16bd> I want to teach maxima how to properly treat the derivative of the conjugate function, with the end result that I will get the behavior: diff( conjugate( f(x) ), x ); ==> conjugate( 'diff( f( x ), x, 1) ) Is there a way to "unprotect" system functions like conjugate so this rule can be implemented for any function f(x)? TIA ted woollett From robert.dodier at gmail.com Thu Jan 31 20:40:18 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 31 Jan 2008 19:40:18 -0700 Subject: [Maxima] unprotect conjugate? In-Reply-To: <000301c8644a$50ece8c0$0d00a8c0@edwinc367e16bd> References: <000301c8644a$50ece8c0$0d00a8c0@edwinc367e16bd> Message-ID: On 1/31/08, Edwin Woollett wrote: > I want to teach maxima how to properly treat the derivative of the conjugate > function, with the end result that I will get the behavior: > > diff( conjugate( f(x) ), x ); ==> conjugate( 'diff( f( x ), x, 1) ) Here is such a rule. declare (e, complex); matchdeclare (e, all, u, mapatom); tellsimpafter ('diff (conjugate (e), u), conjugate (diff (e, u))); This depends rather sensitively on Maxima's assumptions about how diff and conjugate work; e.g. there must be a quote mark on diff but not on conjugate. I hope we can eventually regularize some things so that making up basic rules like this doesn't depend on peculiar factoids ... Anyway here are a couple of examples of the rule in action. diff (conjugate (f(x)), x); => conjugate('diff(f(x),x,1)) diff (conjugate (f(x) + g(x)), x); => conjugate('diff(g(x),x,1))+conjugate('diff(f(x),x,1)) Is that the intended effect? > Is there a way to "unprotect" system functions like conjugate so this rule > can be implemented for any function f(x)? As it happens, Maxima doesn't protect built-in functions. You can make rules for or redefine any built-in function. HTH Robert Dodier From jcano at agt.uva.es Thu Jan 31 13:21:03 2008 From: jcano at agt.uva.es (jcano) Date: Thu, 31 Jan 2008 20:21:03 +0100 Subject: [Maxima] How to evaluate a noun expresion In-Reply-To: References: <47A19E38.4020806@agt.uva.es> Message-ID: <47A21F9F.9020404@agt.uva.es> Thanks Barton and Robert. The Barton's sugestion about funmake works for me at this stage of my code. May be in the future I should change it using the robert's sugestion about using the simplifier. >> I use a modified version of the newdiff function found in the Maxima >> book section 7.11. >> This function output some noun form and after that I have problems to >> evaluate expresions. >> >> My problem can be described with the following function: >> >> F(x):=block([inflag:true], >> if atom(x)=true then 'F(x) >> else >> if inpart(x,0)="+" then map(F,x) >> else 'F(x)); >> > > I see the "Maxima Book" encourages more than one weak practice. > The right way to make F an additive function is to use the simplifier. > The multiadditive declaration which Barton mentioned is exactly > the right thing. If there were no multiadditive package, you could make > a simplification rule via tellsimp or defrule. > > Maxima is an algebra system to the extent that it can work out the > implications of declarations such as "F is additive". Users should > try to take advantage of that; it's not really necessary, nor desirable, > to clutter every function with generic algebraic stuff. > > Maybe if you tell us what your goal is here, we can offer some more > specific advice. > I am trying to implement a very weak version of a differential operator called xdiff such that: xdiff(x,x,1)=x ( and not 1 as diff does), linear and satisfying Leibniz rule with respect the first argument. Every expresion involving diff may be converting in an expresion involving xdiff and reciprocally: xdiff(y(x),x,1)= x* diff(y(x),x,1),... but in some question is most natural to use xdiff. Best wishes, jose cano From phhs80 at gmail.com Fri Feb 1 05:31:56 2008 From: phhs80 at gmail.com (Paul Smith) Date: Fri, 1 Feb 2008 11:31:56 +0000 Subject: [Maxima] Can Maxima solve x*exp(-x) = 0.05 ? Message-ID: <6ade6f6c0802010331s216929b8y13b911d8d99d45de@mail.gmail.com> Dear All, Is there some trick to have Maxima solving the following equation: f(x):=x*exp(-x)-0.05; solve(f(x),x); ? Thanks in advance, Paul From phhs80 at gmail.com Fri Feb 1 05:52:58 2008 From: phhs80 at gmail.com (Paul Smith) Date: Fri, 1 Feb 2008 11:52:58 +0000 Subject: [Maxima] Can Maxima solve x*exp(-x) = 0.05 ? In-Reply-To: <6ade6f6c0802010331s216929b8y13b911d8d99d45de@mail.gmail.com> References: <6ade6f6c0802010331s216929b8y13b911d8d99d45de@mail.gmail.com> Message-ID: <6ade6f6c0802010352m2081e34dg94097070d019f10c@mail.gmail.com> On Feb 1, 2008 11:31 AM, Paul Smith wrote: > Is there some trick to have Maxima solving the following equation: > > f(x):=x*exp(-x)-0.05; > solve(f(x),x); > > ? Well, with plot2d I identified the localization of the roots and then I got the value of them with: find_root(f(x),x,2,5); find_root(f(x),x,0,2); Paul From sangwinc at for.mat.bham.ac.uk Fri Feb 1 06:00:30 2008 From: sangwinc at for.mat.bham.ac.uk (Chris Sangwin) Date: Fri, 1 Feb 2008 12:00:30 +0000 (GMT) Subject: [Maxima] Can Maxima solve x*exp(-x) = 0.05 ? In-Reply-To: <6ade6f6c0802010352m2081e34dg94097070d019f10c@mail.gmail.com> References: <6ade6f6c0802010331s216929b8y13b911d8d99d45de@mail.gmail.com> <6ade6f6c0802010352m2081e34dg94097070d019f10c@mail.gmail.com> Message-ID: Paul, You might be interested in looking up the mathematical background to the "Lambert W function". http://www.cs.uwaterloo.ca/research/tr/1993/03/W.pdf I don't know of a Maxima implementaion of this (very useful) special function. Chris On Fri, 1 Feb 2008, Paul Smith wrote: > On Feb 1, 2008 11:31 AM, Paul Smith wrote: >> Is there some trick to have Maxima solving the following equation: >> >> f(x):=x*exp(-x)-0.05; >> solve(f(x),x); >> >> ? > > Well, with plot2d I identified the localization of the roots and then > I got the value of them with: > > find_root(f(x),x,2,5); > find_root(f(x),x,0,2); > > Paul > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From phhs80 at gmail.com Fri Feb 1 06:09:04 2008 From: phhs80 at gmail.com (Paul Smith) Date: Fri, 1 Feb 2008 12:09:04 +0000 Subject: [Maxima] Can Maxima solve x*exp(-x) = 0.05 ? In-Reply-To: References: <6ade6f6c0802010331s216929b8y13b911d8d99d45de@mail.gmail.com> <6ade6f6c0802010352m2081e34dg94097070d019f10c@mail.gmail.com> Message-ID: <6ade6f6c0802010409r57b7d110m5f36357e95271707@mail.gmail.com> On Feb 1, 2008 12:00 PM, Chris Sangwin wrote: > You might be interested in looking up the mathematical background to the > "Lambert W function". > > http://www.cs.uwaterloo.ca/research/tr/1993/03/W.pdf > > I don't know of a Maxima implementaion of this (very useful) special > function. Thanks, Chris. Matbe Maple has it implemented, as > f := x -> exp(-x)*x-0.05; f := x -> exp(-x) x - 0.05 > solve(f(x),x); 0.05270598355, 4.499755289 Paul > On Fri, 1 Feb 2008, Paul Smith wrote: > > > On Feb 1, 2008 11:31 AM, Paul Smith wrote: > >> Is there some trick to have Maxima solving the following equation: > >> > >> f(x):=x*exp(-x)-0.05; > >> solve(f(x),x); > >> > >> ? > > > > Well, with plot2d I identified the localization of the roots and then > > I got the value of them with: > > > > find_root(f(x),x,2,5); > > find_root(f(x),x,0,2); > > > > Paul > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > > From macrakis at alum.mit.edu Fri Feb 1 07:44:18 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 1 Feb 2008 08:44:18 -0500 Subject: [Maxima] Can Maxima solve x*exp(-x) = 0.05 ? In-Reply-To: <6ade6f6c0802010409r57b7d110m5f36357e95271707@mail.gmail.com> References: <6ade6f6c0802010331s216929b8y13b911d8d99d45de@mail.gmail.com> <6ade6f6c0802010352m2081e34dg94097070d019f10c@mail.gmail.com> <6ade6f6c0802010409r57b7d110m5f36357e95271707@mail.gmail.com> Message-ID: <8b356f880802010544m3b256dfbsa4a8d296351c81a9@mail.gmail.com> You don't need Lambert W to get a *numerical* solution! It's just that Maxima's solve function doesn't solve numerically.... On 2/1/08, Paul Smith wrote: > On Feb 1, 2008 12:00 PM, Chris Sangwin wrote: > > You might be interested in looking up the mathematical background to the > > "Lambert W function". > > > > http://www.cs.uwaterloo.ca/research/tr/1993/03/W.pdf > > > > I don't know of a Maxima implementaion of this (very useful) special > > function. > > Thanks, Chris. Matbe Maple has it implemented, as > > > f := x -> exp(-x)*x-0.05; > f := x -> exp(-x) x - 0.05 > > > solve(f(x),x); > 0.05270598355, 4.499755289 > > Paul > > > > On Fri, 1 Feb 2008, Paul Smith wrote: > > > > > On Feb 1, 2008 11:31 AM, Paul Smith wrote: > > >> Is there some trick to have Maxima solving the following equation: > > >> > > >> f(x):=x*exp(-x)-0.05; > > >> solve(f(x),x); > > >> > > >> ? > > > > > > Well, with plot2d I identified the localization of the roots and then > > > I got the value of them with: > > > > > > find_root(f(x),x,2,5); > > > find_root(f(x),x,0,2); > > > > > > Paul > > > _______________________________________________ > > > 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 > -- Sent from Gmail for mobile | mobile.google.com From willisb at unk.edu Fri Feb 1 08:09:56 2008 From: willisb at unk.edu (Barton Willis) Date: Fri, 1 Feb 2008 08:09:56 -0600 Subject: [Maxima] unprotect conjugate? In-Reply-To: References: <000301c8644a$50ece8c0$0d00a8c0@edwinc367e16bd>, Message-ID: There is no user-level interface to the 'commutes-with-conjugate' mechanism. Maybe there should be: (%i2) :lisp (setf (get '%derivative 'commutes-with-conjugate) t); (%i3) conjugate(diff(f(x),x)); (%o3) 'diff(conjugate(f(x)),x,1) (%i4) conjugate(diff(f(x,y),x,5,y,8)); (%o4) 'diff(conjugate(f(x,y)),x,5,y,8) But maybe Edwin wanted to do diff conjugate --> conjugate diff. By the way, diff conjugate = conjugate diff isn't an identity. Barton From robert.dodier at gmail.com Fri Feb 1 11:08:08 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 1 Feb 2008 10:08:08 -0700 Subject: [Maxima] unprotect conjugate? In-Reply-To: References: <000301c8644a$50ece8c0$0d00a8c0@edwinc367e16bd> Message-ID: On Feb 1, 2008 7:09 AM, Barton Willis wrote: > There is no user-level interface to the 'commutes-with-conjugate' > mechanism. > Maybe there should be: > > (%i2) :lisp (setf (get '%derivative 'commutes-with-conjugate) t); Yes, maybe some notation like declare(foo, commutes_with(bar)). Another one that could be useful is declare(foo, distributes_over(bar)). > By the way, diff conjugate = conjugate diff isn't an identity. Uh oh. best Robert From willisb at unk.edu Fri Feb 1 15:47:09 2008 From: willisb at unk.edu (Barton Willis) Date: Fri, 1 Feb 2008 15:47:09 -0600 Subject: [Maxima] unprotect conjugate? In-Reply-To: References: <000301c8644a$50ece8c0$0d00a8c0@edwinc367e16bd> , Message-ID: Let C be the complex field. The function z in C |--> conjugate(z) isn't differentiable anywhere. Barton -----"Robert Dodier" wrote: ----- >> By the way, diff conjugate = conjugate diff isn't an identity. > >Uh oh. > >best > >Robert From woollett at charter.net Sat Feb 2 17:39:07 2008 From: woollett at charter.net (Edwin Woollett) Date: Sat, 2 Feb 2008 15:39:07 -0800 Subject: [Maxima] matchdeclare syntax Message-ID: <000301c865f4$cde1ebe0$0d00a8c0@edwinc367e16bd> is there a way to use matchdeclare() to require that a pattern parameter is both an integer and greater than some value? I am trying to learn how to use tellsimp() and tellsimpafter(). As a simple exercise, try to define rules so that the symbol i has the properties, i^2 = -1, i^3 = -i, and i^4 = 1. I get as far as these and then try to use the mod function for all higher value of n, but run into some kind of error msg. == (%i1) tellsimp(i^2,-1); (%o1) [^rule1, simpexpt] (%i2) tellsimp(i^3, -i); (%o2) [^rule2, ^rule1, simpexpt] (%i3) tellsimp(i^4,1); (%o3) [^rule3, ^rule2, ^rule1, simpexpt] (%i4) [i,i^2,i^3,i^4]; (%o4) [i, - 1, - i, 1] (%i5) matchdeclare(m,integerp); (%o5) done (%i6) matchdeclare(m,is(m>4) ); (%o6) done (%i7) tellsimp(i^m, i^mod(m,4) ); (%o7) [^rule4, ^rule3, ^rule2, ^rule1, simpexpt] (%i8) i^4; Maxima encountered a Lisp error: Error in DEFINITELY-SO [or a callee]: DEFINITELY-SO [or a callee] requires less than two arguments. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. (%i9) TIA Ted Woollett ps. thanks for the help with the incorrect math operation diff( conjugate(f) ) = conjugate( diff(f) ). From fateman at cs.berkeley.edu Sat Feb 2 20:18:32 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Sat, 02 Feb 2008 18:18:32 -0800 Subject: [Maxima] matchdeclare syntax In-Reply-To: <000301c865f4$cde1ebe0$0d00a8c0@edwinc367e16bd> References: <000301c865f4$cde1ebe0$0d00a8c0@edwinc367e16bd> Message-ID: <47A52478.90500@cs.berkeley.edu> Try pred1(x):=is(integerp(x) and x>4) matchdeclare(q,pred1); tellsimp(i^q,i^mod(q,4)); tellsimp(i^2,-1); etc. I have no idea what bug you have encountered. RJF Edwin Woollett wrote: > is there a way to use matchdeclare() to require that a pattern parameter is > both an integer and greater than some value? > I am trying to learn how to use tellsimp() and tellsimpafter(). > > As a simple exercise, try to define rules so that the symbol i has the > properties, i^2 = -1, i^3 = -i, and i^4 = 1. > I get as far as these and then try to use the mod function for all higher > value of n, but run into some kind of error msg. > == > (%i1) tellsimp(i^2,-1); > (%o1) [^rule1, simpexpt] > (%i2) tellsimp(i^3, -i); > (%o2) [^rule2, ^rule1, simpexpt] > (%i3) tellsimp(i^4,1); > (%o3) [^rule3, ^rule2, ^rule1, simpexpt] > (%i4) [i,i^2,i^3,i^4]; > (%o4) [i, - 1, - i, 1] > (%i5) matchdeclare(m,integerp); > (%o5) done > (%i6) matchdeclare(m,is(m>4) ); > (%o6) done > (%i7) tellsimp(i^m, i^mod(m,4) ); > (%o7) [^rule4, ^rule3, ^rule2, ^rule1, simpexpt] > (%i8) i^4; > Maxima encountered a Lisp error: > > Error in DEFINITELY-SO [or a callee]: DEFINITELY-SO [or a callee] requires > less than two arguments. > > Automatically continuing. > To reenable the Lisp debugger set *debugger-hook* to nil. > (%i9) > TIA > Ted Woollett > ps. thanks for the help with the incorrect math operation diff( > conjugate(f) ) = conjugate( diff(f) ). > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From ismaelgfk at gmail.com Sat Feb 2 20:31:58 2008 From: ismaelgfk at gmail.com (Ismael Garrido) Date: Sun, 03 Feb 2008 00:31:58 -0200 Subject: [Maxima] Save functions for later use? In-Reply-To: <482d80410801291335g36453dc0m7023137afea5e08b@mail.gmail.com> References: <482d80410801291335g36453dc0m7023137afea5e08b@mail.gmail.com> Message-ID: <47A5279E.2090507@gmail.com> Dan Soendergaard escribi?: > Hi, > > As an old Mathcad user I'm used to save some of my most used formulas > as a worksheet. Is there some similar functionality in Maxima? > Basically, when I've defined a function, is it possible to save that > function somewhere, close maxima, open it again, and use that > function? > > I quite often use the Quadratic Formula at school and it's really a > pain to re-type it almost every day. > > Besides that, Maxima is a really great piece of work! > Also note that Maxima does know how to solve the quadratic equation: (%i1) a*x^2+b*x+c=0; (%o1) a*x^2+b*x+c=0 (%i2) solve([%], [x]); (%o2) [x=-(sqrt(b^2-4*a*c)+b)/(2*a),x=(sqrt(b^2-4*a*c)-b)/(2*a)] Of course, a, b and c can be anything. For example: (%i3) (x-3)*(x-1/2); (%o3) (x-3)*(x-1/2) (%i4) expand(%); (%o4) x^2-(7*x)/2+3/2 (%i5) solve([%], [x]); (%o5) [x=3,x=1/2] HTH! Ismael From fateman at cs.berkeley.edu Sat Feb 2 20:38:47 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Sat, 02 Feb 2008 18:38:47 -0800 Subject: [Maxima] Save functions for later use? In-Reply-To: <47A5279E.2090507@gmail.com> References: <482d80410801291335g36453dc0m7023137afea5e08b@mail.gmail.com> <47A5279E.2090507@gmail.com> Message-ID: <47A52937.5050304@cs.berkeley.edu> type describe(save); From ismaelgf at adinet.com.uy Sat Feb 2 20:55:37 2008 From: ismaelgf at adinet.com.uy (Ismael Garrido) Date: Sun, 03 Feb 2008 00:55:37 -0200 Subject: [Maxima] Save functions for later use? In-Reply-To: <482d80410801291335g36453dc0m7023137afea5e08b@mail.gmail.com> References: <482d80410801291335g36453dc0m7023137afea5e08b@mail.gmail.com> Message-ID: <47A52D29.8060206@adinet.com.uy> Dan Soendergaard escribi?: > Hi, > > As an old Mathcad user I'm used to save some of my most used formulas > as a worksheet. Is there some similar functionality in Maxima? > Basically, when I've defined a function, is it possible to save that > function somewhere, close maxima, open it again, and use that > function? > > I quite often use the Quadratic Formula at school and it's really a > pain to re-type it almost every day. > > Besides that, Maxima is a really great piece of work! > Also note that Maxima does know how to solve the quadratic equation: (%i1) a*x^2+b*x+c=0; (%o1) a*x^2+b*x+c=0 (%i2) solve([%], [x]); (%o2) [x=-(sqrt(b^2-4*a*c)+b)/(2*a),x=(sqrt(b^2-4*a*c)-b)/(2*a)] Of course, a, b and c can be anything. For example: (%i3) (x-3)*(x-1/2); (%o3) (x-3)*(x-1/2) (%i4) expand(%); (%o4) x^2-(7*x)/2+3/2 (%i5) solve([%], [x]); (%o5) [x=3,x=1/2] HTH! Ismael From ismaelgf at adinet.com.uy Sat Feb 2 21:08:06 2008 From: ismaelgf at adinet.com.uy (Ismael Garrido) Date: Sun, 03 Feb 2008 01:08:06 -0200 Subject: [Maxima] Finding roots of sextic in radicals + Bug? In-Reply-To: <8b356f880801220754s7bbef158yc6ffdf5c801a0dc9@mail.gmail.com> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <4795E3DC.1060105@math.msu.edu> <8b356f880801220754s7bbef158yc6ffdf5c801a0dc9@mail.gmail.com> Message-ID: <47A53016.40304@adinet.com.uy> Stavros Macrakis escribi?: > Nice solution! Maxima actually lets you do this even more simply: > > p: x^6+3*x^5+6*x^4+3*x^3+9*x+9; > p2: factor(p,q^3-2)$ > solve(subst(q=2^(1/3),p2),x); > > -s I've never seen factor used like that. The manual doesn't explain what that call should do! (Relevant manual entry: http://maxima.sourceforge.net/docs/manual/en/maxima_12.html#IDX404 ) I was trying to figure out what that did, but I get this error: (%i1) factor(x^3+x*2, q^2-1); Maxima encountered a Lisp error: Error in PROGN [or a callee]: Caught fatal error [memory may be damaged]Automatically continuing.To reenable the Lisp debugger set *debugger-hook* to nil.(%i2) Is this a bug? What does "factor(expr, expr)" do? Thanks, Ismael From willisb at unk.edu Sat Feb 2 21:57:29 2008 From: willisb at unk.edu (Barton Willis) Date: Sat, 2 Feb 2008 21:57:29 -0600 Subject: [Maxima] Finding roots of sextic in radicals + Bug? In-Reply-To: <47A53016.40304@adinet.com.uy> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <4795E3DC.1060105@math.msu.edu> <8b356f880801220754s7bbef158yc6ffdf5c801a0dc9@mail.gmail.com>, <47A53016.40304@adinet.com.uy> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- The user documentation (try ? factor) explains the meaning of factor(expr,p). >(%i1) factor(x^3+x*2, q^2-1); >Maxima encountered a Lisp error: Error in PROGN [or a callee]: Caught >fatal error [memory may be damaged]Automatically continuing.To reenable >the Lisp debugger set *debugger-hook* to nil.(%i2) > >Is this a bug? Maybe, maybe not; it works for me. Are you using version 5.14.0? What happens if you try the command right after starting Maxima? Have you have assigned a value to q? (%i2) factor(x^3+x*2, q^2-1); (%o2) x*(x^2+2) (%i3) build_info(); Maxima version: 5.14.0 Maxima build date: 21:46 12/27/2007 host type: i686-pc-mingw32 lisp-implementation-type: GNU Common Lisp (GCL) lisp-implementation-version: GCL 2.6.8 Barton From ismaelgf at adinet.com.uy Sat Feb 2 22:30:04 2008 From: ismaelgf at adinet.com.uy (Ismael Garrido) Date: Sun, 03 Feb 2008 02:30:04 -0200 Subject: [Maxima] Finding roots of sextic in radicals + Bug? In-Reply-To: References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <4795E3DC.1060105@math.msu.edu> <8b356f880801220754s7bbef158yc6ffdf5c801a0dc9@mail.gmail.com>, <47A53016.40304@adinet.com.uy> Message-ID: <47A5434C.7060502@adinet.com.uy> Barton Willis escribi?: > -----maxima-bounces at math.utexas.edu wrote: ----- > > The user documentation (try ? factor) explains the meaning of > factor(expr,p). My mistake. I was expecting the header to list all the possible parameters and I didn't read the whole description. Sorry for that. >> (%i1) factor(x^3+x*2, q^2-1); >> Maxima encountered a Lisp error: Error in PROGN [or a callee]: Caught >> fatal error [memory may be damaged]Automatically continuing.To reenable >> the Lisp debugger set *debugger-hook* to nil.(%i2) >> >> Is this a bug? > > Maybe, maybe not; it works for me. Are you using version 5.14.0? > What happens if you try the command right after starting Maxima? > Have you have assigned a value to q? > > (%i2) factor(x^3+x*2, q^2-1); > (%o2) x*(x^2+2) > > (%i3) build_info(); > Maxima version: 5.14.0 > Maxima build date: 21:46 12/27/2007 > host type: i686-pc-mingw32 > lisp-implementation-type: GNU Common Lisp (GCL) > lisp-implementation-version: GCL 2.6.8 > > > Barton > Must be the version, then: Maxima version: 5.13.0 Maxima build date: 21:29 1/21/2008 host type: x86_64-unknown-linux-gnu lisp-implementation-type: GNU Common Lisp (GCL) lisp-implementation-version: GCL 2.6.8 I'm running the latest version available in Debian Unstable. Thanks Ismael From robert.dodier at gmail.com Sun Feb 3 01:14:11 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 3 Feb 2008 00:14:11 -0700 Subject: [Maxima] matchdeclare syntax In-Reply-To: <000301c865f4$cde1ebe0$0d00a8c0@edwinc367e16bd> References: <000301c865f4$cde1ebe0$0d00a8c0@edwinc367e16bd> Message-ID: On 2/2/08, Edwin Woollett wrote: > (%i5) matchdeclare(m,integerp); > (%o5) done > (%i6) matchdeclare(m,is(m>4) ); > (%o6) done Only the last matchdeclare is significant --- any previous declarations are thrown away. Also, the predicate has to be the name of a function, a lambda expression, or a function call missing its final argument e.g. freeof(x) which is called as freeof(x, some_expr) when the rule is attempted. matchdeclare doesn't automatically construct a function from a general expression such as is(m > 4). You could write the rule for exponent > 4 like this: matchdeclare (foo, lambda ([e], integerp(e) and e > 4)); tellsimp (i^foo, i^mod(foo, 4)); Probably matchdeclare should complain if the expression specified for the predicate is unsuitable. HTH Robert Dodier From macrakis at alum.mit.edu Sun Feb 3 14:33:44 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 3 Feb 2008 15:33:44 -0500 Subject: [Maxima] Finding roots of sextic in radicals + Bug? In-Reply-To: <47A5434C.7060502@adinet.com.uy> References: <9543b3a40801212004o26ca9a75u455dc4ba56f8b1bd@mail.gmail.com> <4795E3DC.1060105@math.msu.edu> <8b356f880801220754s7bbef158yc6ffdf5c801a0dc9@mail.gmail.com> <47A53016.40304@adinet.com.uy> <47A5434C.7060502@adinet.com.uy> Message-ID: <8b356f880802031233g7817d914if12aad7d328e727@mail.gmail.com> On Feb 2, 2008 11:30 PM, Ismael Garrido wrote: > >> (%i1) factor(x^3+x*2, q^2-1); > The second argument must be irreducible over the rationals (otherwise q is not well-defined). > >> Maxima encountered a Lisp error: Error in PROGN [or a callee] > >> Is this a bug? > It is a bug that it is not giving a useful error message but instead returning an internal error. I believe this has been fixed in version 5.14. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080203/640ca99b/attachment.htm From woollett at charter.net Sun Feb 3 17:45:05 2008 From: woollett at charter.net (Edwin Woollett) Date: Sun, 3 Feb 2008 15:45:05 -0800 Subject: [Maxima] matchdeclare syntax Message-ID: <000301c866be$cda23c00$0d00a8c0@edwinc367e16bd> Thanks to R. Fateman and Robert Dodier for working solutions to my effort to use matchdeclare with tellsimp. Another example that seems to work ok, but which seems counter-intuitive, involves the use of declare and integerp: (%i1) display2d:false$ (%i2) matchdeclare(q,integerp); (%o2) done (%i3) tellsimp( cos(q*%pi), (-1)^n ); (%o3) [cosrule1,?simp\-%cos] (%i4) declare(m,integer); (%o4) done (%i5) cos(m*%pi); (%o5) (-1)^m (%i6) tellsimp( sin(q*%pi) , 0); (%o6) [sinrule1,?simp\-%sin] (%i7) sin(m*%pi); (%o7) 0 (%i8) integerp(m); (%o8) false Why does integerp(m) => false, but use in matchdeclare works? ----------- I realize that the Maxima manual warns that declare(m,integer) does not get integerp(m) to be true. (man: integerp returns false if its argument is a symbol, even if the argument is declared integer. ) --------- Maybe I should learn to read lisp code and look at the insides? TIA Ted Woollett From macrakis at alum.mit.edu Sun Feb 3 18:25:30 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 3 Feb 2008 19:25:30 -0500 Subject: [Maxima] matchdeclare syntax In-Reply-To: <000301c866be$cda23c00$0d00a8c0@edwinc367e16bd> References: <000301c866be$cda23c00$0d00a8c0@edwinc367e16bd> Message-ID: <8b356f880802031625l6c9aa98ar3013a4d730c7223d@mail.gmail.com> On Feb 3, 2008 6:45 PM, Edwin Woollett wrote: > (%i2) matchdeclare(q,integerp); > (%i3) tellsimp( cos(q*%pi), (-1)^n ); > (%i4) declare(m,integer); > (%i5) cos(m*%pi); > (%o5) (-1)^m > (%i6) tellsimp( sin(q*%pi) , 0); > (%i7) sin(m*%pi); > (%o7) 0 > Why does integerp(m) => false, but use in matchdeclare works? Actually, integerp isn't doing anything different: tellsimp(f(q),0)$ f(m) => f(m) but f(2) => 0 The reason the examples above work is because these transformations (simplifications) are already performed by default in Maxima: kill(all)$ declare(m,integer)$ sin(m*%pi) => 0 cos(m*%pi) => (-1)^m and for that matter sin((m+1/3)*%pi) => sqrt(3)*(-1)^m/2 though for some reason tan(%pi*m) doesn't simplify to 0 (you have to expand to sin/cos using trigsimp...). -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080203/558cc729/attachment.htm From willisb at unk.edu Sun Feb 3 20:26:59 2008 From: willisb at unk.edu (Barton Willis) Date: Sun, 3 Feb 2008 20:26:59 -0600 Subject: [Maxima] matchdeclare syntax In-Reply-To: <000301c866be$cda23c00$0d00a8c0@edwinc367e16bd> References: <000301c866be$cda23c00$0d00a8c0@edwinc367e16bd> Message-ID: Try something like: (%i1) matchdeclare(q, lambda([x], featurep(x, 'integer)))$ (%i2) tellsimp(fff(q*%pi), (-1)^q)$ (%i5) fff(6*%pi); (%o5) 1 (%i6) fff(7 * %pi); (%o6) -1 (%i7) declare(m,integer)$ (%i8) fff(m * %pi); (%o8) (-1)^m Barton -----maxima-bounces at math.utexas.edu wrote: ----- >Another example that seems to work ok, but which seems counter-intuitive, >involves the use of declare and integerp: > >(%i1) display2d:false$ >(%i2) matchdeclare(q,integerp); >(%o2) done >(%i3) tellsimp( cos(q*%pi), (-1)^n ); From woollett at charter.net Mon Feb 4 15:26:28 2008 From: woollett at charter.net (Edwin Woollett) Date: Mon, 4 Feb 2008 13:26:28 -0800 Subject: [Maxima] matchdeclare syntax Message-ID: <000801c86774$9ac8d760$0d00a8c0@edwinc367e16bd> Stavros Macrakis wrote: >The reason the examples above work is because these transformations >(simplifications) are already performed by default in >Maxima: ------------ I really missed a step in not trying out Maxima's automatic simplification rules first. I am trying to clear Mathematica syntax fog out of my brain. After teaching classes using Mathematica for years, I have a pile of textbooks related to Mathematica. As a way to learn to "think Maxima", I look for problems solved the Mma way and say "how could I do that with Maxima??" I clearly need a personal 24 hour delay rule before I appeal for help; I actually realised that I should have checked the default Maxima behavior about 15 minutes after I sent that message, but was taking an afternoon nap with my wife, and told myself: take the nap! ------------- >Actually, integerp isn't doing anything different: > > tellsimp(f(q),0)$ > f(m) => f(m) > but f(2) => 0 -------------------------- So I was still left with the issue: how to get Maxima to use integer information in rules for both literal and symbolic cases. --------------------------- Barton Willis wrote: >Try something like: > >(%i1) matchdeclare(q, lambda([x], featurep(x, 'integer)))$ >(%i2) tellsimp(fff(q*%pi), (-1)^q)$ -------------------------------------------------- This seems to solve the general integer problem: (%i1) pred1(x) := featurep(x, 'integer)$ (%i2) matchdeclare(q,pred1)$ (%i3) tellsimp( f(q), 0 )$ (%i4) [f(2),f(m)]; (%o4) [0, f(m)] (%i5) declare(m, integer )$ (%i6) [f(2),f(m)]; (%o6) [0, 0] ----------------------- thanks for the help. Ted Woollett From eric.reyssat at math.unicaen.fr Tue Feb 5 12:01:54 2008 From: eric.reyssat at math.unicaen.fr (reyssat) Date: Tue, 05 Feb 2008 19:01:54 +0100 Subject: [Maxima] Multivariate taylor In-Reply-To: <000801c86774$9ac8d760$0d00a8c0@edwinc367e16bd> References: <000801c86774$9ac8d760$0d00a8c0@edwinc367e16bd> Message-ID: <47A8A492.5050505@math.unicaen.fr> Hello, I don't understand the result (or maybe only the notation) of multivariate taylor expansion of a formal function. I would expect the taylor expansion of f(x,y) to order 1 to be f(0,0) + x (df(x,y)/dx)(0,0) + y (df(x,y)/dy)(0,0) but what I understand of maxima's answer is f(0,0) + x (df(x,y)/dx)(0,y) + y (df(0,y)/dy)(0) which is not the same in general (due to terms of higher order). However, the taylor expansion of a "concrete" function seems ok. I didn't succeed to plug a concrete function in a formal taylor expansion. Could somebody explain what happens below ? How to handle ?%at(...) ? (%i1) build_info () ; display2d:false$ Maxima version: 5.14.0 Maxima build date: 17:10 2/5/2008 host type: i686-pc-linux-gnu lisp-implementation-type: CLISP lisp-implementation-version: 2.41 (2006-10-13) (built 3374673657) (memory 3411216640) (%o1) (%i3) taylor(f(x,y),[x,y],[0,0],[1,1])$ define(g(x,y),%); (%o4) g(x,y):=f(0,0) +((?%at('diff(f(x,y),x,1),x = 0))*x+(?%at('diff(f(0,y),y,1),y = 0))*y) (%i5) f(x,y):=cos(x+y)$ g(x,y); (%o6) (?%at('diff(cos(y+x),x,1),x = 0))*x+(?%at('diff(cos(y),y,1),y = 0))*y+1 (%i7) diff(cos(x+y),x,1)$ a:at(%,x=0)$ diff(cos(y),y,1)$ b:at(%,y=0)$ a*x+b*y+1; (%o11) 1-x*sin(y) (%i12) taylor(cos(x+y),[x,y],[0,0],[1,1]); (%o12) +1 I expected (%o11) to be a taylor expansion, i.e. a polynomial in x and y, precisely the same as (%o12). By the way, when display2d is false then (%i2) taylor(-x,[x,y],[0,0],[1,1]); (%o2) +(-x) the output is not simplified. Should it be so ? Eric Reyssat From willisb at unk.edu Tue Feb 5 13:19:20 2008 From: willisb at unk.edu (Barton Willis) Date: Tue, 5 Feb 2008 13:19:20 -0600 Subject: [Maxima] Multivariate taylor In-Reply-To: <47A8A492.5050505@math.unicaen.fr> References: <000801c86774$9ac8d760$0d00a8c0@edwinc367e16bd>, <47A8A492.5050505@math.unicaen.fr> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I don't understand the result (or maybe only the notation) of >multivariate taylor expansion of a formal function. I would expect the >taylor expansion of f(x,y) to order 1 to be > >f(0,0) + x (df(x,y)/dx)(0,0) + y (df(x,y)/dy)(0,0) > >but what I understand of maxima's answer is > >f(0,0) + x (df(x,y)/dx)(0,y) + y (df(0,y)/dy)(0) Maybe the at(xxx, y=0) in the last term alters the second term? (%i2) taylor(f(x,y),[x,y],[0,0],[1,1]); (%o2) f(0,0)+((at('diff(f(x,y),x,1),x=0))*x+(at('diff(f(0,y),y,1),y=0))*y)+... Try loading pdiff --- things look different: (%i3) load(pdiff)$ (%i4) taylor(f(x,y),[x,y],[0,0],[1,1]); (%o4) f(0,0)+(f[(1,0)](0,0)*x+f[(0,1)](0,0)*y)+... Now everybody seems to be evaluated at (x = 0, y=0). Barton From amca01 at gmail.com Tue Feb 5 21:37:57 2008 From: amca01 at gmail.com (Alasdair McAndrew) Date: Wed, 6 Feb 2008 14:37:57 +1100 Subject: [Maxima] Handheld maxima? Message-ID: <1d67a53c0802051937j4e129c7co667efe737d75b0d6@mail.gmail.com> I may be in the market for a new handheld device/ PDA (my old Palm Tungsten T3 is slowly giving up the ghost), and it would be nice to have the mathematical functionality of some sort of CAS on it. Is there anything like Maxima available for a PDA? Thanks, Alasdair -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080206/e53af871/attachment.htm From pcd at wikitex.org Tue Feb 5 21:57:45 2008 From: pcd at wikitex.org (Peter Danenberg) Date: Tue, 5 Feb 2008 21:57:45 -0600 Subject: [Maxima] Handheld maxima? In-Reply-To: <1d67a53c0802051937j4e129c7co667efe737d75b0d6@mail.gmail.com> References: <1d67a53c0802051937j4e129c7co667efe737d75b0d6@mail.gmail.com> Message-ID: <20080206035745.GA11285@klutometis.wikitex.org> Quoth Alasdair McAndrew on Sweetmorn, Chaos 36, 3174: > Is there anything like Maxima available for a PDA? Now that they've released a gcc toolchain for the iPhone, it should be possible to compile just about anything. From beroset at mindspring.com Wed Feb 6 06:05:05 2008 From: beroset at mindspring.com (Ed Beroset) Date: Wed, 6 Feb 2008 07:05:05 -0500 (GMT-05:00) Subject: [Maxima] Handheld maxima? Message-ID: <8288517.1202299505785.JavaMail.root@mswamui-blood.atl.sa.earthlink.net> Alasdair McAndrew wrote: >I may be in the market for a new handheld device/ PDA (my old Palm Tungsten >T3 is slowly giving up the ghost), and it would be nice to have the >mathematical functionality of some sort of CAS on it. Is there anything >like Maxima available for a PDA? I'd have preferred to have Maxima, but was able to find no port of it to a PDA (and I'm unable to do it myself). So what I actually now use on my Palm device is Lyme. http://www.calerga.com/products/LyME/index.html Ed From hansen at akb-antriebstechnik.de Wed Feb 6 06:42:16 2008 From: hansen at akb-antriebstechnik.de (Helge Hansen) Date: Wed, 6 Feb 2008 13:42:16 +0100 Subject: [Maxima] How to tell Maxima not to use "rat' replaced..." Message-ID: <000001c868bd$b4b86470$960aa8c0@PCHelge> Hi all! I've got a problem with an output of Maxima. I would like to print the file that contains the text below and the print should look nice. How can I tell Maxima not to put out the lines beggining with: "`rat replaced"? ====================================================================== Q[1](z)=C[1]-cos(alpha)^2*q*z (%i16) batchload("Abmessungen.mac")$ solve([Q[1](z)=(A[v]*sin(alpha)-A[h]*sin(alpha)),z=0],[C[1],z])$ display(C[1])$ kill(z)$ batchload("Abmessungen freigeben.mac")$ `rat' replaced -76.6990182638242 by -62433/814 = -76.6990171990172 `rat' replaced -10.86725746336 by -115269/10607 = -10.8672574714811 C[1]=62433/814 ====================================================================== Abmessungen.mac: ====================================================================== keepfloat:true$ load("units")$ postfix("?")$ x?:=x*deg/radian$ s[1]:0.175,float$ s[2]:0.86,float$ s[3]:3.29/2,float$ s[4]:2.43,float$ s[5]:3.115,float$ s[6]:3.29,float$ q:44,float$ alpha:60.2?,float$ beta:38.2?,float$ A[v]:(q*s[1]/cos(alpha)+q*(s[2]-s[1])/cos(beta)+q*(s[3]-s[2])),float$ B[v]:(A[v]),float$ A[h]:0$ B[h]:0$ ====================================================================== Greetings Helge From biomates at telefonica.net Wed Feb 6 07:12:09 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 06 Feb 2008 14:12:09 +0100 Subject: [Maxima] How to tell Maxima not to use "rat' replaced..." In-Reply-To: <000001c868bd$b4b86470$960aa8c0@PCHelge> References: <000001c868bd$b4b86470$960aa8c0@PCHelge> Message-ID: <47A9B229.9030707@telefonica.net> Helge Hansen escribi?: > Hi all! > > I've got a problem with an output of Maxima. I would like to print the file > that contains the text below and the print should look nice. How can I tell > Maxima not to put out the lines beggining with: "`rat replaced"? > > ====================================================================== > Q[1](z)=C[1]-cos(alpha)^2*q*z > > (%i16) batchload("Abmessungen.mac")$ > solve([Q[1](z)=(A[v]*sin(alpha)-A[h]*sin(alpha)),z=0],[C[1],z])$ > display(C[1])$ > kill(z)$ > batchload("Abmessungen freigeben.mac")$ > > `rat' replaced -76.6990182638242 by -62433/814 = -76.6990171990172 > `rat' replaced -10.86725746336 by -115269/10607 = -10.8672574714811 > C[1]=62433/814 > ====================================================================== > try ratprint: false$ -- Mario Rodriguez Riotorto www.biomates.net From dtc-maxima at scieneer.com Wed Feb 6 07:38:41 2008 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Thu, 07 Feb 2008 00:38:41 +1100 Subject: [Maxima] Long-float variant giving more precision to numerical computations. Message-ID: <47A9B861.2080707@scieneer.com> A variant of Maxima 5.14.0cvs is available that replaces the use of the Common Lisp 'double-float type with the 'long-float type for Maxima floating point numbers. This change gives more precision and range to some numerical calculations which do not currently support the Maxima bfloat type, such as the Fortran based code. The changes have been tested on the Scieneer CL and CLISP. The Scieneer CL x86 and AMD64 ports support extended precision 80-bit floating point numbers for the 'long-float type, and CLISP supports a much more precise 'long-float type. The change should be neutral on CL implementations for with the 'long-float type is equivalent for the 'double-float type. I understand that CMUCL now has a double-double-float type and with some more work it may be possible to support this too. I needed more accuracy from numerical calculations and this was the quickest path and it extends the number of computations that Maxima can perform to high precision. However there are still a good number numerical approximations in Maxima that have not been improved and still give only 'double-float level accuracy. It is not clear to me that this is a change that should be integrated into the main source now, but the modified source code can be downloaded from: http://www.scieneer.com/s/product.html?code=58636 Regards Douglas Crosher From fateman at cs.berkeley.edu Wed Feb 6 08:24:25 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Wed, 06 Feb 2008 06:24:25 -0800 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47A9B861.2080707@scieneer.com> References: <47A9B861.2080707@scieneer.com> Message-ID: <47A9C319.6070308@cs.berkeley.edu> Adding extra precision algorithms (good for 80 bits) when the hardware only does 64 bits might slow down the programs for those less-precise systems. (For example, 80-bit sin/cos/log/exp/bessel/...). So maybe the libraries should be kept separate. There are software versions of quad (that is, 4 doubles) that are implemented in pretty much standard CL -- in CMU-CL, this is done by doubling the (already built-in) double-double. In other lisps (I tried Allegro), it can be done by mimicking the quad arithmetic available for C, or just calling the C library. Deciding how to integrate this into Maxima has been a puzzle. Ray Toy and I were messing with this recently, but I think we both got tired of it. One point is that we have versions of sin/cos/ etc for quad. As well as some more substantial programs like root-finding, various quadrature programs, and FFT. The code is open, and some papers describing it are online as well. I think http://www.cs.berkeley.edu/~fateman/generic see files quad* Integrating all this with the fortran code would not be automatic, for sure. But I think Ray has made progress on that, too. After all, once you have done fortran --> lisp, why not do double -->quad too. RJF Douglas Crosher wrote: > A variant of Maxima 5.14.0cvs is available that replaces the use of the Common Lisp > 'double-float type with the 'long-float type for Maxima floating point numbers. > This change gives more precision and range to some numerical calculations which > do not currently support the Maxima bfloat type, such as the Fortran based code. > > The changes have been tested on the Scieneer CL and CLISP. The Scieneer CL x86 > and AMD64 ports support extended precision 80-bit floating point numbers for the > 'long-float type, and CLISP supports a much more precise 'long-float type. The > change should be neutral on CL implementations for with the 'long-float type is > equivalent for the 'double-float type. I understand that CMUCL now has a > double-double-float type and with some more work it may be possible to support this > too. > > I needed more accuracy from numerical calculations and this was the quickest path > and it extends the number of computations that Maxima can perform to high precision. > However there are still a good number numerical approximations in Maxima that > have not been improved and still give only 'double-float level accuracy. > > It is not clear to me that this is a change that should be integrated into the > main source now, but the modified source code can be downloaded from: > http://www.scieneer.com/s/product.html?code=58636 > > Regards > Douglas Crosher > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From raymond.toy at ericsson.com Wed Feb 6 08:35:32 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Wed, 06 Feb 2008 09:35:32 -0500 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47A9C319.6070308@cs.berkeley.edu> References: <47A9B861.2080707@scieneer.com> <47A9C319.6070308@cs.berkeley.edu> Message-ID: <47A9C5B4.4020808@ericsson.com> R Fateman wrote: > > There are software versions of quad (that is, 4 doubles) that are > implemented in pretty much standard CL -- in CMU-CL, this is done by > doubling the (already built-in) double-double. In other lisps (I tried > Allegro), it can be done by mimicking the quad arithmetic available for > C, or just calling the C library. The implementation is at http://common-lisp.net/project/oct. > > Deciding how to integrate this into Maxima has been a puzzle. Ray Toy > and I were messing with this recently, but I think we both got tired of > it. One point is that we have versions of sin/cos/ etc for quad. As I haven't forgotten about it but I've been distracted a bit. :-( > > Integrating all this with the fortran code would not be automatic, for > sure. But I think Ray has made progress on that, too. > After all, once you have done fortran --> lisp, why not do double > -->quad too. I did a very simple proof of concept. I took some of the BLAS routines that were converted to Lisp via f2cl. Then I ran a really hacky program to read in the Lisp code and convert all references of double-float to qd-real. A quick test showed that I did get quad-double results. Unfortunately, I also got distracted so I never went any farther. I would like to at least try a Gaussian elimination or eigenvalue routine to see if that will work. With some more work. I think it would be possible to provide a bfloat implementation of the LAPACK routines that maxima already has. I think all that's need would be some CLOS wrappers to call bfloat routines as needed. That would be pretty cool. Ray From macrakis at alum.mit.edu Wed Feb 6 08:41:45 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 6 Feb 2008 09:41:45 -0500 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47A9B861.2080707@scieneer.com> References: <47A9B861.2080707@scieneer.com> Message-ID: <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> On Feb 6, 2008 8:38 AM, Douglas Crosher wrote: > A variant of Maxima 5.14.0cvs is available that replaces the use of the > Common Lisp > 'double-float type with the 'long-float type for Maxima floating point > numbers. > ...However there are still a good number numerical approximations in > Maxima that > have not been improved and still give only 'double-float level accuracy. > > It is not clear to me that this is a change that should be integrated into > the > main source now, but the modified source code can be downloaded from: > http://www.scieneer.com/s/product.html?code=58636 > I'm not sure what you mean by 'integrated'. If there is a compile-time switch that chooses between double-float and long-float to implement Maxima float, with the default being double-float, that would be useful for experimentation moving forward. If this is a runtime choice (some numbers are floats, some long floats), what is the interface? Though I admit that currently there is no documentation on the accuracy of our mathematical functions, it seems reasonable for users to expect that they will be close to the full precision of whatever 'float' is. So I don't think it makes sense to make the default be long-float until all Maxima float operations return full long-float precision, including not just operations provided by the underlying Lisp such as sin/cos/log/exp/^ (which presumably return full long-float precision), but also mathematical constants such as %pi, %e, %gamma...; and mathematical functions such as gamma, bessel_j, ... I would hope that routines such as find_root and the like are written in a precision-independent way, but I don't know. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080206/1b9f006b/attachment.htm From macrakis at alum.mit.edu Wed Feb 6 08:44:53 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 6 Feb 2008 09:44:53 -0500 Subject: [Maxima] Handheld maxima? In-Reply-To: <8288517.1202299505785.JavaMail.root@mswamui-blood.atl.sa.earthlink.net> References: <8288517.1202299505785.JavaMail.root@mswamui-blood.atl.sa.earthlink.net> Message-ID: <8b356f880802060644q1a10365ak419302cdca191927@mail.gmail.com> On Feb 6, 2008 7:05 AM, Ed Beroset wrote: > Alasdair McAndrew wrote: > I'd have preferred to have Maxima, but was able to find no port of it to a > PDA (and I'm unable to do it myself). So what I actually now use on my Palm > device is Lyme. http://www.calerga.com/products/LyME/index.html > >From a quick skim of the doc, the released version of Lyme appears to be strictly numerical; is there a symbolic version in beta or something? -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080206/6382e21d/attachment.htm From raymond.toy at ericsson.com Wed Feb 6 10:11:08 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Wed, 06 Feb 2008 11:11:08 -0500 Subject: [Maxima] Feature request: cosh(asinh(x)) = sqrt(x^2+1) In-Reply-To: <8b356f880801220816h6f06d321mc95fe2568afbc5a@mail.gmail.com> References: <47938211.2080208@tu-dortmund.de> <479606D9.80009@ericsson.com> <8b356f880801220816h6f06d321mc95fe2568afbc5a@mail.gmail.com> Message-ID: <47A9DC1C.6010604@ericsson.com> Stavros Macrakis wrote: > On Jan 22, 2008 10:08 AM, Raymond Toy (RT/EUS) > wrote: > > >> cosh(asinh(x)) = sqrt(x^2 + 1) > > > > Should maxima already know this and if so, how > should it be done? I think it would be easy to add this rule in > trigo.lisp, but is that the right thing to do? > > > Sure, why not? And the simplification should respect triginverses. I'm > assuming no one wants the written-out forms of asinh(cosh(x)), > atan(sinh(x)), etc. to be built-in, though. They are rather messy and > you might as well use logarc/exponentialize. Finally got around to finishing this. So now maxima knows sinh of acosh or atanh, cosh of asinh or atanh, and tanh of asinh or acosh. I'll check this in soon. Ray From ampbox at gmail.com Wed Feb 6 06:47:50 2008 From: ampbox at gmail.com (Masoud Pourmoosa) Date: Wed, 6 Feb 2008 16:17:50 +0330 Subject: [Maxima] Fitting to a random function Message-ID: Hi all Can I use Maxima to fit some data set to my desired function? I know I can fit to linear functions by 'simple_linear_regression' but is there any tool that provide more flexibility, i.e. fitting to a random function with some adjustable parameters, e.g. a*sin(b*x), and determine those parameters? thanks in advance, -- Amir Masoud Pourmoosa http://physics.sharif.edu/~amp -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080206/54cd1fa2/attachment.htm From willisb at unk.edu Wed Feb 6 20:04:06 2008 From: willisb at unk.edu (Barton Willis) Date: Wed, 6 Feb 2008 20:04:06 -0600 Subject: [Maxima] numerical evaluation of psi0 In-Reply-To: <47A9DC1C.6010604@ericsson.com> References: <47938211.2080208@tu-dortmund.de> <479606D9.80009@ericsson.com> <8b356f880801220816h6f06d321mc95fe2568afbc5a@mail.gmail.com>, <47A9DC1C.6010604@ericsson.com> Message-ID: I evaluated psi[0](1.78095) using webMathematica, Maple 10, and Maxima 5.14.0 to 50 digits: Created by webMathematica 0.27085244394958037219241274879122247322668078991599 Maple 0.27085617938915025987352993092362827661833339343790 Maxima 0.2708561793891502598735299309236282766183333934379b-1 (1) What's the story? (2) Does anybody have a reference to how our psi function works? It seems to use a modified asymptotic expansion. (3) Does our psi function work in the complex plane? --- you do need to rectform the output. Barton http://functions.wolfram.com/webMathematica/FunctionEvaluation.jsp?name=PolyGamma From robert.dodier at gmail.com Wed Feb 6 22:43:22 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 6 Feb 2008 21:43:22 -0700 Subject: [Maxima] Fitting to a random function In-Reply-To: References: Message-ID: On 2/6/08, Masoud Pourmoosa wrote: > Can I use Maxima to fit some data set to my desired function? I know I can > fit to linear functions by 'simple_linear_regression' but is there any tool > that provide more flexibility, i.e. fitting to a random function with some > adjustable parameters, e.g. a*sin(b*x), and determine those parameters? There is an add-on package "lsquares" by which more general functions can be fit to data. First one constructs an expression for the mean-square error, then one finds parameter estimates by minimizing that error. ?? lsquares finds the documentation for lsquares, with several examples. Hope this helps, Robert Dodier From pebbles at schattenlauf.de Thu Feb 7 05:40:05 2008 From: pebbles at schattenlauf.de (Hanno Behrens) Date: Thu, 7 Feb 2008 12:40:05 +0100 Subject: [Maxima] Handheld maxima?/openmoko.org In-Reply-To: <8288517.1202299505785.JavaMail.root@mswamui-blood.atl.sa.earthlink.net> References: <8288517.1202299505785.JavaMail.root@mswamui-blood.atl.sa.earthlink.net> Message-ID: <200802071240.05830.pebbles@schattenlauf.de> Am Mittwoch, 6. Februar 2008 schrieb Ed Beroset: > Alasdair McAndrew wrote: > >I may be in the market for a new handheld device/ PDA (my old Palm > > Tungsten T3 is slowly giving up the ghost), and it would be nice to have > > the mathematical functionality of some sort of CAS on it. Is there > > anything like Maxima available for a PDA? > > I'd have preferred to have Maxima, but was able to find no port of it to a > PDA (and I'm unable to do it myself). So what I actually now use on my > Palm device is Lyme. http://www.calerga.com/products/LyME/index.html When using a PDA/Smartphone, why not using a Neo 1973 with openmoko.org? Should be working nice, doesn't it? http://openmoko.org/ As it happens, I will have a small programming project on that pretty cuty soon. Hope to get some experience with it. Hanno -- Hanno Behrens - Hamburg http://pebbles.schattenlauf.de/ Ceterum censeo microsoft esse delendam GPG-Schl?ssel-ID:: 0x622084F589F59F36 Fingerabdruck: B906 30EC 7F29 6333 0E01 302B 6220 84F5 89F5 9F36 From raymond.toy at ericsson.com Thu Feb 7 09:06:39 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Thu, 07 Feb 2008 10:06:39 -0500 Subject: [Maxima] numerical evaluation of psi0 In-Reply-To: References: <47938211.2080208@tu-dortmund.de> <479606D9.80009@ericsson.com> <8b356f880801220816h6f06d321mc95fe2568afbc5a@mail.gmail.com>, <47A9DC1C.6010604@ericsson.com> Message-ID: <47AB1E7F.3020606@ericsson.com> Barton Willis wrote: > I evaluated psi[0](1.78095) using webMathematica, Maple 10, and Maxima > 5.14.0 to 50 > digits: > > Created by webMathematica > 0.27085244394958037219241274879122247322668078991599 > Maple > 0.27085617938915025987352993092362827661833339343790 > Maxima > 0.2708561793891502598735299309236282766183333934379b-1 > > (1) What's the story? You mean that Mma returns something different? I think you need to say 1.7809500000. Something about how mma does some kind of significance arithmetic or something. I get something close to Maple's value then. > > (2) Does anybody have a reference to how our psi function works? It > seems to use a modified asymptotic expansion. I looked at bffac a while back that is the asymptotic series for log gamma. A peek at bfpsi shows that it is probably also the asymptotic series for psi. Probably A&S 6.3.18. (We should document these routines.) > > (3) Does our psi function work in the complex plane? --- you do need > to rectform the output. If it is A&S 6.3.18, it should work in |arg z| < pi. But I see that the code for bfpsi0 (in bffac) says: if z < 0 then bfloat(%pi*cot(%pi*(-z)))+bfpsi0(1-z,fpprec) That z < 0 should probably be realpart(z) < 0 so we can apply the reflection formula. But psi[0](1b0 + 3b0*%i) produces same answer as webMathmetica does. bfpsi0 probably needs a few carefully placed calls to expand or rectform, like in cbffac. My 2 cents, anyway, Ray From willisb at unk.edu Thu Feb 7 09:43:13 2008 From: willisb at unk.edu (Barton Willis) Date: Thu, 7 Feb 2008 09:43:13 -0600 Subject: [Maxima] numerical evaluation of psi0 In-Reply-To: <47AB1E7F.3020606@ericsson.com> Message-ID: maxima-bounces at math.utexas.edu wrote on 02/07/2008 09:06:39 AM: > Barton Willis wrote: > > I evaluated psi[0](1.78095) using webMathematica, Maple 10, and Maxima > > 5.14.0 to 50 > You mean that Mma returns something different? When I re-did the Mma calculation, all three values agreed. Sorry about that. > > (2) Does anybody have a reference to how our psi function works? It > > seems to use a modified asymptotic expansion. > I looked at bffac a while back that is the asymptotic series for log > gamma. A peek at bfpsi shows that it is probably also the asymptotic > series for psi. Probably A&S 6.3.18. I think there is a clever modification of 6.3.18. If I figure it out, I'll append a comment. Let's see if we can tweak bfpsi0 to work better in the complex plane... Barton -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080207/eaf7dee3/attachment.htm From jelledejong at powercraft.nl Thu Feb 7 15:06:00 2008 From: jelledejong at powercraft.nl (Jelle de Jong) Date: Thu, 07 Feb 2008 22:06:00 +0100 Subject: [Maxima] request for help getting maxima to plot the like i would want Message-ID: <47AB72B8.2030407@powercraft.nl> Hello everybody, I have been using and developing linux for 3 years and am an experienced user. I am following some basic mathematical classes on my university. In this collage I have to use software to calculate and analyze functions. The software that is used is called Derive: http://en.wikipedia.org/wiki/Derive_computer_algebra_system For a real FLOSS user this is not an option, so I went trying out all the mathematical tools for GNU/Linux. I think maxima is the program that should be able to do all the calculations and visualisations on the functions I use. However after spending a day working and trying I cant get my functions to plot the way I want and to calculate on them (differentiations / Integration / Compare / Solve). I tried to do somethings but its not working out very well. Would somebody be willing to help me out, and demonstrate the command required to be able to plot in almost exactly the same way as the 2 example pages with the plots, that I included as attachment. (see this link: http://filebin.ca/jggfuw) Kind regards, Jelle Formulas and things i was working on: f(z):=-x-y+5; f(z):=9-x^2-Y^2; f(z):=5-x^2; f(z):=-2*x-y+4; f(z):=-x-3*y+6; f(z):=x+y-4; f(z):=x^2+y^2=r^2; r:3; f(z0):=0=y-x^2; f(z1):=1=y-x^2; f(z4):=4=y-x^2; solve(f(z0)); f(z):=5-x^2; plot2d(f(z),[x,-6,6],[y,-6,6],[xlabel,"X"],[ylabel,"Y"],[gnuplot_preamble,"set xzeroaxis;set yzeroaxis;unset border;set xtics"]); plot3d(f(z),[x,-6,6],[y,-6,6]); From jelledejong at powercraft.nl Thu Feb 7 15:08:00 2008 From: jelledejong at powercraft.nl (Jelle de Jong) Date: Thu, 07 Feb 2008 22:08:00 +0100 Subject: [Maxima] request for help getting maxima to plot the like i would want (correct link) Message-ID: <47AB7330.1070006@powercraft.nl> Hello everybody, I have been using and developing linux for 3 years and am an experienced user. I am following some basic mathematical classes on my university. In this collage I have to use software to calculate and analyze functions. The software that is used is called Derive: http://en.wikipedia.org/wiki/Derive_computer_algebra_system For a real FLOSS user this is not an option, so I went trying out all the mathematical tools for GNU/Linux. I think maxima is the program that should be able to do all the calculations and visualisations on the functions I use. However after spending a day working and trying I cant get my functions to plot the way I want and to calculate on them (differentiations / Integration / Compare / Solve). I tried to do somethings but its not working out very well. Would somebody be willing to help me out, and demonstrate the command required to be able to plot in almost exactly the same way as the 2 example pages with the plots, that I included as attachment. (see this link: http://filebin.ca/fzqyn) (djvu file) Kind regards, Jelle Formulas and things i was working on: f(z):=-x-y+5; f(z):=9-x^2-Y^2; f(z):=5-x^2; f(z):=-2*x-y+4; f(z):=-x-3*y+6; f(z):=x+y-4; f(z):=x^2+y^2=r^2; r:3; f(z0):=0=y-x^2; f(z1):=1=y-x^2; f(z4):=4=y-x^2; solve(f(z0)); f(z):=5-x^2; plot2d(f(z),[x,-6,6],[y,-6,6],[xlabel,"X"],[ylabel,"Y"],[gnuplot_preamble,"set xzeroaxis;set yzeroaxis;unset border;set xtics"]); plot3d(f(z),[x,-6,6],[y,-6,6]); From biomates at telefonica.net Thu Feb 7 16:29:28 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 07 Feb 2008 23:29:28 +0100 Subject: [Maxima] request for help getting maxima to plot the like i would want In-Reply-To: <47AB72B8.2030407@powercraft.nl> References: <47AB72B8.2030407@powercraft.nl> Message-ID: <47AB8648.60901@telefonica.net> Jelle de Jong escribi?: > Hello everybody, > > I have been using and developing linux for 3 years and am an experienced > user. I am following some basic mathematical classes on my university. > In this collage I have to use software to calculate and analyze > functions. The software that is used is called Derive: > http://en.wikipedia.org/wiki/Derive_computer_algebra_system > > For a real FLOSS user this is not an option, so I went trying out all > the mathematical tools for GNU/Linux. I think maxima is the program that > should be able to do all the calculations and visualisations on the > functions I use. However after spending a day working and trying I cant > get my functions to plot the way I want and to calculate on them > (differentiations / Integration / Compare / Solve). > > I tried to do somethings but its not working out very well. > > Would somebody be willing to help me out, and demonstrate the command > required to be able to plot in almost exactly the same way as the 2 > example pages with the plots, that I included as attachment. (see this > link: http://filebin.ca/jggfuw) > Hello, You can try this code with Maxima 5.14: load(draw)$ draw3d(implicit(z=-x-y+5, x,0,5, y,0,5, z,0,5))$ draw3d(surface_hide = true, implicit(z=9-x^2-y^2, x,-4,4, y,-4,4, z,0,10))$ /* Define the parametric curve: x=t, y=2, z=5-t^2 */ draw3d(parametric(t,2,5-t^2, t,-5,5))$ type ? draw for more information about this package. -- Mario Rodriguez Riotorto www.biomates.net From jelledejong at powercraft.nl Thu Feb 7 15:04:04 2008 From: jelledejong at powercraft.nl (Jelle de Jong) Date: Thu, 07 Feb 2008 22:04:04 +0100 Subject: [Maxima] request for help getting maxima to plot the like i would want Message-ID: <47AB7244.30303@powercraft.nl> Hello everybody, I have been using and developing linux for 3 years and am an experienced user. I am following some basic mathematical classes on my university. In this collage I have to use software to calculate and analyze functions. The software that is used is called Derive: http://en.wikipedia.org/wiki/Derive_computer_algebra_system For a real FLOSS user this is not an option, so I went trying out all the mathematical tools for GNU/Linux. I think maxima is the program that should be able to do all the calculations and visualisations on the functions I use. However after spending a day working and trying I cant get my functions to plot the way I want and to calculate on them (differentiations / Integration / Compare / Solve). I tried to do somethings but its not working out very well. Would somebody be willing to help me out, and demonstrate the command required to be able to plot in almost exactly the same way as the 2 example pages with the plots, that I included as attachment. Kind regards, Jelle Formulas and things i was working on: f(z):=-x-y+5; f(z):=9-x^2-Y^2; f(z):=5-x^2; f(z):=-2*x-y+4; f(z):=-x-3*y+6; f(z):=x+y-4; f(z):=x^2+y^2=r^2; r:3; f(z0):=0=y-x^2; f(z1):=1=y-x^2; f(z4):=4=y-x^2; solve(f(z0)); f(z):=5-x^2; plot2d(f(z),[x,-6,6],[y,-6,6],[xlabel,"X"],[ylabel,"Y"],[gnuplot_preamble,"set xzeroaxis;set yzeroaxis;unset border;set xtics"]); plot3d(f(z),[x,-6,6],[y,-6,6]); -------------- next part -------------- A non-text attachment was scrubbed... Name: Jelle de Jong - WEX2 - Three example graphics for Maxima - 07-02-2008 - v0.1.1j.djvu Type: image/x-djvu Size: 61463 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080207/95d05151/attachment-0001.bin From jelledejong at powercraft.nl Fri Feb 8 06:30:56 2008 From: jelledejong at powercraft.nl (Jelle de Jong) Date: Fri, 08 Feb 2008 13:30:56 +0100 Subject: [Maxima] request for help getting maxima to plot the like i would want In-Reply-To: <47AB8648.60901@telefonica.net> References: <47AB72B8.2030407@powercraft.nl> <47AB8648.60901@telefonica.net> Message-ID: <47AC4B80.5090306@powercraft.nl> Mario Rodriguez wrote: > Jelle de Jong escribi?: >> Hello everybody, >> >> I have been using and developing linux for 3 years and am an experienced >> user. I am following some basic mathematical classes on my university. >> In this collage I have to use software to calculate and analyze >> functions. The software that is used is called Derive: >> http://en.wikipedia.org/wiki/Derive_computer_algebra_system >> >> For a real FLOSS user this is not an option, so I went trying out all >> the mathematical tools for GNU/Linux. I think maxima is the program that >> should be able to do all the calculations and visualisations on the >> functions I use. However after spending a day working and trying I cant >> get my functions to plot the way I want and to calculate on them >> (differentiations / Integration / Compare / Solve). >> >> I tried to do somethings but its not working out very well. >> >> Would somebody be willing to help me out, and demonstrate the command >> required to be able to plot in almost exactly the same way as the 2 >> example pages with the plots, that I included as attachment. (see this >> link: http://filebin.ca/jggfuw) >> > > Hello, > > You can try this code with Maxima 5.14: > > load(draw)$ > > draw3d(implicit(z=-x-y+5, x,0,5, y,0,5, z,0,5))$ > > draw3d(surface_hide = true, > implicit(z=9-x^2-y^2, x,-4,4, y,-4,4, z,0,10))$ > > /* > Define the parametric curve: > x=t, > y=2, > z=5-t^2 > */ > draw3d(parametric(t,2,5-t^2, t,-5,5))$ > > type ? draw for more information about this package. > Hi Mario, Thank you for your help, I compiled the latest maxima and have been trying your command: However I am still unable to get an X-ax and Y-Ax in the middle: Y | | ----------- X | | I have been trying the following input, however I cant get it right. I got a function that I substitute with an other function creating a new function that I want to plot. I think I really need a good document with examples how to port math that you do with your hands and head to something I can enter in maxima. function: z=y-x^2; function, z=4; solve(%,y); plot2d(%,[x,-10,10]); load("draw"); f1: 4; f2: y-x^2; solve(f1=f2,y); draw2d(explicit(%,x,-6,6)); Kind regards, Jelle From hansen at akb-antriebstechnik.de Fri Feb 8 09:20:51 2008 From: hansen at akb-antriebstechnik.de (Helge Hansen) Date: Fri, 8 Feb 2008 16:20:51 +0100 Subject: [Maxima] Problem with "globalsolve:true" Message-ID: <000f01c86a66$309ca5c0$960aa8c0@PCHelge> Hi, Does anybody understand why K2 in the following script is not solved global? What am I doing wrong? In my opinion the last line should be: M(z)=z*A-(q*z^2)/2 (%i1) M(z)::=K2+A*z-q*z^2/2; (%o1) M(z)::=K2+A*z+((-q)*z^2)/2 (%i2) globalsolve:true$ (%i3) solve([M(z)=0,z=0],[K2,z]); (%o3) [[K2=0,z=0]] (%i4) display(M(z))$ M(z)=K2+z*A-(q*z^2)/2 From biomates at telefonica.net Fri Feb 8 09:28:58 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 08 Feb 2008 16:28:58 +0100 Subject: [Maxima] request for help getting maxima to plot the like i would want In-Reply-To: <47AC4B80.5090306@powercraft.nl> References: <47AB72B8.2030407@powercraft.nl> <47AB8648.60901@telefonica.net> <47AC4B80.5090306@powercraft.nl> Message-ID: <47AC753A.2000902@telefonica.net> Hello, > Hi Mario, > > Thank you for your help, I compiled the latest maxima and have been > trying your command: > > However I am still unable to get an X-ax and Y-Ax in the middle: > > Y > | > | > ----------- X > | > | > > I have been trying the following input, however I cant get it right. > This is an (baroque) example showing options related to axis in 3d (you probably won't need to use all of them!): draw3d( xaxis=true, xaxis_color = red, xaxis_type=solid, xaxis_width=2, yaxis=true, yaxis_color = aquamarine, yaxis_type=solid, yaxis_width=4, zaxis=true, zaxis_color = "#ff25cb", zaxis_type=dots, zaxis_width=6, xrange = [-1,6], yrange = [-1,6], zrange = [-1,6], xlabel = "Athos", ylabel = "Portos", zlabel = "Aramis", user_preamble= "set xyplane at 0", implicit(z=-x-y+5, x,0,5, y,0,5, z,0,5)); > load("draw"); > f1: 4; > f2: y-x^2; > solve(f1=f2,y); > draw2d(explicit(%,x,-6,6)); > Note in this example that %[1] is the 1st component of the list returned by solve, which is an equation, and rhs returns its right hand side: f1: 4; f2: y-x^2; solve(f1=f2,y); draw2d(explicit(rhs(%[1]),x,-6,6)); hth -- Mario Rodriguez Riotorto www.biomates.net From fateman at cs.berkeley.edu Fri Feb 8 09:50:36 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Fri, 08 Feb 2008 07:50:36 -0800 Subject: [Maxima] Problem with "globalsolve:true" In-Reply-To: <000f01c86a66$309ca5c0$960aa8c0@PCHelge> References: <000f01c86a66$309ca5c0$960aa8c0@PCHelge> Message-ID: <47AC7A4C.7040103@cs.berkeley.edu> globalsolve does not redefine functions. You seem to be using much more complicated syntax and ideas than needed. Also you should use linsolve if you want to have globalsolve work. Solve on systems apparently ignores globalsolve, perhaps because algebraic systems may have many solutions... which should be assigned globally> Try M: K2+A*z-q*z^2/2; globalsolve:true; linsolve([M=0,z=0],[K2,z]); ev(M); or just substituting z=0 in Helge Hansen wrote: > Hi, > > Does anybody understand why K2 in the following script is not solved global? > What am I doing wrong? In my opinion the last line should be: > M(z)=z*A-(q*z^2)/2 > > (%i1) M(z)::=K2+A*z-q*z^2/2; > (%o1) M(z)::=K2+A*z+((-q)*z^2)/2 > > (%i2) globalsolve:true$ > > (%i3) solve([M(z)=0,z=0],[K2,z]); > (%o3) [[K2=0,z=0]] > > (%i4) display(M(z))$ > > M(z)=K2+z*A-(q*z^2)/2 > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From robert.dodier at gmail.com Fri Feb 8 09:58:01 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 8 Feb 2008 08:58:01 -0700 Subject: [Maxima] Problem with "globalsolve:true" In-Reply-To: <000f01c86a66$309ca5c0$960aa8c0@PCHelge> References: <000f01c86a66$309ca5c0$960aa8c0@PCHelge> Message-ID: On 2/8/08, Helge Hansen wrote: > Does anybody understand why K2 in the following script is not solved global? > What am I doing wrong? In my opinion the last line should be: > M(z)=z*A-(q*z^2)/2 > > (%i1) M(z)::=K2+A*z-q*z^2/2; > (%o1) M(z)::=K2+A*z+((-q)*z^2)/2 > > (%i2) globalsolve:true$ > > (%i3) solve([M(z)=0,z=0],[K2,z]); Well, M(z) = 0 is not a linear equation, so solve ignores globalsolve. The documentation for globalsolve states that, although globalsolve is a mess anyway so it is impossible to be entirely clear about it. My advice is to ignore globalsolve and find another way. Maybe subst(K2=0, M(z)) or ev(M(z), K2=0) yields the expected result. I think the Maxima developers should consider cutting out globalsolve. Its implementation is a mess, and even if it worked right, it would make a mess for the user by causing assignments. best Robert Dodier From jelledejong at powercraft.nl Fri Feb 8 14:37:15 2008 From: jelledejong at powercraft.nl (Jelle de Jong) Date: Fri, 08 Feb 2008 21:37:15 +0100 Subject: [Maxima] request for help getting maxima to plot the like i would want In-Reply-To: <47AC753A.2000902@telefonica.net> References: <47AB72B8.2030407@powercraft.nl> <47AB8648.60901@telefonica.net> <47AC4B80.5090306@powercraft.nl> <47AC753A.2000902@telefonica.net> Message-ID: <47ACBD7B.9090509@powercraft.nl> Mario Rodriguez wrote: > Hello, > >> Hi Mario, >> >> Thank you for your help, I compiled the latest maxima and have been >> trying your command: >> >> However I am still unable to get an X-ax and Y-Ax in the middle: >> >> Y >> | >> | >> ----------- X >> | >> | >> >> I have been trying the following input, however I cant get it right. >> > > This is an (baroque) example showing options related to axis in 3d (you > probably won't need to use all of them!): > > draw3d( > xaxis=true, xaxis_color = red, xaxis_type=solid, xaxis_width=2, > yaxis=true, yaxis_color = aquamarine, yaxis_type=solid, > yaxis_width=4, > zaxis=true, zaxis_color = "#ff25cb", zaxis_type=dots, zaxis_width=6, > xrange = [-1,6], yrange = [-1,6], zrange = [-1,6], > xlabel = "Athos", ylabel = "Portos", zlabel = "Aramis", > user_preamble= "set xyplane at 0", > implicit(z=-x-y+5, x,0,5, y,0,5, z,0,5)); > > > > >> load("draw"); >> f1: 4; >> f2: y-x^2; >> solve(f1=f2,y); >> draw2d(explicit(%,x,-6,6)); >> > Note in this example that %[1] is the 1st component of the list returned > by solve, which is an equation, and rhs returns its right hand side: > > f1: 4; > f2: y-x^2; > solve(f1=f2,y); > draw2d(explicit(rhs(%[1]),x,-6,6)); > > > hth > > Thanks you all for the help, it helped me started, however I still got a list of issues. I typed them on the end of this email. I hope somebody can help me out. Kind regards, Jelle load("draw"); f(z):=-2*x-y+4; rhs(%); draw3d(implicit(%, x,0,10, y,0,10, z,0,10),xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,zaxis=true,ztics_axis=true,zaxis_color=red,zaxis_type=solid,zaxis_width=1,xlabel = "X-axis", ylabel = "Y-axis", zlabel = "Z-axis",user_preamble= "unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0"); f(z):=-x-3*y+6; rhs(%); draw3d(implicit(%, x,0,10, y,0,10, z,0,10),xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,zaxis=true,ztics_axis=true,zaxis_color=red,zaxis_type=solid,zaxis_width=1,xlabel = "X-axis", ylabel = "Y-axis", zlabel = "Z-axis",user_preamble= "unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0"); f(z):=x+y-4; rhs(%); draw3d(implicit(%, x,0,10, y,0,10, z,0,10),xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,zaxis=true,ztics_axis=true,zaxis_color=red,zaxis_type=solid,zaxis_width=1,xlabel = "X-axis", ylabel = "Y-axis", zlabel = "Z-axis",user_preamble= "unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0"); function: z=y-x^2; function, z=4; solve(%,y); rhs(%[1]); draw2d(explicit(%,x,-10,10),xrange=[0,10],yrange=[0,10],xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,xlabel="X-axis",ylabel="Y-axis",user_preamble="unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0; set term png transparent; set out \"drawing.png\""); f1: 0; f2: y-x^2; solve(f1=f2,y); rhs(%[1]); draw2d(explicit(%,x,-10,10),xrange=[-10,10],yrange=[-10,10],title=%,xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,xlabel="X-axis",ylabel="Y-axis",user_preamble="unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0; set term png transparent; set out \"drawing.png\""); f1: 1; f2: y-x^2; solve(f1=f2,y); rhs(%[1]); draw2d(explicit(%,x,-10,10),xrange=[-10,10],yrange=[-10,10],title=%,xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,xlabel="X-axis",ylabel="Y-axis",user_preamble="unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0; set term png transparent; set out \"drawing.png\""); f1: 4; f2: y-x^2; solve(f1=f2,y); rhs(%[1]); draw2d(explicit(%,x,-10,10),xrange=[-10,10],yrange=[-10,10],title=%,xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,xlabel="X-axis",ylabel="Y-axis",user_preamble="unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0; set term png transparent; set out \"drawing.png\""); quit(); 1. does somebody knows how to get the names of the axes automaticly on the right places (end of the axes) 2. does somebody knows how to get the zeros to disapear 3. does somebody knows how to get fuction description to apear as title in the plot 4. does somebody knows how to get fuction description to become the name of the outputfile 5. does somebody knows how to get multiple fuctions in one plot with diffrenc collors and a clear legend 6. does somebody knows how to get multiple windows with gnuplots so I can run a batch and popup mutiple windows From jelledejong at powercraft.nl Fri Feb 8 14:59:44 2008 From: jelledejong at powercraft.nl (Jelle de Jong) Date: Fri, 08 Feb 2008 21:59:44 +0100 Subject: [Maxima] request for help getting maxima to plot the like i would want (added images) In-Reply-To: <47AC753A.2000902@telefonica.net> References: <47AB72B8.2030407@powercraft.nl> <47AB8648.60901@telefonica.net> <47AC4B80.5090306@powercraft.nl> <47AC753A.2000902@telefonica.net> Message-ID: <47ACC2C0.1060707@powercraft.nl> Mario Rodriguez wrote: > Hello, > >> Hi Mario, >> >> Thank you for your help, I compiled the latest maxima and have been >> trying your command: >> >> However I am still unable to get an X-ax and Y-Ax in the middle: >> >> Y >> | >> | >> ----------- X >> | >> | >> >> I have been trying the following input, however I cant get it right. >> > > This is an (baroque) example showing options related to axis in 3d (you > probably won't need to use all of them!): > > draw3d( > xaxis=true, xaxis_color = red, xaxis_type=solid, xaxis_width=2, > yaxis=true, yaxis_color = aquamarine, yaxis_type=solid, > yaxis_width=4, > zaxis=true, zaxis_color = "#ff25cb", zaxis_type=dots, zaxis_width=6, > xrange = [-1,6], yrange = [-1,6], zrange = [-1,6], > xlabel = "Athos", ylabel = "Portos", zlabel = "Aramis", > user_preamble= "set xyplane at 0", > implicit(z=-x-y+5, x,0,5, y,0,5, z,0,5)); > > > > >> load("draw"); >> f1: 4; >> f2: y-x^2; >> solve(f1=f2,y); >> draw2d(explicit(%,x,-6,6)); >> > Note in this example that %[1] is the 1st component of the list returned > by solve, which is an equation, and rhs returns its right hand side: > > f1: 4; > f2: y-x^2; > solve(f1=f2,y); > draw2d(explicit(rhs(%[1]),x,-6,6)); > > > hth > > Thanks you all for the help, it helped me started, however I still got a list of issues. I typed them on the end of this email. I hope somebody can help me out. I added some plot images in the attachment Kind regards, Jelle load("draw"); f(z):=-2*x-y+4; rhs(%); draw3d(implicit(%, x,0,10, y,0,10, z,0,10),xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,zaxis=true,ztics_axis=true,zaxis_color=red,zaxis_type=solid,zaxis_width=1,xlabel = "X-axis", ylabel = "Y-axis", zlabel = "Z-axis",user_preamble= "unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0"); f(z):=-x-3*y+6; rhs(%); draw3d(implicit(%, x,0,10, y,0,10, z,0,10),xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,zaxis=true,ztics_axis=true,zaxis_color=red,zaxis_type=solid,zaxis_width=1,xlabel = "X-axis", ylabel = "Y-axis", zlabel = "Z-axis",user_preamble= "unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0"); f(z):=x+y-4; rhs(%); draw3d(implicit(%, x,0,10, y,0,10, z,0,10),xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,zaxis=true,ztics_axis=true,zaxis_color=red,zaxis_type=solid,zaxis_width=1,xlabel = "X-axis", ylabel = "Y-axis", zlabel = "Z-axis",user_preamble= "unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0"); function: z=y-x^2; function, z=4; solve(%,y); rhs(%[1]); draw2d(explicit(%,x,-10,10),xrange=[0,10],yrange=[0,10],xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,xlabel="X-axis",ylabel="Y-axis",user_preamble="unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0; set term png transparent; set out \"drawing.png\""); f1: 0; f2: y-x^2; solve(f1=f2,y); rhs(%[1]); draw2d(explicit(%,x,-10,10),xrange=[-10,10],yrange=[-10,10],title=%,xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,xlabel="X-axis",ylabel="Y-axis",user_preamble="unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0; set term png transparent; set out \"drawing.png\""); f1: 1; f2: y-x^2; solve(f1=f2,y); rhs(%[1]); draw2d(explicit(%,x,-10,10),xrange=[-10,10],yrange=[-10,10],title=%,xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,xlabel="X-axis",ylabel="Y-axis",user_preamble="unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0; set term png transparent; set out \"drawing.png\""); f1: 4; f2: y-x^2; solve(f1=f2,y); rhs(%[1]); draw2d(explicit(%,x,-10,10),xrange=[-10,10],yrange=[-10,10],title=%,xaxis=true,xtics_axis=true,xaxis_color=red,xaxis_type=solid,xaxis_width=1,yaxis=true,ytics_axis=true,yaxis_color=red,yaxis_type=solid,yaxis_width=1,xlabel="X-axis",ylabel="Y-axis",user_preamble="unset border; set xtics nomirror; set ytics nomirror; set xyplane at 0; set term png transparent; set out \"drawing.png\""); quit(); 1. does somebody knows how to get the names of the axes automaticly on the right places (end of the axes) 2. does somebody knows how to get the zeros to disapear 3. does somebody knows how to get fuction description to apear as title in the plot 4. does somebody knows how to get fuction description to become the name of the outputfile 5. does somebody knows how to get multiple fuctions in one plot with diffrenc collors and a clear legend 6. does somebody knows how to get multiple windows with gnuplots so I can run a batch and popup mutiple windows I added some plot images in the attachment -------------- next part -------------- A non-text attachment was scrubbed... Name: drawing-7.zip Type: application/zip Size: 22075 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080208/ff64f6be/attachment-0001.zip From biomates at telefonica.net Fri Feb 8 16:51:56 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 08 Feb 2008 23:51:56 +0100 Subject: [Maxima] request for help getting maxima to plot the like i would want (added images) In-Reply-To: <47ACC2C0.1060707@powercraft.nl> References: <47AB72B8.2030407@powercraft.nl> <47AB8648.60901@telefonica.net> <47AC4B80.5090306@powercraft.nl> <47AC753A.2000902@telefonica.net> <47ACC2C0.1060707@powercraft.nl> Message-ID: <47ACDD0C.8000704@telefonica.net> Hello, > > 1. does somebody knows how to get the names of the axes automaticly on > the right places (end of the axes) Not tested, but I think you can play with gnuplot's 'set label' option in draw's user_preamble option. > 2. does somebody knows how to get the zeros to disapear ? xtics ? ytics ? ztics > 3. does somebody knows how to get fuction description to apear as title > in the plot ? title ? string Something like my_func: x+1$ draw2d(explicit(my_func,x,0,1), title=string(my_func)); could help > 4. does somebody knows how to get fuction description to become the name > of the outputfile ? file_name ? string > 5. does somebody knows how to get multiple fuctions in one plot with > diffrenc collors and a clear legend ? color ? key > 6. does somebody knows how to get multiple windows with gnuplots so I > can run a batch and popup mutiple windows ? draw (see first example for a multiplot window, but not multiple windows) More examples in http://www.telefonica.net/web2/biomates/maxima/gpdraw/ Mario. -- Mario Rodriguez Riotorto www.biomates.net From andrej.vodopivec at gmail.com Sat Feb 9 09:30:36 2008 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Sat, 9 Feb 2008 16:30:36 +0100 Subject: [Maxima] Examples in documentation Message-ID: <7775b21a0802090730j5ca9c942u29c58acf89ca300e@mail.gmail.com> Could someone please explain how examples are created in info files. I would like to know how to change examples embedded in comments like @c ===beg=== @c example; @c ===end=== so that they are written out in info files (I assume this can be done automatically). Thanks, -- Andrej From vvzhy at mail.ru Sat Feb 9 11:26:18 2008 From: vvzhy at mail.ru (Vadim V. Zhytnikov) Date: Sat, 09 Feb 2008 20:26:18 +0300 Subject: [Maxima] Examples in documentation In-Reply-To: <7775b21a0802090730j5ca9c942u29c58acf89ca300e@mail.gmail.com> References: <7775b21a0802090730j5ca9c942u29c58acf89ca300e@mail.gmail.com> Message-ID: <47ADE23A.7020800@mail.ru> Andrej Vodopivec writes: > Could someone please explain how examples are created in info files. I > would like to know how to change examples embedded in comments like > @c ===beg=== > @c example; > @c ===end=== > so that they are written out in info files (I assume this can be done > automatically). > > Thanks, Please take a look at http://maxima.cvs.sourceforge.net/maxima/maxima/doc/info/README.update_examples -- Vadim V. Zhytnikov From woollett at charter.net Sat Feb 9 16:57:45 2008 From: woollett at charter.net (Edwin Woollett) Date: Sat, 9 Feb 2008 14:57:45 -0800 Subject: [Maxima] rncombine? Message-ID: <000301c86b6f$2face120$0d00a8c0@edwinc367e16bd> the manual seems to encourage use of rncombine(...) but ver 5.14 does not know about this function. (%i1) display2d:false$ (%i2) pfeformat; (%o2) false (%i3) e1 : x/a + y/a + z/(2*a); (%o3) z/(2*a)+y/a+x/a (%i4) combine(e1); (%o4) z/(2*a)+(y+x)/a (%i5) rncombine(e1); (%o5) rncombine(z/(2*a)+y/a+x/a) (%i6) pfeformat:true$ (%i7) combine(e1); (%o7) (1/2*z+y+x)/a Ted Woollett win xp From robert.dodier at gmail.com Sat Feb 9 17:52:27 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 9 Feb 2008 16:52:27 -0700 Subject: [Maxima] rncombine? In-Reply-To: <000301c86b6f$2face120$0d00a8c0@edwinc367e16bd> References: <000301c86b6f$2face120$0d00a8c0@edwinc367e16bd> Message-ID: On 2/9/08, Edwin Woollett wrote: > the manual seems to encourage use of rncombine(...) but ver 5.14 does not > know about this function. Looks like you have to enter load(rncomb) first. I guess the ref manual ought to mention that. best, Robert Dodier From willisb at unk.edu Sat Feb 9 18:38:17 2008 From: willisb at unk.edu (Barton Willis) Date: Sat, 9 Feb 2008 18:38:17 -0600 Subject: [Maxima] triangularize is non-idempotent Message-ID: The triangularize function isn't idempotent. Is there a good reason for this? (%i13) matrix([2,4],[0,6]); (%o13) matrix([2,4],[0,6]) (%i14) triangularize(%); (%o14) matrix([2,4],[0,12]) (%i15) triangularize(%); (%o15) matrix([2,4],[0,24]) Barton From woollett at charter.net Sat Feb 9 18:54:29 2008 From: woollett at charter.net (Edwin Woollett) Date: Sat, 9 Feb 2008 16:54:29 -0800 Subject: [Maxima] rncombine? References: <000301c86b6f$2face120$0d00a8c0@edwinc367e16bd> Message-ID: <000501c86b7f$7e69a310$0d00a8c0@edwinc367e16bd> On 2/9/08, Robert Dodierwrote: > Looks like you have to enter load(rncomb) first. > I guess the ref manual ought to mention that. > that works. thanks, ted From willisb at unk.edu Sun Feb 10 01:38:59 2008 From: willisb at unk.edu (Barton Willis) Date: Sun, 10 Feb 2008 01:38:59 -0600 Subject: [Maxima] rncombine? In-Reply-To: <000501c86b7f$7e69a310$0d00a8c0@edwinc367e16bd> References: <000301c86b6f$2face120$0d00a8c0@edwinc367e16bd> , <000501c86b7f$7e69a310$0d00a8c0@edwinc367e16bd> Message-ID: Rncombine is broken: (%i2) rncombine (1/x - 1/y); (%o2) 1-1/y Barton From willisb at unk.edu Sun Feb 10 02:08:30 2008 From: willisb at unk.edu (Barton Willis) Date: Sun, 10 Feb 2008 02:08:30 -0600 Subject: [Maxima] rncombine? In-Reply-To: References: <000301c86b6f$2face120$0d00a8c0@edwinc367e16bd> , <000501c86b7f$7e69a310$0d00a8c0@edwinc367e16bd>, Message-ID: The rncombine bug was reported in SF bug 872433 http://sourceforge.net/tracker/index.php?func=detail&aid=872433&group_id=4933&atid=104933 Barton From willisb at unk.edu Sun Feb 10 08:55:52 2008 From: willisb at unk.edu (Barton Willis) Date: Sun, 10 Feb 2008 08:55:52 -0600 Subject: [Maxima] autoloading of linearalgebra In-Reply-To: References: <000301c86b6f$2face120$0d00a8c0@edwinc367e16bd> , <000501c86b7f$7e69a310$0d00a8c0@edwinc367e16bd>, Message-ID: Each call to vandermonde_matrix causes Maxima to reload *all* of linearalgbra. Other functions in lineralgebra autoload (say rowop), but they don't reload all of linearalgebra every time. I looked at max_ext, but I don't know what's going on. Does anybody know a fix? Try: trace(load); vandermonde_matrix([a,b]); vandermonde_matrix([a,b]); Barton From dtc-maxima at scieneer.com Sun Feb 10 09:54:06 2008 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Mon, 11 Feb 2008 02:54:06 +1100 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> Message-ID: <47AF1E1E.8060009@scieneer.com> Stavros Macrakis wrote: > On Feb 6, 2008 8:38 AM, Douglas Crosher > wrote: > > A variant of Maxima 5.14.0cvs is available that replaces the use of > the Common Lisp 'double-float type with the 'long-float type for > Maxima floating point numbers. ... > I'm not sure what you mean by 'integrated'. If there is a compile-time > switch that chooses between double-float and long-float to implement > Maxima float, with the default being double-float, that would be useful > for experimentation moving forward. If this is a runtime choice (some > numbers are floats, some long floats), what is the interface? The current changes replace usage of double-float with long-floats - its a lot of source code changes. Using the 'flonum type rather than double-float and replacing all double-float numbers with the general form using E would make it easier to support either double-float or long-float and it may even be possible to use the CMUCL double-double float. Regards Douglas Crosher From dtc-maxima at scieneer.com Sun Feb 10 09:55:15 2008 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Mon, 11 Feb 2008 02:55:15 +1100 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47A9C319.6070308@cs.berkeley.edu> References: <47A9B861.2080707@scieneer.com> <47A9C319.6070308@cs.berkeley.edu> Message-ID: <47AF1E63.50300@scieneer.com> R Fateman wrote: > Adding extra precision algorithms (good for 80 bits) when the hardware > only does 64 bits might slow down the programs for those less-precise > systems. (For example, 80-bit sin/cos/log/exp/bessel/...). So maybe > the libraries should be kept separate. The CL implementation should provide accurate implementations of many of these functions, such as sin,cos,log,exp etc. For the others it may be possible for compile-time macros to emit the required number of terms. Quad could be another good option, more precision than 80-bits, although it has less exponent range and is much slower. CLISP long-floats can have a very high precision and a large exponent range, and the precision can be set by the user, so this is an easy path if people need better precision now. CLISP users may even probably prefer this over a quad implementation. Many of the Fortran libraries yield a higher precision when using a higher precision representation for the floating point numbers, but some modifications have been needed. The LAPACK library has been tested, SVD etc, and it is working well. However the modifications to the translated CL files now need to be maintained. Here are some examples of the precision: 1. find_root f(x) := sin(x) - x/2; r: find_root (f(x), x, 0.1, %pi); fpprintprec: 16; fpprec: 1000; f(bfloat(r)); CMUCL 64 bit double-float: 6.154491740245677b-18 SCL 80 bit long-float: - 6.141025968424459b-20 CLISP 1024 bit long-float: - 4.193340718207969b-309 2. LAPACK Eigen values. load(lapack); fpprintprec: 16; fpprec: 1000; rows: 100; cols: 100; m[i, j] := i * cols + j; M: genmatrix (m, rows, cols)$ [L, v, u] : dgeev (M, true, true)$ D : apply (diag_matrix, L)$ E: abs(bfloat(M) . bfloat(v) - bfloat(v) . bfloat(D))$ block([sum2], sum2: 0, for i: 1 thru rows do for j: 1 thru cols do sum2: sum2 + E[i,j]^2, sqrt(sum2)); SCL 64 bit double-float: 9.457340356041502b-10 SCL 80 bit long-float: 5.319785096627637b-13 CLISP 1024 bit long-float: 8.220676310896712b-302 Regards Douglas Crosher From robert.dodier at gmail.com Sun Feb 10 12:06:22 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 10 Feb 2008 11:06:22 -0700 Subject: [Maxima] autoloading of linearalgebra In-Reply-To: References: <000301c86b6f$2face120$0d00a8c0@edwinc367e16bd> <000501c86b7f$7e69a310$0d00a8c0@edwinc367e16bd> Message-ID: On 2/10/08, Barton Willis wrote: > Each call to vandermonde_matrix causes Maxima to reload *all* of > linearalgbra. Other functions in lineralgebra autoload (say rowop), > but they don't reload all of linearalgebra every time. Oh -- $vandermonde_matrix is on the list of Maxima functions to autoload, but it should be on the list of Lisp functions. I'll move it to the other list. There seems to be different ways to arrange for autoloading ... I wonder if some or all of them can be merged. Robert From daniel.hauagge at gmail.com Sun Feb 10 13:49:35 2008 From: daniel.hauagge at gmail.com (Daniel Cabrini Hauagge) Date: Sun, 10 Feb 2008 17:49:35 -0200 Subject: [Maxima] Factoring out expressions Message-ID: <68c5c7820802101149p4248f0daueb88ecd754f1ce95@mail.gmail.com> Hello, I've just started to use Maxima and I'm stumped at a this simple problem. I have an expression of the form 2 2 eq : t (b + a) + t (y + x) and I want to factor out "t". When I use the function factor or factorsum t is correctly isolated but (b+a)^2 and (y+x)^2 are expanded 2 2 2 2 (%o6) t (y + 2 x y + x + b + 2 a b + a ) When I use factorout I get the result that I'm looking for 2 2 (%o5) t ((y + x) + (b + a) ) but I have to pass y, x, b, and a as arguments to factorout (%i5) factorout(eq, x, y, a, b) which is not very practical when you have huge expressions full of variables. Is there a similar function that takes only the expression that I want to factor out as argument? I know how to write a simple function to generate the list with all the atoms and from that subtract the variable/expression that I'm interested in but if there is already a function that does what I want I'd rather use the provided solution. -- Daniel Cabrini Hauagge email: daniel.hauagge at gmail.com cel: +55 (19) 8194-8480 From macrakis at alum.mit.edu Sun Feb 10 14:21:45 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 10 Feb 2008 15:21:45 -0500 Subject: [Maxima] Factoring out expressions In-Reply-To: <68c5c7820802101149p4248f0daueb88ecd754f1ce95@mail.gmail.com> References: <68c5c7820802101149p4248f0daueb88ecd754f1ce95@mail.gmail.com> Message-ID: <8b356f880802101221t3cf156d0w98ddc192bd8972d8@mail.gmail.com> On Feb 10, 2008 2:49 PM, Daniel Cabrini Hauagge wrote: > 2 2 > eq : t (b + a) + t (y + x) > > and I want to factor out "t". When I use the function factor or > factorsum t is correctly isolated > but (b+a)^2 and (y+x)^2 are expanded > ...When I use factorout I get the result that I'm looking for > > 2 2 > (%o5) t ((y + x) + (b + a) ) > > but I have to pass y, x, b, and a as arguments to factorout... > which is not very practical when you have huge expressions full of > variables. Is there a similar function that takes > only the expression that I want to factor out as argument? Some approaches are: *** factorsum(eq) => t*((y+x)^2+(b+a)^2) But this can also expand things in some cases: factorsum(q*(a*t+t)-q*t+(b+a)^2*t) => (a*q+b^2+2*a*b+a^2)*t This may be good or bad, depending on your goals *** t*multthru(eq/t) => t*((y+x)^2+(b+a)^2) This approach depends crucially on the syntactic form of the expression. cf: eq1: t*(b+a)^2+q*(t+a*t)$ multthru(eq1/t)*t => t*(q*(a*t+t)/t+(b+a)^2) I suppose you could do map(factor,eq1) first for at least some cases like this. multthru(map(factor,eq1)/t)*t => ((a+1)*q+(b+a)^2)*t What approach is best for you will depend on the form of your inputs, the desired form of your outputs and (if the expressions are large or hard to factor) your efficiency requirements. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080210/ef67f364/attachment.htm From woollett at charter.net Sun Feb 10 14:26:21 2008 From: woollett at charter.net (Edwin Woollett) Date: Sun, 10 Feb 2008 12:26:21 -0800 Subject: [Maxima] rncombine? References: <000301c86b6f$2face120$0d00a8c0@edwinc367e16bd> , <000501c86b7f$7e69a310$0d00a8c0@edwinc367e16bd> Message-ID: <000701c86c23$333d4e10$0d00a8c0@edwinc367e16bd> On February 09, 2008 Barton Willis wrote: > Rncombine is broken: > > (%i2) rncombine (1/x - 1/y); > (%o2) 1-1/y > > Barton ---------- >The rncombine bug was reported in SF bug 872433 > > > http://sourceforge.net/tracker/index.php?func=detail&aid=872433&group_id=4933&atid=104933 > >Barton thanks for the info. I didn't check bugs archive ted From willisb at unk.edu Tue Feb 12 12:07:12 2008 From: willisb at unk.edu (Barton Willis) Date: Tue, 12 Feb 2008 12:07:12 -0600 Subject: [Maxima] Bad plist bugs Message-ID: I would like to call attention to the SF bugs [ 1891216 ] is(if a>0 and a>0 and a>0 ...) => internal error [ 1891911 ] is(f(a+b+c)) --> Lisp error [ 1726550 ] not bugs I think these bugs are related--fix one bug and you'll get two bonus points! And they make it impossible for me to test some interesting (well, at least I think) experimental linearalgebra code. As a mathematician who has been known to program, the bugs in db.lisp and friends are beyond me. Barton From robert.dodier at gmail.com Tue Feb 12 12:35:25 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 12 Feb 2008 11:35:25 -0700 Subject: [Maxima] Bad plist bugs In-Reply-To: References: Message-ID: On Feb 12, 2008 11:07 AM, Barton Willis wrote: > I would like to call attention to the SF bugs > > [ 1891216 ] is(if a>0 and a>0 and a>0 ...) => internal error > [ 1891911 ] is(f(a+b+c)) --> Lisp error > [ 1726550 ] not bugs > > I think these bugs are related--fix one bug and you'll get two bonus > points! And they make it impossible for me to test some interesting > (well, at least I think) experimental linearalgebra code. As a > mathematician who has been known to program, the bugs in db.lisp and > friends are beyond me. Barton, I looked at these bugs in src/db.lisp recently and I couldn't make any progress. I;ll try to take another look. At least part of the problem is the circular property list which appears to store declared numerical values. The circular lists cause trouble elsewhere in the code. But there could well be more to the "is" bugs -- I would have to look. db.lisp is an incomprehensible mess. I don't think it is doing anything very complicated (to judge by the weakness of the assume system). Let's start thinking about how to replace it. best Robert From macrakis at alum.mit.edu Tue Feb 12 13:51:46 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 12 Feb 2008 14:51:46 -0500 Subject: [Maxima] Bad plist bugs In-Reply-To: References: Message-ID: <8b356f880802121151s3240aa94t2efd3d67762704f1@mail.gmail.com> On Feb 12, 2008 1:35 PM, Robert Dodier wrote: > db.lisp is an incomprehensible mess. I don't think it is doing > anything very complicated (to judge by the weakness of the > assume system). Let's start thinking about how to replace it. > The weaknesses of assume/is have fairly little to do with the DB, which is simply a representation of a partial order. Any additional algebraic, logical, or mathematical intelligence comes from outside DB. I am not sure whether you're proposing to change this interface. One of the reasons it's hard to understand is that the obvious representation of linked structures in Lisp gives you circular lists, which (even with nice pretty-printing) are hard to understand. So debugging and tracing are a mess. Perhaps the first step is writing a special-purpose printer for these structures....) Let's think about the desired functionality, which should probably be a superset (strict or not) of the current functionality: -- represent <, <=, =, and # relations between expressions -- make partial order inferences using those relations, a<=b and b<=c and a#b implies a0) => %rel_x1, assume(x>0) => %rel_x2, forget(%rel_x2) (is(x>0) would remain true); forget(%rel_x1) (is(x>0) would no longer be true) -- (new functionality) it would be nice to handle logical combinations of assumptions, e.g. assume(a<0 or b<0); but this is perhaps outside the scope of DB -- it must be possible to group assumptions into contexts which can be activated or deactivated relatively efficiently --checking for a relation in the DB should be pretty efficient. What am I forgetting? -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080212/5ced0bfc/attachment.htm From woollett at charter.net Tue Feb 12 14:05:03 2008 From: woollett at charter.net (Edwin Woollett) Date: Tue, 12 Feb 2008 12:05:03 -0800 Subject: [Maxima] demo file remarks Message-ID: <000301c86db2$8e5b1800$0d00a8c0@edwinc367e16bd> I would like to create demo files *.dem which include comments on what is happening. Is there a way to do this without the echo that presently occurs in, for example "demo.dem" which has the code at the top: --- title(exp):=disp(dpart(exp))$ (title("a classical textbook example of differentiation"))$ x^x^x; diff(%,x); (title("differentiation of a nested function"))$ -------------------- and the Xmaxima output: (%i73) demo("demo")$ batching #pC:/PROGRA~1/MAXIMA~3.0/share/maxima/5.14.0/demo/demo.dem At the _ prompt, type ';' followed by enter to get next demo (%i74) title(exp) := disp(dpart(exp)) _; (%i75) title(a classical textbook example of differentiation) """"""""""""""""""""""""""""""""""""""""""""""""" "a classical textbook example of differentiation" """"""""""""""""""""""""""""""""""""""""""""""""" ( followed by example 1...) ---------------- TIA Ted Woollett From daniel.hauagge at gmail.com Tue Feb 12 14:12:11 2008 From: daniel.hauagge at gmail.com (Daniel Cabrini Hauagge) Date: Tue, 12 Feb 2008 18:12:11 -0200 Subject: [Maxima] Help calling maxima functions from lisp Message-ID: <68c5c7820802121212t68d56646ic55c457357da130e@mail.gmail.com> Hello, I'm trying to adapt f90.lisp to print out C code. I think that I got the easiest parts done already but I'm stuck trying to call scanmap from lisp. I've tried to do it like this (setq l (mfuncall '$scanmap (mfuncal '$lambda [x] x) l)) and (setq l ($scanmap ($lambda [x] x) l)) and got these errors EVAL: undefined function MFUNCAL EVAL: undefined function $SCANMAP What I'm trying to do is get this into lisp exp_trans: scanmap(lambda([xx], if mapatom(xx) or op(xx) # "^" then xx else pow(args(xx)[1], args(xx)[2])), exp); I searched the source code to see if there are any examples of such call but couldn't find any. If anybody knows how to do this or has suggestions for better ways of doing please let me know. -- Daniel Cabrini Hauagge email: daniel.hauagge at gmail.com cel: +55 (19) 8194-8480 From willisb at unk.edu Tue Feb 12 15:18:27 2008 From: willisb at unk.edu (Barton Willis) Date: Tue, 12 Feb 2008 15:18:27 -0600 Subject: [Maxima] Help calling maxima functions from lisp In-Reply-To: <68c5c7820802121212t68d56646ic55c457357da130e@mail.gmail.com> References: <68c5c7820802121212t68d56646ic55c457357da130e@mail.gmail.com> Message-ID: Maybe some of what you need can be done with subst: (%i4) subst('pow,"^", x^7); (%o4) pow(x,7) (%i5) subst('pow,"^", a^(b+c)); (%o5) pow(a,c+b) The other way (two steps): (#1) Type your lambda form into Maxima and print it with ?print: (%i1) lambda([xx], if mapatom(xx) or op(xx) # "^" then xx else pow(args(xx)[1], args(xx)[2]))$ (%i2) ?print(%); ((LAMBDA SIMP) ((MLIST) $XX) ((MCOND) ((MOR) (($MAPATOM) $XX) ((MNOTEQUAL) (($OP) $XX) "^")) $XX T (($POW) ((MQAPPLY ARRAY) (($ARGS) $XX) 1) ((MQAPPLY ARRAY) (($ARGS) $XX) 2)))) (%o2) lambda([xx],if mapatom(xx) or op(xx)#^ then xx else pow((args(xx))[1],(args(xx))[2])) (#2) Test it (%i3) to_lisp(); Type (to-maxima) to restart, ($quit) to quit Maxima. MAXIMA> (setf f `((LAMBDA SIMP) ((MLIST) $XX) ((MCOND) ((MOR) (($MAPATOM) $XX) ((MNOTEQUAL) (($OP) $XX) "^")) $XX T (($POW) ((MQAPPLY ARRAY) (($ARGS) $XX) 1) ((MQAPPLY ARRAY) (($ARGS) $XX) 2)))) )) ((LAMBDA SIMP) ((MLIST) $XX) ((MCOND) ((MOR) (($MAPATOM) $XX) ((MNOTEQUAL) (($OP) $XX) "^")) $XX T (($POW) ((MQAPPLY ARRAY) (($ARGS) $XX) 1) ((MQAPPLY ARRAY) (($ARGS) $XX) 2)))) MAXIMA> (mfuncall '$scanmap f 'a) A MAXIMA> (mfuncall '$scanmap f `((mplus) a b)) ((MPLUS SIMP) A B) MAXIMA> (mfuncall '$scanmap f `((mtimes) a a a)) (($POW SIMP) A 3) Or something like that... Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: maxima at math.utexas.edu >From: "Daniel Cabrini Hauagge" >Sent by: maxima-bounces at math.utexas.edu >Date: 02/12/2008 02:12PM >Subject: [Maxima] Help calling maxima functions from lisp > >Hello, > >I'm trying to adapt f90.lisp to print out C code. I think that I got >the easiest parts done already but I'm >stuck trying to call scanmap from lisp. I've tried to do it like this > >(setq l (mfuncall '$scanmap (mfuncal '$lambda [x] x) l)) > >and > >(setq l ($scanmap ($lambda [x] x) l)) > >and got these errors > >EVAL: undefined function MFUNCAL >EVAL: undefined function $SCANMAP > >What I'm trying to do is get this into lisp > > exp_trans: scanmap(lambda([xx], > if mapatom(xx) or op(xx) # "^" then xx > else pow(args(xx)[1], args(xx)[2])), exp); > >I searched the source code to see if there are any examples of such >call but couldn't find any. If anybody knows >how to do this or has suggestions for better ways of doing please let me >know. > >-- >Daniel Cabrini Hauagge > >email: daniel.hauagge at gmail.com >cel: +55 (19) 8194-8480 >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Tue Feb 12 15:48:50 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 12 Feb 2008 16:48:50 -0500 Subject: [Maxima] Help calling maxima functions from lisp In-Reply-To: References: <68c5c7820802121212t68d56646ic55c457357da130e@mail.gmail.com> Message-ID: <8b356f880802121348l46a26b13qb9a77f0dd4a30931@mail.gmail.com> If you're going to write in Lisp, you should probably not be using scanmap to traverse the expression tree. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080212/074bbdff/attachment.htm From kovzol at matek.hu Tue Feb 12 16:27:18 2008 From: kovzol at matek.hu (=?UTF-8?Q?Kov=C3=A1cs_Zolt=C3=A1n?=) Date: Tue, 12 Feb 2008 23:27:18 +0100 Subject: [Maxima] WMI-2.1.1 has been released Message-ID: Dear Colleagues, the WMI2 Development Team is happy to announce the latest release of WebMathematics Interactive 2, version 2.1.1 which includes: * small installable version (<2MB) * full version with advertisement support and tutorial movies (60MB) * localization for traditional and simplified Chinese, Czech, Slovak and Hungarian languages (using gettext) * enhanced 3D plotting * session logging * many minor bug fixes The installation tarballs can be downloaded from SourceForge ( http://sourceforge.net/project/showfiles.php?group_id=56476&package_id=51736&release_id=575933). Release notes (including installation howto and hints on which package to download) and changelog is available on http://sourceforge.net/project/shownotes.php?release_id=575933&group_id=56476 . Latest version can be tried out on http://pascal.math.u-szeged.hu/~kovzol/wmi2/webroot/. Our primary demo site, http://matek.hu will be actualized within a few days (Czech and Slovak translations are missing yet). For non-European users it is also suggested to try the test installation at Chang Gung University, Taiwan ( http://diffusion.cgu.edu.tw/wmi2/). Thank you for your attention. Best regards, Zoltan Kovacs lead developer -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080212/8c0b652f/attachment-0001.htm From ottmartin at web.de Tue Feb 12 18:30:16 2008 From: ottmartin at web.de (Martin J. Ott) Date: Wed, 13 Feb 2008 01:30:16 +0100 Subject: [Maxima] addcol list bug or feature Message-ID: <200802130130.16829.ottmartin@web.de> Hello everybody, I want to create a matrix out of list elements. Therefor I tried addcol, but unfortunately the effect ist not the expected. One little example(not my real problem, but contains the same behaviour): a:[matrix([1],[2]), matrix([3],[4])]; b:matrix([0],[0]) what I did is: addcol(b,a) but what I want is the effect of: addcol(b,part(a,1),part(a,2)) could anybody tell me, if this is a bug or just a feature, I haven't understood yes? By the way; Is there a function in MAXIMA equivalent to FoldList in Mathematica? Any suggestions will be welcome. Martin From macrakis at alum.mit.edu Tue Feb 12 20:31:32 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 12 Feb 2008 21:31:32 -0500 Subject: [Maxima] addcol list bug or feature In-Reply-To: <200802130130.16829.ottmartin@web.de> References: <200802130130.16829.ottmartin@web.de> Message-ID: <8b356f880802121831s9a51e0fh55ff36c8f6b46cee@mail.gmail.com> On Feb 12, 2008 7:30 PM, Martin J. Ott wrote: > a:[matrix([1],[2]), matrix([3],[4])]; > A is now a list consisting of two 2x1 matrices. > b:matrix([0],[0]) B is a 2x1 matrix. but what I want is the effect of: > addcol(b,part(a,1),part(a,2)) > This creates a 2x3 matrix from one 2x1 matrix and a list of two 2x1 matrices. I suspect that you wanted A to be a 2x2 matrix: matrix([1,3],[2,4]). Then addcol(B,A) will give you the 2x3 matrix. By the way; Is there a function in MAXIMA equivalent to FoldList in > Mathematica? > If you could tell us the specification of FoldList, perhaps we can help you. Many (most?) of us are not Mathematica users. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080212/538d9b4e/attachment.htm From milan at eskimo.com Tue Feb 12 20:38:33 2008 From: milan at eskimo.com (Milan Lukic) Date: Tue, 12 Feb 2008 18:38:33 -0800 Subject: [Maxima] addcol list bug or feature In-Reply-To: <200802130130.16829.ottmartin@web.de>; from ottmartin@web.de on Wed, Feb 13, 2008 at 01:30:16AM +0100 References: <200802130130.16829.ottmartin@web.de> Message-ID: <20080212183833.B2521@eskimo.com> Martin, I am not sure what you find problematic here. To me, this just looks as Maxima did what you asked it to do (according to the documentation for addcol). In the first case: addcol(b,a), a is a single list, hence you are adding one column to b, and that column is made of the elements of a. In the second case: addcol(b,part(a,1),part(a,2)), you have a list of two matrices that you want to add, so you will add two columns to b, part(a,1) and part(a,2), respectively. I am not familiar with FoldList, so can't help, sorry. Probably someone else can help you with that, or you could explain what FoldList does and we can see waht we can do. HTH, Milan * Martin J. Ott <ottmartin at web.de> [2008-02-13 01:30:16 +0100]: > Hello everybody, > > I want to create a matrix out of list elements. Therefor I tried addcol, but > unfortunately the effect ist not the expected. > One little example(not my real problem, but contains the same behaviour): > > a:[matrix([1],[2]), matrix([3],[4])]; > b:matrix([0],[0]) > > what I did is: > addcol(b,a) > > but what I want is the effect of: > addcol(b,part(a,1),part(a,2)) > > could anybody tell me, if this is a bug or just a feature, I haven't > understood yes? > > By the way; Is there a function in MAXIMA equivalent to FoldList in > Mathematica? > > Any suggestions will be welcome. > > Martin > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- From willisb at unk.edu Tue Feb 12 21:30:12 2008 From: willisb at unk.edu (Barton Willis) Date: Tue, 12 Feb 2008 21:30:12 -0600 Subject: [Maxima] addcol list bug or feature In-Reply-To: <200802130130.16829.ottmartin@web.de> References: <200802130130.16829.ottmartin@web.de> Message-ID: (%i12) a:[matrix([1],[2]), matrix([3],[4])]; (%o12) [matrix([1],[2]),matrix([3],[4])] (%i13) b:matrix([0],[0]); (%o13) matrix([0],[0]) (%i14) rreduce('addcol,cons(b,a)); (%o14) matrix([0,1,3],[0,2,4]) Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: maxima at math.utexas.edu >From: "Martin J. Ott" >Sent by: maxima-bounces at math.utexas.edu >Date: 02/12/2008 06:30PM >Subject: [Maxima] addcol list bug or feature > >Hello everybody, > >I want to create a matrix out of list elements. Therefor I tried addcol, >but >unfortunately the effect ist not the expected. >One little example(not my real problem, but contains the same behaviour): > >a:[matrix([1],[2]), matrix([3],[4])]; >b:matrix([0],[0]) > >what I did is: >addcol(b,a) > >but what I want is the effect of: >addcol(b,part(a,1),part(a,2)) > >could anybody tell me, if this is a bug or just a feature, I haven't >understood yes? > >By the way; Is there a function in MAXIMA equivalent to FoldList in >Mathematica? > >Any suggestions will be welcome. > >Martin >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at cs.berkeley.edu Tue Feb 12 21:33:11 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Tue, 12 Feb 2008 19:33:11 -0800 Subject: [Maxima] FoldList In-Reply-To: <20080212183833.B2521@eskimo.com> References: <200802130130.16829.ottmartin@web.de> <20080212183833.B2521@eskimo.com> Message-ID: <47B264F7.1020603@cs.berkeley.edu> FoldList[f, x, {a, b, ? }] gives {x, f[x, a], f[f[x, a], b], ? }. FoldList, can be easily written in Maxima From robert.dodier at gmail.com Wed Feb 13 01:21:37 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 13 Feb 2008 00:21:37 -0700 Subject: [Maxima] Help calling maxima functions from lisp In-Reply-To: <68c5c7820802121212t68d56646ic55c457357da130e@mail.gmail.com> References: <68c5c7820802121212t68d56646ic55c457357da130e@mail.gmail.com> Message-ID: On Feb 12, 2008 1:12 PM, Daniel Cabrini Hauagge wrote: > What I'm trying to do is get this into lisp > > exp_trans: scanmap(lambda([xx], > if mapatom(xx) or op(xx) # "^" then xx > else pow(args(xx)[1], args(xx)[2])), exp); I think the easiest thing to do is make the above snippet into a function and put it in a separate .mac file, load the .mac, and then call the function via MFUNCALL. ------------ my_xform.mac ------------ my_xform (e) := scanmap (blah blah blah, e); ------- somewhere in my_f90.lisp ------- ($load "my_xform.mac") ... (setq my-new-expr (mfuncall '$my_xform my-expr)) ... HTH Robert Dodier From eric.reyssat at math.unicaen.fr Wed Feb 13 06:35:18 2008 From: eric.reyssat at math.unicaen.fr (reyssat) Date: Wed, 13 Feb 2008 13:35:18 +0100 Subject: [Maxima] How to combine sums ? In-Reply-To: <8288517.1202299505785.JavaMail.root@mswamui-blood.atl.sa.earthlink.net> References: <8288517.1202299505785.JavaMail.root@mswamui-blood.atl.sa.earthlink.net> Message-ID: <47B2E406.1090801@math.unicaen.fr> Does maxima know a way of combining sums which differ only by their bounds using additivity on bounds ? For instance, I don't know how to simplify (for n>0) s:sum(log(i),i,1,n+1)-sum(log(i),i,1,n); into log(n+1) or simplify s2:sum(log(i),i,1,n)+sum(log(i),i,n+1,2*n); into sum(log(i),i,1,2*n) Thanks for any help Eric Reyssat From fateman at cs.berkeley.edu Wed Feb 13 07:37:00 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Wed, 13 Feb 2008 05:37:00 -0800 Subject: [Maxima] Help calling maxima functions from lisp In-Reply-To: References: <68c5c7820802121212t68d56646ic55c457357da130e@mail.gmail.com> Message-ID: <47B2F27C.2000709@cs.berkeley.edu> 1. I'm not sure why you need this in lisp, if maxima code does it. 2. foo(x):=?subst(pow,?mexpt,x); may do what you want. 3. or not... foo(x^2+a/b) returns pow(x,2)+a*pow(b,-1). RJF Robert Dodier wrote: > On Feb 12, 2008 1:12 PM, Daniel Cabrini Hauagge > wrote: > > >> What I'm trying to do is get this into lisp >> >> exp_trans: scanmap(lambda([xx], >> if mapatom(xx) or op(xx) # "^" then xx >> else pow(args(xx)[1], args(xx)[2])), exp); >> > > I think the easiest thing to do is make the above snippet into a function > and put it in a separate .mac file, load the .mac, and then call the > function via MFUNCALL. > > ------------ my_xform.mac ------------ > my_xform (e) := scanmap (blah blah blah, e); > > > ------- somewhere in my_f90.lisp ------- > ($load "my_xform.mac") > ... > (setq my-new-expr (mfuncall '$my_xform my-expr)) > ... > > HTH > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From dtc-maxima at scieneer.com Wed Feb 13 08:46:23 2008 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Thu, 14 Feb 2008 01:46:23 +1100 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> Message-ID: <47B302BF.8030901@scieneer.com> Hello, Reworking the changes to use the maxima 'flonum type appears to work on GCL, CMUCL, and CLISP. The following changes are proposed as a first step: 1. Replace all float constants with the general form, e.g. 1d0 -> 1e0, and increase the precision to at least quad float precision. The *read-default-float-format* can then be modified to change all constants to an alternative format. 2. Replace all references to the double-float type with the 'flonum type, allowing the format used for a 'flonum to be changed easily. The handling of the Fortran code needs more thought, so would not be changed yet. Extending f2cl to allow translating the Fortran double precision type to a long-float or other type may be cleaner. An attempt has been made to use the CMUCL double-double-float type, and it does build but there are a few problems in CMUCL that need work, such as (rationalize 0.25w0) failing, and the lack of constants such as double-double-float-epsilon. If anyone wants patches then just let me know. Regards Douglas Crosher From raymond.toy at ericsson.com Wed Feb 13 08:59:33 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Wed, 13 Feb 2008 09:59:33 -0500 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47B302BF.8030901@scieneer.com> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> <47B302BF.8030901@scieneer.com> Message-ID: <47B305D5.8040405@ericsson.com> Douglas Crosher wrote: > Hello, > > Reworking the changes to use the maxima 'flonum type appears to work on GCL, CMUCL, > and CLISP. The following changes are proposed as a first step: > > 1. Replace all float constants with the general form, e.g. 1d0 -> 1e0, and increase > the precision to at least quad float precision. The *read-default-float-format* > can then be modified to change all constants to an alternative format. > > 2. Replace all references to the double-float type with the 'flonum type, allowing > the format used for a 'flonum to be changed easily. I would accept changes to use flonum as the floating-point type. > > The handling of the Fortran code needs more thought, so would not be changed yet. > Extending f2cl to allow translating the Fortran double precision type to a long-float > or other type may be cleaner. I modifying f2cl would be better. I think it's a bad idea to hand-modify the generated code. f2cl already supports a :float-format option, but I'm not sure that will work if it's changed from 'double-float to, say, 'flonum. > > An attempt has been made to use the CMUCL double-double-float type, and it does build > but there are a few problems in CMUCL that need work, such as (rationalize 0.25w0) > failing, and the lack of constants such as double-double-float-epsilon. If anyone Oops. Rationalize is an oversight. I'll fix that. If you find other issues, please let me know. The problem with double-double-float-epsilon is that it's kind of fuzzy. Look at what happens with (+ 1w0 1w-100). You get 1.1w0. This is an artifact of double-double representation. A reasonable approximation would be (scale-float 1w0 -106), since there are 106 bits of accuracy in a double-double. Ray From ottmartin at web.de Wed Feb 13 09:56:58 2008 From: ottmartin at web.de (Martin J. Ott) Date: Wed, 13 Feb 2008 16:56:58 +0100 Subject: [Maxima] addcol list bug or feature In-Reply-To: References: <200802130130.16829.ottmartin@web.de> Message-ID: <200802131656.58637.ottmartin@web.de> Am Mittwoch 13 Februar 2008 04:30:12 schrieb Barton Willis: > (%i12) a:[matrix([1],[2]), matrix([3],[4])]; > (%o12) [matrix([1],[2]),matrix([3],[4])] > (%i13) b:matrix([0],[0]); > (%o13) matrix([0],[0]) > (%i14) rreduce('addcol,cons(b,a)); > (%o14) matrix([0,1,3],[0,2,4]) This is the solution I looked for. I missunderstood the addcol comand, respectly the list argument. thx Martin From andrej.vodopivec at gmail.com Wed Feb 13 09:55:00 2008 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Wed, 13 Feb 2008 16:55:00 +0100 Subject: [Maxima] How to combine sums ? In-Reply-To: <47B2E406.1090801@math.unicaen.fr> References: <8288517.1202299505785.JavaMail.root@mswamui-blood.atl.sa.earthlink.net> <47B2E406.1090801@math.unicaen.fr> Message-ID: <7775b21a0802130755v36336931madfd705422a2264a@mail.gmail.com> On Feb 13, 2008 1:35 PM, reyssat wrote: > Does maxima know a way of combining sums which differ only by their > bounds using additivity on bounds ? > > For instance, I don't know how to simplify (for n>0) > s:sum(log(i),i,1,n+1)-sum(log(i),i,1,n); > into > log(n+1) (%i1) s:sum(log(i),i,1,n+1)-sum(log(i),i,1,n); (%o1) (sum(log(i),i,1,n+1))-sum(log(i),i,1,n) (%i2) sumcontract(intosum(%)); (%o2) log(n+1) > or simplify > s2:sum(log(i),i,1,n)+sum(log(i),i,n+1,2*n); > into > sum(log(i),i,1,2*n) This seems to work directly: (%i3) s2:sum(log(i),i,1,n)+sum(log(i),i,n+1,2*n); (%o3) sum(log(i),i,1,2*n) HTH, -- Andrej From harald at lefant.net Wed Feb 13 14:08:53 2008 From: harald at lefant.net (Harald Geyer) Date: Wed, 13 Feb 2008 21:08:53 +0100 Subject: [Maxima] demo file remarks In-Reply-To: <000301c86db2$8e5b1800$0d00a8c0@edwinc367e16bd> References: <000301c86db2$8e5b1800$0d00a8c0@edwinc367e16bd> Message-ID: > I would like to create demo files *.dem which include comments on what is > happening. How about this: "a classical textbook example of differentiation"$ x^x^x; diff(%,x); HTH, Harald From woollett at charter.net Wed Feb 13 15:24:57 2008 From: woollett at charter.net (Edwin Woollett) Date: Wed, 13 Feb 2008 13:24:57 -0800 Subject: [Maxima] gcfac and scifac Message-ID: <000301c86e86$e215c650$0d00a8c0@edwinc367e16bd> error when trying to load package scifac.lisp : ------------------ (%i1) load (scifac); Load failed for C:/PROGRA~1/MAXIMA~3.0/share/maxima/5.14.0/share/simplification/scifac.lisp -- an error. To debug this try debugmode(true); --------------- broken? TIA Ted Woollett From woollett at charter.net Wed Feb 13 15:34:39 2008 From: woollett at charter.net (Edwin Woollett) Date: Wed, 13 Feb 2008 13:34:39 -0800 Subject: [Maxima] demo file remarks References: <000301c86db2$8e5b1800$0d00a8c0@edwinc367e16bd> Message-ID: <000301c86e88$3d862bf0$0d00a8c0@edwinc367e16bd> Harald Geyer wrote on February 13, 2008: >> I would like to create demo files *.dem which include comments on what >> is >> happening. > > How about this: > "a classical textbook example of differentiation"$ > x^x^x; > diff(%,x); > > HTH, > Harald Thanks, Harald, a great solution! ted From raymond.toy at ericsson.com Wed Feb 13 15:52:17 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Wed, 13 Feb 2008 16:52:17 -0500 Subject: [Maxima] gcfac and scifac In-Reply-To: <000301c86e86$e215c650$0d00a8c0@edwinc367e16bd> References: <000301c86e86$e215c650$0d00a8c0@edwinc367e16bd> Message-ID: <47B36691.1090801@ericsson.com> Edwin Woollett wrote: > error when trying to load package scifac.lisp : > > ------------------ > (%i1) load (scifac); > > Load failed for > C:/PROGRA~1/MAXIMA~3.0/share/maxima/5.14.0/share/simplification/scifac.lisp > -- an error. To debug this try debugmode(true); Near the top of that file, change the "(declare ...") to "(declaim ..."). It loads for me now. Don't know if it works or not.... Ray From daniel.hauagge at gmail.com Wed Feb 13 20:56:37 2008 From: daniel.hauagge at gmail.com (Daniel Cabrini Hauagge) Date: Thu, 14 Feb 2008 00:56:37 -0200 Subject: [Maxima] Help calling maxima functions from lisp In-Reply-To: <47B2F27C.2000709@cs.berkeley.edu> References: <68c5c7820802121212t68d56646ic55c457357da130e@mail.gmail.com> <47B2F27C.2000709@cs.berkeley.edu> Message-ID: <68c5c7820802131856m1ae1c0ech5413d83b8cc417b7@mail.gmail.com> On Feb 13, 2008 11:37 AM, R Fateman wrote: > 1. I'm not sure why you need this in lisp, if maxima code does it. My starting point was f90.lisp and since I didn't want the functionality to be spread between lisp and maxima files I was trying to put everything inside a lisp file. I also didn't know that it was this hard to get maxima code running inside lisp. Anyway, it's working now. Besides the substitution for pow I also needed ";" at the end of sentences, no "&" between line breaks and to decrement array accessors by 1. > 2. foo(x):=?subst(pow,?mexpt,x); may do what you want. I got it to work without subst, but what I did was write my own substitution function in lisp. One thing that I had to be carefull with was powers like -1 and 1/2, so some extra if's were needed inside the substitution function to leave these alone (somewhere else maxima converts them to division and sqrt). > 3. or not... foo(x^2+a/b) returns pow(x,2)+a*pow(b,-1). > > RJF > > > Robert Dodier wrote: > > On Feb 12, 2008 1:12 PM, Daniel Cabrini Hauagge > > wrote: > > > > > >> What I'm trying to do is get this into lisp > >> > >> exp_trans: scanmap(lambda([xx], > >> if mapatom(xx) or op(xx) # "^" then xx > >> else pow(args(xx)[1], args(xx)[2])), exp); > >> > > > > I think the easiest thing to do is make the above snippet into a function > > and put it in a separate .mac file, load the .mac, and then call the > > function via MFUNCALL. > > > > ------------ my_xform.mac ------------ > > my_xform (e) := scanmap (blah blah blah, e); > > > > > > ------- somewhere in my_f90.lisp ------- > > ($load "my_xform.mac") > > ... > > (setq my-new-expr (mfuncall '$my_xform my-expr)) > > ... > > > > HTH > > > > Robert Dodier > > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > > > -- Daniel Cabrini Hauagge cel: +55 (19) 8194-8480 From dtc-maxima at scieneer.com Wed Feb 13 21:41:26 2008 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Thu, 14 Feb 2008 14:41:26 +1100 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47B305D5.8040405@ericsson.com> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> <47B302BF.8030901@scieneer.com> <47B305D5.8040405@ericsson.com> Message-ID: <47B3B866.2010106@scieneer.com> Hello Ray, The changes have been committed, except for the changes to the Fortran code. Patches to the Fortran code are temporarily available here: Patches to use long-float (SCL, CLISP): http://www.scieneer.com/files/maxima-lf-patch1.txt.gz Patches to use CMU CL double-double-float: http://www.scieneer.com/files/maxima-ddf-patch1.txt.gz The CLISP version is working relatively well. The CMUCL double-double float version has some problems that have not been explored yet but can be reproduced with the above patch. Regards Douglas Crosher From raymond.toy at ericsson.com Thu Feb 14 08:36:02 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Thu, 14 Feb 2008 09:36:02 -0500 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47B3B866.2010106@scieneer.com> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> <47B302BF.8030901@scieneer.com> <47B305D5.8040405@ericsson.com> <47B3B866.2010106@scieneer.com> Message-ID: <47B451D2.2040200@ericsson.com> Douglas Crosher wrote: > Hello Ray, > > The changes have been committed, except for the changes to the Fortran > code. I didn't expect you to check the changes in so quickly! :-) Patches > to the Fortran code are temporarily available here: > > Patches to use long-float (SCL, CLISP): > http://www.scieneer.com/files/maxima-lf-patch1.txt.gz > > Patches to use CMU CL double-double-float: > http://www.scieneer.com/files/maxima-ddf-patch1.txt.gz > > The CLISP version is working relatively well. The CMUCL double-double > float version has > some problems that have not been explored yet but can be reproduced with > the above patch. I'm not sure I would want double-double's. They're fairly slow. But more importantly, we don't have double-double accuracy for the special functions. It will take quite a bit of work to get that in place. I think that effort would be better spent on getting bfloat versions of them. The same goes for x86 long-float (double extended) support, except they should be fast. Dunno. Ray From raymond.toy at ericsson.com Thu Feb 14 09:39:42 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Thu, 14 Feb 2008 10:39:42 -0500 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47B3B866.2010106@scieneer.com> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> <47B302BF.8030901@scieneer.com> <47B305D5.8040405@ericsson.com> <47B3B866.2010106@scieneer.com> Message-ID: <47B460BE.60308@ericsson.com> Douglas Crosher wrote: > Hello Ray, > > The changes have been committed, except for the changes to the Fortran > code. Patches > to the Fortran code are temporarily available here: > > Patches to use long-float (SCL, CLISP): > http://www.scieneer.com/files/maxima-lf-patch1.txt.gz > > Patches to use CMU CL double-double-float: > http://www.scieneer.com/files/maxima-ddf-patch1.txt.gz > > The CLISP version is working relatively well. The CMUCL double-double > float version has > some problems that have not been explored yet but can be reproduced with > the above patch. I haven't tried the above patch, but I did enable double-double support in maxima. plot.lisp doesn't even compile on sparc. This is because most-positive-flonum is really too big. It can be presented but you can't multiply or divide it. It's an artifact of how multiplication and division is done on double-doubles. A quick fix for that, and everything compiles. I have to say it is rather nice to see all those extra digits. There are a few issues though. Printing large floats doesn't print out all the digits. sin only returns double-float numbers. And, of course, a huge number of tests fail. Ray From woollett at charter.net Thu Feb 14 12:07:55 2008 From: woollett at charter.net (Edwin Woollett) Date: Thu, 14 Feb 2008 10:07:55 -0800 Subject: [Maxima] gcfac and scifac References: <000301c86e86$e215c650$0d00a8c0@edwinc367e16bd> <47B36691.1090801@ericsson.com> Message-ID: <002101c86f34$864e9aa0$0d00a8c0@edwinc367e16bd> Raymond Toy wrote on February 13, 2008 >> (%i1) load (scifac); >> >> Load failed for >> >> C:/PROGRA~1/MAXIMA~3.0/share/maxima/5.14.0/share/simplification/scifac.lisp >> -- an error. To debug this try debugmode(true); > > Near the top of that file, change the "(declare ...") to "(declaim ..."). > It loads for me now. Don't know if it works or not.... > > Ray I changed line two of scifac.lisp from " (declare (special $negdistrib)) " to "(declaim (special $negdistrib))" -------------- package scifac.lisp now loads ok but get error first time scifac.dem calls gcfac: (%i1) demo(scifac)$ batching #pC:/PROGRA~1/MAXIMA~3.0/share/maxima/5.14.0/share/simplification/scifac.dem At the _ prompt, type ';' followed by enter to get next demo (%i2) if properties(gcfac) = [] then load(scifac) _; (%i3) exp1 : a v s x + a t r + a u (%o3) a s v x + a u + a r t _; (%i4) gcfac(exp1) Maxima encountered a Lisp error: Error in COND [or a callee]: The function FIXP is undefined. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. (%i5) factor(exp1) (%o5) a (s v x + u + r t) ----------------- ted woollett win xp, v5.14 From raymond.toy at ericsson.com Thu Feb 14 12:34:28 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Thu, 14 Feb 2008 13:34:28 -0500 Subject: [Maxima] gcfac and scifac In-Reply-To: <002101c86f34$864e9aa0$0d00a8c0@edwinc367e16bd> References: <000301c86e86$e215c650$0d00a8c0@edwinc367e16bd> <47B36691.1090801@ericsson.com> <002101c86f34$864e9aa0$0d00a8c0@edwinc367e16bd> Message-ID: <47B489B4.3010506@ericsson.com> Edwin Woollett wrote: > > Raymond Toy wrote on February 13, 2008 > >>> (%i1) load (scifac); >>> >>> Load failed for >>> >>> C:/PROGRA~1/MAXIMA~3.0/share/maxima/5.14.0/share/simplification/scifac.lisp >>> >>> -- an error. To debug this try debugmode(true); >> >> Near the top of that file, change the "(declare ...") to "(declaim >> ..."). It loads for me now. Don't know if it works or not.... >> >> Ray > > I changed line two of scifac.lisp from > " (declare (special $negdistrib)) " > to > "(declaim (special $negdistrib))" > -------------- > package scifac.lisp now loads ok but get error first time scifac.dem > calls gcfac: > > (%i1) demo(scifac)$ > batching > #pC:/PROGRA~1/MAXIMA~3.0/share/maxima/5.14.0/share/simplification/scifac.dem > > > At the _ prompt, type ';' followed by enter to get next demo > (%i2) if properties(gcfac) = [] then load(scifac) > _; > (%i3) exp1 : a v s x + a t r + a u > (%o3) a s v x + a u + a r t > _; > (%i4) gcfac(exp1) > Maxima encountered a Lisp error: > > Error in COND [or a callee]: The function FIXP is undefined. > > Automatically continuing. > To reenable the Lisp debugger set *debugger-hook* to nil. > (%i5) factor(exp1) > (%o5) a (s v x + u + r t) As a temporary solution, add the following to scifac.lisp, near the top: (defun fixp (n) (typep n 'fixnum)) (defun $min (x y) (min x y)) (defun add1 (x) (1+ x)) These are wild guesses, based on looking at the code for a few seconds. fixp and add1 are probably safe since I don'tt seem them defined anywhere else in maxima But $min might be suspect since maxima already has some kind of $min function. But with these changes demo(scifac) finishes. Ray From aeder at arcor.de Thu Feb 14 12:46:41 2008 From: aeder at arcor.de (Andreas Eder) Date: Thu, 14 Feb 2008 19:46:41 +0100 Subject: [Maxima] gcfac and scifac In-Reply-To: <002101c86f34$864e9aa0$0d00a8c0@edwinc367e16bd> References: <000301c86e86$e215c650$0d00a8c0@edwinc367e16bd> <47B36691.1090801@ericsson.com> <002101c86f34$864e9aa0$0d00a8c0@edwinc367e16bd> Message-ID: <22792.1203014801@staffa.eder.local> Edwin Woolett wrote: >I changed line two of scifac.lisp from >" (declare (special $negdistrib)) " >to >"(declaim (special $negdistrib))" >-------------- >package scifac.lisp now loads ok but get error first time scifac.dem calls >gcfac: > >(%i1) demo(scifac)$ >batching >#pC:/PROGRA~1/MAXIMA~3.0/share/maxima/5.14.0/share/simplification/scifac.dem > > At the _ prompt, type ';' followed by enter to get next demo >(%i2) if properties(gcfac) = [] then load(scifac) >_; >(%i3) exp1 : a v s x + a t r + a u >(%o3) a s v x + a u + a r t >_; >(%i4) gcfac(exp1) >Maxima encountered a Lisp error: > > Error in COND [or a callee]: The function FIXP is undefined. That fixp should be changed to fixnump, then it should run if you also change add1 to 1+ in the 2 places where it occurs. Well at least the demo runs for me now. Wether it really does something useful I don?t know :-( 'Andreas From robert.dodier at gmail.com Thu Feb 14 14:43:30 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 14 Feb 2008 13:43:30 -0700 Subject: [Maxima] gcfac and scifac In-Reply-To: <22792.1203014801@staffa.eder.local> References: <000301c86e86$e215c650$0d00a8c0@edwinc367e16bd> <47B36691.1090801@ericsson.com> <002101c86f34$864e9aa0$0d00a8c0@edwinc367e16bd> <22792.1203014801@staffa.eder.local> Message-ID: On Thu, Feb 14, 2008 at 11:46 AM, Andreas Eder wrote: > > Error in COND [or a callee]: The function FIXP is undefined. > > That fixp should be changed to fixnump, then it should run if you > also change add1 to 1+ in the 2 places where it occurs. I wonder (without looking at this in any detail) if INTEGERP would work. Robert From caruso at dm.unipi.it Thu Feb 14 15:49:38 2008 From: caruso at dm.unipi.it (Fabrizio Caruso) Date: Thu, 14 Feb 2008 22:49:38 +0100 (CET) Subject: [Maxima] fasttimes bug Message-ID: Hi fasttimes has a very old bug which makes it less usable because it won't work if its first argument is $rat(1)$ because (1) rat(1) is given an empty list of variables unless it has been the result of some computation involving some variables; (2) fasttimes assumes that list of variables of the product should be the same as the one of its first argument instead of taking the union of the variables of both arguments In fact we have: (%i324) fasttimes(rat(1),rat(x)); Use `fasttimes' only on CRE polynomials with same varlists -- an error. To debug this try debugmode(true); (%i325) fasttimes(rat(x),rat(1)); Evaluation took 0.00 seconds (0.00 elapsed) using 776 bytes. (%o325)/R/ x (%i326) Despite the fact that rat(1) should be the same as remainder(1,rat(x)) they are different when used inside fasttimes because it seems that remainder give to "1" the right list of variables (%i328) rat(1); Evaluation took 0.00 seconds (0.00 elapsed) using 232 bytes. (%o328)/R/ 1 (%i329) remainder(rat(1),rat(x)); Evaluation took 0.00 seconds (0.00 elapsed) using 1.070 KB. (%o329)/R/ 1 (%i330) is(%=%o328); Evaluation took 0.00 seconds (0.00 elapsed) using 600 bytes. (%o330) true (%i331) fasttimes(remainder(rat(1),rat(x)),rat(x)); Evaluation took 0.00 seconds (0.00 elapsed) using 1.523 KB. (%o331)/R/ x Its code is in ratout.lisp but I am not enough Lisp savy to debug it (defmfun $fasttimes (x y) (cond ((and (not (atom x)) (not (atom y)) (equal (car x) (car y)) (equal (caar x) 'mrat) (equal (cddr x) 1) (equal (cddr y) 1)) (cons (car x)(cons (fptimes (cadr x)(cadr y))1))) (t (merror "Use `fasttimes' only on CRE polynomials with same varlists")))) Any suggestions on how to fix it other than circumvent it? Possibly a fix in the Lisp code? Fabrizio From fateman at cs.berkeley.edu Thu Feb 14 17:20:36 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Thu, 14 Feb 2008 15:20:36 -0800 Subject: [Maxima] fasttimes bug In-Reply-To: References: Message-ID: <47B4CCC4.4080008@cs.berkeley.edu> Try fasttimes(rat(1,x), rat(x)). Fasttimes may not be especially fast, depending on your inputs. You should test it to see if it helps your application. It was not intended to be generally useful, but simply an interface to a program that might be worth testing, a "Karatsuba" style multiplier. If you need to multiply many large and dense polynomials fast, there are lots of other methods around (not all in Maxima). Fabrizio Caruso wrote: > Hi > > fasttimes has a very old bug which makes it less usable > because it won't work if its first argument is $rat(1)$ > because > (1) rat(1) is given an empty list of variables > unless it has been the result of some computation > involving some variables; > (2) fasttimes assumes that list of variables of the product > should be the same as the one of its first argument > instead of taking the union of the variables of both arguments > > > In fact we have: > > (%i324) > fasttimes(rat(1),rat(x)); > Use `fasttimes' only on CRE polynomials with same varlists > -- an error. To debug this try debugmode(true); > (%i325) fasttimes(rat(x),rat(1)); > Evaluation took 0.00 seconds (0.00 elapsed) using 776 bytes. > (%o325)/R/ x > (%i326) > > > Despite the fact that rat(1) should be the same as remainder(1,rat(x)) > they are different when used inside fasttimes because it seems > that remainder give to "1" the right list of variables > > > (%i328) rat(1); > Evaluation took 0.00 seconds (0.00 elapsed) using 232 bytes. > (%o328)/R/ 1 > (%i329) remainder(rat(1),rat(x)); > Evaluation took 0.00 seconds (0.00 elapsed) using 1.070 KB. > (%o329)/R/ 1 > (%i330) is(%=%o328); > Evaluation took 0.00 seconds (0.00 elapsed) using 600 bytes. > (%o330) true > (%i331) fasttimes(remainder(rat(1),rat(x)),rat(x)); > Evaluation took 0.00 seconds (0.00 elapsed) using 1.523 KB. > (%o331)/R/ x > > > > Its code is in ratout.lisp but I am not enough Lisp savy to debug it > > (defmfun $fasttimes (x y) > (cond ((and (not (atom x)) (not (atom y)) > (equal (car x) (car y)) (equal (caar x) 'mrat) > (equal (cddr x) 1) (equal (cddr y) 1)) > (cons (car x)(cons (fptimes (cadr x)(cadr y))1))) > (t (merror "Use `fasttimes' only on CRE polynomials with same > varlists")))) > > > > Any suggestions on how to fix it other than circumvent it? > Possibly a fix in the Lisp code? > > Fabrizio > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From caruso at dm.unipi.it Thu Feb 14 17:31:43 2008 From: caruso at dm.unipi.it (Fabrizio Caruso) Date: Fri, 15 Feb 2008 00:31:43 +0100 (CET) Subject: [Maxima] fasttimes bug In-Reply-To: <47B4CCC4.4080008@cs.berkeley.edu> References: <47B4CCC4.4080008@cs.berkeley.edu> Message-ID: Thanks fasttimes helps my application (the gf package in Maxima for finite fields) a lot. I use it extensively and it makes the computation much faster. Fabrizio On Thu, 14 Feb 2008, R Fateman wrote: > Try fasttimes(rat(1,x), rat(x)). > > Fasttimes may not be especially fast, depending on your inputs. You should > test it to see if it helps your application. > It was not intended to be generally useful, but simply an interface to a > program that might be worth testing, > a "Karatsuba" style multiplier. If you need to multiply many large and > dense polynomials fast, > there are lots of other methods around (not all in Maxima). > > Fabrizio Caruso wrote: >> Hi >> >> fasttimes has a very old bug which makes it less usable >> because it won't work if its first argument is $rat(1)$ >> because >> (1) rat(1) is given an empty list of variables >> unless it has been the result of some computation >> involving some variables; >> (2) fasttimes assumes that list of variables of the product >> should be the same as the one of its first argument >> instead of taking the union of the variables of both arguments >> >> >> In fact we have: >> >> (%i324) fasttimes(rat(1),rat(x)); >> Use `fasttimes' only on CRE polynomials with same varlists >> -- an error. To debug this try debugmode(true); >> (%i325) fasttimes(rat(x),rat(1)); >> Evaluation took 0.00 seconds (0.00 elapsed) using 776 bytes. >> (%o325)/R/ x >> (%i326) >> >> >> Despite the fact that rat(1) should be the same as remainder(1,rat(x)) >> they are different when used inside fasttimes because it seems >> that remainder give to "1" the right list of variables >> >> >> (%i328) rat(1); >> Evaluation took 0.00 seconds (0.00 elapsed) using 232 bytes. >> (%o328)/R/ 1 >> (%i329) remainder(rat(1),rat(x)); >> Evaluation took 0.00 seconds (0.00 elapsed) using 1.070 KB. >> (%o329)/R/ 1 >> (%i330) is(%=%o328); >> Evaluation took 0.00 seconds (0.00 elapsed) using 600 bytes. >> (%o330) true >> (%i331) fasttimes(remainder(rat(1),rat(x)),rat(x)); >> Evaluation took 0.00 seconds (0.00 elapsed) using 1.523 KB. >> (%o331)/R/ x >> >> >> >> Its code is in ratout.lisp but I am not enough Lisp savy to debug it >> >> (defmfun $fasttimes (x y) >> (cond ((and (not (atom x)) (not (atom y)) >> (equal (car x) (car y)) (equal (caar x) 'mrat) >> (equal (cddr x) 1) (equal (cddr y) 1)) >> (cons (car x)(cons (fptimes (cadr x)(cadr y))1))) >> (t (merror "Use `fasttimes' only on CRE polynomials with same >> varlists")))) >> >> >> >> Any suggestions on how to fix it other than circumvent it? >> Possibly a fix in the Lisp code? >> >> Fabrizio >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > From robert.dodier at gmail.com Thu Feb 14 18:02:08 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 14 Feb 2008 17:02:08 -0700 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47B460BE.60308@ericsson.com> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> <47B302BF.8030901@scieneer.com> <47B305D5.8040405@ericsson.com> <47B3B866.2010106@scieneer.com> <47B460BE.60308@ericsson.com> Message-ID: On Thu, Feb 14, 2008 at 8:39 AM, Raymond Toy (RT/EUS) wrote: > A quick fix for that, and everything compiles. I have to say it is > rather nice to see all those extra digits. There are a few issues > though. Printing large floats doesn't print out all the digits. Yeah. There is a literal constant 16 in EXPLODEN. I guess that should become a function of the float size, s.t. like ceiling((mantissa #bits)/(log(10)/log(2))). Or maybe there is a way to specify a format directive which just means "print all available digits". best Robert From dtc-maxima at scieneer.com Thu Feb 14 19:11:56 2008 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Fri, 15 Feb 2008 12:11:56 +1100 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> <47B302BF.8030901@scieneer.com> <47B305D5.8040405@ericsson.com> <47B3B866.2010106@scieneer.com> <47B460BE.60308@ericsson.com> Message-ID: <47B4E6DC.6090805@scieneer.com> Robert Dodier wrote: > On Thu, Feb 14, 2008 at 8:39 AM, Raymond Toy (RT/EUS) > wrote: > >> A quick fix for that, and everything compiles. I have to say it is >> rather nice to see all those extra digits. There are a few issues >> though. Printing large floats doesn't print out all the digits. > > Yeah. There is a literal constant 16 in EXPLODEN. > I guess that should become a function of the float size, > s.t. like ceiling((mantissa #bits)/(log(10)/log(2))). > Or maybe there is a way to specify a format directive > which just means "print all available digits". A new constant was added, see float.lisp (defmvar $maxfpprintprec (ceiling (log (expt 2 (float-digits 1.0)) 10.0)) "The maximum number of significant digits printed for floats.") This is used as the default value for $fpprec, and in 'exploden as the default when $fpprintprec is zero. This is 16, as before, for double-floats, and for the CMU CL double-double floats this is currently 32. Regards Douglas Crosher From toy.raymond at gmail.com Thu Feb 14 20:23:34 2008 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 14 Feb 2008 21:23:34 -0500 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47B4E6DC.6090805@scieneer.com> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> <47B302BF.8030901@scieneer.com> <47B305D5.8040405@ericsson.com> <47B3B866.2010106@scieneer.com> <47B460BE.60308@ericsson.com> <47B4E6DC.6090805@scieneer.com> Message-ID: <47B4F7A6.2000005@gmail.com> Douglas Crosher wrote: > A new constant was added, see float.lisp > (defmvar $maxfpprintprec (ceiling (log (expt 2 (float-digits 1.0)) 10.0)) > "The maximum number of significant digits printed for floats.") > > This is used as the default value for $fpprec, and in 'exploden as the default > when $fpprintprec is zero. This is 16, as before, for double-floats, and for > the CMU CL double-double floats this is currently 32. > > This is working now. I must have missed something by not removing all the fasls and recompiling. (maxima.system is missing a ton of dependencies.) I have a couple more fixes for double-double. Also, I don't think we should convert the slatec routines to use long-float. The constants there are only accurate to double-float because that's all that was used when they were generated (even if the original source has way more digits---an artifact of f2cl). I think the slatec routines should be compiled as normal double-float routines, and the maxima interface to them should convert to/from flonum to double-float as appropriate. I have played around with lapack and quad-doubles, and I think they could be converted to flonum type to get flonum precision. I think the only issue is dlamch which computes some information about the underlying floating-point number system. The quad-double version was computing things like epsilon to be zero. :-) But we have lisp to tell use most of the info, so a pure lisp version of dlamch would solve that problem. Ray From dtc-maxima at scieneer.com Fri Feb 15 05:58:13 2008 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Fri, 15 Feb 2008 22:58:13 +1100 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47B4F7A6.2000005@gmail.com> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> <47B302BF.8030901@scieneer.com> <47B305D5.8040405@ericsson.com> <47B3B866.2010106@scieneer.com> <47B460BE.60308@ericsson.com> <47B4E6DC.6090805@scieneer.com> <47B4F7A6.2000005@gmail.com> Message-ID: <47B57E55.1000302@scieneer.com> Raymond Toy wrote: ... > Also, I don't think we should convert the slatec routines to use > long-float. The constants there are only accurate to double-float > because that's all that was used when they were generated (even if the > original source has way more digits---an artifact of f2cl). I think the > slatec routines should be compiled as normal double-float routines, and > the maxima interface to them should convert to/from flonum to > double-float as appropriate. The slatec Fortran source comments suggests it is precise enough for double-double float. The code can be re-translated, maintaining the constant precision, using the following hack patch. F2cl hack patch to target Fortran double precision to long-float or double-double-float: http://www.scieneer.com/files/f2cl-patch1.txt.gz Add the following compiler-options in slatec.system and rebuild: :double-precision-format kernel:double-double-float :float-format kernel:double-double-float Could be a quick path if it works out. Regards Douglas Crosher From raymond.toy at ericsson.com Fri Feb 15 08:44:59 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Fri, 15 Feb 2008 09:44:59 -0500 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47B57E55.1000302@scieneer.com> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> <47B302BF.8030901@scieneer.com> <47B305D5.8040405@ericsson.com> <47B3B866.2010106@scieneer.com> <47B460BE.60308@ericsson.com> <47B4E6DC.6090805@scieneer.com> <47B4F7A6.2000005@gmail.com> <47B57E55.1000302@scieneer.com> Message-ID: <47B5A56B.3070303@ericsson.com> Douglas Crosher wrote: > Raymond Toy wrote: > ... >> Also, I don't think we should convert the slatec routines to use >> long-float. The constants there are only accurate to double-float >> because that's all that was used when they were generated (even if the >> original source has way more digits---an artifact of f2cl). I think the >> slatec routines should be compiled as normal double-float routines, and >> the maxima interface to them should convert to/from flonum to >> double-float as appropriate. > > The slatec Fortran source comments suggests it is precise enough for > double-double float. The code can be re-translated, maintaining the > constant precision, using the following hack patch. > > F2cl hack patch to target Fortran double precision to long-float or > double-double-float: > http://www.scieneer.com/files/f2cl-patch1.txt.gz > You're right. That is interesting. It would be nice if f2cl would preserve all the digits in the translation, independent of whatever the float format was. I'll have to think about that.... Ray From ronis at ronispc.chem.mcgill.ca Fri Feb 15 10:02:35 2008 From: ronis at ronispc.chem.mcgill.ca (David Ronis) Date: Fri, 15 Feb 2008 11:02:35 -0500 Subject: [Maxima] Problem with long expressions in imaxima Message-ID: <1203091355.9263.12.camel@ronispc.chem.mcgill.ca> I've been using imaxima for a short while, and for simple things it works as expected (and makes the output much easier to read). However, for very long expressions something goes wrong. Emacs/maxima spends a long time formatting the results(?), I see gs running in the background, and in the end, all that gets output are pages raw tex. The following shows the problem: exponentialize:true; En(i,l,m, mu, epsilon):=epsilon*(cosh(mu)*(l+1/2)*(A[i,l,m]*%e^((l +1/2)*mu)-B[i,l,m]*%e^(-(l+1/2)*mu)) +sinh(mu)*(A[i,l,m]*%e^((l+1/2)*mu)+B[i,l,m]*%e^(-(l+1/2)*mu)) -sqrt((l+m)*(l-m)/((2*l-1)*(2*l+1)))*(l-1/2) *(A[i,l-1,m]*%e^((l-1/2)*mu)-B[i,l-1,m]*%e^(-(l-1/2)*mu)) -sqrt((l+1+m)*(l+1-m)/((2*l+3)*(2*l+1)))*(l-3/2) *(A[i,l+1,m]*%e^((l+1/2)*mu)-B[i,l+1,m]*%e^(-(l-3/2)*mu))); phi(i,l,m,mu):=A[i,l,m]*%e^((l+1/2)*mu)+B[i,l,m]*%e^(-(l+1/2)*mu); ans:solve([ phi(0,l,m,mu[0])-phi(1,l,m,mu[0])=0, phi(1,l,m,mu[1])-phi(2,l,m,mu[2])=0, phi(2,l,m,-mu[2])-phi(3,l,m,-mu[2])=0, En(0,l,m,mu[0],epsilon[1])-En(1,l,m,mu[0],epsilon[1])=-1, En(1,l,m,mu[1],epsilon[1])-En(2,l,m,mu[1],epsilon[2])=0, En(2,l,m,-mu[2],epsilon[2])- En(3,l,m,-mu[2], epsilon[3])=0, A[0,l,m]=0, B[3,l,m]=0], [ A[0,l,m], B[0,l,m], A[1,l,m], B[1,l,m], A[2,l,m], B[2,l,m], A[3,l,m], B[3,l,m]] )$ part(ans,1); David From fateman at cs.berkeley.edu Fri Feb 15 10:52:57 2008 From: fateman at cs.berkeley.edu (R Fateman) Date: Fri, 15 Feb 2008 08:52:57 -0800 Subject: [Maxima] Problem with long expressions in imaxima In-Reply-To: <1203091355.9263.12.camel@ronispc.chem.mcgill.ca> References: <1203091355.9263.12.camel@ronispc.chem.mcgill.ca> Message-ID: <47B5C369.7010802@cs.berkeley.edu> I don't use imaxima, because I think that what you observe is hard to avoid. imaxima tries to break up large expressions by using breqn or some macro package for TeX. It then runs it through some program to convert dvi to postscript to some displaying program. None of this is, I think, sturdy enough for handling really large expressions. I suspect that there are fixed sizes of tables and exponentially expensive algorithms for breakup. These programs are not part of emacs or maxima. gs is ghostscript, a postscript interpreter. RJF David Ronis wrote: > I've been using imaxima for a short while, and for simple things it > works as expected (and makes the output much easier to read). However, > for very long expressions something goes wrong. Emacs/maxima spends a > long time formatting the results(?), I see gs running in the background, > and in the end, all that gets output are pages raw tex. The following > shows the problem: > > > exponentialize:true; > En(i,l,m, mu, epsilon):=epsilon*(cosh(mu)*(l+1/2)*(A[i,l,m]*%e^((l > +1/2)*mu)-B[i,l,m]*%e^(-(l+1/2)*mu)) > +sinh(mu)*(A[i,l,m]*%e^((l+1/2)*mu)+B[i,l,m]*%e^(-(l+1/2)*mu)) > -sqrt((l+m)*(l-m)/((2*l-1)*(2*l+1)))*(l-1/2) > *(A[i,l-1,m]*%e^((l-1/2)*mu)-B[i,l-1,m]*%e^(-(l-1/2)*mu)) > -sqrt((l+1+m)*(l+1-m)/((2*l+3)*(2*l+1)))*(l-3/2) > *(A[i,l+1,m]*%e^((l+1/2)*mu)-B[i,l+1,m]*%e^(-(l-3/2)*mu))); > > phi(i,l,m,mu):=A[i,l,m]*%e^((l+1/2)*mu)+B[i,l,m]*%e^(-(l+1/2)*mu); > > ans:solve([ phi(0,l,m,mu[0])-phi(1,l,m,mu[0])=0, > phi(1,l,m,mu[1])-phi(2,l,m,mu[2])=0, > phi(2,l,m,-mu[2])-phi(3,l,m,-mu[2])=0, > En(0,l,m,mu[0],epsilon[1])-En(1,l,m,mu[0],epsilon[1])=-1, > En(1,l,m,mu[1],epsilon[1])-En(2,l,m,mu[1],epsilon[2])=0, > En(2,l,m,-mu[2],epsilon[2])- En(3,l,m,-mu[2], epsilon[3])=0, > A[0,l,m]=0, B[3,l,m]=0], > [ A[0,l,m], B[0,l,m], A[1,l,m], B[1,l,m], > A[2,l,m], B[2,l,m], A[3,l,m], B[3,l,m]] )$ > > part(ans,1); > > > David > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From raymond.toy at ericsson.com Fri Feb 15 11:15:00 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Fri, 15 Feb 2008 12:15:00 -0500 Subject: [Maxima] Problem with long expressions in imaxima In-Reply-To: <1203091355.9263.12.camel@ronispc.chem.mcgill.ca> References: <1203091355.9263.12.camel@ronispc.chem.mcgill.ca> Message-ID: <47B5C894.3050104@ericsson.com> David Ronis wrote: > I've been using imaxima for a short while, and for simple things it > works as expected (and makes the output much easier to read). However, > for very long expressions something goes wrong. Emacs/maxima spends a > long time formatting the results(?), I see gs running in the background, > and in the end, all that gets output are pages raw tex. The following > shows the problem: > > > exponentialize:true; > En(i,l,m, mu, epsilon):=epsilon*(cosh(mu)*(l+1/2)*(A[i,l,m]*%e^((l > +1/2)*mu)-B[i,l,m]*%e^(-(l+1/2)*mu)) > +sinh(mu)*(A[i,l,m]*%e^((l+1/2)*mu)+B[i,l,m]*%e^(-(l+1/2)*mu)) > -sqrt((l+m)*(l-m)/((2*l-1)*(2*l+1)))*(l-1/2) > *(A[i,l-1,m]*%e^((l-1/2)*mu)-B[i,l-1,m]*%e^(-(l-1/2)*mu)) > -sqrt((l+1+m)*(l+1-m)/((2*l+3)*(2*l+1)))*(l-3/2) > *(A[i,l+1,m]*%e^((l+1/2)*mu)-B[i,l+1,m]*%e^(-(l-3/2)*mu))); > > phi(i,l,m,mu):=A[i,l,m]*%e^((l+1/2)*mu)+B[i,l,m]*%e^(-(l+1/2)*mu); > > ans:solve([ phi(0,l,m,mu[0])-phi(1,l,m,mu[0])=0, > phi(1,l,m,mu[1])-phi(2,l,m,mu[2])=0, > phi(2,l,m,-mu[2])-phi(3,l,m,-mu[2])=0, > En(0,l,m,mu[0],epsilon[1])-En(1,l,m,mu[0],epsilon[1])=-1, > En(1,l,m,mu[1],epsilon[1])-En(2,l,m,mu[1],epsilon[2])=0, > En(2,l,m,-mu[2],epsilon[2])- En(3,l,m,-mu[2], epsilon[3])=0, > A[0,l,m]=0, B[3,l,m]=0], > [ A[0,l,m], B[0,l,m], A[1,l,m], B[1,l,m], > A[2,l,m], B[2,l,m], A[3,l,m], B[3,l,m]] )$ > > part(ans,1); Note that with 2d-display on, part(ans,1) occupies almost 25000 lines, using plain old maxima. (The 1D display takes 29000 lines). Not sure how useful that would be, whether it's displayed nicely or not. :-) Ray From riccio at gmx.at Fri Feb 15 07:13:53 2008 From: riccio at gmx.at (Alexander Ray) Date: Fri, 15 Feb 2008 14:13:53 +0100 Subject: [Maxima] How to define a New Maxima Function Message-ID: <47B59011.1090804@gmx.at> Hello! Is it possible/easy to define in MAXIMA a generic SYMBOLIC function of the following form? F( x, (x11,x12,f1(x)), (x21,x22,f2(x), ... ) == f1(x), if x in [x11,x12] f2(x), if x in [x21,x22] ... 0, if x elsewhere Example: F(x, (0,2,2*x), (4,6,4*x)) To deliver: diff(F) == 2, at x=1 4, at x=5 0, at x=3 Thank you in advance for your input! Best regards Alex From caruso at dm.unipi.it Fri Feb 15 17:54:28 2008 From: caruso at dm.unipi.it (Fabrizio Caruso) Date: Sat, 16 Feb 2008 00:54:28 +0100 (CET) Subject: [Maxima] fasttimes bug In-Reply-To: <47B4CCC4.4080008@cs.berkeley.edu> References: <47B4CCC4.4080008@cs.berkeley.edu> Message-ID: Hi Unfortunately setting t:rat(1,x) is not enough to circumvent the bug in fasttimes. Checking each time for the argument makes the code significantly slower. For example the function t:rat(1,x) fasttimes(remainder(fasttimes(t,t),x+1),x^3+1); produces the same error about using the wrong list of variables. Would it be possible to fix fasttimes in order to have it read the list of variables from both its arguments? Taking the union of two lists should be fast. Fabrizio On Thu, 14 Feb 2008, R Fateman wrote: > Try fasttimes(rat(1,x), rat(x)). > > Fasttimes may not be especially fast, depending on your inputs. You should > test it to see if it helps your application. > It was not intended to be generally useful, but simply an interface to a > program that might be worth testing, > a "Karatsuba" style multiplier. If you need to multiply many large and > dense polynomials fast, > there are lots of other methods around (not all in Maxima). > > Fabrizio Caruso wrote: >> Hi >> >> fasttimes has a very old bug which makes it less usable >> because it won't work if its first argument is $rat(1)$ >> because >> (1) rat(1) is given an empty list of variables >> unless it has been the result of some computation >> involving some variables; >> (2) fasttimes assumes that list of variables of the product >> should be the same as the one of its first argument >> instead of taking the union of the variables of both arguments >> >> >> In fact we have: >> >> (%i324) fasttimes(rat(1),rat(x)); >> Use `fasttimes' only on CRE polynomials with same varlists >> -- an error. To debug this try debugmode(true); >> (%i325) fasttimes(rat(x),rat(1)); >> Evaluation took 0.00 seconds (0.00 elapsed) using 776 bytes. >> (%o325)/R/ x >> (%i326) >> >> >> Despite the fact that rat(1) should be the same as remainder(1,rat(x)) >> they are different when used inside fasttimes because it seems >> that remainder give to "1" the right list of variables >> >> >> (%i328) rat(1); >> Evaluation took 0.00 seconds (0.00 elapsed) using 232 bytes. >> (%o328)/R/ 1 >> (%i329) remainder(rat(1),rat(x)); >> Evaluation took 0.00 seconds (0.00 elapsed) using 1.070 KB. >> (%o329)/R/ 1 >> (%i330) is(%=%o328); >> Evaluation took 0.00 seconds (0.00 elapsed) using 600 bytes. >> (%o330) true >> (%i331) fasttimes(remainder(rat(1),rat(x)),rat(x)); >> Evaluation took 0.00 seconds (0.00 elapsed) using 1.523 KB. >> (%o331)/R/ x >> >> >> >> Its code is in ratout.lisp but I am not enough Lisp savy to debug it >> >> (defmfun $fasttimes (x y) >> (cond ((and (not (atom x)) (not (atom y)) >> (equal (car x) (car y)) (equal (caar x) 'mrat) >> (equal (cddr x) 1) (equal (cddr y) 1)) >> (cons (car x)(cons (fptimes (cadr x)(cadr y))1))) >> (t (merror "Use `fasttimes' only on CRE polynomials with same >> varlists")))) >> >> >> >> Any suggestions on how to fix it other than circumvent it? >> Possibly a fix in the Lisp code? >> >> Fabrizio >> >> >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > From adammaj1 at o2.pl Sat Feb 16 08:34:34 2008 From: adammaj1 at o2.pl (Adam Majewski) Date: Sat, 16 Feb 2008 15:34:34 +0100 Subject: [Maxima] ALLOCATE Message-ID: Hi, When I run a batch file : http://fraktal.republika.pl/doc/iim.mac I have got an error for some big values of iMax: Error in PROGN [or a callee]: The storage for LONG-FLOAT is exhausted.Currently, 42420 pages are allocated.Use ALLOCATE to expand the space. How can I expand the space ? Adam From woollett at charter.net Sat Feb 16 12:15:18 2008 From: woollett at charter.net (Edwin Woollett) Date: Sat, 16 Feb 2008 10:15:18 -0800 Subject: [Maxima] gcfac and scifac References: <000301c86e86$e215c650$0d00a8c0@edwinc367e16bd> <47B36691.1090801@ericsson.com> <002101c86f34$864e9aa0$0d00a8c0@edwinc367e16bd> <47B489B4.3010506@ericsson.com> Message-ID: <000301c870c7$e367c290$0d00a8c0@edwinc367e16bd> Raymond Toy wrote on Thursday, February 14, 2008 > As a temporary solution, add the following to scifac.lisp, near the top: > > (defun fixp (n) > (typep n 'fixnum)) > > (defun $min (x y) > (min x y)) > > (defun add1 (x) > (1+ x)) > > These are wild guesses, based on looking at the code for a few seconds. > fixp and add1 are probably safe since I don'tt seem them defined > anywhere else in maxima But $min might be suspect since maxima already > has some kind of $min function. > > But with these changes demo(scifac) finishes. > > Ray > I added these as lines 4,5,6. demo(scifac) runs to completion. the gcfac examples demonstrate the power of this factoring function. thanks, ted win xp, v 5.14 From robert.dodier at gmail.com Sat Feb 16 15:01:04 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 16 Feb 2008 14:01:04 -0700 Subject: [Maxima] How to define a New Maxima Function In-Reply-To: <47B59011.1090804@gmx.at> References: <47B59011.1090804@gmx.at> Message-ID: On 2/15/08, Alexander Ray wrote: > Is it possible/easy to define in MAXIMA a generic SYMBOLIC function of > the following form? > > F( x, (x11,x12,f1(x)), (x21,x22,f2(x), ... ) > > == > > f1(x), if x in [x11,x12] > f2(x), if x in [x21,x22] > ... > 0, if x elsewhere The good news is that it is possible, the bad news is that it is not simple, and the moderately good news is that given the existing machinery in Maxima, we could probably figure out a way to equip Maxima with that capability. Given that functions defined piecewise are a recurring source of questions, I'm inclined to think we should go ahead & do it. Here is an initial attempt to solve your problem in terms of the unit_step function. A solution could probably also be formulated in terms of conditional expressions. I hope I haven't made some kind of fundamental error here. load (orthopoly); matchdeclare (aa, all, xx, mapatom); tellsimpafter ('diff (unit_step(aa), xx, 1), if freeof (xx,aa) then 0 else delta (aa)); More stuff has to be thrown in to handle the delta(x) stuff. I'll let it go for now. Here's what we can get with just that rule. foo : f(x) * (1 - unit_step (x - 3)) + g(x) * unit_step (x - 3); diff (foo, x); => unit_step(x - 3) * 'diff(g(x),x,1) + (1 - unit_step(x - 3)) * 'diff(f(x),x,1) + delta(x - 3) * g(x) - delta(x - 3) * f(x) In case it isn't clear, "f1(x), if x in [x11, x12]" is represented as f1(x) * (unit_step (x - x11) - unit_step (x - x12)). Hope this helps. Sorry that Maxima cannot do a better job on this stuff. Robert Dodier From willisb at unk.edu Mon Feb 18 06:37:56 2008 From: willisb at unk.edu (Barton Willis) Date: Mon, 18 Feb 2008 06:37:56 -0600 Subject: [Maxima] How to define a New Maxima Function In-Reply-To: References: <47B59011.1090804@gmx.at>, Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >On 2/15/08, Alexander Ray wrote: > >> Is it possible/easy to define in MAXIMA a generic SYMBOLIC function of >> the following form? >> >> F( x, (x11,x12,f1(x)), (x21,x22,f2(x), ... ) >> f1(x), if x in [x11,x12] >> f2(x), if x in [x21,x22] >> ... >> 0, if x elsewhere Getting all of Maxima (sign, limit, diff, integrate, solve, ...) to do something useful with split-rule expressions is the hard part. But the first step is the build tools to define such expression. Barton From riccio at gmx.at Mon Feb 18 06:15:34 2008 From: riccio at gmx.at (Alexander Ray) Date: Mon, 18 Feb 2008 13:15:34 +0100 Subject: [Maxima] How to define a New Maxima Function In-Reply-To: References: <47B59011.1090804@gmx.at> Message-ID: <47B976E6.9060208@gmx.at> hello robert, in fact, that was our first try to use unit_step. unfortunately, we have next to integrate the function. and integrate(f(x)) does not really work nice if f(x) contains unit_step. we try to to calculate a price of a generic plain-vanilla financial option, that is nothing else but integrate(f(x,a,b,c,...),x,minf,inf). where f(x) typically is piecewise-continuous/differentiable but may depend on parameters a,b,c,... in quite a tricky unpredictable manner (you have to solve an implicit equation first in order to define the integral). do you plan to invest more resources in your integration algorithm? if this is the case we would be happy to provide you with nice examples. regards alex >> Is it possible/easy to define in MAXIMA a generic SYMBOLIC function of >> the following form? >> >> F( x, (x11,x12,f1(x)), (x21,x22,f2(x), ... ) >> >> == >> >> f1(x), if x in [x11,x12] >> f2(x), if x in [x21,x22] >> ... >> 0, if x elsewhere >> > > The good news is that it is possible, the bad news is that it is not simple, > and the moderately good news is that given the existing machinery in > Maxima, we could probably figure out a way to equip Maxima with > that capability. Given that functions defined piecewise are a recurring > source of questions, I'm inclined to think we should go ahead & do it. > > Here is an initial attempt to solve your problem in terms of the > unit_step function. > A solution could probably also be formulated in terms of conditional > expressions. I hope I haven't made some kind of fundamental error here. > > load (orthopoly); > matchdeclare (aa, all, xx, mapatom); > tellsimpafter ('diff (unit_step(aa), xx, 1), if freeof (xx,aa) then 0 > else delta (aa)); > > More stuff has to be thrown in to handle the delta(x) stuff. > I'll let it go for now. Here's what we can get with just that rule. > > foo : f(x) * (1 - unit_step (x - 3)) + g(x) * unit_step (x - 3); > diff (foo, x); > => unit_step(x - 3) * 'diff(g(x),x,1) + (1 - unit_step(x - 3)) * > 'diff(f(x),x,1) + delta(x - 3) * g(x) - delta(x - 3) * f(x) > > In case it isn't clear, "f1(x), if x in [x11, x12]" is represented as > f1(x) * (unit_step (x - x11) - unit_step (x - x12)). > > Hope this helps. Sorry that Maxima cannot do a better job on this stuff. > > Robert Dodier > > From mogunus at gmail.com Mon Feb 18 11:12:03 2008 From: mogunus at gmail.com (Marco Carmosino) Date: Mon, 18 Feb 2008 12:12:03 -0500 Subject: [Maxima] Solving Equations With logs Message-ID: <24a7fa6d0802180912ofdeb078ra7803fd8e01e6e06@mail.gmail.com> Hello all. I am trying to find all points where two functions intersect, using maxima. These are my function definitions: (%i29) log2(x) := log(x)/log(2) (%i84) eq1 : y = 64*n*log2(n)$ (%i85) eq2 : y = 8*n^2$ When I use: solve([eq2,eq1],[n,y]); I get: `algsys' cannot solve - system too complicated. -- an error. To debug this try debugmode(true); I've tried using "pickapart" at levels 1, 2, and 3 on eq1, but I still get the same error message when I execute: solve([eq2,%],[n,y]); When I use find_root, with the same equation definitions, I get two different replies depending on whether I pick y or n as my variable: (%i99) find_root([eq2,eq1],y,1,100); Is n positive or negative? positive; Is n positive or negative? positive; 2 64 n log(n) (%o99) find_root([y = 8 n , y = -----------], y, 1.0, 100.0) log(2) I think I am responding to the "positive or negative" prompt wrong, but I couldn't find how to respond properly in the docs. (%i96) find_root([eq2,eq1],n,1,100); 2 64 n log(n) (%o96) find_root([y = 8 n , y = -----------], n, 1.0, 100.0) log(2) Sorry about the length of this, but I wanted to specify exactly what I tried. Thanks very much for any help. --Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080218/fa602f9b/attachment.htm From phhs80 at gmail.com Mon Feb 18 11:46:55 2008 From: phhs80 at gmail.com (Paul Smith) Date: Mon, 18 Feb 2008 17:46:55 +0000 Subject: [Maxima] Solving Equations With logs In-Reply-To: <24a7fa6d0802180912ofdeb078ra7803fd8e01e6e06@mail.gmail.com> References: <24a7fa6d0802180912ofdeb078ra7803fd8e01e6e06@mail.gmail.com> Message-ID: <6ade6f6c0802180946u58b7ac62lfae2fbb79b83b9f6@mail.gmail.com> On Feb 18, 2008 5:12 PM, Marco Carmosino wrote: > Hello all. I am trying to find all points where two functions intersect, > using maxima. > > These are my function definitions: > > (%i29) log2(x) := log(x)/log(2) > (%i84) eq1 : y = 64*n*log2(n)$ > (%i85) eq2 : y = 8*n^2$ > > When I use: > > solve([eq2,eq1],[n,y]); > > I get: > > `algsys' cannot solve - system too complicated. > -- an error. To debug this try debugmode(true); > > I've tried using "pickapart" at levels 1, 2, and 3 on eq1, but I still get > the same error message when I execute: > > solve([eq2,%],[n,y]); > > When I use find_root, with the same equation definitions, I get two > different replies depending on whether I pick y or n as my variable: > > (%i99) find_root([eq2,eq1],y,1,100); > Is n positive or negative? > > positive; > Is n positive or negative? > > positive; > 2 64 n log(n) > (%o99) find_root([y = 8 n , y = -----------], y, 1.0, 100.0) > log(2) > > I think I am responding to the "positive or negative" prompt wrong, but I > couldn't find how to respond properly in the docs. > > (%i96) find_root([eq2,eq1],n,1,100); > 2 64 n log(n) > (%o96) find_root([y = 8 n , y = -----------], n, 1.0, 100.0) > log(2) > > Sorry about the length of this, but I wanted to specify exactly what I > tried. Thanks very much for any help. What about the following? (%i52) f(n):=8*n^2-64*n*log2(n); (%o52) f(n):=8*n^2-64*n*log2(n) (%i53) find_root(f(n),n,1,2); (%o53) 1.099997030237609 (%i54) find_root(f(n),n,35,50); (%o54) 43.55926043688165 Notice, Marco, that find_root only works with unidimentional functions. By using substitution, one can get a unidimentional function. Use plot2d to identify the intervals where the roots are and, subsequently, use find_root. Paul From robert.dodier at gmail.com Mon Feb 18 11:47:05 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 18 Feb 2008 10:47:05 -0700 Subject: [Maxima] Solving Equations With logs In-Reply-To: <24a7fa6d0802180912ofdeb078ra7803fd8e01e6e06@mail.gmail.com> References: <24a7fa6d0802180912ofdeb078ra7803fd8e01e6e06@mail.gmail.com> Message-ID: On 2/18/08, Marco Carmosino wrote: > Hello all. I am trying to find all points where two functions intersect, > using maxima. > > These are my function definitions: > > (%i29) log2(x) := log(x)/log(2) > (%i84) eq1 : y = 64*n*log2(n)$ > (%i85) eq2 : y = 8*n^2$ > (%i99) find_root([eq2,eq1],y,1,100); find_root knows how to handle just 1 equation at a time. (There is another function mnewton which can handle multiple equations via Newton's method. But I don't think mnewton is needed here.) I think you want something like find_root (eq2 - eq1, n, a, b); where a and b can be determined by inspecting a plot, e.g. plot2d (rhs (eq2 - eq1), [n, 1, 10]); or plot2d (rhs (eq2 - eq1), [n, 1, 100]); Unfortunately Maxima is not very strong at solving equations containing logs by symbolic methods. But maybe a numerical solution is enough here. HTH Robert Dodier From macrakis at alum.mit.edu Mon Feb 18 13:16:36 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 18 Feb 2008 14:16:36 -0500 Subject: [Maxima] Solving Equations With logs In-Reply-To: <24a7fa6d0802180912ofdeb078ra7803fd8e01e6e06@mail.gmail.com> References: <24a7fa6d0802180912ofdeb078ra7803fd8e01e6e06@mail.gmail.com> Message-ID: <8b356f880802181116j2506192co8a796b2517d9ed3a@mail.gmail.com> On Feb 18, 2008 12:12 PM, Marco Carmosino wrote: > (%i29) log2(x) := log(x)/log(2) > (%i84) eq1 : y = 64*n*log2(n)$ > (%i85) eq2 : y = 8*n^2$ > Maxima cannot solve this system of equations symbolically because it is not solvable in closed form. Using the eliminate function, you can reduce it to an equation in n only: eq12: eliminate([eq1,eq2],[y]); => [8*n*(8*log(n)-log(2)*n)] If you use solve on the result, you get sols: solve(eq12,n) => [n = 0,n = 8*log(n)/log(2)] The first solution is correct (despite the log(n) term...); the second is a transcendental equation and can't be solved symbolically using the usual elementary functions. At this point, you can use find_root: find_root(sols[2],n,.1,10) => 1.10 find_root(sols[2],n,10,100) => 43.56 I believe someone is working on a more automated root-finder, but this should work for now. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080218/4877ff8d/attachment.htm From phhs80 at gmail.com Mon Feb 18 13:32:39 2008 From: phhs80 at gmail.com (Paul Smith) Date: Mon, 18 Feb 2008 19:32:39 +0000 Subject: [Maxima] Solving Equations With logs In-Reply-To: <8b356f880802181116j2506192co8a796b2517d9ed3a@mail.gmail.com> References: <24a7fa6d0802180912ofdeb078ra7803fd8e01e6e06@mail.gmail.com> <8b356f880802181116j2506192co8a796b2517d9ed3a@mail.gmail.com> Message-ID: <6ade6f6c0802181132p6ca7562dtc514a3c838d25bd2@mail.gmail.com> On Feb 18, 2008 7:16 PM, Stavros Macrakis wrote: > > (%i29) log2(x) := log(x)/log(2) > > (%i84) eq1 : y = 64*n*log2(n)$ > > (%i85) eq2 : y = 8*n^2$ > > > > Maxima cannot solve this system of equations symbolically because it is not > solvable in closed form. Using the eliminate function, you can reduce it to > an equation in n only: > > eq12: eliminate([eq1,eq2],[y]); => [8*n*(8*log(n)-log(2)*n)] > > If you use solve on the result, you get > > sols: solve(eq12,n) => [n = 0,n = 8*log(n)/log(2)] > > The first solution is correct (despite the log(n) term...); the second is a > transcendental equation and can't be solved symbolically using the usual > elementary functions. At this point, you can use find_root: > > find_root(sols[2],n,.1,10) => 1.10 > find_root(sols[2],n,10,100) => 43.56 > > I believe someone is working on a more automated root-finder, but this > should work for now. Maple gives all symbolic solutions expressed through Lambert W functions. Although one can argue that a solution expressed as a Lambert W function is not a closed-form solution, Maple solution informs us about the number of solutions of the problem (very helpful piece of information). Maybe Maxima could be improved regarding the possibility of giving also the solution of this sort of problems expressed through Lambert W functions, so that the user could learn the number of the solutions of his problem. Paul From mogunus at gmail.com Mon Feb 18 15:37:40 2008 From: mogunus at gmail.com (Marco Carmosino) Date: Mon, 18 Feb 2008 16:37:40 -0500 Subject: [Maxima] Solving Equations With logs Message-ID: <24a7fa6d0802181337w3362d400tb46e14f2e320c1a2@mail.gmail.com> Thanks very much, numeric solutions are fine and find_root works great for two equations. However, I'm having trouble solving where I just want to set my equation equal to a constant: (%i50) find_root(log2(n)=10^6, n, 0, 10^60); log(n) (%o50) find_root(------ = 1000000, n, 0.0, 1.0E+60) log(2) A numeric approximation to the solution of equations of the form log2(n) = 10^6 would also be fine. I have also tried: (%i52) solve(log2(n)=10^6,n); This produces a very, very long string of numbers. Some background: I'd like to be able to automate comparing the running time of algorithms to each other, for different times T, so I can sort a table of them. Thanks --Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080218/ef5011d9/attachment.htm From reyssat at math.unicaen.fr Mon Feb 18 16:12:47 2008 From: reyssat at math.unicaen.fr (reyssat) Date: Mon, 18 Feb 2008 23:12:47 +0100 Subject: [Maxima] Solving Equations With logs In-Reply-To: <24a7fa6d0802181337w3362d400tb46e14f2e320c1a2@mail.gmail.com> References: <24a7fa6d0802181337w3362d400tb46e14f2e320c1a2@mail.gmail.com> Message-ID: <47BA02DF.2020902@math.unicaen.fr> Marco Carmosino a ?crit : > Thanks very much, numeric solutions are fine and find_root works great > for two equations. However, I'm having trouble solving where I just want > to set my equation equal to a constant: > > (%i50) find_root(log2(n)=10^6, n, 0, 10^60); > log(n) > (%o50) find_root(------ = 1000000, n, 0.0, 1.0E+60) > log(2) > > A numeric approximation to the solution of equations of the form log2(n) > = 10^6 would also be fine. I have also tried: > > (%i52) solve(log2(n)=10^6,n); > > This produces a very, very long string of numbers. Sure ! The only solution is 2^(10^6), a number which has about 300000 decimal digits ! And of course find_root cannot find it, since it is not in the interval [0,10^60]. Another reason is that find_root must be given an interval such that your function (difference of two sides of the equation) takes values of opposite signs at its ends. But when n is 0, what is the sign of log2(n) ? If you try the interval [1,10^(10^6)] then you get an overflow because of the right hand side. If you try more reasonable values, you find a solution : find_root(log2(n)=10^2, n, 1, 10^60); correctly gives a numerical solution around 10^30. Eric > > Some background: I'd like to be able to automate comparing the running > time of algorithms to each other, for different times T, so I can sort a > table of them. > > Thanks > > --Marco > > > ------------------------------------------------------------------------ > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Mon Feb 18 18:12:03 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 18 Feb 2008 17:12:03 -0700 Subject: [Maxima] Solving Equations With logs In-Reply-To: <24a7fa6d0802181337w3362d400tb46e14f2e320c1a2@mail.gmail.com> References: <24a7fa6d0802181337w3362d400tb46e14f2e320c1a2@mail.gmail.com> Message-ID: On 2/18/08, Marco Carmosino wrote: > Thanks very much, numeric solutions are fine and find_root works great for > two equations. However, I'm having trouble solving where I just want to set > my equation equal to a constant: > > (%i50) find_root(log2(n)=10^6, n, 0, 10^60); > log(n) > (%o50) find_root(------ = 1000000, n, 0.0, 1.0E+60) > log(2) I see a couple of problems here. find_root wants to evaluate the equation at the endpoints, but log(0.0) isn't a number. Also, the solution to this equation is very, very much greater than 10^60. Perhaps the equation has been misstated ?? > (%i52) solve(log2(n)=10^6,n); > > This produces a very, very long string of numbers. Well, log2(n) = 10^6 => n = 2^(10^6) which is a number of several hundred thousand digits, if I'm not mistaken .... best Robert Dodier From macrakis at alum.mit.edu Mon Feb 18 18:35:39 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 18 Feb 2008 19:35:39 -0500 Subject: [Maxima] Improved min/max; LambertW Message-ID: <8b356f880802181635l227c55f5j15670019b5de37b9@mail.gmail.com> I've checked in some code that improves Maxima's handling of sign(min/max(...)), sign(min/max(...)-min/max(...)). This isn't complete, but I thought I'd start with the simple cases. This already improves simplification of min/max . I'll have to write some test cases.... I also checked in a very simple LambertW simplifier, using the name lambertw(...). The idea is to add it to solve sometime, but it would be nice if we could also add some numerical evaluation routines for it.... -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080218/18f7f094/attachment.htm From robert.dodier at gmail.com Mon Feb 18 18:37:40 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 18 Feb 2008 17:37:40 -0700 Subject: [Maxima] How to define a New Maxima Function In-Reply-To: <47B976E6.9060208@gmx.at> References: <47B59011.1090804@gmx.at> <47B976E6.9060208@gmx.at> Message-ID: On 2/18/08, Alexander Ray wrote: > in fact, that was our first try to use unit_step. > unfortunately, we have next to integrate the function. and > integrate(f(x)) does not really work nice if f(x) contains unit_step. Here is an initial attempt at a pattern-matching rule which tells integrate how to handle unit_step. I've omitted various details, which we can fill in if it seems worth pursuing. matchdeclare (uu, lambda ([ee], not atom(ee) and op(ee) = unit_step), vv, lambda ([ee], atom(ee) or op(ee) # unit_step)); matchdeclare ([aa, bb], all, xx, mapatom); simp : false; 'integrate (uu*vv, xx, aa, bb); defrule (r1, ''%, FOO (uu, vv, xx, aa, bb)); simp : true; FOO (u, v, x, a, b) := (FOO1 (u, x), if %% < a then integrate (v, x, a, b) elseif %% < b then integrate (v, x, %%, b) else 0); FOO1 (u, x) := (if op(u) = unit_step then args(u) else apply (append, maplist (args, u)), map (lambda ([e], solve(e = 0, x)), %%), apply (append, %%), map (rhs, %%), apply (max, %%)); Here is a result which makes use of that rule r1. integrate (f(x)*g(x)*unit_step(x-5), x, a, b); apply1 (%, r1); => if 5 < a then integrate(f(x)*g(x),x,a,b) elseif 5 < b then integrate(f(x)*g(x),x,5,b) else 0 ''%, a=3, b=12; => 'integrate(f(x)*g(x),x,5,12) Maybe that is enough to get started. I would be interested to hear more about the problem you are working on. > we try to to calculate a price of a generic plain-vanilla financial > option, that is nothing else but integrate(f(x,a,b,c,...),x,minf,inf). > where f(x) typically is piecewise-continuous/differentiable but may > depend on parameters a,b,c,... in quite a tricky unpredictable manner > (you have to solve an implicit equation first in order to define the > integral). I see a lot of potential uses for Maxima in mixed symbolic and numerical problems. I would really like to see Maxima become the tool of choice for such problems. Towards that end, strengthening Maxima's treatment of functions defined piecewise is a good strategy. best Robert Dodier From dtc-maxima at scieneer.com Mon Feb 18 18:42:02 2008 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Tue, 19 Feb 2008 11:42:02 +1100 Subject: [Maxima] Solving Equations With logs In-Reply-To: <24a7fa6d0802181337w3362d400tb46e14f2e320c1a2@mail.gmail.com> References: <24a7fa6d0802181337w3362d400tb46e14f2e320c1a2@mail.gmail.com> Message-ID: <47BA25DA.1010704@scieneer.com> Marco Carmosino wrote: > Thanks very much, numeric solutions are fine and find_root works great > for two equations. However, I'm having trouble solving where I just want > to set my equation equal to a constant: > > (%i50) find_root(log2(n)=10^6, n, 0, 10^60); > log(n) > (%o50) find_root(------ = 1000000, n, 0.0, 1.0E+60) > log(2) > > A numeric approximation to the solution of equations of the form log2(n) > = 10^6 would also be fine. I have also tried: The CLISP implementation supports very large floating point numbers and there is a Maxima variant for CLISP that can solve this. If you really need to work with such large numbers and would like to test this then let me know. (%i1) find_root(log(n)/log(2)=10^6, n, 1, 10^310000); (%o1) 9.9006562292958982506979236163019032507336242417875673328663961145317094\ 833094861030546145512346483914824315070345837238835106589894163149274225650315\ 729053723148693772328717754947136642389701258429144896147163384121886311037923\ 980560077401362709605530705386671798123360615921792798327322364303228626065921\ E+301029 Regards Douglas Crosher From pcd at wikitex.org Mon Feb 18 19:46:25 2008 From: pcd at wikitex.org (Peter Danenberg) Date: Mon, 18 Feb 2008 19:46:25 -0600 Subject: [Maxima] Curried Functions Message-ID: <20080219014625.GA29374@klutometis.wikitex.org> Currying works in Maxima from lisp: :lisp (defun curry (function &rest args) (lambda (&rest more-args) (apply function (append args more-args)))) :lisp (defun double (x) (funcall (curry #'* 2) x)) :lisp (double 5) /* 10 */ but I can't seem to translate it into Maximese: curry(f, [args]) := lambda([[x]], apply(f, append([args], x))); double(x) := curry("*", 2)(x); double(5); /* f(args, 5) */ Is there a closure issue; verb-noun conflation; or something else I've missed? From robert.dodier at gmail.com Mon Feb 18 20:13:30 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 18 Feb 2008 19:13:30 -0700 Subject: [Maxima] Curried Functions In-Reply-To: <20080219014625.GA29374@klutometis.wikitex.org> References: <20080219014625.GA29374@klutometis.wikitex.org> Message-ID: On 2/18/08, Peter Danenberg wrote: > curry(f, [args]) := lambda([[x]], apply(f, append([args], x))); lambda does not evaluate its arguments (does not even simplify them). One way to get what (I think) you want is to use buildq. curry(f, [args]) := buildq ([f, args], lambda([[x]], apply (f, append (args, x)))); dble : curry ("*", 2); => lambda([[x]],apply("*",append([2],x))) dble (5); => 10 buildq is reminiscent of `(,x , at y) macrology -- I think it even says so in the source code. HTH Robert Dodier From pcd at wikitex.org Mon Feb 18 20:43:08 2008 From: pcd at wikitex.org (Peter Danenberg) Date: Mon, 18 Feb 2008 20:43:08 -0600 Subject: [Maxima] Curried Functions In-Reply-To: References: <20080219014625.GA29374@klutometis.wikitex.org> Message-ID: <20080219024308.GA29883@klutometis.wikitex.org> > curry(f, [args]) := buildq ([f, args], lambda([[x]], apply (f, > append(args, x)))); Thanks for saving the day, Robert; I wonder if that wouldn't be an instructive example to add under the buildq docs. Does it matter, by the way, whether you use the macro operator, ::=? It seems to work both ways. From pcd at wikitex.org Mon Feb 18 22:29:20 2008 From: pcd at wikitex.org (Peter Danenberg) Date: Mon, 18 Feb 2008 22:29:20 -0600 Subject: [Maxima] Curried Functions In-Reply-To: References: <20080219014625.GA29374@klutometis.wikitex.org> Message-ID: <20080219042920.GA30517@klutometis.wikitex.org> Quoth Robert Dodier on Prickle-Prickle, Chaos 49, 3174: > One way to get what (I think) you want is to use buildq. I'm using curry, by the way, to study the growth of iterative functions (f*_c = min{x >= 0: f^(x)(n) <= c});* by fixing f and c while plotting x: curry(f, [args]) := buildq([f, args], lambda([[x]], apply(f, append(args, x)))); lg(x) := block([], log(x) / log(2))$ iterated(f, c, x) := block([], if x <= c then 0 else 1 + iterated(f, c, f(x)))$ fs: [lambda([x], x - 1), lambda([x], lg(x)), lambda([x], x / 2), lambda([x], x / 2), lambda([x], sqrt(x)), lambda([x], sqrt(x)), lambda([x], x^(1/3)), lambda([x], x/lg(x))]$ cs: [0, 1, 1, 2, 2, 1, 2, 2]$ curries: map(lambda([f, c], curry(iterated, f, c)), fs, cs)$ plot2d(curries, [x, 0, 2^6], [y, 0, 2^6], [gnuplot_term, X11])$ I'm not sure if some native Maxima facility would accomplish the same thing. ----------- * Cormen et al., Algorithms (2004), 60. From takhurst at sun.ac.za Tue Feb 19 06:17:59 2008 From: takhurst at sun.ac.za (Tim Akhurst) Date: Tue, 19 Feb 2008 14:17:59 +0200 Subject: [Maxima] stringout error for large expressions Message-ID: <47BAC8F7.4090907@sun.ac.za> Hi all, I am trying to write the expanded form of a matrix determinant to file. I have successfully done this for a number of matrices, however I am encountering 'stringout errors' with certain matrices. The following matrix creates the error: E:matrix([1,0,-ecvATPase_Pc,0,0,0,0,0,0,0,0,0,0,0], [0,1,0,-ecvGlyK_Pg,-ecvGlyK_Glc6P,-ecvGlyK_Fru6P,-ecvGlyK_Fru16BP,0,-ecvGlyK_GAP,0,-ecvGlyK_DHAP,-ecvGlyK_BPGA13,0,0], [1.0,0,-ecvPK_Pc,0,0,0,0,0,0,0,0,0,-ecvPK_Pyr,-ecvPK_Nb], [JvATPase/(2*JvHK),JvGlyK/(2*JvHK),0,-ecvHK_Pg,-ecvHK_Glc6P,0,0,-ecvHK_GlcI,0,0,0,0,0,0], [JvATPase/(2*JvHK),JvGlyK/(2*JvHK),0,0,-ecvPGI_Glc6P,-ecvPGI_Fru6P,0,0,0,0,0,0,0,0], [JvATPase/(2*JvHK),JvGlyK/(2*JvHK),0,-ecvPFK_Pg,0,-ecvPFK_Fru6P,-ecvPFK_Fru16BP,0,0,0,0,0,0,0], [JvATPase/(2*JvHK),JvGlyK/(2*JvHK),0,-ecvALD_Pg,-ecvALD_Glc6P,-ecvALD_Fru6P,-ecvALD_Fru16BP,0,-ecvALD_GAP,0,-ecvALD_DHAP,-ecvALD_BPGA13,0,0], [JvATPase/(2*JvHK),JvGlyK/(2*JvHK),0,0,0,0,0,-ecvGlcTr_GlcI,0,0,0,0,0,0], [1.0,0,0,0,0,0,0,0,-ecvGAPdh_GAP,ecvGAPdh_NADH*NAD/NADH-ecvGAPdh_NAD,0,-ecvGAPdh_BPGA13,0,0], [1.0,0,0,-ecvGDH_Pg,-ecvGDH_Glc6P,-ecvGDH_Fru6P,-ecvGDH_Fru16BP,0,-ecvGDH_GAP,ecvGDH_NADH*NAD/NADH-ecvGDH_NAD,-ecvGDH_DHAP,-ecvGDH_BPGA13,0,0], [JvATPase/JvGPO,-JvGlyK/JvGPO,0,-ecvGPO_Pg,-ecvGPO_Glc6P,-ecvGPO_Fru6P,-ecvGPO_Fru16BP,0,-ecvGPO_GAP,0,-ecvGPO_DHAP,-ecvGPO_BPGA13,0,0], [1.0,0,0,0,0,0,0,0,0,0,0,0,-ecvPyrTr_Pyr,0], [1.0,0,0,-ecvPGK_Pg,0,0,0,0,0,0,0,-ecvPGK_BPGA13,0,-ecvPGK_Nb], [JvATPase/(2*JvTPI),-JvGlyK/(2*JvTPI),0,-ecvTPI_Pg,-ecvTPI_Glc6P,-ecvTPI_Fru6P,-ecvTPI_Fru16BP,0,-ecvTPI_GAP,0,-ecvTPI_DHAP,-ecvTPI_BPGA13,0,0]); I extract the determinant as folows: den:determinant(E)$ den:expand(den)$ stringout(outfile,den); To which I get the following error message: Error in `stringout' attempt -- an error. To debug this try debugmode(true); Is there a workaround for this, or an alternative to write data for really large expressions to a file. Thanks, Tim From raymond.toy at ericsson.com Tue Feb 19 08:48:48 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 19 Feb 2008 09:48:48 -0500 Subject: [Maxima] stringout error for large expressions In-Reply-To: <47BAC8F7.4090907@sun.ac.za> References: <47BAC8F7.4090907@sun.ac.za> Message-ID: <47BAEC50.6000106@ericsson.com> Tim Akhurst wrote: > Hi all, [snip] > > I extract the determinant as folows: > > den:determinant(E)$ > den:expand(den)$ > stringout(outfile,den); > > To which I get the following error message: > > Error in `stringout' attempt -- an error. To debug this try > debugmode(true); > I didn't have any problem with this with cmucl and CVS maxima. The output file is 6.6 MB. But I think a significant amount of memory is needed to do this. What platform are you using? You might be able to get some additional information by starting maxima with the -g option to get the lisp debugger. This might provide information on what the problem is. Ray From raymond.toy at ericsson.com Tue Feb 19 11:49:33 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 19 Feb 2008 12:49:33 -0500 Subject: [Maxima] [Maxima-commits] CVS: maxima/src specfn.lisp, 1.21, 1.22 In-Reply-To: References: Message-ID: <47BB16AD.5020204@ericsson.com> Barton Willis wrote: > Update of /cvsroot/maxima/maxima/src > In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21460/src > > Modified Files: > specfn.lisp > Log Message: > o Declare lambertw to be complex so that imagpart(lambertw(x + %i)) --/--> 0. > o Add gradef for lambertw. > > Index: specfn.lisp > =================================================================== > RCS file: /cvsroot/maxima/maxima/src/specfn.lisp,v > retrieving revision 1.21 > retrieving revision 1.22 > diff -u -d -r1.21 -r1.22 > --- specfn.lisp 19 Feb 2008 00:13:04 -0000 1.21 > +++ specfn.lisp 19 Feb 2008 03:07:06 -0000 1.22 > @@ -424,6 +424,11 @@ > > ;;; Lambert W > > +(setf (get '$lambertw 'grad) > + '((x) ((mtimes) ((mexpt) x -1) (($lambertw) x) ((mexpt) ((mplus) 1 (($lambertw) x)) -1)))) > + > +(mfuncall '$declare '$lambertw '$complex) Am I doing something wrong? I'm unable to compile maxima because of the mfuncall above. Removing it allows me to compile. Ray From robert.dodier at gmail.com Tue Feb 19 12:12:06 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 19 Feb 2008 11:12:06 -0700 Subject: [Maxima] Improved min/max; LambertW In-Reply-To: <8b356f880802181635l227c55f5j15670019b5de37b9@mail.gmail.com> References: <8b356f880802181635l227c55f5j15670019b5de37b9@mail.gmail.com> Message-ID: On Feb 18, 2008 5:35 PM, Stavros Macrakis wrote: > I also checked in a very simple LambertW simplifier, using the name > lambertw(...). The idea is to add it to solve sometime, but it would be nice > if we could also add some numerical evaluation routines for it.... That sounds like a great addition. The only comment I have is that I think a better name is lambert_w since most or all other functions which are named after someone or something are named like bessel_j or airy_ai or legendre_p, etc. FWIW Robert From raymond.toy at ericsson.com Tue Feb 19 12:25:18 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 19 Feb 2008 13:25:18 -0500 Subject: [Maxima] Improved min/max; LambertW In-Reply-To: <8b356f880802181635l227c55f5j15670019b5de37b9@mail.gmail.com> References: <8b356f880802181635l227c55f5j15670019b5de37b9@mail.gmail.com> Message-ID: <47BB1F0E.1050906@ericsson.com> Stavros Macrakis wrote: > I've checked in some code that improves Maxima's handling of > sign(min/max(...)), sign(min/max(...)-min/max(...)). This isn't > complete, but I thought I'd start with the simple cases. This already > improves simplification of min/max . I'll have to write some test cases.... > > I also checked in a very simple LambertW simplifier, using the name > lambertw(...). The idea is to add it to solve sometime, but it would be > nice if we could also add some numerical evaluation routines for it.... > > -s Here's some simple code to numerically evaluation Lambert W. Wikipedia also lists W(-log(2)/2) = -log(2) W(-1/e) = -1 W(e) = 1 which we should probably also add. Ray ;; Initial approximation for Lambert W. ;; http://www.desy.de/~t00fri/qcdins/texhtml/lambertw/ (defun init-lambert-w (x) (if (<= x 500) (let ((lx1 (log (1+ x)))) (+ (* .665 (+ 1 (* .0195 lx1)) lx1) .04)) (- (log (- x 4)) (* (- 1 (/ (log x))) (log (log x)))))) ;; Algorithm based in part on ;; http://en.wikipedia.org/wiki/Lambert's_W_function. This can also ;; be found in ;; http://www.apmaths.uwo.ca/~djeffrey/Offprints/W-adv-cm.pdf, which ;; says the iteration is just Halley's iteration applied to w*exp(w). (defun lambert-w (z &key (maxiter 100) (prec 1d-14)) (let ((w (init-lambert-w z))) (dotimes (k maxiter) (let* ((we (* w (exp w))) (w1e (* (1+ w) (exp w))) (delta (/ (- we z) (- w1e (/ (* (+ w 2) (- we z)) (+ 2 (* 2 w))))))) (when (<= (abs (/ delta w)) prec) (return w)) (decf w delta))) w)) From robert.dodier at gmail.com Tue Feb 19 12:28:23 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 19 Feb 2008 11:28:23 -0700 Subject: [Maxima] How to define a New Maxima Function In-Reply-To: <47BAD5D3.5020800@gmx.at> References: <47B59011.1090804@gmx.at> <47B976E6.9060208@gmx.at> <47BAD5D3.5020800@gmx.at> Message-ID: On Feb 19, 2008 6:12 AM, Alexander Ray wrote: > just in order to understand the logic: what happens in the following naive > example? > > integrate(unit_step(x-a), x, 0, 1) should give us: > min(1, max(1-a, 0)) I dunno. What happens? > which would mean: > diff(integrate(unit_step(x-a), x, 0, 1), a) should give us: > -a, if a in ]0,1[ > and 0 if a is elsewhere except {0,1}. > > do we achieve this within the rules approach? I wouldn't expect it; I don't think diff knows what to do with min and max, and the integrate rule I posted knows only about products like f(x)*unit_step(h(x)) and not unit_step by itself (since a rule is associated with the so-called main operator, which is different in those 2 cases). In summary I think it's fair to say additional rules are needed. Maybe one way to go about this is to enumerate, in non-Maxima form, the rules which are desired. Then we can figure out how to implement those in Maxima. best Robert Dodier From willisb at unk.edu Tue Feb 19 12:31:54 2008 From: willisb at unk.edu (Barton Willis) Date: Tue, 19 Feb 2008 12:31:54 -0600 Subject: [Maxima] [Maxima-commits] CVS: maxima/src specfn.lisp, 1.21, 1.22 In-Reply-To: <47BB16AD.5020204@ericsson.com> Message-ID: No, you didn't do anything wrong. For now, I deleted (mfuncall '$declare '$lambertw '$complex) and added a comment that we need to do this somewhere. Right now, I can't think of how to do this correctly. My apologies --- I did load & testsuite, not make & testsuite. Barton maxima-bounces at math.utexas.edu wrote on 02/19/2008 11:49:33 AM: > Barton Willis wrote: > > Update of /cvsroot/maxima/maxima/src > > In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21460/src > > > > Modified Files: > > specfn.lisp > > Log Message: > > o Declare lambertw to be complex so that imagpart(lambertw(x + % > i)) --/--> 0. > > o Add gradef for lambertw. > > > > Index: specfn.lisp > > =================================================================== > > RCS file: /cvsroot/maxima/maxima/src/specfn.lisp,v > > retrieving revision 1.21 > > retrieving revision 1.22 > > diff -u -d -r1.21 -r1.22 > > --- specfn.lisp 19 Feb 2008 00:13:04 -0000 1.21 > > +++ specfn.lisp 19 Feb 2008 03:07:06 -0000 1.22 > > @@ -424,6 +424,11 @@ > > > > ;;; Lambert W > > > > +(setf (get '$lambertw 'grad) > > + '((x) ((mtimes) ((mexpt) x -1) (($lambertw) x) ((mexpt) > ((mplus) 1 (($lambertw) x)) -1)))) > > + > > +(mfuncall '$declare '$lambertw '$complex) > > Am I doing something wrong? I'm unable to compile maxima because of the > mfuncall above. Removing it allows me to compile. > > Ray > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Tue Feb 19 12:37:51 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 19 Feb 2008 11:37:51 -0700 Subject: [Maxima] [Maxima-commits] CVS: maxima/src specfn.lisp, 1.21, 1.22 In-Reply-To: References: <47BB16AD.5020204@ericsson.com> Message-ID: On Feb 19, 2008 11:31 AM, Barton Willis wrote: > No, you didn't do anything wrong. For now, I deleted (mfuncall '$declare > '$lambertw '$complex) > and added a comment that we need to do this somewhere. Right now, I can't > think of how to do this correctly. How about if it goes into src/init-cl.lisp. That file is loaded (not compiled) at the tail end of maxima.system. Maybe by then, MFUNCALL is defined. best Robert From raymond.toy at ericsson.com Tue Feb 19 12:42:08 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 19 Feb 2008 13:42:08 -0500 Subject: [Maxima] [Maxima-commits] CVS: maxima/src specfn.lisp, 1.21, 1.22 In-Reply-To: References: <47BB16AD.5020204@ericsson.com> Message-ID: <47BB2300.5060802@ericsson.com> Robert Dodier wrote: > On Feb 19, 2008 11:31 AM, Barton Willis wrote: > >> No, you didn't do anything wrong. For now, I deleted (mfuncall '$declare >> '$lambertw '$complex) >> and added a comment that we need to do this somewhere. Right now, I can't >> think of how to do this correctly. > > How about if it goes into src/init-cl.lisp. That file is loaded (not compiled) > at the tail end of maxima.system. Maybe by then, MFUNCALL is defined. Oops. I should have mentioned that the error is the OPERS is not defined. Or something like that. I forget. Sorry about that. Ray From willisb at unk.edu Tue Feb 19 13:13:36 2008 From: willisb at unk.edu (Barton Willis) Date: Tue, 19 Feb 2008 13:13:36 -0600 Subject: [Maxima] [Maxima-commits] CVS: maxima/src specfn.lisp, 1.21, 1.22 In-Reply-To: <47BB2300.5060802@ericsson.com> Message-ID: Compar.lisp declares $li and %cabs to be complex. I'll place (kind $lambertw $complex) here. I don't know why %cabs is declared complex. Barton maxima-bounces at math.utexas.edu wrote on 02/19/2008 12:42:08 PM: > Robert Dodier wrote: > > On Feb 19, 2008 11:31 AM, Barton Willis wrote: > > > >> No, you didn't do anything wrong. For now, I deleted (mfuncall '$declare > >> '$lambertw '$complex) > >> and added a comment that we need to do this somewhere. Right now, I can't > >> think of how to do this correctly. > > > > How about if it goes into src/init-cl.lisp. That file is loaded > (not compiled) > > at the tail end of maxima.system. Maybe by then, MFUNCALL is defined. > > Oops. I should have mentioned that the error is the OPERS is not > defined. Or something like that. I forget. Sorry about that. > > Ray > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Tue Feb 19 13:13:45 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 19 Feb 2008 14:13:45 -0500 Subject: [Maxima] Improved min/max; LambertW In-Reply-To: References: <8b356f880802181635l227c55f5j15670019b5de37b9@mail.gmail.com> Message-ID: <8b356f880802191113l4f91ef3ag81bc5e262ed038a3@mail.gmail.com> On Feb 19, 2008 1:12 PM, Robert Dodier wrote: > On Feb 18, 2008 5:35 PM, Stavros Macrakis wrote: > > I also checked in a very simple LambertW simplifier, using the name > > lambertw(...). > > > That sounds like a great addition. The only comment I have is that > I think a better name is lambert_w since most or all other functions > which are named after someone or something are named like > bessel_j or airy_ai or legendre_p, etc. > Agreed, let's make it lambert_w. Since others are working on this code now, I'll leave it to them to change. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080219/5cccce67/attachment.htm From willisb at unk.edu Tue Feb 19 14:19:20 2008 From: willisb at unk.edu (Barton Willis) Date: Tue, 19 Feb 2008 14:19:20 -0600 Subject: [Maxima] Improved min/max; LambertW In-Reply-To: <8b356f880802191113l4f91ef3ag81bc5e262ed038a3@mail.gmail.com> Message-ID: > Agreed, let's make it lambert_w. Since others are working on this > code now, I'll leave it to them to change. Done -- also declared lambert_w to be complex (in compar.lisp). But I wouldn't say that on working on this code now :) Barton From frohro at wallawalla.edu Tue Feb 19 17:56:56 2008 From: frohro at wallawalla.edu (Rob Frohne) Date: Tue, 19 Feb 2008 15:56:56 -0800 Subject: [Maxima] Documentation Bug in eigenvectors()? Message-ID: <1203465416.24625.5.camel@frohro-d600.wwc.edu> Hi, The documentation claims that the eigenvectors returned are unit eigenvectors (which seems to me that they should be unit length), but the first entry is 1, and the others aren't zero on the matrix I tried. Here is my output. (%i1) matrix( [25,7], [7,-25] ); (%o1) matrix([25,7],[7,-25]) (%i2) eigenvectors(%); (%o2) [[[-sqrt(674),sqrt(674)],[1,1]],[1,-(sqrt(674)+25)/7],[1,(sqrt(674)-25)/7]] (%i3) Is this a bug? Best regards, Rob -- Rob Frohne Walla Walla University From willisb at unk.edu Tue Feb 19 18:43:42 2008 From: willisb at unk.edu (Barton Willis) Date: Tue, 19 Feb 2008 18:43:42 -0600 Subject: [Maxima] Documentation Bug in eigenvectors()? In-Reply-To: <1203465416.24625.5.camel@frohro-d600.wwc.edu> References: <1203465416.24625.5.camel@frohro-d600.wwc.edu> Message-ID: Our documentation says: "The calculated eigenvectors and the unit eigenvectors of the matrix are the right eigenvectors and the right unit eigenvectors respectively" It takes the will to read right out of me -- I don't think this quote says that all the calculated eigenvectors are unit vectors, does it? Shameless plug --- my favorite way to find eigenvectors: (%i48) algebraic : true$ (%i49) m : matrix([25,7],[7,-25]); (%o49) matrix([25,7],[7,-25]) (%i50) mm : ptriangularize(m - z * identfor(m),z); (%o50) matrix([7,-z-25],[0,674/7-z^2/7]) Use tellrat to declare 674/7-z^2/7 --> 0 (%i51) tellrat(mm[2,2]); (%o51) [z^2-674] Find the eigenpace: (%i52) nullspace(mm); (%o52) span(matrix([z+25],[7])) Let's check: (%i53) ratsimp(mm . first(%)); (%o53) matrix([0],[0]) One more: (%i54) untellrat(z); (%o54) [] (%i55) m : matrix([1,2,3],[4,5,6],[7,8,9])$ (%i56) mm : ptriangularize(m - z * identfor(m),z); (%o56) matrix([4,5-z,6],[0,66 /49,-z^2/7+(102*z)/49+132/49],[0,0,(49*z^3)/264-(245*z^2)/88-(147*z)/44]) (%i57) tellrat(%[3,3])$ (%i58) nullspace(mm); (%o58) span(matrix([-1568*z^2+24696*z+12936],[1372*z^2-19992*z-25872],[12936])) Again, let's check: (%i59) ratsimp(mm . first(%)); (%o59) matrix([0],[0],[0]) Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To: Maxima List >From: Rob Frohne >Sent by: maxima-bounces at math.utexas.edu >Date: 02/19/2008 05:56PM >Subject: [Maxima] Documentation Bug in eigenvectors()? > >Hi, > >The documentation claims that the eigenvectors returned are unit >eigenvectors (which seems to me that they should be unit length), but >the first entry is 1, and the others aren't zero on the matrix I tried. >Here is my output. > >(%i1) matrix( > [25,7], > [7,-25] >); >(%o1) matrix([25,7],[7,-25]) >(%i2) eigenvectors(%); >(%o2) >[[[-sqrt(674),sqrt(674)],[1,1]],[1,-(sqrt(674)+25)/7],[1,(sqrt(674)-25)/7] >] >(%i3) > >Is this a bug? > >Best regards, > >Rob >-- >Rob Frohne >Walla Walla University >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Tue Feb 19 21:13:08 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 19 Feb 2008 20:13:08 -0700 Subject: [Maxima] Documentation Bug in eigenvectors()? In-Reply-To: References: <1203465416.24625.5.camel@frohro-d600.wwc.edu> Message-ID: On 2/19/08, Barton Willis wrote: > "The calculated eigenvectors and the unit eigenvectors of the matrix are > the right eigenvectors and the right unit eigenvectors respectively" > > It takes the will to read right out of me -- I don't think this quote > says that all the calculated eigenvectors are unit vectors, does it? You can blame that delightful aphorism on me ... apparently I was a bit befuddled at the time. I'll try to make it clearer, or maybe just erase it. As it happens, there is a separate function to compute unit eigenvectors, named uniteigenvectors. > Shameless plug --- my favorite way to find eigenvectors: If you want to replace the existing eigenvectors function, please go right ahead. best Robert From robert.dodier at gmail.com Tue Feb 19 22:18:38 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 19 Feb 2008 21:18:38 -0700 Subject: [Maxima] stringout error for large expressions In-Reply-To: <47BAC8F7.4090907@sun.ac.za> References: <47BAC8F7.4090907@sun.ac.za> Message-ID: On 2/19/08, Tim Akhurst wrote: > I am trying to write the expanded form of a matrix determinant to file. > I have successfully done this for a number of matrices, however I am > encountering 'stringout errors' with certain matrices. Try stringout ("foo.out", whatever), grind=true; which will output whatever in a somewhat more aesthetic fashion, but the main point is that it goes down a different path than with grind=false (the default). Or try save ("foo.out", whatever); which saves whatever as a Lisp expression. If you have time, please enter a bug report. Follow "Submit new" at: http://sourceforge.net/tracker/?atid=104933&group_id=4933&func=browse best Robert Dodier From robert.dodier at gmail.com Tue Feb 19 22:29:13 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 19 Feb 2008 21:29:13 -0700 Subject: [Maxima] Curried Functions In-Reply-To: <20080219024308.GA29883@klutometis.wikitex.org> References: <20080219014625.GA29374@klutometis.wikitex.org> <20080219024308.GA29883@klutometis.wikitex.org> Message-ID: On 2/18/08, Peter Danenberg wrote: > Does it matter, by the way, whether you use the macro operator, ::=? > It seems to work both ways. Well, if it were written as a macro, the arguments would be quoted. As a function: curry(f, [args]) := buildq ([f, args], lambda([[x]], apply (f, append(args, x)))); foo : 1234; curry ("*", foo); => lambda([[x]], apply(*, append([1234], x))) As a macro: curry(f, [args]) ::= buildq ([f, args], lambda([[x]], apply (f, append(args, x)))); foo : 1234; curry ("*", foo); => lambda([[x]], apply(*, append([foo], x))) Which one to choose depends on what you're aiming for ... best Robert Dodier From riccio at gmx.at Tue Feb 19 07:12:51 2008 From: riccio at gmx.at (Alexander Ray) Date: Tue, 19 Feb 2008 14:12:51 +0100 Subject: [Maxima] How to define a New Maxima Function In-Reply-To: References: <47B59011.1090804@gmx.at> <47B976E6.9060208@gmx.at> Message-ID: <47BAD5D3.5020800@gmx.at> hello, robert! just in order to understand the logic: what happens in the following naive example? integrate(unit_step(x-a), x, 0, 1) should give us: min(1, max(1-a, 0)) which would mean: diff(integrate(unit_step(x-a), x, 0, 1), a) should give us: -a, if a in ]0,1[ and 0 if a is elsewhere except {0,1}. do we achieve this within the rules approach? regards alex > > >> in fact, that was our first try to use unit_step. >> unfortunately, we have next to integrate the function. and >> integrate(f(x)) does not really work nice if f(x) contains unit_step. >> > > Here is an initial attempt at a pattern-matching rule which tells > integrate how to handle unit_step. I've omitted various details, > which we can fill in if it seems worth pursuing. > > matchdeclare (uu, lambda ([ee], not atom(ee) and op(ee) = unit_step), > vv, lambda ([ee], atom(ee) or op(ee) # unit_step)); > matchdeclare ([aa, bb], all, xx, mapatom); > > simp : false; > 'integrate (uu*vv, xx, aa, bb); > defrule (r1, ''%, FOO (uu, vv, xx, aa, bb)); > simp : true; > > FOO (u, v, x, a, b) := (FOO1 (u, x), > if %% < a then integrate (v, x, a, b) elseif %% < b > then integrate (v, x, %%, b) else 0); > > FOO1 (u, x) := (if op(u) = unit_step then args(u) > else apply (append, maplist (args, u)), > map (lambda ([e], solve(e = 0, x)), %%), > apply (append, %%), > map (rhs, %%), > apply (max, %%)); > > Here is a result which makes use of that rule r1. > > integrate (f(x)*g(x)*unit_step(x-5), x, a, b); > apply1 (%, r1); > => if 5 < a then integrate(f(x)*g(x),x,a,b) elseif 5 < b > then integrate(f(x)*g(x),x,5,b) else 0 > ''%, a=3, b=12; > => 'integrate(f(x)*g(x),x,5,12) > > Maybe that is enough to get started. I would be interested to hear > more about the problem you are working on. > > >> we try to to calculate a price of a generic plain-vanilla financial >> option, that is nothing else but integrate(f(x,a,b,c,...),x,minf,inf). >> where f(x) typically is piecewise-continuous/differentiable but may >> depend on parameters a,b,c,... in quite a tricky unpredictable manner >> (you have to solve an implicit equation first in order to define the >> integral). >> > > I see a lot of potential uses for Maxima in mixed symbolic and > numerical problems. I would really like to see Maxima become > the tool of choice for such problems. Towards that end, > strengthening Maxima's treatment of functions defined piecewise > is a good strategy. > > best > > Robert Dodier > > From dotancohen at gmail.com Wed Feb 20 03:01:17 2008 From: dotancohen at gmail.com (Dotan Cohen) Date: Wed, 20 Feb 2008 11:01:17 +0200 Subject: [Maxima] New user: where to start? Message-ID: <880dece00802200101y2bb1b020sfe50163d853d339f@mail.gmail.com> I am a new Maxima user, and I am having a very hard time finding complete newbie information. Everything that I've found assumes that one is either computer programmer or familiar with Mathematica. Are there any dead-newbie level resources for learning to use Maxima? In general, I'd like to solve matrices, polynomials, and graph calculus functions with one and two variables. Thanks in advance. Dotan Cohen http://what-is-what.com http://gibberish.co.il ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? From willisb at unk.edu Wed Feb 20 05:46:47 2008 From: willisb at unk.edu (Barton Willis) Date: Wed, 20 Feb 2008 05:46:47 -0600 Subject: [Maxima] Documentation Bug in eigenvectors()? In-Reply-To: References: <1203465416.24625.5.camel@frohro-d600.wwc.edu> , Message-ID: -----"Robert Dodier" wrote: ----- >If you want to replace the existing eigenvectors function, >please go right ahead. My method should work for matrices with rational entries. For anything else, it will fail. Also, I think tellrat has some limitations. So the method might be cute, but it's not a general solution. Barton From maxima-list at ssteiner.com Wed Feb 20 15:32:55 2008 From: maxima-list at ssteiner.com (maxima-list at ssteiner.com) Date: Wed, 20 Feb 2008 22:32:55 +0100 (MET) Subject: [Maxima] solve(...) and unnecessary complex results Message-ID: <200802202132.m1KLWtPr020445@post.webmailer.de> Dear Maxima experts, If I make Maxima solve the following example equation it returns results which contain complex parts (%i) but I think the results should be "normal" real numbers. Example: solve( (0=x^3-4*x+2), x ); Maxima returns: [x = (-sqrt(3)*%i/2-1/2)*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)+4*(sqrt(3)*%i/2-\ 1/2)/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)),x = (sqrt(3)*%i/2-1/2)*(3^-(3/2)*sqrt(\ 37)*%i-1)^(1/3)+4*(-sqrt(3)*%i/2-1/2)/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)),x = (\ 3^-(3/2)*sqrt(37)*%i-1)^(1/3)+4/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3))] I think the correct results are -2,214; 0,539; 1,675 How to make Maxima return these results (real numbers) instead of complicated terms containing complex numbers? Thank you! Sebastian From ronis at ronispc.chem.mcgill.ca Wed Feb 20 15:44:44 2008 From: ronis at ronispc.chem.mcgill.ca (David Ronis) Date: Wed, 20 Feb 2008 16:44:44 -0500 Subject: [Maxima] Trivial question Message-ID: <1203543884.15580.13.camel@ronispc.chem.mcgill.ca> Sorry to bother you with this as I'm sure the answer should be trivial; the first part of the following doesn't work as expected: f(l,m):=A[l,m]+B[l,m]+A[l+1,m]; ev(f(l,m), A[l,m]=0); A[l,m] still appears in the result. However, f(l,m); ev(%, A[l,m]=0 ); works as expected. What am I missing? David From raymond.toy at ericsson.com Wed Feb 20 15:54:31 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Wed, 20 Feb 2008 16:54:31 -0500 Subject: [Maxima] solve(...) and unnecessary complex results In-Reply-To: <200802202132.m1KLWtPr020445@post.webmailer.de> References: <200802202132.m1KLWtPr020445@post.webmailer.de> Message-ID: <47BCA197.5090309@ericsson.com> maxima-list at ssteiner.com wrote: > Dear Maxima experts, > > If I make Maxima solve the following example equation it returns results which contain complex parts (%i) but I think the results should be "normal" real numbers. > > Example: solve( (0=x^3-4*x+2), x ); > > Maxima returns: > [x = (-sqrt(3)*%i/2-1/2)*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)+4*(sqrt(3)*%i/2-\ > 1/2)/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)),x = (sqrt(3)*%i/2-1/2)*(3^-(3/2)*sqrt(\ > 37)*%i-1)^(1/3)+4*(-sqrt(3)*%i/2-1/2)/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)),x = (\ > 3^-(3/2)*sqrt(37)*%i-1)^(1/3)+4/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3))] > > I think the correct results are -2,214; 0,539; 1,675 > How to make Maxima return these results (real numbers) instead of complicated terms containing complex numbers? > How about this: solve(x^3-4*x+2,x)$ rectform(%)$ trigsimp(%); [x = -(2*sqrt(3)*sin((atan(sqrt(37)/(3*sqrt(3)))-%pi)/3) +2*cos((atan(sqrt(37)/(3*sqrt(3)))-%pi)/3)) /sqrt(3), x = (2*sqrt(3)*sin((atan(sqrt(37)/(3*sqrt(3)))-%pi)/3) -2*cos((atan(sqrt(37)/(3*sqrt(3)))-%pi)/3)) /sqrt(3),x = 4*cos((atan(sqrt(37)/(3*sqrt(3)))-%pi)/3)/sqrt(3)] All the numbers are real now, but there are trig functions. I think that's unavoidable. Ray From David.Billinghurst at riotinto.com Wed Feb 20 16:10:22 2008 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Thu, 21 Feb 2008 09:10:22 +1100 Subject: [Maxima] solve(...) and unnecessary complex results References: <200802202132.m1KLWtPr020445@post.webmailer.de> Message-ID: <026DCC31AB859648A6F16C0E5CD2580D01318759@calttsv025.cal.riotinto.org> > Dear Maxima experts, > > If I make Maxima solve the following example equation it returns results > which contain complex parts (%i) but I think the results should be > "normal" real numbers. > > Example: solve( (0=x^3-4*x+2), x ); > > Maxima returns: > [x = (-sqrt(3)*%i/2-1/2)*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)+4*(sqrt(3)*%i/2-\ > 1/2)/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)),x = (sqrt(3)*%i/2-1/2)*(3^- > (3/2)*sqrt(\ > 37)*%i-1)^(1/3)+4*(-sqrt(3)*%i/2-1/2)/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)) ,x > = (\ > 3^-(3/2)*sqrt(37)*%i-1)^(1/3)+4/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3))] > > I think the correct results are -2,214; 0,539; 1,675 > How to make Maxima return these results (real numbers) instead of > complicated terms containing complex numbers? > > Thank you! > Sebastian It is not always possible to express the solutions of a cubic equation with three real roots in terms of radicals using just real numbers. For more information, Google for "casus irreducibilis". David NOTICE This e-mail and any attachments are private and confidential and may contain privileged information. If you are not an authorised recipient, the copying or distribution of this e-mail and any attachments is prohibited and you must not read, print or act in reliance on this e-mail or attachments. This notice should not be removed. From phhs80 at gmail.com Thu Feb 21 05:02:52 2008 From: phhs80 at gmail.com (Paul Smith) Date: Thu, 21 Feb 2008 11:02:52 +0000 Subject: [Maxima] solve(...) and unnecessary complex results In-Reply-To: <200802202132.m1KLWtPr020445@post.webmailer.de> References: <200802202132.m1KLWtPr020445@post.webmailer.de> Message-ID: <6ade6f6c0802210302r25b92b8esd62d1f05675ce9c2@mail.gmail.com> On Wed, Feb 20, 2008 at 9:32 PM, wrote: > Dear Maxima experts, > > If I make Maxima solve the following example equation it returns results which contain complex parts (%i) but I think the results should be "normal" real numbers. > > Example: solve( (0=x^3-4*x+2), x ); > > Maxima returns: > [x = (-sqrt(3)*%i/2-1/2)*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)+4*(sqrt(3)*%i/2-\ > 1/2)/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)),x = (sqrt(3)*%i/2-1/2)*(3^-(3/2)*sqrt(\ > 37)*%i-1)^(1/3)+4*(-sqrt(3)*%i/2-1/2)/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)),x = (\ > 3^-(3/2)*sqrt(37)*%i-1)^(1/3)+4/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3))] > > I think the correct results are -2,214; 0,539; 1,675 > How to make Maxima return these results (real numbers) instead of complicated terms containing complex numbers? You can also solve the problem numerically: 1. with plot2d identify small intervals containing the solutions; 2. use find_root to determine the numeric solutions. Paul From beroset at mindspring.com Thu Feb 21 05:50:27 2008 From: beroset at mindspring.com (Ed Beroset) Date: Thu, 21 Feb 2008 06:50:27 -0500 (GMT-05:00) Subject: [Maxima] solve(...) and unnecessary complex results Message-ID: <33321033.1203594627260.JavaMail.root@mswamui-andean.atl.sa.earthlink.net> Paul Smith wrote: >On Wed, Feb 20, 2008 at 9:32 PM, wrote: >> Example: solve( (0=x^3-4*x+2), x ); >> >> Maxima returns: >> [x = (-sqrt(3)*%i/2-1/2)*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)+4*(sqrt(3)*%i/2-\ >> 1/2)/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)),x = (sqrt(3)*%i/2-1/2)*(3^-(3/2)*sqrt(\ >> 37)*%i-1)^(1/3)+4*(-sqrt(3)*%i/2-1/2)/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)),x = (\ >> 3^-(3/2)*sqrt(37)*%i-1)^(1/3)+4/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3))] >> >> I think the correct results are -2,214; 0,539; 1,675 >> How to make Maxima return these results (real numbers) instead of complicated terms containing complex numbers? > >You can also solve the problem numerically: > >1. with plot2d identify small intervals containing the solutions; > >2. use find_root to determine the numeric solutions. That would certainly work, but if what's needed is only the real roots, I think the easier way to get that is to ask for them: realroots(x^3-4*x+2); Then it's easy, if desired, to turn those results from fractions into floating point numbers as: float(%); That yields [x=-2.214319705963135,x=0.53918886184692,x=1.675131320953369] which matches nicely with what the original poster wanted. Ed From macrakis at alum.mit.edu Thu Feb 21 06:04:19 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 21 Feb 2008 07:04:19 -0500 Subject: [Maxima] solve(...) and unnecessary complex results In-Reply-To: <6ade6f6c0802210302r25b92b8esd62d1f05675ce9c2@mail.gmail.com> References: <200802202132.m1KLWtPr020445@post.webmailer.de> <6ade6f6c0802210302r25b92b8esd62d1f05675ce9c2@mail.gmail.com> Message-ID: <8b356f880802210404i79d3f807q9ce2871170cd9273@mail.gmail.com> The realroots function will find all real roots numerically. Maxima is a symbolic math system, so normally performs exact symbolic calculations. -s On 2/21/08, Paul Smith wrote: > On Wed, Feb 20, 2008 at 9:32 PM, wrote: > > Dear Maxima experts, > > > > If I make Maxima solve the following example equation it returns results > which contain complex parts (%i) but I think the results should be "normal" > real numbers. > > > > Example: solve( (0=x^3-4*x+2), x ); > > > > Maxima returns: > > [x = (-sqrt(3)*%i/2-1/2)*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)+4*(sqrt(3)*%i/2-\ > > 1/2)/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)),x = > (sqrt(3)*%i/2-1/2)*(3^-(3/2)*sqrt(\ > > > 37)*%i-1)^(1/3)+4*(-sqrt(3)*%i/2-1/2)/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3)),x = > (\ > > 3^-(3/2)*sqrt(37)*%i-1)^(1/3)+4/(3*(3^-(3/2)*sqrt(37)*%i-1)^(1/3))] > > > > I think the correct results are -2,214; 0,539; 1,675 > > How to make Maxima return these results (real numbers) instead of > complicated terms containing complex numbers? > > You can also solve the problem numerically: > > 1. with plot2d identify small intervals containing the solutions; > > 2. use find_root to determine the numeric solutions. > > Paul > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -- Sent from Gmail for mobile | mobile.google.com From robert.dodier at gmail.com Thu Feb 21 09:01:07 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 21 Feb 2008 08:01:07 -0700 Subject: [Maxima] Trivial question In-Reply-To: <1203543884.15580.13.camel@ronispc.chem.mcgill.ca> References: <1203543884.15580.13.camel@ronispc.chem.mcgill.ca> Message-ID: On 2/20/08, David Ronis wrote: > f(l,m):=A[l,m]+B[l,m]+A[l+1,m]; > ev(f(l,m), A[l,m]=0); > > A[l,m] still appears in the result. > > However, > > f(l,m); > ev(%, A[l,m]=0 ); > > works as expected. What am I missing? Well, the mechanism for saving and restoring local variables handles only simple variables (not subscripted variables). ev substitutes for subscripted variables instead. But substitution doesn't have quite the same effect, as you have observed. See $EV in src/mlisp.lisp. This is a bug; I guess it could be fixed by making MBIND and friends happy with subscripted variables. Dunno if that would cause trouble elsewhere. If you have time, perhaps you can submit a bug report about this. best Robert Dodier From adammaj1 at o2.pl Thu Feb 21 09:58:53 2008 From: adammaj1 at o2.pl (Adam Majewski) Date: Thu, 21 Feb 2008 16:58:53 +0100 Subject: [Maxima] New user: where to start? In-Reply-To: <880dece00802200101y2bb1b020sfe50163d853d339f@mail.gmail.com> References: <880dece00802200101y2bb1b020sfe50163d853d339f@mail.gmail.com> Message-ID: Dotan Cohen pisze: > I am a new Maxima user, and I am having a very hard time finding > complete newbie information. Everything that I've found assumes that > one is either computer programmer or familiar with Mathematica. Are > there any dead-newbie level resources for learning to use Maxima? In > general, I'd like to solve matrices, polynomials, and graph calculus > functions with one and two variables. Thanks in advance. > > Dotan Cohen > > http://what-is-what.com > http://gibberish.co.il > ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-? > > A: Because it messes up the order in which people normally read text. > Q: Why is top-posting such a bad thing? > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima http://en.wikipedia.org/wiki/GNU_Maxima From macrakis at alum.mit.edu Thu Feb 21 12:29:05 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 21 Feb 2008 13:29:05 -0500 Subject: [Maxima] New user: where to start? In-Reply-To: References: <880dece00802200101y2bb1b020sfe50163d853d339f@mail.gmail.com> Message-ID: <8b356f880802211029t23e83f1cj7b7c0349961ad8ba@mail.gmail.com> > > http://en.wikipedia.org/wiki/GNU_Maxima > By the way, please note that Maxima is *not* a GNU project (though it is released under GPL), and so should not be referred to as "GNU Maxima". The link above works for convenience (it is a redirect); another redirect (which I just created) is http://en.wikipedia.org/wiki/Maxima_CAS -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080221/b75aaedd/attachment.htm From george.leeman at sbcglobal.net Thu Feb 21 12:32:22 2008 From: george.leeman at sbcglobal.net (George Leeman) Date: Thu, 21 Feb 2008 13:32:22 -0500 Subject: [Maxima] New user: where to start? Message-ID: <001401c874b8$19b117e0$6401a8c0@Dimension8400> Hi Dotan, Based on what I have seen, Adam Majewski's suggested URL http://en.wikipedia.org/wiki/GNU_Maxima is an excellent place to start. Another manual which I have found useful is at http://www.math.psu.edu/glasner/Max_doc/macref.pdf, and there is also an online reference manual at http://www.delorie.com/gnu/docs/maxima/maxima_toc.html. I and perhaps many others like to learn by example. A nice feature in Maxima is 'example'. If you say 'example(matrices);', you will get several examples to show how matrices are manipulated. Saying just 'example();' tells you what keywords the example function allows. George Leeman -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Dotan Cohen Sent: Wednesday, February 20, 2008 4:01 AM To: maxima at math.utexas.edu Subject: [Maxima] New user: where to start? I am a new Maxima user, and I am having a very hard time finding complete newbie information. Everything that I've found assumes that one is either computer programmer or familiar with Mathematica. Are there any dead-newbie level resources for learning to use Maxima? In general, I'd like to solve matrices, polynomials, and graph calculus functions with one and two variables. Thanks in advance. Dotan Cohen From herczegh at earthlink.net Thu Feb 21 14:19:54 2008 From: herczegh at earthlink.net (herczegh at earthlink.net) Date: Thu, 21 Feb 2008 14:19:54 -0600 Subject: [Maxima] solve(...) and unnecessary complex results Message-ID: <380-220082421201954763@earthlink.net> Hello folks: Concerning the roots of x^3-4*x+2 you can show that the complex roots are equal to the real roots by simplifying the list of complex roots with the command polarform(). polarform() prompts: Is x positive, negative, or zero? reply 0 You can apply polarform() to the list of roots returned by solve(). David Billinghurst thanks for the reference to casus irreducibilis, I did not know that Rober From robert.dodier at gmail.com Thu Feb 21 15:45:17 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 21 Feb 2008 14:45:17 -0700 Subject: [Maxima] New user: where to start? In-Reply-To: <001401c874b8$19b117e0$6401a8c0@Dimension8400> References: <001401c874b8$19b117e0$6401a8c0@Dimension8400> Message-ID: On Thu, Feb 21, 2008 at 11:32 AM, George Leeman wrote: > http://www.math.psu.edu/glasner/Max_doc/macref.pdf, and there is also an > online reference manual at > http://www.delorie.com/gnu/docs/maxima/maxima_toc.html. Unfortunately these documents are out of date. Links to the most recent version of the reference manual and its translations, as well as various tutorials, can be found at: http://maxima.sourceforge.net/docs.shtml Hope this helps, Robert Dodier From toy.raymond at gmail.com Thu Feb 21 18:51:18 2008 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 21 Feb 2008 19:51:18 -0500 Subject: [Maxima] solve(...) and unnecessary complex results In-Reply-To: <380-220082421201954763@earthlink.net> References: <380-220082421201954763@earthlink.net> Message-ID: <47BE1C86.1090700@gmail.com> herczegh at earthlink.net wrote: > Hello folks: > > Concerning the roots of x^3-4*x+2 you can show that the complex roots are > equal to the real roots by simplifying the list of complex roots with the > command polarform(). polarform() prompts: Is x positive, negative, or > zero? reply 0 You can apply polarform() to the list of roots returned by > solve(). > > What do you actually get when you do this? What I get is a list of the form [0 = r*exp(%i*theta)], for appropriate values of r and theta. I can't easily tell that the result is real. And the fact that I have 0 = foo seems not nice either. Applying trigsimp to the result makes it pretty clear that the roots are all real. Ray From sangwinc at for.mat.bham.ac.uk Fri Feb 22 04:42:51 2008 From: sangwinc at for.mat.bham.ac.uk (Chris Sangwin) Date: Fri, 22 Feb 2008 10:42:51 +0000 (GMT) Subject: [Maxima] plot3d([discrete,x,y,z]); Message-ID: Is there a counterpart to plot2d([discrete,t,x]); ie how would I achieve the equivalent of plot3d([discrete,x,y,z]); ? Chris From ronis at ronispc.chem.mcgill.ca Fri Feb 22 10:10:42 2008 From: ronis at ronispc.chem.mcgill.ca (David Ronis) Date: Fri, 22 Feb 2008 11:10:42 -0500 Subject: [Maxima] A bug? Message-ID: <1203696642.19741.26.camel@ronispc.chem.mcgill.ca> The following generates an error: phi(i,l,m,mu):= A[i,l,m]*%e^((l+1/2)*mu)+B[i,l,m]*%e^(-(l+1/2)*mu); ans:[ phi(0,l,m,mu[0])-phi(1,l,m,mu[0])=0, phi(1,l,m,mu[1])-phi(2,l,m,mu[1])=0, phi(2,l,m,-mu[2])-phi(3,l,m,-mu[2])=0 ]$ for i:0 thru 2 step 1 do ap[i]:diff(ans,B[i,l,m]), am[i]:diff(ans,A[i,l,m]), for j:0 thru 2 step 1 do aap[j,i]:part(ap[i],j+1,2), aam[j,i]:part(am[i],j+1,2); On the other hand, replacing the for loops with for i:0 thru 2 step 1 do ap[i]:diff(ans,B[i,l,m]); for i:0 thru 2 step 1 do am[i]:diff(ans,A[i,l,m]); for i:0 thru 2 step 1 do for j:0 thru 2 step 1 do aap[j,i]:part(ap[i],j+1,2); for i:0 thru 2 step 1 do for j:0 thru 2 step 1 do aam[j,i]:part(am[i],j+1,2); works as expected. David From robert.dodier at gmail.com Fri Feb 22 10:22:55 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 22 Feb 2008 09:22:55 -0700 Subject: [Maxima] A bug? In-Reply-To: <1203696642.19741.26.camel@ronispc.chem.mcgill.ca> References: <1203696642.19741.26.camel@ronispc.chem.mcgill.ca> Message-ID: On 2/22/08, David Ronis wrote: > The following generates an error: > phi(i,l,m,mu):= A[i,l,m]*%e^((l+1/2)*mu)+B[i,l,m]*%e^(-(l+1/2)*mu); > > ans:[ phi(0,l,m,mu[0])-phi(1,l,m,mu[0])=0, > phi(1,l,m,mu[1])-phi(2,l,m,mu[1])=0, > phi(2,l,m,-mu[2])-phi(3,l,m,-mu[2])=0 ]$ > > for i:0 thru 2 step 1 do > ap[i]:diff(ans,B[i,l,m]), > am[i]:diff(ans,A[i,l,m]), > for j:0 thru 2 step 1 do > aap[j,i]:part(ap[i],j+1,2), > aam[j,i]:part(am[i],j+1,2); Expressions in the body of a loop must be explicitly grouped, by (...) or block(...), e.g. for j:0 thru 2 step 1 do (aap[j,i]:part(ap[i],j+1,2), aam[j,i]:part(am[i],j+1,2)); Maybe that's the problem here. Robert From ronis at ronispc.chem.mcgill.ca Fri Feb 22 10:26:01 2008 From: ronis at ronispc.chem.mcgill.ca (David Ronis) Date: Fri, 22 Feb 2008 11:26:01 -0500 Subject: [Maxima] A bug? In-Reply-To: References: <1203696642.19741.26.camel@ronispc.chem.mcgill.ca> Message-ID: <1203697561.19741.28.camel@ronispc.chem.mcgill.ca> That was it. Thanks David On Fri, 2008-02-22 at 09:22 -0700, Robert Dodier wrote: > On 2/22/08, David Ronis wrote: > > > The following generates an error: > > phi(i,l,m,mu):= A[i,l,m]*%e^((l+1/2)*mu)+B[i,l,m]*%e^(-(l+1/2)*mu); > > > > ans:[ phi(0,l,m,mu[0])-phi(1,l,m,mu[0])=0, > > phi(1,l,m,mu[1])-phi(2,l,m,mu[1])=0, > > phi(2,l,m,-mu[2])-phi(3,l,m,-mu[2])=0 ]$ > > > > for i:0 thru 2 step 1 do > > ap[i]:diff(ans,B[i,l,m]), > > am[i]:diff(ans,A[i,l,m]), > > for j:0 thru 2 step 1 do > > aap[j,i]:part(ap[i],j+1,2), > > aam[j,i]:part(am[i],j+1,2); > > Expressions in the body of a loop must be explicitly grouped, > by (...) or block(...), e.g. > > for j:0 thru 2 step 1 do > (aap[j,i]:part(ap[i],j+1,2), > aam[j,i]:part(am[i],j+1,2)); > > Maybe that's the problem here. > > Robert > From biomates at telefonica.net Fri Feb 22 15:41:03 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 22 Feb 2008 22:41:03 +0100 Subject: [Maxima] plot3d([discrete,x,y,z]); In-Reply-To: References: Message-ID: <47BF416F.904@telefonica.net> Chris Sangwin escribi?: > Is there a counterpart to > > plot2d([discrete,t,x]); > > ie how would I achieve the equivalent of > > plot3d([discrete,x,y,z]); > > ? > I think it's not possible with plot3d, but you can try the draw package instead. Documentation in: ? points More examples in: http://www.telefonica.net/web2/biomates/maxima/gpdraw/points If your Maxima is 5.13 or older, you can also use the 'dataplot' function of the 'descriptive' package. -- Mario Rodriguez Riotorto http://www.telefonica.net/web2/biomates From toy.raymond at gmail.com Sat Feb 23 12:52:56 2008 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 23 Feb 2008 13:52:56 -0500 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47B57E55.1000302@scieneer.com> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> <47B302BF.8030901@scieneer.com> <47B305D5.8040405@ericsson.com> <47B3B866.2010106@scieneer.com> <47B460BE.60308@ericsson.com> <47B4E6DC.6090805@scieneer.com> <47B4F7A6.2000005@gmail.com> <47B57E55.1000302@scieneer.com> Message-ID: <47C06B88.1080706@gmail.com> Douglas Crosher wrote: > > The slatec Fortran source comments suggests it is precise enough for > double-double float. The code can be re-translated, maintaining the > constant precision, using the following hack patch. > > F2cl hack patch to target Fortran double precision to long-float or > double-double-float: > http://www.scieneer.com/files/f2cl-patch1.txt.gz > > Add the following compiler-options in slatec.system and rebuild: > :double-precision-format kernel:double-double-float > :float-format kernel:double-double-float > > Finally got around to applying this patch to f2cl. I tried it with quadpack, and the translation looks good. Unfortunately, the translation won't work because the f2cl-lib functions need to be changed to support double-double-float. A quick hack of f2cl-lib gives something that runs, but one simple test of quadpack dqag produces results that aren't very accurate. More work needed, I guess. Ray From dotancohen at gmail.com Sat Feb 23 14:42:31 2008 From: dotancohen at gmail.com (Dotan Cohen) Date: Sat, 23 Feb 2008 22:42:31 +0200 Subject: [Maxima] New user: where to start? In-Reply-To: <001401c874b8$19b117e0$6401a8c0@Dimension8400> References: <001401c874b8$19b117e0$6401a8c0@Dimension8400> Message-ID: <880dece00802231242p433f0316q290bc226993fb75c@mail.gmail.com> On 21/02/2008, George Leeman wrote: > Hi Dotan, > Based on what I have seen, Adam Majewski's suggested URL > http://en.wikipedia.org/wiki/GNU_Maxima is an excellent place to start. Are you referring to the links at the bottom? There are a lot of useful information there, and I would not have thought to go to wikipedia for tutorial links. Thanks. > Another manual which I have found useful is at > http://www.math.psu.edu/glasner/Max_doc/macref.pdf, and there is also an > online reference manual at > http://www.delorie.com/gnu/docs/maxima/maxima_toc.html. > I and perhaps many others like to learn by example. A nice feature in > Maxima is 'example'. If you say 'example(matrices);', you will get several > examples to show how matrices are manipulated. Saying just 'example();' > tells you what keywords the example function allows. > George Leeman > Thanks, George. Dotan Cohen http://what-is-what.com http://gibberish.co.il ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? From dotancohen at gmail.com Sat Feb 23 14:43:14 2008 From: dotancohen at gmail.com (Dotan Cohen) Date: Sat, 23 Feb 2008 22:43:14 +0200 Subject: [Maxima] New user: where to start? In-Reply-To: References: <001401c874b8$19b117e0$6401a8c0@Dimension8400> Message-ID: <880dece00802231243k9ead23al16550a5ab1bcc12@mail.gmail.com> On 21/02/2008, Robert Dodier wrote: > On Thu, Feb 21, 2008 at 11:32 AM, George Leeman > wrote: > > > http://www.math.psu.edu/glasner/Max_doc/macref.pdf, and there is also an > > online reference manual at > > http://www.delorie.com/gnu/docs/maxima/maxima_toc.html. > > > Unfortunately these documents are out of date. > Links to the most recent version of the reference manual > and its translations, as well as various tutorials, can be found at: > http://maxima.sourceforge.net/docs.shtml > > Hope this helps, Thank you for the updated tutorial link, Robert. I will concentrate my learning with that resource. Dotan Cohen http://what-is-what.com http://gibberish.co.il ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? From george.leeman at sbcglobal.net Sat Feb 23 20:23:50 2008 From: george.leeman at sbcglobal.net (George Leeman) Date: Sat, 23 Feb 2008 21:23:50 -0500 Subject: [Maxima] help on using maxima to solve systems of equations Message-ID: <000101c8768c$4b144de0$6401a8c0@Dimension8400> Hi Tom, Not sure if someone already answered your question, but replacing (%i3) by 'trigsimp(solve([e1,e2],[x,y]));' will effect the simplification you want. George Leeman -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Tom Torfs Sent: Friday, January 25, 2008 3:00 AM To: maxima at math.utexas.edu Subject: Re: [Maxima] help on using maxima to solve systems of equations ... I have another question (again a simplified example): (%i1) e1:x2=x*cos(phi)-y*sin(phi); (%o1) x2=cos(phi)*x-sin(phi)*y (%i2) e2:y2=x*sin(phi)+y*cos(phi); (%o2) y2=cos(phi)*y+sin(phi)*x (%i3) solve([e1,e2],[x,y]); (%o3) [[x=(sin(phi)*y2+cos(phi)*x2)/(sin(phi)^2+cos(phi)^2),y=-(sin(phi)*x2-cos(ph i)*y2)/(sin(phi)^2+cos(phi)^2)]] How can I get Maxima to recognize that sin(phi)^2+cos(phi)^2 = 1 ? Without this type of simplification, the solutions of my system will get huge and ugly. greetings, Tom From woollett at charter.net Sun Feb 24 17:24:19 2008 From: woollett at charter.net (Edwin Woollett) Date: Sun, 24 Feb 2008 15:24:19 -0800 Subject: [Maxima] nusum Message-ID: <000301c8773c$61cb0fa0$0d00a8c0@edwinc367e16bd> Can someone explain how maxima uses the index limits for the function nusum. Is there a simple explanation for the ouputs: ---------------------------------------- nusum( j, j, 0, 2 ); ----> 3 and nusum( j, j, 0, j ); ---> j*( j + 1 ) / 2 ----------------------------------------------- ? ted From andrej.vodopivec at gmail.com Sun Feb 24 18:10:18 2008 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Mon, 25 Feb 2008 01:10:18 +0100 Subject: [Maxima] nusum In-Reply-To: <000301c8773c$61cb0fa0$0d00a8c0@edwinc367e16bd> References: <000301c8773c$61cb0fa0$0d00a8c0@edwinc367e16bd> Message-ID: <7775b21a0802241610u13530503gef58ad4668f16545@mail.gmail.com> On Mon, Feb 25, 2008 at 12:24 AM, Edwin Woollett wrote: > Can someone explain how maxima uses the index limits for the function nusum. > Is there a simple explanation for the ouputs: > ---------------------------------------- > nusum( j, j, 0, 2 ); ----> 3 > and > nusum( j, j, 0, j ); ---> j*( j + 1 ) / 2 > ----------------------------------------------- The arguments for nusum are the same as for sum: nusum(expression, variable, lower_bound, upper_bound). Explanation for you examples: nusum(j,j,0,2) = 0+1+2 = 3 nusum(j,j,0,j) = 0+1+2+...+j = j*(j+1)/2. Maybe it is confusing that in the last example the upper limit for summation is the same as summation variable. The example is equivalent to nusum(i, i, 0, j). HTH, -- Andrej From fateman at cs.berkeley.edu Mon Feb 25 01:05:57 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Sun, 24 Feb 2008 23:05:57 -0800 Subject: [Maxima] nusum In-Reply-To: <000301c8773c$61cb0fa0$0d00a8c0@edwinc367e16bd> References: <000301c8773c$61cb0fa0$0d00a8c0@edwinc367e16bd> Message-ID: <001101c8777c$e8a95280$31d09888@RJFE510> > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Edwin Woollett > Sent: Sunday, February 24, 2008 3:24 PM > To: maxima mailing list > Subject: [Maxima] nusum > > Can someone explain how maxima uses the index limits for the > function nusum. It seems that maxima uses them better than you do. > Is there a simple explanation for the ouputs: > ---------------------------------------- > nusum( j, j, 0, 2 ); ----> 3 wouldn't this be 0+1+2? > and > nusum( j, j, 0, j ); ---> j*( j + 1 ) / 2 > ----------------------------------------------- It appears that nusum is not confused by your effort to confuse it, and implicitly solves the problems as though you have 2 j's. nusum( f(j_the_index), j_the_index, 0, j_the_upper_limit) where f(x):=x. It then gives you the correct answer, in spite of yourself. RJF From marik at mendelu.cz Mon Feb 25 05:06:50 2008 From: marik at mendelu.cz (Robert Marik) Date: Mon, 25 Feb 2008 12:06:50 +0100 Subject: [Maxima] maxima - rules and patterns Message-ID: <47C2A14A.50902@mendelu.cz> Dear users of maxima I solve the following problem: I wish to write tools which enable to differentiate expresions in simple single steps, something like www.calc101.com My problems are: First problem: -------------- write a function diffsin(expr) which scans the epxression expr for strings derivative(sin(....)) and has the following output diffsin(2*sin(x)+derivative(sin(x)) + derivative(sin(x^2))) = 2*sin(x)+cos(x)+cos(x^2)*derivative(x^2) and similar functions for the other basic elementary functions and for product, quotient and addition for example I wish to define function diffproduct with the following output diffproduct(1+x^7*sin(x)+derivative(x^2*cos(x))) =1+x^7*sin(x)+derivative(x^2)*cos(x)+x^2*derivative(cos(x)) I know that the quotient is treated as product in maxima, but I hope to solve this problem somehow (with simp:false?) User will choose one step in diferentiation and Maxima will do the computations. Something similar to http://user.mendelu.cz/marik/maw/index.php?lang=en&form=integral (not yet translated into english, sorry) Second problem: --------------- given the expression, find the rule which has to be used as the first, second, ..... and apply them to get a result similar to http://calc101.com/webMathematica/derivatives.jsp I looked into the maxima manual and I have seen that there are powerfull tools for this in maxima, but I am confused, which of the function should I use. I started my attemtps with defrule(diffsum,derivative(a+b),derivative(a)+derivative(b)); but diffsum(x+sin(x)) returns false :( Can you give me a few pointers and tips to the following? 1. which commnds to use to solve my problems, defrule, defmatch, tellsimp, let? 2. which literature and which examples to study? 3. is there allready a similar package somewhere on the Internet? 4. what is wrong in my example? Thank you very much Robert Marik From fateman at cs.berkeley.edu Mon Feb 25 08:39:10 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Mon, 25 Feb 2008 06:39:10 -0800 Subject: [Maxima] maxima - rules and patterns In-Reply-To: <47C2A14A.50902@mendelu.cz> References: <47C2A14A.50902@mendelu.cz> Message-ID: <003101c877bc$2f60f720$31d09888@RJFE510> First of all, let me point out that this is somewhat unnatural to do, with respect to sums and products... e.g. the matching program generally will succeed in matching a pattern p*q against an expression X by allowing p=X and q=1. For forms with a fixed number of arguments like sin, cos, etc. there is no problem. try this matchdeclare(g,true); defrule(r1, d(sin(g)), cos(g)*d(g)); sin(sin(x)); apply1(%,r1); but also try.. matchdeclare([g,h],true); defmatch(m1,g*h); m1(X); you may try to attach more conditions on the pattern match variables, like they will not match 1, etc. But you are looking for a syntactic match, and maxima's matcher is too clever for you. You could write a "tree walker" and check to see if op(expression,0)="+" and do things with op(expression,1) ... op(expression,length(expression)) etc. This would be needed only for + * and maybe - /. RJF > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Robert Marik > Sent: Monday, February 25, 2008 3:07 AM > To: maxima at math.utexas.edu > Subject: [Maxima] maxima - rules and patterns > > Dear users of maxima > > I solve the following problem: I wish to write tools which enable to > differentiate expresions in simple single steps, something like > www.calc101.com > > My problems are: > > First problem: > -------------- > write a function diffsin(expr) which scans the epxression expr for > strings derivative(sin(....)) and has the following output > > diffsin(2*sin(x)+derivative(sin(x)) + derivative(sin(x^2))) > = > 2*sin(x)+cos(x)+cos(x^2)*derivative(x^2) > > and similar functions for the other basic elementary functions and for > product, quotient and addition > > for example I wish to define function diffproduct with the > following output > diffproduct(1+x^7*sin(x)+derivative(x^2*cos(x))) > =1+x^7*sin(x)+derivative(x^2)*cos(x)+x^2*derivative(cos(x)) > > I know that the quotient is treated as product in maxima, but I hope > to solve this problem somehow (with simp:false?) > > User will choose one step in diferentiation and Maxima will do the > computations. Something similar to > http://user.mendelu.cz/marik/maw/index.php?lang=en&form=integral > (not yet translated into english, sorry) > > Second problem: > --------------- > > given the expression, find the rule which has to be used as the first, > second, ..... and apply them to get a result similar to > http://calc101.com/webMathematica/derivatives.jsp > > > > I looked into the maxima manual and I have seen that there are > powerfull tools for this in maxima, but I am confused, which of the > function should I use. I started my attemtps with > > defrule(diffsum,derivative(a+b),derivative(a)+derivative(b)); > > but > > diffsum(x+sin(x)) > > returns false :( > > Can you give me a few pointers and tips to the following? > > 1. which commnds to use to solve my problems, defrule, defmatch, > tellsimp, let? > 2. which literature and which examples to study? > 3. is there allready a similar package somewhere on the Internet? > 4. what is wrong in my example? > > > Thank you very much > > Robert Marik > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From robert.dodier at gmail.com Mon Feb 25 10:48:16 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 25 Feb 2008 09:48:16 -0700 Subject: [Maxima] maxima - rules and patterns In-Reply-To: <47C2A14A.50902@mendelu.cz> References: <47C2A14A.50902@mendelu.cz> Message-ID: On Mon, Feb 25, 2008 at 4:06 AM, Robert Marik wrote: > defrule(diffsum,derivative(a+b),derivative(a)+derivative(b)); > > but > > diffsum(x+sin(x)) > > returns false :( The rules constructed by defrule (and tellsimpafter) handle + and * differently from other operators. An attempt to describe this is in the ref manual for matchdeclare. There is some working tellsimpafter code for + and * matches in share/contrib/ezunits/ezunits.mac. Hope this helps, Robert Dodier From woollett at charter.net Mon Feb 25 12:00:52 2008 From: woollett at charter.net (Edwin Woollett) Date: Mon, 25 Feb 2008 10:00:52 -0800 Subject: [Maxima] nusum Message-ID: <001201c877d8$5c9a3370$0d00a8c0@edwinc367e16bd> Thanks for the explanations and advice. Richard Fateman wrote: >It appears that nusum is not confused by your effort to confuse it, and >implicitly solves the problems as though you have 2 j's. Andrej Vodopivec wrote nusum(j,j,0,j) = 0+1+2+...+j = j*(j+1)/2. >Maybe it is confusing that in the last example > the upper limit for summation is the same as > summation variable. The example is > equivalent to nusum(i, i, 0, j). I was missing the "dummy variables" idea that the sum cannot depend on what the sum index is called. Robert Dodier wrote >You might consider using the function simplify_sum, >which applies nusum and other methods. >load(simplify_sum) loads it, > ? simplify_sum >shows some information about it. Thanks for the suggestion. ted From talon at lpthe.jussieu.fr Tue Feb 26 04:53:37 2008 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 26 Feb 2008 11:53:37 +0100 Subject: [Maxima] Grobner Message-ID: Hoping this has not been hashed to death, i am having problems using the Grobner package on maxima, running under sbcl. As soon as maxima runs under gcl, the grobner package works, but with sbcl, all i get is: Maxima encountered a Lisp error: Error during processing of --eval option "(cl-user::run)": The value NIL is not of type PRIORITY-QUEUE. for example running demo("grobner.demo"); I have tried under Ubuntu and FreeBSD both with Maxima 5.10.0 and 5.14.0. Please, is there any workaround for this problem? -- Michel Talon From marik at mendelu.cz Tue Feb 26 08:12:01 2008 From: marik at mendelu.cz (Robert Marik) Date: Tue, 26 Feb 2008 15:12:01 +0100 Subject: [Maxima] maxima - rules and patterns In-Reply-To: <003101c877bc$2f60f720$31d09888@RJFE510> References: <47C2A14A.50902@mendelu.cz> <003101c877bc$2f60f720$31d09888@RJFE510> Message-ID: <47C41E31.2010100@mendelu.cz> Thank you very much for your answer and thank also to Robert Dodier for his explanation. I will study these topics and if I succeed, I put the result on my web pages for public. Robert Richard Fateman wrote: > > First of all, let me point out that this is somewhat unnatural to do, > with respect to sums and products... e.g. the matching program > generally will succeed in matching a pattern p*q against an > expression X by allowing p=X and q=1. > > > > For forms with a fixed number of arguments like sin, cos, etc. there is > no problem. > From raymond.toy at ericsson.com Tue Feb 26 08:17:54 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 26 Feb 2008 09:17:54 -0500 Subject: [Maxima] Grobner In-Reply-To: References: Message-ID: <47C41F92.8080906@ericsson.com> Michel Talon wrote: > Hoping this has not been hashed to death, i am having problems using the > Grobner package on maxima, running under sbcl. As soon as maxima runs under > gcl, the grobner package works, but with sbcl, all i get is: > > Maxima encountered a Lisp error: > > Error during processing of --eval option "(cl-user::run)": > > The value NIL is not of type PRIORITY-QUEUE. > > > for example running > demo("grobner.demo"); > > I have tried under Ubuntu and FreeBSD both with Maxima 5.10.0 and 5.14.0. > Please, is there any workaround for this problem? Use gcl? :-) I don't see any issues with current CVS with cmucl, but I haven't finished running the entire demo yet. I don't have sbcl to try this. One option is to run maxima with the -g option. When you get the error, you'll be in the Lisp debugger and you can type backtrace to get a stack trace. This should help in finding the problem. Oh, the demo finished successfully just now. Ray From talon at lpthe.jussieu.fr Tue Feb 26 09:15:27 2008 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 26 Feb 2008 16:15:27 +0100 Subject: [Maxima] Grobner References: <47C41F92.8080906@ericsson.com> Message-ID: Raymond Toy (RT/EUS) wrote: >> >> I have tried under Ubuntu and FreeBSD both with Maxima 5.10.0 and 5.14.0. >> Please, is there any workaround for this problem? > > Use gcl? :-) Well on other computations i have done sbcl is ways faster than gcl. > > I don't see any issues with current CVS with cmucl, but I haven't > finished running the entire demo yet. In fact cmucl was not available on Ubuntu (precompiled) and doesn't seem to work on FreeBSD-7 so i have only tried with sbcl. Hence it seems that sbcl has a problem. > Oh, the demo finished successfully just now. > Thanks for having tested that. > Ray -- Michel Talon From raymond.toy at ericsson.com Tue Feb 26 09:27:40 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 26 Feb 2008 10:27:40 -0500 Subject: [Maxima] Grobner In-Reply-To: References: <47C41F92.8080906@ericsson.com> Message-ID: <47C42FEC.40104@ericsson.com> Michel Talon wrote: > Raymond Toy (RT/EUS) wrote: >> I don't see any issues with current CVS with cmucl, but I haven't >> finished running the entire demo yet. > > In fact cmucl was not available on Ubuntu (precompiled) and doesn't > seem to work on FreeBSD-7 so i have only tried with sbcl. Hence it seems > that sbcl has a problem. Was the failure early in the demo or late? If you want to try cmucl, you can grab a binary from common-lisp.net. The latest snapshot is supposed to work on FreeBSD7, I think. (I don't have FreeBSD.) Installation is simple. Untar the files anywhere. > >> Oh, the demo finished successfully just now. >> > > Thanks for having tested that. I was mistaken. It hasn't finished. It takes a while to run.... Ray From O.Kullmann at swansea.ac.uk Tue Feb 26 09:33:32 2008 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Tue, 26 Feb 2008 15:33:32 +0000 Subject: [Maxima] how to use "maxima --batch" *reliably* ?? Message-ID: <20080226153332.GE6353@cs-wsok.swansea.ac.uk> Hello, I want to use maxima --batch=File but I need to check automatically that no error occurred. Now unfortunately maxima does not use the return value (which is always 0, apparently completely un-bothered about the execution of File) --- I consider this as a bug? Now how to do it otherwise?? Actually it seems impossible: - communication to the outside world via setting an environment variable does not work; - so what remains is writing to some file - HOWEVER how to trigger such an action??? The possibility to execute a file AND checking for errors seems very basic to me, so I hope somebody can tell me what to do here. Thanks in any case! Oliver From robert.dodier at gmail.com Tue Feb 26 09:43:32 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 26 Feb 2008 08:43:32 -0700 Subject: [Maxima] Fwd: Losing messages on the Maxima mailing list In-Reply-To: <000401c87875$eeab7560$6401a8c0@Dimension8400> References: <000401c87875$eeab7560$6401a8c0@Dimension8400> Message-ID: I'm forwarding this message on behalf of George Leeman. Hope this helps, Robert Dodier. ---------- Forwarded message ---------- From: George Leeman Date: Tue, Feb 26, 2008 at 5:48 AM Subject: Losing messages on the Maxima mailing list To: robert.dodier at gmail.com This note is not about the Maxima system but rather about a problem which can cause a user to miss many of the messages in the Maxima mailing list. The note may be of interest to users who: (1) like to read the Maxima messages as part of their e-mail, instead of viewing the archives from a browser; (2) use a mail application instead of accessing their Internet Service Provider directly via a browser. For example, my ISP is AT&T Yahoo (whose server maintains folders such as Inbox, Spam, etc.), but I send and receive mail on a desktop via Microsoft Outlook. When Outlook issues a Receive command, for example, the AT&T Yahoo server sends all message currently in its Inbox to Outlook's Inbox. Recently I discovered that in 2008 the ISP put 125 Maxima messages in its Spam folder, which Outlook would never see; 425 other Maxima messages went into its Inbox, which I received through Outlook. Readers using mail applications should check if they are victims of similar behavior. The simplest fix is to access the ISP's mail server directly and create a filter defining a rule which guarantees that all Maxima mail reaches the ISP's Inbox. The criterion I used is that the message's subject line should contain '[Maxima]', which solves the problem. Details for creating filters are probably similar for various ISPs. Steps for AT&T Yahoo appear below. George Leeman CREATING A MAXIMA FILTER in AT&T YAHOO: In Yahoo Mail: Options -> Mail Options -> Filters -> Create or edit filters -> Add -> Filter Name: maxima -> Subject contains: [Maxima] -> Check the Match Case box -> Move the message to: Inbox -> Add Filter. From fateman at cs.berkeley.edu Tue Feb 26 09:48:47 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 26 Feb 2008 07:48:47 -0800 Subject: [Maxima] how to use "maxima --batch" *reliably* ?? In-Reply-To: <20080226153332.GE6353@cs-wsok.swansea.ac.uk> References: <20080226153332.GE6353@cs-wsok.swansea.ac.uk> Message-ID: <000001c8788f$14986fd0$0300a8c0@RJFE510> Maybe you should reconsider running maxima in batch mode. Maxima, as designed, wants to be in charge, not called by other programs. There are all kinds of problems that you haven't even considered that come up when you use it as a batch program. > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Oliver Kullmann > Sent: Tuesday, February 26, 2008 7:34 AM > To: maxima at math.utexas.edu > Subject: [Maxima] how to use "maxima --batch" *reliably* ?? > > Hello, > > I want to use > > maxima --batch=File > > but I need to check automatically that no > error occurred. Now unfortunately maxima > does not use the return value (which is > always 0, apparently completely un-bothered > about the execution of File) --- I consider > this as a bug? > > Now how to do it otherwise?? Actually it seems > impossible: > - communication to the outside world via setting > an environment variable does not work; > - so what remains is writing to some file > - HOWEVER how to trigger such an action??? > > The possibility to execute a file AND checking for errors > seems very basic to me, so I hope somebody can tell > me what to do here. > > Thanks in any case! > > Oliver > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From O.Kullmann at swansea.ac.uk Tue Feb 26 09:52:48 2008 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Tue, 26 Feb 2008 15:52:48 +0000 Subject: [Maxima] misleading/wrong documentation for package graphs Message-ID: <20080226155248.GF6353@cs-wsok.swansea.ac.uk> Hi, in the graphs-documentation one finds -------- Function: max_clique (gr) Returns a maximal clique of the graph gr. Function: max_independent_set (gr) Returns a maximal independent set of the graph gr. Function: max_matching (gr) Returns a maximal matching of the graph gr. --------- Now in combinatorics there is a well-established standard about the use of "maximal" in this context, namely that it is a subset which is maximal w.r.t. subset-inclusion. So, this would match the above wording, since there are many maximal subsets, some larger, some smaller, and one can only speak of *a* maximal soandso. On the other hand I regard this as utterly useless: Just to get some maximal subset by a greedy approach is pretty trivial, and especially regarding the matchings obviously the user wants a *maximum* matching, a matching of maximal *size*. Now I actually hope that this is what the above functions achieve, namely a clique of maximal size (or a "maximum clique", but such wording would be too clever in this context), etc. And then, obviously, this should be stated in the documentation. Since a maximum clique and a maximum independent set is a non-trivial problem, it would also be good to indicate the algorithms. Oliver P.S. I had a quick look into the source-code, and it could either be a simple brute-force method, computing a maximum subset, or a simple heuristic, just computing some maximal subset. -- Dr. Oliver Kullmann Computer Science Department Swansea University Faraday Building, Singleton Park Swansea SA2 8PP, UK http://cs.swan.ac.uk/~csoliver/ From dtc-maxima at scieneer.com Tue Feb 26 10:08:58 2008 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Wed, 27 Feb 2008 03:08:58 +1100 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47C06B88.1080706@gmail.com> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> <47B302BF.8030901@scieneer.com> <47B305D5.8040405@ericsson.com> <47B3B866.2010106@scieneer.com> <47B460BE.60308@ericsson.com> <47B4E6DC.6090805@scieneer.com> <47B4F7A6.2000005@gmail.com> <47B57E55.1000302@scieneer.com> <47C06B88.1080706@gmail.com> Message-ID: <47C4399A.6000705@scieneer.com> Raymond Toy wrote: > Douglas Crosher wrote: >> >> The slatec Fortran source comments suggests it is precise enough for >> double-double float. The code can be re-translated, maintaining the >> constant precision, using the following hack patch. ... > Finally got around to applying this patch to f2cl. I tried it with > quadpack, and the translation looks good. Unfortunately, the > translation won't work because the f2cl-lib functions need to be changed > to support double-double-float. A quick hack of f2cl-lib gives > something that runs, but one simple test of quadpack dqag produces > results that aren't very accurate. Slatec seems to be almost accurate enough for double-double floats. For example: (slatec:dbesj0 1w0) 0.76519768655796655144971752610269 Expected: 0.76519768655796655144971752610266322090927428975532524... The code calculates the number of coefficients needed at runtime which uses the result of (d1mach 3), a value of (scale-float 1w0 -100) seems to pass. Regards Douglas Crosher From robert.dodier at gmail.com Tue Feb 26 10:20:40 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 26 Feb 2008 09:20:40 -0700 Subject: [Maxima] Grobner In-Reply-To: <47C41F92.8080906@ericsson.com> References: <47C41F92.8080906@ericsson.com> Message-ID: On Tue, Feb 26, 2008 at 7:17 AM, Raymond Toy (RT/EUS) wrote: > Use gcl? :-) Well, I know you're joking, but just to be clear, that's really a short-term solution at best; I think grobner should work with any of the semi-officially supported Lisp varieties (which are, so far as I know, GCL, CMUCL, SBCL, and Clisp). If someone can enter a bug report about the failure of SBCL + Maxima + grobner, it will help us remember to fix it. With Clisp + Maxima 5.14.0, load(grobner) succeeds and demo("grobner.demo") runs to completion (although I can't tell if the results are correct). With SBCL + Maxima 5.13.0, load(grobner) fails with a lot of error messages. Not sure how much work it would be to make SBCL happy. Sorry I can' t be more helpful. Robert Dodier From O.Kullmann at swansea.ac.uk Tue Feb 26 10:27:39 2008 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Tue, 26 Feb 2008 16:27:39 +0000 Subject: [Maxima] how to use "maxima --batch" *reliably* ?? In-Reply-To: <000001c8788f$14986fd0$0300a8c0@RJFE510> References: <20080226153332.GE6353@cs-wsok.swansea.ac.uk> <000001c8788f$14986fd0$0300a8c0@RJFE510> Message-ID: <20080226162739.GH6353@cs-wsok.swansea.ac.uk> On Tue, Feb 26, 2008 at 07:48:47AM -0800, Richard Fateman wrote: > Maybe you should reconsider running maxima in batch mode. > Maxima, as designed, wants to be in charge, not called by other programs. > There are all kinds of problems that you haven't even considered that > come up when you use it as a batch program. > > So you propose not to use Maxima at all? Any reliable build-process needs to be automatised. It seems to me that Maxima has a lot of weeknesses regarding modern programming standards, but this doesn't need to mean that one gives up on it. Oliver From raymond.toy at ericsson.com Tue Feb 26 10:42:23 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 26 Feb 2008 11:42:23 -0500 Subject: [Maxima] Grobner In-Reply-To: <47C42FEC.40104@ericsson.com> References: <47C41F92.8080906@ericsson.com> <47C42FEC.40104@ericsson.com> Message-ID: <47C4416F.9000407@ericsson.com> Raymond Toy (RT/EUS) wrote: > Michel Talon wrote: >> Raymond Toy (RT/EUS) wrote: >>> I don't see any issues with current CVS with cmucl, but I haven't >>> finished running the entire demo yet. >> In fact cmucl was not available on Ubuntu (precompiled) and doesn't >> seem to work on FreeBSD-7 so i have only tried with sbcl. Hence it seems >> that sbcl has a problem. > > Was the failure early in the demo or late? Found it. It also fails with cmucl AND gcl with current CVS. The issue appears to be that $ezgcd returns T, and the code wants to take the cdr of it. There's only one place in grobner.lisp that does (cdr ($ezgcd x y)). I don't know anything about the code or Grobner basis, so I'm at a loss. In any case, this is the test in grobner.demo that causes the error: poly_grobner([x^5+y^4+z^3-1,x^3+y^3+z^2-1], [x,y,z]), modulus=3; Ray From robert.dodier at gmail.com Tue Feb 26 10:42:56 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 26 Feb 2008 09:42:56 -0700 Subject: [Maxima] maxima - rules and patterns In-Reply-To: <47C2A14A.50902@mendelu.cz> References: <47C2A14A.50902@mendelu.cz> Message-ID: On 2/25/08, Robert Marik wrote: > defrule(diffsum,derivative(a+b),derivative(a)+derivative(b)); To make this work as intended, it might be something like the following (this might work to some extent). matchdeclare (xx, lambda ([e], e # 0)); matchdeclare (yy, lambda ([e], e = 0)); matchdeclare (zz, all); defrule (r1, mydiff (xx + yy, zz), mydiff_sum (xx, zz)); which probably seems a little mysterious, as it exploits the idosyncrasies of Maxima's pattern-matching code ... mydiff_sum is something like this (again, dunno if this works). mydiff_sum (expr, x) := (buildq ([x], lambda ([e], mydiff (e, x))), map (%%, expr)); If you post the rules you want to implement, in some non-Maxima notation, I can help you translate them (or I'll try, anyway) into Maxima rules. best Robert Dodier From andrej.vodopivec at gmail.com Tue Feb 26 10:43:28 2008 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Tue, 26 Feb 2008 17:43:28 +0100 Subject: [Maxima] misleading/wrong documentation for package graphs In-Reply-To: <20080226155248.GF6353@cs-wsok.swansea.ac.uk> References: <20080226155248.GF6353@cs-wsok.swansea.ac.uk> Message-ID: <7775b21a0802260843v763615b1tc950c58e5a96c2e2@mail.gmail.com> The documentation should say that functions find maximum clique/independent set/matching. I will fix that. The algorithm for maximum clique is a branch and bound algorithm. It uses greedy coloring for the bound. HTH, Andrej On Tue, Feb 26, 2008 at 4:52 PM, Oliver Kullmann wrote: > Hi, > > in the graphs-documentation one finds > -------- > Function: max_clique (gr) > Returns a maximal clique of the graph gr. > > Function: max_independent_set (gr) > Returns a maximal independent set of the graph gr. > > Function: max_matching (gr) > Returns a maximal matching of the graph gr. > --------- > > Now in combinatorics there is a well-established standard > about the use of "maximal" in this context, namely that > it is a subset which is maximal w.r.t. subset-inclusion. > > So, this would match the above wording, since there are > many maximal subsets, some larger, some smaller, and > one can only speak of *a* maximal soandso. > > On the other hand I regard this as utterly useless: > Just to get some maximal subset by a greedy approach > is pretty trivial, and especially regarding the matchings > obviously the user wants a *maximum* matching, a matching > of maximal *size*. > > Now I actually hope that this is what the above functions > achieve, namely a clique of maximal size (or a "maximum > clique", but such wording would be too clever in this > context), etc. > > And then, obviously, this should be stated in the documentation. > > Since a maximum clique and a maximum independent set is a non-trivial > problem, it would also be good to indicate the algorithms. > > Oliver > > P.S. I had a quick look into the source-code, and it could either > be a simple brute-force method, computing a maximum subset, > or a simple heuristic, just computing some maximal subset. > > -- > Dr. Oliver Kullmann > Computer Science Department > Swansea University > Faraday Building, Singleton Park > Swansea SA2 8PP, UK > http://cs.swan.ac.uk/~csoliver/ > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Tue Feb 26 10:56:31 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 26 Feb 2008 11:56:31 -0500 Subject: [Maxima] how to use "maxima --batch" *reliably* ?? In-Reply-To: <20080226162739.GH6353@cs-wsok.swansea.ac.uk> References: <20080226153332.GE6353@cs-wsok.swansea.ac.uk> <000001c8788f$14986fd0$0300a8c0@RJFE510> <20080226162739.GH6353@cs-wsok.swansea.ac.uk> Message-ID: <8b356f880802260856j142abd9dmb88dc39115ca1b02@mail.gmail.com> This has nothing to do with the build process. You seem to want to use Maxima as a subroutine for some larger calculation. As Fateman pointed out, Maxima was not designed for this use, and is hard to use this way because 1) Maxima often asks questions in the middle of a calculation (e.g. Is x>0?). 2) Maxima errors are not designed for consumption by other programs. 3) Some errors are not clean. 4) Startup time is long. We're aware of these issues, and would like to fix them, but they are not fixed yet. You are welcome to work on them with us. -s On Tue, Feb 26, 2008 at 11:27 AM, Oliver Kullmann wrote: > So you propose not to use Maxima at all? > > Any reliable build-process needs to be automatised. > It seems to me that Maxima has a lot of weeknesses regarding > modern programming standards, but this doesn't need to mean that > one gives up on it. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080226/ab9bb95f/attachment.htm From talon at lpthe.jussieu.fr Tue Feb 26 11:06:26 2008 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Tue, 26 Feb 2008 18:06:26 +0100 Subject: [Maxima] Grobner References: <47C41F92.8080906@ericsson.com> <47C42FEC.40104@ericsson.com> Message-ID: Raymond Toy (RT/EUS) wrote: > Michel Talon wrote: >> Raymond Toy (RT/EUS) wrote: >>> I don't see any issues with current CVS with cmucl, but I haven't >>> finished running the entire demo yet. >> > > Was the failure early in the demo or late? Quite early. > > If you want to try cmucl, you can grab a binary from common-lisp.net. > The latest snapshot is supposed to work on FreeBSD7, I think. (I don't > have FreeBSD.) Installation is simple. Untar the files anywhere. Indeed i have downloaded cmucl-19d-x86-FreeBSD5.tar.bz2 and it works on FreeBSD-7, at least my machine which has been upgraded from 5 and has the old libraries. Anyways, i have recompiled maxima 5.14.0 with this version of cmucl, and here package grobner works OK. So the problem is definitely a bug related to sbcl. The demo runs for around 7 mn on my machine Note i still get just one an error with cmucl: Maxima 5.14.0 http://maxima.sourceforge.net Using Lisp CMU Common Lisp 19d Release (19D) ..... 3 4 5 2 3 3 (%i58) ev(poly_grobner([- 1 + z + y + x , - 1 + z + y + x ], [x, y, z]), modulus = 3) Maxima encountered a Lisp error: Type-error in KERNEL::OBJECT-NOT-LIST-ERROR-HANDLER: T is not of type LIST Other tests succeed. > > > I was mistaken. It hasn't finished. It takes a while to run.... I have recompiled the latest version of sbcl and maxima on FreeBSD-7 and same problem. In fact even load("grobner") produces errors, and almost all the programs in the demo fail. niobe% maxima Maxima 5.14.0 http://maxima.sourceforge.net Using Lisp SBCL 1.0.11 ... (%i1) load("grobner"); .... ; compilation unit finished ; caught 7 ERROR conditions ; caught 6 STYLE-WARNING conditions ; printed 280 notes Evaluation took 5.09 seconds (5.34 elapsed) using 137.764 MB. (%o1) /usr/local/share/maxima/5.14.0/share/contrib/Grobner/grobner.lisp ..... ..... (%i39) poly_grobner_member(y + x, [x, y], [x, y]) Maxima encountered a Lisp error: Error during processing of --eval option "(cl-user::run)": Execution of a form compiled with errors. Form: (MAKE-MONOM NVARS INITIAL-ELEMENT 0) Compile-time error: (in macroexpansion of (MAKE-MONOM NVARS :INITIAL-ELEMENT ...)) (hint: For more precise location, try *BREAK-ON-SIGNALS*.) The value NVARS is not of type FIXNUM. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. I have taken just an example but similar errors occur before. Basically everything fails. > > Ray -- Michel Talon From raymond.toy at ericsson.com Tue Feb 26 11:21:36 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 26 Feb 2008 12:21:36 -0500 Subject: [Maxima] Grobner In-Reply-To: References: <47C41F92.8080906@ericsson.com> <47C42FEC.40104@ericsson.com> Message-ID: <47C44AA0.6060105@ericsson.com> Michel Talon wrote: > Raymond Toy (RT/EUS) wrote: > Indeed i have downloaded cmucl-19d-x86-FreeBSD5.tar.bz2 and it works on > FreeBSD-7, at least my machine which has been upgraded from 5 and has the > old libraries. Anyways, i have recompiled maxima 5.14.0 with this version > of cmucl, and here package grobner works OK. So the problem is definitely That's odd. cmucl fails for me. > Maxima encountered a Lisp error: > > Error during processing of --eval option "(cl-user::run)": > > Execution of a form compiled with errors. > Form: > (MAKE-MONOM NVARS INITIAL-ELEMENT 0) > Compile-time error: > (in macroexpansion of (MAKE-MONOM NVARS :INITIAL-ELEMENT ...)) > (hint: For more precise location, try *BREAK-ON-SIGNALS*.) > The value NVARS is not of type FIXNUM. > > Automatically continuing. > To reenable the Lisp debugger set *debugger-hook* to nil. A wild guess. Wrap an (eval-when (:load-toplevel :compile-toplevel :execute) ...) around the defmacro for make-monom macro. Ray From raymond.toy at ericsson.com Tue Feb 26 11:42:44 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 26 Feb 2008 12:42:44 -0500 Subject: [Maxima] Grobner In-Reply-To: References: <47C41F92.8080906@ericsson.com> Message-ID: <47C44F94.3090304@ericsson.com> Robert Dodier wrote: > On Tue, Feb 26, 2008 at 7:17 AM, Raymond Toy (RT/EUS) > wrote: > >> Use gcl? :-) > > Well, I know you're joking, but just to be clear, that's really a Well, he asked for a workaround, so I gave one. :-) But I agree. It should work with all supported lisps. > short-term solution at best; I think grobner should work with > any of the semi-officially supported Lisp varieties > (which are, so far as I know, GCL, CMUCL, SBCL, and Clisp). Openmcl was supported. Don't know if any uses that or not still. Ray From fateman at cs.berkeley.edu Tue Feb 26 13:58:47 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 26 Feb 2008 11:58:47 -0800 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <47C4399A.6000705@scieneer.com> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> <47B302BF.8030901@scieneer.com> <47B305D5.8040405@ericsson.com> <47B3B866.2010106@scieneer.com> <47B460BE.60308@ericsson.com> <47B4E6DC.6090805@scieneer.com> <47B4F7A6.2000005@gmail.com> <47B57E55.1000302@scieneer.com> <47C06B88.1080706@gmail.com> <47C4399A.6000705@scieneer.com> Message-ID: <000501c878b1$fff5c320$0300a8c0@RJFE510> If you want to test the accuracy of a Bessel function subroutine, you should test it near some difficult points, not at 1.0. Probably a difficult place is near a zero of the Bessel function, especially a zero that is far from the origin. I would not conclude that Slatec is almost accurate enough for double-double; in fact, if the library is really well designed, it should be just barely good enough for the maximum precision which was anticipated for its use. any higher accuracy is wasted effort! RJF > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Douglas Crosher > Sent: Tuesday, February 26, 2008 8:09 AM > To: Raymond Toy > Cc: Maxima List > Subject: Re: [Maxima] Long-float variant giving more > precision to numerical computations. > > Raymond Toy wrote: > > Douglas Crosher wrote: > >> > >> The slatec Fortran source comments suggests it is precise > enough for > >> double-double float. The code can be re-translated, > maintaining the > >> constant precision, using the following hack patch. > ... > > Finally got around to applying this patch to f2cl. I tried it with > > quadpack, and the translation looks good. Unfortunately, the > > translation won't work because the f2cl-lib functions need > to be changed > > to support double-double-float. A quick hack of f2cl-lib gives > > something that runs, but one simple test of quadpack dqag produces > > results that aren't very accurate. > > Slatec seems to be almost accurate enough for double-double floats. > For example: > > (slatec:dbesj0 1w0) > 0.76519768655796655144971752610269 > > Expected: > 0.76519768655796655144971752610266322090927428975532524... > > The code calculates the number of coefficients needed at > runtime which uses the > result of (d1mach 3), a value of (scale-float 1w0 -100) seems to pass. > > Regards > Douglas Crosher > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From fateman at cs.berkeley.edu Tue Feb 26 14:04:12 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 26 Feb 2008 12:04:12 -0800 Subject: [Maxima] how to use "maxima --batch" *reliably* ?? In-Reply-To: <20080226162739.GH6353@cs-wsok.swansea.ac.uk> References: <20080226153332.GE6353@cs-wsok.swansea.ac.uk> <000001c8788f$14986fd0$0300a8c0@RJFE510> <20080226162739.GH6353@cs-wsok.swansea.ac.uk> Message-ID: <000901c878b2$c1bd9c80$0300a8c0@RJFE510> No, I said that if you use maxima in batch mode, it has lots of issues, because it was designed to be interactive. By your criterion the only text editor that you would use is one that is a batch editor. (sed is one such program). Running Maxima in batch mode is unrelated to BUILDING Maxima, which is mostly automated. As for Maxima not conforming to modern programming standards, note that parts of it date to 1963. RJF > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Oliver Kullmann > Sent: Tuesday, February 26, 2008 8:28 AM > To: Richard Fateman > Cc: maxima at math.utexas.edu > Subject: Re: [Maxima] how to use "maxima --batch" *reliably* ?? > > On Tue, Feb 26, 2008 at 07:48:47AM -0800, Richard Fateman wrote: > > Maybe you should reconsider running maxima in batch mode. > > Maxima, as designed, wants to be in charge, not called by > other programs. > > There are all kinds of problems that you haven't even > considered that > > come up when you use it as a batch program. > > > > > > So you propose not to use Maxima at all? > > Any reliable build-process needs to be automatised. > It seems to me that Maxima has a lot of weeknesses regarding > modern programming standards, but this doesn't need to mean that > one gives up on it. > > Oliver > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From robert.dodier at gmail.com Tue Feb 26 14:10:40 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 26 Feb 2008 13:10:40 -0700 Subject: [Maxima] how to use "maxima --batch" *reliably* ?? In-Reply-To: <8b356f880802260856j142abd9dmb88dc39115ca1b02@mail.gmail.com> References: <20080226153332.GE6353@cs-wsok.swansea.ac.uk> <000001c8788f$14986fd0$0300a8c0@RJFE510> <20080226162739.GH6353@cs-wsok.swansea.ac.uk> <8b356f880802260856j142abd9dmb88dc39115ca1b02@mail.gmail.com> Message-ID: On Tue, Feb 26, 2008 at 9:56 AM, Stavros Macrakis wrote: > 1) Maxima often asks questions in the middle of a calculation (e.g. Is > x>0?). I've tried to implement a mode of operation in which interactive queries are suppressed and turned into conditional expressions. I made some progress (see the "noninteractive" package which is somewhere in cvs) but there are some problems with it still. If anyone is interested, I'd be glad to have some help on it. > 2) Maxima errors are not designed for consumption by other programs. A couple of ideas here. (1) quit should take an integer argument which is the exit value (if the Lisp implementation allows it). (2) If running in batch mode, probably there could be a top-level error handler such that all Maxima errors are turned into some kind of expression, e.g. oops("Division by zero"), instead of printing the error as an out-of-band message. > 4) Startup time is long. I wrote a program share/contrib/maxima-server.lisp which implements a conventional unix-ish server which forks off a new instance for each client. Typically that's faster than re-launching. The program works only with SBCL. Oliver, you might take a look at the list of related projects, http://maxima.sourceforge.net/relatedprojects.shtml Various kinds of systems which use Maxima as a computational engine have been implemented. best Robert Dodier From mhansen at gmail.com Tue Feb 26 15:13:34 2008 From: mhansen at gmail.com (Mike Hansen) Date: Tue, 26 Feb 2008 13:13:34 -0800 Subject: [Maxima] how to use "maxima --batch" *reliably* ?? In-Reply-To: References: <20080226153332.GE6353@cs-wsok.swansea.ac.uk> <000001c8788f$14986fd0$0300a8c0@RJFE510> <20080226162739.GH6353@cs-wsok.swansea.ac.uk> <8b356f880802260856j142abd9dmb88dc39115ca1b02@mail.gmail.com> Message-ID: > Oliver, you might take a look at the list of related projects, > http://maxima.sourceforge.net/relatedprojects.shtml > Various kinds of systems which use Maxima as a computational > engine have been implemented. In particular, you may want to look at Sage which provides a Python interface to Maxima (amongst other things). If a situation arises where Maxima needs additional input, an exception is raised. If that exception is not handled, then the Python script will exit with a status of 1. Here is an example of how to use the interface in the most basic/explicit way: sage: maxima.eval('2+2') '4' sage: maxima.eval('integrate((1+v^2/c^2)^3/(1-v^2/c^2)^(3/2),v)') Traceback (most recent call last): ... ValueError: Computation failed since Maxima requested additional constraints (use assume): Is c zero or nonzero? It is also used behind the scenes for things like the following: sage: integrate(x^2,x) x^3/3 --Mike From dtc-maxima at scieneer.com Tue Feb 26 20:24:13 2008 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Wed, 27 Feb 2008 13:24:13 +1100 Subject: [Maxima] Long-float variant giving more precision to numerical computations. In-Reply-To: <000501c878b1$fff5c320$0300a8c0@RJFE510> References: <47A9B861.2080707@scieneer.com> <8b356f880802060641l25530d2ew748e50a51d49ce01@mail.gmail.com> <47B302BF.8030901@scieneer.com> <47B305D5.8040405@ericsson.com> <47B3B866.2010106@scieneer.com> <47B460BE.60308@ericsson.com> <47B4E6DC.6090805@scieneer.com> <47B4F7A6.2000005@gmail.com> <47B57E55.1000302@scieneer.com> <47C06B88.1080706@gmail.com> <47C4399A.6000705@scieneer.com> <000501c878b1$fff5c320$0300a8c0@RJFE510> Message-ID: <47C4C9CD.6010709@scieneer.com> Hello Richard, Richard Fateman wrote: > If you want to test the accuracy of a Bessel function subroutine, you > should test it near some difficult points, not at 1.0. Probably a > difficult place is near a zero of the Bessel function, especially > a zero that is far from the origin. Yes, good point. I expect Ray was seeing gross errors due to initialization problems in the library and I was not attempting to verify the accuracy of the slatec library. However here are some examples close to zero: (slatec:dbesj0 0.001w0) 0.999999750000015624999565972229008 Expected: 0.999999750000015624999565972229003906182... (slatec:dbesj0 1w-12) 0.9999999999999999999999997499999904923978 Expected: 0.999999999999999999999999750000000000000000... > I would not conclude that Slatec is almost accurate enough for double-double; > in fact, if the library is really well designed, it should be just barely > good enough for the maximum precision which was anticipated for its use. > any higher accuracy is wasted effort! The library does adjust the number of coefficients used based on the float accuracy and the number of coefficients is determined at runtime. However the number of coefficients available is limited. The Fortran source does state the claimed accuracy and it is close to double-double float precision, for example: dbesj0.f C Series for BJ0 on the interval 0. to 1.60000E+01 C with weighted error 4.39E-32 C log weighted error 31.36 C significant figures required 31.21 C decimal places required 32.00 Obviously the Slatec library is not going to be adequate for the quad-double or the precise CLISP long-float representations, but it does appear to offer better accuracy than double-float and is a quick path to more accurate results. It would the good to have big-float versions someday. Here are some timing results for: (time (dotimes (i 1000000) (slatec:dbesj0 0.001l0))) double-float (64 bit, CMUCL): 0.49 seconds long-float (80 bit, SCL): 0.45 seconds double-double-float (CMUCL): 13.9 seconds long-float (128 bit, CLISP): 18.18 seconds The SCL long-float (80 bit) code gives a little more precision the double-float without a significant performance hit and it is well within the accuracy of the Slatec library. If more precision is needed than the CMUCL double-double-float or the CLISP long-float code is an option but is much slower and the accuracy of the Slatec library may be reached. Regards Douglas Crosher From helmut.preininger at chello.at Wed Feb 27 04:14:00 2008 From: helmut.preininger at chello.at (Helmut Preininger) Date: Wed, 27 Feb 2008 11:14:00 +0100 Subject: [Maxima] build maxima with allegro free express 8.1 on windows Message-ID: <20080227101412.YFDJ15207.viefep31-int.chello.at@DIP> hi i tried to build maxima: (compile-maxima) run util to the file slatec\zunk1.lisp ...... ; Fast loading ; C:\Programme\acl81-express\hase\maxima-5.14.0\src\binary-acl\numerical\slate c\dyairy.fasl ; Fast loading ; C:\Programme\acl81-express\hase\maxima-5.14.0\src\binary-acl\numerical\slate c\dbesy.fasl ; Fast loading ; C:\Programme\acl81-express\hase\maxima-5.14.0\src\binary-acl\numerical\slate c\zacon.fasl ;;; Compiling file ;;; C:\Programme\acl81-express\hase\maxima-5.14.0\src\numerical\slatec\zunk1.lis p ; While compiling ZUNK1: Warning: tag LABEL96 is never referenced Error: An explicit gc call caused a need for 5505024 more bytes of heap. This request cannot be satisfied because you have hit the Allegro CL Free Express heap limit. The Student Edition has an unlimited heap. For more information on the Student Edition, see http://www.franz.com/downloads/student.lhtml. For an evaluation of our Enterprise or Professional Editions please contact us at sales at franz.com or (510) 452-2000. [condition type: STORAGE-CONDITION] same hints to solve this problem? helmut From marik at mendelu.cz Wed Feb 27 05:50:58 2008 From: marik at mendelu.cz (Robert Marik) Date: Wed, 27 Feb 2008 12:50:58 +0100 Subject: [Maxima] trigonometric simplification Message-ID: <47C54EA2.5090301@mendelu.cz> Hello all, which of the Maxima functions simplifies sqrt(1-sin(x))*sqrt(1+sin(x)) into cos(x) ? Or is it necessary to write a simplification rule for this? Thanks. Robert. From willisb at unk.edu Wed Feb 27 06:13:30 2008 From: willisb at unk.edu (Barton Willis) Date: Wed, 27 Feb 2008 06:13:30 -0600 Subject: [Maxima] trigonometric simplification In-Reply-To: <47C54EA2.5090301@mendelu.cz> References: <47C54EA2.5090301@mendelu.cz> Message-ID: Try rootscontract followed by trigsimp: (%i7) trigsimp(rootscontract(sqrt(1-sin(x))*sqrt(1+sin(x)))); (%o7) abs(cos(x)) Barton -----maxima-bounces at math.utexas.edu wrote: ----- >Hello all, which of the Maxima functions simplifies > >sqrt(1-sin(x))*sqrt(1+sin(x)) > >into > >cos(x) ? From toy.raymond at gmail.com Wed Feb 27 06:48:12 2008 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 27 Feb 2008 07:48:12 -0500 Subject: [Maxima] build maxima with allegro free express 8.1 on windows In-Reply-To: <20080227101412.YFDJ15207.viefep31-int.chello.at@DIP> References: <20080227101412.YFDJ15207.viefep31-int.chello.at@DIP> Message-ID: <47C55C0C.6000603@gmail.com> Helmut Preininger wrote: > hi > > i tried to build maxima: > > (compile-maxima) run util to the file slatec\zunk1.lisp > > ; While compiling ZUNK1: > Warning: tag LABEL96 is never referenced > Error: An explicit gc call caused a need for 5505024 more bytes of heap. > This request cannot > be satisfied because you have hit the Allegro CL Free Express heap > limit. The Student > Edition has an unlimited heap. For more information on the Student > Edition, see > http://www.franz.com/downloads/student.lhtml. For an evaluation of > our Enterprise or > Professional Editions please contact us at sales at franz.com or (510) > 452-2000. > [condition type: STORAGE-CONDITION] > > > same hints to solve this problem? > > You have several options. You can do as Allegro suggests and get the student version. You can use a different lisp such as clisp, gcl, or sbcl, which all work on Windows (I think). Or if you really want to use Allegro, you can comment out the section in maxima.system that builds the slatec routines. You won't be able to compute some functions, but perhaps that will work for you. Ray From O.Kullmann at swansea.ac.uk Wed Feb 27 09:52:10 2008 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Wed, 27 Feb 2008 15:52:10 +0000 Subject: [Maxima] how to use "maxima --batch" *reliably* ?? In-Reply-To: References: <20080226153332.GE6353@cs-wsok.swansea.ac.uk> <000001c8788f$14986fd0$0300a8c0@RJFE510> <20080226162739.GH6353@cs-wsok.swansea.ac.uk> <8b356f880802260856j142abd9dmb88dc39115ca1b02@mail.gmail.com> Message-ID: <20080227155210.GL6353@cs-wsok.swansea.ac.uk> On Tue, Feb 26, 2008 at 01:13:34PM -0800, Mike Hansen wrote: > > Oliver, you might take a look at the list of related projects, > > http://maxima.sourceforge.net/relatedprojects.shtml > > Various kinds of systems which use Maxima as a computational > > engine have been implemented. > > In particular, you may want to look at Sage which provides a Python > interface to Maxima (amongst other things). If a situation arises > where Maxima needs additional input, an exception is raised. If that > exception is not handled, then the Python script will exit with a > status of 1. Here is an example of how to use the interface in the > most basic/explicit way: > > sage: maxima.eval('2+2') > '4' > sage: maxima.eval('integrate((1+v^2/c^2)^3/(1-v^2/c^2)^(3/2),v)') > Traceback (most recent call last): > ... > ValueError: Computation failed since Maxima requested additional > constraints (use assume): > Is c zero or nonzero? > > It is also used behind the scenes for things like the following: > sage: integrate(x^2,x) > x^3/3 > Thanks, this might be useful for the future (though I actually wanted to escape Sage by using the involved computer-algebra systems (like Maxima) directly, avoiding this further level of indirection --- however my system also uses Sage, and so it's there anyway). Yet I'll solve the problem as follows: My context is actually rather restricted, since I do not want to run computations, but I just want to run the (Maxima) higher-order unit test system I've written (run by the bigger system, of which the Maxima-level is only a part). So all the errors are actually created by a Maxima-assert-function, and this assert-function shall then in case of an error write to some file, so that the build system (of *my* system) can catch the error. (As an aside, "higher-order unit test system" means among other things that test-functions are part of the library provided, they state generic axioms, and can use other test-functions.) I'll also redirect the output to some log-file, and from time to time it needs to be inspected (perhaps it's also parsed automatically for some key words). Thanks Richard and Stavros for pointing out problems, but it seems that in my case those aren't show-stoppers: 1) "Maxima often asks questions in the middle of a calculation (e.g. Is x>0?)." I don't know what happens in batch-mode, but if it stops execution, fine, then the person running the automatic test will become aware of the problem, or otherwise hopefully my assert will trigger. 2) "Maxima errors are not designed for consumption by other programs." My system just needs to become aware that something is wrong, and then good old manual inspection is performed. 3) "Some errors are not clean." Hopefully the same as 2): I just need to find out some "something" happened. 4) "Startup time is long." Sure, from a program which wants to send every millisecond some task to Maxima that looks bad, but for the testing-purposes that seems negligible. Thanks for the useful replies! Oliver From sen1 at math.msu.edu Wed Feb 27 12:22:26 2008 From: sen1 at math.msu.edu (S. Newhouse) Date: Wed, 27 Feb 2008 13:22:26 -0500 Subject: [Maxima] bug in draw ? Message-ID: <47C5AA62.2010604@math.msu.edu> Consider the following: draw(gr3d(explicit(x^2 - 2*y^2,x,-2,2,y,-3,3)),gr3d(explicit(x + y,x,-2,2,y,-3,3))); This produces two 3d plots, one above the other. Using the left or middle mouse key to magnify and/or rotate the two fitures makes the upper plot disappear and works only with the lower plot thereafter.. -Cheers, -sen From biomates at telefonica.net Wed Feb 27 13:33:27 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 27 Feb 2008 20:33:27 +0100 Subject: [Maxima] bug in draw ? In-Reply-To: <47C5AA62.2010604@math.msu.edu> References: <47C5AA62.2010604@math.msu.edu> Message-ID: <47C5BB07.9020002@telefonica.net> S. Newhouse escribi?: > Consider the following: > > draw(gr3d(explicit(x^2 - 2*y^2,x,-2,2,y,-3,3)),gr3d(explicit(x + > y,x,-2,2,y,-3,3))); > > This produces two 3d plots, one above the other. > > Hello, This is intended behaviour. The syntax above is for multiplots. More examples about that in http://www.telefonica.net/web2/biomates/maxima/gpdraw/multiplots If you want both surfaces in the same plot, introduce the two 'explicit' objects into only one 'gr3d' scene descriptor, as in draw(gr3d(explicit(x^2 - 2*y^2,x,-2,2,y,-3,3), explicit(x + y,x,-2,2,y,-3,3)) ); or better yet ... draw3d(explicit(x^2 - 2*y^2,x,-2,2,y,-3,3), explicit(x + y,x,-2,2,y,-3,3)); since draw3d is shorthand for draw(gr3d(blah, blah, blah, ...)) > Using the left or middle mouse key to magnify and/or rotate the two > fitures makes the upper plot disappear and works only with the lower > plot thereafter.. > This is a Gnuplot ussue. According to Gnuplot 4.2 manual (page 96), "Mousing is not available in multiplot mode." Mario. P.D.: Just for fun. If you add to your own example option 'terminal=animated_gif', you'll get an animated gif file. See also '? delay'. -- Mario Rodriguez Riotorto http://www.telefonica.net/web2/biomates From marik at mendelu.cz Wed Feb 27 13:54:07 2008 From: marik at mendelu.cz (Robert Marik) Date: Wed, 27 Feb 2008 20:54:07 +0100 Subject: [Maxima] how to use "maxima --batch" *reliably* ?? In-Reply-To: <20080227155210.GL6353@cs-wsok.swansea.ac.uk> References: <20080226153332.GE6353@cs-wsok.swansea.ac.uk> <000001c8788f$14986fd0$0300a8c0@RJFE510> <20080226162739.GH6353@cs-wsok.swansea.ac.uk> <8b356f880802260856j142abd9dmb88dc39115ca1b02@mail.gmail.com> <20080227155210.GL6353@cs-wsok.swansea.ac.uk> Message-ID: <9d9199c20802271154k26ee5f92u6215aa5a304a170b@mail.gmail.com> On Wed, Feb 27, 2008 at 4:52 PM, Oliver Kullmann wrote: > > > Thanks Richard and Stavros for pointing out problems, but it seems that > in my case those aren't show-stoppers: > > 1) "Maxima often asks questions in the middle of a calculation (e.g. Is > x>0?)." > > I don't know what happens in batch-mode, but if it stops execution, fine, > then > the person running the automatic test will become aware of the problem, > or otherwise hopefully my assert will trigger. > Maxima hangs and the process sits on the server. I use the timeout scritp which kill maxima after 5 seconds: http://www.shelldorado.com/scripts/cmds/timeout Robert Marik -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080227/872138ef/attachment.htm From robert.dodier at gmail.com Wed Feb 27 16:07:15 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 27 Feb 2008 15:07:15 -0700 Subject: [Maxima] how to use "maxima --batch" *reliably* ?? In-Reply-To: <9d9199c20802271154k26ee5f92u6215aa5a304a170b@mail.gmail.com> References: <20080226153332.GE6353@cs-wsok.swansea.ac.uk> <000001c8788f$14986fd0$0300a8c0@RJFE510> <20080226162739.GH6353@cs-wsok.swansea.ac.uk> <8b356f880802260856j142abd9dmb88dc39115ca1b02@mail.gmail.com> <20080227155210.GL6353@cs-wsok.swansea.ac.uk> <9d9199c20802271154k26ee5f92u6215aa5a304a170b@mail.gmail.com> Message-ID: About interactive queries triggered in batch files, On Wed, Feb 27, 2008 at 12:54 PM, Robert Marik wrote: > Maxima hangs and the process sits on the server. I use the timeout scritp > which kill maxima after 5 seconds: > http://www.shelldorado.com/scripts/cmds/timeout It seems like it should be possible to close the terminal input stream so that if any read from the terminal is attempted then there would be a Lisp error. I don't know if that's really possible; depends on the Lisp implementation for sure. FWIW Robert Dodier From raymond.toy at ericsson.com Wed Feb 27 16:21:16 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Wed, 27 Feb 2008 17:21:16 -0500 Subject: [Maxima] how to use "maxima --batch" *reliably* ?? In-Reply-To: References: <20080226153332.GE6353@cs-wsok.swansea.ac.uk> <000001c8788f$14986fd0$0300a8c0@RJFE510> <20080226162739.GH6353@cs-wsok.swansea.ac.uk> <8b356f880802260856j142abd9dmb88dc39115ca1b02@mail.gmail.com> <20080227155210.GL6353@cs-wsok.swansea.ac.uk> <9d9199c20802271154k26ee5f92u6215aa5a304a170b@mail.gmail.com> Message-ID: <47C5E25C.10607@ericsson.com> Robert Dodier wrote: > About interactive queries triggered in batch files, > > On Wed, Feb 27, 2008 at 12:54 PM, Robert Marik wrote: > >> Maxima hangs and the process sits on the server. I use the timeout scritp >> which kill maxima after 5 seconds: >> http://www.shelldorado.com/scripts/cmds/timeout > > It seems like it should be possible to close the terminal input stream > so that if any read from the terminal is attempted then there would be > a Lisp error. I don't know if that's really possible; depends on the > Lisp implementation for sure. Neat. FWIW, mread reads from *query-io*, which is a standard CL stream. If you (close *query-io*), you should get some kind of error when maxima needs to ask a question. Not sure what other effects this might have, though. Ray From fateman at cs.berkeley.edu Wed Feb 27 18:49:14 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Wed, 27 Feb 2008 16:49:14 -0800 Subject: [Maxima] how to use "maxima --batch" *reliably* ?? In-Reply-To: <20080227155210.GL6353@cs-wsok.swansea.ac.uk> References: <20080226153332.GE6353@cs-wsok.swansea.ac.uk> <000001c8788f$14986fd0$0300a8c0@RJFE510> <20080226162739.GH6353@cs-wsok.swansea.ac.uk> <8b356f880802260856j142abd9dmb88dc39115ca1b02@mail.gmail.com> <20080227155210.GL6353@cs-wsok.swansea.ac.uk> Message-ID: <003601c879a3$bde523c0$60d09888@RJFE510> The best approach, from the maxima perspective, is for you to write some program, in lisp, or the Maxima language, but actually could be in almost any other language. Suppose the program is called "MyMain". Then you start up Maxima. From the command line, or even from a batch file, type load("MyMainFile"); MyMain(parameters); and let it run. The MyMain program, especially if it is written in lisp or Maxima, can call any program in Maxima, can do I/O, can handle errors etc. The question is, who is the boss. For simple things it may not matter. If all you want is a different GUI, that has been figured out, mostly. If you want full access from a batch program, ... it has issues. If, as you say, it is OK to crash the program, that is a "solution". From Robert.Gloeckner at gmx.net Wed Feb 27 20:08:41 2008 From: Robert.Gloeckner at gmx.net (Robert Gloeckner) Date: Thu, 28 Feb 2008 03:08:41 +0100 Subject: [Maxima] lbfgs - problem Message-ID: <47C617A9.4080103@gmx.net> Hello, if i try to fit [2] function-parameters to my data-set [3], i get an error [1]. I do not understand what the error message means - can somebody give me a hint what is going wrong? Thanks, Bernd /*------- [1] errors from maxima -------*/ Maxima encountered a Lisp error: WRITE-CHAR on # is illegal Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. /*------- [2] maxima-code -----------*/ kill(all); /*__ Carreau */ eq1: eta = a_T * P_1 / (1 + a_T * P_2 - dtgamma )^P_3; /*__ WLF */ eq2: log(a_T) = (8.86 * (P_4 - P_5) / (101.6 + P_4 - P_5)) - (8.86 * (T - P_5) / (101.6 + T - P_5)); /*__ Arrenius */ eq3: a_T = exp( (P_4 / R) * ((1 / (T + 273.15)) - (1 / P_5))); /*__ Carreau-WLF */ eq100: radcan(exp(lhs(eq2))) = radcan(exp(rhs(eq2))); eq101: ev( eq1, eq100); eq102: ev( eq101, R = 8.31415); fortran( radcan( eq102)); eq103: radcan( eq102); Carreau_WLF: eq103; /*__ Carreau-Arrenius */ eq200: ev( eq1, eq3); eq201: ev( eq200, R = 8.31415); eq202: radcan( eq201); Carreau_Arrenius: eq202; /*__ Fitting */ load (descriptive); load (numericalio); load (lbfgs); m : read_matrix("~/Sourcen/workdir/rheofit-cvs/rheofit-data-frank.dat"); F(dtgamma,T) := ev( rhs(Carreau_WLF)); /* F(dtgamma,T) := ev( rhs(Carreau_Arrenius)); */ /* data-file-format is m[i,1] = dtgamma, m[i, 2] = eta, m[i,3] = T */ FOM : '(sum ((F(m[i, 1],m[i ,3]) - m[i, 2])^2, i, 1, length(m)) / length(m)); estimates : lbfgs (FOM, '[P_1,P_2,P_3,P_4,P_5], [1, 1, 1, 1, 1], 1e-2, [1, 0]); /*--------- [3] data-file [dtgamma, eta, T] ----------*/ 882.13 151.17 200.0 436.70 267.73 200.0 199.64 508.15 200.0 84.61 1039.57 200.0 34.59 2125.71 200.0 14.08 4184.46 200.0 5.77 7733.52 200.0 2.47 12466.0 200.0 917.02 106.88 230.0 365.20 221.23 230.0 149.02 456.17 230.0 62.03 859.14 230.0 26.26 1484.19 230.0 11.33 2322.23 230.0 4.92 3403.47 230.0 2.14 4634.94 230.0 775.53 104.28 250.0 308.00 210.07 250.0 127.86 385.42 250.0 54.31 655.88 250.0 23.67 996.30 250.0 10.36 1400.29 250.0 4.61 1786.14 250.0 2.04 2139.91 250.0 From robert.dodier at gmail.com Wed Feb 27 23:02:52 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 27 Feb 2008 22:02:52 -0700 Subject: [Maxima] lbfgs - problem In-Reply-To: <47C617A9.4080103@gmx.net> References: <47C617A9.4080103@gmx.net> Message-ID: On Wed, Feb 27, 2008 at 7:08 PM, Robert Gloeckner wrote: > WRITE-CHAR on # #P"/dev/fd/1"> is illegal Well, the immediate problem here is that an error message was generated from within lbfgs (in the code translated automatically from Fortran into Lisp) and Clisp, for reasons known only to itself, refuses to print the message. (This is Maxima + Clisp here, isn't it?) Try the same operation with GCL or SBCL -- I think those will display the error message. I don't know what's wrong with Clisp. I've seen that error before but didn't resolve it. The larger problem here is that you have a pretty difficult regression problem. I think you'll need to identify an approximate solution somehow and then start lbfgs from there; as a quasi-Newton method, lbfgs is a local search method. I tried guessing, but everything I tried yielded an error at the starting point approximately equal to 1.215 x 10^7; which suggests I was very far from any solution. Sorry I can't be more helpful, Robert Dodier From phhs80 at gmail.com Thu Feb 28 08:15:59 2008 From: phhs80 at gmail.com (Paul Smith) Date: Thu, 28 Feb 2008 14:15:59 +0000 Subject: [Maxima] Possible bug with Wxmaxima Message-ID: <6ade6f6c0802280615l1a891d18w3a4b6a1497957e7c@mail.gmail.com> Dear All, Do you confirm the following as a bug of Wxmaxima (%i15) eq: 1/x=0; (%o15) 1/x=0 (%i16) solve(e,x); `solve' is using arc-trig functions to get a solution.Some solutions will be lost. (%o16) [x=-%pi/2,x=%pi/2] ? Maxima itself does the following: (%i4) eq: 1/x; 1 (%o4) - x (%i5) solve(eq,x); (%o5) [] (%i6) which is correct. Thanks in advance, Paul From willisb at unk.edu Thu Feb 28 08:28:41 2008 From: willisb at unk.edu (Barton Willis) Date: Thu, 28 Feb 2008 08:28:41 -0600 Subject: [Maxima] Possible bug with Wxmaxima In-Reply-To: <6ade6f6c0802280615l1a891d18w3a4b6a1497957e7c@mail.gmail.com> References: <6ade6f6c0802280615l1a891d18w3a4b6a1497957e7c@mail.gmail.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >(%i15) eq: 1/x=0; >(%o15) 1/x=0 >(%i16) solve(e,x); >`solve' is using arc-trig functions to get a solution.Some solutions >will be lost. >(%o16) [x=-%pi/2,x=%pi/2] Try solve(eq,x) instead of solve(e,x). Barton From phhs80 at gmail.com Thu Feb 28 08:42:44 2008 From: phhs80 at gmail.com (Paul Smith) Date: Thu, 28 Feb 2008 14:42:44 +0000 Subject: [Maxima] Possible bug with Wxmaxima In-Reply-To: References: <6ade6f6c0802280615l1a891d18w3a4b6a1497957e7c@mail.gmail.com> Message-ID: <6ade6f6c0802280642q2a698688qebfbbb52011f92de@mail.gmail.com> On Thu, Feb 28, 2008 at 2:28 PM, Barton Willis wrote: > >(%i15) eq: 1/x=0; > >(%o15) 1/x=0 > >(%i16) solve(e,x); > >`solve' is using arc-trig functions to get a solution.Some solutions > >will be lost. > >(%o16) [x=-%pi/2,x=%pi/2] > > Try solve(eq,x) instead of solve(e,x). Thanks, Barton. I had missed that. Paul From joosteto at gmail.com Thu Feb 28 10:10:12 2008 From: joosteto at gmail.com (Joost Witteveen) Date: Thu, 28 Feb 2008 17:10:12 +0100 Subject: [Maxima] simple simplification fails? Message-ID: When I ask maxima to integrate(x/((x+dx*r)^2+(y+dy*r)^2+(z+dz*r)^2)^(3/2),r); it does give a result that could be easily (even I could do it) simplified a lot (see output below). I notice that for (slightly) simpler integrals, maxima does simplify the result, so it seems it has hit a max simplification-search-depth somewhere, given up, and dumped the not-simplified result. Is there a variable I can set so that maxima will try harder to simplify? (at the moment, the results comes just about instantly). (%i133) integrate(x/((x+rx*r)^2+(y+ry*r)^2+(z+rz*r)^2)^(3/2),r); 2 2 2 2 2 2 2 Is (2 rz z + 2 ry y + 2 rx x) - 4 (rz + ry + rx ) (z + y + x ) zero or nonzero? n; 2 2 2 (%o133) x (4 rz z/(sqrt(z + r (2 rz z + 2 ry y + 2 rx x) + y + x 2 2 2 2 2 2 2 2 2 2 + r (rz + ry + rx )) (4 (rz + ry + rx ) (z + y + x ) 2 - (2 rz z + 2 ry y + 2 rx x) )) + 4 ry y 2 2 2 2 2 2 2 /(sqrt(z + r (2 rz z + 2 ry y + 2 rx x) + y + x + r (rz + ry + rx )) 2 2 2 2 2 2 2 (4 (rz + ry + rx ) (z + y + x ) - (2 rz z + 2 ry y + 2 rx x) )) 2 2 2 + 4 rx x/(sqrt(z + r (2 rz z + 2 ry y + 2 rx x) + y + x 2 2 2 2 2 2 2 2 2 2 + r (rz + ry + rx )) (4 (rz + ry + rx ) (z + y + x ) 2 2 2 2 - (2 rz z + 2 ry y + 2 rx x) )) + 4 r (rz + ry + rx ) 2 2 2 2 2 2 2 /(sqrt(z + r (2 rz z + 2 ry y + 2 rx x) + y + x + r (rz + ry + rx )) 2 2 2 2 2 2 2 (4 (rz + ry + rx ) (z + y + x ) - (2 rz z + 2 ry y + 2 rx x) ))) (%i134) f90(%); x*(4*rz*z/ & (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz** & 2+ry**2+rx**2))*(4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2* & rz*z+2*ry*y+2*rx*x)**2))+4*ry*y/ & (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz** & 2+ry**2+rx**2))*(4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2* & rz*z+2*ry*y+2*rx*x)**2))+4*rx*x/ & (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz** & 2+ry**2+rx**2))*(4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2* & rz*z+2*ry*y+2*rx*x)**2))+4*r*(rz**2+ry**2+rx**2)/ & (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz** & 2+ry**2+rx**2))*(4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2* & rz*z+2*ry*y+2*rx*x)**2))) (I show the f90() output for those that read with proportional font). In the result, this is repeated 4 times: (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz**2+ry**2+rx**2))* (4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2*rz*z+2*ry*y+2*rx*x)**2)) So, the whole result can (at least) be simplified as: 4*x*(rx*x+ry*y+rz*z + r*(rx**2+ry**2+rz**2))/ (sqrt(z**2+r*(2*dz*z+2*dy*y+2*dx*x)+y**2+x**2+(dz**2+dy** & 2+dx**2)*r**2)*(4*(dz**2+dy**2+dx**2)*(z**2+y**2+x**2)-(2* & dz*z+2*dy*y+2*dx*x)**2)) Thanks, joost witteveen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080228/b12756d2/attachment.htm From fateman at cs.berkeley.edu Thu Feb 28 10:42:27 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Thu, 28 Feb 2008 08:42:27 -0800 Subject: [Maxima] simple simplification fails? In-Reply-To: References: Message-ID: <001e01c87a28$e7c8dbc0$0400a8c0@RJFE510> No, there is not a "max simplification search depth". It would be nice if you didn't change your notation from line to line, e.g. do you want rx or dx. If you detect a common subexpression, E and want to replace it by F, then try subst(F,E, expression) or ratsubst(F, E, expression). Ordinarily there are many possible such substitutions, and which one makes the most sense is not always obvious. Trying "all" substitutions is hardly practical except for very small expressions. RJF _____ From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Joost Witteveen Sent: Thursday, February 28, 2008 8:10 AM To: maxima at math.utexas.edu Subject: [Maxima] simple simplification fails? When I ask maxima to integrate(x/((x+dx*r)^2+(y+dy*r)^2+(z+dz*r)^2)^(3/2),r); it does give a result that could be easily (even I could do it) simplified a lot (see output below). I notice that for (slightly) simpler integrals, maxima does simplify the result, so it seems it has hit a max simplification-search-depth somewhere, given up, and dumped the not-simplified result. Is there a variable I can set so that maxima will try harder to simplify? (at the moment, the results comes just about instantly). (%i133) integrate(x/((x+rx*r)^2+(y+ry*r)^2+(z+rz*r)^2)^(3/2),r); 2 2 2 2 2 2 2 Is (2 rz z + 2 ry y + 2 rx x) - 4 (rz + ry + rx ) (z + y + x ) zero or nonzero? n; 2 2 2 (%o133) x (4 rz z/(sqrt(z + r (2 rz z + 2 ry y + 2 rx x) + y + x 2 2 2 2 2 2 2 2 2 2 + r (rz + ry + rx )) (4 (rz + ry + rx ) (z + y + x ) 2 - (2 rz z + 2 ry y + 2 rx x) )) + 4 ry y 2 2 2 2 2 2 2 /(sqrt(z + r (2 rz z + 2 ry y + 2 rx x) + y + x + r (rz + ry + rx )) 2 2 2 2 2 2 2 (4 (rz + ry + rx ) (z + y + x ) - (2 rz z + 2 ry y + 2 rx x) )) 2 2 2 + 4 rx x/(sqrt(z + r (2 rz z + 2 ry y + 2 rx x) + y + x 2 2 2 2 2 2 2 2 2 2 + r (rz + ry + rx )) (4 (rz + ry + rx ) (z + y + x ) 2 2 2 2 - (2 rz z + 2 ry y + 2 rx x) )) + 4 r (rz + ry + rx ) 2 2 2 2 2 2 2 /(sqrt(z + r (2 rz z + 2 ry y + 2 rx x) + y + x + r (rz + ry + rx )) 2 2 2 2 2 2 2 (4 (rz + ry + rx ) (z + y + x ) - (2 rz z + 2 ry y + 2 rx x) ))) (%i134) f90(%); x*(4*rz*z/ & (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz** & 2+ry**2+rx**2))*(4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2* & rz*z+2*ry*y+2*rx*x)**2))+4*ry*y/ & (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz** & 2+ry**2+rx**2))*(4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2* & rz*z+2*ry*y+2*rx*x)**2))+4*rx*x/ & (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz** & 2+ry**2+rx**2))*(4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2* & rz*z+2*ry*y+2*rx*x)**2))+4*r*(rz**2+ry**2+rx**2)/ & (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz** & 2+ry**2+rx**2))*(4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2* & rz*z+2*ry*y+2*rx*x)**2))) (I show the f90() output for those that read with proportional font). In the result, this is repeated 4 times: (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz**2+ry**2+rx**2))* (4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2*rz*z+2*ry*y+2*rx*x)**2)) So, the whole result can (at least) be simplified as: 4*x*(rx*x+ry*y+rz*z + r*(rx**2+ry**2+rz**2))/ (sqrt(z**2+r*(2*dz*z+2*dy*y+2*dx*x)+y**2+x**2+(dz**2+dy** & 2+dx**2)*r**2)*(4*(dz**2+dy**2+dx**2)*(z**2+y**2+x**2)-(2* & dz*z+2*dy*y+2*dx*x)**2)) Thanks, joost witteveen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080228/130bd585/attachment-0001.htm From macrakis at alum.mit.edu Thu Feb 28 10:58:31 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 28 Feb 2008 11:58:31 -0500 Subject: [Maxima] simple simplification fails? In-Reply-To: References: Message-ID: <8b356f880802280858v525af599kfbc64efa92674746@mail.gmail.com> factor simplifies it most of the way. Unfortunately, factorsum doesn't handle rz*z+ry*y+rx*x+r*rz^2+r*ry^2+r*rx^2 => rz*z+ry*y+rx*x+r*(rz^2+ry^2+rx^2) because rx, ry, rz appear in both the r*xxx term and the rest. You could also try playing with ratfac and ratvars variable ordering. > I notice that for (slightly) simpler integrals, maxima does simplify the > result, so it seems it has hit a max simplification-search-depth somewhere, > given up, and dumped the not-simplified result. No, this is not the way it works. There is a standard simplification algorithm which does no combinatorial search. > Is there a variable I can set so that maxima will try harder to simplify? > (at the moment, the results comes just about instantly). No. -s From adammaj1 at o2.pl Thu Feb 28 13:33:53 2008 From: adammaj1 at o2.pl (Adam Majewski) Date: Thu, 28 Feb 2008 20:33:53 +0100 Subject: [Maxima] discrete dynamical system Message-ID: Hello, I have made batch file for drawing Julia set using MIIM. What do you think ? Can it be done better ? Adam -------------- next part -------------- A non-text attachment was scrubbed... Name: miim_draw_screen.mac Type: image/x-macpaint Size: 3661 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20080228/31470d98/attachment.bin From joosteto at gmail.com Fri Feb 29 04:50:39 2008 From: joosteto at gmail.com (Joost Witteveen) Date: Fri, 29 Feb 2008 11:50:39 +0100 Subject: [Maxima] simple simplification fails? In-Reply-To: References: <001e01c87a28$e7c8dbc0$0400a8c0@RJFE510> Message-ID: On 28/02/2008, Richard Fateman wrote: > > No, there is not a "max simplification search depth". > > It would be nice if you didn't change your notation from line to line, e.g. > do you want rx or dx. > Yes, I'm sorry. (I did try to unify the two notations, but clearly forgot at least one line) If you detect a common subexpression, E and want to replace it by F, then > try > subst(F,E, expression) > > or > ratsubst(F, E, expression). > Thanks! I saw subst(...), but that didn't work, and never noticed ratsubst. It does work a bit strange, though, when I do integrate((x-d*r)/(a*r^2+b*r+c)^(1/2),r,0,1); maxima again gives a result that can be simplified; when I then ask it to ratsubst(S, sqrt(4*a*c-b^2),%); appart from substituting, it also combines the asinh()'s that have the same parameter, thus doing what I wanted maxima to do all along (see below). Also, I notice that when i do integrate((x+dx*r)*((x+dx*r)^2+(y+dy*r)^2+(z+dz*r)^2)^-(3/2),r); (question: nonzero) maxima gives a result of more than one page. But if I then do: ratsubst(notexist,notexist,%); then it simplifies the result greatly (to just a few lines). (the reverse also happens) So, clearly ratsubst() does do more than just substituting. Here the ratsubst() that combines the asinh()'s, while integrate didn't do that: assume(4*a*c-b^2>0); assume(b>0); assume(a>0); integrate((x-d*r)/(a*r^2+b*r+c)^(1/2),r,0,1); (%o94) (sqrt(a) (- 2 a asinh(----------------) x - b asinh(----------------) d) 2 2 sqrt(4 a c - b ) sqrt(4 a c - b ) 2 b + 2 a + 2 a sqrt(c) d)/(2 a ) - (sqrt(a) (- 2 a asinh(----------------) x 2 sqrt(4 a c - b ) b + 2 a 2 - b asinh(----------------) d) + 2 a sqrt(c + b + a) d)/(2 a ) 2 sqrt(4 a c - b ) (%i95) ratsubst(S, sqrt(4*a*c-b^2),%); 3/2 b + 2 a (%o95) ((2 a x + sqrt(a) b d) asinh(-------) S 3/2 b + (- 2 a x - sqrt(a) b d) asinh(-) + (2 a sqrt(c) - 2 a sqrt(c + b + a)) d) S 2 /(2 a ) (This is with ubuntu's maxima 5.12.0) Anyway, thanks (and to Stavros) for your replies! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080229/1f5a1979/attachment.htm From macrakis at alum.mit.edu Fri Feb 29 07:47:32 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 29 Feb 2008 08:47:32 -0500 Subject: [Maxima] simple simplification fails? In-Reply-To: References: <001e01c87a28$e7c8dbc0$0400a8c0@RJFE510> Message-ID: <8b356f880802290547x472e0ed1i2528c490bb98ba5e@mail.gmail.com> Yes, ratsubst works on the canonical rational expression form (hence the "rat"). Converting to that form in itself can often perform useful simplifications -- try ratsimp, which does essentially that. Of course, in other cases ratsimp performs unhelpful expansions -- e.g. ratsimp( (x+1)^100-x ) where it is hard to recover a compact form. Simplification is a large.and difficult area.... -s On 2/29/08, Joost Witteveen wrote: > On 28/02/2008, Richard Fateman wrote: > > > > No, there is not a "max simplification search depth". > > > > It would be nice if you didn't change your notation from line to line, > e.g. > > do you want rx or dx. > > > > > Yes, I'm sorry. (I did try to unify the two notations, but clearly forgot at > least one line) > > If you detect a common subexpression, E and want to replace it by F, then > > try > > subst(F,E, expression) > > > > or > > ratsubst(F, E, expression). > > > > > Thanks! I saw subst(...), but that didn't work, and never noticed ratsubst. > It does work a bit strange, though, when I do > integrate((x-d*r)/(a*r^2+b*r+c)^(1/2),r,0,1); > maxima again gives a result that can be simplified; when I then ask it to > ratsubst(S, sqrt(4*a*c-b^2),%); > appart from substituting, it also combines the asinh()'s that have the same > parameter, thus doing what I wanted maxima to do all along (see below). > > Also, I notice that when i do > integrate((x+dx*r)*((x+dx*r)^2+(y+dy*r)^2+(z+dz*r)^2)^-(3/2),r); > (question: nonzero) > maxima gives a result of more than one page. But if I then do: > ratsubst(notexist,notexist,%); > then it simplifies the result greatly (to just a few lines). (the reverse > also happens) > > So, clearly ratsubst() does do more than just substituting. > > > Here the ratsubst() that combines the asinh()'s, while integrate didn't do > that: > assume(4*a*c-b^2>0); > assume(b>0); > assume(a>0); > integrate((x-d*r)/(a*r^2+b*r+c)^(1/2),r,0,1); > (%o94) (sqrt(a) (- 2 a asinh(----------------) x - b asinh(----------------) > d) > 2 2 > sqrt(4 a c - b ) sqrt(4 a c - b ) > 2 b + 2 a > + 2 a sqrt(c) d)/(2 a ) - (sqrt(a) (- 2 a asinh(----------------) x > 2 > sqrt(4 a c - b ) > b + 2 a 2 > - b asinh(----------------) d) + 2 a sqrt(c + b + a) d)/(2 a ) > 2 > sqrt(4 a c - b ) > > > (%i95) ratsubst(S, sqrt(4*a*c-b^2),%); > > > 3/2 b + 2 a > (%o95) ((2 a x + sqrt(a) b d) asinh(-------) > S > 3/2 b > + (- 2 a x - sqrt(a) b d) asinh(-) + (2 a sqrt(c) - 2 a sqrt(c + b + a)) > d) > S > 2 > /(2 a ) > > (This is with ubuntu's maxima 5.12.0) > Anyway, thanks (and to Stavros) for your replies! > -- Sent from Gmail for mobile | mobile.google.com From willisb at unk.edu Fri Feb 29 08:48:40 2008 From: willisb at unk.edu (Barton Willis) Date: Fri, 29 Feb 2008 08:48:40 -0600 Subject: [Maxima] simple simplification fails? In-Reply-To: <8b356f880802290547x472e0ed1i2528c490bb98ba5e@mail.gmail.com> Message-ID: maxima-bounces at math.utexas.edu wrote on 02/29/2008 07:47:32 AM: > Simplification is a large.and difficult area.... > > -s Students (still) want to match the back of the book; the rest of us have our own ideas about presentation--we might want expressions to look as if we had used carbon-based computing (pencil + brain). Even ignoring personal preferences, simplification is a difficult problem. Consider: sin(%pi / 60) = ((sqrt(5) - 1) * (sqrt(6) + sqrt(2))/16) - ((sqrt(sqrt(5) + 5) * (sqrt(6) - sqrt(2)))/(8 * sqrt(2))) The right side might be amusing, but surely the left side is the simplest. Converting sin(%pi / 60) --> ugly algebraic is easy, but ugly algebraic --> sin(%pi/60) isn't so easy. Barton From woollett at charter.net Fri Feb 29 13:15:08 2008 From: woollett at charter.net (Edwin Woollett) Date: Fri, 29 Feb 2008 11:15:08 -0800 Subject: [Maxima] discrete dynamical system Message-ID: <000c01c87b07$682f58a0$0d00a8c0@edwinc367e16bd> Adam Majewski wrote: >I have made batch file for drawing Julia set using MIIM. what is "MIIM" ? >What do you think ? Can it be done better ? works in xmaxima, v 5.14: file renamed julia.mac: (%i1) load(julia); `rat' replaced -0.11 by -11/100 = -0.11 `rat' replaced 0.65569999 by 5700/8693 = 0.65569998849649 (%o1) c:/work2/julia.mac I am no expert on graphics. ted winxp, v. 5.14 From adammaj1 at o2.pl Fri Feb 29 13:27:31 2008 From: adammaj1 at o2.pl (Adam Majewski) Date: Fri, 29 Feb 2008 20:27:31 +0100 Subject: [Maxima] discrete dynamical system In-Reply-To: <000c01c87b07$682f58a0$0d00a8c0@edwinc367e16bd> References: <000c01c87b07$682f58a0$0d00a8c0@edwinc367e16bd> Message-ID: Hi Edwin , thx for your replay > what is "MIIM" ? Modified Inverse Iteration Method http://en.wikibooks.org/wiki/Fractals/Iterations_in_the_complex_plane/Julia_set http://facstaff.unca.edu/mcmcclur/professional/Julia/Links/index_lnk_4.html >> What do you think ? Can it be done better ? > I am no expert on graphics. So am I. I'd like to ask if my use of Maxima commands is good. It works but maybe it can be done faster ? Regards Adam From adammaj1 at o2.pl Fri Feb 29 13:35:24 2008 From: adammaj1 at o2.pl (Adam Majewski) Date: Fri, 29 Feb 2008 20:35:24 +0100 Subject: [Maxima] discrete dynamical system In-Reply-To: References: <000c01c87b07$682f58a0$0d00a8c0@edwinc367e16bd> Message-ID: Adam Majewski pisze: > Hi Edwin , > > thx for your replay > >> what is "MIIM" ? > Modified Inverse Iteration Method > http://en.wikibooks.org/wiki/Fractals/Iterations_in_the_complex_plane/Julia_set > http://facstaff.unca.edu/mcmcclur/professional/Julia/Links/index_lnk_4.html >>> What do you think ? Can it be done better ? > > I am no expert on graphics. > > So am I. > I'd like to ask if my use of Maxima commands is good. > It works but maybe it can be done faster ? > > Regards > > Adam Here is implemented: - stack ( LIFO) using list - drawing points points using 2 lists This maybe things to improve Adam From biomates at telefonica.net Fri Feb 29 14:31:21 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 29 Feb 2008 21:31:21 +0100 Subject: [Maxima] discrete dynamical system In-Reply-To: References: <000c01c87b07$682f58a0$0d00a8c0@edwinc367e16bd> Message-ID: <47C86B99.9080002@telefonica.net> > Here is implemented: > - stack ( LIFO) using list > - drawing points points using 2 lists > This maybe things to improve > Hello, From draw's point of view, your code is 100% correct. But take into account that the drawing routine takes only a small portion of computing time, since most of the time is dedicated to the computation of the Julia set. On the other hand, now that I see this algorithm, perhaps the 'points' drawing object could be improved to admit arrays of coordinates instead of only lists and matrices. Another drawing alternative could be the 'image' object, as in the Mandelbrot sets in www.telefonica.net/web2/biomates/maxima/gpdraw/image Finally, I think you already know about the existence of packages 'dynamics' and 'fractals', which could be of interest for you. -- Mario Rodriguez Riotorto http://www.telefonica.net/web2/biomates From Robert.Gloeckner at gmx.net Fri Feb 29 19:23:23 2008 From: Robert.Gloeckner at gmx.net (Robert Gloeckner) Date: Sat, 01 Mar 2008 02:23:23 +0100 Subject: [Maxima] other than clisp precompiled packages? Message-ID: <47C8B00B.5000404@gmx.net> Hello, I used older versions of gcl-precompiled maxima-binaries and now i "upgraded" to 5.14.0, but i am very unhappy with the usability of this clisp-binaries under linux/emacs. the functions i use most of the time maxima-send-region and maxima-send-full-line-and-goto-next-form are not usable anymore, because output is delayed till last output - so intermediate (log-) outputs do not show up until all computation is done. Maybe someone else already knows of links to other-than-clisp-maxima-binaries for windows/linux? Thanks, Robert From adammaj1 at o2.pl Sat Mar 1 03:31:11 2008 From: adammaj1 at o2.pl (Adam Majewski) Date: Sat, 01 Mar 2008 10:31:11 +0100 Subject: [Maxima] discrete dynamical system In-Reply-To: <47C86B99.9080002@telefonica.net> References: <000c01c87b07$682f58a0$0d00a8c0@edwinc367e16bd> <47C86B99.9080002@telefonica.net> Message-ID: Mario Rodriguez pisze: >> Here is implemented: >> - stack ( LIFO) using list >> - drawing points points using 2 lists >> This maybe things to improve >> > Hello, > > From draw's point of view, your code is 100% correct. But take into > account that the drawing routine takes only a small portion of computing > time, since most of the time is dedicated to the computation of the > Julia set. I have problem with point size. I use diffrent positive integer values but points are still small. > > On the other hand, now that I see this algorithm, perhaps the 'points' > drawing object could be improved to admit arrays of coordinates instead > of only lists and matrices. Can you expand it ? Do you think about drawing only array Hits in 3D. h(x,y):=Hits[fix(X),fix(Y)]/HitLimit; It would be an diagram like fig 27 in "the beauty of fractals" by Peitgen. Can you do it ? > > Another drawing alternative could be the 'image' object, as in the > Mandelbrot sets in > > www.telefonica.net/web2/biomates/maxima/gpdraw/image Yes I will do it. > > Finally, I think you already know about the existence of packages > 'dynamics' and 'fractals', which could be of interest for you. Yes I know it. These packages inspired me to use Maxima for fractals. Dynamics is in Lisp so I have a time to learn it, because I would like to add new functions , not only use it. There are many unsolved problems. Help is wellcome. Adam From biomates at telefonica.net Sat Mar 1 07:15:23 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Sat, 01 Mar 2008 14:15:23 +0100 Subject: [Maxima] discrete dynamical system In-Reply-To: References: <000c01c87b07$682f58a0$0d00a8c0@edwinc367e16bd> <47C86B99.9080002@telefonica.net> Message-ID: <47C956EB.8010001@telefonica.net> > I have problem with point size. I use diffrent positive integer values > but points are still small. > If you want to play with point sizes, don't use 'point_type=dot', but 'point_type=filled_circle' or similar formats (type ? point_type for other alternatives) >> On the other hand, now that I see this algorithm, perhaps the 'points' >> drawing object could be improved to admit arrays of coordinates instead >> of only lists and matrices. >> > Can you expand it ? > I could try it. > Do you think about drawing only array Hits in 3D. > h(x,y):=Hits[fix(X),fix(Y)]/HitLimit; > It would be an diagram like fig 27 in "the beauty of fractals" by Peitgen. > Can you do it ? > > Sorry, I don't have this reference at hand. -- Mario Rodriguez Riotorto http://www.telefonica.net/web2/biomates From robert.dodier at gmail.com Sat Mar 1 15:57:05 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 1 Mar 2008 14:57:05 -0700 Subject: [Maxima] other than clisp precompiled packages? In-Reply-To: <47C8B00B.5000404@gmx.net> References: <47C8B00B.5000404@gmx.net> Message-ID: On 2/29/08, Robert Gloeckner wrote: > Maybe someone else already knows of links to > other-than-clisp-maxima-binaries for windows/linux? The Windows installer (at the Sourceforge download page) has Maxima compiled with GCL. I believe there are various rpms floating around but you would have to google for them, I don't have any links offhand. The Maxima ports page might have some links. http://maxima.sourceforge.net/wiki/index.php?Maxima%20ports Another option is to recompile from a tarball or source rpm. HTH Robert Dodier From jan.brosius at skynet.be Sat Mar 1 16:05:25 2008 From: jan.brosius at skynet.be (Jan Brosius) Date: Sat, 01 Mar 2008 23:05:25 +0100 Subject: [Maxima] maxima does not work Message-ID: <47C9D325.9070809@skynet.be> Hi, I am using fedora 8 , x86_64 . I have installed maxima 5.14.0-4 , maxima-runtime-sbcl 5.14.0-4 and sbcl 1.013-1 , but when I type maxima in the terminal window maxima doesn't start. I get this: [Jan at localhost ~]$ maxima debugger invoked on a SIMPLE-ERROR in thread #: Error during processing of initialization file /home/Jan/.sbclrc: Don't know how to REQUIRE ASDF-INSTALL. See also: The SBCL Manual, Variable *MODULE-PROVIDER-FUNCTIONS* The SBCL Manual, Function REQUIRE Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. restarts (invokable by number or by possibly-abbreviated name): 0: [CONTINUE] Ignore and continue processing. 1: [ABORT ] Skip this initialization file. 2: Skip to toplevel READ/EVAL/PRINT loop. 3: [QUIT ] Quit SBCL (calling #'QUIT, killing the process). ((LAMBDA (SB-IMPL::E)) #) 0] Does anyone know what's wrong (sbcl works). Thanks for any help Jan From woollett at charter.net Sat Mar 1 16:07:51 2008 From: woollett at charter.net (Edwin Woollett) Date: Sat, 1 Mar 2008 14:07:51 -0800 Subject: [Maxima] pull integer inside power? Message-ID: <000601c87be8$b18212e0$0d00a8c0@edwinc367e16bd> Is there a way to make the conversions: a^2/4 => (a/2)^2 or a^3/27 => (a/3)^3 where a is a polynomial? ted win xp , v 5.14 From robert.dodier at gmail.com Sat Mar 1 16:19:13 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 1 Mar 2008 15:19:13 -0700 Subject: [Maxima] maxima does not work In-Reply-To: <47C9D325.9070809@skynet.be> References: <47C9D325.9070809@skynet.be> Message-ID: On 3/1/08, Jan Brosius wrote: > Error during processing of initialization file /home/Jan/.sbclrc: > Don't know how to REQUIRE ASDF-INSTALL. Hmm. Maybe it would work if you rename .sbclrc temporarily so that SBCL doesn';t read it. Or maybe you can out (require 'asdf-install) or whatever SBCL is complaining about. If that doesn't help, try launching maxima with the --verbose option, which will show the SBCL command line. Sorry I can't be more helpful -- just guessing here. Robert Dodier From mickpc at bigond.com Sat Mar 1 02:07:15 2008 From: mickpc at bigond.com (Michael Carey) Date: Sat, 01 Mar 2008 19:07:15 +1100 Subject: [Maxima] Error with maxima Message-ID: <1204358835.6400.3.camel@mickpc-laptop> I gei this when try to plot a function... Maxima encountered a Lisp error: Error in PROGN [or a callee]: Broken pipe Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil How do i fix this please. -- Mick Carey NSW Australia msn mickpc at bigpond.com yahoo mick888200 From fateman at cs.berkeley.edu Sat Mar 1 18:52:26 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Sat, 01 Mar 2008 16:52:26 -0800 Subject: [Maxima] pull integer inside power? In-Reply-To: <000601c87be8$b18212e0$0d00a8c0@edwinc367e16bd> References: <000601c87be8$b18212e0$0d00a8c0@edwinc367e16bd> Message-ID: <47C9FA4A.3030707@cs.berkeley.edu> Edwin Woollett wrote: > Is there a way to make the conversions: > > a^2/4 => (a/2)^2 > > or a^3/27 => (a/3)^3 > > where a is a polynomial? > > ted > win xp , v 5.14 > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > try ratsubst( b,a/3,a^3/27). Maxima will try pretty hard to simplify 3^3 to 27, which it considers simpler. You can try factor( 27); but that 3^3 will not stay around for long unless you rename it as, say, b^3. Basically, you are fighting against the system's notion of what it is supposed to do. RJF From robert.dodier at gmail.com Sat Mar 1 19:26:22 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 1 Mar 2008 18:26:22 -0700 Subject: [Maxima] Error with maxima In-Reply-To: <1204358835.6400.3.camel@mickpc-laptop> References: <1204358835.6400.3.camel@mickpc-laptop> Message-ID: On 3/1/08, Michael Carey wrote: > I gei this when try to plot a function... > Maxima encountered a Lisp error: > > Error in PROGN [or a callee]: Broken pipe Try a different plot format -- see what get_plot_option(plot_format) returns. If it says gnuplot_pipes, try set_plot_option([plot_format, gnuplot]) instead or set_plot_option([plot_format, openmath]). Hope this helps, Robert Dodier From adammaj1 at o2.pl Sun Mar 2 03:06:14 2008 From: adammaj1 at o2.pl (Adam Majewski) Date: Sun, 02 Mar 2008 10:06:14 +0100 Subject: [Maxima] discrete dynamical system In-Reply-To: <47C956EB.8010001@telefonica.net> References: <000c01c87b07$682f58a0$0d00a8c0@edwinc367e16bd> <47C86B99.9080002@telefonica.net> <47C956EB.8010001@telefonica.net> Message-ID: Mario Rodriguez pisze: >> I have problem with point size. I use diffrent positive integer values >> but points are still small. >> > > If you want to play with point sizes, don't use 'point_type=dot', but > 'point_type=filled_circle' or similar formats (type ? point_type for > other alternatives) Great. Thx. It,s very important information for me. I didn't find this information. Is it in help or on your page ? > >> Do you think about drawing only array Hits in 3D. >> h(x,y):=Hits[fix(X),fix(Y)]/HitLimit; >> It would be an diagram like fig 27 in "the beauty of fractals" by Peitgen. >> Can you do it ? >> >> > Sorry, I don't have this reference at hand. I have not found image in the internet, so I will try to desacribe it. I have array of pixels. For each pixel there is a n integer number ( 0<=hit<=HitLimit). I would like to draw vertical bars ( height is = hit/hitLimit) for each pixel. Adam From biomates at telefonica.net Sun Mar 2 06:52:25 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 02 Mar 2008 13:52:25 +0100 Subject: [Maxima] discrete dynamical system In-Reply-To: References: <000c01c87b07$682f58a0$0d00a8c0@edwinc367e16bd> <47C86B99.9080002@telefonica.net> <47C956EB.8010001@telefonica.net> Message-ID: <47CAA309.3090602@telefonica.net> Hello Adam, > Great. Thx. It,s very important information for me. I didn't find this > information. Is it in help or on your page ? > I'm afraid this information is nowhere. I'll fix it. > I have not found image in the internet, so I will try to desacribe it. > I have array of pixels. For each pixel there is a n integer number ( > 0<=hit<=HitLimit). I would like to draw vertical bars ( height is = > hit/hitLimit) for each pixel. > I think I understand. At this moment, the only way to plot vertical lines for each point is to write something as draw3d(points_joined=true, points([[1,1,0], [1,1,10]]), points([[2,2,0], [2,2,10]]), points([[3,4,0], [3,4,10]]) ); which is not a nice solution. Although impulses are implemented in Gnuplot, they aren't in Maxima. I'll look into this too. Thanks a lot for your comments; you gave me a pair of ideas! -- Mario Rodriguez Riotorto http://www.telefonica.net/web2/biomates From nicolas.francois at free.fr Sun Mar 2 08:51:30 2008 From: nicolas.francois at free.fr (Nicolas FRANCOIS) Date: Sun, 2 Mar 2008 15:51:30 +0100 Subject: [Maxima] Solving a matrix equation Message-ID: <20080302155130.75704aee@detritus.baronie.vez> Hi. I have a matrix A (for example 3*3), and a vector X=matrix([x],[y],[z]). What are the instructions for solving the linear system A.X=0 ? I didn't find it in the documentation. I would prefer not to have to convert this matricial equation back to a system, if possible. Thanks. \bye -- Nicolas FRANCOIS | /\ http://nicolas.francois.free.fr | |__| X--/\\ We are the Micro$oft. _\_V Resistance is futile. You will be assimilated. darthvader penguin From willisb at unk.edu Sun Mar 2 09:30:05 2008 From: willisb at unk.edu (Barton Willis) Date: Sun, 2 Mar 2008 09:30:05 -0600 Subject: [Maxima] Solving a matrix equation In-Reply-To: <20080302155130.75704aee@detritus.baronie.vez> References: <20080302155130.75704aee@detritus.baronie.vez> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I have a matrix A (for example 3*3), and a vector X=matrix([x],[y],[z]). >What are the instructions for solving the linear system A.X=0 ? For a invertible coefficient matrix, you can use the (undocumented) function linsolve_by_lu; for other cases, I think you'll have to convert to equations and use linsolve (or solve or algsys). Examples: Solve using rational numbers --- don't compute the matrix condition number: (%i18) linsolve_by_lu(matrix([5,7],[9,6]), matrix([1],[1])); (%o18) [matrix([1/33],[4/33]),false] Solve using IEEE doubles --- return an upper bound for the matrix condition number as the second list entry: (%i19) linsolve_by_lu(matrix([5,7],[9,6]), matrix([1],[1]), 'floatfield); (%o19) [matrix([0.03030303030303],[0.12121212121212]),6.835016835016835] Multiple right-hand-sides are okay -- find the inverse: (%i20) linsolve_by_lu(matrix([5,7],[9,6]), matrix([1,0],[0,1])); (%o20) [matrix([-2/11,7/33],[3/11,-5/33]),false] Solve using bigfloats: (%i21) linsolve_by_lu(matrix([5,7],[9,6]), matrix([1],[1]), 'bigfloatfield), fpprec : 20; (%o21) [matrix([3.030303030303030303b-2],[1.2121212121212121212 b-1]),6.835016835016835] Barton From robert.dodier at gmail.com Sun Mar 2 11:29:11 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 2 Mar 2008 10:29:11 -0700 Subject: [Maxima] Maxima 5.15 release schedule Message-ID: Hello, I am planning to make a release branch for Maxima 5.15 on April 1, with the release of 5.15.0 to follow a few weeks later. If you want to get something into the next release, sometime before the branch is the best time to do it. HTH Robert Dodier From macrakis at alum.mit.edu Sun Mar 2 13:25:27 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 2 Mar 2008 14:25:27 -0500 Subject: [Maxima] pull integer inside power? In-Reply-To: <000601c87be8$b18212e0$0d00a8c0@edwinc367e16bd> References: <000601c87be8$b18212e0$0d00a8c0@edwinc367e16bd> Message-ID: <8b356f880803021125n5d3314a4rc6a011f7c3b9f248@mail.gmail.com> Maxima has many standard simplifications which it performs on every expression. Maxima is not designed to preserve unsimplified expressions such as x+0 (simplifies => x), x+x (=> 2*x), x/x (=> 1), (a/2)^2 (=> a^2/4), etc. There are two main ways of blocking these default simplifications. One is to turn off simplification entirely, by setting simp:false. This will then give you results like integrate(x,x) => x*x*2^-1 and diff(integrate(x,x),x) => 0*x*x + 1*x*2^-1 + 1*x*2^-1. And some built-in functions will not operate correctly on unsimplified expressions. Another is to "box" subexpressions. Thus, box(a/2)^2 does not simplify, but the boxed part gets treated as a, um, black box e.g. diff(box(x),x) => 'diff('box(x),x). Judicious use of boxing and unboxing may have the effect you want. Or maybe not, depending on what you're trying to accomplish. -s From marik at mendelu.cz Sun Mar 2 17:48:27 2008 From: marik at mendelu.cz (Robert Marik) Date: Mon, 3 Mar 2008 00:48:27 +0100 Subject: [Maxima] maxima - rules and patterns In-Reply-To: References: <47C2A14A.50902@mendelu.cz> Message-ID: <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> On Tue, Feb 26, 2008 at 5:42 PM, Robert Dodier wrote: > > > If you post the rules you want to implement, in some non-Maxima > notation, I can help you translate them (or I'll try, anyway) > into Maxima rules. > > best > > Robert Dodier > I have the following code, which seems to work, the function diff_in_steps(x^2*sin(x^3)) differentiates with respect to x and shows steps, but it fails for diff_in_steps(x^2*sin(y)) It remains to solve this problem (it is not possible to use parameters or functions in more variables) and also to format the result for reading -- with tex and texput(derivace,["\\left(","\\right)^\\prime"],matchfix) Since I am new in Maxima (I use it for less than one year), I would like to post my code to this group. If you have any suggestions or improvements, let me know please. Short explanation of the code: The string to be differentiated is in the function derivace(expr) - I use the Czech word in order not to break anything. The function derivace is declared to be linear We try the usual rules for basic elementary functions first. If all the rules fail, we try to use product rule and if this fails as well, we try quotient rule. (here I observed a strange thing: op(u/v) gives "//" on debian and "/" on archlinux) We try the product rule as follows: we replace the function derivace with derivsoucinu and this new function returns derivace(expr) if expr is not a product or derivace(u)*v+u*derivace(v). In a similar way we work with quotient. We use small maxapplydepth to ensure that only one or few rules are applied on each step. We finish if the word "derivace" is missing in the expression or after 100 steps. Robert Marik ------------------------------------------------------------------------------------------------------- constantp_not1 (x%) := constantp(x%) and x% # 1; matchdeclare(g,true,n,constantp_not1,c,constantp); /* formulas with chain rule */ defrule(c1, derivace(c), (print ("constant: (",c,")'=0"), 0)); defrule(x1, derivace(x), (print ("x: (",x,")'=1"), 1)); defrule(r1, derivace(sin(g)), (print ("sine: (sin(",g,"))'=cos(",g,")*(",g,")'"),if g=x then cos(x) else cos(g)*derivace(g))); defrule(r2, derivace(cos(g)), (print ("cosine: (sin(",g,"))'=cos(",g,")*(",g,")'"), if g=x then -sin(x) else -sin(g)*derivace(g))); defrule(r3, derivace(tan(g)), (print ("tangent: (tan(",g,"))'=1/cos^2(",g,")*(",g,")'"), if g=x then 1/(cos(x))^2 else 1/(cos(g))^2*derivace(g))); defrule(r4, derivace(cot(g)), ( print ("cotangent: (cot(",g,"))'=1/sin^2(",g,")*(",g,")'"), if g=x then -1/(sin(x))^2 else -1/(sin(g))^2*derivace(g))); defrule(r5, derivace(n), (print ("constant",n),0)); defrule(r6, derivace(g^n), (print ("power: (",g^n,")'=",n*g^(n-1),"*(",(g),")'"), if g=x then n*x^(n-1) else n*(g)^(n-1)*derivace(g))); defrule(r7, derivace(exp(g)), (print ("natural eponential: (",exp(g),")'=",exp(g),"*(",(g),")'"), if g=x then exp(x) else exp(g)*derivace(g))); defrule(r8, derivace(n^g), (print ("eponential: (",n^g,")'=",log(n)*n^g,"*(",(g),")'"), if g=x then log(n)*n^g else log(n)*n^(g)*derivace(g))); defrule(r9, derivace(log(g)), (print ("logarithm: (",log(g),")'=",1/g,"*(",(g),")'"), if g=x then 1/g else 1/(g)*derivace(g))); defrule(r10, derivace(log10(g)), (print ("decadic logarithm: (",log10(g),")'=",1/(g*log(10)),"*(",(g),")'"), if g=x then 1/(g*log(10)) else 1/(g*log(10))*derivace(g))); defrule(r11, derivace(asin(g)), (print ("arcsin: (",asin(g),")'=",1/sqrt(1-g^2),"*(",(g),")'"), if g=x then 1/sqrt(1-g^2) else 1/sqrt(1-g^2)*derivace(g))); defrule(r12, derivace(acos(g)), (print ("arccos: (",acos(g),")'=",-1/sqrt(1-g^2),"*(",(g),")'"), if g=x then -1/sqrt(1-g^2) else -1/sqrt(1-g^2)*derivace(g))); defrule(r13, derivace(atan(g)), (print ("arctan: (",atan(g),")'=",1/(1+g^2),"*(",(g),")'"), if g=x then 1/(1+g^2) else 1/(1+g^2)*derivace(g))); defrule(r14, derivace(acot(g)), (print ("arccotan: (",acot(g),")'=",-1/(1+g^2),"*(",(g),")'"), if g=x then -1/(1+g^2) else -1/(1+g^2)*derivace(g))); /* product and quotient rule */ derivsoucinu(expr):= if (op(expr)="*") then (u:args(expr)[1], v:expr/u, print("product: (",u*v,")'=..."),derivace(u)*v+u*derivace(v)) else derivace(expr); derivpodilu(expr):= if (op(expr)=op(u/v)) then (u:args(expr)[1], v:u/expr, print("quotient: (",u/v,")'=..."), (derivace(u)*v-u*derivace(v))/(v^2)) else derivace(expr); declare(derivace,linear); derivacep(expr):=numberp(ssearch("derivace",string(expr))); diff_one_step(fce):= if derivacep(fce) then ( block(initfce:string(fce), newfce:fce, for i:0 step 1 unless ((i>100) or (string(fce)#string(newfce))) do (maxapplydepth:i, newfce:apply2(fce,c1,x1,r5,r1,r2,r3,r4,r6,r7,r8,r9,r10,r11,r12,r13,r14))), if fce#newfce then newfce else (aa:''tryproduct(fce), if aa#fce then aa else (bb:''tryquotient(fce), if bb#fce then bb else fce ) ) ) else print("nothing more to differentiate ...") ; /* function to differentiate products and quotients */ tryproduct(expr):= ( exprstr:string(expr), newexprstr:ssubst("derivsoucinu","derivace",exprstr), eval_string(newexprstr) ); tryquotient(expr):= ( exprstr:string(expr), newexprstr:ssubst("derivpodilu","derivace",exprstr), eval_string(newexprstr) ); diff_in_steps(expr):= (newfce:derivace(expr), for counter:1 step 1 unless ((counter>100) or (not(derivacep(newfce)))) do ( newfce:diff_one_step(newfce), print("y'=",newfce) ) ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080303/9c6befa2/attachment.htm From fateman at cs.berkeley.edu Sun Mar 2 18:43:52 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Sun, 2 Mar 2008 16:43:52 -0800 Subject: [Maxima] maxima - rules and patterns In-Reply-To: <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> References: <47C2A14A.50902@mendelu.cz> <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> Message-ID: <000901c87cc7$a7d8d280$0400a8c0@RJFE510> I suggest you remove all the print() statements and just try trace(r1) etc. Alternatively, Your program seems to be quite long, and hardly using maxima. Maxima knows how to do diff(sin(f(x)),x), etc etc so why not use that information instead of typing it in again? For example, something like this.. If E is an atom, then if E=x then 1 else 0 else /* here we know that E= g(a); compute dE = g(f1(x)). set df1(x)/dx etc to 1. You then have the gradient of g, regardless of whether g is sin, cos, asin, .... now look at a ... and compute its derivative as needed. This should be about 5 lines of code, except that you will need to deal with variable numbers of arguments for + and *. RJF _____ From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Robert Marik Sent: Sunday, March 02, 2008 3:48 PM To: maxima at math.utexas.edu Subject: Re: [Maxima] maxima - rules and patterns On Tue, Feb 26, 2008 at 5:42 PM, Robert Dodier wrote: If you post the rules you want to implement, in some non-Maxima notation, I can help you translate them (or I'll try, anyway) into Maxima rules. best Robert Dodier I have the following code, which seems to work, the function diff_in_steps(x^2*sin(x^3)) differentiates with respect to x and shows steps, but it fails for diff_in_steps(x^2*sin(y)) It remains to solve this problem (it is not possible to use parameters or functions in more variables) and also to format the result for reading -- with tex and texput(derivace,["\\left(","\\right)^\\prime"],matchfix) Since I am new in Maxima (I use it for less than one year), I would like to post my code to this group. If you have any suggestions or improvements, let me know please. Short explanation of the code: The string to be differentiated is in the function derivace(expr) - I use the Czech word in order not to break anything. The function derivace is declared to be linear We try the usual rules for basic elementary functions first. If all the rules fail, we try to use product rule and if this fails as well, we try quotient rule. (here I observed a strange thing: op(u/v) gives "//" on debian and "/" on archlinux) We try the product rule as follows: we replace the function derivace with derivsoucinu and this new function returns derivace(expr) if expr is not a product or derivace(u)*v+u*derivace(v). In a similar way we work with quotient. We use small maxapplydepth to ensure that only one or few rules are applied on each step. We finish if the word "derivace" is missing in the expression or after 100 steps. Robert Marik ---------------------------------------------------------------------------- --------------------------- constantp_not1 (x%) := constantp(x%) and x% # 1; matchdeclare(g,true,n,constantp_not1,c,constantp); /* formulas with chain rule */ defrule(c1, derivace(c), (print ("constant: (",c,")'=0"), 0)); defrule(x1, derivace(x), (print ("x: (",x,")'=1"), 1)); defrule(r1, derivace(sin(g)), (print ("sine: (sin(",g,"))'=cos(",g,")*(",g,")'"),if g=x then cos(x) else cos(g)*derivace(g))); defrule(r2, derivace(cos(g)), (print ("cosine: (sin(",g,"))'=cos(",g,")*(",g,")'"), if g=x then -sin(x) else -sin(g)*derivace(g))); defrule(r3, derivace(tan(g)), (print ("tangent: (tan(",g,"))'=1/cos^2(",g,")*(",g,")'"), if g=x then 1/(cos(x))^2 else 1/(cos(g))^2*derivace(g))); defrule(r4, derivace(cot(g)), ( print ("cotangent: (cot(",g,"))'=1/sin^2(",g,")*(",g,")'"), if g=x then -1/(sin(x))^2 else -1/(sin(g))^2*derivace(g))); defrule(r5, derivace(n), (print ("constant",n),0)); defrule(r6, derivace(g^n), (print ("power: (",g^n,")'=",n*g^(n-1),"*(",(g),")'"), if g=x then n*x^(n-1) else n*(g)^(n-1)*derivace(g))); defrule(r7, derivace(exp(g)), (print ("natural eponential: (",exp(g),")'=",exp(g),"*(",(g),")'"), if g=x then exp(x) else exp(g)*derivace(g))); defrule(r8, derivace(n^g), (print ("eponential: (",n^g,")'=",log(n)*n^g,"*(",(g),")'"), if g=x then log(n)*n^g else log(n)*n^(g)*derivace(g))); defrule(r9, derivace(log(g)), (print ("logarithm: (",log(g),")'=",1/g,"*(",(g),")'"), if g=x then 1/g else 1/(g)*derivace(g))); defrule(r10, derivace(log10(g)), (print ("decadic logarithm: (",log10(g),")'=",1/(g*log(10)),"*(",(g),")'"), if g=x then 1/(g*log(10)) else 1/(g*log(10))*derivace(g))); defrule(r11, derivace(asin(g)), (print ("arcsin: (",asin(g),")'=",1/sqrt(1-g^2),"*(",(g),")'"), if g=x then 1/sqrt(1-g^2) else 1/sqrt(1-g^2)*derivace(g))); defrule(r12, derivace(acos(g)), (print ("arccos: (",acos(g),")'=",-1/sqrt(1-g^2),"*(",(g),")'"), if g=x then -1/sqrt(1-g^2) else -1/sqrt(1-g^2)*derivace(g))); defrule(r13, derivace(atan(g)), (print ("arctan: (",atan(g),")'=",1/(1+g^2),"*(",(g),")'"), if g=x then 1/(1+g^2) else 1/(1+g^2)*derivace(g))); defrule(r14, derivace(acot(g)), (print ("arccotan: (",acot(g),")'=",-1/(1+g^2),"*(",(g),")'"), if g=x then -1/(1+g^2) else -1/(1+g^2)*derivace(g))); /* product and quotient rule */ derivsoucinu(expr):= if (op(expr)="*") then (u:args(expr)[1], v:expr/u, print("product: (",u*v,")'=..."),derivace(u)*v+u*derivace(v)) else derivace(expr); derivpodilu(expr):= if (op(expr)=op(u/v)) then (u:args(expr)[1], v:u/expr, print("quotient: (",u/v,")'=..."), (derivace(u)*v-u*derivace(v))/(v^2)) else derivace(expr); declare(derivace,linear); derivacep(expr):=numberp(ssearch("derivace",string(expr))); diff_one_step(fce):= if derivacep(fce) then ( block(initfce:string(fce), newfce:fce, for i:0 step 1 unless ((i>100) or (string(fce)#string(newfce))) do (maxapplydepth:i, newfce:apply2(fce,c1,x1,r5,r1,r2,r3,r4,r6,r7,r8,r9,r10,r11,r12,r13,r14))), if fce#newfce then newfce else (aa:''tryproduct(fce), if aa#fce then aa else (bb:''tryquotient(fce), if bb#fce then bb else fce ) ) ) else print("nothing more to differentiate ...") ; /* function to differentiate products and quotients */ tryproduct(expr):= ( exprstr:string(expr), newexprstr:ssubst("derivsoucinu","derivace",exprstr), eval_string(newexprstr) ); tryquotient(expr):= ( exprstr:string(expr), newexprstr:ssubst("derivpodilu","derivace",exprstr), eval_string(newexprstr) ); diff_in_steps(expr):= (newfce:derivace(expr), for counter:1 step 1 unless ((counter>100) or (not(derivacep(newfce)))) do ( newfce:diff_one_step(newfce), print("y'=",newfce) ) ); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080302/066e26d0/attachment-0001.htm From robert.dodier at gmail.com Sun Mar 2 20:27:06 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 2 Mar 2008 19:27:06 -0700 Subject: [Maxima] maxima - rules and patterns In-Reply-To: <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> References: <47C2A14A.50902@mendelu.cz> <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> Message-ID: On 3/2/08, Robert Marik wrote: > I have the following code, which seems to work, the function > diff_in_steps(x^2*sin(x^3)) > differentiates with respect to x and shows steps, but it fails for > diff_in_steps(x^2*sin(y)) Seems to work better with the following matchdeclare incantation. Instead of recognizing constants I think you want expressions which don't depend on x (since it appears the variable for differentiation is always x and not something else). freeofx (e) := freeof ('x, e); freeofx_not1 (e) := e # 1 and freeofx (e); matchdeclare(g,true,n,freeofx_not1,c,freeofx); Then I get (%i5) diff_in_steps(x^2*sin(y)); 2 product: ( (x sin(y)) )'=... 2 2 y'= x derivace(sin(y)) + derivace(x ) sin(y) 2 power: ( x )'= (2 x) *( x )' free of x: ( sin(y) )'=0 y'= (2 x sin(y)) (%o5) done > It remains to solve this problem (it is not possible to use parameters or > functions in more variables) Not sure what you mean here. > and also to format the result for reading -- > with tex and texput(derivace,["\\left(","\\right)^\\prime"],matchfix) Looks like texput(derivace, "\\prime", postfix) works OK here. tex (derivace (x * y * z)); => $$\left(x\,y\,z\right)\prime$$ Note that tex threw in parentheses here. > (here I observed a strange thing: op(u/v) gives "//" > on debian and "/" on archlinux) Probably a version difference. op(a/b) => "//" until a pretty recent version, now it op(a/b) => "/". Hope this helps, Robert Dodier From robert.dodier at gmail.com Sun Mar 2 21:40:27 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 2 Mar 2008 20:40:27 -0700 Subject: [Maxima] maxima - rules and patterns In-Reply-To: <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> References: <47C2A14A.50902@mendelu.cz> <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> Message-ID: On 3/2/08, Robert Marik wrote: > defrule(r1, derivace(sin(g)), (print ("sine: > (sin(",g,"))'=cos(",g,")*(",g,")'"),if g=x then cos(x) else > cos(g)*derivace(g))); > defrule(r2, derivace(cos(g)), (print ("cosine: > (sin(",g,"))'=cos(",g,")*(",g,")'"), if g=x then -sin(x) > else -sin(g)*derivace(g))); The rules for specific functions can probably be abbreviated as follows. Associate function names and their derivatives via the property list. Then use defrule to match the function name and retrieve the derivative property when there is a match. qput (sin, cos, derivace); qput (cos, lambda ([u], - sin(u)), derivace); /* etc etc */ matchdeclare (ff, lambda ([e], symbolp (e) and get (e, 'derivace) # false)); matchdeclare (uu, all); defrule (rf, derivace (ff (uu)), apply (get (ff, 'derivace), [uu]) * derivace (uu)); apply1 (derivace (sin (x^2)), rf); => derivace(x^2)*cos(x^2) apply1 (derivace (cos (x^2)), rf); => -derivace(x^2)*sin(x^2) apply1 (derivace (tan(x^2)), rf); => derivace (tan(x^2) /* since tan does not have the derivace property */ HTH Robert Dodier From marik at mendelu.cz Mon Mar 3 01:35:18 2008 From: marik at mendelu.cz (Robert Marik) Date: Mon, 03 Mar 2008 08:35:18 +0100 Subject: [Maxima] maxima - rules and patterns In-Reply-To: References: <47C2A14A.50902@mendelu.cz> <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> Message-ID: <47CBAA36.90209@mendelu.cz> Many thanks to both Robert Dodier and Richard Fateman for their suggestions. I very appreciate the help from maxima discucssion list. I tried something like freeofx (e) := freeof ('x, e); but this was not working for me die to the missing quotation mark at x. Robert Dodier wrote: >> It remains to solve this problem (it is not possible to use parameters or >> functions in more variables) > > Not sure what you mean here. > Sorry that I was unclear, my english is still poor. I meant exactly the freeofx property - it was not possible to use more variables or parameters, since for example y was not recognized as constant. With this fix it works. I'll try to follow the hints how to reduce the length of the code, but I wish to get info which rule has been applied and how - this is the reason for many print commands. But I'll try to improve it. I have one another (but closely related) question: I wish to define a function trylinear(expr) which expands all subexpressions of expr of the type derivace(a*x+b) into a*derivace(x)+b and keeps for example derivace(x^2) intact. I tried the following code trylinear(expr):= (declare(derivace,linear),expr:''expr, remove(derivace,linear),expr) with several modifications (define instead of :=, '' on various places, block and ev command) but I was not able to get expected results. Is there any way to define the function trylinear to get required behavior? Many thanks Robert Marik From marik at mendelu.cz Mon Mar 3 02:04:53 2008 From: marik at mendelu.cz (Robert Marik) Date: Mon, 03 Mar 2008 09:04:53 +0100 Subject: [Maxima] maxima - rules and patterns In-Reply-To: <47CBAA36.90209@mendelu.cz> References: <47C2A14A.50902@mendelu.cz> <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> <47CBAA36.90209@mendelu.cz> Message-ID: <47CBB125.4020705@mendelu.cz> Robert Marik wrote: > I have one another (but closely related) question: I wish to define a > function trylinear(expr) which expands all subexpressions of expr of the > type derivace(a*x+b) into a*derivace(x)+b and keeps for example > derivace(x^2) intact. I tried the following code > > trylinear(expr):= > (declare(derivace,linear),expr:''expr, remove(derivace,linear),expr) > > with several modifications (define instead of :=, '' on various places, > block and ev command) but I was not able to get expected results. Is > there any way to define the function trylinear to get required behavior? > It after more attempts, the following code seems to work trylinear(expr):=(ev(ev(exprlin:expr,declare(derivace,linear)), remove(derivace,linear)),remove(derivace,linear),exprlin) Robert Marik From marik at mendelu.cz Mon Mar 3 08:28:44 2008 From: marik at mendelu.cz (Robert Marik) Date: Mon, 3 Mar 2008 15:28:44 +0100 (MET) Subject: [Maxima] log(-1) Message-ID: hello all on debian lenny I get the following result (%i7) float(log(-1)^2); (%o7) - 9.869604401089358 This seems to be incorrect, isn't it? Robert Marik From macrakis at alum.mit.edu Mon Mar 3 08:33:49 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 3 Mar 2008 09:33:49 -0500 Subject: [Maxima] log(-1) In-Reply-To: References: Message-ID: <8b356f880803030633r1784a401q98e1e8dcad82b050@mail.gmail.com> On Mon, Mar 3, 2008 at 9:28 AM, Robert Marik wrote: > (%i7) float(log(-1)^2); > (%o7) - 9.869604401089358 > > This seems to be incorrect, isn't it? No, it is correct. log(-1) = %i*%pi. (%i*%pi)^2 = - %pi^2 float=> -9.86. -s From marik at mendelu.cz Mon Mar 3 08:41:41 2008 From: marik at mendelu.cz (Robert Marik) Date: Mon, 3 Mar 2008 15:41:41 +0100 (MET) Subject: [Maxima] log(-1) In-Reply-To: <8b356f880803030633r1784a401q98e1e8dcad82b050@mail.gmail.com> References: <8b356f880803030633r1784a401q98e1e8dcad82b050@mail.gmail.com> Message-ID: Aha, I forgot .... Sorry for this stupid mistake. Robert ************************************************************** Mgr. Robert Marik, Ph.D. (Robert Ma\v r\'\i k) Dpt. of Mathematics, Mendel University Brno (www.mendelu.cz) Zemedelska 3 613 00 Brno, CZECH REPUBLIC tel:+420 5 4513 4030 ************************************************************** On Mon, 3 Mar 2008, Stavros Macrakis wrote: > On Mon, Mar 3, 2008 at 9:28 AM, Robert Marik wrote: > > (%i7) float(log(-1)^2); > > (%o7) - 9.869604401089358 > > > > This seems to be incorrect, isn't it? > > No, it is correct. log(-1) = %i*%pi. (%i*%pi)^2 = - %pi^2 float=> -9.86. > > -s > From robert.dodier at gmail.com Mon Mar 3 09:07:06 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 3 Mar 2008 08:07:06 -0700 Subject: [Maxima] maxima - rules and patterns In-Reply-To: <47CBB125.4020705@mendelu.cz> References: <47C2A14A.50902@mendelu.cz> <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> <47CBAA36.90209@mendelu.cz> <47CBB125.4020705@mendelu.cz> Message-ID: On 3/3/08, Robert Marik wrote: > trylinear(expr):=(ev(ev(exprlin:expr,declare(derivace,linear)), > remove(derivace,linear)),remove(derivace,linear),exprlin) Hmm. That seems too complicated; does the following work? trylinear (expr) := (declare (derivace, linear), expr : ev (expr), remove (derivace, linear), expr); Something for the developers to think about -- it would be helpful to have a construct like assuming (p(x), q(x)) do (foo, bar, baz); where p(x) and q(x) are some predicates such as featurep(x, linear). This "assuming" construct would place whatever declarations are necessary at the beginning and end, and just as importantly, catch any errors or other stack unwinding, and restore the status quo ante. Such a construct would be both neater and more nearly foolproof. We've probably talked about such a thing before -- I'm just throwing another stick on the fire. FWIW Robert Dodier From fateman at cs.berkeley.edu Mon Mar 3 09:21:39 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Mon, 3 Mar 2008 07:21:39 -0800 Subject: [Maxima] maxima - rules and patterns In-Reply-To: <47CBB125.4020705@mendelu.cz> References: <47C2A14A.50902@mendelu.cz> <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> <47CBAA36.90209@mendelu.cz> <47CBB125.4020705@mendelu.cz> Message-ID: <003601c87d42$4741d770$0400a8c0@RJFE510> Not knowing what you are trying to do exactly, it is hard to say how to do it. But the program you display is a mess, mixing expressions that should be evaluated once, like declare, with others which you evaluate too many times. nzfx(x,z):=freeof(x,z) and not(z=0); matchdeclare(a,freeof(x)); matchdeclare(b,nzfx(x)); defrule(r1,dd(a*x+b),a*dd(x)+b); You may also need to do something different to get dd(a*x) to a*dd(x), like (not1(z):=not(is( z=1)), matchdeclare(c,not1), defrule(r2,dd(c*x),c*dd(x))) > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Robert Marik > Sent: Monday, March 03, 2008 12:05 AM > To: maxima at math.utexas.edu > Subject: Re: [Maxima] maxima - rules and patterns > > Robert Marik wrote: > > > I have one another (but closely related) question: I wish > to define a > > function trylinear(expr) which expands all subexpressions > of expr of the > > type derivace(a*x+b) into a*derivace(x)+b and keeps for example > > derivace(x^2) intact. I tried the following code > > > > trylinear(expr):= > > (declare(derivace,linear),expr:''expr, remove(derivace,linear),expr) > > > > with several modifications (define instead of :=, '' on > various places, > > block and ev command) but I was not able to get expected > results. Is > > there any way to define the function trylinear to get > required behavior? > > > > > It after more attempts, the following code seems to work > > trylinear(expr):=(ev(ev(exprlin:expr,declare(derivace,linear)), > remove(derivace,linear)),remove(derivace,linear),exprlin) > > Robert Marik > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From macrakis at alum.mit.edu Mon Mar 3 09:36:28 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 3 Mar 2008 10:36:28 -0500 Subject: [Maxima] maxima - rules and patterns In-Reply-To: References: <47C2A14A.50902@mendelu.cz> <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> <47CBAA36.90209@mendelu.cz> <47CBB125.4020705@mendelu.cz> Message-ID: <8b356f880803030736h65ea2461gb52807762e494252@mail.gmail.com> On Mon, Mar 3, 2008 at 10:07 AM, Robert Dodier wrote: > On 3/3/08, Robert Marik wrote: > > trylinear(expr):=(ev(ev(exprlin:expr,declare(derivace,linear)), > > remove(derivace,linear)),remove(derivace,linear),exprlin) > > Hmm. That seems too complicated; does the following work? > > trylinear (expr) := (declare (derivace, linear), expr : ev (expr), > remove (derivace, linear), expr); > > Something for the developers to think about -- it would be helpful to > have a construct like > > assuming (p(x), q(x)) do (foo, bar, baz); > > where p(x) and q(x) are some predicates such as featurep(x, linear). I must be missing something here. Why is derivace sometimes linear and sometimes not? -s From ronis at ronispc.chem.mcgill.ca Mon Mar 3 15:33:05 2008 From: ronis at ronispc.chem.mcgill.ca (David Ronis) Date: Mon, 03 Mar 2008 16:33:05 -0500 Subject: [Maxima] New testsuite failure in today's CVS Message-ID: <1204579985.10288.14.camel@ronispc.chem.mcgill.ca> I just rebuilt against CVS (as of 1/2 hr ago). I get the following testsuite failure: ********************** Problem 24 *************** Input: solve(%, [x, y]) Result: [[x = 2, y = 2], [x = .5202594388652008 %i - .1331240357358706, y = .07678378523787788 - 3.608003221870287 %i], [x = - .5202594388652008 %i - .1331240357358706, y = 3.608003221870287 %i + .07678378523787788], [x = - 1.733751846381093, y = - .1535675710019696]] This differed from the expected result: [[x = 2, y = 2], [x = .5202594388652008 %i - .1331240357358706, y = .07678378523787777 - 3.608003221870287 %i], [x = - .1331240357358706 - .5202594388652008 %i, y = .07678378523787777 + 3.608003221870287 %i], [x = - 1.733751846381093, y = - .1535675710019696]] 70/71 tests passed. David From raymond.toy at ericsson.com Mon Mar 3 16:48:05 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Mon, 03 Mar 2008 17:48:05 -0500 Subject: [Maxima] New testsuite failure in today's CVS In-Reply-To: <1204579985.10288.14.camel@ronispc.chem.mcgill.ca> References: <1204579985.10288.14.camel@ronispc.chem.mcgill.ca> Message-ID: <47CC8025.9060408@ericsson.com> David Ronis wrote: > I just rebuilt against CVS (as of 1/2 hr ago). I get the following > testsuite failure: > > ********************** Problem 24 *************** > Input: > solve(%, [x, y]) > > > Result: > [[x = 2, y = 2], [x = .5202594388652008 %i - .1331240357358706, > y = .07678378523787788 - 3.608003221870287 %i], > [x = - .5202594388652008 %i - .1331240357358706, > y = 3.608003221870287 %i + .07678378523787788], > [x = - 1.733751846381093, y = - .1535675710019696]] > > This differed from the expected result: > [[x = 2, y = 2], [x = .5202594388652008 %i - .1331240357358706, > y = .07678378523787777 - 3.608003221870287 %i], > [x = - .1331240357358706 - .5202594388652008 %i, > y = .07678378523787777 + 3.608003221870287 %i], > [x = - 1.733751846381093, y = - .1535675710019696]] > > 70/71 tests passed. I can confirm this. Seems to be a round off problem. But when did solve start returning numeric answers? I thought it returned symbolic answers. (Perhaps it was always that way and I never noticed since this test used to pass.) Ray From willisb at unk.edu Mon Mar 3 17:54:42 2008 From: willisb at unk.edu (Barton Willis) Date: Mon, 3 Mar 2008 17:54:42 -0600 Subject: [Maxima] New testsuite failure in today's CVS In-Reply-To: <47CC8025.9060408@ericsson.com> References: <1204579985.10288.14.camel@ronispc.chem.mcgill.ca>, <47CC8025.9060408@ericsson.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >But when did solve start returning numeric answers? The option variable algexact controls this. The test is (%i85) eqs : [4*x^2-y^2 = 12,x*y-x = 2]$ Solve with algexact : true (non-default) (%i86) solve(eqs,[x,y]), algexact : true$ The solution is a mess. Convert to 235 digit big floats (%i87) bsol : bfloat(rectform(%)), fpprec : 235$ Convert to doubles and sort (%i88) bsol : sort(float(bsol))$ Solve using algexact : false (default) (%i89) sol : sort(float(solve(eqs,[x,y]))), algexact : false; (%o89) [[x=-1.733751846381093,y=-0.15356757100197], ...] Compare to bsol (%i90) bsol-sol; (%o90) [[0=-8.2147165736401462*10^-8, ... Not so good -- this is with 5.14.0. Is there another option variable that controls the accuracy of float solutions when algexact : false? Barton From rswarbrick at googlemail.com Mon Mar 3 19:10:44 2008 From: rswarbrick at googlemail.com (Rupert Swarbrick) Date: Tue, 04 Mar 2008 01:10:44 +0000 Subject: [Maxima] :lisp support in testsuite Message-ID: <1204593044.7056.13.camel@hake> I've not really looked at maxima much (or not the code at any rate) for a couple of weeks, due to work/hurting arm/getting new computer/general procrastination... but: The attached patch (against this afternoon's HEAD) gives the testsuite support for :lisp and I think could be extended reasonably easily to other break commands if so wished. The basic changes are: 1) lisp-eval and lisp-quiet (which are called by break-call when you do :lisp or :lisp-quiet) now return something, specifically the list of values. Before, :lisp (+ 1 2) would print 3 with princ, but left it at that, so calling code definitely couldn't get at the results. I don't think this is likely to break anything - lisp-* didn't return anything useful before, just nil I think, so I presume no-one's testing in any contrib code for anything like their return values! 2) test-batch now uses dbm-read to get new lines. This doesn't break anything... EXCEPT: A stream ending in some whitespace including actual spaces/tabs causes an error break in dbm-read. rtest_dot.mac and rtest_abs.mac did just that and it seemed highly non-trivial to get dbm-read to swallow the result without choking, so I'm afraid for the time being I've just deleted the crazy whitespace at their ends. (After all, I can't really imagine anyone having strong feelings about keeping it!) I can't think of any other uses that this could impact upon, so I presume it's ok. 3) test-batch then does clever stuff, partially lifted from continue (macsys.lisp) to detect and then run :lisp break commands. It doesn't seem trivial to share the code particulary as continue allows general break commands (we're only allowing :lisp) and does checking for server mode etc. 4) There's a test!!! (-: In rtest_testsuite.mac, and yes it should probably be made more complete, but this at least shows that everything I changed works I hope. Does this seem suitable? Rupert P.S. the patch needs "patch -p1 References: <1204579985.10288.14.camel@ronispc.chem.mcgill.ca> <47CC8025.9060408@ericsson.com> Message-ID: On Mon, Mar 3, 2008 at 3:48 PM, Raymond Toy (RT/EUS) > > Result: > > [[x = 2, y = 2], [x = .5202594388652008 %i - .1331240357358706, > > y = .07678378523787788 - 3.608003221870287 %i], > > [x = - .5202594388652008 %i - .1331240357358706, > > y = 3.608003221870287 %i + .07678378523787788], > > [x = - 1.733751846381093, y = - .1535675710019696]] > > > > This differed from the expected result: > > [[x = 2, y = 2], [x = .5202594388652008 %i - .1331240357358706, > > y = .07678378523787777 - 3.608003221870287 %i], > > [x = - .1331240357358706 - .5202594388652008 %i, > > y = .07678378523787777 + 3.608003221870287 %i], > > [x = - 1.733751846381093, y = - .1535675710019696]] > I can confirm this. Seems to be a round off problem. Yes, I've seen it too. But is it maybe a simplification artifact? I've run into cases in which two expressions involving subtraction and/or negative numbers might be displayed the same, but internally they are different & so the test suite comparison function complains. Robert From robert.dodier at gmail.com Mon Mar 3 20:43:13 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 3 Mar 2008 19:43:13 -0700 Subject: [Maxima] maxima - rules and patterns In-Reply-To: <8b356f880803030736h65ea2461gb52807762e494252@mail.gmail.com> References: <47C2A14A.50902@mendelu.cz> <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> <47CBAA36.90209@mendelu.cz> <47CBB125.4020705@mendelu.cz> <8b356f880803030736h65ea2461gb52807762e494252@mail.gmail.com> Message-ID: On Mon, Mar 3, 2008 at 8:36 AM, Stavros Macrakis wrote: > I must be missing something here. Why is derivace sometimes linear > and sometimes not? Well, I think the goal is to reimplement the rules for derivatives, but under control of the user, so that only one rule is applied at a time. A rule for linearity could also be constructed via defrule, in which case the declare(..., linear) and remove(..., linear) stuff isn't needed. Robert From dtc-maxima at scieneer.com Mon Mar 3 21:51:36 2008 From: dtc-maxima at scieneer.com (Douglas Crosher) Date: Tue, 04 Mar 2008 14:51:36 +1100 Subject: [Maxima] New testsuite failure in today's CVS In-Reply-To: References: <1204579985.10288.14.camel@ronispc.chem.mcgill.ca>, <47CC8025.9060408@ericsson.com> Message-ID: <47CCC748.40803@scieneer.com> Barton Willis wrote: ... > Not so good -- this is with 5.14.0. Is there another option variable > that controls the accuracy of float solutions when algexact : false? The function $algsys rounds the results by calling 'roundroots1 which in turn calls 'maxima-rationalize. The variable '$ratepsilon is being bound to 1.0e-7 by $algsys so can not be controlled. Perhaps this rounding is intended to help detect equivalent solutions in the presence of numerical inaccuracy, and if so then perhaps a value of '2 * flonum-epsilon' would be more appropriate, or perhaps '$algdelta? Regards Douglas Crosher From marik at mendelu.cz Mon Mar 3 23:57:09 2008 From: marik at mendelu.cz (Robert Marik) Date: Tue, 4 Mar 2008 06:57:09 +0100 Subject: [Maxima] maxima - rules and patterns In-Reply-To: References: <47C2A14A.50902@mendelu.cz> <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> <47CBAA36.90209@mendelu.cz> <47CBB125.4020705@mendelu.cz> <8b356f880803030736h65ea2461gb52807762e494252@mail.gmail.com> Message-ID: <9d9199c20803032157r785768d6w66970653a0341bc4@mail.gmail.com> Yes, as Robert Dodier wrote, I wish to get a web application witch differentiates function in small short steps. The draft version is on http://wood.mendelu.cz/math/maw/derivace/derivace.html (this link changes in future). I wish to prevent expansion of (sin(3x+x^2))'=cos(3x+x^2) * (3*(x)'+(x^2)') since the step (sin(3x+x^2))'=cos(3x+x^2) * (3x+x^2)' is skipped. As I wrote, I have a draft version of this application, but I am not fully satisfied with the result and I will try the hints from this discussion group. So thank you for your answers. Robert Marik On Tue, Mar 4, 2008 at 3:43 AM, Robert Dodier wrote: > On Mon, Mar 3, 2008 at 8:36 AM, Stavros Macrakis > wrote: > > > I must be missing something here. Why is derivace sometimes linear > > and sometimes not? > > Well, I think the goal is to reimplement the rules for derivatives, > but under control of the user, so that only one rule is applied > at a time. > > A rule for linearity could also be constructed via defrule, > in which case the declare(..., linear) and remove(..., linear) > stuff isn't needed. > > Robert > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080304/05c5f7e8/attachment-0001.htm From willisb at unk.edu Tue Mar 4 06:32:37 2008 From: willisb at unk.edu (Barton Willis) Date: Tue, 4 Mar 2008 06:32:37 -0600 Subject: [Maxima] New testsuite failure in today's CVS In-Reply-To: References: <1204579985.10288.14.camel@ronispc.chem.mcgill.ca> <47CC8025.9060408@ericsson.com>, Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Yes, I've seen it too. But is it maybe a simplification artifact? No, I think approx-alike is doing its job. (%i1) [4*x^2-y^2 = 12,x*y-x = 2]; (%o1) [4*x^2-y^2=12,x*y-x=2] Here is the solution using 5.14: (%i2) sol_514 : solve(%,[x,y]); (%o2) [[x=2,y=2],[x=0.5202594388652*%i-0.13312403573587,y=0.076783785237878-3.608003221870287 *%i],[x= -0.5202594388652 *%i-0.13312403573587,y=3.608003221870287*%i+0.076783785237878],[x=-1.733751846381093,y=- 0.15356757100197]] And a solution from Maxima CVS (sbcl / windows) (%i3) sol_cvs : [[x = 2, y = 2], [x = .5202594388652008 * %i - .1331240357358706, y = .07678378523787788 - 3.608003221870287 * %i], [x = - .5202594388652008 * %i - .1331240357358706, y = 3.608003221870287 * %i + .07678378523787788], [x = - 1.733751846381093, y = - .1535675710019696]]$ There are some differences in the last few digits; approx-alike detects the differences: (%i4) ?approx\-alike(sol_514, sol_cvs); (%o4) false Increasing float_approx_equal_tolerance by a factor of 2 allows the test to pass: (%i5) float_approx_equal_tolerance : float_approx_equal_tolerance * 8$ (%i6) ?approx\-alike(sol_514, sol_cvs); (%o6) true (%i7) float_approx_equal_tolerance : float_approx_equal_tolerance / 4$ (%i8) ?approx\-alike(sol_514, sol_cvs); (%o8) true (%i9) float_approx_equal_tolerance : float_approx_equal_tolerance / 2$ (%i10) ?approx\-alike(sol_514, sol_cvs); (%o10) false Knuth, Vol. II, section 4.2.2 (page 233) gives suggestions on how to compare floats. We test equality using (defun $float_approx_equal (a b) (setq a (if (floatp a) a ($float a))) (setq b (if (floatp b) b ($float b))) (and (floatp a) (floatp b) (<= (abs (- a b)) (* $float_approx_equal_tolerance (min (abs a) (abs b)))))) Where we have min(abs(a), abs(b)), Knuth has min(2^exponent of a, 2^exponent of b). So I think our test is OK (but I wrote approx-alike and $float_approx_equal, so ...) Knuth also gives a weaker form of approximate equality that replaces min with max. Barton From raymond.toy at ericsson.com Tue Mar 4 08:52:10 2008 From: raymond.toy at ericsson.com (Raymond Toy (RT/EUS)) Date: Tue, 04 Mar 2008 09:52:10 -0500 Subject: [Maxima] New testsuite failure in today's CVS In-Reply-To: References: <1204579985.10288.14.camel@ronispc.chem.mcgill.ca>, <47CC8025.9060408@ericsson.com> Message-ID: <47CD621A.7020802@ericsson.com> Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > >> But when did solve start returning numeric answers? > > The option variable algexact controls this. The test is Ah, this example is in the help for solve. I should have looked there first. Sorry for the noise. Ray From dotancohen at gmail.com Wed Mar 5 03:12:40 2008 From: dotancohen at gmail.com (Dotan Cohen) Date: Wed, 5 Mar 2008 11:12:40 +0200 Subject: [Maxima] Rotating 3-D graphs Message-ID: <880dece00803050112q2d0b354fn5df636da0204c3e7@mail.gmail.com> I'm just getting my feet wet with Maxima. How can one rotate and zoom a 3-D graph created with Maxima? I'm on Ubuntu 7.04 if it matters, with Maxima 5.10.0. Additionally, the 3-D graphs seem to be of a transparent grid, which is rather difficult to see. How can that be turned into a sheet, coloured as per the height (z-axis value) of the x,y function? Thanks in advance. Dotan Cohen http://what-is-what.com http://gibberish.co.il ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? From joosteto at gmail.com Wed Mar 5 04:01:56 2008 From: joosteto at gmail.com (Joost Witteveen) Date: Wed, 5 Mar 2008 11:01:56 +0100 Subject: [Maxima] Rotating 3-D graphs In-Reply-To: <880dece00803050112q2d0b354fn5df636da0204c3e7@mail.gmail.com> References: <880dece00803050112q2d0b354fn5df636da0204c3e7@mail.gmail.com> Message-ID: On 05/03/2008, Dotan Cohen wrote: > I'm just getting my feet wet with Maxima. How can one rotate and zoom > a 3-D graph created with Maxima? I'm on Ubuntu 7.04 if it matters, > with Maxima 5.10.0. > > Additionally, the 3-D graphs seem to be of a transparent grid, which > is rather difficult to see. How can that be turned into a sheet, > coloured as per the height (z-axis value) of the x,y function? On my ubuntu (7.10, maxima 5.12 I think), maxima draws using gnuplot, and when draw surfaces with gnuplot (plot3d in maxima, splot in gnuplot), I can rotate them using the cursor keys (up/down, left/right) or the mouse. The surface with colors I get using (in maxima): plot3d(sin(x)*sin(y),[x,0,6],[y,0,6], [gnuplot_preamble, "set pm3d"]); Is this what you're looking for? From joosteto at gmail.com Wed Mar 5 04:28:23 2008 From: joosteto at gmail.com (Joost Witteveen) Date: Wed, 5 Mar 2008 11:28:23 +0100 Subject: [Maxima] Rotating 3-D graphs In-Reply-To: References: <880dece00803050112q2d0b354fn5df636da0204c3e7@mail.gmail.com> Message-ID: Sorry, replying to my own post:( > > I'm just getting my feet wet with Maxima. How can one rotate and zoom > On my ubuntu (7.10, maxima 5.12 I think), maxima draws using gnuplot, > and when draw surfaces with gnuplot (plot3d in maxima, splot in > gnuplot), I just checked using Debian (maxima 5.10), and rotating works when I draw using gnuplot directly, but not when I use gnuplot via maxima. However, this does work: (%i14) set_plot_option([plot_format, mgnuplot]); (%i15) plot3d(sin(x)*sin(y),[x,0,6],[y,0,6]); (This will give a tcl window with scales to rotate the curve) However, now the d3pm argument doesn't seem to have any effect:( From dotancohen at gmail.com Wed Mar 5 04:57:45 2008 From: dotancohen at gmail.com (Dotan Cohen) Date: Wed, 5 Mar 2008 12:57:45 +0200 Subject: [Maxima] Rotating 3-D graphs In-Reply-To: References: <880dece00803050112q2d0b354fn5df636da0204c3e7@mail.gmail.com> Message-ID: <880dece00803050257p5fc16bbexf52660617657fb2@mail.gmail.com> On 05/03/2008, Joost Witteveen wrote: > On 05/03/2008, Dotan Cohen wrote: > > I'm just getting my feet wet with Maxima. How can one rotate and zoom > > a 3-D graph created with Maxima? I'm on Ubuntu 7.04 if it matters, > > with Maxima 5.10.0. > > > > Additionally, the 3-D graphs seem to be of a transparent grid, which > > is rather difficult to see. How can that be turned into a sheet, > > coloured as per the height (z-axis value) of the x,y function? > > On my ubuntu (7.10, maxima 5.12 I think), maxima draws using gnuplot, > and when draw surfaces with gnuplot (plot3d in maxima, splot in > gnuplot), I can rotate them using the cursor keys (up/down, > left/right) or the mouse. > > The surface with colors I get using (in maxima): > > plot3d(sin(x)*sin(y),[x,0,6],[y,0,6], [gnuplot_preamble, "set pm3d"]); > > > Is this what you're looking for? > Thank you. With the [gnuplot_preamble, "set pm3d"] parameter set, I see a gridded sheet instead of just the grid, which helps a lot. However, either with or without, I cannot rotate with the arrow keys. I tried combining with the Shift, Ctrl, and Alt keys, but that did not help. Dotan Cohen http://what-is-what.com http://gibberish.co.il ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? From andrej.vodopivec at gmail.com Wed Mar 5 05:06:36 2008 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Wed, 5 Mar 2008 12:06:36 +0100 Subject: [Maxima] Rotating 3-D graphs In-Reply-To: <880dece00803050112q2d0b354fn5df636da0204c3e7@mail.gmail.com> References: <880dece00803050112q2d0b354fn5df636da0204c3e7@mail.gmail.com> Message-ID: <7775b21a0803050306i17f9dd85jca05ca58ca7b8ec9@mail.gmail.com> On Wed, Mar 5, 2008 at 10:12 AM, Dotan Cohen wrote: > I'm just getting my feet wet with Maxima. How can one rotate and zoom > a 3-D graph created with Maxima? I'm on Ubuntu 7.04 if it matters, > with Maxima 5.10.0. If you wish to have mouse support in gnuplot you will need to upgrade maxima at least to version 5.12. -- Andrej From dotancohen at gmail.com Wed Mar 5 05:15:08 2008 From: dotancohen at gmail.com (Dotan Cohen) Date: Wed, 5 Mar 2008 13:15:08 +0200 Subject: [Maxima] Rotating 3-D graphs In-Reply-To: References: <880dece00803050112q2d0b354fn5df636da0204c3e7@mail.gmail.com> Message-ID: <880dece00803050315g5e0fac00m8a46f13dd3f54557@mail.gmail.com> On 05/03/2008, Joost Witteveen wrote: > I just checked using Debian (maxima 5.10), and rotating works when I > draw using gnuplot directly, but not when I use gnuplot via maxima. > However, this does work: > > (%i14) set_plot_option([plot_format, mgnuplot]); > (%i15) plot3d(sin(x)*sin(y),[x,0,6],[y,0,6]); > > (This will give a tcl window with scales to rotate the curve) > However, now the d3pm argument doesn't seem to have any effect:( > Thanks, this works as you describe. I have a second window with controls that allow me to rotate the graph. However, like you mention, the d3pm parameter no longer colours in the graph. Should I ask on the gnuplot list about this? Dotan Cohen http://what-is-what.com http://gibberish.co.il ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? From dotancohen at gmail.com Wed Mar 5 05:17:01 2008 From: dotancohen at gmail.com (Dotan Cohen) Date: Wed, 5 Mar 2008 13:17:01 +0200 Subject: [Maxima] Rotating 3-D graphs In-Reply-To: <7775b21a0803050306i17f9dd85jca05ca58ca7b8ec9@mail.gmail.com> References: <880dece00803050112q2d0b354fn5df636da0204c3e7@mail.gmail.com> <7775b21a0803050306i17f9dd85jca05ca58ca7b8ec9@mail.gmail.com> Message-ID: <880dece00803050317y17f312cfnc5297424e48542b5@mail.gmail.com> On 05/03/2008, Andrej Vodopivec wrote: > On Wed, Mar 5, 2008 at 10:12 AM, Dotan Cohen wrote: > > I'm just getting my feet wet with Maxima. How can one rotate and zoom > > a 3-D graph created with Maxima? I'm on Ubuntu 7.04 if it matters, > > with Maxima 5.10.0. > > > If you wish to have mouse support in gnuplot you will need to upgrade > maxima at least to version 5.12. > Thanks, Andrej. I will look around for a 5.12 deb package. Good to know. Dotan Cohen http://what-is-what.com http://gibberish.co.il ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? From marik at mendelu.cz Wed Mar 5 07:02:05 2008 From: marik at mendelu.cz (Robert Marik) Date: Wed, 05 Mar 2008 14:02:05 +0100 Subject: [Maxima] maxima - rules and patterns In-Reply-To: References: <47C2A14A.50902@mendelu.cz> <9d9199c20803021548m384e36adq8d338c1b3006a524@mail.gmail.com> <47CBAA36.90209@mendelu.cz> <47CBB125.4020705@mendelu.cz> <8b356f880803030736h65ea2461gb52807762e494252@mail.gmail.com> Message-ID: <47CE99CD.1010009@mendelu.cz> Robert Dodier wrote: > On Mon, Mar 3, 2008 at 8:36 AM, Stavros Macrakis wrote: > >> I must be missing something here. Why is derivace sometimes linear >> and sometimes not? > > Well, I think the goal is to reimplement the rules for derivatives, > but under control of the user, so that only one rule is applied > at a time. > > A rule for linearity could also be constructed via defrule, > in which case the declare(..., linear) and remove(..., linear) > stuff isn't needed. > defrule is in fact better, since this covers cases like derivace(x^2*a^2) which are not covered by declare(..., linear) I use the following code for constant multiple rule: freeofx (e) := freeof ('x, e); notfreeofx (e) := not freeof ('x, e); freeofx_not1 (e) := e # 1 and freeofx (e); matchdeclare(a,notfreeofx,k,freeofx_not1); defrule(c2, derivace(k*a), k*derivace(a)); The site with these calculations is (English is not yet available and I continue to improve the code) on http://user.mendelu.cz/marik/maw/index.php?lang=en&form=derivace I hope, this will be useful for students. Thank you again for all hints I got from this maillist. Robert Marik > Robert > From sen1 at math.msu.edu Wed Mar 5 09:19:54 2008 From: sen1 at math.msu.edu (S. Newhouse) Date: Wed, 05 Mar 2008 10:19:54 -0500 Subject: [Maxima] Rotating 3-D graphs In-Reply-To: <7775b21a0803050306i17f9dd85jca05ca58ca7b8ec9@mail.gmail.com> References: <880dece00803050112q2d0b354fn5df636da0204c3e7@mail.gmail.com> <7775b21a0803050306i17f9dd85jca05ca58ca7b8ec9@mail.gmail.com> Message-ID: <47CEBA1A.7060602@math.msu.edu> Andrej Vodopivec wrote: > On Wed, Mar 5, 2008 at 10:12 AM, Dotan Cohen wrote: > >> I'm just getting my feet wet with Maxima. How can one rotate and zoom >> a 3-D graph created with Maxima? I'm on Ubuntu 7.04 if it matters, >> with Maxima 5.10.0. >> > > If you wish to have mouse support in gnuplot you will need to upgrade > maxima at least to version 5.12. > > -- > Andrej > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > I use maxima 5.14.0 in fedora core 6 and I don't get mouse support with plot3d. However, with draw3d, the mouse works quite well, rotation with left mouse, and zooming with middle mouse. Try e.g. (%i7) load(draw); (%o7) /usr/local/share/maxima/5.14.0/share/draw/draw.lisp (%i8) draw3d(explicit(x^2 - y^2, x,-2,2,y,-2,2)); (%o8) [gr3d(explicit)] Look at the maxima manual for draw -sen From dotancohen at gmail.com Wed Mar 5 14:02:16 2008 From: dotancohen at gmail.com (Dotan Cohen) Date: Wed, 5 Mar 2008 22:02:16 +0200 Subject: [Maxima] Rotating 3-D graphs In-Reply-To: <47CEBA1A.7060602@math.msu.edu> References: <880dece00803050112q2d0b354fn5df636da0204c3e7@mail.gmail.com> <7775b21a0803050306i17f9dd85jca05ca58ca7b8ec9@mail.gmail.com> <47CEBA1A.7060602@math.msu.edu> Message-ID: <880dece00803051202m372b1582tc32dd59516948ef0@mail.gmail.com> On 05/03/2008, S. Newhouse wrote: > I use maxima 5.14.0 in fedora core 6 and I don't get mouse support with > plot3d. However, with draw3d, the mouse works quite well, rotation with > left mouse, and zooming with middle mouse. > > Try e.g. > > (%i7) load(draw); > (%o7) /usr/local/share/maxima/5.14.0/share/draw/draw.lisp > (%i8) draw3d(explicit(x^2 - y^2, x,-2,2,y,-2,2)); > (%o8) [gr3d(explicit)] > > > Look at the maxima manual for draw Thank you Sen. As soon as I upgrade my Maxima version I will look into the mouse support. Thanks for the example usages as well. Dotan Cohen http://what-is-what.com http://gibberish.co.il ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? From adammaj1 at o2.pl Wed Mar 5 14:07:05 2008 From: adammaj1 at o2.pl (Adam Majewski) Date: Wed, 05 Mar 2008 21:07:05 +0100 Subject: [Maxima] discrete dynamical system In-Reply-To: <47CAA309.3090602@telefonica.net> References: <000c01c87b07$682f58a0$0d00a8c0@edwinc367e16bd> <47C86B99.9080002@telefonica.net> <47C956EB.8010001@telefonica.net> <47CAA309.3090602@telefonica.net> Message-ID: Mario Rodriguez pisze: > Hello Adam, > >> Great. Thx. It,s very important information for me. I didn't find this >> information. Is it in help or on your page ? >> > I'm afraid this information is nowhere. I'll fix it. > >> I have not found image in the internet, so I will try to desacribe it. >> I have array of pixels. For each pixel there is a n integer number ( >> 0<=hit<=HitLimit). I would like to draw vertical bars ( height is = >> hit/hitLimit) for each pixel. >> > I think I understand. At this moment, the only way to plot vertical > lines for each point is to write something as > > > draw3d(points_joined=true, > points([[1,1,0], [1,1,10]]), > points([[2,2,0], [2,2,10]]), > points([[3,4,0], [3,4,10]]) ); > > which is not a nice solution. Although impulses are implemented in > Gnuplot, they aren't in Maxima. I'll look into this too. > > Thanks a lot for your comments; you gave me a pair of ideas! > > Here is last version: http://commons.wikimedia.org/wiki/Image:Miimcr.png What do you think ? As to draw: - can svg terminal be made? - jpg not works for me. As to general Maxima. I usu draw points(xx,yy) . Here are 2 lists. Could it be draw points(orbit) with 1 list of complex numbers ? Regards Adam From sen1 at math.msu.edu Wed Mar 5 14:39:35 2008 From: sen1 at math.msu.edu (S. Newhouse) Date: Wed, 05 Mar 2008 15:39:35 -0500 Subject: [Maxima] problems with eigenvectors and bfloat Message-ID: <47CF0507.8080208@math.msu.edu> Hello, I noticed that none of the included eigenvalue routines (that I am aware of at least) work in a reasonable way with bfloat and irrational numbers. The problem with 'eigenvectors' seems to be 'algsys'. It is a bit embarrassing that there are no routines to handle even 2x2 matrices automatically, since the algebra is at the (maybe junior) high school level. Of course, this can be overcome by writing one's own routines for 2x2, maybe 3x3, and/or 4x4 matrices directly, but I think they should be a part of the standard maxima tools. Here are some examples: Since my command line output always has lines shifted, I will suppress output, so only the errors show up. (%i30) build_info(); Maxima version: 5.14.0 Maxima build date: 13:44 2/10/2008 host type: i686-pc-linux-gnu lisp-implementation-type: CLISP lisp-implementation-version: 2.41 (2006-10-13) (built on gumbie [192.168.1.109]) (%o30) (%i31) A: matrix([sqrt(2),1],[1,1]); (%i32) eigenvectors(A)$ (%i33) so this is fine. Now, look at this: (%i33) B: matrix([bfloat(sqrt(2)),1],[1,1]); %i34) eigenvectors(B)$ `rat' replaced 1.414213562373095B0 by 8119/5741 = 1.414213551646055B0 algsys failure: the eigenvector(s) for the 1 th eigenvalue will be missing. algsys failure: the eigenvector(s) for the 2 th eigenvalue will be missing. There are no eigenvectors. The eigenvalues are computed, however. Also, maybe it does not come as a surprise, but the lapack routine 'dgeev' does not work with bfloats. -sen From biomates at telefonica.net Wed Mar 5 15:54:37 2008 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 05 Mar 2008 22:54:37 +0100 Subject: [Maxima] discrete dynamical system In-Reply-To: References: <000c01c87b07$682f58a0$0d00a8c0@edwinc367e16bd> <47C86B99.9080002@telefonica.net> <47C956EB.8010001@telefonica.net> <47CAA309.3090602@telefonica.net> Message-ID: <47CF169D.4060709@telefonica.net> Hello, > Here is last version: > http://commons.wikimedia.org/wiki/Image:Miimcr.png > > What do you think ? > > Looks nice. > As to draw: > - can svg terminal be made? > This terminal is not directly supported by draw, but you can use the 'user_preamble' option to force output in svg format. Here is an example: draw2d(explicit(exp(x)-1,x,-1,1), user_preamble=["set terminal svg","set out 'mysvg.svg'"]); But you have to add by hand at the end of the file. For some reason this mark is sent to the console and not to the svg file, at least for me. > - jpg not works for me. > > Maybe your gnuplot wasn't compiled with support for this terminal. It works for me. > As to general Maxima. > I usu draw points(xx,yy) . Here are 2 lists. > Could it be draw points(orbit) with 1 list of complex numbers ? > No, sorry. But you can try something as this: cl: makelist(random(10.0)+random(10.0)*%i,k,1,100)$ draw2d( point_type=diamant, points(map(realpart, cl), map(imagpart, cl)) )$ hth -- Mario Rodriguez Riotorto http://www.telefonica.net/web2/biomates From willisb at unk.edu Wed Mar 5 16:39:30 2008 From: willisb at unk.edu (Barton Willis) Date: Wed, 5 Mar 2008 16:39:30 -0600 Subject: [Maxima] problems with eigenvectors and bfloat In-Reply-To: <47CF0507.8080208@math.msu.edu> References: <47CF0507.8080208@math.msu.edu> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- > I noticed that none of the included eigenvalue routines (that I am > aware of at least) work in a reasonable way with bfloat and irrational > numbers. For real selfadjoint matrices, we have double and bigfloat versions of the Jacobi method. (%i1) B: matrix([sqrt(2),1],[1,1]); (%o1) matrix([sqrt(2),1],[1,1]) (%i2) eigens_by_jacobi(B, 'bigfloatfield); ....(deleted) Barton From musso at physics.utexas.edu Thu Mar 6 04:54:16 2008 From: musso at physics.utexas.edu (Marcello Musso) Date: Thu, 6 Mar 2008 04:54:16 -0600 (CST) Subject: [Maxima] maxima and ADM Message-ID: Hello, i am rather new to maxima. I would like to know if it is possible to tell the program to use the ADM formalism within the itensor/ctensor packages. Any help would be appreciated. Thanks, Marcello ************************************************ * Marcello Musso * * University of Texas at Austin * * Department of Physics - Theory group * * 1, University Station C1608 * * Austin, TX 78712-0269 - USA * * office phone: (512)-471-4108 * * VoIP phone: +39-02-303129852 * ************************************************ From a.panizza at cira.it Wed Mar 5 10:25:17 2008 From: a.panizza at cira.it (Andrea Panizza) Date: Wed, 5 Mar 2008 17:25:17 +0100 Subject: [Maxima] New releases of Maxima Message-ID: <002701c87edd$7f876130$c51e0e9c@CIRA.IT> Hi, Robert, I am an aerospace engineer at CIRA (Italian Aerospace Research Center): I use a lot Maxima and I find it wonderful. Sometimes features I'm missing are added to successive versions of Maxima. I would like to know if there's a page where new features and/or bug fixes in a new version are shown, so that I can decide wheter to download it or not. Can you point me to any useful resource? Thanks, Andrea Panizza Ing. Andrea Panizza - CIRA/LCFD e-mail: a.panizza at cira.it tel.: +390823623907 fax : +390823969272 C.I.R.A. S.C.p.A. Via Maiorise 81043 Capua(CE), Italy -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080305/447ef871/attachment.htm From jan.brosius at skynet.be Thu Mar 6 09:31:23 2008 From: jan.brosius at skynet.be (Jan Brosius) Date: Thu, 06 Mar 2008 16:31:23 +0100 Subject: [Maxima] bug in maxima? Message-ID: <47D00E4B.3050807@skynet.be> Hello, when I give into Maxima the following code: *for q1:-10 while q1<3 do for q2:-10 thru 10 while q2>4 do print([q1,q2]); * then Maxima doesn't print the [q1,q2] values. Is this a bug? Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080306/c94c0de7/attachment-0001.htm From robert.dodier at gmail.com Thu Mar 6 09:45:12 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 6 Mar 2008 08:45:12 -0700 Subject: [Maxima] New releases of Maxima In-Reply-To: <002701c87edd$7f876130$c51e0e9c@CIRA.IT> References: <002701c87edd$7f876130$c51e0e9c@CIRA.IT> Message-ID: On 3/5/08, Andrea Panizza wrote: > I am an aerospace engineer at CIRA (Italian Aerospace Research Center): I > use a lot Maxima and I find it wonderful. Sometimes features I'm missing are > added to successive versions of Maxima. I would like to know if there's a > page where new features and/or bug fixes in a new version are shown, so that > I can decide wheter to download it or not. Can you point me to any useful > resource? Take a look at the ChangeLog-5.xx.yy files which you can find in CVS: http://maxima.cvs.sourceforge.net/maxima/maxima There is a wish list for new features at the Maxima wiki: http://maxima.sourceforge.net/wiki/index.php?Design%20Notes You can add stuff to the list if you like. I'm glad to hear that you find Maxima useful. best, Robert Dodier From robert.dodier at gmail.com Thu Mar 6 09:54:22 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 6 Mar 2008 08:54:22 -0700 Subject: [Maxima] bug in maxima? In-Reply-To: <47D00E4B.3050807@skynet.be> References: <47D00E4B.3050807@skynet.be> Message-ID: On 3/6/08, Jan Brosius wrote: > for q1:-10 while q1<3 do for q2:-10 thru 10 while q2>4 do print([q1,q2]); > > then Maxima doesn't print the [q1,q2] values. Well, in something like for q2:-10 thru 10 while foop(q2) do (...) the loop is never executed if foop(q2) is false for the first value of q2. The loop doesn't continue until foop(q2) becomes true. I think it is working as intended, but clearly different people intend different things. Perhaps for q2:-10 thru 10 do if q2>4 then (...) has the effect you want. HTH Robert Dodier From eric.reyssat at math.unicaen.fr Thu Mar 6 10:01:16 2008 From: eric.reyssat at math.unicaen.fr (reyssat) Date: Thu, 06 Mar 2008 17:01:16 +0100 Subject: [Maxima] bug in maxima? In-Reply-To: <47D00E4B.3050807@skynet.be> References: <47D00E4B.3050807@skynet.be> Message-ID: <47D0154C.6000905@math.unicaen.fr> Jan Brosius a ?crit : > Hello, > > > when I give into Maxima the following code: > > *for q1:-10 while q1<3 do for q2:-10 thru 10 while q2>4 do print([q1,q2]); > * > then Maxima doesn't print the [q1,q2] values. > > Is this a bug? No, as soon as q2>4 is not true (which is the case from the begining of the q2 loop), this loop ends. Eric > > > Jan > > > ------------------------------------------------------------------------ > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Thu Mar 6 11:45:23 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 6 Mar 2008 12:45:23 -0500 Subject: [Maxima] bug in maxima? In-Reply-To: <47D00E4B.3050807@skynet.be> References: <47D00E4B.3050807@skynet.be> Message-ID: <8b356f880803060945j453e3eebka5f8132f88dfcee8@mail.gmail.com> On Thu, Mar 6, 2008 at 10:31 AM, Jan Brosius wrote: > when I give into Maxima the following code: > for q1:-10 while q1<3 do for q2:-10 thru 10 while q2>4 do print([q1,q2]); > then Maxima doesn't print the [q1,q2] values. In Maxima, "for", "while", and "thru" are all modifiers to the basic "do" statement. It's the inner loop that does nothing: for q2:-10 thru 10 while q2>4 do ... This is equivalent to block([q2: -10], while (q2>4 and q2<=10) do (..., q2:q2+1) ) Since -10>4 is not true, the while-clause terminates the iteration immediately. -s From andrea.panizza75 at libero.it Thu Mar 6 13:23:31 2008 From: andrea.panizza75 at libero.it (Andrea Panizza) Date: Thu, 6 Mar 2008 20:23:31 +0100 Subject: [Maxima] simplification in matrices Message-ID: <1fdd0ced0803061123p1184aea8lab6d3d3085a75457@mail.gmail.com> Hi, I have the antisymmetric matrix M:matrix([0,(u[1,2]-u[2,1])/2,(u[1,3]-u[3,1])/2],[(u[2,1]-u[1,2])/2,0,(u[2,3]-u[3,2])/2],[(u[3,1]-u[1,3])/2,(u[3,2]-u[2,3])/2,0]) I would like Maxima to reckon that, since the vector (Omg_1, Omg_2, Omg_3) (how do I input a vector in Maxima?) has components Omg_1 = u[3,2]-u[2,3] Omg_2 = u[1,3]-u[3,1] Omg_3 = u[2,1]-u[1,2] then M has the expression M:matrix([0,-Omg[3]/2,Omg[2]/2],[-Omg[3]/2,0,-Omg[1]/2],[-Omg[2]/2,Omg[3]/2,0]) Is this possible? Thanks, Best Regards, Andrea Panizza -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080306/539b5673/attachment.htm From willisb at unk.edu Thu Mar 6 17:01:01 2008 From: willisb at unk.edu (Barton Willis) Date: Thu, 6 Mar 2008 17:01:01 -0600 Subject: [Maxima] simplification in matrices In-Reply-To: <1fdd0ced0803061123p1184aea8lab6d3d3085a75457@mail.gmail.com> References: <1fdd0ced0803061123p1184aea8lab6d3d3085a75457@mail.gmail.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Hi, > >I have the antisymmetric matrix > >M:matrix([0,(u[1,2]-u[2,1])/2,(u[1,3]-u[3,1])/2],[(u[2,1]-u[1,2])/2,0,(u[2 >,3]-u[3,2])/2],[(u[3,1]-u[1,3])/2,(u[3,2]-u[2,3])/2,0]) > >I would like Maxima to reckon that, since the vector (Omg_1, Omg_2, Omg_3) >(how do I input a vector in Maxima?) has components > > >Omg_1 = u[3,2]-u[2,3] >Omg_2 = u[1,3]-u[3,1] >Omg_3 = u[2,1]-u[1,2] > >then M has the expression > >M:matrix([0,-Omg[3]/2,Omg[2]/2],[-Omg[3]/2,0,-Omg[1]/2],[-Omg[2]/2,Omg[3]/ >2,0]) > >Is this possible? Thanks, Try something like this: (%i10) M:matrix([0,(u[1,2]-u[2,1])/2,(u[1,3]-u[3,1])/2],[(u[2,1]-u[1,2])/2,0,(u[2,3]-u[3,2])/2],[(u[3,1] -u[1,3])/2,(u[3,2]-u[2,3])/2,0])$ (%i11) M : ratsubst(Omg_1, u[3,2]-u[2,3], M)$ (%i12) M : ratsubst(Omg_2, u[1,3]-u[3,1], M)$ (%i13) M : ratsubst(Omg_3, u[2,1]-u[1,2], M); (%o13) matrix([0,-Omg_3/2,Omg_2/2],[Omg_3/2,0,-Omg_1/2],[-Omg_2/2,Omg_1/2,0]) To read the user documentation for ratsubst, enter "? ratsubst" on a command line. There is no vector object in Maxima. Either you need to represent a vector as a list or as a Matrix. Examples: (%i14) vec : matrix([1],[2],[3]); (%o14) matrix([1],[2],[3]) (%i15) M . vec; (%o15) matrix([(3*Omg_2)/2-Omg_3],[Omg_3/2-(3*Omg_1)/2],[Omg_1-Omg_2/2]) (%i16) u : [1,2,3]; (%o16) [1,2,3] (%i17) u . M; (%o17) matrix([Omg_3-(3*Omg_2)/2,(3*Omg_1)/2-Omg_3/2,Omg_2/2-Omg_1]) I think we've talked about adding a vector object to Maxima, but I don't know if anybody is working on it. I hope this helps; let us know if you have additional questions or if something I said isn't clear. Barton From dlakelan at street-artists.org Thu Mar 6 22:05:15 2008 From: dlakelan at street-artists.org (dlakelan) Date: Thu, 06 Mar 2008 20:05:15 -0800 Subject: [Maxima] Argh, why can't I ever figure out plot2d/find_root/etc Message-ID: <47D0BEFB.7050001@street-artists.org> whenever I try to use Maxima for numerical calculations with functions, rather than expressions, it just doesn't work. Oh sure, maybe calling my function Moment(.001,d) at the command line works fine, but when I do plot2d(Moment(phi,d),[phi,0,.001]) (with "d" bound at the global level), I get some stupid error related to how I'm using find_root deep inside this function... Why does this suck so much? From toy.raymond at gmail.com Thu Mar 6 22:50:33 2008 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 06 Mar 2008 23:50:33 -0500 Subject: [Maxima] Argh, why can't I ever figure out plot2d/find_root/etc In-Reply-To: <47D0BEFB.7050001@street-artists.org> References: <47D0BEFB.7050001@street-artists.org> Message-ID: <47D0C999.1010300@gmail.com> dlakelan wrote: > whenever I try to use Maxima for numerical calculations with functions, > rather than expressions, it just doesn't work. > > Oh sure, maybe calling my function Moment(.001,d) at the command line > works fine, but when I do plot2d(Moment(phi,d),[phi,0,.001]) (with "d" > bound at the global level), I get some stupid error related to how I'm > using find_root deep inside this function... > > Why does this suck so much? > Maybe you can provide a small example illustrating the problem? I tried this and it worked for me. foo(x,y):=sin(x+y); yy:4.5; plot2d(foo(x,yy),[x,0,10]); I get a nice plot of a sine wave. Ray From robert.dodier at gmail.com Fri Mar 7 01:11:55 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 7 Mar 2008 00:11:55 -0700 Subject: [Maxima] Argh, why can't I ever figure out plot2d/find_root/etc In-Reply-To: <47D0BEFB.7050001@street-artists.org> References: <47D0BEFB.7050001@street-artists.org> Message-ID: On 3/6/08, dlakelan wrote: > Oh sure, maybe calling my function Moment(.001,d) at the command line > works fine, but when I do plot2d(Moment(phi,d),[phi,0,.001]) (with "d" > bound at the global level), I get some stupid error related to how I'm > using find_root deep inside this function... I'm sympathetic, but I can't guess what's the matter here. Feel free to provide some details. Robert From dotancohen at gmail.com Fri Mar 7 03:43:31 2008 From: dotancohen at gmail.com (Dotan Cohen) Date: Fri, 7 Mar 2008 11:43:31 +0200 Subject: [Maxima] Maxima-related files cluttering $HOME Message-ID: <880dece00803070143i6230804dw4ad205ed39cb2230@mail.gmail.com> Whenever I finish using Maxima, I find many files cluttering up my $HOME directory, such as: gnu-optionsxx maxout.gnuplot maxout.mgnuplot I understand that these are related to gnuplot as well as Maxima. How can I configure Maxima/GNUplot to store it's temp files in ~/.maxima or /tmp? If this question is answered in the fine manual then please point it out. I am just getting my feet wet with Maxima and the docs, as I am certain that I have missed quite a lot. Thanks in advance. Dotan Cohen http://what-is-what.com http://gibberish.co.il ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? From andrea.panizza75 at libero.it Fri Mar 7 03:53:20 2008 From: andrea.panizza75 at libero.it (Andrea Panizza) Date: Fri, 7 Mar 2008 10:53:20 +0100 Subject: [Maxima] simplification in matrices Message-ID: <1fdd0ced0803070153p6c0cafd2ma42240b4eb4e133f@mail.gmail.com> >*Hi, *>* *>*I have the antisymmetric matrix *>* *>*M:matrix([0,(u[1,2]-u[2,1])/2,(u[1,3]-u[3,1])/2],[(u[2,1]-u[1,2])/2,0,(u[2 *>*,3]-u[3,2])/2],[(u[3,1]-u[1,3])/2,(u[3,2]-u[2,3])/2,0]) *>* *>*I would like Maxima to reckon that, since the vector (Omg_1, Omg_2, Omg_3) *>*(how do I input a vector in Maxima?) has components *>* *>* *>*Omg_1 = u[3,2]-u[2,3] *>*Omg_2 = u[1,3]-u[3,1] *>*Omg_3 = u[2,1]-u[1,2] *>* *>*then M has the expression *>* *>*M:matrix([0,-Omg[3]/2,Omg[2]/2],[-Omg[3]/2,0,-Omg[1]/2],[-Omg[2]/2,Omg[3]/ *>*2,0]) *>* *>*Is this possible? Thanks, * Try something like this: (%i10) M:matrix([0,(u[1,2]-u[2,1])/2,(u[1,3]-u[3,1])/2],[(u[2,1]-u[1,2])/2,0,(u[2,3]-u[3,2])/2],[(u[3,1] -u[1,3])/2,(u[3,2]-u[2,3])/2,0])$ (%i11) M : ratsubst(Omg_1, u[3,2]-u[2,3], M)$ (%i12) M : ratsubst(Omg_2, u[1,3]-u[3,1], M)$ (%i13) M : ratsubst(Omg_3, u[2,1]-u[1,2], M); (%o13) matrix([0,-Omg_3/2,Omg_2/2],[Omg_3/2,0,-Omg_1/2],[-Omg_2/2,Omg_1/2,0]) To read the user documentation for ratsubst, enter "? ratsubst" on a command line. There is no vector object in Maxima. Either you need to represent a vector as a list or as a Matrix. Examples: (%i14) vec : matrix([1],[2],[3]); (%o14) matrix([1],[2],[3]) (%i15) M . vec; (%o15) matrix([(3*Omg_2)/2-Omg_3],[Omg_3/2-(3*Omg_1)/2],[Omg_1-Omg_2/2]) (%i16) u : [1,2,3]; (%o16) [1,2,3] (%i17) u . M; (%o17) matrix([Omg_3-(3*Omg_2)/2,(3*Omg_1)/2-Omg_3/2,Omg_2/2-Omg_1]) I think we've talked about adding a vector object to Maxima, but I don't know if anybody is working on it. I hope this helps; let us know if you have additional questions or if something I said isn't clear. Barton Hi, thank you very much for your valuable help. It would be very useful for me if Maxima had a vector object. Functions like finding the vector associated to a skew-symmetric matrix are very useful in vector calculus. Also things like decomposing a symmetric or skew-symmetric matrix in terms of its invariants would be helpful. Best regards, Andrea ps I don' understand how to reply directly to your post. Hope this shows in the correct thread. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080307/e33defc8/attachment.htm From sonofthejedi at xtra.co.nz Fri Mar 7 04:13:34 2008 From: sonofthejedi at xtra.co.nz (Robert Willam Grieve) Date: Fri, 7 Mar 2008 23:13:34 +1300 Subject: [Maxima] YA query re use of assume (Have RTM) In-Reply-To: References: <47D0BEFB.7050001@street-artists.org> Message-ID: <200803072313.34657.sonofthejedi@xtra.co.nz> Greetings list I'm still getting used to this, but I've been lurking a while and now I have to start doing basic college first year calc. I'm working up to Stochastic processes later in the year. I'll do it in Mathematica if I need to but I'd rather use your package, it suits me better. I'm getting to grips with parts and equation manipulation, so I tryed this, prove eqn1 converges to root n for x > 0: eqn1 : (1/2)*(x + (n/x)) = 0$ eqn1 : eqn1*2$ eqn1 : eqn1 - part(part(eqn1, 1), 1)$ eqn1 : eqn1^2$ eqn1 : eqn1 * part(part(eqn1, 1), 2)$ eqn1 : eqn1^(1/4)$ eqn1; And I get something that can be written in c as sqrt(n) == abs(x) Fair enough I also got rid of the abs by doing assume(n > 0, x > 0); which is fine cause my case allows it. So having proved this 'manually' I want to try and get solve to do it automatically. But when I do this: assume(n>0)$ eqn2 : (1/2)*(x + (n/x)) = 0$ soln : solve(eqn2, x)$ soln; I get [ -%i*n^(1/2), %i*n^(1/2) ] What am I missing, if I can manipulate the expression around to be what I thought, then these 2 expressions should be the same, but they aren't what am I missing. PS wxMaxima should support copy and paste from the interface, it seems broken on my Gentoo system. wxMaxima 0.7.4, Maxima 5.14.0 all build with recent libs as at 1 March. TIA and sorry for a long post. Any ideas on any of this are appreciated. rgrieve at cs.otago.ac.nz From willisb at unk.edu Fri Mar 7 05:30:01 2008 From: willisb at unk.edu (Barton Willis) Date: Fri, 7 Mar 2008 05:30:01 -0600 Subject: [Maxima] simplification in matrices In-Reply-To: <1fdd0ced0803070153p6c0cafd2ma42240b4eb4e133f@mail.gmail.com> References: <1fdd0ced0803070153p6c0cafd2ma42240b4eb4e133f@mail.gmail.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >thank you very much for your valuable help. It would be very useful for me >if Maxima had a vector object. Functions like finding the vector associated >to a skew-symmetric matrix are very useful in vector calculus. Also things >like decomposing a symmetric or skew-symmetric matrix in terms of its >invariants would be helpful. Maybe you don't need a vector to do want you need to do. Here are some examples: Define m to be an antisymmetric matrix (%i41) m : matrix([0,1,1],[-1,0,1],[-1,-1,0])$ Make a list of the traces of m, m^2, and m^3 (%i42) makelist(mat_trace(m^^k),k,1,3); (%o42) [0,-6,0] Express m as a linear combination of projection matrices (%i43) spectral_rep(m); (%o43) --- long expression deleted---- Verify the spectral representation (%i44) expand(m - first(%) . second(%)); (%o44) matrix([0,0,0],[0,0,0],[0,0,0]) Compute exp(%i * m * t) (%i47) matrixexp(m, %i*t); (%o47) -- long expression deleted---- Maybe these examples will get you started. Or if there is something else, maybe we all could help you figure out how to that too. Barton From eric.reyssat at math.unicaen.fr Fri Mar 7 07:07:54 2008 From: eric.reyssat at math.unicaen.fr (reyssat) Date: Fri, 07 Mar 2008 14:07:54 +0100 Subject: [Maxima] YA query re use of assume (Have RTM) In-Reply-To: <200803072313.34657.sonofthejedi@xtra.co.nz> References: <47D0BEFB.7050001@street-artists.org> <200803072313.34657.sonofthejedi@xtra.co.nz> Message-ID: <47D13E2A.3010804@math.unicaen.fr> Robert Willam Grieve a ?crit : > Greetings list > > I'm still getting used to this, but I've been lurking a while and > now I have to start doing basic college first year calc. I'm > working up to Stochastic processes later in the year. > I'll do it in Mathematica if I need to but I'd rather use your > package, it suits me better. > > I'm getting to grips with parts and equation manipulation, so I > tryed this, prove eqn1 converges to root n for x > 0: > > eqn1 : (1/2)*(x + (n/x)) = 0$ > eqn1 : eqn1*2$ > eqn1 : eqn1 - part(part(eqn1, 1), 1)$ > eqn1 : eqn1^2$ At this place, you forget about a minus sign ; the new equation is not equivalent to the first one. > eqn1 : eqn1 * part(part(eqn1, 1), 2)$ > eqn1 : eqn1^(1/4)$ Here you get only one of four solutions : x=sqrt(n) but there are three other that maxima doesn't show : i*sqrt(n) , -sqrt(n) , -i*sqrt(n). Only i*sqrt(n) and -i*sqrt(n) are solutions of your first equation. The other have been introduced by in the squaring step above. > eqn1; > > And I get something that can be written in c as sqrt(n) == abs(x) > Fair enough > > I also got rid of the abs by doing > > assume(n > 0, x > 0); > > which is fine cause my case allows it. > > So having proved this 'manually' I want to try and get solve to > do it automatically. > > But when I do this: > > assume(n>0)$ > eqn2 : (1/2)*(x + (n/x)) = 0$ > soln : solve(eqn2, x)$ > soln; > > I get [ -%i*n^(1/2), %i*n^(1/2) ] This answer is correct. If you want to find the square root of n as a limit of the sequence defined by u_(k+1)=(1/2)*(u_k+n/u_k), you are looking for a FIXED POINT (not a zero) of f(x)=(1/2)*(x + (n/x)). Hence the equation should be eqn3 : (1/2)*(x + (n/x)) = x; Now solve(eqn3, x); returns [x = - sqrt(n), x = sqrt(n)] as expected. Eric From fateman at cs.berkeley.edu Fri Mar 7 08:32:01 2008 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Fri, 7 Mar 2008 06:32:01 -0800 Subject: [Maxima] YA query re use of assume (Have RTM) In-Reply-To: <200803072313.34657.sonofthejedi@xtra.co.nz> References: <47D0BEFB.7050001@street-artists.org> <200803072313.34657.sonofthejedi@xtra.co.nz> Message-ID: <00e901c88060$0243e980$0400a8c0@RJFE510> assume() does not affect solve directly. RJF From robert.dodier at gmail.com Fri Mar 7 09:13:31 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 7 Mar 2008 08:13:31 -0700 Subject: [Maxima] Maxima-related files cluttering $HOME In-Reply-To: <880dece00803070143i6230804dw4ad205ed39cb2230@mail.gmail.com> References: <880dece00803070143i6230804dw4ad205ed39cb2230@mail.gmail.com> Message-ID: On 3/7/08, Dotan Cohen wrote: > Whenever I finish using Maxima, I find many files cluttering up my > $HOME directory, such as: > gnu-optionsxx > maxout.gnuplot > maxout.mgnuplot Output files for plotting are supposed to be written to the directory named by maxima_tempdir. Try maxima_tempdir:"/tmp" or whatever. best Robert Dodier From dotancohen at gmail.com Fri Mar 7 09:32:11 2008 From: dotancohen at gmail.com (Dotan Cohen) Date: Fri, 7 Mar 2008 17:32:11 +0200 Subject: [Maxima] Maxima-related files cluttering $HOME In-Reply-To: References: <880dece00803070143i6230804dw4ad205ed39cb2230@mail.gmail.com> Message-ID: <880dece00803070732s6c0007d8y36d3bda5b2f06f90@mail.gmail.com> On 07/03/2008, Robert Dodier wrote: > Output files for plotting are supposed to be written to the directory > named by maxima_tempdir. Try maxima_tempdir:"/tmp" or whatever. Thank you Robert. I don't have a .maxima* file or directory. Where is that setting to be set? Dotan Cohen http://what-is-what.com http://gibberish.co.il ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? From robert.dodier at gmail.com Fri Mar 7 09:41:31 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 7 Mar 2008 08:41:31 -0700 Subject: [Maxima] Maxima-related files cluttering $HOME In-Reply-To: <880dece00803070732s6c0007d8y36d3bda5b2f06f90@mail.gmail.com> References: <880dece00803070143i6230804dw4ad205ed39cb2230@mail.gmail.com> <880dece00803070732s6c0007d8y36d3bda5b2f06f90@mail.gmail.com> Message-ID: On 3/7/08, Dotan Cohen wrote: > Thank you Robert. I don't have a .maxima* file or directory. Where is > that setting to be set? I think Maxima is supposed to read $HOME/.maxima/maxima-init.mac when it is launched. best Robert From macrakis at alum.mit.edu Fri Mar 7 09:42:18 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 7 Mar 2008 10:42:18 -0500 Subject: [Maxima] simplification in matrices In-Reply-To: References: <1fdd0ced0803061123p1184aea8lab6d3d3085a75457@mail.gmail.com> Message-ID: <8b356f880803070742o68646cb1pe7921b742ecd4cd1@mail.gmail.com> On Thu, Mar 6, 2008 at 6:01 PM, Barton Willis wrote: > There is no vector object in Maxima. Either you need to represent a vector as > a list or as a Matrix. Barton, A little quibble here. There is no *separate* vector object in Maxima, but lists *are* vectors, making no distinction between column and row vectors. The "." operation operates on list-vectors, where [x1,x2,...] . [y1, y2,...] == [x1,x2,...] . transpose([y1,y2,...]). There are of course applications where co/contravariant vectors need to be distinguished, which the list approach doesn't address. -s From dotancohen at gmail.com Fri Mar 7 09:51:04 2008 From: dotancohen at gmail.com (Dotan Cohen) Date: Fri, 7 Mar 2008 17:51:04 +0200 Subject: [Maxima] Maxima-related files cluttering $HOME In-Reply-To: References: <880dece00803070143i6230804dw4ad205ed39cb2230@mail.gmail.com> <880dece00803070732s6c0007d8y36d3bda5b2f06f90@mail.gmail.com> Message-ID: <880dece00803070751u78d6c85fs46255c22fdc8204f@mail.gmail.com> On 07/03/2008, Robert Dodier wrote: > I think Maxima is supposed to read $HOME/.maxima/maxima-init.mac when > it is launched. Thanks. I have googled the file looking for example of it, but I cannot find even a single one! Can you send me your ~.maxima/maxima-init.mac file so that I can go through the options and build one that suits me? Thank you very much. Dotan Cohen http://what-is-what.com http://gibberish.co.il ?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-?-? A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? From macrakis at alum.mit.edu Fri Mar 7 10:07:51 2008 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 7 Mar 2008 11:07:51 -0500 Subject: [Maxima] Argh, why can't I ever figure out plot2d/find_root/etc In-Reply-To: <47D0BEFB.7050001@street-artists.org> References: <47D0BEFB.7050001@street-artists.org> Message-ID: <8b356f880803070807x4293421eja0fed4d214d152bd@mail.gmail.com> On Thu, Mar 6, 2008 at 11:05 PM, dlakelan wrote: > whenever I try to use Maxima for numerical calculations with functions, > rather than expressions, it just doesn't work. > > Oh sure, maybe calling my function Moment(.001,d) at the command line > works fine, but when I do plot2d(Moment(phi,d),[phi,0,.001]) (with "d" > bound at the global level), I get some stupid error related to how I'm > using find_root deep inside this function... > > Why does this suck so much? Despite your giving a useless bug report with no details, and using vulgar language to insult everyone who's worked on Maxima over the years, I suspect you will actually get help on this list. Go figure. -s From robert.dodier at gmail.com Fri Mar 7 10:22:34 2008 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 7 Mar 2008 09:22:34 -0700 Subject: [Maxima] Maxima-related files cluttering $HOME In-Reply-To: <880dece00803070751u78d6c85fs46255c22fdc8204f@mail.gmail.com> References: <880dece00803070143i6230804dw4ad205ed39cb2230@mail.gmail.com> <880dece00803070732s6c0007d8y36d3bda5b2f06f90@mail.gmail.com> <880dece00803070751u78d6c85fs46255c22fdc8204f@mail.gmail.com> Message-ID: On Fri, Mar 7, 2008 at 8:51 AM, Dotan Cohen wrote: > Thanks. I have googled the file looking for example of it, but I > cannot find even a single one! Can you send me your > ~.maxima/maxima-init.mac file so that I can go through the options and > build one that suits me? maxima-init.mac is just an ordinary Maxima script. Maxima has a lot of user-adjustable options -- see "Global flags" and "Global variables" at: http://maxima.sourceforge.net/docs/manual/en/maxima_92.html For the most part I just let them be. The only one I set is linel:65 (line width). best Robert From elzacho at gmail.com Fri Mar 7 11:07:47 2008 From: elzacho at gmail.com (Zach) Date: Fri, 7 Mar 2008 10:07:47 -0700 Subject: [Maxima] find_root and variable capture? Message-ID: <95f1acd0803070907r7d0270b7yd3d1a80e3be9e166@mail.gmail.com> Dear Maxima people, Please excuse my lack of knowledge of Maxima internals. Also, I am pretty sure this is all part of a long standing confusion I have about what gets evaluated when, and the meaning of := and ::=. So, the previous post asking why Maxima "suck[s] so much" got me trying to recreate his problem. I stumbled upon this: f(y) := find_root(exp(x) - y, x, 0, 100); plot2d(f(x), [x, .1, .9]); This will plot a constant value at 0.56..., however, f(.1) is not equal to f(.2) if I just type them in. And, plot2d(f(y), [y, .1, .9]); will plot the root wrt. x of exp(x) - y. Basically, what is happening here is f(y) -> find_root(exp(x)-y, x, 0, 100) (what I intended), but, f(x) -> find_root(exp(x)-x, x, 0, 100) = 0.56... This sounds *very* similar to what is known in the Lisp world as variable capture, where a macro expansion uses a variable name that the user happens to be using. Is it? How can I define a function that does an explicit find_root at each evaluation? I guess I would need a gensym, right? Does Maxima have such a capability, or does it not need it for some reason? Please guide me in these troubled times... Anyway, happy Friday everybody, Zach P.S. I am aware that exp(x)-y = 0 => x = log(y) but imagine I had put some transcendental equation down where I might need to use a numerical root finder. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20080307/1b370a44/attachment-0001.htm From dlakelan at street-artists.org Fri Mar 7 11:33:21 2008 From: dlakelan at street-artists.org (dlakelan) Date: Fri, 07 Mar 2008 09:33:21 -0800 Subject: [Maxima] Argh, why can't I ever figure out plot2d/find_root/etc In-Reply-To: <8b356f880803070807x4293421eja0fed4d214d152bd@mail.gmail.com> References: <47D0BEFB.7050001@street-artists.org> <8b356f880803070807x4293421eja0fed4d214d152bd@mail.gmail.com> Message-ID: <47D17C61.10100@street-artists.org> Stavros Macrakis wrote: > On Thu, Mar 6, 2008 at 11:05 PM, dlakelan wrote: >> Why does this suck so much? > > Despite your giving a useless bug report with no details, and using > vulgar language to insult everyone who's worked on Maxima over the > years, I suspect you will actually get help on this list. Stavros: I am sorry to have offended you or anyone else. As you can imagine computers can be frustrating things at times. I am a very enthusiastic Maxima user, and I want things that look right to work because I want to be able to recommend maxima to others... But I run into this kind of confusion almost every time I try to use maxima for this sort of thing. The simple example is not very easy to give, because these things USUALLY WORK for the simple case... Kudos to the maxima developers for that! Here's a description of what i'm trying to do. perhaps someone will be able to come up with a simple case that shows the bug. I have a model for concrete stress/strain relationship. I am analyzing the bending properties of a concrete beam. I apply a degree of curvature to the beam, and then I try to balance the tension force in the steel with the integral of the compressive stress distribution over the cross sectional surface of the beam. The strain is assumed to be linear with distance from the "neutral axis". So I need to find the neutral axis... neutral_axis(phi,w,d) := find_root('(totalforce(a,phi,w,d)),a,0.0,d); w, and d are the width and depth of the rectangular cross section... phi is the angle of curvature As you can see I've already started quoting things to try to debug what's going on.... but it hasn't changed the behavior... totalforce is a function which calls quad_qag to integrate the stress over the rectangular cross section given a neutral axis depth at "a"... Moment is a function which calculates the total internal moment, which is the torque around the neutral axis applied to one side of the beam by the other side. It calls neutral axis to find the neutral axis, and then it calls quad_qag to integrate the torque caused by the stress distribution in the concrete, and adds the torque caused by the reinforcement steel. When I call Moment at the command prompt, it produces a nice floating point num