Yury | 20 Aug 10:41 2014

ev: improper argument:

I'm confused with the error in the following function, seemingly trivial:

pskeqn(n,k,l) :=
μ : l/2 ,
σ_2 : ((l+1)^2-1)/12 ,
* (1/sqrt(2*%pi))
* exp(  -(n-k*μ)^2 / (2*k*σ_2)  )

Any subsequent evaluation of this with specific values, e.g.,
pskeqn(100,10,10), produces error message:

                                  (n - k μ)
                                - ----------
                                   2 k σ_2
ev: improper argument: -----------------------------
                       sqrt(2) sqrt(%pi) sqrt(k σ_2)

This is so unexpected, that I'm completely stuck. Advice, anybody?

Slashdot TV.  
Video for Nerds.  Stuff that matters.
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
(Continue reading)

Yury | 20 Aug 09:46 2014

erf evaluation

Hello all,

I'm getting the "defint: variable of integration cannot be [anything
specific]" with the definite integral which transforms to the erf function
in Maxima. The error shows when I'm submitting either constant or expression
to the Phi(x), defined as follows.

Phi(x) :=
(1/sqrt(2*%pi)) * integrate(exp(-x^2/2),x,-inf,x)
/* (-m^(1/10) * sqrt(σ)) */
Phi( 1 );

Does this mean there's no actual erf(x) evaluation built-in in Maxima, only
the symbolic equivalences? (I can throw together a series approximation for
it, of course.)


Slashdot TV.  
Video for Nerds.  Stuff that matters.
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
Robert Dodier | 20 Aug 02:43 2014

need advice about invert function

Hey, I am considering changing the invert function so that for small
matrices, it uses the adjoint method, otherwise, it uses a method
based on Gaussian elimination. (The code for the adjoint method is
a previous incarnation of invert, while the Gaussian elimination code
is what used to be called invertmx, which implemented a^^-1.)
The motivation for using the adjoint method is that it might yield
"simpler" results for small symbolic problems. The adjoint method used
to be the only method used by invert, but its runtime increases very
quickly with the size of the matrix, so it was replaced a few years
ago by a method based on LU decomposition.

With the proposed changes, a few tests in rtest2 fail. One test fails
because the adjoint method finds a slightly different, equivalent 
solution; not a problem. Two other tests fail because the code for
the adjoint method doesn't honor the ratmx flag (as invert has always
been advertised to honor). I suppose that can be fixed.



Robert Dodier

Slashdot TV.  
Video for Nerds.  Stuff that matters.
Dimiter Prodanov | 18 Aug 23:39 2014

another bug related to infinities

Dear all,

Inconsiten behavior

In<< is(abs(minf)=inf);
Out>> true

In<< is( minf+inf);
Out>> unknown

If we consider that minf and inf are infinities of different "magnitude" then 1 is false.
If we agree wtih 1) then minf+inf =0 which will be problematic in handling limits. 

More consisten behavior whill be
is(abs(minf)=inf) >> unknown

best regards,

Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net

Allow f(x)(y)

Maxima doesn't allow f(x)(y):

apply(f(x),[y]) => Error: apply: found q(x) where a function was expected.

This is not a limitation in the parser:

qq() := f(x)(y)$            << no error

And in fact it works fine for a defined function f:

f(q) := if q = 1 then 'sin else 'cos$
f(1)(2) => sin(2)

g(x) := subst(x, 'x, lambda([y], x + y))$      << simulated lexical scope
g(4) => lambda([y],y+4)
g(4)(5) => 9

So why don't we allow it for an unevaluated function? We do allow u(1)[2], u[1](2), u[1][2], and even u(1)[2](3), so why don't we allow u(1)(2)?

Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
jignesh | 18 Aug 14:48 2014

[newbie] how to substitute expression

I have executed following commands


I got expression of gradient as function of x,y,z. Now I want to convert that expression to spherical coordinates (r,theta,phi). How to do that?

Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
Edwin Woollett | 16 Aug 23:36 2014

bind stack overflow in loop

I am trying to understand what is causing a lisp
error "bind stack overflow" in a simple loop, in which
the only "dangerous" thing I am doing is storing
values in a one dimensional array. (see code below).

Here is the maxima session (windows xp)
Maxima 5.31.2 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL)

