Reputation:
I searched the maxima manual about how to manipulate the equation and the likes but I can't really find it.
I've already implemented coefmatrix in terms of ratcoef and using lhs and rhs. To finish it and proceed to augmented part, I need to know how to do this.
How can I make this:
x + 10 - y = z + 5;
turn into this:
x - y - z = -5;
Upvotes: 0
Views: 684
Reputation: 17577
There are a couple of ways to do it. (1) I assume that you have already figured out how to get the coefficients via ratcoef
and the right-hand side via rhs
. Let foo
be the right-hand side minus the left-hand side (so now you have right - left = 0
. Subtract the sum of all the variables times their coefficients from that. Then the remainder is the constant part that doesn't depend on any variable. (2) Use freeof
to identify terms which are free of (i.e., do not contain) any variable.
Upvotes: 1