You can subscribe to this list here.
2014 
_{Jan}

_{Feb}
(232) 
_{Mar}
(323) 
_{Apr}
(383) 
_{May}
(359) 
_{Jun}
(435) 
_{Jul}
(252) 
_{Aug}
(172) 
_{Sep}
(265) 
_{Oct}
(263) 
_{Nov}
(350) 
_{Dec}
(294) 

S  M  T  W  T  F  S 







1
(7) 
2
(14) 
3
(22) 
4
(14) 
5
(9) 
6
(8) 
7
(18) 
8
(8) 
9
(1) 
10
(4) 
11
(4) 
12
(22) 
13
(10) 
14
(8) 
15
(6) 
16
(6) 
17
(15) 
18
(1) 
19
(13) 
20
(15) 
21
(7) 
22
(12) 
23
(17) 
24
(13) 
25
(10) 
26
(12) 
27
(8) 
28
(9) 
29
(14) 
30
(10) 
31
(6) 





From: Robert Dodier <robert.dodier@gm...>  20140331 18:01:29

On 20140330, Nijso Beishuizen <nijso@...> wrote: > I have created a git repository for the Kovacic algorithm. You can find > it here: > https://github.com/bigfooted/maximaodesolve Thanks a lot. I've copied kovacic.mac (renaming to kovacicODE.mac to make the filename coincide with the function name) and README to share/contrib/maximaodesolve in Maxima, so it will be included in the next release. Maybe someone has mentioned it already  it would be very helpful to include a list of example problems and expected results. Speaking of which, I'm planning to make a release branch for Maxima 5.33 in the next few days. best, Robert Dodier 
From: Leo Butler <l_butler@us...>  20140331 17:56:13

velten <kai.velten@...> writes: > 1. we both are of course in 100% agreement that it would be a > particularly stupid idea to switch off warnings and error messages in > normal operation, but > > 2. there are nevertheless exceptional situations where it makes sense to > switch off these messages, e.g. if you want to print out a short > documentation of your programming session, including output, but not > including 10 pages of warnings which you might want to analyze later. > > I'd be still interested in a preamble such as > ratprint:false;... > which could be used to temporarily switch off all warnings and error > messages; this would be useful for other users as well. > > May be one of the other list members knows how to do this. Kai, you are using a frontend to Maxima, correct? My suggestion would be to have the frontend pass on the input and output from Maxima and let it hide anything that comes between the input and output. In Emacs, for example, you could set the text properties to hidden, which would let the user inspect the hidden text if wanted. I imagine that there are similar features in most frontends. The only complication is to correctly delimit input and output. The altdisplay package gives the freedom to do this. For example, $ ./maximalocal Maxima branch_5_32_base_118_gc597229 http://maxima.sourceforge.net using Lisp SBCL 1.0.56 Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) load("altdisplay.mac")$ (%i2) set_prompt('prefix,"<<input>>",'general,"<<warnings/errors>>")$ <<input>>(%i3) define_alt_display(f(form),block([alt_display2d:false],printf(true,"<<output>>~%"),displa(form))); <<warnings/errors>>(%o3) f(form) := block([simp : false], block([*altdisplay2d* : false], printf(true, "<<output>>~%"), displa(form))) <<input>>(%i4) set_alt_display(2,f)$ <<warnings/errors>> <<input>>(%i5) rat(1.2); <<warnings/errors>> rat: replaced 1.2 by 6/5 = 1.2 <<output>> 6 (%o5)/R/  5 <<input>>(%i6) integrate(x^n,x); <<warnings/errors>><<input>><<output>> Is n equal to  1? n; <<warnings/errors>><<output>> n + 1 x (%o6)  n + 1 <<input>>(%i7) solve(sin(x),x); <<warnings/errors>> solve: using arctrig functions to get a solution. Some solutions will be lost. <<output>> (%o7) [x = 0] <<input>>(%i8) error(); <<warnings/errors>>  an error. To debug this try: debugmode(true); <<input>>(%i9) Leo 
From: Robert Dodier <robert.dodier@gm...>  20140331 16:39:16

On 20140331, Richard Fateman <fateman@...> wrote: >:lisp (defun merror(&rest foo) nil) > > and see if that stifles everything you want to stifle. Yeah  and also :lisp (defun mtell (&rest foo) nil) for nonerror messages. best Robert Dodier 
From: Richard Fateman <fateman@be...>  20140331 13:54:51

You can do this: :lisp (defun merror(&rest foo) nil) and see if that stifles everything you want to stifle. RJF 
From: Stavros Macrakis <macrakis@al...>  20140331 13:50:22

