Feature request



Here is my example function definition.

I just want to be able to diff it with respect to y.  Is this too much to ask?

diff(f(x,y),y)

f(x,y):=
block
(
    c[-2]:0,c[-1]:0,c[0]:1,c[1]:0,
    for i: 2 thru 500 do (c[i]:(2*c[i-2]-y*3*c[i-4])/(i*(i-1))),
    p:c[0],
    for i: 1 thru 500 do (p:p+c[i]*x^i),
    p
);


 ------------Original Message------------
From: "Richard Hennessy"<rvh2007 at comcast.net>
To: "Harald Geyer" <harald at lefant.net>
Cc: "Maxima List" <maxima at math.utexas.edu>
Date: Mon, Apr-21-2008 12:58 PM
Subject: Re: [Maxima] Feature request


I wanted something like this so thanks.  The only thing is the degree of the polynomials.  I used the quadratic case as an example but really the reason I asked about this is that I have a power series in x and y and I needed to keep a lot of terms for accuracy.  In one case to get sufficient accuracy I used 500 terms.

Rich





 ------------Original Message------------
From: Harald Geyer <harald at lefant.net>
To: "Richard Hennessy" <rvh2007 at comcast.net>
Cc: "Maxima List" <maxima at math.utexas.edu>
Date: Mon, Apr-21-2008 12:01 PM
Subject: Re: [Maxima] Feature request

Hi Richard.

>  I would really like it if you could have some control over the order
> of terms in a polynomial by using some external package which could be
> loaded when needed.

I don't think that needs an extra package. All you need to do is keep
the core simplifier from reordering terms. Perhaps the following
is able to give you some ideas, how to do that. The important
part ist the "simp:false" statement - but be careful, maxima heavily
depends on it's core simplifier...

myprint(expr, pred):=block([simp:false], 
	print(apply("+", sort(subst("[", "+", expr), pred))));
(%i31) expr:y+x^2+x+b+a;
(%i32) myprint(expr, lambda([u,v], orderlessp(u,v)))$
a+b+x+x^2+y
(%i33) myprint(expr, lambda([u,v], orderlessp(v,u)))$
y+x^2+x+b+a
(%o34) mypred(x,y):=if atom(x) and not atom(y) then true
	else (if not atom(x) and atom(y) then false
		else orderlessp(x,y))
(%i35) myprint(expr, mypred)$
a+b+x+y+x^2

Of course you can invent any other predicate you like...

HTH,
Harald





_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima