# [Maxima] Ordering of vector variables?

S. Newhouse sen1 at math.msu.edu
Mon Mar 24 12:15:42 CDT 2008

```Robert Dodier wrote:
> On Mon, Mar 24, 2008 at 9:45 AM, Raymond Toy (RT/EUS)
> <raymond.toy at ericsson.com> wrote:
>
>
>> While playing with donlp2, I noticed that maxima orders vector variables
>>  in "reverse" order.   For example,
>>
>>  sum(x[k],k,1,5) -> x[5]+x[4]+x[3]+x[2]+x[1].
>>
>>  While I usually just accept whatever order maxima wants to display
>>  variables, this particular example seems wrong.  There's a natural
>>  ordering and it's by the index of the variable.
>>
>>  Any reason why it should be in reverse order?  Any objections to
>>  changing it for this case?  (I don't know if that's really possible or
>>  not.  I haven't looked.)
>>
>
> The terms x[1], x[2], ... are stored in order of increasing index.
> Whether they are displayed that way or reversed is controlled
> by the global variable powerdisp. When powerdisp=true the terms
> are displayed in order of increasing index.
>
> I'm not opposed to changing the default value of powerdisp to true.
>
> Aside from changing powerdisp, we could also change GREAT
> (the function which implements Maxima's idea of canonical
> ordering). Changing GREAT could have rippling effects, though.
>
> FWIW
>
> Robert Dodier
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>
For those of us who already have routines which make use of the current
ordering of variables, e.g. as in
%i1) p: x^2 + y^2 - x*y;
2 2
(%o1) y - x y + x

changing some defaults would create havoc and, perhaps, cause a lot more
time spent modifying existing debugged code.
If it is only a matter of setting a flag to be 'true' or 'false' in new
code, why not leave the defaults as they are?

-sen

```