SlideShare a Scribd company logo
1
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Linear Algebraic Equations
Gauss Elimination
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Objectives
• Knowing how to solve a system of linear
equations
• Understanding how to implement Gauss
elimination method
• Understanding the concepts of singularity
and ill-conditioning
2
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
A System of Linear Equations
1823 21 =+ xx
22 21 =+− xx
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Solution
Subtract second equation
from first
16*04 21 =+ xx
41 =x
32 =x
3
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
In Matrix Form






=












− 2
18
21
23
2
1
x
x
1823 21 =+ xx
22 21 =+− xx
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Elimination






=












− 2
18
21
23
2
1
x
x
Using row operations






=












− 2
16
21
04
2
1
x
x
4
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Elimination
Using row operations






=












− 2
16
21
04
2
1
x
x






=












6
16
20
04
2
1
x
x
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Naïve Elimination Routine!
5
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Back Substitution
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Special Cases
6
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Conclusions
• In this lecture, we revised the process of
Gauss elimination
• A clear algorithm for the elimination
process and the back substitution was
presented
• The different cases of no solution, infinite
number of solutions, and ill conditioning
were graphically presented
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Linear Algebraic Equations
Iterative Solutions
7
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Objectives
• Recognize the need for iterative solutions
• Understand the difference between
different iterative methods for solving
systems of linear equations
• Apply iterative methods to solve a system
of linear equations
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Why Iterative Methods?
• When system of equations is sparse; too many
zero elements. Such systems are produced
when approximately solving differential
equations; finite difference, finite element, etc…
• We already have sources of error in the solution;
model errors, approximation errors, truncation
errors, etc…, so why not use approximate
method any way
• Saves on time!
8
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Gauss-Jacobi
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Gauss-Jacobi: Example
1642
302
1124
321
21
321
=++
=++−
=++
xxx
xx
xxx ( )
( )
( ) 4/216
2/3
4/211
213
12
321
xxx
xx
xxx
−−=
+=
−−=
( )
( )
( ) 4/216
2/3
4/211
21
1
3
1
1
2
32
1
1
kkk
kk
kkk
xxx
xx
xxx
−−=
+=
−−=
+
+
+
9
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Is that really going to work?!!!
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Let’s try it!
{ }










=
1
1
1
0
x
( )
( )
( ) 25.34/1216
22/13
24/1211
1
3
1
2
1
1
=−−=
=+=
=−−=
x
x
x
( )
( )
( ) 5.24/22*216
5.22/23
9375.04/25.32*211
2
3
2
2
2
1
=−−=
=+=
=−−=
x
x
x ( )
( )
( ) 9063.24/5.2875.116
9688.12/9375.03
875.04/5.2511
3
3
3
2
3
1
=−−=
=+=
=−−=
x
x
x
10
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
In General!
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
A system of linear equations














=


























nnnnnn
n
n
b
b
b
x
x
x
aaa
aaa
aaa
MM
L
MOMM
L
L
2
1
2
1
21
22221
11211
Let’s examine one equation!
11212111 ... bxaxaxa nn =+++
( )
11
12121
1
...
a
xaxab
x nn++−
=
11
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
For any equation






−−= ∑∑ +=
−
=
+
n
ij
k
jij
i
j
k
jiji
ii
k
i xaxab
a
x
1
1
1
1 1
( )
ii
niniiiiiiii
i
a
xaxaxaxab
x
+++++−
= ++−− ...... 11,11,11
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Can it be any better?
12
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Gauss-Seidel






−−= ∑∑ +=
−
=
+
n
ij
k
jij
i
j
k
jiji
ii
k
i xaxab
a
x
1
1
1
1 1






−−= ∑∑ +=
−
=
++
n
ij
k
jij
i
j
k
jiji
ii
k
i xaxab
a
x
1
1
1
11 1
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Gauss-Seidel: Example
1642
302
1124
321
21
321
=++
=++−
=++
xxx
xx
xxx ( )
( )
( ) 4/216
2/3
4/211
213
12
321
xxx
xx
xxx
−−=
+=
−−=
( )
( )
( ) 4/216
2/3
4/211
1
2
1
1
1
3
1
1
1
2
32
1
1
+++
++
+
−−=
+=
−−=
kkk
kk
kkk
xxx
xx
xxx
13
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Let’s try it!
{ }










=
1
1
1
0
x
( )
( )
( ) 375.24/5.22*216
5.22/23
24/1211
1
3
1
2
1
1
=−−=
=+=
=−−=
x
x
x
( )
( )
( ) 0586.34/9531.1906.0*216
9531.12/90625.03
90625.04/375.2511
2
3
2
2
2
1
=−−=
=+=
=−−=
x
x
x
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Convergence Condition
• For the iterative solutions presented to
converge, the matrix must be diagonally
dominant.
∑
≠
=
>
n
ij
j
ijii aa
1
14
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Error!
{ } { } { }kkk
xxe −= −1
k
i
k
ik
a
x
e
max=ε
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Algorithm
1. If the system is not diagonally dominant; end
2. Start with any initial solution {x}
3. Apply the steps for Gauss-Seidal method to
evaluate the next iteration
4. If the maximum approximate relative error < εs;
end
5. Let the old solution vector equal the new
solution vector
6. Goto step 3
15
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Homework #3
• For the given system of simultaneous equations
• Write down the system of equation in a form that can be used for
iterative methods for solving systems of equations
• Use four iterations using Gauss-Jacobi method to find an
approximate solution using initial values {0,0,0}
• Use four iterations using Gauss-Seidel method to find an
approximate solution using initial values {0,0,0}
1642
1124
32
321
321
21
=++
=++
=+−
xxx
xxx
xx
ENEM602 Spring 2007
Dr. Eng. Mohammad Tawfik
Homework #3 cont’d
• Chapter 11, p 303, numbers:
11.8,11.9,11.10
• Due Next week

More Related Content

PDF
07 interpolationnewton
PDF
06 regression
PPT
09 numerical differentiation
PPT
07 interpolation
PDF
13 weightedresidual
PDF
A uniform distribution has density function find n (1)
PDF
Properties of coefficient of correlation
PDF
Lecture 6.1 6.2 bt
07 interpolationnewton
06 regression
09 numerical differentiation
07 interpolation
13 weightedresidual
A uniform distribution has density function find n (1)
Properties of coefficient of correlation
Lecture 6.1 6.2 bt

What's hot (19)

PDF
Direct and indirect methods
PPTX
Numerical Techniques
PDF
On The Numerical Solution of Picard Iteration Method for Fractional Integro -...
PDF
Least Square Plane and Leastsquare Quadric Surface Approximation by Using Mod...
DOCX
MCA_UNIT-1_Computer Oriented Numerical Statistical Methods
PDF
Chebyshev Collocation Approach for a Continuous Formulation of Implicit Hybri...
PDF
A computational method for system of linear fredholm integral equations
PDF
Adomian decomposition Method and Differential Transform Method to solve the H...
DOCX
MCA_UNIT-2_Computer Oriented Numerical Statistical Methods
PPTX
Elements of Statistical Learning 読み会 第2章
PPTX
Reducible equation to quadratic form
DOCX
Course pack unit 5
PDF
Q0749397
PDF
Comparative analysis of x^3+y^3=z^3 and x^2+y^2=z^2 in the Interconnected Sets
PDF
Ijetcas14 608
DOCX
Tugas Aljabar Linear
PPTX
Scrodinger wave equation
PPTX
Contactless Calipper - English
DOCX
BSC_COMPUTER _SCIENCE_UNIT-4_DISCRETE MATHEMATICS
Direct and indirect methods
Numerical Techniques
On The Numerical Solution of Picard Iteration Method for Fractional Integro -...
Least Square Plane and Leastsquare Quadric Surface Approximation by Using Mod...
MCA_UNIT-1_Computer Oriented Numerical Statistical Methods
Chebyshev Collocation Approach for a Continuous Formulation of Implicit Hybri...
A computational method for system of linear fredholm integral equations
Adomian decomposition Method and Differential Transform Method to solve the H...
MCA_UNIT-2_Computer Oriented Numerical Statistical Methods
Elements of Statistical Learning 読み会 第2章
Reducible equation to quadratic form
Course pack unit 5
Q0749397
Comparative analysis of x^3+y^3=z^3 and x^2+y^2=z^2 in the Interconnected Sets
Ijetcas14 608
Tugas Aljabar Linear
Scrodinger wave equation
Contactless Calipper - English
BSC_COMPUTER _SCIENCE_UNIT-4_DISCRETE MATHEMATICS
Ad

Similar to 04 gaussmethods (20)

