How do you order terms this way



Mr Hennessy,

Although I don't think it will help you in this instance, if you are trying
to control more of what Maxima prints out, you could try the format
package.  It might help you in the future.  load(format),
demo("format.demo") and read share/contrib/format/format.ps.

Format's syntax is complicated and opaque, but it allows you to do things
like factor a numerator while expanding the denominator or specify some
parts of the expression you are looking for in the end.  It is extensible,
it seems, but I believe that term reordering is beyond its capabilities.
>From the demo:

(%i48) format(expand((x+a)^3 - a^3), %f);
(%o48) x*(x^2+3*a*x+3*a^2)

tell format I want a^3 seperate...

(%i49) format(expand((x+a)^3 - a^3), %f - a^3);
(%o49) (x+a)^3-a^3

but if we try to switch the ordering of the output...

(%i50) format(expand((x+a)^3 - a^3), -a^3 + %f );
(%o50) (x+a)^3-a^3

you get the same thing.

Zach


On Sun, Apr 20, 2008 at 7:50 PM, Richard Fateman <fateman at cs.berkeley.edu>
wrote:

>  try rat(%,y,x);
>
> if that doesn't work for you, then I suspect the simplest alternative
> is that you try to accomodate your own notions of what the right order is
> to what maxima provides.
>
> Good luck.
>
>
>  ------------------------------
> *From:* maxima-bounces at math.utexas.edu [mailto:
> maxima-bounces at math.utexas.edu] *On Behalf Of *Richard Hennessy
> *Sent:* Sunday, April 20, 2008 6:08 PM
> *To:* Maxima List
> *Subject:* [Maxima] How do you order terms this way
>
>  If I have the quadratic surface in x and y
>
> a*x^2 +b*y^2+d*x*y+e*x+f*y +g = 0
>
> I want Maxima to print out this formula in the order above but when I
> enter it it changes it to
>
> b*y^2+d*x*y+f*y+a*x^2+e*x+g=0
>
> I want the terms in order of degree so that x^n*y^m would come before
> x^(n-1)*y^m and also before x^n*y^(m-1) etc...
>
> Is there a way?  I can't find a function for that in the help.
>
> Richard Hennessy
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>