Solving Linear Systems Syed Nasrullah Lab 3 Solving Linear Systems Syed Nasrullah
Method 1 Finding Determinants To Solving Linear Systems 2 × 2 matrix
Example : - Compute the determinants of the following matrices : det(A) = (1)(4) - (2)(3) = 4 - 6 = -2. - + det(A) = (3)(5)(5) + (1)(9)(2) + (4)(1)(6) - (3)(9)(6) - (1)(1)(5) - (4)(5)(2) = 75 + 18 + 24 - 162 - 5 - 40 = -90
Finding Determinants using Matlab
Solving Linear Systems “ using Determinates ” Determinants can be used to find out if a linear system of equations has a solution. Consider the following set of equations: 5x + 2y − 9z = 44 −9x − 3y + 2z = 11 6x + 7y + 3z =5 1’st step : find the determinant of the coefficient matrix A.
The solution of the system 2’nd step : create a column vector of the numbers on the right-hand side of the system. Then using left division, and the vector which will appear is the solution of the linear equation. Left Division = b / A The solution of the system
Method 2 Finding the Inverse of a Matrix To Solving Linear Systems The Identity Matrix ( I ) is the n × n matrix , each main diagonal entry is a 1 and for which all other entries are 0. For Example
[ -ͨ ᵃ ] Solve the linear equation “ using inverse Matrix ” : 6 -2 B= 5 2 A =1/(ad-bc) [ ᵈ -ᵇ ] [ -ͨ ᵃ ] A = 1 /[ (3*(-2)-(-2) *(6) ] -2 2 - 6 3 X = A * B = -1.0000 -4.0000 3x − 2y = 5 6x − 2y = 2 -1 -1 -1
Solving Linear Systems “ using inverse Matrix ” 5x + 2y − 9z = 44 −9x − 2y + 2z = 11 6x + 7y + 3z = 44 Solving Linear Systems “ using inverse Matrix ” 1’st step : find the inverse of the coefficient matrix A.
The solution of the system 2’nd step : create a column vector (B) of the numbers on the right-hand side of the system. Then using Multiplication * between inverseA and B which will appear is the solution of the linear equation. The solution of the system
Find a solution to the following Linear Equations: EXCERSIZE : Find a solution to the following Linear Equations: x + 2y + 3z = 12 −4x + y + 2z = 13 9y − 8z = −1