PPT
03 open methods
PPT
08 interpolation lagrange
PPT
09 numerical integration
PPT
08 numerical integration
PPT
08 numerical integration 2
PPT
11 initial value problems system
PDF
Algebra Trigonometry Problems
DOCX
Btech_II_ engineering mathematics_unit5
PDF
Fourier Series note by Prasad Enagandula
PDF
Fourier Series note by Prasad Enagandula
PDF
Uniform Order Legendre Approach for Continuous Hybrid Block Methods for the S...
PPTX
Response surface methodology.pptx
PDF
Gauss elimination & Gauss Jordan method
PDF
2022 ملزمة الرياضيات للصف السادس التطبيقي الفصل الثالث - تطبيقات التفاضل
PDF
勾配法
PDF
2022 ملزمة الرياضيات للصف السادس الاحيائي الفصل الثالث تطبيقات التفاضل
PDF
FUNCTIONS L.1.pdf
PPTX
5-Solving-Quadratic-Equations-and-Rational-Algebraic-Equations.pptx
PDF
Trabajo matemáticas 7
03 open methods
08 interpolation lagrange
09 numerical integration
08 numerical integration
08 numerical integration 2
11 initial value problems system
Algebra Trigonometry Problems
Btech_II_ engineering mathematics_unit5
Fourier Series note by Prasad Enagandula
Fourier Series note by Prasad Enagandula
Uniform Order Legendre Approach for Continuous Hybrid Block Methods for the S...
Response surface methodology.pptx
Gauss elimination & Gauss Jordan method
2022 ملزمة الرياضيات للصف السادس التطبيقي الفصل الثالث - تطبيقات التفاضل
勾配法
2022 ملزمة الرياضيات للصف السادس الاحيائي الفصل الثالث تطبيقات التفاضل
FUNCTIONS L.1.pdf
5-Solving-Quadratic-Equations-and-Rational-Algebraic-Equations.pptx
Trabajo matemáticas 7
Ad

More from Mohammad Tawfik (20)

PDF
Supply Chain Management for Engineers - INDE073
PDF
Supply Chain Management 01 - Introduction
PDF
Supply Chain Management 02 - Logistics
PDF
Supply Chain Management 03 - Inventory Management
PDF
Creative problem solving and decision making
PDF
Digital content for teaching introduction
PDF
Crisis Management Basics
PDF
DISC Personality Model
PDF
Training of Trainers
PDF
Effective Delegation Skills
PDF
Train The Trainer
PDF
Business Management - Marketing
PDF
Stress Management
PDF
Project Management (CAPM) - Integration
PDF
Project Management (CAPM) - The Framework
PDF
Project Management (CAPM) - Introduction
PDF
The Creative Individual
PDF
Introduction to Wind Energy
PDF
Finite Element for Trusses in 2-D
PDF
Future of Drones ITW'16
Supply Chain Management for Engineers - INDE073
Supply Chain Management 01 - Introduction
Supply Chain Management 02 - Logistics
Supply Chain Management 03 - Inventory Management
Creative problem solving and decision making
Digital content for teaching introduction
Crisis Management Basics
DISC Personality Model
Training of Trainers
Effective Delegation Skills
Train The Trainer
Business Management - Marketing
Stress Management
Project Management (CAPM) - Integration
Project Management (CAPM) - The Framework
Project Management (CAPM) - Introduction
The Creative Individual
Introduction to Wind Energy
Finite Element for Trusses in 2-D
Future of Drones ITW'16

