This Java Script calculator solves a system of four linear equations in four variables using Gaussian elimination. To operate the calculator, enter the coefficients and the constants y. Press the Compute button to obtain the solution. On invalid entries, a popup window will display an error message. The Test button loads a test case to show how the calculator operates.
Return to Contents
The Java Script source code for this program can be viewed by using the View|Source command of your web browser.
You may use or modify this source code in any way you find useful, provided that you agree that the author has no warranty, obligations or liability. You must determine the suitability of this source code for your use.
Return to Contents
A system of linear equations has the form:
which is represented in matrix-vector form as:a11x1 + a12x2 + . . . a1NxN = y1 a21x1 + a22x2 + . . . a2NxN = y1 . . . . aN1x1 + aN2x2 + . . . aNNxN = yN
Gaussian elimination solves this linear system of equations by converting the original equations, using elementary row operations, to a simpler form that allows a simple substitution process. The basic algorithm can be broken into stages:Ax = y
An alternative procedure, Gauss-Jordan elimination, uses elementary row operations to both zero the elements below the diagonal and above. Back substitution is not necessary and the values of the unknowns are the values of the elements in the last column of the augmented matrix. However, Gauss-Jordan elimination is less efficient in usage of computer resources than Gaussian elimination.
Return to Contents
AbCd Classics - free on-line books