Function: math[reduce] - Gaussian elemination of a system of linear equations
Calling Sequence:
reduce(sys, p, option);
Parameters:
sys - a list or set of linear equations
p - (optional) a name
option - either 'list' or 'set'
Description:
This function is the counterpart to linalg/gausselim by evaluating a set or list of linear equations instead of a matrix.
By specifying an optional second argument - a name -, the set of solutions of the system of linear equations is assigned to that name.
Internally, reduce uses linalg/genmatrix and linalg/gausselim and converts the resulting upper triangular matrix to a set of equations using all the indeterminates included in sys. When specifying the second argument, function solve solves the system of equations.
The result is equivalent to an upper triangular matrix, but in the form of equations. The type of return is determined as follows: If the sys is a set, the return is a set; if sys is a list, the return is a list. By specifying either 'list' or 'set' as a third argument, the return is either a list or set, respectively. By specifying a third argument, the type of the system of linear equations passed to reduce is overridden.
This function is part of the math package, and so can be used only after performing the command with(math) or with(math, reduce).
Examples:
> with(math, reduce):
>
sys := {
a-3*b+3/2*c-d=-104/10,
-2*a+b+7/2*c+2*d=-165/10,
a-2*b+12/10*c+2*d=0,
3*a+b-c-3*d=-7/10};
> reduce(sys, p);
> p;
> reduce(sys, p, list);
> reduce(sys, p, set);
See Also:
linalg/gausselim , linalg/gaussjord , solve , math/sortsols .
Version History:
Version 1.0 - current as of February 25, 1998