SlideShare une entreprise Scribd logo
1  sur  12
Télécharger pour lire hors ligne
Chapter 3: Solving Systems of Linear Equations
System of linear equations
a11x1 + a12x2 + ··· + a1nxn = b1
a21x1 + a22x2 + ··· + a2nxn = b2
. . .
. . .
an1x1 + an2x2 + ··· + annxn = bn
where aij and bi are some constant numbers, for i , j = 1, 2,..., n.
This system can be written in the matrix-vector form as: Ax = b







































n
2
1
n
2
1
nn
n2
n1
2n
22
21
1n
12
11
b
b
b
b
,
x
x
x
x
,
a
a
a
a
a
a
a
a
a
A









Augmented matrix of the above linear system is given by
 














n
2
1
nn
n2
n1
2n
22
21
1n
12
11
b
b
b
a
a
a
a
a
a
a
a
a
or
b
|
A








Some linear systems in certain special forms can be solved easier than
others by using some specific procedures.
An upper triangular linear system can be solved by the back substitution.
(R1) a11x1 + a12x2 + a13x3 = b1
(R2) a22x2 + a23x3 = b2
(R3) a33x3 = b3
A lower triangular linear system can be solved by the forward substitution
(R1) a11x1 = b1
(R2) a21x1 + a22x2 = b2
(R3) a31x1 + a32x2 + a33x3 = b3
Example Solve the following linear systems.
(R1) 3x1+ x2+ x3 = 5
(R2) x2+ 2x3 = 4
(R3) 3x3 = 6
Example Solve the following linear systems.
(R1) 3x1 += 6
(R2) 2x1 + x2 = 4
(R3) 3x1 + x2 + x3 = 5
Elementary row operations
Elementary row operations are the following three rules for manipulating or
transforming an augmented matrix that leave the values of the solution set
unchanged.
1. Any two rows can be exchanged.
2. Any row may be multiplied (or divided) by a non-zero constant.
3. A multiple of any row can be added to any other row.
Example Show that the following two linear systems have the same solution.
(I) x - y = 2
2x - y - z = 3
x + y + z = 6
(II) x - y = 2
x - z = 1
3x - y + z = 10
Numerical methods for solving a system of linear equations
2 main types of methods for solving this linear system:
Direct methods
 Give exact solution
 Transform into the form that is easy to solve: i.e. either
 upper triangular form,
 lower triangular form, or
 diagonal form
E.g. Gaussian Elimination  upper triangular form
Gauss-Jordan  diagonal form
LU decomposition  upper and lower triangular form
Indirect methods or Iterative methods
 Give approximate solution
 Require initial approximate solution
E.g. Jacobi method
Gauss-Seidel method
Gaussian Elimination Method
Example: Solve the following system of linear equations by using Gaussian
elimination method.
x - y = 2
2x - y - z = 3
x + y + z = 6
Example - no solution
x - 2y - 6z = 12
x - 4y - 12z = 22
2x + 4y + 12z = -17
Example - Many Solutions
x + y - 2z = 1
y - z = 3
-x + 4y - 3z = 14
Example Consider the following linear system:
x + 2y + 3z = 1
x + 3y + 4z = 3
x + 4y + kz = m.
Use Gaussian elimination to specify all possible values of m and k so that the
linear system has
(i) One solution/Unique Solution
(ii) Infinitely many solutions
(iii) No solution
Gaussian Elimination Method with Partial Pivoting
Use when the pivot element is zero or close to zero.
1. Forward elimination with partial pivoting: selecting the largest pivot
element.
(i) Let row i , Ri be the pivot row. Select the largest element in absolute value
from {aii, ai+1 i,..., ani}:
(ii) Suppose row p, Rp, has the maximum absolute value of the entries in
column i . Then switch row p and row i : Ri Rp.
After pivoting in each column i = 1,..., n, perform forward elimination to
transform the system into the upper diagonal form.
2. Back substitution to solve for the unknowns x
Example: Solve the following system of linear equations by using Gaussian
elimination method with partial pivoting.
x - y = 2
2x - y - z = 3
x + y + z = 6
Gauss-Jordan Elimination Method
Example: Solve the following system of linear equations by using
Gauss-Jordan elimination method.
x - y = 2
2x - y - z = 3
x + y + z = 6
Matrix Inverse
AA-1
= A-1
A = I
Let











