Skip to content

Assignment done as a part of MTH101 course to find the parametric solution of an augmented matrix by converting it into its unique rref form.

Notifications You must be signed in to change notification settings

anushk4/Matrix-to-RREF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Matrix-to-RREF

This project was done as a part of the MTH101 (Linear Algebra) course offered in the first semester. The aim of the project was to solve a homogenous system of linear equationa of the form Ax=0 where A is a coffecient matrix and x is a vector of variables. The input is the coefficient matrix, and the code converts it into its Reduced Row Echelon Form or RREF and presents the solution in parametric vector form.

Pre-Requisites

Application

  • VS Code or Python IDLE

Knowledge

  • Coefficient Matrix
  • RREF properties
  • Steps to convert a matrix to its RREF
  • Nullspace
  • How to find nullspace
  • Finding parametric solutions using nullspace and free variables.

Intuition and Approach

Converting to RREF

  • The augmented matrix is passed as a parameter through the rref function. The function searches for the first non-zero integer in the first column and swaps it with the first row. This process is iteratively repeated for all the columns, swapping the desired row with the second row, third row, and so on. This is done to simplify calculations by shifting the zeroes to the bottom of the matrix and shifting the non-zero rows to the top of the matrix.
  • Each row is then simplified by dividing the entire row with an integer such that the pivot of each row is 1. The pivots are simultaneously stored in a list pivot, which is used in the next function to evaluate the nullspace.
  • Further row operations are performed to set all the integers, below the pivot column of a row, to 0.

Finding nullspace

  • The list pivot created in rref function is used to classify all columns into column space and nullspace

Finding solution

  • The solutions are then calculated using the nullspace, free variables, and pivots calculated.
  • It is then represented in parametric form (x1v1 x2v2 x3v3 ....).

Input format

The coefficient matrix is given as input as a nested list by entering the rows and columns as given.

Output format

The output consists of the rref of the matrix and the parametric vector form, which is in the form of a string.

Alternate method

The same can be done alternatively by using numpy library. The matrix can be converted to an array, and in-built libraries can be used to perform each step of the calculation.

About

Assignment done as a part of MTH101 course to find the parametric solution of an augmented matrix by converting it into its unique rref form.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages