I am solving Simultaneous Equations using the Gauss Jordan method. I am having a problem in computing the Upper triangular Matrix with sufficient accuracy for no of variables >50. Some of the elements in the lower triangular region are not exactly becoming zero (some are ~ 1e-14). Hence the solution I am getting is a bit inaccurate. So I wanted to know whether there is any method by which I can improve the accuracy of my Upper Triangular Matrix?
Example (Please consider the following case for 3 variables just a scaled down example of what I am getting for 50 variables):
This is the original co-efficient matrix: 1 2 3 3 2 1 2 3 1 This is ideally the reduced upper triangular matrix: 1 2 3 0 -4 -8 0 0 -3 This is what I am currently getting: 1 2 3 0.1 -4.1 -7.9 0.01 -0.09 -3.2 How do I improve the above matrix to something like the below matrix: 1 2 3 0.0001 -4.0001 -7.9995 0.00005 -0.005 -3.0001
I know that it is not possible to obtain the exact upper triangular matrix, but how can I improve my current matrix so that the error becomes small? Please let me know if I could not explain the question properly. Thank You.