Next: , Previous: Multiple Solutions, Up: Solving Equations

10.6.2 Solving Systems of Equations


For example, putting ‘[x + y = a, x - y = b]’ on the stack and typing a S x,y <RET> produces the vector of solutions ‘[x = a - (a-b)/2, y = (a-b)/2]’. The result vector will have the same length as the variables vector, and the variables will be listed in the same order there. Note that the solutions are not always simplified as far as possible; the solution for ‘x’ here could be improved by an application of the a n command.


Normally there will be as many variables as equations. If you give fewer variables than equations (an “over-determined” system of equations), Calc will find a partial solution. For example, typing a S y <RET> with the above system of equations would produce ‘[y = a - x]’. There are now several ways to express this solution in terms of the original variables; Calc uses the first one that it finds. You can control the choice by adding variable specifiers of the form ‘elim(v)’ to the variables list. This says that v should be eliminated from the equations; the variable will not appear at all in the solution. For example, typing a S y,elim(x) would yield ‘[y = a - (b+a)/2]’.

If the variables list contains only elim specifiers, Calc simply eliminates those variables from the equations and then returns the resulting set of equations. For example, a S elim(x) produces ‘[a - 2 y = b]’. Every variable eliminated will reduce the number of equations in the system by one.