Can you assume that Vmax>0? If so, ratsimp(imagpart(erg[1])) simplifies to 0. On Sat, Mar 29, 2014 at 10:54 AM, velten <kai.velten@...> wrote: > Thanks, I'll try that. You are probably right that real_p(e) won't work > on complex expressions, and I will probably have to keep my current > workaround for complex expression, which is plotting imagpart e.g. using > plot3d over the subset of the parameter space where I expect imagpart=0. > > Kai > > > > > > > Original Message > From: Barton Willis <willisb@...> > To: velten <kai.velten@...>, andre maute <andre.maute@...> > Subject: RE: [Maximadiscuss] Can Maxima prove Im(x)=0? > Date: Sat, 29 Mar 2014 12:04:59 +0000 > > > 1. Can I somehow solve equations with assumptions similar to: > > assume(12*Vmax%pi*Lv^3<0); > > erg:solve((Lvbv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); > > Solve does not exclude solutions that do not satisfy the assumptions in > the fact database. > You could try using sublist on the solutions to find the solution that > satisfies certain inequalities. > > >2. Can Maxima prove imagpart(x)=0, if x is complex, depends on > >parameters a,b,c..., and the parameter space is restricted similar to > >the cubic example below. > > I'd say Maxima isn't capable of proving anything. You can certainly define > predicates such as > > real_p(e) := is(equal(imagpart(e),0)) > > For simple expressions, this function might work, but in general, I'd > guess that real_p will not > work as well as you would like it to work. > > > > Barton > > > >  > _______________________________________________ > Maximadiscuss mailing list > Maximadiscuss@... > https://lists.sourceforge.net/lists/listinfo/maximadiscuss > 
From: velten <kai.velten@hs...>  20140331 05:36:43

You're right, grepping wouldn't make much sense ... so the answer is there is no on/off switch for messages ... Kai Original Message From: Rupert Swarbrick <rswarbrick@...> To: maximadiscuss@... Subject: Re: [Maximadiscuss] How can I swith off warnings? Date: Sun, 30 Mar 2014 22:20:05 +0100 velten <kai.velten@...> writes: > 2. there are nevertheless exceptional situations where it makes sense to > switch off these messages, e.g. if you want to print out a short > documentation of your programming session, including output, but not > including 10 pages of warnings which you might want to analyze later. > > I'd be still interested in a preamble such as > ratprint:false;... > which could be used to temporarily switch off all warnings and error > messages; this would be useful for other users as well. If your use case is something like scripted_input.mac ==> maxima_output.txt ==> documentation.something then why not just grep for errors between the second and third stages and strip them out? I can definitely see myself wanting to do things like this, but I'm also pretty certain that each time I'll have different requirements about what stays in and what gets stripped out, so it's probably easiest just to use sed or grep on the text in an adhoc way. For example, do I want to keep warnings about inverse trig functions? rat conversion? invalid numbers in range of plots? ...??? Frankly, I'd rather make each decision when I come to it and, if a warning/error message doesn't come up for my example, I don't have to think about it at all. Awesome! Rupert  _______________________________________________ Maximadiscuss mailing list Maximadiscuss@... https://lists.sourceforge.net/lists/listinfo/maximadiscuss 
From: Rupert Swarbrick <rswarbrick@gm...>  20140330 21:30:22

velten <kai.velten@...> writes: > 2. there are nevertheless exceptional situations where it makes sense to > switch off these messages, e.g. if you want to print out a short > documentation of your programming session, including output, but not > including 10 pages of warnings which you might want to analyze later. > > I'd be still interested in a preamble such as > ratprint:false;... > which could be used to temporarily switch off all warnings and error > messages; this would be useful for other users as well. If your use case is something like scripted_input.mac ==> maxima_output.txt ==> documentation.something then why not just grep for errors between the second and third stages and strip them out? I can definitely see myself wanting to do things like this, but I'm also pretty certain that each time I'll have different requirements about what stays in and what gets stripped out, so it's probably easiest just to use sed or grep on the text in an adhoc way. For example, do I want to keep warnings about inverse trig functions? rat conversion? invalid numbers in range of plots? ...??? Frankly, I'd rather make each decision when I come to it and, if a warning/error message doesn't come up for my example, I don't have to think about it at all. Awesome! Rupert 
From: Nijso Beishuizen <nijso@ho...>  20140330 18:37:34

Dear Robert, I will have to do the comparison, but I expect there is quite some overlap. The nice thing about the Kovacic algorithm is that it is a single algorithm solving many equations. An algorithm solving 90% of the second order linear ODE's is based on trying to find hypergeometric solutions (Chan and Chebterrab, 2004) but I haven't studied this method in detail. Best, Nyso On Sun, 20140330 at 17:20 +0000, Robert Dodier wrote: > On 20140330, Nijso Beishuizen <nijso@...> wrote: > > > The Kamke database has 445 ODE's, it has 363 ODEs with rational > > coefficients, and 181 of those can be solved by Kovacic' algorithm. > > Kovacic.mac currently returns 180 solutions. > > How do the existing Maxima functions for ODE's compare to kovacicODE? > How many problems can be solved that weren't solved before? > > Thanks a lot for you work, I appreciate it. > > best, > > Robert Dodier > > >  > _______________________________________________ > Maximadiscuss mailing list > Maximadiscuss@... > https://lists.sourceforge.net/lists/listinfo/maximadiscuss > 
From: Barton Willis <willisb@un...>  20140330 17:40:02

________________________________ As far as I can tell, Oopsthe example in https://www.ma.utexas.edu/pipermail/maxima/2009/018604.html involves a side effect. With my code (%i5) (a[1] : [], a[2] : [], i : 0)$ (%i6) push(5,a[i : i+1]); (%o6) [5] (%i8) [a[1],a[2]]; (%o8) [[],[5]] Surely (%o8) should be [[5], []]. Maybe this is a deal breaker? I'll see about fixing it... 
From: Robert Dodier <robert.dodier@gm...>  20140330 17:35:11

On 20140330, Barton Willis <willisb@...> wrote: > I think it's not necessary, but without the explicit call to > simplifya, the simplifier insists on simplifying every list member. > That's spendy. Surely just pushing a new list member shouldn't > render the other members to be unsimplified? Does that really happen? I thought that the simplifier would only simplify the toplevel operator of the return value, not all the arguments too. Or if it does look at every argument, that it honors the SIMP flag, so the elements are not resimplified if they are simplified already. best, Robert Dodier 
From: Robert Dodier <robert.dodier@gm...>  20140330 17:26:22

On 20140329, Richard Fateman <fateman@...> wrote: > I think you are mistaken because the simplifier is called on %o5, not > on foo. Good point. In general a Lisp function in Maxima can expect that its return value will be simplfied. But in a function which has side effects, there's no other mechanism for ensuring that any sideeffect results get simplified, so it has to be done explicitly, if that's desirable. best, Robert Dodier 
From: Robert Dodier <robert.dodier@gm...>  20140330 17:20:45

On 20140330, Nijso Beishuizen <nijso@...> wrote: > The Kamke database has 445 ODE's, it has 363 ODEs with rational > coefficients, and 181 of those can be solved by Kovacic' algorithm. > Kovacic.mac currently returns 180 solutions. How do the existing Maxima functions for ODE's compare to kovacicODE? How many problems can be solved that weren't solved before? Thanks a lot for you work, I appreciate it. best, Robert Dodier 
From: Nijso Beishuizen <nijso@ho...>  20140330 16:24:00

Dear all, I have created a git repository for the Kovacic algorithm. You can find it here: https://github.com/bigfooted/maximaodesolve The usage is simple, just call kovacicODE: load("kovacic.mac")' declare(a,constant); kovacicODE('diff(y,x,2)=a*y,y,x); If kovacicODE finds a solution, it returns [y=solution] and if it doesn't find a solution, it returns false. The Kamke database has 445 ODE's, it has 363 ODEs with rational coefficients, and 181 of those can be solved by Kovacic' algorithm. Kovacic.mac currently returns 180 solutions. Some solutions take a long time to compute, e.g. Kamke 2.152. This is due to an intermediate integrate taking 10 minutes or so. Some returned solutions are quite complicated and could be simplified, but this is a difficult problem. I am not a maxima expert. If you see strange things in the code, please let me know. Have fun! Best, Nyso On Sun, 20140323 at 22:11 +0100, Nijso Beishuizen wrote: > Dear list, please see below. If someone is interested in kovacicODE.mac > (around 34kb), just let me know. > > Best, > Nyso > > On Sun, 20140323 at 22:02 +0100, Nijso Beishuizen wrote: > > Dear Neeraj, > > > > > > kovacicODE solves second order linear ODE's with Liouvillian solutions > > In maxima, just do something like this: > > > > load('kovacic.mac'); > > ode:'diff(y,x,2)+a*'diff(y,x)+b*x=c; > > kovacicODE(ode,y,x); > > > > Note that there is a lot of output before the final solution is given > > > > kovacicODE was tested using the Kamke database, which is included in > > maxima in share/contrib/diffequations. > > It solves around 50% or so of the second order linear equations. > > > > > > The Kovacic algorithm is known to take a long time to finish for certain > > ODE's, on my pc sometimes 5 minutes before it finally concludes that no > > Liouvillian solutions exist. > > > > > > It is recommended to define constants appearing in the ODE as constants. > > It might be necessary to restrict the constants further, i.e. say that > > a>0 or even x>0. > > It is sometimes necessary to load absimp to get rid of abs(a) when a>0. > > > > > > > > After kovacicODE has found a solution, it tries to simplify the solution by > > merging constants into the integration constants %k1 and %k2. > > I also try some simplifications and check the number of operators in the > > new result. If the result has less operators, the simplification is > > accepted. > > In some cases, you will still end up with a complex solution, or with a > > solution containing exponential integrals or gamma_incomplete solutions, > > even though the solution can be simplified further. > > > > > > > > > > On Wed, 20140319 at 12:14 +0530, Neeraj Sangwan wrote: > > > I am interested in development version. Could you please send it to me. > > > > > > Thanking you > > > Neeraj > > > > > > On Wed, Mar 19, 2014 at 2:32 AM, nijso beishuizen <nijso@...> wrote: > > > > Hello Neeraj, > > > > > > > > I have written an implementation of the Kovacic algorithm. It is based on > > > > the thesis of Carolyn Smith which you can download from the university of > > > > waterloo as a pdf: > > > > > > > > https://cs.uwaterloo.ca/research/tr/1984/CS8435.pdf > > > > > > > > I have a development version, if you are interested I can send it to you. > > > > > > > > Best, > > > > Nijso > > > > > > > > > > > >> Date: Sat, 8 Mar 2014 11:23:17 +0530 > > > >> Subject: Kovacic Algorithm > > > >> From: ms09089@... > > > >> To: nijso@... > > > > > > > >> > > > >> Respected Sir > > > >> > > > >> I was searching form some implemntation of kovacic algorithm and I > > > >> fouund your question regarding the same somewhere. Did you find some > > > >> implementation? If yes could you please send some inks or files > > > >> regarding this? > > > >> > > > >> Thanking you > > > >> Neeraj > > > >> 5th year Integrated MS student > > > >> IISER Mohali > > > > > > > > > > > > >  > Learn Graph Databases  Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > _______________________________________________ > Maximadiscuss mailing list > Maximadiscuss@... > https://lists.sourceforge.net/lists/listinfo/maximadiscuss > 
From: Raymond Toy <toy.raymond@gm...>  20140330 15:56:59

>>>>> "velten" == velten <kai.velten@...> writes: velten> Ray, in a forum like this, it's a good idea to start with the assumption velten> that your dialog partners are not much less experienced mathematicians velten> and programmers compared to yourself. In fact, velten> 1. we both are of course in 100% agreement that it would be a velten> particularly stupid idea to switch off warnings and error messages in velten> normal operation, but velten> 2. there are nevertheless exceptional situations where it makes sense to velten> switch off these messages, e.g. if you want to print out a short velten> documentation of your programming session, including output, but not velten> including 10 pages of warnings which you might want to analyze later. You never explained your use case. This makes some sense now. I don't quite see how it's documenting your session when you remove the 10 pages of warnings that would have been asked when you rerun the session. But that's ok. I don't need to understand that. velten> I'd be still interested in a preamble such as velten> ratprint:false;... velten> which could be used to temporarily switch off all warnings and error velten> messages; this would be useful for other users as well. Unfortunately, unless someone else has made such a list, I think the only way is to read the docs to find all the flags or to read the code to find them. There are lots of flags; I can't remember them all. float2bf is another. I don't think you can turn off the message from solve about using arctrig functions. Ray 
From: velten <kai.velten@hs...>  20140330 10:09:35

Ray, in a forum like this, it's a good idea to start with the assumption that your dialog partners are not much less experienced mathematicians and programmers compared to yourself. In fact, 1. we both are of course in 100% agreement that it would be a particularly stupid idea to switch off warnings and error messages in normal operation, but 2. there are nevertheless exceptional situations where it makes sense to switch off these messages, e.g. if you want to print out a short documentation of your programming session, including output, but not including 10 pages of warnings which you might want to analyze later. I'd be still interested in a preamble such as ratprint:false;... which could be used to temporarily switch off all warnings and error messages; this would be useful for other users as well. May be one of the other list members knows how to do this. Kai To: maximadiscuss@... Subject: Re: [Maximadiscuss] How can I swith off warnings? Date: Sat, 29 Mar 2014 08:56:38 0700 >>>>> "velten" == velten <kai.velten@...> writes: velten> I don't agree. What Ray says applies to beginners who don't know what velten> they do. I don't think I'm a beginner, but I still make stupid mistakes. (Who doesn't?) I want to know if I did something nonsensical like enter the limits of a plot incorrectly. But it's your application; you can do what you want. Ray velten> To: maximadiscuss@... velten> Subject: Re: [Maximadiscuss] How can I swith off warnings? velten> Date: Fri, 28 Mar 2014 11:39:59 0700 >>>>> "velten" == velten <kai.velten@...> writes: velten> I'll try errcatch. I don't want that message in a program used by velten> practitioners who occasionally enter invalid limits for plots, which are velten> still valid ... these people don't like any kind of "mathematical" velten> messages ... velten> Well, I hate systems like that. You prevent error messages so now the velten> user wonders why there's no plot or why the result is just junk. And velten> without the message, you have no idea where to look for this, except velten> to look, painstakingly, at every single line of input to see what the velten> mistake is. And it's really easy to, say, not notice that the plot velten> limits are wrong (because you don't know the syntax well), or that velten> you're erroneously dividing by zero somewhere, and on and on. velten> Yuck! velten> Ray velten>  velten> _______________________________________________ velten> Maximadiscuss mailing list velten> Maximadiscuss@... velten> https://lists.sourceforge.net/lists/listinfo/maximadiscuss velten>   _______________________________________________ Maximadiscuss mailing list Maximadiscuss@... https://lists.sourceforge.net/lists/listinfo/maximadiscuss 
From: Barton Willis <willisb@un...>  20140330 02:20:27

>> (defmspec $push (z) >> ;;alternative: (mset l (if (rulechk 'mlist) (simplifya (cons '(mlist) ll) t) (cons '(mlist simp) ll)))) >> (mset l (simplifya (cons '(mlist) ll) t))) > It's not necessary to invoke the simplifier here, right? I think it's not necessary, but without the explicit call to simplifya, the simplifier insists on simplifying every list member. That's spendy. Surely just pushing a new list member shouldn't render the other members to be unsimplified? Well, unless you do something pretty weird such as: (%i30) logsimp : false; (%o30) false (%i31) l : [exp(log(x))]; (%o31) [%e^log(x)] (%i32) push(logsimp : true, l); (%o32) [true,%e^log(x)] (%i33) expand(%,0,0); (%o33) [true,x] See also https://www.ma.utexas.edu/pipermail/maxima/2009/018587.html . As far as I can tell, (%i2) a[2] : []$ (%i3) a[3] : []$ (%i4) i : 1$ (%i5) push(x, a[i+1]); (%o5) [x] (%i6) [a[2],a[3],i]; (%o6) [[x],[],1] works OK? See https://www.ma.utexas.edu/pipermail/maxima/2009/018604.html 
From: Aleksas Domarkas <aleksasd873@gm...>  20140329 20:55:59

