## 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.

**References:**

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

1979

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.

The system takes the following form:

a_{11} x_{1} |
+ | a_{12} x_{2} |
+ | a_{13} x_{3} |
= | b_{1} |

a_{21} x_{1} |
+ | a_{22} x_{2} |
+ | a_{23} x_{3} |
= | b_{2} |

a_{31} x_{1} |
+ | a_{32} x_{2} |
+ | a_{33} x_{3} |
= | b_{3} |

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,

a_{11} |
a_{12} |
a_{13} |
||||||

[A] |
= | a_{21} |
a_{22} |
a_{23} |
||||

a_{31} |
a_{32} |
a_{33} |

x_{1} |
||||

(x) |
= | x_{2} |
||

x_{3} |

b_{1} |
||||

(b) |
= | b_{2} |
||

b_{3} |

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**).