(%i1) load(poisson3);
(%o1) "c:/k3/poisson3.mac"
(%i2) arrays;
(%o2) []
(%i3) outL : poisson3(25,0.002,0.95,5)$
 array phiL defined
  r       exact             diff
 start numerov loop
  2001  2002  2003  2004  2005
Maxima encountered a Lisp error:

 Error in PROGN [or a callee]: Bind stack overflow.

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
(%i4) arrays;
(%o4) [phiL]
(%i5) for j:10500 thru 10494 step -1 do print(phiL[j])$
(%i6) phiL[10500];
(%o6) 0.95
(%i7) fpprintprec;
(%o7) 8
(%i8) phiL[12500];
(%o8) 0.95
and here is the code file poisson3.mac

/*   poisson3(rmax,h,frac,rprint)  for inward integration of poisson's
        equation without correction from r = rmax to r = 0 with step size h.
     If frac > 0, uses frac times exact solution to get the first two points
              at rmax and rmax-h; if frac < 0 uses phi = 1 at first two 
   The (dimensionless) charge density is taken to be exp(-r)/8/%pi.
   Values of phi internally are kept in the array phiL; declared arrays are
          global objects until removed from memory using remarray.
   The output is a list [rrL, phiL_list] in which rrL and phiL_list are 
         created using makelist.
   At intervals rprint, values of r, exact, and diff_phi are printed to the 
          using the formated print function printf.

 this version has debug printouts since lisp error "bind stack overflow" 
  when j = 2005.

poisson3(rmax,h,frac, rprint) :=
block([phi_m,phi_z,phi_p,Sm,Sz,Sp, fac, phiL_list, num,
             rrL,rr,exact, diff_phi, nprint, nstep,  numer],numer:true,
    phi_exact(r) :=  1 - (r+2)*exp(-r)/2,
 S(r) := -r*exp(-r)/2,

 if frac < 0 then (
       phi_p : 1,
    phi_z : 1)
 else (
      phi_p : frac*phi_exact(rmax),
      phi_z : frac*phi_exact(rmax - h)),

 Sp : S(rmax),
 Sz : S(rmax - h),
 fac : h^2/(12),
 num :  round (rmax/h),   /* total number of steps to take */
  /*  create an array with num+1 elements, array indexing starts with 0,
         phiL[0] = phi(r=0), phiL[n] = phi(r=n*h), phiL[num] = phi(rmax)
         phiL holds all phi values    */
 array(phiL, flonum,  num + 1),             /* floating point number array 
 print(" array phiL defined "),
 phiL[num] : phi_p,                     /*   phi( r = rmax )  */
 phiL[num - 1] : phi_z,                 /*  phi(r = rmax - h)  */

 nprint : round(rprint/h),                /* number of steps between 
printing  */
 nstep : 2,                                   /*  current value of nstep */
 print(" start numerov loop "),

 for j:2 thru num do (
      if j > 2000 then printf(true,"  ~d", j),
      rr : rmax - j*h,                       /* for j=2, rr = rmax - 2*h  */
   Sm : S(rr),
   phi_m : 2*phi_z - phi_p + fac*(Sm + 10*Sz + Sp),
   phiL[num - j] : phi_m,
   if  is(equal(nstep,nprint)) then (
       exact : phi_exact(rr),
            diff_phi : exact - phi_m,
      /* print("  ",rr,"  ",exact,"  ",diff_phi), */
         printf(true, "~&~2t~d~9t~9f~27t~15e ", rr, exact, diff_phi),
      nstep : 0),
   nstep : nstep + 1,
   Sp : Sz,                                /* rotate values for Numerov 
method */
   Sz : Sm,
   phi_p : phi_z,
   phi_z  : phi_m),

 print("  make lists "),
 rrL : makelist(j*h, j, 0, num),                /* return lists of length 
num+1  */
 phiL_list : makelist(phiL[j], j, 0, num),
 remarray(phiL),                                   /* remove array from 
memory  */
 [rrL, phiL_list])$

fpprintprec : 8$
Ted Woollett
woollett <at> charter.net

Martin Mallinson | 12 Aug 00:32 2014

Compiling Maxima on Allegro

Can anyone help out here?
I followed the general outline in Richard Fateman's note http://comments.gmane.org/gmane.comp.mathematics.maxima.general/40905
and I get an error: the chaps at Allegro suggest it relates rather to ASDF (about which I know very little indeed) or maxima somewhere.
Any tips appreciated - my guess is this is a trivial problem I just dont know where to start...

cg-user(1): :cd c:/maxima-5.33.0/src c:\maxima-5.33.0\src\ cg-user(2): (require :asdf) ; Fast loading C:\acl90.64\code\asdf.003 ;;; Installing asdf patch, version 3. t cg-user(3): (setf asdf/find-system:*central-registry* '(*default-pathname-defaults*)) (*default-pathname-defaults*) cg-user(4): (asdf::load-system :maxima) ; Loading c:\maxima-5.33.0\src\maxima.asd Error: #P"C:\\Users\\martinm\\AppData\\Local\\common-lisp\\cache\\acl-9.0m-win-x64\\C\\maxima-5.33.0\\src\\binary-ecl\\maxima-package.fasl" does not exist, cannot load [condition type: file-does-not-exist-error] But as you can see the source did compile - it simply placed the result here: cg-user(5): (directory "**/*.fasl") (#P"c:\\maxima-5.33.0\\src\\binary-ecl\\maxima-package.fasl") So the error seems to be that ACL is assuming that the fasl is in some default directory constructed from that (correct) pathname. Thank you for any help,
Martin Mallinson
PS this was the subject of support case # spr41620 at Franz - they [Kevin Layer et al] tell me the issue does not lie in the Allegro implementation, hence my note to the group.
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
Pankaj Sejwal | 11 Aug 19:07 2014

Statistics on progressively solving equations

A few days back I had asked a question relating to triggering garbage collection during progressively solving equations, for which I got help here. I achieved some good results then.

I reached to the conclusion that if possible at all, one must spend time on arranging equations in an order(discussed in link) and solve a few at a time and use the results from these to solve further equations.

In experiment, it unexpectedly sped up equations solving by 3 times and also helped trigger GC between solving equations which is not possible if equations are fed in "solve" all together.

I have collected the observations and results in this pdf file
Its an observation that​ I believe would be helpful to others.


Pankaj Sejwal
"The more I read, the more I acquire, the more certain I am that I know nothing.” -
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
Raymond Toy | 11 Aug 18:09 2014

Re: Simplify sqrt expression

>>>>> "Aleksas" == Aleksas Domarkas <aleksasd873 <at> gmail.com> writes:

    Aleksas> From: Raymond Toy <toy.raymond <at> gm...> - 2014-08-10 06:00:50        

    Aleksas> tray rootscontract                                                 


    Aleksas> (%i1) sqrt(sqrt(2) + 1)*sqrt(sqrt(2) - 1);                         
    Aleksas> (%o1) sqrt(sqrt(2)-1)*sqrt(sqrt(2)+1)                              
    Aleksas> (%i2) rootscontract(%);                                            
    Aleksas> (%o2) 1                                                            

How silly of me! I had completely forgotten about rootscontract.



Martin Bock | 11 Aug 13:59 2014

Several plot windows

Dear all,

I was wondering whether it is possible to have several plot windows 
originating from a single wxmaxima instance ...

If so, how would I control which plot goes to which plotting window?

FWIW, software versions are: wxMaxima 13.04.2, Maxima 5.28, CLISP 2.49,
all running on SuSE Linux 13.1, kernel 3.11.10.



        Martin Bock                                         :wq