> > Original Message > From: Barton Willis <willisb@...> > To: velten <kai.velten@...>, andre maute <andre.maute@...> > Subject: RE: [Maximadiscuss] Can Maxima prove Im(x)=0? > Date: Sat, 29 Mar 2014 12:04:59 +0000 > > > 1. Can I somehow solve equations with assumptions similar to: > > assume(12*Vmax%pi*Lv^3<0); > > erg:solve((Lvbv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); > > Solve does not exclude solutions that do not satisfy the assumptions in > the fact database. > You could try using sublist on the solutions to find the solution that > satisfies certain inequalities. > > >2. Can Maxima prove imagpart(x)=0, if x is complex, depends on > >parameters a,b,c..., and the parameter space is restricted similar to > >the cubic example below. > > I'd say Maxima isn't capable of proving anything. You can certainly define > predicates such as > > real_p(e) := is(equal(imagpart(e),0)) > > For simple expressions, this function might work, but in general, I'd > guess that real_p will not > work as well as you would like it to work. > > > > Barton > Example. Solve solve((Lvbv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv) (%i1) assume(12*Vmax%pi*Lv^3<0,Vmax>0,Lv>0)$ (%i2) load(odes); (%o2) "C:/Users/Aleksas/maxima/odes.mac" (%i3) solvet((Lvbv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv)$ spr:expand(%)$ (%i5) tr:expand(atan2((sqrt(3)*sqrt(%pi*Lv^312*Vmax)*sqrt(Vmax))/(2*%pi),(24*Vmax%pi*Lv^3)/(8*%pi)))$ (%i6) ratsubst (omega, %, spr); (%o6) [bv=(2*Lv*cos(omega/3)+Lv)/2,bv=(2*Lv*cos((omega2*%pi)/3)+Lv)/2,bv=(2*Lv*cos((omega+2*%pi)/3)+Lv)/2] Solution: (%i7) sol:expand(%); (%o7) [bv=Lv*cos(omega/3)+Lv/2,bv=Lv*cos(omega/3(2*%pi)/3)+Lv/2,bv=Lv*cos(omega/3+(2*%pi)/3)+Lv/2] where (%i8) omega=tr; (%o8) omega=atan2((sqrt(3)*sqrt(%pi*Lv^312*Vmax)*sqrt(Vmax))/(2*%pi),Lv^3/8(3*Vmax)/%pi) best Aleksas D 
From: Richard Fateman <fateman@be...>  20140329 20:00:48

I think you are mistaken because the simplifier is called on %o5, not on foo. So try your experiment again, but look to see if foo is simplified. You will have to do this: :lisp $foo because if you type foo; then foo will be simplified (for the first time). RJf On 3/29/2014 12:38 PM, Robert Dodier wrote: > On 20140329, Barton Willis <willisb@...> wrote: > >> For tellsimp rules on lists, there are plenty of restrictions >> I don't think that a tellsimp rule on a list could, for example, >> sort the list. > Not sure what you mean by restrictions. But it is indeed possible > to sort a list via simplification: > > (%i1) declare ("[", symmetric) $ > (%i2) '([a, 1, b, 4, %pi, 2.5]); > (%o2) [1, 2.5, 4, %pi, a, b] > >> (defmspec $push (z) >> ;;alternative: (mset l (if (rulechk 'mlist) (simplifya (cons '(mlist) ll) t) (cons '(mlist simp) ll)))) >> (mset l (simplifya (cons '(mlist) ll) t))) > It's not necessary to invoke the simplifier here, right? because the > SIMP flag isn't in the car of the constructed expression, so the > simplifier will be invoked on the return value. > > I think this example didn't work as expected before, but now that > $CONS is out of the picture, it works OK: > > (%i1) matchdeclare (xx, symbolp, nn, integerp) $ > (%i2) tellsimp ([xx, nn], [nn, xx]) $ > (%i3) load ("/tmp/pushpop.lisp") $ /* your code sans call to SIMPLIFYA */ > (%i4) foo : [1] $ > (%i5) push ('a, foo); > (%o5) [1, a] > > best, > > Robert Dodier > > >  > _______________________________________________ > Maximadiscuss mailing list > Maximadiscuss@... > https://lists.sourceforge.net/lists/listinfo/maximadiscuss 
From: Robert Dodier <robert.dodier@gm...>  20140329 19:38:40

