Four Equations in Four Unknowns, a Numerical Solution Utility


This page contains a routine that numerically solves a system of four equations in four 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"
          SIAM, Philadelphia

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.
Before being posted on this page, "SGEFS.F" was translated to Javascript and edited. Although all care was taken to ensure that it was translated accurately, some errors may have crept into the translation. These errors are mine; the original FORTRAN routines have been thoroughly tested and work properly. Please contact the webmaster to report any errors.

Consider a system of three equations in three unknowns, which 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:

        a11   a12   a13
[A]   =   a21   a22   a23
        a31   a32   a33

(x)   =   x2

(b)   =   b2

In the present case, we are considering a system of four equations in four unknowns; the notation is identical, but the matrix and vectors have more coefficients.

To use this utility, you should have the a and b values ready to enter. 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).

a11 a12 a13 a14             b1
a21 a22 a23 a24             b2
a31 a32 a33 a34             b3
a41 a42 a43 a44             b4


Return to Math Functions Page Home