33
32
31
23
22
21
13
12
11
1
-
x
x
x
x
x
x
x
x
x
A be the inverse of











33
32
31
23
22
21
13
12
11
a
a
a
a
a
a
a
a
a
A
AA-1
= I 































1
0
0
0
1
0
0
0
1
x
x
x
x
x
x
x
x
x
a
a
a
a
a
a
a
a
a
33
32
31
23
22
21
13
12
11
33
32
31
23
22
21
13
12
11





























































































1
0
0
x
x
x
a
a
a
a
a
a
a
a
a
,
0
1
0
x
x
x
a
a
a
a
a
a
a
a
a
,
0
0
1
x
x
x
a
a
a
a
a
a
a
a
a
33
23
13
33
32
31
23
22
21
13
12
11
32
22
12
33
32
31
23
22
21
13
12
11
31
21
11
33
32
31
23
22
21
13
12
11
the inverse matrix can be found by using Gauss-Jordan
Elimination method










1
0
0
0
1
0
0
0
1
a
a
a
a
a
a
a
a
a
33
32
31
23
22
21
13
12
11
and applying Gauss-Jordan elimination to transform to the form:










33
32
31
23
22
21
13
12
11
x
x
x
x
x
x
x
x
x
1
0
0
0
1
0
0
0
1
and the inverse is











33
32
31
23
22
21
13
12
11
1
-
x
x
x
x
x
x
x
x
x
A
Example Find the inverse of the following matrix by using Gauss-Jordan
Elimination method.










8
0
1
3
5
2
3
2
1
LU decomposition
LU decomposition of a given square matrix A is in the following form:
A = LU
1
0
1
0
0
1
0
0
0
1
L
n3
n2
n1
32
31
21
































u
0
0
0
u
u
0
0
u
u
u
0
u
u
u
u
U
nn
3n
33
2n
23
22
1n
13
12
11


























is an upper triangular matrix.
we can solve the linear system Ax = b  LUx = b
1. Let y = Ux. Then Ly = b.
We can solve y from the above linear system by using forward
Substitution, since L is a lower triangular matrix.
2. When y is known from the previous step, we can solve for x by
performing the backward substitution since U is an upper triangular matrix
Ux = y
Example: Find the LU decomposition of the matrix










18
15
15
6
6
5
4
3
5
is a lower triangular matrix with
all diagonal entries being 1
Example: Find the inverse of the matrix by LU decomposition










18
15
15
6
6
5
4
3
5
Vector Norms
Let x =  T
n
2
1
n
2
1
x
x
x
x
x
x















Euclidean norm (2-norm or 2
 -norm): 2
n
2
2
2
1
2
x
...
x
x
x 



1-norm: n
2
1
1
x
...
x
x
x 