On 20140329, Barton Willis <willisb@...> wrote: > For tellsimp rules on lists, there are plenty of restrictions > I don't think that a tellsimp rule on a list could, for example, > sort the list. Not sure what you mean by restrictions. But it is indeed possible to sort a list via simplification: (%i1) declare ("[", symmetric) $ (%i2) '([a, 1, b, 4, %pi, 2.5]); (%o2) [1, 2.5, 4, %pi, a, b] > (defmspec $push (z) > ;;alternative: (mset l (if (rulechk 'mlist) (simplifya (cons '(mlist) ll) t) (cons '(mlist simp) ll)))) > (mset l (simplifya (cons '(mlist) ll) t))) It's not necessary to invoke the simplifier here, right? because the SIMP flag isn't in the car of the constructed expression, so the simplifier will be invoked on the return value. I think this example didn't work as expected before, but now that $CONS is out of the picture, it works OK: (%i1) matchdeclare (xx, symbolp, nn, integerp) $ (%i2) tellsimp ([xx, nn], [nn, xx]) $ (%i3) load ("/tmp/pushpop.lisp") $ /* your code sans call to SIMPLIFYA */ (%i4) foo : [1] $ (%i5) push ('a, foo); (%o5) [1, a] best, Robert Dodier 
From: Barton Willis <willisb@un...>  20140329 18:18:53

