For solving sets of linear equations, Gauss-Jordan elimination produces both the solution of the equations for one or more right-hand side vectors
The subroutine used here is adapted from Numerical Recipies. You can find the subroutine and relevant files in the code folder.
Example
This can be written in agumented matrix form as follows:
The two matrices can be then use as input in to the gauss-jordan subroutine to find the solution for
- lieq.f - Main Routine to input the matrices
- gauss-jordan.f - Gauss-Jordan Elimination Subroutine