Infinity norm (1-norm or `1-norm):  
x
,...,
x
,
x
max
x n
2
1


Example: Find theEuclidean norm (2-norm), 1-norm and Infinity norm of
x =[1,-2,-3, 0,-1]T
.
Iterative methods
a11x1 + a12x2 + ··· + a1nxn = b1  x1 = ( b1-[ a12x2 + a13x3 + ··· + a1nxn])/a11
a21x1 + a22x2 + ··· + a2nxn = b2  x2 = ( b2-[ a21x1 + a23x3 + ··· + a2nxn])/a22

an1x1 + an2x2 + ··· + an nxn = bn  xn = ( bn-[ an1x1 + an2x2 + ··· + an n-1xn-1])/an n
Jacobi Method
Gauss-Seidel method
Example: Approximate the solution of the following linear system by using
3 iterations of Jacobi method
5x1 + x2 + 2x3 = 7
2x1 + 7x2 + x3 = 3
x1 + 3x2 + 8x3 = 9
with initial value x(0)
=[0, 0, 0]T
. Compute the corresponding the absolute
error in each iteration using Euclidean norm and Infinity norm. Use 4 D.P.
Rounding.
Example: Approximate the solution of the following linear system by using
3 iterations of Gauss-Seidel method
5x1 + x2 + 2x3 = 7
2x1 + 7x2 + x3 = 3
x1 + 3x2 + 8x3 = 9
with initial value x(0)
=[0, 0, 0]T
. Compute the corresponding the absolute
error in each iteration using Euclidean norm and Infinity norm. Use 4 D.P.
Rounding.

Contenu connexe

Tendances

7 3elimination
7 3elimination7 3elimination
7 3elimination
taco40
 
Pair of linear equation in two variables (sparsh singh)
Pair of linear equation in two variables (sparsh singh)Pair of linear equation in two variables (sparsh singh)
Pair of linear equation in two variables (sparsh singh)
Sparsh Singh
 
5.4 write linear equations in standard form day 1
5.4 write linear equations in standard form   day 15.4 write linear equations in standard form   day 1
5.4 write linear equations in standard form day 1
bweldon
 
Linear equation in two variable
Linear equation in two variableLinear equation in two variable
Linear equation in two variable
Ramjas College
 

Tendances (20)

Solution of Differential Equations in Power Series by Employing Frobenius Method
Solution of Differential Equations in Power Series by Employing Frobenius MethodSolution of Differential Equations in Power Series by Employing Frobenius Method
Solution of Differential Equations in Power Series by Employing Frobenius Method
 
Power series
Power series Power series
Power series
 
Sistem pertidaksamaan kuadrat 2 variabel
Sistem pertidaksamaan kuadrat 2 variabelSistem pertidaksamaan kuadrat 2 variabel
Sistem pertidaksamaan kuadrat 2 variabel
 
Algebra Presentation on Topic Modulus Function and Polynomials
Algebra Presentation on Topic Modulus Function and PolynomialsAlgebra Presentation on Topic Modulus Function and Polynomials
Algebra Presentation on Topic Modulus Function and Polynomials
 
4 6 radical equations-x
4 6 radical equations-x4 6 radical equations-x
4 6 radical equations-x
 
Solution of linear system of equations
Solution of linear system of equationsSolution of linear system of equations
Solution of linear system of equations
 
Linear equations in Two Variable
Linear equations in Two VariableLinear equations in Two Variable
Linear equations in Two Variable
 
7 3elimination
7 3elimination7 3elimination
7 3elimination
 
Consistency of linear equations in two and three variables
Consistency of linear equations in two and three variablesConsistency of linear equations in two and three variables
Consistency of linear equations in two and three variables
 
Pair of linear equation in two variables (sparsh singh)
Pair of linear equation in two variables (sparsh singh)Pair of linear equation in two variables (sparsh singh)
Pair of linear equation in two variables (sparsh singh)
 
Linear equation in two variable for class X(TEN) by G R Ahmed
Linear equation in two variable for class X(TEN) by G R AhmedLinear equation in two variable for class X(TEN) by G R Ahmed
Linear equation in two variable for class X(TEN) by G R Ahmed
 
Linear Equations
Linear EquationsLinear Equations
Linear Equations
 
Unit2.polynomials.algebraicfractions
Unit2.polynomials.algebraicfractionsUnit2.polynomials.algebraicfractions
Unit2.polynomials.algebraicfractions
 
5.4 write linear equations in standard form day 1
5.4 write linear equations in standard form   day 15.4 write linear equations in standard form   day 1
5.4 write linear equations in standard form day 1
 
First order non-linear partial differential equation & its applications
First order non-linear partial differential equation & its applicationsFirst order non-linear partial differential equation & its applications
First order non-linear partial differential equation & its applications
 
5 4 equations that may be reduced to quadratics-x
5 4 equations that may be reduced to quadratics-x5 4 equations that may be reduced to quadratics-x
5 4 equations that may be reduced to quadratics-x
 
Higher order differential equation
Higher order differential equationHigher order differential equation
Higher order differential equation
 
Systems of linear equations
Systems of linear equationsSystems of linear equations
Systems of linear equations
 
Linear equation in two variable
Linear equation in two variableLinear equation in two variable
Linear equation in two variable
 
Ch07 7
Ch07 7Ch07 7
Ch07 7
 

Similaire à Chapter 3 solving systems of linear equations

Ultimate guide to systems of equations
Ultimate guide to systems of equationsUltimate guide to systems of equations
Ultimate guide to systems of equations
khyps13
 
Linear Algebra and Matrix
Linear Algebra and MatrixLinear Algebra and Matrix
Linear Algebra and Matrix
itutor
 
4 pages from matlab an introduction with app.-2
4 pages from matlab an introduction with app.-24 pages from matlab an introduction with app.-2
4 pages from matlab an introduction with app.-2
Malika khalil
 

Similaire à Chapter 3 solving systems of linear equations (20)

Linear algebra03fallleturenotes01
Linear algebra03fallleturenotes01Linear algebra03fallleturenotes01
Linear algebra03fallleturenotes01
 
Lecture 11 systems of nonlinear equations
Lecture 11 systems of nonlinear equationsLecture 11 systems of nonlinear equations
Lecture 11 systems of nonlinear equations
 
GATE Engineering Maths : System of Linear Equations
GATE Engineering Maths : System of Linear EquationsGATE Engineering Maths : System of Linear Equations
GATE Engineering Maths : System of Linear Equations
 
Pair of linear equation in two variables (sparsh singh)
Pair of linear equation in two variables (sparsh singh)Pair of linear equation in two variables (sparsh singh)
Pair of linear equation in two variables (sparsh singh)
 
system linear equations
 system linear equations  system linear equations
system linear equations
 
Linear Algebra- Gauss Elim-converted.pptx
Linear Algebra- Gauss Elim-converted.pptxLinear Algebra- Gauss Elim-converted.pptx
Linear Algebra- Gauss Elim-converted.pptx
 
20200830230859_PPT4-Lines, Parabolas and Systems.pptx
20200830230859_PPT4-Lines, Parabolas and Systems.pptx20200830230859_PPT4-Lines, Parabolas and Systems.pptx
20200830230859_PPT4-Lines, Parabolas and Systems.pptx
 
Computational Method for Engineers: Solving a system of Linear Equations
Computational Method for Engineers: Solving a system of Linear EquationsComputational Method for Engineers: Solving a system of Linear Equations
Computational Method for Engineers: Solving a system of Linear Equations
 
Business Math Chapter 3
Business Math Chapter 3Business Math Chapter 3
Business Math Chapter 3
 
chapter1_part2.pdf
chapter1_part2.pdfchapter1_part2.pdf
chapter1_part2.pdf
 
Ultimate guide to systems of equations
Ultimate guide to systems of equationsUltimate guide to systems of equations
Ultimate guide to systems of equations
 
Linear equations Class 10 by aryan kathuria
Linear equations Class 10 by aryan kathuriaLinear equations Class 10 by aryan kathuria
Linear equations Class 10 by aryan kathuria
 
Gauss Elimination & Gauss Jordan Methods in Numerical & Statistical Methods
Gauss Elimination & Gauss Jordan Methods in Numerical & Statistical MethodsGauss Elimination & Gauss Jordan Methods in Numerical & Statistical Methods
Gauss Elimination & Gauss Jordan Methods in Numerical & Statistical Methods
 
Pair of linear equations in two variables for classX
Pair of linear equations in two variables for classXPair of linear equations in two variables for classX
Pair of linear equations in two variables for classX
 
TABREZ KHAN.ppt
TABREZ KHAN.pptTABREZ KHAN.ppt
TABREZ KHAN.ppt
 
METHOD OF LEAST SQURE
METHOD OF LEAST SQUREMETHOD OF LEAST SQURE
METHOD OF LEAST SQURE
 
Linear Algebra and Matrix
Linear Algebra and MatrixLinear Algebra and Matrix
Linear Algebra and Matrix
 
Linearprog, Reading Materials for Operational Research
Linearprog, Reading Materials for Operational Research Linearprog, Reading Materials for Operational Research
Linearprog, Reading Materials for Operational Research
 
4 pages from matlab an introduction with app.-2
4 pages from matlab an introduction with app.-24 pages from matlab an introduction with app.-2
4 pages from matlab an introduction with app.-2
 
Bonus math project
Bonus math projectBonus math project
Bonus math project
 

Dernier

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 

Dernier (20)

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 

Chapter 3 solving systems of linear equations

  • 1. Chapter 3: Solving Systems of Linear Equations System of linear equations a11x1 + a12x2 + ··· + a1nxn = b1 a21x1 + a22x2 + ··· + a2nxn = b2 . . . . . . an1x1 + an2x2 + ··· + annxn = bn where aij and bi are some constant numbers, for i , j = 1, 2,..., n. This system can be written in the matrix-vector form as: Ax = b                                        n 2 1 n 2 1 nn n2 n1 2n 22 21 1n 12 11 b b b b , x x x x , a a a a a a a a a A          Augmented matrix of the above linear system is given by                 n 2 1 nn n2 n1 2n 22 21 1n 12 11 b b b a a a a a a a a a or b | A         Some linear systems in certain special forms can be solved easier than others by using some specific procedures. An upper triangular linear system can be solved by the back substitution. (R1) a11x1 + a12x2 + a13x3 = b1 (R2) a22x2 + a23x3 = b2 (R3) a33x3 = b3 A lower triangular linear system can be solved by the forward substitution (R1) a11x1 = b1 (R2) a21x1 + a22x2 = b2 (R3) a31x1 + a32x2 + a33x3 = b3 Example Solve the following linear systems. (R1) 3x1+ x2+ x3 = 5 (R2) x2+ 2x3 = 4 (R3) 3x3 = 6 Example Solve the following linear systems. (R1) 3x1 += 6 (R2) 2x1 + x2 = 4 (R3) 3x1 + x2 + x3 = 5
  • 2. Elementary row operations Elementary row operations are the following three rules for manipulating or transforming an augmented matrix that leave the values of the solution set unchanged. 1. Any two rows can be exchanged. 2. Any row may be multiplied (or divided) by a non-zero constant. 3. A multiple of any row can be added to any other row. Example Show that the following two linear systems have the same solution. (I) x - y = 2 2x - y - z = 3 x + y + z = 6 (II) x - y = 2 x - z = 1 3x - y + z = 10 Numerical methods for solving a system of linear equations 2 main types of methods for solving this linear system: Direct methods  Give exact solution  Transform into the form that is easy to solve: i.e. either  upper triangular form,  lower triangular form, or  diagonal form E.g. Gaussian Elimination  upper triangular form Gauss-Jordan  diagonal form LU decomposition  upper and lower triangular form Indirect methods or Iterative methods  Give approximate solution  Require initial approximate solution E.g. Jacobi method Gauss-Seidel method
  • 3. Gaussian Elimination Method Example: Solve the following system of linear equations by using Gaussian elimination method. x - y = 2 2x - y - z = 3 x + y + z = 6 Example - no solution x - 2y - 6z = 12 x - 4y - 12z = 22 2x + 4y + 12z = -17
  • 4. Example - Many Solutions x + y - 2z = 1 y - z = 3 -x + 4y - 3z = 14 Example Consider the following linear system: x + 2y + 3z = 1 x + 3y + 4z = 3 x + 4y + kz = m. Use Gaussian elimination to specify all possible values of m and k so that the linear system has (i) One solution/Unique Solution (ii) Infinitely many solutions (iii) No solution
  • 5. Gaussian Elimination Method with Partial Pivoting Use when the pivot element is zero or close to zero. 1. Forward elimination with partial pivoting: selecting the largest pivot element. (i) Let row i , Ri be the pivot row. Select the largest element in absolute value from {aii, ai+1 i,..., ani}: (ii) Suppose row p, Rp, has the maximum absolute value of the entries in column i . Then switch row p and row i : Ri Rp. After pivoting in each column i = 1,..., n, perform forward elimination to transform the system into the upper diagonal form. 2. Back substitution to solve for the unknowns x Example: Solve the following system of linear equations by using Gaussian elimination method with partial pivoting. x - y = 2 2x - y - z = 3 x + y + z = 6
  • 6. Gauss-Jordan Elimination Method Example: Solve the following system of linear equations by using Gauss-Jordan elimination method. x - y = 2 2x - y - z = 3 x + y + z = 6
  • 7. Matrix Inverse AA-1 = A-1 A = I Let            33 32 31 23 22 21 13 12 11 1 - x x x x x x x x x A be the inverse of            33 32 31 23 22 21 13 12 11 a a a a a a a a a A AA-1 = I                                 1 0 0 0 1 0 0 0 1 x x x x x x x x x a a a a a a a a a 33 32 31 23 22 21 13 12 11 33 32 31 23 22 21 13 12 11                                                                                              1 0 0 x x x a a a a a a a a a , 0 1 0 x x x a a a a a a a a a , 0 0 1 x x x a a a a a a a a a 33 23 13 33 32 31 23 22 21 13 12 11 32 22 12 33 32 31 23 22 21 13 12 11 31 21 11 33 32 31 23 22 21 13 12 11 the inverse matrix can be found by using Gauss-Jordan Elimination method           1 0 0 0 1 0 0 0 1 a a a a a a a a a 33 32 31 23 22 21 13 12 11 and applying Gauss-Jordan elimination to transform to the form:           33 32 31 23 22 21 13 12 11 x x x x x x x x x 1 0 0 0 1 0 0 0 1 and the inverse is            33 32 31 23 22 21 13 12 11 1 - x x x x x x x x x A Example Find the inverse of the following matrix by using Gauss-Jordan Elimination method.           8 0 1 3 5 2 3 2 1
  • 8. LU decomposition LU decomposition of a given square matrix A is in the following form: A = LU 1 0 1 0 0 1 0 0 0 1 L n3 n2 n1 32 31 21                                 u 0 0 0 u u 0 0 u u u 0 u u u u U nn 3n 33 2n 23 22 1n 13 12 11                           is an upper triangular matrix. we can solve the linear system Ax = b  LUx = b 1. Let y = Ux. Then Ly = b. We can solve y from the above linear system by using forward Substitution, since L is a lower triangular matrix. 2. When y is known from the previous step, we can solve for x by performing the backward substitution since U is an upper triangular matrix Ux = y Example: Find the LU decomposition of the matrix           18 15 15 6 6 5 4 3 5 is a lower triangular matrix with all diagonal entries being 1
  • 9. Example: Find the inverse of the matrix by LU decomposition           18 15 15 6 6 5 4 3 5
  • 10. Vector Norms Let x =  T n 2 1 n 2 1 x x x x x x                Euclidean norm (2-norm or 2  -norm): 2 n 2 2 2 1 2 x ... x x x     1-norm: n 2 1 1 x ... x x x     Infinity norm (1-norm or `1-norm):   x ,..., x , x max x n 2 1   Example: Find theEuclidean norm (2-norm), 1-norm and Infinity norm of x =[1,-2,-3, 0,-1]T . Iterative methods a11x1 + a12x2 + ··· + a1nxn = b1  x1 = ( b1-[ a12x2 + a13x3 + ··· + a1nxn])/a11 a21x1 + a22x2 + ··· + a2nxn = b2  x2 = ( b2-[ a21x1 + a23x3 + ··· + a2nxn])/a22  an1x1 + an2x2 + ··· + an nxn = bn  xn = ( bn-[ an1x1 + an2x2 + ··· + an n-1xn-1])/an n Jacobi Method Gauss-Seidel method
  • 11. Example: Approximate the solution of the following linear system by using 3 iterations of Jacobi method 5x1 + x2 + 2x3 = 7 2x1 + 7x2 + x3 = 3 x1 + 3x2 + 8x3 = 9 with initial value x(0) =[0, 0, 0]T . Compute the corresponding the absolute error in each iteration using Euclidean norm and Infinity norm. Use 4 D.P. Rounding.
  • 12. Example: Approximate the solution of the following linear system by using 3 iterations of Gauss-Seidel method 5x1 + x2 + 2x3 = 7 2x1 + 7x2 + x3 = 3 x1 + 3x2 + 8x3 = 9 with initial value x(0) =[0, 0, 0]T . Compute the corresponding the absolute error in each iteration using Euclidean norm and Infinity norm. Use 4 D.P. Rounding.