> Dunno about rulecheck clause, to make Robert Dodier happy? Initially I thought that if there is no rule defined on mlist, the code could skip final simplification. And I think that's OK. Replacing the rulechk check with (mset l (simplifya (cons '(mlist) ll) t))) was nearly as fast and it seems more sturdy. So I commented out the rulechk check. Changing (mset l (simplifya (cons '(mlist) ll) t))) to (mset l (simplifya (cons '(mlist) ll) nil))) makes the code pokey slow. Without helping simplifya with a second argument of true, the general simplifier simplifies each list member. Maybe all such logic should be left up to the general simplifier, but for push and pop the alternative seems to be pokey slow code. Barton 
From: Richard Fateman <fateman@be...>  20140329 16:45:03

addendum to previous speedup message.. There are something like 11,700 symbols in the :maxima package . To run speedup on them all (in lisp) do this: (dosymbols (s (findpackage :maxima))($speedup s)) That's all. I look forward to reports of how this speeds up your programs. Or not. My very simple tests suggest about 05% improvement. Occasionally 10%, but I find poor reproducibility of my timings on my computer setup. RJF 
From: Richard Fateman <fateman@be...>  20140329 16:00:12

Your code looks ok to me. Dunno about rulecheck clause, to make Robert Dodier happy? I don't know why GCL is slow but looking around, here are some thoughts on speeding stuff up more. I hope you or someone has the time 1. do this: (setf (get 'mlist 'msimpind) '(mlist simp)) What this does is it uses the same list structure all the time for (mlist simp) in the header of the list after simplification, instead of consing up 10^4 redundant lists. 2. (and this is in general to potentially speed up maxima' simplifier all over the place...) This hack was put in the predumpthebinary phase in an attempt to speed things up, but maybe in the effort to use nonlisp for such things, got lost(?) Anyway, it is to put the property list of operators in an order in which the most timecritical ones come first. Rationale: if you are running the simplifier and encounter the operator %sin, in order to simplify it, you look on the property list of %sin for the place where the simplifier program is stored. It is stored under the property operators. That is, you do (get '%sin 'operators) and you get the symbol SIMP%SIN. (a) you would hope that this property, used most often, would be at the front of the plist so as to make access fast. It is not. It is in position 22, so that 44 memory references are needed to get to the simplifier function. Because other stuff was (uh) pushed on the plist later. What timecritical stuff might that be? well, wxmaxima display properties, tex display properties, integration properties, file sourcecode data etc. So a simple program to go through all the operators in Maxima and rearrange the symbolplists so that the operators property comes first, could save time, and would use no more storage. Even the heavilyused operators have this lag built in. to find the operators property of MPLUS requires 32 memory references. (b) Yet another level of memory reference could be removed. This way: SIMP%SIN is an atom. It is not actually the lisp function. To get that, we can compute (symbolfunction 'simp%sin) and we get something that is essentially a machine address, though how it is printed varies with the lisp system. On GCL I get #<compiledfunction SIMP%SIN> Also it would pay to move msimpind near to the front of the plists. So here's thelisp program... ;; move property to front of property list (inpackage :maxima) (defun motf(r p) ; r is symbol, p is property (let ((q (get r p))) (cond (q (remf (symbolplist r)p ) (setf (get r p) q) ;; put it back q) (t 'not_found)))) (defun $speedup(r) (motf r 'msimpind) (motf r 'operators)) .......... in maxima , how to use it? map (speedup, [?mplus, ?mtimes, ?mexpt, sin,cos, tan, nounify(integrate)]) note: the nounify(integrate) is necessary because the integration facility has mixed up evaluation and simplification... So here's what you can do: run this speedup, once. and see if it makes your favorite timing benchmark run faster. It should make simplification faster. Whether you notice it or not depends on how much other serious computing is going on. If you like it, the people who make binaries should (a) make a list of all the common operators and run speedup on them, just before the system is dumped. After wxmaxima or whatever has been loaded. (b) then dump the system. On 3/29/2014 4:45 AM, Barton Willis wrote: > The standard pop and push (defined in basic) are especially slow using > Maxima compiled with GCL. > For N = 5*10^4, run times for (l : [], for i : 1 thru N do push(x,l), > for i : 1 thru N do pop(l)) are > > CCL 7.0500 seconds > GCL 73.8600 seconds > > For either GCL or CCL, my pop and push run the test OK > > CCL 0.6390 seconds > GCL 0.52 seconds > > For tellsimp rules on lists, there are plenty of restrictionsI don't > think that a tellsimp rule on a list > could, for example, sort the list. > > Barton > > (defmspec $push (z) > (let* ((o (car (pop z))) > (x (if z (pop z) (wnaerr o))) > (l (if z (pop z) (wnaerr o))) > (ll (meval l))) > > (if z (wnaerr o)) > > (if (and ($mapatom l) ($listp ll)) > (progn > (setq ll (cons (meval x) (cdr ll))) > ;;alternative: (mset l (if (rulechk 'mlist) (simplifya (cons > '(mlist) ll) t) (cons '(mlist simp) ll)))) > (mset l (simplifya (cons '(mlist) ll) t))) > (merror "Second argument to push must be a mapatom that is bound > to a list")))) > > (defmspec $pop (z) > (let* ((o (car (pop z))) > (l (if z (pop z) (wnaerr o))) > (ll (meval l))) > (if z (wnaerr o)) > (cond ((and ($mapatom l) ($listp ll)) > (if ($emptyp ll) (merror "Pop called on an empty list") > (prog2 > (setq ll (cdr ll)) > (pop ll) > ;; alternative: (mset l (if (rulechk 'mlist) (simplifya (cons > '(mlist) ll) t) (cons (list 'mlist 'simp) ll)))))) > (mset l (simplifya (cons '(mlist) ll) t))))) > (t (merror "Argument to pop must be a mapatom that is bound to a > list"))))) > > > And some tests > > errcatch(push()); > []$ > > errcatch(push(2014)); > []$ > > errcatch(push(a,b,c)); > []$ > > errcatch(push(a,[1,2])); > []$ > > errcatch(pop()); > []$ > > errcatch(pop(2014)); > []$ > > errcatch(pop([1,2])); > []$ > > (l : [1,2],0); > 0$ > > errcatch(pop(l,12)); > []$ > > errcatch(push(x,l, 2014)); > []$ > > (l : [1,2], push(x,l),l); > [x,1,2]$ > > [pop(l), l]; > [x, [1,2]]$ > > (l : [false], [pop(l), l]); > [false,[]]$ > > (l : [1,2], a : push(0,l), pop(l), [a,l]); > [[0,1,2],[1,2]]$ > > (l : [1,2], push(l,l)); > [[1,2],1,2]$ > > (remvalue(a), a[%pi] : [0,1,[8]], 0); > 0$ > > (push(2014, a[%pi]), a[%pi]); > [2014,0,1,[8]]$ > > (pop(a[%pi]), a[%pi]); > [0,1,[8]]$ > > (l1 : [0], l2 : [0,1], l3 : [0,1,2],0); > 0$ > > map('pop, '[l1,l2,l3]); > [0,0,0]$ > > [l1,l2,l3]; > [[],[1],[1,2]]$ > > (a : b, b : c, c : d, d : e, e : f,0); > 0$ > > (l : [a,b,c,d,e], push(x,l), pop(l),l); > [b,c,d,e,f]$ > > [pop(l),pop(l),pop(l),pop(l),pop(l)]; > [b,c,d,e,f]$ > > (remvalue(a,l,l1,l2,l3,b,c,d,e,f),remarray(a), 0); > 0$ > > > > > > > > >  > > > _______________________________________________ > Maximadiscuss mailing list > Maximadiscuss@... > https://lists.sourceforge.net/lists/listinfo/maximadiscuss 
From: Raymond Toy <toy.raymond@gm...>  20140329 15:56:57

