A Downloadable Console Utility for Solving N Equations in N 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 executable program 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 "C" 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.



At the link below is posted an executable console program that solves N Equations in N Unknowns. It was written on a Pentium III personal computer running Microsoft Windows 2000 Professional. The compiler was Microsoft Visual C++ version 6. If you think the executable will run successfully on your machine, download it to your machine and run it (it should work on any personal computer running Microsoft Windows 95, 98, NT, or 2000).

To download this utility:
Right-click on the "Download N X N Solver Utility" link;
Select "Save Target As";
Specify the folder on your computer in which you want to save this utility;
Click the Save button.

How to use this program:
Before running this utility, create a new file named "LINSYS.TXT" and save it in the same folder as the executable you just downloaded.
In "LINSYS.TXT", save the following entries:
       N: the size of the N X N Matrix
       A: the A matrix. Enter row1, row2, etc, in that order
       b: the b vector.

The program can then be run. The results are output to the text file "X_OUT.TXT", which this utility creates. (The reason this utility reads from and writes to text files is so that big systems may be handled without having to input many data entries via the console.)

An Example

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.

In this case, "LINSYS.TXT" would contain the following entries:

3

a11   a12   a13
a21   a22   a23
a31   a32   a33

b1
b2
b3

The program would then be run, reading this data in, and calculating the solution, x, which it writes to "X_OUT.TXT".

The program does not do any error checking; it assumes the user is familiar with the system and that the user is not trying to defeat this program. If any of the entries are missing, or invalid, or in the wrong order, this utility will not give correct results. So make sure "LINSYS.TXT" contains all the appropriate information.

Download N X N Solver Utility

 


 

Return to Math Functions Page

AKiTi.ca Home