1
$\begingroup$

If I write a[n-1] in Maple 18 it changes the output to $a_{-1+n}$ and 4*c[1]-6*c[2] is changed to $-6 c_2+4 c_1$.

And this happens to me in many different expressions.

Is it a setting in Maple which I can change? Why is it reordering my terms?

$\endgroup$

1 Answer 1

1
$\begingroup$

In general, expressions in Maple are kept in the same order in which they were first created, and expressions that are equal due to the commutative and associative laws of addition and multiplication will always be shown in that same order. So if $-1+n$ was created at some point in your Maple session (either at the top level or internally), all future occurrences of either $-1+n$ or $n-1$ will be shown as $-1+n$. However, you can use the sort function to change the order of a particular expression. Thus:

-1 + n;

$$ -1 + n $$

sort(%, n, descending);

$$ n - 1 $$

a[n-1] = b[-1+n];

$$ a_{n-1} = b_{n-1} $$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .