From biomates at telefonica.net Thu Jan 1 09:45:02 2009 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 01 Jan 2009 16:45:02 +0100 Subject: [Maxima] Draw an animated gif with black background In-Reply-To: <8A04B3566CC5442999DBFD792FC67136@RichDesktop> References: <3010F1635C7543719D608D30AB24C7BB@RichDesktop> <1230716340.5864.6.camel@pc> <8A04B3566CC5442999DBFD792FC67136@RichDesktop> Message-ID: <1230824702.6234.2.camel@pc> > Thanks, that worked but now I can't see any of the titles or labels. Is there a way to change the default foreground color to white > or some hex code? set_draw_defaults( xrange = [-1,1], yrange = [-1,1], color = yellow, user_preamble = ["set title 'My title' tc rgb 'white'", "set label 'My 1st label' at 0, 0.5 tc rgb 'white'", "set label 'My 2nd label' at 0, -0.5 tc rgb 'cyan'"], line_width = 2 )$ draw( delay = 100, file_name = "zzz", terminal = 'animated_gif, file_bgcolor = "#000000", gr2d(explicit(x^2,x,-1,1)), gr2d(explicit(x^3,x,-1,1)), gr2d(explicit(x^4,x,-1,1))); ------------- I have dedicated some time in the past trying to declare font types, sizes and colors, in a standard mode for all terminals, but couldn't find any (not all terminals support the same types and sizes), so that this is a chance for option user_preamble to be used instead. There is also an extra problem with labels. According to documentation: Colored labels work only with Gnuplot 4.3. This is a known bug in package @code{draw}. In fact, they don't work in Gnuplot 4.2.* when they are entered as data, as is the case in package draw. But they do work when they are entered with the 'set label' command as in the example above. As a consequence, this is another chance for user_preamble. hth. Mario From biomates at telefonica.net Thu Jan 1 09:52:16 2009 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 01 Jan 2009 16:52:16 +0100 Subject: [Maxima] Draw an animated gif with black background In-Reply-To: <8A04B3566CC5442999DBFD792FC67136@RichDesktop> References: <3010F1635C7543719D608D30AB24C7BB@RichDesktop> <1230716340.5864.6.camel@pc> <8A04B3566CC5442999DBFD792FC67136@RichDesktop> Message-ID: <1230825136.6234.9.camel@pc> > How can you send animated gif output to a file, I might as well learn how gnuplot works. I have been putting it off. If gnuplot > can do animated gifs then that would be more powerful probably. Draw's animated gifs are made by gnuplot. This is a new terminal introduced in gnuplot 4.2. In the first versions of draw, we had to generate all scenes separately and then make the animation with a third tool (imagemagick, for example). Mario From drdieterkaiser at web.de Thu Jan 1 13:34:21 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 01 Jan 2009 20:34:21 +0100 Subject: [Maxima] Half-angle-simplification of trig functions Message-ID: <1230838461.11405.55.camel@dieter-laptop> We have the open bug SF[505443] Halfangle limitation. I had a look at this topic. We have to adjust the factors for the cases sin(z/2), cos(z/2), sinh(z/2) and cosh(z/2). The most general formula for half-angle-simplification would be e. g. for the Sin function (see e.g. functions.wolfram.com): sin(z/2) = c(z) * sqrt((1-cos(z))/2) with a factor c(z) = (-1)^floor(realpart(z)/(2*%%pi)) * (1- (1+ (-1)^(floor(realpart(z)/(2*%pi)) + floor(-realpart(z)/(2*%pi)))) * unit_step(-imagpart(z))) For a real argument this simplifies to: c(x) = (-1)^floor(realpart(z)/(2*%%pi)) For a pure imaginary argument we get: c(y) = (1-2*unit_step(-y)) This simplifies further to -1 for y negative and 1 for y positive. For general complex expressions the term (-1)^(floor(expr)+floor(-expr)) is 1 for realpart(z) a multiple of 2*%pi and otherwise -1. For the functions cos, sinh and cosh we get similiar expressions. I have done an implementation of these general factors. The examples at the end of this text show that the expressions simplify well when we specialize the argument of the trig function accordingly. Mathematically it is clear that c(z)^2 = 1. One problem is that only for real arguments Maxima can simplify the general expression to c(z)^2 = 1. For complex arguments this simplification only works when the sign of the imaginary part is known to Maxima. For this case the unit_step function will simplify. One problem of the testsuite (Problem 33 in rtest_trig.mac) will fail. But after restriction the argument to a positive value in the interval (0,%pi) the example works again and as expected. I think we can implement the most general formulas for the factors of the half-angle-simplification. For complex arguments the result can look very complicated. But it will simplify to correct expressions. This is of course true for arguments with rational and integer numbers like (1+%i)/2. For such expressions we allows get simple and correct results. See e.g. the following example: (%i24) sin((2*%pi-%i)/2); (%o24) sqrt(1-cos(%i))/sqrt(2) (%i25) sin((2*%pi+%i)/2); (%o25) -sqrt(1-cos(%i))/sqrt(2) What do you think. Should we do the generalization of the half-angle-simplification to complex arguments and close the bug report? Dieter Kaiser Examples for the half-angle-simplification: /* Tests for half-angles simplification */ kill(all); done; (old_halfangles:halfangles,halfangles:true,old_%iargs:%iargs,% iargs:false,done); done; /* Sin function: The general result for real argument */ sin(x/2); (-1)^floor(x/(2*%pi))*sqrt(1-cos(x))/sqrt(2); /* The square simplifies correctly */ sin(x/2)^2; (1-cos(x))/2; /* Correct sign for negative and positive real argument */ (assume(x1>0,x1<2*%pi),done); done; sin(x1/2); sqrt(1-cos(x1))/sqrt(2); (assume(x2>-2*%pi,x2<0),done); done; sin(x2/2); -sqrt(1-cos(x2))/sqrt(2); /* Correct sign for pure imaginary argument and complex argument with realpart a multiple of 2*%pi */ (assume(y1>0,y2<0),done); done; sin(%i*y1/2); sqrt(1-cos(%i*y1))/sqrt(2); sin(%i*y2/2); -sqrt(1-cos(%i*y2))/sqrt(2); sin((2*%pi+%i*y2)/2); sqrt(1-cos(2*%pi+%i*y2))/sqrt(2); sin((2*%pi+%i*y1)/2); -sqrt(1-cos(2*%pi+%i*y1))/sqrt(2); /* Simplification for negative or positive imaginary part */ (assume(yneg<0,ypos>0),done); done; sin((x1+%i*yneg)/2); sqrt(1-cos(x1+%i*yneg))/sqrt(2); sin((2*%pi+%i*yneg)/2); sqrt(1-cos(2*%pi+%i*yneg))/sqrt(2); sin((x1+%i*ypos)/2); sqrt(1-cos(x1+%i*ypos))/sqrt(2); sin((2*%pi+%i*ypos)/2); -sqrt(1-cos(2*%pi+%i*ypos))/sqrt(2); /* for this case -1 */ /* Cos function: The general result for real argument */ cos(x/2); (-1)^floor((x+%pi)/(2*%pi))*sqrt(1+cos(x))/sqrt(2); /* The square simplifies correctly */ cos(x/2)^2; (1+cos(x))/2; /* Correct sign for real argument in (-%pi,%pi) */ (forget(x1<2*%pi,x1>0),assume(x1>-%pi,x1<%pi),done); done; cos(x1/2); sqrt(1+cos(x1))/sqrt(2); /* Correct sign for pure imaginary argument and complex argument with realpart a multiple of %pi */ cos(%i*y1/2); sqrt(1+cos(%i*y1))/sqrt(2); cos(%i*y2/2); sqrt(1+cos(%i*y2))/sqrt(2); cos((%pi+%i*y2)/2); sqrt(1+cos(%pi+%i*y2))/sqrt(2); cos((%pi+%i*y1)/2); -sqrt(1+cos(%pi+%i*y1))/sqrt(2); /* Simplification for negative or positive imaginary part */ (assume(yneg<0,ypos>0),done); done; cos((x1+%i*yneg)/2); sqrt(1+cos(x1+%i*yneg))/sqrt(2); cos((%pi+%i*yneg)/2); sqrt(1+cos(%pi+%i*yneg))/sqrt(2); cos((x1+%i*ypos)/2); sqrt(1+cos(x1+%i*ypos))/sqrt(2); cos((%pi+%i*ypos)/2); -sqrt(1+cos(%pi+%i*ypos))/sqrt(2); /* for this case an -1 */ /* Sinh function with Real arguments */ (assume(xpos>0,xneg<0),done); done; sinh(x/2); abs(x)/x*sqrt((cosh(x)-1)/2); sinh(x/2)^2; (cosh(x)-1)/2; sinh(xpos/2); sqrt((cosh(xpos)-1)/2); sinh(xneg/2); -sqrt((cosh(xneg)-1)/2); /* Sinh function with Complex arguments */ /* x1 is in (-%pi,%pi) */ sinh(%i*x1/2); abs(x1)/x1*sqrt((cosh(%i*x1)-1)/2); sinh((xpos+%i*x1)/2); sqrt((xpos+%i*x1)^2)/(xpos+%i*x1)*sqrt((cosh(xpos+%i*x1)-1)/2); sinh((xneg+%i*x1)/2); sqrt((xneg+%i*x1)^2)/(xneg+%i*x1)*sqrt((cosh(xneg+%i*x1)-1)/2); /* Cosh function with Real arguments */ cosh(x/2); sqrt((cosh(x)+1)/2); cosh(x/2)^2; (cosh(x)+1)/2; cosh(xpos/2); sqrt((cosh(xpos)+1)/2); cosh(xneg/2); sqrt((cosh(xneg)+1)/2); /* Cosh function with Complex arguments */ /* x1 is in (-%pi,%pi) */ cosh(%i*x1/2); sqrt((cosh(%i*x1)+1)/2); cosh((xpos+%i*x1)/2); sqrt((cosh(xpos+%i*x1)+1)/2); cosh((xneg+%i*x1)/2); sqrt((cosh(xneg+%i*x1)+1)/2); /* Problem 33 in rtest_trig will fail. The argument has to be restricted to a positive interval, then the example works again */ (trig : [cos(x), sin(x), tan(x), csc(x), sec(x), cot(x)],0); 0$ (htrig : [cosh(x), sinh(x), tanh(x), csch(x), sech(x), coth(x)],0); 0$ /* We restrict to be positive value in the interval (0,3). In this interval sin(x/2) and cos(x/2) and the corresponding hyperbolic functions simplifies to the known simple expressions. Remark: Better would be %pi as upper limit, but this does not work! Is this related to known problems with assume? */ (assume(x>0,x<3),halfangles : true, 0); 0$ (xtrig : subst(x/2,x, append(trig,htrig)),0); 0$ (halfangles : false, 0); 0$ xtrig : taylor(xtrig - subst(x/2,x, append(trig,htrig)),x,0,5); ''(makelist(taylor(0,x,0,5),i,1,length(append(trig,htrig))))$ (forget(x>0,x<3),0); 0; /* Restore global flags */ (halfangles:old_halfangles,%iargs:old_%iargs,done); done; From toy.raymond at gmail.com Fri Jan 2 08:31:31 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 02 Jan 2009 09:31:31 -0500 Subject: [Maxima] Fitting in Maxima In-Reply-To: <3384951C-FC8E-4862-84C3-C368F967C6F0@gmail.com> References: <3384951C-FC8E-4862-84C3-C368F967C6F0@gmail.com> Message-ID: <495E2543.9030301@gmail.com> ?iga Lenar?i? wrote: > > 4) Will there be possibility to call compiled numerical libraries > (ATLAS ..) from lisp in the future? I know gcl is kinda the limiting > factor right now.. I think f2cl conversions of numerical libraries > should not be a part of maxima. Especially if the user has to call > them with their fortran names. It's better to implement an > unoptimised original algorithm in lisp by hand (and tailored to > maxima's needs), since f2cl translations do not inherit the speed of > original fortran porgrams, neither are they consistent with other > maxima code or gain anything. So it's like using fortran without > speed, why would you do that? Ideally we should use ATLAS for > numerical linear algebra, so speed-wise maxima would be on par with > MATLAB and mathematica. Any chance of this becoming reality? > The names are the LAPACK names because no one has come up with good names. Feel free to suggest new names and implement the appropriate interface. I haven't heard many comments about LAPACK support, so it seems no one is really using it at all. The best part of the f2cl translations is that no one else had to spend their time writing Lisp equivalents for them. Doing something like LAPACK from scratch by hand in Lisp seems like a huge waste of time. That the translations aren't as fast as the original Fortran is not a fault of the translation but of the Lisp used to compile it. Rewriting it in Lisp won't solve the speed problem if your Lisp can't do a good job of compiling the f2cl-converted code. If you feel like rewriting LAPACK in Lisp and can do as good a job as the original authors, please do so. There is also one other possibility that the f2cl translations gives us. With a bit of extra Lisp code, we can convert the current double-float LAPACK routines into arbitrary precision LAPACK routines. I know this can be done because I automatically converted many of the routines to work with quad-double precision numbers. That would have been quite a bit more difficult without the Lisp translation. > > I would like Fit to use svd instead of ^^-1, since it's more robust, > but looks like i have to implement svd first? How and where should > svd be implemented in Maxima? > If it were me, I'd just hook up an interface to LAPACK's svd function. If you think you can write one from scratch that is as good and robust as LAPACK, go ahead. Ray, who thinks there's a reason why there are apparently no other competing packages for LAPACK. From luigi_marino2 at alice.it Fri Jan 2 02:22:17 2009 From: luigi_marino2 at alice.it (Luigi Marino) Date: Fri, 2 Jan 2009 09:22:17 +0100 Subject: [Maxima] Equations Message-ID: <8DA6CA16D867484A9B52CB4DA5514510@windowsa96d2f1> Andrew wrote: I noticed that solve does not check roots for tolerance range. A simple example of this is solve([1/x + 1/y =0 , x*y =0],[x,y]); Maxima gives the solution x=0, y=0. How to make Maxima check the roots? Maybe some global flags? Hi . A possible solution: declare x and y not equal zero and Maxima finds indeterminate system: x=%*r and y=-%*r infact (x+y)/(xy)=x+y (eliminate denominator). 2. Try k=x^2 and solve two equations. Luigi Marino. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090102/5b180194/attachment.htm From toy.raymond at gmail.com Fri Jan 2 10:56:59 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 02 Jan 2009 11:56:59 -0500 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic Message-ID: <495E475B.3010906@gmail.com> I think a long time ago, I talked with Barton about this, and have now finally gotten a round to implementing it. I've written a set of CLOS classes to make working with bigfloat and complex bigfloat numbers easier. It's a new package "NUMERIC" where the standard Lisp operations have been shadowed to work with a new bigfloat and complex-bigfloat numbers. The source is available at http://common-lisp.net/~rtoy/numeric.lisp. If you want to try it you'll need to modify maxima-package.lisp and maxima.system a bit. Instructions included in numeric.lisp. Here's a quick example what you can do: :lisp (numeric:sqrt (numeric:bigfloat -8)) 0.0b0 + %i* 2.82842712474619b0 (numeric:bigfloat converts a float or integer to a bigfloat object) Here is the ascending-transform from ellipt.lisp, for double-floats: (defun ascending-transform (u m) (let* ((root-m (cl:sqrt m)) (mu (/ (* 4 root-m) (cl:expt (1+ root-m) 2))) (root-mu1 (/ (- 1 root-m) (+ 1 root-m))) (v (/ u (1+ root-mu1)))) (values v mu root-mu1))) The equivalent that would for double-floats, bigfloats, or complex-bigfloats is: (defun ascending-transform (u m) (let* ((root-m (numeric:sqrt m)) (mu (numeric:/ (numeric:* 4 root-m) (numeric:expt (numeric:1+ root-m) 2))) (root-mu1 (numeric:/ (numeric:- 1 root-m) (numeric:+ 1 root-m))) (v (numeric:/ u (numeric:1+ root-mu1)))) (values v mu root-mu1))) Of course, if you really needed max speed with just double-float, you need to write a special version for that, but at least this package makes it easy to write one version that will handle double-float, bigfloat or complex bigfloats. If people find this useful, perhaps it can be added to maxima. The routines still need some work, and not all corresponding Lisp arithmetic functions have been implemented yet. One side benefit is that the bigfloat operations have been abstracted out, so we can easily replace Maxima's current bigfloat implementation with a different implementation like GMP or MPFR. Ray From fateman at cs.berkeley.edu Fri Jan 2 11:07:08 2009 From: fateman at cs.berkeley.edu (R Fateman) Date: Fri, 02 Jan 2009 09:07:08 -0800 Subject: [Maxima] Equations In-Reply-To: <8DA6CA16D867484A9B52CB4DA5514510@windowsa96d2f1> References: <8DA6CA16D867484A9B52CB4DA5514510@windowsa96d2f1> Message-ID: <495E49BC.7000001@cs.berkeley.edu> So far as I know, solve does not check the roots it produces, but you could easily write a program, say marino_solve, that calls solve and then checks the roots. One reason for solve not checking the roots is that sometimes Maxima is not able to simplify the result of the substitution into the original equation to zero. So the solution may be correct but proving it may be too hard. Roots of cubics and quartics can be very hard, for example. RJF Luigi Marino wrote: > Andrew wrote: > > I noticed that solve does not check roots for tolerance range. > A simple example of this is solve([1/x + 1/y =0 , x*y =0],[x,y]); > Maxima gives the solution x=0, > y=0. How to make Maxima check the roots? Maybe some global flags? > > Hi . > A possible solution: > declare x and y not equal zero > and Maxima finds indeterminate system: > x=%*r and y=-%*r > infact (x+y)/(xy)=x+y (eliminate denominator). > 2. Try k=x^2 and solve two equations. > > Luigi Marino. > > ------------------------------------------------------------------------ > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From fateman at cs.berkeley.edu Fri Jan 2 11:29:40 2009 From: fateman at cs.berkeley.edu (R Fateman) Date: Fri, 02 Jan 2009 09:29:40 -0800 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: <495E475B.3010906@gmail.com> References: <495E475B.3010906@gmail.com> Message-ID: <495E4F04.4010803@cs.berkeley.edu> An alternative design that I used in my generic arithmetic package (free/....) is to do the conversion this way: have the program that makes a number into a bigfloat called "to" have the program that makes a number into a quadfloat called "to" ...etc and have the packages make the difference. e.g. (generic:+ (bigfloat:to 3) (bigfloat:to 1/2)) With the right declarations for package usage you can eliminate some of the package qualifications. They are sort of equivalent to Ray's stuff if you consider (defun numeric:bigfloat(x) (bigfloat:to x)) The actual work to figure out the equivalent number in a different form has to be done somewhere. I'm all in favor of using CLOS, the common lisp object system, which didn't exist when Maxima was written starting in 1966, or when bigfloats were written, circa 1974. RJF From biomates at telefonica.net Fri Jan 2 11:32:30 2009 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 02 Jan 2009 18:32:30 +0100 Subject: [Maxima] Windows Maxima running in Linux Message-ID: <1230917550.9960.12.camel@pc> I think this fact has never been commented here in the list before, so I write this post for the record. It is possible to run Maxima's windows executable in Linux with 'wine', just write: $ sudo apt-get install wine $ wine maxima-5.17.1.exe In Ubuntu Hardy, wgnuplot, maxima, xmaxima and wxmaxima all worked without problems. Probably the same can be said for other linuxes. Mario From talon at lpthe.jussieu.fr Fri Jan 2 12:49:42 2009 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 02 Jan 2009 19:49:42 +0100 Subject: [Maxima] Fitting in Maxima References: <3384951C-FC8E-4862-84C3-C368F967C6F0@gmail.com> <495E2543.9030301@gmail.com> Message-ID: Raymond Toy wrote: > > > Ray, who thinks there's a reason why there are apparently no other > competing packages for LAPACK. > Indeed numerical analysis is a hard subject! By the way, since the OP was speaking about numerical solutions of ODE, there is a wonderful program in netlib, called colnew who is able to solve all sorts of boundary problems for ODEs. I have used it for my work and it really does wonders. But this is a very complicated program, with a complicated interface. I have tried once to run it through f2cl, but i think i remember it did not pass entirely through. Anyways it would be a great addition to maxima if someone more competent than me was able to make it work here, since the only other place it is ported to, as far a i know, is scilab, where the implementation is incomplete (there is no provision for continuations - a fundamental feature of this program). It can be found at: http://www.netlib.org/ode/colnew.f -- Michel Talon From toy.raymond at gmail.com Fri Jan 2 12:50:16 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 02 Jan 2009 13:50:16 -0500 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: <495E4F04.4010803@cs.berkeley.edu> References: <495E475B.3010906@gmail.com> <495E4F04.4010803@cs.berkeley.edu> Message-ID: <495E61E8.8030007@gmail.com> R Fateman wrote: > An alternative design that I used in my generic arithmetic package > (free/....) is to do the conversion this way: > > have the program that makes a number into a bigfloat called "to" > have the program that makes a number into a quadfloat called "to" > ...etc > and have the packages make the difference. > > e.g. (generic:+ (bigfloat:to 3) (bigfloat:to 1/2)) I'm certainly open to having the appropriate interface that makes it easy for users. In this case, I'd would certainly like (coerce 3 'bigfloat) to work. Haven't implemented that yet and there are various issues with doing that. In any case, we need some function to convert maxima's internal bigfloat representation to a bigfloat object. Haven't done that either. > > With the right declarations for package usage you can eliminate some > of the package > qualifications. Yeah, I think typical usage would have an (in-package "NUMERIC") to get rid of the package qualifiers. One thing that would be nice to have is to modify the existing routines for special functions to use the new objects, since reading and writing bigfloat code is a bit difficult. (It's fpplus and fpminus but fpminus is unary minus, not binary, which is fpdifference. It's fptimes* not fptimes,. There's fpgreaterp and fplessp, but no fpgreater-or-equal-p.) But the existing code works, so perhaps this isn't worth doing. One issue with the current numeric code is that for some of the special functions it calls mevalp to compute them. I think it would be nicer not to have to do that. A nice side-effect, though, is that the numeric package always computes EXACTLY what maxima would otherwise have computed. Ray From toy.raymond at gmail.com Fri Jan 2 12:51:29 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 02 Jan 2009 13:51:29 -0500 Subject: [Maxima] Windows Maxima running in Linux In-Reply-To: <1230917550.9960.12.camel@pc> References: <1230917550.9960.12.camel@pc> Message-ID: <495E6231.3010004@gmail.com> Mario Rodriguez wrote: > I think this fact has never been commented here in the list before, so I > write this post for the record. > > It is possible to run Maxima's windows executable in Linux with 'wine', > just write: > > $ sudo apt-get install wine > $ wine maxima-5.17.1.exe > > In Ubuntu Hardy, wgnuplot, maxima, xmaxima and wxmaxima all worked > without problems. Probably the same can be said for other linuxes. > > Kind of cool to be able to do that. But is there any advantage in running maxima that way? Why not just run the Linux version directly? Ray From toy.raymond at gmail.com Fri Jan 2 13:36:48 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 02 Jan 2009 14:36:48 -0500 Subject: [Maxima] Fitting in Maxima In-Reply-To: References: <3384951C-FC8E-4862-84C3-C368F967C6F0@gmail.com> <495E2543.9030301@gmail.com> Message-ID: <495E6CD0.6000903@gmail.com> Michel Talon wrote: > Raymond Toy wrote: > > >> Ray, who thinks there's a reason why there are apparently no other >> competing packages for LAPACK. >> >> > > Indeed numerical analysis is a hard subject! By the way, since the OP was > speaking about numerical solutions of ODE, there is a wonderful program in > f2cl includes the ODEPACK from netlib, as a test case. Most of the tests cases in ODEPACK work. Don't know if ODEPACK will solve the ODEs needed. > netlib, called colnew who is able to solve all sorts of boundary problems > for ODEs. I have used it for my work and it really does wonders. But this is > a very complicated program, with a complicated interface. I have tried once > to run it through f2cl, but i think i remember it did not pass entirely > through. Anyways it would be a great addition to maxima if someone more > competent than me was able to make it work here, since the only other place > it is ported to, as far a i know, is scilab, where the implementation is > incomplete (there is no provision for continuations - a fundamental feature > of this program). It can be found at: > http://www.netlib.org/ode/colnew.f > I'll take a look at it. A quick 5 second glance at the code doesn't indicate anything that f2cl should not be able to handle, except for the Hollerith strings in FORMAT statements, which will have to be converted by hand to strings, and for an ENTRY function that f2cl can sometimes handle. Ray From biomates at telefonica.net Fri Jan 2 13:42:02 2009 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 02 Jan 2009 20:42:02 +0100 Subject: [Maxima] Windows Maxima running in Linux In-Reply-To: <495E6231.3010004@gmail.com> References: <1230917550.9960.12.camel@pc> <495E6231.3010004@gmail.com> Message-ID: <1230925322.6907.14.camel@pc> > > In Ubuntu Hardy, wgnuplot, maxima, xmaxima and wxmaxima all worked > > without problems. Probably the same can be said for other linuxes. > > > > > Kind of cool to be able to do that. But is there any advantage in > running maxima that way? Why not just run the Linux version directly? > > Ray With this trick I don't need to install windows to test my code, specially that of package draw, or what features are available in wgnuplot. When I write some new code I am not sure how does it work in windows until I get to work, where I have some products of the Microsoft factory installed. Aside from that, I don't see any advantages. Mario From aaparker at gmail.com Fri Jan 2 14:03:14 2009 From: aaparker at gmail.com (ahmet alper parker) Date: Fri, 2 Jan 2009 22:03:14 +0200 Subject: [Maxima] Management Model for Open Source Software Developement Projects Message-ID: <1d4427680901021203web48e2dx845b5c6067f5362d@mail.gmail.com> Hi All,I want to ask you that is there a management model (schedule, plan, responsible people etc.) in the development phase of maxima? And also, if no, do you know if there exists some or someone using something? And more importantly, if no, do you consider to implement such a model? Best Regarsa AAP -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090102/ae4e8b36/attachment.htm From willisb at unk.edu Fri Jan 2 15:15:37 2009 From: willisb at unk.edu (Barton Willis) Date: Fri, 2 Jan 2009 15:15:37 -0600 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: <495E475B.3010906@gmail.com> References: <495E475B.3010906@gmail.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I think a long time ago, I talked with Barton about this, and have now >finally gotten a round to implementing it. > >I've written a set of CLOS classes to make working with bigfloat and >complex bigfloat numbers easier. It's a new package "NUMERIC" where the >standard Lisp operations have been shadowed to work with a new bigfloat >and complex-bigfloat numbers. Great -- my version didn't use CLOS; I just had functions, such as fp+, that did complex float / bigfloat addition. I think I'll have a use for NUMERIC. I'd suggest starting a /contrib/numeric folder; eventually, I might have some extensions. Barton From toy.raymond at gmail.com Fri Jan 2 16:22:36 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 02 Jan 2009 17:22:36 -0500 Subject: [Maxima] Fitting in Maxima In-Reply-To: References: <3384951C-FC8E-4862-84C3-C368F967C6F0@gmail.com> <495E2543.9030301@gmail.com> Message-ID: <495E93AC.80806@gmail.com> Michel Talon wrote: > Raymond Toy wrote: > > >> Ray, who thinks there's a reason why there are apparently no other >> competing packages for LAPACK. >> >> > > Indeed numerical analysis is a hard subject! By the way, since the OP was > speaking about numerical solutions of ODE, there is a wonderful program in > netlib, called colnew who is able to solve all sorts of boundary problems > for ODEs. I have used it for my work and it really does wonders. But this is > a very complicated program, with a complicated interface. I have tried once > to run it through f2cl, but i think i remember it did not pass entirely > through. Anyways it would be a great addition to maxima if someone more > competent than me was able to make it work here, since the only other place > it is ported to, as far a i know, is scilab, where the implementation is > incomplete (there is no provision for continuations - a fundamental feature > of this program). It can be found at: > http://www.netlib.org/ode/colnew.f > > Ok. I see that colnew tickles a couple of bugs in f2cl. Those are fixed now. After adding a couple of missing linpack routines and a small compatibility file, it all compiles. So, do you have a simple test program that I can use to check to see if the conversion actually works? Ray From al at beshenov.ru Fri Jan 2 16:24:38 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Sat, 3 Jan 2009 01:24:38 +0300 Subject: [Maxima] nary & commutative? Message-ID: <200901030124.39925.al@beshenov.ru> (%i1) nary ("foo", 100)$ (%i2) a foo c foo b; (%o2) a foo c foo b (%i3) declare ("foo", commutative)$ (%i4) a foo c foo b; (%o4) a foo b foo c (%i5) declare ("foo", nary)$ (%i6) a foo (c foo b); (%o6) a foo c foo b Why does declare ("foo", nary) break commutative simplification (i.e. rearranging of the symbols)? I think Maxima should flatten nested expressions and then simplify (($foo) a c b) to (($foo) a b c). -- Boomtime, Chaos 2 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From danmonalto at yahoo.es Fri Jan 2 16:31:50 2009 From: danmonalto at yahoo.es (Daniel Monte Alto) Date: Fri, 2 Jan 2009 14:31:50 -0800 (PST) Subject: [Maxima] Windows Maxima running in Linux In-Reply-To: <495E6231.3010004@gmail.com> Message-ID: <672224.95181.qm@web24613.mail.ird.yahoo.com> > Mario Rodriguez wrote: > > I think this fact has never been commented here in the > list before, so I > > write this post for the record. > > > > It is possible to run Maxima's windows executable > in Linux with 'wine', > > just write: > > > > $ sudo apt-get install wine > > $ wine maxima-5.17.1.exe > > > > In Ubuntu Hardy, wgnuplot, maxima, xmaxima and > wxmaxima all worked > > without problems. Probably the same can be said for > other linuxes. I just did that and it works but there is a problem with wxmaxima graphics (only draw a box). Using the gnuplot option it works ok. I'm using Ubuntu 8.10 P.D. These are the steps: sudo apt-get install wine winecfg get maxima-5.17.1.exe from sourceforge copy maxima-5.17.1.exe to /home/yourname/.wine/drive_c wine "c:\Archivos de programa\Maxima-5.17.1.exe" wine "c:\Archivos de programa\wxMaxima\wxMaxima.exe" This can be useful to test new versions in Linux and Windows. From toy.raymond at gmail.com Fri Jan 2 16:54:57 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 02 Jan 2009 17:54:57 -0500 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: References: <495E475B.3010906@gmail.com> Message-ID: <495E9B41.4030408@gmail.com> Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > > >> I think a long time ago, I talked with Barton about this, and have now >> finally gotten a round to implementing it. >> >> I've written a set of CLOS classes to make working with bigfloat and >> complex bigfloat numbers easier. It's a new package "NUMERIC" where the >> standard Lisp operations have been shadowed to work with a new bigfloat >> and complex-bigfloat numbers. >> > > > Great -- my version didn't use CLOS; I just had functions, such as fp+, > that > did complex float / bigfloat addition. I think I'll have a use for NUMERIC. > I'd > suggest starting a /contrib/numeric folder; eventually, I might have some > extensions. > > > Actually, I was hoping it might be suitable for putting in src. Why? Take a look at gamma.lisp, and all of the routines Dieter had to write for double-float, bigfloat, complex bigfloat, etc. They all look pretty much identical, except for the fact that he had to use different operation names for each case. With NUMERIC (I open for a different package name), he could have just used one routine to implement them all. (I think.) Yes, for speed, we may have wanted a separate routine for double-floats, but that could have waited until later when someone really needed the speed. And the current routines aren't particularly fast anyway. No offense to Dieter. He just didn't declare any variable types to help the compiler generate fast double-float code. :-) Ray From biomates at telefonica.net Fri Jan 2 17:09:37 2009 From: biomates at telefonica.net (Mario Rodriguez) Date: Sat, 03 Jan 2009 00:09:37 +0100 Subject: [Maxima] Windows Maxima running in Linux In-Reply-To: <672224.95181.qm@web24613.mail.ird.yahoo.com> References: <672224.95181.qm@web24613.mail.ird.yahoo.com> Message-ID: <1230937777.10365.6.camel@pc> > > I just did that and it works but there is a problem with wxmaxima graphics (only draw a box). > Using the gnuplot option it works ok. I'm using Ubuntu 8.10 I see. Embedded graphics seem to be unstable. In any case, for checking purposes, what I get is enough. Mario From willisb at unk.edu Fri Jan 2 17:18:32 2009 From: willisb at unk.edu (Barton Willis) Date: Fri, 2 Jan 2009 17:18:32 -0600 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: <495E9B41.4030408@gmail.com> References: <495E475B.3010906@gmail.com> , <495E9B41.4030408@gmail.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Actually, I was hoping it might be suitable for putting in src. Why? >Take a look at gamma.lisp, and all of the routines Dieter had to write >for double-float, bigfloat, complex bigfloat, etc. They all look pretty >much identical, except for the fact that he had to use different >operation names for each case. Sure, that would be great. Have you tried your CLOS with GCL? Barton From drdieterkaiser at web.de Fri Jan 2 17:23:03 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 03 Jan 2009 00:23:03 +0100 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: <495E9B41.4030408@gmail.com> References: <495E475B.3010906@gmail.com> <495E9B41.4030408@gmail.com> Message-ID: <1230938583.5525.17.camel@dieter-laptop> Am Freitag, den 02.01.2009, 17:54 -0500 schrieb Raymond Toy: > Barton Willis wrote: > > -----maxima-bounces at math.utexas.edu wrote: ----- > > > > > >> I think a long time ago, I talked with Barton about this, and have now > >> finally gotten a round to implementing it. > >> > >> I've written a set of CLOS classes to make working with bigfloat and > >> complex bigfloat numbers easier. It's a new package "NUMERIC" where the > >> standard Lisp operations have been shadowed to work with a new bigfloat > >> and complex-bigfloat numbers. > >> > > > > > > Great -- my version didn't use CLOS; I just had functions, such as fp+, > > that > > did complex float / bigfloat addition. I think I'll have a use for NUMERIC. > > I'd > > suggest starting a /contrib/numeric folder; eventually, I might have some > > extensions. > > > > > > > Actually, I was hoping it might be suitable for putting in src. Why? > Take a look at gamma.lisp, and all of the routines Dieter had to write > for double-float, bigfloat, complex bigfloat, etc. They all look pretty > much identical, except for the fact that he had to use different > operation names for each case. > > With NUMERIC (I open for a different package name), he could have just > used one routine to implement them all. (I think.) Yes, for speed, we > may have wanted a separate routine for double-floats, but that could > have waited until later when someone really needed the speed. And the > current routines aren't particularly fast anyway. No offense to > Dieter. He just didn't declare any variable types to help the compiler > generate fast double-float code. :-) Hello Ray, yes you are right. The routines are almost identical. Most things I had to change because of different tests for zero or equivalence, etc ... I have already finished the numerical routines for the Beta Incomplete function. I will try to use your code. By the way. I like the object oriented style very much. The time I started to work on the code of Maxima I have tried to rewrite the parser to use objects of a class structure. The first steps works fine and I was able to integrate the code in the complete Maxima project. One advantage can be to reduce the lots of cond and case for the different types in the code. It would be very good to have a concept for all Maxima numbers including rational, etc. Dieter Kaiser From toy.raymond at gmail.com Fri Jan 2 17:29:12 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 02 Jan 2009 18:29:12 -0500 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: References: <495E475B.3010906@gmail.com> , <495E9B41.4030408@gmail.com> Message-ID: <495EA348.1040402@gmail.com> Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > > >> Actually, I was hoping it might be suitable for putting in src. Why? >> Take a look at gamma.lisp, and all of the routines Dieter had to write >> for double-float, bigfloat, complex bigfloat, etc. They all look pretty >> much identical, except for the fact that he had to use different >> operation names for each case. >> > > Sure, that would be great. Have you tried your CLOS with GCL? > > Not yet. That's on my list. It should be ok, though since gcl uses PCL for its CLOS, just like cmucl. And I'm not doing anything really fancy with CLOS. I think gcl doesn't have define-compiler-macro, so those might have to be removed for gcl. But that's not too important, since it just expanded out (+ a b c) to multiple calls to two-arg-+. Ray From toy.raymond at gmail.com Fri Jan 2 17:33:56 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 02 Jan 2009 18:33:56 -0500 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: <1230938583.5525.17.camel@dieter-laptop> References: <495E475B.3010906@gmail.com> <495E9B41.4030408@gmail.com> <1230938583.5525.17.camel@dieter-laptop> Message-ID: <495EA464.3050905@gmail.com> Dieter Kaiser wrote: > Hello Ray, > > yes you are right. The routines are almost identical. Most things I had > to change because of different tests for zero or equivalence, etc ... > Hopefully, this will simplify your work by just having to write (and debug!!!!) just one routine. > I have already finished the numerical routines for the Beta Incomplete > function. I will try to use your code. > That would be great. Undoubtly there are errors in the code, but they should be easy to find and fix. > > > One advantage can be to reduce the lots of cond and case for the > different types in the code. It would be very good to have a concept for > all Maxima numbers including rational, etc. > > You mean to handle ((rat) 1 2) kind of maxima rationals? That shouldn't be two hard. Just need to extend numeric::bigfloat. Other than that, I think we already handle all of Maxima's numeric types. Ray From talon at lpthe.jussieu.fr Fri Jan 2 18:31:30 2009 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sat, 03 Jan 2009 01:31:30 +0100 Subject: [Maxima] Fitting in Maxima References: <3384951C-FC8E-4862-84C3-C368F967C6F0@gmail.com> <495E2543.9030301@gmail.com> <495E93AC.80806@gmail.com> Message-ID: Raymond Toy wrote: > Michel Talon wrote: >> Raymond Toy wrote: >> > >> > Ok. I see that colnew tickles a couple of bugs in f2cl. Those are > fixed now. After adding a couple of missing linpack routines and a > small compatibility file, it all compiles. Fantastic! > > So, do you have a simple test program that I can use to check to see if > the conversion actually works? In my work i have used colnew as embedded in scilab, where it is called bvode. The man page can be found here http://www.scilab.org/doc/manual/Docu-html659.html and contains simple examples. As i remember colnew needs to be called from an other program which reserves a "workspace", that is room in memory where computations are done more or less "in place", and where the final result appears. Scilab reserves this space on the stack, reads the results and returns, destroying the workspace. This by itself forbids using the continuations method which consists of using a previous result as a guess for a succeeding computation with slightly different parameters. So we had to hack a little bit the scilab code to preserve the stack, but the hack was very fragile and only sufficient to run our computation. I think continuation is obtained by taking ipar(9)=2 in the above man page, but it is broken in scilab. So i suspect to use colnew in maxima the first step is to create a workspace of size ipar(5) i think. Also one needs of course to define the system to solve and its Jacobian. If you want to see the problem we were looking at, and a description of how colnew works (as far as i understood, because it is complex) you can look at: http://arxiv.org/pdf/hep-th/0509226 notably section 4 for the description of colnew. The example of this paper is very interesting to show why the usual class of boundary value problems for ODE ( that is solving a second order equation with given values at both ends of an interval, getting eigenvalues ) is far too restricted to solve many interesting problems that colnew can tackle without difficulty. By the way this type of ODE problems (basically finding eigenvalues and eigenvectors of spectral problems) is radically different from the typical elementary ODE solver which simply solves an ODE given initial values. For that there are tons of programs in matlab, scilab, octave, all algebraic computing programs, etc. the only difficulty here being not losing too much precision when time grows. Thanks a lot for your attention. > > Ray -- Michel Talon From fateman at cs.berkeley.edu Fri Jan 2 23:16:46 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Fri, 02 Jan 2009 21:16:46 -0800 Subject: [Maxima] wxmaxima slows down if you have a large expression display Message-ID: <495EF4BE.9010407@cs.berkeley.edu> It seems that wxmaxima must re-process the whole front-end buffer before getting to read the new input. This makes it very sluggish, after a while. This might be related to the problem where display of a big section of "info" kills the front end entirely. wxMaxima 0.8.0 http://wxmaxima.sourceforge.net Maxima 5.17.0 http://maxima.sourceforge.net Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL) From van.nek at arcor.de Sat Jan 3 03:48:57 2009 From: van.nek at arcor.de (van Nek) Date: Sat, 03 Jan 2009 10:48:57 +0100 Subject: [Maxima] Windows Maxima running in Linux In-Reply-To: <1230925322.6907.14.camel@pc> References: <1230917550.9960.12.camel@pc>, <495E6231.3010004@gmail.com>, <1230925322.6907.14.camel@pc> Message-ID: <495F4299.12699.1216EB@van.nek.arcor.de> Hi Mario, did you try a virtual Windows on ubuntu? That would be a realistic test environment. I do it the other way round: I installed ubuntu in virtualbox (free software, Linux version available) on my Windows 2000 to learn Linux. Pretty cool. I don't need to shut down the virtual OS. I can save the current status and within 5 seconds I can start ubuntu that way. Happy new year Best wishes Volker Am 2 Jan 2009 um 20:42 hat Mario Rodriguez geschrieben: > > > > In Ubuntu Hardy, wgnuplot, maxima, xmaxima and wxmaxima all worked > > > without problems. Probably the same can be said for other linuxes. > > > > > > > > Kind of cool to be able to do that. But is there any advantage in > > running maxima that way? Why not just run the Linux version directly? > > > > Ray > > With this trick I don't need to install windows to test my code, > specially that of package draw, or what features are available in > wgnuplot. When I write some new code I am not sure how does it work in > windows until I get to work, where I have some products of the Microsoft > factory installed. > > Aside from that, I don't see any advantages. > > Mario > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From biomates at telefonica.net Sat Jan 3 04:51:24 2009 From: biomates at telefonica.net (Mario Rodriguez) Date: Sat, 03 Jan 2009 11:51:24 +0100 Subject: [Maxima] Windows Maxima running in Linux In-Reply-To: <495F4299.12699.1216EB@van.nek.arcor.de> References: <1230917550.9960.12.camel@pc>, <495E6231.3010004@gmail.com> , <1230925322.6907.14.camel@pc> <495F4299.12699.1216EB@van.nek.arcor.de> Message-ID: <1230979884.8046.36.camel@pc> > Hi Mario, Wie geht's Volker? > did you try a virtual Windows on ubuntu? That would be a realistic test environment. I do it > the other way round: I installed ubuntu in virtualbox (free software, Linux version available) > on my Windows 2000 to learn Linux. Pretty cool. I don't need to shut down the virtual OS. I > can save the current status and within 5 seconds I can start ubuntu that way. I have never used it. But I could try it for other purposes, since in general I'm not very happy with wine. My problem is that in Linux, draw calls gnuplot via pipes, and in windows via a system call. Since I don't have a windows system at hand, when I write some code here, I don't know how it works there. On the other hand, wgnuplot is another source of problems. Some common terminals used in draw are (or were) not supported in the windows version. That's the only reason I need maxima on windows. > Happy new year > Best wishes > Volker Herzliche Gl?ckw?nsche! Mario From biomates at telefonica.net Sat Jan 3 05:02:55 2009 From: biomates at telefonica.net (Mario Rodriguez) Date: Sat, 03 Jan 2009 12:02:55 +0100 Subject: [Maxima] Problems with sftp Message-ID: <1230980575.8763.8.camel@pc> Hi, I have built the pdf of the Spanish manual for version 5.17, but I have problems connecting to sourceforge: $ sftp riotorto at shell.sourceforge.net:/home/groups/m/ma/maxima/htdocs Connecting to shell.sourceforge.net... riotorto at shell.sourceforge.net's password: Request for subsystem 'sftp' failed on channel 0 Couldn't read packet: Connection reset by peer Is there another way for doing this? By the way, what's the command to generate the English pdf version? texi2pdf maxima.texi doesn't work with version 5.17.1, but works fine with current cvs. Mario From David.Billinghurst at riotinto.com Sat Jan 3 08:28:24 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Sun, 4 Jan 2009 01:28:24 +1100 Subject: [Maxima] Further improvements to integral property code Message-ID: <026DCC31AB859648A6F16C0E5CD2580D01789988@calttsv025.cal.riotinto.org> I have spent some time tidying up the integral property code that Dieter and I have been working on recently. It now works for functions with an arbitrary number of arguements. I then extended it to work for: - cases where the integral property is a function, and - subscripted functions. Have a look at the bessel function and psi function for examples. integrate(bessel_y(3,x),x); -2*bessel_y(2,x)-bessel_y(0,x); integrate(bessel_k(7,x),x); 2*(-bessel_k(6,x)+bessel_k(4,x)-bessel_k(2,x))+bessel_k(0,x); integrate(psi[0](x),x); log_gamma(x); integrate(psi[1](x),x); psi[0](x); As a further test I had a go at the 0F1 hypergeometric function with the following code (which is not in CVS). (defprop $%f ((p q p-list q-list z) nil nil nil nil (lambda (p q p-list q-list unused) (cond ;; integral of 0F1(;b;z) ((and (alike1 p 0) (alike1 q 1)) (integral-0F1 (cadr q-list))) (t nil)))) integral) ;; Return a form suitable for integral property ;; integral of 0F1[0,1](;b;z) = (b-1) * 0F1[0,1](;b-1;z) (defun integral-0F1 (b) `((mtimes) ((mqapply) (($%f array) 0 1) ((mlist)) ((mlist) ((mplus) -1 ,b)) z) ((mplus) -1 ,b))) This gives: (%i2) integrate(%f[0,1]([],[a],z),z); (%o2) %f ([], [a - 1], z) (a - 1) 0, 1 (%i3) diff(%,z); (%o3) %f ([], [a], z) 0, 1 This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. From toy.raymond at gmail.com Sat Jan 3 08:55:48 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 03 Jan 2009 09:55:48 -0500 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: References: <495E475B.3010906@gmail.com> , <495E9B41.4030408@gmail.com> Message-ID: <495F7C74.2070800@gmail.com> Barton Willis wrote: > -----maxima-bounces at math.utexas.edu wrote: ----- > > >> Actually, I was hoping it might be suitable for putting in src. Why? >> Take a look at gamma.lisp, and all of the routines Dieter had to write >> for double-float, bigfloat, complex bigfloat, etc. They all look pretty >> much identical, except for the fact that he had to use different >> operation names for each case. >> > > Sure, that would be great. Have you tried your CLOS with GCL? > > The current numeric class doesn' work with GCL. It seems that GCL is missing the REAL class. It has the REAL type, but not the REAL class. I don't know why. It would be best if we could somehow tell GCL about the REAL class, but I don't know how to do that. I'll have to change all the methods specialized on REAL to specialize on FLOAT and add an equivalent method for RATIONAL. Ray From al at beshenov.ru Sat Jan 3 11:11:09 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Sat, 3 Jan 2009 20:11:09 +0300 Subject: [Maxima] Problems with sftp In-Reply-To: <1230980575.8763.8.camel@pc> References: <1230980575.8763.8.camel@pc> Message-ID: <200901032011.10482.al@beshenov.ru> On Saturday 03 January 2009 14:02:55 Mario Rodriguez wrote: > $ sftp > riotorto at shell.sourceforge.net:/home/groups/m/ma/maxima/htdocs > Connecting to shell.sourceforge.net... > riotorto at shell.sourceforge.net's password: > Request for subsystem 'sftp' failed on channel 0 > Couldn't read packet: Connection reset by peer Use riotorto,maxima at web.sourceforge.net. -- Pungenday, Chaos 3 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From robert.dodier at gmail.com Sat Jan 3 12:36:07 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 3 Jan 2009 11:36:07 -0700 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: <495E9B41.4030408@gmail.com> References: <495E475B.3010906@gmail.com> <495E9B41.4030408@gmail.com> Message-ID: On 1/2/09, Raymond Toy wrote: > Actually, I was hoping it might be suitable for putting in src. I'd rather put it in src also. I think it should be available to core functions. > With NUMERIC (I open for a different package name), NUMERIC suggests stuff like Newton's method, quadrature, etc.... Maybe ARITHMETIC instead? I guess it's not much of an improvement. FWIW Robert Dodier From drdieterkaiser at web.de Sat Jan 3 14:17:05 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 3 Jan 2009 21:17:05 +0100 Subject: [Maxima] Maxima lists and $use_fast_arrays Message-ID: I have detected that it is possible to write directly into a Maxima list or Maxima matrix using the flag $use_fast_arrays:true; (%i8) use_fast_arrays:true$ Bind a list with 9 values to the symbol a: (%i11) a:[1,2,3,4,5,6,7,8,9]; (%o11) [1,2,3,4,5,6,7,8,9] Fast arrays are on. Try to generate a fast array with one value: (%i12) a[3]:333; (%o12) 333 What has happend is that we have set the third value in the list: (%i14) a; (%o14) [1,2,333,4,5,6,7,8,9] Again we change a value in the list: (%i15) a[6]:666; (%o15) 666 (%i16) a; (%o16) [1,2,333,4,5,666,7,8,9] I do not know if this feature is really wanted. But it causes series failures as described in the bug report SF[887639]. You get a lot of strange things and at the end the Maxima session is killed. The reason is that the code do not do any checks for the range of the index and does not check the type of the index. This is the code in the function arrstore in mlisp.lisp which is responsible for this behavior (I have added an extra flag to hide this code completely): ((and $use_fast_arrays_with_list (eq the-type 'list)) (cond ((eq (caar tem) 'mlist) (setq index (car index)) (setf (nth index tem) r) r) ((eq (caar tem) '$matrix) (setf (nth (second index) (nth (first index) tem)) r) r) (t (error "The value of ~A is not a hash-table ,an ~ array, Maxima list, or a matrix" (caar l))))) The variable tem gets the value of the symbol $a which is bound to the list in the example above. This happens a bit earlier at the beginning of the function arrstore. The testsuite and the share_testsuite have no problems when I hide this code. Fortunately there seems to be no code which uses this functionality of $use_fast_arrays. It may be possible to improve this code (check range of index, ...), but I think it should be screened or perhaps completely cut out. Any comment? Dieter Kaiser From luigi_marino2 at alice.it Sat Jan 3 03:13:14 2009 From: luigi_marino2 at alice.it (Luigi Marino) Date: Sat, 3 Jan 2009 10:13:14 +0100 Subject: [Maxima] tips for Multiple roots of non-algebric equations Message-ID: <91D7C30713A54D1AB62D9DAA43A59F0C@windowsa96d2f1> I try to solve non-algebric equations with multiple roots. : 1. first example. f:log(x^2+1)-sin(x)-4; for k:-12 thru -3 step 1 do print("x="(newton(f,x,k,0.0000000001)))$ x=(-11.473978752837) x=(-11.47397875283699) x=(-10.11683910867541) x=(-10.11683910866628) x=(4.448769777051635) x=(-6.514022226263688) x=(-6.514022226261542) x=(-6.514022226263688) x=(5.817314641920149) x=(9.004771476502718) 2. second example. g:log(x+1)-2*x+1; log(x+1)-2*x+1(%i12) for k:-0.99 thru 1 step 1 do print("x="(newton(g,x,k,0.0000000001)))$ x=(-0.94435167809671) x=(0.79153693801855) 3. third example h:log(x+1)-1/2*x^2+0.6;(%o13) log(x+1)-x^2/2+0.6(%i14) for k:0 thru 1 step 1 do print("x="(newton(h,x,k,0.0000000001)))$ x=(-0.40442128319509) x=(1.806649648414053) Luigi Marino -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090103/7c524bd2/attachment.htm From robert.dodier at gmail.com Sat Jan 3 16:39:06 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 3 Jan 2009 15:39:06 -0700 Subject: [Maxima] Management Model for Open Source Software Developement Projects In-Reply-To: <1d4427680901021203web48e2dx845b5c6067f5362d@mail.gmail.com> References: <1d4427680901021203web48e2dx845b5c6067f5362d@mail.gmail.com> Message-ID: On 1/2/09, ahmet alper parker wrote: > I want to ask you that is there a management model (schedule, plan, > responsible people etc.) in the development phase of maxima? Well, the Maxima development process, to the extent that there is any, is the following. * There are 3 releases per year, April, August, and December. * Project administrators manage the releases and machinery such as the project web site and mailing list, but do not set goals for the project or oversee developers. * Ideas about what to do are often floated on the mailing list. * Developers work on stuff as their time, interests, and expertise permit. * Whether or not something gets done is largely a function of whether anybody wants to do it, and whether there is any active opposition to it. This is just a description of the current state of affairs. For my part, I'm not inclined to change it. FWIW Robert Dodier From biomates at telefonica.net Sat Jan 3 17:04:59 2009 From: biomates at telefonica.net (Mario Rodriguez) Date: Sun, 04 Jan 2009 00:04:59 +0100 Subject: [Maxima] Problems with sftp In-Reply-To: <200901032011.10482.al@beshenov.ru> References: <1230980575.8763.8.camel@pc> <200901032011.10482.al@beshenov.ru> Message-ID: <1231023899.8382.5.camel@pc> > Use riotorto,maxima at web.sourceforge.net. > Thanks, that worked. I've uploaded to the host the html documentation of version 5.17, both Spanish and English, and the pdf in Spanish. I'm having problems with the English pdf. From toy.raymond at gmail.com Sat Jan 3 20:48:24 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 03 Jan 2009 21:48:24 -0500 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: References: <495E475B.3010906@gmail.com> <495E9B41.4030408@gmail.com> Message-ID: <49602378.2080206@gmail.com> Robert Dodier wrote: > On 1/2/09, Raymond Toy wrote: > > >> Actually, I was hoping it might be suitable for putting in src. >> > > I'd rather put it in src also. I think it should be available to core functions. > I'll do that soon. > >> With NUMERIC (I open for a different package name), >> > > NUMERIC suggests stuff like Newton's method, quadrature, etc.... > Maybe ARITHMETIC instead? I guess it's not much of an improvement. > > ARITHMETIC is ok, but we do more than just arithmetic. I could just call it the BIGFLOAT package, which is kind of what it is, except that float.lisp is the core implementation. I think I'll just checkin what I have and we can change the package name later. Ray From David.Billinghurst at riotinto.com Sat Jan 3 21:46:06 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Sun, 4 Jan 2009 14:46:06 +1100 Subject: [Maxima] Further improvements to integral property code Message-ID: <026DCC31AB859648A6F16C0E5CD2580D01789989@calttsv025.cal.riotinto.org> > From: David Billinghurst > > I have spent some time tidying up the integral property code > that Dieter and I have been working on recently. It now > works for functions with an arbitrary number of arguements. > > I then extended it to work for: > - cases where the integral property is a function, and > - subscripted functions. > > As a further test I had a go at the 0F1 hypergeometric > function with the following code (which is not in CVS). ... and here is naive code for a pFq hypergeometric function. I don't know enough about these functions to know if we should do if any of the terms in the denominator are zero. (defprop $%f ((p q p-list q-list z) nil nil nil nil (lambda (p q p-list q-list unused) (cond ((and ($integerp p) ($integerp q) (= ($length p-list) p) (= ($length q-list) q)) (let* ((p-list-1 `((mlist) ,@(map 'list (lambda (x) (sub x 1)) (cdr p-list)))) (q-list-1 `((mlist) ,@(map 'list (lambda (x) (sub x 1)) (cdr q-list))))) `((mtimes) ,(div `((mtimes) ,@(cdr q-list-1)) `((mtimes) ,@(cdr p-list-1))) ((mqapply) (($%f array) ,p ,q) ,p-list-1 ,q-list-1 z)))) (t nil)))) integral) With this: (%i31) integrate(%f[2,2]([a1,a2],[b1,b2],x),x); %f ([a1 - 1, a2 - 1], [b1 - 1, b2 - 1], x) (b1 - 1) (b2 - 1) 2, 2 (%o31) --------------------------------------------------------------- (a1 - 1) (a2 - 1) (%i33) integrate(x*%f[2,2]([a1,a2],[b1,b2],x^2),x); 2 %f ([a1 - 1, a2 - 1], [b1 - 1, b2 - 1], x ) (b1 - 1) (b2 - 1) 2, 2 (%o33) ---------------------------------------------------------------- 2 (a1 - 1) (a2 - 1) This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. From talon at lpthe.jussieu.fr Sun Jan 4 05:06:33 2009 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sun, 04 Jan 2009 12:06:33 +0100 Subject: [Maxima] Further improvements to integral property code References: <026DCC31AB859648A6F16C0E5CD2580D01789989@calttsv025.cal.riotinto.org> Message-ID: Billinghurst, David (RTATECH) wrote: >> From: David Billinghurst > > > ... and here is naive code for a pFq hypergeometric function. > I don't know enough about these functions to know if we should > do if any of the terms in the denominator are zero. > By the way i encountered recently the following maxima program written by a collegue of mine, which uses Meijer G functions toperform integrals which reduce to pFq hypergeometric functions. It seems that this technique is used systematically in Maple and Mathematica. The program is contained in the following post to the maxima mailing list: http://www.math.utexas.edu/pipermail/maxima/2007/005710.html -- Michel Talon From drdieterkaiser at web.de Sun Jan 4 05:57:58 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 4 Jan 2009 12:57:58 +0100 Subject: [Maxima] Further improvements to integral property code In-Reply-To: <026DCC31AB859648A6F16C0E5CD2580D01789989@calttsv025.cal.riotinto.org> References: <026DCC31AB859648A6F16C0E5CD2580D01789989@calttsv025.cal.riotinto.org> Message-ID: <390C8137C3DB4E6DA2B787DC17360709@Kaiser> Hello David, nice to see that the generalizations of the code for integrals on the property list works so nice. Concerning the Hypergeometric functions I would suggest to introduce a simplifying functions which can use hgfred to simplify and have the following notation: hypergeometric([a1,a2,...],[b1,b2,....],z) This general function could be specialized for the most important cases like: hypergeometric_2f1(a1,a2,b,z) We can support the hypergeomtric representation on the property list too. This representation could be looked up by the integrator and then integrated. One big problem is that hgfred produces a lot of asksign. I think the code of hgfred can be improved. The technique to lookup the hypergeometric representation would be very interesting for the Laplace transformations in $specint too. The code of $specint can be much simplified using a lookup algorithm. By the way I think it would be nice a feature for the Maxima User to get the hypergeometric representation of a function. Dieter Kaiser -----Urspr?ngliche Nachricht----- Von: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] Im Auftrag von Billinghurst, David (RTATECH) Gesendet: Sonntag, 4. Januar 2009 04:46 An: maxima at math.utexas.edu Betreff: Re: [Maxima] Further improvements to integral property code > From: David Billinghurst > > I have spent some time tidying up the integral property code > that Dieter and I have been working on recently. It now > works for functions with an arbitrary number of arguements. > > I then extended it to work for: > - cases where the integral property is a function, and > - subscripted functions. > > As a further test I had a go at the 0F1 hypergeometric > function with the following code (which is not in CVS). ... and here is naive code for a pFq hypergeometric function. I don't know enough about these functions to know if we should do if any of the terms in the denominator are zero. (defprop $%f ((p q p-list q-list z) nil nil nil nil (lambda (p q p-list q-list unused) (cond ((and ($integerp p) ($integerp q) (= ($length p-list) p) (= ($length q-list) q)) (let* ((p-list-1 `((mlist) ,@(map 'list (lambda (x) (sub x 1)) (cdr p-list)))) (q-list-1 `((mlist) ,@(map 'list (lambda (x) (sub x 1)) (cdr q-list))))) `((mtimes) ,(div `((mtimes) ,@(cdr q-list-1)) `((mtimes) ,@(cdr p-list-1))) ((mqapply) (($%f array) ,p ,q) ,p-list-1 ,q-list-1 z)))) (t nil)))) integral) With this: (%i31) integrate(%f[2,2]([a1,a2],[b1,b2],x),x); %f ([a1 - 1, a2 - 1], [b1 - 1, b2 - 1], x) (b1 - 1) (b2 - 1) 2, 2 (%o31) --------------------------------------------------------------- (a1 - 1) (a2 - 1) (%i33) integrate(x*%f[2,2]([a1,a2],[b1,b2],x^2),x); 2 %f ([a1 - 1, a2 - 1], [b1 - 1, b2 - 1], x ) (b1 - 1) (b2 - 1) 2, 2 (%o33) ---------------------------------------------------------------- 2 (a1 - 1) (a2 - 1) This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Sun Jan 4 11:19:59 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 4 Jan 2009 10:19:59 -0700 Subject: [Maxima] Further improvements to integral property code In-Reply-To: References: <026DCC31AB859648A6F16C0E5CD2580D01789989@calttsv025.cal.riotinto.org> Message-ID: On 1/4/09, Michel Talon wrote: > By the way i encountered recently the following maxima program written > by a collegue of mine, which uses Meijer G functions to perform integrals > which reduce to pFq hypergeometric functions. It seems that this technique > is used systematically in Maple and Mathematica. The program is contained in > the following post to the maxima mailing list: > http://www.math.utexas.edu/pipermail/maxima/2007/005710.html That program meijer_gv2.mac is in share/contrib, as is meijer_g.tex. Both files should be present in Maxima releases. Hope this helps, Robert Dodier From oldenbur at math.uni-frankfurt.de Sun Jan 4 11:49:28 2009 From: oldenbur at math.uni-frankfurt.de (Reinhard Oldenburg) Date: Sun, 04 Jan 2009 18:49:28 +0100 Subject: [Maxima] Lattice reduction code and number recognition question Message-ID: <4960F6A8.1020000@math.uni-frankfurt.de> Dear Maxima list, I've written a little bit of lisp code with Maxima interface that does the following: The Lisp function lll and its maxima counterpart latticereduce calculate a reduced basis of an lattice by a straightforward (i.e. robust but slow) implemementation of the Lenstra-Lenstra-Lovasz algorithm. In maxima the usage is e.g. latticereduce([[2,16],[1,9]]); The name of the top level function is inspired by Mathematica where LatticeReduce does exactly the same thing (faster). I hope that Wolfram does not have the right to use this name execlusively. I tested the code with Lispworks and with gcl from Maxima's binary distribution. Is there interest to include it in the share library? My motivation to implement the lll algorithm came from the possibilty to detect releations between integers. This does the following maxima function: integerrelations([23,3,5]); produces [1,-1,-4] which says that 23*1+3*(-1)+5*(-4) is zero (or small in the sense of a short vector in the lattice). floatrelations does the same for floats. Finally, things shoud fit together to produce something like Maple identify function, i.e. a function that produces a (hopefully) good guess what a floating point numer may be. An example where this works is: (%i11) recognize(6.2426406871190006); (%o11) 3 sqrt(2) + 2 The underlying lisp function convert2AlgNum tries to find the coefficient of a candidate minimal polynomial. However, results are very poor. Does anybody understand why this is the case? Here is the code (20 yeras ago I used Scheme a lot, but I'm new to Common lisp, so I expect there is mucg room for improvement). Reinhard ---- ; file lll.lisp ; Maxima Interface (defun maxima::$latticereduce (L) ; L is maxima list of maxima lists (if (or (not (listp L)) (< (length L) 2) (not (equal (apply 'max (mapcar 'length (cdr L))) (apply 'min (mapcar 'length (cdr L))) )) ) (maxima::merror "Latticereduce needs a list lists as input")) (let* ((vs (mapcar 'cdr (cdr L))) (n (length vs)) (v (make-array (list n)))) (loop for i from 0 to (- n 1) do (setf (aref v i) (make-array (list n) :initial-contents (nth i vs)))) (setf v (lll v)) (cons '(maxima::mlist) (mapcar #'(lambda (u) (cons '(maxima::mlist) (coerce u 'list))) (coerce v 'list))) )) (defun maxima::$integerrelations (L) (let ((res (integerrelations (cdr L)))) (cons '(maxima::mlist) (car res)) )) (defun maxima::$floatrelations (L) (let ((res (floatrelations (cdr L)))) (cons '(maxima::mlist) (car res)) )) (defun maxima::$recognize (x) (convert2AlgNum x)) ; linear algebra helpers (defun norm2 (a) (declare (type (vector number *) a)) (loop for i from 0 to (- (length a) 1) sum (* (aref a i) (aref a i) ))) (defun vadd (a b) (declare (type (vector number *) a)) (declare (type (vector number *) b)) (if (not (= (length a) (length b))) (error "vadd: length must coincide") (let ((res (make-array (list (length a)) )) (n (length a))) (loop for i from 0 to (- n 1) do (setf (aref res i) (+ (aref a i) (aref b i)))) res))) (defun vsub (a b) (declare (type (vector number *) a)) (declare (type (vector number *) b)) (if (not (= (length a) (length b))) (error "vadd: length must coincide") (let ((res (make-array (list (length a)) )) (n (length a))) (loop for i from 0 to (- n 1) do (setf (aref res i) (- (aref a i) (aref b i)))) res))) (defun smul (s a) (declare (type (vector number *) a)) (declare (type (vector number *) b)) (let ((res (make-array (list (length a)) )) (n (length a))) (loop for i from 0 to (- n 1) do (setf (aref res i) (* s (aref a i)))) res)) (defun dot (a b) (declare (type (vector number *) a)) (declare (type (vector number *) b)) (if (not (= (length a) (length b))) (error "vadd: length must coincide") (loop for i from 0 to (- (length a) 1) sum (* (aref a i) (aref b i))))) (defvar *gsbasis* nil) (defun gso (f mu) ; returns Gram-Schmidt OGS, updates mu (declare (type vector a)) (declare (type (array number (* *) mu))) (let* ((n (length f)) (g (make-array (list n) ))) (loop for j from 0 to (- n 1) do (setf (aref g j) (aref f j))) (loop for j from 0 to (- n 1) do (loop for k from 0 to (- j 1) do (if (> (norm2 (aref g k)) 0) (progn (setf (aref mu j k) (/ (dot (aref f j) (aref g k)) (dot (aref g k) (aref g k)))) (setf (aref g j) (vsub (aref g j) (smul (aref mu j k) (aref g k)))) )) )) g )) (defun lll (f) ; f is vetor of n vectors (declare (type (vector vector *) f)) (let* ((n (length f)) (g (make-array (list n) )) (gg nil) (i 1) (temp nil) (mu (make-array (list n n) :initial-element 0))) (loop for j from 0 to (- n 1) do (setf (aref g j) (aref f j)) (setf (aref mu j j) 1)) (setf gg (gso g mu)) (do () ((>= i n) ) (loop for j from (- i 1) downto 0 do (setf (aref g i) (vsub (aref g i) (smul (nint (aref mu i j)) (aref g j)))) (setf gg (gso g mu)) ) (if (and (> i 0) (> (norm2 (aref gg (- i 1))) (* 2 (norm2 (aref gg i))))) (progn (setf temp (aref g (- i 1))) (setf (aref g (- i 1)) (aref g i)) (setf (aref g i) temp) (setf gg (gso g mu)) (setf i (- i 1)) ) (setf i (+ i 1))) ) g ) ) (defun nint (q) (car (list (floor (+ q (/ 1 2)))))) (defun test1 () (lll #( #(12 2) #(13 4)))) (defun test2 () (lll #( #(12 2) #(1 2)))) (defun test3 () (lll #( #(1 2) #(12 2) ))) (defun test4 () (lll #( #(1 2) #(9 -4)))) (defun integerRelations (L) ; L ist list of integers ; returns (rel def) such that dotproduct def of rel and L is small (let* ((n (length L)) (z nil) (g nil) (res nil) (optdef 0) (optres nil) (def 0) (f (make-array (list (+ n 1))))) (setf (aref f 0) (make-array (list (+ n 1)) :initial-element 0)) (loop for i from 1 to n do (setf z (make-array (list (+ n 1)) :initial-element 0)) (setf (aref z 0) (nth (- i 1) L)) (setf (aref z i) 1) (setf (aref f i) z)) (setf g (lll f)) (setf optdef most-POSITIVE-fixnum) (loop for k from 1 to n do (setf def 0) (setf res nil) (loop for i from n downto 1 do (setf res (cons (aref (aref g k) i) res)) (setf def (+ def (* (nth (- i 1) L) (aref (aref g k) i)))) ) (if (< (abs def) (abs optdef)) (progn (setf optdef def) (setf optres res) )) ) (list optres optdef) )) (defun test5 () (print "Should give ((3 -7 4) 0)") (integerRelations '(5707963267 4142135623 2967764890))) (defun nkomma (a) (- a (car (list (floor a))))) (defun FloatRelations (x &optional (digits 10)) ; x is a list of floats or doubles (let ((n (length x)) (digs nil) (i 0) (nkomma 0) (nkommaStellen0) (xx 0) (expo nil) (rel nil) (def 0)) (setf nkommaStellen (lambda (x) ; x ist float (let ((s 0) (i 0)) (do () ((< (abs (nkomma (* x (expt 10d0 s)))) (expt 1d-1 digits))) (setf s (+ s 1))) s))) (setf digs (mapcar nkommaStellen x)) (setf expo (apply 'max digs)) (setf xx (mapcar #'(lambda (u) (car (list (floor (* u (expt 10d0 expo)))))) x)) (setf rel (IntegerRelations xx)) (list (car rel) (/ (cadr rel) (expt 10.0d0 expo))) )) (defun test6 () (FloatRelations (list .5707963267d0 .4142135623d0 .2967764890d0))) (defun mkdif (a b) (list '(MAXIMA::MPLUS) a (list '(MAXIMA::MMINUS) b)) ) (defun mksum (a b) (list '(MAXIMA::MPLUS) a b) ) (defun mkprod (a b) (list '(MAXIMA::MTIMES) a b) ) (defun mkexpt (a b) (list '(MAXIMA::MEXPT) a b)) (defun mkeq (a b) (list '(MAXIMA::MEQUAL) a b)) (defun max2str (expr) (maxima::mfuncall 'maxima::$string expr) ) (defun convert2AlgNum (x &optional (digits 10)) ; x is float or double (let ((n 0) (nn 6) ;; nn: maximal search degree (xs nil) (res nil) (def 0) (sol nil) (opt nil) (mini 0) (var (gentemp "$v"))) (loop for n from 2 to nn do (if (not (null opt)) (return opt)) (setf xs (loop for i from 0 to n collect (expt x i))) (setf res (FloatRelations xs digits)) (setf def (cadr res)) (if (< (abs def) (expt 10d0 (- digits))) (progn (setf pol 0) (loop for i from 0 to n do (setf pol (mksum pol (mkprod (nth i (car res)) (mkexpt var i))))) (setf sol (maxima::meval (maxima::$solve (mkeq pol 0) var))) (if (not (null (cdr sol))) ; a solution has been found (progn (setq *sol* sol) (setf sol (mapcar 'third (cdr sol))) (setf sol (mapcar #'(lambda (u) (let ((r (maxima::$realpart u)) (i (maxima::$float (maxima::$imagpart u)))) (if (or (equal i 0) (equal i 0.0) (equal i 0.0d0)) (list u (abs (- x (maxima::$float u)))) (list u most-POSITIVE-DOUBLE-FLOAT) ))) sol)) (setf mini most-POSITIVE-DOUBLE-FLOAT) (loop for p in sol do (if (< (second p) mini) (setf opt (car p)))) )))) ); loop opt ) ; let ) ;defun (defun test7 () ; fails (convert2AlgNum 1.414213562373d0)) (defun test8 () ; works (convert2AlgNum (+ 2 (* 3 1.414213562373d0)))) (defun test9 () :fails (convert2AlgNum (+ 1d0 (sqrt 2d0) (sqrt 3d0)) )) From rvh2007 at comcast.net Sun Jan 4 12:00:39 2009 From: rvh2007 at comcast.net (Richard Hennessy) Date: Sun, 4 Jan 2009 13:00:39 -0500 Subject: [Maxima] pw 2.5 is ready Message-ID: Hi List, I don't know of any bugs with this version. I may add more stuff later. I also will try different ways to obtain more speed. You need abs_integrate.mac to make this work. Here is a link to it. http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/share/contrib/integration/ Rich -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: pw 2.5.txt Url: http://www.math.utexas.edu/pipermail/maxima/attachments/20090104/182bc9b5/attachment.txt From rvh2007 at comcast.net Sun Jan 4 12:03:02 2009 From: rvh2007 at comcast.net (Richard Hennessy) Date: Sun, 4 Jan 2009 13:03:02 -0500 Subject: [Maxima] pw 2.5 is ready References: Message-ID: <45C9C048F8794672B9A81CA22C96AA86@RichDesktop> pw.txt is attached. I forgot to mention that. You can get it here too. http://home.comcast.net/~rvh2007/site/?/page/Maxima_Page/ ----- Original Message ----- From: "Richard Hennessy" To: "Maxima List" Sent: Sunday, January 04, 2009 1:00 PM Subject: [Maxima] pw 2.5 is ready Hi List, I don't know of any bugs with this version. I may add more stuff later. I also will try different ways to obtain more speed. You need abs_integrate.mac to make this work. Here is a link to it. http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/share/contrib/integration/ Rich -------------------------------------------------------------------------------- _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Sun Jan 4 12:17:03 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 4 Jan 2009 11:17:03 -0700 Subject: [Maxima] [ maxima-Bugs-813659 ] xgraph broken (Windows) Message-ID: Hello, There is some code in src/plot.lisp to support the xgraph program. I am going to cut it out if there is not too much opposition. Please see my most recent comments in the bug report: http://sourceforge.net/support/tracker.php?aid=813659 All the best Robert Dodier From drdieterkaiser at web.de Sun Jan 4 14:48:00 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 4 Jan 2009 21:48:00 +0100 Subject: [Maxima] Integral lookup and CLISP Message-ID: <00F49236477940C198F865EBF164FAC1@Kaiser> CLISP has a problem with the routine to lookup the integrals for the Bessel functions. The following code is the reason: ;; If form is a function then evaluate it with actual args (or (not (functionp form)) (setq form (apply form real-args)))) In CLISP the expression (functionp (lambda (x y) ... )) gives always NIL and not T as is expected. The evaluation is not done and later in the code we get an Lisp Error with the unevaluated lambda expression. For GCL the test with functionp works. Dieter Kaiser From robert.dodier at gmail.com Sun Jan 4 14:50:02 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 4 Jan 2009 12:50:02 -0800 (PST) Subject: [Maxima] Maxima, ECL, asksign; was: Re: reduce In-Reply-To: <36806d0d-6904-482d-8f52-c3ee2106b79e@i18g2000prf.googlegroups.com> References: <85e81ba30901022322q6969914ehb66010b81df1b5ca@mail.gmail.com> <8cf963450901030420y59e79640x718f500c2b173b16@mail.gmail.com> <618147F9-A6CF-4F2C-B2C0-4252D95C410B@gmail.com> <25bcebdd-12cb-4d86-98a3-cbcf8446682f@t39g2000prh.googlegroups.com> <366474f7-c5c6-414e-a5db-8b738b3ac087@k1g2000prb.googlegroups.com> <36806d0d-6904-482d-8f52-c3ee2106b79e@i18g2000prf.googlegroups.com> Message-ID: <65826b70-7643-4a89-8b92-b4fbd33a3cb6@q26g2000prq.googlegroups.com> mabshoff wrote: > On Jan 3, 11:27?am, Robert Dodier wrote: > > Hmm, what is "this possibility" ? I don't understand. > I meant embedding Maxima into a library extensions via ecl. You stated > to the best of my recollection that this would be troublesome due to > asksign since there would be the need on occasion by the user to > interact with the integration/limit calculation - unless I > misunderstood you :) OK, I don't remember what I might have said, probably not too important. Instead let me spell out my current thoughts about the situation. Maxima + ECL seems to work OK at this point so I guess you could indeed link in Maxima via CFFI or some other C interface. (Although there are two layers of glue here, right? Lisp -> C and C -> Python; seems like it could be messy.) asksign would presumably still interfere, but it wouldn't be any more of problem than it is now. About disabling asksign, I made an attempt to do that in a non- intrusive way, by having asksign throw an exception back to a high-level handler which could construct a conditional expression. (The code is in share/contrib/noninteractive/.) That sort of works, except that it clogs up the assume system (which eventually stops working). Also, the scheme inherits assume's weakness. So at this point I think it would be necessary to revise every call to asksign to construct a conditional expression when asksign is disabled. That would be tedious --- there are something like 100 calls to asksign or similar functions throughout the core code --- but it seems straightforward. I might try to work on that in 2009. FWIW Robert Dodier From al at beshenov.ru Sun Jan 4 15:01:59 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Mon, 5 Jan 2009 00:01:59 +0300 Subject: [Maxima] Integral lookup and CLISP In-Reply-To: <00F49236477940C198F865EBF164FAC1@Kaiser> References: <00F49236477940C198F865EBF164FAC1@Kaiser> Message-ID: <200901050002.00212.al@beshenov.ru> On Sunday 04 January 2009 23:48:00 Dieter Kaiser wrote: > In CLISP the expression (functionp (lambda (x y) ... )) gives > always NIL and not T as is expected. The evaluation is not done and > later in the code we get an Lisp Error with the unevaluated lambda > expression. > > For GCL the test with functionp works. I tried CLISP 2.44.1 and everything is OK. (type-of (lambda (x) x)) => 'function (functionp (lambda (x) x)) => t -- Prickle Prickle, Chaos 4 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From robert.dodier at gmail.com Sun Jan 4 15:15:16 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 4 Jan 2009 14:15:16 -0700 Subject: [Maxima] Integral lookup and CLISP In-Reply-To: <00F49236477940C198F865EBF164FAC1@Kaiser> References: <00F49236477940C198F865EBF164FAC1@Kaiser> Message-ID: On 1/4/09, Dieter Kaiser wrote: > In CLISP the expression (functionp (lambda (x y) ... )) gives always NIL and not > T as is expected. Hmm, Clisp 2.46 on Linux, in the following program, (H) yields T (interpreted or compiled). Robert PS. (defvar g (lambda (x) (1+ x))) (defun f (x) (functionp x)) (defun h () (f g)) From drdieterkaiser at web.de Sun Jan 4 15:27:55 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 4 Jan 2009 22:27:55 +0100 Subject: [Maxima] Integral lookup and CLISP In-Reply-To: <200901050002.00212.al@beshenov.ru> References: <00F49236477940C198F865EBF164FAC1@Kaiser> <200901050002.00212.al@beshenov.ru> Message-ID: Ok, than there is a difference to my CLISP 2.44 on Windows: lisp-implementation-type: CLISP lisp-implementation-version: 2.44 (2008-02-02) (built 3411200795) (memory 3440089629) Here is a session using writefile() with some debugging code: ;; Dribble of # started on NIL. (%o3) # (%i4) integrate(bessel_j(0,x),x); /* The lookuped expression and the values for the args */ form = ((N Z) NIL (LAMBDA (N UNUSED) (CASE N (0 '((MTIMES) ((RAT) 1 2) Z ((MPLUS) ((MTIMES) $%PI ((%BESSEL_J) 1 Z) ((MQAPPLY) (($HSTRUVE ARRAY) 0) Z)) ((MTIMES) ((%BESSEL_J) 0 Z) ((MPLUS) 2 ((MTIMES) -1 $%PI ((MQAPPLY) (($HSTRUVE ARRAY) 1) Z))))))) (1 '((MTIMES) -1 ((%BESSEL_J) 0 Z))) (OTHERWISE NIL)))) dummy-args = (N Z) real-args = (0 $X) /* This is the unevaluated form after passing the code which tests for a function */ form = (LAMBDA (N UNUSED) (CASE N (0 '((MTIMES) ((RAT) 1 2) Z ((MPLUS) ((MTIMES) $%PI ((%BESSEL_J) 1 Z) ((MQAPPLY) (($HSTRUVE ARRAY) 0) Z)) ((MTIMES) ((%BESSEL_J) 0 Z) ((MPLUS) 2 ((MTIMES) -1 $%PI ((MQAPPLY) (($HSTRUVE ARRAY) 1) Z))))))) (1 '((MTIMES) -1 ((%BESSEL_J) 0 Z))) (OTHERWISE NIL))) INTEGRALLOOKUPS: Found integral %BESSEL_J Maxima encountered a Lisp error: CAR: LAMBDA ist keine Liste. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. Because of this effect all Bessel integration tests fail on my system. Dieter Kaiser -----Urspr?ngliche Nachricht----- Von: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] Im Auftrag von Alexey Beshenov Gesendet: Sonntag, 4. Januar 2009 22:02 An: maxima at math.utexas.edu Betreff: Re: [Maxima] Integral lookup and CLISP On Sunday 04 January 2009 23:48:00 Dieter Kaiser wrote: > In CLISP the expression (functionp (lambda (x y) ... )) gives > always NIL and not T as is expected. The evaluation is not done and > later in the code we get an Lisp Error with the unevaluated lambda > expression. > > For GCL the test with functionp works. I tried CLISP 2.44.1 and everything is OK. (type-of (lambda (x) x)) => 'function (functionp (lambda (x) x)) => t -- Prickle Prickle, Chaos 4 YOLD 3175 Alexey Beshenov http://beshenov.ru/ _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From macrakis at alum.mit.edu Sun Jan 4 15:36:38 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 4 Jan 2009 16:36:38 -0500 Subject: [Maxima] Maxima on Blackberry or iPhone? Message-ID: <8b356f880901041336t5920edbdoeda55419c2cb3150@mail.gmail.com> Do any of our underlying Lisps run on Blackberry or iPhone or will they soon? Is anyone working on porting Maxima to Blackberry or iPhone (ideally with graphing...)? ...though I suppose most users of iPhone or iPod Touch wouldn't be happy with a command line interface.... -s From talon at lpthe.jussieu.fr Sun Jan 4 16:02:11 2009 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sun, 04 Jan 2009 23:02:11 +0100 Subject: [Maxima] Further improvements to integral property code References: <026DCC31AB859648A6F16C0E5CD2580D01789989@calttsv025.cal.riotinto.org> Message-ID: Robert Dodier wrote: > On 1/4/09, Michel Talon wrote: > >> By the way i encountered recently the following maxima program written >> by a collegue of mine, which uses Meijer G functions to perform >> integrals which reduce to pFq hypergeometric functions. It seems that >> this technique is used systematically in Maple and Mathematica. The >> program is contained in the following post to the maxima mailing list: >> http://www.math.utexas.edu/pipermail/maxima/2007/005710.html > > That program meijer_gv2.mac is in share/contrib, as is meijer_g.tex. > Both files should be present in Maxima releases. > > Hope this helps, > > Robert Dodier Oh! sorry. I had searched something Meijer related in Maxima without finding it, but it is clearly here. Thanks a lot. -- Michel Talon From Jussi.Eloranta at csun.edu Sun Jan 4 16:25:50 2009 From: Jussi.Eloranta at csun.edu (Jussi Eloranta) Date: Sun, 04 Jan 2009 14:25:50 -0800 Subject: [Maxima] lsquares Message-ID: <4961376E.9080707@csun.edu> Hi, I just found the lsquares package in maxima. I have couple of questions: 1) Is it possible to simultaneously fit multiple data sets with each having its own fitting function in such a way that they share parameters? For example, I run into this sort of problem often in chemical kinetics where multiple components are followed experimentally and each have their own kinetic equation. The rate constants are shared between the two equations when fitting the data. 2) Are there routines to calculate r^2, covariance matrix, standard error estimates ? Of course, for non-linear least squares things are a bit tricky but many things can be done at least approximately. I have been using the following maxima program for (non-linear) least squares. I would like to get rid of this and use the built-in routines in maxima. Thanks, Jussi Eloranta Department of chemistry and biochemistry Cal State Northridge --- /* * Unconstrained nonlinear least squares fit. * * nlsq(funcs, ydata, xdata, yvars, xvars, params, initvars, errtol, debug) * * funcs = list of functions for fitting [fun1, fun2, ...]. * ydata = list of y-data vectors [yvec1, yvec2, ...]. * xdata = list of x-data vectors [xvec1, xvec2, ...]. * yvars = list of y variables for the functions given in funcs [y1, y2, ...]. * xvars = list of x variables for the functions given in funcs [x1, x2, ...]. * params = list of parameters to be fitted [a, b, ...]. * initvars = list of initial values for params [ai, bi, ...]. * errtol = requested error tolerance in BFGS (1E-4). * debug = optimization output vector for BFGS ([1, 2] = full output, [-1 0] = no output). * * Returns: [F, R2, V, C, E]. * * F = list of optimized functions. * R2 = list of r^2 values for each function. * V = list of optimized parameter values. * C = covariance matrix for the parameters. * E = list of standard errors for parameters. * */ load("lbfgs"); nlsq([ArgList]):= block([narg, funcs, ydata, xdata, yvars, xvars, params, initvars, errtol, debug, neqs, i, sq, tmp, lbfgs_nfeval_max:1000, /* BFGS tends to converge somewhat slowly... */ fun, fit, F, ss, sstot, sm, st, R2, C, lp, E, sigma2, Vm, k, np], narg:length(ArgList), if narg # 9 then ( print("nlsq: bad number of function arguments (requires 9 arguments)."), return(false) ), funcs:ArgList[1], ydata:ArgList[2], xdata:ArgList[3], yvars:ArgList[4], xvars:ArgList[5], params:ArgList[6], initvars:ArgList[7], errtol:ArgList[8], debug:ArgList[9], neqs:length(funcs), lp:length(params), if neqs # length(ydata) or neqs # length(xdata) or neqs # length(yvars) or neqs # length(xvars) then ( print("nlsq: Inconsistent lengths for arguments 1 - 5."), return(false) ), /* Construct the least squares sum and call lbfgs to optimize */ tmp:0, for i:1 thru neqs do ( if length(xdata[i]) # length(ydata[i]) then ( print("nlsq: Inconsistent lengths for X and Y in set ", i), return(false) ), sq:(lhs(funcs[i]) - rhs(funcs[i]))^2, sq:subst('xdata[i][j], xvars[i], sq), sq:subst('ydata[i][j], yvars[i], sq), tmp:tmp + 'sum(sq, j, 1, length(xdata[i])) ), /* fun:ev(tmp,nouns),*/ fun:tmp, fit:lbfgs(fun, params, initvars, errtol, debug), if fit = [] then ( print("nlsq: BFGS convergence error. Fit failed."), return(false) ), /* Substitute the optimized values back into the equations */ F:makelist(0,i,1,neqs), for i:1 thru neqs do ( F[i]:float(rhs(funcs[i])), for j:1 thru lp do F[i]:subst(rhs(fit[j]), params[j], F[i]) ), /* Calculate r^2 for each data set */ sstot:0, R2:makelist(0,i,1,neqs), for i:1 thru neqs do ( ss:sum((subst(xdata[i][j], xvars[i], F[i]) - ydata[i][j])^2, j, 1, length(xdata[i])), sstot:sstot + ss, sm:sum(ydata[i][j], j, 1, length(xdata[i])) / length(xdata[i]), st:sum((subst(xdata[i][j], xvars[i], F[i]) - sm)^2, j, 1, length(xdata[i])), R2[i]:float(ev(1 - ss / st,nouns)) ), /* Calculate the covariance matrix */ C:ematrix(lp, lp, 0, 1, 1), for i:1 thru lp do for j:1 thru lp do ( C[i,j]:diff(fun,params[i],1,params[j],1), for k:1 thru lp do C[i,j]:subst(rhs(fit[k]),params[k],C[i,j]) ), C:float(ev(C,nouns)), /* watch out when lp = 1, invert returns a number not a matrix */ if lp = 1 then ( C[1,1]:1/C[1,1] ) else ( C:invert(C) ), /* Calculate standard errors */ np:sum(length(xdata[i]), i, 1, neqs), sigma2:sstot / (np - lp), E:makelist(0,i,1,lp), V:makelist(0,i,1,lp), for i:1 thru lp do ( E[i]:float(sqrt(sigma2 * C[i,i])), V[i]:float(rhs(fit[i])) ), return([F, R2, V, C, E]) ); From kovzol at matek.hu Sun Jan 4 16:30:58 2009 From: kovzol at matek.hu (=?UTF-8?Q?Kov=C3=A1cs_Zolt=C3=A1n?=) Date: Sun, 4 Jan 2009 23:30:58 +0100 Subject: [Maxima] formconv-0.9.0 has been released Message-ID: Dear Colleagues, a pleasure for me to announce the newest release of formconv, the free general purpose command line formula converter (and evaluator) tool. After 4 years of development and testing we proudly release version 0.9.0 which can parse intuitive, LISP and MathML formats and outputs various CAS (including Mathematica, Maxima, MuPAD and Maple) formats, gnuplot, C/Java syntax, HTML, MathML, LaTeX and LISP. The tarball and 2 Ubuntu packages (Dapper, Feisty) are uploaded to sf.net ( http://sf.net/projects/formconv). I also successfully installed formconv on my laptop which runs Ubuntu Hardy (8.04). I needed to install sun-java5-jdk (and then compile antlr from source, it was a clean install after setting CLASSPATH), libtclap-dev and libboost-dev. (CFLAGS had to be reset.) I am going to create and upload a .deb package to sf.net as well as soon as I can. If you know someone who may be also interested in using formconv, you are welcome forwarding my email to other colleagues. Best regards, Zoltan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090104/a629f8cf/attachment.htm From David.Billinghurst at riotinto.com Sun Jan 4 17:19:12 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Mon, 5 Jan 2009 10:19:12 +1100 Subject: [Maxima] Integral lookup and CLISP References: <00F49236477940C198F865EBF164FAC1@Kaiser> Message-ID: <026DCC31AB859648A6F16C0E5CD2580D017899C5@calttsv025.cal.riotinto.org> > From: Dieter Kaiser > > CLISP has a problem with the routine to lookup the integrals > for the Bessel functions. The following code is the reason: > > ;; If form is a function then evaluate it with actual args > (or (not (functionp form)) > (setq form (apply form real-args)))) > > In CLISP the expression (functionp (lambda (x y) ... )) gives > always NIL and not T as is expected. The evaluation is not > done and later in the code we get an Lisp Error with the > unevaluated lambda expression. > > For GCL the test with functionp works. > > Dieter Kaiser I can reproduce this with CLISP 2.46 on cygwin, and I think that CLISP is correct. The common lisp hyperspec for FUNCTIONP gives as examples: (functionp '(lambda (x) (* x x))) => false (functionp #'(lambda (x) (* x x))) => true CLISP conforms, but gcl gives true in both cases. I need to read up on this some more. Suggestions/patches welcome. This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. From robert.dodier at gmail.com Sun Jan 4 20:04:31 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 4 Jan 2009 19:04:31 -0700 Subject: [Maxima] Integral lookup and CLISP In-Reply-To: <026DCC31AB859648A6F16C0E5CD2580D017899C5@calttsv025.cal.riotinto.org> References: <00F49236477940C198F865EBF164FAC1@Kaiser> <026DCC31AB859648A6F16C0E5CD2580D017899C5@calttsv025.cal.riotinto.org> Message-ID: On 1/4/09, Billinghurst, David (RTATECH) wrote: > I can reproduce this with CLISP 2.46 on cygwin, and I think that > CLISP is correct. > > The common lisp hyperspec for FUNCTIONP gives as examples: > (functionp '(lambda (x) (* x x))) => false > (functionp #'(lambda (x) (* x x))) => true > CLISP conforms, but gcl gives true in both cases. Yes, but (functionp (lambda (x) (* x x))) is something else again. Isn't the result of (lambda (x) ...) the same as #'(lambda (x) ...) ? What does Clisp on cygwin return for just (functionp (lambda (x) (* x x))) ? For these inputs: (functionp '(lambda (x) (* x x))) (functionp #'(lambda (x) (* x x))) (functionp (lambda (x) (* x x))) on my Linux desktop box, I get NIL, T, T from Clisp, CMUCL, SBCL, ECL, and Allegro, while GCL returns T, T, T. For the record, Robert Dodier From robert.dodier at gmail.com Sun Jan 4 20:46:26 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 4 Jan 2009 19:46:26 -0700 Subject: [Maxima] lsquares In-Reply-To: <4961376E.9080707@csun.edu> References: <4961376E.9080707@csun.edu> Message-ID: On 1/4/09, Jussi Eloranta wrote: > 1) Is it possible to simultaneously fit multiple data sets with each > having its own fitting function in such a way that they share parameters? Yes, if I understand correctly, you can construct a combined MSE and then minimize that, something like: mse1 : lsquares_mse (data1, [a, b, c, d], equation1); mse2 : lsquares_mse (data2, [a, b, c, d], equation2); lsquares_estimates_approximate (mse1 + mse2, [a, b, c, d], ...); Well, if data1 and data2 have different numbers of rows I guess you want something like n1/(n1 + n2)*mse1 + n2/(n1 + n2)*mse2 for the combined MSE. > 2) Are there routines to calculate r^2, covariance matrix, standard > error estimates ? r^2 you can obtain from lsquares_residual_mse. There aren't any built-in functions for the covariance matrix or standard error estimates. I 'll put those on my to-do list (should be straightforward). > debug, neqs, i, sq, tmp, lbfgs_nfeval_max:1000, /* BFGS tends > to converge somewhat slowly... */ Do you want to suggest another minimization algorithm? Thanks for your interest, Robert Dodier From smh at franz.com Sun Jan 4 21:02:47 2009 From: smh at franz.com (Steve Haflich) Date: Sun, 04 Jan 2009 19:02:47 -0800 Subject: [Maxima] Integral lookup and CLISP In-Reply-To: <026DCC31AB859648A6F16C0E5CD2580D017899C5@calttsv025.cal.riotinto.org> References: <00F49236477940C198F865EBF164FAC1@Kaiser> <026DCC31AB859648A6F16C0E5CD2580D017899C5@calttsv025.cal.riotinto.org> Message-ID: <8365.1231124567@gemini.franz.com> From: "Billinghurst, David \(RTATECH\)" I can reproduce this with CLISP 2.46 on cygwin, and I think that CLISP is correct. The common lisp hyperspec for FUNCTIONP gives as examples: (functionp '(lambda (x) (* x x))) => false (functionp #'(lambda (x) (* x x))) => true CLISP conforms, but gcl gives true in both cases. Here's an explanation. In order for CLOS to make sense, when it was being considered by X3J13, it was necessary that various important types be disjoint. This is so generic functions can discriminate on argument classes. There is an ancient Lisp tradition that a form can be consed up at well and passed to the interpreter. This is what EVAL does. But the language cleanup required by CLOS was to make the FUNCTION type disjoint from nearly everything else. [1] (type-of '(lambda (x) x)) ==> CONS [2] (type-of #'(lambda (x) x)) ==> FUNCTION [3] (type-of (function (lambda (x) x))) ==> FUNCTION [4] (type-of (lambda (x) x)) ==> FUNCTION [5] (function '(lambda (x) x)) ==> "undefined consequences" Functions are created by executing the FUNCTION special form, by COERCE, by COMPILE, and by form in LOAD. The above results are required from any conforming ANSI CL, except that the returned types might be some known subtype of FUNCTION, e.g. COMPILED-FUNCTION. Form [1] should be clear. Forms [2] and [3] are the same, since #' is simply reader macro abbreviation for FUNCTION. Form [4] is the one that might not be clear to everyone. The symbol LAMBDA has since John McCarthy was a young man been a flag that appears on the car of a cons to denote a "lambda expression". But almost the last language change made by X3J13 was to add a definition of LAMBDA as a macro that could have been defined this way: (defmacro lambda (&whole whole &rest rest) (declare (ignore rest)) `(function ,whole)) In other words, it is just a convenience macro eliminating the need to type #' in front of anaonymous lambdas. Form [5] might work in some Lisps under a strange notion of back compatibility, but is not defined by the standard. The functions returned by [2] [3] [4] are defined in the surrounding lexical environment and have access to variables, functions, block tags, and go tags defined in that environment. It isn't clear what [5] is intended to do. The lambda expression might be consed up at run time preventing the compiler from knowing its details when compiling the surrounding environment; and the compiler might not leave around enough information about the surrounding lexical environment in order to compile the lambda expression in it. One of the unstated assumptions in ANSI CL is that when a form (typically a cons tree) is converted to a function, everything sharing a lexical environment is converted at the same time, when eval or compile or compile-file times. From: "Robert Dodier" (functionp '(lambda (x) (* x x))) (functionp #'(lambda (x) (* x x))) (functionp (lambda (x) (* x x))) on my Linux desktop box, I get NIL, T, T from Clisp, CMUCL, SBCL, ECL, and Allegro, while GCL returns T, T, T. To clarify situations like this, I suggest also testing type-of along with functionp. From the above it is impossible to determine whether FUNCTION and LAMBDA are nonconformant in this GCL release, or whether FUNCTIONP is nonconformant. It used to be common before the adoiption of CLOS that implementations of FUNCTIONP would return true for cons-trees that looked sort of like lambda expressions. It's no longer conforming. From hwpeters at jamadots.com Sun Jan 4 22:09:29 2009 From: hwpeters at jamadots.com (Henry W. Peters) Date: Sun, 04 Jan 2009 23:09:29 -0500 Subject: [Maxima] wxWidget & wxMaxima (again) Message-ID: <496187F9.6090209@jamadots.com> Ok, I thought this was going to be easy... I did a clean upgrade to Ubuntu 8.10, so I needed to do a fresh build of Maxima, wxMaxima, etc... I installed Maxima 5.17 using CLisp, seemed to go fine, haven't yet had the chance to do anything with it yet... I did a latest download of wxMaxima & I followed the instructions at the WxPy Wiki for apt-get install for wxWidgets... this did its' thing in the terminal... but when I went to ./configure, etc., wxMaxima I get the following message & then a configure error message, which made my head spin... (lots of thoughts, no answers): 'henry at henry-heron:~$ cd /home/henry/wxMaxima-0.8.1 henry at henry-heron:~/wxMaxima-0.8.1$ ./configure checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for g++... g++ checking for C++ compiler default output file name... a.out checking whether the C++ compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for gcc... gcc checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for a BSD-compatible install... /usr/bin/install -c checking whether make sets $(MAKE)... yes checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking dependency style of g++... gcc3 checking for wx-config... no configure: error: wxWidgets must be installed on your system. Please check that wx-config is in path, the directory where wxWidgets libraries are installed (returned by 'wx-config --libs' or 'wx-config --static --libs' command) is in LD_LIBRARY_PATH or equivalent variable and wxWidgets version is 2.8.0 or above.' Yikes! What the heck is "in path" ??? What path, where? (one note, wxPy does not claim this .deb version is, or is not compatible with Intrepid, I just assumed they have not updated their web site, especially as it downloaded...) So then I tried to do another 'apt-get' etc to see if wxWidgets actually did a successful install & I got the following. ':~$ sudo apt-get install python-wxgtk2.8 python-wxtools python-wxaddons wx2.8-i18n [sudo] password for henry: Reading package lists... Done Building dependency tree Reading state information... Done python-wxgtk2.8 is already the newest version. python-wxtools is already the newest version. python-wxaddons is already the newest version. wx2.8-i18n is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. henry at henry-heron:~$ wx-config --libs The program 'wx-config' can be found in the following packages: * libwxbase2.6-dbg * libwxgtk2.6-dbg * libwxbase2.6-dev * libwxgtk2.4-dbg * libwxgtk2.6-dev * libwxgtk2.8-dev * libwxbase2.8-dev * libwxgtk2.8-dbg * libwxbase2.4-dev * libwxbase2.4-dbg * libwxgtk2.4-dev * libwxbase2.8-dbg Try: sudo apt-get install bash: wx-config: command not found henry at henry-heron:~$ ' Hope this makes some sense. Many thanks for any information leading me back to 'in path' Henry From Jussi.Eloranta at csun.edu Sun Jan 4 22:29:28 2009 From: Jussi.Eloranta at csun.edu (Jussi Eloranta) Date: Sun, 04 Jan 2009 20:29:28 -0800 Subject: [Maxima] lsquares In-Reply-To: References: <4961376E.9080707@csun.edu> Message-ID: <49618CA8.7060902@csun.edu> Hi, Robert Dodier wrote: > > Yes, if I understand correctly, you can construct a combined MSE > and then minimize that, something like: > > mse1 : lsquares_mse (data1, [a, b, c, d], equation1); > mse2 : lsquares_mse (data2, [a, b, c, d], equation2); > lsquares_estimates_approximate (mse1 + mse2, [a, b, c, d], ...); > > Well, if data1 and data2 have different numbers of rows I guess you > want something like n1/(n1 + n2)*mse1 + n2/(n1 + n2)*mse2 for the > combined MSE. > > Yes, this is exactly what I was looking for - thanks. >> 2) Are there routines to calculate r^2, covariance matrix, standard >> error estimates ? >> > > r^2 you can obtain from lsquares_residual_mse. > > There aren't any built-in functions for the covariance matrix or > standard error estimates. > I 'll put those on my to-do list (should be straightforward). > > Of course, one can compute these separately but they are often needed in least squares fitting and would be handy to have as preprogrammed functions. >> debug, neqs, i, sq, tmp, lbfgs_nfeval_max:1000, /* BFGS tends >> to converge somewhat slowly... */ >> > > Do you want to suggest another minimization algorithm? > I believe that the Levenberg-Marquardt is pretty much standard algorithm in this business? http://en.wikipedia.org/wiki/Levenberg-Marquardt_algorithm Jussi Eloranta Department of chemistry and biochemistry Cal State Northridge From al at beshenov.ru Sun Jan 4 22:29:33 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Mon, 5 Jan 2009 07:29:33 +0300 Subject: [Maxima] wxWidget & wxMaxima (again) In-Reply-To: <496187F9.6090209@jamadots.com> References: <496187F9.6090209@jamadots.com> Message-ID: <200901050729.33319.al@beshenov.ru> On Monday 05 January 2009 07:09:29 Henry W. Peters wrote: > Yikes! What the heck is "in path" ??? What path, where? (one note, > wxPy does not claim this .deb version is, or is not compatible with > Intrepid, I just assumed they have not updated their web site, > especially as it downloaded...) I think you need `sudo apt-get install libwxgtk2.8-dev`. -- Setting Orange (Mungoday), Chaos 5 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From rvh2007 at comcast.net Mon Jan 5 04:21:39 2009 From: rvh2007 at comcast.net (Richard Hennessy) Date: Mon, 5 Jan 2009 05:21:39 -0500 Subject: [Maxima] More functions for pw. Message-ID: <43EA202CE0FB4649B039FC3A24A9CDDF@RichDesktop> Does anyone have an opinion whether I should create a Fourier series command for piecewise functions? I haven't tested the fourie package recently but when I last checked it did not work for piecewise functions. I was thinking pwfourier(pw(L,x),x) a(0)=... a(n) = ... b(n) = ... and pwfourier_transform(pw(L,x),x) -> some complicated function. I already have written the code for it. Rich From biomates at telefonica.net Mon Jan 5 06:44:26 2009 From: biomates at telefonica.net (Mario Rodriguez) Date: Mon, 05 Jan 2009 13:44:26 +0100 Subject: [Maxima] lsquares In-Reply-To: <49618CA8.7060902@csun.edu> References: <4961376E.9080707@csun.edu> <49618CA8.7060902@csun.edu> Message-ID: <1231159466.5865.8.camel@pc> > >> 2) Are there routines to calculate r^2, covariance matrix, standard > >> error estimates ? > >> > > > > r^2 you can obtain from lsquares_residual_mse. > > > > There aren't any built-in functions for the covariance matrix or > > standard error estimates. > > I 'll put those on my to-do list (should be straightforward). Functions var, std or cov in package descriptive can be of some help here. Also, for normality or mean tests of the residuals (lsquares_residual), check functions test_normality and test_mean defined in package stats. links to on-line documentation: http://maxima.sourceforge.net/docs/manual/en/maxima_45.html http://maxima.sourceforge.net/docs/manual/en/maxima_73.html From dgildea at users.sourceforge.net Mon Jan 5 07:33:50 2009 From: dgildea at users.sourceforge.net (Dan Gildea) Date: Mon, 5 Jan 2009 08:33:50 -0500 Subject: [Maxima] Integral lookup and CLISP In-Reply-To: References: Message-ID: <20090105133350.GA21535@e15.cs.rochester.edu> The defprop macro quotes the lambda expression, but this works: ;; Integral of the Bessel function wrt z (putprop '%bessel_j `((n z) nil ,(lambda (n unused) (case n (0 ;; integrate(bessel_j(0,z) ;; = (1/2)*z*(%pi*bessel_j(1,z)*hstruve[0](z) ;; +bessel_j(0,z)*(2-%pi*hstruve[1](z))) '((mtimes) ((rat) 1 2) z ((mplus) ((mtimes) $%pi ((%bessel_j) 1 z) ((mqapply) (($hstruve array) 0) z)) ((mtimes) ((%bessel_j) 0 z) ((mplus) 2 ((mtimes) -1 $%pi ((mqapply) (($hstruve array) 1) z))))))) (1 ;; integrate(bessel_j(1,z) = -bessel_j(0,z) '((mtimes) -1 ((%bessel_j) 0 z))) (otherwise nil)))) 'integral) From raymond.toy at ericsson.com Mon Jan 5 09:38:50 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 05 Jan 2009 10:38:50 -0500 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: <495E475B.3010906@gmail.com> (Raymond Toy's message of "Fri, 02 Jan 2009 11:56:59 -0500") References: <495E475B.3010906@gmail.com> Message-ID: >>>>> "Raymond" == Raymond Toy writes: Raymond> I think a long time ago, I talked with Barton about this, and have now Raymond> finally gotten a round to implementing it. Raymond> I've written a set of CLOS classes to make working with bigfloat and Raymond> complex bigfloat numbers easier. It's a new package "NUMERIC" where the Raymond> standard Lisp operations have been shadowed to work with a new bigfloat Raymond> and complex-bigfloat numbers. I've checked in the new package. It's not quite ready for use, even though I think I have most things implemented. Based on some comments, I think I will rename the (Lisp) package from NUMERIC to BIGFLOAT. I'm still open to other suggestions of an appropriate package name. (Maybe the package could use a nickname of BF to minimize typing?) Also, I like Richard's suggestion of using TO. So, I'll add BIGFLOAT:TO which will convert CL numbers into either a BIGFLOAT or COMPLEX-BIGFLOAT object. It will also convert Maxima's internal bigfloat representation to a BIGFLOAT object. I suppose we should also be able to convert a+b*%i into a COMPLEX-BIGFLOAT. I'll also add MAXIMA:TO to convert a BIGFLOAT or COMPLEX-BIGFLOAT object into Maxima's internal representation. How does that sound? Ray From raymond.toy at ericsson.com Mon Jan 5 09:51:12 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 05 Jan 2009 10:51:12 -0500 Subject: [Maxima] tips for Multiple roots of non-algebric equations In-Reply-To: <91D7C30713A54D1AB62D9DAA43A59F0C@windowsa96d2f1> (Luigi Marino's message of "Sat, 3 Jan 2009 10:13:14 +0100") References: <91D7C30713A54D1AB62D9DAA43A59F0C@windowsa96d2f1> Message-ID: >>>>> "Luigi" == Luigi Marino writes: Luigi> I try to solve non-algebric equations with multiple roots. : Luigi> 1. first example. Luigi> f:log(x^2+1)-sin(x)-4; Luigi> for k:-12 thru -3 step 1 do print("x="(newton(f,x,k,0.0000000001)))$ Luigi> x=(-11.473978752837) Luigi> x=(-11.47397875283699) Are you bothered that you get the same roots again? Luigi> 3. third example Luigi> h:log(x+1)-1/2*x^2+0.6;(%o13) Luigi> log(x+1)-x^2/2+0.6(%i14) Luigi> for k:0 thru 1 step 1 do print("x="(newton(h,x,k,0.0000000001)))$ Luigi> x=(-0.40442128319509) Luigi> x=(1.806649648414053) Are you bothered that you get roots outside of the interval [0,1]? I think that's the nature of Newton's method. Your initial guess has to be close enough to the root to converge to the root; different starting points can converge to the same root. And nothing constrains Newton's method to stay in any given interval. Ray From fateman at cs.berkeley.edu Mon Jan 5 09:57:47 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Mon, 05 Jan 2009 07:57:47 -0800 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: References: <495E475B.3010906@gmail.com> Message-ID: <49622DFB.7000502@cs.berkeley.edu> There are lots of possible classes. It is easy to start programming up real-interval:to quad-float:to polar-double-float:to projective-rational:to [includes infinity] affine-rational:to [includes infinity] ... and then maxima:to must be extended also That's what I tried to systematize with the lisp generic package. I don't know that I succeeded in making it as simple as possible. I think that bigfloat / complex bigfloat is probably the most useful for maxima. RJF From raymond.toy at ericsson.com Mon Jan 5 09:59:08 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 05 Jan 2009 10:59:08 -0500 Subject: [Maxima] Management Model for Open Source Software Developement Projects In-Reply-To: (Robert Dodier's message of "Sat, 3 Jan 2009 15:39:06 -0700") References: <1d4427680901021203web48e2dx845b5c6067f5362d@mail.gmail.com> Message-ID: >>>>> "Robert" == Robert Dodier writes: Robert> On 1/2/09, ahmet alper parker wrote: >> I want to ask you that is there a management model (schedule, plan, >> responsible people etc.) in the development phase of maxima? Robert> Well, the Maxima development process, to the extent that there is any, Robert> is the following. Robert> * There are 3 releases per year, April, August, and December. Robert> * Project administrators manage the releases and machinery such Robert> as the project web site and mailing list, but do not set goals for the Robert> project or oversee developers. Robert> * Ideas about what to do are often floated on the mailing list. Robert> * Developers work on stuff as their time, interests, and expertise permit. Robert> * Whether or not something gets done is largely a function of whether Robert> anybody wants to do it, and whether there is any active opposition to it. Robert> This is just a description of the current state of affairs. Robert> For my part, I'm not inclined to change it. I think this is all you can realistically do anyway. :-) But it would be nice if there were some set of goals. You know, some certain set of features that maxima is currently lacking that we'd like to have. A lot of this is already happening (more special function support with bigfloat values for them), but a rough list of ideas would be nice. (I thought the wiki had some ideas on this, but I may be mistaken.) Ray From raymond.toy at ericsson.com Mon Jan 5 10:40:01 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 05 Jan 2009 11:40:01 -0500 Subject: [Maxima] Testsuite failures Message-ID: I'm getting the following failures in the testsuite: ********************** Problem 303 *************** Input: integrate(bessel_y(11, x), x) Result: error-catch I think this due to a typo in the integral formula for bessel_y. There's a call to simplify with two args instead of one. I think the second arg should be removed, or simplify should by simplifya. Clisp (2.47) fails rtest_gamma: ********************** Problem 354 *************** Input: relerror(gamma_incomplete(0.5, 0.1 %i - 2.5), 1.00288947695445 - 9.842709236689227 %i, 1.0E-15) Result: 1.105194365996218E-15 Cmucl fails rtest_gamma: ********************** Problem 371 *************** Input: relerror(gamma_incomplete(0.5, - 5 %i), 0.364419841063559 - .2436855906381129 %i, 1.0e-15) Result: 2.788636698038084e-15 ********************** Problem 381 *************** Input: relerror(gamma_incomplete(0.5, 5 %i), .2436855906381129 %i + 0.364419841063559, 1.0e-15) Result: 2.788636698038084e-15 ********************** Problem 388 *************** Input: relerror(gamma_incomplete(0.5, 2.0 %i - 2), - .6696404542328767 %i - 4.636214977691262, 2.0e-15) Result: 2.051455149042451e-15 ********************** Problem 389 *************** Input: relerror(gamma_incomplete(0.5, 3.0 %i - 3), 8.244293668813985 %i - 6.274836016533672, 2.5e-15) Result: 3.682253398201579e-15 ********************** Problem 391 *************** Input: relerror(gamma_incomplete(0.5, 5.0 %i - 5), 9.813229347687738 %i + 57.54071128202554, 2.0e-15) Result: 2.449911020455208e-15 ********************** Problem 396 *************** Input: relerror(gamma_incomplete(0.5, 2.0 %i - 2), - .6696404542328767 %i - 4.636214977691262, 2.0e-15) Result: 2.051455149042451e-15 ********************** Problem 397 *************** Input: relerror(gamma_incomplete(0.5, 3.0 %i - 3), 8.244293668813985 %i - 6.274836016533672, 3.0e-15) Result: 3.682253398201579e-15 ********************** Problem 399 *************** Input: relerror(gamma_incomplete(0.5, 5.0 %i - 5), 9.813229347687738 %i + 57.54071128202554, 2.0e-15) Result: 2.449911020455208e-15 Gcl fails rtest_gamma: ********************** Problem 592 *************** Input: relerror(fresnel_s(%i + 5.0), 3.84389093777759513198736581956757227475265101347572827364567521b4 %i - 2.044525505063210590493330126425293361797143144299005524393297869b5, 2.e-14) Result: 2.542490092925679718842752779534059543174617462409733517737362792b-14 ********************** Problem 614 *************** Input: relerror(fresnel_c(%i + 5.0), 2.044530505063119004499308897858846121088557663560705550579996093b5 %i + 3.84394093777740143202918713550472184235160647415045418329908291b4, 2.e-14) I guess the tolerance needs to be increased a bit. The CMUCL failures may indicate an issue with some CMUCL routines since CMUCL fails more tests than the other lisps. Ray From hwpeters at jamadots.com Mon Jan 5 10:55:42 2009 From: hwpeters at jamadots.com (Henry W. Peters) Date: Mon, 05 Jan 2009 11:55:42 -0500 Subject: [Maxima] Problem/s with Maxima, et al (on Ubuntu 8.10) Message-ID: <49623B8E.9080505@jamadots.com> I got wxWidgets to install & wxMaxima 0.8.1 (thanks Alexey!). However, *no* command line in wxMaxima... strange behaviours in the terminal, etc. I found out (from another circumstance) how to un-install, thinking that, as the terminal welcome info showed, the 5.17 build was for i686 architecture & my machine is an AMD Mobile Athelon +3000 (i386... I do believe). Anyway I went back to Maxima 5.16.3, hoping this would set me up correctly with Maxima... It was not to be... (though I did *run* the tests in xMaxima & no unexpected errors????). This is was, however, an error message I got when trying to run the plot demonstrations in xMaxima: xmaxima error Maxima encountered a Lisp error Unix error 32 9EPIPE): Broken pipe, child process terminate or socket closed Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. This is the welcome message when I ran Maxima in the terminal ('gnuplot: not found'): henry at henry-heron:~/maxima-5.16.3$ xmaxima Maxima 5.16.3 http://maxima.sourceforge.net Using Lisp CLISP 2.44.1 (2008-02-23) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) jfa: starting server on port 4008 /bin/sh: gnuplot: not found Any one with ideas about what is, or is not going on here? Further tests? CLISP problem? Or... or... Henry From l.butler at ed.ac.uk Mon Jan 5 11:18:21 2009 From: l.butler at ed.ac.uk (Leo Butler) Date: Mon, 5 Jan 2009 17:18:21 +0000 (GMT) Subject: [Maxima] Problem/s with Maxima, et al (on Ubuntu 8.10) In-Reply-To: <49623B8E.9080505@jamadots.com> References: <49623B8E.9080505@jamadots.com> Message-ID: On Mon, 5 Jan 2009, Henry W. Peters wrote: < I got wxWidgets to install & wxMaxima 0.8.1 (thanks Alexey!). However, < *no* command line in wxMaxima... strange behaviours in the terminal, < etc. I found out (from another circumstance) how to un-install, thinking < that, as the terminal welcome info showed, the 5.17 build was for i686 < architecture & my machine is an AMD Mobile Athelon +3000 (i386... I do < believe). Anyway I went back to Maxima 5.16.3, hoping this would set me < up correctly with Maxima... It was not to be... (though I did *run* the < tests in xMaxima & no unexpected errors????). < < This is was, however, an error message I got when trying to run the plot < demonstrations in xMaxima: < < xmaxima error < Maxima encountered a Lisp error < Unix error 32 9EPIPE): Broken pipe, child process terminate or socket closed < Automatically continuing. < To reenable the Lisp debugger set *debugger-hook* to nil. < < This is the welcome message when I ran Maxima in the terminal ('gnuplot: < not found'): < < henry at henry-heron:~/maxima-5.16.3$ xmaxima < Maxima 5.16.3 http://maxima.sourceforge.net < Using Lisp CLISP 2.44.1 (2008-02-23) < Distributed under the GNU Public License. See the file COPYING. < Dedicated to the memory of William Schelter. < The function bug_report() provides bug reporting information. < (%i1) jfa: starting server on port 4008 < /bin/sh: gnuplot: not found Maxima uses gnuplot to do its plotting, so gnuplot must be installed. This last line tells you that 'gnuplot' has not been found. It is likely not installed on your machine (?). Try apt-get -s install gnuplot to simulate (-s) the installation of gnuplot. To actually install gnuplot, remove the '-s' from the line above. Leo < < Any one with ideas about what is, or is not going on here? Further < tests? CLISP problem? Or... or... < < Henry < _______________________________________________ < Maxima mailing list < Maxima at math.utexas.edu < http://www.math.utexas.edu/mailman/listinfo/maxima < < -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From villate at fe.up.pt Mon Jan 5 11:25:22 2009 From: villate at fe.up.pt (Jaime Villate) Date: Mon, 05 Jan 2009 17:25:22 +0000 Subject: [Maxima] Problem/s with Maxima, et al (on Ubuntu 8.10) In-Reply-To: <49623B8E.9080505@jamadots.com> References: <49623B8E.9080505@jamadots.com> Message-ID: <1231176322.6793.31.camel@bethe> On Seg, 2009-01-05 at 11:55 -0500, Henry W. Peters wrote: > This is was, however, an error message I got when trying to run the > plot > demonstrations in xMaxima: > > xmaxima error > Maxima encountered a Lisp error Can you please tell us the exact command you used? You can try using the following command before to attempt to do the plot: set_plot_option([plot_format,openmath])$ does that work? Regards, Jaime From hwpeters at jamadots.com Mon Jan 5 13:17:44 2009 From: hwpeters at jamadots.com (Henry W. Peters) Date: Mon, 05 Jan 2009 14:17:44 -0500 Subject: [Maxima] Problem/s with Maxima, et al (on Ubuntu 8.10) In-Reply-To: References: <49623B8E.9080505@jamadots.com> Message-ID: <49625CD8.80902@jamadots.com> Hi Leo, Jaime, I installed gnuplot... & now xmaxima seems to function ok... (& it calculates & plots the demos...), except I now get this error (in bottom of message returned, & which I do not know exactly the implications of this) in the terminal window when I launch it from the terminal with the *command line, 'xmaxima'*: henry at henry-heron:~$ xmaxima Maxima 5.16.3 http://maxima.sourceforge.net Using Lisp CLISP 2.44.1 (2008-02-23) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) jfa: starting server on port 4008 *** - handle_fault error2 ! address = 0xdfffffff not in [0x683a5d08,0x685da000) ! SIGSEGV cannot be cured. Fault address = 0xdfffffff. Permanently allocated: 107072 bytes. Currently in use: 9758248 bytes. Free space: 9386 bytes. Wxmaxima still has no command line (though it says "ready for user input" at the lower right corner (to the right of where the command line might be). The work space has a bracket which stretches with input, with a triangle hanging on the top inward line... & a couple of '>>' (I think this may be something like a group input entry form (?). There does not seem to be any configuration/preferences to change this condition. Something is quite wrong here, some how. Perhaps the problem lays with wxMaxima (v.0.8.1)? I can launch wxMaxima from an icon in the applications menu, same result. Thanks much for help! Henry p.s., please, if you need more information, or for me to try something else, glad to try... & one other query, if I may; what about the 'i686' install of v.5.17 (as I said, I believe my machine is for i386)? Is this, or could this be a problem for me, once (under the hopefully *not* hypothetical situation), we can actually iron out the current problem/s? If so, can one direct the v. 5.17 source build to do other ways than i686? Leo Butler wrote: > On Mon, 5 Jan 2009, Henry W. Peters wrote: > > < /bin/sh: gnuplot: not found > > Maxima uses gnuplot to do its plotting, so gnuplot must be installed. > This last line tells you that 'gnuplot' has not been found. It is likely > not installed on your machine (?). Try > > apt-get -s install gnuplot > > to simulate (-s) the installation of gnuplot. To actually install > gnuplot, remove the '-s' from the line above. > > Leo > > > < > < Any one with ideas about what is, or is not going on here? Further > < tests? CLISP problem? Or... or... > < > < Henry > > Can you please tell us the exact command you used? > You can try using the following command before to attempt to do the > plot: > set_plot_option([plot_format,openmath])$ > does that work? > > Regards, > Jaime From andrej.vodopivec at gmail.com Mon Jan 5 13:28:23 2009 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Mon, 5 Jan 2009 20:28:23 +0100 Subject: [Maxima] Problem/s with Maxima, et al (on Ubuntu 8.10) In-Reply-To: <49625CD8.80902@jamadots.com> References: <49623B8E.9080505@jamadots.com> <49625CD8.80902@jamadots.com> Message-ID: <7775b21a0901051128o34599a1fl85fcb99c69266318@mail.gmail.com> wxmaxima 0.8 does not have the separated input field anymore. There are some tutorials at http://wxmaxima.sourceforge.net/wiki/index.php/Tutorials which should help you get started with the new interface. Andrej On Mon, Jan 5, 2009 at 8:17 PM, Henry W. Peters wrote: > Hi Leo, Jaime, > > I installed gnuplot... & now xmaxima seems to function ok... (& it > calculates & plots the demos...), except I now get this error (in bottom > of message returned, & which I do not know exactly the implications of > this) in the terminal window when I launch it from the terminal with the > *command line, 'xmaxima'*: > > henry at henry-heron:~$ xmaxima > Maxima 5.16.3 http://maxima.sourceforge.net > Using Lisp CLISP 2.44.1 (2008-02-23) > Distributed under the GNU Public License. See the file COPYING. > Dedicated to the memory of William Schelter. > The function bug_report() provides bug reporting information. > (%i1) jfa: starting server on port 4008 > > *** - handle_fault error2 ! address = 0xdfffffff not in > [0x683a5d08,0x685da000) ! > SIGSEGV cannot be cured. Fault address = 0xdfffffff. > Permanently allocated: 107072 bytes. > Currently in use: 9758248 bytes. > Free space: 9386 bytes. > > > Wxmaxima still has no command line (though it says "ready for user > input" at the lower right corner (to the right of where the command line > might be). The work space has a bracket which stretches with input, with > a triangle hanging on the top inward line... & a couple of '>>' (I think > this may be something like a group input entry form (?). There does not > seem to be any configuration/preferences to change this condition. > Something is quite wrong here, some how. > > Perhaps the problem lays with wxMaxima (v.0.8.1)? > > I can launch wxMaxima from an icon in the applications menu, same result. > > Thanks much for help! > > Henry > p.s., please, if you need more information, or for me to try something > else, glad to try... > > & one other query, if I may; what about the 'i686' install of v.5.17 (as > I said, I believe my machine is for i386)? Is this, or could this be a > problem for me, once (under the hopefully *not* hypothetical situation), > we can actually iron out the current problem/s? If so, can one direct > the v. 5.17 source build to do other ways than i686? > > Leo Butler wrote: >> On Mon, 5 Jan 2009, Henry W. Peters wrote: >> >> < /bin/sh: gnuplot: not found >> >> Maxima uses gnuplot to do its plotting, so gnuplot must be installed. >> This last line tells you that 'gnuplot' has not been found. It is likely >> not installed on your machine (?). Try >> >> apt-get -s install gnuplot >> >> to simulate (-s) the installation of gnuplot. To actually install >> gnuplot, remove the '-s' from the line above. >> >> Leo >> >> >> < >> < Any one with ideas about what is, or is not going on here? Further >> < tests? CLISP problem? Or... or... >> < >> < Henry >> > > >> Can you please tell us the exact command you used? >> You can try using the following command before to attempt to do the >> plot: >> set_plot_option([plot_format,openmath])$ >> does that work? >> >> Regards, >> Jaime > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From raymond.toy at ericsson.com Mon Jan 5 13:47:14 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 05 Jan 2009 14:47:14 -0500 Subject: [Maxima] "Simpler" bigfloat and complex bigfloat arithmetic In-Reply-To: <49622DFB.7000502@cs.berkeley.edu> References: <495E475B.3010906@gmail.com> <49622DFB.7000502@cs.berkeley.edu> Message-ID: <496263C2.1090704@ericsson.com> Richard Fateman wrote: > There are lots of possible classes. It is easy to start programming up > > real-interval:to > quad-float:to > polar-double-float:to > projective-rational:to [includes infinity] > affine-rational:to [includes infinity] > ... > > and then maxima:to > must be extended also > I've renamed NUMERIC to BIGFLOAT, and implemented BIGFLOAT:TO and MAXIMA::TO. BIGFLOAT:TO is a function, but MAXIMA::TO is a method, which, I hope, should make it easy to extend MAXIMA::TO with the possibilities you mention above. The only possible issue is that you mentioned GENERIC:+. It's currently in the bigfloat package, but that shouldn't be a problem in practice. I don't expect to change the package name from BIGFLOAT to anything else, and the TO functions are here to stay unless someone really objects. So, if people want to start using this, it should be ok. I'm sure there are bugs and missing functionality. If you are converting plain CL code to bigfloat, and you find you're missing something, let me know. > That's what I tried to systematize with the lisp generic package. I don't > know that I succeeded in making it as simple as possible. > > I think that bigfloat / complex bigfloat is probably the most useful > for maxima. Real intervals would be interesting. Perhaps someone would be interested in doing this. (Having implemented an interval package sometime ago, I might try this again.) Ray From drdieterkaiser at web.de Mon Jan 5 15:11:54 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 5 Jan 2009 22:11:54 +0100 Subject: [Maxima] Testsuite failures In-Reply-To: References: Message-ID: Hello Ray, thank you for your report. I will have a look at the numerical accuracy of the functions. Dieter Kaiser -----Urspr?ngliche Nachricht----- Von: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] Im Auftrag von Raymond Toy Gesendet: Montag, 5. Januar 2009 17:40 An: Maxima List Betreff: [Maxima] Testsuite failures I'm getting the following failures in the testsuite: ********************** Problem 303 *************** Input: integrate(bessel_y(11, x), x) Result: error-catch I think this due to a typo in the integral formula for bessel_y. There's a call to simplify with two args instead of one. I think the second arg should be removed, or simplify should by simplifya. Clisp (2.47) fails rtest_gamma: ********************** Problem 354 *************** Input: relerror(gamma_incomplete(0.5, 0.1 %i - 2.5), 1.00288947695445 - 9.842709236689227 %i, 1.0E-15) Result: 1.105194365996218E-15 Cmucl fails rtest_gamma: ********************** Problem 371 *************** Input: relerror(gamma_incomplete(0.5, - 5 %i), 0.364419841063559 - .2436855906381129 %i, 1.0e-15) Result: 2.788636698038084e-15 ********************** Problem 381 *************** Input: relerror(gamma_incomplete(0.5, 5 %i), .2436855906381129 %i + 0.364419841063559, 1.0e-15) Result: 2.788636698038084e-15 ********************** Problem 388 *************** Input: relerror(gamma_incomplete(0.5, 2.0 %i - 2), - .6696404542328767 %i - 4.636214977691262, 2.0e-15) Result: 2.051455149042451e-15 ********************** Problem 389 *************** Input: relerror(gamma_incomplete(0.5, 3.0 %i - 3), 8.244293668813985 %i - 6.274836016533672, 2.5e-15) Result: 3.682253398201579e-15 ********************** Problem 391 *************** Input: relerror(gamma_incomplete(0.5, 5.0 %i - 5), 9.813229347687738 %i + 57.54071128202554, 2.0e-15) Result: 2.449911020455208e-15 ********************** Problem 396 *************** Input: relerror(gamma_incomplete(0.5, 2.0 %i - 2), - .6696404542328767 %i - 4.636214977691262, 2.0e-15) Result: 2.051455149042451e-15 ********************** Problem 397 *************** Input: relerror(gamma_incomplete(0.5, 3.0 %i - 3), 8.244293668813985 %i - 6.274836016533672, 3.0e-15) Result: 3.682253398201579e-15 ********************** Problem 399 *************** Input: relerror(gamma_incomplete(0.5, 5.0 %i - 5), 9.813229347687738 %i + 57.54071128202554, 2.0e-15) Result: 2.449911020455208e-15 Gcl fails rtest_gamma: ********************** Problem 592 *************** Input: relerror(fresnel_s(%i + 5.0), 3.84389093777759513198736581956757227475265101347572827364567521b4 %i - 2.044525505063210590493330126425293361797143144299005524393297869b5, 2.e-14) Result: 2.542490092925679718842752779534059543174617462409733517737362792b-14 ********************** Problem 614 *************** Input: relerror(fresnel_c(%i + 5.0), 2.044530505063119004499308897858846121088557663560705550579996093b5 %i + 3.84394093777740143202918713550472184235160647415045418329908291b4, 2.e-14) I guess the tolerance needs to be increased a bit. The CMUCL failures may indicate an issue with some CMUCL routines since CMUCL fails more tests than the other lisps. Ray _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From caos.drums at gmail.com Sun Jan 4 18:14:23 2009 From: caos.drums at gmail.com (caos0569) Date: Sun, 4 Jan 2009 16:14:23 -0800 (PST) Subject: [Maxima] Maxima routine for False Position Method. Message-ID: <21283430.post@talk.nabble.com> Hi, My name is Carlos and i'm an engeneering student. I'm a beginer using Maxima for mathematics learning and i need a routine for the "False Position Method" for loading in Maxima. False Position Method, as i'm shure you know, is a "root-finding" method, such as Newton Method or Bissecton method for solving non-linear functions. If anyone have such routine can you send it to me by email? Thanks, Carlos -- View this message in context: http://www.nabble.com/Maxima-routine-for-False-Position-Method.-tp21283430p21283430.html Sent from the Maxima mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090104/dfb74406/attachment.htm From al at beshenov.ru Mon Jan 5 15:30:15 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Tue, 6 Jan 2009 00:30:15 +0300 Subject: [Maxima] Maxima routine for False Position Method. In-Reply-To: <21283430.post@talk.nabble.com> References: <21283430.post@talk.nabble.com> Message-ID: <200901060030.16233.al@beshenov.ru> On Monday 05 January 2009 03:14:23 caos0569 wrote: > Hi, > My name is Carlos and i'm an engeneering student. I'm a beginer > using Maxima for mathematics learning and i need a routine for the > "False Position Method" for loading in Maxima. False Position > Method, as i'm shure you know, is a "root-finding" method, such as > Newton Method or Bissecton method for solving non-linear functions. > > If anyone have such routine can you send it to me by email? See "newton" and "mnewton" in the Maxima manual. -- Setting Orange (Mungoday), Chaos 5 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From David.Billinghurst at riotinto.com Mon Jan 5 16:11:41 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Tue, 6 Jan 2009 09:11:41 +1100 Subject: [Maxima] Testsuite failures References: Message-ID: <026DCC31AB859648A6F16C0E5CD2580D01789A60@calttsv025.cal.riotinto.org> > From: Raymond Toy > > I'm getting the following failures in the testsuite: > > ********************** Problem 303 *************** > Input: > integrate(bessel_y(11, x), x) > > > Result: > error-catch > > I think this due to a typo in the integral formula for bessel_y. > There's a call to simplify with two args instead of one. I > think the second arg should be removed, or simplify should by > simplifya. patch checked in. Thanks. gcl let this through. This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. From drdieterkaiser at web.de Mon Jan 5 16:16:45 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 5 Jan 2009 23:16:45 +0100 Subject: [Maxima] Fully simplifiying Exp function Message-ID: <1ABDA6D624704FB3BF1149FC72504C3B@Kaiser> I have closed the bug SF[1247549] "noun/verb forms of erf and exp not treated consistently", because the Erf function works as expected. But I was too fast. The Exp function has still a different behavior. I had a further look at the Exp function and would like to suggest to add the following code (perhaps to the file simp.lisp): (defprop %exp simp-exp operators) (defprop $exp %exp alias) (defprop %exp $exp reversealias) (defun simp-exp (x y z) (oneargcheck x) (setq y (simpcheck (cadr x) z)) (cond ((taylorize (mop x) (second x))) ; Check for taylor-expansion (t (simplifya (list '(mexpt) '$%e y) z)))) ; Now some results to show how this works: Session 1: The old behaviour without any change (%i4) %e^1.0; (%o4) 2.718281828459045 (%i5) exp(1.0); (%o5) 2.718281828459045 (%i6) 'exp(1.0); (%o6) 'exp(1.0) /* no simplification to number */ The reason is that the parser does the following: exp(1.0) ---> (($exp) 1.0) 'exp(1.0) ---> ((%exp) 1.0) The $exp-expression is numerically evaluated because we support a $exp function which does the transformation to %e^1.0 which than simplifies to a number. But we have no simplifying function for the expression %exp. The noun form for the Exp function in not known by Maxima und can not be further handled. Session 2: Adding a simplifying function Now we get the expected simplification: (%i5) exp(1.0); (%o5) 2.718281828459045 (%i6) 'exp(1.0); (%o6) 2.718281828459045 But now we pass the wrong number of arguments: (%i7) exp(1.0,2.0); Maxima encountered a Lisp error: Error in MACSYMA-TOP-LEVEL [or a callee]: MACSYMA-TOP-LEVEL [or a callee] requires less than two arguments. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. (%i8) 'exp(1.0,2.); Wrong number of arguments to exp -- an error. To debug this try debugmode(true); In one case we get a Lisp Error, the other case gives a Maxima Error. The reason is, that the $exp expression which we get from the parser calls directly the Lisp function $exp. This function does no check for the arguments and gives therefore a Lisp Error. In the second case the %exp expression is passed to the simplifying function which checks the number of arguments and gives a Maxima Error. 3. Session: Add the properties Alias and Reversealias At first again the expected numerical evaluation: (%i10) exp(1.0); (%o10) 2.718281828459045 (%i11) 'exp(1.0); (%o11) 2.718281828459045 Now both examples with a wrong number of arguments: (%i12) exp(1.0,2.0); Wrong number of arguments to exp -- an error. To debug this try debugmode(true); (%i13) 'exp(1.0,2.0); Wrong number of arguments to exp -- an error. To debug this try debugmode(true); We get in both cases a Maxima Error. When the Alias properties are defined the parser transforms both expression to a %exp noun form. This noun form is then simplified by simp-exp which checks the arguments. The Maxima User never calls the $exp function. It is no longer necessary to support this function for a Maxima User. But: When correctly implemented the $exp function has a very nice feature. Instead of writing (simplify (list '(%exp) x) or using other shortcuts or macros you can write ($exp x) in Lisp code. The $exp function does the right, save and complete simplification of the expression. It works for all Maxima numbers and expressions: A complete $exp function would be (defun $exp (x) (simplify '(%exp) (resimplify x))) To be complete, the $exp function does a bit more than the code (simplify (...)). It does a resimplify of the argument. This might be an extra call to the simplifier for the argument, because the simp-flags are ignored when calling resimplify, but on the other side this resimplify ensures that we pass a well formed Maxima expression to the code of Maxima. Perhaps a lot of subtle problems migth vanish if we always let the simplifier do the the work. Sorry, because of the long posting. But it might be, that a lot of noun/verb confusion has its origin in not complete implemented noun/verb/alias properties of a lot of functions. E.g. one further known problem is the wrong linear-display of functions which are not fully implemented. I have tested the full implementation of the Exp function with the testsuite. As expected there are no problems. Dieter Kaiser From David.Billinghurst at riotinto.com Mon Jan 5 16:17:52 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Tue, 6 Jan 2009 09:17:52 +1100 Subject: [Maxima] Integral lookup and CLISP References: <20090105133350.GA21535@e15.cs.rochester.edu> Message-ID: <026DCC31AB859648A6F16C0E5CD2580D01789A63@calttsv025.cal.riotinto.org> > From: Dan Gildea > > The defprop macro quotes the lambda expression, but this works: > > > ;; Integral of the Bessel function wrt z > (putprop '%bessel_j > `((n z) > nil > ,(lambda (n unused) > (case n > (0 > ;; integrate(bessel_j(0,z) > ;; = (1/2)*z*(%pi*bessel_j(1,z)*hstruve[0](z) > ;; +bessel_j(0,z)*(2-%pi*hstruve[1](z))) > '((mtimes) ((rat) 1 2) z > ((mplus) > ((mtimes) $%pi ((%bessel_j) 1 z) > ((mqapply) (($hstruve array) 0) z)) > ((mtimes) ((%bessel_j) 0 z) > ((mplus) 2 ((mtimes) -1 $%pi > ((mqapply) (($hstruve array) 1) z))))))) > (1 > ;; integrate(bessel_j(1,z) = -bessel_j(0,z) > '((mtimes) -1 ((%bessel_j) 0 z))) > (otherwise nil)))) > 'integral) Aha!!!! Thank you. I poked around at this for a while last night and was heading (slowly) in a direction that might have found this. I checked in a patch to sin.lisp last night that "solved" the issue in another way. I will do some testing with the above as I preferred my original code. David This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. From shorne at energetiq.com Mon Jan 5 16:22:23 2009 From: shorne at energetiq.com (shorne at energetiq.com) Date: Mon, 5 Jan 2009 17:22:23 -0500 Subject: [Maxima] Features; general comments... a couple suggestions.. In-Reply-To: <3384951C-FC8E-4862-84C3-C368F967C6F0@gmail.com> Message-ID: First -- I don't post very often, though I follow the group in detail and have used maxima for years -- so I hope you'll all forgive the length of this note.. I've been using Maxima (and free math software, in general) for a whole lot of years. In fact I started the sourceforge Maxima site, when Bill Schelter passed away. I'm not by any means a lisp hacker and don't feel qualified to work as a developer -- though I've supported other projects in the past (particularly g77). My own belief is that there are a host of superb free tools to do numerical mathematics. Three that jump to mind are the statistical package R, the matlab clone Octave, and the Scilab package. I have used the latter for many years in many real applications -- not toy problems, but real programs that guided development of hardware that is for sale in the real world. What Maxima brings to the table is explicitly _not_ numerical capabilities. I'm worried a bit that Maxima seems to be experiencing "feature creep" -- that effort is being invested by the community into developing Maxima into a clone of already available tools -- instead of concentrating on those areas where Maxima is unique -- symbolic manipulation. (And, maybe, arbitrary precision numerics... but even that is a stretch, given that the gnu mp package could be hooked to from Scilab... ) I claim that Maxima does not "need" (for instance) a highly developed, native, numerical curve fitting package. However, the development model for Maxima -- a sort of free-for-all -- is actually quite productive. Chaos can be good. One downside of the free-for-all development model is that as feature after feature is added, if there's no ability to easily _build_ an executable with a subset of features, the memory and disk footprint of the system can grow to the point where running it on minimal hardware can become an issue. I've seen requests in the group for versions that might run on tiny hardware -- eg phones, or net appliances. I think it's important to remember that the original MIT Macsyma ran on a computer that was, by todays standards, a digital watch. The linux kernel build process has (I assume it still does? ) front ends that allow a lot of customization. I claim an interesting project, for someone who has a solid architectural knowledge of Maxima, would be a similar build system -- a scheme that would permit customization and optimization for various levels of features, performance, memory footprint, and disk footprint. Functional featues -- If I had my druthers, the single most useful feature that Maxima is missing is something along the lines of the Macsyma taylor_solve. Rationale -- It's very common for a math/physics/EE calculation to boil down to something like f(x,y) = 0, solve for y in terms of x. f(x,y) is often horrid. But it's often possible to find an approximate series expansion -- a polynomial in x and y, valid in some physically interesting region. Solving this for y(x) is a known problem -- newton diagram, puiseux expansions -- but is absolutely non-trivial, and very interesting from both a programming and mathematical point of view. There are a bunch of rather pretty complications to be dealt with. A couple specific instances for where this problem turns up -- Anywhere you have an eigenvalue problem with a parametric dependence - - these come up everywhere. EE -- I had to figure out how to tune an RF generator (via changing frequency) to maintain zero reflected power, in a plasma reactor, with a varying parameter (plasma load impedance). Boiling down the problem via laplace transforms gets you to f(x,y)=0, with f a polynomial in x and y. Something to get started with -- an incomplete and (I believe) buggy version.... I've hacked at this ovre the years, with little success.. http://alamos.math.arizona.edu/~rychlik/577-dir/lecture15.html http://alamos.math.arizona.edu/~rychlik/577-dir/lecture16.html http://alamos.math.arizona.edu/~rychlik/577-dir/puiseux.macsyma Thanks for the bandwidth -- Steve ?iga Lenar?i? Sent by: maxima-bounces at math.utexas.edu 12/31/2008 10:54 AM To maxima at math.utexas.edu cc Subject [Maxima] Fitting in Maxima Maxima is actually lacking a proper fitting facilities (like many other things). lsquares is a poor excuse for a fitting package in many aspects: -slow -complicated to use -unintuitive -cryptic name (should be LeastSquares/least_squares, not lsquares_mse and what not) I think the latter three (if not all four) aspects of lsquares package applies well to a lot of maxima functions, if they even exist (still no ODE integrator or fast numerical linear algebra functions)... Especialy cryptic names are the plague of maxima. What can a user dechipher from 'create_list' and 'makelist'. It makes no sense.. However not to be too critical towards maxima developers (since a lot of problems really originate from 30 years old code, which nobody dares to rewrite), I find the new draw package extremely well designed (esp. compared to plot2d), easy to use and useful (though some names, like "terminal" or "enhanced3d", originating from gnuplot should be translated to meaningful names like "output".) and I really like the fact that new gamma implementations feel like a complete coherent package, naming and functionality-wise. There sadly is no "manual" written for extending maxima, no directions for adding functionality to maxima. I feel if new additions to maxima aren't guided by some central guidance document, different maxima level naming conventions, internal naming conventions, packages doubling or only partially implementing desired featureset ('vect' and 'vector' for instance) will keep maxima being a nonelegant mess of poor implementations (which you must admit in many areas it is). I would really like, somebody wrote such a document with maybe some general plan of maxima features to be added or reimplemented in a better way. Of course I'm not only complaining but I will gladly contribute. I have very little experience with lisp and symbolic computations source code, but have some experience with numerical methods.. I will try to add linear fitting and also nonlinear fitting functionality to maxima via a nice full featured package. I'm also thinking of writing numerical ode solving package, but that's a much tougher task, so maybe in the future. I have a working linear fitting function written in Maxima language and while writing it, many questions regarding adding functionality to Maxima. 1) What is the current naming convenction for new functions in Maxima? It seems that new functions are named in a whole_words_separated_with_underscore. I personally much prefer the Mathematica's CapitalsForEachWord, which is easier to read, easier to type and also leaves more room for user defined variables or functions (which are typically small caps). I understand the need for backwards compatibility, but new conventions could be applied to new functionality easily. I'm glad that at least MATLAB's abrvtdfunnames aren't encouraged, but are sadly very common in maxima. 2) Are there any internal (lisp) naming conventions? Code reuse would benefit from this. 3) When should new functionality be implemented in Maxima language and when in lisp if for instance some problem can be solved in both? 4) Will there be possibility to call compiled numerical libraries (ATLAS ..) from lisp in the future? I know gcl is kinda the limiting factor right now.. I think f2cl conversions of numerical libraries should not be a part of maxima. Especially if the user has to call them with their fortran names. It's better to implement an unoptimised original algorithm in lisp by hand (and tailored to maxima's needs), since f2cl translations do not inherit the speed of original fortran porgrams, neither are they consistent with other maxima code or gain anything. So it's like using fortran without speed, why would you do that? Ideally we should use ATLAS for numerical linear algebra, so speed-wise maxima would be on par with MATLAB and mathematica. Any chance of this becoming reality? 5) List of lists vs matrix : transpose does not work on list of lists, therefore one has to convert list of lists to matrix, transpose and convert back. I don't see what functionality is gained by reprezenting matrices with a 'matrix. In case we use a special construct for matrices, we should at least make something of it. A matrix could carry some useful flags about it's contents: real/ complex, diagonal, symetric, numerical(all elements) ... which would then updated at any operation on matrix and used when solution or a system or eigenvalues are needed for choosing the best algorithm for the job (i.e. if all elements are numeric, the matrix is passed to ATLAS numerical libraries). Transpose should accept also a list of lists. I'd rather see, 'matrix didn't exist since it's more trouble for the user, than what it's worth. 6) There is no real SVD in Maxima? (don't suggest lapack dgesvd) Maybe it should be implemented.. 6) What functionality should Maxima provide regarding function fitting? I intend to write functions with similar calling structure as Mathematicas Fit - linear fitting (via missing SVD) FindFit - nonlinear fitting via levenberg-marq. minimisation (from Numerical Recipes) Suggestions regarding implementation of fitting are welcome! Here is a linear fitting function in maxima language (hey! it works!) and examples: /****** MAXIMA *******/ Fit(data, functionlist, vars) := block( [numer:true,float:true, lambdalist, design_matrix, alpha_matrix, beta_vector, sol, vector_b], lambdalist: map( lambda([what], apply( 'lambda, what) ), makelist( [vars,functionlist[function_index]] , function_index, 1, length(functionlist)) ) , design_matrix: makelist( makelist( apply(lambdalist[function_index], makelist(data[data_index][k], k, 1 , length(vars)) ) , function_index, 1, length(functionlist)) , data_index, 1, length(data)) , vector_b: makelist( data[data_index][length(vars) + 1] , data_index, 1, length(data)) , design_matrix: apply('matrix, design_matrix), alpha_matrix: transpose(design_matrix) . design_matrix, beta_vector: transpose(design_matrix) . vector_b, sol: alpha_matrix^^-1 . beta_vector, sol: subst( '"[", 'matrix , transpose(sol) )[1] , apply("+" , sol * functionlist ) ) $ /* 2d example */ data2d: [ [1, 2, 2] , [ 3, 2, 5], [1, 5, 4], [3, 5, 5],[2,1,3], [-1,0,7]] $ fit2d: Fit( data2d, [1,x,y,x*y], [x,y] ); load(draw) $ draw3d( color = red, point_size = 3, point_type = 7, points(data2d), color = black, explicit( fit2d , x, -1, 4, y, 0, 5) )$ /* 1d example, 1000 points */ dejta: makelist( [float(i/50), sin(i/50)+random(0.2)] , i, 0, 1000), numer$ fit:Fit( dejta, [1, x, sin(x)], [x]); draw2d( color = blue, points(dejta), color = red, explicit( fit, x, dejta[1][1]-1, dejta[length(dejta)][1]+1) ) $ /******** MAXIMA ********/ I would like Fit to use svd instead of ^^-1, since it's more robust, but looks like i have to implement svd first? How and where should svd be implemented in Maxima? hny ?iga Lenar?i? _______________________________________________ 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/20090105/6d439f12/attachment-0001.htm From drdieterkaiser at web.de Mon Jan 5 16:26:54 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 5 Jan 2009 23:26:54 +0100 Subject: [Maxima] Half-angle-simplification of trig functions In-Reply-To: <1230838461.11405.55.camel@dieter-laptop> References: <1230838461.11405.55.camel@dieter-laptop> Message-ID: I have committed the general simplification for half-angles of the trigonometric and hyperbolic functions which works for every real and complex argument. I hope the code will work well. Dieter Kaiser From drdieterkaiser at web.de Mon Jan 5 17:02:51 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 6 Jan 2009 00:02:51 +0100 Subject: [Maxima] Fully simplifiying Exp function In-Reply-To: <1ABDA6D624704FB3BF1149FC72504C3B@Kaiser> References: <1ABDA6D624704FB3BF1149FC72504C3B@Kaiser> Message-ID: <07E57A45A8984A9394F63E33DF6B66EB@Kaiser> Sorry, but the complete $exp function would be of course: (defun $exp (x) (simplify (list '(%exp) (resimplify x)))) Dieter Kaiser From rvh2007 at comcast.net Mon Jan 5 17:20:06 2009 From: rvh2007 at comcast.net (Richard Hennessy) Date: Mon, 5 Jan 2009 18:20:06 -0500 Subject: [Maxima] Features; general comments... a couple suggestions.. References: Message-ID: "a scheme that would permit customization and optimization for various levels of features, performance, memory footprint, and disk footprint." Maxima has the Maxima-init.mac feature. I would not like Maxima as much without it. I have thought that this feature is under supported. A completely customized Maxima would be completely awesome, if it could be done in a init file. Just my thoughts. Rich ----- Original Message ----- From: shorne at energetiq.com To: maxima at math.utexas.edu Sent: Monday, January 05, 2009 5:22 PM Subject: [Maxima] Features; general comments... a couple suggestions.. First -- I don't post very often, though I follow the group in detail and have used maxima for years -- so I hope you'll all forgive the length of this note.. I've been using Maxima (and free math software, in general) for a whole lot of years. In fact I started the sourceforge Maxima site, when Bill Schelter passed away. I'm not by any means a lisp hacker and don't feel qualified to work as a developer -- though I've supported other projects in the past (particularly g77). My own belief is that there are a host of superb free tools to do numerical mathematics. Three that jump to mind are the statistical package R, the matlab clone Octave, and the Scilab package. I have used the latter for many years in many real applications -- not toy problems, but real programs that guided development of hardware that is for sale in the real world. What Maxima brings to the table is explicitly _not_ numerical capabilities. I'm worried a bit that Maxima seems to be experiencing "feature creep" -- that effort is being invested by the community into developing Maxima into a clone of already available tools -- instead of concentrating on those areas where Maxima is unique -- symbolic manipulation. (And, maybe, arbitrary precision numerics... but even that is a stretch, given that the gnu mp package could be hooked to from Scilab... ) I claim that Maxima does not "need" (for instance) a highly developed, native, numerical curve fitting package. However, the development model for Maxima -- a sort of free-for-all -- is actually quite productive. Chaos can be good. One downside of the free-for-all development model is that as feature after feature is added, if there's no ability to easily _build_ an executable with a subset of features, the memory and disk footprint of the system can grow to the point where running it on minimal hardware can become an issue. I've seen requests in the group for versions that might run on tiny hardware -- eg phones, or net appliances. I think it's important to remember that the original MIT Macsyma ran on a computer that was, by todays standards, a digital watch. The linux kernel build process has (I assume it still does? ) front ends that allow a lot of customization. I claim an interesting project, for someone who has a solid architectural knowledge of Maxima, would be a similar build system -- a scheme that would permit customization and optimization for various levels of features, performance, memory footprint, and disk footprint. Functional featues -- If I had my druthers, the single most useful feature that Maxima is missing is something along the lines of the Macsyma taylor_solve. Rationale -- It's very common for a math/physics/EE calculation to boil down to something like f(x,y) = 0, solve for y in terms of x. f(x,y) is often horrid. But it's often possible to find an approximate series expansion -- a polynomial in x and y, valid in some physically interesting region. Solving this for y(x) is a known problem -- newton diagram, puiseux expansions -- but is absolutely non-trivial, and very interesting from both a programming and mathematical point of view. There are a bunch of rather pretty complications to be dealt with. A couple specific instances for where this problem turns up -- Anywhere you have an eigenvalue problem with a parametric dependence - - these come up everywhere. EE -- I had to figure out how to tune an RF generator (via changing frequency) to maintain zero reflected power, in a plasma reactor, with a varying parameter (plasma load impedance). Boiling down the problem via laplace transforms gets you to f(x,y)=0, with f a polynomial in x and y. Something to get started with -- an incomplete and (I believe) buggy version.... I've hacked at this ovre the years, with little success.. http://alamos.math.arizona.edu/~rychlik/577-dir/lecture15.html http://alamos.math.arizona.edu/~rychlik/577-dir/lecture16.html http://alamos.math.arizona.edu/~rychlik/577-dir/puiseux.macsyma Thanks for the bandwidth -- Steve ?iga Lenar?i? Sent by: maxima-bounces at math.utexas.edu 12/31/2008 10:54 AM To maxima at math.utexas.edu cc Subject [Maxima] Fitting in Maxima Maxima is actually lacking a proper fitting facilities (like many other things). lsquares is a poor excuse for a fitting package in many aspects: -slow -complicated to use -unintuitive -cryptic name (should be LeastSquares/least_squares, not lsquares_mse and what not) I think the latter three (if not all four) aspects of lsquares package applies well to a lot of maxima functions, if they even exist (still no ODE integrator or fast numerical linear algebra functions)... Especialy cryptic names are the plague of maxima. What can a user dechipher from 'create_list' and 'makelist'. It makes no sense.. However not to be too critical towards maxima developers (since a lot of problems really originate from 30 years old code, which nobody dares to rewrite), I find the new draw package extremely well designed (esp. compared to plot2d), easy to use and useful (though some names, like "terminal" or "enhanced3d", originating from gnuplot should be translated to meaningful names like "output".) and I really like the fact that new gamma implementations feel like a complete coherent package, naming and functionality-wise. There sadly is no "manual" written for extending maxima, no directions for adding functionality to maxima. I feel if new additions to maxima aren't guided by some central guidance document, different maxima level naming conventions, internal naming conventions, packages doubling or only partially implementing desired featureset ('vect' and 'vector' for instance) will keep maxima being a nonelegant mess of poor implementations (which you must admit in many areas it is). I would really like, somebody wrote such a document with maybe some general plan of maxima features to be added or reimplemented in a better way. Of course I'm not only complaining but I will gladly contribute. I have very little experience with lisp and symbolic computations source code, but have some experience with numerical methods.. I will try to add linear fitting and also nonlinear fitting functionality to maxima via a nice full featured package. I'm also thinking of writing numerical ode solving package, but that's a much tougher task, so maybe in the future. I have a working linear fitting function written in Maxima language and while writing it, many questions regarding adding functionality to Maxima. 1) What is the current naming convenction for new functions in Maxima? It seems that new functions are named in a whole_words_separated_with_underscore. I personally much prefer the Mathematica's CapitalsForEachWord, which is easier to read, easier to type and also leaves more room for user defined variables or functions (which are typically small caps). I understand the need for backwards compatibility, but new conventions could be applied to new functionality easily. I'm glad that at least MATLAB's abrvtdfunnames aren't encouraged, but are sadly very common in maxima. 2) Are there any internal (lisp) naming conventions? Code reuse would benefit from this. 3) When should new functionality be implemented in Maxima language and when in lisp if for instance some problem can be solved in both? 4) Will there be possibility to call compiled numerical libraries (ATLAS ..) from lisp in the future? I know gcl is kinda the limiting factor right now.. I think f2cl conversions of numerical libraries should not be a part of maxima. Especially if the user has to call them with their fortran names. It's better to implement an unoptimised original algorithm in lisp by hand (and tailored to maxima's needs), since f2cl translations do not inherit the speed of original fortran porgrams, neither are they consistent with other maxima code or gain anything. So it's like using fortran without speed, why would you do that? Ideally we should use ATLAS for numerical linear algebra, so speed-wise maxima would be on par with MATLAB and mathematica. Any chance of this becoming reality? 5) List of lists vs matrix : transpose does not work on list of lists, therefore one has to convert list of lists to matrix, transpose and convert back. I don't see what functionality is gained by reprezenting matrices with a 'matrix. In case we use a special construct for matrices, we should at least make something of it. A matrix could carry some useful flags about it's contents: real/ complex, diagonal, symetric, numerical(all elements) ... which would then updated at any operation on matrix and used when solution or a system or eigenvalues are needed for choosing the best algorithm for the job (i.e. if all elements are numeric, the matrix is passed to ATLAS numerical libraries). Transpose should accept also a list of lists. I'd rather see, 'matrix didn't exist since it's more trouble for the user, than what it's worth. 6) There is no real SVD in Maxima? (don't suggest lapack dgesvd) Maybe it should be implemented.. 6) What functionality should Maxima provide regarding function fitting? I intend to write functions with similar calling structure as Mathematicas Fit - linear fitting (via missing SVD) FindFit - nonlinear fitting via levenberg-marq. minimisation (from Numerical Recipes) Suggestions regarding implementation of fitting are welcome! Here is a linear fitting function in maxima language (hey! it works!) and examples: /****** MAXIMA *******/ Fit(data, functionlist, vars) := block( [numer:true,float:true, lambdalist, design_matrix, alpha_matrix, beta_vector, sol, vector_b], lambdalist: map( lambda([what], apply( 'lambda, what) ), makelist( [vars,functionlist[function_index]] , function_index, 1, length(functionlist)) ) , design_matrix: makelist( makelist( apply(lambdalist[function_index], makelist(data[data_index][k], k, 1 , length(vars)) ) , function_index, 1, length(functionlist)) , data_index, 1, length(data)) , vector_b: makelist( data[data_index][length(vars) + 1] , data_index, 1, length(data)) , design_matrix: apply('matrix, design_matrix), alpha_matrix: transpose(design_matrix) . design_matrix, beta_vector: transpose(design_matrix) . vector_b, sol: alpha_matrix^^-1 . beta_vector, sol: subst( '"[", 'matrix , transpose(sol) )[1] , apply("+" , sol * functionlist ) ) $ /* 2d example */ data2d: [ [1, 2, 2] , [ 3, 2, 5], [1, 5, 4], [3, 5, 5],[2,1,3], [-1,0,7]] $ fit2d: Fit( data2d, [1,x,y,x*y], [x,y] ); load(draw) $ draw3d( color = red, point_size = 3, point_type = 7, points(data2d), color = black, explicit( fit2d , x, -1, 4, y, 0, 5) )$ /* 1d example, 1000 points */ dejta: makelist( [float(i/50), sin(i/50)+random(0.2)] , i, 0, 1000), numer$ fit:Fit( dejta, [1, x, sin(x)], [x]); draw2d( color = blue, points(dejta), color = red, explicit( fit, x, dejta[1][1]-1, dejta[length(dejta)][1]+1) ) $ /******** MAXIMA ********/ I would like Fit to use svd instead of ^^-1, since it's more robust, but looks like i have to implement svd first? How and where should svd be implemented in Maxima? hny ?iga Lenar?i? _______________________________________________ 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/20090105/ca3adc66/attachment-0001.htm From rvh2007 at comcast.net Mon Jan 5 17:45:45 2009 From: rvh2007 at comcast.net (Richard Hennessy) Date: Mon, 5 Jan 2009 18:45:45 -0500 Subject: [Maxima] pw 2.5 is ready References: , <34F42187F8484081802856C8835FCC2B@RichDesktop> Message-ID: "The bug has nothing to do with being at an endpoint, by the way:" Maybe you are right and pw.mac is not ready for share/contrib yet. Rich From macrakis at alum.mit.edu Mon Jan 5 18:01:42 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 5 Jan 2009 19:01:42 -0500 Subject: [Maxima] Fully simplifiying Exp function In-Reply-To: <07E57A45A8984A9394F63E33DF6B66EB@Kaiser> References: <1ABDA6D624704FB3BF1149FC72504C3B@Kaiser> <07E57A45A8984A9394F63E33DF6B66EB@Kaiser> Message-ID: <8b356f880901051601g501c47acj9455d87b6ff2f8f@mail.gmail.com> It seems to me that the only time resimplify (which forces simp to ignore existing simp flags) is appropriate is if you know something has changed (assumptions, global variables, etc.) since an object was last simplified. It is a very specialized function and should rarely be used. The only case I can think of in the general simplifier where it *might* be appropriate is in the simplifier for MCOND: if a>0 then abs(a) should resimplify abs(a) with the assumption that a>0. Otherwise, if the argument is already simplified, it should remain untouched; if it is not simplified, the outer 'simplify' should take care of simplifying it. This is not innocuous. Adding resimplify's all over the code can make the simplifier run in exponential time, if all subexpressions are resimplified at every level. Less dramatically, an extra, unnecessary, round of simplification was what changed the set functions from O(n) to O(n log n) (a bug which has been fixed). -s On Mon, Jan 5, 2009 at 6:02 PM, Dieter Kaiser wrote: > Sorry, but the complete $exp function would be of course: > > (defun $exp (x) > (simplify (list '(%exp) (resimplify x)))) > > Dieter Kaiser > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From rvh2007 at comcast.net Mon Jan 5 18:49:23 2009 From: rvh2007 at comcast.net (Richard Hennessy) Date: Mon, 5 Jan 2009 19:49:23 -0500 Subject: [Maxima] More functions for pw. References: <43EA202CE0FB4649B039FC3A24A9CDDF@RichDesktop> Message-ID: <1FD9F1AD930A41858160F9F6E97A04E2@RichDesktop> I think I must be completely on my own with this. No one has an opinion... Rich ----- Original Message ----- From: "Richard Hennessy" To: "Maxima List" Sent: Monday, January 05, 2009 5:21 AM Subject: [Maxima] More functions for pw. Does anyone have an opinion whether I should create a Fourier series command for piecewise functions? I haven't tested the fourie package recently but when I last checked it did not work for piecewise functions. I was thinking pwfourier(pw(L,x),x) a(0)=... a(n) = ... b(n) = ... and pwfourier_transform(pw(L,x),x) -> some complicated function. I already have written the code for it. Rich _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From toy.raymond at gmail.com Mon Jan 5 20:08:34 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 05 Jan 2009 21:08:34 -0500 Subject: [Maxima] More functions for pw. In-Reply-To: <1FD9F1AD930A41858160F9F6E97A04E2@RichDesktop> References: <43EA202CE0FB4649B039FC3A24A9CDDF@RichDesktop> <1FD9F1AD930A41858160F9F6E97A04E2@RichDesktop> Message-ID: <4962BD22.9010501@gmail.com> Richard Hennessy wrote: > I think I must be completely on my own with this. No one has an opinion... > Go for it if the current package can't do it or if you're interested in doing it. But don't expect opinions in a few hours. Some people might be asleep :-) or otherwise occupied. Ray From toy.raymond at gmail.com Mon Jan 5 22:22:16 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 05 Jan 2009 23:22:16 -0500 Subject: [Maxima] Fitting in Maxima In-Reply-To: References: <3384951C-FC8E-4862-84C3-C368F967C6F0@gmail.com> <495E2543.9030301@gmail.com> <495E93AC.80806@gmail.com> Message-ID: <4962DC78.3070701@gmail.com> Michel Talon wrote: > Raymond Toy wrote: > > >> Michel Talon wrote: >> >>> Raymond Toy wrote: >>> >>> >>> >>> >> Ok. I see that colnew tickles a couple of bugs in f2cl. Those are >> fixed now. After adding a couple of missing linpack routines and a >> small compatibility file, it all compiles. >> > > Fantastic! > > >> So, do you have a simple test program that I can use to check to see if >> the conversion actually works? >> > > In my work i have used colnew as embedded in scilab, where it is called > bvode. The man page can be found here > http://www.scilab.org/doc/manual/Docu-html659.html > and contains simple examples. > I was hoping to find something a little simpler than that. But nevermind. I found 3 Fortran test cases from TOMS 569, and test case 1 seems to pass. Hurray! Not sure if this can be added to maxima or not. Although colnew is different, it seems that it might be based on TOMS 569, and we definitely don't have permission to use TOMS algorithms. (I asked the ACM once. Never got an answer.) Ray From David.Billinghurst at riotinto.com Mon Jan 5 22:47:49 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Tue, 6 Jan 2009 15:47:49 +1100 Subject: [Maxima] Integral lookup and CLISP References: <20090105133350.GA21535@e15.cs.rochester.edu> Message-ID: <026DCC31AB859648A6F16C0E5CD2580D01789ACA@calttsv025.cal.riotinto.org> > From: David Billinghurst > > > From: Dan Gildea > > > > The defprop macro quotes the lambda expression, but this works: > > > > > > ;; Integral of the Bessel function wrt z > > (putprop '%bessel_j > > `((n z) > > nil > > ,(lambda (n unused) > > (case n > > (0 > > ;; integrate(bessel_j(0,z) > > ;; = (1/2)*z*(%pi*bessel_j(1,z)*hstruve[0](z) > > ;; +bessel_j(0,z)*(2-%pi*hstruve[1](z))) > > '((mtimes) ((rat) 1 2) z > > ((mplus) > > ((mtimes) $%pi ((%bessel_j) 1 z) > > ((mqapply) (($hstruve array) 0) z)) > > ((mtimes) ((%bessel_j) 0 z) > > ((mplus) 2 ((mtimes) -1 $%pi > > ((mqapply) (($hstruve array) 1) z))))))) > > (1 > > ;; integrate(bessel_j(1,z) = -bessel_j(0,z) > > '((mtimes) -1 ((%bessel_j) 0 z))) > > (otherwise nil)))) > > 'integral) > > Aha!!!! Thank you. I poked around at this for a while last > night and was heading (slowly) in a direction that might have > found this. > > I checked in a patch to sin.lisp last night that "solved" the > issue in another way. I will do some testing with the above > as I preferred my original code. It took me a while to realize that you had used the "putprop" function to avoid the quoting issues with the "defprop" macro. The form above works with my original INTEGRALLOOKUPS code using gcl, clisp and sbcl. Thanks again. This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. From robert.dodier at gmail.com Tue Jan 6 00:26:12 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 5 Jan 2009 23:26:12 -0700 Subject: [Maxima] Fully simplifiying Exp function In-Reply-To: <1ABDA6D624704FB3BF1149FC72504C3B@Kaiser> References: <1ABDA6D624704FB3BF1149FC72504C3B@Kaiser> Message-ID: Dieter, Thanks for looking into this topic. I'm in favor of changing %EXP to act like %SIN, %ERF, etc. I'll take this opportunity to second the remark by Stavros, that you should be careful about when to call the simplifier. best Robert From robert.dodier at gmail.com Tue Jan 6 00:36:57 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 5 Jan 2009 23:36:57 -0700 Subject: [Maxima] Features; general comments... a couple suggestions.. In-Reply-To: References: <3384951C-FC8E-4862-84C3-C368F967C6F0@gmail.com> Message-ID: Steve, thanks for your message. I'm glad to hear from you. On 1/5/09, shorne at energetiq.com wrote: > What Maxima brings to the table is explicitly _not_ numerical capabilities. With all due respect, I think you're mistaken. Combining symbolic and numerical functions makes Maxima much more powerful than either capability alone. > However, the development model for Maxima -- a sort of free-for-all > -- is actually quite productive. Seems to work OK in practice ... and in any event, there is nobody here in a position to give orders. > I claim an interesting project, for someone who has a solid > architectural knowledge of Maxima, would be a similar build system > -- a scheme that would permit customization and optimization for > various levels of features, performance, memory footprint, > and disk footprint. I think that's a great idea. I hope someone will work on it. > Something to get started with -- > an incomplete and (I believe) buggy version.... > I've hacked at this ovre the years, with little success.. Seems like an interesting problem -- code to solve it could be generally useful. Keep us posted as you progress. Maybe someone will be inspired to work on it too. best Robert Dodier From DrDieterKaiser at web.de Tue Jan 6 04:05:36 2009 From: DrDieterKaiser at web.de (Dieter Kaiser) Date: Tue, 06 Jan 2009 11:05:36 +0100 Subject: [Maxima] Fully simplifiying Exp function Message-ID: <278025976@web.de> Hello Stavros, thank you very much for your comment. I was focussed on the implementation of the $function like it was done for the Bessel functions. There we have a resimplify. In this case the resimplify was necessary, because the $function was directly called by the Maxima simplifier. But when we have a fully implemented function with noun/verb/alias the $function is no longer called by the simplifier. The noun/verb/alias property has been recently added to the Bessel functions. The $function can now be used as proposed for a Lisp call to the simplifier. The resimplify is no longer needed. And we can implement the $function like: (defun $exp (x) (simplify (list '(%exp) x))). Thus the $function can be used as a shortform for a call to the simplifier from Lisp code. Perhaps it is a nice convention to support the $function for functions with noun/verb/alias in this way to have a readable form for a call to the simplifier. Your comment helped me to see this point much better. I will have again a look at the code to prove the implemented $functions. Dieter Kaiser __________________________________________________________________ Deutschlands gr??te Online-Videothek schenkt Ihnen 12.000 Videos!* http://entertainment.web.de/de/entertainment/maxdome/index.html From ferriste at gmail.com Tue Jan 6 04:17:01 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Tue, 06 Jan 2009 11:17:01 +0100 Subject: [Maxima] Half-angle-simplification of trig functions In-Reply-To: <1230838461.11405.55.camel@dieter-laptop> References: <1230838461.11405.55.camel@dieter-laptop> Message-ID: <49632F9D.60100@gmail.com> In your code there are some "assume" in wich you used integer multiples of %pi, like (assume(x1>0,x1<2*%pi),done); did it work correctly? You said > Remark: Better would be %pi as upper limit, but this does not work! > Is this related to known problems with assume? Your code needs to bound variables within multiples of %pi, are the problems you mentioned the ones reported here? http://sourceforge.net/tracker/index.php?func=detail&aid=2477795&group_id=4933&atid=104933 I reported this as a bug (if it is a bug, but I think so...) Stefano From rvh2007 at comcast.net Tue Jan 6 04:55:42 2009 From: rvh2007 at comcast.net (Richard Hennessy) Date: Tue, 6 Jan 2009 05:55:42 -0500 Subject: [Maxima] More functions for pw. References: <43EA202CE0FB4649B039FC3A24A9CDDF@RichDesktop> <1FD9F1AD930A41858160F9F6E97A04E2@RichDesktop> <4962BD22.9010501@gmail.com> Message-ID: I frequently get no response at all. I don't like to ask again.... Thanks for the feedback. I will go for it, I think. Seems like it could be fun. Rich ----- Original Message ----- From: "Raymond Toy" To: "Richard Hennessy" Cc: "Maxima List" Sent: Monday, January 05, 2009 9:08 PM Subject: Re: [Maxima] More functions for pw. Richard Hennessy wrote: > I think I must be completely on my own with this. No one has an opinion... > Go for it if the current package can't do it or if you're interested in doing it. But don't expect opinions in a few hours. Some people might be asleep :-) or otherwise occupied. Ray From willisb at unk.edu Tue Jan 6 06:41:01 2009 From: willisb at unk.edu (Barton Willis) Date: Tue, 6 Jan 2009 06:41:01 -0600 Subject: [Maxima] test failures in arag_test Message-ID: With CVS Maxima, I get 17 failures from arag_test (in the share testsuite). Each failure seems to be related to make_array. Are these bugs related to the recent changes to ar.lisp or marray.lisp? Here is one bug: Running tests in arag_test: ********************** Problem 2 *************** Input: list2poly(getCoeffFromNewton([3, 0, 2, 0]), x) Result: Wrong number of arguments to make_array error-catch This differed from the expected result: 3 x - x There are bugs with tests 2 4 5 6 13 31 32 33 34 35 36 37 39 40 41 42 43. Barton From toy.raymond at gmail.com Tue Jan 6 06:44:01 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 06 Jan 2009 07:44:01 -0500 Subject: [Maxima] Fully simplifiying Exp function In-Reply-To: <278025976@web.de> References: <278025976@web.de> Message-ID: <49635211.1030900@gmail.com> Dieter Kaiser wrote: > Hello Stavros, > > thank you very much for your comment. > > I was focussed on the implementation of the $function like it was done > for the Bessel functions. There we have a resimplify. In this case the > I wouldn't necessarily use the Bessel function implementation as a guide on how to do things. I wrote those a while back without really understanding how everything fit together. I think I modeled the work on the trig functions. Ray From luigi_marino2 at alice.it Tue Jan 6 02:11:19 2009 From: luigi_marino2 at alice.it (Luigi Marino) Date: Tue, 6 Jan 2009 09:11:19 +0100 Subject: [Maxima] Maxima routine for False Position Method. Message-ID: Hallo Alexey I send my work on bisection metod with Maxima 5.17.1 Best wishes. Luigi Marino. Enter the two block separately: segno(x):=block([], if x=0 then return(0) else (if x>0 then return(1) else return(-1) ) )$ bisez(funz,var,a,b,eps,numiter):=block([fa,fb,fc,c,l,k], define(f(var),funz), fa:f(a), fb:f(b), l:abs(b-a), k:0, if segno(fa)#segno(fb) then do ( k:k+1, l:l/2.0, c:ev(a+(b-a)/2.0,float), fc:f(c), if (fc=0.0 or lnumiter) then (print("c=",c," in ",k," iterazioni"), return(fine)) else (if (segno(fa)*segno(fc)>0) then (a:c, fa:fc) else (b:c, fb:fc) ) ))$ Example: m:log(x+1)-1/2*x^2+0.6; bisez(m,x,1.0,2.0,0.000001,100); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090106/62470d77/attachment.htm From macrakis at alum.mit.edu Tue Jan 6 11:09:47 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 6 Jan 2009 12:09:47 -0500 Subject: [Maxima] Functions and simplification WAS: Fully simplifiying Exp function Message-ID: <8b356f880901060909v421e05fft1b9751f5f9e3cf50@mail.gmail.com> I don't think our rules for when to call simplification etc. are documented anywhere. Here's a first try. -s 1) All routines callable from the Maxima level (namely, all $xxx functions) should assume that their arguments are simplified but may return unsimplified results. MEVAL takes care of simplifying arguments and simplifying results as necessary. When constructing algebraic expressions, they should preferably use add, mul, etc. which take care of simplification; or they can construct algebraic expressions *without* simp flags and call simplifya. They should *not* create expressions with a SIMP flag explicitly except for constants (e.g. ((mtimes simp) 2 $%pi)). 2) Within Lisp code, in general functions can assume that their arguments are simplified and should return simplified results. That is the best convention, but some existing packages may have other conventions. 3) Functions and routines should never explicitly check $SIMP and DOSIMP -- those flags should be handled only by the top-level simplifying functions. Functions and routines should not call resimplify or ssimplifya except in very special circumstances. 4) Simplifying functions (simp-%xxx) work differently from other routines. They always take three arguments, conventionally called (form vestigial simp-flag) or the like. The first argument is the full form ((%xxx)...) to be simplified. The second argument is ignored. The third argument, if T, means that the *arguments* of form are already simplified; if NIL, means that cannot be assumed to be simplified, and (simplifya arg nil) should be called on them. Arguments to %xxx may also be special forms (CRE etc.). But you don't need to know all those details: simply call (simpcheck simp-flag) on each argument before doing anything else. 5) In general, Maxima and Lisp code *cannot* be assumed to work correctly when SIMP = NIL. From adammaj1 at o2.pl Tue Jan 6 11:37:20 2009 From: adammaj1 at o2.pl (Adam Majewski) Date: Tue, 06 Jan 2009 18:37:20 +0100 Subject: [Maxima] memory Message-ID: Hi, I use : wxMaxima 0.7.6 http://wxmaxima.sourceforge.net Maxima 5.16.3 http://maxima.sourceforge.net Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 I have found : "GCL is one of the oldest Lisp systems still in use, and as such has served as the basis for large lisp applications when computers were much more limited than they are today, particularly in terms of available memory. Considerable effort was therefore made in the past to keep the memory image as small as possible. As of the present time, the GCL team has not tuned the default memory allocation scheme to be more in line with modern systems. One can therefore often get significant performance increases by preallocating memory" I try to increase Maxima memory. I have not found any Maima commands so I try lisp : to_lisp(); (room) (progn (si::allocate 'cons 10000 t) (si::allocate 'fixnum 200 t) (si::allocate 'symbol 100 t) (si::allocate-relocatable-pages 2000 t) (si::allocate 'cfun 1000 t)) (si::allocate 'string 2000 t) What do you think about it ? How to find maximal values of avilable memory ? I have tried : (defun testmem (size) (ignore-errors (loop for i upfrom 1 collect (make-array size)))) (testmem 10000) with no result. Regards Adam From O.Kullmann at swansea.ac.uk Tue Jan 6 11:37:55 2009 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Tue, 6 Jan 2009 17:37:55 +0000 Subject: [Maxima] Problem with Maxima 5.17.1 and ECL 8.12.0 In-Reply-To: <20090106165856.GR31658@cs-wsok.swansea.ac.uk> References: <20081217205641.GZ8768@cs-wsok.swansea.ac.uk> <20081217211304.GA8768@cs-wsok.swansea.ac.uk> <20081230164829.GA14686@cs-wsok.swansea.ac.uk> <495A5DCA.7000901@gmail.com> <20081230182040.GC31658@cs-wsok.swansea.ac.uk> <20081230184522.GA13872@cs-wsok.swansea.ac.uk> <20090106165856.GR31658@cs-wsok.swansea.ac.uk> Message-ID: <20090106173755.GS31658@cs-wsok.swansea.ac.uk> Forgot to copy this to the maxima mailing list, so here it is (two test failures of Maxima from CVS with Ecl 8.12.0, and problem finding the documentation). Meanwhile I found the problem with the apparently missing documentation (and other broken links): What used to be installed: 5.17.1/share/maxima/5.17.1 has now been renamed: 5.17.1/share/maxima/5.17post This seems quite unfortunate to me: Is this only temporary? Or what are the precise rules for the naming of this directory? I cannot imagine any good reason to switch from the well-defined old naming scheme to this currently undefined new naming scheme (what is "not post"?), which just creates unnecessary trouble (now a little script has to be written, to make the case distinction between "post" and "non-post"). I hope this issue can be clarified. Oliver On Tue, Jan 06, 2009 at 04:58:56PM +0000, Oliver Kullmann wrote: > Hello, > > I got it now installing, but still problems: Some test > failures (with Ecl), and where's the html-documentation? > > The test failures are: > > Running tests in rtest14: > ********************** Problem 139 *************** > Input: > closeto(AS_10_4_17(- 10), 1.e-15) > > > Result: > 2 20 sqrt(10) 2 20 sqrt(10) > 10 (bessel_j(- -, -----------) - bessel_j(-, -----------)) > 3 3 3 3 > ---------------------------------------------------------- + airy_dai(- 10) > 3 > > This differed from the expected result: > true > > 293/294 tests passed (not counting 2 expected errors). > > The following 1 problem failed: (139) > > > Running tests in rtest_gamma: > ********************** Problem 592 *************** > Input: > relerror(fresnel_s(%i + 5.0), > 3.84389093777759513198736581956757227475265101347572827364567521b4 %i > - 2.044525505063210590493330126425293361797143144299005524393297869b5, 2.e-14) > > > Result: > 2.542490092925679718842752779534059543174617462409733517737362792b-14 > > This differed from the expected result: > true > > ********************** Problem 614 *************** > Input: > relerror(fresnel_c(%i + 5.0), > 2.044530505063119004499308897858846121088557663560705550579996093b5 %i > + 3.84394093777740143202918713550472184235160647415045418329908291b4, 2.e-14) > > > Result: > 2.545880046763412762594157711951056394921468040249292492237741923b-14 > > This differed from the expected result: > true > > 614/616 tests passed. > > The following 2 problems failed: (592 614) > > ------------- > > Regarding the documentation: It used to be in > > 5.17.1/share/maxima/5.17.1/doc/ > > but this is now (using the CVS-maxima version and boostrap) > apparently no longer build? > > Oliver > > > > On Tue, Dec 30, 2008 at 01:58:38PM -0700, Robert Dodier wrote: > > Looking at the CVS logs for src/numth.lisp and src/rat3c.lisp, > > I see that the $JACOBI stuff was applied after 5.17.1 was tagged. > > However those changes have been applied to both the 5.17 branch > > (on Dec 21) and the main trunk (on Dec 25). > > > > On 12/30/08, Oliver Kullmann wrote: > > > > > Some more attempts: > > > > > > Since I don't know how to update the 5.17.1-distribution > > > (it doesn't match what you find in CVS) I did the following: > > > > I can't tell what would be the outcome of the steps which you described. > > My advice is to start clean (do not try to update or modify an > > existing installation) and try one of the following: > > > > 5.17 branch: > > > > $ cvs -d co -rRELEASE-5_17-BRANCH maxima > > > > CVS head: > > > > $ cvs -d co maxima > > > > and then > > > > $ sh bootstrap > > $ LDFLAGS=-Wl,-rpath=/usr/local/lib ./configure --enable-ecl > > $ make > > > > It might be possible to omit LDFLAGS, I don't know. > > > > Hope this helps, > > > > Robert > From O.Kullmann at swansea.ac.uk Tue Jan 6 11:58:35 2009 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Tue, 6 Jan 2009 17:58:35 +0000 Subject: [Maxima] Problem with Maxima 5.17.1 and ECL 8.12.0 In-Reply-To: <20090106173755.GS31658@cs-wsok.swansea.ac.uk> References: <20081217205641.GZ8768@cs-wsok.swansea.ac.uk> <20081217211304.GA8768@cs-wsok.swansea.ac.uk> <20081230164829.GA14686@cs-wsok.swansea.ac.uk> <495A5DCA.7000901@gmail.com> <20081230182040.GC31658@cs-wsok.swansea.ac.uk> <20081230184522.GA13872@cs-wsok.swansea.ac.uk> <20090106165856.GR31658@cs-wsok.swansea.ac.uk> <20090106173755.GS31658@cs-wsok.swansea.ac.uk> Message-ID: <20090106175835.GT31658@cs-wsok.swansea.ac.uk> Regarding the problem of "5.17.1/share/maxima/5.17.1" versus "5.17.1/share/maxima/5.17post": Perhaps this is just an artefact of using the CVS-version (and boostrapping it)? In a clisp-installation of plain 5.17.1 one finds the good old 5.17.1/share/maxima/5.17.1. If this is the case (and with the next distribution we again have "5.xx.yy/share/maxima/5.xx.yy", then that's not a problem for me (for my build system this is just a (recursive) make-variable, which I can override). Oliver On Tue, Jan 06, 2009 at 05:37:55PM +0000, Oliver Kullmann wrote: > Forgot to copy this to the maxima mailing list, so here > it is (two test failures of Maxima from CVS with Ecl 8.12.0, > and problem finding the documentation). > > Meanwhile I found the problem with the apparently missing documentation > (and other broken links): > > What used to be installed: > 5.17.1/share/maxima/5.17.1 > has now been renamed: > 5.17.1/share/maxima/5.17post > > This seems quite unfortunate to me: Is this only temporary? > Or what are the precise rules for the naming of this directory? > I cannot imagine any good reason to switch from the well-defined > old naming scheme to this currently undefined new naming scheme (what > is "not post"?), which just creates unnecessary trouble (now a little > script has to be written, to make the case distinction between > "post" and "non-post"). > > I hope this issue can be clarified. > > Oliver > > > > On Tue, Jan 06, 2009 at 04:58:56PM +0000, Oliver Kullmann wrote: > > Hello, > > > > I got it now installing, but still problems: Some test > > failures (with Ecl), and where's the html-documentation? > > > > The test failures are: > > > > Running tests in rtest14: > > ********************** Problem 139 *************** > > Input: > > closeto(AS_10_4_17(- 10), 1.e-15) > > > > > > Result: > > 2 20 sqrt(10) 2 20 sqrt(10) > > 10 (bessel_j(- -, -----------) - bessel_j(-, -----------)) > > 3 3 3 3 > > ---------------------------------------------------------- + airy_dai(- 10) > > 3 > > > > This differed from the expected result: > > true > > > > 293/294 tests passed (not counting 2 expected errors). > > > > The following 1 problem failed: (139) > > > > > > Running tests in rtest_gamma: > > ********************** Problem 592 *************** > > Input: > > relerror(fresnel_s(%i + 5.0), > > 3.84389093777759513198736581956757227475265101347572827364567521b4 %i > > - 2.044525505063210590493330126425293361797143144299005524393297869b5, 2.e-14) > > > > > > Result: > > 2.542490092925679718842752779534059543174617462409733517737362792b-14 > > > > This differed from the expected result: > > true > > > > ********************** Problem 614 *************** > > Input: > > relerror(fresnel_c(%i + 5.0), > > 2.044530505063119004499308897858846121088557663560705550579996093b5 %i > > + 3.84394093777740143202918713550472184235160647415045418329908291b4, 2.e-14) > > > > > > Result: > > 2.545880046763412762594157711951056394921468040249292492237741923b-14 > > > > This differed from the expected result: > > true > > > > 614/616 tests passed. > > > > The following 2 problems failed: (592 614) > > > > ------------- > > > > Regarding the documentation: It used to be in > > > > 5.17.1/share/maxima/5.17.1/doc/ > > > > but this is now (using the CVS-maxima version and boostrap) > > apparently no longer build? > > > > Oliver > > > > > > > > On Tue, Dec 30, 2008 at 01:58:38PM -0700, Robert Dodier wrote: > > > Looking at the CVS logs for src/numth.lisp and src/rat3c.lisp, > > > I see that the $JACOBI stuff was applied after 5.17.1 was tagged. > > > However those changes have been applied to both the 5.17 branch > > > (on Dec 21) and the main trunk (on Dec 25). > > > > > > On 12/30/08, Oliver Kullmann wrote: > > > > > > > Some more attempts: > > > > > > > > Since I don't know how to update the 5.17.1-distribution > > > > (it doesn't match what you find in CVS) I did the following: > > > > > > I can't tell what would be the outcome of the steps which you described. > > > My advice is to start clean (do not try to update or modify an > > > existing installation) and try one of the following: > > > > > > 5.17 branch: > > > > > > $ cvs -d co -rRELEASE-5_17-BRANCH maxima > > > > > > CVS head: > > > > > > $ cvs -d co maxima > > > > > > and then > > > > > > $ sh bootstrap > > > $ LDFLAGS=-Wl,-rpath=/usr/local/lib ./configure --enable-ecl > > > $ make > > > > > > It might be possible to omit LDFLAGS, I don't know. > > > > > > Hope this helps, > > > > > > Robert > > From O.Kullmann at swansea.ac.uk Tue Jan 6 13:47:24 2009 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Tue, 6 Jan 2009 19:47:24 +0000 Subject: [Maxima] other test failures with current Maxima Message-ID: <20090106194724.GX31658@cs-wsok.swansea.ac.uk> Hello, I've reported on the test failures with current (CVS) maxima and ecl. Now with clisp these two failures don't show up, but I get another error: Running tests in rtest_gamma: ********************** Problem 354 *************** Input: relerror(gamma_incomplete(0.5, 0.1 %i - 2.5), 1.00288947695445 - 9.842709236689227 %i, 1.0E-15) Result: 1.105194365996218E-15 This differed from the expected result: true 615/616 tests passed. The following 1 problem failed: (354) Just to mention (perhaps this is all known, but I thought it can't hurt to report it). Oliver From drdieterkaiser at web.de Tue Jan 6 14:29:26 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 6 Jan 2009 21:29:26 +0100 Subject: [Maxima] test failures in arag_test In-Reply-To: References: Message-ID: <7582536CBF514D7AB92A917E1DC06556@Kaiser> Hello Barton, That was my mistake. I have committed a type check for the dimension list of make_array and unfortunately, I have added code to ensure at minium one dimension. This was wrong. So the code now does more than needed. Dieter Kaiser -----Urspr?ngliche Nachricht----- Von: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] Im Auftrag von Barton Willis Gesendet: Dienstag, 6. Januar 2009 13:41 An: maxima at math.utexas.edu Betreff: [Maxima] test failures in arag_test With CVS Maxima, I get 17 failures from arag_test (in the share testsuite). Each failure seems to be related to make_array. Are these bugs related to the recent changes to ar.lisp or marray.lisp? Here is one bug: Running tests in arag_test: ********************** Problem 2 *************** Input: list2poly(getCoeffFromNewton([3, 0, 2, 0]), x) Result: Wrong number of arguments to make_array error-catch This differed from the expected result: 3 x - x There are bugs with tests 2 4 5 6 13 31 32 33 34 35 36 37 39 40 41 42 43. Barton _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From drdieterkaiser at web.de Tue Jan 6 14:37:41 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 6 Jan 2009 21:37:41 +0100 Subject: [Maxima] Half-angle-simplification of trig functions In-Reply-To: <49632F9D.60100@gmail.com> References: <1230838461.11405.55.camel@dieter-laptop> <49632F9D.60100@gmail.com> Message-ID: Hello Stefano, Yes I think it is the same problem. If I use an intervall (0,2*%pi) the simplification of sin(x/2) works well. If I use an intervall (0,%pi) the simplifcation of cos(x/2) works well. But now the simplification of sin(x/2) fails. If I use an intervall (0,3.0) both simplifications works well. I think this is a bug of assume with %pi as a value. I do not know the reason of the bug. I will have a deeper look into the code to find it. Dieter Kaiser -----Urspr?ngliche Nachricht----- Von: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] Im Auftrag von Stefano Ferri Gesendet: Dienstag, 6. Januar 2009 11:17 An: maxima at math.utexas.edu Betreff: Re: [Maxima] Half-angle-simplification of trig functions In your code there are some "assume" in wich you used integer multiples of %pi, like (assume(x1>0,x1<2*%pi),done); did it work correctly? You said > Remark: Better would be %pi as upper limit, but this does not work! > Is this related to known problems with assume? Your code needs to bound variables within multiples of %pi, are the problems you mentioned the ones reported here? http://sourceforge.net/tracker/index.php?func=detail&aid=2477795&group_id=4933&a tid=104933 I reported this as a bug (if it is a bug, but I think so...) Stefano _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Tue Jan 6 14:43:03 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 6 Jan 2009 13:43:03 -0700 Subject: [Maxima] Problem with Maxima 5.17.1 and ECL 8.12.0 In-Reply-To: <20090106173755.GS31658@cs-wsok.swansea.ac.uk> References: <20081217211304.GA8768@cs-wsok.swansea.ac.uk> <20081230164829.GA14686@cs-wsok.swansea.ac.uk> <495A5DCA.7000901@gmail.com> <20081230182040.GC31658@cs-wsok.swansea.ac.uk> <20081230184522.GA13872@cs-wsok.swansea.ac.uk> <20090106165856.GR31658@cs-wsok.swansea.ac.uk> <20090106173755.GS31658@cs-wsok.swansea.ac.uk> Message-ID: On Tue, Jan 6, 2009 at 10:37 AM, Oliver Kullmann wrote: > What used to be installed: > 5.17.1/share/maxima/5.17.1 > has now been renamed: > 5.17.1/share/maxima/5.17post 5.17post just means stuff on the trunk after the 5.17 branch. When the 5.18 branch is created (circa April 1) versions on that branch will be 5.18.1, 5.18.2, etc, and the trunk will be 5.18post. The version number is specified in configure.in. You can change it to something else & re-run the bootstrap script. Hope this clarifies the situation. Robert From O.Kullmann at swansea.ac.uk Tue Jan 6 14:52:43 2009 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Tue, 6 Jan 2009 20:52:43 +0000 Subject: [Maxima] Problem with Maxima 5.17.1 and ECL 8.12.0 In-Reply-To: References: <20081217211304.GA8768@cs-wsok.swansea.ac.uk> <20081230164829.GA14686@cs-wsok.swansea.ac.uk> <495A5DCA.7000901@gmail.com> <20081230182040.GC31658@cs-wsok.swansea.ac.uk> <20081230184522.GA13872@cs-wsok.swansea.ac.uk> <20090106165856.GR31658@cs-wsok.swansea.ac.uk> <20090106173755.GS31658@cs-wsok.swansea.ac.uk> Message-ID: <20090106205243.GZ31658@cs-wsok.swansea.ac.uk> I see; thanks! Oliver On Tue, Jan 06, 2009 at 01:43:03PM -0700, Robert Dodier wrote: > On Tue, Jan 6, 2009 at 10:37 AM, Oliver Kullmann > wrote: > > > What used to be installed: > > 5.17.1/share/maxima/5.17.1 > > has now been renamed: > > 5.17.1/share/maxima/5.17post > > 5.17post just means stuff on the trunk after the 5.17 branch. > When the 5.18 branch is created (circa April 1) versions on that > branch will be 5.18.1, 5.18.2, etc, and the trunk will be 5.18post. > The version number is specified in configure.in. > You can change it to something else & re-run the bootstrap script. > > Hope this clarifies the situation. > > Robert From fateman at cs.berkeley.edu Tue Jan 6 15:51:03 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 06 Jan 2009 13:51:03 -0800 Subject: [Maxima] memory In-Reply-To: References: Message-ID: <4963D247.3050507@cs.berkeley.edu> Without knowing the details of what you are doing, it is nevertheless more likely that your need for more memory is caused by a badly formulated problem solution, and that adding more addressable space in your lisp will not solve your problem, but only allow it to run longer and slower before halting. Maybe your should share some info about why you think you need more memory.. That said, I don't know if you are doing the right thing in GCL. Sorry. RJF Adam Majewski wrote: > Hi, > > I use : > > wxMaxima 0.7.6 http://wxmaxima.sourceforge.net > Maxima 5.16.3 http://maxima.sourceforge.net > Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 > > I have found : > "GCL is one of the oldest Lisp systems still in use, and as such has > served as the basis for large lisp applications when computers were > much more limited than they are today, particularly in terms of > available memory. Considerable effort was therefore made in the past > to keep the memory image as small as possible. As of the present > time, the GCL team has not tuned the default memory allocation scheme > to be more in line with modern systems. One can therefore often get > significant performance increases by preallocating memory" > > I try to increase Maxima memory. > I have not found any Maima commands so I try lisp : > > > to_lisp(); > > (room) > > (progn > (si::allocate 'cons 10000 t) > (si::allocate 'fixnum 200 t) > (si::allocate 'symbol 100 t) > (si::allocate-relocatable-pages 2000 t) > (si::allocate 'cfun 1000 t)) > (si::allocate 'string 2000 t) > > > > What do you think about it ? > How to find maximal values of avilable memory ? > > I have tried : > > (defun testmem (size) > (ignore-errors > (loop for i upfrom 1 collect (make-array size)))) > > (testmem 10000) > > with no result. > > Regards > > Adam > > > > > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From fateman at cs.berkeley.edu Tue Jan 6 15:55:37 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 06 Jan 2009 13:55:37 -0800 Subject: [Maxima] partitioning instead of matching so much In-Reply-To: References: <1230838461.11405.55.camel@dieter-laptop> <49632F9D.60100@gmail.com> Message-ID: <4963D359.1080604@cs.berkeley.edu> I've written up some programs that are largely alternatives to matching. I show how the "derivative divides" symbolic integration in Joel Moses' SIN program, one of the initial methods in Maxima's program, can be written in half a page or so, probably more effectively than already in Maxima. It might be interesting especially for fans of table-driven programs for integration or other tasks. comments are of course welcome. http://www.cs.berkeley.edu/~fateman/papers/partition.pdf The text, if you want to extract it and use it yourself, is in the same place, partition.tex. RJf From drdieterkaiser at web.de Tue Jan 6 16:00:27 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 6 Jan 2009 23:00:27 +0100 Subject: [Maxima] Testsuite failures In-Reply-To: References: Message-ID: <744F9084C5084B4CAFD342FD49700323@Kaiser> I have adjusted the accuracy of some tests. Please report when there are more problems. Dieter Kaiser -----Urspr?ngliche Nachricht----- Von: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] Im Auftrag von Dieter Kaiser Gesendet: Montag, 5. Januar 2009 22:12 An: 'Raymond Toy' Cc: maxima at math.utexas.edu Betreff: Re: [Maxima] Testsuite failures Hello Ray, thank you for your report. I will have a look at the numerical accuracy of the functions. Dieter Kaiser -----Urspr?ngliche Nachricht----- Von: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] Im Auftrag von Raymond Toy Gesendet: Montag, 5. Januar 2009 17:40 An: Maxima List Betreff: [Maxima] Testsuite failures I'm getting the following failures in the testsuite: ********************** Problem 303 *************** Input: integrate(bessel_y(11, x), x) Result: error-catch I think this due to a typo in the integral formula for bessel_y. There's a call to simplify with two args instead of one. I think the second arg should be removed, or simplify should by simplifya. Clisp (2.47) fails rtest_gamma: ********************** Problem 354 *************** Input: relerror(gamma_incomplete(0.5, 0.1 %i - 2.5), 1.00288947695445 - 9.842709236689227 %i, 1.0E-15) Result: 1.105194365996218E-15 Cmucl fails rtest_gamma: ********************** Problem 371 *************** Input: relerror(gamma_incomplete(0.5, - 5 %i), 0.364419841063559 - .2436855906381129 %i, 1.0e-15) Result: 2.788636698038084e-15 ********************** Problem 381 *************** Input: relerror(gamma_incomplete(0.5, 5 %i), .2436855906381129 %i + 0.364419841063559, 1.0e-15) Result: 2.788636698038084e-15 ********************** Problem 388 *************** Input: relerror(gamma_incomplete(0.5, 2.0 %i - 2), - .6696404542328767 %i - 4.636214977691262, 2.0e-15) Result: 2.051455149042451e-15 ********************** Problem 389 *************** Input: relerror(gamma_incomplete(0.5, 3.0 %i - 3), 8.244293668813985 %i - 6.274836016533672, 2.5e-15) Result: 3.682253398201579e-15 ********************** Problem 391 *************** Input: relerror(gamma_incomplete(0.5, 5.0 %i - 5), 9.813229347687738 %i + 57.54071128202554, 2.0e-15) Result: 2.449911020455208e-15 ********************** Problem 396 *************** Input: relerror(gamma_incomplete(0.5, 2.0 %i - 2), - .6696404542328767 %i - 4.636214977691262, 2.0e-15) Result: 2.051455149042451e-15 ********************** Problem 397 *************** Input: relerror(gamma_incomplete(0.5, 3.0 %i - 3), 8.244293668813985 %i - 6.274836016533672, 3.0e-15) Result: 3.682253398201579e-15 ********************** Problem 399 *************** Input: relerror(gamma_incomplete(0.5, 5.0 %i - 5), 9.813229347687738 %i + 57.54071128202554, 2.0e-15) Result: 2.449911020455208e-15 Gcl fails rtest_gamma: ********************** Problem 592 *************** Input: relerror(fresnel_s(%i + 5.0), 3.84389093777759513198736581956757227475265101347572827364567521b4 %i - 2.044525505063210590493330126425293361797143144299005524393297869b5, 2.e-14) Result: 2.542490092925679718842752779534059543174617462409733517737362792b-14 ********************** Problem 614 *************** Input: relerror(fresnel_c(%i + 5.0), 2.044530505063119004499308897858846121088557663560705550579996093b5 %i + 3.84394093777740143202918713550472184235160647415045418329908291b4, 2.e-14) I guess the tolerance needs to be increased a bit. The CMUCL failures may indicate an issue with some CMUCL routines since CMUCL fails more tests than the other lisps. Ray _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From adammaj1 at o2.pl Tue Jan 6 16:02:35 2009 From: adammaj1 at o2.pl (Adam Majewski) Date: Tue, 06 Jan 2009 23:02:35 +0100 Subject: [Maxima] memory In-Reply-To: References: Message-ID: Hi, Here is the program which IMHO needs more memory Try change jMax to 50 or 100 to see effect. ( result image : http://commons.wikimedia.org/wiki/File:Jung50e.png theory : http://fraktal.republika.pl/mset_jungreis.html or http://en.wikipedia.org/wiki/External_ray Regards Adam -====================== code =================== /* batch file for maxima uses : - symmetry around horizontal ( 0X ) axis - Psi_M function to map conjugate plane to parameter plane - jungreis algorithm to time for jMax:30; iMax:200; iMaxBig:400; is 1191 sec */ start:elapsed_run_time (); jMax:30; /* precision = proportional to details and time of computations */ iMax:200; /* number of points to draw */ iMaxBig:400; /* computes b coefficient of Jungreis function*/ betaF[n,m]:=block ( [nnn:2^(n+1)-1], if m=0 then 1.0 else if ((n>0) and (m < nnn)) then 0.0 else (betaF[n+1,m]- sum(betaF[n,k]*betaF[n,m-k],k,nnn,m-nnn)-betaF[0,m-nnn])/2.0 )$ b[m]:=betaF[0,m+1]$ /* -------------------------------*/ /* Power of w to j */ wn[w,j]:= if j=0 then 1 else w*wn[w,j-1]$ /* ---------Jungreis function ; c = Psi_M(w) ----------------------------- */ Psi_M(w):=w + sum(b[j]/wn[w,j],j,0,jMax)$ /* exponential for of complex number with angle in turns */ GiveCirclePoint(t):=R*%e^(%i*t*2*%pi)$ /* gives point of unit circle for angle t in turns */ GiveWRayPoint(R):=R*%e^(%i*tRay*2*%pi)$ /* gives point of external ray for radius R and angle tRay in turns */ NmbrOfCurves:9; /* coordinate of w-plane not c-plane */ R_max:1.5; R_min:1; dR:(R_max-R_min)/NmbrOfCurves; /* for circles */ dRR:(R_max-R_min)/iMax; /* for rays */ /* --------------------------------------f_0 plane = w-plane -----------------------------------------*/ /*-------------- unit circle ------------*/ R:1; circle_angles:makelist(i/iMax,i,0,iMax/2)$ CirclePoints:map(GiveCirclePoint,circle_angles)$ /* ---------------external circles ---------*/ circle_radii: makelist(R_min+i*dR,i,1,NmbrOfCurves)$ circle_angles:makelist(i/iMaxBig,i,0,iMaxBig/2)$ WCirclesPoints:[]$ for R in circle_radii do WCirclesPoints:append(WCirclesPoints,map(GiveCirclePoint,circle_angles))$ /* -------------- external w rays -------------*/ ray_radii:makelist(R_min+dRR*i,i,1,iMax); ray_angles:[0,1/3,1/7 , 2/7 ,3/7 ]; /* list of angles < 1/2 of root points */ WRaysPoints:[]; for tRay in ray_angles do WRaysPoints:append(WRaysPoints,map(GiveWRayPoint,ray_radii)); /* -------------------------parameter plane = c plane -----------------------------------*/ MPoints:map(Psi_M,CirclePoints); /* Mandelbrot set points */ CRaysPoints:map(Psi_M,WRaysPoints); /* external z rays */ Equipotentials:map(Psi_M,WCirclesPoints); /* add points below horizontal axis */ for w in CirclePoints do CirclePoints:cons(conjugate(w),CirclePoints); for w in WRaysPoints do WRaysPoints:cons(conjugate(w),WRaysPoints); for w in WCirclesPoints do WCirclesPoints:cons(conjugate(w),WCirclesPoints); for c in MPoints do MPoints:cons(conjugate(c),MPoints); for c in CRaysPoints do CRaysPoints:cons(conjugate(c),CRaysPoints); for c in Equipotentials do Equipotentials:cons(conjugate(c),Equipotentials); /* time */ stop:elapsed_run_time (); time:fix(stop-start); /* ---------------- draw *--------------------------------------------------------------------------*/ load(draw); /* Mario Rodr?guez Riotorto http://www.telefonica.net/web2/biomates/maxima/gpdraw/index.html */ draw(file_name = "jung30es_2", pic_width=1000, pic_height= 500, terminal = 'png, columns = 2, gr2d(title = " unit circle with external rays & circles ", point_type = filled_circle, points_joined =true, point_size = 0.34, color = red, points(map(realpart, CirclePoints),map(imagpart, CirclePoints)), points_joined =false, color = green, points(map(realpart, WCirclesPoints),map(imagpart, WCirclesPoints)), color = black, points(map(realpart, WRaysPoints),map(imagpart, WRaysPoints)) ), gr2d(title = "Parameter plane : Image under Psi_M(w) ", points_joined =true, point_type = filled_circle, point_size =0.34, color = blue, points(map(realpart, MPoints),map(imagpart, MPoints)), points_joined =false, color = green, points(map(realpart, Equipotentials),map(imagpart, Equipotentials)), color = black, points(map(realpart, CRaysPoints),map(imagpart, CRaysPoints)) ) ); From al at beshenov.ru Wed Jan 7 00:36:59 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Wed, 7 Jan 2009 09:36:59 +0300 Subject: [Maxima] Logic algebra package Message-ID: <200901070936.59887.al@beshenov.ru> Please, check my new logic algebra package: http://beshenov.ru/maxima/logic/logic-mac-2.1.tar.bz2 I've added new operators by the following code: nary ("nand",62)$ nary ("nor",61)$ infix ("implies",59)$ nary ("eq",58)$ nary ("xor",58)$ Maybe it is better to eventually declare them in src/. The simplifier is logic_simp, but I think it should be merged somehow with the basic Maxima simplifier. (Any suggestions?) I'll add it to share/contrib/ soon. -- Boomtime, Chaos 7 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From al at beshenov.ru Wed Jan 7 02:39:07 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Wed, 7 Jan 2009 11:39:07 +0300 Subject: [Maxima] Logic algebra package In-Reply-To: <7775b21a0901070008h588841dal415dad8bf68c334a@mail.gmail.com> References: <200901070936.59887.al@beshenov.ru> <7775b21a0901070008h588841dal415dad8bf68c334a@mail.gmail.com> Message-ID: <200901071139.07385.al@beshenov.ru> On Wednesday 07 January 2009 11:08 you wrote: > Hi Alexey, > > I'm happy you are working on logic algebra stuff, I will find it > useful. I checked it on some old exam problems and it seems to work > well. > > I found a small bug though: > > C1 : (not s) implies q; > C2 : s or (not t); > C1 and C2; > > the last line gives an error: > > Maxima encountered a Lisp error: > Malformed property list: ($S) > Automatically continuing. > To reenable the Lisp debugger set *debugger-hook* to nil. I'm not sure why it happens. Here's a minimal test case, without loading "logic.mac": nary ("nand",62)$ nary ("nor",61)$ infix ("implies",59)$ nary ("eq",58)$ nary ("xor",58)$ x nor (not y) or (not z); It prints Maxima encountered a Lisp error: Error during processing of --eval option "(cl-user::run)": malformed property list: ($Y). Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. But if you add nary ("OR",60)$ Then y eq (not z) nand t nor (not x) OR (not t); is OK. I tried to tune the binding powers, but it doesn't make sense. :lisp (setf *debugger-hook* nil) x nor (not y) or (not z); debugger invoked on a SIMPLE-ERROR in thread #: Error during processing of --eval option "(cl-user::run)": malformed property list: ($Y). Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. restarts (invokable by number or by possibly-abbreviated name): 0: [MACSYMA-QUIT] Maxima top-level 1: [CONTINUE ] Ignore and continue with next --eval option. 2: [ABORT ] Skip rest of --eval options. 3: Skip to toplevel READ/EVAL/PRINT loop. 4: [QUIT ] Quit SBCL (calling #'QUIT, killing the process). ((FLET #:LAMBDA139) #) 0] backtrace 0: ((FLET #:LAMBDA139) #) 1: ((FLET #:LAMBDA139) #)[:EXTERNAL] 2: (SIGNAL #)[:EXTERNAL] 3: (ERROR SIMPLE-TYPE-ERROR)[:EXTERNAL] 4: (GETF ($Y) -LABS NIL) 5: (QUEUE-P (MNOT $Y) #) 6: (BEG- (MNOT $Y) #) 7: (TRUEP #) 8: (ISP ($NOR $X (MNOT $Y))) 9: (MEVALP1 (($NOR) $X ((MNOT) $Y))) 10: (MEVALP (($NOR) $X ((MNOT) $Y))) 11: ((LAMBDA (FORM)) ((MOR) (($NOR) $X ((MNOT) $Y)) ((MNOT) $Z))) 12: (MEVAL1 #) 13: (MEVAL ((MOR) (($NOR) $X ((MNOT) $Y)) ((MNOT) $Z))) 14: (MEVAL* ((MOR) (($NOR) $X ((MNOT) $Y)) ((MNOT) $Z))) 15: (TOPLEVEL-MACSYMA-EVAL ((MOR) (($NOR) $X ((MNOT) $Y)) ((MNOT) $Z))) 16: (CONTINUE # NIL) 17: (MACSYMA-TOP-LEVEL # NIL) 18: (RUN) 19: (SB-INT:SIMPLE-EVAL-IN-LEXENV (RUN) #) 20: (SB-IMPL::PROCESS-EVAL-OPTIONS ("(cl-user::run)")) 21: (SB-IMPL::TOPLEVEL-INIT) 22: ((LABELS SB-IMPL::RESTART-LISP)) -- Boomtime, Chaos 7 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From talon at lpthe.jussieu.fr Wed Jan 7 07:09:16 2009 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 07 Jan 2009 14:09:16 +0100 Subject: [Maxima] Fitting in Maxima References: <3384951C-FC8E-4862-84C3-C368F967C6F0@gmail.com> <495E2543.9030301@gmail.com> <495E93AC.80806@gmail.com> Message-ID: Raymond Toy wrote: > Ok. I see that colnew tickles a couple of bugs in f2cl. Those are > fixed now. After adding a couple of missing linpack routines and a > small compatibility file, it all compiles. I have written the authors of colnew to ask them permission of including colnew in maxima. They kindly agreed, and i am joining here the answers: ------------------------------------------------------ Date: Tue, 6 Jan 2009 22:52:12 +0200 From: "Uri Ascher" Subject: Re: A request about colnew To: "Michel Talon" Cc: bader at math.tu-cottbus.de Dear Michel, Thank you for your kind words!! I certainly have no objection to any improvement of COLNEW provided the result remains in public domain. The idea of a wrapper to reduce the need for fortran programming is definitely a good one and I have wanted it done for a while, but there is no one to do it. Your other ideas look good, too, and again someone is needed to carry them out. best regards Uri ----------------------------------------------------- Date: Wed, 07 Jan 2009 08:20:15 +0100 From: "Prof. Dr. G. Bader" Subject: Re: A request about colnew To: Michel Talon CC: Uri Ascher Dear Michel, I agree completely with the position of Uri Ascher. I only would like be keep informed on your progress in this direction. With best regards Georg --------------------------------------------------- At the same time Raymond Toy has been able to compile colnew.f through f2cl and test the result on some examples. So it seems that maxima may inherit soon a program to solve boundary values differential systems, in particular find eigenvalues of Schroedinger equations, but also more general problems. -- Michel Talon From ferriste at gmail.com Wed Jan 7 08:09:22 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Wed, 07 Jan 2009 15:09:22 +0100 Subject: [Maxima] Half-angle-simplification of trig functions In-Reply-To: References: <1230838461.11405.55.camel@dieter-laptop> <49632F9D.60100@gmail.com> Message-ID: <4964B792.1020101@gmail.com> I hope you'll find soon where is the bug :-)... For me it would be quite important if assume worked fine, because I am writing a code in wich I need to know the sign of trigonometric functions, and as of now there is no way to do it with an assumptions over angles without explicitly declaring the sign of sin, cos, and the others functions. I use this workarond for now. Strange is also that there are analogous problems with %e... Stefano > Hello Stefano, > > Yes I think it is the same problem. > > If I use an intervall (0,2*%pi) the simplification of sin(x/2) works well. If I > use an intervall (0,%pi) the simplifcation of cos(x/2) works well. But now the > simplification of sin(x/2) fails. If I use an intervall (0,3.0) both > simplifications works well. > > I think this is a bug of assume with %pi as a value. I do not know the reason of > the bug. I will have a deeper look into the code to find it. > > Dieter Kaiser > From raymond.toy at ericsson.com Wed Jan 7 08:21:58 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Wed, 07 Jan 2009 09:21:58 -0500 Subject: [Maxima] Adding colnew contrib (Was Re: Fitting in Maxima) In-Reply-To: References: <3384951C-FC8E-4862-84C3-C368F967C6F0@gmail.com> <495E2543.9030301@gmail.com> <495E93AC.80806@gmail.com> Message-ID: <4964BA86.7050604@ericsson.com> Michel Talon wrote: > Raymond Toy wrote: > > > >> Ok. I see that colnew tickles a couple of bugs in f2cl. Those are >> fixed now. After adding a couple of missing linpack routines and a >> small compatibility file, it all compiles. >> > > I have written the authors of colnew to ask them permission of including > colnew in maxima. They kindly agreed, and i am joining here the answers: > That's really good that we have permission to use their code! Therefore, I'd like to add colnew to, say, contrib/colnew. The converted code correctly runs a couple of tests that I found, so I think it's in usable shape. However, the conversion needs the very latest version of f2cl due to some bugs in f2cl being unable to handle the code. While this isn't usually a problem, the latest f2cl has changed some of the internals that affect f2cl-lib.lisp. Thus, I'll have to update f2cl-lib.lisp and regenerate all of the converted code. I don't expect this to break anything, but you never know. So, unless there are objections to any of these items, I'll be updating the f2cl-lib.lisp and all of the converted code over the next few weeks. To make sense, the checkin will have to happen all at once, when everything is done. Ray From macrakis at alum.mit.edu Wed Jan 7 09:20:32 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 7 Jan 2009 10:20:32 -0500 Subject: [Maxima] Half-angle-simplification of trig functions In-Reply-To: <4964B792.1020101@gmail.com> References: <1230838461.11405.55.camel@dieter-laptop> <49632F9D.60100@gmail.com> <4964B792.1020101@gmail.com> Message-ID: <8b356f880901070720y348f6b71nbcbea0b72a2b1bbe@mail.gmail.com> If assumptions like a<%pi/2 etc. aren't working properly, then it sounds as though halfangles expansions will always be messy and hard to work with. I would recommend that we do *not* release the new halfangle code until the assume problem is resolved. -s On Wed, Jan 7, 2009 at 9:09 AM, Stefano Ferri wrote: > I hope you'll find soon where is the bug :-)... For me it would be quite > important if assume worked fine, because I am writing a code in wich I > need to know the sign of trigonometric functions, and as of now there is > no way to do it with an assumptions over angles without explicitly > declaring the sign of sin, cos, and the others functions. I use this > workarond for now. Strange is also that there are analogous problems > with %e... > Stefano > > > Hello Stefano, > > > > Yes I think it is the same problem. > > > > If I use an intervall (0,2*%pi) the simplification of sin(x/2) works > well. If I > > use an intervall (0,%pi) the simplifcation of cos(x/2) works well. But > now the > > simplification of sin(x/2) fails. If I use an intervall (0,3.0) both > > simplifications works well. > > > > I think this is a bug of assume with %pi as a value. I do not know the > reason of > > the bug. I will have a deeper look into the code to find it. > > > > Dieter Kaiser > > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090107/9cda46da/attachment.htm From adammaj1 at o2.pl Wed Jan 7 09:41:21 2009 From: adammaj1 at o2.pl (Adam Majewski) Date: Wed, 07 Jan 2009 16:41:21 +0100 Subject: [Maxima] memory In-Reply-To: References: Message-ID: Hi, I've got lisp error , not maxima error Adam Adam Majewski pisze: > Hi, > > Here is the program which IMHO needs more memory > Try change jMax to 50 or 100 to see effect. > ( result image : http://commons.wikimedia.org/wiki/File:Jung50e.png > theory : http://fraktal.republika.pl/mset_jungreis.html > or > http://en.wikipedia.org/wiki/External_ray > > Regards > > Adam > > -====================== code =================== > /* batch file for maxima > uses : > - symmetry around horizontal ( 0X ) axis > - Psi_M function to map conjugate plane to parameter plane > - jungreis algorithm to > > > time for jMax:30; iMax:200; iMaxBig:400; is 1191 sec > */ > > > start:elapsed_run_time (); > > > jMax:30; /* precision = proportional to details and time of > computations */ > iMax:200; /* number of points to draw */ > iMaxBig:400; > > /* computes b coefficient of Jungreis function*/ > betaF[n,m]:=block > ( > [nnn:2^(n+1)-1], > if m=0 > then 1.0 > else if ((n>0) and (m < nnn)) > then 0.0 > else (betaF[n+1,m]- > sum(betaF[n,k]*betaF[n,m-k],k,nnn,m-nnn)-betaF[0,m-nnn])/2.0 > )$ > > b[m]:=betaF[0,m+1]$ > > > /* -------------------------------*/ > > > /* Power of w to j */ > wn[w,j]:= if j=0 then 1 else w*wn[w,j-1]$ > > > /* ---------Jungreis function ; c = Psi_M(w) > ----------------------------- */ > Psi_M(w):=w + sum(b[j]/wn[w,j],j,0,jMax)$ > > > > > > > > /* exponential for of complex number with angle in turns */ > GiveCirclePoint(t):=R*%e^(%i*t*2*%pi)$ /* gives point of unit circle for > angle t in turns */ > GiveWRayPoint(R):=R*%e^(%i*tRay*2*%pi)$ /* gives point of external ray > for radius R and angle tRay in turns */ > > NmbrOfCurves:9; > /* coordinate of w-plane not c-plane */ > R_max:1.5; > R_min:1; > dR:(R_max-R_min)/NmbrOfCurves; /* for circles */ > dRR:(R_max-R_min)/iMax; /* for rays */ > > > > /* --------------------------------------f_0 plane = w-plane > -----------------------------------------*/ > /*-------------- unit circle ------------*/ > R:1; > circle_angles:makelist(i/iMax,i,0,iMax/2)$ > CirclePoints:map(GiveCirclePoint,circle_angles)$ > > /* ---------------external circles ---------*/ > circle_radii: makelist(R_min+i*dR,i,1,NmbrOfCurves)$ > circle_angles:makelist(i/iMaxBig,i,0,iMaxBig/2)$ > WCirclesPoints:[]$ > for R in circle_radii do > WCirclesPoints:append(WCirclesPoints,map(GiveCirclePoint,circle_angles))$ > > /* -------------- external w rays -------------*/ > ray_radii:makelist(R_min+dRR*i,i,1,iMax); > ray_angles:[0,1/3,1/7 , 2/7 ,3/7 ]; /* list of angles < 1/2 of root > points */ > WRaysPoints:[]; > for tRay in ray_angles do > WRaysPoints:append(WRaysPoints,map(GiveWRayPoint,ray_radii)); > > > > > > /* -------------------------parameter plane = c plane > -----------------------------------*/ > > > MPoints:map(Psi_M,CirclePoints); /* Mandelbrot set points */ > CRaysPoints:map(Psi_M,WRaysPoints); /* external z rays */ > Equipotentials:map(Psi_M,WCirclesPoints); > > /* add points below horizontal axis */ > for w in CirclePoints do CirclePoints:cons(conjugate(w),CirclePoints); > for w in WRaysPoints do WRaysPoints:cons(conjugate(w),WRaysPoints); > for w in WCirclesPoints do WCirclesPoints:cons(conjugate(w),WCirclesPoints); > > for c in MPoints do MPoints:cons(conjugate(c),MPoints); > for c in CRaysPoints do CRaysPoints:cons(conjugate(c),CRaysPoints); > for c in Equipotentials do Equipotentials:cons(conjugate(c),Equipotentials); > > > /* time */ > > stop:elapsed_run_time (); > time:fix(stop-start); > > /* ---------------- draw > *--------------------------------------------------------------------------*/ > > load(draw); /* Mario Rodr?guez Riotorto > http://www.telefonica.net/web2/biomates/maxima/gpdraw/index.html */ > draw(file_name = "jung30es_2", > pic_width=1000, > pic_height= 500, > terminal = 'png, > columns = 2, > gr2d(title = " unit circle with external rays & circles ", > point_type = filled_circle, > points_joined =true, > point_size = 0.34, > color = red, > > points(map(realpart, CirclePoints),map(imagpart, CirclePoints)), > points_joined =false, > color = green, > points(map(realpart, WCirclesPoints),map(imagpart, WCirclesPoints)), > color = black, > points(map(realpart, WRaysPoints),map(imagpart, WRaysPoints)) > ), > gr2d(title = "Parameter plane : Image under Psi_M(w) ", > points_joined =true, > point_type = filled_circle, > point_size =0.34, > color = blue, > > points(map(realpart, MPoints),map(imagpart, MPoints)), > points_joined =false, > > color = green, > points(map(realpart, Equipotentials),map(imagpart, Equipotentials)), > color = black, > points(map(realpart, CRaysPoints),map(imagpart, CRaysPoints)) > ) > > ); From willisb at unk.edu Wed Jan 7 10:01:02 2009 From: willisb at unk.edu (Barton Willis) Date: Wed, 7 Jan 2009 10:01:02 -0600 Subject: [Maxima] partitioning instead of matching so much In-Reply-To: <4963D359.1080604@cs.berkeley.edu> References: <1230838461.11405.55.camel@dieter-laptop> <49632F9D.60100@gmail.com> , <4963D359.1080604@cs.berkeley.edu> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >I've?written?up?some?programs?that?are?largely?alternatives?to?matching. >I?show?how?the?"derivative?divides"?symbolic?integration?in?Joel?Moses' >SIN?program, one?of?the?initial?methods?in?Maxima's?program,?can?be?written?in?half?a >page?or?so, Cool--I changed my abs_integrate to allow a user to append new integration methods by appending a function name to a list of integration methods. I hooked up your derivative divides code; here is a short demo: (%i2) load("abs_integrate.mac")$ (not yet in CVS) (%i4) integrate(a*Ci(x),x); (%o4) a*(x*Ci(x)-sin(x)) (%i5) integrate(Si(1 - x^2) * x,x); (%o5) (cos(x^2-1)-(1-x^2)*Si(1-x^2))/2 (%i6) integrate(bessel_j(1, x/42),x); (%o6) -42*bessel_j(0,x/42) An option variable extra_integration_methods holds the additional methods (intfudu is the derivative divides code): (%i7) extra_integration_methods; (%o7) [intfudu,signum_int] (%i8) extra_integration_methods : []; (%o8) [] (%i9) integrate(bessel_j(1, x/42),x); (%o9) integrate(bessel_j(1,x/42),x) Barton From robert.dodier at gmail.com Wed Jan 7 10:05:22 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 7 Jan 2009 09:05:22 -0700 Subject: [Maxima] memory In-Reply-To: References: Message-ID: On 1/6/09, Adam Majewski wrote: > Here is the program which IMHO needs more memory > Try change jMax to 50 or 100 to see effect. Adam, I ran your program for jMax=30 and jMax=50 and it seemed to run OK -- it took about 5 minutes and 8 minutes respectively on a 3 GHz PC. The Lisp implementation is Clisp -- I have noticed that GCL seems to use more memory than some other Lisps. You might consider using a different Lisp. best Robert From robert.dodier at gmail.com Wed Jan 7 10:10:49 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 7 Jan 2009 09:10:49 -0700 Subject: [Maxima] parser bug, was: memory Message-ID: On 1/6/09, Adam Majewski wrote: > load(draw); /* Mario Rodr?guez Riotorto When I ran your program in Clisp, it complained about the accented letter i in the comment above, and the Maxima parser got stuck there and just endlessly printed an error message about a undefined character sequence or something. (I guess the locale is UTF-8 and the bytes corresponding to accented i don't encode any character in that locale ... I'm no expert about that.) Anyway that's a bug in the parser --- probably it should just eat any troublesome bytes (certainly if they are in comments). Maybe someone can take a look at that. best Robert From talon at lpthe.jussieu.fr Wed Jan 7 10:22:39 2009 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Wed, 07 Jan 2009 17:22:39 +0100 Subject: [Maxima] memory References: Message-ID: Robert Dodier wrote: > On 1/6/09, Adam Majewski wrote: > >> Here is the program which IMHO needs more memory >> Try change jMax to 50 or 100 to see effect. > > Adam, I ran your program for jMax=30 and jMax=50 and it > seemed to run OK -- it took about 5 minutes and 8 minutes > respectively on a 3 GHz PC. The Lisp implementation is Clisp -- > I have noticed that GCL seems to use more memory than > some other Lisps. You might consider using a different Lisp. > > best > > Robert Here i did run it for jMax=30 in 82 s. It is on a P4 at 3Ghz running FreeBSD and maxima 5.17.1 compiled with cmucl. I have not encountered any memory problem (the lisp process grew to 120 Megs resident) and no problem parsing load(draw); /* Mario Rodr?guez Riotorto The plot itself looks nice. -- Michel Talon From adammaj1 at o2.pl Wed Jan 7 11:04:55 2009 From: adammaj1 at o2.pl (Adam Majewski) Date: Wed, 07 Jan 2009 18:04:55 +0100 Subject: [Maxima] memory In-Reply-To: References: Message-ID: Robert Dodier pisze: > On 1/6/09, Adam Majewski wrote: > >> Here is the program which IMHO needs more memory >> Try change jMax to 50 or 100 to see effect. > > Adam, I ran your program for jMax=30 and jMax=50 and it > seemed to run OK -- it took about 5 minutes and 8 minutes > respectively on a 3 GHz PC. Thx. For me jMax=50 for this program was the max value. For AMD Turion 64 x2 1.6 GHz it took 63 minutes ( 3818/60) Please try jMax=100 or more ( and send me png file (:-) ) then you will probably have errors. For simpler program : http://commons.wikimedia.org/wiki/File:Jung200.png I have reached jMax=200 but Mathemathica 2500 : http://www.morris.umn.edu/academic/math/Ma4901/Sp08/eckert-final.doc Sypercomputers can reach jMax 250 0000. Because jMax can be increased until infinity so here memory errors always be. > The Lisp implementation is Clisp -- > I have noticed that GCL seems to use more memory than > some other Lisps. You might consider using a different Lisp. I use wxMaxima on gcl because it is easy to install. ( download one file ). How to run Maxima using different Lisp ? Maby make a diffrent Maxima versions : stable( on GCL) and for modern computers ( on CMUL or CLISp) ? best Adam From robert.dodier at gmail.com Wed Jan 7 11:28:39 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 7 Jan 2009 10:28:39 -0700 Subject: [Maxima] Logic algebra package In-Reply-To: <200901071139.07385.al@beshenov.ru> References: <200901070936.59887.al@beshenov.ru> <7775b21a0901070008h588841dal415dad8bf68c334a@mail.gmail.com> <200901071139.07385.al@beshenov.ru> Message-ID: On Wed, Jan 7, 2009 at 1:39 AM, Alexey Beshenov wrote: > 0: ((FLET #:LAMBDA139) #) > 1: ((FLET #:LAMBDA139) #)[:EXTERNAL] > 2: (SIGNAL #)[:EXTERNAL] > 3: (ERROR SIMPLE-TYPE-ERROR)[:EXTERNAL] > 4: (GETF ($Y) -LABS NIL) > 5: (QUEUE-P (MNOT $Y) #) > 6: (BEG- (MNOT $Y) #) > 7: (TRUEP #) > 8: (ISP ($NOR $X (MNOT $Y))) > 9: (MEVALP1 (($NOR) $X ((MNOT) $Y))) It's getting messed up src/db.lisp (i.e. the "assume" stuff). I think I've bumped into a similar error, and tried to figure it out, without success. I'm not sure what to do, although flushing db.lisp down the proverbial drain would be an excellent start. Robert From biomates at telefonica.net Wed Jan 7 11:29:41 2009 From: biomates at telefonica.net (Mario Rodriguez) Date: Wed, 07 Jan 2009 18:29:41 +0100 Subject: [Maxima] parser bug, was: memory In-Reply-To: References: Message-ID: <1231349381.5861.41.camel@pc> > When I ran your program in Clisp, it complained about the accented > letter i in the comment above, and the Maxima parser got stuck there > and just endlessly printed an error message about a undefined > character sequence or something. (I guess the locale is UTF-8 and the > bytes corresponding to accented i don't encode any character in that > locale ... I'm no expert about that.) > I usually avoid writing Maxima files with accented characters. It's a source of problems when other users want to work with them under other encodings. I don't know much about this, but I think that standard characters are encoded the same way both in utf-8 and iso-8859-15, so that encoding doesn't matter in this context. Problems begin when one writes special letters. Mario From fateman at cs.berkeley.edu Wed Jan 7 12:04:18 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Wed, 07 Jan 2009 10:04:18 -0800 Subject: [Maxima] memory In-Reply-To: References: Message-ID: <4964EEA2.3080607@cs.berkeley.edu> If I understand your program (which I may not!) it seems entirely numerical, in which case writing it in a programming language that is compiled and targeted at efficient double-float computations rather than symbolic-and (incidentally) numeric computing, would provide much speedier computation. Even writing in Lisp instead of Maxima would probably get you a factor of 20 or more. Writing in carefully declared Lisp, or C [which has to be declared], might get you a factor of 40 or more. I don't know about the plotting costs, though. They might be just the same. But maybe speed is not an issue, if you can only get it done once. Also, Maxima is becoming more supportive of numbers, though with CLISP that is not likely to get far. RJF From rvh2007 at comcast.net Wed Jan 7 15:24:49 2009 From: rvh2007 at comcast.net (Richard Hennessy) Date: Wed, 7 Jan 2009 16:24:49 -0500 Subject: [Maxima] partitioning instead of matching so much References: <1230838461.11405.55.camel@dieter-laptop><49632F9D.60100@gmail.com> <4963D359.1080604@cs.berkeley.edu> Message-ID: Thanks for providing this. It is an interesting subject particular to me since I fell into the category of trying tellsimp to do all of my pw.mac integrals (at the start anyway, now I am using calls to Barton's abs_integrate.mac). Rich ----- Original Message ----- From: "Richard Fateman" To: "Maxima List" Sent: Tuesday, January 06, 2009 4:55 PM Subject: Re: [Maxima] partitioning instead of matching so much I've written up some programs that are largely alternatives to matching. I show how the "derivative divides" symbolic integration in Joel Moses' SIN program, one of the initial methods in Maxima's program, can be written in half a page or so, probably more effectively than already in Maxima. It might be interesting especially for fans of table-driven programs for integration or other tasks. comments are of course welcome. http://www.cs.berkeley.edu/~fateman/papers/partition.pdf The text, if you want to extract it and use it yourself, is in the same place, partition.tex. RJf _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From drdieterkaiser at web.de Wed Jan 7 16:16:34 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 07 Jan 2009 23:16:34 +0100 Subject: [Maxima] Half-angle-simplification of trig functions In-Reply-To: <4964B792.1020101@gmail.com> References: <1230838461.11405.55.camel@dieter-laptop> <49632F9D.60100@gmail.com> <4964B792.1020101@gmail.com> Message-ID: <1231366594.14317.42.camel@dieter-laptop> Am Mittwoch, den 07.01.2009, 15:09 +0100 schrieb Stefano Ferri: > I hope you'll find soon where is the bug :-)... I am working on the problem and I am very close to it. Here again some simple example: (%i1) assume(x<2*%pi); (%o1) [2*%pi > x] (%i2) is(x<2*%pi); (%o2) true (%i3) is(x<3*%pi); (%o3) unknown (%i4) is(x<10.0); (%o4) unknown We always have a problem with assume when the constant is involved in an expression. The following expression is stored in the database for the example above: ((MLIST) ((MGREATERP) ((MTIMES SIMP) 2 $%PI) $X)) The algorithm do not convert the expression ((mtimes simp) 2 $%pi) in something which can be compared with a number like in example (%i4) or can be compared with other expressions involving %pi. Here is a workaround which might be useful (Until we have a solution for the bug): (%i6) assume(x<2*%pi),numer; (%o6) [x < 6.283185307179586] (%i7) is(x<2*%pi); (%o7) true (%i8) is(x<3*%pi); (%o8) true (%i9) is(x<10.0); (%o9) true In this case the numerical value of 2*%pi is stored in the database and all tests work. ((MGREATERP) 6.283185307179586 $X)) In fact to do the comparison of expressions Maxima converts the constants %pi and %e to numbers too. But not for symbols within expressions like ((mtimes) 2 $%pi). Therefore a lot of tests fail. Dieter Kaiser From ferriste at gmail.com Wed Jan 7 17:05:24 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Thu, 08 Jan 2009 00:05:24 +0100 Subject: [Maxima] Negligible terms in polynomials Message-ID: <49653534.2090708@gmail.com> How could I indicate to Maxima that in a polynomial some terms are negiglible with respect to others? In example, if expr: a+b; how could I make a>>b, so expr will be simplified to a? I should do this in a sum like the one shown, so I think I cannot use ratweights because there are not multiplications or exponentiations. Thanks. Stefano From al at beshenov.ru Wed Jan 7 19:13:48 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Thu, 8 Jan 2009 04:13:48 +0300 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <49653534.2090708@gmail.com> References: <49653534.2090708@gmail.com> Message-ID: <200901080413.48580.al@beshenov.ru> On Thursday 08 January 2009 02:05:24 Stefano Ferri wrote: > How could I indicate to Maxima that in a polynomial some terms are > negiglible with respect to others? > In example, if > > expr: a+b; > > how could I make a>>b, so expr will be simplified to a? I should do > this in a sum like the one shown, so I think I cannot use > ratweights because there are not multiplications or > exponentiations. Thanks. Try tellrat: (%i1) expr : rat(a+b)$ (%i2) tellrat (b)$ (%i3) expr; (%o3)/R/ b + a (%i4) expr, algebraic; (%o4)/R/ a Or you can do it manually: (%i1) set_to_zero (expr,[terms]) := at (expr, map (lambda([x],x=0), terms))$ (%i2) set_to_zero (a+b+c+d+e, b,d); (%02) e + c + a -- Pungenday, Chaos 8 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From harald at lefant.net Wed Jan 7 20:20:21 2009 From: harald at lefant.net (Harald Geyer) Date: Thu, 08 Jan 2009 03:20:21 +0100 Subject: [Maxima] Maxima lists and $use_fast_arrays In-Reply-To: References: Message-ID: Hi Dieter! > I have detected that it is possible to write directly into a Maxima list or > Maxima matrix using the flag $use_fast_arrays:true; I think either you or me are confused: I know that use_fast_arrays has issues, but the behaviour you describe below doesn't depend on the value of this flag. > (%i8) use_fast_arrays:true$ > > Bind a list with 9 values to the symbol a: > > (%i11) a:[1,2,3,4,5,6,7,8,9]; > (%o11) [1,2,3,4,5,6,7,8,9] > > Fast arrays are on. Try to generate a fast array with one value: > > (%i12) a[3]:333; > (%o12) 333 > > What has happend is that we have set the third value in the list: > > (%i14) a; > (%o14) [1,2,333,4,5,6,7,8,9] > > Again we change a value in the list: > > (%i15) a[6]:666; > (%o15) 666 > > (%i16) a; > (%o16) [1,2,333,4,5,666,7,8,9] > > I do not know if this feature is really wanted. But it causes series failures > as > described in the bug report SF[887639]. You get a lot of strange things and a > t > the end the Maxima session is killed. The reason is that the code do not do a > ny > checks for the range of the index and does not check the type of the index. > > This is the code in the function arrstore in mlisp.lisp which is responsible > for > this behavior (I have added an extra flag to hide this code completely): > > ((and $use_fast_arrays_with_list (eq the-type 'list)) > (cond ((eq (caar tem) 'mlist) > (setq index (car index)) > (setf (nth index tem) r) > r) > ((eq (caar tem) '$matrix) > (setf (nth (second index) (nth (first index) tem)) r) > r) > (t > (error "The value of ~A is not a hash-table ,an ~ > array, Maxima list, or a matrix" (caar l))))) > > The variable tem gets the value of the symbol $a which is bound to the list i > n > the example above. This happens a bit earlier at the beginning of the functio > n > arrstore. > > The testsuite and the share_testsuite have no problems when I hide this code. > Fortunately there seems to be no code which uses this functionality of > $use_fast_arrays. > > It may be possible to improve this code (check range of index, ...), but I th > ink > it should be screened or perhaps completely cut out. > > Any comment? > > Dieter Kaiser > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Wed Jan 7 23:16:26 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 7 Jan 2009 22:16:26 -0700 Subject: [Maxima] Maxima lists and $use_fast_arrays In-Reply-To: References: Message-ID: On Wed, Jan 7, 2009 at 7:20 PM, Harald Geyer wrote: >> I have detected that it is possible to write directly into a Maxima list or >> Maxima matrix using the flag $use_fast_arrays:true; > > I think either you or me are confused: I know that use_fast_arrays has > issues, but the behaviour you describe below doesn't depend on the > value of this flag. I am confused as well --- I don't see what problem is illustrated by the example. best Robert From ferriste at gmail.com Thu Jan 8 04:24:41 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Thu, 08 Jan 2009 11:24:41 +0100 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <200901080413.48580.al@beshenov.ru> References: <49653534.2090708@gmail.com> <200901080413.48580.al@beshenov.ru> Message-ID: <4965D469.4000507@gmail.com> Mmm... I think it's not the right way. I gave a bad example. The real problem is this: I have a vector containing some polynomials, wich represent the displacements of some points of a structure (I'm writing a didactic software to solve structures in a symbolic way). In this vector, displacements are the combination of two kinds of deformation, axial and flexional, the first dependin on A (area), the second on I (momentum of inertia). So, in example: (%i1) u:matrix( [M*l^2/(E*I) + q*l/(E*A)] , [q*l/(E*A)] )$ that is the matrix (a column vector) of displacements. The first term depends on both flexional and axial deformation, the second only on the axial one. Do not care about the meanings of the symbols, they are all assumed > 0. Now, I say that axial deformation is negligible with respect to flexional one. I can do this by saying A>>I. The resulting vector should be: u2: matrix( [ M*l^2/(E*I)] , [q*l/(E*A)])$ where only the first term has been modified, because in it there are both flexional and axial deformation effects. The second term is unchanged because the axial one is the only deformation present. I can map rat over all the elements of u, but then? Using tellrat is not possible, because it would set the second element of the matrix to zero, nor it it possible to use ratweight, because it has effect only on further multiplications or exponentiations, but I have not to do operations on u, and it will eliminate also terms that sholud be keeped. I only have to neglect some terms with respect to others, element by element in u. Sorry for the long email... any idea? Thanks, Stefano Alexey Beshenov ha scritto: > On Thursday 08 January 2009 02:05:24 Stefano Ferri wrote: > >> How could I indicate to Maxima that in a polynomial some terms are >> negiglible with respect to others? >> In example, if >> >> expr: a+b; >> >> how could I make a>>b, so expr will be simplified to a? I should do >> this in a sum like the one shown, so I think I cannot use >> ratweights because there are not multiplications or >> exponentiations. Thanks. >> > > Try tellrat: > > (%i1) expr : rat(a+b)$ > (%i2) tellrat (b)$ > (%i3) expr; > (%o3)/R/ b + a > (%i4) expr, algebraic; > (%o4)/R/ a > > > Or you can do it manually: > > (%i1) set_to_zero (expr,[terms]) := > at (expr, map (lambda([x],x=0), terms))$ > (%i2) set_to_zero (a+b+c+d+e, b,d); > (%02) e + c + a > > From al at beshenov.ru Thu Jan 8 05:34:53 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Thu, 8 Jan 2009 14:34:53 +0300 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <4965D469.4000507@gmail.com> References: <49653534.2090708@gmail.com> <200901080413.48580.al@beshenov.ru> <4965D469.4000507@gmail.com> Message-ID: <200901081434.54035.al@beshenov.ru> On Thursday 08 January 2009 13:24:41 Stefano Ferri wrote: > Mmm... I think it's not the right way. I gave a bad example. > The real problem is this: I have a vector containing some > polynomials, wich represent the displacements of some points of a > structure (I'm writing a didactic software to solve structures in a > symbolic way). In this vector, displacements are the combination of > two kinds of deformation, axial and flexional, the first dependin > on A (area), the second on I (momentum of inertia). So, in example: > > (%i1) u:matrix( [M*l^2/(E*I) + q*l/(E*A)] , [q*l/(E*A)] )$ > > that is the matrix (a column vector) of displacements. The first > term depends on both flexional and axial deformation, the second > only on the axial one. Do not care about the meanings of the > symbols, they are all assumed > 0. Now, I say that axial > deformation is negligible with respect to flexional one. I can do > this by saying A>>I. The resulting vector should be: > > u2: matrix( [ M*l^2/(E*I)] , [q*l/(E*A)])$ If you just want to cancel terms that depend on some variable (which is not correct in terms of limits, of course), then try cancel_terms (poly, x) := block([terms, poly : expand(poly)], terms : if atom(poly) or op(poly)#"+" then [poly] else args(poly), terms : sublist (terms, lambda([e], freeof (x,e))), if terms=[] then 0 else apply ("+", terms) )$ cancel_terms (M*l^2/(E*I) + q*l/(E*A), A) => l^2*M/(E*I) cancel_terms (M*l^2/(E*I) + q*l/(E*A), I) => l*q/(A*E) cancel_terms (M*l^2/(E*I) + q*l/(E*A), E) => 0 If you want to reduce elements that depend on A and I, but keep elements that depend only on A, then try something like u : [M*l^2/(E*I) + q*l/(E*A), q*l/(E*A)]$ map (lambda([e], if freeof(A,e) or freeof(I,e) then e else cancel_terms(e, A)), u); A more mathematically correct version: map (lambda([e], if freeof(A,e) or freeof(I,e) then e else limit(e, A, inf)), u); -- Pungenday, Chaos 8 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From macrakis at alum.mit.edu Thu Jan 8 06:05:33 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 8 Jan 2009 07:05:33 -0500 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <200901081434.54035.al@beshenov.ru> References: <49653534.2090708@gmail.com> <200901080413.48580.al@beshenov.ru> <4965D469.4000507@gmail.com> <200901081434.54035.al@beshenov.ru> Message-ID: <8b356f880901080405p6ee7d2a5v1a42dd2cd4cf651b@mail.gmail.com> You can substitute bt = a*eps and expand: taylor(..., eps, 0, 0). Or use taylor(...,[a,binv],inf,1) where you've substituted binv = 1/b. You can also expand to higher orders, and the terms will be nicely ordered. On my blackberry, so I can't give a worked example. -s On 1/8/09, Alexey Beshenov wrote: > On Thursday 08 January 2009 13:24:41 Stefano Ferri wrote: >> Mmm... I think it's not the right way. I gave a bad example. >> The real problem is this: I have a vector containing some >> polynomials, wich represent the displacements of some points of a >> structure (I'm writing a didactic software to solve structures in a >> symbolic way). In this vector, displacements are the combination of >> two kinds of deformation, axial and flexional, the first dependin >> on A (area), the second on I (momentum of inertia). So, in example: >> >> (%i1) u:matrix( [M*l^2/(E*I) + q*l/(E*A)] , [q*l/(E*A)] )$ >> >> that is the matrix (a column vector) of displacements. The first >> term depends on both flexional and axial deformation, the second >> only on the axial one. Do not care about the meanings of the >> symbols, they are all assumed > 0. Now, I say that axial >> deformation is negligible with respect to flexional one. I can do >> this by saying A>>I. The resulting vector should be: >> >> u2: matrix( [ M*l^2/(E*I)] , [q*l/(E*A)])$ > > If you just want to cancel terms that depend on some variable > (which is not correct in terms of limits, of course), then try > > cancel_terms (poly, x) := block([terms, poly : expand(poly)], > terms : > if atom(poly) or op(poly)#"+" then > [poly] > else > args(poly), > terms : sublist (terms, lambda([e], freeof (x,e))), > if terms=[] then > 0 > else > apply ("+", terms) > )$ > > cancel_terms (M*l^2/(E*I) + q*l/(E*A), A) => l^2*M/(E*I) > cancel_terms (M*l^2/(E*I) + q*l/(E*A), I) => l*q/(A*E) > cancel_terms (M*l^2/(E*I) + q*l/(E*A), E) => 0 > > > If you want to reduce elements that depend on A and I, but keep > elements that depend only on A, then try something like > > u : [M*l^2/(E*I) + q*l/(E*A), q*l/(E*A)]$ > > map (lambda([e], if freeof(A,e) or freeof(I,e) then e else > cancel_terms(e, A)), u); > > > A more mathematically correct version: > > map (lambda([e], if freeof(A,e) or freeof(I,e) then e else > limit(e, A, inf)), u); > > -- > Pungenday, Chaos 8 YOLD 3175 > Alexey Beshenov http://beshenov.ru/ > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From raymond.toy at ericsson.com Thu Jan 8 10:07:02 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Thu, 08 Jan 2009 11:07:02 -0500 Subject: [Maxima] Rearranging lbfgs code Message-ID: Since I need to run f2cl over the existing Fortran code, I'd like to rearrange the lbfgs code. Basically, I just need to move each of the functions in lbfgs.f into it's own file so that we can compile them in the right order. This gets around the issue that Robert had to manually reorder the lbfgs.lisp file to get rid of some warnings and such. I think it's best that we touch the generated lisp files as little as possible. For simplicity, I probably won't add a defsystem since lbfgs wasn't using a defsystem previously. Ray From saratcchand at rediffmail.com Thu Jan 8 10:18:13 2009 From: saratcchand at rediffmail.com (saratchand c chandrasekharan) Date: 8 Jan 2009 16:18:13 -0000 Subject: [Maxima] optimal hardware for maxima Message-ID: <20090108161813.20834.qmail@f5mail-237-205.rediffmail.com> 1. I have been using Maxima for symbolic computation tasks that arise as part of my research into economics. 2. This usually involves solution of non-linear equations in two to five variables. When reduced to one variable the resulting polynomial is of degree four or lower. However maxima seems to be taking an inordinately long time solving them. e.g. solve([x^2+a*x+b*y+c*y^2=0,x^2+d*x+e*y+f=0],[x,y]); When I use Maxima to solve for y in terms of x in the second of the above equations and substitute in the first equation, maxima is able to solve the resulting polynomial immediately. 3. I wish to know whether augmenting my hardware will result in better results as far as my problems are concerned. My current hardware configuration: a. AMD Athlon 64 5600+ Dual Core Processor 2.8 Ghz b. 4 GB(=2X2) DDR2 800 RAM Corsair TWIN2X4096-6400C5DHX c. Asus M2A-VM Motherboard d. 300 GB Seagate HardDisk. 4. I am using Ubuntu 8.10 32 bit. 5. The Maxima 5.17.0 and WxMaxima 0.8.1 packages I am using are from:http://zeus.nyf.hu/~blahota/linux/ I will be grateful for any views on my problem. ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090108/2d4ee13c/attachment.htm From raymond.toy at ericsson.com Thu Jan 8 10:16:15 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Thu, 08 Jan 2009 11:16:15 -0500 Subject: [Maxima] Algebraic gcd and Rothstein-Trager algorithm Message-ID: I was reading over the Rothstein-Trager algorithm for integrating the logarithmic part of rational functions in Symbolic Integration by Bronstein. (Which is available on Google Books, by the way). Maxima seems to have almost all of the necessary pieces to implement this, but I don't know how to compute the gcd. In the example on page 48, we need to compute gcd(x^6-5*x^4+x*x^2+4, x^4-3*x^2+6-a*(6*x^5-20*x^3+10*x)) where a is the algebraic number such that 4*a^2+1 = 0. The book says the gcd is x^3+2*a*x^2-3*x-4*a. Can I get maxima to do that? Ray From robert.dodier at gmail.com Thu Jan 8 10:27:04 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 8 Jan 2009 09:27:04 -0700 Subject: [Maxima] Rearranging lbfgs code In-Reply-To: References: Message-ID: On Thu, Jan 8, 2009 at 9:07 AM, Raymond Toy wrote: > Since I need to run f2cl over the existing Fortran code, I'd like to > rearrange the lbfgs code. Basically, I just need to move each of the > functions in lbfgs.f into it's own file so that we can compile them in > the right order. This gets around the issue that Robert had to > manually reorder the lbfgs.lisp file to get rid of some warnings and > such. OK by me. Robert From macrakis at alum.mit.edu Thu Jan 8 11:02:14 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Thu, 8 Jan 2009 12:02:14 -0500 Subject: [Maxima] optimal hardware for maxima In-Reply-To: <20090108161813.20834.qmail@f5mail-237-205.rediffmail.com> References: <20090108161813.20834.qmail@f5mail-237-205.rediffmail.com> Message-ID: <8b356f880901080902l5e7bf6dcyca39647dde15c167@mail.gmail.com> On Thu, Jan 8, 2009 at 11:18 AM, saratchand c chandrasekharan < saratcchand at rediffmail.com> wrote: > ...However maxima seems to be taking an inordinately long time solving > them. > ...I wish to know whether augmenting my hardware will result in better > results > Unlikely. Maxima can't take advantage of multiple processors, and an Athlon 5600+ is a fast processor. It has a modest amount of cache (2MB); a bigger cache would speed things up a bit. With 4GB, you are unlikely to be thrashing. Even the fastest x86 with the fastest memory and largest cache would only give you a small improvement (50%?), with a very high marginal cost. Given that: > When I use Maxima to solve for y in terms of x in the second of the above > equations and substitute in the first equation, maxima is able to solve the > resulting polynomial immediately. > it seems that the basic problem is that the solve/algsys algorithm is far from optimal. I don't know if anyone is working on improving that. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090108/adf26c46/attachment.htm From Boris.Gaertner at gmx.net Thu Jan 8 14:04:58 2009 From: Boris.Gaertner at gmx.net (Boris.Gaertner) Date: Thu, 8 Jan 2009 21:04:58 +0100 Subject: [Maxima] Algebraic gcd and Rothstein-Trager algorithm References: Message-ID: <002a01c971cc$65780000$38ed61c2@Apfel> "Raymond Toy" wrote: > I was reading over the Rothstein-Trager algorithm for integrating the > logarithmic part of rational functions in Symbolic Integration by > Bronstein. (Which is available on Google Books, by the way). > > Maxima seems to have almost all of the necessary pieces to implement > this, but I don't know how to compute the gcd. In the example on page > 48, we need to compute > > gcd(x^6-5*x^4+x*x^2+4, x^4-3*x^2+6-a*(6*x^5-20*x^3+10*x)) > > where a is the algebraic number such that 4*a^2+1 = 0. > > The book says the gcd is x^3+2*a*x^2-3*x-4*a. > > Can I get maxima to do that? > You have a typo in your example, in Bronsteins book the polynomials are: x^6-5*x^4+5*x^2+4 x^4-3*x^2+6-a*(3*x^5-10*x^3+5*x) Macsyma does it this way: tellrat(t^2 + 1); gcd(x^6-5*x^4+5*x^2+4, x^4-3*x^2+6-t*(3*x^5-10*x^3+5*x)),gcd:subres,algebraic:true This works for me in Maxima 5.9.1 Hint: tellrat requires a monic polynomial. 4*a^2 + 1 is not monic, but a variable substitution x -> t/2 gives a monic polynomial. Do not forget to multiply the polynomial 6*x^5-20*x^3+10*x with the factor 1/2 of the variable substitution. Greetings Boris From drdieterkaiser at web.de Thu Jan 8 17:05:33 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 09 Jan 2009 00:05:33 +0100 Subject: [Maxima] Maxima lists and $use_fast_arrays In-Reply-To: References: Message-ID: <1231455933.5496.84.camel@dieter-laptop> Am Mittwoch, den 07.01.2009, 22:16 -0700 schrieb Robert Dodier: > On Wed, Jan 7, 2009 at 7:20 PM, Harald Geyer wrote: > > I am confused as well --- I don't see what problem is illustrated by > the example. > Yes, now I am confused too. I have done a wrong conclusion. I have worked on the bug report SF[887639] "listarray when use_fast_arrays : true". But I have done this work only with GCL and not CLISP. Thus I have not seen that I have got a special problem with GCL (+ Windows?). At first again the example from a post of the bug report: use_fast_arrays: true$ b: [1,2]$ b[3] => error OK b[3]: 5$ => no error ??? b[3] => error ??? b => [1,2] ??? setting b[3] didn't give an error, but has no effect on b c[1]: 5$ c => # (ridiculous internal thingy This example was done with GCL-2-5.0 and Maxima 5.9.0 1. I did not recognize that it is possible to set the elements of a Maxima list like an array e.g. (is this documented?) (%i1) a:[1,2,3,4,5]; (%o1) [1,2,3,4,5] (%i2) a[3]; (%o2) 3 (%i3) a[3]:333; (%o3) 333 (%i4) a; (%o5) [1,2,333,4,5] 2. There is a difference using use_fast_arrays:false or true. In the case of false we get a Maxima error when we try to set a value with wrong index. When we use_fast_arrays:true we get a Lisp error (not for GCL). (%i45) use_fast_arrays:false; (%o45) false (%i46) a:[1,2,3]; (%o46) [1,2,3] (%i48) a[5]:5; 5 - index out of range -- an error. To debug this try debugmode(true); (%i49) use_fast_arrays:true; (%o49) true (%i50) b:[1,2,3]; (%o50) [1,2,3] (%i52) b[5]:5; Maxima encountered a Lisp error: (SETF NTH): index 5 is too large for ((MLIST SIMP) 1 2 3) Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. 3. If I try the above example with GCL 2.6.8 I can get something like (%i6) use_fast_arrays:true$ (%i7) b:[1,2,3]$ (%i8) b[4]:4; /* No error message */ (%o8) 4 (%i9) b; (%o9) [1,2,3] /* Nothing has happened? */ (%i14) c[1]; /* Some expressions later. */ Universal error handler called recursively (:ERROR NIL ... At this point the Maxima session is killed. At first it seems that nothing had happened like in the bug report. But that is not true. The memory is damaged. When I continue the session first a lot of strange things can happen. Some time later the session is killed. This does not happen when using use_fast_arrays:false. In this case Maxima gives correct error messages when the index is wrong. Result: With use_fast_arrays:true Maxima uses a different algorithm to check the index and to access the list values. With GCL the memory is damaged when we try to write into the list with a wrong index. So I think for the case fast_arrays:true a check of the correct index has to be added to avoid a Lisp error e.g. for CLISP and a memory damage for GCL. Dieter Kaiser From ferriste at gmail.com Thu Jan 8 17:21:49 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Fri, 09 Jan 2009 00:21:49 +0100 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <200901081434.54035.al@beshenov.ru> References: <49653534.2090708@gmail.com> <200901080413.48580.al@beshenov.ru> <4965D469.4000507@gmail.com> <200901081434.54035.al@beshenov.ru> Message-ID: <49668A8D.9070203@gmail.com> Alexey Beshenov ha scritto: > A more mathematically correct version: > > map (lambda([e], if freeof(A,e) or freeof(I,e) then e else > limit(e, A, inf)), u); > Thank you, this works! But now there is another problem. A and I are not the same for all the elements of the displacements vector u, but can have subscripts, i.e. A[1], A[2], I[1], I[2], because each beam can have its mechanical and geometric properties. So I've modified your code: for i in BigAreas do u : map (lambda([e], if freeof(i, e) or apply(freeof, endcons(e, Inertia)) then e else limit(e, i, inf)), u); where BigAreas is a list containing the area of elements for whom there is the assumption A>>I, and Inertia is anoter list containig the momentum of inertia of all the elements of the structure. The problem is in apply(freeof, endcons(e, Inertia)) this is equivalent to write, in example freeof(I[1], I[2], e) Let us examine two particular cases: (%i1) freeof(I[1], I[2], M*l2/(E*I)); (%o1) true this is ok. But... (%i2) freeof(I, I[2], M*l2/(E*I[1])); (%o2) false this is not the correct result. There is this problem if the expression contains subscripts. (%i1) freeof(I[1], I[1]); (%o1) false (%i2) freeof(I[1], I); (%o2) true (%i3) freeof(I, I[1]); (%o3) false %o1 and %o2 are correct, %o3 is wrong. Is it normal this behaviour? Maybe I've made some bad coding, in my program I've used subscript not only for lists and arrays, but also to distinguish the properties of different element of the structure, so in this particular case I, I[1], I[2] are separate entities. I[1] and I[2] don't indicate the first and the second element of I. So the above result %o3 from freeof is correct? But above all, why %o3 is false if %o2 is true? Stefano From fateman at cs.berkeley.edu Thu Jan 8 18:31:17 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Thu, 08 Jan 2009 16:31:17 -0800 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <49668A8D.9070203@gmail.com> References: <49653534.2090708@gmail.com> <200901080413.48580.al@beshenov.ru> <4965D469.4000507@gmail.com> <200901081434.54035.al@beshenov.ru> <49668A8D.9070203@gmail.com> Message-ID: <49669AD5.7000005@cs.berkeley.edu> you may find it advantageous to use atoms instead of subscripted names. You can do this: I[k]:= concat("i_",k); RJF From al at beshenov.ru Thu Jan 8 18:32:04 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Fri, 9 Jan 2009 03:32:04 +0300 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <49668A8D.9070203@gmail.com> References: <49653534.2090708@gmail.com> <200901081434.54035.al@beshenov.ru> <49668A8D.9070203@gmail.com> Message-ID: <200901090332.04799.al@beshenov.ru> On Friday 09 January 2009 02:21:49 Stefano Ferri wrote: > (%i1) freeof(I[1], I[1]); > (%o1) false > (%i2) freeof(I[1], I); > (%o2) true > (%i3) freeof(I, I[1]); > (%o3) false > > %o1 and %o2 are correct, %o3 is wrong. Is it normal this behaviour? > Maybe I've made some bad coding, in my program I've used subscript > not only for lists and arrays, but also to distinguish the > properties of different element of the structure, so in this > particular case I, I[1], I[2] are separate entities. I[1] and I[2] > don't indicate the first and the second element of I. So the above > result %o3 from freeof is correct? But above all, why %o3 is false > if %o2 is true? op(I[1])=I, args(I[1])=[1]. So I[1] contains I, as an operator. You can try something like freeof_var (e, [x]) := block ([v : listofvars(e)], not apply("or", map (lambda([xx], member(xx,v)), x)) )$ freeof_var (a[1] + b[2] + c[3], a,b,c) => true freeof_var (a[1] + b[2] + c[3], a[1],b,c) => false freeof (a,b,c, a[1] + b[2] + c[3]) => false -- Pungenday, Chaos 8 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From maxima at mgenovese.otherinbox.com Fri Jan 9 09:01:59 2009 From: maxima at mgenovese.otherinbox.com (maxima at mgenovese.otherinbox.com) Date: Fri, 9 Jan 2009 10:01:59 -0500 Subject: [Maxima] Windows environment variables needed for xMaxima and wxMaxima Message-ID: <200901091501.n09F1wxR021218@box7.911domain.com> An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090109/bae853cc/attachment.htm From villate at fe.up.pt Fri Jan 9 11:08:53 2009 From: villate at fe.up.pt (Jaime Villate) Date: Fri, 09 Jan 2009 17:08:53 +0000 Subject: [Maxima] optimal hardware for maxima In-Reply-To: <20090108161813.20834.qmail@f5mail-237-205.rediffmail.com> References: <20090108161813.20834.qmail@f5mail-237-205.rediffmail.com> Message-ID: <1231520933.6538.25.camel@bethe> On Qui, 2009-01-08 at 16:18 +0000, saratchand c chandrasekharan wrote: > 3. I wish to know whether augmenting my hardware will result in better > results as far as my problems are concerned. My current hardware > configuration: > a. AMD Athlon 64 5600+ Dual Core Processor 2.8 Ghz > b. 4 GB(=2X2) DDR2 800 RAM Corsair TWIN2X4096-6400C5DHX > c. Asus M2A-VM Motherboard > d. 300 GB Seagate HardDisk. > 4. I am using Ubuntu 8.10 32 bit. > 5. The Maxima 5.17.0 and WxMaxima 0.8.1 packages I am using are > from:http://zeus.nyf.hu/~blahota/linux/ Hi, I also run Maxima in Ubuntu in several different computers, from ancient Pentiums, to Quad Core 64 with different amounts of cache. I can tell you that there is not much difference in performance between the dual core and quad core processors. What makes a big difference is the lisp flavor that you use. The version you got from zeus.nyf.hu was compiled with clisp that is much slower than sbcl in Ubuntu. It also seems to me that it was compile for a 32 bit architecture and not for 64 bit. I'd recommend that you install Maxima directly from the source code (it is easy to compile it; if you get stuck, I can send you a shell script I use in Ubuntu to install the necessary packages and compile, but I do not have it with me here). You should install several different versions of Lisp: sbcl, clisp, gcl, compile for all those flavors of lisp, and try it out with "maxima -l sbcl", "maxima -l clisp",..., to decide what works better for you. Regards, Jaime From ferriste at gmail.com Fri Jan 9 11:17:44 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Fri, 09 Jan 2009 18:17:44 +0100 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <200901090332.04799.al@beshenov.ru> References: <49653534.2090708@gmail.com> <200901081434.54035.al@beshenov.ru> <49668A8D.9070203@gmail.com> <200901090332.04799.al@beshenov.ru> Message-ID: <496786B8.1090901@gmail.com> > op(I[1])=I, args(I[1])=[1]. So I[1] contains I, as an operator. Ok. > You can try something like > > freeof_var (e, [x]) := block ([v : listofvars(e)], > not apply("or", map (lambda([xx], member(xx,v)), x)) > )$ > > freeof_var (a[1] + b[2] + c[3], a,b,c) => true > freeof_var (a[1] + b[2] + c[3], a[1],b,c) => false > freeof (a,b,c, a[1] + b[2] + c[3]) => false Thank you again, this is what I needed! Stefano From van.nek at arcor.de Fri Jan 9 15:50:14 2009 From: van.nek at arcor.de (van Nek) Date: Fri, 09 Jan 2009 22:50:14 +0100 Subject: [Maxima] Input line in wxMaxima In-Reply-To: <566DBEA4-C36F-44F6-9456-0B41D57442DC@gmx.net> References: <566DBEA4-C36F-44F6-9456-0B41D57442DC@gmx.net> Message-ID: <4967D4A6.24977.17CEDF1@van.nek.arcor.de> Hallo Holger, http://wxmaxima.sourceforge.net/wiki/index.php/Tutorials here you find three tutorials to get started with the new wxMaxima GUI. I am quite sure that after doing the first steps you will like version 0.8.x. HTH Volker van Nek Am 9 Jan 2009 um 19:39 hat Holger Schulz geschrieben: > I use wxMaxima on a Mac (iMac, Core 2 Duo, MacOS X 10.5.6) installed > via fink (http://www.finkproject.org/). Since the last fink update, I > have wxMaxima version 0.8.1. The surface is somehow different since > than. The input line is missing. > > In the fink mailing list I was told, that > > 1. this was the designated behavior in cirrent wxMaxima versions and > > 2. I have to enter the terms in the main window an press Shift-Return > to evaluate them. > > I liked the old input line and would like to continue working with it. > I cannot work with wxMaxima in the new style. Is there any chance to > get the old behavior back? > > Thanks. > > hs > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From drdieterkaiser at web.de Fri Jan 9 18:15:22 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 10 Jan 2009 01:15:22 +0100 Subject: [Maxima] SF[2477795] "assume":problems with fractions or multiples of %pi and %e Message-ID: <1231546522.5990.56.camel@dieter-laptop> I have reported that I had a look to this bug report. These were my first results I had already presented: (%i1) assume(x<2*%pi); (%o1) [2*%pi > x] (%i2) is(x<2*%pi); (%o2) true (%i3) is(x<3*%pi); (%o3) unknown (%i4) is(x<10.0); (%o4) unknown We always have a problem with assume when the constant is involved in an expression. The following expression is stored in the database for the example above: ((MLIST) ((MGREATERP) ((MTIMES SIMP) 2 $%PI) $X)) The algorithm of the database do not convert the expression ((mtimes simp) 2 $%pi) in something which can be compared with a number like in example (%i4) or can be compared with other expressions involving %pi. The code stops searching a correct result in the routines DCOMPARE and DCOMP. Because ((mtimes) 3 $%pi) or a simple number like 10.0 does not match the fact ((mtimes) 2 $%pi) in the database, the routines return $PNZ which gives the result UNKOWN. Perhaps at this point the code can be extended to look again in the database to find expression which might match when numerically evaluated. One problem for me is, that it seems to be necessary to write code with low level database functions. I have tried several times to understand the code of the database, but I have no idea how it really works. The proposed workaround to store a numerically value in the database works well: (%i6) assume(x<2*%pi),numer; (%o6) [x < 6.283185307179586] (%i7) is(x<2*%pi); (%o7) true (%i8) is(x<3*%pi); (%o8) true (%i9) is(x<10.0); (%o9) true This is the expression which is stored in the database: ((MGREATERP) 6.283185307179586 $X)) Furthermore I tested to implemented the numerically evaluation directly in the routine assume. That works for the given examples and even for the testsuite (for one example the code stops and ask a sign), but might generate other problems. E.g. x*%e^a is stored as x*2,71...^a. Thus is(x*%e^a>0) will fail -- again it might be possible to force the numerically evaluation now for the test expression. Unfortunately, the following example does not work anyway: (%o1) [a > 0,a < 1.570796326794897] (%i2) is(sin(a)>0); (%o2) unknown Here we have the problem that functions are not well supported. I think all these problems are not really bugs but a weakness of the database and the implemented algorithm which do not support the needed functionality. Because I have problems to understand the code of the database, I have no idea how to start to improve the database. Dieter Kaiser From yhonda at mac.com Sat Jan 10 03:31:27 2009 From: yhonda at mac.com (Yasuaki Honda) Date: Sat, 10 Jan 2009 18:31:27 +0900 Subject: [Maxima] user-defined TeX output functions In-Reply-To: References: Message-ID: Hi Robert, I did miss this very interesting effort of user-defined TeX output when it was posted last year. I noticed this just recently and tried it along with Imaxima which uses latex to render the output of Maixma in Emacs. It worked great!! Imaxima is benefitted from this extension since the tex output associted with a function is generated when in imaxima, and the expression is rendered as intended!! Here is the simplest example that I created: dsum(e, v, n) := block([dlist], if not(numberp(n)) then apply(nounify(dsum),[e,v,n]) else apply(lsum,[e,v,listify(divisors(n))])); tex_dsum (e) := concat("\\sum_{{", tex1(second(e)), "} | {", tex1(third(e)), "}}{", tex1(first(e)), "}")$ texput(nounify(dsum), tex_dsum); The following pdf file captured an imaxima session which demonstrates this used-defined TeX output with above divisor sum example. http://members3.jcom.home.ne.jp/imaxima/imax.pdf Yasuaki Honda -------------- next part -------------- A non-text attachment was scrubbed... Name: imax.pdf Type: application/pdf Size: 24552 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20090110/2b054bed/attachment-0001.pdf -------------- next part -------------- On 2008/12/22, at 7:04, Robert Dodier wrote: > Hello, > > there was a question about user-defined TeX output a few months ago. > I've come up a modification to the existing texput function such that > texput(foo, texfoo) calls a Maxima function texfoo to generate the TeX > output for operator foo. > > Seem to work OK. See PS below for a batch script and the attached > png image for the output as rendered by latex + xdvi. > > Comments? > > Robert Dodier > > PS. > S : openw ("/tmp/texfoo.tex"); > printf (S, "\\documentclass{article}~%"); > printf (S, "\\begin{document}~%"); > > tex_foo (e) := concat ("\\Phi_{\\upsilon}\\left(", tex1 (first (e)), > "\\right)"); > texput (foo, tex_foo); > tex (foo (1), S); > tex (foo (foo (1)), S); > tex (a + 1 + foo (2) / foo (3), S); > > tex_if (e):= block ([L : args (e)], concat > ("\\left\\{\\begin{array}{ll}", tex1 (L[2]), "&", tex1 (L[1]), "\\\\", > tex1 (L[4]), "&\\mbox{otherwise}\\end{array}\\right.")); > texput (verbify ("if"), tex_if); > texput (nounify ("if"), tex_if); > tex (if x > 0 then sin(x) else cos(x), S); > tex (if x > 0 then sin(x) else if x < 0 then cos(x) else 0, S); > > tex_diff (e) := block ([a, b, c], [a, b, c] : args (e), > concat ("{\\partial^", tex1 (c), "\\over\\partial ", tex1 (b), > "^", tex1 (c), "}", tex1 (a))); > texput (nounify (diff), tex_diff); > tex ('diff (foo (w), w), S); > > tex_integrate (e) := block ([a, b, c, d], [a, b, c, d] : args (e), > concat ("\\int_{", tex1 (c), "}^{", tex1 (d), "}", tex1 (a), " > d\\!", tex1 (b))); > texput (nounify (integrate), tex_integrate); > tex ('integrate (sin(u) / exp(u), u, 0, inf), S); > > tex ('if n > 0 then 'diff (foo (z), z, 3) else 'integrate (foo (z), z, > 0, 2*%pi), S); > > printf (S, "\\end{document}~%"); > close (S); > patch>_______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From ferriste at gmail.com Sat Jan 10 03:36:29 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Sat, 10 Jan 2009 10:36:29 +0100 Subject: [Maxima] SF[2477795] "assume":problems with fractions or multiples of %pi and %e In-Reply-To: <1231546522.5990.56.camel@dieter-laptop> References: <1231546522.5990.56.camel@dieter-laptop> Message-ID: <49686C1D.8070600@gmail.com> > Here we have the problem that functions are not well supported. > > I think all these problems are not really bugs but a weakness of the > database and the implemented algorithm which do not support the needed > functionality. > > Because I have problems to understand the code of the database, I have > no idea how to start to improve the database. > So assume lacks of functionality and the code is not documented :-( Sorry for being so annoying for this problem, I really needed an assume working with trigonometric functions but it was not in my intention to make it sound like an urgent feature request. I don't know neither Lisp or Maxima sources, so I cannot help... I hope someone can understand how the database functions... is this code so old? Stefano From sangwinc at for.mat.bham.ac.uk Sat Jan 10 05:12:54 2009 From: sangwinc at for.mat.bham.ac.uk (Chris Sangwin) Date: Sat, 10 Jan 2009 11:12:54 +0000 (GMT) Subject: [Maxima] Input line in wxMaxima In-Reply-To: <505E716F-A639-4350-AD8C-0E0558E87379@gmx.net> References: <566DBEA4-C36F-44F6-9456-0B41D57442DC@gmx.net> <4967D4A6.24977.17CEDF1@van.nek.arcor.de> <505E716F-A639-4350-AD8C-0E0558E87379@gmx.net> Message-ID: Dear all, I agree with Holger: in many applications "enter" means "evaluate" and "shift+enter" is "new line". wxMaxima has changes to reverse this. I thought this was a bug and it took me a while (after the upgrade) to work out what to do. Could we change this back on the next release please? Thanks Chris On Fri, 9 Jan 2009, Holger Schulz wrote: > Well thanks. But, actually, this is not an answer to my question. > > hs > > Am 2009-01-09 um 22:50 schrieb van Nek: > >> Hallo Holger, >> >> http://wxmaxima.sourceforge.net/wiki/index.php/Tutorials >> >> here you find three tutorials to get started with the new wxMaxima >> GUI. I am quite sure that >> after doing the first steps you will like version 0.8.x. >> >> HTH >> Volker van Nek >> >> Am 9 Jan 2009 um 19:39 hat Holger Schulz geschrieben: >> >>> I use wxMaxima on a Mac (iMac, Core 2 Duo, MacOS X 10.5.6) installed >>> via fink (http://www.finkproject.org/). Since the last fink update, I >>> have wxMaxima version 0.8.1. The surface is somehow different since >>> than. The input line is missing. >>> >>> In the fink mailing list I was told, that >>> >>> 1. this was the designated behavior in cirrent wxMaxima versions and >>> >>> 2. I have to enter the terms in the main window an press Shift-Return >>> to evaluate them. >>> >>> I liked the old input line and would like to continue working with >>> it. >>> I cannot work with wxMaxima in the new style. Is there any chance to >>> get the old behavior back? >>> >>> Thanks. >>> >>> hs >>> _______________________________________________ >>> 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 sangwinc at for.mat.bham.ac.uk Sat Jan 10 05:39:57 2009 From: sangwinc at for.mat.bham.ac.uk (Chris Sangwin) Date: Sat, 10 Jan 2009 11:39:57 +0000 (GMT) Subject: [Maxima] Input line in wxMaxima In-Reply-To: <3816BB91-1B3A-428B-B5EA-DD2D19C3FFD1@gmx.net> References: <566DBEA4-C36F-44F6-9456-0B41D57442DC@gmx.net> <4967D4A6.24977.17CEDF1@van.nek.arcor.de> <505E716F-A639-4350-AD8C-0E0558E87379@gmx.net> <3816BB91-1B3A-428B-B5EA-DD2D19C3FFD1@gmx.net> Message-ID: I'm sure we can find a less emotive name for the option..... I do appreciate the work done on wxMaxima - it is a very useful front-end which I like very much! Thank you. Chris On Sat, 10 Jan 2009, Holger Schulz wrote: > For those, you switched already mentally, it could be kept, somehow, and > there could be an option in there preferences like "Use old fashioned but > useful input line instead of new rubbish which is said to be compatible to a > programme I don't use, because I have maxima already". > > You might want to use other terms to declare this option: :-) > > hs > > Am 2009-01-10 um 12:12 schrieb Chris Sangwin: > >> >> Dear all, >> >> I agree with Holger: in many applications "enter" means "evaluate" and >> "shift+enter" is "new line". wxMaxima has changes to reverse this. I >> thought this was a bug and it took me a while (after the upgrade) to work >> out what to do. Could we change this back on the next release please? >> >> Thanks >> Chris >> >> On Fri, 9 Jan 2009, Holger Schulz wrote: >> >>> Well thanks. But, actually, this is not an answer to my question. >>> >>> hs >>> >>> Am 2009-01-09 um 22:50 schrieb van Nek: >>> >>>> Hallo Holger, >>>> >>>> http://wxmaxima.sourceforge.net/wiki/index.php/Tutorials >>>> >>>> here you find three tutorials to get started with the new wxMaxima >>>> GUI. I am quite sure that >>>> after doing the first steps you will like version 0.8.x. >>>> >>>> HTH >>>> Volker van Nek >>>> >>>> Am 9 Jan 2009 um 19:39 hat Holger Schulz geschrieben: >>>> >>>>> I use wxMaxima on a Mac (iMac, Core 2 Duo, MacOS X 10.5.6) installed >>>>> via fink (http://www.finkproject.org/). Since the last fink update, I >>>>> have wxMaxima version 0.8.1. The surface is somehow different since >>>>> than. The input line is missing. >>>>> >>>>> In the fink mailing list I was told, that >>>>> >>>>> 1. this was the designated behavior in cirrent wxMaxima versions and >>>>> >>>>> 2. I have to enter the terms in the main window an press Shift-Return >>>>> to evaluate them. >>>>> >>>>> I liked the old input line and would like to continue working with >>>>> it. >>>>> I cannot work with wxMaxima in the new style. Is there any chance to >>>>> get the old behavior back? >>>>> >>>>> Thanks. >>>>> >>>>> hs >>>>> _______________________________________________ >>>>> 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 saratcchand at rediffmail.com Sat Jan 10 05:59:04 2009 From: saratcchand at rediffmail.com (saratchand c chandrasekharan) Date: 10 Jan 2009 11:59:04 -0000 Subject: [Maxima] optimal hardware for maxima Message-ID: <20090110115904.48363.qmail@f5mail-237-238.rediffmail.com> 1. In reply to my original question on optimal hardware for Maxima, Stavros Macrakis has suggested that augmenting hardware is unlikely to lead to better results but suggests that a 50% improvement is possible with better hardware. I am planning to request the Indian government, I work in India, to assist me to set up a home workstation (for research purposes) with the following configuration: 1.AMD Phenom II X4 940 3.0GHz 6MB L3 Cache Socket AM2+ 125W Quad-Core Black Edition Processor 2.ASUS M3A79-T Deluxe Motherboard 3.CORSAIR TWIN2X4096-6400C4DHX: 2 units i.e. 8GB, in all 4 sticks of 2 GB RAM each. 4.Western Digital VelociRaptor WD3000GLFS 300GB 10000 RPM 16MB Cache SATA 3.0Gb/s Hard Drive I would like your opinions on whether the new configuration would make some difference. 2. Stavros Macrakis has suggested that "it seems that the basic problem is that the solve/algsys algorithm is far from optimal". I am not a programmer but is there a place where i can report this? 3. Jaime Villate has suggested that i must compile Maxima from source code. I tried compiling Maxima from instructions available on https://help.ubuntu.com/community/Maxima But I could not make much headway. If Jaime Villate can send me the shell script that he mentions, i will definitely have a go at it. 4. As far as 64 bit is concerned, I was given to understand that 64 bit operating systems starts making a difference only when, one uses more than 4 GB RAM. In this light I installed the 32 bit linux server kernel provided in ubuntu 8.10 which recognises 3.8 GB of my 4 GB RAM. My ASUS M2A-VM motherboard has a problem running 8 GB of RAM so I am stuck with a 32 bit operating system unless it is the case that a 64 bit operating system is capable of outperforming a 32 bit one even when 4 GB RAM or less is used. In this case too, would'nt a hardware upgrade help matters? c. saratchand -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090110/d65f4e79/attachment.htm From ferriste at gmail.com Sat Jan 10 06:35:07 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Sat, 10 Jan 2009 13:35:07 +0100 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <200901090332.04799.al@beshenov.ru> References: <49653534.2090708@gmail.com> <200901081434.54035.al@beshenov.ru> <49668A8D.9070203@gmail.com> <200901090332.04799.al@beshenov.ru> Message-ID: <496895FB.1080101@gmail.com> Sorry but I have another problem... I'm trying to use your freeof_var with the function tou suggested me to make some terms negligible in polynomials, here is a little example with a matrix: (%i2) u:matrix([M/I+F/A], [M/I], [F/A])$ (%i3) freeof_var (ee, [x]) := block ([v : listofvars(ee)], not apply("or", map (lambda([xx], member(xx,v)), x)))$ (%i4) setcheck:true$ here terms are recognized and neglected using freeof: (%i5) map (lambda([e], if freeof(A,e) or freeof(I,e) then e else limit(e, A, inf)), u); e SET TO [M/I+F/A] e SET TO [M/I] e SET TO [F/A] (%o5) matrix([M/I],[M/I],[F/A]) that is correct. But when I use freeof_var (%i6) map (lambda([e], if freeof_var(I,e) or freeof_var(A,e) then e else limit(e, A, inf)), u); e SET TO [M/I+F/A] ee SET TO I x SET TO [[M/I+F/A]] v SET TO [I] xx SET TO [M/I+F/A] e SET TO [M/I] ee SET TO I x SET TO [[M/I]] v SET TO [I] xx SET TO [M/I] e SET TO [F/A] ee SET TO I x SET TO [[F/A]] v SET TO [I] xx SET TO [F/A] (%o6) matrix([M/I+F/A],[M/I],[F/A]) (%i7) map (lambda([e], if freeof_var(A,e) or freeof_var(I,e) then e else limit(e, A, inf)), u); e SET TO [M/I+F/A] ee SET TO A x SET TO [[M/I+F/A]] v SET TO [A] xx SET TO [M/I+F/A] e SET TO [M/I] ee SET TO A x SET TO [[M/I]] v SET TO [A] xx SET TO [M/I] e SET TO [F/A] ee SET TO A x SET TO [[F/A]] v SET TO [A] xx SET TO [F/A] (%o7) matrix([M/I+F/A],[M/I],[F/A]) these results are wrong, u[1,1] should become M/I. Even when using a single element of u there are problems: (%i15) if freeof_var(A,u[1,1]) or freeof_var(I,u[1,1]) then u[1,1] else limit(u[1,1], A, inf); ee SET TO A x SET TO [M/I+F/A] v SET TO [A] xx SET TO M/I+F/A (%o15) M/I+F/A ee is set only once, and so v... When freeof_var is contained within an "if" statement, only the first condition is evaluated. With setcheck one can notice that in the "if freeof_var(A,e) or freeof_var(I,e)" only the first condition is considered, to ee is assigned only I in the %i6 example and only A in the %i7 example, and so the limit is never evaluated. Sorry but I don't understand why... Is it an issue related to the nesting of lambda functions? Stefano Alexey Beshenov ha scritto: > On Friday 09 January 2009 02:21:49 Stefano Ferri wrote: > > >> (%i1) freeof(I[1], I[1]); >> (%o1) false >> (%i2) freeof(I[1], I); >> (%o2) true >> (%i3) freeof(I, I[1]); >> (%o3) false >> >> %o1 and %o2 are correct, %o3 is wrong. Is it normal this behaviour? >> Maybe I've made some bad coding, in my program I've used subscript >> not only for lists and arrays, but also to distinguish the >> properties of different element of the structure, so in this >> particular case I, I[1], I[2] are separate entities. I[1] and I[2] >> don't indicate the first and the second element of I. So the above >> result %o3 from freeof is correct? But above all, why %o3 is false >> if %o2 is true? >> > > op(I[1])=I, args(I[1])=[1]. So I[1] contains I, as an operator. > > You can try something like > > freeof_var (e, [x]) := block ([v : listofvars(e)], > not apply("or", map (lambda([xx], member(xx,v)), x)) > )$ > > freeof_var (a[1] + b[2] + c[3], a,b,c) => true > freeof_var (a[1] + b[2] + c[3], a[1],b,c) => false > freeof (a,b,c, a[1] + b[2] + c[3]) => false > > From al at beshenov.ru Sat Jan 10 06:46:23 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Sat, 10 Jan 2009 15:46:23 +0300 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <496895FB.1080101@gmail.com> References: <49653534.2090708@gmail.com> <200901090332.04799.al@beshenov.ru> <496895FB.1080101@gmail.com> Message-ID: <200901101546.24163.al@beshenov.ru> On Saturday 10 January 2009 15:35 you wrote: > Sorry but I have another problem... I'm trying to use your > freeof_var with the function tou suggested me to make some terms > negligible in polynomials, here is a little example with a matrix: I just changed the order of arguments to make freeof_var definition shorter. So you should replace freeof(A,e) by freeof_var(e,A), etc. Redefine freeof_var in an appropriate way, if needed. -- Setting Orange, Chaos 10 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From al at beshenov.ru Sat Jan 10 07:21:37 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Sat, 10 Jan 2009 16:21:37 +0300 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <200901101546.24163.al@beshenov.ru> References: <49653534.2090708@gmail.com> <496895FB.1080101@gmail.com> <200901101546.24163.al@beshenov.ru> Message-ID: <200901101621.37497.al@beshenov.ru> On Saturday 10 January 2009 15:46:23 Alexey Beshenov wrote: > On Saturday 10 January 2009 15:35 you wrote: > > Sorry but I have another problem... I'm trying to use your > > freeof_var with the function tou suggested me to make some terms > > negligible in polynomials, here is a little example with a > > matrix: > > I just changed the order of arguments to make freeof_var > definition shorter. So you should replace freeof(A,e) by > freeof_var(e,A), etc. > > Redefine freeof_var in an appropriate way, if needed. freeof_var ([xe]) := block ([v, x, e], if xe=[] then return(true), block ([ex : reverse(xe)]. e : first (ex), x : rest (ex) ), v : listofvars (e), while true do ( if x=[] then return (true) elseif member(first(x),v) then return (false) else x : rest(x) ) )$ freeof (x, x[1]+y) => false freeof_var (x, x[1]+y) => true map (lambda([e], if freeof(A,e) or freeof(I,e) then e else limit(e, A, inf)), u) => matrix([M/I],[M/I],[F/A]) map (lambda([e], if freeof_var(A,e) or freeof_var(I,e) then e else limit(e, A, inf)), u) => matrix([M/I],[M/I],[F/A]) -- Setting Orange, Chaos 10 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From LindnerW at t-online.de Sat Jan 10 08:34:46 2009 From: LindnerW at t-online.de (Wolfgang Lindner) Date: Sat, 10 Jan 2009 15:34:46 +0100 Subject: [Maxima] Maxima version counter Message-ID: <002d01c97330$9f0fb140$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> dear group, thank you all for this wonderful piece of software. I like it, I use it, I could not live without it ;) Here is my 'question'. The version number of Maxima ist now 5.17.0 Should we wait until 5.99.3 before there is Maxima 6.0.0 ;) So: why not use integer increments 0<=n<=9 for indicating the development process? That is Maxima 5.17.0 could be Maxima 6.8.0. Perhaps this would be more 'fair' to reflect the continuous progress of Maxima in comparison with the other CAS. hth Wolfgang From LindnerW at t-online.de Sat Jan 10 08:18:12 2009 From: LindnerW at t-online.de (Wolfgang Lindner) Date: Sat, 10 Jan 2009 15:18:12 +0100 Subject: [Maxima] Input line in wxMaxima Message-ID: <002c01c97330$9ed5b580$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> dear wxMaxima Users, I like the new version of the wxMaxima-GUI for Maxima. In my opinion it is a good development and now works like some of the big M's: Maple, Mathematica, MuPAD (now included in MatLAB). I don't miss the old Derive-like 'entry' line. The new possibilities to quickly edit at place or to generate new cells with icons or to hide cells via clicking the triangle is very comfortabe. Maybe Andrej could give an option to switch from 'Ctrt-Enter' to 'Enter'. But I would prefer to use the new possibilities. hth Wolfgang From al at beshenov.ru Sat Jan 10 09:05:25 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Sat, 10 Jan 2009 18:05:25 +0300 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <200901101621.37497.al@beshenov.ru> References: <49653534.2090708@gmail.com> <200901101546.24163.al@beshenov.ru> <200901101621.37497.al@beshenov.ru> Message-ID: <200901101805.25483.al@beshenov.ru> Maybe it is really handy to have a special version of freeof(x_1,...,x_n, expr) which compares x_1,...,x_n only with non-dummy variables in expr. Here's a code which could be used in addition to nrat4.lisp stuff: ------------------------------------------------------------ (defun lfreeof-var (x expr) (let* (($listdummyvars nil) (v ($listofvars expr))) (loop while x do (if (member (car x) v :test 'equal) (return-from lfreeof-var nil)) (setf x (cdr x))) t)) (defun $lfreeof_var (x expr) (if ($listp x) (lfreeof-var (margs x) expr) (merror "First argument must be a list"))) (defun $freeof_var (&rest xe) (let ((ex (reverse xe))) (lfreeof-var (cdr ex) (car ex)))) ------------------------------------------------------------ Examples: freeof_var (x,y,z, x^n + y^n = z^n) => false freeof (x,y,z, x^n + y^n = z^n) => false Dummy variables: freeof_var (i, 'sum(i,i,0,1000)) => true freeof (i, 'sum(i,i,0,1000)) => true Useless for operators or constants: freeof_var (cos, cos(x)) => true freeof (cos, cos(x)) => false freeof_var (23, 23*x) => true freeof (23, 23*x) => false But may be useful for subscripted names: freeof_var (x,y,z, x[0]^n + y[0]^n = z[0]^n) => true freeof (x,y,z, x[0]^n + y[0]^n = z[0]^n) => false -- Setting Orange, Chaos 10 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From fateman at cs.berkeley.edu Sat Jan 10 09:45:08 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Sat, 10 Jan 2009 07:45:08 -0800 Subject: [Maxima] Input line in wxMaxima In-Reply-To: <0F474931-8FE0-45DB-A4D9-8EE9A0DE22D0@gmx.net> References: <002c01c97330$9ed5b580$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> <0F474931-8FE0-45DB-A4D9-8EE9A0DE22D0@gmx.net> Message-ID: <4968C284.3080402@cs.berkeley.edu> personally, I do not mind the shift-enter. The "old" version required two characters also. the first character was ; or $. The second character was . If you allow only to submit the command, then all commands must be one-line long, or you need another character sequence to continue a long command. In some systems this is two characters \ . I think that wxmaxima should behave somewhat differently in "batch" mode... it seems to display the results even if the commands in the file are terminated by $. Also, as I've mentioned, the front-end seems to get "clogged" and slow down, especially if you have some long text from the manual in your notebook. RJF From rvh2007 at comcast.net Sat Jan 10 10:24:30 2009 From: rvh2007 at comcast.net (Richard Hennessy) Date: Sat, 10 Jan 2009 11:24:30 -0500 Subject: [Maxima] Input line in wxMaxima References: <002c01c97330$9ed5b580$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A><0F474931-8FE0-45DB-A4D9-8EE9A0DE22D0@gmx.net> <4968C284.3080402@cs.berkeley.edu> Message-ID: <50AB0E7BFB0D4792B3E27217608541C5@RichDesktop> I like the new wxMaxima but I have noticed that there are still "issues" with it. I am not going to call them bugs but maybe I should. For example, right clicking on an output line does not consistently bring up the right context menu. There appears to be two different context menu's, one for input and one for output. The input one has three options, the output one has ten or so. Sometimes I like to factor an expression by right clicking it and select factor from the context menu. Now sometimes I cannot get that menu to come up no matter what I do. That I think is a weakness or maybe a bug. Maybe there is something I am missing but I don't know why this happens. I get the input context menu when right clicking on output. Very problematic. Rich ----- Original Message ----- From: "Richard Fateman" To: "Holger Schulz" Cc: Sent: Saturday, January 10, 2009 10:45 AM Subject: Re: [Maxima] Input line in wxMaxima personally, I do not mind the shift-enter. The "old" version required two characters also. the first character was ; or $. The second character was . If you allow only to submit the command, then all commands must be one-line long, or you need another character sequence to continue a long command. In some systems this is two characters \ . I think that wxmaxima should behave somewhat differently in "batch" mode... it seems to display the results even if the commands in the file are terminated by $. Also, as I've mentioned, the front-end seems to get "clogged" and slow down, especially if you have some long text from the manual in your notebook. RJF _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From ferriste at gmail.com Sat Jan 10 15:15:19 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Sat, 10 Jan 2009 22:15:19 +0100 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <200901101805.25483.al@beshenov.ru> References: <49653534.2090708@gmail.com> <200901101546.24163.al@beshenov.ru> <200901101621.37497.al@beshenov.ru> <200901101805.25483.al@beshenov.ru> Message-ID: <49690FE7.8090903@gmail.com> Thank you very much, the code freeof_var ([xe]) := block ([v, x, e], if xe=[] then return(true), block ([ex : reverse(xe)]. e : first (ex), x : rest (ex) ), v : listofvars (e), while true do ( if x=[] then return (true) elseif member(first(x),v) then return (false) else x : rest(x) ) )$ works fine. I don't understand your lisp implementation because I dont't know lisp, do you want to add the new freeof_var to Maxima core in further versions? Can I ask you a last thing? Just for curiosity :-) The code above works fine but I wish to understand why with the previous code: (%i1) freeof_var (ee, [x]) := block ([v : listofvars(ee)], not apply("or", map (lambda([xx], member(xx,v)), x)))$ (%i2) map (lambda([e], if freeof(A,e) or freeof(I,e) then e else limit(e, A, inf)), u); where u is a vector, only the first condition in the if statement is evaluated, because ee is set only once, only to A and never to I. I'm far from being a Maxima geek :-( Thanks, Stefano Alexey Beshenov ha scritto: > Maybe it is really handy to have a special version of > freeof(x_1,...,x_n, expr) which compares x_1,...,x_n only > with non-dummy variables in expr. > > Here's a code which could be used in addition to nrat4.lisp > stuff: > > ------------------------------------------------------------ > > (defun lfreeof-var (x expr) > (let* > (($listdummyvars nil) > (v ($listofvars expr))) > (loop while x do > (if (member (car x) v :test 'equal) > (return-from lfreeof-var nil)) > (setf x (cdr x))) > t)) > > (defun $lfreeof_var (x expr) > (if ($listp x) > (lfreeof-var (margs x) expr) > (merror "First argument must be a list"))) > > (defun $freeof_var (&rest xe) > (let ((ex (reverse xe))) > (lfreeof-var (cdr ex) (car ex)))) > > ------------------------------------------------------------ > > Examples: > > freeof_var (x,y,z, x^n + y^n = z^n) => false > freeof (x,y,z, x^n + y^n = z^n) => false > > Dummy variables: > freeof_var (i, 'sum(i,i,0,1000)) => true > freeof (i, 'sum(i,i,0,1000)) => true > > Useless for operators or constants: > freeof_var (cos, cos(x)) => true > freeof (cos, cos(x)) => false > freeof_var (23, 23*x) => true > freeof (23, 23*x) => false > > But may be useful for subscripted names: > freeof_var (x,y,z, x[0]^n + y[0]^n = z[0]^n) => true > freeof (x,y,z, x[0]^n + y[0]^n = z[0]^n) => false > > From macrakis at alum.mit.edu Sat Jan 10 15:50:47 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 10 Jan 2009 16:50:47 -0500 Subject: [Maxima] SF[2477795] "assume":problems with fractions or multiples of %pi and %e In-Reply-To: <49686C1D.8070600@gmail.com> References: <1231546522.5990.56.camel@dieter-laptop> <49686C1D.8070600@gmail.com> Message-ID: <8b356f880901101350u2c4d546fi73af7c34f35e424d@mail.gmail.com> On Sat, Jan 10, 2009 at 4:36 AM, Stefano Ferri wrote: > I hope someone can understand how the database functions... is this code so > old? > Yes. Written in about 1974 and uncommented. -s PS Rumor has it that the original developer *deleted* his comments because he didn't think anyone else could maintain it. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090110/bf3d5dfe/attachment.htm From robert.dodier at gmail.com Sat Jan 10 16:29:43 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 10 Jan 2009 15:29:43 -0700 Subject: [Maxima] SF[2477795] "assume":problems with fractions or multiples of %pi and %e In-Reply-To: <1231546522.5990.56.camel@dieter-laptop> References: <1231546522.5990.56.camel@dieter-laptop> Message-ID: On 1/9/09, Dieter Kaiser wrote: > I think all these problems are not really bugs but a weakness of the > database and the implemented algorithm which do not support the needed > functionality. > > Because I have problems to understand the code of the database, I have > no idea how to start to improve the database. Given that the existing code is incomprehensible, and capable only for fairly weak inferences, I think we should start over. To judge by the behavior of the existing assume/is and peeking at the source code, it appears a partial order of variables is constructed and inferences are derived from that. It seems like we should be able to replicate, and extend, the existing functionality pretty easily. The existing share package fourier_elim might be useful in this context. Perhaps the author (Barton Willis) can comment on this point. There is a library QEPCAD which implements the so-called cylindrical algebraic decomposition. If I understand correctly that subsumes the assume/is functionality and goes far beyond it. However it is written in C, and it is pretty large (1000's of lines of code). So I think the only feasible way to use it is to link it via a foreign function interface. A stronger assume/is system would greatly benefit many parts of Maxima, so I think it is certainly worth the effort. best Robert Dodier From robert.dodier at gmail.com Sat Jan 10 16:40:11 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 10 Jan 2009 15:40:11 -0700 Subject: [Maxima] Maxima version counter In-Reply-To: <002d01c97330$9f0fb140$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> References: <002d01c97330$9f0fb140$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> Message-ID: On 1/10/09, Wolfgang Lindner wrote: > thank you all for this wonderful piece of software. > I like it, I use it, I could not live without it ;) I'm glad to hear that you find it useful. I would be interested to hear what is your primary problem domain. > The version number of Maxima ist now 5.17.0 > Should we wait until 5.99.3 before there is Maxima 6.0.0 ;) > So: why not use integer increments 0<=n<=9 for indicating the development > process? > That is Maxima 5.17.0 could be Maxima 6.8.0. > Perhaps this would be more 'fair' to reflect the continuous progress of > Maxima in comparison with the other CAS. Well, the numbering scheme is fairly arbitrary ... it seems like we should change the major version number (5 at present) when there are some fundamental changes, but in every release there are just a lot of little incremental changes, and for the most part Maxima works pretty much the same as before. Many aspects haven't changed in 30 years. That said, maybe we should consider changing the major number from 5 to 6. Maybe the mass of accumulated incremental changes is enough. best Robert Dodier From willisb at unk.edu Sat Jan 10 16:46:27 2009 From: willisb at unk.edu (Barton Willis) Date: Sat, 10 Jan 2009 16:46:27 -0600 Subject: [Maxima] SF[2477795] "assume":problems with fractions or multiples of %pi and %e Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >One?problem?for?me?is,?that?it?seems?to?be?necessary?to?write?code?with >low?level?database?functions.?I?have?tried?several?times?to?understand >the?code?of?the?database,?but?I?have?no?idea?how?it?really?works. >Because I have problems to understand the code of the database, I have >no idea how to start to improve the database. The fact database would benefit if it contained more information: (a) the facts as input by the user, (b) upper and lower bounds for all assumed variables (would make some sign queries super fast), (c) a flag that indicates if Maxima knows for *certain* that the facts are consistent (Maxima doesn't complain when it should: Maxima has no way to know if assume(bessel_j(a,a^2 -b) > 0, cos(a + b) > a-b) is consistent, for example) (d) a processed form (possibly Fourier elimination for linear assumptions) for the facts I don't know how much of this data is in the fact database. When I wrote the Fourier elimination code, I tried this: (%i1) load("mysign.mac")$ (%i2) assume(a < %pi/2); (%o2) [%pi/2>a] (%i4) mysign(%pi - a); (%o4) pos (%i5) sign(%pi - a); (%o5) pnz The code is super inefficient (and completely untested). We also have simplex code as well. load(fourier_elim); inequation_facts() := subset(setify(facts()), lambda([s], not(mapatom(s)) and member(op(s), ["<", "<=", "=", "#",">", ">=", 'equal]))); mysign(e,[f]) := block([listconstvars : false, v, s_z, s_p, s_pz, s_nz, s_n, s_pn], f : listify(union(setify(f), inequation_facts())), f : subst('equal = "=", f), v : listify(setify(append(listofvars(e),listofvars(f)))), if 'emptyset = fourier_elim(f,v) then (print("emtpy assume"), return ('pnz)), s_z : fourier_elim(cons(e # 0, f), v), if s_z = 'emptyset then return('zero), s_p : fourier_elim(cons(e <= 0, f), v), if s_p = 'emptyset then return('pos), s_pz : fourier_elim(cons(e < 0, f), v), if s_pz = 'emptyset then return('pz), s_nz : fourier_elim(cons(e >= 0, f), v), if s_nz = 'emptyset then return('neg), s_n : fourier_elim(cons(e > 0, f), v), if s_n = 'emptyset then return('nz), s_pn : fourier_elim(cons(e = 0, f), v), if s_pn = 'emptyset then return('pn), 'pnz); Barton From al at beshenov.ru Sat Jan 10 20:37:02 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Sun, 11 Jan 2009 05:37:02 +0300 Subject: [Maxima] Negligible terms in polynomials In-Reply-To: <49690FE7.8090903@gmail.com> References: <49653534.2090708@gmail.com> <200901101805.25483.al@beshenov.ru> <49690FE7.8090903@gmail.com> Message-ID: <200901110537.03157.al@beshenov.ru> On Sunday 11 January 2009 00:15:19 Stefano Ferri wrote: > works fine. I don't understand your lisp implementation because I > dont't know lisp, do you want to add the new freeof_var to Maxima > core in further versions? I can add it to nrat4.lisp and Expressions.texi if other developers approve it. > Can I ask you a last thing? Just for curiosity :-) The code above > works fine but I wish to understand why with the previous code: > > (%i1) freeof_var (ee, [x]) := block ([v : listofvars(ee)], > not apply("or", map (lambda([xx], member(xx,v)), x)))$ > > (%i2) map (lambda([e], if freeof(A,e) or freeof(I,e) then e else > limit(e, A, inf)), u); > > where u is a vector, only the first condition in the if statement > is evaluated, because ee is set only once, only to A and never to > I. I'm far from being a Maxima geek :-( As I noted before, (%i1) is just a short definition, it is not consistent with freeof because it changes the order of arguments. freeof_var(A,e) returns true for all cases just because it looks for e in A (not vice versa). Thus the other condition is never evaluated. Also, apply("or", map (...)) may be not efficient since it performs full mapping (apply&map does not involve lazy evaluation). -- Sweetmorn, Chaos 11 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From rmihael at gmail.com Fri Jan 9 15:24:40 2009 From: rmihael at gmail.com (Mykhailo Korbakov) Date: Fri, 9 Jan 2009 23:24:40 +0200 Subject: [Maxima] Differentiation in sum Message-ID: <86469e5f0901091324x59f6f384p717498e8a12cb99b@mail.gmail.com> Hi everybody, I'm very new to Maxima and symbolic computations at all, so please, don't make laugh of me if my question is trivial or stupid :) I have a simple polynomial function y:tpsum(i=0, N, w_i*x^i) Is it possible to differentiate by w_1, w_2, w_j symbols? I'm getting '0' for result of diff(y, w_1). That's definitely not the 'x' I was hoping to obtain. Thank you in advance, Michael Korbakov From rmihael at gmail.com Fri Jan 9 15:32:06 2009 From: rmihael at gmail.com (Mykhailo Korbakov) Date: Fri, 9 Jan 2009 23:32:06 +0200 Subject: [Maxima] Differentiation in sum Message-ID: <86469e5f0901091332p77738a90lf3d85ab60b234059@mail.gmail.com> Hi everybody, I'm very new to Maxima and symbolic computations at all, so please, don't make laugh of me if my question is trivial or stupid :) I have a simple polynomial function y:tpsum(i=0, N, w_i*x^i) Is it possible to differentiate by w_1, w_2, w_j symbols? I'm getting '0' for result of diff(y, w_1). That's definitely not the 'x' I was hoping to obtain. Thank you in advance, Michael Korbakov From al at beshenov.ru Sun Jan 11 06:07:03 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Sun, 11 Jan 2009 15:07:03 +0300 Subject: [Maxima] Differentiation in sum In-Reply-To: <86469e5f0901091332p77738a90lf3d85ab60b234059@mail.gmail.com> References: <86469e5f0901091332p77738a90lf3d85ab60b234059@mail.gmail.com> Message-ID: <200901111507.03391.al@beshenov.ru> On Saturday 10 January 2009 00:32:06 Mykhailo Korbakov wrote: > I'm very new to Maxima and symbolic computations at all, so please, > don't make laugh of me if my question is trivial or stupid :) > > I have a simple polynomial function y:tpsum(i=0, N, w_i*x^i) > Is it possible to differentiate by w_1, w_2, w_j symbols? I'm > getting '0' for result of diff(y, w_1). That's definitely not the > 'x' I was hoping to obtain. 1. What is "tpsum"? I think Maxima doesn't know such function. 2. "w_1" is not "w_i at i=1". Maxima uses brackets for subscripted names. 3. If you want to differentiate \sum_{i=0}^N w_i x^i, then the correct expression would be diff(sum(w[i]*x^i,i,0,N), w[1]), but Maxima will return 0 unless you fix N. -- Sweetmorn, Chaos 11 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From adammaj1 at o2.pl Sun Jan 11 06:48:09 2009 From: adammaj1 at o2.pl (Adam Majewski) Date: Sun, 11 Jan 2009 13:48:09 +0100 Subject: [Maxima] carg (?) bug Message-ID: Hi, I make complex number in exponential form : R:16; T:1/3; Z:R*exp(T*%i*2*%pi); output is : 16*((sqrt(3)*%i)/2-1/2) Then check radius : r:abs(Z) 16 it is good , but carg : (%i6) t:carg(Z) (%o6) (2*%pi)/3 It gives 2/3 not 1/3 . Is it a bug ? Adam PS On image on page : http://fraktal.republika.pl/q_iteration.html it is a point z2 and it is on ray 1/3 not 2/3 ======== code ============== R:16; T:1/3; Z:R*exp(T*%i*2*%pi); r:abs(Z); t:carg(Z); z:r*exp(t*%i*2*%pi); ====== output ============== (%i2) R:16 (%o2) 16 (%i3) T:1/3 (%o3) 1/3 (%i4) Z:R*exp(T*%i*2*%pi) (%o4) 16*((sqrt(3)*%i)/2-1/2) (%i5) r:abs(Z) (%o5) 16 (%i6) t:carg(Z) (%o6) (2*%pi)/3 (%i7) z:r*exp(t*%i*2*%pi) (%o7) 16*%e^((4*%i*%pi^2)/3) From al at beshenov.ru Sun Jan 11 07:00:31 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Sun, 11 Jan 2009 16:00:31 +0300 Subject: [Maxima] carg (?) bug In-Reply-To: References: Message-ID: <200901111600.31894.al@beshenov.ru> On Sunday 11 January 2009 15:48:09 Adam Majewski wrote: > Hi, > > I make complex number in exponential form : > R:16; > T:1/3; > Z:R*exp(T*%i*2*%pi); > > output is : > 16*((sqrt(3)*%i)/2-1/2) > > Then check radius : > > r:abs(Z) > 16 > > it is good , but carg : > > (%i6) t:carg(Z) > (%o6) (2*%pi)/3 > > It gives 2/3 not 1/3 . > Is it a bug ? No. Complex argument of z is defined as angle \theta (-\pi < \theta <= \pi) such that z = |z| exp (\theta i). So is is clear that carg(R*exp(T*%i*2*%pi)) = 2*%pi*T. -- Sweetmorn, Chaos 11 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From adammaj1 at o2.pl Sun Jan 11 07:14:40 2009 From: adammaj1 at o2.pl (Adam Majewski) Date: Sun, 11 Jan 2009 14:14:40 +0100 Subject: [Maxima] carg (?) bug In-Reply-To: <200901111600.31894.al@beshenov.ru> References: <200901111600.31894.al@beshenov.ru> Message-ID: Alexey Beshenov pisze: > On Sunday 11 January 2009 15:48:09 Adam Majewski wrote: >> Hi, >> >> I make complex number in exponential form : >> R:16; >> T:1/3; >> Z:R*exp(T*%i*2*%pi); >> >> output is : >> 16*((sqrt(3)*%i)/2-1/2) >> >> Then check radius : >> >> r:abs(Z) >> 16 >> >> it is good , but carg : >> >> (%i6) t:carg(Z) >> (%o6) (2*%pi)/3 >> >> It gives 2/3 not 1/3 . >> Is it a bug ? > > No. Complex argument of z is defined as angle \theta > (-\pi < \theta <= \pi) such that z = |z| exp (\theta i). > > So is is clear that carg(R*exp(T*%i*2*%pi)) = 2*%pi*T. > You are right. It's my bug. (:-( Sorry. it should be : carg_t(z):=carg(z)/(2*%pi); /* argument of complex number in turns */ R:16; T:1/3; Z:R*exp(T*%i*2*%pi); r:abs(Z); t:carg_t(Z); z:r*exp(t*%i*2*%pi); S From adammaj1 at o2.pl Sun Jan 11 08:01:09 2009 From: adammaj1 at o2.pl (Adam Majewski) Date: Sun, 11 Jan 2009 15:01:09 +0100 Subject: [Maxima] carg (?) bug In-Reply-To: <200901111600.31894.al@beshenov.ru> References: <200901111600.31894.al@beshenov.ru> Message-ID: Alexey Beshenov pisze: > On Sunday 11 January 2009 15:48:09 Adam Majewski wrote: >> Hi, >> >> I make complex number in exponential form : >> R:16; >> T:1/3; >> Z:R*exp(T*%i*2*%pi); >> >> output is : >> 16*((sqrt(3)*%i)/2-1/2) >> >> Then check radius : >> >> r:abs(Z) >> 16 >> >> it is good , but carg : >> >> (%i6) t:carg(Z) >> (%o6) (2*%pi)/3 >> >> It gives 2/3 not 1/3 . >> Is it a bug ? > > No. Complex argument of z is defined as angle \theta > (-\pi < \theta <= \pi) such that z = |z| exp (\theta i). > > So is is clear that carg(R*exp(T*%i*2*%pi)) = 2*%pi*T. > better version : ( carg gives negative values fo numbers below horizontal ( x ) axis "(...) produces results in the range (??, ?] It can be mapped to [0, 2?) by adding 2? to the negative values" so /* principial value of argument of complex number in turns */ carg_pv_t(z):=block( [t], t:carg(z)/(2*%pi), /* now in turns */ if t<0 then t:t+1, /* map from (-pi,pi] to [0, 2?) */ return(t) )$ Adam From macrakis at alum.mit.edu Sun Jan 11 12:53:35 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 11 Jan 2009 13:53:35 -0500 Subject: [Maxima] Nonsimplifying nounforms: abs, realpart, carg, etc. (maxima-Bugs-902290) Message-ID: <8b356f880901111053m56950e63pe4f523d27445ed8e@mail.gmail.com> In https://sourceforge.net/tracker/?func=detail&atid=104933&aid=902290&group_id=4933, there has been some discussion of a bug report of mine, which I think is worth discussing on the larger list. The bug is that some nounforms, like realpart(1), do not simplify. Dieter Kaiser suggests (2009-01-11 15:05): >>>>>>>>>> It seems to be not difficult to extend the functions realpart and imagpart to simplifying functions. That is the code which is necessary:... (defun simp-realpart (x y simpflag) (oneargcheck x) (setq y (simpcheck (cadr x) simpflag)) (cond ((taylorize (mop x) (second x))) (t (car (trisplit y))))) ...The functions work as expected as simlifying functions. <<<<<<<<<< This change assumes that the simplification of a nounform is the same thing as the evaluation of verbs. The Maxima design philosophy is quite different from this -- please see my comment of 2007-07-14 22:24 in the bug report for more detail. To summarize: Simplification is supposed to be a relatively low-cost, local transformation of an expression. It is *not* supposed to change the expression radically or put it into canonical form. Thus, for example, the general simplifier (as opposed to the CRE subsystem) does *not* perform GCDs on quotients ((x^2-1)/(x-1) remains as-is), expansions of polynomials, etc. It is appropriate for 'cabs(-3) => 3; 'cabs(x) => abs(x) (if x is real); etc., but NOT appropriate for 'cabs(w+z) (where w and z are complex to simplify to sqrt(('realpart(z)+'realpart(w))^2+('imagpart(z)+'imagpart(w))^2). Calling trisplit from the simplifying function violates this understanding of simplification. -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090111/52b8e9cb/attachment.htm From drdieterkaiser at web.de Sun Jan 11 17:49:27 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Mon, 12 Jan 2009 00:49:27 +0100 Subject: [Maxima] Nonsimplifying nounforms: abs, realpart, carg, etc. (maxima-Bugs-902290) In-Reply-To: <028A01EE71FA474E9F48080566839F1F@Kaiser> References: <028A01EE71FA474E9F48080566839F1F@Kaiser> Message-ID: <1231717767.5608.130.camel@dieter-laptop> ________________________________________________________________________ > Von:macrakis at gmail.com [mailto:macrakis at gmail.com] Im Auftrag von > Stavros Macrakis > Gesendet: Sonntag, 11. Januar 2009 19:54 > An: maxima at math.utexas.edu > Cc: Dieter Kaiser > Betreff: Nonsimplifying nounforms: abs, realpart, carg, etc. > (maxima-Bugs-902290) > The bug is that some nounforms, like realpart(1), do not simplify. To have this simplification we need a function which can be called by the simplifier. I think we have the following options: 1. Implement a simplifying function like sin, cos, ... Evaluation and simplification is done by a function which is called only by the simplifer. No VERB function is needed. The decision is: Should the functions for the complex components including realpart and imagpart be simplifying functions or not. The next question is: Can we use a call to trisplit to get a simplified expressions. What should be improved e.g. 'realpart(z+w) --> realpart(z+w) and not realpart(z)+realpart(w)? 2. Implement VERB/NOUN concept like diff, integrate, ... Implement both functions: The VERB function is called by the Maxima user. The NOUN function again is called only by the simplifier and supports some elementary simplifications e.g. like 'diff(x,x)--> 1 or 'integrate(0,x) --> 0. The decision is: What code should be duplicated for the simplifier function e.g. 'realpart(x) --> x for all symbols not declared to be complex and real numbers. Should complex numbers also be included like 'realpart(x+%i*y) --> x ? 3. Do nothing In this case 'realpart(1) --> realpart(1) is not a bug. A simplification is not supported. Dieter Kaiser From macrakis at alum.mit.edu Sun Jan 11 22:21:20 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sun, 11 Jan 2009 23:21:20 -0500 Subject: [Maxima] Nonsimplifying nounforms: abs, realpart, carg, etc. (maxima-Bugs-902290) In-Reply-To: <1231717767.5608.130.camel@dieter-laptop> References: <028A01EE71FA474E9F48080566839F1F@Kaiser> <1231717767.5608.130.camel@dieter-laptop> Message-ID: <8b356f880901112021p37eb5a8cyca6901586413ffdd@mail.gmail.com> Dieter, I agree that those are the three implementation options, which correspond to three different kinds of behavior for the user. If you agree with my arguments above, that the noun and the verb in the case of realpart/etc. should be distinct, then only implementation (2) will work. As you point out, if we *do* decide to make it both a simplifying function and a verb (which is what I propose), then we will have to decide exactly what simplifications to incorporate. > ...What should be improved e.g. > 'realpart(z+w) --> realpart(z+w) and not realpart(z)+realpart(w)? I don't think that would not be an improvement. In particular, realpart(z+w)-realpart(z) would not simplify to realpart(w). The general simplifier works best when arithmetic operations are exposed for further simplification. -s From macrakis at alum.mit.edu Sun Jan 11 23:40:09 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 12 Jan 2009 00:40:09 -0500 Subject: [Maxima] Nonsimplifying nounforms: abs, realpart, carg, etc. (maxima-Bugs-902290) In-Reply-To: <8b356f880901112021p37eb5a8cyca6901586413ffdd@mail.gmail.com> References: <028A01EE71FA474E9F48080566839F1F@Kaiser> <1231717767.5608.130.camel@dieter-laptop> <8b356f880901112021p37eb5a8cyca6901586413ffdd@mail.gmail.com> Message-ID: <8b356f880901112140q866279dpad9ed69047c78505@mail.gmail.com> On Sun, Jan 11, 2009 at 11:21 PM, Stavros Macrakis wrote: > I don't think that would not be an improvement. Oops. I meant of course either: > I don't think that would be an improvement. or > I think that would not be an improvement. -s From jack.schmidt at sbcglobal.net Mon Jan 12 12:35:29 2009 From: jack.schmidt at sbcglobal.net (Jack Schmidt) Date: Mon, 12 Jan 2009 10:35:29 -0800 Subject: [Maxima] pw 2.5 is ready Message-ID: <496B8D71.2040700@sbcglobal.net> [ New subscriber to this list and new user of Maxima ] Richard, Your piecewise work is exactly what I've been looking for these past couple of years. I'm an engineer and I want to solve some statistical problems symbolically. Screw Monte Carlo! Anyway, pw doesn't show up on http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/share/contrib/ and comcast says http://home.comcast.net/~rvh2007/site/?/page/Maxima_Page/ is temporarily unavailable, and it was also unavailable last night. In a previous message you say that maybe pw isn't ready for share/contrib, so should I assume that you took it down? If so, I'd be happy with an alpha version or even pre-alpha, and I'd be happy to relate my experiences with it. I'm running Maxima on Win Vista using the executable from sourceforge, though I could switch to Fedora Linux if necessary. I also have a stupid newbie question. I downloaded abs_integrate.mac from sourceforge and put it in c:/maxima/mac/ and then: (C4) LOAD("abs_integrate.mac"); Could not find `opsubst' using paths in FILE_SEARCH_MAXIMA,FILE_SEARCH_LISP (combined values: [./###.{mc,mac}, C:/maxima/{mac,sym}/###.mac, C:/maxima/{share,share1,share2,tensor}/###.mc, ./###.{o,lsp,lisp}, C:/maxima/{src,share1,sym}/###.o, C:/maxima/{src,share1,sym}/###.o, C:/maxima/{src,share1}/###.lisp, C:/maxima/{sym}/###.lsp] ) -- an error. Quitting. To debug this try DEBUGMODE(TRUE);) What am I doing wrong? Thanks. Jack Schmidt From willisb at unk.edu Mon Jan 12 13:07:55 2009 From: willisb at unk.edu (Barton Willis) Date: Mon, 12 Jan 2009 13:07:55 -0600 Subject: [Maxima] pw 2.5 is ready In-Reply-To: <496B8D71.2040700@sbcglobal.net> References: <496B8D71.2040700@sbcglobal.net> Message-ID: maxima-bounces at math.utexas.edu wrote on 01/12/2009 12:35:29 PM: > I also have a stupid newbie question. I downloaded abs_integrate.mac > from sourceforge and put it in c:/maxima/mac/ and then: > (C4) LOAD("abs_integrate.mac"); > Could not find `opsubst' using paths in FILE_SEARCH_MAXIMA,FILE_SEARCH_LISP What Maxima version are you using? What is the output of build_info()? I'm puzzled because "opsubst" has been in Maxima for a few years, I think. Also, did you do something that might alter the values of FILE_SEARCH_LISP? Try load("opsubst") in the first command line. If that doesn't load the file, is there something in your maxima-init file that alters FILE_SEARCH_LISP? Maybe Richard Hennessy can help you locate the latest pw.mac. Welcome to Maxima. Barton From jack.schmidt at sbcglobal.net Mon Jan 12 15:07:21 2009 From: jack.schmidt at sbcglobal.net (Jack Schmidt) Date: Mon, 12 Jan 2009 13:07:21 -0800 Subject: [Maxima] pw 2.5 is ready In-Reply-To: References: <496B8D71.2040700@sbcglobal.net> Message-ID: <496BB109.20406@sbcglobal.net> Barton Willis wrote: > What Maxima version are you using? Uh-oh. Reviewing my route to Maxima, I find that I downloaded the Windows executable NOT from sourceforge but from a link in http://www.ma.utexas.edu/maxima.html -- at which I arrived from google ("Maxima algebra -Nissan"). Maxima's first output line says, "Maxima 5.5 Tue Dec 5 16:55:33 2000 (with enhancements by W. Schelter)." !! Pre-memorial! Somehow I overlooked the bright red text on the utexas page that says the page is no longer maintained. I re-installed from sourceforge and I'm now running 5.17.0. load("abs_integrate") now works. By the way, I don't know where abs_integrate.mac should reside canonically, so I just put it in C:/Program Files/Maxima-5.17.0/share/maxima/5.17.0/share/ Thanks for the advice and the kind welcome. -- Jack Schmidt From fateman at cs.berkeley.edu Mon Jan 12 22:08:55 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Mon, 12 Jan 2009 20:08:55 -0800 Subject: [Maxima] hgfred Message-ID: <496C13D7.2000406@cs.berkeley.edu> I just had occasion to try hgfred. There are errors in simplification in this program that allow it to generate subexpressions like (1- -x) or even (1 - -36). Someone is producing expressions with incorrect ((mtimes simp)..) headers. Unfortunately I didn't catch the examples before my system crashed. But there are other probs. as an example, consider i3(m,k,a,x):=(x^(1 + m)*(a^2 + x^2)^k*hgfred([(1 + m)/2, -k], [1 + (1 + m)/2], -(x^2/a^2))/((1 + m)*(1 + x^2/a^2)^k)); i3(m,k,a,x) should, I think, be the integral of x^m*(x^2+a^2)^k. The following example (and many others) give odd messages like SIMP2F1-WILL-CONTINUE-IN i3(2,3/2,a,x) i3(0,1,a,x) [also says FAIL-1-IN-C-1-CASE] i3(1,1/2,a,x) [gives "non-variable 2nd argument to diff, -x^2/a^2] also some of the answers come out in terms of jacobi_p functions, but diff does not know about them. Thanks for help RJF From David.Billinghurst at riotinto.com Mon Jan 12 22:36:51 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Tue, 13 Jan 2009 15:36:51 +1100 Subject: [Maxima] hgfred References: <496C13D7.2000406@cs.berkeley.edu> Message-ID: <026DCC31AB859648A6F16C0E5CD2580D01789E34@calttsv025.cal.riotinto.org> > From: Richard Fateman> > I just had occasion to try hgfred. There are errors in > simplification in this program that allow it to generate > subexpressions like (1- -x) or even (1 - -36). Someone is producing > expressions with incorrect ((mtimes simp)..) headers. > Unfortunately I didn't catch the examples before my system > crashed. But there are other probs. > > as an example, consider > i3(m,k,a,x):=(x^(1 + m)*(a^2 + x^2)^k*hgfred([(1 + m)/2, -k], > [1 + (1 + m)/2], -(x^2/a^2))/((1 + m)*(1 + x^2/a^2)^k)); > > i3(m,k,a,x) > should, I think, be the integral of x^m*(x^2+a^2)^k. > > The following example (and many others) give odd messages > like SIMP2F1-WILL-CONTINUE-IN > > i3(2,3/2,a,x) > > i3(0,1,a,x) [also says FAIL-1-IN-C-1-CASE] > i3(1,1/2,a,x) [gives "non-variable 2nd argument to diff, -x^2/a^2] > > also some of the answers come out in terms of jacobi_p > functions, but diff does not know about them. Coincidentally I was looking through the code in hypgeo.lisp as I want to document the special functions defined and used by hgfred and specint there. I also downloaded a copy of Yannis Avgoustis' thesis from http://dspace.mit.edu/handle/1721.1/16269 At present there are multiple versions of some of the special functions. For example: %he[n](x) and hermite(n,x) for Hermite polynomials %t[n](x) and chebechev_t(n,x) for Chebychev polynomials %p[n,a,b](x) and jacobi_p(n,a,b,x) for Jacobi polynomials maxima cannot differentiate the older % forms, and I have not (yet) found any use of them outside hgfred and specint. Once I understand the code better I may propose a consolidation. This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. From LindnerW at t-online.de Tue Jan 13 06:22:12 2009 From: LindnerW at t-online.de (Wolfgang Lindner) Date: Tue, 13 Jan 2009 13:22:12 +0100 Subject: [Maxima] wxMaxima cells Message-ID: <000f01c97579$95c9e920$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> dear group, I would like to use wxMaxima as a presentation tool. The new input/text cells offer a first possibility to hide/show it's contents and to structure the line of presentation. Nice. But if one saves the worksheet the 'filled' markers of the cells are lost. Loading the sheet again one looks to all text and inputs (but not the output, ok). Dear Andrej, would it be possible to save the hide/show status (e.g. the filled/wireframe triange) in the left upper position of a cell and it's contents, too? This way it would be possible to use the hide/show button of the cells to step through an presentation opening the cells with text or code on progress. This would be especially interesting for the text cells containing information for an audience which should be seen later. Thanks for your work on wxMaxima. PS: If someone perfer the 'input edit line of wxMaxima 0.7.x' one can - try to use an older wxMaxima version pointing to the new maxima.exe - or e.g. use Maxima with the GUI of the Euler Math Toolbox: http://mathsrv.ku-eichstaett.de/MGF/homes/grothmann/euler/index.html hth Wolfgang From raymond.toy at ericsson.com Tue Jan 13 07:45:16 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Tue, 13 Jan 2009 08:45:16 -0500 Subject: [Maxima] hgfred In-Reply-To: <496C13D7.2000406@cs.berkeley.edu> (Richard Fateman's message of "Mon, 12 Jan 2009 20:08:55 -0800") References: <496C13D7.2000406@cs.berkeley.edu> Message-ID: >>>>> "Richard" == Richard Fateman writes: Richard> I just had occasion to try hgfred. There are errors in simplification in Richard> this program that allow it to generate Richard> subexpressions like (1- -x) or even (1 - -36). Someone is producing Richard> expressions with incorrect ((mtimes simp)..) Richard> headers. Unfortunately I didn't catch the examples before my system Richard> crashed. But there are other probs. If you could produce examples of this, I'll try to fix them. [snip] Richard> The following example (and many others) give odd messages like Richard> SIMP2F1-WILL-CONTINUE-IN Richard> i3(2,3/2,a,x) Richard> i3(0,1,a,x) [also says FAIL-1-IN-C-1-CASE] Richard> i3(1,1/2,a,x) [gives "non-variable 2nd argument to diff, -x^2/a^2] These are all left overs from the original implementation. Some have been removed or hidden, but others have been left in as a gentle reminder to me to fix them. Richard> also some of the answers come out in terms of jacobi_p functions, but Richard> diff does not know about them. I think you need to load Barton's orthopoly to tell maxima about these functions. Ray From raymond.toy at ericsson.com Tue Jan 13 07:49:03 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Tue, 13 Jan 2009 08:49:03 -0500 Subject: [Maxima] hgfred In-Reply-To: <026DCC31AB859648A6F16C0E5CD2580D01789E34@calttsv025.cal.riotinto.org> (David Billinghurst's message of "Tue, 13 Jan 2009 15:36:51 +1100") References: <496C13D7.2000406@cs.berkeley.edu> <026DCC31AB859648A6F16C0E5CD2580D01789E34@calttsv025.cal.riotinto.org> Message-ID: >>>>> "David" == David Billinghurst writes: David> Coincidentally I was looking through the code in hypgeo.lisp as I David> want to document the special functions defined and used by hgfred David> and specint there. I also downloaded a copy of Yannis Avgoustis' David> thesis from http://dspace.mit.edu/handle/1721.1/16269 This is great! I've benn looking for that for a while. It will help a lot to understand the code. There are some parts of the code where the implementation is clearly incomplete, but I never quite figured out how to invoke it to see what kinds of problems it was trying to solve. David> At present there are multiple versions of some of the special David> functions. For example: David> %he[n](x) and hermite(n,x) for Hermite polynomials David> %t[n](x) and chebechev_t(n,x) for Chebychev polynomials David> %p[n,a,b](x) and jacobi_p(n,a,b,x) for Jacobi polynomials These are left overs. The % functions were the original versions. The latter names match Barton's orthopoly functions and were added later. All of the % names should go away, eventually. Well, except I think %he is not hermite. It's a scaled Hermite function. And some of the functions don't yet exist (Whittaker's M, W, %d, etc.) anywhere else in Maxima. Ray From fateman at cs.berkeley.edu Tue Jan 13 09:27:52 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 13 Jan 2009 07:27:52 -0800 Subject: [Maxima] hgfred also orthopoly? In-Reply-To: References: <496C13D7.2000406@cs.berkeley.edu> Message-ID: <496CB2F8.6040407@cs.berkeley.edu> More probs, jacobi_p(1,1/2,-2,1.125); --> interval(1.53125,2.6797208657787516*10^-15) This would be good if everyone else agreed about intervals and knew how to process them, but they don't, yet. Right now there appears to be no mention of interval in the documentation. jacobi_p(1,1/2,-2,1,x); %,x=1.125 --> 1.53125 which happens to be what I wanted. where did this come from? consider: i3(m,k,a,x):=(x^(1+m)*(a^2+x^2)^k*hgfred([(1+m)/2,-k],[1+(1+m)/2],-x^2/a^2))/((1+m)*(1+x^2/a^2)^k); then z: i3(0,1,2,0,0.5) produces 1.333333333333333*jacobi_p(1.0,0.5,-2.0,1.125). But it should have computed the value of jacobi_p, no?? After trying many ways to evaluate this, the first that worked was ratsimp(z), %,numer. but that returned an interval expression. huh? Also, at the risk of putting too many disparate complaints in the same message... ? hypergeometric might have some kind of entry in the on-line info. ?? hypergeometric might have a link to hgfred. Thanks RJF From raymond.toy at ericsson.com Tue Jan 13 10:53:59 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Tue, 13 Jan 2009 11:53:59 -0500 Subject: [Maxima] hgfred also orthopoly? In-Reply-To: <496CB2F8.6040407@cs.berkeley.edu> References: <496C13D7.2000406@cs.berkeley.edu> <496CB2F8.6040407@cs.berkeley.edu> Message-ID: <496CC727.6070308@ericsson.com> Richard Fateman wrote: > Also, at the risk of putting too many disparate complaints in the same > message... > ? hypergeometric might have some kind of entry in the on-line info. > ?? hypergeometric might have a link to hgfred. > My excuse for not putting any documentation for hgfred is that I never felt hgfred was ready for that. hgfred should be buried inside the simplifier for hypergeometric functions. But Maxima has no support for hypergeometric functions. Hence, no documentation. Anyway, that's my excuse. Ray From fateman at cs.berkeley.edu Tue Jan 13 11:23:22 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 13 Jan 2009 09:23:22 -0800 Subject: [Maxima] hipow gives unexpected answer Message-ID: <496CCE0A.5060500@cs.berkeley.edu> hipow( x^m*(x^2+a^2)^k,x) gives max(2,m), which probably is wrong, I think max(2*k+m, m) might be right, assuming k could be either positive or negative. or maybe a punt to a noun form? RJF From raymond.toy at ericsson.com Tue Jan 13 11:54:16 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Tue, 13 Jan 2009 12:54:16 -0500 Subject: [Maxima] hgfred In-Reply-To: <026DCC31AB859648A6F16C0E5CD2580D01789E34@calttsv025.cal.riotinto.org> References: <496C13D7.2000406@cs.berkeley.edu> <026DCC31AB859648A6F16C0E5CD2580D01789E34@calttsv025.cal.riotinto.org> Message-ID: <496CD548.1060606@ericsson.com> Billinghurst, David (RTATECH) wrote: >> From: Richard Fateman> >> I just had occasion to try hgfred. There are errors in >> simplification in this program that allow it to generate >> subexpressions like (1- -x) or even (1 - -36). Someone is producing >> expressions with incorrect ((mtimes simp)..) headers. >> Unfortunately I didn't catch the examples before my system >> crashed. But there are other probs. >> >> as an example, consider >> i3(m,k,a,x):=(x^(1 + m)*(a^2 + x^2)^k*hgfred([(1 + m)/2, -k], >> [1 + (1 + m)/2], -(x^2/a^2))/((1 + m)*(1 + x^2/a^2)^k)); >> >> i3(m,k,a,x) >> should, I think, be the integral of x^m*(x^2+a^2)^k. >> >> The following example (and many others) give odd messages >> like SIMP2F1-WILL-CONTINUE-IN >> >> i3(2,3/2,a,x) >> >> i3(0,1,a,x) [also says FAIL-1-IN-C-1-CASE] >> i3(1,1/2,a,x) [gives "non-variable 2nd argument to diff, -x^2/a^2] >> >> also some of the answers come out in terms of jacobi_p >> functions, but diff does not know about them. >> > > Coincidentally I was looking through the code in hypgeo.lisp as I > want to document the special functions defined and used by hgfred > and specint there. I also downloaded a copy of Yannis Avgoustis' > thesis from http://dspace.mit.edu/handle/1721.1/16269 > > After skimming over the thesis, I see that somethings are broken in maxima compared to the thesis. For example, on page 66, we have 2F1[3/4, 5/4; 1/2; z^2]. Maxima says this is 1/2*((z+1)^(-3/2)+(1-z)^(-3/2)), which is different from the expected answer of 1/6*(1+z)^(-3/2)+5/6*(1-z)^(-3/2). On page 84, we have 2F1(a+5/6, a+7/3; 2*a+23/3; 4*z*(1-z)). Maxima gives an error about 2nd arg to diff is a non-variable. (I probably introduced that bug). If we repalce 4*z*(1-z) with z, maxima now returns something long expression with false in it. That's clearly wrong. The thesis also describes various quadratic and cubic transformations. I don't think hgfred does any of those, except in specific cases a quadratic transformation is done. Anyway, having this document will certainly help to improve what we have now. Ray From maxima at mgenovese.otherinbox.com Tue Jan 13 14:57:21 2009 From: maxima at mgenovese.otherinbox.com (maxima at mgenovese.otherinbox.com) Date: Tue, 13 Jan 2009 15:57:21 -0500 Subject: [Maxima] Windows environment variables needed for xMaxima and wxMaxima Message-ID: <200901132057.n0DKvKXA018519@box7.911domain.com> An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090113/a2652f6e/attachment.htm From fateman at cs.berkeley.edu Tue Jan 13 15:56:29 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 13 Jan 2009 13:56:29 -0800 Subject: [Maxima] hipow gives unexpected answer In-Reply-To: <496CCE0A.5060500@cs.berkeley.edu> References: <496CCE0A.5060500@cs.berkeley.edu> Message-ID: <496D0E0D.6090104@cs.berkeley.edu> Richard Fateman wrote: > hipow( x^m*(x^2+a^2)^k,x) > > gives max(2,m), which probably is wrong, I think max(2*k+m, m) might > be right, assuming > k could be either positive or negative. > > or maybe a punt to a noun form? > > RJF > > > Actually, reading the documentation for hipow suggests that the behavior is documented, (but perhaps unfortunate in its specification...) RJF From David.Billinghurst at riotinto.com Tue Jan 13 16:45:39 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Wed, 14 Jan 2009 09:45:39 +1100 Subject: [Maxima] hgfred also orthopoly? References: <496C13D7.2000406@cs.berkeley.edu> <496CB2F8.6040407@cs.berkeley.edu> Message-ID: <026DCC31AB859648A6F16C0E5CD2580D0180A7D0@calttsv025.cal.riotinto.org> > Also, at the risk of putting too many disparate complaints in > the same message... > ? hypergeometric might have some kind of entry in the on-line info. > ?? hypergeometric might have a link to hgfred. Noted. Am documenting exisiting practice for special functions at present. This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. From van.nek at arcor.de Wed Jan 14 01:16:30 2009 From: van.nek at arcor.de (van Nek) Date: Wed, 14 Jan 2009 08:16:30 +0100 Subject: [Maxima] Windows environment variables needed for xMaxima and wxMaxima In-Reply-To: <200901132057.n0DKvKXA018519@box7.911domain.com> References: <200901132057.n0DKvKXA018519@box7.911domain.com> Message-ID: <496D9F5E.16408.1ECD31@van.nek.arcor.de> Hi Matt, what is the reason that you don't want to use the installer to install Maxima? The installer works perfectly. Since version 5.9.0 I install and uninstall without any problems on Windows 2k and XP. Also a parallel installation of different Maxima versions is possible. Volker van Nek Am 13 Jan 2009 um 15:57 hat maxima at mgenovese.otherinbox.com geschrieben: > > Just requesting again for some help with the Windows env vars required to run XMaxima / > wxMaxima. Thanks much, > Matt > > > ------------------------------------------------------------ > I installed Maxima 5.17.0 (but have tried 5.17.1 too), and am trying to figure out exactly what the > Windows installer does to the Windows XP registry, and environment. Just a list of additions and > changes would be perfect. I don't see it documented, but perhaps I'm not looking in the right > place. > > I have unsuccessfully tried to duplicate the environment so the installer wouldn't be required. As > I have tried to recreate the environment (without the installer's help), I ran into an issue where I > started XMaxima, and upon killing it, another XMaxima pops up again. Even using the Windows > task manager, I can't seem to ever kill the process without another one popping up. Only way is > to reboot. > > Any help appreciated. Thanks, > > Matt > Austin, TX > -- > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From van.nek at arcor.de Wed Jan 14 01:53:31 2009 From: van.nek at arcor.de (van Nek) Date: Wed, 14 Jan 2009 08:53:31 +0100 Subject: [Maxima] Windows environment variables needed for xMaxima and wxMaxima In-Reply-To: <200901140730.n0E7UKAA024596@box7.911domain.com> References: <200901140730.n0E7UKAA024596@box7.911domain.com> Message-ID: <496DA80B.26071.40B0F9@van.nek.arcor.de> Some years ago I used Veritas WinINSTALL LE (which i believe comes with the Windows adminpak) to create msi files for deploying them by group policies to clients in a Windows domain. Perhaps you know it. I had to install once on a test computer and WinINSTALL creates the msi file. This worked easily with Maxima but not with all other software, so I dropped this method. Today I use installation scripts but using some image creating software would be definitely better. So it seems that I can't help. I don't know if these things are written down somewhere. To figure it out I would install Maxima on a fresh Windows a search for "maxima" in the registry. Hope someone knows a less intensive method. Volker Am 14 Jan 2009 um 2:30 hat maxima at mgenovese.otherinbox.com geschrieben: > Hi Volker, > I'm deploying to multiple workstations as an image, and I'd rather not go through the whole install > process each time.Rather, I want to drop in the directory structure + files, and setup the env > vars + any registry settings that way. However, unless I'm missing it, I don't see documentation > about what is changed in the Windows environment and registry. > Thanks, > Matt > > ------------------------------------------------------------ > Hi Matt, > what is the reason that you don't want to use the installer to install Maxima? The installer > works perfectly. Since version 5.9.0 I install and uninstall without any problems on Windows > 2k and XP. Also a parallel installation of different Maxima versions is possible. > Volker van Nek > Am 13 Jan 2009 um 15:57 hat maxima at mgenovese.otherinbox.com geschrieben: > > > > Just requesting again for some help with the Windows env vars required to run XMaxima / > > wxMaxima. Thanks much, > > Matt > > > > > >------------------------------------------------------------ > > I installed Maxima 5.17.0 (but have tried 5.17.1 too), and am trying to figure out exactly what > the > > Windows installer does to the Windows XP registry, and environment. Just a list of additions > and > > changes would be perfect. I don't see it documented, but perhaps I'm not looking in the right > > place. > > > > I have unsuccessfully tried to duplicate the environment so the installer wouldn't be required. > As > > I have tried to recreate the environment (without the installer's help), I ran into an issue where I > > started XMaxima, and upon killing it, another XMaxima pops up again. Even using the > Windows > > task manager, I can't seem to ever kill the process without another one popping up. Only way > is > > to reboot. > > > > Any help appreciated. Thanks, > > > > Matt > > Austin, TX > > -- > > > > _______________________________________________ > > Maxima mailing list > > Maxima at math.utexas.edu > > http://www.math.utexas.edu/mailman/listinfo/maxima > > > From al at beshenov.ru Wed Jan 14 03:12:59 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Wed, 14 Jan 2009 12:12:59 +0300 Subject: [Maxima] Windows environment variables needed for xMaxima and wxMaxima In-Reply-To: <200901132057.n0DKvKXA018519@box7.911domain.com> References: <200901132057.n0DKvKXA018519@box7.911domain.com> Message-ID: <200901141213.00104.al@beshenov.ru> On Tuesday 13 January 2009 23:57:21 maxima at mgenovese.otherinbox.com wrote: > Just requesting again for some help with the Windows env vars > required to run XMaxima / wxMaxima.? Thanks much, Matt I think you should check /maxima.iss (see CVS or source distribution). -- Prickle Prickle, Chaos 14 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From raymond.toy at ericsson.com Fri Jan 16 11:07:20 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Fri, 16 Jan 2009 12:07:20 -0500 Subject: [Maxima] Simplification and alike1 Message-ID: I was looking at hgfred([A+5/6,A+7/3],[2*A+23/3],4*z*(1-z)). Currently, this fails because there is a call to hyp-cos (in hyp.lisp) with arguments a = A+11/6, b = A+7/3, c = 2*(A+11/6)+1. There is a test (alike1 (add 1 (mul 2 a1)) c) that fails. (a1 = (a+b-1/2)/2 = (2*A+11/3)/2) We want this test to succeed because 2*a1+1 actually does equal c, when everything is expanded out. What is the best way to achieve this? I could call $expand or $ratsimp in hyp-cos, but I'm not sure what is right, or if something else should be used. (Even if this is fixed, the result, it's hard to tell if the answer is correct or not. It differs from the answer given in Avgoustis' thesis.) Ray From aphongka at yandex.ru Fri Jan 16 11:20:31 2009 From: aphongka at yandex.ru (Alexey Afanasyev) Date: Fri, 16 Jan 2009 20:20:31 +0300 Subject: [Maxima] Using maxima in C++ app Message-ID: <4970C1DF.2030202@yandex.ru> Hi everyone, I am a newbie in Maxima. I am writing a program in C++ and wish to use Maxima in it. How can I interoperate with Maxima? I have found that one of the possible ways is using sockets. Is this the only way? Is there any documentation on the topic? Thanks. Best regards, Alexey From drdieterkaiser at web.de Fri Jan 16 15:13:03 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 16 Jan 2009 22:13:03 +0100 Subject: [Maxima] Assignment to $ind in itensor? Message-ID: Today, I have checked out a check to prevent an assignment to a symbol which is declared to be a SYSCONST. This is related to the bug report SF[783847] "assignments to %i, inf, ...". All works well, but I have seen to late that we have got a problem with the test file rtest_intensor.mac from the share_testsuite. I thougt it would be a good idea to prevent the assignment to a system constant. But it seems to be that we have an assignment to the symbol $ind. I have not found the problem and do not know the code of itensor. Can this be easy cured? Running tests in rtest_itensor: ********************** Problem 41 *************** Input: factor(canform(extdiff(p([j,k]),i))) Result: ind improper value assignment ?error\-catch This differed from the expected result: (p([i,j],[],k)-p([i,k],[],j)+p([j,k],[],i))/3 ********************** Problem 42 *************** Input: extdiff(a([j]) ~ b([k]),k) Result: ind improper value assignment ?error\-catch This differed from the expected result: 0 ********************** Problem 43 *************** Input: factor(a([i2]) ~ b([i1]) | a+a([i1]) ~ b([i2]) | a) Result: ind improper value assignment ?error\-catch This differed from the expected result: 0 ********************** Problem 44 *************** Input: canform(liediff(v,extdiff(a([i1]),i2))-extdiff(liediff(v,a([i1])),i2)) Result: ind improper value assignment ?error\-catch This differed from the expected result: 0 53/57 tests passed. Dieter Kaiser From raymond.toy at ericsson.com Fri Jan 16 15:27:48 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Fri, 16 Jan 2009 16:27:48 -0500 Subject: [Maxima] Assignment to $ind in itensor? In-Reply-To: References: Message-ID: <4970FBD4.8050509@ericsson.com> Dieter Kaiser wrote: > Today, I have checked out a check to prevent an assignment to a symbol which is > declared to be a SYSCONST. This is related to the bug report SF[783847] > "assignments to %i, inf, ...". > > All works well, but I have seen to late that we have got a problem with the test > file rtest_intensor.mac from the share_testsuite. > > I thougt it would be a good idea to prevent the assignment to a system constant. > But it seems to be that we have an assignment to the symbol $ind. I have not > found the problem and do not know the code of itensor. Can this be easy cured? Maybe these sysconsts should have a different name since they are special to maxima. Since it's %i, not i, maybe it should be %inf, %minf, %ind, %und, etc? This is a pretty big change, though, affecting lots of code. Fortunately, we just did a release, so there's lots of time to fix up the code. :-) Users may not like it, though. Ray From raymond.toy at ericsson.com Fri Jan 16 15:31:42 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Fri, 16 Jan 2009 16:31:42 -0500 Subject: [Maxima] Assignment to $ind in itensor? In-Reply-To: References: Message-ID: <4970FCBE.2070702@ericsson.com> Dieter Kaiser wrote: > Today, I have checked out a check to prevent an assignment to a symbol which is > declared to be a SYSCONST. This is related to the bug report SF[783847] > "assignments to %i, inf, ...". > > All works well, but I have seen to late that we have got a problem with the test > file rtest_intensor.mac from the share_testsuite. > > Also, what about %o1 and friends? Should I be able to assign to them? It works now: (%i1) sin(1.0); (%o1) .8414709848078965 (%i2) %o1:42; (%o2) 42 (%i3) asin(%o1); (%o3) asin(42) Likewise for %i. Ray From drdieterkaiser at web.de Fri Jan 16 16:01:54 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 16 Jan 2009 23:01:54 +0100 Subject: [Maxima] Assignment to $ind in itensor? In-Reply-To: <4970FCBE.2070702@ericsson.com> References: <4970FCBE.2070702@ericsson.com> Message-ID: <1232143314.5751.13.camel@dieter-laptop> Am Freitag, den 16.01.2009, 16:31 -0500 schrieb Raymond Toy: > Dieter Kaiser wrote: > > Today, I have checked out a check to prevent an assignment to a symbol which is > > declared to be a SYSCONST. This is related to the bug report SF[783847] > > "assignments to %i, inf, ...". > > > > All works well, but I have seen to late that we have got a problem with the test > > file rtest_intensor.mac from the share_testsuite. > > > > > Also, what about %o1 and friends? Should I be able to assign to them? > It works now: > > (%i1) sin(1.0); > (%o1) .8414709848078965 > (%i2) %o1:42; > (%o2) 42 > (%i3) asin(%o1); > (%o3) asin(42) > > Likewise for %i. Thank you very much for your fast response. Perhaps, you have recognized that I try to work on the "old" bugs. I think there too much of them. The change to prevent an assignment to the symbols %i, inf, minf, infinity, ind and und was already proposed in 2003. I had a further look at the complete code. I have found an assignment to IND only in the file share/algebra/charset/charsets.mac (95 matches) and share/algegra/charset/test1.mac (2 matches). I am not really sure what to do. It seems to me natural to prevent the assignment to a system constant. Should we allow the assignment to system constants and close the bug report anyway? Another possible would be to prevent the assignment only for %i. Dieter Kaiser From raymond.toy at ericsson.com Fri Jan 16 16:41:20 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Fri, 16 Jan 2009 17:41:20 -0500 Subject: [Maxima] Assignment to $ind in itensor? In-Reply-To: <1232143314.5751.13.camel@dieter-laptop> (Dieter Kaiser's message of "Fri, 16 Jan 2009 23:01:54 +0100") References: <4970FCBE.2070702@ericsson.com> <1232143314.5751.13.camel@dieter-laptop> Message-ID: >>>>> "Dieter" == Dieter Kaiser writes: Dieter> The change to prevent an assignment to the symbols %i, Dieter> inf, minf, infinity, ind and und was already proposed in Dieter> 2003. Yes, and, embarrassingly, I said I'd check in that change too but never did. Dieter> I am not really sure what to do. It seems to me natural to Dieter> prevent the assignment to a system constant. Should we Dieter> allow the assignment to system constants and close the bug Dieter> report anyway? Don't know. It's unfortunate that these system constants have nice short names but are otherwise not distinguished from any other constant or variable. One option (which has been proposed before, I think) is to give them more distinguishable names that are less likely to collide with user variables. Dieter> Another possible would be to prevent the assignment only Dieter> for %i. We should at least do that. Ray From macrakis at alum.mit.edu Fri Jan 16 17:12:04 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 16 Jan 2009 18:12:04 -0500 Subject: [Maxima] Simplification and alike1 In-Reply-To: References: Message-ID: <8b356f880901161512w172f9557re935d4edca442616@mail.gmail.com> On Fri, Jan 16, 2009 at 12:07 PM, Raymond Toy wrote: > ...There is a test (alike1 (add 1 (mul 2 a1)) c) that fails. (a1 = (a+b-1/2)/2 = (2*A+11/3)/2) > We want this test to succeed because 2*a1+1 actually does equal c, when everything is expanded out. > What is the best way to achieve this? I could call $expand or $ratsimp in hyp-cos, but I'm not sure what is right, or if something else should be used. The best way to do this in this case is to check whether is(equal(2*a1+1,c)) (using the appropriate Lisp calls, which I don't remember off the top of my head). This will also take into account the assume database. In general, Maxima's philosophy is that the simplification of f(ex) should not radically change the form of ex or perform expensive operations on it like expand or ratsimp -- if a simplification depends on an argument being in a particular form (e.g. ratsimp'ed or expand'ed), doing that should be left to the user. The general simplifier does not, for example, perform GCDs in divisions so that users don't have (x^100-1)/(x-1) expand into 100 terms. is/equal itself does call ratsimp, and should not be called promiscuously by simplifying functions, but in the case of hypergeometric function order arguments, that seems fine to me. > (Even if this is fixed, the result, it's hard to tell if the answer is > correct or not. It differs from the answer given in Avgoustis' > thesis.) Can't help you with that, sorry. -s From robert.dodier at gmail.com Fri Jan 16 17:15:47 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 16 Jan 2009 16:15:47 -0700 Subject: [Maxima] Assignment to $ind in itensor? In-Reply-To: <4970FBD4.8050509@ericsson.com> References: <4970FBD4.8050509@ericsson.com> Message-ID: On Fri, Jan 16, 2009 at 2:27 PM, Raymond Toy wrote: > Maybe these sysconsts should have a different name since they are > special to maxima. Since it's %i, not i, maybe it should be %inf, > %minf, %ind, %und, etc? How about if we just change ind to indefinite and und to undefined ? ind and und are quite obscure. I'm guessing that changing them wouldn't cause too much trouble. inf and minf are OK as they stand. Cryptic names are OK for frequently used symbols but the names of infrequently used items need to be more descriptive. FWIW Robert From drdieterkaiser at web.de Fri Jan 16 17:24:01 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 17 Jan 2009 00:24:01 +0100 Subject: [Maxima] Assignment to $ind in itensor? In-Reply-To: References: <4970FCBE.2070702@ericsson.com> <1232143314.5751.13.camel@dieter-laptop> Message-ID: <1232148242.5517.6.camel@dieter-laptop> Am Freitag, den 16.01.2009, 17:41 -0500 schrieb Raymond Toy: > Don't know. It's unfortunate that these system constants have nice > short names but are otherwise not distinguished from any other > constant or variable. One option (which has been proposed before, I > think) is to give them more distinguishable names that are less likely > to collide with user variables. > > Dieter> Another possible would be to prevent the assignment only > Dieter> for %i. > > We should at least do that. > I think it would be at least nice to prevent the numeric constants from assignment. This is the complete list of the symbols which are declared to be SYSCONST. '($%pi $%i $%e $%phi %i $%gamma ;numeric constants $inf $minf $und $ind $infinity ;pseudo-constants t nil) ;logical constants Meanwhile I had a further look at the code of itensor. I have found the problem in the file ex_calc.mac in the function extdiff(). This functions does the assignment to the symbol IND. It is possible to changes this e. g. using ind1 and not ind. After this change the testsuite and the share_testsuite works as expected. Dieter Kaiser From fateman at cs.berkeley.edu Fri Jan 16 17:26:06 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Fri, 16 Jan 2009 15:26:06 -0800 Subject: [Maxima] Simplification and alike1 In-Reply-To: References: Message-ID: <4971178E.5050800@cs.berkeley.edu> Using expand is a very bad idea, since it is so slow. ratsimp is faster, but may be overkill. I think testing ratsimp(c-(2*a1+1) )= 0 would be ok. Raymond Toy wrote: > I was looking at hgfred([A+5/6,A+7/3],[2*A+23/3],4*z*(1-z)). > Currently, this fails because there is a call to hyp-cos (in hyp.lisp) > with arguments a = A+11/6, b = A+7/3, c = 2*(A+11/6)+1. > > There is a test (alike1 (add 1 (mul 2 a1)) c) that fails. (a1 = > (a+b-1/2)/2 = (2*A+11/3)/2) > > We want this test to succeed because 2*a1+1 actually does equal c, > when everything is expanded out. > > What is the best way to achieve this? I could call $expand or > $ratsimp in hyp-cos, but I'm not sure what is right, or if something > else should be used. > > (Even if this is fixed, the result, it's hard to tell if the answer is > correct or not. It differs from the answer given in Avgoustis' > thesis.) > > Ray > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From fateman at cs.berkeley.edu Fri Jan 16 17:27:07 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Fri, 16 Jan 2009 15:27:07 -0800 Subject: [Maxima] Using maxima in C++ app In-Reply-To: <4970C1DF.2030202@yandex.ru> References: <4970C1DF.2030202@yandex.ru> Message-ID: <497117CB.60805@cs.berkeley.edu> You could change your C++ program to a subroutine, and call it from Maxima. Alexey Afanasyev wrote: > Hi everyone, > > I am a newbie in Maxima. I am writing a program in C++ and wish to use > Maxima in it. How can I interoperate with Maxima? > > I have found that one of the possible ways is using sockets. Is this the > only way? Is there any documentation on the topic? > > Thanks. > > Best regards, > Alexey > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From robert.dodier at gmail.com Fri Jan 16 18:06:11 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 16 Jan 2009 17:06:11 -0700 Subject: [Maxima] Using maxima in C++ app In-Reply-To: <4970C1DF.2030202@yandex.ru> References: <4970C1DF.2030202@yandex.ru> Message-ID: On Fri, Jan 16, 2009 at 10:20 AM, Alexey Afanasyev wrote: > I am a newbie in Maxima. I am writing a program in C++ and wish to use > Maxima in it. How can I interoperate with Maxima? > > I have found that one of the possible ways is using sockets. Is this the > only way? Is there any documentation on the topic? Take a look at http://maxima.sourceforge.net/relatedprojects.html -- in many cases there is a front end written some other language which talks to Maxima via a socket. (E.g. XMaxima and wxMaxima.) Maybe you can get some ideas from them. If you are working with sockets you might consider share/contrib/maxima-server.lisp which implements a simple ordinary Unix server which forks a new instance of Maxima for each socket connection. It works only with SBCL; should be possible to port it to other Lisps which have fork, etc. There is also the possibility of linking directly through a so-called foreign function interface. Several Lisp varieties have their own, also there is one named CFFI which works for several of them (notably, excluding GCL). Maxima was originally written with a pervasive assumption that there is always someone at the console. In particular Maxima tries to gather user input via the asksign function (which asks questions like "Is x positive, negative, or zero?"). Each program which calls Maxima has to deal with that in some way. Take a look at the related projects page to get some ideas about that. Hope this helps, & good luck. What kind of a program are you writing? Robert Dodier From vttoth at vttoth.com Fri Jan 16 19:22:14 2009 From: vttoth at vttoth.com (Viktor T. Toth) Date: Fri, 16 Jan 2009 20:22:14 -0500 Subject: [Maxima] Assignment to $ind in itensor? In-Reply-To: <1232148242.5517.6.camel@dieter-laptop> References: <4970FCBE.2070702@ericsson.com><1232143314.5751.13.camel@dieter-laptop> <1232148242.5517.6.camel@dieter-laptop> Message-ID: <86E5D602BD0240D0AA4252A31489AB50@VTTOTH.COM> Dieter, Changing ind to something else like ind1 in itensor is no big deal. Had I noticed that we're using a system constant name I'd have done it a long time ago. In terms of the bigger picture, I agree with those who think that system constants should really be prefixed consistently, e.g., with %. But, such a wholesale change may not be practical. I'll change itensor shortly. Viktor -----Original Message----- From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Dieter Kaiser Sent: Friday, January 16, 2009 6:24 PM To: Raymond Toy Cc: maxima at math.utexas.edu Subject: Re: [Maxima] Assignment to $ind in itensor? Am Freitag, den 16.01.2009, 17:41 -0500 schrieb Raymond Toy: > Don't know. It's unfortunate that these system constants have nice > short names but are otherwise not distinguished from any other > constant or variable. One option (which has been proposed before, I > think) is to give them more distinguishable names that are less likely > to collide with user variables. > > Dieter> Another possible would be to prevent the assignment only > Dieter> for %i. > > We should at least do that. > I think it would be at least nice to prevent the numeric constants from assignment. This is the complete list of the symbols which are declared to be SYSCONST. '($%pi $%i $%e $%phi %i $%gamma ;numeric constants $inf $minf $und $ind $infinity ;pseudo-constants t nil) ;logical constants Meanwhile I had a further look at the code of itensor. I have found the problem in the file ex_calc.mac in the function extdiff(). This functions does the assignment to the symbol IND. It is possible to changes this e. g. using ind1 and not ind. After this change the testsuite and the share_testsuite works as expected. Dieter Kaiser _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From drdieterkaiser at web.de Fri Jan 16 19:39:18 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 17 Jan 2009 02:39:18 +0100 Subject: [Maxima] Problem in share_testsuite in file rtest_simplify_sum.mac Message-ID: <1232156358.5517.86.camel@dieter-laptop> The last example of the test file rtest_simplify_sum which was added with Rev. 1.17 does not work. A parameter is missing: ********************** Problem 56 *************** Input: test_sum(sum(1/(3+2*2*k)+1/(1+2*2*k)+(-1)/(2*k),k,1,inf),[],[ratsimp], (9*log(2)-8)/6) Result: Too few arguments supplied to test_sum(sm,ass,use_gamma,smp,ans): ['sum(1/(4*k+3)+1/(4*k+1)-1/(2*k),k,1,inf),[],[ratsimp],(9*log(2)-8)/6] ?error\-catch This differed from the expected result: 0 I get this error with CLISP and GCL. Dieter Kaiser From ferriste at gmail.com Sat Jan 17 04:50:00 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Sat, 17 Jan 2009 11:50:00 +0100 Subject: [Maxima] Using maxima in C++ app In-Reply-To: References: <4970C1DF.2030202@yandex.ru> Message-ID: <4971B7D8.3070101@gmail.com> I have the same necessity, I've written a code in Maxima to do structural analysis with symbolic calculus and it's now almost complete. I'm starting to write a Qt4 Gui for this, and I was looking to wxMaxima sources to understand how to communicate with Maxima. I've also found some documentation on tcl/tk wiki, here: http://wiki.tcl.tk/12065 http://wiki.tcl.tk/12269 I still haven't looked deep inside the code, anyway one should be able to replicate these functions in another language... But is there any kind of Maxima official documentation about this? Maxima wiki has an interesting purpose: Maxima and programming languages: utilizing Maxima from scripts and external programs. It would be really nice and useful to see this section written :-) Stefano Robert Dodier ha scritto: > On Fri, Jan 16, 2009 at 10:20 AM, Alexey Afanasyev wrote: > > >> I am a newbie in Maxima. I am writing a program in C++ and wish to use >> Maxima in it. How can I interoperate with Maxima? >> >> I have found that one of the possible ways is using sockets. Is this the >> only way? Is there any documentation on the topic? >> > > Take a look at http://maxima.sourceforge.net/relatedprojects.html -- > in many cases there is a front end written some other language > which talks to Maxima via a socket. (E.g. XMaxima and wxMaxima.) > Maybe you can get some ideas from them. > > If you are working with sockets you might consider > share/contrib/maxima-server.lisp > which implements a simple ordinary Unix server which forks a new > instance of Maxima for each socket connection. It works only with > SBCL; should be possible to port it to other Lisps which have fork, etc. > > There is also the possibility of linking directly through a so-called > foreign function interface. Several Lisp varieties have their own, also > there is one named CFFI which works for several of them (notably, > excluding GCL). > > Maxima was originally written with a pervasive assumption that there > is always someone at the console. In particular Maxima tries to gather > user input via the asksign function (which asks questions like > "Is x positive, negative, or zero?"). Each program which calls Maxima > has to deal with that in some way. Take a look at the related projects > page to get some ideas about that. > > Hope this helps, & good luck. What kind of a program are you writing? > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From ferriste at gmail.com Sat Jan 17 08:07:51 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Sat, 17 Jan 2009 15:07:51 +0100 Subject: [Maxima] Using maxima in C++ app In-Reply-To: <4970C1DF.2030202@yandex.ru> References: <4970C1DF.2030202@yandex.ru> Message-ID: <4971E637.3050306@gmail.com> This site may be useful http://www.lon-capa.org/cas.html there is an implementation of a Maxima server, and it is also indicated in the related project page of Maxima together with Stack (also this could be useful). There is also the command maxima -s port but when I type it in a shell it doesn't works, giving this error: maxima -s 4010 jfa: starting server on port 4010 Maxima encountered a Lisp error: UNIX error 111 (ECONNREFUSED): Connection refused Why? Stefano > Hi everyone, > > I am a newbie in Maxima. I am writing a program in C++ and wish to use > Maxima in it. How can I interoperate with Maxima? > > I have found that one of the possible ways is using sockets. Is this the > only way? Is there any documentation on the topic? > > Thanks. > > Best regards, > Alexey > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From toy.raymond at gmail.com Sat Jan 17 09:17:38 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 17 Jan 2009 10:17:38 -0500 Subject: [Maxima] Simplification and alike1 In-Reply-To: <8b356f880901161512w172f9557re935d4edca442616@mail.gmail.com> References: <8b356f880901161512w172f9557re935d4edca442616@mail.gmail.com> Message-ID: <4971F692.2070601@gmail.com> Stavros Macrakis wrote: > On Fri, Jan 16, 2009 at 12:07 PM, Raymond Toy wrote: > >> ...There is a test (alike1 (add 1 (mul 2 a1)) c) that fails. (a1 = (a+b-1/2)/2 = (2*A+11/3)/2) >> We want this test to succeed because 2*a1+1 actually does equal c, when everything is expanded out. >> What is the best way to achieve this? I could call $expand or $ratsimp in hyp-cos, but I'm not sure what is right, or if something else should be used. >> > > The best way to do this in this case is to check whether > is(equal(2*a1+1,c)) (using the appropriate Lisp calls, which I don't > remember off the top of my head). This will also take into account > the assume database. > Hmm. I don't know the exact calls either. But I think I'll use Richard's suggestion and use ratsimp(2*a1+1-c) and test for 0. > >> (Even if this is fixed, the result, it's hard to tell if the answer is >> correct or not. It differs from the answer given in Avgoustis' >> thesis.) >> > > Can't help you with that, sorry. > Sorry, I wasn't asking for help there. I think I know one problem. I think the code does too many differentiations. The result is really rather messy and Avgoustis' result seems to have made some assumptions about the range of the argument. I also notice that I can't get maxima to simplify sqrt(4*z^2-4*z+1). Radcan will simplify this to 2*z-1, but that's not the correct answer because in this |z|<=1/2 in this case. Ray > -s > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > From drdieterkaiser at web.de Sat Jan 17 10:38:08 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 17 Jan 2009 17:38:08 +0100 Subject: [Maxima] SF[887639] listarray when use_fast_arrays : true Message-ID: <37FD498E38A94F9E9FC3BC85A2214028@Kaiser> There are two problems when switching fast arrays on. First: With use_fast_arrays:TRUE the output for an array with one dimension is wrong. I have already suggested the following correction to the function $listarray in marray.lisp: ((hash-table-p ary) (let (vals (tab ary)) (declare (special vals tab)) (maphash #'(lambda (x &rest l) l (unless (eq x 'dim1) (push (gethash x tab) vals))) ary) (reverse vals))) The code skips over the element (dim1 t) which is stored in the hash-table by the Lisp function make-equal-hash-table. Additionaly the code reorders the list of elements so that we get the expected order of elements. I would like to check in the changes if no one sees a problem with the code. Second: A Maxima list or matrix can be accessed like an array. With use_fast_arrays:TRUE Maxima no longer checks the type or the range of the indices. Depending on the Lisp we get Lisp Errors or the memory is damaged (GCL). This is reported in a post of this bug report and on this mailing list. I would like to suggest to implement a complete type and range check when the code of use_fast_arrays access a Maxima list or matrix. This has to be added to the function arrstore in the file mlisp.lisp: ((eq the-type 'list) (cond ((eq (caar tem) 'mlist) (unless (= (length index) 1) (merror "Wrong number of indices: ~M" (cons '(mlist) index))) (setq index (car index)) (cond ((not (eq (ml-typep index) 'fixnum)) (merror "Index not an integer: ~M" index)) ((and (> index 0) (< index (length tem))) (setf (nth index tem) r) r) (t (merror "Index out of range: ~A" index)))) ((eq (caar tem) '$matrix) (cond ((not (= (length index) 2)) (merror "Wrong number of indices: ~M" (cons '(mlist) index))) ((or (not (eq (ml-typep (first index)) 'fixnum)) (not (eq (ml-typep (second index)) 'fixnum))) (merror "Indices not an integer: ~M" (cons '(mlist) index))) ((and (> (first index) 0) (< (first index) (length (cadr tem))) (> (second index) 0) (< (second index) (length (caddr tem)))) (setf (nth (second index) (nth (first index) tem)) r) r) (t (merror "Indices out of range: ~M" (cons '(mlist) index))))) With this code we no longer get Lisp Errors when accessing an element of a Maxima list or matrix with wrong range or type and use_fast_arrays:TRUE. Remark: With use_fast_arrays:FALSE the check of the type and the range of the indices is completely done by Maxima. Because a Maxima list or a Maxima matrix is not a fast array it seems to be even better to have no code duplication and to implement the access via the existing code. But to do this the algorithm of arrstore has to be changed (rewritten). I would like to check in the complete type and range checking for the case use_fast_arrays:TRUE if no one sees a problem with the change? The testsuite and share_testsuite have no problems. Dieter Kaiser From willisb at unk.edu Sat Jan 17 11:05:51 2009 From: willisb at unk.edu (Barton Willis) Date: Sat, 17 Jan 2009 11:05:51 -0600 Subject: [Maxima] Simplification and alike1 In-Reply-To: <4971F692.2070601@gmail.com> References: <8b356f880901161512w172f9557re935d4edca442616@mail.gmail.com>, <4971F692.2070601@gmail.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >Hmm.??I?don't?know?the?exact?calls?either.??But?I?think?I'll?use >Richard's?suggestion?and?use?ratsimp(2*a1+1-c)?and?test?for?0. An equality test that consults the fact database (can be slow, I suppose) is (eq t (meqp a b)) (%i18) assume(equal(a,b))$ (%i17) is(equal(a,b)); 1> (MEQP $A $B) <1 (MEQP T) (%o17) true Barton From robert.dodier at gmail.com Sat Jan 17 11:37:21 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 17 Jan 2009 10:37:21 -0700 Subject: [Maxima] Using maxima in C++ app In-Reply-To: <4971E637.3050306@gmail.com> References: <4970C1DF.2030202@yandex.ru> <4971E637.3050306@gmail.com> Message-ID: On 1/17/09, Stefano Ferri wrote: > maxima -s port > > but when I type it in a shell it doesn't works, giving this error: > > maxima -s 4010 > jfa: starting server on port 4010 > Maxima encountered a Lisp error: > > UNIX error 111 (ECONNREFUSED): Connection refused Well, the stated description of the option is a little misleading --- it does not start Maxima as a server, but rather a client, which is looking for an open socket at the indicated port. Typically a GUI program acts as the server and launches Maxima as a client to talk to the port which it is listening to. I'll try to rework the documentation of the -s option to clarify its purpose. share/contrib/maxima-server.lisp does create an ordinary Unix-ish server, which listens for connections and forks a new Maxima process for each client. As it relies on POSIX functions, it is not portable Common Lisp; at present it works with SBCL only. Hope this helps Robert Dodier From drdieterkaiser at web.de Sat Jan 17 12:05:58 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 17 Jan 2009 19:05:58 +0100 Subject: [Maxima] SF[887639] listarray when use_fast_arrays : true In-Reply-To: <37FD498E38A94F9E9FC3BC85A2214028@Kaiser> References: <37FD498E38A94F9E9FC3BC85A2214028@Kaiser> Message-ID: Two further remarks: I have to modify the check for the range of a Maxima matrix a bit to take into account not only a square matrix (I have overseen this point). It is possible to assign a complete row with use_fast_arrays:false e.g. a:matrix([1,2],[3,4]); a[1]:[11,11]; This longer works with use_fast_arrays:true. Without range check we get a Lisp error. With the suggested range check we get an Maxima Error: "Wrong number of indices". Dieter Kaiser From ferriste at gmail.com Sat Jan 17 13:03:34 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Sat, 17 Jan 2009 20:03:34 +0100 Subject: [Maxima] Using maxima in C++ app In-Reply-To: References: <4970C1DF.2030202@yandex.ru> <4971E637.3050306@gmail.com> Message-ID: <49722B86.1060700@gmail.com> > Hope this helps > > Robert Dodier > Ok now I understand... thank you. Actually the man page is quite misleading about this point... So Maxima should work as a "passive" component, like an ftp client connected to a ftp server. One creates a server socket with a Gui or another component, and then launches Maxima with the -s option to send commands and receive outputs... It's right? Stefano From al at beshenov.ru Sat Jan 17 16:41:02 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Sun, 18 Jan 2009 01:41:02 +0300 Subject: [Maxima] sign(zeta(x)) Message-ID: <200901180141.03706.al@beshenov.ru> I found that Maxima doesn't know how to find sign(zeta(x)) for non-integer or positive odd x: integrate (t^3/(exp(t)-1), t, 0, inf) Is zeta(3) positive, negative, or zero? It happens because zeta(3) is not evaluated, so sign(zeta(3))=pnz. Other examples: sign (zeta(5/6)) => pnz sign (zeta(-5/2)) => pnz Maybe we can extend compar.lisp by the following stuff: ;; for real x, zeta(x) has ;; trivial negative even roots ;; and a pole at x=1 (defun sign-zeta (x) (let ((arg (cadr x))) (cond ((eq (mgqp arg 1) t) '$pos) ((eq (mgqp arg 0) t) '$neg) ((eq (mgrp 0 arg) t) (if (integerp arg) (let ((m (mod arg 4))) (cond ((= m 3) '$neg) ((= m 1) '$pos) (t '$zero))) (let ((fl (take '($floor) arg))) (if (integerp fl) (if (= (mod (if (evenp fl) fl (1- fl)) 4) 0) '$pos '$neg) '$pnz)))) (t '$pnz)))) Examples: (sign-zeta '(($zeta) -23)) => $pos (sign-zeta '(($zeta) -22)) => $zero (sign-zeta '(($zeta) -21)) => $neg (sign-zeta '(($zeta) 0) => $neg (sign-zeta '(($zeta) 23)) => $pos (sign-zeta '(($zeta) ((rat) 5 6))) => $neg (sign-zeta '(($zeta) ((rat) -5 2))) => $pos (sign-zeta '(($zeta) $%pi))) => $pos (sign-zeta '(($zeta) ((mtimes) 23 $%i))) => $pnz (sign-zeta '(($zeta) $x)) => $pnz -- Boomtime, Chaos 17 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From LindnerW at t-online.de Sun Jan 18 00:16:59 2009 From: LindnerW at t-online.de (Wolfgang Lindner) Date: Sun, 18 Jan 2009 07:16:59 +0100 Subject: [Maxima] Using maxima in C++ app Message-ID: <001a01c97934$7126d380$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> dear Stefano, dear Alexey, Prof. Grothmann has managed to use Maxima in his EULER (~ MatLab) program. It is possible to exchange data and calls between both programs. As far as I know EULER is written in C/C++. The source is on his homepage and maybe gives a working example to your questions. OK, one has to analysize his coding .. Google for 'euler grothmann' .. hth Wolfgang -----Urspr?ngliche Nachricht----- Von: Stefano Ferri An: maxima at math.utexas.edu Datum: Samstag, 17. Januar 2009 15:21 Betreff: Re: [Maxima] Using maxima in C++ app |This site may be useful | |http://www.lon-capa.org/cas.html | |there is an implementation of a Maxima server, and it is also indicated |in the related project page of Maxima together with Stack (also this |could be useful). |There is also the command | |maxima -s port | |but when I type it in a shell it doesn't works, giving this error: | |maxima -s 4010 |jfa: starting server on port 4010 |Maxima encountered a Lisp error: | |UNIX error 111 (ECONNREFUSED): Connection refused | |Why? | |Stefano | | |> Hi everyone, |> |> I am a newbie in Maxima. I am writing a program in C++ and wish to use |> Maxima in it. How can I interoperate with Maxima? |> |> I have found that one of the possible ways is using sockets. Is this the |> only way? Is there any documentation on the topic? |> |> Thanks. |> |> Best regards, |> Alexey |> |> _______________________________________________ |> 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 luigi_marino2 at alice.it Sat Jan 17 12:13:09 2009 From: luigi_marino2 at alice.it (Luigi Marino) Date: Sat, 17 Jan 2009 19:13:09 +0100 Subject: [Maxima] fixed-point for solve non linear equation Message-ID: There is a block for solve non linear equation with fixed-point method: f(x)=x puntiter(f,xv,tol,nmax):=block([x0,x1,diff,count], count:1, x0:xv, print(x0), x1:float(ev(f,x:x0)), print(x1), diff:x1-x0, x0:x1, while tol is temporarily unavailable, and it was also unavailable last night. In a previous message you say that maybe pw isn't ready for share/contrib, so should I assume that you took it down? If so, I'd be happy with an alpha version or even pre-alpha, and I'd be happy to relate my experiences with it. I'm running Maxima on Win Vista using the executable from sourceforge, though I could switch to Fedora Linux if necessary. I also have a stupid newbie question. I downloaded abs_integrate.mac from sourceforge and put it in c:/maxima/mac/ and then: (C4) LOAD("abs_integrate.mac"); Could not find `opsubst' using paths in FILE_SEARCH_MAXIMA,FILE_SEARCH_LISP (combined values: [./###.{mc,mac}, C:/maxima/{mac,sym}/###.mac, C:/maxima/{share,share1,share2,tensor}/###.mc, ./###.{o,lsp,lisp}, C:/maxima/{src,share1,sym}/###.o, C:/maxima/{src,share1,sym}/###.o, C:/maxima/{src,share1}/###.lisp, C:/maxima/{sym}/###.lsp] ) -- an error. Quitting. To debug this try DEBUGMODE(TRUE);) What am I doing wrong? Thanks. Jack Schmidt From nerd_gone_astray at yahoo.com Sun Jan 18 20:02:39 2009 From: nerd_gone_astray at yahoo.com (Rich Hennessy) Date: Sun, 18 Jan 2009 18:02:39 -0800 (PST) Subject: [Maxima] Draw an animated gif with black background Message-ID: <357142.65857.qm@web111407.mail.gq1.yahoo.com> Thanks again. I'll try it. > Thanks, that worked but now I can't see any of the titles or labels. Is there a way to change the default foreground color to white > or some hex code? set_draw_defaults( xrange = [-1,1], yrange = [-1,1], color = yellow, user_preamble = ["set title 'My title' tc rgb 'white'", "set label 'My 1st label' at 0, 0.5 tc rgb 'white'", "set label 'My 2nd label' at 0, -0.5 tc rgb 'cyan'"], line_width = 2 )$ draw( delay = 100, file_name = "zzz", terminal = 'animated_gif, file_bgcolor = "#000000", gr2d(explicit(x^2,x,-1,1)), gr2d(explicit(x^3,x,-1,1)), gr2d(explicit(x^4,x,-1,1))); ------------- I have dedicated some time in the past trying to declare font types, sizes and colors, in a standard mode for all terminals, but couldn't find any (not all terminals support the same types and sizes), so that this is a chance for option user_preamble to be used instead. There is also an extra problem with labels. According to documentation: Colored labels work only with Gnuplot 4.3. This is a known bug in package @code{draw}. In fact, they don't work in Gnuplot 4.2.* when they are entered as data, as is the case in package draw. But they do work when they are entered with the 'set label' command as in the example above. As a consequence, this is another chance for user_preamble. hth. Mario From willisb at unk.edu Mon Jan 19 05:46:18 2009 From: willisb at unk.edu (Barton Willis) Date: Mon, 19 Jan 2009 05:46:18 -0600 Subject: [Maxima] *complexsign* Message-ID: There are several reported bugs that can be fixed by settting *complexsign* to true; one such bug is SF bug 2358696 "is equal bug." Alternatively, bug 2358696 could be fixed by setting complexsign to true, but I think complexsign is deprecated? Would it be OK to set *complexsign* to true in functions such as meqp-by-csign and mgrp? The downside is that we might uncover bugs with the new *complexsign* scheme; the upside is that we might fix newly discovered bugs with the *complexsign* scheme. Barton From aphongka at yandex.ru Mon Jan 19 08:43:50 2009 From: aphongka at yandex.ru (Alexey Afanasyev) Date: Mon, 19 Jan 2009 17:43:50 +0300 Subject: [Maxima] Using maxima in C++ app In-Reply-To: References: <4970C1DF.2030202@yandex.ru> Message-ID: <497491A6.5020700@yandex.ru> Hi Robert, Thank you for the info. Robert Dodier wrote: > ... > Hope this helps, & good luck. What kind of a program are you writing? I am trying to write an air navigation calculator which might be plugged in into a flight simulator app. From raymond.toy at ericsson.com Mon Jan 19 08:50:43 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 19 Jan 2009 09:50:43 -0500 Subject: [Maxima] Minpack added for solving non-linear equations and non-linear least-squares Message-ID: >From a suggestion from Robert, I've add minpack to maxima. Minpack includes software for solving nonlinear equations and nonlinear least squares problems. Least squares problems use a modified Levenberg-Marquardt algorithm. The interface is not complete, but it does work. Here is an example of how to use it. (%i1) load(minpack)$ /* Rosenbrock function */ (%i2) f(x1,x2) := [10*(x1-x2^2),1-x1]; (%i3) jacobian(f(x1,x2),[x1,x2]); (%i4) minpack_lmder1(2,[-1.2,1],lambda([x],f(x[1],x[2])), lambda([x],subst([x1=x[1],x2=x[2]],%o3)),1d-8); (%o4) [[1.0, 1.0], 0.0, 2] The result is a list. The first element is the estimated solution, [1.0, 1.0]. The second element is the norm of the error, and 2 is a flag returned by the lmder1 routine. (More info available in the lmder.f file. This will eventually be documented.) The interface is minpack_lmder1(m, init, fun, jac, tol) where m is the number of equations init is the initial guess, a vector f is a function returning a list of each function. jac is function to evaluate the Jacobian of f. tol is the tolerance. It should be about sqrt(eps). I don't think this interface is very nice, and I'm open to others. It might be better if f could be given as a list of equations instead of a function taking a vector and returning the list of equations. If a list is used, then the parameter m isn't needed. And since this is Maxima, it would be nice if Maxima computed the Jacobian automatically for us, but we should allow the user to specify one if necessary. The tolerance should be optional. Minpack also includes a routine that uses a numerical Jacobian. That might be useful. I didn't implement the interface to the routines for solving nonlinear equations, but that shouldn't be too hard. Ray From fateman at cs.berkeley.edu Mon Jan 19 08:59:40 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Mon, 19 Jan 2009 06:59:40 -0800 Subject: [Maxima] Using maxima in C++ app In-Reply-To: <497491A6.5020700@yandex.ru> References: <4970C1DF.2030202@yandex.ru> <497491A6.5020700@yandex.ru> Message-ID: <4974955C.8070102@cs.berkeley.edu> This is curious: what facilities in Maxima are you using? In my (admittedly limited) experience with flight simulators, there is no need for symbolic manipulation... Alexey Afanasyev wrote: > > I am trying to write an air navigation calculator which might be plugged > in into a flight simulator app. > > From aphongka at yandex.ru Mon Jan 19 09:29:35 2009 From: aphongka at yandex.ru (Alexey Afanasyev) Date: Mon, 19 Jan 2009 18:29:35 +0300 Subject: [Maxima] Using maxima in C++ app In-Reply-To: <4972F598.8090900@gmail.com> References: <001a01c97934$7126d380$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> <4972F598.8090900@gmail.com> Message-ID: <49749C5F.6060703@yandex.ru> Thanks Wolfgang, thanks Stefano, Yes, it's pretty straightforward. And if one used sockets, would it look like the pipes solution when a client prog talk to Maxima via its stdin and listen to its stdout? Alexey Stefano Ferri wrote: > I looked at maxima.cpp in the source code, it is quite clear to > understand, and also commented. > Thank you. > Stefano > > > Wolfgang Lindner ha scritto: >> dear Stefano, >> dear Alexey, >> >> Prof. Grothmann has managed to use Maxima in his EULER (~ MatLab) program. >> It is possible to exchange data and calls between both programs. >> As far as I know EULER is written in C/C++. >> The source is on his homepage and maybe gives a working example to your >> questions. >> OK, one has to analysize his coding .. >> >> Google for 'euler grothmann' .. >> >> hth >> Wolfgang >> >> >> >> ---- > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - http://www.avg.com > Version: 8.0.176 / Virus Database: 270.10.8/1899 - Release Date: 17.01.2009 17:50 > From raymond.toy at ericsson.com Mon Jan 19 09:39:03 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 19 Jan 2009 10:39:03 -0500 Subject: [Maxima] run_testsuite interface change? Message-ID: I think this was brought up sometime ago, but I can't find it right now. I can never remember how to call run_testsuite() since all of the arguments are optional, so order matters, and my most common usage is to want to specify just a subset of the test suite. Could we change run_testsuite to use a keyword style? Something like run_testsuite(display=, known_bugs=, tests=) The keyword args can come in any order. The default for run_testsuite() remains the same. Only if you want to specify something different will you see a change. Ray From robert.dodier at gmail.com Mon Jan 19 09:57:20 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 19 Jan 2009 08:57:20 -0700 Subject: [Maxima] run_testsuite interface change? In-Reply-To: References: Message-ID: On 1/19/09, Raymond Toy wrote: > Something like > > run_testsuite(display=, known_bugs=, tests=) OK by me. Instead of display and known_bugs, I am inclined to name the parameters display_all and display_known_bugs. At present, the elements of the list of tests must be strings; I think symbols should be allowed also. i.e. [rtest10, rtest15] as well as ["rtest10", "rtest15"]. Thanks for taking a look at it. Robert From raymond.toy at ericsson.com Mon Jan 19 10:04:29 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 19 Jan 2009 11:04:29 -0500 Subject: [Maxima] run_testsuite interface change? In-Reply-To: References: Message-ID: <4974A48D.7060409@ericsson.com> Robert Dodier wrote: > On 1/19/09, Raymond Toy wrote: > > >> Something like >> >> run_testsuite(display=, known_bugs=, tests=) >> > > OK by me. Instead of display and known_bugs, I am inclined to name > the parameters display_all and display_known_bugs. > Works for me. > At present, the elements of the list of tests must be strings; > I think symbols should be allowed also. > i.e. [rtest10, rtest15] as well as ["rtest10", "rtest15"]. > > I'll see if I can make it accept symbols and strings. Ray From pgrahl at gmail.com Mon Jan 19 10:03:19 2009 From: pgrahl at gmail.com (Paulo Grahl) Date: Mon, 19 Jan 2009 14:03:19 -0200 Subject: [Maxima] newbie simple question Message-ID: <755f575b0901190803j204bae59h23e261e4fceb83ac@mail.gmail.com> Dear list members: I have a polynomial in "x" (e.g. a0+a1 x + a2 x^2 + ... ar x^r) and want to substitute "x^i", where "i" ranges from 1 to r by m[i]. I understant I can use subst() and do it term by term, but I need to do that for several polynomials and not all of them are of the same degree. Any idea how to do that ? Many thanks. Paulo Paulo Gustavo Grahl, CFA ------------------------------------------ pgrahl at gmail.com pgrahl at fgvmail.br +55(21) 8809-9254 www.linkedin.com/in/pgrahl ------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090119/934ded9d/attachment.htm From willisb at unk.edu Mon Jan 19 10:30:54 2009 From: willisb at unk.edu (Barton Willis) Date: Mon, 19 Jan 2009 10:30:54 -0600 Subject: [Maxima] newbie simple question In-Reply-To: <755f575b0901190803j204bae59h23e261e4fceb83ac@mail.gmail.com> References: <755f575b0901190803j204bae59h23e261e4fceb83ac@mail.gmail.com> Message-ID: Maybe a function something like (%i12) f(p,x) := block([k], p : ratexpand(p), k : hipow(p,x), while (k > 0) do ( p : ratsubst(subvar(m,k),x^k,p), k : k - 1), p)$ will work for you: (%i14) f(2 + x + 5 * x^2 - x^8,x); (%o14) -m[8]+5*m[2]+m[1]+2 Barton -----maxima-bounces at math.utexas.edu wrote: ----- >Dear?list?members: >I?have?a?polynomial?in?"x"?(e.g.?a0+a1?x?+?a2?x^2?+?...?ar?x^r) >and?want?to?substitute?"x^i",?where?"i"?ranges?from?1?to?r?by?m[i]. >I?understant?I?can?use?subst()?and?do?it?term?by?term,?but?I?need?to?do >that?for?several?polynomials?and?not?all?of?them?are?of?the?same?degree. > >Any?idea?how?to?do?that?? >Many?thanks. >Paulo > > > >Paulo?Gustavo?Grahl,?CFA >------------------------------------------ >pgrahl at gmail.com >pgrahl at fgvmail.br > >+55(21)?8809-9254 >www.linkedin.com/in/pgrahl >------------------------------------------ > > >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From al at beshenov.ru Mon Jan 19 10:43:09 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Mon, 19 Jan 2009 19:43:09 +0300 Subject: [Maxima] newbie simple question In-Reply-To: <755f575b0901190803j204bae59h23e261e4fceb83ac@mail.gmail.com> References: <755f575b0901190803j204bae59h23e261e4fceb83ac@mail.gmail.com> Message-ID: <200901191943.10228.al@beshenov.ru> On Monday 19 January 2009 19:03:19 Paulo Grahl wrote: > Dear list members: > I have a polynomial in "x" (e.g. a0+a1 x + a2 x^2 + ... ar x^r) > and want to substitute "x^i", where "i" ranges from 1 to r by m[i]. > I understant I can use subst() and do it term by term, but I need > to do that for several polynomials and not all of them are of the > same degree. Any idea how to do that ? > Many thanks. > Paulo poly_subscr (e, x, m) := ( e : ratexpand(e), sum (coeff(e,x,i)*subvar(m,i), i,1,hipow(e,x)) + coeff(e,x,0) )$ (%i1) sum(a[i]*x^i, i,0,5); (%o1) a[5]*x^5+a[4]*x^4+a[3]*x^3+a[2]*x^2+a[1]*x+a[0] (%i2) poly_subscr(%,x,m); (%o2) a[5]*m[5]+a[4]*m[4]+a[3]*m[3]+a[2]*m[2]+a[1]*m[1]+a[0] -- Prickle Prickle, Chaos 19 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From raymond.toy at ericsson.com Mon Jan 19 11:58:53 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 19 Jan 2009 12:58:53 -0500 Subject: [Maxima] run_testsuite interface change? In-Reply-To: (Robert Dodier's message of "Mon, 19 Jan 2009 08:57:20 -0700") References: Message-ID: >>>>> "Robert" == Robert Dodier writes: Robert> On 1/19/09, Raymond Toy wrote: >> Something like >> >> run_testsuite(display=, known_bugs=, tests=) Robert> OK by me. Instead of display and known_bugs, I am inclined to name Robert> the parameters display_all and display_known_bugs. Robert> At present, the elements of the list of tests must be strings; Robert> I think symbols should be allowed also. Robert> i.e. [rtest10, rtest15] as well as ["rtest10", "rtest15"]. Done, with documentation updated. run_testsuite(display_all = t); or run_testsuite(display_known_bugs=t, tests=["rtest5"]); Note however, that in this case problem 48 is a known test failure. BUT, the result matches the expected result, so problem 48 doesn't actually fail anymore. I think this is bad. We should do something so that if a test is expected to fail but doesn't, we should complain about that. Ray From pgrahl at gmail.com Mon Jan 19 12:02:29 2009 From: pgrahl at gmail.com (Paulo Grahl) Date: Mon, 19 Jan 2009 16:02:29 -0200 Subject: [Maxima] newbie simple question In-Reply-To: References: <755f575b0901190803j204bae59h23e261e4fceb83ac@mail.gmail.com> Message-ID: <755f575b0901191002l75c4046et424834b35c07c776@mail.gmail.com> Excellent! Thanks a lot. - Paulo On Mon, Jan 19, 2009 at 2:30 PM, Barton Willis wrote: > Maybe a function something like > > (%i12) f(p,x) := block([k], > p : ratexpand(p), > k : hipow(p,x), > while (k > 0) do ( > p : ratsubst(subvar(m,k),x^k,p), > k : k - 1), > p)$ > > will work for you: > > (%i14) f(2 + x + 5 * x^2 - x^8,x); > (%o14) -m[8]+5*m[2]+m[1]+2 > > Barton > > -----maxima-bounces at math.utexas.edu wrote: ----- > > > >Dear list members: > >I have a polynomial in "x" (e.g. a0+a1 x + a2 x^2 + ... ar x^r) > >and want to substitute "x^i", where "i" ranges from 1 to r by m[i]. > >I understant I can use subst() and do it term by term, but I need to do > >that for several polynomials and not all of them are of the same degree. > > > >Any idea how to do that ? > >Many thanks. > >Paulo > > > > > > > >Paulo Gustavo Grahl, CFA > >------------------------------------------ > >pgrahl at gmail.com > >pgrahl at fgvmail.br > > > >+55(21) 8809-9254 > >www.linkedin.com/in/pgrahl > >------------------------------------------ > > > > > >_______________________________________________ > >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/20090119/9ea7bb3f/attachment.htm From robert.dodier at gmail.com Mon Jan 19 12:15:11 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 19 Jan 2009 11:15:11 -0700 Subject: [Maxima] run_testsuite interface change? In-Reply-To: References: Message-ID: On Mon, Jan 19, 2009 at 10:58 AM, Raymond Toy wrote: > run_testsuite(display_all = t); Um, I hope the actual argument is display_all=true. > I think this is bad. We should do something so that if a test is > expected to fail but doesn't, we should complain about that. Isn't there already some logic to detect unexpected success? best Robert From raymond.toy at ericsson.com Mon Jan 19 12:21:59 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 19 Jan 2009 13:21:59 -0500 Subject: [Maxima] run_testsuite interface change? In-Reply-To: References: Message-ID: <4974C4C7.10103@ericsson.com> Robert Dodier wrote: > On Mon, Jan 19, 2009 at 10:58 AM, Raymond Toy wrote: > > >> run_testsuite(display_all = t); >> > > Um, I hope the actual argument is display_all=true. > Actually, anything other than false is treated as true. Do we want to accept only true and false? > >> I think this is bad. We should do something so that if a test is >> expected to fail but doesn't, we should complain about that. >> > > Isn't there already some logic to detect unexpected success? > I thought there was and there is. But I see now why problem 48 doesn't trigger that logic. The comment for the test says the result is not simplified. and it isn't. But the display routine doesn't know that and displays the actual and expected results exactly the same. Ray From ziga.lenarcic at gmail.com Mon Jan 19 10:56:23 2009 From: ziga.lenarcic at gmail.com (=?UTF-8?Q?=C5=BDiga_Lenar=C4=8Di=C4=8D?=) Date: Mon, 19 Jan 2009 17:56:23 +0100 Subject: [Maxima] Minpack added for solving non-linear equations and non-linear least-squares Message-ID: <3098DF64-892A-44A0-9206-71B6B0DC2EFC@gmail.com> Hi! Nice to see minimisation in maxima finally. I would like to stress the importance of proper maxima-level interface to minpack. In the past Andrej V. tried to do a simple interface to quadpack routines, but somehow mailing list couldn't agree on the name, so maxima still has no interface to numerical integration functions. Hopefully this will not be the case this time. In my opinion the underlying method names and routine names should be hidden to the user. Maxima level function should be named by "what they do", not "what method they use". So I'm in favour of functions "find_minimum" rather than "minpack_minimize" or something along those lines. The user should call an appropriately named function (this goes for quadpack also), which should then decide which method will be called. Ofcourse user has also the option to choose the method and set options if he wants to, but an usable soultion should be found with a simple function call. Sometime ago, some debated, what's the purpose of numerical subroutines in a CAS like maxima. for non-perfomnace cricitcal operations (like model fitting, numerical ode integration, numerical quadrature ... - single calls of course) a CAS like maxima enables the user to formulate the problem in a straightforward way, while the CAS abilities can then transform the problem into a form, suitable for numerical solving. One could compare nonlinear fitting in Mathematica and MATLAB to compare the two. In Mathematica, one simply writes the model in its mathematical form, while in MATLAB one has to provide a function/program for the fitting routine to evaluate. Also ODE integration - numerical integrators integrate a system of first order ODEs. In matlab, one has to provide the rhs of such a system as is usual with numerical solvers. If Maxima had a numerical ode solver, one could state ode system as usual equations, while the symbolic abilities of Maxima would take care of converting the user's (mathematically looking) ode to a system of 1st order odes, compute the solution using some standard algorithm and return the appropriate solution (interpolating function preferably). Using a CAS for some numerical tasks is much better than fortran-in-disguise a.k.a matlab/ octave. With todays computers, performance is often not an issue. I suggest the following naming: - maxima (user) level functions with names according to what they do: "find_minimum" (for iterative numerical minimum searching, where local minimums can be found, consistent with find_root) - lisp level functions with names suggesting the underlying algorithm/ fortran name: "minpack-lmderl", "lapack-deesgv", "quadpack-qagi" (at least for fortran numerical packages, where it's nice to know which code is in maxima) etc. Another important thing is to make use of maxima sybolic abilities, to make the formulation of the problem as mathematically simple as possible (jacobian can be calculated automaticly as suggested, or optionallly user defined). I'm still slowly working on a fitting package - looks like i won't have to implement levenberg myself if minpack works. I would also suggest agains naming packages via their fortran names. A package "load(optimization)$" should include minimization, perhaps fitting, linearprogramming/simplex functions imo. I think the user has a right of not getting to know the names of fortran numerical libraries, when he wants a simple numerical approximation of an integral/ fit a function. Maxima should provide that. Hope someone writes nice wrapping functions for minpack. Ziga From ziga.lenarcic at gmail.com Mon Jan 19 11:26:02 2009 From: ziga.lenarcic at gmail.com (=?UTF-8?Q?=C5=BDiga_Lenar=C4=8Di=C4=8D?=) Date: Mon, 19 Jan 2009 18:26:02 +0100 Subject: [Maxima] Suggestion for implementation of infix 'map' and 'apply' Message-ID: Hi! I have another suggestion regarding infix versions of map an apply. Infix notation is in many cases easier for humans to read than prefix. Consider plus(a,b,c) vs a + b + c. Maxima functions 'map' and 'apply' are very common in maxima code and infix versions would help improve readability and reduce the number of () in the code. Consider map( lambda([x], x+1), [1,2,3,4]) vs lambda([x],x+1) /@ [1,2,3,4]. I know that it's easily implemented into maxima via 'infix()', and I have done so with mathematica's "//" infix operator: infix("//")$ "//"(expr, func) := func(expr)$ It works nicely. However I don't like the fact that a highly customised 'maxima-init.mac' lead to somewhat unportable code - I can't send my code to friends and expect to work in an out-of-the-box maxima. Therefore I suggest, that such infix operators are introduced into maxima - if everyone agrees ofcourse. In this mail, I used Mathematicas infix map, which is "/@". Mathematicas infix apply looks like "@@": f @@ [1,2,3] = f(1,2,3). I don't think /@, @@ and // are the best possible choice (they look quite cryptic, except //), but I don't have any other ideas right now. The name of these infix operators should be debated here on the mailing list before implementation, so the best names, suitable for maxima are chosen. The other day I was thinking of making lambda expressions shorter, something like this: (_ + 1)& -> lambda([x], x + 1) and (_1 + _2 + 1)& -> lambda([x,y], x + y + 1) This is not hard to implement, but I'd be most happy with a standard maxima implementation of this macro (instead of my private 'maxima- init.mac' version). I later found out that the symbol "_" is already taken, though I thought it would be most intuitive or mathematically correct symbol to use in such a definition. So besides infix map and apply and "//" I would like to debate, should such short lambda function notation be introduced to maxima? If so, it would be nice if the mailing list users would come up with a short, yet intuitive/ clear notation for such lambda functions. I think, this would also benefit maxima code. For instance - to square every list entry and make it a matrix and transpose would in such notation be: ( 'matrix @@ (_^2)& /@ [1,2,3,4] ) // transpose vs transpose(apply('matrix,map(lambda([x],x^2),[1,2,3,4]))) Is there any interest for such infix notation to be included in maxima? If there is, then 'names' of these operators should be debated and then implemented into maxima. I for one, would really like this to be a part of maxima. Ziga From robert.dodier at gmail.com Mon Jan 19 12:28:27 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 19 Jan 2009 11:28:27 -0700 Subject: [Maxima] run_testsuite interface change? In-Reply-To: <4974C4C7.10103@ericsson.com> References: <4974C4C7.10103@ericsson.com> Message-ID: On Mon, Jan 19, 2009 at 11:21 AM, Raymond Toy wrote: > Actually, anything other than false is treated as true. Do we want to > accept only true and false? Well, in general only true and false are recognized as Boolean values. I don't think there should be a special case for run_testsuite. best Robert From raymond.toy at ericsson.com Mon Jan 19 12:33:29 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 19 Jan 2009 13:33:29 -0500 Subject: [Maxima] run_testsuite interface change? In-Reply-To: References: <4974C4C7.10103@ericsson.com> Message-ID: <4974C779.8060601@ericsson.com> Robert Dodier wrote: > On Mon, Jan 19, 2009 at 11:21 AM, Raymond Toy wrote: > > >> Actually, anything other than false is treated as true. Do we want to >> accept only true and false? >> > > Well, in general only true and false are recognized as Boolean values. > I don't think there should be a special case for run_testsuite. > > Well, the underlying implementation is basically (test :display_all ), and lisp deals with , so non-NIL means the same as T. If we want to recognize only true and false, I'll have to add code for that (which is easy to do). But what do we want to do if neither NIL nor T are given? Signal an error? Ray From robert.dodier at gmail.com Mon Jan 19 12:38:09 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 19 Jan 2009 11:38:09 -0700 Subject: [Maxima] run_testsuite interface change? In-Reply-To: <4974C779.8060601@ericsson.com> References: <4974C4C7.10103@ericsson.com> <4974C779.8060601@ericsson.com> Message-ID: On Mon, Jan 19, 2009 at 11:33 AM, Raymond Toy wrote: > If we want to recognize only true and false, I'll have to add code for > that (which is easy to do). But what do we want to do if neither NIL > nor T are given? Signal an error? Yes. I think the error detection ought to be in the top-level function ($RUN_TESTSUITE instead of TEST or whatever is called to actually do the test). best Robert From raymond.toy at ericsson.com Mon Jan 19 12:44:44 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 19 Jan 2009 13:44:44 -0500 Subject: [Maxima] Suggestion for implementation of infix 'map' and 'apply' In-Reply-To: (ziga.lenarcic@gmail.com's message of "Mon, 19 Jan 2009 18:26:02 +0100") References: Message-ID: >>>>> "ziga" == ziga lenarcic writes: ziga> Hi! ziga> I have another suggestion regarding infix versions of map an apply. ziga> Infix notation is in many cases easier for humans to read than ziga> prefix. Consider ziga> plus(a,b,c) vs a + b + c. ziga> Maxima functions 'map' and 'apply' are very common in maxima code and ziga> infix versions would help improve readability and reduce the number ziga> of () in the code. Consider ziga> map( lambda([x], x+1), [1,2,3,4]) vs ziga> lambda([x],x+1) /@ [1,2,3,4]. I agree that the later is slightly easier to read. [snip] ziga> The other day I was thinking of making lambda expressions shorter, ziga> something like this: ziga> (_ + 1)& -> lambda([x], x + 1) and (_1 + _2 + 1)& -> lambda([x,y], x ziga> + y + 1) [snip] ziga> benefit maxima code. For instance - to square every list entry and ziga> make it a matrix and transpose would in such notation be: ziga> ( 'matrix @@ (_^2)& /@ [1,2,3,4] ) // transpose vs ziga> transpose(apply('matrix,map(lambda([x],x^2),[1,2,3,4]))) I have to say that these later examples are extremely hard for me to read. But maybe that's because I have not been polluted by Mathematica but I am polluted by Lisp. Ray From al at beshenov.ru Mon Jan 19 13:00:19 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Mon, 19 Jan 2009 22:00:19 +0300 Subject: [Maxima] Minpack added for solving non-linear equations and non-linear least-squares In-Reply-To: <3098DF64-892A-44A0-9206-71B6B0DC2EFC@gmail.com> References: <3098DF64-892A-44A0-9206-71B6B0DC2EFC@gmail.com> Message-ID: <200901192200.20903.al@beshenov.ru> On Monday 19 January 2009 19:56:23 ?iga Lenar?i? wrote: > Nice to see minimisation in maxima finally. I would like to stress > ? the importance of proper maxima-level interface to minpack. In > the past Andrej V. tried to do a simple interface to quadpack > routines, but somehow mailing list couldn't agree on the name, so > maxima still has no interface to numerical integration functions. http://maxima.sourceforge.net/docs/manual/en/maxima_20.html#SEC70 -- Prickle Prickle, Chaos 19 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From raymond.toy at ericsson.com Mon Jan 19 13:01:26 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 19 Jan 2009 14:01:26 -0500 Subject: [Maxima] Minpack added for solving non-linear equations and non-linear least-squares In-Reply-To: <3098DF64-892A-44A0-9206-71B6B0DC2EFC@gmail.com> (ziga.lenarcic@gmail.com's message of "Mon, 19 Jan 2009 17:56:23 +0100") References: <3098DF64-892A-44A0-9206-71B6B0DC2EFC@gmail.com> Message-ID: >>>>> "ziga" == ziga lenarcic writes: ziga> Hi! ziga> Nice to see minimisation in maxima finally. I would like to stress lbfgs has been there for a while. ziga> the importance of proper maxima-level interface to minpack. In the ziga> past Andrej V. tried to do a simple interface to quadpack routines, ziga> but somehow mailing list couldn't agree on the name, so maxima still ziga> has no interface to numerical integration functions. Of course Maxima has an interface to numerical integration routines; it just doesn't have the names that you like. ziga> Hopefully this will not be the case this time. ziga> In my opinion the underlying method names and routine names should be ziga> hidden to the user. Maxima level function should be named by "what ziga> they do", not "what method they use". So I'm in favour of functions ziga> "find_minimum" rather than "minpack_minimize" or something along ziga> those lines. The user should call an appropriately named function ziga> (this goes for quadpack also), which should then decide which method ziga> will be called. Ofcourse user has also the option to choose the ziga> method and set options if he wants to, but an usable soultion should ziga> be found with a simple function call. I'm not smart enough to create the all-powerful, all-solving find_minimum routine that works for everyone everywhere. I'll leave that for someone smarter than me. I will provide some kind of minpack_ that might do something useful for someone, with, perhaps, some convenience features to compute the Jacobian. If someone wants to hook that into find_minimum, that's fine with me. ziga> I would also suggest agains naming packages via their fortran names. ziga> A package "load(optimization)$" should include minimization, perhaps ziga> fitting, linearprogramming/simplex functions imo. I think the user ziga> has a right of not getting to know the names of fortran numerical ziga> libraries, when he wants a simple numerical approximation of an ziga> integral/ fit a function. Maxima should provide that. Good suggestion. But optimization is such a vague name. Does it load zillions of packages that are remotely related to optimization? Even if the user only needs one simple optimization routine? ziga> Hope someone writes nice wrapping functions for minpack. That someone could be you! :-) Ray From LindnerW at t-online.de Mon Jan 19 13:47:24 2009 From: LindnerW at t-online.de (Wolfgang Lindner) Date: Mon, 19 Jan 2009 20:47:24 +0100 Subject: [Maxima] how to use degree in sin function Message-ID: <023b01c97a6e$c5852b80$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> .. or you could use a nonfunctional 'unit-like' solution: degree:= %pi/180$ sin(30*degree) hth Wolfgang -----Urspr?ngliche Nachricht----- Von: Alexey Beshenov An: maxima at math.utexas.edu Cc: ? ?? Datum: Sonntag, 18. Januar 2009 17:27 Betreff: Re: [Maxima] how to use degree in sin function On Sunday 18 January 2009 19:00:19 ??? ?????? wrote: > (%i9) sin(%pi/6); > (%o9) 1/2 > (%i10) sin(30); > (%o10) sin(30) > > we have 30 degree =%pi/6 radian > the sin function is use radian. > how can I use degree in sin funciton > for example > I want input sin(30) =1/2 > I wish the students can free input degree and they can get the sin > function answer. deg_to_rad (x) := x*%pi/180$ sin_deg (x) := sin(deg_to_rad(x))$ sin_deg (30) => 1/2 -- Pungenday, Chaos 18 YOLD 3175 Alexey Beshenov http://beshenov.ru/ _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From O.Kullmann at swansea.ac.uk Mon Jan 19 14:27:19 2009 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Mon, 19 Jan 2009 20:27:19 +0000 Subject: [Maxima] Suggestion for implementation of infix 'map' and 'apply' In-Reply-To: References: Message-ID: <20090119202719.GM1937@cs-wsok.swansea.ac.uk> Hello, On Mon, Jan 19, 2009 at 06:26:02PM +0100, ?iga Lenar?i? wrote: > Hi! > > I have another suggestion regarding infix versions of map an apply. > Infix notation is in many cases easier for humans to read than > prefix. Consider > plus(a,b,c) vs a + b + c. > Maxima functions 'map' and 'apply' are very common in maxima code and > infix versions would help improve readability and reduce the number > of () in the code. Consider > map( lambda([x], x+1), [1,2,3,4]) vs > lambda([x],x+1) /@ [1,2,3,4]. For me the first form is *far* more readable (and it has a robust syntax where I don't need to worry). > I know that it's easily implemented into maxima via 'infix()', and I > have done so with mathematica's "//" infix operator: > infix("//")$ > "//"(expr, func) := func(expr)$ > > It works nicely. However I don't like the fact that a highly > customised 'maxima-init.mac' lead to somewhat unportable code - I > can't send my code to friends and expect to work in an out-of-the-box > maxima. > Therefore I suggest, that such infix operators are introduced into > maxima - if everyone agrees of course. I am rather sceptical about that: Obviously (see above) I don't see value in infix-operations, but additionally for my usage at least Maxima already pays too much attention to (for my understanding) bad practice coming from "mathematical usage". And the use of little symbols I regard already as bad practice on paper (since it only works for a small world, and you necessarily exclude most others, who (by definition) are not familiar with such insider jargon), and definitely in a bigger context like Maxima, which shall be used for many things, the explicit(!) expressive power of language is important. > > The other day I was thinking of making lambda expressions shorter, > something like this: > (_ + 1)& -> lambda([x], x + 1) and (_1 + _2 + 1)& -> lambda([x,y], x > + y + 1) > >From my point of view (using Maxima as a programming language, not as a kind of front-end) Maxima is already fragile enough, so I'm sceptical about the value of such syntactic sugar. Sure, it depends on the usage and the users, but that's my point of view. Oliver P.S. Perhaps you want to provide a package with such facilities? From robert.dodier at gmail.com Mon Jan 19 15:57:11 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 19 Jan 2009 14:57:11 -0700 Subject: [Maxima] how to use degree in sin function In-Reply-To: <023b01c97a6e$c5852b80$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> References: <023b01c97a6e$c5852b80$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> Message-ID: On Mon, Jan 19, 2009 at 12:47 PM, Wolfgang Lindner wrote: > .. or you could use a nonfunctional 'unit-like' solution: > > degree:= %pi/180$ > sin(30*degree) Well, for your amusement ... load (ezunits); matchdeclare (dd, lambda ([e], unitp(e) and units(e) = 'deg)); simp : false; tellsimp (sin(dd), sin(qty(dd) * %pi/180)); simp : true; sin (30); => sin(30) sin (30 ` deg); => 1/2 sin (31 ` deg); => sin(31*%pi/180) I suppose one could define the degree symbol as a postfix operator and match against that. Robert From raymond.toy at ericsson.com Mon Jan 19 16:17:56 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 19 Jan 2009 17:17:56 -0500 Subject: [Maxima] Minpack added for solving non-linear equations and non-linear least-squares AND linear fitting In-Reply-To: <3E26BE17-FBD4-4181-8D31-27ADF2A00EB5@gmail.com> (ziga.lenarcic@gmail.com's message of "Mon, 19 Jan 2009 21:05:24 +0100") References: <3098DF64-892A-44A0-9206-71B6B0DC2EFC@gmail.com> <3E26BE17-FBD4-4181-8D31-27ADF2A00EB5@gmail.com> Message-ID: >>>>> "ziga" == ziga lenarcic writes: ziga> On 19. Jan, 2009, at 8:01 PM, Raymond Toy wrote: >> >> Good suggestion. But optimization is such a vague name. Does it load >> zillions of packages that are remotely related to optimization? Even >> if the user only needs one simple optimization routine? >> ziga> Hope someone writes nice wrapping functions for minpack. >> >> That someone could be you! :-) >> >> Ray ziga> Maybe load(minimisation) is more appropriate.. the package would ziga> contain f2cl minpack and wrapper maxima level functions... What about constrained minimization? We don't have any today, but there could be. (I did hook up an interface to donlp2, but that probably won't be added.) ziga> Yes, maybe I'll write it :) But I'm not yet proficient in lisp ziga> (learning it for a month or two, examining maxima code), however I've No offense to any authors of Lisp code in maxima, but looking at maxima's lisp code is not a good way to learn Lisp and good lisp style in particular. Get a book. Practical Common Lisp is a good book to learn from. There are many others to choose from. Ray From raymond.toy at ericsson.com Mon Jan 19 16:44:16 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 19 Jan 2009 17:44:16 -0500 Subject: [Maxima] run_testsuite interface change? In-Reply-To: References: <4974C4C7.10103@ericsson.com> <4974C779.8060601@ericsson.com> Message-ID: <49750240.7000503@ericsson.com> Robert Dodier wrote: > On Mon, Jan 19, 2009 at 11:33 AM, Raymond Toy wrote: > > >> If we want to recognize only true and false, I'll have to add code for >> that (which is easy to do). But what do we want to do if neither NIL >> nor T are given? Signal an error? >> > > Yes. I think the error detection ought to be in the top-level > function ($RUN_TESTSUITE instead of TEST or whatever is called > to actually do the test). > > It's actually easier in TEST (actually run-testsuite) than in $RUN_TESTSUITE, which basically just parses the options and calls run-testsuite. But where the check happens isn't too important as long as it happens. All of the suggested changes have been made and I'll check them in sometime soon. Ray From nerd_gone_astray at yahoo.com Mon Jan 19 18:52:13 2009 From: nerd_gone_astray at yahoo.com (Rich Hennessy) Date: Mon, 19 Jan 2009 16:52:13 -0800 (PST) Subject: [Maxima] I want to define Message-ID: <887917.85411.qm@web111409.mail.gq1.yahoo.com> I want integrate(pwdelta(x),x,minf,0) 1/2 and integrate(pwdelta(x),x,0,inf) 1/2 I can try making integrate(pwdelta(x),x) = (signum(x)+1)/2 that should work but does not partly because limit(signum(x),x,inf) cannot be computed. Is there a work around? FYI I want these two integrals to be true by definition (of pwdelta)! Rich From toy.raymond at gmail.com Mon Jan 19 20:34:02 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 19 Jan 2009 21:34:02 -0500 Subject: [Maxima] Minpack interface Message-ID: <4975381A.5050607@gmail.com> After looking this over a bit, and looking at lbfgs, I think the right interface to minpack's least squares solver is this: minpack_lsquares(vars, initpt, fcns, [jacobian = matrix], [tolerance = 1d-8]) where vars is a list of the variable names, initpt is the initial guess, and fcns is a list of the functions. If jacobian is given, it is assumed to the Jacobian matrix. If jacobian is true, Maxima will compute the Jacobian from fcns. If jacobian is false, a difference method will be used to compute the Jacobian. So, if the Jacobian is given, minpack routine lmder1 is called. Without a jacobian, lmdif1 is called. A similar interface could be used for Minpack's hybrd function which computes the solution of n non-linear equations in n unknowns. Ray From willisb at unk.edu Mon Jan 19 20:36:11 2009 From: willisb at unk.edu (Barton Willis) Date: Mon, 19 Jan 2009 20:36:11 -0600 Subject: [Maxima] I want to define In-Reply-To: <887917.85411.qm@web111409.mail.gq1.yahoo.com> References: <887917.85411.qm@web111409.mail.gq1.yahoo.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >that?should?work?but?does?not?partly?because?limit(signum(x),x,inf)?cannot >be?computed.??Is?there?a?work?around? A workaround: (%i1) load("abs_integrate.mac")$ (%i9) simp_assuming(limit(signum(x),x,inf), x > 0); (%o9) 1 (%i6) simp_assuming(limit(signum(x),x,minf), x < 0); (%o6) -1 (%i7) simp_assuming(limit(signum(x) * atan(x),x,inf), x > 0); (%o7) %pi/2 You could build your own limit function that does the simp_assuming automatically. Barton From toy.raymond at gmail.com Tue Jan 20 09:17:15 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 20 Jan 2009 10:17:15 -0500 Subject: [Maxima] Minpack interface In-Reply-To: <4975381A.5050607@gmail.com> References: <4975381A.5050607@gmail.com> Message-ID: <4975EAFB.9020303@gmail.com> Raymond Toy wrote: > After looking this over a bit, and looking at lbfgs, I think the right > interface to minpack's least squares solver is this: > > minpack_lsquares(vars, initpt, fcns, [jacobian = matrix], [tolerance = > 1d-8]) > I've implemented this and checked in the changes. The default for the Jacobian is true, which means to compute the Jacobian from the functions. And since the code is very similar, I've implemented the nonlinear solver from minpack: minpack_solve(vars, initpt, fcns, [jacobian = matrix], [tolerance = 1d-8]) Some quick tests indicate that these work as expected. No documentation yet, though. Ray From fateman at cs.berkeley.edu Tue Jan 20 09:51:20 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 20 Jan 2009 07:51:20 -0800 Subject: [Maxima] Minpack interface In-Reply-To: <4975EAFB.9020303@gmail.com> References: <4975381A.5050607@gmail.com> <4975EAFB.9020303@gmail.com> Message-ID: <4975F2F8.4010609@cs.berkeley.edu> As a historical note, the 1978 implementation of "Franz Lisp" hosted Macsyma on the DEC VAX 11/780 computer. Its implementation of arrays was identical to FORTRAN, and interchange between Lisp and FORTRAN was easy. One of the first projects (c. 1979) was an interface between Macsyma and MINPACK. RJF Raymond Toy wrote: > Raymond Toy wrote: > >> After looking this over a bit, and looking at lbfgs, I think the right >> interface to minpack's least squares solver is this: >> >> minpack_lsquares(vars, initpt, fcns, [jacobian = matrix], [tolerance = >> 1d-8]) >> >> > > I've implemented this and checked in the changes. The default for the > Jacobian is true, which means to compute the Jacobian from the functions. > > And since the code is very similar, I've implemented the nonlinear > solver from minpack: > > minpack_solve(vars, initpt, fcns, [jacobian = matrix], [tolerance = 1d-8]) > > Some quick tests indicate that these work as expected. > > No documentation yet, though. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From ziga.lenarcic at gmail.com Mon Jan 19 13:01:42 2009 From: ziga.lenarcic at gmail.com (=?UTF-8?Q?=C5=BDiga_Lenar=C4=8Di=C4=8D?=) Date: Mon, 19 Jan 2009 20:01:42 +0100 Subject: [Maxima] Suggestion for implementation of infix 'map' and 'apply' In-Reply-To: References: Message-ID: Yes, Mathematica's notation is not that beautiful in this area. My suggestion would be ./ for apply (since it takes it "whole") .// for map (since it iterates/ slices through) // for function evaluation on the left side Another function with possible nice infix notation is append. Consider [1,2,3] ./. [4,5,6] => [1,2,3,4,5,6] or something along those lines. Well I think something like draw2d ./ makelist( explicit(x^i, x, -5,5) , i, 1, 3) ; looks nice and clean. Or "(a + b)^3 // expand // ratsimp" looks like youre sending (a + b)^3 through expand and ratsimp. It may take some getting used to it. The important part is, that it would not break any current functionality and that the user can choose if/when he/she uses infix notation or the usual one. Ziga On 19. Jan, 2009, at 7:44 PM, Raymond Toy wrote: >>>>>> "ziga" == ziga lenarcic writes: > > ziga> Hi! > ziga> I have another suggestion regarding infix versions of map > an apply. > ziga> Infix notation is in many cases easier for humans to read > than > ziga> prefix. Consider > ziga> plus(a,b,c) vs a + b + c. > ziga> Maxima functions 'map' and 'apply' are very common in > maxima code and > ziga> infix versions would help improve readability and reduce > the number > ziga> of () in the code. Consider > ziga> map( lambda([x], x+1), [1,2,3,4]) vs > ziga> lambda([x],x+1) /@ [1,2,3,4]. > > I agree that the later is slightly easier to read. > > [snip] > > ziga> The other day I was thinking of making lambda expressions > shorter, > ziga> something like this: > ziga> (_ + 1)& -> lambda([x], x + 1) and (_1 + _2 + 1)& -> > lambda([x,y], x > ziga> + y + 1) > > [snip] > > ziga> benefit maxima code. For instance - to square every list > entry and > ziga> make it a matrix and transpose would in such notation be: > ziga> ( 'matrix @@ (_^2)& /@ [1,2,3,4] ) // transpose vs > ziga> transpose(apply('matrix,map(lambda([x],x^2),[1,2,3,4]))) > > I have to say that these later examples are extremely hard for me to > read. > > But maybe that's because I have not been polluted by Mathematica but I > am polluted by Lisp. > > Ray From ziga.lenarcic at gmail.com Mon Jan 19 13:08:04 2009 From: ziga.lenarcic at gmail.com (=?UTF-8?Q?=C5=BDiga_Lenar=C4=8Di=C4=8D?=) Date: Mon, 19 Jan 2009 20:08:04 +0100 Subject: [Maxima] Minpack added for solving non-linear equations and non-linear least-squares In-Reply-To: <200901192200.20903.al@beshenov.ru> References: <3098DF64-892A-44A0-9206-71B6B0DC2EFC@gmail.com> <200901192200.20903.al@beshenov.ru> Message-ID: <7BEF1ED3-7723-431B-B138-6E21B1E0FF84@gmail.com> I know about quadpack :) However I was thinking more along the lines of some "numerical_integrate" which calles the appropriate quadpack routine, depending on what kind of problem the user stated (finite/infinite, zero function simplification ..). Andrej V. has written a function "nintegrate" which does just that, but it is not included in maxima.. Quadpack is useful indeed, just not very ergonomic, when user has to look up fortran function names depending on what kind of integral he has. This could be automated.. Ziga On 19. Jan, 2009, at 8:00 PM, Alexey Beshenov wrote: > On Monday 19 January 2009 19:56:23 ?iga Lenar?i? wrote: >> Nice to see minimisation in maxima finally. I would like to stress >> the importance of proper maxima-level interface to minpack. In >> the past Andrej V. tried to do a simple interface to quadpack >> routines, but somehow mailing list couldn't agree on the name, so >> maxima still has no interface to numerical integration functions. > > http://maxima.sourceforge.net/docs/manual/en/maxima_20.html#SEC70 > > -- > Prickle Prickle, Chaos 19 YOLD 3175 > Alexey Beshenov http://beshenov.ru/ > From ziga.lenarcic at gmail.com Mon Jan 19 14:05:24 2009 From: ziga.lenarcic at gmail.com (=?UTF-8?Q?=C5=BDiga_Lenar=C4=8Di=C4=8D?=) Date: Mon, 19 Jan 2009 21:05:24 +0100 Subject: [Maxima] Minpack added for solving non-linear equations and non-linear least-squares AND linear fitting In-Reply-To: References: <3098DF64-892A-44A0-9206-71B6B0DC2EFC@gmail.com> Message-ID: <3E26BE17-FBD4-4181-8D31-27ADF2A00EB5@gmail.com> On 19. Jan, 2009, at 8:01 PM, Raymond Toy wrote: > > Good suggestion. But optimization is such a vague name. Does it load > zillions of packages that are remotely related to optimization? Even > if the user only needs one simple optimization routine? > > ziga> Hope someone writes nice wrapping functions for minpack. > > That someone could be you! :-) > > Ray Maybe load(minimisation) is more appropriate.. the package would contain f2cl minpack and wrapper maxima level functions... Yes, maybe I'll write it :) But I'm not yet proficient in lisp (learning it for a month or two, examining maxima code), however I've invested cca. 1 "man week" of work into wxMaxima interface since it's written in C++ which I know relatively well. So I've in some way contributed to Maxima, though not directly :) While speaking of contributions, here is my user level, super easy to use, linear fitting function: /******** MAXIMA CODE ************/ fit(data, functionlist, vars, [optional_args]) := block( [numer:true,float:true, lambdalist, design_matrix, alpha_matrix, beta_vector, sol, vector_b, out_format, out_list, _model, _out_subs:[] ], /* PARAMETER: vars */ /* check if we have a single variable in vars, make it a list */ if atom(vars) then vars:[vars], /* PARAMETER: data */ /* convert data to a matrix if it's a list */ if listp(data) then data: apply('matrix, data) , /* check length of datapoints against the number of vars */ if ( is(length(data[1]) < (length(vars) + 1)) or is(length(data[1]) > (length(vars) + 1))) then error("fit: The number of variables does not match data."), /* PARAMETER: [optional_args] */ /* search [optional_args] for 'output = , default 'model */ out_format: assoc( 'output, optional_args, 'model), /* out_list used for "member" search */ out_list: flatten([out_format]), /* PARAMETER: functionlist */ /* Convert functionlist to a list of lambda functions with vars arguments */ lambdalist: map( lambda([what], apply( 'lambda, what) ), makelist( [vars,functionlist[function_index]] , function_index, 1, length(functionlist)) ), /* FITTING */ /* Construct a design matrix (evaluate lambdalist on all datapoints) */ design_matrix: makelist( makelist( apply(lambdalist[function_index], makelist(data[data_index,k], k, 1 , length(vars)) ) , function_index, 1, length(functionlist)) , data_index, 1, length(data)) , design_matrix: apply('matrix, design_matrix) /* convert listoflist to matrix */ , /* save design_matrix to _out_subs if user requested it in out_list */ if member('design_matrix, out_list) then (_out_subs:cons( 'design_matrix = design_matrix, _out_subs)), vector_b: makelist( data[data_index, length(vars) + 1] , data_index, 1, length(data)) , alpha_matrix: transpose(design_matrix) . design_matrix, beta_vector: transpose(design_matrix) . vector_b, sol: alpha_matrix^^-1 . beta_vector, sol: subst( '"[", 'matrix , transpose(sol) )[1], /* OUTPUT FORMULATION */ /* write fit information to _out_subs */ if member('parameters, out_list) then (_out_subs:cons( 'parameters = sol , _out_subs)), _model: apply("+" , sol * functionlist ), if member('model, out_list) then (_out_subs:cons( 'model = _model , _out_subs)), if member('residuals, out_list) then (_out_subs:cons( 'residuals = fit_residuals(data,_model, vars) ,_out_subs)) , subst(_out_subs , out_format) ) $ fit_residuals( data, fitfunction, vars ) := block( [numer:true,lambdafun], lambdafun: apply( 'lambda, [vars , fitfunction]), makelist( data[data_index][length(vars) + 1] - apply( lambdafun, makelist( data[data_index][k],k,1,length(vars) )) , data_index, 1, length(data)) ) $ /********* MAXIMA CODE ***********/ Example of use: /********* MAXIMA CODE ***********/ dejta: [ [1.0, 2.0], [ 2.0, 3.0], [4.0, 5.0], [8.0,8.0], [6.0,5.0], [12.0,-5]]; /* basic usage */ fit(dejta, [1, x], x); /* 'expert' usage */ fit(dejta, [1, x], [x], output = '[model,residuals, [design_matrix,parameters]]); /* 2d scenario */ data2d: [ [1, 2, 2] , [ 3, 2, 5], [1, 5, 4], [3, 5, 5],[2,1,3], [-1,0,7]] $ fit2d: fit( data2d, [1,x,y,x*y], [x,y] ); /********* MAXIMA CODE ***********/ Function fit accepts either a list of lists or a matrix. By default it returns just the model, but the user can specify it's output, since there is a lot of information one can extract from a fit. Right now "fit" can output only model, residuals, parameters, design_matrix but the function can be extended to calculate various information about the fit. I'm not a fitting expert, so I'm open to suggestions which statisics can be extracted from a fit (anyone?). I will add "chi_squared" output element which is the sum of residuals squared (or is that called R^2 ?) and support for sigmas (error estimates of the data). I intend to write a nonlinear fitting function with similar calling sequence with support for multiple datasets (I've read that someone mentioned it on the mailing list). I think configurable output of a fitting function is a nice touch maxima can provide over MATLAB and such. It makes "fit" much more powerful, while retaining it's ease of use, when output is not specified. User might not be concerned about the model itself but some statistic. One can compare the quality of the fit for different polynomials easily: somedata: [[1,1],[2,2],[3,-1],[5,5],[-1,6],[8,8]]$ /*something*/ makelist([imax, apply("+", fit( somedata, makelist(x^i, i, 0, imax) , x, 'output = 'residuals)^2 ) ], imax, 1, 3); I think such configurable output really shows the power of Maxima compared to systems like MATLAB. Maxima numerical functions should make maximum use of it's symbolic core to gain an edge over faster but not as flexible numerical systems. Lisp vs Fortran is similar in some ways to Maxima/CAS vs MATLAB. I'm open for suggestions about possible outputs of a fitting function... (preferably with some link to resources regarding implementation/ calculation of these outputs). Ziga From andrej.vodopivec at gmail.com Tue Jan 20 12:28:07 2009 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Tue, 20 Jan 2009 19:28:07 +0100 Subject: [Maxima] Minpack interface In-Reply-To: <4975EAFB.9020303@gmail.com> References: <4975381A.5050607@gmail.com> <4975EAFB.9020303@gmail.com> Message-ID: <7775b21a0901201028u20a4ee4dj49dc7b44133debc0@mail.gmail.com> On Tue, Jan 20, 2009 at 4:17 PM, Raymond Toy wrote: > And since the code is very similar, I've implemented the nonlinear > solver from minpack: > > minpack_solve(vars, initpt, fcns, [jacobian = matrix], [tolerance = 1d-8]) I think minpack_solve(fcns, vars, initpt,...) would be more consistent with other functions (solve, mnewton, lbfgs,...). Andrej From toy.raymond at gmail.com Tue Jan 20 14:23:25 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 20 Jan 2009 15:23:25 -0500 Subject: [Maxima] Minpack interface In-Reply-To: <7775b21a0901201028u20a4ee4dj49dc7b44133debc0@mail.gmail.com> References: <4975381A.5050607@gmail.com> <4975EAFB.9020303@gmail.com> <7775b21a0901201028u20a4ee4dj49dc7b44133debc0@mail.gmail.com> Message-ID: <497632BD.4050606@gmail.com> Andrej Vodopivec wrote: > On Tue, Jan 20, 2009 at 4:17 PM, Raymond Toy wrote: > >> And since the code is very similar, I've implemented the nonlinear >> solver from minpack: >> >> minpack_solve(vars, initpt, fcns, [jacobian = matrix], [tolerance = 1d-8]) >> > > I think minpack_solve(fcns, vars, initpt,...) would be more consistent > with other functions (solve, mnewton, lbfgs,...). > > Good point. I'll make that change. (I like short things at the front and long things at the end because it's easier to see.) Ray From toy.raymond at gmail.com Tue Jan 20 14:28:19 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 20 Jan 2009 15:28:19 -0500 Subject: [Maxima] Minpack interface In-Reply-To: <4975F2F8.4010609@cs.berkeley.edu> References: <4975381A.5050607@gmail.com> <4975EAFB.9020303@gmail.com> <4975F2F8.4010609@cs.berkeley.edu> Message-ID: <497633E3.6040906@gmail.com> Richard Fateman wrote: > As a historical note, the 1978 implementation of "Franz Lisp" hosted > Macsyma on the DEC VAX 11/780 computer. > Its implementation of arrays was identical to FORTRAN, and interchange > between Lisp and FORTRAN was > easy. One of the first projects (c. 1979) was an interface between > Macsyma and MINPACK. > Heh. "Those who cannot remember the past, are condemned to repeat it" Ray From robert.dodier at gmail.com Tue Jan 20 14:56:30 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 20 Jan 2009 13:56:30 -0700 Subject: [Maxima] Minpack interface In-Reply-To: <497633E3.6040906@gmail.com> References: <4975381A.5050607@gmail.com> <4975EAFB.9020303@gmail.com> <4975F2F8.4010609@cs.berkeley.edu> <497633E3.6040906@gmail.com> Message-ID: On Tue, Jan 20, 2009 at 1:28 PM, Raymond Toy wrote: > "Those who cannot remember the past, are condemned to repeat it" First as tragedy, second as farce. (Credited to Marx, but iirc he was repeating a remark some French guy whose name escapes me.) Robert From toy.raymond at gmail.com Tue Jan 20 16:51:43 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 20 Jan 2009 17:51:43 -0500 Subject: [Maxima] Proposal for location of fasls Message-ID: <4976557F.806@gmail.com> It's been mentioned previously that some of the share packages like lapack and affine (previously) were trying to compile into the same directories as the source. However, in many situations, these directories are not generally writable. Andreas has modified the affine system so that the affine fasls are saved in the directory binary-foo in *maxima-tempdir*. This is much better than what we have today. However, there is no guarantee that different systems will always have different filenames, so they'll overwrite each other. Also, *maxima-tempdir* defaults to the user's home directory, so fasls from maxima subsystems will clutter the users home directory. I propose that systems should place fasls not in *maxima-tempdir* but in *maxima-userdir*, and they should be in some subdirectory, preferably based on the actual source pathname. Thus, affine would store it fasls in *maxima-userdir*/share/affine/binary-foo and minpack goes in *maxima-userdir*/share/minpack/binary-foo. Let's add a function maxima-subsystem-binary-path: maxima-subsystem-binary-pathname &rest base This creates the pathname *maxima-userdir*//binary- This can be used by systems to create the base directory in which to store the compiled fasls. Another useful utility is maxima-subsystem-source-directory which returns the directory where the defsystem file lives. This is useful in defsystem files to set the source directory relative to the location of the defsystem file itself. Ray From willisb at unk.edu Wed Jan 21 05:12:37 2009 From: willisb at unk.edu (Barton Willis) Date: Wed, 21 Jan 2009 05:12:37 -0600 Subject: [Maxima] unsimplified result from integrate In-Reply-To: References: <4975381A.5050607@gmail.com> <4975EAFB.9020303@gmail.com> <4975F2F8.4010609@cs.berkeley.edu> <497633E3.6040906@gmail.com>, Message-ID: I was looking into bug 2465066 "unsimplified result from integrate." The bug is (%i1) matchdeclare(x, symbolp)$ (%i2) tellsimpafter('integrate(f(x),x), g(x))$ (%i3) integrate(5*f(x)+7,x); (%o3) 5*integrate(f(x),x)+7*x (%i4) expand(%,0,0); (%o4) 5*g(x)+7*x In sinint (sin.lisp), I see ((let ((ans (simplify (let ($opsubst varlist genvar stack) (integrator exp var))))) (if (sum-of-intsp ans) (list '(%integrate) exp var) ans)))))) Changing simplify to ($expand ... 0 0) fixes the bug. I'm not sure why ($expand ... 0 0) works and simplify doesn't. Maybe the code needs to be fixed elsewhere. Advice? Is ($expand ... 0 0) an OK fix? Barton From asau at inbox.ru Wed Jan 21 10:32:47 2009 From: asau at inbox.ru (Aleksej Saushev) Date: Wed, 21 Jan 2009 19:32:47 +0300 Subject: [Maxima] Proposal for location of fasls References: <4976557F.806@gmail.com> Message-ID: <874ozsr55c.fsf@inbox.ru> Raymond Toy writes: > It's been mentioned previously that some of the share packages like > lapack and affine (previously) were trying to compile into the same > directories as the source. However, in many situations, these > directories are not generally writable. > > Andreas has modified the affine system so that the affine fasls are > saved in the directory binary-foo in *maxima-tempdir*. This is much > better than what we have today. > > However, there is no guarantee that different systems will always have > different filenames, so they'll overwrite each other. Also, > *maxima-tempdir* defaults to the user's home directory, so fasls from > maxima subsystems will clutter the users home directory. Maybe it is better to default to /tmp or ${TMPDIR}? > I propose that systems should place fasls not in *maxima-tempdir* but in > *maxima-userdir*, and they should be in some subdirectory, preferably > based on the actual source pathname. Thus, affine would store it fasls > in *maxima-userdir*/share/affine/binary-foo and minpack goes in > *maxima-userdir*/share/minpack/binary-foo. This is called OBJDIR ("object directory") in BSDs. See make(1) at http://man.netbsd.org/cgi-bin/man-cgi?make++NetBSD-current http://man.freebsd.org/cgi/man.cgi?sektion=0&query=make&manpath=FreeBSD+7.1-RELEASE&format=html Specifically, note the first rule for .OBJDIR > This can be used by systems to create the base directory in which to > store the compiled fasls. > > Another useful utility is maxima-subsystem-source-directory which > returns the directory where the defsystem file lives. This is useful in > defsystem files to set the source directory relative to the location of > the defsystem file itself. -- HE CE3OH... From raymond.toy at ericsson.com Wed Jan 21 10:47:12 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Wed, 21 Jan 2009 11:47:12 -0500 Subject: [Maxima] Proposal for location of fasls In-Reply-To: <874ozsr55c.fsf@inbox.ru> References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> Message-ID: <49775190.8090106@ericsson.com> Aleksej Saushev wrote: > Raymond Toy writes: > > >> >> However, there is no guarantee that different systems will always have >> different filenames, so they'll overwrite each other. Also, >> *maxima-tempdir* defaults to the user's home directory, so fasls from >> maxima subsystems will clutter the users home directory. >> > > Maybe it is better to default to /tmp or ${TMPDIR}? > Do you mean *maxima-tempdir* should default to /tmp? I assume there's a good reason for making it the home directory. Perhaps to support windows? Or do you mean put fasls into /tmp/binary-? I don't think that's a good idea. We still have the problem with non-unique names, and I certainly don't want to be loading up someone else's fasls. We could do /tmp//, but I think I would want my fasls to survive a reboot. (We do have an issue with gcl in that gcl doesn't have ensure-directories-exist, so mk:defsystem can't create the directories if they don't already exist. One possible workaround is to make ensure-directories-exist call mkdir -p to create the directories. This will probably work on all unix systems we have today, but I don't know how to do that on windows.) > >> I propose that systems should place fasls not in *maxima-tempdir* but in >> *maxima-userdir*, and they should be in some subdirectory, preferably >> based on the actual source pathname. Thus, affine would store it fasls >> in *maxima-userdir*/share/affine/binary-foo and minpack goes in >> *maxima-userdir*/share/minpack/binary-foo. >> > > This is called OBJDIR ("object directory") in BSDs. See make(1) at > > http://man.netbsd.org/cgi-bin/man-cgi?make++NetBSD-current > http://man.freebsd.org/cgi/man.cgi?sektion=0&query=make&manpath=FreeBSD+7.1-RELEASE&format=html > > Specifically, note the first rule for .OBJDIR > I suppose we could do that. I don't want to make it overly complicated. Ray From al at beshenov.ru Wed Jan 21 10:53:20 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Wed, 21 Jan 2009 19:53:20 +0300 Subject: [Maxima] Proposal for location of fasls In-Reply-To: <49775190.8090106@ericsson.com> References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> <49775190.8090106@ericsson.com> Message-ID: <200901211953.21104.al@beshenov.ru> On Wednesday 21 January 2009 19:47:12 Raymond Toy wrote: > We could do /tmp//, but I think I would want my fasls > to survive a reboot. /var/tmp is preserved after reboots. -- Sweetmorn, Chaos 21 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From O.Kullmann at swansea.ac.uk Wed Jan 21 11:16:06 2009 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Wed, 21 Jan 2009 17:16:06 +0000 Subject: [Maxima] Proposal for location of fasls In-Reply-To: <874ozsr55c.fsf@inbox.ru> References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> Message-ID: <20090121171606.GG1937@cs-wsok.swansea.ac.uk> Hello, may I interrupt from the user perspective: I see two classes of users: (i) with system installation (/usr/local etc.) (ii) with local installation And for class (ii) the default place where to put any auxiliary files etc. should be the installation directory. With all what you say below it seems you are considering only class (i) --- while class (ii) users definitely don't want /temp or their home directory cluttered with auxiliary files/directories (that's why they created a local installation). So shouldn't it be the case that when prefix is set during build, then the installation directory obtains a new sub-directory, say, aux, and everything goes there? (Or else there should be a clear build-option for doing so.) Oliver P.S. As I said, this is written from the (future) user perspective (the affine package is of interest to me; though yet the documentation was to unspecific to me so I didn't get what's it precisely about (and what is the difference to the grobner-package)). On Wed, Jan 21, 2009 at 07:32:47PM +0300, Aleksej Saushev wrote: > Raymond Toy writes: > > > It's been mentioned previously that some of the share packages like > > lapack and affine (previously) were trying to compile into the same > > directories as the source. However, in many situations, these > > directories are not generally writable. > > > > Andreas has modified the affine system so that the affine fasls are > > saved in the directory binary-foo in *maxima-tempdir*. This is much > > better than what we have today. > > > > However, there is no guarantee that different systems will always have > > different filenames, so they'll overwrite each other. Also, > > *maxima-tempdir* defaults to the user's home directory, so fasls from > > maxima subsystems will clutter the users home directory. > > Maybe it is better to default to /tmp or ${TMPDIR}? > > > I propose that systems should place fasls not in *maxima-tempdir* but in > > *maxima-userdir*, and they should be in some subdirectory, preferably > > based on the actual source pathname. Thus, affine would store it fasls > > in *maxima-userdir*/share/affine/binary-foo and minpack goes in > > *maxima-userdir*/share/minpack/binary-foo. > > This is called OBJDIR ("object directory") in BSDs. See make(1) at > > http://man.netbsd.org/cgi-bin/man-cgi?make++NetBSD-current > http://man.freebsd.org/cgi/man.cgi?sektion=0&query=make&manpath=FreeBSD+7.1-RELEASE&format=html > > Specifically, note the first rule for .OBJDIR > > > This can be used by systems to create the base directory in which to > > store the compiled fasls. > > > > Another useful utility is maxima-subsystem-source-directory which > > returns the directory where the defsystem file lives. This is useful in > > defsystem files to set the source directory relative to the location of > > the defsystem file itself. > > > -- > HE CE3OH... > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- Dr. Oliver Kullmann Computer Science Department Swansea University Faraday Building, Singleton Park Swansea SA2 8PP, UK http://cs.swan.ac.uk/~csoliver/ From robert.dodier at gmail.com Wed Jan 21 11:55:39 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 21 Jan 2009 10:55:39 -0700 Subject: [Maxima] Proposal for location of fasls In-Reply-To: <4976557F.806@gmail.com> References: <4976557F.806@gmail.com> Message-ID: On Tue, Jan 20, 2009 at 3:51 PM, Raymond Toy wrote: > maxima-subsystem-binary-pathname &rest base > > This creates the pathname *maxima-userdir*//binary- OK by me, but let's make sure that everything depends on *MAXIMA-USERDIR* only via MAXIMA-SUBSYSTEM-BINARY-PATHNAME. That way if/when we have 2nd thoughts, we can change the location without requiring changes elsewhere. best Robert From robert.dodier at gmail.com Wed Jan 21 11:59:40 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 21 Jan 2009 10:59:40 -0700 Subject: [Maxima] Proposal for location of fasls In-Reply-To: <874ozsr55c.fsf@inbox.ru> References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> Message-ID: On Wed, Jan 21, 2009 at 9:32 AM, Aleksej Saushev wrote: > Maybe it is better to default to /tmp or ${TMPDIR}? Well, /tmp is problematic. There is potential for collisions between different users, and what's worse, stuff may get erased after a while. I guess we could make the user name part of the path, to avoid collisions, but I don't know a way to work around the file volatility feature. Robert From robert.dodier at gmail.com Wed Jan 21 12:01:08 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 21 Jan 2009 11:01:08 -0700 Subject: [Maxima] Proposal for location of fasls In-Reply-To: References: <4976557F.806@gmail.com> Message-ID: On Wed, Jan 21, 2009 at 10:55 AM, Robert Dodier wrote: > On Tue, Jan 20, 2009 at 3:51 PM, Raymond Toy wrote: > >> maxima-subsystem-binary-pathname &rest base >> >> This creates the pathname *maxima-userdir*//binary- > > OK by me, but let's make sure that everything depends on *MAXIMA-USERDIR* > only via MAXIMA-SUBSYSTEM-BINARY-PATHNAME. > That way if/when we have 2nd thoughts, we can change the location > without requiring changes elsewhere. It would be really nice if there were also a way to set the binary path so that stuff can be written into installation directories (by the superuser). That way users could share the compiled stuff. Robert From raymond.toy at ericsson.com Wed Jan 21 12:13:36 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Wed, 21 Jan 2009 13:13:36 -0500 Subject: [Maxima] Proposal for location of fasls In-Reply-To: References: <4976557F.806@gmail.com> Message-ID: <497765D0.8070507@ericsson.com> Robert Dodier wrote: > On Wed, Jan 21, 2009 at 10:55 AM, Robert Dodier wrote: > >> On Tue, Jan 20, 2009 at 3:51 PM, Raymond Toy wrote: >> >> >>> maxima-subsystem-binary-pathname &rest base >>> >>> This creates the pathname *maxima-userdir*//binary- >>> >> OK by me, but let's make sure that everything depends on *MAXIMA-USERDIR* >> only via MAXIMA-SUBSYSTEM-BINARY-PATHNAME. >> That way if/when we have 2nd thoughts, we can change the location >> without requiring changes elsewhere. >> > > It would be really nice if there were also a way to set the binary path so > that stuff can be written into installation directories (by the superuser). > That way users could share the compiled stuff. > > The part about making all uses of *maxima-userdir* is beyond my proposal. I was only considering share stuff with defsystems that wants to stuff fasls somewhere. I certainly agree that everyone should be using maxima-subsystem-binary-pathname (or whatever it's called) so we can easily move things around. For the second item about installation directories, I guess the user (superuser) could set maxima_userdir to be the appropriate place. Or maybe we want a new variable, *maxima-objdir* (maxima_objdir) to specify where fasls should go? With the default being the source directories (as suggested by Oliver K.) and after installation, it defaults to *maxima-userdir* or something. (Don't know if that's possible or not. I have done an installation in ages.) Ray From robert.dodier at gmail.com Wed Jan 21 12:27:16 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 21 Jan 2009 11:27:16 -0700 Subject: [Maxima] Proposal for location of fasls In-Reply-To: <497765D0.8070507@ericsson.com> References: <4976557F.806@gmail.com> <497765D0.8070507@ericsson.com> Message-ID: On Wed, Jan 21, 2009 at 11:13 AM, Raymond Toy wrote: > The part about making all uses of *maxima-userdir* is beyond my > proposal. I was only considering share stuff with defsystems that wants > to stuff fasls somewhere. Sorry, that's what I meant too. Actually we're in agreement. > For the second item about installation directories, I guess the user > (superuser) could set maxima_userdir to be the appropriate place. > Or maybe we want a new variable, *maxima-objdir* (maxima_objdir) to > specify where fasls should go? I can see that another special variable could be useful here, although I'm not sure we want to make this situation even more complicated ... Robert From macrakis at alum.mit.edu Wed Jan 21 13:14:48 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Wed, 21 Jan 2009 14:14:48 -0500 Subject: [Maxima] unsimplified result from integrate In-Reply-To: References: <4975381A.5050607@gmail.com> <4975EAFB.9020303@gmail.com> <4975F2F8.4010609@cs.berkeley.edu> <497633E3.6040906@gmail.com> Message-ID: <8b356f880901211114j6233961dtab518bab554f2ab9@mail.gmail.com> On Wed, Jan 21, 2009 at 6:12 AM, Barton Willis wrote: > I was looking into bug 2465066 "unsimplified result from integrate."... > Changing simplify to ($expand ... 0 0) fixes the bug. I'm not sure why > ($expand ... 0 0) works and simplify doesn't. Maybe the code needs to be > fixed elsewhere. Advice? Is ($expand ... 0 0) an OK fix? Well, ($expand ... 0 0) is possibly an acceptable interim patch until you find the source of the problem, but the problem should really be fixed at the source. Some piece of code is returning as simplified without going through the simplifier, which may be causing other problems as well. -s From raymond.toy at ericsson.com Wed Jan 21 13:34:25 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Wed, 21 Jan 2009 14:34:25 -0500 Subject: [Maxima] Proposal for location of fasls In-Reply-To: References: <4976557F.806@gmail.com> <497765D0.8070507@ericsson.com> Message-ID: <497778C1.305@ericsson.com> Robert Dodier wrote: > On Wed, Jan 21, 2009 at 11:13 AM, Raymond Toy wrote: > > >> For the second item about installation directories, I guess the user >> (superuser) could set maxima_userdir to be the appropriate place. >> Or maybe we want a new variable, *maxima-objdir* (maxima_objdir) to >> specify where fasls should go? >> > > I can see that another special variable could be useful here, > although I'm not sure we want to make this situation even more complicated ... > > How about this (after just a minute of thinking)? First, I do not know how to distinguish a local install versus a system install (as wanted by Oliver). However, when I want the system installation, I always run maxima. For a "local" install, I run maxima-local. If that's good enough to distinguish between a local and system install, then the following might be an option. New environment variable MAXIMA_OBJDIR. In maxima, this is unset. In maxima-local this is set to maxima userdir. On startup, maxima looks at these and sets *maxima-objdir* appropriately, and the function maxima-objdir-path returns the appropriate string (Lisp pathname?) for defsystem to use for storing fasls. I haven't tried to implement this so I don't know if this will work or not. Ray From willisb at unk.edu Wed Jan 21 13:48:20 2009 From: willisb at unk.edu (Barton Willis) Date: Wed, 21 Jan 2009 13:48:20 -0600 Subject: [Maxima] unsimplified result from integrate In-Reply-To: <8b356f880901211114j6233961dtab518bab554f2ab9@mail.gmail.com> References: <4975381A.5050607@gmail.com> <4975EAFB.9020303@gmail.com> <4975F2F8.4010609@cs.berkeley.edu> <497633E3.6040906@gmail.com> <8b356f880901211114j6233961dtab518bab554f2ab9@mail.gmail.com> Message-ID: > On Wed, Jan 21, 2009 at 6:12 AM, Barton Willis wrote: > > I was looking into bug 2465066 "unsimplified result from integrate."... > > Changing simplify to ($expand ... 0 0) fixes the bug. I'm not sure why > > ($expand ... 0 0) works and simplify doesn't. Maybe the code needs to be > > fixed elsewhere. Advice? Is ($expand ... 0 0) an OK fix? > > Well, ($expand ... 0 0) is possibly an acceptable interim patch until > you find the source of the problem, but the problem should really be > fixed at the source. Some piece of code is returning as simplified > without going through the simplifier, which may be causing other > problems as well. Thanks for the advice. I'll keep looking---I think I need to find the code that applies additivity (or outativity) for antiderivatives. If somebody knows where this code is, let me know ($1 for tapping a switch with a mallot and $9,999 for knowing which switch to tap). My fix only changes (simplify ... ) to ($expand ... 0 0), so I'd guess the code was already cynically patched by its author :( Barton From O.Kullmann at swansea.ac.uk Wed Jan 21 14:09:14 2009 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Wed, 21 Jan 2009 20:09:14 +0000 Subject: [Maxima] Proposal for location of fasls In-Reply-To: <497778C1.305@ericsson.com> References: <4976557F.806@gmail.com> <497765D0.8070507@ericsson.com> <497778C1.305@ericsson.com> Message-ID: <20090121200914.GI1937@cs-wsok.swansea.ac.uk> Just to clarify my request (which should also make it simpler): Actually, I myself don't care so much about the general distinction between "local" and "system". My problem is just, that as part of my library, I install (and use) Maxima. And I just want to do my best that my library "doesn't leak", that is, nothing outside of its directory is changed, and once that library-directory is deleted, nothing remains. So when I install Maxima (as part of the installation of my library), then yet I just specify prefix as a certain local directory inside the library directory. Now, whatever you do, hopefully I will have the possibility, perhaps with another installation-option, to make sure that everything Maxima will do (that is, "under the cover") will stay inside that specified installation directory. Hope this can be done. Oliver On Wed, Jan 21, 2009 at 02:34:25PM -0500, Raymond Toy wrote: > Robert Dodier wrote: > > On Wed, Jan 21, 2009 at 11:13 AM, Raymond Toy wrote: > > > > > >> For the second item about installation directories, I guess the user > >> (superuser) could set maxima_userdir to be the appropriate place. > >> Or maybe we want a new variable, *maxima-objdir* (maxima_objdir) to > >> specify where fasls should go? > >> > > > > I can see that another special variable could be useful here, > > although I'm not sure we want to make this situation even more complicated ... > > > > > How about this (after just a minute of thinking)? First, I do not know > how to distinguish a local install versus a system install (as wanted by > Oliver). However, when I want the system installation, I always run > maxima. For a "local" install, I run maxima-local. If that's good > enough to distinguish between a local and system install, then the > following might be an option. > > New environment variable MAXIMA_OBJDIR. In maxima, this is unset. In > maxima-local this is set to maxima userdir. > > On startup, maxima looks at these and sets *maxima-objdir* > appropriately, and the function maxima-objdir-path returns the > appropriate string (Lisp pathname?) for defsystem to use for storing fasls. > > I haven't tried to implement this so I don't know if this will work or not. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima -- Dr. Oliver Kullmann Computer Science Department Swansea University Faraday Building, Singleton Park Swansea SA2 8PP, UK http://cs.swan.ac.uk/~csoliver/ From asau at inbox.ru Wed Jan 21 16:04:11 2009 From: asau at inbox.ru (Aleksej Saushev) Date: Thu, 22 Jan 2009 01:04:11 +0300 Subject: [Maxima] Proposal for location of fasls References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> <49775190.8090106@ericsson.com> Message-ID: <87k58opb8k.fsf@inbox.ru> Raymond Toy writes: > Aleksej Saushev wrote: >> Raymond Toy writes: >>> >>> However, there is no guarantee that different systems will always have >>> different filenames, so they'll overwrite each other. Also, >>> *maxima-tempdir* defaults to the user's home directory, so fasls from >>> maxima subsystems will clutter the users home directory. >>> >> >> Maybe it is better to default to /tmp or ${TMPDIR}? >> > Do you mean *maxima-tempdir* should default to /tmp? I assume there's a > good reason for making it the home directory. Perhaps to support windows? > > Or do you mean put fasls into /tmp/binary-? I don't think that's > a good idea. We still have the problem with non-unique names, and I > certainly don't want to be loading up someone else's fasls. > > We could do /tmp//, but I think I would want my fasls to > survive a reboot. No, I mean that _temp_-dir should be temporary (in accordance to POLA), that is /tmp or like. User home directory should have another descriptive name. (This is the problem with gnuplot interface, it spits its temporary files into my ${HOME} instead of /tmp, thus entering backups &c. Not that it is critical, but this is annoying.) > (We do have an issue with gcl in that gcl doesn't have > ensure-directories-exist, so mk:defsystem can't create the directories > if they don't already exist. One possible workaround is to make > ensure-directories-exist call mkdir -p to create the directories. This > will probably work on all unix systems we have today, but I don't know > how to do that on windows.) Maybe someone interested should read documentation on command shell. My knowledge is almost useless now, since it changed heavily in NT 5. >>> I propose that systems should place fasls not in *maxima-tempdir* but in >>> *maxima-userdir*, and they should be in some subdirectory, preferably >>> based on the actual source pathname. Thus, affine would store it fasls >>> in *maxima-userdir*/share/affine/binary-foo and minpack goes in >>> *maxima-userdir*/share/minpack/binary-foo. >> >> This is called OBJDIR ("object directory") in BSDs. See make(1) at >> >> http://man.netbsd.org/cgi-bin/man-cgi?make++NetBSD-current >> http://man.freebsd.org/cgi/man.cgi?sektion=0&query=make&manpath=FreeBSD+7.1-RELEASE&format=html >> >> Specifically, note the first rule for .OBJDIR >> > I suppose we could do that. I don't want to make it overly complicated. That wasn't meant as instruction, it is information about "prior art." I'm not sure about precise usage pattern for generated files, but if they are meant completely intermediate without own value, quite like object files, you may follow this way. -- HE CE3OH... From raymond.toy at ericsson.com Wed Jan 21 16:46:07 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Wed, 21 Jan 2009 17:46:07 -0500 Subject: [Maxima] Minpack vs autoload of $jacobian Message-ID: I've noticed the following issue with minpack and jacobian, which is autoloaded. This works nicely from a clean maxima: (%i1) load(minpack); (%o1) /apps/public/src/toy/maxima-colnew/share/minpack/minpack.mac (%i2) jacobian([10*(x[1]-x[2]^2),1-x[2]],[x[1],x[2]]); [ 10 - 20 x ] (%o2) [ 2 ] [ ] [ 0 - 1 ] (%i3) minpack_lsquares([10*(x[1]-x[2]^2),1-x[2]],[x[1],x[2]],[-1.2,-1]); (%o3) [[1.0, 1.0], 0.0, 4] But from a clean maxima, try this: (%i1) load(minpack); (%o1) /apps/public/src/toy/maxima-colnew/share/minpack/minpack.mac (%i2) minpack_lsquares([10*(x[1]-x[2]^2),1-x[2]],[x[1],x[2]],[-1.2,-1]); put: atom must be a symbol or a string: 'linearalgebra -- an error. To debug this try debugmode(true); Why the difference? In both cases I see maxima automatically loading the files from linearalgebra, but in the former, I don't get a problem with PUT, but the later dies. The arguments being passed to $PUT are definitely wrong. In the working case, we have ($PUT $LINEARALGEBRA 1 $VERSION) but the broken one says ($PUT '((MQUOTE (18 "path" SRC)) $LINEARALGEBRA) 1 ((MQUOTE (18 "path" SRC)) $VERSION)) Does anyone know what's going on? It's easy enough to compute the jacobian manually in minpack, but I thought I'd use the real jacobian function that maxima already has. Ray From willisb at unk.edu Wed Jan 21 16:59:51 2009 From: willisb at unk.edu (Barton Willis) Date: Wed, 21 Jan 2009 16:59:51 -0600 Subject: [Maxima] Minpack vs autoload of $jacobian In-Reply-To: References: Message-ID: Wild guess: Do you have a compiled linearalgebra.mac? If so, try deleting the compiled version. Barton -----maxima-bounces at math.utexas.edu wrote: ----- >This?works?nicely?from?a?clean?maxima: > >(%i1)?load(minpack); >(%o1)????/apps/public/src/toy/maxima-colnew/share/minpack/minpack.mac >(%i2)?jacobian([10*(x[1]-x[2]^2),1-x[2]],[x[1],x[2]]); >????????????????????????????????[?10??-?20?x??] >(%o2)???????????????????????????[???????????2?] >????????????????????????????????[?????????????] >????????????????????????????????[?0?????-?1???] >(%i3)?minpack_lsquares([10*(x[1]-x[2]^2),1-x[2]],[x[1],x[2]],[-1.2,-1]); >(%o3)????????????????????????[[1.0,?1.0],?0.0,?4] > > >But?from?a?clean?maxima,?try?this: > >(%i1)?load(minpack); >(%o1)????/apps/public/src/toy/maxima-colnew/share/minpack/minpack.mac >(%i2)?minpack_lsquares([10*(x[1]-x[2]^2),1-x[2]],[x[1],x[2]],[-1.2,-1]); > >put:?atom?must?be?a?symbol?or?a?string: >'linearalgebra >?--?an?error.??To?debug?this?try?debugmode(true); > >Why?the?difference???In?both?cases?I?see?maxima?automatically?loading >the?files?from?linearalgebra,?but?in?the?former,?I?don't?get?a?problem >with?PUT,?but?the?later?dies.??The?arguments?being?passed?to?$PUT?are >definitely?wrong.??In?the?working?case,?we?have > >????($PUT?$LINEARALGEBRA?1?$VERSION) > >but?the?broken?one?says > >($PUT?'((MQUOTE >???? ?(18 >???? ??"path" >???? ??SRC)) >???? $LINEARALGEBRA) >??????1 >??????((MQUOTE >???? (18 >???? ?"path" >???? ?SRC)) >???????$VERSION)) > >Does?anyone?know?what's?going?on? > >It's?easy?enough?to?compute?the?jacobian?manually?in?minpack,?but?I >thought?I'd?use?the?real?jacobian?function?that?maxima?already?has. > >Ray >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From toy.raymond at gmail.com Wed Jan 21 17:58:10 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 21 Jan 2009 18:58:10 -0500 Subject: [Maxima] Minpack vs autoload of $jacobian In-Reply-To: References: Message-ID: <4977B692.70408@gmail.com> Barton Willis wrote: > Wild guess: Do you have a compiled linearalgebra.mac? If so, try deleting > the > compiled version. > > No, I didn't compile it. I don't understand what makes it different. Perhaps meval* is different when run from the repl and when run from mfuncall in minpack_lsquares. Ray From toy.raymond at gmail.com Wed Jan 21 18:10:56 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 21 Jan 2009 19:10:56 -0500 Subject: [Maxima] Proposal for location of fasls In-Reply-To: <87k58opb8k.fsf@inbox.ru> References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> <49775190.8090106@ericsson.com> <87k58opb8k.fsf@inbox.ru> Message-ID: <4977B990.4080208@gmail.com> Aleksej Saushev wrote: > Raymond Toy writes: > > >> Aleksej Saushev wrote: >> >>> Raymond Toy writes: >>> >>>> However, there is no guarantee that different systems will always have >>>> different filenames, so they'll overwrite each other. Also, >>>> *maxima-tempdir* defaults to the user's home directory, so fasls from >>>> maxima subsystems will clutter the users home directory. >>>> >>>> >>> Maybe it is better to default to /tmp or ${TMPDIR}? >>> >>> >> Do you mean *maxima-tempdir* should default to /tmp? I assume there's a >> good reason for making it the home directory. Perhaps to support windows? >> >> Or do you mean put fasls into /tmp/binary-? I don't think that's >> a good idea. We still have the problem with non-unique names, and I >> certainly don't want to be loading up someone else's fasls. >> >> We could do /tmp//, but I think I would want my fasls to >> survive a reboot. >> > > No, I mean that _temp_-dir should be temporary (in accordance to POLA), > POLA? > >> (We do have an issue with gcl in that gcl doesn't have >> ensure-directories-exist, so mk:defsystem can't create the directories >> if they don't already exist. One possible workaround is to make >> ensure-directories-exist call mkdir -p to create the directories. This >> will probably work on all unix systems we have today, but I don't know >> how to do that on windows.) >> I'm mistaken. mk:defsys will create the directories with gcl. (I see that I added that.) > > >>> Specifically, note the first rule for .OBJDIR >>> >>> >> I suppose we could do that. I don't want to make it overly complicated. >> > > That wasn't meant as instruction, it is information about "prior art." > > I'm not sure about precise usage pattern for generated files, but if > they are meant completely intermediate without own value, quite like > object files, you may follow this way. > Unlike .o files from C, fasl files are important in Lisp. Ray From toy.raymond at gmail.com Wed Jan 21 19:25:24 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Wed, 21 Jan 2009 20:25:24 -0500 Subject: [Maxima] Proposal for location of fasls In-Reply-To: <8763k8p35n.fsf@inbox.ru> References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> <49775190.8090106@ericsson.com> <87k58opb8k.fsf@inbox.ru> <4977B990.4080208@gmail.com> <8763k8p35n.fsf@inbox.ru> Message-ID: <4977CB04.4030301@gmail.com> Aleksej Saushev wrote: > Raymond Toy writes: > > >>> >>> No, I mean that _temp_-dir should be temporary (in accordance to POLA), >>> >>> >> POLA? >> > > http://en.wikipedia.org/wiki/Principle_of_least_astonishment > > Here "tempdir" is expected to be temporary one, which is /tmp, /var/tmp > or wherever ${TMPDIR} points to. User home directory is the less expected > value for it, contrary to temporary directory it is expected to persist > and enter backup system. > I agree with that, but I don't know the history of how it came to be this way. >> >> Unlike .o files from C, fasl files are important in Lisp. >> > > To me it looks the same way: the only need for object files is time saving, > you can easily skip that step (e.g. Borland "Turbo" compilers did that). > I don't see how "fasl" files are more important. > Yeah, I guess in that respect they're the same. But if I have to wait 30 minutes every time to compile some file for donlp2, I won't be happy. Or if I just loaded the lisp file and interpreted it, I wouldn't be happy if now every problem takes minutes instead of seconds. :-) > After more thought I think that you're really looking for "MAKEOBJDIRPREFIX", > this does solve what you want: when set - user may set - "fasl" files are put > into respective directory and searched there, when unset you use default value, > which is "~/.maxima/fasl/" for user, and some another directory like > /var/lib/maxima/fasl/ for root. > > > Yes, that was basically proposed earlier. Except the default wouldn't change between a user and root unless someone set the variable. Ray From robert.dodier at gmail.com Thu Jan 22 00:41:52 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 21 Jan 2009 23:41:52 -0700 Subject: [Maxima] Minpack vs autoload of $jacobian In-Reply-To: References: Message-ID: On 1/21/09, Raymond Toy wrote: > (%i1) load(minpack); > (%o1) /apps/public/src/toy/maxima-colnew/share/minpack/minpack.mac > (%i2) minpack_lsquares([10*(x[1]-x[2]^2),1-x[2]],[x[1],x[2]],[-1.2,-1]); > > put: atom must be a symbol or a string: > 'linearalgebra > -- an error. To debug this try debugmode(true); Ray, MFUNCALL eventually calls MAPPLY1 which binds the special variable NOEVALARGS to T, which prevents evaluation of the arguments of "put" in linearalgebra.mac, so the single quotes (MQUOTE) are not stripped off 'linearalgebra and 'version, so those arguments are not atoms, they're MQUOTE expressions. That place in MAPPLY1 seems to be the only place NOEVALARGS is bound to anything other than NIL. It has been there since r1.1 src/mlisp.lisp in cvs. The presence of (LET ((NOEVALARGS T)) ...) makes autoloaded stuff behave differently from stuff loaded explicitly --- that to me is an argument for cutting it out. FWIW Robert From rmaheryl at gmail.com Thu Jan 22 01:10:40 2009 From: rmaheryl at gmail.com (Mahery Raharinjatovo) Date: Thu, 22 Jan 2009 10:10:40 +0300 Subject: [Maxima] compiling wxMaxima Message-ID: <5a3526930901212310m38b1f833j3919ec0fdabfcdac@mail.gmail.com> Hello I compiled wxMaxima-0.7.5 with Dev cpp and i had this error C:\...\ImgCell.cpp In member function `virtual void imgCell ::Draw(CellParser&, wxPoint,int,bool)`: C:\..\ImgCell Unused variable 'scale' C:\...\MathCtrl.cpp In member function 'void MathCtrl::Onchar(wxKeyEvent&)': C:\...\MathCtrl.cpp unused variable 'config' Please help me. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090122/5971040b/attachment.htm From sangwinc at for.mat.bham.ac.uk Thu Jan 22 04:05:32 2009 From: sangwinc at for.mat.bham.ac.uk (Chris Sangwin) Date: Thu, 22 Jan 2009 10:05:32 +0000 (GMT) Subject: [Maxima] Difference between "batch" and command line input Message-ID: Dear Maxima list, Could someone help me understand the following difference in behaviour? [Maxima 5.17.0 through wxMaxima 0.8.0 on Windows] I create a file on Maxima's path, e.g. "test.mac", with the following lines simp:false; a1 : 1; a2 : ev(-20,simp); errcatch(a1+a2); In a clean Maxima session I execute this file with "batch" batch("test.mac"); The last output is [1-20] as expected. Now, at the command line I type in errcatch(a1+a2); The output is now [1+-20] which is different. I don't understand this difference. Also, how should I avoid an ugly "1+-20" expression, but without performing the subtraction? Thanks Chris From StefanProbst at gmx.net Wed Jan 21 03:18:54 2009 From: StefanProbst at gmx.net (StefanProbst at gmx.net) Date: Wed, 21 Jan 2009 10:18:54 +0100 Subject: [Maxima] Two different y-axes Message-ID: <20090121091854.88920@gmx.net> Hello, in gnuplot it is possible to have two different y-Axis. This can be interesting for example, if you want to compare two functions. For example plot2d([sin(x),100*sin(x+0.1)+3]) Visually it is not possible to analyse the phase shift between the two functions. Taking the following gnuplot script ---------------------------------------- set ytics nomirror set y2tics autofreq set autoscale y2fix set autoscale yfix plot [0:10] sin(x) axis x1y1,100*sin(x+0.1)+2 axis x1y2 ----------------------------------------- the phase shift is obvious already visually. Is it possible with maxima to plot the functions on different y-axes somehow? Thank you for your answers! Best regards Stefan From asau at inbox.ru Wed Jan 21 18:58:44 2009 From: asau at inbox.ru (Aleksej Saushev) Date: Thu, 22 Jan 2009 03:58:44 +0300 Subject: [Maxima] Proposal for location of fasls In-Reply-To: <4977B990.4080208@gmail.com> (Raymond Toy's message of "Wed\, 21 Jan 2009 19\:10\:56 -0500") References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> <49775190.8090106@ericsson.com> <87k58opb8k.fsf@inbox.ru> <4977B990.4080208@gmail.com> Message-ID: <8763k8p35n.fsf@inbox.ru> Raymond Toy writes: > Aleksej Saushev wrote: >> Raymond Toy writes: >> >>> Aleksej Saushev wrote: >>> >>>> Raymond Toy writes: >>>> >>>>> However, there is no guarantee that different systems will always have >>>>> different filenames, so they'll overwrite each other. Also, >>>>> *maxima-tempdir* defaults to the user's home directory, so fasls from >>>>> maxima subsystems will clutter the users home directory. >>>>> >>>> Maybe it is better to default to /tmp or ${TMPDIR}? >>>> >>> Do you mean *maxima-tempdir* should default to /tmp? I assume there's a >>> good reason for making it the home directory. Perhaps to support windows? >>> >>> Or do you mean put fasls into /tmp/binary-? I don't think that's >>> a good idea. We still have the problem with non-unique names, and I >>> certainly don't want to be loading up someone else's fasls. >>> >>> We could do /tmp//, but I think I would want my fasls to >>> survive a reboot. >> >> No, I mean that _temp_-dir should be temporary (in accordance to POLA), >> > POLA? http://en.wikipedia.org/wiki/Principle_of_least_astonishment Here "tempdir" is expected to be temporary one, which is /tmp, /var/tmp or wherever ${TMPDIR} points to. User home directory is the less expected value for it, contrary to temporary directory it is expected to persist and enter backup system. >>>> Specifically, note the first rule for .OBJDIR >>>> >>> I suppose we could do that. I don't want to make it overly complicated. >> >> That wasn't meant as instruction, it is information about "prior art." >> >> I'm not sure about precise usage pattern for generated files, but if >> they are meant completely intermediate without own value, quite like >> object files, you may follow this way. >> > Unlike .o files from C, fasl files are important in Lisp. To me it looks the same way: the only need for object files is time saving, you can easily skip that step (e.g. Borland "Turbo" compilers did that). I don't see how "fasl" files are more important. After more thought I think that you're really looking for "MAKEOBJDIRPREFIX", this does solve what you want: when set - user may set - "fasl" files are put into respective directory and searched there, when unset you use default value, which is "~/.maxima/fasl/" for user, and some another directory like /var/lib/maxima/fasl/ for root. -- HE CE3OH... From alexanderk.hansen at gmail.com Thu Jan 22 09:26:42 2009 From: alexanderk.hansen at gmail.com (Alexander Hansen) Date: Thu, 22 Jan 2009 10:26:42 -0500 Subject: [Maxima] Integration issue on maxima-5.17.0 ; appears to be platform-independent, and changed from prior versions. Message-ID: <49789032.5050701@gmail.com> Hi. I'll apologize in advance if this issue has been discussed before: I'm new on this list, and I didn't see the issue in my archive search. I'm currently the maintainer for maxima for the Fink project, and this issue came up on our lists. In 5.17.0 I get the following on Windows (GCL), Mac OS X (SBCL), or Linux [Debian] (GCL): $ maxima Maxima 5.17.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. The function bug_report() provides bug reporting information. (%i1) integrate(r^(-3),r,R,inf); Is R positive, negative, or zero? positive; Integral is divergent -- an error. To debug this try debugmode(true) However, I checked against an earlier version that I happened to have handy, 5.13.0 from Ubuntu Linux (GCL), and I got the answer that I expected: $ maxima Maxima 5.13.0 http://maxima.sourceforge.net Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (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) integrate(r^(-3),r,R,inf); Is R positive, negative, or zero? positive ; 1 (%o1) ---- 2 2 R Was this an intentional change in the behavior? From robert.dodier at gmail.com Thu Jan 22 09:53:19 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 22 Jan 2009 08:53:19 -0700 Subject: [Maxima] Integration issue on maxima-5.17.0 ; appears to be platform-independent, and changed from prior versions. In-Reply-To: <49789032.5050701@gmail.com> References: <49789032.5050701@gmail.com> Message-ID: On 1/22/09, Alexander Hansen wrote: > (%i1) integrate(r^(-3),r,R,inf); > Is R positive, negative, or zero? > > positive; > Integral is divergent Observed in 5.17.1, but not in current build from cvs, so I guess it is fixed. I'll throw in a test case to make sure it stays fixed. Thanks for pointing it out. Robert Dodier From raymond.toy at ericsson.com Thu Jan 22 11:40:07 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Thu, 22 Jan 2009 12:40:07 -0500 Subject: [Maxima] Proposal for location of fasls In-Reply-To: <4977CB04.4030301@gmail.com> References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> <49775190.8090106@ericsson.com> <87k58opb8k.fsf@inbox.ru> <4977B990.4080208@gmail.com> <8763k8p35n.fsf@inbox.ru> <4977CB04.4030301@gmail.com> Message-ID: <4978AF77.1030209@ericsson.com> Ok. Based on some of the dicussion, here is what I have come up with. Add a new variable $maxima_objdir (Lisp: *maxima-objdir*). This is where maxima will store object files (fasls). By default it is initialized to the value of $maxima_userdir (Lisp: *maxima-userdir*). However, if you set the environment variable MAXIMA_OBJDIR, that will be used instead. And there will be a new function MAXIMA-OBJDIR that will return *maxima-objdir*. If MAXIMA-OBJDIR is given any arguments, they are assumed to be subdirectories of *maxima-objdir*, and MAXIMA-OBJDIR will return a pathname with those directories appended. For example (maxima-objdir "share" "minpack") will return something like "/home/toy/.maxima/share/minpack". I also added a convenience function MAXIMA-LOAD-PATHNAME-DIRECTORY that returns the directory part of the *LOAD-PATHNAME*. GCL doesn't have *LOAD-PATHNAME*, but does have SYS:*LOAD-PATHNAME*, so this function hides that difference. (This is useful in defsystems if all of the files in a system are relative to the location of the defsystem file itself.) I have not decided what to do with maxima (script) or maxima-local. I think I'll leave them as is for now. How does that sound? Ray From robert.dodier at gmail.com Thu Jan 22 13:46:42 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 22 Jan 2009 12:46:42 -0700 Subject: [Maxima] Difference between "batch" and command line input In-Reply-To: References: Message-ID: On Thu, Jan 22, 2009 at 3:05 AM, Chris Sangwin wrote: > I create a file on Maxima's path, e.g. "test.mac", with the following > lines > > simp:false; > a1 : 1; > a2 : ev(-20,simp); > errcatch(a1+a2); > > In a clean Maxima session I execute this file with "batch" > > batch("test.mac"); > > The last output is [1-20] as expected. > > Now, at the command line I type in > errcatch(a1+a2); > > The output is now [1+-20] which is different. This behavior appears to be a symptom of a bug in the display code. The presence of extra stuff in the operator of an expression, such as line number info emplaced by the batch code, causes the display code to treat -20 differently. (%i1) :lisp (displa '((mplus) 1 -20)) 1 + (- 20) NIL (%i1) :lisp (displa '((mplus foo) 1 -20)) 1 - 20 NIL The batch code puts in stuff like (17 "foo.mac" SRC) but from what I can tell, it doesn't matter what the stuff is; FOO has the same effect. I'll take a look at the display code. I think the correct output for the second example above would be the same as the first. > Also, how should I avoid an ugly "1+-20" expression, but without > performing the subtraction? Well, 1 + (- 20) looks correct to me; after all simp:false prevents Maxima from applying identities such as x + (- y) = x - y. Perhaps you want to apply just that one identity -- there may be a way to do it, but I wonder if it's worth the trouble. I'll let you be the judge of that. Let me know how you want to proceed. best Robert Dodier From biomates at telefonica.net Thu Jan 22 14:10:45 2009 From: biomates at telefonica.net (Mario Rodriguez) Date: Thu, 22 Jan 2009 21:10:45 +0100 Subject: [Maxima] Two different y-axes In-Reply-To: <20090121091854.88920@gmx.net> References: <20090121091854.88920@gmx.net> Message-ID: <1232655045.10069.16.camel@pc> El mi?, 21-01-2009 a las 10:18 +0100, StefanProbst at gmx.net escribi?: > Hello, > > in gnuplot it is possible to have two different y-Axis. This can be interesting for example, if you want to compare two functions. For example > > plot2d([sin(x),100*sin(x+0.1)+3]) > > Visually it is not possible to analyse the phase shift between the two functions. Taking the following gnuplot script > ---------------------------------------- > set ytics nomirror > set y2tics autofreq > set autoscale y2fix > set autoscale yfix > plot [0:10] sin(x) axis x1y1,100*sin(x+0.1)+2 axis x1y2 > ----------------------------------------- > the phase shift is obvious already visually. > > Is it possible with maxima to plot the functions on different y-axes somehow? Hello, Download current cvs draw.lisp from http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/share/draw/draw.lisp load it and type draw2d( explicit(sin(x),x,0,10), right_yaxis = true, y2tics = true, color = blue, user_preamble = "set ytics nomirror", explicit(100*sin(x+0.1)+2,x,0,10)); The key option is 'right_yaxis'; set it to false (default) or true before the 2d graphics objects you want to scale with respect to the right y-axis. This is a quick hack and was not fully tested. Documentation comming soon. Probably, I should rename options 'right_yaxis' and/or 'y2tics'. I'm open to suggestions. -- Mario From ziga.lenarcic at gmail.com Thu Jan 22 17:56:32 2009 From: ziga.lenarcic at gmail.com (=?UTF-8?Q?=C5=BDiga_Lenar=C4=8Di=C4=8D?=) Date: Fri, 23 Jan 2009 00:56:32 +0100 Subject: [Maxima] Two different y-axes Message-ID: <8FCE1C36-DE54-4F93-ACBE-2CAA4E2FA0DF@gmail.com> Perhaps yaxis_secondary ytics_secondary Or shorter, but not so "correct": yaxis2 ytics2. I'm in favour of the first one (typing a few more keystrokes resulting in greater readability of code). Also maxima (at least the new stuff) favours spelled out names, which is good imo. Maybe the addition to userpreamble can be automatically set when yaxis_secondary = true? Ziga From robert.dodier at gmail.com Thu Jan 22 18:51:19 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Thu, 22 Jan 2009 17:51:19 -0700 Subject: [Maxima] Proposal for location of fasls In-Reply-To: <4978AF77.1030209@ericsson.com> References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> <49775190.8090106@ericsson.com> <87k58opb8k.fsf@inbox.ru> <4977B990.4080208@gmail.com> <8763k8p35n.fsf@inbox.ru> <4977CB04.4030301@gmail.com> <4978AF77.1030209@ericsson.com> Message-ID: On Thu, Jan 22, 2009 at 10:40 AM, Raymond Toy wrote: > How does that sound? OK by me on all counts. Robert From toy.raymond at gmail.com Thu Jan 22 19:35:44 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 22 Jan 2009 20:35:44 -0500 Subject: [Maxima] Proposal for location of fasls In-Reply-To: References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> <49775190.8090106@ericsson.com> <87k58opb8k.fsf@inbox.ru> <4977B990.4080208@gmail.com> <8763k8p35n.fsf@inbox.ru> <4977CB04.4030301@gmail.com> <4978AF77.1030209@ericsson.com> Message-ID: <49791EF0.3020900@gmail.com> Robert Dodier wrote: > On Thu, Jan 22, 2009 at 10:40 AM, Raymond Toy wrote: > > >> How does that sound? >> > > OK by me on all counts. > > Thanks. I'll check in these changes shortly. Ray From toy.raymond at gmail.com Thu Jan 22 19:48:55 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 22 Jan 2009 20:48:55 -0500 Subject: [Maxima] noevalargs (Re: Minpack vs autoload of $jacobian) In-Reply-To: References: Message-ID: <49792207.1070300@gmail.com> Robert Dodier wrote: > On 1/21/09, Raymond Toy wrote: > > >> (%i1) load(minpack); >> (%o1) /apps/public/src/toy/maxima-colnew/share/minpack/minpack.mac >> (%i2) minpack_lsquares([10*(x[1]-x[2]^2),1-x[2]],[x[1],x[2]],[-1.2,-1]); >> >> put: atom must be a symbol or a string: >> 'linearalgebra >> -- an error. To debug this try debugmode(true); >> > > Ray, MFUNCALL eventually calls MAPPLY1 which binds the special > variable NOEVALARGS to T, which prevents evaluation of the > arguments of "put" in linearalgebra.mac, so the single quotes (MQUOTE) > are not stripped off 'linearalgebra and 'version, so those arguments are > not atoms, they're MQUOTE expressions. > > That place in MAPPLY1 seems to be the only place NOEVALARGS is > bound to anything other than NIL. It has been there since r1.1 src/mlisp.lisp > in cvs. > > The presence of (LET ((NOEVALARGS T)) ...) makes autoloaded > stuff behave differently from stuff loaded explicitly --- that to me > is an argument for cutting it out. > > That works for me. But I wonder what problem it was intended to solve way back when. Can someone with Macsyma see if it behaves the same? Ray From toy.raymond at gmail.com Thu Jan 22 19:53:12 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 22 Jan 2009 20:53:12 -0500 Subject: [Maxima] Share autoloads? Message-ID: <49792308.3030103@gmail.com> While looking at the minpack vs $jacobian autoload, I noticed that src/max_ext.lisp contains the list of things that should autoload. Is that correct? It seems to me that it would be nice if we could look through the share directory for an autoload file that defines what the share package wants to be autoloaded? Less work for maxima, and it allows share packages not included with maxima itself to define what it wants to be autoloaded. It also reduces the coupling of the core maxima code with the share packages. Anyway, just a thought. I haven't tried to implement any of this. Ray From toy.raymond at gmail.com Thu Jan 22 20:00:14 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 22 Jan 2009 21:00:14 -0500 Subject: [Maxima] Runtime determination of share directories? Message-ID: <497924AE.9030406@gmail.com> Currently maxima has a manually maintained list of share directories (see set-pathnames in src/init-cl.lisp). Wouldn't it be nicer if we could do this at startup and just find all of the directories in share directory? Then we wouldn't have to maintain this list at all, and users can easily add share packages themselves and have them automatically available. (Well, perhaps we could keep a few of the core share packages in the list, but most would be determined at runtime). I played with this a while back, but never finished it. I think, however, that all of the lisps we support can do this using the Lisp DIRECTORY function with a bit of extra glue to return the right stuff. GCL might be a bit more difficult, but I think it can be done there too. Anyway, just a thought. Ray From nobuyuki_1998 at yahoo.co.jp Thu Jan 22 23:48:05 2009 From: nobuyuki_1998 at yahoo.co.jp (nobuyuki) Date: Fri, 23 Jan 2009 14:48:05 +0900 (JST) Subject: [Maxima] to japanese version Message-ID: <20090123054806.67422.qmail@web3903.mail.bbt.yahoo.co.jp> hi all .im japanese.i wanna maxima into japanese.where is the language file?how can i get maxima into japanese version?lend me a hand plz. -------------------------------------- Power up the Internet with Yahoo! Toolbar. http://pr.mail.yahoo.co.jp/toolbar/ From maxima at mgenovese.otherinbox.com Fri Jan 23 01:13:39 2009 From: maxima at mgenovese.otherinbox.com (maxima at mgenovese.otherinbox.com) Date: Fri, 23 Jan 2009 02:13:39 -0500 Subject: [Maxima] Windows environment variables needed for xMaxima and wxMaxima Message-ID: <200901230713.n0N7DbZs004328@box7.911domain.com> An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090123/a3932fdd/attachment.htm From al at beshenov.ru Fri Jan 23 01:34:13 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Fri, 23 Jan 2009 10:34:13 +0300 Subject: [Maxima] to japanese version In-Reply-To: <20090123054806.67422.qmail@web3903.mail.bbt.yahoo.co.jp> References: <20090123054806.67422.qmail@web3903.mail.bbt.yahoo.co.jp> Message-ID: <200901231034.14171.al@beshenov.ru> On Friday 23 January 2009 08:48:05 nobuyuki wrote: > hi all .im japanese.i wanna maxima into japanese.where is > the language file?how can i get maxima into japanese > version?lend me a hand plz. If you mean the wxMaxima interface, then its .tar.gz contains a directory called "locales" with .po files. Currently, it lacks Japanese. Are you looking for a translation or you want to contribute it? -- Pungenday, Chaos 23 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From jromerobernal at gmail.com Fri Jan 23 01:48:26 2009 From: jromerobernal at gmail.com (Juan Pablo Romero Bernal) Date: Fri, 23 Jan 2009 02:48:26 -0500 Subject: [Maxima] Integration issue on maxima-5.17.0 ; appears to be platform-independent, and changed from prior versions. In-Reply-To: References: <49789032.5050701@gmail.com> Message-ID: Hi, >> (%i1) integrate(r^(-3),r,R,inf); >> Is R positive, negative, or zero? >> >> positive; >> Integral is divergent > > Observed in 5.17.1, but not in current build from cvs, so I guess it is fixed. > I'll throw in a test case to make sure it stays fixed. > Thanks for pointing it out. I've compiled Maxima from CVS (under CLISP) and the bug has fixed. Bye, -- Juan Pablo Romero Bernal Grupo Linux Universidad Distrital Blog: http://jpromerobx.blogspot.com/ Visita el sitio web de Software Libre en Colombia: http://www.el-directorio.org From biomates at telefonica.net Fri Jan 23 03:02:27 2009 From: biomates at telefonica.net (Mario Rodriguez) Date: Fri, 23 Jan 2009 10:02:27 +0100 Subject: [Maxima] Two different y-axes In-Reply-To: <8FCE1C36-DE54-4F93-ACBE-2CAA4E2FA0DF@gmail.com> References: <8FCE1C36-DE54-4F93-ACBE-2CAA4E2FA0DF@gmail.com> Message-ID: <1232701347.5884.15.camel@pc> > yaxis_secondary > ytics_secondary > > Or shorter, but not so "correct": > > yaxis2 > ytics2. > In current cvs version I added these new options to give some support for the second y-axis: y2range y2tics y2tics_rotate y2tics_axis right_axis which should be changed to something like: yrange_secondary ytics_secondary ytics_rotate_secondary ytics_axis_secondary yaxis_secondary respectively. I don't have any problems renaming them this way. > > Maybe the addition to userpreamble can be automatically set when > yaxis_secondary = true? Yes, I had also this in mind for the next commit. Thanks for your comments. -- Mario From bastian at pranzas.com Fri Jan 23 05:07:48 2009 From: bastian at pranzas.com (Bastian Pranzas) Date: Fri, 23 Jan 2009 12:07:48 +0100 Subject: [Maxima] optimize() function Message-ID: <87515d920901230307h252aa878x4d3e330c65486cc2@mail.gmail.com> Hi, I use maxima to find formulas I want to use in software development. It is pretty common, that I can bring my formulas to sums of products of serveral variables. To keep calculation time at a minimum I want to minimize the actual count of operations. I found that the optimize() function attempts to do what I want. But it is not very successful i.e. an expression like a*b*c+b*c*d, that contains the product b*c twice can not be optimized. Is there a way to do this with maxima? If not (sorry for being off-topic), does somebody know of a (free) CAS that can do this? Bastian Pranzas From ziga.lenarcic at gmail.com Fri Jan 23 09:25:25 2009 From: ziga.lenarcic at gmail.com (=?UTF-8?Q?=C5=BDiga_Lenar=C4=8Di=C4=8D?=) Date: Fri, 23 Jan 2009 16:25:25 +0100 Subject: [Maxima] A question about defmvar Message-ID: <7ADC409B-4B8A-4E5C-A094-DB5A08A3FE1A@gmail.com> Hi! Going through Maxima's code, I'm wondering what is the difference between defvar and defmvar. Also, what's the difference between defun and defmfun? Ziga From talon at lpthe.jussieu.fr Fri Jan 23 09:57:26 2009 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 23 Jan 2009 16:57:26 +0100 Subject: [Maxima] Proposal for location of fasls References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> Message-ID: Robert Dodier wrote: > On Wed, Jan 21, 2009 at 9:32 AM, Aleksej Saushev wrote: > >> Maybe it is better to default to /tmp or ${TMPDIR}? > > Well, /tmp is problematic. There is potential for collisions between > different users, and what's worse, stuff may get erased after a while. > > I guess we could make the user name part of the path, to avoid collisions, > but I don't know a way to work around the file volatility feature. > > Robert Speaking about affine, i think that the best place to compile it is in "binary-gcl" or "binary-cmucl" subdirectory of affine like it was previously. This way the installation is shared by all users. The only thing to be done is to mention in the documentation of affine that it must be compiled as root or administrator once. For me this solution is ways simpler and more appropriate than putting binaries in some strange place, ready for collisions. While on that i have compiled affine on 5.17.1 by using the indication by R. Toy somewhere on Google, that is, replace last line by: (mk:oos "affine" :compile) and it works no problem. The Grobner basis computation in affine is *much much* faster than the one in the Grobner package. Little problem, such basis are not unique, and it is difficult to check results between two implementations, i have tried comparing with Maple. Unfortunately affine is very little documented, in particular in the way order of variables is defined, and their weight. But the result entirely depends on that. Anyways, speedwise, Maple and affine are in the same league, while the Grobner package leads to extremely slow computations, for example for /* A tough example learned from Cox */ poly_grobner([x^5+y^4+z^3-1,x^3+y^3+z^2-1], [x,y,z]); takes 1mn30s where affine and Maple answer after around a second. -- Michel Talon From robert.dodier at gmail.com Fri Jan 23 10:12:54 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 23 Jan 2009 09:12:54 -0700 Subject: [Maxima] Runtime determination of share directories? In-Reply-To: <497924AE.9030406@gmail.com> References: <497924AE.9030406@gmail.com> Message-ID: On 1/22/09, Raymond Toy wrote: > Wouldn't it be nicer if we could do this at startup and just find all of > the directories in share directory? Then we wouldn't have to maintain > this list at all, and users can easily add share packages themselves and > have them automatically available. (Well, perhaps we could keep a few > of the core share packages in the list, but most would be determined at > runtime). Yes, that's a good idea. Have at it! > I played with this a while back, but never finished it. I think, > however, that all of the lisps we support can do this using the Lisp > DIRECTORY function with a bit of extra glue to return the right stuff. > GCL might be a bit more difficult, but I think it can be done there too. I believe it is within the realm of possibility that we might stop working around GCL's idiosyncrasies. I think it would be worth the time to compare Maxima + ECL against Maxma + GCL on various platforms, considering ECL as a possible replacement for GCL. If someone wants to do that & report to the mailing list, that would be terrific. FWIW Robert Dodier From robert.dodier at gmail.com Fri Jan 23 10:19:48 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 23 Jan 2009 09:19:48 -0700 Subject: [Maxima] potential for using Sage build farm for Maxima ports Message-ID: Michael, If I am not mistaken, the Sage project has a collection of different systems which are used for testing Sage ports. What is the potential for using the Sage build farm for testing Maxima ports? Specifically I am interested in testing Maxima + ECL and Maxima + GCL. For the record, aside from ensuring that run_testsuite succeeds, I am hoping to find out whether the stuff around the edges (plotting, on-line documentation, anything that causes file i/o, console interaction, maybe other stuff) works as expected. Thanks for your help, Robert Dodier From harald at lefant.net Fri Jan 23 10:22:39 2009 From: harald at lefant.net (Harald Geyer) Date: Fri, 23 Jan 2009 17:22:39 +0100 Subject: [Maxima] optimize() function In-Reply-To: <87515d920901230307h252aa878x4d3e330c65486cc2@mail.gmail.com> References: <87515d920901230307h252aa878x4d3e330c65486cc2@mail.gmail.com> Message-ID: > Hi, > > I use maxima to find formulas I want to use in software development. > It is pretty common, that I can bring my formulas to sums of products > of serveral variables. To keep calculation time at a minimum I want to > minimize the actual count of operations. I found that the optimize() > function attempts to do what I want. But it is not very successful > i.e. an expression like a*b*c+b*c*d, that contains the product b*c > twice can not be optimized. Is there a way to do this with maxima? Well, if you just need to minimize the total number of operations, then I think factor() is all you need. If you want to introduce some metric (ie. + has cost 1, * has cost 2, power has cost 5) then this can be done too but it is some work... HTH, Harald From robert.dodier at gmail.com Fri Jan 23 10:24:34 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 23 Jan 2009 09:24:34 -0700 Subject: [Maxima] stack overflow / endless loop in rtest11 Message-ID: I am getting a stack overflow or endless loop in rtest11. Does anyone else see that? Seems to get stuck somewhere around this problem: block([algebraic:false],errcatch(typeof(2*%e+x*%pi))); Robert From fateman at cs.berkeley.edu Fri Jan 23 10:57:03 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Fri, 23 Jan 2009 08:57:03 -0800 Subject: [Maxima] A question about defmvar In-Reply-To: <7ADC409B-4B8A-4E5C-A094-DB5A08A3FE1A@gmail.com> References: <7ADC409B-4B8A-4E5C-A094-DB5A08A3FE1A@gmail.com> Message-ID: <4979F6DF.509@cs.berkeley.edu> ?iga Lenar?i? wrote: > Hi! > > Going through Maxima's code, I'm wondering what is the difference > between defvar and defmvar. Also, what's the difference between defun > and defmfun? > > Ziga > Not much. I think that historically defmvar and defmfun were used by maclisp and lispmachine lisps to simulate what eventually were standardized in common lisp as defvar and defun. There are additional features for backward compatibility and recordkeeping of what files defined which functions, but these are disabled for common lisp (and probably re-introduced by common lisp compilers). You can use defmfun if you want, but it means you cannot read your program into an ordinary lisp. It must have some of the Maxima system loaded. (specifically the definition of defmfun in maxmac.lisp or commac.lisp. From robert.dodier at gmail.com Fri Jan 23 11:52:35 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 23 Jan 2009 10:52:35 -0700 Subject: [Maxima] A question about defmvar In-Reply-To: <7ADC409B-4B8A-4E5C-A094-DB5A08A3FE1A@gmail.com> References: <7ADC409B-4B8A-4E5C-A094-DB5A08A3FE1A@gmail.com> Message-ID: On Fri, Jan 23, 2009 at 8:25 AM, ?iga Lenar?i? wrote: > Going through Maxima's code, I'm wondering what is the difference > between defvar and defmvar. Also, what's the difference between defun > and defmfun? DEFMVAR puts the declared symbol on a list of symbols which are reassigned their initial values by the Maxima function "reset". It might do other things, I don't remember for sure; MACROEXPAND could be helpful here. Robert Dodier From asau at inbox.ru Fri Jan 23 12:07:20 2009 From: asau at inbox.ru (Aleksej Saushev) Date: Fri, 23 Jan 2009 21:07:20 +0300 Subject: [Maxima] Runtime determination of share directories? References: <497924AE.9030406@gmail.com> Message-ID: <87eiytlwvb.fsf@inbox.ru> Robert Dodier writes: > I believe it is within the realm of possibility that we might stop > working around GCL's idiosyncrasies. > > I think it would be worth the time to compare Maxima + ECL against > Maxma + GCL on various platforms, considering ECL as a possible > replacement for GCL. If someone wants to do that & report to the > mailing list, that would be terrific. ECL seems to work on more platforms and is in active development, GCL doesn't work on NetBSD at least and looks abandoned. On this acount I don't even try to revive GCL. -- HE CE3OH... From michael.abshoff at googlemail.com Fri Jan 23 12:16:07 2009 From: michael.abshoff at googlemail.com (Michael Abshoff) Date: Fri, 23 Jan 2009 10:16:07 -0800 Subject: [Maxima] potential for using Sage build farm for Maxima ports In-Reply-To: References: Message-ID: <497A0967.3050708@gmail.com> Robert Dodier wrote: > Michael, Hi Robert, > If I am not mistaken, the Sage project has a collection of different > systems which are used for testing Sage ports. Yep. > What is the potential for using the Sage build farm for testing > Maxima ports? I see no problem doing so since we are helping ourselves here, too :) > Specifically I am interested in testing Maxima + ECL > and Maxima + GCL. Mhhh, we are finally switching this week to ECL after talking about it for more than six months. I have gotten Maxima 5.16.3 to pass its test suite by building clisp 2.47 on Solaris 10/Sparc with a gcc 3.2.3. If anybody wants that as a binary (since the blastwave site has an ancient 2.28 clisp only) I am more than happy to provide it. We have been setting up all the needed bits (i.e. buildbot and many [D]RCS clients on those boxen) and are in the process of adding various projects to the list we test. Note that the truly interesting boxen are behind firewalls and have severely limited connectivity, i.e. only one box can even get to the outside on every port and the other ones are usually unable to resolve external IPs, i.e. no email to the outside. But given that I need to check on the status of my builds I am there nearly daily anyway and can forward things to the list/someone like you who will deal with the results then. The regular stuff (about 20 VMWare images running 24/7 on a nice new 24 Core/128 GB box with 12 Linux distros, FreeBSD, various Solarises, Cygwin and more in the future) are easily accessible and I can set up a buildbot that can also test on OSX 10.4, 10.5 and so on. In the near future you should also be able to log into those VMware images with you sage.math account directly. If you need an account just (recently all account holders who had not logged in for six months had their access disabled) ping me off list. Re GCL: I have build 2.6.7 as well as 2.6.8CVS on all the "interesting" machines and at least the naive "configure && make && make install" fails on all boxen, but one Itanium. When I complain about gcl's build system it is exactly from that experience since in most cases it was instantly clear from the error message that libbfd.a was missing from the system or some equally trivial configure problem was to blame. I guess when trying again I ought to use the internal libbfd and see how far I get. I have some sbcl, cmucl on various Solaris boxen and can likely build on more of them as needed. There is also someone now working on packaging ecl in 32 and 64 bit Windows and building Maxima on top of that ought to be interesting. We plan to not use the in tree gmp and boehm_gc, but the latest upstream there and also build ecl with the good options, i.e. --small-scons and a couple other flags I do not recall at the moment to get the best performance out of it and also configure boehm_gc to use the large mem setting since IIRC the default is still a max 1GB heap. Since my 64 bit Windows box has 16GB Ram that seems like a waste and given the fact that RAM is dirty cheap I see little benefit from limiting Maxima in Sage's Windows port to 1GB. Packing Maxima + ECL to an MSI installer should also be something we can provide in the not too distant future. > For the record, aside from ensuring that run_testsuite succeeds, > I am hoping to find out whether the stuff around the edges > (plotting, on-line documentation, anything that causes file i/o, > console interaction, maybe other stuff) works as expected. Hmm, what requirements (X, gnuplot, ....) are needed here? I do have shell access only, but can tunnel into the boxen to test things via X, but if it isn't automated I will likely only be able to do this rarely. > Thanks for your help, I won't be getting to this until at least next Tuesday since I am at Sage Days 12 and have been sleeping about 5 hours a night for the last three nights and way too many tickets to fix until I leave on Monday. You have been to SD 8.5, so you should get an idea what it is like :) Either way, please ping me toward the middle of next week if you don't see any sign of life from me end since I tend to always have to put out fires and things like the above then gets preempted. It goes like the old saying that the squeaky wheel gets greased, so no need to be subtle when things don't happen. Depending on the signal/noise ratio for the rest of the list we can take this private if you so desire. > Robert Dodier Cheers, Michael > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From raymond.toy at ericsson.com Fri Jan 23 12:21:18 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Fri, 23 Jan 2009 13:21:18 -0500 Subject: [Maxima] Runtime determination of share directories? In-Reply-To: References: <497924AE.9030406@gmail.com> Message-ID: <497A0A9E.6050702@ericsson.com> Robert Dodier wrote: > On 1/22/09, Raymond Toy wrote: > > >> Wouldn't it be nicer if we could do this at startup and just find all of >> the directories in share directory? Then we wouldn't have to maintain >> this list at all, and users can easily add share packages themselves and >> have them automatically available. (Well, perhaps we could keep a few >> of the core share packages in the list, but most would be determined at >> runtime). >> > > Yes, that's a good idea. Have at it! > I have a version(s) that works for cmucl, clisp, and ecl. (The code can't be the same because the directory function is not the same.) Some extra directories get included the lapack/fortran and lapack/lisp, but that's probably ok. If not, they're easy enough to prune. > >> I played with this a while back, but never finished it. I think, >> however, that all of the lisps we support can do this using the Lisp >> DIRECTORY function with a bit of extra glue to return the right stuff. >> GCL might be a bit more difficult, but I think it can be done there too. >> > > I believe it is within the realm of possibility that we might stop > working around GCL's idiosyncrasies. > Kind of sad, but that's the way it goes. > I think it would be worth the time to compare Maxima + ECL against > Maxma + GCL on various platforms, considering ECL as a possible > replacement for GCL. If someone wants to do that & report to the > mailing list, that would be terrific. > I have been regularly building with gcl and ecl, and occassionally run the testsuite for all. IIRC, there is only one unusual test result with ecl. I'll post the results later. Ray From michael.abshoff at googlemail.com Fri Jan 23 12:41:49 2009 From: michael.abshoff at googlemail.com (Michael Abshoff) Date: Fri, 23 Jan 2009 10:41:49 -0800 Subject: [Maxima] Runtime determination of share directories? In-Reply-To: <87eiytlwvb.fsf@inbox.ru> References: <497924AE.9030406@gmail.com> <87eiytlwvb.fsf@inbox.ru> Message-ID: <497A0F6D.3020703@gmail.com> Aleksej Saushev wrote: > Robert Dodier writes: > >> I believe it is within the realm of possibility that we might stop >> working around GCL's idiosyncrasies. >> >> I think it would be worth the time to compare Maxima + ECL against >> Maxma + GCL on various platforms, considering ECL as a possible >> replacement for GCL. If someone wants to do that & report to the >> mailing list, that would be terrific. > > ECL seems to work on more platforms and is in active development, > GCL doesn't work on NetBSD at least and looks abandoned. > On this acount I don't even try to revive GCL. > > Well, AFAI understand gcl is the only lisp supported by Maxima that does not support ffi and hence prevents you from using things like MPFR, GSL or native BLAS, so if I had to made a decision as an outsider it would be a no brainer provided ecl worked (which I believe it does). The ecl maintainer has been extremely responsive to issues in ecl exposed by Maxima as well as been more that willing to fix performance bottle necks in case they were pointed out to him. Obviously at least some people have a emotional connection to gcl due to the history between Maxima and gcl. One thing about the bigfloat package in Maxima that concerns me a lot is that for example for many special functions you compute additional digits and then truncate the output to the requested precision to make the test suite pass on various lisps. This is a bad idea since it only takes a little of bad luck to find a case where numerical instability gives you incorrect results. Using MPFR for example would get rid of that clutch and also unburden you from the "boring" task of maintaining that code. Given the stellar performance as well as excellent code quality of MPFR I would assume that this is another nail in the coffin for gcl support for Maxima. In my personal experience I have seen libraries like quaddouble that rely on the IEEE conformance of the double arithmetic of the hardware to behave *extremely* badly, i.e. I can provide an example where the output on an x86 running Solaris is correct for 172 out of 212 bits when computing the number of partitions of 10^5. On the same platform using quaddouble the number of partitions for the first five hundred integers is incorrect in about half the cases, so any time you are using some extended precision library that is not proven to be correct and vigorously I get very nervous. Cheers, Michael From raymond.toy at ericsson.com Fri Jan 23 12:48:57 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Fri, 23 Jan 2009 13:48:57 -0500 Subject: [Maxima] Proposal for location of fasls In-Reply-To: References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> Message-ID: <497A1119.3090508@ericsson.com> Michel Talon wrote: > Speaking about affine, i think that the best place to compile it is > in "binary-gcl" or "binary-cmucl" subdirectory of affine like it was > previously. This way the installation is shared by all users. The only > Dang. I forgot to make it go into binary-. I'll fix that. But currently, it will go into maxima_userdir right now. If you want it to go somewhere else, you have to set maxima_objdir to the place you want. (Or set the environment variable MAXIMA_OBJDIR.) > thing to be done is to mention in the documentation of affine that > it must be compiled as root or administrator once. For me this solution is > ways simpler and more appropriate than putting binaries in some strange > place, ready for collisions. > There shouldn't be any collisions with the default value for maxima_objdir. That also means no sharing, by default, either. Ray From macrakis at alum.mit.edu Fri Jan 23 13:05:08 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 23 Jan 2009 14:05:08 -0500 Subject: [Maxima] Runtime determination of share directories? In-Reply-To: <497A0F6D.3020703@gmail.com> References: <497924AE.9030406@gmail.com> <87eiytlwvb.fsf@inbox.ru> <497A0F6D.3020703@gmail.com> Message-ID: <8b356f880901231105g7c94d060rfbc1f65d6781a457@mail.gmail.com> On Fri, Jan 23, 2009 at 1:41 PM, Michael Abshoff wrote: > Aleksej Saushev wrote: > Well, AFAI understand gcl is the only lisp supported by Maxima that does > not support ffi ... so if I had to made a decision as an outsider it would > be a no brainer... I agree entirely about the great value of FFI. > ... provided ecl worked (which I believe it does). The one big issue I'm aware of is that ECL coredumps on stack overflow in compiled code rather than giving a clean exception. This is a serious problem, since infinite recursions are not an uncommon kind of error in code. > The ecl maintainer has been extremely responsive to issues in ecl exposed by > Maxima as well as been more that willing to fix performance bottle necks in > case they were pointed out to him. He may be responsive, but in this case, his response was "won't fix". In an email exchange last year, he said that he didn't plan to fix the coredump problem because it would require platform-dependent code. > Obviously at least some people have a emotional connection to gcl due to the history between Maxima and gcl. I have no emotional connection to GCL. (If anything, I have an emotional connection to MacLisp! :-) ) I simply want an underlying Lisp which works on Windows and doesn't coredump. -s From fateman at cs.berkeley.edu Fri Jan 23 13:21:04 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Fri, 23 Jan 2009 11:21:04 -0800 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: <497A0F6D.3020703@gmail.com> References: <497924AE.9030406@gmail.com> <87eiytlwvb.fsf@inbox.ru> <497A0F6D.3020703@gmail.com> Message-ID: <497A18A0.6040806@cs.berkeley.edu> Michael Abshoff wrote: > ....snip... > > One thing about the bigfloat package in Maxima that concerns me a lot is > that for example for many special functions you compute additional > digits and then truncate the output to the requested precision to make > the test suite pass on various lisps. This is a bad idea since it only > takes a little of bad luck to find a case where numerical instability > gives you incorrect results. I'm not a big fan of GCL myself. I use it only for Maxima. I write code using another lisp and move it to Maxima when I think it is mostly debugged. I find it hard to use the underlying lisp support of GCL. Similarly for CMUCL/SBCL and CLISP But these may be reactions from an old fogey and to older versions (pre-SLIME, for example). And maybe ECL is now better than when I tried it. I believe that Maxima can run in another (free, but not open source) lisp, namely Allegro's Express, which is what I use. But your comments on bigfloats surprise me, since I wrote (the original...) version of it. Different results??? Do you have such an example? I find it unlikely that such would be the case since the bigfloat package uses integer arithmetic, and each implementation should get the same answers to every bit. Any numerical instability would occur in every system. If there are two lisp systems that get different integer results, then (at least ) one of them is just wrong. In the bigfloat package there may be the occasional floating point arithmetic to get approximations for the rough magnitude of the number of extra bits needed, but not the actual value of the bits. > Using MPFR for example would get rid of > that clutch and also unburden you from the "boring" task of maintaining > that code. Given the stellar performance as well as excellent code > quality of MPFR I would assume that this is another nail in the coffin > for gcl support for Maxima. I use MPFR myself, but that relies on lots of other stuff, including C compilers, diagnosis of what computer is being targeted, assemblers, ... .. If you use the C-only [no assembler] code, it is maybe 10X slower. Bigfloat may be slower, but it relies only on arbitrary precision integer arithmetic, part of every common lisp system. > In my personal experience I have seen > libraries like quaddouble that rely on the IEEE conformance of the > double arithmetic of the hardware to behave *extremely* badly, i.e. I > can provide an example where the output on an x86 running Solaris is > correct for 172 out of 212 bits when computing the number of partitions > of 10^5. Do you mean that the quad double library gets different answers on X86 on Solaris versus X86 on Windows? If your example is simply of a bad algorithm (for example, one that needs more bits of precision), then what is the point? I would encourage the use of quaddouble. In fact it can be used for integer arithmetic, probably faster than anything else, for a certain range of integers. > On the same platform using quaddouble the number of partitions > for the first five hundred integers is incorrect in about half the > cases, so any time you are using some extended precision library that is > not proven to be correct and vigorously I get very nervous. > Maybe the algorithm requires more precision? RJF From raymond.toy at ericsson.com Fri Jan 23 13:23:46 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Fri, 23 Jan 2009 14:23:46 -0500 Subject: [Maxima] Runtime determination of share directories? In-Reply-To: References: <497924AE.9030406@gmail.com> Message-ID: <497A1942.10303@ericsson.com> Robert Dodier wrote: > I think it would be worth the time to compare Maxima + ECL against > Maxma + GCL on various platforms, considering ECL as a possible > replacement for GCL. If someone wants to do that & report to the > mailing list, that would be terrific. > FWIW, I ran the testsuite on a Solaris box just now. This is the CVS sources from yesterday or so. Clisp, gcl, and ecl all pass the test suite. Cmucl has the following fails tests 396, 397, and 399 in rtest_gamma. It looks like the threshold is a little too tight for cmucl. Ray From bastian at pranzas.com Fri Jan 23 11:25:40 2009 From: bastian at pranzas.com (Bastian Pranzas) Date: Fri, 23 Jan 2009 18:25:40 +0100 Subject: [Maxima] optimize() function In-Reply-To: References: <87515d920901230307h252aa878x4d3e330c65486cc2@mail.gmail.com> Message-ID: <87515d920901230925y45235b32i818c460e4929a1a9@mail.gmail.com> 2009/1/23 Harald Geyer : > Well, if you just need to minimize the total number of operations, > then I think factor() is all you need. If you want to introduce some > metric (ie. + has cost 1, * has cost 2, power has cost 5) then this > can be done too but it is some work... It would be enough to just minimize the count of the operations. But factor() only does this for factors of the whole expression, so it doesn't do what I need in something like a*b*c+b*c*d+a I consider writing a python script for this task. From asau at inbox.ru Fri Jan 23 14:34:41 2009 From: asau at inbox.ru (Aleksej Saushev) Date: Fri, 23 Jan 2009 23:34:41 +0300 Subject: [Maxima] Runtime determination of share directories? References: <497924AE.9030406@gmail.com> <497A0A9E.6050702@ericsson.com> Message-ID: <87zlhhkbha.fsf@inbox.ru> Raymond Toy writes: > Robert Dodier wrote: >> I believe it is within the realm of possibility that we might stop >> working around GCL's idiosyncrasies. >> > Kind of sad, but that's the way it goes. >> I think it would be worth the time to compare Maxima + ECL against >> Maxma + GCL on various platforms, considering ECL as a possible >> replacement for GCL. If someone wants to do that & report to the >> mailing list, that would be terrific. >> > I have been regularly building with gcl and ecl, and occassionally run > the testsuite for all. IIRC, there is only one unusual test result with > ecl. > > I'll post the results later. If that matters, I can provide regular build results (tests included) for CLISP and ECL (I do it in personal anyway, quasi-regularly though), the only thing to decide is the way to communicate to others. I can find a person to do that regularly, e.g. weekly (not that it is guaranteed, but there exists such possibility to find this person except me). -- HE CE3OH... From michael.abshoff at googlemail.com Fri Jan 23 14:50:14 2009 From: michael.abshoff at googlemail.com (Michael Abshoff) Date: Fri, 23 Jan 2009 12:50:14 -0800 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: <497A18A0.6040806@cs.berkeley.edu> References: <497924AE.9030406@gmail.com> <87eiytlwvb.fsf@inbox.ru> <497A0F6D.3020703@gmail.com> <497A18A0.6040806@cs.berkeley.edu> Message-ID: <497A2D86.3010303@gmail.com> Richard Fateman wrote: > Michael Abshoff wrote: >> ....snip... Hello rjf, >> One thing about the bigfloat package in Maxima that concerns me a lot >> is that for example for many special functions you compute additional >> digits and then truncate the output to the requested precision to make >> the test suite pass on various lisps. This is a bad idea since it only >> takes a little of bad luck to find a case where numerical instability >> gives you incorrect results. > I'm not a big fan of GCL myself. I use it only for Maxima. I write code > using another lisp and move it to > Maxima when I think it is mostly debugged. I find it hard to use the > underlying lisp support of GCL. > Similarly for CMUCL/SBCL and CLISP > But these may be reactions from an old fogey and to older versions > (pre-SLIME, for example). And maybe > ECL is now better than when I tried it. I believe that Maxima can run > in another (free, but not open source) lisp, > namely Allegro's Express, which is what I use. > > But your comments on bigfloats surprise me, since I wrote (the > original...) version of it. Mhhh, maybe I did not name the right package? I am referring to the recent work of Dieter Kaiser implementing more special functions and I do recall him increasing the number of bits used internally for some computations to ensure identical results on various lisps. > Different results??? > > Do you have such an example? I find it unlikely that such would be the > case since the bigfloat package uses integer arithmetic, > and each implementation should get the same answers to every bit. Any > numerical instability would occur in every system. As mentioned above I would need to dig into my email archive. But if bigfloat sits on top of integer arithmetic any potential deviation would be a great cause of concern and this is unlikely to be the case. > If there are two lisp systems that get different integer results, then > (at least ) one of them is just wrong. Yes :) > In the bigfloat package there may be the occasional floating point > arithmetic to get approximations for the rough magnitude of the number > of extra bits needed, but not the actual value of the bits. > > >> Using MPFR for example would get rid of that clutch and also unburden >> you from the "boring" task of maintaining that code. Given the stellar >> performance as well as excellent code quality of MPFR I would assume >> that this is another nail in the coffin for gcl support for Maxima. > > I use MPFR myself, but that relies on lots of other stuff, including C > compilers, diagnosis of what computer is being > targeted, assemblers, ... .. If you use the C-only [no assembler] code, > it is maybe 10X slower. MPFR itself is pure C, but MPFR relies on GMP for the underlying arithmetic which is partially written in assembler. But I don't see how requiring MPFR and GMP present on the system would be an issue since building a lisp from sources is often harder. Making it optional and falling back to a pure lisp implementation would obviously be a good idea for small devices like PDAs since I guess you want to make Maxima as sleek as possible on those devices. > Bigfloat may be slower, but it relies only on arbitrary precision > integer arithmetic, part of every common lisp system. > >> In my personal experience I have seen libraries like quaddouble that >> rely on the IEEE conformance of the double arithmetic of the hardware >> to behave *extremely* badly, i.e. I can provide an example where the >> output on an x86 running Solaris is correct for 172 out of 212 bits >> when computing the number of partitions of 10^5. > Do you mean that the quad double library gets different answers on X86 > on Solaris versus X86 on Windows? > If your example is simply of a bad algorithm (for example, one that > needs more bits of precision), then what is > the point? I would encourage the use of quaddouble. In fact it can be > used for integer arithmetic, probably faster than anything else, for a > certain range of integers. Well, take the latest official release, build it on Solaris running on a x86 cpu and run make check. It failed its test suite on every x86 based Solaris box I tried and that is a bad, bad thing. If you use quaddouble to do numerical work this is less of a issue IMHO, but I see little benefit from getting potentially wrong results anywhere from 10 to 50% more quickly than MPFR if you want identical results on any platform which MPFR does deliver. And by the way: quaddouble is released under the BSD license by researchers working for LBNL and U.C. Berkeley, but according to "http://crd.lbl.gov/~dhbailey/mpdist/" one can read that "Incorporating this software in any commercial product requires a license agreement" Maybe someone ought to clue these people in what it means to release software under the BSD license. And I am sure someone should point them to the wikipedia page about BSD to make 100% sure that they will appreciate the irony. > >> On the same platform using quaddouble the number of partitions for the >> first five hundred integers is incorrect in about half the cases, so >> any time you are using some extended precision library that is not >> proven to be correct and vigorously I get very nervous. >> > Maybe the algorithm requires more precision? No, the problem with quaddouble is that it requires at least on x86 to precisely set the FPU control word, i.e. rounding mode and so on. On PowerPC or Sparc this is not possible to my recollection, but in our experience arithmetic operations there also deliver less than the 212 bits promised. I have even seen cases where a single multiplication of two numbers (and we did not attempt to hit a corner case) produced results that were different in the last three of four bits. If the documentation tells me that I get 212 bits of precision then it should not matter which IEEE conformant CPU I am running the code on (modulo compiler bugs), but quaddouble does for the purpose the Sage project uses it not live up to the standard of reproducibility. That does not mean it is not useful for other projects, but at least Sage is not in the business of delivering potentially worng results 50% faster. AFAIK the issue is known to quaddouble developers and Carl Witty and I discussed the possibility of attempting to fix it by working around potential miscompilations last night, but this is a waste of time since even if we get it to work for some examples it will still not even come close to the assurance that MPFR gives me. And correctness should always come before speed in any software project. > RJF > > Cheers, Michael From willisb at unk.edu Fri Jan 23 14:56:53 2009 From: willisb at unk.edu (Barton Willis) Date: Fri, 23 Jan 2009 14:56:53 -0600 Subject: [Maxima] optimize() function In-Reply-To: <87515d920901230925y45235b32i818c460e4929a1a9@mail.gmail.com> References: <87515d920901230307h252aa878x4d3e330c65486cc2@mail.gmail.com> <87515d920901230925y45235b32i818c460e4929a1a9@mail.gmail.com> Message-ID: > > Well, if you just need to minimize the total number of operations, > > then I think factor() is all you need. If you want to introduce some > > metric (ie. + has cost 1, * has cost 2, power has cost 5) then this > > can be done too but it is some work... > > It would be enough to just minimize the count of the operations. But > factor() only does this for factors of the whole expression, so it > doesn't do what I need in something like a*b*c+b*c*d+a Maybe facsum will be useful: (%i4) i : a*b*c+b*c*d+a$ (%i8) facsum(i,b); (%o8) b*c*(d+a)+a Of course, all this could be automated, but maybe this will work for you. Barton From raymond.toy at ericsson.com Fri Jan 23 15:17:50 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Fri, 23 Jan 2009 16:17:50 -0500 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: <497A2D86.3010303@gmail.com> References: <497924AE.9030406@gmail.com> <87eiytlwvb.fsf@inbox.ru> <497A0F6D.3020703@gmail.com> <497A18A0.6040806@cs.berkeley.edu> <497A2D86.3010303@gmail.com> Message-ID: <497A33FE.6060000@ericsson.com> Michael Abshoff wrote: > Mhhh, maybe I did not name the right package? I am referring to the > recent work of Dieter Kaiser implementing more special functions and I > do recall him increasing the number of bits used internally for some > computations to ensure identical results on various lisps. > There was some discussion about the gamma function, but I think increasing the number of bits wasn't actually done. As far as I know, the bigfloat implementations of the special functions are truly identical. > MPFR itself is pure C, but MPFR relies on GMP for the underlying > arithmetic which is partially written in assembler. But I don't see how > requiring MPFR and GMP present on the system would be an issue since > building a lisp from sources is often harder. Making it optional and > I didn't find it that easy to build MPFR and/or GMP. But Maxima can't run without a lisp, but it does run well (quite well, IMNSHO) without MPFR/GMP. :-) > No, the problem with quaddouble is that it requires at least on x86 to > precisely set the FPU control word, i.e. rounding mode and so on. On This assumes you're using x87. There should be no problem if you're using SSE2. > > > bits promised. I have even seen cases where a single multiplication of > two numbers (and we did not attempt to hit a corner case) produced > results that were different in the last three of four bits. > Do you have such an example? I'd really like to see it, since I implemented a quaddouble package in Lisp sometime ago. Richard is well aware of some of the problems we had on getting Allegro to produce the correct results. (Not really allegro's fault, but it was over aggressive speed 3, safety 0 optimization causing the compiler to lose track (intentionally) of the precision of the numbers.) > If the documentation tells me that I get 212 bits of precision then it > should not matter which IEEE conformant CPU I am running the code on > (modulo compiler bugs), but quaddouble does for the purpose the Sage > project uses it not live up to the standard of reproducibility. That > does not mean it is not useful for other projects, but at least Sage is > not in the business of delivering potentially worng results 50% faster. > AFAIK the issue is known to quaddouble developers and Carl Witty and I > discussed the possibility of attempting to fix it by working around > potential miscompilations last night, but this is a waste of time since > even if we get it to work for some examples it will still not even come I'm not sure, but I think there will always be corner cases where you will get incorrect results on an x87. It's unavoidable due to the 80-bit registers. Even if you set the rounding and precision modes correctly. I think the cases are when a number would underflow to 0 if you had 64-bit doubles but doesn't when you have 80-bit long floats. Ray From al at beshenov.ru Fri Jan 23 15:18:33 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Sat, 24 Jan 2009 00:18:33 +0300 Subject: [Maxima] to japanese version In-Reply-To: <20090123075542.90235.qmail@web3908.mail.bbt.yahoo.co.jp> References: <20090123075542.90235.qmail@web3908.mail.bbt.yahoo.co.jp> Message-ID: <200901240018.35220.al@beshenov.ru> On Friday 23 January 2009 10:55 nobuyuki wrote: > i wanna translate english toolbar menus of maxima into > japanese and japanese can use it easily. > i should have wrote it clearly excuse me Nice to hear! You should rely on the file locales/wxMaxima.pot. The latest wxMaxima source package is available from https://sourceforge.net/project/showfiles.php?group_id=126731 -- Pungenday, Chaos 23 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From andrej.vodopivec at gmail.com Fri Jan 23 15:34:41 2009 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Fri, 23 Jan 2009 22:34:41 +0100 Subject: [Maxima] to japanese version In-Reply-To: <200901240018.35220.al@beshenov.ru> References: <20090123075542.90235.qmail@web3908.mail.bbt.yahoo.co.jp> <200901240018.35220.al@beshenov.ru> Message-ID: <7775b21a0901231334m3f7bd8f8jf4cfaeed0555cf41@mail.gmail.com> The translation to Japanese already exists, but it is not included with wxMaxima. The link to the translation was posted in the wxMaxima forum: http://sourceforge.net/forum/forum.php?thread_id=2301260&forum_id=435775 Andrej On Fri, Jan 23, 2009 at 10:18 PM, Alexey Beshenov wrote: > On Friday 23 January 2009 10:55 nobuyuki wrote: > >> i wanna translate english toolbar menus of maxima into >> japanese and japanese can use it easily. >> i should have wrote it clearly excuse me > > Nice to hear! > > You should rely on the file locales/wxMaxima.pot. > The latest wxMaxima source package is available from > https://sourceforge.net/project/showfiles.php?group_id=126731 > > -- > Pungenday, Chaos 23 YOLD 3175 > Alexey Beshenov http://beshenov.ru/ > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From drdieterkaiser at web.de Fri Jan 23 15:43:04 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 23 Jan 2009 22:43:04 +0100 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: <497A33FE.6060000@ericsson.com> References: <497924AE.9030406@gmail.com> <87eiytlwvb.fsf@inbox.ru> <497A0F6D.3020703@gmail.com> <497A18A0.6040806@cs.berkeley.edu> <497A2D86.3010303@gmail.com> <497A33FE.6060000@ericsson.com> Message-ID: <1232746984.5484.7.camel@dieter-laptop> Am Freitag, den 23.01.2009, 16:17 -0500 schrieb Raymond Toy: > Michael Abshoff wrote: > > Mhhh, maybe I did not name the right package? I am referring to the > > recent work of Dieter Kaiser implementing more special functions and I > > do recall him increasing the number of bits used internally for some > > computations to ensure identical results on various lisps. > > > There was some discussion about the gamma function, but I think > increasing the number of bits wasn't actually done. > As far as I know, the bigfloat implementations of the special functions > are truly identical. We have added four digits to fpprec for the calculation of the Gamma function in bigfloat and complex bigfloat precision. We have done that to increase the precsion of the algorithm itself. There were no problems with different Lisps. Yes, the numerical algorithm for the implemented special functions in float or bigfloat precison are identical. Dieter Kaiser From fateman at cs.berkeley.edu Fri Jan 23 15:44:50 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Fri, 23 Jan 2009 13:44:50 -0800 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: <497A2D86.3010303@gmail.com> References: <497924AE.9030406@gmail.com> <87eiytlwvb.fsf@inbox.ru> <497A0F6D.3020703@gmail.com> <497A18A0.6040806@cs.berkeley.edu> <497A2D86.3010303@gmail.com> Message-ID: <497A3A52.4080104@cs.berkeley.edu> Michael Abshoff wrote:... ... > Mhhh, maybe I did not name the right package? I am referring to the > recent work of Dieter Kaiser implementing more special functions and I > do recall him increasing the number of bits used internally for some > computations to ensure identical results on various lisps. > I noticed some mail about (double precision?) logarithm / gamma . Common Lisp allows for different floats, up to 4 in the standard, I think. And possibly more, short, single, long, double. It is certainly possible to support double-extended, double-double (which is, I think, in CMU-CL), and others. > ...... > MPFR itself is pure C, but MPFR relies on GMP for the underlying > arithmetic which is partially written in assembler. But I don't see > how requiring MPFR and GMP present on the system would be an issue > since building a lisp from sources is often harder. Just because Sage requires the building of whatever from sources is pretty much irrelevant to Maxima. The vast vast majority of Maxima users just download and install a working executable (+ support files) suitable for their machine. If MPFR were to be made part of Maxima (which might be nice) it would involve some technical tricks. For example, to get the best out of MPFR and GMP, it would be necessary, in the install process, to distinguish among many x86 implementations to choose the optimal binary. I don't know the details of the current system, but the best code I have for a Pentium 4 does not run on an earlier Pentium. The code for the earlier Pentium runs on the Pentium 4, but is slower. A pure-C implementation of GMP is considerably slower on the Pentium 4. So a Maxima using MPFR+GMP could use the pure-C version and be 10X slower, or at some stage figure what CPU is running. Testing such a system build for all x86 implementations would be a hassle. I, of course, only care about the computer I'm usually using. > Making it optional and falling back to a pure lisp implementation > would obviously be a good idea for small devices like PDAs since I > guess you want to make Maxima as sleek as possible on those devices. If I want to make my life more difficult, I can try riding a unicycle or maybe constructing ships in bottles. Doing mathematics by typing with my thumbs and seeing the answers on a 2x2inch screen is not so interesting to me. But what do I know, I don't own an IPod. > > Well, take the latest official release, build it on Solaris running on > a x86 cpu and run make check. It failed its test suite on every x86 > based Solaris box I tried and that is a bad, bad thing. If you haven't reported it, maybe they don't know. I don't know of anyone (else?) using Solaris on x86, and maybe they don't either. > If you use quaddouble to do numerical work this is less of a issue IMHO, Huh? You are using quaddouble but not numerical? Or do you mean you are using quaddouble for integers only? > but I see little benefit from getting potentially wrong results > anywhere from 10 to 50% more quickly than MPFR if you want identical > results on any platform which MPFR does deliver. Well, consider those people who are hacking away in dungeons trying to get 2 processors to work together to get a program to work 50% faster. You are saying you could do the job, but with one processor. But debugging the program is not worth it. Imagine those dungeon-hackers... if they could get 1.5X for one processor, and another 50% from the second, they would have (1.5)^2 or 2.25X speedup. > And by the way: quaddouble is released under the BSD license by > researchers working for LBNL and U.C. Berkeley, but according to > > "http://crd.lbl.gov/~dhbailey/mpdist/" > > one can read that > > > "Incorporating this software in any commercial product requires a > license agreement" > > > Maybe someone ought to clue these people in what it means to release > software under the BSD license. And I am sure someone should point > them to the wikipedia page about BSD to make 100% sure that they will > appreciate the irony. I have forwarded your note to one of the people :) > >> >>> On the same platform using quaddouble the number of partitions for >>> the first five hundred integers is incorrect in about half the >>> cases, so any time you are using some extended precision library >>> that is not proven to be correct and vigorously I get very nervous. >>> >> Maybe the algorithm requires more precision? > > No, the problem with quaddouble is that it requires at least on x86 to > precisely set the FPU control word, i.e. rounding mode and so on. On > PowerPC or Sparc this is not possible to my recollection, but in our > experience arithmetic operations there also deliver less than the 212 > bits promised. I have even seen cases where a single multiplication of > two numbers (and we did not attempt to hit a corner case) produced > results that were different in the last three of four bits. In my own use of quaddouble from Lisp on x86, I have to be careful that the fpu control word isn't messed up by other processes which may also be taking time from the same Lisp, and this might be the same kind of situation for Sparc. x86 can do more arithmetic (fused multiply-add) in registers with more precision than Sparc2. I don't know about later Sparc or PowerPC. In any case, quad-double does not, as I recall, guarantee the last few bits in the fraction, and thus if you are relying on them either to be correct or consistent across different architectures, then you should not be using this software. I changed the code to set the rounding modes, e.g. void c_qd_add(const double *a, const double *b, double *c) { fpu_fix_start(NULL); //// ADDED qd_real cc; cc = qd_real(a) + qd_real(b); TO_DOUBLE_PTR(cc, c); } I frankly don't know if this guards the fpu control word adequately for all possible operating systems and architectures. > > If the documentation tells me that I get 212 bits of precision then it > should not matter which IEEE conformant CPU I am running the code on > (modulo compiler bugs), but quaddouble does for the purpose the Sage > project uses it not live up to the standard of reproducibility. Reproducibility down to the last few bits is, according to some people, not worth slowing down. Maxima's bigfloats are way slower than they could be except that all basic arithmetic is done with round-to-nearest-even. It could probably be made 2 or 4 times faster. Elementary functions like exp and cos are probably good to 1 unit in last place, but I never proved that. Since you can always up the precision by a bunch of bits, the advantages of correctly rounded can probably be obtained by less work. > That does not mean it is not useful for other projects, but at least > Sage is not in the business of delivering potentially worng results > 50% faster. Well, wrong is in the eye of the beholder. Have you heard the phrase "close enough for government work"? > AFAIK the issue is known to quaddouble developers and Carl Witty and I > discussed the possibility of attempting to fix it by working around > potential miscompilations last night, but this is a waste of time > since even if we get it to work for some examples it will still not > even come close to the assurance that MPFR gives me. And correctness > should always come before speed in any software project. certainly it was known in 2007 when I wrote the generic lisp interface to qd. RJF From michael.abshoff at googlemail.com Fri Jan 23 16:13:00 2009 From: michael.abshoff at googlemail.com (Michael Abshoff) Date: Fri, 23 Jan 2009 14:13:00 -0800 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: <1232746984.5484.7.camel@dieter-laptop> References: <497924AE.9030406@gmail.com> <87eiytlwvb.fsf@inbox.ru> <497A0F6D.3020703@gmail.com> <497A18A0.6040806@cs.berkeley.edu> <497A2D86.3010303@gmail.com> <497A33FE.6060000@ericsson.com> <1232746984.5484.7.camel@dieter-laptop> Message-ID: <497A40EC.5090207@gmail.com> Dieter Kaiser wrote: > Am Freitag, den 23.01.2009, 16:17 -0500 schrieb Raymond Toy: >> Michael Abshoff wrote: >>> Mhhh, maybe I did not name the right package? I am referring to the >>> recent work of Dieter Kaiser implementing more special functions and I >>> do recall him increasing the number of bits used internally for some >>> computations to ensure identical results on various lisps. >>> Hi Dieter, >> There was some discussion about the gamma function, but I think >> increasing the number of bits wasn't actually done. >> As far as I know, the bigfloat implementations of the special functions >> are truly identical. > We have added four digits to fpprec for the calculation of the Gamma > function in bigfloat and complex bigfloat precision. We have done that > to increase the precsion of the algorithm itself. There were no problems > with different Lisps. > > Yes, the numerical algorithm for the implemented special functions in > float or bigfloat precison are identical. Thanks for clearing that up. > Dieter Kaiser Cheers, Michael > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From drdieterkaiser at web.de Fri Jan 23 16:17:53 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 23 Jan 2009 23:17:53 +0100 Subject: [Maxima] Package bigfloat Message-ID: <1232749073.5484.41.camel@dieter-laptop> I am working with the new package BIGFLOAT to implement the function beta_incomplete(a,b,z). The first steps work fine. The numerical algorithm is working for some cases. But I have some problems with the generalization to all types of numbers. I have two problems why I could not finish the work, but which are perhaps easy to solve: 1. I need the function bigfloat:expt. I have seen the declaration in the package, but the function seems not to work: (%i7) :lisp (bigfloat:expt 2.0 2.0) Maxima encountered a Lisp error: READ from #: # has no external symbol with name "EXPT" Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. A workaround is to use the Maxima function power. In this case we get the second problem too. 2. In the numerical code I have to call other Maxima functions. The following is a piece of code as an example (to be short I have called the verb form of the Gamma function, that is nearly equivalent to a direct call to the simplifier): (bigfloat:- (bigfloat:/ (bigfloat:* (bigfloat:to ($gamma (to a))) (bigfloat:to ($gamma (to b)))) (bigfloat:to ($gamma (to (bigfloat:+ a b))))) (beta-incomplete b a (bigfloat:- 1.0 z)))) To call $gamma we have to convert the type NUMERIC to a Maxima number. This is done with the function TO (or MAXIMA:TO). The result of the $gamma function is a Maxima number which has to be converted back to the type NUMERIC. This is done here with the function bigfloat:to. But this function always converts to a type bigfloat, what I need is a function which does not convert the types integer, float, ... to a bigfloat, but returns the CL number e.g. Maxima integer -> CL integer Maxima float -> CL float Maxima complex -> CL complex Maxima bfloat -> NUMERIC bigfloat Maxima complex bfloat -> NUMERIC complex-bigfloat Is this functionality build in? Do I have overseen something? Dieter Kaiser From michael.abshoff at googlemail.com Fri Jan 23 16:19:30 2009 From: michael.abshoff at googlemail.com (Michael Abshoff) Date: Fri, 23 Jan 2009 14:19:30 -0800 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: <497A33FE.6060000@ericsson.com> References: <497924AE.9030406@gmail.com> <87eiytlwvb.fsf@inbox.ru> <497A0F6D.3020703@gmail.com> <497A18A0.6040806@cs.berkeley.edu> <497A2D86.3010303@gmail.com> <497A33FE.6060000@ericsson.com> Message-ID: <497A4272.4080005@gmail.com> Raymond Toy wrote: > Michael Abshoff wrote: Hi, >> Mhhh, maybe I did not name the right package? I am referring to the >> recent work of Dieter Kaiser implementing more special functions and I >> do recall him increasing the number of bits used internally for some >> computations to ensure identical results on various lisps. >> > There was some discussion about the gamma function, but I think > increasing the number of bits wasn't actually done. > As far as I know, the bigfloat implementations of the special functions > are truly identical. > >> MPFR itself is pure C, but MPFR relies on GMP for the underlying >> arithmetic which is partially written in assembler. But I don't see how >> requiring MPFR and GMP present on the system would be an issue since >> building a lisp from sources is often harder. Making it optional and >> > I didn't find it that easy to build MPFR and/or GMP. Ok, I personally have zero problems with GMP and MPFR while getting various lisps to compile did cost me considerable more effort. And gcc 4.2.x recommends GMP and MPFR while 4.3.x and later require it for constant folding. So any system providing recent gcc should have them available. Ecl has its own GMP copy in tree and so do other lisp implementations. > But Maxima can't run without a lisp, but it does run well (quite well, > IMNSHO) without MPFR/GMP. :-) Absolutely, but given the periodically reappearing discussion about easier use of external libraries written in C/C++/Fortran something worthwhile to think about IMHO would be MPFR. Since I am not doing any of the work this is merely a suggestion. >> No, the problem with quaddouble is that it requires at least on x86 to >> precisely set the FPU control word, i.e. rounding mode and so on. On > This assumes you're using x87. There should be no problem if you're > using SSE2. Quaddouble uses SSE2 if it is available on on the box in question we certainly had that, i.e. it was a recent QuadCore2 >> >> >> bits promised. I have even seen cases where a single multiplication of >> two numbers (and we did not attempt to hit a corner case) produced >> results that were different in the last three of four bits. >> > Do you have such an example? I'd really like to see it, since I I need to dig it out of the Sage bug tracker and that will take some time. > implemented a quaddouble package in Lisp sometime ago. Richard is well > aware of some of the problems we had on getting Allegro to produce the > correct results. (Not really allegro's fault, but it was over > aggressive speed 3, safety 0 optimization causing the compiler to lose > track (intentionally) of the precision of the numbers.) >> If the documentation tells me that I get 212 bits of precision then it >> should not matter which IEEE conformant CPU I am running the code on >> (modulo compiler bugs), but quaddouble does for the purpose the Sage >> project uses it not live up to the standard of reproducibility. That >> does not mean it is not useful for other projects, but at least Sage is >> not in the business of delivering potentially worng results 50% faster. >> AFAIK the issue is known to quaddouble developers and Carl Witty and I >> discussed the possibility of attempting to fix it by working around >> potential miscompilations last night, but this is a waste of time since >> even if we get it to work for some examples it will still not even come > I'm not sure, but I think there will always be corner cases where you > will get incorrect results on an x87. It's unavoidable due to the > 80-bit registers. Even if you set the rounding and precision modes > correctly. I think the cases are when a number would underflow to 0 if > you had 64-bit doubles but doesn't when you have 80-bit long floats. AFAIK the advantage if qd is that it sets rounding mode to 53 bits and hence does not rely on 80 bit representation. There is a well known paper that shows that compilers optimizing expression trees will cause precision loss. But qd at least to my understanding should not be affected by this issue. > Ray > > Cheers, Michael From michael.abshoff at googlemail.com Fri Jan 23 16:44:22 2009 From: michael.abshoff at googlemail.com (Michael Abshoff) Date: Fri, 23 Jan 2009 14:44:22 -0800 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: <497A3A52.4080104@cs.berkeley.edu> References: <497924AE.9030406@gmail.com> <87eiytlwvb.fsf@inbox.ru> <497A0F6D.3020703@gmail.com> <497A18A0.6040806@cs.berkeley.edu> <497A2D86.3010303@gmail.com> <497A3A52.4080104@cs.berkeley.edu> Message-ID: <497A4846.1000605@gmail.com> Richard Fateman wrote: > Michael Abshoff wrote:... Hi, > ... >> Mhhh, maybe I did not name the right package? I am referring to the >> recent work of Dieter Kaiser implementing more special functions and I >> do recall him increasing the number of bits used internally for some >> computations to ensure identical results on various lisps. >> > I noticed some mail about (double precision?) logarithm / gamma . > Common Lisp allows for different floats, up to 4 in the standard, I > think. And possibly more, short, single, long, double. It is > certainly possible to support double-extended, double-double (which is, > I think, in CMU-CL), and others. >> ...... Ok. > >> MPFR itself is pure C, but MPFR relies on GMP for the underlying >> arithmetic which is partially written in assembler. But I don't see >> how requiring MPFR and GMP present on the system would be an issue >> since building a lisp from sources is often harder. > > Just because Sage requires the building of whatever from sources is > pretty much irrelevant to Maxima. The vast vast majority of Maxima users > just download and install a working executable (+ support files) > suitable for their machine. Yes, I know that. > If MPFR were to be made part of Maxima (which might be nice) it would > involve some technical tricks. For example, to get the best out of MPFR > and GMP, it would be necessary, in the install process, to distinguish > among many x86 implementations to choose the optimal binary. I don't > know the details of the current system, but the best code I have for a > Pentium 4 does not run on an earlier Pentium. > The code for the earlier Pentium runs on the Pentium 4, but is slower. > A pure-C implementation of GMP is considerably slower on the Pentium 4. > So a Maxima using MPFR+GMP could use the pure-C version and be 10X > slower, or at some stage figure what CPU is running. Could you tell me which examples were 10 times slower in pure C than assembly? You don't have to target C code, i.e. I doubt too many people are running Maxima on pre-Pentium CPUs. Given the sleak size of Maxima this is certainly be possible. > Testing such a system build for all x86 implementations would be a > hassle. I, of course, only care about the computer I'm usually > using. GMP is probably one of the most extensively tested scientific libraries out there. If you want a 32 bit build optimized for any CPU used --enable-fat and at runtime the optimum implementation will be picked by adjusting a function pointer table. This does not work in GMP itself on anything but Linux, but MPIR which is a fork of GMP has fixed that also for 64 bit systems as well as MinGW. >> Making it optional and falling back to a pure lisp implementation >> would obviously be a good idea for small devices like PDAs since I >> guess you want to make Maxima as sleek as possible on those devices. > If I want to make my life more difficult, I can try riding a unicycle or > maybe constructing ships in bottles. Doing mathematics by typing with > my thumbs and seeing the answers on a 2x2inch screen is not so > interesting to me. But what do I know, I don't own an IPod. I do not see how this is relevant. There clearly seems to be demand for hooking up external libraries into Maxima. I am pretty sure that if I benchmark a some Lapack routines using ATLAS against the f2cl translated Lapack in Maxima you would see a large performance difference. And I can trivially build ATLAS to use 4 cores at the same time and BLAS level 3 will scale linear in the number of cores. Given an appropriately large enough matrix we have seen linea scaling of BLAS level 3 matrix matrix multiply with up to 32 cores. We have also been running BLAS on GPUs and the speed improvements there are significant for certain problem classes, i.e. recent NVidia as well as ATI GPUs offer over 200GFlops double and in excess of 1.2 TFlops single precision. I have seen people achieve 60% peak of that, so it is nothing to sneeze at. >> >> Well, take the latest official release, build it on Solaris running on >> a x86 cpu and run make check. It failed its test suite on every x86 >> based Solaris box I tried and that is a bad, bad thing. > If you haven't reported it, maybe they don't know. I don't know of > anyone (else?) using Solaris on x86, and maybe they don't either. > >> If you use quaddouble to do numerical work this is less of a issue IMHO, > > Huh? You are using quaddouble but not numerical? Or do you mean you > are using quaddouble for integers only? The number of partitions algorithm in Sage uses doubles, qd or MPFR depending on the input size to get optimum speed and it beats the second fastest implementation in MMA 7 by about a 20% margin. Everything else out there needs orders of magnitude more time to compute the number of partitions of anything non-trivial. >> but I see little benefit from getting potentially wrong results >> anywhere from 10 to 50% more quickly than MPFR if you want identical >> results on any platform which MPFR does deliver. > Well, consider those people who are hacking away in dungeons trying to > get 2 processors to work together to get a program to work 50% faster. > You are saying you could do the job, but with one processor. But > debugging the program is not worth it. > Imagine those dungeon-hackers... if they could get 1.5X for one > processor, and another 50% from the second, they would have > (1.5)^2 or 2.25X speedup. Ok, I do not understand how the above is relevant to my point. qd's result on Solaris x86 and even PPC OSX cannot be trusted by a significant number of digits. MPFR is about 30% slower for precisions around 200 bits and I am happy to trade 30% speed in arithmetic for the trade off of correctness. Maybe qd can be fixed on Solaris 10, but then what about the other BSDs? MPFR passes its extensive test suite on numerous platforms assuming GMP does and they will quickly fix any issue you report. I could not even find a mailing list for qd which seems to indicate to me that its user community is significantly smaller than MPFRs. >> And by the way: quaddouble is released under the BSD license by >> researchers working for LBNL and U.C. Berkeley, but according to >> >> "http://crd.lbl.gov/~dhbailey/mpdist/" >> >> one can read that >> >> >> "Incorporating this software in any commercial product requires a >> license agreement" >> >> >> Maybe someone ought to clue these people in what it means to release >> software under the BSD license. And I am sure someone should point >> them to the wikipedia page about BSD to make 100% sure that they will >> appreciate the irony. > I have forwarded your note to one of the people :) Thanks. Feel free to send me the response :) >> >>> >>>> On the same platform using quaddouble the number of partitions for >>>> the first five hundred integers is incorrect in about half the >>>> cases, so any time you are using some extended precision library >>>> that is not proven to be correct and vigorously I get very nervous. >>>> >>> Maybe the algorithm requires more precision? >> >> No, the problem with quaddouble is that it requires at least on x86 to >> precisely set the FPU control word, i.e. rounding mode and so on. On >> PowerPC or Sparc this is not possible to my recollection, but in our >> experience arithmetic operations there also deliver less than the 212 >> bits promised. I have even seen cases where a single multiplication of >> two numbers (and we did not attempt to hit a corner case) produced >> results that were different in the last three of four bits. > In my own use of quaddouble from Lisp on x86, I have to be careful that > the fpu control word isn't messed up by other processes which may also > be taking time from the same Lisp, and this might be the same kind of > situation for Sparc. x86 can do more arithmetic (fused multiply-add) in > registers with more precision than Sparc2. I don't know about later > Sparc or PowerPC. In any case, quad-double does not, as I recall, > guarantee the last few bits in the fraction, and thus if you are relying > on them either to be correct or consistent across different > architectures, then you should not be using this software. > > I changed the code to set the rounding modes, e.g. qd automatically sets the rounding mode if you define -DX86 via inline assembly and we do so in Sage. > void c_qd_add(const double *a, const double *b, double *c) { > fpu_fix_start(NULL); //// ADDED > > qd_real cc; > cc = qd_real(a) + qd_real(b); > TO_DOUBLE_PTR(cc, c); > } > > I frankly don't know if this guards the fpu control word adequately for > all possible operating systems and architectures. It is supposed to do so on any x86 CPU I ever had access to. Obviously hardware and software deviates from that ideal. >> >> If the documentation tells me that I get 212 bits of precision then it >> should not matter which IEEE conformant CPU I am running the code on >> (modulo compiler bugs), but quaddouble does for the purpose the Sage >> project uses it not live up to the standard of reproducibility. > Reproducibility down to the last few bits is, according to some people, > not worth slowing down. Maxima's bigfloats are way slower than they > could be except that all basic arithmetic is done with > round-to-nearest-even. It could probably be made 2 or 4 times faster. > Elementary functions like exp and cos are probably good to 1 unit in > last place, but I never proved that. Since you can always up the > precision by a bunch of bits, the advantages of correctly rounded can > probably be obtained by less work. > Sure, but a lot of people will tell you that correctness is more important than speed. Numerical computations have dealt with the problem that operations with doubles and floats are commutative or distributive among other things, but most of the people I work with do pure math reserch. From past conversations on and off list I know that your take on this is different then mine, so I don't think either one of us will convince the other that they are right (if there even is such a thing). > >> That does not mean it is not useful for other projects, but at least >> Sage is not in the business of delivering potentially worng results >> 50% faster. > Well, wrong is in the eye of the beholder. Have you heard the phrase > "close enough for government work"? :) >> AFAIK the issue is known to quaddouble developers and Carl Witty and I >> discussed the possibility of attempting to fix it by working around >> potential miscompilations last night, but this is a waste of time >> since even if we get it to work for some examples it will still not >> even come close to the assurance that MPFR gives me. And correctness >> should always come before speed in any software project. > certainly it was known in 2007 when I wrote the generic lisp interface > to qd. > > RJF > Anyway, it has been fun arguing with you, but this is getting OT and I have things to do, so this will probably be my last email about this to the Maxima list. Cheers, Michael From raymond.toy at ericsson.com Fri Jan 23 17:09:37 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Fri, 23 Jan 2009 18:09:37 -0500 Subject: [Maxima] Package bigfloat In-Reply-To: <1232749073.5484.41.camel@dieter-laptop> References: <1232749073.5484.41.camel@dieter-laptop> Message-ID: <497A4E31.8000703@ericsson.com> Dieter Kaiser wrote: > I am working with the new package BIGFLOAT to implement the function > beta_incomplete(a,b,z). The first steps work fine. The numerical > algorithm is working for some cases. But I have some problems with the > generalization to all types of numbers. > > I have two problems why I could not finish the work, but which are > perhaps easy to solve: > > 1. > > I need the function bigfloat:expt. I have seen the declaration in the > package, but the function seems not to work: > > (%i7) :lisp (bigfloat:expt 2.0 2.0) > > First, I'm glad you're trying it out. I haven't a chance to really use it for anything other than the simplest bits of code, unfortunately. Second, I probably forgot to export the symbol. I'll look into it. > > In the numerical code I have to call other Maxima functions. The > following is a piece of code as an example (to be short I have called > the verb form of the Gamma function, that is nearly equivalent to a > direct call to the simplifier): > > (bigfloat:- > (bigfloat:/ (bigfloat:* (bigfloat:to ($gamma (to a))) > (bigfloat:to ($gamma (to b)))) > (bigfloat:to ($gamma (to (bigfloat:+ a b))))) > (beta-incomplete b a (bigfloat:- 1.0 z)))) > > To call $gamma we have to convert the type NUMERIC to a Maxima number. > This is done with the function TO (or MAXIMA:TO). The result of the > $gamma function is a Maxima number which has to be converted back to the > type NUMERIC. This is done here with the function bigfloat:to. > > But this function always converts to a type bigfloat, what I need is a > function which does not convert the types integer, float, ... to a > bigfloat, but returns the CL number e.g. > > Maxima integer -> CL integer > Maxima float -> CL float > Maxima complex -> CL complex > Maxima bfloat -> NUMERIC bigfloat > Maxima complex bfloat -> NUMERIC complex-bigfloat > > Is this functionality build in? Do I have overseen something? > > I'm a little confused. Are you talking about bigfloat:to or maxima:to? bigfloat:to is supposed to convert everything to a bigfloat type. If this is not what you want, I'll have to think about it. Can you describe (in terms of the algorithm above), exactly what behaviour you want? There are too many TO functions to think about. Perhaps there are two too many? :-) Ray From drdieterkaiser at web.de Fri Jan 23 17:37:00 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 24 Jan 2009 00:37:00 +0100 Subject: [Maxima] Package bigfloat In-Reply-To: <497A4E31.8000703@ericsson.com> References: <1232749073.5484.41.camel@dieter-laptop> <497A4E31.8000703@ericsson.com> Message-ID: <1232753820.5484.66.camel@dieter-laptop> Am Freitag, den 23.01.2009, 18:09 -0500 schrieb Raymond Toy: > Dieter Kaiser wrote: > > I am working with the new package BIGFLOAT to implement the function > > beta_incomplete(a,b,z). The first steps work fine. The numerical > > algorithm is working for some cases. But I have some problems with the > > generalization to all types of numbers. > > > > I have two problems why I could not finish the work, but which are > > perhaps easy to solve: > > > > 1. > > > > I need the function bigfloat:expt. I have seen the declaration in the > > package, but the function seems not to work: > > > > (%i7) :lisp (bigfloat:expt 2.0 2.0) > > > > > First, I'm glad you're trying it out. I haven't a chance to really use > it for anything other than the simplest bits of code, unfortunately. > > Second, I probably forgot to export the symbol. I'll look into it. > > > > In the numerical code I have to call other Maxima functions. The > > following is a piece of code as an example (to be short I have called > > the verb form of the Gamma function, that is nearly equivalent to a > > direct call to the simplifier): > > > > (bigfloat:- > > (bigfloat:/ (bigfloat:* (bigfloat:to ($gamma (to a))) > > (bigfloat:to ($gamma (to b)))) > > (bigfloat:to ($gamma (to (bigfloat:+ a b))))) > > (beta-incomplete b a (bigfloat:- 1.0 z)))) > > > > To call $gamma we have to convert the type NUMERIC to a Maxima number. > > This is done with the function TO (or MAXIMA:TO). The result of the > > $gamma function is a Maxima number which has to be converted back to the > > type NUMERIC. This is done here with the function bigfloat:to. > > > > But this function always converts to a type bigfloat, what I need is a > > function which does not convert the types integer, float, ... to a > > bigfloat, but returns the CL number e.g. > > > > Maxima integer -> CL integer > > Maxima float -> CL float > > Maxima complex -> CL complex > > Maxima bfloat -> NUMERIC bigfloat > > Maxima complex bfloat -> NUMERIC complex-bigfloat > > > > Is this functionality build in? Do I have overseen something? > > > > > I'm a little confused. Are you talking about bigfloat:to or maxima:to? > bigfloat:to is supposed to convert everything to a bigfloat type. If > this is not what you want, I'll have to think about it. Can you > describe (in terms of the algorithm above), exactly what behaviour you > want? There are too many TO functions to think about. Perhaps there > are two too many? :-) > > Ray The problem is that after a call e.g. to the Maxima function $gamma we get a back a Maxima number. To continue the calculation we need the number with a type which is compatible to the calculation within the package bigfloat. This number should not be in general a bigfloat, but a float, CL complex, ... and a bigfloat type only for Maxima bigfloat number. I think such a function has to be added. Dieter Kaiser From toy.raymond at gmail.com Fri Jan 23 18:57:27 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 23 Jan 2009 19:57:27 -0500 Subject: [Maxima] Package bigfloat In-Reply-To: <1232753820.5484.66.camel@dieter-laptop> References: <1232749073.5484.41.camel@dieter-laptop> <497A4E31.8000703@ericsson.com> <1232753820.5484.66.camel@dieter-laptop> Message-ID: <497A6777.90105@gmail.com> Dieter Kaiser wrote: > The problem is that after a call e.g. to the Maxima function $gamma we > get a back a Maxima number. To continue the calculation we need the > number with a type which is compatible to the calculation within the > package bigfloat. This number should not be in general a bigfloat, but a > float, CL complex, ... and a bigfloat type only for Maxima bigfloat > number. > > I think such a function has to be added. > > Ok. I understand now. I think TO should do what you want and preserve CL number types. When it finds '((rat) a b) it should convert to a Lisp rational, and '((bfloat) ...) should be a BIGFLOAT:REAL object. If maxima returns something like x+%i*y, TO should return a CL complex when possible and then a BIGFLOAT:COMPLEX object. To explicitly convert a CL number to a bigfloat, we'll have to use (float x ) or (coerce x 'bigfloat:real)). How does that sound? Ray From toy.raymond at gmail.com Fri Jan 23 19:07:00 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 23 Jan 2009 20:07:00 -0500 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: <497A4272.4080005@gmail.com> References: <497924AE.9030406@gmail.com> <87eiytlwvb.fsf@inbox.ru> <497A0F6D.3020703@gmail.com> <497A18A0.6040806@cs.berkeley.edu> <497A2D86.3010303@gmail.com> <497A33FE.6060000@ericsson.com> <497A4272.4080005@gmail.com> Message-ID: <497A69B4.5010900@gmail.com> Michael Abshoff wrote: > Raymond Toy wrote: > >> I didn't find it that easy to build MPFR and/or GMP. >> > > Ok, I personally have zero problems with GMP and MPFR while getting > various lisps to compile did cost me considerable more effort. And gcc > 4.2.x recommends GMP and MPFR while 4.3.x and later require it for > Yes, I had to build mpfr and gmp because gcc wanted them. It took a while to get it built. (I don't normally do this unless I have to. I thought I needed a recent gcc on solaris/sparc.) So now I actually have them available. > constant folding. So any system providing recent gcc should have them > available. Ecl has its own GMP copy in tree and so do other lisp > implementations. > > >> But Maxima can't run without a lisp, but it does run well (quite well, >> IMNSHO) without MPFR/GMP. :-) >> > > Absolutely, but given the periodically reappearing discussion about > easier use of external libraries written in C/C++/Fortran something > worthwhile to think about IMHO would be MPFR. Since I am not doing any > of the work this is merely a suggestion. > The best part of using an ffi is having my lisp die because I called the foreign function incorrectly. Or it decided an error happened and exiting is the best way. :-) (But I do use FFI for stuff, as needed.) >> Do you have such an example? I'd really like to see it, since I >> > > I need to dig it out of the Sage bug tracker and that will take some time. > I would certainly like it, but if it's too much work, that's ok. > > > AFAIK the advantage if qd is that it sets rounding mode to 53 bits and > hence does not rely on 80 bit representation. There is a well known > paper that shows that compilers optimizing expression trees will cause > precision loss. But qd at least to my understanding should not be > affected by this issue. > > Setting the rounding mode to 53 bits isn't actually enough. I saw some Java numerics slide that explained this. Even though the precision was 53 bits, the exponent is still 16 bits, so numbers don't underflow/overflow as you would expect for double precision. The slides explained how to solve this problem, but it added a factor of 2-4 in execution or something like that. Ray From toy.raymond at gmail.com Fri Jan 23 19:17:55 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 23 Jan 2009 20:17:55 -0500 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: <497A4846.1000605@gmail.com> References: <497924AE.9030406@gmail.com> <87eiytlwvb.fsf@inbox.ru> <497A0F6D.3020703@gmail.com> <497A18A0.6040806@cs.berkeley.edu> <497A2D86.3010303@gmail.com> <497A3A52.4080104@cs.berkeley.edu> <497A4846.1000605@gmail.com> Message-ID: <497A6C43.3070003@gmail.com> Michael Abshoff wrote: > > I do not see how this is relevant. There clearly seems to be demand for > hooking up external libraries into Maxima. I am pretty sure that if I > benchmark a some Lapack routines using ATLAS against the f2cl translated > Lapack in Maxima you would see a large performance difference. And I can > Numeric speed is not the reason to use maxima; there are many other things that would be better suited. I have not heard any one complain about the lapack routines in maxima being too slow. In fact, I'm not sure any even uses them for anything. :-) And one thing that we can do with the Lisp translation is massage it relatively easily to do a bigfloat implementation. (I haven't actually done this, but I did hack something to support quad-doubles. That appeared to work for the couple of simple tests I tried.) Perhaps there's already an mpfr version of lapack. > trivially build ATLAS to use 4 cores at the same time and BLAS level 3 > Last time I tried to build ATLAS was not exactly trivial, and took the better part of a day. Perhaps it's better now. Ray From michael.abshoff at googlemail.com Fri Jan 23 19:33:56 2009 From: michael.abshoff at googlemail.com (Michael Abshoff) Date: Fri, 23 Jan 2009 17:33:56 -0800 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: <497A69B4.5010900@gmail.com> References: <497924AE.9030406@gmail.com> <87eiytlwvb.fsf@inbox.ru> <497A0F6D.3020703@gmail.com> <497A18A0.6040806@cs.berkeley.edu> <497A2D86.3010303@gmail.com> <497A33FE.6060000@ericsson.com> <497A4272.4080005@gmail.com> <497A69B4.5010900@gmail.com> Message-ID: <497A7004.90502@gmail.com> Raymond Toy wrote: > Michael Abshoff wrote: >> Raymond Toy wrote: Hi Raymond, >>> But Maxima can't run without a lisp, but it does run well (quite well, >>> IMNSHO) without MPFR/GMP. :-) >>> >> Absolutely, but given the periodically reappearing discussion about >> easier use of external libraries written in C/C++/Fortran something >> worthwhile to think about IMHO would be MPFR. Since I am not doing any >> of the work this is merely a suggestion. >> > The best part of using an ffi is having my lisp die because I called the > foreign function incorrectly. Or it decided an error happened and > exiting is the best way. :-) Well, great potential speedups do not come for free :) > (But I do use FFI for stuff, as needed.) > >>> Do you have such an example? I'd really like to see it, since I >>> >> I need to dig it out of the Sage bug tracker and that will take some time. >> > I would certainly like it, but if it's too much work, that's ok. Ping me off list in about a week if you don't hear from me. I know it was a commit I did (or at least I bug I reported), so it should be somewhat reasonable to find. If I got a power supply on the way home trans-atlantic I will try to find it. I hope my recollection is not wrong, but I do recall being very surprised to see the failure. >> AFAIK the advantage if qd is that it sets rounding mode to 53 bits and >> hence does not rely on 80 bit representation. There is a well known >> paper that shows that compilers optimizing expression trees will cause >> precision loss. But qd at least to my understanding should not be >> affected by this issue. >> >> > Setting the rounding mode to 53 bits isn't actually enough. I saw some > Java numerics slide that explained this. I do recall some paper discussing the problem, but I do not have time to look into this. If you find the slides feel tree to send them to me off list. > Even though the precision was > 53 bits, the exponent is still 16 bits, so numbers don't > underflow/overflow as you would expect for double precision. The slides > explained how to solve this problem, but it added a factor of 2-4 in > execution or something like that. Fair enough. But given that quaddouble is faster than MPFR it does sound very much like it does not do this. Thanks for the input, I will think about this and will hopefully come up with a solution to make the quaddouble tests work. One potential problem might be that some of the other FPU control flags are different on Linux and Solaris per default for example and since quaddouble only sets the rounding mode this might cause the discrepancy. Note that oddly on Solaris there is only a kernel level interface to set FPU control words and one has to resort to inline assembly to make it work in userspace. Back in the day Linux had some problems with restoring FPU states on context switches, but I would assume that Solaris 10 does not suffer from this problem. I have other code to maintain in Sage that uses the same algorithmic tricks with doubles to have fast multi-double arithmetic and it also has serious issues with precision and rounding and seems to expose Solaris gcc specific bugs with higher optimization levels, so the problem seems to be unrelated to the quaddouble specific implementation. > Ray Cheers, Michael From robert.dodier at gmail.com Fri Jan 23 19:48:39 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 23 Jan 2009 18:48:39 -0700 Subject: [Maxima] numerics; was: ECL? was ..Re: Runtime determination of share directories? Message-ID: On Fri, Jan 23, 2009 at 6:17 PM, Raymond Toy wrote: > Numeric speed is not the reason to use maxima; there are many other > things that would be better suited. Well, at the risk of prolonging this discussion, my $0.02 on this is that symbolic problems very often lead to numeric ones, and it would be really nice to be able to solve such problems all in one environment. My pet example, not related to LAPACK or GMP or anything else, is the computation of marginal probability distributions; typically one can make some headway with symbolic calculations, but in many cases it is necessary to resort to numerical approximations (some variety of numerical integration). FWIW Robert Dodier From michael.abshoff at googlemail.com Fri Jan 23 21:31:28 2009 From: michael.abshoff at googlemail.com (Michael Abshoff) Date: Fri, 23 Jan 2009 19:31:28 -0800 Subject: [Maxima] numerics; was: ECL? was ..Re: Runtime determination of share directories? In-Reply-To: References: Message-ID: <497A8B90.6070208@gmail.com> Robert Dodier wrote: > On Fri, Jan 23, 2009 at 6:17 PM, Raymond Toy wrote: > >> Numeric speed is not the reason to use maxima; there are many other >> things that would be better suited. > > Well, at the risk of prolonging this discussion, my $0.02 on this > is that symbolic problems very often lead to numeric ones, > and it would be really nice to be able to solve such problems > all in one environment. > > My pet example, not related to LAPACK or GMP or anything else, > is the computation of marginal probability distributions; typically > one can make some headway with symbolic calculations, but in > many cases it is necessary to resort to numerical approximations > (some variety of numerical integration). I am sorry, but I could not resist this one: Many algorithms for exact linear algebra problems can be reduced to multimodular problems that then in turn are solved using BLAS since operations in F_p can be done via floats or doubles assuming p is lower than some bound. I.e. the reason a determinant in Sage over ZZ for example blows Maxima out of the water because exactly that implementation is used (yes, even with the RAT trick). We are talking about significantly better asymptotic complexity coupled with much faster finite field arithmetic. The same applied to HNF, charpoly, solving linear systems and on and on. And those building blocks are used to implement more high level algorithms which very much benefit from the fast low level implementations. Now you might not care about any of this since the problems you solve have little to do with exact linear algebra problems of any significant size, but your competitors, commercial as well as Open Source do. When your basic operations are slow you cannot really have fast high level code. Obviously clever algorithms can compensate for that to some extend. > FWIW > > Robert Dodier Cheers, Michael > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From toy.raymond at gmail.com Fri Jan 23 21:59:56 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 23 Jan 2009 22:59:56 -0500 Subject: [Maxima] Package bigfloat In-Reply-To: <1232753820.5484.66.camel@dieter-laptop> References: <1232749073.5484.41.camel@dieter-laptop> <497A4E31.8000703@ericsson.com> <1232753820.5484.66.camel@dieter-laptop> Message-ID: <497A923C.2000905@gmail.com> Dieter Kaiser wrote: > The problem is that after a call e.g. to the Maxima function $gamma we > get a back a Maxima number. To continue the calculation we need the > number with a type which is compatible to the calculation within the > package bigfloat. This number should not be in general a bigfloat, but a > float, CL complex, ... and a bigfloat type only for Maxima bigfloat > number. > > I think such a function has to be added. > > Ok. The function bigfloat:to will take a maxima number and convert it to a CL or BIGFLOAT number (real or complex) as expected. I also added bigfloat:bigfloat to make a bigfloat number (real or complex). The changes are checked in. Let me know if you run into other problems and I'll try to fix them soon. Ray From andrej.vodopivec at gmail.com Sat Jan 24 03:39:03 2009 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Sat, 24 Jan 2009 10:39:03 +0100 Subject: [Maxima] Proposal for location of fasls In-Reply-To: References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> Message-ID: <7775b21a0901240139t3981c8au68a49811e3acb662@mail.gmail.com> > While on that i have compiled affine on 5.17.1 by using the indication by > R. Toy somewhere on Google, that is, replace last line by: > (mk:oos "affine" :compile) > and it works no problem. The Grobner basis computation in affine is *much > much* faster than the one in the Grobner package. Little problem, such > basis are not unique, and it is difficult to check results between two > implementations, i have tried comparing with Maple. Unfortunately affine is > very little documented, in particular in the way order of variables is > defined, and their weight. But the result entirely depends on that. > Anyways, speedwise, Maple and affine are in the same league, while the > Grobner package leads to extremely slow computations, for example for > > /* A tough example learned from Cox */ > poly_grobner([x^5+y^4+z^3-1,x^3+y^3+z^2-1], [x,y,z]); > > takes 1mn30s You should compile the grobner package if you wish to compare it to the compiled affine package. compile_file(file_search("grobner.lisp"), path_to_compiled_grobner); will compile the grobner package and save the result to path_to_compiled_grobner which you can then load. With the default ordering poly_grobner is still slow, but if you change the ordering to grlex poly_grobner is faster than affine. Andrej From drdieterkaiser at web.de Sat Jan 24 07:24:01 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 24 Jan 2009 14:24:01 +0100 Subject: [Maxima] Package bigfloat In-Reply-To: <497A6777.90105@gmail.com> References: <1232749073.5484.41.camel@dieter-laptop> <497A4E31.8000703@ericsson.com> <1232753820.5484.66.camel@dieter-laptop> <497A6777.90105@gmail.com> Message-ID: <1232803441.5449.23.camel@dieter-laptop> Am Freitag, den 23.01.2009, 19:57 -0500 schrieb Raymond Toy: > Dieter Kaiser wrote: > > The problem is that after a call e.g. to the Maxima function $gamma we > > get a back a Maxima number. To continue the calculation we need the > > number with a type which is compatible to the calculation within the > > package bigfloat. This number should not be in general a bigfloat, but a > > float, CL complex, ... and a bigfloat type only for Maxima bigfloat > > number. > > > > I think such a function has to be added. > > > > > Ok. I understand now. I think TO should do what you want and preserve > CL number types. When it finds '((rat) a b) it should convert to a Lisp > rational, and '((bfloat) ...) should be a BIGFLOAT:REAL object. If > maxima returns something like x+%i*y, TO should return a CL complex when > possible and then a BIGFLOAT:COMPLEX object. > > To explicitly convert a CL number to a bigfloat, we'll have to use > (float x ) or (coerce x 'bigfloat:real)). > > How does that sound? Hello Ray, yes, that is the functionality I need to combine a call to a Maxima function with the calculation within the package bigfloat. Again the example. I have named the new function convert and added the prefix maxima to be more clear: (bigfloat:- (bigfloat:/ (bigfloat:* (bigfloat:convert ($gamma (maxima:to a))) (bigfloat:convert ($gamma (maxima:to b)))) (bigfloat:convert ($gamma (maxima:to (bigfloat:+ a b))))) (beta-incomplete b a (bigfloat:- 1.0 z)))) Furthermore I would like to use the convention that a numerical function is called with and returns a type compatible to the package bigfloat. Thus a call to the numerical function beta-incomplete from the simplifier has been implemented as (maxima:to (beta-incomplete (bigfloat:convert a) (bigfloat:convert b) (bigfloat:convert z))) Dieter Kaiser From drdieterkaiser at web.de Sat Jan 24 08:37:03 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 24 Jan 2009 15:37:03 +0100 Subject: [Maxima] Package bigfloat In-Reply-To: <497A923C.2000905@gmail.com> References: <1232749073.5484.41.camel@dieter-laptop> <497A4E31.8000703@ericsson.com> <1232753820.5484.66.camel@dieter-laptop> <497A923C.2000905@gmail.com> Message-ID: <1232807823.5783.7.camel@dieter-laptop> Am Freitag, den 23.01.2009, 22:59 -0500 schrieb Raymond Toy: > Dieter Kaiser wrote: > > The problem is that after a call e.g. to the Maxima function $gamma we > > get a back a Maxima number. To continue the calculation we need the > > number with a type which is compatible to the calculation within the > > package bigfloat. This number should not be in general a bigfloat, but a > > float, CL complex, ... and a bigfloat type only for Maxima bigfloat > > number. > > > > I think such a function has to be added. > > > > > Ok. The function bigfloat:to will take a maxima number and convert it > to a CL or BIGFLOAT number (real or complex) as expected. I also added > bigfloat:bigfloat to make a bigfloat number (real or complex). > > The changes are checked in. > > Let me know if you run into other problems and I'll try to fix them soon. Hello Ray, it works fine. I have nearly completed the numerical algorithm for the beta_incomplete function. It works for float and bigfloat numbers as expected. There is an open problem for complex numbers. bigfloat:to does not do the correct conversion for pure imaginary numbers. Two examples: (%i36) :lisp (bigfloat:to (mul '$%i ($bfloat 1.0))) NIL (%i36) :lisp (bigfloat:to (mul '$%i 1.0)) NIL Dieter Kaiser From toy.raymond at gmail.com Sat Jan 24 09:19:20 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 24 Jan 2009 10:19:20 -0500 Subject: [Maxima] Package bigfloat In-Reply-To: <1232807823.5783.7.camel@dieter-laptop> References: <1232749073.5484.41.camel@dieter-laptop> <497A4E31.8000703@ericsson.com> <1232753820.5484.66.camel@dieter-laptop> <497A923C.2000905@gmail.com> <1232807823.5783.7.camel@dieter-laptop> Message-ID: <497B3178.2040608@gmail.com> Dieter Kaiser wrote: > Am Freitag, den 23.01.2009, 22:59 -0500 schrieb Raymond Toy: > >> Dieter Kaiser wrote: >> >>> The problem is that after a call e.g. to the Maxima function $gamma we >>> get a back a Maxima number. To continue the calculation we need the >>> number with a type which is compatible to the calculation within the >>> package bigfloat. This number should not be in general a bigfloat, but a >>> float, CL complex, ... and a bigfloat type only for Maxima bigfloat >>> number. >>> >>> I think such a function has to be added. >>> >>> >>> >> Ok. The function bigfloat:to will take a maxima number and convert it >> to a CL or BIGFLOAT number (real or complex) as expected. I also added >> bigfloat:bigfloat to make a bigfloat number (real or complex). >> >> The changes are checked in. >> >> Let me know if you run into other problems and I'll try to fix them soon. >> > > Hello Ray, > > it works fine. I have nearly completed the numerical algorithm for the > beta_incomplete function. It works for float and bigfloat numbers as > expected. > > There is an open problem for complex numbers. bigfloat:to does not do > the correct conversion for pure imaginary numbers. > > Two examples: > > (%i36) :lisp (bigfloat:to (mul '$%i ($bfloat 1.0))) > NIL > (%i36) :lisp (bigfloat:to (mul '$%i 1.0)) > NIL > > Oops. Forgot that case. This should be fixed now, so if you had some workaround for that you can remove it. Ray From drdieterkaiser at web.de Sat Jan 24 09:51:37 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 24 Jan 2009 16:51:37 +0100 Subject: [Maxima] Package bigfloat In-Reply-To: <497B3178.2040608@gmail.com> References: <1232749073.5484.41.camel@dieter-laptop> <497A4E31.8000703@ericsson.com> <1232753820.5484.66.camel@dieter-laptop> <497A923C.2000905@gmail.com> <1232807823.5783.7.camel@dieter-laptop> <497B3178.2040608@gmail.com> Message-ID: <1232812297.5783.15.camel@dieter-laptop> Am Samstag, den 24.01.2009, 10:19 -0500 schrieb Raymond Toy: > Oops. Forgot that case. This should be fixed now, so if you had some > workaround for that you can remove it. Hello Ray, it works. Sorry but we have a further problem. The function bigfloat:exp does not work for complex bigfloat numbers: A general complex bigfloat: (%i11) :lisp (bigfloat:exp (bigfloat:to (add 1.0 (mul '$%i ($bfloat 1.0))))) Maxima encountered a Lisp error: CDR: 0 is not a list Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. A pure imaginary complex bigfloat: (%i11) :lisp (bigfloat:exp (bigfloat:to (mul '$%i ($bfloat 1.0)))) Maxima encountered a Lisp error: CDR: 0 is not a list Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. For complex float numbers all is fine: (%i11) :lisp (bigfloat:exp (bigfloat:to (add 1.0 (mul '$%i ($float 1.0))))) #C(1.4686939399158851 2.2873552871788423) (%i11) :lisp (bigfloat:exp (bigfloat:to (mul '$%i ($float 1.0)))) #C(0.5403023058681398 0.8414709848078965) Dieter Kaiser From toy.raymond at gmail.com Sat Jan 24 09:54:00 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 24 Jan 2009 10:54:00 -0500 Subject: [Maxima] sharefiles list in share/Makefile.am? Message-ID: <497B3998.6010409@gmail.com> Should the sharefiles list in share/Makefile.am include the Fortran files? I guess sharefiles is the list of files from the share directory that should go in a distribution/installation. They're not needed in a distribution/installation. Ray From andre.maute at gmx.de Sat Jan 24 10:08:35 2009 From: andre.maute at gmx.de (andre maute) Date: Sat, 24 Jan 2009 17:08:35 +0100 Subject: [Maxima] integrate and pnz questions Message-ID: <200901241708.36003.andre.maute@gmx.de> I stumbled upon the following -------------------------------------------------------- myuser at myhost:~$ maxima -b bug1.max Maxima 5.15.0 http://maxima.sourceforge.net Using Lisp SBCL 1.0.11.debian Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) batch(bug1.max) batching /home/myuser/bug1.max (%i2) display2d : false (%o2) false (%i3) integrate(x/(1-x),x,-1,1) Is zeroa positive, negative, or zero? ---------------------------------------------------------- what does zeroa mean here? ---------------------------------------------------------- myuser at myhost:~$ maxima -b bug2.max Maxima 5.15.0 http://maxima.sourceforge.net Using Lisp SBCL 1.0.11.debian Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) batch(bug2.max) batching /home/myuser/bug2.max (%i2) display2d : false (%o2) false (%i3) integrate(1/x,x,-1,1) Is x-1 positive, negative, or zero? ---------------------------------------------------------- isn't x-1 < 1-1 = 0? how does this pnz question help here? Regards Andre From toy.raymond at gmail.com Sat Jan 24 10:42:22 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 24 Jan 2009 11:42:22 -0500 Subject: [Maxima] Package bigfloat In-Reply-To: <1232812297.5783.15.camel@dieter-laptop> References: <1232749073.5484.41.camel@dieter-laptop> <497A4E31.8000703@ericsson.com> <1232753820.5484.66.camel@dieter-laptop> <497A923C.2000905@gmail.com> <1232807823.5783.7.camel@dieter-laptop> <497B3178.2040608@gmail.com> <1232812297.5783.15.camel@dieter-laptop> Message-ID: <497B44EE.2090301@gmail.com> Dieter Kaiser wrote: > Am Samstag, den 24.01.2009, 10:19 -0500 schrieb Raymond Toy: > > >> Oops. Forgot that case. This should be fixed now, so if you had some >> workaround for that you can remove it. >> > > Hello Ray, > > it works. > > Sorry but we have a further problem. The function bigfloat:exp does not > work for complex bigfloat numbers: > > A general complex bigfloat: > > (%i11) :lisp (bigfloat:exp (bigfloat:to (add 1.0 (mul '$%i ($bfloat > 1.0))))) > Maxima encountered a Lisp error: > CDR: 0 is not a list > Automatically continuing. > To reenable the Lisp debugger set *debugger-hook* to nil. > > A pure imaginary complex bigfloat: > > (%i11) :lisp (bigfloat:exp (bigfloat:to (mul '$%i ($bfloat 1.0)))) > Maxima encountered a Lisp error: > CDR: 0 is not a list > Automatically continuing. > To reenable the Lisp debugger set *debugger-hook* to nil. I think this is fixed now. I also found similar bugs in the other special functions for a complex bigfloat. And I also found a bug in maxima, unrelated to bigfloat: asinh(%i*2b0) signals an error "pquotient by zero", whatever that means. Ray From drdieterkaiser at web.de Sat Jan 24 10:52:55 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 24 Jan 2009 17:52:55 +0100 Subject: [Maxima] Package bigfloat In-Reply-To: <497B44EE.2090301@gmail.com> References: <1232749073.5484.41.camel@dieter-laptop> <497A4E31.8000703@ericsson.com> <1232753820.5484.66.camel@dieter-laptop> <497A923C.2000905@gmail.com> <1232807823.5783.7.camel@dieter-laptop> <497B3178.2040608@gmail.com> <1232812297.5783.15.camel@dieter-laptop> <497B44EE.2090301@gmail.com> Message-ID: <1232815975.5783.22.camel@dieter-laptop> Am Samstag, den 24.01.2009, 11:42 -0500 schrieb Raymond Toy: > Dieter Kaiser wrote: > > Am Samstag, den 24.01.2009, 10:19 -0500 schrieb Raymond Toy: > > > > > >> Oops. Forgot that case. This should be fixed now, so if you had some > >> workaround for that you can remove it. > >> > > > > Hello Ray, > > > > it works. > > > > Sorry but we have a further problem. The function bigfloat:exp does not > > work for complex bigfloat numbers: > > > > A general complex bigfloat: > > > > (%i11) :lisp (bigfloat:exp (bigfloat:to (add 1.0 (mul '$%i ($bfloat > > 1.0))))) > > Maxima encountered a Lisp error: > > CDR: 0 is not a list > > Automatically continuing. > > To reenable the Lisp debugger set *debugger-hook* to nil. > > > > A pure imaginary complex bigfloat: > > > > (%i11) :lisp (bigfloat:exp (bigfloat:to (mul '$%i ($bfloat 1.0)))) > > Maxima encountered a Lisp error: > > CDR: 0 is not a list > > Automatically continuing. > > To reenable the Lisp debugger set *debugger-hook* to nil. > I think this is fixed now. I also found similar bugs in the other > special functions for a complex bigfloat. > > And I also found a bug in maxima, unrelated to bigfloat: > > asinh(%i*2b0) signals an error "pquotient by zero", whatever that means. Hello Ray, thank you for the fast work. I try to complete the numerical function gamma-incomplete. Meanwhile I am working on the Maxima function beta(a,b). A complete and correct beta function is needed to have a correct beta_incomplete function. There are some problems with an inconsistent handling of negative integers. Furthermore a more complete numerical evaluation has to be added. Dieter Kaiser From macrakis at alum.mit.edu Sat Jan 24 10:56:58 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 24 Jan 2009 11:56:58 -0500 Subject: [Maxima] integrate and pnz questions In-Reply-To: <200901241708.36003.andre.maute@gmx.de> References: <200901241708.36003.andre.maute@gmx.de> Message-ID: <8b356f880901240856i81f882er1803f726017037d4@mail.gmail.com> On Sat, Jan 24, 2009 at 11:08 AM, andre maute wrote: > (%i3) integrate(x/(1-x),x,-1,1) > Is zeroa positive, negative, or zero? > what does zeroa mean here? zeroa is an internal symbol for a positive infinitesimal (sort of). The fact that it is being displayed to the user is a bug. Anyway, asksign should know that zeroa>0 and zerob<0. > (%i3) integrate(1/x,x,-1,1) > Is x-1 positive, negative, or zero? > ---------------------------------------------------------- > > isn't x-1 < 1-1 = 0? > how does this pnz question help here? Yes, definite integration should be cleverer here. Not exactly a bug, but not the best behavior. -s From zimmerma at loria.fr Sat Jan 24 03:34:13 2009 From: zimmerma at loria.fr (Paul Zimmermann) Date: Sat, 24 Jan 2009 10:34:13 +0100 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: <497A33FE.6060000@ericsson.com> (message from Raymond Toy on Fri, 23 Jan 2009 16:17:50 -0500) Message-ID: Ray, [it's quite an interesting discussion for me] I'm not sure, but I think there will always be corner cases where you will get incorrect results on an x87. It's unavoidable due to the 80-bit registers. Even if you set the rounding and precision modes correctly. I think the cases are when a number would underflow to 0 if you had 64-bit doubles but doesn't when you have 80-bit long floats. please can you give an example? I thought quaddouble was using algorithms like TwoSum of TwoProduct which guarantee exact operations, without guard bits. Paul From zimmerma at loria.fr Sat Jan 24 04:19:40 2009 From: zimmerma at loria.fr (Paul Zimmermann) Date: Sat, 24 Jan 2009 11:19:40 +0100 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: <497A7004.90502@gmail.com> (message from Michael Abshoff on Fri, 23 Jan 2009 17:33:56 -0800) Message-ID: > Setting the rounding mode to 53 bits isn't actually enough. I saw some > Java numerics slide that explained this. I do recall some paper discussing the problem, but I do not have time to look into this. If you find the slides feel tree to send them to me off list. moreover it is not enough to set it at startup time, since any other component or even the user may revert the rounding mode. Thus this change has to be made at every call of a quaddouble function. Paul Zimmermann From macrakis at alum.mit.edu Sat Jan 24 11:10:03 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Sat, 24 Jan 2009 12:10:03 -0500 Subject: [Maxima] optimize() function In-Reply-To: <87515d920901230307h252aa878x4d3e330c65486cc2@mail.gmail.com> References: <87515d920901230307h252aa878x4d3e330c65486cc2@mail.gmail.com> Message-ID: <8b356f880901240910k15e0ac74pb4062d2c956cc94@mail.gmail.com> The "optimize" function does much less than its name implies. In particular, in the case of n-ary operators, it does not take into account associativity and commutativity at all -- it only looks for common subtrees. You could probably write a simple greedy algorithm which would give decent (though not optimal) results. Be careful, though: mathematical identities are not floating-point identities. -s On Fri, Jan 23, 2009 at 6:07 AM, Bastian Pranzas wrote: > Hi, > > I use maxima to find formulas I want to use in software development. > It is pretty common, that I can bring my formulas to sums of products > of serveral variables. To keep calculation time at a minimum I want to > minimize the actual count of operations. I found that the optimize() > function attempts to do what I want. But it is not very successful > i.e. an expression like a*b*c+b*c*d, that contains the product b*c > twice can not be optimized. Is there a way to do this with maxima? If > not (sorry for being off-topic), does somebody know of a (free) CAS > that can do this? From fateman at cs.berkeley.edu Sat Jan 24 11:40:50 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Sat, 24 Jan 2009 09:40:50 -0800 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: References: Message-ID: <497B52A2.4000505@cs.berkeley.edu> Paul Zimmermann wrote: > > Setting the rounding mode to 53 bits isn't actually enough. I saw some > > Java numerics slide that explained this. > > I do recall some paper discussing the problem, but I do not have time to > look into this. If you find the slides feel tree to send them to me off > list. > > moreover it is not enough to set it at startup time, since any other component > or even the user may revert the rounding mode. Thus this change has to be made > at every call of a quaddouble function. > > Paul Zimmermann > Looking back at the qd stuff I used, where I inserted a fix_fpu_start in each interface routine, I forget if I had any guarantee I had that some operating system interruption would not come in and change the rounding anyway. (I think the lightweight threads in the model used by Allegro CL on x86 is not going to interrupt). Anyway, setting the rounding at startup time is, as you say, not enough, and if that is what Sage does, that might produce random behaviors. From fateman at cs.berkeley.edu Sat Jan 24 11:50:26 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Sat, 24 Jan 2009 09:50:26 -0800 Subject: [Maxima] Package bigfloat In-Reply-To: <1232803441.5449.23.camel@dieter-laptop> References: <1232749073.5484.41.camel@dieter-laptop> <497A4E31.8000703@ericsson.com> <1232753820.5484.66.camel@dieter-laptop> <497A6777.90105@gmail.com> <1232803441.5449.23.camel@dieter-laptop> Message-ID: <497B54E2.6080903@cs.berkeley.edu> Another way around this is to consider removing ((rat) a b) and using common lisp rationals. This requires changes in Maxima in many places, but maybe not as many as some people would think. Also, using common lisp complex constants. This makes the representation of a+b*%i with symbols a, b ((mplus simp) $a ((mtimes simp) $b $%i)) which is different from 3+4*%i, which would be common lisp #c(3,4). But then complex bigfloats would be ((mplus simp) ((bigfloat...) ((mtimes simp) ....)) I think this has to be thought through more completely, not just for gamma, and could be a nice application of CLOS (as per the code I wrote for generic arithmetic, which might however not be easy to drop in to Maxima). RJF There are only two caseDieter Kaiser wrote: > Am Freitag, den 23.01.2009, 19:57 -0500 schrieb Raymond Toy: > >> Dieter Kaiser wrote: >> >>> The problem is that after a call e.g. to the Maxima function $gamma we >>> get a back a Maxima number. To continue the calculation we need the >>> number with a type which is compatible to the calculation within the >>> package bigfloat. This number should not be in general a bigfloat, but a >>> float, CL complex, ... and a bigfloat type only for Maxima bigfloat >>> number. >>> >>> I think such a function has to be added. >>> >>> >>> >> Ok. I understand now. I think TO should do what you want and preserve >> CL number types. When it finds '((rat) a b) it should convert to a Lisp >> rational, and '((bfloat) ...) should be a BIGFLOAT:REAL object. If >> maxima returns something like x+%i*y, TO should return a CL complex when >> possible and then a BIGFLOAT:COMPLEX object. >> >> To explicitly convert a CL number to a bigfloat, we'll have to use >> (float x ) or (coerce x 'bigfloat:real)). >> >> How does that sound? >> > > Hello Ray, > > yes, that is the functionality I need to combine a call to a Maxima > function with the calculation within the package bigfloat. > > Again the example. I have named the new function convert and added the > prefix maxima to be more clear: > > (bigfloat:- > (bigfloat:/ > (bigfloat:* > (bigfloat:convert ($gamma (maxima:to a))) > (bigfloat:convert ($gamma (maxima:to b)))) > (bigfloat:convert ($gamma (maxima:to (bigfloat:+ a b))))) > (beta-incomplete b a (bigfloat:- 1.0 z)))) > > Furthermore I would like to use the convention that a numerical function > is called with and returns a type compatible to the package bigfloat. > > Thus a call to the numerical function beta-incomplete from the > simplifier has been implemented as > > (maxima:to (beta-incomplete (bigfloat:convert a) > (bigfloat:convert b) > (bigfloat:convert z))) > > Dieter Kaiser > > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From drdieterkaiser at web.de Sat Jan 24 11:52:28 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 24 Jan 2009 18:52:28 +0100 Subject: [Maxima] Package bigfloat In-Reply-To: <1232815975.5783.22.camel@dieter-laptop> References: <1232749073.5484.41.camel@dieter-laptop> <497A4E31.8000703@ericsson.com> <1232753820.5484.66.camel@dieter-laptop> <497A923C.2000905@gmail.com> <1232807823.5783.7.camel@dieter-laptop> <497B3178.2040608@gmail.com> <1232812297.5783.15.camel@dieter-laptop> <497B44EE.2090301@gmail.com> <1232815975.5783.22.camel@dieter-laptop> Message-ID: <1232819548.5783.47.camel@dieter-laptop> Hello Ray, the code seems to be nearly complete. The first more systematically tests for the beta_incomplete function with float and bigfloat numbers work well. Again a small problem: The function bigfloat:expt does not work for a zero base: (%i23) :lisp (bigfloat:expt 0.0 (bigfloat:bigfloat 1.0)); Maxima encountered a Lisp error: LOG: division by zero Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. Again for float numbers it is working: (%i23) :lisp (bigfloat:expt 0.0 1.0); 0.0 I have not tested it systematically, but perhaps there are some further problems with mixed types and a negative base: (%i28) :lisp (bigfloat:expt -1.0 (bigfloat:bigfloat 1.0)); Maxima encountered a Lisp error: NO-APPLICABLE-METHOD: When calling # with arguments (+1.0b0 #C(0.0 3.141592653589793)), no method is applicable. Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. Dieter Kaiser From fateman at cs.berkeley.edu Sat Jan 24 12:00:04 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Sat, 24 Jan 2009 10:00:04 -0800 Subject: [Maxima] Package bigfloat In-Reply-To: <497B44EE.2090301@gmail.com> References: <1232749073.5484.41.camel@dieter-laptop> <497A4E31.8000703@ericsson.com> <1232753820.5484.66.camel@dieter-laptop> <497A923C.2000905@gmail.com> <1232807823.5783.7.camel@dieter-laptop> <497B3178.2040608@gmail.com> <1232812297.5783.15.camel@dieter-laptop> <497B44EE.2090301@gmail.com> Message-ID: <497B5724.7080800@cs.berkeley.edu> Raymond Toy wrote: > > And I also found a bug in maxima, unrelated to bigfloat: > > asinh(%i*2b0) signals an error "pquotient by zero", whatever that means. > > pquotient is part of the rational function package. Someone is trying to divide a polynomial by zero. The bug does not occur in Macsyma 2.4 From robert.dodier at gmail.com Sat Jan 24 12:15:55 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 24 Jan 2009 11:15:55 -0700 Subject: [Maxima] sharefiles list in share/Makefile.am? In-Reply-To: <497B3998.6010409@gmail.com> References: <497B3998.6010409@gmail.com> Message-ID: On 1/24/09, Raymond Toy wrote: > Should the sharefiles list in share/Makefile.am include the Fortran files? I don't think so. They are useful to developers but not users. best Robert From robert.dodier at gmail.com Sat Jan 24 12:27:13 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 24 Jan 2009 11:27:13 -0700 Subject: [Maxima] Share autoloads? In-Reply-To: <49792308.3030103@gmail.com> References: <49792308.3030103@gmail.com> Message-ID: On 1/22/09, Raymond Toy wrote: > While looking at the minpack vs $jacobian autoload, I noticed that > src/max_ext.lisp contains the list of things that should autoload. Is > that correct? Yup. > It seems to me that it would be nice if we could look through the share > directory for an autoload file that defines what the share package wants > to be autoloaded? Less work for maxima, and it allows share packages > not included with maxima itself to define what it wants to be > autoloaded. It also reduces the coupling of the core maxima code with > the share packages. Makes sense to me. best Robert From ekamperi at gmail.com Sat Jan 24 13:37:09 2009 From: ekamperi at gmail.com (Stathis Kamperis) Date: Sat, 24 Jan 2009 21:37:09 +0200 Subject: [Maxima] Failed test cases Message-ID: <2218b9af0901241137u4710ccc6ya4365f42de87a459@mail.gmail.com> Greetings to everyone. I've build a today cvs snapshot. Everything went smoothly. When I ran the test suite, I got the following failures: Error summary: Error found in /usr/pkg/share/maxima/5.17.99/tests/rtest14.mac, problem: (285) Error found in rtest_integrate, problem: (error break) Error found in rtest_integrate_special, problem: (error break) Also before that I caught this: ********************** Problem 285 *************** Input: test_wronskian(lambda([n, z], expand(w_jj(n, %i z))), - 2.0 sin(n %pi) lambda([n, z], ----------------), 1.0E-8, 10) %i z %pi Result: error-catch This differed from the expected result: [] Best regards, Stathis Kamperis From asau at inbox.ru Sat Jan 24 15:34:43 2009 From: asau at inbox.ru (Aleksej Saushev) Date: Sun, 25 Jan 2009 00:34:43 +0300 Subject: [Maxima] Recurring build problem with maxima.info Message-ID: <87iqo4ie18.fsf@inbox.ru> Hello! When building Maxima from CVS in parallel make jobs I (and I'm not alone) see the following: Making all in lisp-utils Making all in tests Making all in doc --- all-recursive --- Making all in info --- all-recursive --- --- maxima.info --- --- warn_texinfo --- --- ./maxima.info --- --- maxima.info --- makeinfo --split-size=1000000 maxima.texi --- warn_texinfo --- pattern=`printf "\r$"` ; bad_files=`find . -name '*.texi' -print | xargs /usr/bin/egrep -l -e "$pattern"` ; [ -z "$bad_files" ] || ( echo "WARNING: The following files have DOS-style EOLs: $bad_files" ; echo "Run /doc/info/fix_crlf to fix the problem." ) --- ./maxima.info --- restore=: && backupdir=".am$$" && am__cwd=`pwd` && cd . && rm -rf $backupdir && mkdir $backupdir && if (/var/tmp/pkgsrc/wip/maxima/work/.tools/bin/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 /var/tmp/pkgsrc/wip/maxima/work/.tools/bin/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 --- warn_texinfo --- pattern=`printf "\t"` ; bad_files=`find . -name '*.texi' -print | xargs /usr/bin/egrep -l -e "$pattern"` ; [ -z "$bad_files" ] || ( echo "WARNING: The following files have unexpanded Tabs: $bad_files" ; echo "Run /doc/info/fix_tab to fix the problem." ) --- maxima.info --- /var/tmp/pkgsrc/wip/maxima/work/maxima/doc/info/maxima.info: Bad address makeinfo: Removing output file `/var/tmp/pkgsrc/wip/maxima/work/maxima/doc/info/maxima.info' due to errors; use --force to preserve. *** [maxima.info] Error code 1 --- ./maxima.info --- ./maxima.info: No such file or directory makeinfo: Removing output file `./maxima.info' due to errors; use --force to preserve. *** [./maxima.info] Error code 1 2 errors make: stopped in /var/tmp/pkgsrc/wip/maxima/work/maxima/doc/info *** [all-recursive] Error code 1 1 error This started several weeks ago and occurs only under heavy load or with many make jobs (32 in the last case). Does anyone else see it? -- HE CE3OH... From toy.raymond at gmail.com Sat Jan 24 20:51:53 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 24 Jan 2009 21:51:53 -0500 Subject: [Maxima] Package bigfloat In-Reply-To: <1232819548.5783.47.camel@dieter-laptop> References: <1232749073.5484.41.camel@dieter-laptop> <497A4E31.8000703@ericsson.com> <1232753820.5484.66.camel@dieter-laptop> <497A923C.2000905@gmail.com> <1232807823.5783.7.camel@dieter-laptop> <497B3178.2040608@gmail.com> <1232812297.5783.15.camel@dieter-laptop> <497B44EE.2090301@gmail.com> <1232815975.5783.22.camel@dieter-laptop> <1232819548.5783.47.camel@dieter-laptop> Message-ID: <497BD3C9.9050104@gmail.com> Dieter Kaiser wrote: > Hello Ray, > > the code seems to be nearly complete. The first more systematically > tests for the beta_incomplete function with float and bigfloat numbers > work well. > > Again a small problem: > > The function bigfloat:expt does not work for a zero base: > > (%i23) :lisp (bigfloat:expt 0.0 (bigfloat:bigfloat 1.0)); > Maxima encountered a Lisp error: > LOG: division by zero > Automatically continuing. > To reenable the Lisp debugger set *debugger-hook* to nil. > Oops. I think I've fixed the issues with expt. It still needs more work though. Things like (expt -1b0 1b0) returns a complex number instead of -1b0. But expt should return answers that are at least close to the real answer. > > (%i28) :lisp (bigfloat:expt -1.0 (bigfloat:bigfloat 1.0)); > Maxima encountered a Lisp error: > NO-APPLICABLE-METHOD: When calling # BIGFLOAT::TWO-ARG-*> with arguments (+1.0b0 #C(0.0 > 3.141592653589793)), no method is applicable. > Automatically continuing. > To reenable the Lisp debugger set *debugger-hook* to nil. > > I completely missed the case of bigfloat op cl:complex. I've fixed these now. I hope bigfloat works better now. Sorry for the trouble. If you find more issues, just holler. Ray From robert.dodier at gmail.com Sat Jan 24 21:17:59 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 24 Jan 2009 20:17:59 -0700 Subject: [Maxima] default value of *MAXIMA-OBJDIR* Message-ID: Ray, at present I guess the default value of *MAXIMA-OBJDIR* is the same as *MAXIMA-USERDIR*. Now that I;ve tried it out, I think it should be some subdirectory of that. Can we change it to: (concatenate 'string *maxima-userdir* "/binary-" *maxima-lispname*) or better still: (concatenate 'string *maxima-userdir* "/binary/binary-" *maxima-lispname*) The way things are set up at present, *MAXIMA-OBJDIR* is not actually a place you would want to collect compiler output files. It seems important to me to make *MAXIMA-OBJDIR* something where (1) OK to clutter it with compiler output; and (2) OK to nuke it. FWIW Robert Dodier From toy.raymond at gmail.com Sat Jan 24 21:33:16 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Sat, 24 Jan 2009 22:33:16 -0500 Subject: [Maxima] default value of *MAXIMA-OBJDIR* In-Reply-To: References: Message-ID: <497BDD7C.10909@gmail.com> Robert Dodier wrote: > Ray, > > at present I guess the default value of *MAXIMA-OBJDIR* is the same > as *MAXIMA-USERDIR*. Now that I;ve tried it out, I think it should be > some subdirectory of that. Can we change it to: > (concatenate 'string *maxima-userdir* "/binary-" *maxima-lispname*) > or better still: > (concatenate 'string *maxima-userdir* "/binary/binary-" *maxima-lispname*) > > Either is fine with me. I'll need to rework slightly minpack.system and lapack.system which are currently putting the results in*maxima-objdir*/share/minpack/binary-foo. With teither option, I guess that would be *maxima-objdir*/minpack. Works for me. Also, I'm wondering if maxima-local should set MAXIMA_OBJDIR to be somewhere in the source tree. For someone that has both an installed release and a CVS version, it's probably not a good idea to destroy the fasls in *maxima-objdir* built with the release with new stuff from CVS. Ray From drdieterkaiser at web.de Sun Jan 25 07:41:19 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 25 Jan 2009 14:41:19 +0100 Subject: [Maxima] Problems with CLISP 2.44 and Windows Message-ID: On a Windows system with CLISP 2.44 the testsuite no longer works. I have recompiled Maxima completely. The problem is that Maxima no longer finds the necessary files from the share library. The problem is not present with GCL 2.6.8 on my Windows system. On my Linux system with CLISP 2.44 I have no problems too. Remark: On my Windows system I use the function (maxima-compile) and (maxima-load) to build Maxima. These are the messages from the testsuite: (%i2) run_testsuite(); Running tests in rtestnset: 502/502 tests passed. Running tests in rtest1: 27/27 tests passed. Running tests in rtest1a: 24/24 tests passed. Running tests in rtest2: ********************** Problem 40 *************** Input: 3 3 determinant(hessian(y - 3 a x y z + x , [x, y, z])) Result: Could not find `linearalgebra' using paths in file_search_maxima,file_search_lisp. error-catch This differed from the expected result: 2 3 3 2 2 - 54 a x - 27 a x y z - 3 a y (18 a y + 9 a x z) ********************** Problem 41 *************** Input: 2 subst(1, z, quotient(%, - 54 a )) Result: 0 This differed from the expected result: 3 3 x + a x y + y 54/56 tests passed. The following 2 problems failed: (40 41) Running tests in rtest4: 89/89 tests passed. Running tests in rtest5: 52/52 tests passed (not counting 1 expected errors). Running tests in rtest6: 4/4 tests passed. Running tests in rtest6a: 56/56 tests passed. Running tests in rtest6b: 16/16 tests passed. Running tests in rtest7: 44/44 tests passed. Running tests in rtest9: ********************** Problem 53 *************** Input: nusum(n n!, n, 0, n) Result: Could not find `nusum' using paths in file_search_maxima,system. error-catch This differed from the expected result: (1 + n)! - 1 ********************** Problem 54 *************** Input: 4 n n 4 map('ratsimp, nusum(----------------, n, 0, n)) binomial(2 n, n) Result: Could not find `nusum' using paths in file_search_maxima,system. error-catch This differed from the expected result: 2 3 4 5 n (6 - 38 n - 8 n + 260 n + 350 n + 126 n ) 4 2 ----------------------------------------------- - --- 693 binomial(2 n, n) 231 ********************** Problem 55 *************** Input: unsum(%, n) Result: Could not find `nusum' using paths in file_search_maxima,system. error-catch This differed from the expected result: 4 n n 4 ---------------- binomial(2 n, n) ********************** Problem 56 *************** Input: 2 unsum(product(i , i, 1, n), n) Result: Could not find `nusum' using paths in file_search_maxima,system. error-catch This differed from the expected result: n - 1 /===\ ! ! 2 ( ! ! i ) (n - 1) (1 + n) ! ! i = 1 ********************** Problem 57 *************** Input: nusum(%, n, 1, n) Result: Could not find `nusum' using paths in file_search_maxima,system. error-catch This differed from the expected result: n /===\ ! ! 2 ! ! i - 1 ! ! i = 1 ********************** Problem 58 *************** Input: (3 + n) f(1 + n) n - 1 funcsolve((1 + n) f(n) - ---------------- = -----, f(n)) 1 + n 2 + n Result: Could not find `nusum' using paths in file_search_maxima,system. error-catch This differed from the expected result: n f(n) = --------------- (1 + n) (2 + n) 76/82 tests passed (not counting 1 expected errors). The following 6 problems failed: (53 54 55 56 57 58) Running tests in rtest9a: 22/22 tests passed. Running tests in rtest10: 46/46 tests passed (not counting 2 expected errors). Running tests in rtest11: 112/112 tests passed. Running tests in rtest13: ********************** Problem 3 *************** Input: soln1 : ode2(%, y, x) Result: Could not find `ode2.mac' using paths in file_search_maxima,system. error-catch This differed from the expected result: %c - cos(x) y = ----------- 3 x ********************** Problem 4 *************** Input: ic1(soln1, x = %pi, y = 0) Result: Could not find `ode2.mac' using paths in file_search_maxima,system. error-catch This differed from the expected result: 1 + cos(x) y = - ---------- 3 x ********************** Problem 6 *************** Input: soln2 : ode2(%, y, x) Result: Could not find `ode2.mac' using paths in file_search_maxima,system. error-catch This differed from the expected result: 3 6 %k1 y + y ------------ = %k2 + x 6 ********************** Problem 7 *************** Input: ratsimp(ic2(soln2, x = 0, y = 0, y = 2)) x Result: Could not find `ode2.mac' using paths in file_search_maxima,system. error-catch This differed from the expected result: 3 2 y - 3 y - ---------- = x 6 ********************** Problem 8 *************** Input: bc2(soln2, x = 0, y = 1, x = 1, y = 3) Result: Could not find `ode2.mac' using paths in file_search_maxima,system. error-catch This differed from the expected result: 3 y - 10 y 3 --------- = x - - 6 2 19/24 tests passed. The following 5 problems failed: (3 4 6 7 8) Running tests in rtest13s: 17/17 tests passed. Running tests in rtest14: Could not find `orthopoly' using paths in file_search_maxima,file_search_lisp. -- an error. To debug this try debugmode(true); Real time: 7.828125f0 sec. Run time: 7.421875f0 sec. Space: 47406296 Bytes GC: 28, GC time: 0.5f0 sec. Dieter Kaiser From drdieterkaiser at web.de Sun Jan 25 08:58:53 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 25 Jan 2009 15:58:53 +0100 Subject: [Maxima] Implementation of the Incomplete Beta function Message-ID: I have checked in a first implementation of the Incomplete Beta function. This function uses the new package bigfloat for numerical evaluation. I have further added some tests to the file rtest_gamma.mac. I think the implementation with the package bigfloat is much more elegant. We only need to support and to test one routine. The implementation is not as complete as for other functions, but it might be good to have an example for the package bigfloat. I will add further functionality to beta_incomplete. There are some further problems with the package bigfloat. One point is the handling of Maxima rationals. Another point the imaginary symbol. Here are some examples: (%i3) beta_incomplete(0.5,2.8,0.73); (%o3) 1.097127003359422 A Maxima rational as the first argument: (%i4) beta_incomplete(1/2,2.8,0.73); Maxima encountered a Lisp error: Error in MACSYMA-TOP-LEVEL [or a callee]: No matching method for the generic-function #, when called with arguments (NIL 1.6764907877644366). Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. As the last argument a Maxima rational works: (%i5) beta_incomplete(0.5,2.8,3/2); (%o5) 1.142891048340748-0.025822579159378*%i The symbol %i as argument: (%i10) beta_incomplete(0.5,%i,1.5); BIGFLOAT: Unable to convert %i to a CL or BIGFLOAT number -- an error. To debug this try debugmode(true); Remark: It is necessary to support rationals also in expressions like 1/2+0.5*%i. I would be posssible to do some workarounds in the code of beta_incomplete. But I think it is better to have the package bigfloat as complete as possible. A next task is to improve the Beta function. The handling of negative integers is inconsistent. Support for complex and bigfloat numbers has to be added. Dieter Kaiser From drdieterkaiser at web.de Sun Jan 25 09:22:46 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 25 Jan 2009 16:22:46 +0100 Subject: [Maxima] Failed test cases In-Reply-To: <2218b9af0901241137u4710ccc6ya4365f42de87a459@mail.gmail.com> References: <2218b9af0901241137u4710ccc6ya4365f42de87a459@mail.gmail.com> Message-ID: -----Urspr?ngliche Nachricht----- Von: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] Im Auftrag von Stathis Kamperis Gesendet: Samstag, 24. Januar 2009 20:37 An: maxima at math.utexas.edu Betreff: [Maxima] Failed test cases > I've build a today cvs snapshot. Everything went smoothly. When I ran > the test suite, I got the following failures: > Error found in rtest_integrate, problem: > (error break) > Error found in rtest_integrate_special, problem: > (error break) I had the same problem with CLISP 2.44 on Ubuntu. The files rtest_integrate.mac and rtest_integrate_special.mac were not installed correctly. I had to copy the files by hand in the proper directory. I had no look at the second problem. At first it might be useful to get more information about your Lisp and system (see the Maxima function build_info()). Dieter Kaiser From toy.raymond at gmail.com Sun Jan 25 09:49:03 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 25 Jan 2009 10:49:03 -0500 Subject: [Maxima] Problems with CLISP 2.44 and Windows In-Reply-To: References: Message-ID: <497C89EF.1080500@gmail.com> Dieter Kaiser wrote: > On a Windows system with CLISP 2.44 the testsuite no longer works. I have > recompiled Maxima completely. The problem is that Maxima no longer finds the > necessary files from the share library. > Is this with the latest CVS version? Then it's probably my fault when I added share-subdirs-list. It works fine on OSX. Can you try ":lisp (share-subdirs-list)"? It should return a list of the subdirectories of share. If that doesn't work, can you try just ':lisp (directory "/share/**/")'? That should return the subdirectories too. Ray From toy.raymond at gmail.com Sun Jan 25 10:09:22 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 25 Jan 2009 11:09:22 -0500 Subject: [Maxima] Implementation of the Incomplete Beta function In-Reply-To: References: Message-ID: <497C8EB2.6030703@gmail.com> Dieter Kaiser wrote: > > The implementation is not as complete as for other functions, but it might be > good to have an example for the package bigfloat. I will add further > functionality to beta_incomplete. > Yes, I think an example of how to use the bigfloat package is a good idea. Thanks for doing this. An alternative way would be to put an (in-package "BIGFLOAT") before the implementation so you don't have to type the package qualifier everywhere. Just remember to put a (in-package "MAXIMA") afterwords! > A Maxima rational as the first argument: > > (%i4) beta_incomplete(1/2,2.8,0.73); > Maxima encountered a Lisp error: > > Error in MACSYMA-TOP-LEVEL [or a callee]: No matching method for the > generic-function #, > when called with arguments (NIL 1.6764907877644366). > This is tricky. It fails because the beta_incomplete calls ($gamma a), a = 1/2. It return sqrt(%pi) and wants bigfloat:to to convert it. I think that's outside the scope of bigfloat. The code needs to convert that to either a float or a bfloat. > > The symbol %i as argument: > > (%i10) beta_incomplete(0.5,%i,1.5); > BIGFLOAT: Unable to convert %i to a CL or BIGFLOAT number > -- an error. To debug this try debugmode(true); > This is a bug in bigfloat:to. It needs to recognize $%i. I'll fix this. But I don't think bigfloat:to can handle %pi, %e or %gamma. The caller needs to convert those to a float or bfloat before calling bigfloat routines. > Remark: It is necessary to support rationals also in expressions like > 1/2+0.5*%i. > Yes, this should work. I'll fix it. > I would be posssible to do some workarounds in the code of beta_incomplete. But > I think it is better to have the package bigfloat as complete as possible. > I agree. The intent is that if you have some code that works for double-floats, then you should be able to use that code unchanged (almost) in the bigfloat package. If the code uses declarations or double-float constants, you'll have to change that, of course. Ray From toy.raymond at gmail.com Sun Jan 25 10:19:30 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Sun, 25 Jan 2009 11:19:30 -0500 Subject: [Maxima] Implementation of the Incomplete Beta function In-Reply-To: References: Message-ID: <497C9112.6040200@gmail.com> Dieter Kaiser wrote: > (%i10) beta_incomplete(0.5,%i,1.5); > BIGFLOAT: Unable to convert %i to a CL or BIGFLOAT number > -- an error. To debug this try debugmode(true); > Dang. I fixed it so that bigfloat:to converts %i to #c(0 1). But beta_incomplete still fails here: (BIGFLOAT:* (BIGFLOAT:TO ($GAMMA (TO A))) (BIGFLOAT:TO ($GAMMA (TO B)))) Here, B = #c(0 1). Then (to b) is '$%i. ($gamma $%i) returns '((%gamma simp) $%i). bigfloat:to can't handle that. I think the calls to $gamma need convert either the args or the results to some kind of float/bfloat before calling bigfloat:to. Ray From ekamperi at gmail.com Sun Jan 25 10:22:18 2009 From: ekamperi at gmail.com (Stathis Kamperis) Date: Sun, 25 Jan 2009 18:22:18 +0200 Subject: [Maxima] Failed test cases In-Reply-To: References: <2218b9af0901241137u4710ccc6ya4365f42de87a459@mail.gmail.com> Message-ID: <2218b9af0901250822x64c59098q3dee6631ab72cbbb@mail.gmail.com> 2009/1/25 Dieter Kaiser : > -----Urspr?ngliche Nachricht----- > Von: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] Im > Auftrag von Stathis Kamperis > Gesendet: Samstag, 24. Januar 2009 20:37 > An: maxima at math.utexas.edu > Betreff: [Maxima] Failed test cases > >> I've build a today cvs snapshot. Everything went smoothly. When I ran >> the test suite, I got the following failures: > >> Error found in rtest_integrate, problem: >> (error break) >> Error found in rtest_integrate_special, problem: >> (error break) > > I had the same problem with CLISP 2.44 on Ubuntu. The files rtest_integrate.mac > and rtest_integrate_special.mac were not installed correctly. I had to copy the > files by hand in the proper directory. This is archlinux with CLISPT 2.47. I'll see if the trick works for me and if yes, I'll file a bug report to my distribution. > I had no look at the second problem. At first it might be useful to get more > information about your Lisp and system (see the Maxima function build_info()). > > Dieter Kaiser > (%i1) build_info(); Maxima version: 5.17.1 Maxima build date: 19:18 12/30/2008 host type: i686-pc-linux-gnu lisp-implementation-type: CLISP lisp-implementation-version: 2.47 (2008-10-23) (built on Miranda) (%o1) Best regards, Stathis Kamperis From ekamperi at gmail.com Sun Jan 25 10:28:57 2009 From: ekamperi at gmail.com (Stathis Kamperis) Date: Sun, 25 Jan 2009 18:28:57 +0200 Subject: [Maxima] Failed test cases In-Reply-To: <2218b9af0901250822x64c59098q3dee6631ab72cbbb@mail.gmail.com> References: <2218b9af0901241137u4710ccc6ya4365f42de87a459@mail.gmail.com> <2218b9af0901250822x64c59098q3dee6631ab72cbbb@mail.gmail.com> Message-ID: <2218b9af0901250828m5f8aadc2w4e34044c2556c389@mail.gmail.com> 2009/1/25 Stathis Kamperis : > 2009/1/25 Dieter Kaiser : >> -----Urspr?ngliche Nachricht----- >> Von: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] Im >> Auftrag von Stathis Kamperis >> Gesendet: Samstag, 24. Januar 2009 20:37 >> An: maxima at math.utexas.edu >> Betreff: [Maxima] Failed test cases >> >>> I've build a today cvs snapshot. Everything went smoothly. When I ran >>> the test suite, I got the following failures: >> >>> Error found in rtest_integrate, problem: >>> (error break) >>> Error found in rtest_integrate_special, problem: >>> (error break) >> >> I had the same problem with CLISP 2.44 on Ubuntu. The files rtest_integrate.mac >> and rtest_integrate_special.mac were not installed correctly. I had to copy the >> files by hand in the proper directory. > > This is archlinux with CLISPT 2.47. I'll see if the trick works for me > and if yes, I'll file a bug report to my distribution. > >> I had no look at the second problem. At first it might be useful to get more >> information about your Lisp and system (see the Maxima function build_info()). >> >> Dieter Kaiser >> > (%i1) build_info(); > > Maxima version: 5.17.1 > Maxima build date: 19:18 12/30/2008 > host type: i686-pc-linux-gnu > lisp-implementation-type: CLISP > lisp-implementation-version: 2.47 (2008-10-23) (built on Miranda) > > (%o1) > > Best regards, > Stathis Kamperis > Please forget everything I've just said. The problem was encountered in a NetBSD box with maxima-current and a CLISP version I don't remember right now. I'm writing this from a linux machine, that's why I got confused. I need sleep. Sorry for the noise. Best regards, Stathis Kamperis From drdieterkaiser at web.de Sun Jan 25 11:48:06 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 25 Jan 2009 18:48:06 +0100 Subject: [Maxima] Implementation of the Incomplete Beta function In-Reply-To: <497C9112.6040200@gmail.com> References: <497C9112.6040200@gmail.com> Message-ID: <1232905686.5515.30.camel@dieter-laptop> Am Sonntag, den 25.01.2009, 11:19 -0500 schrieb Raymond Toy: > Dieter Kaiser wrote: > > (%i10) beta_incomplete(0.5,%i,1.5); > > BIGFLOAT: Unable to convert %i to a CL or BIGFLOAT number > > -- an error. To debug this try debugmode(true); > > > Dang. I fixed it so that bigfloat:to converts %i to #c(0 1). But > beta_incomplete still fails here: > > (BIGFLOAT:* (BIGFLOAT:TO ($GAMMA (TO A))) (BIGFLOAT:TO ($GAMMA (TO B)))) > > Here, B = #c(0 1). Then (to b) is '$%i. ($gamma $%i) returns '((%gamma > simp) $%i). bigfloat:to can't handle that. > > I think the calls to $gamma need convert either the args or the results > to some kind of float/bfloat before calling bigfloat:to. > > Ray Hello Ray, I see the problem and I am thinking about it. The first part of the beta-incomplete function uses a reflection formula. Perhaps it is necessary to redesign this part completely without using the package bigfloat. I have checked the handling of constants. The results are interesting: The flag numer gives a numerical result for %i, but not the function float(): (%i30) gamma(%i),numer; (%o30) - .4980156681183566 %i - .1549498283018101 (%i31) float(gamma(%i)); (%o31) gamma(%i) That is different for other constants which give always a numerical result: (%i32) gamma(%gamma),numer; (%o32) 1.543881741815662 (%i33) float(gamma(%gamma)); (%o33) 1.543881741815662 (%i34) gamma(%phi),numer; (%o34) .8956731517052878 (%i35) float(gamma(%phi)); (%o35) .8956731517052878 But for %e we have a bug in the gamma function: (%i36) gamma(%e),numer; Maxima encountered a Lisp error: CDR: $%E is not a list Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. (%i37) float(gamma(%e)); (%o37) 1.567468255774053 I think the problem is the following line in the function simpgamma: ($numer (gammafloat (fpcofrat j))) This is called without any further check. Furthermore I think simpgamma has to be redesign a bit to be more correct in handling the flag $numer and constants. Some results for the sin function. The function float() works for all constants: (%i38) sin(%e); (%o38) sin(%e) (%i39) sin(%e),numer; (%o39) sin(%e) (%i40) float(sin(%e)); (%o40) .4107812905029088 (%i41) float(sin(%gamma)); (%o41) .5456928232039928 (%i42) sin(%gamma),numer; (%o42) .5456928232039928 (%i43) sin(%i),numer; (%o43) 1.175201193643801 %i (%i44) float(sin(%i)); (%o44) 1.175201193643801 %i Dieter Kaiser From al at beshenov.ru Sun Jan 25 13:45:54 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Sun, 25 Jan 2009 22:45:54 +0300 Subject: [Maxima] sloane's integer sequences and maxima In-Reply-To: <200809081006.42671.andre.maute@gmx.de> References: <200809081006.42671.andre.maute@gmx.de> Message-ID: <200901252245.55138.al@beshenov.ru> On Monday 08 September 2008 12:06:42 andre maute wrote: > wouldn't it be nice to optionally ship a version > of sloane's integer sequences with maxima? Here is my interface for EIS: http://beshenov.ru/maxima/eis/ eis-maxima-data.tar.bz2 takes 42M, so I'm sure it should be distributed as a separate package. Example: ----------------------------------------------------------------- (%i1) load ("/usr/share/eis-maxima/eis.lisp")$ (%i2) eis_search (1, 2, 3, 4, 6, 9); (%o2) [A000792, A000930, A001115, A001521, A001935, A003143, A005428, A007210, A007604, A013950, A014851, A016028, A017823, A017824, A017825, A017826, A017982, A017983, A018130, A018140, A018256, A018287, A018393, A018431, A018471, A018550, A018591, A018669, A018752, A022159, A022161, A022859, A022860, A022875, A022956, A026437, A027338, A027594, A027751, A033069, A035312, A035947, A035952, A035958, A035965, A035973, A035982, A035992, A036003, A036561, A039865, A039884, A046097, A047419, A048249, A051404, A056230, A056751, A057285, A057287, A058355, A060729, A061481, A062121, A062437, A064174, A068921, A069907, A073576, A073941, A076968, A078012, A078529, A078620, A078932, A081237, A081419, A081454, A081532, A082976, A083197, A089797, A094054, A094995, A096824, A097557, A098578, A098889, A099558, A101626, A103481, A105781, A108858, A111251, A111791, A111792, A112868, A113197, A113199, A117791, A119919, A121653, A123648, A126011, A127604, A128166, A128399, A129632, A130899, A131338, A132134, A132600, A135205, A135851, A136423, A136561, A138029, A138857, A138881, A139040, A139076, A139077, A141396, A143951, A144429, A145733] (%i3) eis_name (A018591)$ A018591 - Divisors of 684. (%i4) eis_search_name (1, 2, 3, 4, 6, 9, 8)$ A036561 - Triangle of numbers in which i-th row is {2^(i-j)*3^j, 0<=j<=i}; i >= 0. A082976 - Erroneous version of A036561. A119919 - Table read by antidiagonals: number of rationals in [0, 1) having at most n preperiodic bits, then at most k periodic bits (read up antidiagonals). (%i5) eis_details (A124136)$ A124136 - a(n) is the smallest prime when larger number of primes arise between numbers and their doubles. Note for example that there are 8 primes between 34 and 2*34=68 and 35 and 2*35=70, but 34 and 35 are not primes and a(8)=37, which is the smallest prime where there are already nine primes between numbers 36, 37, 38, 39, 41, 43, 44, 47, 48 and their doubles. UNSIGNED TERMS 2, 7, 11, 17, 23, 29, 31, 37, 53, 59, 71, 79, 89, 97, 101, 127, 137, 149, 157, 179, 191, 211, 223, 233, 251, 257, 263, 293, 307, 311, 331, 347, 367, 373, 379, 389, 409, 419, 431, 443, 457, 479, 487, 499, 521, 541, 547, 557, 563, 587, 599, 613, 617, 631, 641 OFFSET 1, 1 EXAMPLES a(2)=7 since 7 is first prime when two primes are between 7 and its double. a(10)=59 since 59 is first prime after 55 and 56 when ten primes are between these numbers and their doubles. MAPLE PROGRAM ts_c:=proc(n) local i,j,st_p,max_stp,ans; ans:= [ ]: st_p:=0: max_stp:=0: for i from 2 to n do for j from i+1 to 2*i-1 do if (isprime(j) = 'true') then st_p:=st_p+1: fi od: if (st_p > max_stp and isprime(i) = 'true') then max_stp := st_p: ans:=[ op(ans),i ]: fi; st_p:=0: od: RETURN(ans) end: ts_c(1200); CROSS-REFERENCES Cf. A060756, A060715, A084139. Adjacent sequences: A124133 A124134 A124135 this_sequence A124137 A124138 A124139 Sequence in context: A090613 A063097 A038942 this_sequence A019385 A075552 A124854 COMMENTS a(n) is the index of first occurrence of prime n in A060715. KEYWORDS nonn, uned AUTHOR Jani Melik (jani_melik(AT)hotmail.com), Nov 30 2006 ----------------------------------------------------------------- -- Setting Orange, Chaos 25 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From robert.dodier at gmail.com Sun Jan 25 15:57:18 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 25 Jan 2009 14:57:18 -0700 Subject: [Maxima] default value of *MAXIMA-OBJDIR* In-Reply-To: <497BDD7C.10909@gmail.com> References: <497BDD7C.10909@gmail.com> Message-ID: On 1/24/09, Raymond Toy wrote: > Either is fine with me. I'll need to rework slightly minpack.system > and lapack.system which are currently putting the results > in*maxima-objdir*/share/minpack/binary-foo. With teither option, I > guess that would be *maxima-objdir*/minpack. Works for me. > > Also, I'm wondering if maxima-local should set MAXIMA_OBJDIR to be > somewhere in the source tree. For someone that has both an installed > release and a CVS version, it's probably not a good idea to destroy the > fasls in *maxima-objdir* built with the release with new stuff from CVS. I've committed changes to src/init-cl.lisp, maxima-local.in, and the share *.system files which refer to *MAXIMA-OBJDIR* (there are some which don't, I didn't touch them). Here's the log message: Adjust *MAXIMA-OBJDIR* and modify *.system files in share accordingly. (1) When environment variable MAXIMA_OBJDIR is set, let *MAXIMA-OBJDIR* = $MAXIMA_OBJDIR/binary-foolisp. Shell script maxima-local sets MAXIMA_OBJDIR to $top_srcdir/binary. (2) When MAXIMA_OBJDIR is not set, let *MAXIMA-OBJDIR* = *MAXIMA-USERDIR*/binary/binary-foolisp. Hope this helps. I wouldn't be surprised if we need to tweak it again, but I hope this is a step in the right direction. Robert Dodier From al at beshenov.ru Sun Jan 25 18:54:44 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Mon, 26 Jan 2009 00:54:44 -0000 Subject: [Maxima] Problems with the online manual Message-ID: <200901260054.n0Q0shxA010038@ibm3.ma.utexas.edu> The online manual at http://maxima.sourceforge.net/docs/manual/en/ does not contain images. I can see them in /home/groups/m/ma/maxima/htdocs/docs/manual/en/figures/, but web server returns 403. (For example, try http://maxima.sourceforge.net/docs/manual/en/figures/graphs01.gif) Could anyone set the proper permissions? -- Setting Orange (Mungoday), Chaos 5 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From andre.maute at gmx.de Mon Jan 26 04:07:36 2009 From: andre.maute at gmx.de (andre maute) Date: Mon, 26 Jan 2009 11:07:36 +0100 Subject: [Maxima] sloane's integer sequences and maxima In-Reply-To: <200901252245.55138.al@beshenov.ru> References: <200809081006.42671.andre.maute@gmx.de> <200901252245.55138.al@beshenov.ru> Message-ID: <200901261107.36810.andre.maute@gmx.de> Cool, thank you very much :-) yeah, an additional x-mas present Andre On Sunday 25 January 2009, Alexey Beshenov wrote: > On Monday 08 September 2008 12:06:42 andre maute wrote: > > wouldn't it be nice to optionally ship a version > > of sloane's integer sequences with maxima? > > Here is my interface for EIS: http://beshenov.ru/maxima/eis/ > > eis-maxima-data.tar.bz2 takes 42M, so I'm sure it should be > distributed as a separate package. > > Example: > ----------------------------------------------------------------- > > (%i1) load ("/usr/share/eis-maxima/eis.lisp")$ > > (%i2) eis_search (1, 2, 3, 4, 6, 9); > (%o2) [A000792, A000930, A001115, A001521, A001935, A003143, > A005428, A007210, A007604, A013950, A014851, A016028, A017823, > A017824, A017825, A017826, A017982, A017983, A018130, A018140, > A018256, A018287, A018393, A018431, A018471, A018550, A018591, > A018669, A018752, A022159, A022161, A022859, A022860, A022875, > A022956, A026437, A027338, A027594, A027751, A033069, A035312, > A035947, A035952, A035958, A035965, A035973, A035982, A035992, > A036003, A036561, A039865, A039884, A046097, A047419, A048249, > A051404, A056230, A056751, A057285, A057287, A058355, A060729, > A061481, A062121, A062437, A064174, A068921, A069907, A073576, > A073941, A076968, A078012, A078529, A078620, A078932, A081237, > A081419, A081454, A081532, A082976, A083197, A089797, A094054, > A094995, A096824, A097557, A098578, A098889, A099558, A101626, > A103481, A105781, A108858, A111251, A111791, A111792, A112868, > A113197, A113199, A117791, A119919, A121653, A123648, A126011, > A127604, A128166, A128399, A129632, A130899, A131338, A132134, > A132600, A135205, A135851, A136423, A136561, A138029, A138857, > A138881, A139040, A139076, A139077, A141396, A143951, A144429, > A145733] > > (%i3) eis_name (A018591)$ > A018591 - Divisors of 684. > > (%i4) eis_search_name (1, 2, 3, 4, 6, 9, 8)$ > A036561 - Triangle of numbers in which i-th row is > {2^(i-j)*3^j, 0<=j<=i}; i >= 0. > > A082976 - Erroneous version of A036561. > > A119919 - Table read by antidiagonals: number of rationals in > [0, 1) having at most n preperiodic bits, then at > most k periodic bits (read up antidiagonals). > > (%i5) eis_details (A124136)$ > > A124136 - a(n) is the smallest prime when larger number of primes > arise between numbers and their doubles. Note for > example that there are 8 primes between 34 and 2*34=68 > and 35 and 2*35=70, but 34 and 35 are not primes and > a(8)=37, which is the smallest prime where there are > already nine primes between numbers 36, 37, 38, 39, 41, > 43, 44, 47, 48 and their doubles. > > UNSIGNED TERMS > 2, 7, 11, 17, 23, 29, 31, 37, 53, 59, 71, 79, 89, 97, 101, 127, > 137, 149, 157, 179, 191, 211, 223, 233, 251, 257, 263, 293, 307, > 311, 331, 347, 367, 373, 379, 389, 409, 419, 431, 443, 457, 479, > 487, 499, 521, 541, 547, 557, 563, 587, 599, 613, 617, 631, 641 > > OFFSET > 1, 1 > > EXAMPLES > a(2)=7 since 7 is first prime when two primes are between 7 and > its double. > a(10)=59 since 59 is first prime after 55 and 56 when ten > primes are between these numbers and their doubles. > > MAPLE PROGRAM > ts_c:=proc(n) local i,j,st_p,max_stp,ans; ans:= [ ]: st_p:=0: > max_stp:=0: for i from 2 to n do for j from i+1 to 2*i-1 do if > (isprime(j) = 'true') then st_p:=st_p+1: fi od: if (st_p > > max_stp and isprime(i) = 'true') then max_stp := st_p: ans:=[ > op(ans),i ]: fi; st_p:=0: od: RETURN(ans) end: ts_c(1200); > > CROSS-REFERENCES > Cf. A060756, A060715, A084139. > Adjacent sequences: A124133 A124134 A124135 this_sequence > A124137 A124138 A124139 > Sequence in context: A090613 A063097 A038942 this_sequence > A019385 A075552 A124854 > > COMMENTS > a(n) is the index of first occurrence of prime n in A060715. > > KEYWORDS > nonn, uned > > AUTHOR > Jani Melik (jani_melik(AT)hotmail.com), Nov 30 2006 > ----------------------------------------------------------------- From biomates at telefonica.net Mon Jan 26 04:53:24 2009 From: biomates at telefonica.net (Mario Rodriguez) Date: Mon, 26 Jan 2009 11:53:24 +0100 Subject: [Maxima] Problems with the online manual In-Reply-To: <200901260054.n0Q0shxA010038@ibm3.ma.utexas.edu> References: <200901260054.n0Q0shxA010038@ibm3.ma.utexas.edu> Message-ID: <1232967204.5868.23.camel@pc> El mar, 06-01-2009 a las 02:18 +0300, Alexey Beshenov escribi?: > The online manual at http://maxima.sourceforge.net/docs/manual/en/ > does not contain images. I can see them in > /home/groups/m/ma/maxima/htdocs/docs/manual/en/figures/, but web > server returns 403. > > (For example, try > http://maxima.sourceforge.net/docs/manual/en/figures/graphs01.gif) > > Could anyone set the proper permissions? > Hello, Permissions are 664, they should be enough for reading them. In fact, the Spanish manual shows images without problems and both manuals take figures from the same folder. Hyperlinks in the Spanish manual point directly to docs/manual/figures, but in the case of the English manual they point to link docs/manual/en/figures. I don't know if I'm missing something here. -- Mario From talon at lpthe.jussieu.fr Sat Jan 24 17:02:03 2009 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Sun, 25 Jan 2009 00:02:03 +0100 Subject: [Maxima] Proposal for location of fasls In-Reply-To: <7775b21a0901240139t3981c8au68a49811e3acb662@mail.gmail.com> References: <4976557F.806@gmail.com> <874ozsr55c.fsf@inbox.ru> <7775b21a0901240139t3981c8au68a49811e3acb662@mail.gmail.com> Message-ID: <20090124230203.GA24574@lpthe.jussieu.fr> On Sat, Jan 24, 2009 at 10:39:03AM +0100, Andrej Vodopivec wrote: > > /* A tough example learned from Cox */ > > poly_grobner([x^5+y^4+z^3-1,x^3+y^3+z^2-1], [x,y,z]); > > > > takes 1mn30s > > You should compile the grobner package if you wish to compare it to > the compiled affine package. Indeed, you are completely right: on the same machine, with grobner.x86f (%i4) poly_monomial_order: grlex; Evaluation took 0.0000 seconds (0.0000 elapsed) using 32 bytes. (%o4) grlex (%i5) poly_reduced_grobner([x^5+y^4+z^3-1,x^3+y^3+z^2-1], [x,y,z])$ Evaluation took 0.0000 seconds (0.0000 elapsed) using 111.523 KB. (%i6) poly_monomial_order: lex; Evaluation took 0.0000 seconds (0.0000 elapsed) using 8 bytes. (%o6) lex (%i7) poly_reduced_grobner([x^5+y^4+z^3-1,x^3+y^3+z^2-1], [x,y,z])$ Evaluation took 2.4200 seconds (2.4200 elapsed) using 142.060 MB. and with affine: (%i8) grobner_basis([x^5+y^4+z^3-1,x^3+y^3+z^2-1])$ .... Evaluation took 0.1700 seconds (0.1700 elapsed) using 8.723 MB. So with compiled grobner package, maxima is faster than maple using the same type of ordering (total degree, and then lexical), since maple uses around 1.5 s. I must say that compiling is incredibly efficient here, since uncompiled package takes 1mn30s. As a practical conclusion, i think maxima would appear in a better light if the install procedure systematically compiled such packages which are widely used by people doing heavy formal computations. I have colleagues involved in such work who complained that maxima is too slow, idem for mathematica, so are using maple or specialized faster software. As a workaround the documentation should mention to compile such packages, and to do it as root once because of permission problems. -- Michel TALON From raymond.toy at ericsson.com Mon Jan 26 10:15:59 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 26 Jan 2009 11:15:59 -0500 Subject: [Maxima] ECL? was ..Re: Runtime determination of share directories? In-Reply-To: (Paul Zimmermann's message of "Sat, 24 Jan 2009 10:34:13 +0100") References: Message-ID: >>>>> "Paul" == Paul Zimmermann writes: Paul> Ray, Paul> [it's quite an interesting discussion for me] Paul> I'm not sure, but I think there will always be corner cases where you Paul> will get incorrect results on an x87. It's unavoidable due to the Paul> 80-bit registers. Even if you set the rounding and precision modes Paul> correctly. I think the cases are when a number would underflow to 0 if Paul> you had 64-bit doubles but doesn't when you have 80-bit long floats. Paul> please can you give an example? I thought quaddouble was using algorithms Paul> like TwoSum of TwoProduct which guarantee exact operations, without guard Paul> bits. I don't have an example. I was just thinking of the case of underflow, and how it could potentially cause quaddouble to produce a result that was off by one bit because the underflow to zero didn't happen due to the large exponent range. I'll have to think about it some more and try some experiments. One annoyance I do have with quaddouble is that products overflow too soon because of the way TwoProduct splits the number. But this is now getting *way* off-topic for Maxima.... Ray From robert.dodier at gmail.com Mon Jan 26 11:57:32 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 26 Jan 2009 10:57:32 -0700 Subject: [Maxima] sloane's integer sequences and maxima In-Reply-To: <200901252245.55138.al@beshenov.ru> References: <200809081006.42671.andre.maute@gmx.de> <200901252245.55138.al@beshenov.ru> Message-ID: On Sun, Jan 25, 2009 at 12:45 PM, Alexey Beshenov wrote: > Here is my interface for EIS: http://beshenov.ru/maxima/eis/ > > eis-maxima-data.tar.bz2 takes 42M, so I'm sure it should be > distributed as a separate package. Hey, that's awesome. Thanks a lot for working on it. I think it should be linked from somewhere in the Maxima web site. Maybe on the "related projects" page --- perhaps in a new section for add-on packages (I think the EIS package doesn't really fit under any of the existing headings). best Robert Dodier From al at beshenov.ru Mon Jan 26 14:39:30 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Mon, 26 Jan 2009 23:39:30 +0300 Subject: [Maxima] sloane's integer sequences and maxima In-Reply-To: <200901252245.55138.al@beshenov.ru> References: <200809081006.42671.andre.maute@gmx.de> <200901252245.55138.al@beshenov.ru> Message-ID: <200901262339.31029.al@beshenov.ru> On Sunday 25 January 2009 22:45:54 Alexey Beshenov wrote: > Here is my interface for EIS: http://beshenov.ru/maxima/eis/ > > eis-maxima-data.tar.bz2 takes 42M, so I'm sure it should be > distributed as a separate package I'm sorry for confusion. The code was uploaded only for testing purposes and distributing the OEIS data was just an improbable idea. I have some private software for getting an offline snapshot from the official OEIS website, but for now I have to remove any related stuff from my webpage due to legal issues. -- Sweetmorn, Chaos 26 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From O.Kullmann at swansea.ac.uk Mon Jan 26 14:48:36 2009 From: O.Kullmann at swansea.ac.uk (Oliver Kullmann) Date: Mon, 26 Jan 2009 20:48:36 +0000 Subject: [Maxima] sloane's integer sequences and maxima In-Reply-To: <200901252245.55138.al@beshenov.ru> References: <200809081006.42671.andre.maute@gmx.de> <200901252245.55138.al@beshenov.ru> Message-ID: <20090126204836.GX6683@cs-wsok.swansea.ac.uk> Hi, that's great!! It would be good if on some Maxima page information on updates of this package would be available. Why not having a "big Maxima package", which includes the data? (Still quite a bit smaller than e.g., Axiom or Sage.) Oliver On Sun, Jan 25, 2009 at 10:45:54PM +0300, Alexey Beshenov wrote: > On Monday 08 September 2008 12:06:42 andre maute wrote: > > wouldn't it be nice to optionally ship a version > > of sloane's integer sequences with maxima? > > Here is my interface for EIS: http://beshenov.ru/maxima/eis/ > > eis-maxima-data.tar.bz2 takes 42M, so I'm sure it should be > distributed as a separate package. > > Example: > ----------------------------------------------------------------- > > (%i1) load ("/usr/share/eis-maxima/eis.lisp")$ > > (%i2) eis_search (1, 2, 3, 4, 6, 9); > (%o2) [A000792, A000930, A001115, A001521, A001935, A003143, > A005428, A007210, A007604, A013950, A014851, A016028, A017823, > A017824, A017825, A017826, A017982, A017983, A018130, A018140, > A018256, A018287, A018393, A018431, A018471, A018550, A018591, > A018669, A018752, A022159, A022161, A022859, A022860, A022875, > A022956, A026437, A027338, A027594, A027751, A033069, A035312, > A035947, A035952, A035958, A035965, A035973, A035982, A035992, > A036003, A036561, A039865, A039884, A046097, A047419, A048249, > A051404, A056230, A056751, A057285, A057287, A058355, A060729, > A061481, A062121, A062437, A064174, A068921, A069907, A073576, > A073941, A076968, A078012, A078529, A078620, A078932, A081237, > A081419, A081454, A081532, A082976, A083197, A089797, A094054, > A094995, A096824, A097557, A098578, A098889, A099558, A101626, > A103481, A105781, A108858, A111251, A111791, A111792, A112868, > A113197, A113199, A117791, A119919, A121653, A123648, A126011, > A127604, A128166, A128399, A129632, A130899, A131338, A132134, > A132600, A135205, A135851, A136423, A136561, A138029, A138857, > A138881, A139040, A139076, A139077, A141396, A143951, A144429, > A145733] > > (%i3) eis_name (A018591)$ > A018591 - Divisors of 684. > > (%i4) eis_search_name (1, 2, 3, 4, 6, 9, 8)$ > A036561 - Triangle of numbers in which i-th row is > {2^(i-j)*3^j, 0<=j<=i}; i >= 0. > > A082976 - Erroneous version of A036561. > > A119919 - Table read by antidiagonals: number of rationals in > [0, 1) having at most n preperiodic bits, then at > most k periodic bits (read up antidiagonals). > > (%i5) eis_details (A124136)$ > > A124136 - a(n) is the smallest prime when larger number of primes > arise between numbers and their doubles. Note for > example that there are 8 primes between 34 and 2*34=68 > and 35 and 2*35=70, but 34 and 35 are not primes and > a(8)=37, which is the smallest prime where there are > already nine primes between numbers 36, 37, 38, 39, 41, > 43, 44, 47, 48 and their doubles. > > UNSIGNED TERMS > 2, 7, 11, 17, 23, 29, 31, 37, 53, 59, 71, 79, 89, 97, 101, 127, > 137, 149, 157, 179, 191, 211, 223, 233, 251, 257, 263, 293, 307, > 311, 331, 347, 367, 373, 379, 389, 409, 419, 431, 443, 457, 479, > 487, 499, 521, 541, 547, 557, 563, 587, 599, 613, 617, 631, 641 > > OFFSET > 1, 1 > > EXAMPLES > a(2)=7 since 7 is first prime when two primes are between 7 and > its double. > a(10)=59 since 59 is first prime after 55 and 56 when ten > primes are between these numbers and their doubles. > > MAPLE PROGRAM > ts_c:=proc(n) local i,j,st_p,max_stp,ans; ans:= [ ]: st_p:=0: > max_stp:=0: for i from 2 to n do for j from i+1 to 2*i-1 do if > (isprime(j) = 'true') then st_p:=st_p+1: fi od: if (st_p > > max_stp and isprime(i) = 'true') then max_stp := st_p: ans:=[ > op(ans),i ]: fi; st_p:=0: od: RETURN(ans) end: ts_c(1200); > > CROSS-REFERENCES > Cf. A060756, A060715, A084139. > Adjacent sequences: A124133 A124134 A124135 this_sequence > A124137 A124138 A124139 > Sequence in context: A090613 A063097 A038942 this_sequence > A019385 A075552 A124854 > > COMMENTS > a(n) is the index of first occurrence of prime n in A060715. > > KEYWORDS > nonn, uned > > AUTHOR > Jani Melik (jani_melik(AT)hotmail.com), Nov 30 2006 > ----------------------------------------------------------------- > > -- > Setting Orange, Chaos 25 YOLD 3175 > Alexey Beshenov http://beshenov.ru/ > From al at beshenov.ru Mon Jan 26 15:07:26 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Tue, 27 Jan 2009 00:07:26 +0300 Subject: [Maxima] sloane's integer sequences and maxima In-Reply-To: <20090126204836.GX6683@cs-wsok.swansea.ac.uk> References: <200809081006.42671.andre.maute@gmx.de> <200901252245.55138.al@beshenov.ru> <20090126204836.GX6683@cs-wsok.swansea.ac.uk> Message-ID: <200901270007.26759.al@beshenov.ru> On Monday 26 January 2009 23:48:36 Oliver Kullmann wrote: > It would be good if on some Maxima page information on updates > of this package would be available. > Why not having a "big Maxima package", which includes > the data? (Still quite a bit smaller than e.g., Axiom > or Sage.) The OEIS data could be used only by permission of Neil Sloane. (And it is not copylefted, like Maxima.) For now, I have to remove my software. It was just unofficial and experimental stuff. -- Sweetmorn, Chaos 26 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From toy.raymond at gmail.com Mon Jan 26 21:25:18 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 26 Jan 2009 22:25:18 -0500 Subject: [Maxima] bfloat gamma problem Message-ID: <497E7E9E.3070309@gmail.com> Found this problem while playing with elliptic integrals an bigfloats: (%i1) display2d:false; (%o1) false (%i2) gamma(3/4)/gamma(1/4); (%o2) gamma(3/4)/gamma(1/4) (%i3) float(%); (%o3) .3379891200336423 (%i4) bfloat(%o2); (%o4) 4.125843750410604b-5 %o4 is WAY off. But, we have (%i5) bfloat(gamma(3/4)); (%o5) 1.2254167024651776452b0 (%i6) bfloat(gamma(1/4)); (%o6) 3.6256099082219083112b0 (%i7) %o5/%o6; (%o7) 3.379891200336424b-1 So something is messed with with the computation of the ratio. Ray From fateman at cs.berkeley.edu Mon Jan 26 22:55:01 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Mon, 26 Jan 2009 20:55:01 -0800 Subject: [Maxima] antid Message-ID: <497E93A5.8060301@cs.berkeley.edu> I just had occasion to look at the code for antid, which includes the locution (simplified, here) antid(..) := block( [ ..., killer, ...], ... killer(z) := ...., ....) Presumably the author thought he (or she) was defining a local function named killer. In fact, killer is just as global as any other function. It is defined the first time antid is called. And it is defined again each time antid is called. Probably the author should use "local". I would have preferred to send this note to the author but the author did not sign the file :( It would be nice if the author of this (as well as other contributions) were identified in the text. Also in this case it would be nice to explain somewhere why this program exists. I think it is because it can find the antiderivative (i.e. symbolic indefinite integral) of some expressions that are not currently handled by the built-in integrate command. I recommend that the manual and the demo provide such an explanation. RJf From David.Billinghurst at riotinto.com Mon Jan 26 23:18:28 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Tue, 27 Jan 2009 16:18:28 +1100 Subject: [Maxima] antid References: <497E93A5.8060301@cs.berkeley.edu> Message-ID: <026DCC31AB859648A6F16C0E5CD2580D0180AEA5@calttsv025.cal.riotinto.org> > From: Richard Fateman > > I just had occasion to look at the code for antid, which > includes the locution (simplified, here) > > antid(..) := block( [ ..., killer, ...], > ... > killer(z) := ...., > ....) > > Presumably the author thought he (or she) was defining a > local function named killer. In fact, killer is just as > global as any other function. > It is defined the first time antid is called. And it is > defined again each time antid is called. > > Probably the author should use "local". > > I would have preferred to send this note to the author but > the author did not sign the file :( > > It would be nice if the author of this (as well as other > contributions) were identified in the text. Also in this case > it would be nice to explain somewhere why this program > exists. I think it is because it can find the antiderivative > (i.e. symbolic indefinite integral) of some expressions that > are not currently handled by the built-in integrate command. > I recommend that the manual and the demo provide such an explanation. In the file archive/share/trash/antid.usg in the CVS repository we have: The file ANTID > contains a routine for evaluating integrals of expressions involving an arbitrary unspecified function and its derivatives. After BATCH'ing the file, it may be used by: ANTIDIFF(G,X,U(X)); where G is the expression involving U(X) (U(X) arbitrary) and its derivatives, whose integral with respect to X is desired. The batch file also defines the functions NONZEROANDFREEOF and LINEAR as well as ANTID. ANTID is the same as ANTIDIFF except that it returns a list of two parts, the first part is the integrated part of the expression and the second part of the list is the non- integrable remainder. A translated version of this file is available as SHARE2;ANTID LISP. It may be used by LOADFILE(ANTID,LISP,SHARE2). Send complaints to BNLGHC. This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. From willisb at unk.edu Tue Jan 27 06:46:49 2009 From: willisb at unk.edu (Barton Willis) Date: Tue, 27 Jan 2009 06:46:49 -0600 Subject: [Maxima] new topoly + to_poly_solver Message-ID: Late last month, I checked in a new version of topoly and to_poly_solver. Additionally, I contributed user documentation (share/contrib/topoly-user-doc.texi and share/contrib/topoly-user-doc.html). This morning, I appended the to_poly_solver test suite to the share testsuite. If you all have a chance, run the share_testsuite and let me know if rtest_to_poly_solve reports problems. To read a few of my thoughts about topoly and the to_poly_solver, do a web search on "nary a variety" (with the quotes), or http://www.unk.edu/uploadedFiles/facstaff/profiles/willisb/solve-talk (3).pdf A quick tour: (%i16) to_poly_solve(sin(x) = 1/2,x); (%o16) %union([x = 2*%pi*%z2153+%pi/6],[x = 2*%pi*%z2155+5*%pi/6]) (%i17) featurep(%z2153, integer); (%o17) true (%i18) to_poly_solve(max(x,4) = x,x); (%o18) %union(%if(isnonnegative_p(%c2159),[x = %c2159+4],%union())) /* apply rootscontract to each solution */ (%i19) to_poly_solve(sqrt(x) - x = sqrt(42) - 42,x, 'simpfuncs = ['rootscontract]); (%o19) %union([x = (-2*sqrt(42)+sqrt(169-4*sqrt(42))+85)/2]) (%i20) float(%); (%o20) %union([x = 42.0]) Barton From fateman at cs.berkeley.edu Tue Jan 27 09:34:28 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 27 Jan 2009 07:34:28 -0800 Subject: [Maxima] antid In-Reply-To: <026DCC31AB859648A6F16C0E5CD2580D0180AEA5@calttsv025.cal.riotinto.org> References: <497E93A5.8060301@cs.berkeley.edu> <026DCC31AB859648A6F16C0E5CD2580D0180AEA5@calttsv025.cal.riotinto.org> Message-ID: <497F2984.7010102@cs.berkeley.edu> Billinghurst, David (RTATECH) wrote: > .. > > Send complaints to BNLGHC. > does not seem to be a complete email address. :( Should documentation for a component that is included in the distribution and manual be in the archive/trash? Thanks for the info!! RJF From robert.dodier at gmail.com Tue Jan 27 09:40:44 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 27 Jan 2009 08:40:44 -0700 Subject: [Maxima] Failed test cases In-Reply-To: References: <2218b9af0901241137u4710ccc6ya4365f42de87a459@mail.gmail.com> Message-ID: On 1/25/09, Dieter Kaiser wrote: > I had the same problem with CLISP 2.44 on Ubuntu. The files rtest_integrate.mac > and rtest_integrate_special.mac were not installed correctly. I had to copy the > files by hand in the proper directory. I put rtest_integrate.mac and rtest_integrate_special.mac on the list of test scripts in tests/Makefile.am. Should be OK now. best Robert Dodier From willisb at unk.edu Tue Jan 27 09:48:51 2009 From: willisb at unk.edu (Barton Willis) Date: Tue, 27 Jan 2009 09:48:51 -0600 Subject: [Maxima] antid In-Reply-To: <497E93A5.8060301@cs.berkeley.edu> References: <497E93A5.8060301@cs.berkeley.edu> Message-ID: > maxima-bounces at math.utexas.edu > > I just had occasion to look at the code for antid, By the way, antidiff is pretty smart: (%i35) load("antid")$ (%i36) diff(f(x) * (f(x) + 1)^5,x)$ (%i37) factor(antidiff(%,x,f(x))); (%o37) f(x)*(f(x)+1)^5 (%i46) diff(f(x) * exp(x-x * diff(f(x),x) - x),x)$ (%i47) factor(antidiff(%,x,f(x))); (%o47) f(x)*%e^(-x*('diff(f(x),x,1))) Likely, the following bug might be due to code not in antid: (%i48) diff(f(x) * (f(x) + 1)^a,x)$ (%i49) antidiff(%,x,f(x)); Is a zero or nonzero?nonzero; Maxima encountered a Lisp error: Barton From robert.dodier at gmail.com Tue Jan 27 10:01:20 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 27 Jan 2009 09:01:20 -0700 Subject: [Maxima] antid In-Reply-To: References: <497E93A5.8060301@cs.berkeley.edu> Message-ID: On 1/27/09, Barton Willis wrote: > Likely, the following bug might be due to code not in antid: > > (%i48) diff(f(x) * (f(x) + 1)^a,x)$ > (%i49) antidiff(%,x,f(x)); > Is a zero or nonzero?nonzero; > Maxima encountered a Lisp error: That's a good one. Seems to get into an endless loop in the Risch code. Not 100% sure about that. Robert From drdieterkaiser at web.de Tue Jan 27 13:27:11 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 27 Jan 2009 20:27:11 +0100 Subject: [Maxima] Loading numeric.o don't work with GCL on Windows Message-ID: Hello Ray, after updating my sandbox and compiling it, I can not load numeric.o on my system with Windows and GCL 2.6.8. Compiling E:/maxima/cvs_maxima/maxima/src/numeric.lisp. End of Pass 1. End of Pass 2. OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3 Finished compiling binary-gcl/numeric.o. Loading binary-gcl/numeric.o Error in PCL::LOAD-DEFMETHOD [or a callee]: No class named: REAL. Fast links are on: do (use-fast-links nil) for debugging Broken at PCL::REAL-ADD-NAMED-METHOD. Type :H for Help. 1 (Continue) Retry loading file "binary-gcl/numeric.o". 2 (Abort) Return to top level. dbl:BIGFLOAT>> Dieter Kaiser From raymond.toy at ericsson.com Tue Jan 27 13:37:33 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Tue, 27 Jan 2009 14:37:33 -0500 Subject: [Maxima] Loading numeric.o don't work with GCL on Windows In-Reply-To: References: Message-ID: <497F627D.6070109@ericsson.com> Dieter Kaiser wrote: > Hello Ray, > > after updating my sandbox and compiling it, I can not load numeric.o on my > system with Windows and GCL 2.6.8. > > Compiling E:/maxima/cvs_maxima/maxima/src/numeric.lisp. > End of Pass 1. > End of Pass 2. > OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3 > Finished compiling binary-gcl/numeric.o. > Loading binary-gcl/numeric.o > Error in PCL::LOAD-DEFMETHOD [or a callee]: No class named: REAL. Dang. I forgot that gcl doesn't have a real class. I don't know why, and I wish I knew the magic to teach gcl that there is a real class. I'll fix this shortly. Ray From drdieterkaiser at web.de Tue Jan 27 15:28:49 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 27 Jan 2009 22:28:49 +0100 Subject: [Maxima] bfloat gamma problem In-Reply-To: <497E7E9E.3070309@gmail.com> References: <497E7E9E.3070309@gmail.com> Message-ID: <71ECA13744E9467EB563F307BD8A978C@Kaiser> Hello Ray, I had a look at the problem. The bug vanishes if I remove the 4 extra digits in the call to bffac in the routine simpgamma. Here again is the example with the 4 extra digits and some debugging info: That is the example with the wrong result. Simpgamma calculats two times the Gamma function in bigfloat precision. The results have extra digits but fpprec has after the call of bffac again the value 16. (%i2) bfloat(gamma(3/4)/gamma(1/4)); in GAMMA bigfloat-numerical for ((%GAMMA) ((BIGFLOAT SIMP 56) 36028797018963968 -1)) : result = ((BIGFLOAT SIMP 69) 535045584704600947817 2) : fpprec = 16 in GAMMA bigfloat-numerical for ((%GAMMA) ((BIGFLOAT SIMP 56) 54043195528445952 0)) : result = ((BIGFLOAT SIMP 69) 361679172704387465868 1) : fpprec = 16 (%o2) 4.125843750410604b-5 Here the correct calculation. At first the numerical values of the Gamma function are calculated in bigfloat precision and then divided. The results of simpgamma looks identically. (%i3) bfloat(gamma(3/4))/bfloat(gamma(1/4)); in GAMMA bigfloat-numerical for ((%GAMMA) ((BIGFLOAT SIMP 56) 54043195528445952 0)) : result = ((BIGFLOAT SIMP 69) 361679172704387465868 1) : fpprec = 16 in GAMMA bigfloat-numerical for ((%GAMMA) ((BIGFLOAT SIMP 56) 36028797018963968 -1)) : result = ((BIGFLOAT SIMP 69) 535045584704600947821 2) : fpprec = 16 (%o3) 3.379891200336424b-1 I have done the calculation without extra digits to bffac. Without extra digits the results of both calculations are correct. I have no idea what is wrong. Dieter Kaiser From Rolf.Schirmacher at MuellerBBM.de Tue Jan 27 15:41:26 2009 From: Rolf.Schirmacher at MuellerBBM.de (Schirmacher, Rolf) Date: Tue, 27 Jan 2009 22:41:26 +0100 Subject: [Maxima] Bessel function with imaginary argument Message-ID: <2417729F3416D511A27E0090273A963B02910C4F@smex01.mbbm.de> Hello, I get the following strange result for bessel_j(1,z) with purely imaginary argument: First, try numerical evaluation: (%i127) bessel_j(1,1.0*%i); (%o127) 0.56515910399249*%i (%i128) realpart(bessel_j(1,1.0*%i)); (%o128) 0 (%i130) imagpart(bessel_j(1,1.0*%i)); (%o130) 0.56515910399249 This looks fine. Now, if I want to get the realpart / imagpart symbolically, it is wired: (%i131) realpart(bessel_j(1,1*%i)); (%o131) bessel_j(1,%i) (%i132) imagpart(bessel_j(1,1*%i)); (%o132) 0 What am I doing wrong? I am using the pre-built Windows release: wxMaxima 0.8.1 http://wxmaxima.sourceforge.net Maxima 5.17.1 http://maxima.sourceforge.net Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. I am not an expert to maxima neither to lisp ... Any hint is highly appreciated. Thanks, Rolf From drdieterkaiser at web.de Tue Jan 27 16:29:04 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 27 Jan 2009 23:29:04 +0100 Subject: [Maxima] Bessel function with imaginary argument In-Reply-To: <2417729F3416D511A27E0090273A963B02910C4F@smex01.mbbm.de> References: <2417729F3416D511A27E0090273A963B02910C4F@smex01.mbbm.de> Message-ID: <1233095344.5420.15.camel@dieter-laptop> Am Dienstag, den 27.01.2009, 22:41 +0100 schrieb Schirmacher, Rolf: > Hello, > > I get the following strange result for bessel_j(1,z) with purely imaginary > argument: > > First, try numerical evaluation: > > (%i127) bessel_j(1,1.0*%i); > (%o127) 0.56515910399249*%i > (%i128) realpart(bessel_j(1,1.0*%i)); > (%o128) 0 > (%i130) imagpart(bessel_j(1,1.0*%i)); > (%o130) 0.56515910399249 > > This looks fine. Now, if I want to get the realpart / imagpart symbolically, > it is wired: > > (%i131) realpart(bessel_j(1,1*%i)); > (%o131) bessel_j(1,%i) > (%i132) imagpart(bessel_j(1,1*%i)); > (%o132) 0 > > What am I doing wrong? You are doing nothing wrong. At first Maxima does not evaluate the expression bessel_j(1,%i) numerically. Second, Maxima does not know that bessel_j(n,z) is a complex valued function. Every unknown function is assumed to be real valued. Therefore you get the "wrong" results for the unsimplified noun form of the expression bessel_j(1,%i). It is possible to declare the function to be complex. Then you get the following: (%i13) declare(bessel_j,complex); (%o13) done (%i14) realpart(bessel_j(1,%i)); (%o14) realpart(bessel_j(1, %i)) (%i15) imagpart(bessel_j(1,%i)); (%o15) imagpart(bessel_j(1, %i)) Maxima can not simplify realpart(bessel_j(1,%i)) to be zero. But the results are not wrong. If you introduce the number 1.0 Maxima does a numerical evaluation of the expression. The result is a complex number which can be handled by the Maxima functions realpart and imagpart: (%i16) realpart(bessel_j(1,1.0*%i)); (%o16) 0 (%i17) imagpart(bessel_j(1,1.0*%i)); (%o17) 0.565159103992485 The numerical evaluation is done too when using the flag numer: (%i18) realpart(bessel_j(1,%i)),numer; (%o18) 0 (%i19) imagpart(bessel_j(1,%i)),numer; (%o19) 0.565159103992485 It might be a good idea to give Maxima functions more known features like 'complex. The results might be unsimplified, but more correct. Dieter Kaiser From drdieterkaiser at web.de Tue Jan 27 16:31:51 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Tue, 27 Jan 2009 23:31:51 +0100 Subject: [Maxima] Loading numeric.o don't work with GCL on Windows In-Reply-To: <497F627D.6070109@ericsson.com> References: <497F627D.6070109@ericsson.com> Message-ID: <1233095511.5420.18.camel@dieter-laptop> Am Dienstag, den 27.01.2009, 14:37 -0500 schrieb Raymond Toy: > I'll fix this shortly. > Hello Ray, thank you. I have updated my sandbox and it works again. Dieter Kaiser From rich.hennessy at verizon.net Tue Jan 27 16:52:11 2009 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Tue, 27 Jan 2009 17:52:11 -0500 Subject: [Maxima] Bessel function with imaginary argument References: <2417729F3416D511A27E0090273A963B02910C4F@smex01.mbbm.de> Message-ID: Try this. realpart(bessel_j(1,1*%i)),numer; imagpart(bessel_j(1,1*%i)),numer; the numer flag tells Maxima to give the answer in floating point. The result you are getting symbolically is the exact answer which is, in the simplified form, itself. Rich ----- Original Message ----- From: "Schirmacher, Rolf" To: Sent: Tuesday, January 27, 2009 4:41 PM Subject: [Maxima] Bessel function with imaginary argument Hello, I get the following strange result for bessel_j(1,z) with purely imaginary argument: First, try numerical evaluation: (%i127) bessel_j(1,1.0*%i); (%o127) 0.56515910399249*%i (%i128) realpart(bessel_j(1,1.0*%i)); (%o128) 0 (%i130) imagpart(bessel_j(1,1.0*%i)); (%o130) 0.56515910399249 This looks fine. Now, if I want to get the realpart / imagpart symbolically, it is wired: (%i131) realpart(bessel_j(1,1*%i)); (%o131) bessel_j(1,%i) (%i132) imagpart(bessel_j(1,1*%i)); (%o132) 0 What am I doing wrong? I am using the pre-built Windows release: wxMaxima 0.8.1 http://wxmaxima.sourceforge.net Maxima 5.17.1 http://maxima.sourceforge.net Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. I am not an expert to maxima neither to lisp ... Any hint is highly appreciated. Thanks, Rolf _______________________________________________ Maxima mailing list Maxima at math.utexas.edu http://www.math.utexas.edu/mailman/listinfo/maxima From drdieterkaiser at web.de Tue Jan 27 17:25:49 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Wed, 28 Jan 2009 00:25:49 +0100 Subject: [Maxima] float(zeta(3)) does not evaluate numerically Message-ID: <1233098750.5420.39.camel@dieter-laptop> Alexey has recognized that sign(zeta(x)) does not give the expected answers when x is a numerical value e. g. sign(zeta(3)) --> 'pnz and not 'pos as expected. (But sign(zeta(3.0)) --> 'pos.) The reason is that float(zeta(3)) does not evaluate numerically, but returns float(zeta(3)) --> zeta(3.0). This is because the function zeta() is a "pure" verb function. There is no simplifying function implemented. I do not know any reason why the zeta() function is not implemented as a simplifying function. But if we would change the implementation to a simplifying function perhaps we will get the desired and much more functionality. Dieter Kaiser From ferriste at gmail.com Tue Jan 27 17:30:23 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Wed, 28 Jan 2009 00:30:23 +0100 Subject: [Maxima] Bugs and strange behaviours of Maxima with ratmx and sparse set to true Message-ID: <497F990F.9020209@gmail.com> I am working with a linear system with a big sparse matrix (K) of coefficients, and I need to solve a system like this Ku = f with respect to u, so I write u : K^^-1 . f I don't use invert(K) because, in general, it is much slower than ^^-1. But, because I have to deal with matrices being of high order, also ^^-1 is very very slow. But fortunately these are sparse matrices, so I thought it could be useful to set ratmx:true; sparse:true; to use the special algorithm to compute the determinant, therefore performing the inverse with invert() could be faster, because it computes the determinants of the minors ok K. But with ratmx and sparse set to true, determinant no longer works: (%i5) determinant(K); Maxima encountered a Lisp error: FUNCALL: undefined function TMLATTICE Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. obviously, using invert, which calls determinant, the error is the same. Only matrices of order greater or equal to 3 produce the error on invert, and the ones of order greater or equal to 2 produce the error on determinant. This is the bug, now comes a strange behaviour related to ratmx and sparse as well. I said I am trying to compute the inverse of a big sparse matrix, called K. With the default values of sparse and ratmx (false), the computation of K^^-1 take a very very long time. If one sets: (%i7) sparse:true; (%o7) true (%i8) ratmx:true; (%o8) true the computation of K^^-1 is still very long. But if I do: (%i10) kill(all) (%o0) done (%i1) K : matrix(....); (%o1).... (%i2) K^^-1; sparse and ratmx are not affected by kill(all), but now the computation of K^^-1 takes only few seconds. Why? Is ^^-1 also somehow affected by the values of sparse and ratmx? Therefore, to speed up the computation, in my program I started the .mac file with these lines: sparse:true; ratmx:true; kill(all); and it works perfectly. There is nothing to kill at the beginning but it works... But could someone explain me why I have to do a kill(all) do get all tehe things working? If you want to try, here it is the 42x42 sparse matrix I used: K : matrix([1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0], [0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0], [0,0,4*E*I/l,0,0,0,3*sqrt(3)*E*I/l^2,-3*E*I/l^2,2*E*I/l,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,(A*E+bk*l)/l,0,0,0,0,0,0,0,0,0,0,0,-A*E/l,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,(12*E*I+bk*l^3)/l^3,6*E*I/l^2,0,0,0,0,0,0,0,0,0,0, -12*E*I/l^3,6*E*I/l^2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0], [0,0,0,0,6*E*I/l^2,4*E*I/l,0,0,0,0,0,0,0,0,0,0,-6*E*I/l^2, 2*E*I/l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,3*sqrt(3)*E*I/l^2,0,0,0, (12*sqrt(3)^2*E*I+l^2*A*E+4*bk*l^3)/(4*l^3), -(12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3),3*sqrt(3)*E*I/l^2,-bk, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0], [0,0,-3*E*I/l^2,0,0,0,-(12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3), (12*E*I+sqrt(3)^2*l^2*A*E+4*bk*l^3)/(4*l^3),-3*E*I/l^2,0,-bk,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,2*E*I/l,0,0,0,3*sqrt(3)*E*I/l^2,-3*E*I/l^2,4*E*I/l,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,-bk,0,0,(12*sqrt(3)^2*E*I+l^2*A*E+8*bk*l^3)/(4*l^3), (12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3),3*sqrt(3)*E*I/l^2,-bk, 0,0,0,0,0,-(12*sqrt(3)^2*E*I+l^2*A*E)/(4*l^3), -(12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3),3*sqrt(3)*E*I/l^2,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,-bk,0,(12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3), (12*E*I+sqrt(3)^2*l^2*A*E+8*bk*l^3)/(4*l^3),3*E*I/l^2,0,-bk,0,0, 0,0,-(12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3), -(12*E*I+sqrt(3)^2*l^2*A*E)/(4*l^3),3*E*I/l^2,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,3*sqrt(3)*E*I/l^2,3*E*I/l^2,4*E*I/l,0,0,0,0,0, 0,-3*sqrt(3)*E*I/l^2,-3*E*I/l^2,2*E*I/l,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,-bk,0,0,(A*E+bk*l)/l,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,-A*E/l,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,-bk,0,0,(12*E*I+bk*l^3)/l^3,6*E*I/l^2,0,0,0, 0,0,0,0,0,0,0,0,0,0,-12*E*I/l^3,6*E*I/l^2,0,0,0,0,0,0,0,0,0,0,0, 0], [0,0,0,0,0,0,0,0,0,0,0,0,0,6*E*I/l^2,4*E*I/l,0,0,0,0,0,0,0,0,0,0, 0,0,0,-6*E*I/l^2,2*E*I/l,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,-A*E/l,0,0,0,0,0,0,0,0,0,0,0,(A*E+bk*l)/l,0,0,-bk,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,-12*E*I/l^3,-6*E*I/l^2,0,0,0,0,0,0,0,0,0,0, (12*E*I+bk*l^3)/l^3,-6*E*I/l^2,0,-bk,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0], [0,0,0,0,6*E*I/l^2,2*E*I/l,0,0,0,0,0,0,0,0,0,0,-6*E*I/l^2, 4*E*I/l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,-(12*sqrt(3)^2*E*I+l^2*A*E)/(4*l^3), -(12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3),-3*sqrt(3)*E*I/l^2,0, 0,0,-bk,0,0,(12*sqrt(3)^2*E*I+l^2*A*E+8*bk*l^3)/(4*l^3), (12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3),-3*sqrt(3)*E*I/l^2,-bk, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,-(12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3), -(12*E*I+sqrt(3)^2*l^2*A*E)/(4*l^3),-3*E*I/l^2,0,0,0,0,-bk,0, (12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3), (12*E*I+sqrt(3)^2*l^2*A*E+8*bk*l^3)/(4*l^3),-3*E*I/l^2,0,-bk,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,3*sqrt(3)*E*I/l^2,3*E*I/l^2,2*E*I/l,0,0,0,0,0, 0,-3*sqrt(3)*E*I/l^2,-3*E*I/l^2,4*E*I/l,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-bk,0,0, (12*sqrt(3)^2*E*I+l^2*A*E+8*bk*l^3)/(4*l^3), -(12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3),-3*sqrt(3)*E*I/l^2, -bk,0,0,0,0,0,-(12*sqrt(3)^2*E*I+l^2*A*E)/(4*l^3), (12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3),-3*sqrt(3)*E*I/l^2,0,0, 0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-bk,0, -(12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3), (12*E*I+sqrt(3)^2*l^2*A*E+8*bk*l^3)/(4*l^3),3*E*I/l^2,0,-bk,0,0, 0,0,(12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3), -(12*E*I+sqrt(3)^2*l^2*A*E)/(4*l^3),3*E*I/l^2,0,0,0,0,0,0,0,0, 0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-3*sqrt(3)*E*I/l^2, 3*E*I/l^2,4*E*I/l,0,0,0,0,0,0,3*sqrt(3)*E*I/l^2,-3*E*I/l^2, 2*E*I/l,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-bk,0,0,(A*E+bk*l)/l, 0,0,0,0,0,0,0,0,0,0,0,-A*E/l,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-bk,0,0, (12*E*I+bk*l^3)/l^3,6*E*I/l^2,0,0,0,0,0,0,0,0,0,0,-12*E*I/l^3, 6*E*I/l^2,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6*E*I/l^2, 4*E*I/l,0,0,0,0,0,0,0,0,0,0,-6*E*I/l^2,2*E*I/l,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,-A*E/l,0,0,0,0,0,0,0,0,0,0,0,0,0,0, (A*E+bk*l)/l,0,0,-bk,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,-12*E*I/l^3,-6*E*I/l^2,0,0,0,0,0,0,0, 0,0,0,0,0,0,(12*E*I+bk*l^3)/l^3,-6*E*I/l^2,0,-bk,0,0,0,0,0,0,0, 0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,6*E*I/l^2,2*E*I/l,0,0,0,0,0,0,0,0,0,0, 0,0,0,-6*E*I/l^2,4*E*I/l,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -(12*sqrt(3)^2*E*I+l^2*A*E)/(4*l^3), (12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3),3*sqrt(3)*E*I/l^2,0,0, 0,-bk,0,0,(12*sqrt(3)^2*E*I+l^2*A*E+8*bk*l^3)/(4*l^3), -(12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3),3*sqrt(3)*E*I/l^2,-bk, 0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, (12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3), -(12*E*I+sqrt(3)^2*l^2*A*E)/(4*l^3),-3*E*I/l^2,0,0,0,0,-bk,0, -(12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3), (12*E*I+sqrt(3)^2*l^2*A*E+8*bk*l^3)/(4*l^3),-3*E*I/l^2,0,-bk,0, 0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-3*sqrt(3)*E*I/l^2, 3*E*I/l^2,2*E*I/l,0,0,0,0,0,0,3*sqrt(3)*E*I/l^2,-3*E*I/l^2, 4*E*I/l,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-bk, 0,0,(12*sqrt(3)^2*E*I+l^2*A*E+4*bk*l^3)/(4*l^3), (12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3),3*sqrt(3)*E*I/l^2,0,0, 0,0,0,3*sqrt(3)*E*I/l^2], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -bk,0,(12*sqrt(3)*E*I-sqrt(3)*l^2*A*E)/(4*l^3), (12*E*I+sqrt(3)^2*l^2*A*E+4*bk*l^3)/(4*l^3),3*E*I/l^2,0,0,0,0,0, 3*E*I/l^2], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3*sqrt(3)*E*I/l^2,3*E*I/l^2,4*E*I/l,0,0,0,0,0,2*E*I/l], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-A*E/l,0,0,0,0, 0,0,0,0,0,0,0,(A*E+bk*l)/l,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-12*E*I/l^3, -6*E*I/l^2,0,0,0,0,0,0,0,0,0,0,(12*E*I+bk*l^3)/l^3,-6*E*I/l^2,0, 0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6*E*I/l^2, 2*E*I/l,0,0,0,0,0,0,0,0,0,0,-6*E*I/l^2,4*E*I/l,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,1,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,1,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,3*sqrt(3)*E*I/l^2,3*E*I/l^2,2*E*I/l,0,0,0,0,0,4*E*I/l]); Stefano From al at beshenov.ru Tue Jan 27 17:44:30 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Wed, 28 Jan 2009 02:44:30 +0300 Subject: [Maxima] Bugs and strange behaviours of Maxima with ratmx and sparse set to true In-Reply-To: <497F990F.9020209@gmail.com> References: <497F990F.9020209@gmail.com> Message-ID: <200901280244.30525.al@beshenov.ru> On Wednesday 28 January 2009 02:30:23 Stefano Ferri wrote: > I am working with a linear system with a big sparse matrix (K) of > coefficients, and I need to solve a system like this > > Ku = f > > with respect to u, so I write > > u : K^^-1 . f I think it could be better to use something like fast_linsolve or linsolve_by_lu rather than inversion. -- Boomtime, Chaos 27 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From ferriste at gmail.com Tue Jan 27 18:01:50 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Wed, 28 Jan 2009 01:01:50 +0100 Subject: [Maxima] Bugs and strange behaviours of Maxima with ratmx and sparse set to true In-Reply-To: <200901280244.30525.al@beshenov.ru> References: <497F990F.9020209@gmail.com> <200901280244.30525.al@beshenov.ru> Message-ID: <497FA06E.2080109@gmail.com> > I think it could be better to use something like > fast_linsolve or linsolve_by_lu rather than inversion. > > Yes, maybe... but I need to keep all the things in a vector form, so inversion is (I think) the best way to do it. Anyway, this is not a problem, I've found the workaround to speed up the inversion of sparse matrices. The problem is the bug with determinant when sparse and ratmx are set to true, and the fact that I don't understand why inversion of sparse matrices is so much fast by doing a kill(all) before performing the inversion... I tryed to invert the 42x42 sparse matrix in the previous email without using the workaround, I stopped the computation after 5-10 minuts with a Ctrl-c, no results were displayed in that time... From toy.raymond at gmail.com Tue Jan 27 19:20:31 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 27 Jan 2009 20:20:31 -0500 Subject: [Maxima] bfloat gamma problem In-Reply-To: <71ECA13744E9467EB563F307BD8A978C@Kaiser> References: <497E7E9E.3070309@gmail.com> <71ECA13744E9467EB563F307BD8A978C@Kaiser> Message-ID: <497FB2DF.1050609@gmail.com> Dieter Kaiser wrote: > Hello Ray, > > I had a look at the problem. > > The bug vanishes if I remove the 4 extra digits in the call to bffac in the > routine simpgamma. > > Here again is the example with the 4 extra digits and some debugging info: > > That is the example with the wrong result. Simpgamma calculats two times the > Gamma function in bigfloat precision. The results have extra digits but fpprec > has after the call of bffac again the value 16. > > (%i2) bfloat(gamma(3/4)/gamma(1/4)); > > in GAMMA bigfloat-numerical for > ((%GAMMA) ((BIGFLOAT SIMP 56) 36028797018963968 -1)) > : result = ((BIGFLOAT SIMP 69) 535045584704600947817 2) > : fpprec = 16 > > in GAMMA bigfloat-numerical for > ((%GAMMA) ((BIGFLOAT SIMP 56) 54043195528445952 0)) > : result = ((BIGFLOAT SIMP 69) 361679172704387465868 1) > : fpprec = 16 > > (%o2) 4.125843750410604b-5 > > Here the correct calculation. At first the numerical values of the Gamma > function are calculated in bigfloat precision and then divided. The results of > simpgamma looks identically. > > (%i3) bfloat(gamma(3/4))/bfloat(gamma(1/4)); > > in GAMMA bigfloat-numerical for > ((%GAMMA) ((BIGFLOAT SIMP 56) 54043195528445952 0)) > : result = ((BIGFLOAT SIMP 69) 361679172704387465868 1) > : fpprec = 16 > > in GAMMA bigfloat-numerical for > ((%GAMMA) ((BIGFLOAT SIMP 56) 36028797018963968 -1)) > : result = ((BIGFLOAT SIMP 69) 535045584704600947821 2) > : fpprec = 16 > > (%o3) 3.379891200336424b-1 > > I have done the calculation without extra digits to bffac. Without extra digits > the results of both calculations are correct. > > Yes, I've come more or less to the same conclusion. Also, as an experiment, I added a call to fpround before simpgamma returns the bfloat result. This fixes the issue. Based on this, I think something somewhere is getting confused by the fact that gamma returns a bfloat with 69 bits instead of 56. I haven't tracked this down yet. But the path taken is somehow different between bfloat(gamma(3/4)/gamma(1/4)) and bfloat(gamma(3/4))/bfloat(gamma(1/4)), because, as you show, gamma returns the same bfloat in both cases. Ray From willisb at unk.edu Tue Jan 27 19:53:16 2009 From: willisb at unk.edu (Barton Willis) Date: Tue, 27 Jan 2009 19:53:16 -0600 Subject: [Maxima] Bugs and strange behaviours of Maxima with ratmx and sparse set to true In-Reply-To: <497FA06E.2080109@gmail.com> References: <497F990F.9020209@gmail.com> <200901280244.30525.al@beshenov.ru>, <497FA06E.2080109@gmail.com> Message-ID: -----maxima-bounces at math.utexas.edu wrote: ----- >> I think it could be better to use something like >> fast_linsolve or linsolve_by_lu rather than inversion. >Yes, maybe... but I need to keep all the things in a vector form, so >inversion is (I think) the best way to do it. Maybe you have already solved your problem; for what it is worth, I'd try something like: (%i19) algebraic : true$ (%i20) ratmx : true$ (%i21) KT : triangularize(K)$ Evaluation took 0.2900 seconds (0.2900 elapsed) (%i22) last(KT); (%o22) [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(5072270477230080*bk^17*l^67*A^7*E^21 +2028908190892032*bk^18*l^68*A^6*E^20)*I^14] (%i23) factor(last(%)); (%o23) 1014454095446016*bk^17*l^67*A^6*E^20*(5*A*E+2*bk*l)*I^14 Barton From toy.raymond at gmail.com Tue Jan 27 20:01:56 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 27 Jan 2009 21:01:56 -0500 Subject: [Maxima] bfloat gamma problem In-Reply-To: <71ECA13744E9467EB563F307BD8A978C@Kaiser> References: <497E7E9E.3070309@gmail.com> <71ECA13744E9467EB563F307BD8A978C@Kaiser> Message-ID: <497FBC94.9040607@gmail.com> Dieter Kaiser wrote: > I have done the calculation without extra digits to bffac. Without extra digits > the results of both calculations are correct. > > I have no idea what is wrong. > > Some additional information. I tracked down the issue to exptbigfloat and invertbigfloat. At one point, exptbigfloat is called to compute gamma(1/4)^(-1), where gamma(1/4) has already been converted to a bfloat. Then exptbigfloat calls invertbigfloat on gamma(1/4). This is fine, I think. But when invertbigfloat calls fpquotient, there is a problem. fpquotient is called: (FPQUOTIENT (36028797018963968 1) (535045584704600947821 2)) The first argument is 1b0, using fpprec=56 bits. The second arg is gamma(1/4), using 69 bits. But I'm pretty sure these fp functions assume all args are supposed to have the same precision. So, perhaps, the correct solution is to make simpgamma round the result from bffac to fpprec bits before returning. Ray From fateman at cs.berkeley.edu Tue Jan 27 23:41:03 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 27 Jan 2009 21:41:03 -0800 Subject: [Maxima] bfloat gamma problem In-Reply-To: <497FBC94.9040607@gmail.com> References: <497E7E9E.3070309@gmail.com> <71ECA13744E9467EB563F307BD8A978C@Kaiser> <497FBC94.9040607@gmail.com> Message-ID: <497FEFEF.5030700@cs.berkeley.edu> Raymond Toy wrote: > .... > But when invertbigfloat calls fpquotient, there is a > problem. fpquotient is called: > > (FPQUOTIENT (36028797018963968 1) (535045584704600947821 2)) > > > The first argument is 1b0, using fpprec=56 bits. The second arg is > gamma(1/4), using 69 bits. But I'm pretty sure these fp functions > assume all args are supposed to have the same precision. > yes, this would be a real problem if the two numbers are different precisions and the headers are missing. If you put the headers back, and did the division, e.g. ( ...divide.. ((bigfloat simp 56) 360..... 1) (bigfloat simp 69) 53..... 2)) then that would work. I don't know what the function needed for ..divide.. is. is there an mdiv or simpdiv or something like that? Otherwise (defun ..divide.. (a b)(simplifya (list '(mquotient) a b) t)) > So, perhaps, the correct solution is to make simpgamma round the result > from bffac to fpprec bits before returning. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From fateman at cs.berkeley.edu Wed Jan 28 00:17:35 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 27 Jan 2009 22:17:35 -0800 Subject: [Maxima] odd integration problem. Message-ID: <497FF87F.1070402@cs.berkeley.edu> integrate(2^x/sqrt(1+4^x), x); is not done. but integrate(radcan (2^x/sqrt(1+4^x)), x); works fine. why this is odd? the risch algorithm should be decomposing stuff using radcan. It has to notice that 4^x is 2 ^(2*x) , and is therefore related to 2^x. Macsyma has the same problem and the same fix. This problem was posed as something the new "Fricas" can do. RJF From robert.dodier at gmail.com Wed Jan 28 01:12:17 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 28 Jan 2009 00:12:17 -0700 Subject: [Maxima] Bugs and strange behaviours of Maxima with ratmx and sparse set to true In-Reply-To: <497F990F.9020209@gmail.com> References: <497F990F.9020209@gmail.com> Message-ID: On 1/27/09, Stefano Ferri wrote: > (%i5) determinant(K); > > Maxima encountered a Lisp error: > > FUNCALL: undefined function TMLATTICE Sorry, it's my fault. I removed the file which contained that function a few years ago in an effort to clean up the code ... I'll restore it. Robert Dodier From ferriste at gmail.com Wed Jan 28 03:32:03 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Wed, 28 Jan 2009 10:32:03 +0100 Subject: [Maxima] Bugs and strange behaviours of Maxima with ratmx and sparse set to true In-Reply-To: References: <497F990F.9020209@gmail.com> <200901280244.30525.al@beshenov.ru>, <497FA06E.2080109@gmail.com> Message-ID: <49802613.6030505@gmail.com> Robert Dodier ha scritto: > On 1/27/09, Stefano Ferri wrote: > > >> (%i5) determinant(K); >> >> Maxima encountered a Lisp error: >> >> FUNCALL: undefined function TMLATTICE >> > > Sorry, it's my fault. I removed the file which contained that function > a few years ago in an effort to clean up the code ... I'll restore it. > > Robert Dodier Ok ;-) > Maybe you have already solved your problem; for what it is worth, I'd try > something like: > > (%i19) algebraic : true$ > (%i20) ratmx : true$ > > (%i21) KT : triangularize(K)$ > Evaluation took 0.2900 seconds (0.2900 elapsed) > > (%i22) last(KT); > (%o22) > [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(5072270477230080*bk^17*l^67*A^7*E^21 > +2028908190892032*bk^18*l^68*A^6*E^20)*I^14] > > (%i23) factor(last(%)); > (%o23) 1014454095446016*bk^17*l^67*A^6*E^20*(5*A*E+2*bk*l)*I^14 > > > Barton > > Yes, maybe there are many ways to improve speed, but please forget I have to solve a system. I need to do it with inversion because unknows are identified only by their position in the column vector, I don' know if with other methods is possible to keep these positions... Anyway, computation times in my notebook are not so different: (%i2) K^^-1$ Evaluation took 3.3522 seconds (4.0273 elapsed) using 27.563 MB. (%i1) triangularize(K)$ Evaluation took 2.0681 seconds (2.5926 elapsed) using 13.593 MB. Forgotten? Ok :-) Thank you Barton for the idea of algebraic:true, I noticed that inversion of the given matrix K is not yet affected by the value of sparse. In fact, one only need to set algebraic:true; ratmx:true; kill(all); before all to speed up the inversion. This always works. There is a .mac file attached to this mail if somebody wants to try. I still don't understand why in the program I'm writing I don't need to set algebraic:true, but I need to set sparse:true. If in the .mac sample file attached one tryes to comment algebraic:true, and uncomment sparse:true, inversion is very long (I've never seen its end so far :-). In my program there is a main file, in wich I set the values of option variables, wich loads other files in wich K and K^^-1 are computed. In this way, setting ratmx and sparse to true works. Algebraic is still set to false at the end, there is nothing that chamges its value. In the attached prova4.mac one have to set algebraic to true to make K^^-1 working... Sorry for the confusion but I don't understand why sometimes sparse works, other times only algebraic works fine... Stefano -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: prova4.mac Url: http://www.math.utexas.edu/pipermail/maxima/attachments/20090128/54641a7a/attachment-0001.diff From Rolf.Schirmacher at MuellerBBM.de Wed Jan 28 04:03:54 2009 From: Rolf.Schirmacher at MuellerBBM.de (Schirmacher, Rolf) Date: Wed, 28 Jan 2009 11:03:54 +0100 Subject: [Maxima] Bessel function with imaginary argument Message-ID: <2417729F3416D511A27E0090273A963B02910C50@smex01.mbbm.de> Thanks for the fast and detailed reply. > -----Original Message----- > From: drdieterkaiser at web.de [mailto:drdieterkaiser at web.de] > Sent: Tuesday, January 27, 2009 11:29 PM > To: Schirmacher, Rolf > Cc: maxima at math.utexas.edu > Subject: Re: [Maxima] Bessel function with imaginary argument > > > Am Dienstag, den 27.01.2009, 22:41 +0100 schrieb Schirmacher, Rolf: > > Hello, > > > > I get the following strange result for bessel_j(1,z) with > purely imaginary > > argument: > > > > First, try numerical evaluation: > > > > (%i127) bessel_j(1,1.0*%i); > > (%o127) 0.56515910399249*%i > > (%i128) realpart(bessel_j(1,1.0*%i)); > > (%o128) 0 > > (%i130) imagpart(bessel_j(1,1.0*%i)); > > (%o130) 0.56515910399249 > > > > This looks fine. Now, if I want to get the realpart / > imagpart symbolically, > > it is wired: > > > > (%i131) realpart(bessel_j(1,1*%i)); > > (%o131) bessel_j(1,%i) > > (%i132) imagpart(bessel_j(1,1*%i)); > > (%o132) 0 > > > > What am I doing wrong? > > You are doing nothing wrong. At first Maxima does not evaluate the > expression bessel_j(1,%i) numerically. Second, Maxima does not know > that bessel_j(n,z) is a complex valued function. Every > unknown function > is assumed to be real valued. Therefore you get the "wrong" > results for > the unsimplified noun form of the expression bessel_j(1,%i). > > It is possible to declare the function to be complex. Then you get the > following: > > (%i13) declare(bessel_j,complex); > (%o13) done > (%i14) realpart(bessel_j(1,%i)); > (%o14) realpart(bessel_j(1, %i)) > (%i15) imagpart(bessel_j(1,%i)); > (%o15) imagpart(bessel_j(1, %i)) > > Maxima can not simplify realpart(bessel_j(1,%i)) to be zero. But the > results are not wrong. > Somehow, I get different results. With a freshly started Maxima session, I obtain (%i1) facts(bessel_j); (%o1) [] (%i2) realpart(bessel_j(1,%i)); (%o2) bessel_j(1,%i) (%i3) imagpart(bessel_j(1,%i)); (%o3) 0 (%i4) declare(bessel_j,complex); (%o4) done (%i5) facts(bessel_j); (%o5) [kind(bessel_j,complex)] (%i6) realpart(bessel_j(1,%i)); (%o6) bessel_j(1,%i) (%i7) imagpart(bessel_j(1,%i)); (%o7) 0 It does not depend on the previous usage of bessel_j: (%i1) declare (bessel_j, complex); (%o1) done (%i2) facts(bessel_j); (%o2) [kind(bessel_j,complex)] (%i3) realpart(bessel_j(1,%i)); (%o3) bessel_j(1,%i) (%i4) imagpart(bessel_j(1,%i)); (%o4) 0 Am I missing something? > If you introduce the number 1.0 Maxima does a numerical evaluation of > the expression. The result is a complex number which can be handled by > the Maxima functions realpart and imagpart: > > (%i16) realpart(bessel_j(1,1.0*%i)); > (%o16) 0 > (%i17) imagpart(bessel_j(1,1.0*%i)); > (%o17) 0.565159103992485 > > The numerical evaluation is done too when using the flag numer: > > (%i18) realpart(bessel_j(1,%i)),numer; > (%o18) 0 > (%i19) imagpart(bessel_j(1,%i)),numer; > (%o19) 0.565159103992485 > Unfortunately, my "real" application is not as simple as the example above. I am interested in the real / imaginary parts of some analytical expressions including of course variables. Fortunately, there is some knowledge about the domain of these variables. But for "mixed" expressions, the numerical evaluation trick seems to be ineffective, it ends up with the symbolic result: (%i1) declare(x,real); (%o1) done (%i2) imagpart(bessel_j(1,%i*x)); (%o2) 0 (%i3) imagpart(bessel_j(1,%i*x)),numer; (%o3) 0 (%i4) imagpart(bessel_j(1,%i)),numer; (%o4) 0.56515910399249 For my actual problem, all I need (at the moment, at least) is bessel_j(0,z) and bessel_j(1,z) for purely real and purely imaginary arguments z. Now, according to A&S 9.1.10, the series for bessel_j(0,z) contains only even powers of z, so it would be purely real for purely real or purely imaginary arguments. The series for bessel_j(1,z) contains an additional factor z, so it would be purely real for purely real z and purely imag for purely imag z. How to tell Maxima? > It might be a good idea to give Maxima functions more known features > like 'complex. The results might be unsimplified, but more correct. > I would highly appreciate this approach. I regard the risk of misleading results for "naive" users to be very high - everything seems to work fine but the results are wrong. Unsimplified results at least provide a clear warning on the limited capabilities. To add additional knowledge would be even more nice, but that is definitely a second step. Thanks Rolf Schirmacher From raymond.toy at ericsson.com Wed Jan 28 09:17:21 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Wed, 28 Jan 2009 10:17:21 -0500 Subject: [Maxima] bfloat gamma problem In-Reply-To: <497FEFEF.5030700@cs.berkeley.edu> References: <497E7E9E.3070309@gmail.com> <71ECA13744E9467EB563F307BD8A978C@Kaiser> <497FBC94.9040607@gmail.com> <497FEFEF.5030700@cs.berkeley.edu> Message-ID: <49807701.8070407@ericsson.com> Richard Fateman wrote: > Raymond Toy wrote: > >> .... >> > > >> But when invertbigfloat calls fpquotient, there is a >> problem. fpquotient is called: >> >> (FPQUOTIENT (36028797018963968 1) (535045584704600947821 2)) >> >> >> The first argument is 1b0, using fpprec=56 bits. The second arg is >> gamma(1/4), using 69 bits. But I'm pretty sure these fp functions >> assume all args are supposed to have the same precision. >> >> > > yes, this would be a real problem if the two numbers are different > precisions and the headers are missing. > If you put the headers back, and did the division, e.g. > ( ...divide.. ((bigfloat simp 56) 360..... 1) (bigfloat simp 69) > 53..... 2)) > > In this particular case, the bogus call comes from invertbigfloat. My proposed solution is to call bigfloatp on the argument to convert it to the correct precision. (I would never have suspected bigfloatp would actually convert the bigfloat!) This fixes the immediate problem. There may also be some issues in exptbigfloat, but I haven't looked at that yet. Ray From raymond.toy at ericsson.com Wed Jan 28 10:29:55 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Wed, 28 Jan 2009 11:29:55 -0500 Subject: [Maxima] bfloat elliptic integrals In-Reply-To: <501s2f$1nrjjbi@ironmaiden.mail.utexas.edu> References: <501s2f$1nrjjbi@ironmaiden.mail.utexas.edu> Message-ID: <49808803.70902@ericsson.com> Jim FitzSimons wrote: > > There is a patch in the latest bfloat elliptic integrals to get past > the sqrt error. > > Also included are the symmetric elliptic integrals. > > The Maxima source is attached. > > Regards, Jim FitzSimons > > > > > I know this is really, really late, but I've used your elliptbf3.mac from your website and added it to maxima. It's no longer in the Maxima language; I translated it to Lisp. I need to do some more testing, but the few things I've tried appear to work. I do have one question. In your code, you have bferrtol set to 1b-6. Why 1b-6? I've tried various values of fpprec, and it seems that the routines produce the correct values for all desired precisions. Ray From robert.dodier at gmail.com Wed Jan 28 11:14:41 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 28 Jan 2009 10:14:41 -0700 Subject: [Maxima] float(zeta(3)) does not evaluate numerically In-Reply-To: <1233098750.5420.39.camel@dieter-laptop> References: <1233098750.5420.39.camel@dieter-laptop> Message-ID: On Tue, Jan 27, 2009 at 4:25 PM, Dieter Kaiser wrote: > I do not know any reason why the zeta() function is not implemented as a > simplifying function. But if we would change the implementation to a > simplifying function perhaps we will get the desired and much more > functionality. OK by me. Robert From drdieterkaiser at web.de Wed Jan 28 17:24:31 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 29 Jan 2009 00:24:31 +0100 Subject: [Maxima] Bessel function with imaginary argument In-Reply-To: <2417729F3416D511A27E0090273A963B02910C50@smex01.mbbm.de> References: <2417729F3416D511A27E0090273A963B02910C50@smex01.mbbm.de> Message-ID: <1233185071.5407.27.camel@dieter-laptop> Am Mittwoch, den 28.01.2009, 11:03 +0100 schrieb Schirmacher, Rolf: > Somehow, I get different results. With a freshly started Maxima session, I > obtain > > (%i1) facts(bessel_j); > (%o1) [] > (%i2) realpart(bessel_j(1,%i)); > (%o2) bessel_j(1,%i) > (%i3) imagpart(bessel_j(1,%i)); > (%o3) 0 > (%i4) declare(bessel_j,complex); > (%o4) done > (%i5) facts(bessel_j); > (%o5) [kind(bessel_j,complex)] > (%i6) realpart(bessel_j(1,%i)); > (%o6) bessel_j(1,%i) > (%i7) imagpart(bessel_j(1,%i)); > (%o7) 0 In the past I have got a similar problem with a symbol declared to be complex. I think we have a bug. I got the problem with GCL on windows. At the moment I am working on a Linux system with CLISP and I have no problems. But even more interesting would be to implement more support for the complex characteristic of functions. I have done a implementation for the bessel_j function to show how it would work: (%i15) declare(n, integer, x,real, z,complex, j,imaginary); (%o15) done (%i16) realpart(bessel_j(n,x)); (%o16) bessel_j(n, x) (%i17) impagpart(bessel_j(n,x)); (%o17) impagpart(bessel_j(n, x)) (%i18) realpart(bessel_j(n,z)); (%o18) realpart(bessel_j(n, z)) (%i19) imagpart(bessel_j(n,z)); (%o19) imagpart(bessel_j(n, z)) (%i20) realpart(bessel_j(n,j)); (%o20) 0 (%i21) imagpart(bessel_j(n,j)); (%o21) bessel_j(n, j) (%i22) realpart(bessel_j(n,%i)); (%o22) 0 (%i23) imagpart(bessel_j(n,%i)); (%o23) bessel_j(n, %i) (%i24) realpart(bessel_j(n,2*%i)); (%o24) 0 (%i25) imagpart(bessel_j(n,2*%i)); (%o25) bessel_j(n, 2 %i) These are the results for your last example: (%i26) realpart(bessel_j(n,x*%i)); (%o26) 0 (%i27) imagpart(bessel_j(n,x*%i)); (%o27) bessel_j(n, %i x) That is the function risplit-bessel-j which is called from the routine risplit to give support for the realpart and imagpart of the bessel_j function. This can be generalized for every function. (defprop %bessel_j risplit-bessel-j risplit-function) (defun risplit-bessel-j (args) (let ((order (car args)) (arg (cadr args)) (sign-order ($csign (car args))) (sign-arg ($csign (cadr args)))) (cond ((or (member sign-order '($complex $imaginary)) (eq sign-arg '$complex)) (risplit-noun (list '(%bessel_j) order arg))) ((eq sign-arg '$imaginary) (cons 0 (list '(%bessel_j) order arg))) (t (cons (list '(%bessel_j) order arg) 0))))) This is the implemented call from risplit: ((setq func (get (mop l) 'risplit-function)) ;; A risplit-function on the property list (funcall func (margs l))) In addition I have added the feature 'complex for the bessel_j function. Perhaps, this is a first step to support more complex characteristics of functions which could be easy generalized to much more functions. Remark: I have used the new function $csign to get the complex characteristic of the order and argument. This works fine also for expressions as an order or an argument. Dieter Kaiser From David.Billinghurst at riotinto.com Wed Jan 28 17:38:34 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Thu, 29 Jan 2009 10:38:34 +1100 Subject: [Maxima] Bessel function with imaginary argument References: <2417729F3416D511A27E0090273A963B02910C50@smex01.mbbm.de> Message-ID: <026DCC31AB859648A6F16C0E5CD2580D0180AFC4@calttsv025.cal.riotinto.org> > From:Schirmacher, Rolf > > For my actual problem, all I need (at the moment, at least) > is bessel_j(0,z) and bessel_j(1,z) for purely real and purely > imaginary arguments z. Now, according to A&S 9.1.10, the > series for bessel_j(0,z) contains only even powers of z, so > it would be purely real for purely real or purely imaginary > arguments. The series for bessel_j(1,z) contains an > additional factor z, so it would be purely real for purely > real z and purely imag for purely imag z. > Try modified Bessel functions. A&S 9.6.3: bessel_i(v,z)=exp(-v*%pi*%i/2)*bessel_j(v,z*exp(%pi*%i/2)) (-%pi References: <2417729F3416D511A27E0090273A963B02910C50@smex01.mbbm.de> <1233185071.5407.27.camel@dieter-laptop> Message-ID: <1233187741.5407.30.camel@dieter-laptop> Am Donnerstag, den 29.01.2009, 00:24 +0100 schrieb Dieter Kaiser: Sorry,there is a typo in the example (%i17) impagpart(bessel_j(n,x)); (%o17) impagpart(bessel_j(n, x)) Correct is (%i4) imagpart(bessel_j(n,x)); (%o4) 0 Dieter Kaiser From ferriste at gmail.com Wed Jan 28 19:45:04 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Thu, 29 Jan 2009 02:45:04 +0100 Subject: [Maxima] Bugs and strange behaviours of Maxima with ratmx and sparse set to true In-Reply-To: References: <497F990F.9020209@gmail.com> <200901280244.30525.al@beshenov.ru>, <497FA06E.2080109@gmail.com> Message-ID: <49810A20.3030402@gmail.com> Barton Willis ha scritto: > > > Maybe you have already solved your problem; for what it is worth, I'd try > something like: > > (%i19) algebraic : true$ > (%i20) ratmx : true$ > > (%i21) KT : triangularize(K)$ > Evaluation took 0.2900 seconds (0.2900 elapsed) > > > > Barton > > I have implemented in my program what you suggested... Sorry I don't know why I thought gaussian elimination could not be better than inversion... The code to solve K*u=f now is this: algebraic : true$ ratmx : true$ ugauss : zeromatrix(nVars,1) $ KT : triangularize(addcol(K,f)) $ ugauss[nVars,1] : KT[nVars,nVars+1]/KT[nVars,nVars]; for i:nVars-1 step -1 thru 1 do ( temp : 0, for j:nVars step -1 thru i+1 do ( temp : temp + KT[i,j]*ugauss[j,1] ), ugauss[i,1] : (KT[i,nVars+1] - temp)/KT[i,i] )$ This set of instructions takes 3.97 seconds and 18.9 MB to be evaluated, while u : K^^-1 . f takes 4.33 seconds and 29.316 MB. The difference is small, but anyway it is a better optimized code and it could be useful with matrices of very high order. PS: I don't know how triangularize works, but could exist a way to improve its performances with sparse matrices? Stefano From Rolf.Schirmacher at MuellerBBM.de Thu Jan 29 02:21:31 2009 From: Rolf.Schirmacher at MuellerBBM.de (Schirmacher, Rolf) Date: Thu, 29 Jan 2009 09:21:31 +0100 Subject: [Maxima] Bessel function with imaginary argument Message-ID: <2417729F3416D511A27E0090273A963B02910C52@smex01.mbbm.de> > -----Original Message----- > From: drdieterkaiser at web.de [mailto:drdieterkaiser at web.de] > Sent: Thursday, January 29, 2009 12:25 AM > To: Schirmacher, Rolf > Cc: maxima at math.utexas.edu > Subject: RE: [Maxima] Bessel function with imaginary argument > > But even more interesting would be to implement more support for the > complex characteristic of functions. I have done a implementation for > the bessel_j function to show how it would work: > > (%i15) declare(n, integer, x,real, z,complex, j,imaginary); > (%o15) done > (%i16) realpart(bessel_j(n,x)); > (%o16) bessel_j(n, x) > (%i17) impagpart(bessel_j(n,x)); > (%o17) impagpart(bessel_j(n, x)) > (%i18) realpart(bessel_j(n,z)); > (%o18) realpart(bessel_j(n, z)) > (%i19) imagpart(bessel_j(n,z)); > (%o19) imagpart(bessel_j(n, z)) > (%i20) realpart(bessel_j(n,j)); > (%o20) 0 > (%i21) imagpart(bessel_j(n,j)); > (%o21) bessel_j(n, j) > (%i22) realpart(bessel_j(n,%i)); > (%o22) 0 > (%i23) imagpart(bessel_j(n,%i)); > (%o23) bessel_j(n, %i) > (%i24) realpart(bessel_j(n,2*%i)); > (%o24) 0 > (%i25) imagpart(bessel_j(n,2*%i)); > (%o25) bessel_j(n, 2 %i) > > These are the results for your last example: > > (%i26) realpart(bessel_j(n,x*%i)); > (%o26) 0 > (%i27) imagpart(bessel_j(n,x*%i)); > (%o27) bessel_j(n, %i x) > I think the examples are correct for n = 1 (n odd? I did not check thoroghly), but definitely not for n = 0 (n even?). (%o17) is 0 in this case. For n=0 (n even?), bessel_j(0,x) and bessel_j(0,j) are purely real (but bessel_j(0,z) is not). > That is the function risplit-bessel-j which is called from the routine > risplit to give support for the realpart and imagpart of the bessel_j > function. This can be generalized for every function. > > (defprop %bessel_j risplit-bessel-j risplit-function) > > (defun risplit-bessel-j (args) > (let ((order (car args)) > (arg (cadr args)) > (sign-order ($csign (car args))) > (sign-arg ($csign (cadr args)))) > (cond > ((or (member sign-order '($complex $imaginary)) > (eq sign-arg '$complex)) > (risplit-noun (list '(%bessel_j) order arg))) > ((eq sign-arg '$imaginary) > (cons 0 (list '(%bessel_j) order arg))) > (t > (cons (list '(%bessel_j) order arg) 0))))) > > This is the implemented call from risplit: > > ((setq func (get (mop l) 'risplit-function)) > ;; A risplit-function on the property list > (funcall func (margs l))) > > In addition I have added the feature 'complex for the > bessel_j function. > > Perhaps, this is a first step to support more complex > characteristics of > functions which could be easy generalized to much more functions. > > Remark: I have used the new function $csign to get the complex > characteristic of the order and argument. This works fine also for > expressions as an order or an argument. > > Dieter Kaiser > That looks really nice and I would strongly support it. Unfortunately, I am not familiar with lisp neither with the structure of the sources, so I guess, I will be of little help for an implementation. Thanks, Rolf Schirmacher From talon at lpthe.jussieu.fr Thu Jan 29 03:12:12 2009 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Thu, 29 Jan 2009 10:12:12 +0100 Subject: [Maxima] odd integration problem. References: <497FF87F.1070402@cs.berkeley.edu> Message-ID: Richard Fateman wrote: > integrate(2^x/sqrt(1+4^x), x); > is not done. > > but integrate(radcan (2^x/sqrt(1+4^x)), x); > works fine. > > why this is odd? the risch algorithm should be decomposing stuff using > radcan. > It has to notice that 4^x is 2 ^(2*x) , and is therefore related to 2^x. > > Macsyma has the same problem and the same fix. > > This problem was posed as something the new "Fricas" can do. > RJF At first i had read x^4! I would be happier if maxima could integrate this one than a completely exotic and artificial integral with 4^x. Anyways, Maple, Mathematica have no problem integrating elliptic differentials, and this is not a super sophisticated risch algorithm for algebraic integrands, it is simply recognizing that integrals of the form integrate(r(x)*sqrt(P(x)),x) where r(x) is a rational function and P is a polynomial of degree 3 or 4 are elliptic, the explicit elliptic form being obtained by writing the curve y^2=P(x) in canonical elliptic form through reparametrizations. More complicated algebraic integrals cannot be expressed on well known special functions,so it is useless to develop an algorithm for more general cases. -- Michel Talon From fateman at cs.berkeley.edu Thu Jan 29 09:54:38 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Thu, 29 Jan 2009 07:54:38 -0800 Subject: [Maxima] odd integration problem. In-Reply-To: References: <497FF87F.1070402@cs.berkeley.edu> Message-ID: <4981D13E.9080707@cs.berkeley.edu> Michel Talon wrote: > Richard Fateman wrote: > > >> integrate(2^x/sqrt(1+4^x), x); >> is not done. >> >> but integrate(radcan (2^x/sqrt(1+4^x)), x); >> works fine. >> >> why this is odd? the risch algorithm should be decomposing stuff using >> radcan. >> It has to notice that 4^x is 2 ^(2*x) , and is therefore related to 2^x. >> >> Macsyma has the same problem and the same fix. >> >> This problem was posed as something the new "Fricas" can do. >> RJF >> > > At first i had read x^4! I would be happier if maxima could integrate > this one than a completely exotic and artificial integral with 4^x. > I agree. > Anyways, Maple, Mathematica have no problem integrating elliptic > differentials, and this is not a super sophisticated risch algorithm > for algebraic integrands, it is simply recognizing that integrals of the > form integrate(r(x)*sqrt(P(x)),x) where r(x) is a rational function and > P is a polynomial of degree 3 or 4 are elliptic, > the explicit elliptic form being obtained by writing the curve y^2=P(x) in > canonical elliptic form through reparametrizations. More complicated > algebraic integrals cannot be expressed on well known special functions,so > it is useless to develop an algorithm for more general cases. > The approach in the literature is to attack the problem of integrate(R(x,q),x) where R is a rational function, and q satisfies an algebraic equation in x, e.g. q^2= x^4+1. There are several approaches. For one reference, try google {ng elliptic macsyma} RJF > > From drdieterkaiser at web.de Thu Jan 29 14:06:13 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Thu, 29 Jan 2009 21:06:13 +0100 Subject: [Maxima] Bessel function with imaginary argument In-Reply-To: <2417729F3416D511A27E0090273A963B02910C52@smex01.mbbm.de> References: <2417729F3416D511A27E0090273A963B02910C52@smex01.mbbm.de> Message-ID: <1233259574.5433.10.camel@dieter-laptop> Am Donnerstag, den 29.01.2009, 09:21 +0100 schrieb Schirmacher, Rolf: > > -----Original Message----- > > From: drdieterkaiser at web.de [mailto:drdieterkaiser at web.de] > > Sent: Thursday, January 29, 2009 12:25 AM > > To: Schirmacher, Rolf > > Cc: maxima at math.utexas.edu > > Subject: RE: [Maxima] Bessel function with imaginary argument > I think the examples are correct for n = 1 (n odd? I did not check > thoroghly), but definitely not for n = 0 (n even?). (%o17) is 0 in this > case. > For n=0 (n even?), bessel_j(0,x) and bessel_j(0,j) are purely real (but > bessel_j(0,z) is not). You are right. It was a too fast first implementation. There are more cases we have to handle. Even and odd integer or half integral values for the order and negative or imaginary values for the argument are the cases we have to look for. I am working on a more complete risplit-bessel-j function. > That looks really nice and I would strongly support it. Unfortunately, I am > not familiar with lisp neither with the structure of the sources, so I > guess, I will be of little help for an implementation. I will finish the bessel_j function. In a similar way it is possible to support a more complete handling of the other bessel functions. If there is no opposition I would like to commit the extension of trisplit and the risplit-functions for the bessel functions as an example for supporting more complex characteristics of functions. Dieter Kaiser From stassats at gmail.com Thu Jan 29 14:48:11 2009 From: stassats at gmail.com (Stas Boukarev) Date: Thu, 29 Jan 2009 23:48:11 +0300 Subject: [Maxima] [Patch] gnuplot support in Clozure CL Message-ID: <87tz7hzvn8.fsf@gmail.com> A non-text attachment was scrubbed... Name: maxima-ccl.patch Type: text/x-diff Size: 951 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20090129/3ad3abd0/attachment.bin From drdieterkaiser at web.de Thu Jan 29 17:06:34 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 30 Jan 2009 00:06:34 +0100 Subject: [Maxima] Bessel function with imaginary argument In-Reply-To: <2417729F3416D511A27E0090273A963B02910C52@smex01.mbbm.de> References: <2417729F3416D511A27E0090273A963B02910C52@smex01.mbbm.de> Message-ID: <1233270394.5433.31.camel@dieter-laptop> Am Donnerstag, den 29.01.2009, 09:21 +0100 schrieb Schirmacher, Rolf: A second attempt. I have tried to do it more complete: (%i2) f(n,x):=[realpart(bessel_j(n,x)),imagpart(bessel_j(n,x))]$ We start with n an integer and the argument is real and positive: (%i3) declare(n,integer)$ (%i4) assume(x > 0)$ (%i5) f(n,x) (%o5) [bessel_j(n,x),0] /* list is [realpart,imagpart] */ (%i6) f(n,-x) (%o6) [bessel_j(n,-x),0] Half integral values work symbolically: (%i7) f(1/2+n,x) (%o7) [bessel_j(n+1/2,x),0] (%i8) f(1/2+n,-x) (%o8) [0,bessel_j(n+1/2,-x)] Argument is imaginary and order an even or odd integer: (%i9) declare(n_even,even)$ (%i10) declare(n_odd,odd)$ (%i11) f(n_even,%i) (%o11) [bessel_j(n_even,%i),0] (%i12) f(n_odd,%i) (%o12) [0,bessel_j(n_odd,%i)] This works for more general imaginary arguments too: (%i25) f(n_even,x*%i) (%o25) [bessel_j(n_even,%i*x),0] (%i26) f(n_odd,x*%i) (%o26) [0,bessel_j(n_odd,%i*x)] (%i27) f(n_even,(1+x)^2*%i) (%o27) [bessel_j(n_even,%i*(x+1)^2),0] (%i28) f(n_odd,(1+x)^2*%i) (%o28) [0,bessel_j(n_odd,%i*(x+1)^2)] And for symbols declared to be imaginary: (%i29) declare(j,imaginary)$ (%i30) f(n_even,(1+x)^2*j) (%o30) [bessel_j(n_even,j*(x+1)^2),0] (%i31) f(n_odd,(1+x)^2*j) (%o31) [0,bessel_j(n_odd,j*(x+1)^2)] This the new routine risplit-bessel-j: (defun risplit-bessel-j (args) (let ((order (car args)) (arg (cadr args)) (sign-order ($csign (car args))) (sign-arg ($csign (cadr args)))) (cond ((or (member sign-order '($complex $imaginary)) (eq sign-arg '$complex)) (risplit-noun (list '(%bessel_j) order arg))) ((eq sign-arg '$imaginary) (cond ((or ($oddp order) ($featurep order '$odd)) /* oddp don't check facts */ (cons 0 (list '(%bessel_j) order arg))) ((or ($evenp order) ($featurep order '$even)) /* evenp don't check facts */ (cons (list '(%bessel_j) order arg) 0)) (t (risplit-noun (list '(%bessel_j) order arg))))) ;; At this point order and arg are real valued. ;; We have to look for some special cases involving a negative arg ((or (maxima-integerp order) (member sign-arg '($pos $pz))) ;; arg is positive or order an integer, real valued. (cons (list '(%bessel_j) order arg) 0)) ;; The sign of arg is negative or not known ((zerop1 (sub ($truncate ($multthru 2 order)) ($multthru 2 order))) ;; order is half integral (cond ((eq sign-arg '$neg) (cons 0 (list '(%bessel_j) order arg))) (t ;; the sign of arg is not known (risplit-noun (list '(%bessel_j) order arg))))) (t ;; the sign of arg is not known (risplit-noun (list '(%bessel_j) order arg)))))) If it is of general interest to have more support for the realpart and imagpart of a function like bessel_j I could commit the extension. Dieter Kaiser From talon at lpthe.jussieu.fr Thu Jan 29 17:10:17 2009 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 30 Jan 2009 00:10:17 +0100 Subject: [Maxima] odd integration problem. References: <497FF87F.1070402@cs.berkeley.edu> <4981D13E.9080707@cs.berkeley.edu> Message-ID: Richard Fateman wrote: > Michel Talon wrote: >> Richard Fateman wrote: >> >> >>> integrate(2^x/sqrt(1+4^x), x); >>> is not done. >>> >>> but integrate(radcan (2^x/sqrt(1+4^x)), x); >>> works fine. >>> >>> why this is odd? the risch algorithm should be decomposing stuff using >>> radcan. >>> It has to notice that 4^x is 2 ^(2*x) , and is therefore related to >>> 2^x. >>> >>> Macsyma has the same problem and the same fix. >>> >>> This problem was posed as something the new "Fricas" can do. >>> RJF >>> >> >> At first i had read x^4! I would be happier if maxima could integrate >> this one than a completely exotic and artificial integral with 4^x. >> > I agree. >> Anyways, Maple, Mathematica have no problem integrating elliptic >> differentials, and this is not a super sophisticated risch algorithm >> for algebraic integrands, it is simply recognizing that integrals of the >> form integrate(r(x)*sqrt(P(x)),x) where r(x) is a rational function and >> P is a polynomial of degree 3 or 4 are elliptic, >> the explicit elliptic form being obtained by writing the curve y^2=P(x) >> in canonical elliptic form through reparametrizations. More complicated >> algebraic integrals cannot be expressed on well known special >> functions,so it is useless to develop an algorithm for more general >> cases. >> > The approach in the literature is to attack the problem of > integrate(R(x,q),x) where R is a rational function, and q satisfies > an algebraic equation in x, e.g. q^2= x^4+1. There are several > approaches. For one reference, try google {ng elliptic macsyma} This is not more general that what i advocated, since R(x,q) can be written (a(x)+b(x)q)/(c(x)+d(x)q) since q^2 is a polynomial, and then multiplying numerator and denominator by (c-dq) you get r1(x)+qr2(x). Only the second term is non trivial. I reiterate that the general algebraic equation P(x,q)=0 is totally useless, since the curve will be hyperelliptic or worse, that is the integral cannot be expressed by known special functions. The only case of interest boils down to q^2= P(x) with P a polynomial of degree 3 or 4. This can always been brought to the form P = x^3 + px + q by an homography bringing one of the roots of P at infinity, and a translation to kill the x^2 term. This is a canonical form for elliptic curves. I don't know what is this stuff about Carlson method, what i sketched above is described in all books on Riemann surfaces or whatever, for example Springer Introduction to Riemann surfaces, i am quite sure it is even in Whittaker and Watson. > > RJF > >> >> -- Michel Talon From fateman at cs.berkeley.edu Thu Jan 29 18:07:58 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Thu, 29 Jan 2009 16:07:58 -0800 Subject: [Maxima] odd integration problem. In-Reply-To: References: <497FF87F.1070402@cs.berkeley.edu> <4981D13E.9080707@cs.berkeley.edu> Message-ID: <498244DE.3060006@cs.berkeley.edu> Michel Talon wrote: > RJF wrote... >> The approach in the literature is to attack the problem of >> integrate(R(x,q),x) where R is a rational function, and q satisfies >> an algebraic equation in x, e.g. q^2= x^4+1. There are several >> approaches. For one reference, try google {ng elliptic macsyma} >> > > This is not more general that what i advocated, since R(x,q) can be > written (a(x)+b(x)q)/(c(x)+d(x)q) since q^2 is a polynomial, and then > multiplying numerator and denominator by (c-dq) you get r1(x)+qr2(x). > My assumption was that the more general case included q satisfying an algebraic equation of higher degree (e.g. q^2 not a polynomial) or the polynomial P of possibly higher degree. Perhaps some of the cases reduce to usual elliptic functions, surprisingly. I do not have any first-hand experience with this, but Ed Ng probably was not dealing with a vacuous problem. The fact that stuff is described in references or even texts does not mean it is described in sufficient form to write a computer program. For example, consider all the books for freshman calculus that describe integration. Very few, perhaps none, give an algorithm. For that you need to look at books on computer algebra, and even then there are gaps. > Only the second term is non trivial. I reiterate that the general algebraic > equation P(x,q)=0 is totally useless, since the curve will be hyperelliptic > or worse, that is the integral cannot be expressed by known special > functions. The only case of interest boils down to q^2= P(x) with P a > polynomial of degree 3 or 4. This can always been brought to the form > P = x^3 + px + q by an homography bringing one of the roots of P at > infinity, and a translation to kill the x^2 term. This is a canonical form > for elliptic curves. I don't know what is this stuff about Carlson method, > what i sketched above is described in all books on Riemann surfaces or > whatever, for example Springer Introduction to Riemann surfaces, i am > quite sure it is even in Whittaker and Watson. > > If it is so simple, why has it not been done? Perhaps you would write it? RJF From fateman at cs.berkeley.edu Thu Jan 29 18:13:46 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Thu, 29 Jan 2009 16:13:46 -0800 Subject: [Maxima] odd integration problem. In-Reply-To: <498244DE.3060006@cs.berkeley.edu> References: <497FF87F.1070402@cs.berkeley.edu> <4981D13E.9080707@cs.berkeley.edu> <498244DE.3060006@cs.berkeley.edu> Message-ID: <4982463A.1010109@cs.berkeley.edu> Richard Fateman wrote: > > My assumption was that the more general case included q satisfying an > algebraic equation of higher degree (e.g. q^2 not a polynomial) .. not this > or the > polynomial P of possibly higher degree. ..yes this. (I checked Ng's paper.) RJF From David.Billinghurst at riotinto.com Thu Jan 29 19:08:03 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Fri, 30 Jan 2009 12:08:03 +1100 Subject: [Maxima] Bessel function with imaginary argument References: <2417729F3416D511A27E0090273A963B02910C50@smex01.mbbm.de> Message-ID: <026DCC31AB859648A6F16C0E5CD2580D0180B075@calttsv025.cal.riotinto.org> > From: Billinghurst, David > > From:Schirmacher, Rolf > > > > For my actual problem, all I need (at the moment, at least) is > > bessel_j(0,z) and bessel_j(1,z) for purely real and purely > imaginary > > arguments z. Now, according to A&S 9.1.10, the series for > > bessel_j(0,z) contains only even powers of z, so it would be purely > > real for purely real or purely imaginary arguments. The series for > > bessel_j(1,z) contains an additional factor z, so it would > be purely > > real for purely real z and purely imag for purely imag z. > > > > Try modified Bessel functions. > > A&S 9.6.3: > bessel_i(v,z)=exp(-v*%pi*%i/2)*bessel_j(v,z*exp(%pi*%i/2)) > (-%pi bessel_i(v,z)=exp(3*v*%pi*%i/2)*bessel_j(v,z*exp(-3*%pi*%i/2)) > (%pi/2 > therefore for x real (but check for sign errors) > > bessel_j(0,%i*x) = bessel_i(0,x) > bessel_j(1,%i*x) = %i*bessel_i(1,x) > I forgot to say that Bessel functions of real order and argument are real, so that for real x realpart(bessel_j(0,%i*x)) = bessel_i(0,x) imagpart(bessel_j(0,%i*x)) = 0 realpart(bessel_j(1,%i*x)) = 0 imagpart(bessel_j(1,%i*x)) = bessel_i(1,x) This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. From toy.raymond at gmail.com Thu Jan 29 21:20:04 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Thu, 29 Jan 2009 22:20:04 -0500 Subject: [Maxima] odd integration problem. In-Reply-To: References: <497FF87F.1070402@cs.berkeley.edu> <4981D13E.9080707@cs.berkeley.edu> Message-ID: <498271E4.6060403@gmail.com> Michel Talon wrote: > Richard Fateman wrote: > > >> Michel Talon wrote: >> >>> Richard Fateman wrote: >>> >>> >>> >>>> integrate(2^x/sqrt(1+4^x), x); >>>> is not done. >>>> >>>> but integrate(radcan (2^x/sqrt(1+4^x)), x); >>>> works fine. >>>> >>>> why this is odd? the risch algorithm should be decomposing stuff using >>>> radcan. >>>> It has to notice that 4^x is 2 ^(2*x) , and is therefore related to >>>> 2^x. >>>> >>>> Macsyma has the same problem and the same fix. >>>> >>>> This problem was posed as something the new "Fricas" can do. >>>> RJF >>>> >>>> >>> At first i had read x^4! I would be happier if maxima could integrate >>> this one than a completely exotic and artificial integral with 4^x. >>> >>> >> I agree. >> >>> Anyways, Maple, Mathematica have no problem integrating elliptic >>> differentials, and this is not a super sophisticated risch algorithm >>> for algebraic integrands, it is simply recognizing that integrals of the >>> form integrate(r(x)*sqrt(P(x)),x) where r(x) is a rational function and >>> P is a polynomial of degree 3 or 4 are elliptic, >>> the explicit elliptic form being obtained by writing the curve y^2=P(x) >>> in canonical elliptic form through reparametrizations. More complicated >>> algebraic integrals cannot be expressed on well known special >>> functions,so it is useless to develop an algorithm for more general >>> cases. >>> >>> >> The approach in the literature is to attack the problem of >> integrate(R(x,q),x) where R is a rational function, and q satisfies >> an algebraic equation in x, e.g. q^2= x^4+1. There are several >> approaches. For one reference, try google {ng elliptic macsyma} >> > > This is not more general that what i advocated, since R(x,q) can be > written (a(x)+b(x)q)/(c(x)+d(x)q) since q^2 is a polynomial, and then > multiplying numerator and denominator by (c-dq) you get r1(x)+qr2(x). > Only the second term is non trivial. I reiterate that the general algebraic > equation P(x,q)=0 is totally useless, since the curve will be hyperelliptic > or worse, that is the integral cannot be expressed by known special > functions. The only case of interest boils down to q^2= P(x) with P a > polynomial of degree 3 or 4. This can always been brought to the form > P = x^3 + px + q by an homography bringing one of the roots of P at > infinity, and a translation to kill the x^2 term. This is a canonical form > for elliptic curves. I don't know what is this stuff about Carlson method, > what i sketched above is described in all books on Riemann surfaces or > whatever, for example Springer Introduction to Riemann surfaces, i am > quite sure it is even in Whittaker and Watson. > FWIW, I tried implementing the reduction algorithm in A&S for converting R(x,q) to elliptic integals of the first, second, and third kind. Parts of it work, but many parts do not. In particular, I never got it to recognize that sqrt((1-x^2)/(1-m*x^2)) is an elliptic integral. Ray From j4ck32 at gmail.com Fri Jan 30 03:13:08 2009 From: j4ck32 at gmail.com (Timo Eggers) Date: Fri, 30 Jan 2009 10:13:08 +0100 Subject: [Maxima] Can maxima solve inequations like x^2-7x+12 > 0 Message-ID: <6c5ad820901300113h28b7181ued73eba32f132d80@mail.gmail.com> i like to solve some inequations with maxima. how can i do this? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090130/338e1fc1/attachment.htm From talon at lpthe.jussieu.fr Fri Jan 30 03:38:09 2009 From: talon at lpthe.jussieu.fr (Michel Talon) Date: Fri, 30 Jan 2009 10:38:09 +0100 Subject: [Maxima] odd integration problem. References: <497FF87F.1070402@cs.berkeley.edu> <4981D13E.9080707@cs.berkeley.edu> <498271E4.6060403@gmail.com> Message-ID: Raymond Toy wrote: > >> > FWIW, I tried implementing the reduction algorithm in A&S for converting > R(x,q) to elliptic integals of the first, second, and third kind. Parts > of it work, but many parts do not. In particular, I never got it to > recognize that sqrt((1-x^2)/(1-m*x^2)) is an elliptic integral. > > Ray Hi, thank you for your comments, Raymond and Richard. The example above is the occasion to show how to reduce such things to canonical form. First one writes sqrt((1-x^2)/(1-m*x^2)) = 1/(1-mx^2) sqrt((1-x^2)(1-mx^2)) which allows to reduce to rational function times square root of a polynomial of degree 4. This polynomial has roots +1, -1, +sqrt(m) , -sqrt(m). Sending one root to infinity by e.g. x -> 1/(x-1) reduces to a polynomial of degree 3. Since i am now at my office, i have checked in Whittaker and Watson (a course of modern analysis) it is in section 20.6 chapter 20, page 452-455. By the way, i think one of the problems when trying to compute elliptic integrals is trying to coerce everything to old Jacobian elliptic notations, cn, sn etc. which are in fact extremely unnatural from the point of view of Riemann surface theory, and are rather inspired by an improper analogy with trigonometric functions. Things are natural and simple when expressed through the Weierstrass p function, which uniformizes the genus 1 Riemann surface. It is true that CAS tools seem to favor these elliptic functions, for reasons i don't know. As an answer to the question q^2=P(x) with P a polynomial of degree larger than 4, this is an hyperelliptic Riemann surface, and as such the integral is guaranteed to be impossible to express in terms of elliptic functions. Hence this is a completely void generalization. Of course, as always, there is an exception, if P has a double root, e.g. (x-a)^2, then you can bring (x-a) out of the square root, and the degree of P falls by 2 units. So these assertions are for a polynomial with simple roots. What would be a legitimate generalization is an algebraic relation of the form P(q,x)=0 which in fact describes a curve of genus 1 while it is hidden in this explicit form. Then one needs to resort to algorithms (which exist, i know a package exists for Maple) to change variables to good variables q and w such that q^2=P(x). But i think this more complicated case, which can occur in theory, is less likely to occur in practice than the straightforward integration of a square root of a polynomial of degree 4 multiplied by a rational function. -- Michel Talon From gutierrez at nigma.ru Fri Jan 30 07:06:02 2009 From: gutierrez at nigma.ru (Andrew Yeltsin) Date: Fri, 30 Jan 2009 16:06:02 +0300 Subject: [Maxima] Can maxima solve inequations like x^2-7x+12 > 0 In-Reply-To: <6c5ad820901300113h28b7181ued73eba32f132d80@mail.gmail.com> References: <6c5ad820901300113h28b7181ued73eba32f132d80@mail.gmail.com> Message-ID: Hello. Use "solve" function. solve(x^2-7*x-12,x); For some other equations try "to_poly_solve" 2009/1/30 Timo Eggers > i like to solve some inequations with maxima. > > how can i do this? > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -- ? ?????????, ?????? ??????, ???????? nigma.ru -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090130/de0758a2/attachment.htm From gutierrez at nigma.ru Fri Jan 30 07:07:14 2009 From: gutierrez at nigma.ru (Andrew Yeltsin) Date: Fri, 30 Jan 2009 16:07:14 +0300 Subject: [Maxima] Can maxima solve inequations like x^2-7x+12 > 0 In-Reply-To: <6c5ad820901300113h28b7181ued73eba32f132d80@mail.gmail.com> References: <6c5ad820901300113h28b7181ued73eba32f132d80@mail.gmail.com> Message-ID: Sorry. I didn't notice that it is an in inequality. 2009/1/30 Timo Eggers > i like to solve some inequations with maxima. > > how can i do this? > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > -- ? ?????????, ?????? ??????, ???????? nigma.ru -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090130/c1fecc20/attachment.htm From gutierrez at nigma.ru Fri Jan 30 07:10:17 2009 From: gutierrez at nigma.ru (Andrew Yeltsin) Date: Fri, 30 Jan 2009 16:10:17 +0300 Subject: [Maxima] Radical signs output for fractional degrees. Message-ID: Hello! We're still working on a custom version of Maxima (step-by-step output for some problems) I mentioned $tex function outputs the roots of degrees higher than 2 like fractional degrees. Maybe, Maxima doesn't use any roots, only fractional degrees. (%i1) :lisp (mfuncall '$tex '((MEXPT SIMP) ((MPLUS SIMP) 1 $a) ((RAT SIMP) 1 3) )); $$\left(a+1\right)^{{{1}\over{3}}}$$ The question is - how to make fractional degrees to be output as radical signs (using \sqrt[root index]{expression})? Sometimes, it is more understandable than fractional degrees, IMHO. Even if it is not necessary for main Maxima version, we need it for our custom version. In this case we can pay for it. If you are interested in this job - write me. We'll discuss the requirements specification and payment details. -- Andrey Yeltsin nigma.ru -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090130/029e0398/attachment.htm From luke.scharf at clusterbee.net Thu Jan 29 13:21:13 2009 From: luke.scharf at clusterbee.net (Luke Scharf) Date: Thu, 29 Jan 2009 13:21:13 -0600 Subject: [Maxima] Configuring Maxima output as an improper fraction? Message-ID: <498201A9.8010604@clusterbee.net> Is there a way to configure Maxima to output the result as an improper fraction? For instance, if I enter 3/4+3/4, then it outputs 3/2. Since I'm doing arithmetic for a woodworking project, it would be easier if it would output as 1+1/2. Or 1+4/8 would be super-useful, too. Is there a way to make Maxima to do that? Many thanks! -Luke P.S. Please CC me -- I'm not subscribed to the list. P.P.S. I'm impressed with Maxima -- after using Mathematica and Matlab, I'm thrilled to find a mature open-source computer algebra system! With wxMaxima, I'll certainly be recommending it to many people! From tryneeds at gmail.com Fri Jan 30 08:30:27 2009 From: tryneeds at gmail.com (Tryneeds) Date: Fri, 30 Jan 2009 22:30:27 +0800 Subject: [Maxima] zh_TW Translations for wxMaxima Message-ID: Hi list, Here is zh_TW translations for wxMaxima 0.8.1. The translators is Hsin-An Hong (rabbit at ctu.edu.tw). Thanks very much! -- Tryneeds-Chinese, the zh_TW online translation platform. URL: http://tryneeds.westart.tw/ Contact E-mail: tryneeds at gmail.com Principal: Franklin Weng -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090130/6fd58923/attachment-0001.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: wxMaxima_zh_TW.po Type: application/octet-stream Size: 64748 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20090130/6fd58923/attachment-0001.obj From fateman at cs.berkeley.edu Fri Jan 30 09:45:30 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Fri, 30 Jan 2009 07:45:30 -0800 Subject: [Maxima] Radical signs output for fractional degrees. In-Reply-To: References: Message-ID: <4983209A.5060102@cs.berkeley.edu> Andrew Yeltsin wrote: > Hello! > > > We're still working on a custom version of Maxima (step-by-step output > for some problems) > > I mentioned $tex function outputs the roots of degrees higher than 2 > like fractional degrees. > Maybe, Maxima doesn't use any roots, only fractional degrees. Internally, only fractional degrees. In fact 1/a is a^(-1) in general form. > > > (%i1) :lisp (mfuncall '$tex '((MEXPT SIMP) ((MPLUS SIMP) 1 $a) ((RAT > SIMP) 1 3) )); > $$\left(a+1\right)^{{{1}\over{3}}}$$ > > The question is - how to make fractional degrees to be output as > radical signs (using \sqrt[root index]{expression})? by changing nformat. But you have to specify what you want for (x+1)^(3/4), (x+1)^(a/2), (x+1)^(a/b), (x+1)^(-1/3), etc. > > Sometimes, it is more understandable than fractional degrees, IMHO. > > Even if it is not necessary for main Maxima version, we need it for > our custom version. > In this case we can pay for it. > If you are interested in this job - write me. We'll discuss the > requirements specification and payment details. a number of people have hacked on $tex and nformat. I was the original author of $tex. RJF > > -- > > Andrey Yeltsin > > nigma.ru > > ------------------------------------------------------------------------ > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From raymond.toy at ericsson.com Fri Jan 30 10:05:30 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Fri, 30 Jan 2009 11:05:30 -0500 Subject: [Maxima] odd integration problem. In-Reply-To: References: <497FF87F.1070402@cs.berkeley.edu> <4981D13E.9080707@cs.berkeley.edu> <498271E4.6060403@gmail.com> Message-ID: <4983254A.10101@ericsson.com> Michel Talon wrote: > Raymond Toy wrote: > > >>> >>> >> FWIW, I tried implementing the reduction algorithm in A&S for converting >> R(x,q) to elliptic integals of the first, second, and third kind. Parts >> of it work, but many parts do not. In particular, I never got it to >> recognize that sqrt((1-x^2)/(1-m*x^2)) is an elliptic integral. >> >> Ray >> > > Hi, > > thank you for your comments, Raymond and Richard. The example above is the > occasion to show how to reduce such things to canonical form. > > First one writes sqrt((1-x^2)/(1-m*x^2)) = 1/(1-mx^2) sqrt((1-x^2)(1-mx^2)) > Hmm. I think I would have converted that to (1-x^2)/sqrt((1-x^2)*(1-m*x^2)), but I guess either way works. I just never got around to teaching maxima to recognize and convert that form. My algorithms generally converted cubic forms to quartic forms, since that seemed to be how A&S was handling the integrals. Oh, and my stuff was not integrated into the integration routines. You had to call the routine manually with a known elliptic integral form. > > By the way, i think one of the problems when trying to compute elliptic > integrals is trying to coerce everything to old Jacobian elliptic > notations, cn, sn etc. which are in fact extremely unnatural from the point > At least for maxima, Jacobian elliptic functions are more useful because maxima actually knows something about them. Maxima doesn't know anything about the Weierstrass p function. :-) Ray From van.nek at arcor.de Fri Jan 30 10:27:36 2009 From: van.nek at arcor.de (van Nek) Date: Fri, 30 Jan 2009 17:27:36 +0100 Subject: [Maxima] Configuring Maxima output as an improper fraction? In-Reply-To: <498201A9.8010604@clusterbee.net> References: <498201A9.8010604@clusterbee.net> Message-ID: <49833888.31387.8CC03A@van.nek.arcor.de> Hi Luke, for better readability in an e-mail I use (%i1) display2d:false$ I guess you are dealing with positive numbers. So the following works for positive numbers. (%i2) x: 23/7$ (%i3) f(x):= [floor(x), mod(x,1)]$ (%i4) f(x); (%o4) [3,2/7] If this representation fits your needs you can format your results with such a function. The computation backwards is done by an apply "+" or by accessing the list entries via %[1]+%[2]. (%i5) apply("+",%); (%o5) 23/7 If you really want to print the "+" here is a quick hack: (%i6) :lisp(defun $unsimplified_plus (a b) `((mplus simp) ,b ,a)) $UNSIMPLIFIED_PLUS (%i6) f(x):= unsimplified_plus(floor(x), mod(x,1))$ (%i7) f(x); (%o7) 3+2/7 This unsimplified "+" can be reevaluated by two single quotes: (%i8) ''%; (%o8) 23/7 And there is another one: (%i9) f(x):= sconcat(floor(x), "+", mod(x,1))$ (%i10) f(x); (%o10) "3+2/7" This is a string. (In the default - display2d:true - mode you won't see the quotes.) (%i11) eval_string(%); (%o11) 23/7 HTH Volker van Nek Am 29 Jan 2009 um 13:21 hat Luke Scharf geschrieben: > Is there a way to configure Maxima to output the result as an improper > fraction? > > For instance, if I enter 3/4+3/4, then it outputs 3/2. Since I'm doing > arithmetic for a woodworking project, it would be easier if it would > output as 1+1/2. Or 1+4/8 would be super-useful, too. Is there a way > to make Maxima to do that? > > Many thanks! > -Luke > > P.S. Please CC me -- I'm not subscribed to the list. > > P.P.S. I'm impressed with Maxima -- after using Mathematica and Matlab, > I'm thrilled to find a mature open-source computer algebra system! With > wxMaxima, I'll certainly be recommending it to many people! > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From fateman at cs.berkeley.edu Fri Jan 30 10:58:37 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Fri, 30 Jan 2009 08:58:37 -0800 Subject: [Maxima] odd integration problem. In-Reply-To: References: <497FF87F.1070402@cs.berkeley.edu> <4981D13E.9080707@cs.berkeley.edu> <498271E4.6060403@gmail.com> Message-ID: <498331BD.80309@cs.berkeley.edu> Michel Talon wrote: > ...snip... > > What would be a legitimate generalization is an algebraic relation of the > form P(q,x)=0 which in fact describes a curve of genus 1 while it is hidden > in this explicit form. Then one needs to resort to algorithms (which exist, > i know a package exists for Maple) to change variables to good > variables q and w such that q^2=P(x). But i think this more complicated > case, which can occur in theory, is less likely to occur in practice than > the straightforward integration of a square root of a polynomial of degree > 4 multiplied by a rational function. > A common observation in writing a program (like integration which may reduce to elliptic integrals) is that the usual cases that are described in texts and references, might take 10% of the code that is needed. The 90% of the code, and much of the thought needed is dealing with the other cases. I don't know what that might be here, but singularities, repeated roots, symbols where you expect numbers (e.g. sqrt(x^n +a^n) ). For example, calculus texts describe integration of rational functions using partial fractions. They factor the denominator into linear and quadratic factors. All the examples factor in this way. But a program must consider the case where the denominator does not factor, and this is perhaps 90% of the effort. > > > > From macrakis at alum.mit.edu Fri Jan 30 11:35:13 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Fri, 30 Jan 2009 12:35:13 -0500 Subject: [Maxima] Configuring Maxima output as an improper fraction? In-Reply-To: <49833888.31387.8CC03A@van.nek.arcor.de> References: <498201A9.8010604@clusterbee.net> <49833888.31387.8CC03A@van.nek.arcor.de> Message-ID: <8b356f880901300935y51fb2a7ai688533759d35437e@mail.gmail.com> On Fri, Jan 30, 2009 at 11:27 AM, van Nek wrote: > ...If you really want to print the "+" here is a quick hack: > > (%i6) :lisp(defun $unsimplified_plus (a b) `((mplus simp) ,b ,a)) > (%i6) f(x):= unsimplified_plus(floor(x), mod(x,1))$ Be aware that any further arithmetic with the results of unsimplified_plus may not be fully simplified. For example, f(-3/2)+f(3/2) => 1 - 2 + 1, not zero. > This unsimplified "+" can be reevaluated by two single quotes: Though two single quotes work in this case, more generally if you want an expression resimplified, you should use expand(expr,1,1). You may find it convenient to define resimplify(expr):=expand(expr,1,1)$ -s -s From christophe.deroulers__maxml1 at normalesup.org Fri Jan 30 19:21:38 2009 From: christophe.deroulers__maxml1 at normalesup.org (Christophe Deroulers) Date: Sat, 31 Jan 2009 02:21:38 +0100 (CET) Subject: [Maxima] Patch to make ic2 work even with i.c. 'y(x)= (fwd) Message-ID: ---------- Forwarded message ---------- Date: Sat, 31 Jan 2009 02:15:59 +0100 (CET) From: Christophe Deroulers To: maxima at math.utexas.edu Subject: Patch to make ic2 work even with i.c. 'y(x)= Hello, This is a patch proposal / feature request. In brief: --------- Change subs([xa,ya],soln) to subs([ya,xa],soln) in the line 318 of the file share/diffequations/ode2.mac . This would allow initial conditions like 'y(x)=2 (for an O.D.E. written like "... + 'y(x)= 0") in addition to initial conditions like y=2 (for an O.D.E. written like "... + y = 0"). This would also make SAGE's users' life easier. Details and motivation: ----------------------- According to the documentation of ode2, the proper way to solve the O.D.E. y''(x)+y(x)=0 with initial conditions y(0)=2, y'(0)=3 is the following: my_ode: 'diff(y,x,2) + y = 0; my_sol: ode2(my_ode, y, x); ic2(my_sol, x=0, y=2, 'diff(y,x)=3); Maxima returns (%o3) y = 3 sin(x) + 2 cos(x) as expected. If, instead, one tries the following: my_ode: diff('y(x),x,2) + 'y(x) = 0; my_sol: ode2(my_ode, 'y(x), x); ic2(my_sol, x=0, 'y(x)=2, diff('y(x),x)=3); Maxima returns: (%o3) y(x) = 3 sin(x) + y(0) cos(x) with y(0) instead of 2. It turns out that, when one solves this O.D.E. with SAGE's desolve function, SAGE is sending the second sequence of commands to Maxima (in a more verbose way). Thefore, typing "x=var('x'); y=function('y',x); desolve(diff(y,x,2)+y(x)==0, y, [0,2,3])" in SAGE yields the same solution with trailing y(0) as above instead of 3*sin(x)+2*cos(x). This behaviour can be easily explained: the function ic2 builds a system of two equations, one for each initial condition, that is solved to find the two unknowns of the general solution returned by ode2. The first of these two equations is built thanks to "subst([xa,ya],soln)" (line 318 of the file share/diffequations/ode2.mac) where xa is "x=0" and ya is "'y(x)=2". If x is replaced by 0 first, then 'y(x) by 2, the resulting equation is "y(0) = %k1" (right but not very useful), and y(0) remains in the final result. But, if 'y(x) is replaced first and then x by 0, the resulting equation is "2=%k1" (right and useful). An easy way of making this second sequence of commands work would therefore be to swap the order of the substitutions (see proposal at the beginning of this message and attached patch --- as I'm a newbie I probably did not make my patch correctly, I did not use RCS). Thank you for your help! (Should I submit this to TRAC?) Christophe Deroulers -------------- next part -------------- A non-text attachment was scrubbed... Name: ic2.patch Type: text/x-diff Size: 695 bytes Desc: Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20090131/46797b92/attachment.bin From robert.dodier at gmail.com Sat Jan 31 10:30:09 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 31 Jan 2009 09:30:09 -0700 Subject: [Maxima] Configuring Maxima output as an improper fraction? In-Reply-To: <498201A9.8010604@clusterbee.net> References: <498201A9.8010604@clusterbee.net> Message-ID: On 1/29/09, Luke Scharf wrote: > Is there a way to configure Maxima to output the result as an improper > fraction? > > For instance, if I enter 3/4+3/4, then it outputs 3/2. Since I'm doing > arithmetic for a woodworking project, it would be easier if it would > output as 1+1/2. Or 1+4/8 would be super-useful, too. Is there a way > to make Maxima to do that? Luke, I've attached some code which changes the way literal rational numbers are displayed. It doesn't change the way expressions are constructed, only the pretty-printing display. It doesn't change the 1-dimensional display, that could be done with the same approach. (On re-reading your message, I see you've mentioned wxMaxima. The following code doesn't change the wxMaxima display, only the display of the command line Maxima. There is a way to get a similar result in wxMaxima, by clobbering the default display function, but I'm not familiar with the details.) Since you are working with physical units, perhaps the ezunits package is useful to you. Ezunits has been evolving over the last few releases, probably you would want to use the most recent (Maxima 5.17.1). (%i1) load ("stuff.lisp"); (%i2) load (ezunits); (%i3) 7/8 ` inch; 7 (%o3) - ` inch 8 (%i4) -3/8 ` inch; 3 (%o4) (- -) ` inch 8 (%i5) 3 ` feet - (5 + 5/8) ` inch; 5 (%o5) 3 ` feet + (- 5 -) ` inch 8 (%i6) % `` feet; Computing conversions to base units; may take a moment. 17 (%o6) 2 -- ` feet 32 (%i7) % `` inch; 3 (%o7) 30 - ` inch 8 It occurs to me that it might be nice to display lengths as, say, X feet + Y inches after carrying out arithmetic. At present ezunits can't do that, I'll think about how it could be done. I haven't tested the code below very extensively, so I wouldn't be surprised if you discover some bugs. Hope it's useful anyway. best Robert Dodier PS. ;; display literal rational numbers as improper fractions ;; copyright 2009 by Robert Dodier ;; I release this work under terms of the GNU General Public License ;; save this stuff in a file and then enter load("stuff.lisp"); (setf (symbol-function 'dim-rat-original) #'dim-rat) (defun dim-rat (form result) (if (or (great form 1) (great -1 form)) (dim-rat-improper form result) (dim-rat-original form result))) (setf (get 'foo 'rbp) 10) (setf (get 'foo 'lbp) 10) (setf (get 'foo 'dissym) '(#\ )) (defun dim-rat-improper (form result) (let ((denom (third form))) (if (great 0 form) (multiple-value-bind (whole remainder) (mfuncall '$ceiling form) (dimension-infix `((foo) ,whole ((rat) ,(- remainder) ,denom)) result)) (multiple-value-bind (whole remainder) (mfuncall '$floor form) (dimension-infix `((foo) ,whole ((rat) ,remainder ,denom)) result))))) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090131/4d0a7b85/attachment.htm From drdieterkaiser at web.de Sat Jan 31 10:51:57 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 31 Jan 2009 17:51:57 +0100 Subject: [Maxima] Bessel function with imaginary argument In-Reply-To: <1233270394.5433.31.camel@dieter-laptop> References: <2417729F3416D511A27E0090273A963B02910C52@smex01.mbbm.de> <1233270394.5433.31.camel@dieter-laptop> Message-ID: I have check in the code to handle the realpart and the imagpart of the Bessel functions more general and correct. I hope this is useful and might be a first step to support more functions. There are some points to remark: 1. Maxima no longer returns the default real result for the Bessel functions. E.g. realpart(bessel_j(n,x)) --> gives the noun form, because in general the result can be complex. But when we declare n to be an integer we get again the correct pure real result. 2. Because abs and cabs uses the algorithm of risplit, the results of these functions change too and are more correct. 3. realpart and imagpart are not simplifying functions. This is the reason that we do not get the most simple results when the Bessel functions are involved in expressions. Dieter Kaiser From robert.dodier at gmail.com Sat Jan 31 11:51:54 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 31 Jan 2009 10:51:54 -0700 Subject: [Maxima] Radical signs output for fractional degrees. In-Reply-To: References: Message-ID: On 1/30/09, Andrew Yeltsin wrote: > We're still working on a custom version of Maxima (step-by-step > output for some problems) I'd be interested to hear more about it. > The question is - how to make fractional degrees to be output > as radical signs (using \sqrt[root index]{expression})? I've appended some code to clobber the built-in TeX function for x^(1/y) expressions. (I didn't try to handle anything else such as x^(2/y).) tex (x^(1/2)); => $$\sqrt{x}$$ tex (x^(1/3)); => $$\sqrt[3]{x}$$ tex (x^(2/3)); => $$x^{{{2}\over{3}}}$$ tex (x^(1/n)); => $$\sqrt[n]{x}$$ tex (x^(2/n)); => $$x^{{{2}\over{n}}}$$ tex (x^(1/(n + m))); => $$\sqrt[n+m]{x}$$ tex (x^(2/(n + m))); => $$x^{{{2}\over{n+m}}}$$ > Even if it is not necessary for main Maxima version, we need it for > our custom version. In this case we can pay for it. > If you are interested in this job - write me. We'll discuss the requirements > specification and payment details. Well, in this case anyway, your appreciation is enough. (Assuming this function does what you want!) I might try to put this code somewhere in maxima/share/. best Robert Dodier PS. ;; TeX output x^(1/n) as \sqrt[n]{x} ;; copyright 2009 by Robert Dodier ;; I release this work under terms of the GNU General Public License (setf (symbol-function 'tex-mexpt-original) #'tex-mexpt) (defun tex-mexpt (x l r) (let ((my-expt (third x))) (multiple-value-bind (hit my-root) (1-over-something-p my-expt) (if hit (let ((my-base (second x))) (tex-mexpt-root my-base my-root l r)) (tex-mexpt-original x l r))))) ;; Try to detect: ((RAT) 1 FOO) ((MEXPT) FOO -1) ((MQUOTIENT) 1 FOO) ;; Dunno if there are other ways to represent 1/foo in Maxima. (defun 1-over-something-p (x) (cond ((atom x) (values nil nil)) ((and (eq (caar x) 'rat) (eq (second x) 1)) (values t (third x))) ((and (eq (caar x) 'mexpt) (eq (third x) -1)) (values t (second x))) ((and (eq (caar x) 'mquotient) (eq (second x) 1)) (values t (third x))) (t (values nil nil)))) (defun tex-mexpt-root (my-base my-root l r) (append l (list "\\sqrt[") (tex my-root nil nil 'mparen 'mparen) (list "]{") (tex my-base nil nil 'mparen 'mparen) (list "}") r)) From robert.dodier at gmail.com Sat Jan 31 16:20:33 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 31 Jan 2009 15:20:33 -0700 Subject: [Maxima] [Patch] gnuplot support in Clozure CL In-Reply-To: <87tz7hzvn8.fsf@gmail.com> References: <87tz7hzvn8.fsf@gmail.com> Message-ID: Thanks, Stas. I've committed the patch. best Robert Dodier From drdieterkaiser at web.de Sat Jan 31 16:52:28 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 31 Jan 2009 23:52:28 +0100 Subject: [Maxima] float(zeta(3)) does not evaluate numerically In-Reply-To: References: <1233098750.5420.39.camel@dieter-laptop> Message-ID: <14997BB46C3B4221A775A9B25F7A8089@Kaiser> I have changed the implementation of the Zeta function to a simplifying function. Now something like zeta(3),numer; will give the expected numerical result. The proposed extension to $sign to get the sign of the Zeta function for noun forms with numerical constants is no longer needed. Remarks: 1. The algorithm of simp-zeta is almost the same as the old algorithm. I have removed some direct calls to internal functions of the simplifier like simpabs, red*, timesk, ... The old routine has a resimplify which is not necessary. Futhermore I have sligtly changed the logic to get a more readable code. I have changed the result of zeta(1) to INFINITY, which is more correct and added the new result zeta(inf) --> 1. Furthermore I have added code to check more carefully the numbers ONE and ZERO. 2. The zeta function has a problem with values near ZERO. (See bug report SF[1995531 ] "zeta errors near 0.0 / 0.0b0". One reason is that for small negative values the numerical routine does the calculation for an argument (1-s). But for small values this is near by the value ONE which is a pole. I have tried to catch this problem. At least the divison by zero errors near the value zero can be avoided if we do not try to evaluate zeta for values abs(s) < 10^(-fpprec). But there seems to be more problems near by the value ZERO in the routine bfzeta. Dieter Kaiser From luigi_marino2 at alice.it Sat Jan 31 09:47:55 2009 From: luigi_marino2 at alice.it (Luigi Marino) Date: Sat, 31 Jan 2009 16:47:55 +0100 Subject: [Maxima] rudimental block for second degree inequation Message-ID: <528E113C847F4CF798D9370A1F57D6B0@windowsa96d2f1> Hallo I include a rudimental block for solving inequation with Maxima, solve is only for equation. Best regards. Luigi Marino. diseq(a,b,c):=block([x1,x2,delta], delta:b*b-4*a*c, if delta>0 then x1:(-b-sqrt(delta))/2*a, x2: (-b+sqrt(delta))/2*a, if a>0 then print("S= R - ",[x1,x2]), else print("S = ",[x1,x2]), if delta=0 and a>0 then print("S= R -(",-b/2*a,")") else if a<0 then print("{}"), if delta<0 and a>0 then print("S=R") else if a<0 then print("S={}") )$ Example: diseq(1,-7,12); diseq(1,1,1); diseq(-1,-1,-1); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090131/957660da/attachment.htm From drdieterkaiser at web.de Sun Feb 1 12:26:10 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 1 Feb 2009 19:26:10 +0100 Subject: [Maxima] Mirror symmetry and realpart/imagpart of functions Message-ID: We know that realpart/imagpart do not work correctly for most functions with complex arguments. An example is: (%i1) realpart(gamma(1+%i)); (%o1) gamma(1+%i) (%i2) imagpart(gamma(1+%i)); (%o2) 0 Maxima assumes a function always to be real valued. This can be changed by declaring the symbol gamma to be complex. Then we get the noun form for the realpart and the imagpart. For functions which have mirror symmetry we can do more. In general we have realpart(f(x+%i*y)) = 1/2* (conjugate(f(x+%i)) + f(x+%i*y)) imagpart(f(x+%i*y)) = 1/2*%i*(conjugate(f(x+%i)) - f(x+%i*y)) If the function has mirror symmetry this simplifies to: realpart(f(x+%i*y)) = 1/2* (f(x-%i) + f(x+%i*y)) imagpart(f(x+%i*y)) = 1/2*%i*(f(x-%i) - f(x+%i*y)) This is implemented directly into the routine risplit for the Erf function. It is possible to support this simplification in general for function which are declared to have mirror symmetry (or partially). We have to add the following code to the routine risplit: ((or (get (mop l) 'commutes-with-conjugate) (get (mop l) 'conjugate-function)) ;; The function has mirror symmetry (cons (mul (div 1 2) (add (simplify (list '($conjugate) l)) l)) (mul (div 1 2) '$%i (sub (simplify (list '($conjugate) l)) l)))) If we add this code every function with mirror symmetry calls the function conjugate to get a more simple expression for the realpart and imagpart of the function. Example: For a real argument the conjugate expression simplifies as expected: (%i1) realpart(gamma(x)); (%o1) gamma(x) (%i2) imagpart(gamma(x)); (%o2) 0 Now a a complex argument. We get correct expressions for the realpart and imagpart: (%i2) realpart(gamma(1+%i)); (%o2) (gamma(%i+1)+gamma(1-%i))/2 (%i2) imagpart(gamma(1+%i)); (%o2) %i*(gamma(1-%i)-gamma(%i+1))/2 If we include functions with a conjugate-function on the property list, we do not always get the most simple result, but a correct. E.g. the function gamma_incomplete has no mirror symmetry on the negative x-axis. For complex values we get the results from above: (%i2) realpart(gamma_incomplete(a,1+%i)); (%o2) (gamma_incomplete(a,%i+1)+gamma_incomplete(a,1-%i))/2 (%i3) imagpart(gamma_incomplete(a,1+%i)); (%o3) %i*(gamma_incomplete(a,1-%i)-gamma_incomplete(a,%i+1))/2 For a real symbol the conjugate function does not simplify, because the sign is unknown. The result is correct, but looks more complicated as the noun form: (%i4) realpart(gamma_incomplete(a,x)); (%o4) (conjugate(gamma_incomplete(a,x))+gamma_incomplete(a,x))/2 (%i5) imagpart(gamma_incomplete(a,x)); (%o5) %i*(conjugate(gamma_incomplete(a,x))-gamma_incomplete(a,x))/2 But if we tell Maxima the sign of x, we againg get a simple answer: (%i6) assume(x>0)$ (%i7) realpart(gamma_incomplete(a,x)); (%o7) gamma_incomplete(a,x) (%i8) imagpart(gamma_incomplete(a,x)); (%o8) 0 I have run the testsuite and the share_testsuite. Both have no problems with this extension. (We have to add the code at the right place in risplit.) So what do you think. Should we extend Maxima to handle the realpart/imagpart of functions with mirror symmetry more correctly. Remarks: If the function has in addition reflection symmetry and this is implemented too we can get further simplifications. With this extension we get more simple expressions for the abs and the carg functions too, because the realpart/imagpart are needed. Examples: (%i19) abs(gamma(1+%i)); (%o19) sqrt((gamma(%i+1)+gamma(1-%i))^2/4-(gamma(1-%i)-gamma(%i+1))^2/4) We have to help Maxima to get the most simple expression for abs: (%i20) radcan(%); (%o20) sqrt(gamma(1-%i))*sqrt(gamma(%i+1)) That would be the result for carg: (%i21) carg(gamma(1+%i)); (%o21) atan2(%i*(gamma(1-%i)-gamma(%i+1))/2,(gamma(%i+1)+gamma(1-%i))/2) Dieter Kaiser From rswarbrick at googlemail.com Sun Feb 1 19:21:50 2009 From: rswarbrick at googlemail.com (Rupert Swarbrick) Date: Mon, 02 Feb 2009 01:21:50 +0000 Subject: [Maxima] (Minor) Documentation Fix Message-ID: <87fxixr5u9.fsf@gmail.com> A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 314 bytes Desc: not available Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20090202/edeb71fc/attachment.pgp From robert.dodier at gmail.com Mon Feb 2 00:59:56 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sun, 1 Feb 2009 23:59:56 -0700 Subject: [Maxima] Fwd: [Maxima-lang-fr] Trouver les extrema de sin(x) In-Reply-To: <4985A955.9030209@gmail.com> References: <4985A955.9030209@gmail.com> Message-ID: Forwarding this message from the French-language mailing list. Laurent: maybe "find_root" (numerical approximation) is helpful. best Robert Dodier ---------- Forwarded message ---------- From: moky Date: Feb 1, 2009 6:53 AM Subject: [Maxima-lang-fr] Trouver les extrema de sin(x) To: maxima-lang-fr at lists.sourceforge.net Bonjour ? toutes et ? tous Affin de trouver les extrema d'une fonction, je cherche l'annulation de la d?riv?e. Par exemple pour la fonction sinus : f(x):=sin(x); solve( [diff(f(x),x)=0],[x] ) Ceci me donne correctement la valeur pi/2, mais h?las : `solve' is using arc-trig functions to get a solution.Some solutions will be lost. La solution -pi/2 a ?t? perdue. Or j'aurais bien aim? l'avoir parce qu'elle est un minimum. (?videmment, chercher le mot-clef "maxima" dans la doc, ?a n'aide pas beaucoup ;) ) Ce qui m'int?resse est de pouvoir trouver la plus petite et la plus grande valeur atteinte par la fonction entre deux bornes. Bien entendu, je peux y aller ? la barbare et lancer une r?solution num?rique sur 100 points r?partis sur tout mon intervalle, voir carr?ment calculer la fonction en 1000 point (je ne me soucie pas d'une faute de moins de 0.1). Pour le contexte, j'utilise maxima en arri?re plan d'un script en python qui le sert ? g?n?rer du code pstricks pour les dessins que je veux introduire dans mes documents LaTeX. Savoir le minimum et le maximum de la fonction me sert ? d?terminer la taille de la bounding box de l'image et ? faire en sorte que les axes soient assez grands pour accueillir toute la fonction que je trace. Merci bon dimanche Laurent ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Maxima-lang-fr mailing list Maxima-lang-fr at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/maxima-lang-fr From willisb at unk.edu Mon Feb 2 07:42:27 2009 From: willisb at unk.edu (Barton Willis) Date: Mon, 2 Feb 2009 07:42:27 -0600 Subject: [Maxima] question / comments about sublis Message-ID: I was looking at the source code for sublis (defined in src/sublis.lisp). It seems that much of the complexity of this code could be eliminated by using the CL function sublis. Does the Maxima sublis function predate the Common Lisp function sublis? (1) sublis ignores opsubst, subst doesn't; sublis obeys the sublis_apply_lambda option variable, subst ignores it, (2) sublis requires a list of substitutions, subst doesn't, (3) subst allows for substitutions of subscripted variables, sublis doesn't, (4) subst allows for substitutions of nonatoms, sublis doesn't (OK, parallel substitution of say sublis([x*y=1, x = 7], x * y) is somewhat problematic.) In part, I was looking at all this because I was thinking about substitutions into Maxima conditionals: (%i6) '(if x < 1 then 5 else 1/x)$ (%i7) subst(x=0,%); Division by 0 In the new to_poly_solver (CVS only), there is a simplifying conditional %if. I started thinking about squeezing some code into sublis to make sublis work for conditionals, but the source for sublis is recondite. Of course, it's tempting to take the easy path: ditch the complexity (and the oddball option variable sublis_apply_lambda) and start from scratch and use the CL function sublis. Already, subst and sublis have too many differences... Barton From luigi_marino2 at alice.it Sun Feb 1 12:05:38 2009 From: luigi_marino2 at alice.it (Luigi Marino) Date: Sun, 1 Feb 2009 19:05:38 +0100 Subject: [Maxima] find minima and maxima points of a function Message-ID: <2D40635C5B3E42799B49F640E3BD44AF@windowsa96d2f1> Last my work for Maxima, the block find minima and maxima points of a function. The block use solve of Maxima and points are discovered if solve works. load(descriptive); stud_funz(f):=block([p,fs,fp], p:solve(diff(f,x,1),x), fs:diff(f,x,2), fp:ev(fs,x:p), for i:1 thru length(float(p)) do if rhs(fp[i])>0 then print("minimo",[p[i],rhs(ev(f,x:p[i]))]) else print("massimo",[p[i],rhs(ev(f,x:p[i]))]))$ Example: f:x^3/(1-x^2); stud_funz(f); minimo[x=-sqrt(3),(3*sqrt(3))/2] massimo[x=sqrt(3),-(3*sqrt(3))/2] massimo[x=0,0] f:x*sqrt(1-x^2); stud_funz(f); minimo[x=-1/sqrt(2),-1/2] massimo[x=1/sqrt(2),1/2] f:trigexpand(cos(2*x)+2*sin(x)); stud_funz(f); `solve' is using arc-trig functions to get a solution. Some solutions will be lost. massimo[x=%pi/6,0] massimo[x=%pi/2,0] Best wishes. Luigi Marino -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090201/1c870c9e/attachment.htm From fateman at cs.berkeley.edu Mon Feb 2 09:15:50 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Mon, 02 Feb 2009 07:15:50 -0800 Subject: [Maxima] Configuring Maxima output as an improper fraction? In-Reply-To: References: <498201A9.8010604@clusterbee.net> Message-ID: <49870E26.5090101@cs.berkeley.edu> Why not multiply your result by 1.0, and use decimal. It seems to me that you probably don't want improper fractions that are smaller than 1/16 or 1/32. You can buy a ruler that has a decimal to fraction table engraved on the back. RJF From willisb at unk.edu Mon Feb 2 12:18:33 2009 From: willisb at unk.edu (Barton Willis) Date: Mon, 2 Feb 2009 12:18:33 -0600 Subject: [Maxima] question / comments about sublis In-Reply-To: References: Message-ID: Not that it matters all that much, but sublis is potentially faster than subst: sublis makes 2 calls to simplus & 12 to great: (%i37) (untimer(), timer(?simplus,?great))$ (%i38) sublis([w=a, x=b,y=c,z=d], w + x + y + z)$ (%i39) timer_info(); (%o39) matrix([function,time//call,calls,runtime,gctime],[great,0,12,0,0],[simplus,0,2,0,0],[total,0,14,0,0]) subst makes 5 calls to simplus and 30 to great: (%i41) (untimer(), timer(?simplus, ?great))$ (%i42) subst([w=a, x=b,y=c,z=d], w + x + y + z)$ (%i43) timer_info(); (%o43) matrix([function,time//call,calls,runtime,gctime],[great,0,30,0,0],[simplus,0,5,0,0],[total,0,35,0,0]) (1) When speed matters, I'd guess that ratsubst is faster than both, (2) subst allows substitution of nonatoms, sublist doesn't --- so we're not comparing equals. Barton From robert.dodier at gmail.com Mon Feb 2 12:47:25 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 2 Feb 2009 11:47:25 -0700 Subject: [Maxima] question / comments about sublis In-Reply-To: References: Message-ID: On 2/2/09, Barton Willis wrote: > In part, I was looking at all this because I was thinking about > substitutions into Maxima conditionals: > > (%i6) '(if x < 1 then 5 else 1/x)$ > (%i7) subst(x=0,%); Division by 0 > > In the new to_poly_solver (CVS only), there is a simplifying > conditional %if. I started thinking about squeezing some code into > sublis to make sublis work for conditionals, but the source for sublis is > recondite. Of course, it's tempting to take the easy path: ditch the > complexity (and the oddball option variable sublis_apply_lambda) and > start from scratch and use the CL function sublis. Already, subst and > sublis have too many differences... Barton, although it is tempting to just punt to SUBLIS, I think the differences between subst and sublis are confusing, and just calling SUBLIS wouldn't change that. I think the only useful difference between subst and sublis is that subst substitutes iteratively while sublis substitutes in parallel. The name sublis doesn't suggest that, I think subst_parallel is better. I'll suggest at this point to rename sublis to subst_parallel and aside from parallel substitution to make it work like subst as much as possible. About substitution into conditional expressions, I don't recommend modifiying subst or sublis to handle them. A new function specifically to substitute into such expressions would be OK I guess. But maybe evaluating the expression with the variables of interest bound to specific values would have the desired effect (because the code for evaluating conditionals already ignores branches not taken). e.g. foo : if x > 0 then 1/x else foo0; ev(foo, x = 0); or: ev(foo, x = 1); There may be some opposition to using ev in this way, but I don't see how to get the desired effect with subst or sublis. best Robert Dodier From robert.dodier at gmail.com Mon Feb 2 12:56:15 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 2 Feb 2009 11:56:15 -0700 Subject: [Maxima] Mirror symmetry and realpart/imagpart of functions In-Reply-To: References: Message-ID: On 2/1/09, Dieter Kaiser wrote: > So what do you think. Should we extend Maxima to handle the > realpart/imagpart of functions with mirror symmetry more correctly. OK by me. Thanks for working on this problem. I hope at some point we will be able to state in the documentation the identities which are known for each function. > If the function has in addition reflection symmetry and this is implemented too > we can get further simplifications. > > With this extension we get more simple expressions for the abs and the carg > functions too, because the realpart/imagpart are needed. Terrific, please go ahead. best Robert Dodier From macrakis at alum.mit.edu Mon Feb 2 13:00:31 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 2 Feb 2009 14:00:31 -0500 Subject: [Maxima] Mirror symmetry and realpart/imagpart of functions In-Reply-To: References: Message-ID: <8b356f880902021100q61c6f330t1cd1f5fd6b21ddb9@mail.gmail.com> On Sun, Feb 1, 2009 at 1:26 PM, Dieter Kaiser wrote: > ...If the function has mirror symmetry this simplifies to: > > realpart(f(x+%i*y)) = 1/2* (f(x-%i) + f(x+%i*y)) > imagpart(f(x+%i*y)) = 1/2*%i*(f(x-%i) - f(x+%i*y)) > > This is implemented directly into the routine risplit for the Erf function. > > It is possible to support this simplification in general for function which are > declared to have mirror symmetry (or partially).... These are nice transformations, which have the good property of eliminating realpart/imagpart/abs/carg nouns, which means further simplifications are possible. However, I am not sure that a user would always prefer to see sqrt(gamma(1-%i))*sqrt(gamma(%i+1)) than abs(gamma(1+%i)) I do not actually have an opinion on this, but I think the question is worth thinking about.... -s From robert.dodier at gmail.com Mon Feb 2 13:02:15 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 2 Feb 2009 12:02:15 -0700 Subject: [Maxima] Patch to make ic2 work even with i.c. 'y(x)= (fwd) In-Reply-To: References: Message-ID: On 1/30/09, Christophe Deroulers wrote: > This is a patch proposal / feature request. > > In brief: > --------- > Change subs([xa,ya],soln) to subs([ya,xa],soln) in the line 318 of the > file share/diffequations/ode2.mac . > > This would allow initial conditions like 'y(x)=2 (for an O.D.E. written > like "... + 'y(x)= 0") in addition to initial conditions like y=2 (for an > O.D.E. written like "... + y = 0"). OK by me if we can verify that the proposed patch doesn't change the behavior of the ODE code for existing problems. There is a large test suite for Maxima's ODE code -- I don't know how much (if any) calls the function touched by the patch. Perhaps you, Christophe, can look into it and report on it. Thanks for your interest in Maxima, Robert Dodier From LindnerW at t-online.de Mon Feb 2 14:35:57 2009 From: LindnerW at t-online.de (Wolfgang Lindner) Date: Mon, 2 Feb 2009 21:35:57 +0100 Subject: [Maxima] find minima and maxima points of a function Message-ID: <001201c98575$ea13be00$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> hi Luigi, thanks for sharing your code with us. I enjoy it. Find attached some code examples of Maxima friends (Nelson and Mario) for the same job. Maybe you find it interesting, too. My class and me like it .. hth wolfgang /* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/ /* [wxMaxima: input start ] */ /* ------------------------------------------------------------------------- - this is file critpts.mac: as you can see, comments in maxima are like comments in C Nelson Luis Dias, nldias at simepar.br created 20000707 updated 20000707 The program is written outside of MAXIMA with a text editor, and then loaded into MAXIMA with the BATCH command. Here is the program listing: ------------------------------------------------------------------------- -- */ critpts():=( print("program to find critical points"), /* asks for a function */ f:read("enter f(x,y)"), /* echoes it, to make sure */ print("f = ",f), /* produces a list with the two partial derivatives of f */ eqs:[diff(f,x),diff(f,y)], /* produces a list of unknowns */ unk:[x,y], /* solves the system */ solve(eqs,unk) )$ print("z.B.: %e^(x^3+y^2)*(x+y);")$ critpts(); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ %e^(x^3+y^2)*(x+y); /* [wxMaxima: input end ] */ /* Maxima can't load/batch files which end with a comment! */ "Created with wxMaxima"$ --------- /* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/ /* [ Created by wxMaxima version 0.7.6 ] */ /* [wxMaxima: comment start ] I am trying to figure out how to find the min/max of a threee-dimensional function with Maxima. For instance, I am playing with the function f(x,y)=x^3+3*x*y-6*x*y On paper I can easily find f'x f''xx f'y f''yy f''xy and find the critical points, then check each one. Is there a simpler way to do this in Maxima? I have googled but not found anything of this sort (though there is a lot of good info about Maxima floating around the 'net). Just to prove that I'm not asking someone to do my homework (and yes, this _is_ a homework question), the solution set is {(0,0,), (0,2), (1,1), (-1,1)}. [wxMaxima: comment end ] */ /* [wxMaxima: comment start ] /************* begin Maxima Session ********************/ /* Analiza los puntos criticos de una funcion de */ /* variables independientes x e y. */ /* Ejemplos de uso: */ /* extremos(exp(x-y)*x*y); */ /* extremos(y^2 + (x + 1)^2*y + (x + 1)^4); */ /* Mario Rodriguez */ [wxMaxima: comment end ] */ /* [wxMaxima: input start ] */ load(vect)$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ extremos(expr):= block([gr,cr,he,x,y,mn,de], /* vector gradiente de la funcion */ gr: grad(expr), /* hessiano */ he: hessian(expr, [x,y]), /* Resuelve para x e y el gradiente nulo */ cr: solve(ev(express(gr),diff), [x,y]), /* s recorre las soluciones encontradas por solve */ for s in cr do ( /* valor numerico del hessiano para la soluci?n s */ mn: subst(s, he), /* determinante del hessiano */ de: determinant(mn), /* controla el tipo de punto critico */ if de > 0 then if mn[1,1] > 0 then print("Minimo relativo en ", s) else print("Maximo relativo en ", s) else if de < 0 then print("Punto silla en ", s) else print("Determinante nulo en ", s) ) )$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ f(x, y) := x^3+3*x*y-6*x*y $ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ extremos(f(x,y)); /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ load(draw)$ /* [wxMaxima: input end ] */ /* [wxMaxima: input start ] */ draw3d( explicit(x^3+3*x*y-6*x*y, x,-3,3,y,-3,3), point_size = 3, color = red, point_type = filled_circle, points([[0,0,f(0, 0)],[0,2,f(0, 2)],[1,1,f(1, 1)],[-1,1,f(-1, 1)]]))$ /* [wxMaxima: input end ] */ /* Maxima can't load/batch files which end with a comment! */ "Created with wxMaxima"$ -----Urspr?ngliche Nachricht----- Von: Luigi Marino An: maxima at math.utexas.edu Datum: Montag, 2. Februar 2009 15:52 Betreff: [Maxima] find minima and maxima points of a function Last my work for Maxima, the block find minima and maxima points of a function. The block use solve of Maxima and points are discovered if solve works. load(descriptive); stud_funz(f):=block([p,fs,fp], p:solve(diff(f,x,1),x), fs:diff(f,x,2), fp:ev(fs,x:p), for i:1 thru length(float(p)) do if rhs(fp[i])>0 then print("minimo",[p[i],rhs(ev(f,x:p[i]))]) else print("massimo",[p[i],rhs(ev(f,x:p[i]))]))$ Example: f:x^3/(1-x^2); stud_funz(f); minimo[x=-sqrt(3),(3*sqrt(3))/2] massimo[x=sqrt(3),-(3*sqrt(3))/2] massimo[x=0,0] f:x*sqrt(1-x^2); stud_funz(f); minimo[x=-1/sqrt(2),-1/2] massimo[x=1/sqrt(2),1/2] f:trigexpand(cos(2*x)+2*sin(x)); stud_funz(f); `solve' is using arc-trig functions to get a solution. Some solutions will be lost. massimo[x=%pi/6,0] massimo[x=%pi/2,0] Best wishes. Luigi Marino From David.Billinghurst at riotinto.com Mon Feb 2 17:13:31 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Tue, 3 Feb 2009 10:13:31 +1100 Subject: [Maxima] Patch to make ic2 work even with i.c. 'y(x)= (fwd) References: Message-ID: <026DCC31AB859648A6F16C0E5CD2580D0180B253@calttsv025.cal.riotinto.org> > From: Robert Dodier > > On 1/30/09, Christophe Deroulers wrote: > > > This is a patch proposal / feature request. > > > > In brief: > > --------- > > Change subs([xa,ya],soln) to subs([ya,xa],soln) in the > line 318 of > > the file share/diffequations/ode2.mac . > > > > This would allow initial conditions like 'y(x)=2 (for an O.D.E. > > written like "... + 'y(x)= 0") in addition to initial > conditions like > > y=2 (for an O.D.E. written like "... + y = 0"). > > OK by me if we can verify that the proposed patch doesn't > change the behavior of the ODE code for existing problems. > There is a large test suite for Maxima's ODE code -- I don't > know how much (if any) calls the function touched by the patch. > Perhaps you, Christophe, can look into it and report on it. There are only two tests of ic2 in the testsuite, and none in the share/contrib/diffequations testsuite. I think we need more before we can be sure there are no adverse effects. I haven't had time to look at this patch. I will see what I can do in the next couple of weeks. David This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. From rich.hennessy at verizon.net Mon Feb 2 18:41:23 2009 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Mon, 02 Feb 2009 19:41:23 -0500 Subject: [Maxima] I think I found a bug Message-ID: <183DC746C8644A2D814ABF7407C3E50B@RichDesktop> (%i1) inpart:true; (e1) true (%i2) op(-a*b); (e2) - (%i3) inpart:false; (e3) false (%i4) op(-a*b); (e4) - (%i5) op((-a)*b); (e5) - (%i6) simp:false; (e6) false (%i7) op((-a)*b); (e7) * (%i8) inpart((-a)*b,1); (e8) - a (%i9) inpart:true; (e9) true (%i10) inpart((-a)*b,1); (e10) - a (%i11) inpart(-a*b,1); (e11) - a (%i12) op(-a*b,1); Maxima encountered a Lisp error: Error in MACSYMA-TOP-LEVEL [or a callee]: MACSYMA-TOP-LEVEL [or a calle Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. (%i13) op(-a*b); (e13) * (%i14) op(-a*b); (e14) * Why is e13 different than e2, they should be the same, I think it has something due to the error. Rich From willisb at unk.edu Mon Feb 2 20:59:22 2009 From: willisb at unk.edu (Barton Willis) Date: Mon, 2 Feb 2009 20:59:22 -0600 Subject: [Maxima] question / comments about sublis Message-ID: Ignoring the sublis_apply_lambda option, it's possible to rewrite sublis.lisp to call the CL function sublis. It takes about 10 lines of code. And you get a generalization: (%i1) sublis([x^2=a, y= 7], x^2 * y); `sublis': Bad 1st arg (%i2) load("sublis.lisp")$ (%i3) sublis([x^2=a, y= 7], x^2 * y); (%o3) 7*a This fixes no bugs, so it's just self-amusement. As for substitution into conditionals, and etc, I think most of the problems are due to the frailties of the conditional. And I think subst is supposed do what it is told: (%i8) subst(x=0, limit(x * f(x,z),z,9)); (%o8) 0 There is no multivariable limit, so we can't do things like limit(x * f(x,z),[z=9, x=0]) :( From robert.dodier at gmail.com Mon Feb 2 21:26:09 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 2 Feb 2009 20:26:09 -0700 Subject: [Maxima] fun with hours, minutes, seconds etc Message-ID: Hello, inspired by a recent question about carpentry, I've committed some new stuff in ezunits. As before foo ` bar `` baz changes units bar to units baz. Now if baz is a list, the result is a list in which quantities are integers except for the last. load (ezunits); 86401 ` s `` [hour, minute, s]; => [24 ` hour, 0 ` minute, 1 ` s] 10^7 ` m^2 `` [mile^2, acre, foot^2, inch^2]; => [3 ` mile^2, 551 ` acre, 2344 ` foot^2, 388096/16129 ` inch^2] map (lambda ([x], x `` m^2), %); => [121405692672/15625 ` m^2, 174204522558/78125 ` m^2, 85064346/390625 ` m^2, 6064/390625 ` m^2] apply ("+", %); => 10000000 ` m^2 x ` m `` [yard, foot, inch]; => [floor(1250*x/1143) ` yard, floor(3*(1250*x/1143-floor(1250*x/1143))) ` foot, 12*(3*(1250*x/1143-floor(1250*x/1143)) -floor(3*(1250*x/1143-floor(1250*x/1143)))) ` inch] ev (%, x = 500); => [546 ` yard, 2 ` foot, 640/127 ` inch] I thought about making the result something like x ` hour + y ` minute + z ` s but Maxima reorders operands of "+". I guess I could invent a noncommutative plus operator. Hope this is useful to someone. I'd be glad to read any comments. Robert Dodier From fateman at cs.berkeley.edu Mon Feb 2 22:42:13 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Mon, 02 Feb 2009 20:42:13 -0800 Subject: [Maxima] question / comments about sublis In-Reply-To: References: Message-ID: <4987CB25.3050306@cs.berkeley.edu> A reason to call the program sublis is that it corresponds to an already existing common lisp function. Less intellectual overhead for people who know lisp already, and a tribute to those who came up with the name. Probably in the period 1959-61. Barton Willis wrote: > Ignoring the sublis_apply_lambda option, it's possible to rewrite > sublis.lisp to call the CL function sublis. It takes about 10 lines of > code. And you get a generalization: > > (%i1) sublis([x^2=a, y= 7], x^2 * y); > `sublis': Bad 1st arg > > (%i2) load("sublis.lisp")$ > (%i3) sublis([x^2=a, y= 7], x^2 * y); > (%o3) 7*a > > This fixes no bugs, so it's just self-amusement. > > As for substitution into conditionals, and etc, I think most of the > problems are due to the frailties of the conditional. And I think > subst is supposed do what it is told: > > (%i8) subst(x=0, limit(x * f(x,z),z,9)); > (%o8) 0 > > There is no multivariable limit, so we can't do things like > limit(x * f(x,z),[z=9, x=0]) :( > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From fateman at cs.berkeley.edu Mon Feb 2 23:20:04 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Mon, 02 Feb 2009 21:20:04 -0800 Subject: [Maxima] fun with hours, minutes, seconds etc In-Reply-To: References: Message-ID: <4987D404.9080403@cs.berkeley.edu> Robert Dodier wrote: > Hello, > > inspired by a recent question about carpentry, I've committed some > new stuff in ezunits. As before foo ` bar `` baz changes units bar > to units baz. Now if baz is a list, the result is a list in which > quantities are integers except for the last. > > load (ezunits); > > 86401 ` s `` [hour, minute, s]; > => [24 ` hour, 0 ` minute, 1 ` s] > > 10^7 ` m^2 `` [mile^2, acre, foot^2, inch^2]; > => [3 ` mile^2, 551 ` acre, 2344 ` foot^2, 388096/16129 ` inch^2] > > map (lambda ([x], x `` m^2), %); > => [121405692672/15625 ` m^2, 174204522558/78125 ` m^2, > 85064346/390625 ` m^2, 6064/390625 ` m^2] > > apply ("+", %); > => 10000000 ` m^2 > > x ` m `` [yard, foot, inch]; > => [floor(1250*x/1143) ` yard, > floor(3*(1250*x/1143-floor(1250*x/1143))) ` foot, > 12*(3*(1250*x/1143-floor(1250*x/1143)) > -floor(3*(1250*x/1143-floor(1250*x/1143)))) ` inch] > > ev (%, x = 500); > => [546 ` yard, 2 ` foot, 640/127 ` inch] > > I thought about making the result something like x ` hour > + y ` minute + z ` s but Maxima reorders operands of "+". > I guess I could invent a noncommutative plus operator. > Fun but I prefer not to mess with the syntax; my fear of such changes is possible problems from front ends' displays, and also interference from other syntax changes. convert_units(number,old_units, new_units) could handle convert_units(60,sec,[hours,minutes]) Maple and Mathematica have commands that push expressions in certain directions that are sort of analogous. e.g. pushing asin toward log, or cos towards complex exponential ... convert(expression, [exp]). or simplify(expression, [exp]). These are not units, of course. RJF From smh at franz.com Mon Feb 2 23:51:13 2009 From: smh at franz.com (Steve Haflich) Date: Mon, 02 Feb 2009 21:51:13 -0800 Subject: [Maxima] fun with hours, minutes, seconds etc In-Reply-To: <4987D404.9080403@cs.berkeley.edu> References: <4987D404.9080403@cs.berkeley.edu> Message-ID: <30550.1233640273@gemini.franz.com> Anyone interested in this topic might want to review the work of Martin Mallinson, who has been doing apllied engineering in Common Lisp for many years, and has developed a body of reader and printer customisations that support friendly engineering notation. He's spoken about this at ILC --- slides and audio are here: http://www.international-lisp-conference.org/2005/speakers.html#martin_mallinson Martin is approachable and I believe he might be willing to share this code if anyone thought it would be useful in Maxima. Of course, integrating anything new into Maxima syntax is probably not easy (as rjf points out) but Martin's experiences might at least be useful to anyone undertaking something like this. Engineering math isn't the _best_ math, but it's often the math that pays the bills. From luke.scharf at clusterbee.net Mon Feb 2 09:47:40 2009 From: luke.scharf at clusterbee.net (Luke Scharf) Date: Mon, 02 Feb 2009 09:47:40 -0600 Subject: [Maxima] Configuring Maxima output as an improper fraction? In-Reply-To: <49870E26.5090101@cs.berkeley.edu> References: <498201A9.8010604@clusterbee.net> <49870E26.5090101@cs.berkeley.edu> Message-ID: <4987159C.2060706@clusterbee.net> Richard Fateman wrote: > Why not multiply your result by 1.0, and use decimal. It seems to me > that you probably don't want improper fractions that are smaller than > 1/16 or 1/32. You can buy a ruler that has a decimal to fraction > table engraved on the back. I thought about that, and about making a lookup table for the decimals->fraction conversions that I haven't memorized yet, and using a conventional calculator -- but I couldn't find my calculator, and I was stubborn, and it was late, and it was a good opportunity to learn a new application. Plus, the reason I wanted to use a symbolic math system was because I wanted my calculations to match my application, not the other way around. :-) I guess I just have an engineer's attitude toward math involving Real numbers -- no matter how much guff my girlfriend (who is pursuing a PHD in a sciency field) gives me for it... :-) -Luke From thedickster at gmail.com Mon Feb 2 13:00:46 2009 From: thedickster at gmail.com (Richard Schneeman) Date: Mon, 2 Feb 2009 13:00:46 -0600 Subject: [Maxima] Format Maxima Output Message-ID: <36328a5d0902021100x66cbc9ffxf9bf695a1b96a90@mail.gmail.com> Hey, first post. I'm interfacing maxima with ruby using the command line but it is difficult to format maxima's output of : a --- b c into: a/(b*c). Are there any options to change how maxima renders its answer? Also are there any good maxima forums online? Thanks!! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090202/a4733b0b/attachment.htm From al at beshenov.ru Tue Feb 3 01:01:43 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Tue, 3 Feb 2009 10:01:43 +0300 Subject: [Maxima] Format Maxima Output In-Reply-To: <36328a5d0902021100x66cbc9ffxf9bf695a1b96a90@mail.gmail.com> References: <36328a5d0902021100x66cbc9ffxf9bf695a1b96a90@mail.gmail.com> Message-ID: <200902031001.44123.al@beshenov.ru> On Monday 02 February 2009 22:00:46 Richard Schneeman wrote: > I'm interfacing maxima with ruby using the command line but it is > difficult to format maxima's output of : > > a > --- > b c > > into: > > a/(b*c). > > Are there any options to change how maxima renders its answer? display2d : false > are there any good maxima forums online? maxima at math.utexas.edu -- Prickle Prickle, Chaos 34 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From willisb at unk.edu Tue Feb 3 06:45:07 2009 From: willisb at unk.edu (Barton Willis) Date: Tue, 3 Feb 2009 06:45:07 -0600 Subject: [Maxima] question / comments about sublis In-Reply-To: <4987CB25.3050306@cs.berkeley.edu> References: , <4987CB25.3050306@cs.berkeley.edu> Message-ID: I modified simp-%if to delay simplification of the final two arguments until after the first argument is simplified. Since sublis simplifies after all subs are made and subst simplifies along the way, we get: (%i6) load("to_poly_solve_extra.lisp")$ (%i7) f : %if(x < 1, 5, log(x)); (%o7) %if(-(x-1)>0,5,log(x)) (%i8) sublis([x=0],f); (%o8) 5 (%i9) subst([x=0],f); log(0) has been generated. I'm a sublis fan. Using GCL, my ten line sublis function is slower than the Maxima version. Barton From robert.dodier at gmail.com Tue Feb 3 09:20:04 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 3 Feb 2009 08:20:04 -0700 Subject: [Maxima] question / comments about sublis In-Reply-To: <4987CB25.3050306@cs.berkeley.edu> References: <4987CB25.3050306@cs.berkeley.edu> Message-ID: On 2/2/09, Richard Fateman wrote: > A reason to call the program sublis is that it corresponds to an already > existing common lisp function. > Less intellectual overhead for people who know lisp already, I'm pretty sure it's in the best interests of the project to focus on the other 99% of users. Robert Dodier From robert.dodier at gmail.com Tue Feb 3 09:34:32 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 3 Feb 2009 08:34:32 -0700 Subject: [Maxima] question / comments about sublis In-Reply-To: References: Message-ID: On 2/2/09, Barton Willis wrote: > Ignoring the sublis_apply_lambda option, it's possible to rewrite > sublis.lisp to call the CL function sublis. It takes about 10 lines of > code. Does the 10 lines include whatever it takes to replicate the features of subst? If so, I would say go ahead and change it. > As for substitution into conditionals, and etc, I think most of the > problems are due to the frailties of the conditional. The branches of a conditional are simplified (but not evaluated) and errors such as 1/0 and 0^0 are triggered in simplification. So an error is to be expected from subst(x=0, if x>0 then 1/x else foo). Maybe instead of substitution what is intended is evaluation in an environment in which x is bound to 0; i.e. either block([x : 0], if x > 0 then 1/x else foo) or ev(if x > 0 then 1/x else foo, x=0). > And I think subst is supposed do what it is told: Agreed. best Robert From willisb at unk.edu Tue Feb 3 10:04:55 2009 From: willisb at unk.edu (Barton Willis) Date: Tue, 3 Feb 2009 10:04:55 -0600 Subject: [Maxima] question / comments about sublis In-Reply-To: References: Message-ID: maxima-bounces at math.utexas.edu wrote on 02/03/2009 09:34:32 AM: > On 2/2/09, Barton Willis wrote: > > > Ignoring the sublis_apply_lambda option, it's possible to rewrite > > sublis.lisp to call the CL function sublis. It takes about 10 lines of > > code. > > Does the 10 lines include whatever it takes to replicate the > features of subst? No, $substitute has code that helps with "at" substitutions (the "atp" special). Further, $substitute allows for semantic substitutions in square roots and etc that sublis lacks. Finally, several option variables (opsubst, subnumsimp, sqrtdispflag, derivsubst, and exptsubst) modify $substitute, but not sublis. Barton From macrakis at alum.mit.edu Tue Feb 3 10:17:45 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Tue, 3 Feb 2009 11:17:45 -0500 Subject: [Maxima] fun with hours, minutes, seconds etc In-Reply-To: References: Message-ID: <8b356f880902030817r493783dcqc57ad39ce3be7cd7@mail.gmail.com> Nice... what happens if you add a fractional-inch unit? Do you get 3/2`inch `` [inch, finch] => [1 inch, 1/2 finch]? Which was the original requirement.... -s On Mon, Feb 2, 2009 at 10:26 PM, Robert Dodier wrote: > Hello, > > inspired by a recent question about carpentry, I've committed some > new stuff in ezunits. As before foo ` bar `` baz changes units bar > to units baz. Now if baz is a list, the result is a list in which > quantities are integers except for the last. > > load (ezunits); > > 86401 ` s `` [hour, minute, s]; > => [24 ` hour, 0 ` minute, 1 ` s] > > 10^7 ` m^2 `` [mile^2, acre, foot^2, inch^2]; > => [3 ` mile^2, 551 ` acre, 2344 ` foot^2, 388096/16129 ` inch^2] > > map (lambda ([x], x `` m^2), %); > => [121405692672/15625 ` m^2, 174204522558/78125 ` m^2, > 85064346/390625 ` m^2, 6064/390625 ` m^2] > > apply ("+", %); > => 10000000 ` m^2 > > x ` m `` [yard, foot, inch]; > => [floor(1250*x/1143) ` yard, > floor(3*(1250*x/1143-floor(1250*x/1143))) ` foot, > 12*(3*(1250*x/1143-floor(1250*x/1143)) > -floor(3*(1250*x/1143-floor(1250*x/1143)))) ` inch] > > ev (%, x = 500); > => [546 ` yard, 2 ` foot, 640/127 ` inch] > > I thought about making the result something like x ` hour > + y ` minute + z ` s but Maxima reorders operands of "+". > I guess I could invent a noncommutative plus operator. > > Hope this is useful to someone. I'd be glad to read any comments. > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From fateman at cs.berkeley.edu Tue Feb 3 10:24:37 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Tue, 03 Feb 2009 08:24:37 -0800 Subject: [Maxima] question / comments about sublis In-Reply-To: References: <4987CB25.3050306@cs.berkeley.edu> Message-ID: <49886FC5.4020106@cs.berkeley.edu> I didn't say it was the best reason. However: If 1% of the users already know the name sublis from common lisp, but 0% of the users have seen the name-you-just-made-up-for-sublis, then there is an infinite advantage in familiarity in using the name from common lisp. :) Either one could be explained in the documentation and cross referenced etc etc. Robert Dodier wrote: > On 2/2/09, Richard Fateman wrote: > > >> A reason to call the program sublis is that it corresponds to an already >> existing common lisp function. >> Less intellectual overhead for people who know lisp already, >> > > I'm pretty sure it's in the best interests of the project to focus on > the other 99% of users. > > Robert Dodier > From mehmet.suzen at physics.org Tue Feb 3 10:52:13 2009 From: mehmet.suzen at physics.org (Mehmet Suzen) Date: Tue, 03 Feb 2009 17:52:13 +0100 Subject: [Maxima] generating very long binary sequences Message-ID: <4988763D.2030902@physics.org> Hi All, What can you suggest to generate very long pseudorandom binary sequence? (At least 1-2 Ghz) Are there any implementation of Maximum Length Sequence (MLS)? Greetings, Mehmet Suzen From ziga.lenarcic at gmail.com Tue Feb 3 11:01:22 2009 From: ziga.lenarcic at gmail.com (=?UTF-8?Q?=C5=BDiga_Lenar=C4=8Di=C4=8D?=) Date: Tue, 3 Feb 2009 18:01:22 +0100 Subject: [Maxima] question / comments about sublis Message-ID: <9D17A424-DCD4-40AE-8D0A-106AC154E151@gmail.com> > When function names are related to what they do, they are easier to remember. Also, functions with similar functionality, with similar words are easier to remember. random_real(), random_integer() are much better choice than rand(), ranint() for instance (imo :)). So I'm in favour of subst_parallel. Thats my view of the matter. While discousing Maxima function names, I think Maxima functions should follow mathematical notation if possible. Functions with "programmer" names: atan, asin, atan2 ... should be named arcsin, arctan, arctan(x,y)... since this is the usual mathematical notation. Also realpart and imagpart could be named "Re" and "Im", which is shorter and "correct" in mathematical sense (at least where I live). I know that changing function names creates a lot of problems, so I don't expect such changes will be implemented soon (or are in everyone's current interest). Maybe with the next major version (maxima 6), names could be "corrected", while having aliases for the old names so as not to break existing maxima programs. Ziga > I didn't say it was the best reason. However: > If 1% of the users already know the name sublis from common lisp, but > 0% of the users have seen the name-you-just-made-up-for-sublis, then > there is > an infinite advantage in familiarity in using the name from common > lisp. :) > > Either one could be explained in the documentation and cross > referenced > etc etc. From robert.dodier at gmail.com Tue Feb 3 14:03:49 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 3 Feb 2009 13:03:49 -0700 Subject: [Maxima] fun with hours, minutes, seconds etc In-Reply-To: <8b356f880902030817r493783dcqc57ad39ce3be7cd7@mail.gmail.com> References: <8b356f880902030817r493783dcqc57ad39ce3be7cd7@mail.gmail.com> Message-ID: On Tue, Feb 3, 2009 at 9:17 AM, Stavros Macrakis wrote: > Nice... what happens if you add a fractional-inch unit? Do you get > 3/2`inch `` [inch, finch] => [1 inch, 1/2 finch]? Well, maybe this: 3/2 ` inch `` [inch, inch]; => [1 ` inch, 1/2 ` inch] or this: declare_unit_conversion (hairs_breadth=1/100*inch); 3/2 ` inch `` [inch, hairs_breadth]; => [1 ` inch, 50 ` hairs_breadth] FWIW Robert From robert.dodier at gmail.com Tue Feb 3 14:10:26 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Tue, 3 Feb 2009 13:10:26 -0700 Subject: [Maxima] generating very long binary sequences In-Reply-To: <4988763D.2030902@physics.org> References: <4988763D.2030902@physics.org> Message-ID: On Tue, Feb 3, 2009 at 9:52 AM, Mehmet Suzen wrote: > What can you suggest to generate very long pseudorandom binary sequence? > (At least 1-2 Ghz) Well, Maxima has an implementation of the Mersenne twister rng. You could concatenate outputs from that to get a long sequence. The Maxima function is "random" and the source code is src/rand-mt19937.lisp. > Are there any implementation of Maximum Length Sequence (MLS)? I don't know what that is. Maybe you can explain briefly. Robert Dodier From mehmet.suzen at physics.org Wed Feb 4 01:27:04 2009 From: mehmet.suzen at physics.org (Mehmet Suzen) Date: Wed, 04 Feb 2009 08:27:04 +0100 Subject: [Maxima] generating very long binary sequences In-Reply-To: References: <4988763D.2030902@physics.org> Message-ID: <49894348.6000308@physics.org> Robert Dodier wrote: > On Tue, Feb 3, 2009 at 9:52 AM, Mehmet Suzen wrote: > >> What can you suggest to generate very long pseudorandom binary sequence? >> (At least 1-2 Ghz) > > Well, Maxima has an implementation of the Mersenne twister rng. > You could concatenate outputs from that to get a long sequence. > The Maxima function is "random" and the source code is src/rand-mt19937.lisp. Do you know how long sequence is considered to be safely pseudorandom with the implementation? (not repeating!) Can you suggest a reference for the Mersenne Twister? > >> Are there any implementation of Maximum Length Sequence (MLS)? It's explained here: http://en.wikipedia.org/wiki/N-sequence I have read somewhere that one can generate very long random binary sequences with this. > > I don't know what that is. Maybe you can explain briefly. > > Robert Dodier From luke.scharf at clusterbee.net Tue Feb 3 10:40:40 2009 From: luke.scharf at clusterbee.net (Luke Scharf) Date: Tue, 03 Feb 2009 10:40:40 -0600 Subject: [Maxima] Configuring Maxima output as an improper fraction? In-Reply-To: References: <498201A9.8010604@clusterbee.net> Message-ID: <49887388.3010106@clusterbee.net> Robert Dodier wrote: > On 1/29/09, Luke Scharf wrote: > > >> Is there a way to configure Maxima to output the result as an improper >> fraction? >> >> For instance, if I enter 3/4+3/4, then it outputs 3/2. Since I'm doing >> arithmetic for a woodworking project, it would be easier if it would >> output as 1+1/2. Or 1+4/8 would be super-useful, too. Is there a way >> to make Maxima to do that? >> > > Luke, I've attached some code which changes the way literal rational > numbers are displayed. It doesn't change the way expressions are > constructed, only the pretty-printing display. It doesn't change the > 1-dimensional display, that could be done with the same approach. > Very cool -- many thanks! -Luke From adammaj1 at o2.pl Wed Feb 4 10:46:37 2009 From: adammaj1 at o2.pl (Adam Majewski) Date: Wed, 04 Feb 2009 17:46:37 +0100 Subject: [Maxima] plot_options description in help Message-ID: Hi In my Maxima help in plot_options is : [gnuplot_outfile, "graph3.png"] I think that it should be changed to : [gnuplot_out_file, "graph3.png"] I have wxMaxima 0.7.6 http://wxmaxima.sourceforge.netMaxima 5.16.3 http://maxima.sourceforge.netUsing Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL)Distributed under the GNU Public License. See the file COPYING.Dedicated to the memory of William Schelter.The function bug_report() provides bug reporting information. and help : This document was generated by Robert Dodier on August, 24 2008 using texi2html 1.76. Adam From robert.dodier at gmail.com Wed Feb 4 12:15:08 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 4 Feb 2009 11:15:08 -0700 Subject: [Maxima] generating very long binary sequences In-Reply-To: <49894348.6000308@physics.org> References: <4988763D.2030902@physics.org> <49894348.6000308@physics.org> Message-ID: On Wed, Feb 4, 2009 at 12:27 AM, Mehmet Suzen wrote: > Do you know how long sequence is considered to be safely pseudorandom with > the implementation? (not repeating!) The period of MT19937 is 2^19337 - 1 or thereabouts, I don't remember exactly. > Can you suggest a reference for the Mersenne Twister? I don't have any at the moment, I think Google should find some. best Robert Dodier From David.Billinghurst at riotinto.com Wed Feb 4 15:33:26 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Thu, 5 Feb 2009 08:33:26 +1100 Subject: [Maxima] generating very long binary sequences References: <4988763D.2030902@physics.org><49894348.6000308@physics.org> Message-ID: <026DCC31AB859648A6F16C0E5CD2580D0180B3A2@calttsv025.cal.riotinto.org> > From: Robert Dodier > On Wed, Feb 4, 2009 at 12:27 AM, Mehmet Suzen > wrote: > > > Can you suggest a reference for the Mersenne Twister? The file src/rand-mt19937.lisp http://maxima.cvs.sourceforge.net/viewvc/maxima/maxima/src/rand-mt19937. lisp?view=log says: ;;; Support for the Mersenne Twister, MT19937, random number generator ;;; due to Matsumoto and Nishimura. This implementation has been ;;; placed in the public domain with permission from M. Matsumoto. ;;; ;;; Makoto Matsumoto and T. Nishimura, "Mersenne twister: A ;;; 623-dimensionally equidistributed uniform pseudorandom number ;;; generator.", ACM Transactions on Modeling and Computer Simulation, ;;; 1997, to appear. google will find a copy on the authors home page. This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. From mehmet.suzen at physics.org Wed Feb 4 21:34:42 2009 From: mehmet.suzen at physics.org (Mehmet Suzen) Date: Thu, 05 Feb 2009 04:34:42 +0100 Subject: [Maxima] generating very long binary sequences In-Reply-To: <1d67a53c0902040015v675996c6y7636e66c66f9b6dc@mail.gmail.com> References: <4988763D.2030902@physics.org> <49894348.6000308@physics.org> <1d67a53c0902040015v675996c6y7636e66c66f9b6dc@mail.gmail.com> Message-ID: <498A5E52.1060505@physics.org> Thanks Alasdair, the length of m-sequence looks considerably smaller then the MT19937. So I guess using MT19937 is safer, right? -m Alasdair McAndrew wrote: > Grab a primitive polynomial from > http://www.jjj.de/mathdata/all-lowblock-primpoly-short.txt and use it to > generate your sequence. A primitive polynomial of degree n will produce > an m-sequence of length 2^n-1. > > -Alasdair > > On Wed, Feb 4, 2009 at 6:27 PM, Mehmet Suzen > wrote: > > > > Robert Dodier wrote: > > On Tue, Feb 3, 2009 at 9:52 AM, Mehmet Suzen > > wrote: > > > >> What can you suggest to generate very long pseudorandom binary > sequence? > >> (At least 1-2 Ghz) > > > > Well, Maxima has an implementation of the Mersenne twister rng. > > You could concatenate outputs from that to get a long sequence. > > The Maxima function is "random" and the source code is > src/rand-mt19937.lisp. > > Do you know how long sequence is considered to be safely pseudorandom > with the implementation? (not repeating!) Can you suggest a reference > for the Mersenne Twister? > > > > >> Are there any implementation of Maximum Length Sequence (MLS)? > > It's explained here: > http://en.wikipedia.org/wiki/N-sequence > I have read somewhere that one can generate very long random binary > sequences with this. > > > > > I don't know what that is. Maybe you can explain briefly. > > > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > > > > > -- > Blog: http://amca01.wordpress.com From amca01 at gmail.com Wed Feb 4 21:45:57 2009 From: amca01 at gmail.com (Alasdair McAndrew) Date: Thu, 5 Feb 2009 14:45:57 +1100 Subject: [Maxima] generating very long binary sequences In-Reply-To: <498A5E52.1060505@physics.org> References: <4988763D.2030902@physics.org> <49894348.6000308@physics.org> <1d67a53c0902040015v675996c6y7636e66c66f9b6dc@mail.gmail.com> <498A5E52.1060505@physics.org> Message-ID: <1d67a53c0902041945t5d1d83fax55bc8c505064bf41@mail.gmail.com> It depends on what you want: m-sequences have very nice auto-correlation properties, but if you're just wishing to produce uniformly distributed random numbers, then the Mersenne twister is better. You might also check Marsaglia's complimentary-multiply-with-carry generator, described at http://groups.google.com/group/comp.lang.c/browse_thread/thread/a9915080a4424068/ and which is simpler than MT, as well as being faster, and having a longer period. -Alasdair On Thu, Feb 5, 2009 at 2:34 PM, Mehmet Suzen wrote: > Thanks Alasdair, the length of m-sequence looks considerably smaller then > the MT19937. So I guess using MT19937 is safer, right? > > -m > > Alasdair McAndrew wrote: > >> Grab a primitive polynomial from >> http://www.jjj.de/mathdata/all-lowblock-primpoly-short.txt and use it to >> generate your sequence. A primitive polynomial of degree n will produce an >> m-sequence of length 2^n-1. >> -Alasdair >> >> On Wed, Feb 4, 2009 at 6:27 PM, Mehmet Suzen > mehmet.suzen at physics.org>> wrote: >> >> >> >> Robert Dodier wrote: >> > On Tue, Feb 3, 2009 at 9:52 AM, Mehmet Suzen >> > wrote: >> > >> >> What can you suggest to generate very long pseudorandom binary >> sequence? >> >> (At least 1-2 Ghz) >> > >> > Well, Maxima has an implementation of the Mersenne twister rng. >> > You could concatenate outputs from that to get a long sequence. >> > The Maxima function is "random" and the source code is >> src/rand-mt19937.lisp. >> >> Do you know how long sequence is considered to be safely pseudorandom >> with the implementation? (not repeating!) Can you suggest a reference >> for the Mersenne Twister? >> >> > >> >> Are there any implementation of Maximum Length Sequence (MLS)? >> >> It's explained here: >> http://en.wikipedia.org/wiki/N-sequence >> I have read somewhere that one can generate very long random binary >> sequences with this. >> >> > >> > I don't know what that is. Maybe you can explain briefly. >> > >> > Robert Dodier >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> >> >> >> >> -- >> Blog: http://amca01.wordpress.com >> > -- Blog: http://amca01.wordpress.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090205/a740d909/attachment.htm From caruso at dm.unipi.it Thu Feb 5 05:21:24 2009 From: caruso at dm.unipi.it (Fabrizio Caruso) Date: Thu, 5 Feb 2009 12:21:24 +0100 (CET) Subject: [Maxima] bibtex for maxima In-Reply-To: References: Message-ID: What is the best/standard way to cite Maxima? Could we have it on the home page? I am sorry for this question because this must have been asked more than once. Fabrizio From christophe.deroulers__maxml1 at normalesup.org Thu Feb 5 06:37:44 2009 From: christophe.deroulers__maxml1 at normalesup.org (Christophe Deroulers) Date: Thu, 5 Feb 2009 13:37:44 +0100 (CET) Subject: [Maxima] Patch to make ic2 work even with i.c. 'y(x)= (fwd) In-Reply-To: <026DCC31AB859648A6F16C0E5CD2580D0180B253@calttsv025.cal.riotinto.org> References: <026DCC31AB859648A6F16C0E5CD2580D0180B253@calttsv025.cal.riotinto.org> Message-ID: On Tue, 3 Feb 2009, Billinghurst, David (RTATECH) wrote: >> From: Robert Dodier >> >> On 1/30/09, Christophe Deroulers wrote: >> >>> This is a patch proposal / feature request. >>> >>> In brief: >>> --------- >>> Change subs([xa,ya],soln) to subs([ya,xa],soln) in the >> line 318 of >>> the file share/diffequations/ode2.mac . >>> >>> This would allow initial conditions like 'y(x)=2 (for an O.D.E. >>> written like "... + 'y(x)= 0") in addition to initial >> conditions like >>> y=2 (for an O.D.E. written like "... + y = 0"). >> >> OK by me if we can verify that the proposed patch doesn't >> change the behavior of the ODE code for existing problems. >> There is a large test suite for Maxima's ODE code -- I don't >> know how much (if any) calls the function touched by the patch. >> Perhaps you, Christophe, can look into it and report on it. Thank you, Robert, for your interest. What you propose sounds good to me. David: > There are only two tests of ic2 in the testsuite, and none in > the share/contrib/diffequations testsuite. I think we need > more before we can be sure there are no adverse effects. Indeed, there are 37 tests involving ode2 but only 2 involving ic2. Maybe the first thing to do would be to add more tests calling ic2 (ideally one test of ic2 for each test of ode2)? Then one could go ahead with the patch. I'll see if I can do that. Best wishes, Christophe Deroulers University Paris Diderot-Paris 7 From David.Billinghurst at riotinto.com Thu Feb 5 16:29:29 2009 From: David.Billinghurst at riotinto.com (Billinghurst, David (RTATECH)) Date: Fri, 6 Feb 2009 09:29:29 +1100 Subject: [Maxima] Patch to make ic2 work even with i.c. 'y(x)= (fwd) References: <026DCC31AB859648A6F16C0E5CD2580D0180B253@calttsv025.cal.riotinto.org> Message-ID: <026DCC31AB859648A6F16C0E5CD2580D0180B49C@calttsv025.cal.riotinto.org> > David: > > There are only two tests of ic2 in the testsuite, and none in the > > share/contrib/diffequations testsuite. I think we need > more before we > > can be sure there are no adverse effects. > > Indeed, there are 37 tests involving ode2 but only 2 > involving ic2. Maybe the first thing to do would be to add > more tests calling ic2 (ideally one test of ic2 for each test > of ode2)? Then one could go ahead with the patch. I'll see if > I can do that. > > Best wishes, > > Christophe Deroulers > University Paris Diderot-Paris 7 I like tests. maxima is complex and changes can have unexpected consequences (although probably not in this case). I don't think we need one ic2 test for each ode2 test, but we do need to test each path through the code, and also the different ways that the solutions can be expressed. I also want to understand what you patch does. I have never looked at the ic2 function before and need to step through some examples. It is going to be an inside day tomorrow (43 C) so I will try and find time. David This email is confidential and may also be privileged. If you are not the intended recipient, please notify us immediately and delete this message from your system without first printing or copying it. Any personal data in this email (including any attachments) must be handled in accordance with the Rio Tinto Group Data Protection Policy and all applicable data protection laws. From camm at maguirefamily.org Thu Feb 5 21:42:38 2009 From: camm at maguirefamily.org (Camm Maguire) Date: Thu, 05 Feb 2009 22:42:38 -0500 Subject: [Maxima] Runtime determination of share directories? In-Reply-To: (Robert Dodier's message of "Fri\, 23 Jan 2009 09\:12\:54 -0700") References: <497924AE.9030406@gmail.com> Message-ID: <87prhwgrip.fsf@maguirefamily.org> Greetings! Robert Dodier writes: > On 1/22/09, Raymond Toy wrote: > >> Wouldn't it be nicer if we could do this at startup and just find all of >> the directories in share directory? Then we wouldn't have to maintain >> this list at all, and users can easily add share packages themselves and >> have them automatically available. (Well, perhaps we could keep a few >> of the core share packages in the list, but most would be determined at >> runtime). > > Yes, that's a good idea. Have at it! > >> I played with this a while back, but never finished it. I think, >> however, that all of the lisps we support can do this using the Lisp >> DIRECTORY function with a bit of extra glue to return the right stuff. >> GCL might be a bit more difficult, but I think it can be done there too. > > I believe it is within the realm of possibility that we might stop > working around GCL's idiosyncrasies. > It would be helpful if you could describe what 'idiosyncrasies' you find onerous, and perhaps suggest what type of behavior would be optimal. This is the first I've heard of this, and only by happenstance when catching up on the maxima mailing list. (I have received a suggestion to implement a more native directory function, but was not aware that this was causing any real difficulties in current applications. After reading the above, I still don't understand the issue.) GCL is very much alive, but proceeds in bursts as many open source projects. Needless to say, if the GCL community can do something differently to be more useful for maxima, we'd certainly be open to suggestions. Take care, -- Camm Maguire camm at maguirefamily.org ========================================================================== "The earth is but one country, and mankind its citizens." -- Baha'u'llah From marik at mendelu.cz Fri Feb 6 09:29:17 2009 From: marik at mendelu.cz (Robert Marik) Date: Fri, 6 Feb 2009 15:29:17 +0000 (UTC) Subject: [Maxima] find minima and maxima points of a function References: <2D40635C5B3E42799B49F640E3BD44AF@windowsa96d2f1> Message-ID: Hi Luigi, very nice, thank you for sharing, but ..... Luigi Marino alice.it> writes: > Example: > > f:x^3/(1-x^2); > stud_funz(f); > minimo[x=-sqrt(3),(3*sqrt(3))/2]massimo[x=sqrt(3),-(3*sqrt(3))/2]massimo[x=0,0] > Does "massimo" mean local maximum? If yes, your example is not correct! There is no local maximum at x=0 (point f inflection, the function behaves like x^3 near origin). You should test maxima/minima more carefully. Another problem: try the function x^2*log(x)/2-x^2/4 the point x=0 is not a local maximum (does not belong to the domain of the function). The problem is that solve(x*log(x)=0,x) returns x=0 which does not belong to the domain. I think that your p[i] could be something like x=3, so you should use ev(f,x:rhs(p[i])) instead of ev(f,x:p[i]) Thank you again for sharing your work with others. From l.butler at ed.ac.uk Fri Feb 6 09:39:38 2009 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 6 Feb 2009 15:39:38 +0000 (GMT) Subject: [Maxima] find minima and maxima points of a function In-Reply-To: References: <2D40635C5B3E42799B49F640E3BD44AF@windowsa96d2f1> Message-ID: < Another problem: try the function x^2*log(x)/2-x^2/4 < the point x=0 is not a local maximum (does not belong to the domain of the < function). The problem is that solve(x*log(x)=0,x) returns x=0 which does not < belong to the domain. x*log(x) has a limit as x->0, (0), so it is conventional to extend x*log(x) to include x=0 in its domain. I believe that maxima does this implicitly. Leo. -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From drdieterkaiser at web.de Fri Feb 6 09:46:24 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Fri, 6 Feb 2009 16:46:24 +0100 Subject: [Maxima] Mirror symmetry and realpart/imagpart of functions In-Reply-To: <8b356f880902021100q61c6f330t1cd1f5fd6b21ddb9@mail.gmail.com> References: <8b356f880902021100q61c6f330t1cd1f5fd6b21ddb9@mail.gmail.com> Message-ID: -----Urspr?ngliche Nachricht----- Von: macrakis at gmail.com [mailto:macrakis at gmail.com] Im Auftrag von Stavros Macrakis I have checked in the handling of realpart/imagpart for function with mirror symmetry and have added some tests to show how it works for the functions expintegral_e, expintegral_ei and expintegral_si. > These are nice transformations, which have the good property of > eliminating realpart/imagpart/abs/carg nouns, which means further > simplifications are possible. However, I am not sure that a user > would always prefer to see > > sqrt(gamma(1-%i))*sqrt(gamma(%i+1)) > > than > > abs(gamma(1+%i)) > > I do not actually have an opinion on this, but I think the question is > worth thinking about.... I hope it will be not too unusual to get the results in terms of the sqrt function if we take the absolute value of a function with mirror symmetry and a complex argument. But the starting point for me was to get a correct realpart/imagpart. If it is necessary to modify this simplification it, we could have a look into the code of the abs function. Remark: Because the conjugate function handles complex and imaginary symbols and expressions carefully, Maxima gets correct results for much more general arguments too. Dieter Kaiser From marik at mendelu.cz Fri Feb 6 09:48:32 2009 From: marik at mendelu.cz (Robert Marik) Date: Fri, 6 Feb 2009 15:48:32 +0000 (UTC) Subject: [Maxima] find minima and maxima points of a function References: <001201c98575$ea13be00$6502a8c0@oemcomputer.Speedport_W_502V_Typ_A> Message-ID: Wolfgang Lindner t-online.de> writes: > > hi Luigi, > > thanks for sharing your code with us. I enjoy it. > Find attached some code examples of Maxima friends (Nelson and Mario) for > the same job. > Maybe you find it interesting, too. > My class and me like it .. > > hth > wolfgang Hi Wolfgang, thank you for sharing the code of your friends. If you use something like this in your classroom, remember, that the linear system [diff(f,x)=0,diff(f,y)=0] may have solution which do not belong to the domain of the function f. In this case your code marks points which do not belong to the domain as maxima or minima. For example x^2+y+ln(y) and the point x=0, y=-1. But I think that only a minor improvement is sufficient to get great macro for local maxima/minima. btw: One of my friends wrote a similar procedure in Maple. He included the test that the results of solve command are real. I think, you can use rectform and imagpart or freeof in Maxima. Robert. From marik at mendelu.cz Fri Feb 6 09:53:06 2009 From: marik at mendelu.cz (Robert Marik) Date: Fri, 6 Feb 2009 15:53:06 +0000 (UTC) Subject: [Maxima] find minima and maxima points of a function References: <2D40635C5B3E42799B49F640E3BD44AF@windowsa96d2f1> Message-ID: Leo Butler ed.ac.uk> writes: > > > < Another problem: try the function x^2*log(x)/2-x^2/4 > < the point x=0 is not a local maximum (does not belong to the domain of the > < function). The problem is that solve(x*log(x)=0,x) returns x=0 which does not > < belong to the domain. > > x*log(x) has a limit as x->0, (0), so it is conventional to extend > x*log(x) to include x=0 in its domain. I believe that maxima does this > implicitly. > I don't think so. Try solve(x/sin(x),x) wxmaxima (not the last version of Maxima, however) on our server returns x=0. Robert > Leo. > From l.butler at ed.ac.uk Fri Feb 6 10:16:10 2009 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 6 Feb 2009 16:16:10 +0000 (GMT) Subject: [Maxima] find minima and maxima points of a function In-Reply-To: References: <2D40635C5B3E42799B49F640E3BD44AF@windowsa96d2f1> Message-ID: On Fri, 6 Feb 2009, Robert Marik wrote: < Leo Butler ed.ac.uk> writes: < < > < > < > < Another problem: try the function x^2*log(x)/2-x^2/4 < > < the point x=0 is not a local maximum (does not belong to the domain of the < > < function). The problem is that solve(x*log(x)=0,x) returns x=0 which does not < > < belong to the domain. < > < > x*log(x) has a limit as x->0, (0), so it is conventional to extend < > x*log(x) to include x=0 in its domain. I believe that maxima does this < > implicitly. < > < < I don't think so. Try solve(x/sin(x),x) < < wxmaxima (not the last version of Maxima, however) on our server returns x=0. That is clearly a bug. Here is what I get on maxima-5.16.3 (%i495) solve(x*csc(x),x); `solve' is using arc-trig functions to get a solution. Some solutions will be lost. (%o495) [x = acsc(0), x = 0] Maxima is factoring the expression and it is not checking if the factorisation is valid where it finds the possible solutions. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From fateman at cs.berkeley.edu Fri Feb 6 11:07:38 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Fri, 06 Feb 2009 09:07:38 -0800 Subject: [Maxima] find minima and maxima points of a function In-Reply-To: References: <2D40635C5B3E42799B49F640E3BD44AF@windowsa96d2f1> Message-ID: <498C6E5A.3080404@cs.berkeley.edu> Leo Butler wrote: > ..... > < > I believe that maxima does this > < > implicitly. > I think it would be more correct to say that maxima does this by being oblivious to the issue. > That is clearly a bug. Well, the notion of solving and the output of the solve command are not necessarily the same. The solve command does not check that all the solutions it returns are actually solutions. One good reason for this is that substituting back and checking is too hard in general. A bug suggests that the program doesn't meet its specifications. In this case I think the specification should be made more explicit. From Rolf.Schirmacher at MuellerBBM.de Fri Feb 6 11:15:53 2009 From: Rolf.Schirmacher at MuellerBBM.de (Schirmacher, Rolf) Date: Fri, 6 Feb 2009 18:15:53 +0100 Subject: [Maxima] Mirror symmetry and realpart/imagpart of functions Message-ID: <2417729F3416D511A27E0090273A963B02910C81@smex01.mbbm.de> > -----Original Message----- > From: maxima-bounces at math.utexas.edu > [mailto:maxima-bounces at math.utexas.edu]On Behalf Of Dieter Kaiser > > -----Urspr?ngliche Nachricht----- > Von: macrakis at gmail.com [mailto:macrakis at gmail.com] Im > Auftrag von Stavros > Macrakis > > I have checked in the handling of realpart/imagpart for > function with mirror > symmetry and have added some tests to show how it works for > the functions > expintegral_e, expintegral_ei and expintegral_si. > > > These are nice transformations, which have the good property of > > eliminating realpart/imagpart/abs/carg nouns, which means further > > simplifications are possible. However, I am not sure that a user > > would always prefer to see > > > > sqrt(gamma(1-%i))*sqrt(gamma(%i+1)) > > > > than > > > > abs(gamma(1+%i)) > > > > I do not actually have an opinion on this, but I think the > question is > > worth thinking about.... > > I hope it will be not too unusual to get the results in terms > of the sqrt > function if we take the absolute value of a function with > mirror symmetry and a > complex argument. But the starting point for me was to get a correct > realpart/imagpart. > > If it is necessary to modify this simplification it, we could > have a look into > the code of the abs function. > > Remark: > > Because the conjugate function handles complex and imaginary > symbols and > expressions carefully, Maxima gets correct results for much > more general > arguments too. > > Dieter Kaiser > I would prefer the approach. The first and probably most important point is to get realpart and imagepart RIGHT - by default, they are not today. The second point is to allow for further simplifications and in general I would call products of sqrt more easy to simplify than abs(). But I admit that it will probably never be possible to display any result in a way "a user would always prefer to see"... So, please go on. Rolf Schirmacher From robert.dodier at gmail.com Fri Feb 6 11:48:07 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Fri, 6 Feb 2009 10:48:07 -0700 Subject: [Maxima] Runtime determination of share directories? In-Reply-To: <87prhwgrip.fsf@maguirefamily.org> References: <497924AE.9030406@gmail.com> <87prhwgrip.fsf@maguirefamily.org> Message-ID: On Thu, Feb 5, 2009 at 8:42 PM, Camm Maguire wrote: > It would be helpful if you could describe what 'idiosyncrasies' you > find onerous, I haven't tried to keep track. Grepping for #+gcl in maxima/src and maxima/share turns up a lot of stuff. A few other items come to mind: GCL doesn't have a CFFI implementation; nonnumeric floats (infinity and not-a-number) can be computed but not displayed; DRIBBLE puts newlines in unexpected places; maximum number of function arguments is small (63 or something). I might have reported some of this stuff to the GCL bug tracker, I don't remember for sure. Thanks for working on GCL. best Robert Dodier From l.butler at ed.ac.uk Fri Feb 6 13:22:26 2009 From: l.butler at ed.ac.uk (Leo Butler) Date: Fri, 6 Feb 2009 19:22:26 +0000 (GMT) Subject: [Maxima] find minima and maxima points of a function In-Reply-To: <498C6E5A.3080404@cs.berkeley.edu> References: <2D40635C5B3E42799B49F640E3BD44AF@windowsa96d2f1> <498C6E5A.3080404@cs.berkeley.edu> Message-ID: On Fri, 6 Feb 2009, Richard Fateman wrote: < Leo Butler wrote: < > ..... < > < > I believe that maxima does this < > < > implicitly. < > < < I think it would be more correct to say that maxima does this by being < oblivious to the issue. < > That is clearly a bug. < < Well, the notion of solving and the output of the solve command are not < necessarily the same. < The solve command does not check that all the solutions it returns are < actually solutions. I think the original poster had the following in mind: an elementary way for 'solve' to check a putative solution x is to verify that x is in the domain. I don't know the internals of 'solve' but it is apparent that it doesn't employ any such checks. (Yes, I am aware that most (all?) cas are hopelessly sloppy on this point, because they allow an expression to define a function without specifying the domain of that function, and determining the domain from an expression is a difficult problem -- but maxima ought to know what are the domains of the elementary functions). < One good reason for this is that substituting back and checking is too hard in < general. < < A bug suggests that the program doesn't meet its specifications. < In this case I think the specification should be made more explicit. One man's bug is another's feature. The point is that there is a shortcoming that can catch a user unaware. If one cannot fix a pothole, at least one ought to put up a warning sign. I would think that a number of cautionary examples, and possible workarounds, could be added to the documentation of 'solve'. Leo. -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From toy.raymond at gmail.com Fri Feb 6 20:47:53 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Fri, 06 Feb 2009 21:47:53 -0500 Subject: [Maxima] Runtime determination of share directories? In-Reply-To: <87prhwgrip.fsf@maguirefamily.org> References: <497924AE.9030406@gmail.com> <87prhwgrip.fsf@maguirefamily.org> Message-ID: <498CF659.8090607@gmail.com> Camm Maguire wrote: > Greetings! > > Robert Dodier writes: > > >> On 1/22/09, Raymond Toy wrote: >> >> >>> Wouldn't it be nicer if we could do this at startup and just find all of >>> the directories in share directory? Then we wouldn't have to maintain >>> this list at all, and users can easily add share packages themselves and >>> have them automatically available. (Well, perhaps we could keep a few >>> of the core share packages in the list, but most would be determined at >>> runtime). >>> >> Yes, that's a good idea. Have at it! >> >> >>> I played with this a while back, but never finished it. I think, >>> however, that all of the lisps we support can do this using the Lisp >>> DIRECTORY function with a bit of extra glue to return the right stuff. >>> GCL might be a bit more difficult, but I think it can be done there too. >>> >> I believe it is within the realm of possibility that we might stop >> working around GCL's idiosyncrasies. >> >> > > It would be helpful if you could describe what 'idiosyncrasies' you > find onerous, and perhaps suggest what type of behavior would be > optimal. Hi Camm! For me, I would like to have DIRECTORY return a list of the files in the given directory and all subdirectories in the given directory. A working ensure-directories-exist would also be nice. Right now, I just call system to run mkdir -p. That only works on Unix systems with mkdir -p. Or alternatively, I'd like some example of how to call C functions from Lisp. I tried to write an interface to mkdir(2), but nothing I've tried actually works. Ray From robert.dodier at gmail.com Sat Feb 7 16:52:47 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 7 Feb 2009 15:52:47 -0700 Subject: [Maxima] revision & translation of errors and other messages Message-ID: Hello, I'd like to arrange for Maxima to translate error messages and other messages via gettext (a message translation system). If I understand correctly there is typically a .po file for each language which lists the translated strings and their translations. These are compile into a .mo file and loaded at run time. The function gettext fetches a translation, if there is one, from a hash table. Many free software projects use this system. I found a CL implementation of gettext: http://users.actrix.co.nz/mycroft/intl.lisp I got permission from the author to license it by GPLv2. (There is a gettext implementation in Clisp but it is written in C. I couldn't find any others in Lisp.) If there isn't too much opposition I'd like to arrange for MERROR and MTELL to run their arguments through gettext. The gettext code is pretty straightforward but I'll need some help about putting .po/.mo files in the right place. Also of course we'll need to find someone to make each .po file. As part of this effort, I am planning to revise the existing messages to a uniform format; the messages were written by many people according to different conventions, so I think it's a good idea to make them all follow the same convention before translating them. Hope this helps. Thanks for any comments. Robert Dodier From drdieterkaiser at web.de Sat Feb 7 17:36:10 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 08 Feb 2009 00:36:10 +0100 Subject: [Maxima] Extensions and improvements of the Beta funtion Message-ID: <1234049770.5476.84.camel@dieter-laptop> Because I am again working on the Incomplete Beta function I had a look at the code of the Beta function. These are the points I would like to suggest to improve: 1. Extension to complex float, bigfloat and complex bigfloat evaluation Because the Gamma function and the Logarithm of the Gamma function are fully implemented we can extend the Beta function too. 2. Use log_gamma for numerical evaluation To avoid an early overflow of an intermediate result use the function log_gamma and not the function gamma for evaluation. 3. Check the arguments to be valid for numerical evaluation Check carefully the arguments. The arguments and the sum of the arguments are not allowed to be a negative integer or a float or bigfloat representation of a negative integer. 4. Extend expansion for positive integer There are two changes: We have one positive integer. We check too if we have a float or bigfloat representation. With this change we get more consistent results. If the second integer is a negative integer, then the sum of the integers has to be negative to get a valid expansion. This is checked carefully. 5. Remove code for both arguments a negative integer The code for the case when both arguments are negative integers don't work anymore. This code returns a representation of the beta function in terms of the Factorial function. But the factorial function is not valid for negative integers. 6. Mirror symmetry and permutation symmetry I have added mirror symmetry. I have added permutation symmetry too. But it does not work. I don't no the reason. Perhaps we have a problem with the noun/verb concept for the beta function. Related bug reports are: SF[831354] beta(-2,1) inconsistent With the changes we would get as expected: (%i16) beta(-2,1); (%o16) -1/2 (%i17) beta(-2.0,1); (%o17) -0.5 (%i18) beta(-2.0,1.0); (%o18) -0.5 But this should give -0.5 too (see below): (%i19) beta(-2,1.0); (%o19) -1/2 Open problem: There are some further small inconsistencies for float and bigfloat numbers e.g. beta(1.0, -2) --> -1/2 and not -0.5. To get all evaluations very consistent more of the code has to be duplicated for the different types of numbers. SF[1860420] "beta_args_sum_to_integer" As suggested in the bug report it is possible to remove this flag. But I think the simplification of expressions like beta(1+a,2-a) is interesting: (%i21) beta_args_sum_to_integer:true; (%o21) true (%i22) beta(1+a,2-a); (%o22) -%pi*(1-a)*a/(2*sin(%pi*(a+1))) One possibility would be to allow this simplification generally. But we have one example in the testsuite which no longer will work. /* sf bug 1730044 - powerseries(1+x^n,x,0) wrong */ powerseries(1+x^n, x, 0); ('sum(x^(i3*n)/beta(2-i3,i3+1),i3,0,inf))/2; The result contains a beta function which will simplify to an expression which generates zeros. Noun/Verb concept: The beta function is implemented as a simplifying function, but the "noun" does not have the name %beta. The noun form is implemented as $beta. I do not know the reason why the naming convention is changed for the beta function. But this change causes problems with the parser and the simplifier. Perhaps we should change it to the convention %beta for a noun and $beta for the verb function. This has to be done in about 15 files and at 40 places. This is the code with the changes: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Implementation of the Beta function ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmvar $beta_args_sum_to_integer nil) ;;; The beta funtion has mirror symmetry (defprop $beta t commutes-with-conjugate) ;;; The Beta function is symmetric beta(a,b) = beta(b,a) ;(eval-when ; #+gcl (load eval) ; #-gcl (:load-toplevel :execute) ; (let (($context '$global) (context '$global)) ; (meval '(($declare) $beta $symmetric)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmfun simpbeta (x vestigial z &aux check) (declare (ignore vestigial)) (twoargcheck x) (setq check x) (let ((u (simpcheck (cadr x) z)) (v (simpcheck (caddr x) z)) ($ratprint nil)) (cond ((or (zerop1 u) (zerop1 v)) (if errorsw (throw 'errorsw t) (merror "Zero argument to `beta'"))) ;; Check for numerical evaluation in float precision ((and (complex-float-numerical-eval-p u v) ;; We use gamma(u)*gamma(v)/gamma(u+v) for numerical ;; evaluation. Therefore u, v or u+v can not be a negative ;; integer or a floating point representation of a negative ;; integer. (and (or (not (numberp u)) (> u 0) (not (= (nth-value 1 (truncate u)) 0))) (and (or (not (numberp v)) (> v 0) (not (= (nth-value 1 (truncate v)) 0))) (and (or (not (numberp (add u v))) (> (add v u) 0) (not (= (nth-value 1 ($truncate (add u v))) 0))))))) ($rectform (power ($float '$%e) (add ($log_gamma ($float u)) ($log_gamma ($float v)) (mul -1 ($log_gamma ($float (add u v)))))))) ;; Check for numerical evaluation in bigfloat precision ((and (not (complex-float-numerical-eval-p u v)) (complex-bigfloat-numerical-eval-p u v) (and (or (not (mnump u)) (eq ($sign u) '$pos) (not (eq ($sign (sub ($truncate u) u)) '$zero))) (or (not (mnump v)) (eq ($sign v) '$pos) (not (eq ($sign (sub ($truncate v) v)) '$zero))) (or (not (mnump (add u v))) (eq ($sign (add u v)) '$pos) (not (eq ($sign (sub ($truncate (add u v)) (add u v))) '$zero))))) ($rectform (power ($bfloat'$%e) (add ($log_gamma ($bfloat u)) ($log_gamma ($bfloat v)) (mul -1 ($log_gamma ($bfloat (add u v)))))))) ;; One of the arguments is a positive integer or a float or a bigfloat ; representation. We try to expand. ((or (and (or (and (integerp u) (plusp u)) (and (mnump u) (eq ($sign u) '$pos) (eq ($sign (sub ($truncate u) u)) '$zero) (setq u ($truncate u)))) (not (and (mnump v) (eq ($sign (sub ($truncate v) v)) '$zero) (eq ($sign v) '$neg) (eq ($sign (add u v)) '$pos)))) (and (or (and (integerp v) (plusp v)) (and (mnump v) (eq ($sign v) '$pos) (eq ($sign (sub ($truncate v) v)) '$zero) (setq v ($truncate v)))) (not (and (mnump u) (eq ($sign (sub ($truncate u) u)) '$zero) (eq ($sign u) '$neg) (eq ($sign (add u v)) '$pos))))) (setq x (add u v)) (power (mul (sub x 1) (simplify (list '(%binomial) (sub x 2) (sub (if (and (integerp u) (plusp u)) u v) 1)))) -1)) ;; At this point both integers are negative ;; the following code will never work. ; ((and (integerp u) (integerp v)) ; (mul2* (div* (list '(mfactorial) (1- u)) ; (list '(mfactorial) (+ u v -1))) ; (list '(mfactorial) (1- v)))) ;; The sum of the arguments is an integer. We expand. ((or (and (ratnump u) (ratnump v) (integerp (setq x (add u v)))) (and $beta_args_sum_to_integer (integerp (setq x (expand1 (add u v) 1 1))))) (let ((w (if (symbolp v) v u))) (div (mul '$%pi (simplify (list '(%binomial) (add (1- x) (neg w)) (1- x)))) (simplify (list '(%sin) (mul w '$%pi)))))) (t (eqtest (list '($beta) u v) check))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Dieter Kaiser From drdieterkaiser at web.de Sat Feb 7 18:03:59 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 08 Feb 2009 01:03:59 +0100 Subject: [Maxima] revision & translation of errors and other messages In-Reply-To: References: Message-ID: <1234051439.5476.108.camel@dieter-laptop> Am Samstag, den 07.02.2009, 15:52 -0700 schrieb Robert Dodier: > Hello, > > I'd like to arrange for Maxima to translate error messages and > other messages via gettext (a message translation system). > If I understand correctly there is typically a .po file for each > language which lists the translated strings and their translations. > These are compile into a .mo file and loaded at run time. > The function gettext fetches a translation, if there is one, > from a hash table. Many free software projects use this system. > > I found a CL implementation of gettext: > http://users.actrix.co.nz/mycroft/intl.lisp > I got permission from the author to license it by GPLv2. > (There is a gettext implementation in Clisp but it is written > in C. I couldn't find any others in Lisp.) > > If there isn't too much opposition I'd like to arrange for > MERROR and MTELL to run their arguments through gettext. > The gettext code is pretty straightforward but I'll need some > help about putting .po/.mo files in the right place. Also of course > we'll need to find someone to make each .po file. Yes, I think too that it would be a nice feature to support other languages. Please let me know if I can help to build up a German translation. > As part of this effort, I am planning to revise the existing > messages to a uniform format; the messages were written > by many people according to different conventions, so I > think it's a good idea to make them all follow the same > convention before translating them. This might be the real challenge to find some conventions. But it would be helpful for the user too to get similar messages for similar problems. Dieter Kaiser From ferriste at gmail.com Sat Feb 7 18:30:09 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Sun, 8 Feb 2009 01:30:09 +0100 Subject: [Maxima] revision & translation of errors and other messages In-Reply-To: References: Message-ID: <200902080130.09779.ferriste@gmail.com> I could help with Italian! Stefano In data sabato 07 febbraio 2009 23:52:47, Robert Dodier ha scritto: : > Hello, > > I'd like to arrange for Maxima to translate error messages and > other messages via gettext (a message translation system). > If I understand correctly there is typically a .po file for each > language which lists the translated strings and their translations. > These are compile into a .mo file and loaded at run time. > The function gettext fetches a translation, if there is one, > from a hash table. Many free software projects use this system. > > I found a CL implementation of gettext: > http://users.actrix.co.nz/mycroft/intl.lisp > I got permission from the author to license it by GPLv2. > (There is a gettext implementation in Clisp but it is written > in C. I couldn't find any others in Lisp.) > > If there isn't too much opposition I'd like to arrange for > MERROR and MTELL to run their arguments through gettext. > The gettext code is pretty straightforward but I'll need some > help about putting .po/.mo files in the right place. Also of course > we'll need to find someone to make each .po file. > > As part of this effort, I am planning to revise the existing > messages to a uniform format; the messages were written > by many people according to different conventions, so I > think it's a good idea to make them all follow the same > convention before translating them. > > Hope this helps. Thanks for any comments. > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From jromerobernal at gmail.com Sat Feb 7 18:49:05 2009 From: jromerobernal at gmail.com (Juan Pablo Romero Bernal) Date: Sat, 7 Feb 2009 19:49:05 -0500 Subject: [Maxima] revision & translation of errors and other messages In-Reply-To: References: Message-ID: Hi, > If there isn't too much opposition I'd like to arrange for > MERROR and MTELL to run their arguments through gettext. > The gettext code is pretty straightforward but I'll need some > help about putting .po/.mo files in the right place. Also of course > we'll need to find someone to make each .po file. > As part of this effort, I am planning to revise the existing > messages to a uniform format; the messages were written > by many people according to different conventions, so I > think it's a good idea to make them all follow the same > convention before translating them. It's s good work !. May be Andrej Vodopivec and others wxMaxima developers can help about the use of gettext and translating conventions. I can help with Spanish traslation. Bye, -- Juan Pablo Romero Bernal Grupo Linux Universidad Distrital Blog: http://jpromerobx.blogspot.com/ From andreas_eder at gmx.net Sun Feb 8 01:38:23 2009 From: andreas_eder at gmx.net (Andreas Eder) Date: Sun, 8 Feb 2009 08:38:23 +0100 Subject: [Maxima] revision & translation of errors and other messages In-Reply-To: References: Message-ID: <18830.35823.217832.236742@arran.eder.local> Hi Robert, >>>>> "Robert" == Robert Dodier writes: Robert> Hello, Robert> I'd like to arrange for Maxima to translate error messages and Robert> other messages via gettext (a message translation Robert> system). Robert> If there isn't too much opposition I'd like to arrange for Robert> MERROR and MTELL to run their arguments through gettext. Robert> The gettext code is pretty straightforward but I'll need some Robert> help about putting .po/.mo files in the right place. Also of course Robert> we'll need to find someone to make each .po file. This is certainly a good thing! If I can be of any help - especially in translating to german - please tell me. I guess a localized version of maxima will lower the entering barrier for lots of people. 'Andreas -- ceterum censeo redmondinem esse delendam. From andrej.vodopivec at gmail.com Sun Feb 8 03:38:12 2009 From: andrej.vodopivec at gmail.com (Andrej Vodopivec) Date: Sun, 8 Feb 2009 10:38:12 +0100 Subject: [Maxima] revision & translation of errors and other messages In-Reply-To: References: Message-ID: <7775b21a0902080138q565e6485pbc177acdbd0dc14e@mail.gmail.com> On Sun, Feb 8, 2009 at 1:49 AM, Juan Pablo Romero Bernal wrote: > Hi, > >> If there isn't too much opposition I'd like to arrange for >> MERROR and MTELL to run their arguments through gettext. >> The gettext code is pretty straightforward but I'll need some >> help about putting .po/.mo files in the right place. Also of course >> we'll need to find someone to make each .po file. > >> As part of this effort, I am planning to revise the existing >> messages to a uniform format; the messages were written >> by many people according to different conventions, so I >> think it's a good idea to make them all follow the same >> convention before translating them. > > It's s good work !. May be Andrej Vodopivec and others wxMaxima > developers can help about the use of gettext and translating conventions. I can help with makefiles and installation. We can copy the makefiles from wxmaxima with minimal changes and it will work for maxima also. Andrej From luigi_marino2 at alice.it Sun Feb 8 03:38:26 2009 From: luigi_marino2 at alice.it (Luigi Marino) Date: Sun, 8 Feb 2009 10:38:26 +0100 Subject: [Maxima] second verion maxima and minima points of a function Message-ID: Hi My block (simplest function how said Mr. Fateman) have the purpose to test really capability of CAS Maxima. Solve is very hard, Maple and other CAS have any limititation. It is a new version that found also inflection point only as a zero of second derivative. load(descriptive); stud_funz(f):=block([p,fs,fp], p:solve(diff(f,x,1),x), fs:diff(f,x,2), fp:ev(fs,x:p), for i:1 thru length(float(p)) do if floor(rhs(fp[i]))#0 and rhs(fp[i])>0 then print("minimo",[p[i],rhs(ev(f,x:p[i]))]) else if floor(rhs(fp[i]))#0 then print("massimo",[p[i],rhs(ev(f,x:p[i]))]) else print("flesso",[p[i],rhs(ev(f,x:p[i]))]))$ Example: f:x^3/(1-x^2); minimo[x=-sqrt(3),(3*sqrt(3))/2] massimo[x=sqrt(3),-(3*sqrt(3))/2] flesso[x=0,0] Best regards. Luigi Marino -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090208/2715ea22/attachment.htm From marik at mendelu.cz Sun Feb 8 07:29:41 2009 From: marik at mendelu.cz (Robert Marik) Date: Sun, 8 Feb 2009 13:29:41 +0000 (UTC) Subject: [Maxima] second verion maxima and minima points of a function References: Message-ID: Luigi Marino alice.it> writes: > > > Hi > My block (simplest? function how said Mr. > Fateman) > have the purpose to test really capability of CAS > Maxima. > Solve is very hard, Maple and other CAS ?have > any limititation. > It is a new version that found also inflection > point only > as a zero of second > derivative.?? Hi Luigi, thank you for posting revised version. I understand that you want to keep the code as simple as possible. I suggest to change the message "flesso" into something like "point of inflection or local maximum or minimum". To see why, consider functions like x^4 (minimum at x=0, reported as point of inflection by your function) and -x^4 (maximum at x=0, but reported as point of inflection). Yours sincerely Robert Marik From marik at mendelu.cz Sun Feb 8 08:11:47 2009 From: marik at mendelu.cz (Robert Marik) Date: Sun, 8 Feb 2009 14:11:47 +0000 (UTC) Subject: [Maxima] revision & translation of errors and other messages References: Message-ID: Robert Dodier gmail.com> writes: > > Hello, > > I'd like to arrange for Maxima to translate error messages and > other messages via gettext (a message translation system). > If I understand correctly there is typically a .po file for each > language which lists the translated strings and their translations. > These are compile into a .mo file and loaded at run time. > The function gettext fetches a translation, if there is one, > from a hash table. Many free software projects use this system. Great idea. Thanks. Our students are sometimes very weak in English and the translation makes the barrier to use Maxima in classrooms smaller. I think that you know that gettext (and friends) not only translates strings, but can be used to scan sources for strings to be translated and optionaly merge them with older translations. Hence all messages like "This is maxima message" should be rewritten into something like gettext("This is maxima message") to make scanning with xgettext and perhaps merging new and old strings using msgmerge possible. And in this case it should be not necessary to modify MERROR and MTELL (I think, but I have no experinece in Lisp). > If there isn't too much opposition I'd like to arrange for > MERROR and MTELL to run their arguments through gettext. > The gettext code is pretty straightforward but I'll need some > help about putting .po/.mo files in the right place. Also of course > we'll need to find someone to make each .po file. > I can help with Czech translation. It is allmost the same as Slovak, but the target amount of users will be still small due to the current size of these nations :-) However, the Czech Maxima session could look like integrate(1/(x^2+a),x); Je v?raz a kladn? nebo z?porn?? which means in TeX: Je v\'{y}raz a kladn\'{y} nebo z\'{a}porn\'{y}? in English: Is a positive otr negative? How to answer this question? "z?p;" or "neg;" ? Is it a good idea to allow translated anwers on input? If not, is it a good idea to expect answer in English, if the question is in other language? I think that German and other translations could have similar problems. Best regards Robert Marik From caruso at dm.unipi.it Sun Feb 8 10:41:21 2009 From: caruso at dm.unipi.it (Fabrizio Caruso) Date: Sun, 8 Feb 2009 17:41:21 +0100 (CET) Subject: [Maxima] interpolating with Hasse derivatives In-Reply-To: References: Message-ID: I am looking for an implementation of Hasse derivatives and an algorithm for the interpolation with such derivatives. Does any of you if such package exists in Maxima or any other (free or non-free) computer algebra system? Thanks Fabrizio From drdieterkaiser at web.de Sun Feb 8 13:01:27 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 08 Feb 2009 20:01:27 +0100 Subject: [Maxima] revision & translation of errors and other messages In-Reply-To: References: Message-ID: <1234119687.24473.43.camel@dieter-laptop> Am Sonntag, den 08.02.2009, 14:11 +0000 schrieb Robert Marik: > How to answer this question? "z?p;" or "neg;" ? Is it a good idea to allow > translated anwers on input? If not, is it a good idea to expect answer > in English, if the question is in other language? > I think that German and other translations could have similar problems. I think too that it would be a problem to expect an English answer for a German question. For the given example there is no problem in German integrate(1/(x^2+a),x); Ist a negative oder positive? But Zero will be "Null" and we have a problem when we accept only one char as an answer, because we can not distinguish "Null" and "Negative". Dieter Kaiser From yhonda at mac.com Mon Feb 9 10:05:09 2009 From: yhonda at mac.com (Yasuaki Honda) Date: Tue, 10 Feb 2009 01:05:09 +0900 Subject: [Maxima] imaxima-imath-1.0rc1 Message-ID: <7A7EB63F-C33A-46F3-8A5C-FD6C7EF727CA@mac.com> Dear maxima and imaxima users, I have released imaxima-imath-1.0rc.tar.gz on the imaxima-imath web page at: http://members3.jcom.home.ne.jp/imaxima/ This version does not have a new feature, but fixes many bugs that were reported in the past. -As for inline graph, if the emacs buffer window is too small for the generated graph image, the graph was not displayed, but a file name is displayed instead. Now, the graph is resized to fit to the current imaxima buffer size and correctly displayed. Thanks go to Bertram for his patch. -A bug in setup-imaxima-imath.el, which is used in "Easy Install on Windows XP / Vista" is fixed so that it can now correctly handles the set up of info files. -Now csetup() function in ctensor package displays interactive messages correctly. -derivabbrev:true is correctly handled. -A lot of lisp code in imaxima.lisp that are common in mactex.lisp are removed. Without any significant bug report, this version will become the 1.0 release in a couple of weeks. Yasuaki Honda Chiba, Japan http://members3.jcom.home.ne.jp/imaxima/ mailto:imaxima at mac.com From raymond.toy at ericsson.com Mon Feb 9 11:54:13 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 09 Feb 2009 12:54:13 -0500 Subject: [Maxima] Simplifying sqrt(4*z^2-4*z+1)? Message-ID: Assume |z| <= 1/2, how can I get maxima to simplify (sqrt(4*z^2-4*z+1)-1)/(2*z^2-2*z)? ratsimp and factor don't really do anything. radcan does, but the answer is wrong. If factor looked inside the sqrt, it would see that 4*z^2-4*z+1 is (2*z-1)^2. If we manually do that, maxima notices: (sqrt((2*z-1)^2)-1)/(2*z^2-2*z) -> -1/(z-1) or 1/(1-z), which is what I wanted. Ray From ronis at ronispc.chem.mcgill.ca Mon Feb 9 12:04:08 2009 From: ronis at ronispc.chem.mcgill.ca (David Ronis) Date: Mon, 09 Feb 2009 13:04:08 -0500 Subject: [Maxima] Build failure in today's cvs-head Message-ID: <1234202648.31430.3.camel@ronispc.chem.mcgill.ca> After updating the sources, making clean, running bootstrap, etc., make all dies with: ; - Compiling source file ; "/home/ronis/Project/notar/maxima/src/intl.lisp" ;; Compiling file /home/ronis/Project/notar/maxima/src/intl.lisp ... *** - SYSTEM::LINE-COMMENT-READER: Invalid byte #xA9 in CHARSET:ASCII conversion clisp --version shows: GNU CLISP 2.47 (2008-10-23) (built 3434030259) (memory 3434030443) Software: GNU C 4.3.2 /usr/bin/gcc -O3 -march=pentium4 -ffast-math -funroll-loops -fomit-frame-pointer -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -Wmissing-declarations -Wno-sign-compare -O2 -fexpensive-optimizations -falign-functions=4 -DUNICODE -DDYNAMIC_FFI -I. -x none /usr/lib/libreadline.so -lncurses -ldl -lavcall -lcallback -L/usr/lib -lsigsegv -L/usr/lib -lc SAFETY=0 HEAPCODES LINUX_NOEXEC_HEAPCODES GENERATIONAL_GC SPVW_BLOCKS SPVW_MIXED TRIVIALMAP_MEMORY libsigsegv 2.4 libreadline 5.2 Features: (READLINE REGEXP SYSCALLS I18N LOOP COMPILER CLOS MOP CLISP ANSI-CL COMMON-LISP LISP=CL INTERPRETER SOCKETS GENERIC-STREAMS LOGICAL-PATHNAMES SCREEN FFI GETTEXT UNICODE BASE-CHAR=CHARACTER PC386 UNIX) C Modules: (clisp i18n syscalls regexp readline) Installation directory: /usr/lib/clisp-2.47/ User language: ENGLISH Machine: I686 (I686) ronispc.chem.mcgill.ca [132.206.205.91] although I've used this version to compile maxima many times before. David From raymond.toy at ericsson.com Mon Feb 9 12:10:45 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 09 Feb 2009 13:10:45 -0500 Subject: [Maxima] Build failure in today's cvs-head In-Reply-To: <1234202648.31430.3.camel@ronispc.chem.mcgill.ca> References: <1234202648.31430.3.camel@ronispc.chem.mcgill.ca> Message-ID: <499071A5.9070009@ericsson.com> David Ronis wrote: > After updating the sources, making clean, running bootstrap, etc., make > all dies with: > > > > ; - Compiling source file > ; "/home/ronis/Project/notar/maxima/src/intl.lisp" > ;; Compiling file /home/ronis/Project/notar/maxima/src/intl.lisp ... > *** - SYSTEM::LINE-COMMENT-READER: Invalid byte #xA9 in CHARSET:ASCII > conversion > > It's caused by the copyright character near the top of src/intl.lisp. I thought Robert had made some changes so that clisp would handle this, and indeed on one system, it works just fine, but on a different system at home, it chokes as you show above. The easy solution is to remove the copyright character, but perhaps we should make sure Robert's changes are in place before doing that. Ray From macrakis at alum.mit.edu Mon Feb 9 12:11:45 2009 From: macrakis at alum.mit.edu (Stavros Macrakis) Date: Mon, 9 Feb 2009 13:11:45 -0500 Subject: [Maxima] Simplifying sqrt(4*z^2-4*z+1)? In-Reply-To: References: Message-ID: <8b356f880902091011x36c022f4ndbd99be252f8bd7@mail.gmail.com> On Mon, Feb 9, 2009 at 12:54 PM, Raymond Toy wrote: > > Assume |z| <= 1/2, how can I get maxima to simplify > > (sqrt(4*z^2-4*z+1)-1)/(2*z^2-2*z)? > expr: (sqrt(4*z^2-4*z+1)-1)/(2*z^2-2*z) assume(z>-1/2,z<1/2)$ scanmap(factor,expr) => -1/(z-1) -s -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090209/c4a91266/attachment.htm From raymond.toy at ericsson.com Mon Feb 9 12:17:15 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 09 Feb 2009 13:17:15 -0500 Subject: [Maxima] Simplifying sqrt(4*z^2-4*z+1)? In-Reply-To: <8b356f880902091011x36c022f4ndbd99be252f8bd7@mail.gmail.com> References: <8b356f880902091011x36c022f4ndbd99be252f8bd7@mail.gmail.com> Message-ID: <4990732B.2030509@ericsson.com> Stavros Macrakis wrote: > On Mon, Feb 9, 2009 at 12:54 PM, Raymond Toy > wrote: > > > Assume |z| <= 1/2, how can I get maxima to simplify > > (sqrt(4*z^2-4*z+1)-1)/(2*z^2-2*z)? > > > expr: (sqrt(4*z^2-4*z+1)-1)/(2*z^2-2*z) > assume(z>-1/2,z<1/2)$ > scanmap(factor,expr) => -1/(z-1) > > Thanks. It would have been nice if factor peeked inside sqrt, but I guess factor isn't supposed to do that. Ray From robert.dodier at gmail.com Mon Feb 9 12:26:27 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 9 Feb 2009 11:26:27 -0700 Subject: [Maxima] Build failure in today's cvs-head In-Reply-To: <499071A5.9070009@ericsson.com> References: <1234202648.31430.3.camel@ronispc.chem.mcgill.ca> <499071A5.9070009@ericsson.com> Message-ID: On Mon, Feb 9, 2009 at 11:10 AM, Raymond Toy wrote: > It's caused by the copyright character near the top of src/intl.lisp. I > thought Robert had made some changes so that clisp would handle this, Oh, the stuff I added can only help when files are loaded via Maxima's load function (by supplying a restart for the "bad character" error). Incidentally, from what I can tell, handling undecodable bytes is implementation-dependent ... yet another CLHS-missing-bits-around-the-edges that will, in all probability, never be completed. > The easy solution is to remove the copyright character, but perhaps we > should make sure Robert's changes are in place before doing that. Go ahead and replace the offending character. best Robert From raymond.toy at ericsson.com Mon Feb 9 12:37:17 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 09 Feb 2009 13:37:17 -0500 Subject: [Maxima] Build failure in today's cvs-head In-Reply-To: References: <1234202648.31430.3.camel@ronispc.chem.mcgill.ca> <499071A5.9070009@ericsson.com> Message-ID: <499077DD.9020303@ericsson.com> Robert Dodier wrote: > On Mon, Feb 9, 2009 at 11:10 AM, Raymond Toy wrote: > > >> It's caused by the copyright character near the top of src/intl.lisp. I >> thought Robert had made some changes so that clisp would handle this, >> > > Oh, the stuff I added can only help when files are loaded via Maxima's > load function (by supplying a restart for the "bad character" error). > > Oh, ok. > >> The easy solution is to remove the copyright character, but perhaps we >> should make sure Robert's changes are in place before doing that. >> > > Go ahead and replace the offending character. > > Could we just change custom:*default-file-encoding* to be iso-8859-1? This should allow the copyright sign to be accepted. (Untested, but on the machine where I don't have a problem, custom:*default-file-encoding* is #.) This might be a problem if we start accepting Lisp files that aren't iso-8859-1 but we haven't reached that point yet. Ray From robert.dodier at gmail.com Mon Feb 9 12:48:38 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Mon, 9 Feb 2009 11:48:38 -0700 Subject: [Maxima] Build failure in today's cvs-head In-Reply-To: <499077DD.9020303@ericsson.com> References: <1234202648.31430.3.camel@ronispc.chem.mcgill.ca> <499071A5.9070009@ericsson.com> <499077DD.9020303@ericsson.com> Message-ID: On Mon, Feb 9, 2009 at 11:37 AM, Raymond Toy wrote: > Could we just change custom:*default-file-encoding* to be iso-8859-1? > This should allow the copyright sign to be accepted. (Untested, but on > the machine where I don't have a problem, custom:*default-file-encoding* > is #.) > This might be a problem if we start accepting Lisp files that aren't > iso-8859-1 but we haven't reached that point yet. I dunno. At this point I'd rather just nuke any characters that are not 7-bit ascii. best Robert From raymond.toy at ericsson.com Mon Feb 9 12:58:59 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Mon, 09 Feb 2009 13:58:59 -0500 Subject: [Maxima] Build failure in today's cvs-head In-Reply-To: References: <1234202648.31430.3.camel@ronispc.chem.mcgill.ca> <499071A5.9070009@ericsson.com> <499077DD.9020303@ericsson.com> Message-ID: <49907CF3.8020605@ericsson.com> Robert Dodier wrote: > On Mon, Feb 9, 2009 at 11:37 AM, Raymond Toy wrote: > > >> Could we just change custom:*default-file-encoding* to be iso-8859-1? >> This should allow the copyright sign to be accepted. (Untested, but on >> the machine where I don't have a problem, custom:*default-file-encoding* >> is #.) >> > > >> This might be a problem if we start accepting Lisp files that aren't >> iso-8859-1 but we haven't reached that point yet. >> > > I dunno. At this point I'd rather just nuke any characters that are > not 7-bit ascii. > > Being illiterate, nuking those characters works for me. Ray From ronis at ronispc.chem.mcgill.ca Mon Feb 9 13:04:13 2009 From: ronis at ronispc.chem.mcgill.ca (David Ronis) Date: Mon, 09 Feb 2009 14:04:13 -0500 Subject: [Maxima] More issues with today's cvs-head Message-ID: <1234206253.31430.9.camel@ronispc.chem.mcgill.ca> I flamed the copyright symbol and maxima built/installed as in the past (make check worked too); however, when I try to run a script under imaxima, e.g., as emacs A-X imaxima I get: Maxima encountered a Lisp error: SYSTEM::SET-STREAM-EXTERNAL-FORMAT on # #> is illegal Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. *** - THROW: there is no CATCHer for tag RETURN-FROM-DEBUGGER Break 1 [1]> block(load(("/usr/local/share/maxima/current/emacs/imaxima.lisp")), linenum:0)$ *** - SYSTEM::READ-EVAL-PRINT: variable BLOCK has no value The following restarts are available: USE-VALUE :R1 Input a value to be used instead of BLOCK. STORE-VALUE :R2 Input a new value for BLOCK. ABORT :R3 Abort debug loop Break 2 [2]> I get the same behavior with the imaxima that is in the cvs repository as well as with the just-announced 1.0rc1. Finally, note that the current directory is a soft link to 5.17post/. David From luigi_marino2 at alice.it Sun Feb 8 07:38:44 2009 From: luigi_marino2 at alice.it (Luigi Marino) Date: Sun, 8 Feb 2009 14:38:44 +0100 Subject: [Maxima] last revision maxima and mininima points of f(x) Message-ID: <3525928B3D3846A68A41EE5E7A50170B@windowsa96d2f1> Here is my last revesion of minima and maxima for f(x), founds also inflection points (zeros of second derivative only). Some zeros of second derivative are not inflection points (it for all critical users of Maxima). It works without problem for polinomials and rational functions (some limitation for log and exponential function, no works for trig function ). load(descriptive); stud_funz(f):=block([p,q,fs,fp], p:solve(diff(f,x,1),x), q:solve(diff(f,x,2),x), fs:diff(f,x,2), fp:ev(fs,x:p), for i:1 thru length(float(p)) do (if rhs(fp[i])>0 then print("minimo",[p[i],ev(f,x:rhs(p[i]))]), if rhs(fp[i])<0 then print("massimo",[p[i],ev(f,x:rhs(p[i]))])), for j:1 thru length(float(q)) do print("flesso",[q[j],ev(f,x:rhs(q[j]))]))$ Example: f:(x^3+10*x)/(x^2+1); stud_funz(f); minimo[x=-sqrt(2),-4*sqrt(2)] massimo[x=sqrt(2),4*sqrt(2)] massimo[x=-sqrt(5),-(5*sqrt(5))/2] minimo[x=sqrt(5),(5*sqrt(5))/2] flesso[x=-sqrt(3),-(13*sqrt(3))/4] flesso[x=sqrt(3),(13*sqrt(3))/4] flesso[x=0,0] Best wishes luigi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090208/fcb748f9/attachment-0001.htm From ronis at ronispc.chem.mcgill.ca Mon Feb 9 16:26:22 2009 From: ronis at ronispc.chem.mcgill.ca (David Ronis) Date: Mon, 09 Feb 2009 17:26:22 -0500 Subject: [Maxima] Yet More issues with today's cvs-head Message-ID: <1234218382.14024.27.camel@ronispc.chem.mcgill.ca> I've updated and built the cvs head, starting with bootstrap, configure, make all, make check, make install. Everything goes without complaint except for the last. make install gives: make[2]: *** No rule to make target `colnew/bv_ode.mac', needed by `install-datafiles'. Stop. make[2]: Leaving directory `/home/ronis/Project/notar/maxima/share' From fateman at cs.berkeley.edu Mon Feb 9 16:40:22 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Mon, 09 Feb 2009 14:40:22 -0800 Subject: [Maxima] Simplifying sqrt(4*z^2-4*z+1)? In-Reply-To: References: Message-ID: <4990B0D6.7040904@cs.berkeley.edu> radcan assumes |z| --> inf, so your assumption that |z|<1/2 won't work. Maybe here's a workaround. ratsubst(1/z,w,radcan(subst(1/w,z, expression))); RJF Raymond Toy wrote: > Assume |z| <= 1/2, how can I get maxima to simplify > > (sqrt(4*z^2-4*z+1)-1)/(2*z^2-2*z)? > > ratsimp and factor don't really do anything. radcan does, but the > answer is wrong. > > If factor looked inside the sqrt, it would see that 4*z^2-4*z+1 is > (2*z-1)^2. If we manually do that, maxima notices: > > (sqrt((2*z-1)^2)-1)/(2*z^2-2*z) -> -1/(z-1) > > or 1/(1-z), which is what I wanted. > > Ray > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From fateman at cs.berkeley.edu Mon Feb 9 16:56:31 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Mon, 09 Feb 2009 14:56:31 -0800 Subject: [Maxima] Simplifying sqrt(4*z^2-4*z+1)? In-Reply-To: <4990B0D6.7040904@cs.berkeley.edu> References: <4990B0D6.7040904@cs.berkeley.edu> Message-ID: <4990B49F.9000003@cs.berkeley.edu> Richard Fateman wrote: > radcan assumes |z| --> inf, so your assumption that |z|<1/2 won't work. > Maybe here's a workaround. > > ratsubst(1/z,w,radcan(subst(1/w,z, expression))); > > RJF > Not quite. first you have to set radexpand:false. The default setting is, in my opinion, a recipe for disaster. RJF From toy.raymond at gmail.com Mon Feb 9 21:34:22 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Mon, 09 Feb 2009 22:34:22 -0500 Subject: [Maxima] Numerical issues with jacobi_sn Message-ID: <4990F5BE.1090300@gmail.com> Just a note that jacobi_sn has some numerical issues for complex arguments. I'm not sure why. For example, with fpprec = 25, jacobi_sn(1b0+%i*1b0, .7b0) -> 3.522523469224944528936666b-1 %i + 1.134045971912365284394387b0 This uses the new implementation using AGM. The old version using Landen's descending transformation produces: 3.522523469224944776209612b-1 %i + 1.134045971912365274954094b0 Mathematica says it is (0.352252346922494477620961149 I + 1.134045971912365274954094081) The descending transformation is much closer to Mathematica's result. I don't know why AGM is less accurate. When the argument is real, there doesn't appear to be any problems and both AGM and Landen's transformation produce good results. We can't go back to using Landen's transformation because it has problems with Jacobi cn (and dn) for large values of the argument. Ray From raymond.toy at ericsson.com Tue Feb 10 08:07:11 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Tue, 10 Feb 2009 09:07:11 -0500 Subject: [Maxima] Numerical issues with jacobi_sn In-Reply-To: <4990F5BE.1090300@gmail.com> (Raymond Toy's message of "Mon, 09 Feb 2009 22:34:22 -0500") References: <4990F5BE.1090300@gmail.com> Message-ID: >>>>> "Raymond" == Raymond Toy writes: Raymond> Just a note that jacobi_sn has some numerical issues for complex Raymond> arguments. I'm not sure why. Raymond> For example, with fpprec = 25, Raymond> jacobi_sn(1b0+%i*1b0, .7b0) -> Raymond> 3.522523469224944528936666b-1 %i + 1.134045971912365284394387b0 Raymond> This uses the new implementation using AGM. The old version using Raymond> Landen's descending transformation produces: Some further experiments indicate that AGM works fine for real arguments. It just loses accuracy for complex arguments, and quite a few digits are lost. The descending Landen transform for sn appears to work fine for both real and complex arguments. But the ascending and descending Landen transformations (A&S 16.14, 16.12) don't work very well for cn and dn when the argument gets larger than 10 or 100, so we can't use that. I did some further experiments. We can compute dn from sn using dn = sqrt(1-m*sn) (A&S 16.9.5). For real arguments, there's no ambiguity with sqrt since dn >= 0. Not sure about complex values, but simple experiments indicate that it also works for complex values. Finally, we need cn. This can be obtained from the ascending Landen transformation since it only involves dn, which we've already computed. I think I need to do some more experiments, but this seems to be a reasonable approach to get accurate values for the Jacobian elliptic functions. I'm kind of curious why AGM doesn't seem to produce very accurate results for complex arguments. Is it a bug in Maxima's implementation of the trig functions? Something inherent in AGM? Something else? Ray From l.butler at ed.ac.uk Tue Feb 10 14:19:44 2009 From: l.butler at ed.ac.uk (Leo Butler) Date: Tue, 10 Feb 2009 20:19:44 +0000 (GMT) Subject: [Maxima] eigenvector problem Message-ID: Hello, I have encountered the following problem. I am unsure of its origins. The charpoly of the 6x6 matrix is (x^3-3x-1)^2, so the eigenvector problem can be solved symbolically (maple does it in < 1sec on my work desktop). Leo Maxima 5.16.3 http://maxima.sourceforge.net Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL) Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) A : matrix([0, 0, -1, 0, 0, 0], [2, 0, 0, 0, 1, 0], [-4, 0, 0, -1, -1, 0], [0, -2, -1, 0, 0, -1], [1, 2, 0, 0, 0, 1], [-2, 1, 1, -2, 1, 0]); [ 0 0 - 1 0 0 0 ] [ ] [ 2 0 0 0 1 0 ] [ ] [ - 4 0 0 - 1 - 1 0 ] (%o1) [ ] [ 0 - 2 - 1 0 0 - 1 ] [ ] [ 1 2 0 0 0 1 ] [ ] [ - 2 1 1 - 2 1 0 ] (%i2) eigenvectors(A); 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. (%i3) eigenvalues(A); - 3/2 sqrt(3) %i 1 3 sqrt(473) %i 1 1/3 (%o3) [[(- ---------- - -) (------------------- + -) 2 2 2 2 sqrt(3) %i 1 5 (---------- - -) 2 2 sqrt(3) %i 1 + ------------------------------, (---------- - -) - 3/2 2 2 3 sqrt(473) %i 1 1/3 3 (------------------- + -) 2 2 sqrt(3) %i 1 - 3/2 5 (- ---------- - -) 3 sqrt(473) %i 1 1/3 2 2 (------------------- + -) + ------------------------------, 2 2 - 3/2 3 sqrt(473) %i 1 1/3 3 (------------------- + -) 2 2 - 3/2 3 sqrt(473) %i 1 1/3 5 (------------------- + -) + ------------------------------], [2, 2, 2]] 2 2 - 3/2 3 sqrt(473) %i 1 1/3 3 (------------------- + -) 2 2 -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From willisb at unk.edu Tue Feb 10 14:48:57 2009 From: willisb at unk.edu (Barton Willis) Date: Tue, 10 Feb 2009 14:48:57 -0600 Subject: [Maxima] eigenvector problem In-Reply-To: References: Message-ID: A possible workaround: (this could present the data in a better form) (%i35) myeigenvectors(m) := (m : spectral_rep(m), [first(m), map('columnspace, second(m))])$ Simple checks: (%i36) m : matrix([2,3],[4,5])$ (%i37) e : myeigenvectors(m); (%o37) [[-(sqrt(57)-7)/2,(sqrt(57)+7)/2],[span(matrix([(sqrt(57)+19)/38],[-(4*sqrt(57))/57])),span(matrix([-(sqrt(57)-19)/38],[(4*sqrt(57))/57]))]] (%i38) ratsimp(m . first(first(second(e))) - first(first(e)) . first(first(second(e)))); (%o38) matrix([0],[0]) (%i39) ratsimp(m . first(second(second(e))) - second(first(e)) . first(second(second(e)))); (%o39) matrix([0],[0]) (%i40) A : matrix([0, 0, -1, 0, 0, 0], [2, 0, 0, 0, 1, 0], [-4, 0, 0, -1,-1, 0], [0, -2, -1, 0, 0, -1], [1, 2, 0, 0, 0, 1], [-2, 1, 1, -2, 1, 0])$ (%i41) myeigenvectors(A); (%o41) [[(-(sqrt(3)*%i)/2-1/2)*((3^(-3/2)*sqrt(473)*%i)/2+1/2)^(1/3)+(5*((sqrt(3)*%i)/2-1/2))/(3*((3^(-3/2)* ... < huge mess deleted> Let us know if this works for you. Barton (author of columnspace & specral_rep). maxima-bounces at math.utexas.edu wrote on 02/10/2009 02:19:44 PM: > [image removed] > > [Maxima] eigenvector problem > > Leo Butler > > to: > > 'Maxima List' > > 02/10/2009 02:21 PM > > Sent by: > > maxima-bounces at math.utexas.edu > > Hello, > I have encountered the following problem. I am unsure of its origins. > The charpoly of the 6x6 matrix is (x^3-3x-1)^2, so the eigenvector > problem can be solved symbolically (maple does it in < 1sec on my > work desktop). > Leo > > > > Maxima 5.16.3 http://maxima.sourceforge.net > Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL) > Distributed under the GNU Public License. See the file COPYING. > Dedicated to the memory of William Schelter. > The function bug_report() provides bug reporting information. > (%i1) A : matrix([0, 0, -1, 0, 0, 0], [2, 0, 0, 0, 1, 0], [-4, 0, 0, -1, > -1, 0], [0, -2, -1, 0, 0, -1], [1, 2, 0, 0, 0, 1], [-2, 1, 1, -2, 1, > 0]); > [ 0 0 - 1 0 0 0 ] > [ ] > [ 2 0 0 0 1 0 ] > [ ] > [ - 4 0 0 - 1 - 1 0 ] > (%o1) [ ] > [ 0 - 2 - 1 0 0 - 1 ] > [ ] > [ 1 2 0 0 0 1 ] > [ ] > [ - 2 1 1 - 2 1 0 ] > (%i2) eigenvectors(A); > > 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. > (%i3) eigenvalues(A); > - 3/2 > sqrt(3) %i 1 3 sqrt(473) %i 1 1/3 > (%o3) [[(- ---------- - -) (------------------- + -) > 2 2 2 2 > sqrt(3) %i 1 > 5 (---------- - -) > 2 2 sqrt(3) %i 1 > + ------------------------------, (---------- - -) > - 3/2 2 2 > 3 sqrt(473) %i 1 1/3 > 3 (------------------- + -) > 2 2 > sqrt(3) %i 1 > - 3/2 5 (- ---------- - -) > 3 sqrt(473) %i 1 1/3 2 2 > (------------------- + -) + ------------------------------, > 2 2 - 3/2 > 3 sqrt(473) %i 1 1/3 > 3 (------------------- + -) > 2 2 > - 3/2 > 3 sqrt(473) %i 1 1/3 5 > (------------------- + -) + ------------------------------], [2, 2, > 2]] > 2 2 - 3/2 > 3 sqrt(473) %i 1 1/3 > 3 (------------------- + -) > 2 2 > > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From andreas_eder at gmx.net Tue Feb 10 15:43:25 2009 From: andreas_eder at gmx.net (Andreas Eder) Date: Tue, 10 Feb 2009 22:43:25 +0100 Subject: [Maxima] problems with intl.lisp and sbcl Message-ID: <18833.62717.447765.883823@arran.eder.local> Hi, I have problems compiling intl.lisp with sbcl (version SBCL 1.0.19-gentoo) ; if a make the following changes i succed in compiling, but it looks fishy to me: *** src/intl.lisp 2009-02-10 22:32:06.000000000 +0100 --- /tmp/intl.lisp 2009-02-10 22:28:18.000000000 +0100 *************** *** 30,36 **** (ext:file-comment "$Header: /cvsroot/maxima/maxima/src/intl.lisp,v 1.3 2009/02/09 20:32:53 rtoy Exp $") ! (in-package "INTL") (defvar *locale-directory* "/usr/share/locale/") (defvar *locale* "C") --- 30,36 ---- (ext:file-comment "$Header: /cvsroot/maxima/maxima/src/intl.lisp,v 1.3 2009/02/09 20:32:53 rtoy Exp $") ! ;(in-package "INTL") (defvar *locale-directory* "/usr/share/locale/") (defvar *locale* "C") *************** *** 236,245 **** `(dgettext ,*default-domain* ,string)))) (defun install () ! (unless #+(or CMU SBCL) (eq (get-macro-character #\_) ! #'lisp::read-dispatch-char) ! #-(or CMU SBCL) (get-macro-character #\_) ! (make-dispatch-macro-character #\_ t)) (set-dispatch-macro-character #\_ #\" #'read-translatable-string) (set-dispatch-macro-character #\# #\" #'read-translatable-string) t) --- 236,244 ---- `(dgettext ,*default-domain* ,string)))) (defun install () ! (unless #+CMU (eq (get-macro-character #\_) #'lisp::read-dispatch-char) ! #-CMU (get-macro-character #\_) ! (make-dispatch-macro-character #\_ t)) (set-dispatch-macro-character #\_ #\" #'read-translatable-string) (set-dispatch-macro-character #\# #\" #'read-translatable-string) t) in my sbcl (get-macro-character #\_) returns nil, unlike cmucl. OK thats a simple change, but what amazes me are the errors I get with the (in-package "INTL") form still active: ; in: DEFUN READ-LELONG ; ((INTL::A (INTL::READ-CHAR INTL::STREAM)) ; (INTL::B (INTL::READ-CHAR INTL::STREAM)) ; (INTL::C (INTL::READ-CHAR INTL::STREAM)) ; (INTL::D (INTL::READ-CHAR INTL::STREAM))) ; ; caught COMMON-LISP:ERROR: ; illegal function call ; (INTL::LET ; ((INTL::A (INTL::READ-CHAR INTL::STREAM)) ; (INTL::B (INTL::READ-CHAR INTL::STREAM)) ; (INTL::C (INTL::READ-CHAR INTL::STREAM)) ; (INTL::D (INTL::READ-CHAR INTL::STREAM))) ; (INTL::+ (INTL::ASH (INTL::CHAR-CODE INTL::D) 24) ; (INTL::ASH (INTL::CHAR-CODE INTL::C) 16) ; (INTL::ASH (INTL::CHAR-CODE INTL::B) 8) (INTL::CHAR-CODE INTL::A))) ; ; note: The first argument never returns a value. ; (INTL::CHAR-CODE INTL::D) ; ==> ; INTL::D this looks very suspicious to me. Has anybody got an idea? Thanks in advance, Andreas -- ceterum censeo redmondinem esse delendam. From raymond.toy at ericsson.com Tue Feb 10 16:50:00 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Tue, 10 Feb 2009 17:50:00 -0500 Subject: [Maxima] problems with intl.lisp and sbcl In-Reply-To: <18833.62717.447765.883823@arran.eder.local> References: <18833.62717.447765.883823@arran.eder.local> Message-ID: <49920498.3030804@ericsson.com> Andreas Eder wrote: > ; (INTL::LET > ; ((INTL::A (INTL::READ-CHAR INTL::STREAM)) > ; (INTL::B (INTL::READ-CHAR INTL::STREAM)) > ; (INTL::C (INTL::READ-CHAR INTL::STREAM)) > ; (INTL::D (INTL::READ-CHAR INTL::STREAM))) > ; (INTL::+ (INTL::ASH (INTL::CHAR-CODE INTL::D) 24) > ; (INTL::ASH (INTL::CHAR-CODE INTL::C) 16) > ; (INTL::ASH (INTL::CHAR-CODE INTL::B) 8) (INTL::CHAR-CODE INTL::A))) > ; > ; note: The first argument never returns a value. > > ; (INTL::CHAR-CODE INTL::D) > ; ==> > ; INTL::D > > this looks very suspicious to me. Has anybody got an idea? > > Try to add (:use :cl) in the defpackage for intl in maxima-package.lisp. This will probably fix everything. Ray From raymond.toy at ericsson.com Tue Feb 10 16:56:06 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Tue, 10 Feb 2009 17:56:06 -0500 Subject: [Maxima] eigenvector problem In-Reply-To: References: Message-ID: <49920606.1080909@ericsson.com> Leo Butler wrote: > Hello, > I have encountered the following problem. I am unsure of its origins. > The charpoly of the 6x6 matrix is (x^3-3x-1)^2, so the eigenvector > problem can be solved symbolically (maple does it in < 1sec on my > work desktop). > Leo > > > > Maxima 5.16.3 http://maxima.sourceforge.net > Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL) > Distributed under the GNU Public License. See the file COPYING. > Dedicated to the memory of William Schelter. > The function bug_report() provides bug reporting information. > (%i1) A : matrix([0, 0, -1, 0, 0, 0], [2, 0, 0, 0, 1, 0], [-4, 0, 0, -1, > -1, 0], [0, -2, -1, 0, 0, -1], [1, 2, 0, 0, 0, 1], [-2, 1, 1, -2, 1, > 0]); > [ 0 0 - 1 0 0 0 ] > [ ] > [ 2 0 0 0 1 0 ] > [ ] > [ - 4 0 0 - 1 - 1 0 ] > (%o1) [ ] > [ 0 - 2 - 1 0 0 - 1 ] > [ ] > [ 1 2 0 0 0 1 ] > [ ] > [ - 2 1 1 - 2 1 0 ] > (%i2) eigenvectors(A); > > Maxima encountered a Lisp error: > > Error in PROGN [or a callee]: Caught fatal error [memory may be > damaged] > > This doesn't help, but with cmucl, the problem is that algsys says the system is too complicated to solve. I don't know why gcl crashes this way. It shouldn't. Ray From toy.raymond at gmail.com Tue Feb 10 20:24:31 2009 From: toy.raymond at gmail.com (Raymond Toy) Date: Tue, 10 Feb 2009 21:24:31 -0500 Subject: [Maxima] Numerical issues with jacobi_sn In-Reply-To: References: <4990F5BE.1090300@gmail.com> Message-ID: <499236DF.80800@gmail.com> Raymond Toy wrote: > I did some further experiments. We can compute dn from sn using dn = > sqrt(1-m*sn) (A&S 16.9.5). For real arguments, there's no ambiguity > with sqrt since dn >= 0. Not sure about complex values, but simple > experiments indicate that it also works for complex values. > Some more interesting examples. jacobi_sn(1.785063352082689082581887b0 *%i + 8.890858759528509578661528b-1, 9.434463451695984398149033b-1 - 1.476052973708684178844821b-1 * %i) -> 1.016169837568035196962361b0 %i + 3.327138718909161319167269b0 This differs from the descending Landen version and from what Mathematica says the answer should be: 1.345233534539675700312281b0 - 7.599023926615176284214056b-2 %i And we can't use dn = sqrt(1-m*sn^2). Use the same parameters above, sqrt(1-m*sn^2) is 8.617730683333292717095686b-1 %i + 2.663978258141280808361839b-1 But the true answer is the negative of this. At this point, I'm stumped. Neither AGM nor Landen/Gauss transformations produce the correct answers. Ray From l.butler at ed.ac.uk Wed Feb 11 00:42:58 2009 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 11 Feb 2009 06:42:58 +0000 (GMT) Subject: [Maxima] eigenvector problem In-Reply-To: <49920606.1080909@ericsson.com> References: <49920606.1080909@ericsson.com> Message-ID: On Tue, 10 Feb 2009, Raymond Toy wrote: < Leo Butler wrote: < > Hello, < > I have encountered the following problem. I am unsure of its origins. < > The charpoly of the 6x6 matrix is (x^3-3x-1)^2, so the eigenvector < > problem can be solved symbolically (maple does it in < 1sec on my < > work desktop). < > Leo > < > < This doesn't help, but with cmucl, the problem is that algsys says the < system is too complicated to solve. I don't know why gcl crashes this < way. It shouldn't. Yes, with clisp I get a slightly different error message, too: Maxima encountered a Lisp error: CDR: 0 is not a list In both cases, it is maxima 5.16.3. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From l.butler at ed.ac.uk Wed Feb 11 00:53:23 2009 From: l.butler at ed.ac.uk (Leo Butler) Date: Wed, 11 Feb 2009 06:53:23 +0000 (GMT) Subject: [Maxima] eigenvector problem In-Reply-To: References: Message-ID: On Tue, 10 Feb 2009, Barton Willis wrote: < A possible workaround: (this could present the data in a better form) < < (%i35) myeigenvectors(m) := (m : spectral_rep(m), [first(m), < map('columnspace, second(m))])$ Thank you. I had tried this by hand, but I was unaware of spectral_rep. I cannot find its documentation in my online help, although it is installed. Leo -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From lorenzo.isella at gmail.com Wed Feb 11 06:48:37 2009 From: lorenzo.isella at gmail.com (Lorenzo Isella) Date: Wed, 11 Feb 2009 13:48:37 +0100 Subject: [Maxima] Calculation of simple Integrals Message-ID: Dear All, I am quite a newbie (I used maxima only a while several years ago), but there is something I find a biut strange: (%i2) integrate(sin(x), x, 0 , %pi); (%o2) 2 (%i3) integrate(sin(x)^2, x, 0 , %pi); %pi (%o3) --- 2 (%i4) integrate(abs(sin(x))^2, x, 0 , %pi); %pi (%o4) --- 2 (%i5) integrate(abs(sin(x)), x, 0 , %pi); %pi / [ (%o5) I abs(sin(x)) dx ] / 0 So, it looks like that maxima (as expected!) has no trouble in calculating definite integrals of simple trigonometric functions, but if I add an absolute value, even if it has no effect on the sinus in the selected interval, then it returns what (according to some reading I did) stands for its inability of calculating the integral analytically. Why is that? Am I misunderstanding anything? Kind Regards Lorenzo -- I went to the race track once and bet on a horse that was so good that it took seven others to beat him! From al at beshenov.ru Wed Feb 11 07:11:29 2009 From: al at beshenov.ru (Alexey Beshenov) Date: Wed, 11 Feb 2009 16:11:29 +0300 Subject: [Maxima] Calculation of simple Integrals In-Reply-To: References: Message-ID: <200902111611.29651.al@beshenov.ru> On Wednesday 11 February 2009 15:48:37 Lorenzo Isella wrote: > (%i5) integrate(abs(sin(x)), x, 0 , %pi); > %pi > / > [ > (%o5) I abs(sin(x)) dx > ] > / > 0 > > So, it looks like that maxima (as expected!) has no trouble in > calculating definite integrals of simple trigonometric functions, > but if I add an absolute value, even if it has no effect on the > sinus in the selected interval, then it returns what (according to > some reading I did) stands for its inability of calculating the > integral analytically. > Why is that? Am I misunderstanding anything? integrate does not handle abs. abs(sin(x)) could be simplified to sin(x) in this case, but Maxima can't do it: (%i1) assume(x >= 0 and x <= %pi); (%o1) [x >= 0,x <= %pi] (%i2) sign(x); (%o2) pz (%i3) abs(x); (%o3) x (%i4) sign(sin(x)); (%o4) pnz (%i5) abs(sin(x)); (%o5) abs(sin(x)) -- Boomtime, Chaos 42 YOLD 3175 Alexey Beshenov http://beshenov.ru/ From ferriste at gmail.com Wed Feb 11 07:38:14 2009 From: ferriste at gmail.com (Stefano Ferri) Date: Wed, 11 Feb 2009 14:38:14 +0100 Subject: [Maxima] Calculation of simple Integrals In-Reply-To: <200902111611.29651.al@beshenov.ru> References: <200902111611.29651.al@beshenov.ru> Message-ID: <200902111438.15515.ferriste@gmail.com> Maxima can't actually correctly handle signs of functions. In particular, this happens when you try to bound a variable between two values and one of these is %pi or %e. The sign of trigonometric functions remains unknown. Look at this: http://sourceforge.net/tracker/index.php?func=detail&aid=2477795&group_id=4933&atid=104933 Maxima isn't (for now) able to understand that sin(x) is positive if you bound x between 0 and %pi, so your integral is reprinted as you typed it. Stefano In data mercoled? 11 febbraio 2009 14:11:29, Alexey Beshenov ha scritto: : > On Wednesday 11 February 2009 15:48:37 Lorenzo Isella wrote: > > (%i5) integrate(abs(sin(x)), x, 0 , %pi); > > %pi > > / > > [ > > (%o5) I abs(sin(x)) dx > > ] > > / > > 0 > > > > So, it looks like that maxima (as expected!) has no trouble in > > calculating definite integrals of simple trigonometric functions, > > but if I add an absolute value, even if it has no effect on the > > sinus in the selected interval, then it returns what (according to > > some reading I did) stands for its inability of calculating the > > integral analytically. > > Why is that? Am I misunderstanding anything? > > integrate does not handle abs. abs(sin(x)) could be simplified to > sin(x) in this case, but Maxima can't do it: > > (%i1) assume(x >= 0 and x <= %pi); > (%o1) [x >= 0,x <= %pi] > > (%i2) sign(x); > (%o2) pz > > (%i3) abs(x); > (%o3) x > > (%i4) sign(sin(x)); > (%o4) pnz > > (%i5) abs(sin(x)); > (%o5) abs(sin(x)) From raymond.toy at ericsson.com Wed Feb 11 11:10:46 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Wed, 11 Feb 2009 12:10:46 -0500 Subject: [Maxima] Build failure in today's cvs-head In-Reply-To: References: <1234202648.31430.3.camel@ronispc.chem.mcgill.ca> <499071A5.9070009@ericsson.com> <499077DD.9020303@ericsson.com> Message-ID: <49930696.7080703@ericsson.com> Robert Dodier wrote: > On Mon, Feb 9, 2009 at 11:37 AM, Raymond Toy wrote: > > >> Could we just change custom:*default-file-encoding* to be iso-8859-1? >> This should allow the copyright sign to be accepted. (Untested, but on >> the machine where I don't have a problem, custom:*default-file-encoding* >> is #.) >> > > >> This might be a problem if we start accepting Lisp files that aren't >> iso-8859-1 but we haven't reached that point yet. >> > > I dunno. At this point I'd rather just nuke any characters that are > not 7-bit ascii. > > I've done that already. But I think that we're going to have to visit this issue again soon if you get the gettext stuff going with different translations. I don't know, but I suspect that the supported languages are not going to fit in 7-bit ascii, so we'll have to set up the output streams to support the correct external format. Ray From raymond.toy at ericsson.com Wed Feb 11 11:14:34 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Wed, 11 Feb 2009 12:14:34 -0500 Subject: [Maxima] Numerical issues with jacobi_sn In-Reply-To: <499236DF.80800@gmail.com> References: <4990F5BE.1090300@gmail.com> <499236DF.80800@gmail.com> Message-ID: <4993077A.2090802@ericsson.com> Raymond Toy wrote: > At this point, I'm stumped. Neither AGM nor Landen/Gauss > transformations produce the correct answers. > > I think I've found a solution to this. Use the descending Landen transformation to jacobi_sn. This appears to work well for all real and complex values of the argument and the parameter. Then, for jacobi_dn, we use the Gauss transformation () to express jacobi_dn in terms of jacobi_sn. Finally, jacobi_cn can be computed using the ascending Landen transformation to express jacobi_cn in terms of jacobi_dn. Simple tests of selected interesting points and random values indicates that the algorithms work without undue loss of precision and without returning bogus results like jacobi_dn or jacobi_cn greater then 1. Ray From robert.dodier at gmail.com Wed Feb 11 11:59:31 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 11 Feb 2009 10:59:31 -0700 Subject: [Maxima] Build failure in today's cvs-head In-Reply-To: <49930696.7080703@ericsson.com> References: <1234202648.31430.3.camel@ronispc.chem.mcgill.ca> <499071A5.9070009@ericsson.com> <499077DD.9020303@ericsson.com> <49930696.7080703@ericsson.com> Message-ID: On Wed, Feb 11, 2009 at 10:10 AM, Raymond Toy wrote: >> I dunno. At this point I'd rather just nuke any characters that are >> not 7-bit ascii. > I've done that already. > > But I think that we're going to have to visit this issue again soon if > you get the gettext stuff going with different translations. > > I don't know, but I suspect that the supported languages are not going > to fit in 7-bit ascii, so we'll have to set up the output streams to > support the correct external format. Sure, but I think there are 2 separate problems here. One is to read the source code in any locale. I think enforcing 7-bit ascii is helpful for that. The other is to read and display translated messages. For any given language that would be done in a specific locale. It doesn't have to work in any other locale. Maybe I'm not understanding what you're getting at. Robert From raymond.toy at ericsson.com Wed Feb 11 12:24:00 2009 From: raymond.toy at ericsson.com (Raymond Toy) Date: Wed, 11 Feb 2009 13:24:00 -0500 Subject: [Maxima] Build failure in today's cvs-head In-Reply-To: References: <1234202648.31430.3.camel@ronispc.chem.mcgill.ca> <499071A5.9070009@ericsson.com> <499077DD.9020303@ericsson.com> <49930696.7080703@ericsson.com> Message-ID: <499317C0.8010409@ericsson.com> Robert Dodier wrote: > On Wed, Feb 11, 2009 at 10:10 AM, Raymond Toy wrote: > > >>> I dunno. At this point I'd rather just nuke any characters that are >>> not 7-bit ascii. >>> > > >> I've done that already. >> >> But I think that we're going to have to visit this issue again soon if >> you get the gettext stuff going with different translations. >> >> I don't know, but I suspect that the supported languages are not going >> to fit in 7-bit ascii, so we'll have to set up the output streams to >> support the correct external format. >> > > Sure, but I think there are 2 separate problems here. > > One is to read the source code in any locale. I think enforcing > 7-bit ascii is helpful for that. > 7-bit ascii, with Unix end-of-lines, not DOS, not Mac, right? That works for me, since I'm illiterate. May not be so nice for people who are not. > The other is to read and display translated messages. > For any given language that would be done in a specific locale. > It doesn't have to work in any other locale. > Yes. As a side note not really related but cmucl had an experimental unicode version that supported the concept of dialect. That is, the standard common lisp functions had a "native" word for each function. When read, it would get translated to the correct name, and on printing it would get the native word. And I can imagine that once we have messages in native languages, people will want to use variable names in the native language. Eventually we'll probably have to do this and it's not such a stretch then to allow source code to use other languages. The core maxima language, however, should probably remain plain English. Any add-on share/contrib packages can use whatever language is desired. Anyway, that's probably a long way off. Ray From robert.dodier at gmail.com Wed Feb 11 13:02:09 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Wed, 11 Feb 2009 12:02:09 -0700 Subject: [Maxima] Build failure in today's cvs-head In-Reply-To: <499317C0.8010409@ericsson.com> References: <1234202648.31430.3.camel@ronispc.chem.mcgill.ca> <499071A5.9070009@ericsson.com> <499077DD.9020303@ericsson.com> <49930696.7080703@ericsson.com> <499317C0.8010409@ericsson.com> Message-ID: On Wed, Feb 11, 2009 at 11:24 AM, Raymond Toy wrote: > 7-bit ascii, with Unix end-of-lines, not DOS, not Mac, right? > > That works for me, since I'm illiterate. May not be so nice for people > who are not. My point is that we should try to make the source code readable in random environments. 7-bit ascii is a means to that end. Maybe line endings are relevant to that goal, maybe not. Certainly DOS eol is OK on *nix and vice versa, dunno about Mac eol. > And I can imagine that once we have messages in native languages, people > will want to use variable names in the native language. Eventually > we'll probably have to do this and it's not such a stretch then to allow > source code to use other languages. It's already possible to use e.g. utf-8 characters in variables names if the Lisp implementation supports it. Robert From friedrich at hattendoerfer.de Sat Feb 14 05:11:05 2009 From: friedrich at hattendoerfer.de (Friedrich Hattendorf) Date: Sat, 14 Feb 2009 12:11:05 +0100 Subject: [Maxima] wxmaxima and ltsp problems Message-ID: <200902141211.05492.friedrich@hattendoerfer.de> Hello, im am running wxmaxima on ltsp (linux terminal server project ) at home and at school. If I am alone, it works fine. But when (at school) 20 students log in and start wxmaxima: - for some it works - for some of them it is possible to calculate etc, but its not possible to plot - some get the message "couldn't connect to wxmaxima" (or similar; sorry, I didn't write down) If the last ones start maxima (Kde/konsole) they could plot in ascii; when I tried the same (alone) the output was with gnuplot Any idea, to fix? which log-file may give more information? Our System: - debian 4.0 - kernel 2.6.24-19-xen - ltsp 5.1.10-1~40.etch.0 - xen on hp proliant - three virtual servers ; two on the hp proliant machine; one on an other machine - Maxima 5.10.0-6 - wxmaxima 0.7.0a-1.1 - gnuplot 4.0.0-5 -- mit freundlichen Gr??en Friedrich Hattendorf --- Lernen ist wie das Rudern gegen den Strom; sobald man aufh?rt, treibt man zur?ck Benjamin Britten From carl at udel.edu Sat Feb 14 08:46:13 2009 From: carl at udel.edu (Carl Krauthauser) Date: Sat, 14 Feb 2009 09:46:13 -0500 Subject: [Maxima] Bessel function differential equation Message-ID: <4996D935.6010504@udel.edu> I am trying to solve the following diff eq: x^2*diff(y,x,2)+x*diff(y,x)+(a^2*x^2-b^2)*y=0 which should lead to the following solution: y=c1*bessel_j(b, a*x) + c2*bessel_y(b,a*x) If I use ode2 to solve, I get the message "false", meaning it couldn't solve it, and if I use odelin or contrib_ode, I get the message EVAL: too many arguments given to SRATSIMP: (SRATSIMP P X) Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. However, if I ask ode2 to solve: x^2*diff(y,x,2)+x*diff(y,x)+(x^2-1)*y=0 I get: y=c1*bessel_j(1,x) + c2*bessel_y(1,x) which is, of course, the correct solution. Clearly, I am not doing something correctly with the constants a and b. Might there be someone who could provide me with some insight? Thank you all for your help! Cheers, Carl From dastew at sympatico.ca Sat Feb 14 09:21:25 2009 From: dastew at sympatico.ca (Doug Stewart) Date: Sat, 14 Feb 2009 10:21:25 -0500 Subject: [Maxima] z_transforms In-Reply-To: <4996D935.6010504@udel.edu> References: <4996D935.6010504@udel.edu> Message-ID: <4996E175.2030704@sympatico.ca> I see some work was done on Z Transforms in 2007, but I can't find it now. I am using Maxima 5.13.0 in Ubuntu. How do I get it to work? Doug Stewart From fateman at cs.berkeley.edu Sat Feb 14 09:34:16 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Sat, 14 Feb 2009 07:34:16 -0800 Subject: [Maxima] Bessel function differential equation In-Reply-To: <4996D935.6010504@udel.edu> References: <4996D935.6010504@udel.edu> Message-ID: <4996E478.7070302@cs.berkeley.edu> Carl Krauthauser wrote: > ... > > which is, of course, the correct solution. Clearly, I am not doing > something correctly with the constants a and b. Might there be someone > who could provide me with some insight? Thank you all for your help! I think you are doing nothing wrong. There is a bug. Or at least a failure to be as general as possible. For anyone trying to duplicate this, type depends(y,x) first. From willisb at unk.edu Sat Feb 14 11:09:37 2009 From: willisb at unk.edu (Barton Willis) Date: Sat, 14 Feb 2009 11:09:37 -0600 Subject: [Maxima] Bessel function differential equation In-Reply-To: <4996D935.6010504@udel.edu> References: <4996D935.6010504@udel.edu> Message-ID: A work around is to call odelin directly (%i5) load(odelin)$ (%i6) odelin(x^2*'diff(y,x,2)+x*'diff(y,x)+(a^2*x^2-b^2)*y=0,y,x); (%o6) {bessel_j(b,-a*x),bessel_y(b,-a*x)} I think ode2 is supposed to call odelin automatically; apparently something in this process is broken. Maybe you could file a bug report. Barton -----maxima-bounces at math.utexas.edu wrote: ----- >I?am?trying?to?solve?the?following?diff?eq: > >x^2*diff(y,x,2)+x*diff(y,x)+(a^2*x^2-b^2)*y=0 > >which?should?lead?to?the?following?solution: > >y=c1*bessel_j(b,?a*x)?+?c2*bessel_y(b,a*x) > >If?I?use?ode2?to?solve,?I?get?the?message?"false",?meaning?it?couldn't >solve?it,?and?if?I?use?odelin?or?contrib_ode,?I?get?the?message > >EVAL:?too?many?arguments?given?to?SRATSIMP:?(SRATSIMP?P?X) >Automatically?continuing. >To?reenable?the?Lisp?debugger?set?*debugger-hook*?to?nil. > >However,?if?I?ask?ode2?to?solve: > >x^2*diff(y,x,2)+x*diff(y,x)+(x^2-1)*y=0 > >I?get: > >y=c1*bessel_j(1,x)?+?c2*bessel_y(1,x) > >which?is,?of?course,?the?correct?solution.??Clearly,?I?am?not?doing >something?correctly?with?the?constants?a?and?b.??Might?there?be?someone >who?could?provide?me?with?some?insight???Thank?you?all?for?your?help! > > >Cheers, >Carl >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From robert.dodier at gmail.com Sat Feb 14 11:23:31 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 14 Feb 2009 10:23:31 -0700 Subject: [Maxima] z_transforms In-Reply-To: <4996E175.2030704@sympatico.ca> References: <4996D935.6010504@udel.edu> <4996E175.2030704@sympatico.ca> Message-ID: On 2/14/09, Doug Stewart wrote: > I see some work was done on Z Transforms in 2007, but I can't find it now. > > I am using Maxima 5.13.0 in Ubuntu. > > How do I get it to work? I recently worked on the z-transform stuff again and made some progress. I've committed the z_transform.mac program and rtest_z_transform.mac test script. You should be able to see them here: http://maxima.cvs.sourceforge.net/maxima/maxima/share/contrib They will be in the next release (due in April). random example: load (z_transform); apply_z_transform (z_transform (1 + kron_delta (m, x), m, u)); => 1/u^x+u/(u-1) batch (rtest_z_transform, test); => (... lots o' stuff ...) 24/24 tests passed. Hope this helps. I';ll be glad to hear any comments. There are doubtless many more transform rules that can be implemented, maybe we can get going on that. By the way, I'll recommend getting the most recent version of Maxima (5.17.1). best Robert Dodier From van.nek at arcor.de Sat Feb 14 12:00:34 2009 From: van.nek at arcor.de (van Nek) Date: Sat, 14 Feb 2009 19:00:34 +0100 Subject: [Maxima] wxmaxima and ltsp problems In-Reply-To: <200902141211.05492.friedrich@hattendoerfer.de> References: <200902141211.05492.friedrich@hattendoerfer.de> Message-ID: <499714D2.19716.84A834@van.nek.arcor.de> Hallo Friedrich, I read that you are using quite old versions of both Maxima and wxMaxima. I remember that I also had path- and plot-problems in LANs with some earlier versions, but I can't remember which version was envolved. I hope updating will solve your problems. E.g. on the wxMaxima webside there are links to the debian repositories. You'll find stable (Maxima 5.13) and unstable (5.17) packages. HTH Beste Gr??e Volker van Nek Am 14 Feb 2009 um 12:11 hat Friedrich Hattendorf geschrieben: > Hello, > > im am running wxmaxima on ltsp (linux terminal server > project ) at home and at school. > > If I am alone, it works fine. > But when (at school) 20 students log in and start wxmaxima: > - for some it works > - for some of them it is possible to calculate etc, but its > not possible to plot > - some get the message "couldn't connect to wxmaxima" > (or similar; sorry, I didn't write down) > > If the last ones start maxima (Kde/konsole) they could plot > in ascii; when I tried the same (alone) the output was with > gnuplot > > Any idea, to fix? > which log-file may give more information? > > Our System: > > - debian 4.0 > - kernel 2.6.24-19-xen > - ltsp 5.1.10-1~40.etch.0 > - xen on hp proliant > - three virtual servers ; two on the hp proliant machine; > one on an other machine > - Maxima 5.10.0-6 > - wxmaxima 0.7.0a-1.1 > - gnuplot 4.0.0-5 > > -- > mit freundlichen Gr??en > Friedrich Hattendorf > > --- > Lernen ist wie das Rudern gegen den Strom; > sobald man aufh?rt, treibt man zur?ck > Benjamin Britten > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima From carl at udel.edu Sat Feb 14 12:13:16 2009 From: carl at udel.edu (Carl Krauthauser) Date: Sat, 14 Feb 2009 13:13:16 -0500 Subject: [Maxima] Bessel function differential equation In-Reply-To: References: <4996D935.6010504@udel.edu> Message-ID: <499709BC.1000000@udel.edu> Hello Barton, Thank you for the work around. When I tried to do the same thing, I got: Maxima encountered a Lisp error: EVAL: too many arguments given to SRATSIMP: (SRATSIMP P X) Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil. This is a consistent error I get every time I load a module and then try to run something with it. This would seem to suggest a bug; I am using maxima-5.17.1-1.centos4.i386.rpm on a Centos 4.7, i386 box. Has anyone else encountered similar problems? I am hoping to avoid having to compile my own version of Maxima. Is it suggested that I compile my own version of Maxima? Thank you for your help! Cheers, Carl Barton Willis wrote: > A work around is to call odelin directly > > (%i5) load(odelin)$ > (%i6) odelin(x^2*'diff(y,x,2)+x*'diff(y,x)+(a^2*x^2-b^2)*y=0,y,x); > > (%o6) {bessel_j(b,-a*x),bessel_y(b,-a*x)} > > I think ode2 is supposed to call odelin automatically; apparently something > in this > process is broken. Maybe you could file a bug report. > > Barton > > -----maxima-bounces at math.utexas.edu wrote: ----- > > > >> I am trying to solve the following diff eq: >> >> x^2*diff(y,x,2)+x*diff(y,x)+(a^2*x^2-b^2)*y=0 >> >> which should lead to the following solution: >> >> y=c1*bessel_j(b, a*x) + c2*bessel_y(b,a*x) >> >> If I use ode2 to solve, I get the message "false", meaning it couldn't >> solve it, and if I use odelin or contrib_ode, I get the message >> >> EVAL: too many arguments given to SRATSIMP: (SRATSIMP P X) >> Automatically continuing. >> To reenable the Lisp debugger set *debugger-hook* to nil. >> >> However, if I ask ode2 to solve: >> >> x^2*diff(y,x,2)+x*diff(y,x)+(x^2-1)*y=0 >> >> I get: >> >> y=c1*bessel_j(1,x) + c2*bessel_y(1,x) >> >> which is, of course, the correct solution. Clearly, I am not doing >> something correctly with the constants a and b. Might there be someone >> who could provide me with some insight? Thank you all for your help! >> >> >> Cheers, >> Carl >> _______________________________________________ >> Maxima mailing list >> Maxima at math.utexas.edu >> http://www.math.utexas.edu/mailman/listinfo/maxima >> > > > From robert.dodier at gmail.com Sat Feb 14 12:16:49 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 14 Feb 2009 11:16:49 -0700 Subject: [Maxima] progress on i18n stuff Message-ID: Hello, about the i18n stuff, I'm revising MTELL and MERROR messages in the interest of clarity and consistency. As I go through the src/ files I guess I'll mark the updated messages with the gettext macro (leading underscore). Then translators can start working on them. I'm also planning to make a test script which triggers each message. There are tools to find gettext-ified strings and dump them into a .po or .pot file. I don't know much about that, maybe someone who has done this before can explain how we should go about this. I have a few questions at this point. (1) Where in the development directories should we put the .po files? Where are the compiled .mo files installed? What kind of magic do we need in Makefile.am or whatever? (2) I guess we need to make sure the _ reader macro is defined before any Maxima files are processed. (I'm not 100% in favor of making it a reader macro; if it were a function that would be OK with me. It seems like with a function there is less potential for varying behavior among Lisp implementations. Maybe I'm worrying over nothing.) (3) Not sure at this point what we should do about questions which accept abbreviations (e.g. "positive, negative, or zero?" which accepts p, n, or z). Suggestions? best Robert Dodier From willisb at unk.edu Sat Feb 14 12:20:07 2009 From: willisb at unk.edu (Barton Willis) Date: Sat, 14 Feb 2009 12:20:07 -0600 Subject: [Maxima] Bessel function differential equation In-Reply-To: <499709BC.1000000@udel.edu> References: <4996D935.6010504@udel.edu> , <499709BC.1000000@udel.edu> Message-ID: I used 5.17.0; using CVS Maxima + SBCL 1.0.22, loading odelin gives an error. (%i1) load(odelin); ; in: LAMBDA NIL ; (MAXIMA::SRATSIMP MAXIMA::P MAXIMA::X) ; ; caught STYLE-WARNING: ; The function was called with two arguments, but wants exactly one. This shouldn't be all that difficult to fix. After it's fixed, instead of building your own Maxima from scratch, to just replace the offending file. Barton -----Carl Krauthauser wrote: ----- >To:?Barton?Willis? >From:?Carl?Krauthauser? >Date:?02/14/2009?12:13PM >cc:?maxima at math.utexas.edu >Subject:?Re:?[Maxima]?Bessel?function?differential?equation > >Hello?Barton, > >Thank?you?for?the?work?around.??When?I?tried?to?do?the?same?thing,?I?got: > >Maxima?encountered?a?Lisp?error: > >EVAL:?too?many?arguments?given?to?SRATSIMP:?(SRATSIMP?P?X) >Automatically?continuing. >To?reenable?the?Lisp?debugger?set?*debugger-hook*?to?nil. > >This?is?a?consistent?error?I?get?every?time?I?load?a?module?and?then?try >to?run?something?with?it.??This?would?seem?to?suggest?a?bug;?I?am?using >maxima-5.17.1-1.centos4.i386.rpm?on?a?Centos?4.7,?i386?box.??Has?anyone >else?encountered?similar?problems???I?am?hoping?to?avoid?having?to >compile?my?own?version?of?Maxima. > >Is?it?suggested?that?I?compile?my?own?version?of?Maxima???Thank?you?for >your?help! > > >Cheers, >Carl > > >Barton?Willis?wrote: >>?A?work?around?is?to?call?odelin?directly >> >>??(%i5)?load(odelin)$ >>??(%i6)?odelin(x^2*'diff(y,x,2)+x*'diff(y,x)+(a^2*x^2-b^2)*y=0,y,x); >> >>??(%o6)?{bessel_j(b,-a*x),bessel_y(b,-a*x)} >> >>?I?think?ode2?is?supposed?to?call?odelin?automatically;?apparently >something >>?in?this >>?process?is?broken.?Maybe?you?could?file?a?bug?report. >> >>?Barton >> >>?-----maxima-bounces at math.utexas.edu?wrote:?----- >> >> >> >>>?I?am?trying?to?solve?the?following?diff?eq: >>> >>>?x^2*diff(y,x,2)+x*diff(y,x)+(a^2*x^2-b^2)*y=0 >>> >>>?which?should?lead?to?the?following?solution: >>> >>>?y=c1*bessel_j(b,?a*x)?+?c2*bessel_y(b,a*x) >>> >>>?If?I?use?ode2?to?solve,?I?get?the?message?"false",?meaning?it?couldn't >>>?solve?it,?and?if?I?use?odelin?or?contrib_ode,?I?get?the?message >>> >>>?EVAL:?too?many?arguments?given?to?SRATSIMP:?(SRATSIMP?P?X) >>>?Automatically?continuing. >>>?To?reenable?the?Lisp?debugger?set?*debugger-hook*?to?nil. >>> >>>?However,?if?I?ask?ode2?to?solve: >>> >>>?x^2*diff(y,x,2)+x*diff(y,x)+(x^2-1)*y=0 >>> >>>?I?get: >>> >>>?y=c1*bessel_j(1,x)?+?c2*bessel_y(1,x) >>> >>>?which?is,?of?course,?the?correct?solution.??Clearly,?I?am?not?doing >>>?something?correctly?with?the?constants?a?and?b.??Might?there?be?someone >>>?who?could?provide?me?with?some?insight???Thank?you?all?for?your?help! >>> >>> >>>?Cheers, >>>?Carl >>>?_______________________________________________ >>>?Maxima?mailing?list >>>?Maxima at math.utexas.edu >>>?http://www.math.utexas.edu/mailman/listinfo/maxima >>> >> >> >> From fateman at cs.berkeley.edu Sat Feb 14 12:42:35 2009 From: fateman at cs.berkeley.edu (Richard Fateman) Date: Sat, 14 Feb 2009 10:42:35 -0800 Subject: [Maxima] progress on i18n stuff In-Reply-To: References: Message-ID: <4997109B.1020606@cs.berkeley.edu> maybe change programs to allow 1. positive 2. negative 3. zero please type 1,2, or 3. [also allow p, pos, positive, n, neg, negative, ... perhaps] Robert Dodier wrote: > Hello, > > about the i18n stuff, I'm revising MTELL and MERROR messages > in the interest of clarity and consistency. As I go through the src/ > files I guess I'll mark the updated messages with the gettext macro > (leading underscore). Then translators can start working on them. > > I'm also planning to make a test script which triggers each message. > > There are tools to find gettext-ified strings and dump them into a > .po or .pot file. I don't know much about that, maybe someone who > has done this before can explain how we should go about this. > > I have a few questions at this point. > > (1) Where in the development directories should we put the .po files? > Where are the compiled .mo files installed? > What kind of magic do we need in Makefile.am or whatever? > > (2) I guess we need to make sure the _ reader macro is defined before > any Maxima files are processed. (I'm not 100% in favor of making > it a reader macro; if it were a function that would be OK with me. > It seems like with a function there is less potential for varying > behavior among Lisp implementations. Maybe I'm worrying over > nothing.) > > (3) Not sure at this point what we should do about questions > which accept abbreviations (e.g. "positive, negative, or zero?" > which accepts p, n, or z). Suggestions? > > best > > Robert Dodier > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > From robert.dodier at gmail.com Sat Feb 14 12:52:52 2009 From: robert.dodier at gmail.com (Robert Dodier) Date: Sat, 14 Feb 2009 11:52:52 -0700 Subject: [Maxima] Bessel function differential equation In-Reply-To: References: <4996D935.6010504@udel.edu> <499709BC.1000000@udel.edu> Message-ID: On 2/14/09, Barton Willis wrote: > I used 5.17.0; using CVS Maxima + SBCL 1.0.22, loading odelin gives an > error. > > (%i1) load(odelin); > ; in: LAMBDA NIL > ; (MAXIMA::SRATSIMP MAXIMA::P MAXIMA::X) > ; > ; caught STYLE-WARNING: > ; The function was called with two arguments, but wants exactly one. Looks like SRATSIMP is defined with 1 argument in src/simp.lisp but called with 2 arguments in share/contrib/diffequations/odelin.lisp at line 295. Haven't look at how to fix it. best Robert Dodier From dastew at sympatico.ca Sat Feb 14 13:15:13 2009 From: dastew at sympatico.ca (Doug Stewart) Date: Sat, 14 Feb 2009 14:15:13 -0500 Subject: [Maxima] z_transforms In-Reply-To: References: <4996D935.6010504@udel.edu> <4996E175.2030704@sympatico.ca> Message-ID: <49971841.7050901@sympatico.ca> Robert Dodier wrote: > On 2/14/09, Doug Stewart wrote: > > >> I see some work was done on Z Transforms in 2007, but I can't find it now. >> >> I am using Maxima 5.13.0 in Ubuntu. >> >> How do I get it to work? >> > > I recently worked on the z-transform stuff again and made some progress. > I've committed the z_transform.mac program and rtest_z_transform.mac > test script. You should be able to see them here: > http://maxima.cvs.sourceforge.net/maxima/maxima/share/contrib > They will be in the next release (due in April). > > random example: > > load (z_transform); > apply_z_transform (z_transform (1 + kron_delta (m, x), m, u)); > => 1/u^x+u/(u-1) > > batch (rtest_z_transform, test); > => (... lots o' stuff ...) 24/24 tests passed. > > > Hope this helps. I';ll be glad to hear any comments. There are > doubtless many more transform rules that can be implemented, > maybe we can get going on that. By the way, I'll recommend > getting the most recent version of Maxima (5.17.1). > > best > > Robert Dodier > > > Thank You !!!! here is one example that needs a little polish :-) with the "-" in the exponential it doesn't work (%i77) apply_z_transform (z_transform (a+b*(e^(-p*T))^(m) , m, z)); a z 1 (%o77) ----- + b z_transform(-------, m, z) z - 1 p T m (e ) (%i78) But without the "-" it works. (%i76) apply_z_transform (z_transform (a+b*(e^(p*T))^(m) , m, z)); b z a z (%o76) -------- + ----- p T z - 1 z - e (%i77) A happy Doug From drdieterkaiser at web.de Sat Feb 14 13:16:06 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sat, 14 Feb 2009 20:16:06 +0100 Subject: [Maxima] progress on i18n stuff In-Reply-To: References: Message-ID: <9AD2B68F52FC4C57BD0A77FF34B2C8BA@Kaiser> -----Urspr?ngliche Nachricht----- Von: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] Im Auftrag von Robert Dodier Gesendet: Samstag, 14. Februar 2009 19:17 An: Maxima List Betreff: [Maxima] progress on i18n stuff > (3) Not sure at this point what we should do about questions > which accept abbreviations (e.g. "positive, negative, or zero?" > which accepts p, n, or z). Suggestions? Perhaps we should do something like: "(1) positive, (2) negative, or (3) zero?" And the user has to choose the correct number. This should work in all languages. Dieter Kaiser From willisb at unk.edu Sat Feb 14 13:22:21 2009 From: willisb at unk.edu (Barton Willis) Date: Sat, 14 Feb 2009 13:22:21 -0600 Subject: [Maxima] Bessel function differential equation In-Reply-To: References: <4996D935.6010504@udel.edu> <499709BC.1000000@udel.edu> , Message-ID: Here is the fix; you can paste this into odelin.lisp (over write the old polynomial-filter). Just appending this to your init.lisp file will not work). It seems that GCL isn't as careful as it should be? After some testing, I'll commit the fix. Thanks for the bug report and the help in locating it. (defun polynomial-filter (p x f) (let (($gcd '$spmod) ($algebraic t) ($ratfac nil) ($ratprint nil) ($radexpand nil)) (setq p (sratsimp p)) ;; Get rid of terms like sqr(5)^2, %i^2... (setq p ($mysqfr p x)) (setq p (if (mtimesp p) (margs p) (list p))) (let ((q 1) (n)) (dolist (pj p q) (cond ((mexptp pj) (setq n (nth 2 pj)) (setq pj (nth 1 pj))) (($freeof x pj) (setq n 0)) (t (setq n 1))) (setq n (funcall f n)) (setq q (mult q (power pj n))))))) Barton -----maxima-bounces at math.utexas.edu wrote: ----- >To:?Barton?Willis? >From:?Robert?Dodier? >Sent?by:?maxima-bounces at math.utexas.edu >Date:?02/14/2009?12:52PM >cc:?maxima at math.utexas.edu,?Carl?Krauthauser? >Subject:?Re:?[Maxima]?Bessel?function?differential?equation > >On?2/14/09,?Barton?Willis??wrote: > >>?I?used?5.17.0;?using?CVS?Maxima?+?SBCL?1.0.22,?loading?odelin?gives?an >>??error. >> >>??(%i1)?load(odelin); >>??;?in:?LAMBDA?NIL >>??;?????(MAXIMA::SRATSIMP?MAXIMA::P?MAXIMA::X) >>??; >>??;?caught?STYLE-WARNING: >>??;???The?function?was?called?with?two?arguments,?but?wants?exactly?one. > >Looks?like?SRATSIMP?is?defined?with?1?argument?in?src/simp.lisp >but?called?with?2?arguments?in?share/contrib/diffequations/odelin.lisp >at?line?295.?Haven't?look?at?how?to?fix?it. > >best > >Robert?Dodier >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From rich.hennessy at verizon.net Sat Feb 14 15:05:34 2009 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sat, 14 Feb 2009 16:05:34 -0500 Subject: [Maxima] Converting a function to one Message-ID: <14D9C45594414FBAAC29F48B6FEAEC2E@RichDesktop> Hi List, I have an expression containing many calls to the same function say f(someargs)+f(someotherargs)/f(somestuff) and I want to know what is the fastest way to change all of the occurrences of this function to the number 1. I want/need to do this in my program to eliminate pwdelta(someargs)'s inside of an integral and so that is the reason for my question. I have been doing it a silly way by creating a new function and using opsubst(g=pwdelta, expr) where g is defined g(x):=1. Is that the best way? It is pretty fast, but is there a better way? One problem I get is that I have to do an ev(opsubst(g=pwdelta, expr), nouns) to get Maxima to change the g's to a 1 and I have been observing in the list that ev() is a problem function. Thanks for any help, Rich -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090214/eff50a9e/attachment.htm From willisb at unk.edu Sat Feb 14 16:11:37 2009 From: willisb at unk.edu (Barton Willis) Date: Sat, 14 Feb 2009 16:11:37 -0600 Subject: [Maxima] Converting a function to one In-Reply-To: <14D9C45594414FBAAC29F48B6FEAEC2E@RichDesktop> References: <14D9C45594414FBAAC29F48B6FEAEC2E@RichDesktop> Message-ID: To avoid ev(..., nouns), substitute a lambda form for the function: (%i2) g(x) := 1$ (%i3) subst(g,f, f(x)); (%o3) g(x) (%i4) subst(f = lambda([s],1), f(x)); (%o4) 1 Barton -----maxima-bounces at math.utexas.edu wrote: ----- >I?have?an?expression?containing?many?calls?to?the?same >function?say > >f(someargs)+f(someotherargs)/f(somestuff) > >and?I >want?to?know?what?is?the?fastest?way?to?change?all?of?the?occurrences?of >this >function?to?the?number?1.??I?want/need?to?do?this?in?my?program?to >eliminate?pwdelta(someargs)'s?inside?of?an?integral?and?so?that?is?the >reason >for?my?question.??I?have?been?doing?it?a?silly?way?by?creating?a?new >function?and?using?opsubst(g=pwdelta,?expr)?where?g?is?defined?g(x):=1. >Is >that?the?best?way???It?is?pretty?fast,?but?is?there?a?better?way???One >problem?I?get?is?that?I?have?to?do?an?ev(opsubst(g=pwdelta,?expr),?nouns) >to?get >Maxima?to?change?the?g's?to?a?1?and?I?have?been?observing?in?the?list?that >ev() >is?a?problem?function. > >Thanks?for?any?help, > >Rich >_______________________________________________ >Maxima?mailing?list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From sen1 at math.msu.edu Sat Feb 14 16:12:44 2009 From: sen1 at math.msu.edu (Sheldon Newhouse) Date: Sat, 14 Feb 2009 17:12:44 -0500 Subject: [Maxima] Converting a function to one In-Reply-To: <14D9C45594414FBAAC29F48B6FEAEC2E@RichDesktop> References: <14D9C45594414FBAAC29F48B6FEAEC2E@RichDesktop> Message-ID: <499741DC.2010006@math.msu.edu> Richard Hennessy wrote: > Hi List, > > I have an expression containing many calls to the same function say > > f(someargs)+f(someotherargs)/f(somestuff) > > and I want to know what is the fastest way to change all of the > occurrences of this function to the number 1. I want/need to do this > in my program to eliminate pwdelta(someargs)'s inside of an integral > and so that is the reason for my question. I have been doing it a > silly way by creating a new function and using opsubst(g=pwdelta, > expr) where g is defined g(x):=1. Is that the best way? It is pretty > fast, but is there a better way? One problem I get is that I have to > do an ev(opsubst(g=pwdelta, expr), nouns) to get Maxima to change the > g's to a 1 and I have been observing in the list that ev() is a > problem function. > > Thanks for any help, > > Rich > ------------------------------------------------------------------------ > > _______________________________________________ > Maxima mailing list > Maxima at math.utexas.edu > http://www.math.utexas.edu/mailman/listinfo/maxima > You might want to play with evaluated and unevaluated function definitions, etc. E.g. (%o33) f(x):=x^2+2 (%i34) g: 'f+ 'f/('f+1)^2; (%o34) f/(f+1)^2+f (%i35) ''g; (%o35) (x^2+2)/(x^2+3)^2+x^2+2 (%i36) subst(f=1,g); (%o36) f/(f+1)^2+f (%i37) subst('f=1,g); (%o37) 5/4 HTH, -sen If you define your functions as unevaluated expressions, then you can evaluate them when needed, and you can use 'subst' to replace them by 1. E.g. From rich.hennessy at verizon.net Sat Feb 14 17:43:39 2009 From: rich.hennessy at verizon.net (Richard Hennessy) Date: Sat, 14 Feb 2009 18:43:39 -0500 Subject: [Maxima] Converting a function to one References: <14D9C45594414FBAAC29F48B6FEAEC2E@RichDesktop> Message-ID: <8426301D17354B0FACDF69B681810433@RichDesktop> "(%i4) subst(f = lambda([s],1), f(x));" Thanks, that worked. Rich ----- Original Message ----- From: "Barton Willis" To: "Richard Hennessy" Cc: "Maxima List" ; "Richard Fateman" ; "Richard Fateman" Sent: Saturday, February 14, 2009 5:11 PM Subject: Re: [Maxima] Converting a function to one To avoid ev(..., nouns), substitute a lambda form for the function: (%i2) g(x) := 1$ (%i3) subst(g,f, f(x)); (%o3) g(x) (%i4) subst(f = lambda([s],1), f(x)); (%o4) 1 Barton -----maxima-bounces at math.utexas.edu wrote: ----- >I have an expression containing many calls to the same >function say > >f(someargs)+f(someotherargs)/f(somestuff) > >and I >want to know what is the fastest way to change all of the occurrences of >this >function to the number 1. I want/need to do this in my program to >eliminate pwdelta(someargs)'s inside of an integral and so that is the >reason >for my question. I have been doing it a silly way by creating a new >function and using opsubst(g=pwdelta, expr) where g is defined g(x):=1. >Is >that the best way? It is pretty fast, but is there a better way? One >problem I get is that I have to do an ev(opsubst(g=pwdelta, expr), nouns) >to get >Maxima to change the g's to a 1 and I have been observing in the list that >ev() >is a problem function. > >Thanks for any help, > >Rich >_______________________________________________ >Maxima mailing list >Maxima at math.utexas.edu >http://www.math.utexas.edu/mailman/listinfo/maxima From drdieterkaiser at web.de Sat Feb 14 18:35:45 2009 From: drdieterkaiser at web.de (Dieter Kaiser) Date: Sun, 15 Feb 2009 01:35:45 +0100 Subject: [Maxima] Directed infinities Message-ID: <89C2AA4521E242C3A7BED5C55B6F9B42@Kaiser> I think we had serveral attempts to handle infinities more correct. I have tried a next one. At first I have introduced the generalized concept of a directed infinity and implemented it as a simplifying Maxima function: directed_infinity(z) z is in general a complex value The internal representation is ((%directed_infinity) z) I have chossen the following definitions: directed_infinity(1) ---> '$inf directed_infinity(-1) ---> '$minf directed_infinity(0) ---> '$infinity directed_infinity(false) ---> '$und or '$ind I have not distinguished beetween '$und and '$ind and call both cases indeterminate. Next I have implemented the arithmetic (addition, multiplication, exponentiation) for directed infinities. The code is directly implemented in the simplifying functions for add, mul and power. I have tried to be complete. These are examples: Numbers and symbols are absorbed from the directed infinity: (%i5) 10+x+y+directed_infinity(z)+0+a+1+2*a (%o5) directed_infinity(z) The addition of inf and inf gives inf: (%i19) directed_infinity(1)+directed_infinity(1) (%o19) directed_infinity(1) The addition of inf and minf gives indeterminate: (%i33) directed_infinity(1)+directed_infinity(-1) (%o33) directed_infinity(false) But subtraction of inf and minf gives again inf: (%i101) directed_infinity(1)-directed_infinity(-1) (%o101) directed_infinity(1) Multiplication with Zero gives indeterminate: (i165) 0*directed_infinity(1) (%o165) directed_infinity(false) (%i167) 0*directed_infinity(-1) (%o167) directed_infinity(false) (%i169) 0*directed_infinity(0) (%o169) directed_infinity(false) Expressions in a multiplication are absorbed as an argument of the directed infinity. The argument is simplified to the complex signum value: (%i423) z*directed_infinity(1); (%o423) directed_infinity(z/abs(z)) (%i424) (1+%i)*directed_infinity(1); (%o424) directed_infinity((%i+1)/sqrt(2)) (%i425) sin(x)*directed_infinity(1); (%o425) directed_infinity(sin(x)/abs(sin(x))) The general case which simplifies to the correct expressions: (%i243) directed_infinity(x)*directed_infinity(y) (%o243) directed_infinity(x*y/(abs(x)*abs(y))) Division of Zero through infinities: (%i245) 0/directed_infinity(1) (%o245) 0 But (%i251) 0/directed_infinity(false) (%o251) directed_infinity(false) Zero and a directed infinity as a power: (%i325) 0^directed_infinity(1) (%o325) 0 (%i327) 0^directed_infinity(-1) (%o327) directed_infinity(0) Nested directed infinities are simplified: (%i430) directed_infinity(directed_infinity(z)); (%o430) directed_infinity(z/abs(z)) Because the directed infinity is implemented as a function, Maxima has no problems. Nothing has changed. But it might be possible to introduce the directed infinity step by step into the algorithm of Maxima. To do this in principle it should be possible to replace e.g. '$inf --> ((%directed_infinity) 1) Next we have to change the tests against the symbol '$inf, '$minf, ... e. g. (eq sym '$inf) --> (infinity-p sym) (eq sym '$minf) --> (minus-infinity-p sym) (eq sym '$infinity) --> (complex-infinity-p sym) (member sym '($inf $min)) --> (real-infinity-p sym) It is also possible to simplify the directed infinities to the symbols '$inf,'$minf, ... and call the algorithm. I think there are a lot of possible solutions and extensions which will work with a more general concept like the directed infinities. This is an example of a piece of code which handles the case with a directed infinity as the base of a power function. This code is added to simpexpt: ;; The base is one of the infinities or indeterminate ((directed-infinity-p gr) (cond ((or (zerop1 pot) (indeterminate-p pot) (indeterminate-p gr)) (return (list '(%directed_infinity) nil))) ((onep1 (mul -1 pot)) (cond ((not (indeterminate-p gr)) (return 0)) (t (return (list '(%directed_infinity) nil))))) ((infinity-p gr) (cond ((infinity-p pot) (return (list '(%directed_infinity) 0))) ((minus-infinity-p pot) (return 0)) (t (return (list '(%directed_infinity) nil))))) ((minus-infinity-p gr) (cond ((infinity-p pot) (return (list '(%directed_infinity) 0))) ((minus-infinity-p pot) (return 0)) (t (return (list '(%directed_infinity) nil))))) ((complex-infinity-p gr) (cond ((infinity-p pot) (return (list '(%directed_infinity) 0))) ((minus-infinity-p pot) (return 0)) (t (return (list '(%directed_infinity) nil))))) ((not (indeterminate-p gr)) (cond ((infinity-p pot) (return (list '(%directed_infinity) 0))) ((minus-infinity-p pot) (return 0)) (t (return (list '(%directed_infinity) nil))))) (t (return (list '(%directed_infinity) nil))))) This is the simplifying function for a directed infinity (here a simplification to the symbols '$inf,... can be added): (defun simp-directed-infinity (expr z simpflag) (oneargcheck expr) (setq z (simpcheck (cadr expr) simpflag)) (cond ((eq z nil) (eqtest (list '(%directed_infinity) z) expr)) ((directed-infinity-p z) (simplify (list '(%directed_infinity) (cadr z)))) ((not (eq ($csign z) '$zero)) (eqtest (list '(%directed_infinity) (div z (simplify (list '(mabs) z)))) expr)) (t (eqtest (list '(%directed_infinity) z) expr)))) Comments are welcome. Dieter Kaiser From carl at udel.edu Sat Feb 14 19:19:33 2009 From: carl at udel.edu (Carl Krauthauser) Date: Sat, 14 Feb 2009 20:19:33 -0500 Subject: [Maxima] Bessel function differential equation In-Reply-To: References: <4996D935.6010504@udel.edu> <499709BC.1000000@udel.edu> , Message-ID: <49976DA5.6080408@udel.edu> Hi Barton, That did the trick! I am now able to use contrib_ode, and odelin, to solve this problem. I really appreciate all the help you've given me, and I will work on improving my Lisp skills. Perhaps with a little time, I can assist others as you have with me. Thanks again! Cheers, Carl Barton Willis wrote: > Here is the fix; you can paste this into odelin.lisp (over write the old > polynomial-filter). > Just appending this to your init.lisp file will not work). > > It seems that GCL isn't as careful as it should be? > > After some testing, I'll commit the fix. Thanks for the bug report and the > help in locating it. > > (defun polynomial-filter (p x f) > (let (($gcd '$spmod) ($algebraic t) ($ratfac nil) > ($ratprint nil) ($radexpand nil)) > (setq p (sratsimp p)) ;; Get rid of terms like sqr(5)^2, %i^2... > (setq p ($mysqfr p x)) > (setq p (if (mtimesp p) (margs p) (list p))) > (let ((q 1) (n)) > (dolist (pj p q) > (cond ((mexptp pj) > (setq n (nth 2 pj)) > (setq pj (nth 1 pj))) > (($freeof x pj) > (setq n 0)) > (t > (setq n 1))) > (setq n (funcall f n)) > (setq q (mult q (power pj n))))))) > > Barton > > -----maxima-bounces at math.utexas.edu wrote: ----- > > >> To: Barton Willis >> From: Robert Dodier >> Sent by: maxima-bounces at math.utexas.edu >> Date: 02/14/2009 12:52PM >> cc: maxima at math.utexas.edu, Carl Krauthauser >> Subject: Re: [Maxima] Bessel function differential equation >> >> On 2/14/09, Barton Willis wrote: >> >> >>> I used 5.17.0; using CVS Maxima + SBCL 1.0.22, loading