Three Equations in Three Unknowns, a Numerical Solution Utility
This page contains a routine that numerically solves a system of three equations in three unknowns.
Author: E. A. Voorhees, Los Alamos National Laboratory (LANL)
Dongarra, J. J.; J.R. Bunch; C.B. Moler; and G.W. Stewart.
"LINPACK User's Guide"
The utility posted on this page is based on the program "SGEFS.F", written by E. A. Voorhees (LANL).
"SGEFS.F" is part of the SLATEC library of programs, and its original code (written in FORTRAN) can be viewed there.
The system takes the following form:
|a11 x1||+||a12 x2||+||a13 x3||=||b1|
|a21 x1||+||a22 x2||+||a23 x3||=||b2|
|a31 x1||+||a32 x2||+||a33 x3||=||b3|
where the a and b values are known constants. Knowing these constants, the task is then to solve for the values of x that satisfy this system.
This system can be rearranged into matrix form:
[A](x) = (b)
where [A] is a square matrix and (x) and (b) are column vectors. In the present case,
To use this utility, you should have the a and b values ready to enter. If any of the b values are zero, then this utility is not necessary; the values of x that solve the system can be found by a couple simple calculations. If you have all the data ready, simply enter it, click the Solve button, and it will calculate the values of x that solve the system.
IMPORTANT: Make sure that Error Code is greater than 0; if it is not, the solution is meaningless.
If Error Code > 0, it represents a rough estimate of the number of digits of accuracy in the solution, (x).
If Error Code < 0, there are errors:
Error Code = -1: Fatal Error. [A] is computationally singular. No solution was computed.
Error Code = -2: Warning. Solution has no significance. The solution may be inaccurate, or [A] may be poorly scaled.
In addition, rcond is output, which is an estimate of 1/cond(A).