Description
1. Prerequisites:
a. Open the colab file shared in BUX.
b. Create a copy of that shared file.
c. Rename the colab filename using the format Name_ID_Lab Section
2. Lab Tasks:
Task-1: Solving a linear system using an inverse matrix
A. You have to implement the get_result_by_inverse_matrix(A, b), where A is a n x n matrix and b is a n x 1 vector.
B. Check if A is a singular matrix or not. If not, find its inverse. [3]
C. Multiply the inverse with the vector b. [2]
Task-2: Gaussian elimination method
Gaussian elimination method uses elementary row operations to transform the system to an upper triangular form ππ₯ = π¦.
Elementary row operations include swapping rows and adding multiples of one row to another. They wonβt change the solution x but will change the matrix A and the right-hand side b.
The upper triangular matrix, U, is defined as
The algorithm of the Gaussian elimination method:
A. You have to implement the get_result_gaussian_elimination(n, A) method, where n is the number of unknowns and A is the augmented
matrix. [2.5 + 2.5 = 5]
Task-3: LU Decomposition
We will transform the n Γ n matrix A into a product of two triangular matrices:
one lower triangular (L) and the other upper triangular (U). The algorithm of LU decomposition: π΄ = πΏπ
A. You have to implement the lu(A)method.
B. You have to implement the forward_substitution(L, b)method. [5]
C. You have to implement the back_substitution(U, y)method. [5] Note: lu_solve(A, b)method has been completed for you.
Total Marks: 20
Reviews
There are no reviews yet.