04 gaussmethods

  • 1. 1 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Linear Algebraic Equations Gauss Elimination ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Objectives • Knowing how to solve a system of linear equations • Understanding how to implement Gauss elimination method • Understanding the concepts of singularity and ill-conditioning
  • 2. 2 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik A System of Linear Equations 1823 21 =+ xx 22 21 =+− xx ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Solution Subtract second equation from first 16*04 21 =+ xx 41 =x 32 =x
  • 3. 3 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik In Matrix Form       =             − 2 18 21 23 2 1 x x 1823 21 =+ xx 22 21 =+− xx ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Elimination       =             − 2 18 21 23 2 1 x x Using row operations       =             − 2 16 21 04 2 1 x x
  • 4. 4 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Elimination Using row operations       =             − 2 16 21 04 2 1 x x       =             6 16 20 04 2 1 x x ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Naïve Elimination Routine!
  • 5. 5 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Back Substitution ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Special Cases
  • 6. 6 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Conclusions • In this lecture, we revised the process of Gauss elimination • A clear algorithm for the elimination process and the back substitution was presented • The different cases of no solution, infinite number of solutions, and ill conditioning were graphically presented ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Linear Algebraic Equations Iterative Solutions
  • 7. 7 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Objectives • Recognize the need for iterative solutions • Understand the difference between different iterative methods for solving systems of linear equations • Apply iterative methods to solve a system of linear equations ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Why Iterative Methods? • When system of equations is sparse; too many zero elements. Such systems are produced when approximately solving differential equations; finite difference, finite element, etc… • We already have sources of error in the solution; model errors, approximation errors, truncation errors, etc…, so why not use approximate method any way • Saves on time!
  • 8. 8 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Gauss-Jacobi ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Gauss-Jacobi: Example 1642 302 1124 321 21 321 =++ =++− =++ xxx xx xxx ( ) ( ) ( ) 4/216 2/3 4/211 213 12 321 xxx xx xxx −−= += −−= ( ) ( ) ( ) 4/216 2/3 4/211 21 1 3 1 1 2 32 1 1 kkk kk kkk xxx xx xxx −−= += −−= + + +
  • 9. 9 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Is that really going to work?!!! ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Let’s try it! { }           = 1 1 1 0 x ( ) ( ) ( ) 25.34/1216 22/13 24/1211 1 3 1 2 1 1 =−−= =+= =−−= x x x ( ) ( ) ( ) 5.24/22*216 5.22/23 9375.04/25.32*211 2 3 2 2 2 1 =−−= =+= =−−= x x x ( ) ( ) ( ) 9063.24/5.2875.116 9688.12/9375.03 875.04/5.2511 3 3 3 2 3 1 =−−= =+= =−−= x x x
  • 10. 10 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik In General! ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik A system of linear equations               =                           nnnnnn n n b b b x x x aaa aaa aaa MM L MOMM L L 2 1 2 1 21 22221 11211 Let’s examine one equation! 11212111 ... bxaxaxa nn =+++ ( ) 11 12121 1 ... a xaxab x nn++− =
  • 11. 11 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik For any equation       −−= ∑∑ += − = + n ij k jij i j k jiji ii k i xaxab a x 1 1 1 1 1 ( ) ii niniiiiiiii i a xaxaxaxab x +++++− = ++−− ...... 11,11,11 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Can it be any better?
  • 12. 12 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Gauss-Seidel       −−= ∑∑ += − = + n ij k jij i j k jiji ii k i xaxab a x 1 1 1 1 1       −−= ∑∑ += − = ++ n ij k jij i j k jiji ii k i xaxab a x 1 1 1 11 1 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Gauss-Seidel: Example 1642 302 1124 321 21 321 =++ =++− =++ xxx xx xxx ( ) ( ) ( ) 4/216 2/3 4/211 213 12 321 xxx xx xxx −−= += −−= ( ) ( ) ( ) 4/216 2/3 4/211 1 2 1 1 1 3 1 1 1 2 32 1 1 +++ ++ + −−= += −−= kkk kk kkk xxx xx xxx
  • 13. 13 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Let’s try it! { }           = 1 1 1 0 x ( ) ( ) ( ) 375.24/5.22*216 5.22/23 24/1211 1 3 1 2 1 1 =−−= =+= =−−= x x x ( ) ( ) ( ) 0586.34/9531.1906.0*216 9531.12/90625.03 90625.04/375.2511 2 3 2 2 2 1 =−−= =+= =−−= x x x ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Convergence Condition • For the iterative solutions presented to converge, the matrix must be diagonally dominant. ∑ ≠ = > n ij j ijii aa 1
  • 14. 14 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Error! { } { } { }kkk xxe −= −1 k i k ik a x e max=ε ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Algorithm 1. If the system is not diagonally dominant; end 2. Start with any initial solution {x} 3. Apply the steps for Gauss-Seidal method to evaluate the next iteration 4. If the maximum approximate relative error < εs; end 5. Let the old solution vector equal the new solution vector 6. Goto step 3
  • 15. 15 ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Homework #3 • For the given system of simultaneous equations • Write down the system of equation in a form that can be used for iterative methods for solving systems of equations • Use four iterations using Gauss-Jacobi method to find an approximate solution using initial values {0,0,0} • Use four iterations using Gauss-Seidel method to find an approximate solution using initial values {0,0,0} 1642 1124 32 321 321 21 =++ =++ =+− xxx xxx xx ENEM602 Spring 2007 Dr. Eng. Mohammad Tawfik Homework #3 cont’d • Chapter 11, p 303, numbers: 11.8,11.9,11.10 • Due Next week