>>>>> "velten" == velten <kai.velten@...> writes: velten> I don't agree. What Ray says applies to beginners who don't know what velten> they do. I don't think I'm a beginner, but I still make stupid mistakes. (Who doesn't?) I want to know if I did something nonsensical like enter the limits of a plot incorrectly. But it's your application; you can do what you want. Ray velten> To: maximadiscuss@... velten> Subject: Re: [Maximadiscuss] How can I swith off warnings? velten> Date: Fri, 28 Mar 2014 11:39:59 0700 >>>>> "velten" == velten <kai.velten@...> writes: velten> I'll try errcatch. I don't want that message in a program used by velten> practitioners who occasionally enter invalid limits for plots, which are velten> still valid ... these people don't like any kind of "mathematical" velten> messages ... velten> Well, I hate systems like that. You prevent error messages so now the velten> user wonders why there's no plot or why the result is just junk. And velten> without the message, you have no idea where to look for this, except velten> to look, painstakingly, at every single line of input to see what the velten> mistake is. And it's really easy to, say, not notice that the plot velten> limits are wrong (because you don't know the syntax well), or that velten> you're erroneously dividing by zero somewhere, and on and on. velten> Yuck! velten> Ray velten>  velten> _______________________________________________ velten> Maximadiscuss mailing list velten> Maximadiscuss@... velten> https://lists.sourceforge.net/lists/listinfo/maximadiscuss velten>  
From: velten <kai.velten@hs...>  20140329 14:54:35

