Introduction

This method finds all the solutions of a linear equations system. The definition of a linear equations system can be found in this post.

Method

Gauss-Jordan method works similarily as Gauss. The main difference is that, instead of getting the upper triangular matrix and then getting the values, we go directly through each value.

Examples

  • A = [7., 2.; -21., -5.], B = [16.; 50.], R = [-25.7; 98.]
  • A = [2., -3.; 4., 1.], B = [-2.; 24.], R = [5.; 4.]
  • A = [3., -0.1, -0.2; 0.1, 7., -0.3; 0.3, -0.2, 10.], B = [7.85; -19.3; 71.4], R = [3.; -2.5; 7.]
  • A = [0.3, 0.52, 1.; 0.5, 1., 1.9; 0.1, 0.3, 0.5], B = [-0.01; 0.67; -0.44], R=[-14.9; -29.5; -19.8]

Singularities

This method is not an iterative method. Even though it realizes the calculations with iterations, these iterations are defined by the size of the matrix and not by the contents of it. An iterative method realizes unknown iterations, and it stops until it meets an error criteria given. Because of this, an iterative method can diverge. On the other hand, a non-iterative error makes a fixed number of iterations. It can have a terrible complexity, but it is finite. It does not diverge, it does not fail.

Flowchart

Gauss-Jordan

Code

Conclusions

Gauss-Jordan is a simple method for solving equations. It requires some computational time that scales with the matrix size, but it is not as hard as Cramer.

Advertisements