Skip to content

mSamiolo/Linear_Algebra_solver-Gaussian_elimination

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

System resolutor using the Echelon method

This piece of code resolve a Ax = b system, following the echelon method. Cloning this script and setting the A and b matrix/vector, it will return the x vector. Numpy must be installed to perform the calculations.

Run the code

To run the code:

python ./main.py

Code snippet to indicate where to insert your algebraic system

Here it is the test the software execute when it is run:

    A = np.array([[2, 1, -1],
             [-3, -1, 2],
             [-2, 1, 2]])

    b = np.array([8, -11, -3])

    wider_matrix = get_echelon_form(A,b)
    reduced_matrix = reduced_echelon_form(wider_matrix)
    solution = solve_reduce_matrix(reduced_matrix)
    
    ## ------------------  Testing unit  ----------------------------- ##
    
    np.testing.assert_equal(solution, np.array([2 ,3,-1]))
    
    ```

Asserting the system has been solved due to the solution of A and b stated in the code snippet is: [2, 3,-1]

About

Resolve a Ax = b system with the echelon method

Topics

Resources

License

Stars

Watchers

Forks

Languages