Thanks, I'll try that. You are probably right that real_p(e) won't work on complex expressions, and I will probably have to keep my current workaround for complex expression, which is plotting imagpart e.g. using plot3d over the subset of the parameter space where I expect imagpart=0. Kai Original Message From: Barton Willis <willisb@...> To: velten <kai.velten@...>, andre maute <andre.maute@...> Subject: RE: [Maximadiscuss] Can Maxima prove Im(x)=0? Date: Sat, 29 Mar 2014 12:04:59 +0000 > 1. Can I somehow solve equations with assumptions similar to: > assume(12*Vmax%pi*Lv^3<0); > erg:solve((Lvbv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); Solve does not exclude solutions that do not satisfy the assumptions in the fact database. You could try using sublist on the solutions to find the solution that satisfies certain inequalities. >2. Can Maxima prove imagpart(x)=0, if x is complex, depends on >parameters a,b,c..., and the parameter space is restricted similar to >the cubic example below. I'd say Maxima isn't capable of proving anything. You can certainly define predicates such as real_p(e) := is(equal(imagpart(e),0)) For simple expressions, this function might work, but in general, I'd guess that real_p will not work as well as you would like it to work. Barton 
From: Barton Willis <willisb@un...>  20140329 12:05:10

> 1. Can I somehow solve equations with assumptions similar to: > assume(12*Vmax%pi*Lv^3<0); > erg:solve((Lvbv)*%pi/4*bv^2+%pi/12*bv^3=Vmax,bv); Solve does not exclude solutions that do not satisfy the assumptions in the fact database. You could try using sublist on the solutions to find the solution that satisfies certain inequalities. >2. Can Maxima prove imagpart(x)=0, if x is complex, depends on >parameters a,b,c..., and the parameter space is restricted similar to >the cubic example below. I'd say Maxima isn't capable of proving anything. You can certainly define predicates such as real_p(e) := is(equal(imagpart(e),0)) For simple expressions, this function might work, but in general, I'd guess that real_p will not work as well as you would like it to work. Barton 