SlideShare ist ein Scribd-Unternehmen logo
1 von 65
Downloaden Sie, um offline zu lesen
Simultaneous linear
algebraic equations
Linear Algebraic Equations










nnnnnn
nn
x
nn
bxaxaxa
bxxaeaxa
bxaxxaxa




2211
2
3
2222
3
121
1
5
12112111
/)()(
)(
2










nnnnnn
nn
nn
bxaxaxa
bxaxaxa
bxaxaxa




2211
22222121
11212111
Nonlinear Equations
Special Types of Square Matrices













8863916
6972
39731
16215
][A















nna
a
a
D

22
11
][













1
1
1
1
][I
Symmetric Diagonal Identity















nn
n
n
a
aa
aaa
A][ 222
11211


















nnn aa
aa
a
A


1
2221
11
][
Upper Triangular Lower Triangular
4
Solving Systems of Equations
• A linear equation in n variables:
a1x1 + a2x2 + … + anxn = b
• For small (n ≤ 3), linear algebra provides several tools to solve
such systems of linear equations:
– Graphical method
– Cramer’s rule
– Method of elimination
• Nowadays, easy access to computers makes the solution of
very large sets of linear algebraic equations possible
n = 2: the solution is the sole intersection point of
two lines
n = 3: each equation represents a plane in a 3D
space, and the solution is the intersection
between the three planes.
n > 3: the method fails to be of any practical use.
Manual Solutions (n ≤ 3)
12
1
1
12
11
2
a
b
x
a
a
x 






22
2
1
22
21
2
a
b
x
a
a
x 






The Graphical Method
Singular and ill-conditioned systems
Determinants and Cramer’s Rule
[A] : coefficient matrix    BxA 































3
2
1
3
2
1
333231
232221
131211
b
b
b
x
x
x
aaa
aaa
aaa
 











333231
232221
131211
aaa
aaa
aaa
A
D
aab
aab
aab
x 33323
23222
13121
1 
D
aba
aba
aba
x 33331
23221
13111
2 
D
baa
baa
baa
x 33231
22221
11211
3 
D : Determinant of A matrix
7
333231
232221
131211
aaa
aaa
aaa
D 
 











333231
232221
131211
aaa
aaa
aaa
A
    BxA 
3231
2221
13
3331
2321
12
3332
2322
11AoftDeterminan
aa
aa
a
aa
aa
a
aa
aa
aD 
Computing the
Determinant
23323322
3332
2322
11 aaaa
aa
aa
D 
22313221
3231
2221
13
23313321
3331
2321
12
aaaa
aa
aa
D
aaaa
aa
aa
D


Manual Solutions (n ≤ 3)
An Example 1 of Cramer’s Method
Cramer’s Rule
• For a singular system D = 0  Solution can not
be obtained.
• For large systems Cramer’s rule is not practical
because calculating determinants is costly.
10
Gauss Elimination Method
• Solve Ax = b
• Consists of two phases:
–Forward elimination
–Back substitution
• Forward Elimination
reduces Ax = b to an upper
triangular system Tx = b’
• Back substitution can then
solve Tx = b’ for x





















''
3
''
33
'
2
'
23
'
22
1131211
3333231
2232221
1131211
00
0
ba
baa
baaa
baaa
baaa
baaa
Forward
Elimination
Back
Substitution
11
2123131
1
'
22
3
'
23
'
2
2''
33
''
3
3
a
xaxab
x
a
xab
x
a
b
x





x1 - x2 + x3 = 6
3x1 + 4x2 + 2x3 = 9
2x1 + x2 + x3 = 7
x1 - x2 + x3 = 6
0 +7x2 - x3 = -9
0 + 3x2 - x3 = -5
x1 - x2 + x3 = 6
0 7x2 - x3 = -9
0 0 -(4/7)x3=-(8/7)
-(3/1)
Solve using BACK SUBSTITUTION: x3 = 2 x2=-1 x1 =3
-(2/1) -(3/7)
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0 0
Example 1
Example 2
Pitfalls of Elimination Methods
Division by zero
It is possible that during both elimination and back-substitution phases a
division by zero can occur.
For example:
2x2 + 3x3 = 8 0 2 3
4x1 + 6x2 + 7x3 = -3 A = 4 6 7
2x1 + x2 + 6x3 = 5 2 1 6
Solution: pivoting (to be discussed later)
Pitfalls (cont.)
Round-off errors
• A round-off error, also called rounding error, is the difference between the
calculated approximation of a number and its exact mathematical value.
• Because computers carry only a limited number of significant figures,
round-off errors will occur and they will propagate from one iteration to the
next.
• This problem is especially important when large numbers of equations (100
or more) are to be solved.
• Always use double-precision numbers/arithmetic. It is slow but needed for
correctness!
• It is also a good idea to substitute your results back into the original
equations and check whether a substantial error has occurred.
ill-conditioned systems - small changes in coefficients result in large
changes in the solution. Alternatively, a wide range of answers can
approximately satisfy the equations.
(Well-conditioned systems – small changes in coefficients result in small
changes in the solution)
Problem: Since round off errors can induce small changes in the coefficients, these
changes can lead to large solution errors in ill-conditioned systems.
Example:
x1 + 2x2 = 10
1.1x1 + 2x2 = 10.4
x1 + 2x2 = 10
1.05x1 + 2x2 = 10.4
34
2.0
)4.10(2)10(2
)1.1(2)2(1
24.10
210
2
222
121
1 




 x
D
ab
ab
x
18
1.0
)4.10(2)10(2
)05.1(2)2(1
24.10
210
2
222
121
1 




 x
D
ab
ab
x
Pitfalls (cont.)
• Surprisingly, substitution of the wrong values, x1=8 and x2=1, into the original
equation will not reveal their incorrect nature clearly:
x1 + 2x2 = 10 8+2(1) = 10 (the same!)
1.1x1 + 2x2 = 10.4 1.1(8)+2(1)=10.8 (close!)
IMPORTANT OBSERVATION:
An ill-conditioned system is one with a determinant close to zero
• If determinant D=0 then there are infinitely many solutions  singular system
• Scaling (multiplying the coefficients with the same value) does not change the
equations but changes the value of the determinant in a significant way.
However, it does not change the ill-conditioned state of the equations!
DANGER! It may hide the fact that the system is ill-conditioned!!
How can we find out whether a system is ill-conditioned or not?
Not easy! Luckily, most engineering systems yield well-conditioned results!
• One way to find out: change the coefficients slightly and recompute & compare
ill-conditioned systems (cont.) –
19
COMPUTING THE DETERMINANT OF A MATRIX
USING GAUSSIAN ELIMINATION
The determinant of a matrix can be found using Gaussian elimination.
Here are the rules that apply:
• Interchanging two rows changes the sign of the determinant.
• Multiplying a row by a scalar multiplies the determinant by that scalar.
• Replacing any row by the sum of that row and any other row does NOT change
the determinant.
• The determinant of a triangular matrix (upper or lower triangular) is the product
of the diagonal elements. i.e. D=t11t22t33
33
2322
131211
00
0
t
tt
ttt
D 
Techniques for Improving Solutions
• Use of more significant figures – double precision arithmetic
• Pivoting
If a pivot element is zero, normalization step leads to division by zero. The
same problem may arise, when the pivot element is close to zero. Problem
can be avoided:
– Partial pivoting
Switching the rows below so that the largest element is the pivot element.
– Complete pivoting
• Searching for the largest element in all rows and columns then switching.
• This is rarely used because switching columns changes the order of x’s
and adds significant complexity and overhead  costly
• Scaling
– used to reduce the round-off errors and improve accuracy
Pivoting
• Consider this system:
• Immediately run into problem:
algorithm wants us to divide by zero!
• More subtle version:






8
2
32
10






8
2
32
1001.0
Pivoting
• Conclusion: small diagonal elements bad
• Remedy: swap in larger element from
somewhere else
Partial Pivoting
• Swap rows 1 and 2:
• Now continue:






8
2
32
10






2
8
10
32












2
1
10
01
2
4
10
1 2
3
Full Pivoting
• Swap largest element onto diagonal by
swapping rows 1 and 2 and columns 1 and 2:
• Critical: when swapping columns, must
remember to swap results!






8
2
32
10






2
8
01
23
Full Pivoting
• Full pivoting more stable, but only slightly






2
8
01
23






 3
2
3
8
3
2
3
2
0
1






1
2
10
01
* Swap results
1 and 2
Example 3: Gauss Elimination
2 4
1 2 3 4
1 2 4
1 2 3 4
2 0
2 2 3 2 2
4 3 7
6 6 5 6
x x
x x x x
x x x
x x x x
  
    
   
   
a) Forward Elimination
0 2 0 1 0 6 1 6 5 6
2 2 3 2 2 2 2 3 2 2
1 4
4 3 0 1 7 4 3 0 1 7
6 1 6 5 6 0 2 0 1 0
R R
     
   
          
   
       
Example 3: Gauss Elimination (cont’d)
6 1 6 5 6
2 2 3 2 2 2 0.33333 1
4 3 0 1 7 3 0.66667 1
0 2 0 1 0
6 1 6 5 6
0 1.6667 5 3.6667 4
2 3
0 3.6667 4 4.3333 11
0 2 0 1 0
6 1 6 5 6
0 3.6667 4 4.3333 11
0 1.6667 5 3.6667 4
0 2 0 1 0
R R
R R
R R
   
 
   
    
 
  
   
 
    
 
  
   
 
  
 
 
  
Example 3: Gauss Elimination (cont’d)
6 1 6 5 6
0 3.6667 4 4.3333 11
0 1.6667 5 3.6667 4 3 0.45455 2
0 2 0 1 0 4 0.54545 2
6 1 6 5 6
0 3.6667 4 4.3333 11
0 0 6.8182 5.6364 9.0001
0 0 2.1818 3.3636 5.9999 4 0.32000 3
6 1 6
0 3.6667 4
0 0 6.8
0 0
R R
R R
R R
   
 
  
   
 
   
   
 
  
 
 
    


5 6
4.3333 11
182 5.6364 9.0001
0 1.5600 3.1199
  
 
 
 
 
  
Example 3: Gauss Elimination (cont’d)
b) Back Substitution
6 1 6 5 6
0 3.6667 4 4.3333 11
0 0 6.8182 5.6364 9.0001
0 0 0 1.5600 3.1199
   
 
  
 
 
  
 
   
     
4
3
2
1
3.1199
1.9999
1.5600
9.0001 5.6364 1.9999
0.33325
6.8182
11 4.3333 1.9999 4 0.33325
1.0000
3.6667
6 5 1.9999 6 0.33325 1 1.0000
0.50000
6
x
x
x
x

  
  
 
   
 

   
  
Gauss-Jordan Elimination
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0 0
0
a11
x22
0
x33
0
0
x44
0
0
0
x55
0
0
0
0
x66
x77
x88
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
b11
b22
b33
b44
b55
b66
b77
b66
b660 0 0 x99
Gauss-Jordan Elimination: Example 4











































10
1
8
|
|
|
473
321
211
:MatrixAugmented
10
1
8
473
321
211
3
2
1
x
x
x
1 1 2 | 8
0 1 5 | 9
0 4 2| 14
 
  
   
R2  R2 - (-1)R1
R3  R3 - ( 3)R1
Scaling R2:
R2  R2/(-1)
R1  R1 - (1)R2
R3  R3-(4)R2
1 1 2 | 8
0 1 5| 9
0 4 2| 14
 
   
   












22
9
17
|
|
|
1800
510
701
Scaling R3:
R3  R3/(18) 











9/11
9
17
|
|
|
100
510
701











222.1
888.2
444.8
|
|
|
100
010
001R1  R1 - (7)R3
R2  R2-(-5)R3
RESULT:
x1=8.45, x2=-2.89, x3=1.23
Example 5:
Motivation
• The elimination method becomes inefficient when solving
equations with the same coefficients [A] but different right-
hand-side constants (the b’s).
• The LU decomposition also provides an efficient means to
compute the matrix inverse.
• Gauss elimination itself can be expressed as an LU
decomposition.
    BXA 
The LU decomposition method
Example 6:
Notice that for the LU decomposition implementation of Gauss elimination, the [L]
matrix has 1’s on the diagonal. This is formally referred to as a Doolittle
decomposition, or factorization. An alternative approach involves a [U] matrix with
1’s on the diagonal. This is called Crout decomposition.
  











333231
232221
131211
aaa
aaa
aaa
A
[ U ][ L ]




















33
2322
131211
3231
21
00
0
1
01
001
u
uu
uuu
ll
l
upper triangular
matrix
lower triangular
matrix
LU Decomposition by Gauss Elimination
 





















3
2
1
33
2322
131211
00
0
d
d
d
X
a
aa
aaa
"
'' 





















3
2
1
333231
232221
131211
b
b
b
X
uaa
aaa
aaa
22
32
32
'
'
a
a
f 
forward elimination
[U]
11
21
21
a
a
f 
11
31
31
a
a
f 
 











33
2322
131211
00
0
"
''
a
aa
aaa
U  











1
01
001
3231
21
ff
fL     ULA 
upper triangular matrix
22
32
32
'
'
a
a
f 
11
21
21
a
a
f 
11
31
31
a
a
f 
U =  











33
2322
131211
00
0
"
''
a
aa
aaa
U
Example 6 (cont’d):
Example 6 (cont’d):
Example 6 (cont’d):
Example 7:
CW 1: Use the LU decomposition method to solve
CW 2: Use the LU decomposition method to solve
CW 3:
Solve the following system using Gauss Elimination.
Jacobi Iterative Method
])([)()]([ xDAbDxxDAbDxbxDAD
a
a
a
D
aaa
aaa
aaa
AbAx























1
33
22
11
333231
232221
131211
00
00
00
33
1
232
1
1313
3
22
1
323
1
1212
2
11
1
313
1
2121
1
a
xaxab
x
a
xaxab
x
a
xaxab
x
kk
k
kk
k
kk
k







*
/
/
/






























































3
2
1
3231
2321
1312
3
2
1
33
22
11
3
2
1
0
0
0
100
010
001
x
x
x
aa
aa
aa
b
b
b
a
a
a
x
x
x
Choose an initial guess (i.e. all zeros) and Iterate until the equality is satisfied.
No guarantee for convergence!
Iterative methods provide an alternative to the elimination
methods.
Gauss-Seidel Iteration Method
• The Gauss-Seidel method is a commonly used iterative method.
• It is same as Jacobi technique except with one important difference:
A newly computed x value (say xk) is substituted in the subsequent
equations (equations k+1, k+2, …, n) in the same iteration.
Example: Consider the 3x3 system below:
• First, choose initial guesses for the x’s.
• A simple way to obtain initial guesses is
to assume that they are all zero.
• Compute new x1 using the previous
iteration values.
• New x1 is substituted in the equations to
calculate x2 and x3
• The process is repeated for x2, x3, …newold
newnew
new
oldnew
new
oldold
new
XX
a
xaxab
x
a
xaxab
x
a
xaxab
x
}{}{ 






33
2321313
3
22
3231212
2
11
3132121
1
56
Convergence Criterion for Gauss-Seidel Method
• Iterations are repeated until the convergence criterion is satisfied:
For all i, where j and j-1 are
the current and previous iterations.
• As any other iterative method, the Gauss-Seidel method has problems:
– It may not converge or it converges very slowly.
• If the coefficient matrix A is Diagonally Dominant Gauss-Seidel is
guaranteed to converge.
• Note that this is not a necessary condition, i.e. the system may still have a
chance to converge even if A is not diagonally dominant.
sj
i
j
i
j
i
ia
x
xx
 %100
1
,



57
newold
newnew
new
oldnew
new
oldold
new
XX
a
xaxab
x
a
xaxab
x
a
xaxab
x
}{}{ 






33
2321313
3
22
3231212
2
11
3132121
1
Example 8 (Gauss-Seidel Method) :
Special Problem 4
Home Work 2
1.
2.
3.
4.
5. Use Gauss-Seidel method to solve the system

Weitere ähnliche Inhalte

Was ist angesagt?

Differential equations of first order
Differential equations of first orderDifferential equations of first order
Differential equations of first ordervishalgohel12195
 
Gamma and betta function harsh shah
Gamma and betta function  harsh shahGamma and betta function  harsh shah
Gamma and betta function harsh shahC.G.P.I.T
 
Gauss elimination method
Gauss elimination methodGauss elimination method
Gauss elimination methodgilandio
 
Engineering Numerical Analysis Lecture-1
Engineering Numerical Analysis Lecture-1Engineering Numerical Analysis Lecture-1
Engineering Numerical Analysis Lecture-1Muhammad Waqas
 
1st order differential equations
1st order differential equations1st order differential equations
1st order differential equationsNisarg Amin
 
Higher Differential Equation
Higher Differential Equation Higher Differential Equation
Higher Differential Equation Abdul Hannan
 
170120107066 power series.ppt
170120107066 power series.ppt170120107066 power series.ppt
170120107066 power series.pptharsh kothari
 
First Order Differential Equations
First Order Differential EquationsFirst Order Differential Equations
First Order Differential EquationsItishree Dash
 
Boundary Value Problems - Finite Difference
Boundary Value Problems - Finite DifferenceBoundary Value Problems - Finite Difference
Boundary Value Problems - Finite DifferenceMohammad Tawfik
 
presentation on Euler and Modified Euler method ,and Fitting of curve
presentation on Euler and Modified Euler method ,and Fitting of curve presentation on Euler and Modified Euler method ,and Fitting of curve
presentation on Euler and Modified Euler method ,and Fitting of curve Mukuldev Khunte
 
1575 numerical differentiation and integration
1575 numerical differentiation and integration1575 numerical differentiation and integration
1575 numerical differentiation and integrationDr Fereidoun Dejahang
 
Higher Differential Equation
Higher Differential EquationHigher Differential Equation
Higher Differential Equationgtuautonomous
 
Integration presentation
Integration presentationIntegration presentation
Integration presentationUrmila Bhardwaj
 

Was ist angesagt? (20)

Secant method
Secant methodSecant method
Secant method
 
Differential equations of first order
Differential equations of first orderDifferential equations of first order
Differential equations of first order
 
Gamma and betta function harsh shah
Gamma and betta function  harsh shahGamma and betta function  harsh shah
Gamma and betta function harsh shah
 
Gauss elimination method
Gauss elimination methodGauss elimination method
Gauss elimination method
 
Engineering Numerical Analysis Lecture-1
Engineering Numerical Analysis Lecture-1Engineering Numerical Analysis Lecture-1
Engineering Numerical Analysis Lecture-1
 
Functions
FunctionsFunctions
Functions
 
Generating function
Generating functionGenerating function
Generating function
 
Gauss sediel
Gauss sedielGauss sediel
Gauss sediel
 
Applications of numerical methods
Applications of numerical methodsApplications of numerical methods
Applications of numerical methods
 
1st order differential equations
1st order differential equations1st order differential equations
1st order differential equations
 
Higher Differential Equation
Higher Differential Equation Higher Differential Equation
Higher Differential Equation
 
170120107066 power series.ppt
170120107066 power series.ppt170120107066 power series.ppt
170120107066 power series.ppt
 
First Order Differential Equations
First Order Differential EquationsFirst Order Differential Equations
First Order Differential Equations
 
Algebraic structures
Algebraic structuresAlgebraic structures
Algebraic structures
 
Boundary Value Problems - Finite Difference
Boundary Value Problems - Finite DifferenceBoundary Value Problems - Finite Difference
Boundary Value Problems - Finite Difference
 
presentation on Euler and Modified Euler method ,and Fitting of curve
presentation on Euler and Modified Euler method ,and Fitting of curve presentation on Euler and Modified Euler method ,and Fitting of curve
presentation on Euler and Modified Euler method ,and Fitting of curve
 
1575 numerical differentiation and integration
1575 numerical differentiation and integration1575 numerical differentiation and integration
1575 numerical differentiation and integration
 
Metric space
Metric spaceMetric space
Metric space
 
Higher Differential Equation
Higher Differential EquationHigher Differential Equation
Higher Differential Equation
 
Integration presentation
Integration presentationIntegration presentation
Integration presentation
 

Andere mochten auch

Adequacy of solutions
Adequacy of solutionsAdequacy of solutions
Adequacy of solutionsTarun Gehlot
 
Applied numerical methods lec7
Applied numerical methods lec7Applied numerical methods lec7
Applied numerical methods lec7Yasser Ahmed
 
Numerical analysis using Scilab: Solving nonlinear equations
Numerical analysis using Scilab: Solving nonlinear equationsNumerical analysis using Scilab: Solving nonlinear equations
Numerical analysis using Scilab: Solving nonlinear equationsScilab
 
Chapter 4: Linear Algebraic Equations
Chapter 4: Linear Algebraic EquationsChapter 4: Linear Algebraic Equations
Chapter 4: Linear Algebraic EquationsMaria Fernanda
 
MILNE'S PREDICTOR CORRECTOR METHOD
MILNE'S PREDICTOR CORRECTOR METHODMILNE'S PREDICTOR CORRECTOR METHOD
MILNE'S PREDICTOR CORRECTOR METHODKavin Raval
 
System of linear algebriac equations nsm
System of linear algebriac equations nsmSystem of linear algebriac equations nsm
System of linear algebriac equations nsmRahul Narang
 
Algebraic Mathematics of Linear Inequality & System of Linear Inequality
Algebraic Mathematics of Linear Inequality & System of Linear InequalityAlgebraic Mathematics of Linear Inequality & System of Linear Inequality
Algebraic Mathematics of Linear Inequality & System of Linear InequalityJacqueline Chau
 

Andere mochten auch (12)

Adequacy of solutions
Adequacy of solutionsAdequacy of solutions
Adequacy of solutions
 
Applied numerical methods lec7
Applied numerical methods lec7Applied numerical methods lec7
Applied numerical methods lec7
 
Es272 ch4a
Es272 ch4aEs272 ch4a
Es272 ch4a
 
Numerical analysis using Scilab: Solving nonlinear equations
Numerical analysis using Scilab: Solving nonlinear equationsNumerical analysis using Scilab: Solving nonlinear equations
Numerical analysis using Scilab: Solving nonlinear equations
 
Unit vi
Unit viUnit vi
Unit vi
 
Chapter 4: Linear Algebraic Equations
Chapter 4: Linear Algebraic EquationsChapter 4: Linear Algebraic Equations
Chapter 4: Linear Algebraic Equations
 
Systems of linear equations; matrices
Systems of linear equations; matricesSystems of linear equations; matrices
Systems of linear equations; matrices
 
MILNE'S PREDICTOR CORRECTOR METHOD
MILNE'S PREDICTOR CORRECTOR METHODMILNE'S PREDICTOR CORRECTOR METHOD
MILNE'S PREDICTOR CORRECTOR METHOD
 
System of linear algebriac equations nsm
System of linear algebriac equations nsmSystem of linear algebriac equations nsm
System of linear algebriac equations nsm
 
Es272 ch7
Es272 ch7Es272 ch7
Es272 ch7
 
Algebraic Mathematics of Linear Inequality & System of Linear Inequality
Algebraic Mathematics of Linear Inequality & System of Linear InequalityAlgebraic Mathematics of Linear Inequality & System of Linear Inequality
Algebraic Mathematics of Linear Inequality & System of Linear Inequality
 
forging processes
forging processesforging processes
forging processes
 

Ähnlich wie Applied numerical methods lec6

lecture0003-numerical-methods-topic-3-solution-of-systems-of-linear-equations...
lecture0003-numerical-methods-topic-3-solution-of-systems-of-linear-equations...lecture0003-numerical-methods-topic-3-solution-of-systems-of-linear-equations...
lecture0003-numerical-methods-topic-3-solution-of-systems-of-linear-equations...wafahop
 
Ch9-Gauss_Elimination4.pdf
Ch9-Gauss_Elimination4.pdfCh9-Gauss_Elimination4.pdf
Ch9-Gauss_Elimination4.pdfRahulUkhande
 
18-21 Principles of Least Squares.ppt
18-21 Principles of Least Squares.ppt18-21 Principles of Least Squares.ppt
18-21 Principles of Least Squares.pptBAGARAGAZAROMUALD2
 
Linear Algebra- Gauss Elim-converted.pptx
Linear Algebra- Gauss Elim-converted.pptxLinear Algebra- Gauss Elim-converted.pptx
Linear Algebra- Gauss Elim-converted.pptxMazwan3
 
Maths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K MukhopadhyayMaths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K MukhopadhyayDr. Asish K Mukhopadhyay
 
determinants-160504230830_repaired.pdf
determinants-160504230830_repaired.pdfdeterminants-160504230830_repaired.pdf
determinants-160504230830_repaired.pdfTGBSmile
 
7.3_Nonlinear Programming-LagrangeExamples.pptx
7.3_Nonlinear Programming-LagrangeExamples.pptx7.3_Nonlinear Programming-LagrangeExamples.pptx
7.3_Nonlinear Programming-LagrangeExamples.pptxethannguyen1618
 
Linear Equations-Dr. Hasib.pdf
Linear Equations-Dr. Hasib.pdfLinear Equations-Dr. Hasib.pdf
Linear Equations-Dr. Hasib.pdfABIDANJAM
 
The rules of indices
The rules of indicesThe rules of indices
The rules of indicesYu Kok Hui
 
Direct solution of sparse network equations by optimally ordered triangular f...
Direct solution of sparse network equations by optimally ordered triangular f...Direct solution of sparse network equations by optimally ordered triangular f...
Direct solution of sparse network equations by optimally ordered triangular f...Dimas Ruliandi
 
Complete Factoring Rules.ppt
Complete Factoring Rules.pptComplete Factoring Rules.ppt
Complete Factoring Rules.pptJasmin679773
 
Complete Factoring Rules in Grade 8 Math.ppt
Complete Factoring Rules in Grade 8 Math.pptComplete Factoring Rules in Grade 8 Math.ppt
Complete Factoring Rules in Grade 8 Math.pptElmabethDelaCruz2
 
matrices and determinantes
matrices and determinantes matrices and determinantes
matrices and determinantes gandhinagar
 

Ähnlich wie Applied numerical methods lec6 (20)

lecture0003-numerical-methods-topic-3-solution-of-systems-of-linear-equations...
lecture0003-numerical-methods-topic-3-solution-of-systems-of-linear-equations...lecture0003-numerical-methods-topic-3-solution-of-systems-of-linear-equations...
lecture0003-numerical-methods-topic-3-solution-of-systems-of-linear-equations...
 
algebra
algebraalgebra
algebra
 
Ch9-Gauss_Elimination4.pdf
Ch9-Gauss_Elimination4.pdfCh9-Gauss_Elimination4.pdf
Ch9-Gauss_Elimination4.pdf
 
18-21 Principles of Least Squares.ppt
18-21 Principles of Least Squares.ppt18-21 Principles of Least Squares.ppt
18-21 Principles of Least Squares.ppt
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical Methods
 
ge.ppt
ge.pptge.ppt
ge.ppt
 
Determinants. Cramer’s Rule
Determinants. Cramer’s RuleDeterminants. Cramer’s Rule
Determinants. Cramer’s Rule
 
Matrix
MatrixMatrix
Matrix
 
Linear Algebra- Gauss Elim-converted.pptx
Linear Algebra- Gauss Elim-converted.pptxLinear Algebra- Gauss Elim-converted.pptx
Linear Algebra- Gauss Elim-converted.pptx
 
Maths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K MukhopadhyayMaths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K Mukhopadhyay
 
determinants-160504230830.pdf
determinants-160504230830.pdfdeterminants-160504230830.pdf
determinants-160504230830.pdf
 
determinants-160504230830_repaired.pdf
determinants-160504230830_repaired.pdfdeterminants-160504230830_repaired.pdf
determinants-160504230830_repaired.pdf
 
lecture_note.ppt
lecture_note.pptlecture_note.ppt
lecture_note.ppt
 
7.3_Nonlinear Programming-LagrangeExamples.pptx
7.3_Nonlinear Programming-LagrangeExamples.pptx7.3_Nonlinear Programming-LagrangeExamples.pptx
7.3_Nonlinear Programming-LagrangeExamples.pptx
 
Linear Equations-Dr. Hasib.pdf
Linear Equations-Dr. Hasib.pdfLinear Equations-Dr. Hasib.pdf
Linear Equations-Dr. Hasib.pdf
 
The rules of indices
The rules of indicesThe rules of indices
The rules of indices
 
Direct solution of sparse network equations by optimally ordered triangular f...
Direct solution of sparse network equations by optimally ordered triangular f...Direct solution of sparse network equations by optimally ordered triangular f...
Direct solution of sparse network equations by optimally ordered triangular f...
 
Complete Factoring Rules.ppt
Complete Factoring Rules.pptComplete Factoring Rules.ppt
Complete Factoring Rules.ppt
 
Complete Factoring Rules in Grade 8 Math.ppt
Complete Factoring Rules in Grade 8 Math.pptComplete Factoring Rules in Grade 8 Math.ppt
Complete Factoring Rules in Grade 8 Math.ppt
 
matrices and determinantes
matrices and determinantes matrices and determinantes
matrices and determinantes
 

Mehr von Yasser Ahmed

Novel approach of bidirectional diffuser-augmented channels system for enhanc...
Novel approach of bidirectional diffuser-augmented channels system for enhanc...Novel approach of bidirectional diffuser-augmented channels system for enhanc...
Novel approach of bidirectional diffuser-augmented channels system for enhanc...Yasser Ahmed
 
Applied numerical methods lec14
Applied numerical methods lec14Applied numerical methods lec14
Applied numerical methods lec14Yasser Ahmed
 
Applied numerical methods lec13
Applied numerical methods lec13Applied numerical methods lec13
Applied numerical methods lec13Yasser Ahmed
 
Applied numerical methods lec12
Applied numerical methods lec12Applied numerical methods lec12
Applied numerical methods lec12Yasser Ahmed
 
Applied numerical methods lec11
Applied numerical methods lec11Applied numerical methods lec11
Applied numerical methods lec11Yasser Ahmed
 
Applied numerical methods lec10
Applied numerical methods lec10Applied numerical methods lec10
Applied numerical methods lec10Yasser Ahmed
 
Applied numerical methods lec9
Applied numerical methods lec9Applied numerical methods lec9
Applied numerical methods lec9Yasser Ahmed
 
Applied numerical methods lec8
Applied numerical methods lec8Applied numerical methods lec8
Applied numerical methods lec8Yasser Ahmed
 
Applied numerical methods lec5
Applied numerical methods lec5Applied numerical methods lec5
Applied numerical methods lec5Yasser Ahmed
 
Applied numerical methods lec4
Applied numerical methods lec4Applied numerical methods lec4
Applied numerical methods lec4Yasser Ahmed
 
Applied numerical methods lec3
Applied numerical methods lec3Applied numerical methods lec3
Applied numerical methods lec3Yasser Ahmed
 
Applied numerical methods lec2
Applied numerical methods lec2Applied numerical methods lec2
Applied numerical methods lec2Yasser Ahmed
 
Applied numerical methods lec1
Applied numerical methods lec1Applied numerical methods lec1
Applied numerical methods lec1Yasser Ahmed
 

Mehr von Yasser Ahmed (14)

Artificial reefs
Artificial reefsArtificial reefs
Artificial reefs
 
Novel approach of bidirectional diffuser-augmented channels system for enhanc...
Novel approach of bidirectional diffuser-augmented channels system for enhanc...Novel approach of bidirectional diffuser-augmented channels system for enhanc...
Novel approach of bidirectional diffuser-augmented channels system for enhanc...
 
Applied numerical methods lec14
Applied numerical methods lec14Applied numerical methods lec14
Applied numerical methods lec14
 
Applied numerical methods lec13
Applied numerical methods lec13Applied numerical methods lec13
Applied numerical methods lec13
 
Applied numerical methods lec12
Applied numerical methods lec12Applied numerical methods lec12
Applied numerical methods lec12
 
Applied numerical methods lec11
Applied numerical methods lec11Applied numerical methods lec11
Applied numerical methods lec11
 
Applied numerical methods lec10
Applied numerical methods lec10Applied numerical methods lec10
Applied numerical methods lec10
 
Applied numerical methods lec9
Applied numerical methods lec9Applied numerical methods lec9
Applied numerical methods lec9
 
Applied numerical methods lec8
Applied numerical methods lec8Applied numerical methods lec8
Applied numerical methods lec8
 
Applied numerical methods lec5
Applied numerical methods lec5Applied numerical methods lec5
Applied numerical methods lec5
 
Applied numerical methods lec4
Applied numerical methods lec4Applied numerical methods lec4
Applied numerical methods lec4
 
Applied numerical methods lec3
Applied numerical methods lec3Applied numerical methods lec3
Applied numerical methods lec3
 
Applied numerical methods lec2
Applied numerical methods lec2Applied numerical methods lec2
Applied numerical methods lec2
 
Applied numerical methods lec1
Applied numerical methods lec1Applied numerical methods lec1
Applied numerical methods lec1
 

Kürzlich hochgeladen

"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...Erbil Polytechnic University
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodManicka Mamallan Andavar
 
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdfPaper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdfNainaShrivastava14
 
CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfBalamuruganV28
 
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfalene1
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithmComputer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithmDeepika Walanjkar
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHSneha Padhiar
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdfHafizMudaserAhmad
 
signals in triangulation .. ...Surveying
signals in triangulation .. ...Surveyingsignals in triangulation .. ...Surveying
signals in triangulation .. ...Surveyingsapna80328
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTSneha Padhiar
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 
Turn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxTurn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxStephen Sitton
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfChristianCDAM
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewsandhya757531
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Romil Mishra
 
Industrial Applications of Centrifugal Compressors
Industrial Applications of Centrifugal CompressorsIndustrial Applications of Centrifugal Compressors
Industrial Applications of Centrifugal CompressorsAlirezaBagherian3
 

Kürzlich hochgeladen (20)

"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument method
 
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdfPaper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
Paper Tube : Shigeru Ban projects and Case Study of Cardboard Cathedral .pdf
 
CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdf
 
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithmComputer Graphics Introduction, Open GL, Line and Circle drawing algorithm
Computer Graphics Introduction, Open GL, Line and Circle drawing algorithm
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf
 
signals in triangulation .. ...Surveying
signals in triangulation .. ...Surveyingsignals in triangulation .. ...Surveying
signals in triangulation .. ...Surveying
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 
Turn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxTurn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptx
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdf
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overview
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________
 
Industrial Applications of Centrifugal Compressors
Industrial Applications of Centrifugal CompressorsIndustrial Applications of Centrifugal Compressors
Industrial Applications of Centrifugal Compressors
 

Applied numerical methods lec6

  • 3. Special Types of Square Matrices              8863916 6972 39731 16215 ][A                nna a a D  22 11 ][              1 1 1 1 ][I Symmetric Diagonal Identity                nn n n a aa aaa A][ 222 11211                   nnn aa aa a A   1 2221 11 ][ Upper Triangular Lower Triangular
  • 4. 4 Solving Systems of Equations • A linear equation in n variables: a1x1 + a2x2 + … + anxn = b • For small (n ≤ 3), linear algebra provides several tools to solve such systems of linear equations: – Graphical method – Cramer’s rule – Method of elimination • Nowadays, easy access to computers makes the solution of very large sets of linear algebraic equations possible
  • 5. n = 2: the solution is the sole intersection point of two lines n = 3: each equation represents a plane in a 3D space, and the solution is the intersection between the three planes. n > 3: the method fails to be of any practical use. Manual Solutions (n ≤ 3) 12 1 1 12 11 2 a b x a a x        22 2 1 22 21 2 a b x a a x        The Graphical Method Singular and ill-conditioned systems
  • 6. Determinants and Cramer’s Rule [A] : coefficient matrix    BxA                                 3 2 1 3 2 1 333231 232221 131211 b b b x x x aaa aaa aaa              333231 232221 131211 aaa aaa aaa A D aab aab aab x 33323 23222 13121 1  D aba aba aba x 33331 23221 13111 2  D baa baa baa x 33231 22221 11211 3  D : Determinant of A matrix
  • 7. 7 333231 232221 131211 aaa aaa aaa D               333231 232221 131211 aaa aaa aaa A     BxA  3231 2221 13 3331 2321 12 3332 2322 11AoftDeterminan aa aa a aa aa a aa aa aD  Computing the Determinant 23323322 3332 2322 11 aaaa aa aa D  22313221 3231 2221 13 23313321 3331 2321 12 aaaa aa aa D aaaa aa aa D  
  • 8. Manual Solutions (n ≤ 3) An Example 1 of Cramer’s Method
  • 9. Cramer’s Rule • For a singular system D = 0  Solution can not be obtained. • For large systems Cramer’s rule is not practical because calculating determinants is costly.
  • 10. 10 Gauss Elimination Method • Solve Ax = b • Consists of two phases: –Forward elimination –Back substitution • Forward Elimination reduces Ax = b to an upper triangular system Tx = b’ • Back substitution can then solve Tx = b’ for x                      '' 3 '' 33 ' 2 ' 23 ' 22 1131211 3333231 2232221 1131211 00 0 ba baa baaa baaa baaa baaa Forward Elimination Back Substitution 11 2123131 1 ' 22 3 ' 23 ' 2 2'' 33 '' 3 3 a xaxab x a xab x a b x     
  • 11. x1 - x2 + x3 = 6 3x1 + 4x2 + 2x3 = 9 2x1 + x2 + x3 = 7 x1 - x2 + x3 = 6 0 +7x2 - x3 = -9 0 + 3x2 - x3 = -5 x1 - x2 + x3 = 6 0 7x2 - x3 = -9 0 0 -(4/7)x3=-(8/7) -(3/1) Solve using BACK SUBSTITUTION: x3 = 2 x2=-1 x1 =3 -(2/1) -(3/7) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Example 1
  • 13.
  • 14.
  • 15. Pitfalls of Elimination Methods Division by zero It is possible that during both elimination and back-substitution phases a division by zero can occur. For example: 2x2 + 3x3 = 8 0 2 3 4x1 + 6x2 + 7x3 = -3 A = 4 6 7 2x1 + x2 + 6x3 = 5 2 1 6 Solution: pivoting (to be discussed later)
  • 16. Pitfalls (cont.) Round-off errors • A round-off error, also called rounding error, is the difference between the calculated approximation of a number and its exact mathematical value. • Because computers carry only a limited number of significant figures, round-off errors will occur and they will propagate from one iteration to the next. • This problem is especially important when large numbers of equations (100 or more) are to be solved. • Always use double-precision numbers/arithmetic. It is slow but needed for correctness! • It is also a good idea to substitute your results back into the original equations and check whether a substantial error has occurred.
  • 17. ill-conditioned systems - small changes in coefficients result in large changes in the solution. Alternatively, a wide range of answers can approximately satisfy the equations. (Well-conditioned systems – small changes in coefficients result in small changes in the solution) Problem: Since round off errors can induce small changes in the coefficients, these changes can lead to large solution errors in ill-conditioned systems. Example: x1 + 2x2 = 10 1.1x1 + 2x2 = 10.4 x1 + 2x2 = 10 1.05x1 + 2x2 = 10.4 34 2.0 )4.10(2)10(2 )1.1(2)2(1 24.10 210 2 222 121 1       x D ab ab x 18 1.0 )4.10(2)10(2 )05.1(2)2(1 24.10 210 2 222 121 1       x D ab ab x Pitfalls (cont.)
  • 18. • Surprisingly, substitution of the wrong values, x1=8 and x2=1, into the original equation will not reveal their incorrect nature clearly: x1 + 2x2 = 10 8+2(1) = 10 (the same!) 1.1x1 + 2x2 = 10.4 1.1(8)+2(1)=10.8 (close!) IMPORTANT OBSERVATION: An ill-conditioned system is one with a determinant close to zero • If determinant D=0 then there are infinitely many solutions  singular system • Scaling (multiplying the coefficients with the same value) does not change the equations but changes the value of the determinant in a significant way. However, it does not change the ill-conditioned state of the equations! DANGER! It may hide the fact that the system is ill-conditioned!! How can we find out whether a system is ill-conditioned or not? Not easy! Luckily, most engineering systems yield well-conditioned results! • One way to find out: change the coefficients slightly and recompute & compare ill-conditioned systems (cont.) –
  • 19. 19 COMPUTING THE DETERMINANT OF A MATRIX USING GAUSSIAN ELIMINATION The determinant of a matrix can be found using Gaussian elimination. Here are the rules that apply: • Interchanging two rows changes the sign of the determinant. • Multiplying a row by a scalar multiplies the determinant by that scalar. • Replacing any row by the sum of that row and any other row does NOT change the determinant. • The determinant of a triangular matrix (upper or lower triangular) is the product of the diagonal elements. i.e. D=t11t22t33 33 2322 131211 00 0 t tt ttt D 
  • 20. Techniques for Improving Solutions • Use of more significant figures – double precision arithmetic • Pivoting If a pivot element is zero, normalization step leads to division by zero. The same problem may arise, when the pivot element is close to zero. Problem can be avoided: – Partial pivoting Switching the rows below so that the largest element is the pivot element. – Complete pivoting • Searching for the largest element in all rows and columns then switching. • This is rarely used because switching columns changes the order of x’s and adds significant complexity and overhead  costly • Scaling – used to reduce the round-off errors and improve accuracy
  • 21. Pivoting • Consider this system: • Immediately run into problem: algorithm wants us to divide by zero! • More subtle version:       8 2 32 10       8 2 32 1001.0
  • 22. Pivoting • Conclusion: small diagonal elements bad • Remedy: swap in larger element from somewhere else
  • 23. Partial Pivoting • Swap rows 1 and 2: • Now continue:       8 2 32 10       2 8 10 32             2 1 10 01 2 4 10 1 2 3
  • 24. Full Pivoting • Swap largest element onto diagonal by swapping rows 1 and 2 and columns 1 and 2: • Critical: when swapping columns, must remember to swap results!       8 2 32 10       2 8 01 23
  • 25. Full Pivoting • Full pivoting more stable, but only slightly       2 8 01 23        3 2 3 8 3 2 3 2 0 1       1 2 10 01 * Swap results 1 and 2
  • 26. Example 3: Gauss Elimination 2 4 1 2 3 4 1 2 4 1 2 3 4 2 0 2 2 3 2 2 4 3 7 6 6 5 6 x x x x x x x x x x x x x                 a) Forward Elimination 0 2 0 1 0 6 1 6 5 6 2 2 3 2 2 2 2 3 2 2 1 4 4 3 0 1 7 4 3 0 1 7 6 1 6 5 6 0 2 0 1 0 R R                                 
  • 27. Example 3: Gauss Elimination (cont’d) 6 1 6 5 6 2 2 3 2 2 2 0.33333 1 4 3 0 1 7 3 0.66667 1 0 2 0 1 0 6 1 6 5 6 0 1.6667 5 3.6667 4 2 3 0 3.6667 4 4.3333 11 0 2 0 1 0 6 1 6 5 6 0 3.6667 4 4.3333 11 0 1.6667 5 3.6667 4 0 2 0 1 0 R R R R R R                                                    
  • 28. Example 3: Gauss Elimination (cont’d) 6 1 6 5 6 0 3.6667 4 4.3333 11 0 1.6667 5 3.6667 4 3 0.45455 2 0 2 0 1 0 4 0.54545 2 6 1 6 5 6 0 3.6667 4 4.3333 11 0 0 6.8182 5.6364 9.0001 0 0 2.1818 3.3636 5.9999 4 0.32000 3 6 1 6 0 3.6667 4 0 0 6.8 0 0 R R R R R R                                        5 6 4.3333 11 182 5.6364 9.0001 0 1.5600 3.1199              
  • 29. Example 3: Gauss Elimination (cont’d) b) Back Substitution 6 1 6 5 6 0 3.6667 4 4.3333 11 0 0 6.8182 5.6364 9.0001 0 0 0 1.5600 3.1199                             4 3 2 1 3.1199 1.9999 1.5600 9.0001 5.6364 1.9999 0.33325 6.8182 11 4.3333 1.9999 4 0.33325 1.0000 3.6667 6 5 1.9999 6 0.33325 1 1.0000 0.50000 6 x x x x                       
  • 30.
  • 31.
  • 33. Gauss-Jordan Elimination: Example 4                                            10 1 8 | | | 473 321 211 :MatrixAugmented 10 1 8 473 321 211 3 2 1 x x x 1 1 2 | 8 0 1 5 | 9 0 4 2| 14          R2  R2 - (-1)R1 R3  R3 - ( 3)R1 Scaling R2: R2  R2/(-1) R1  R1 - (1)R2 R3  R3-(4)R2 1 1 2 | 8 0 1 5| 9 0 4 2| 14                       22 9 17 | | | 1800 510 701 Scaling R3: R3  R3/(18)             9/11 9 17 | | | 100 510 701            222.1 888.2 444.8 | | | 100 010 001R1  R1 - (7)R3 R2  R2-(-5)R3 RESULT: x1=8.45, x2=-2.89, x3=1.23
  • 35.
  • 36.
  • 37. Motivation • The elimination method becomes inefficient when solving equations with the same coefficients [A] but different right- hand-side constants (the b’s). • The LU decomposition also provides an efficient means to compute the matrix inverse. • Gauss elimination itself can be expressed as an LU decomposition.     BXA  The LU decomposition method
  • 39. Notice that for the LU decomposition implementation of Gauss elimination, the [L] matrix has 1’s on the diagonal. This is formally referred to as a Doolittle decomposition, or factorization. An alternative approach involves a [U] matrix with 1’s on the diagonal. This is called Crout decomposition.               333231 232221 131211 aaa aaa aaa A [ U ][ L ]                     33 2322 131211 3231 21 00 0 1 01 001 u uu uuu ll l upper triangular matrix lower triangular matrix
  • 40.
  • 41. LU Decomposition by Gauss Elimination                        3 2 1 33 2322 131211 00 0 d d d X a aa aaa " ''                       3 2 1 333231 232221 131211 b b b X uaa aaa aaa 22 32 32 ' ' a a f  forward elimination [U] 11 21 21 a a f  11 31 31 a a f               33 2322 131211 00 0 " '' a aa aaa U              1 01 001 3231 21 ff fL     ULA  upper triangular matrix
  • 42. 22 32 32 ' ' a a f  11 21 21 a a f  11 31 31 a a f  U =              33 2322 131211 00 0 " '' a aa aaa U Example 6 (cont’d):
  • 46.
  • 47. CW 1: Use the LU decomposition method to solve
  • 48.
  • 49. CW 2: Use the LU decomposition method to solve
  • 50.
  • 51.
  • 52. CW 3: Solve the following system using Gauss Elimination.
  • 53.
  • 54. Jacobi Iterative Method ])([)()]([ xDAbDxxDAbDxbxDAD a a a D aaa aaa aaa AbAx                        1 33 22 11 333231 232221 131211 00 00 00 33 1 232 1 1313 3 22 1 323 1 1212 2 11 1 313 1 2121 1 a xaxab x a xaxab x a xaxab x kk k kk k kk k        * / / /                                                               3 2 1 3231 2321 1312 3 2 1 33 22 11 3 2 1 0 0 0 100 010 001 x x x aa aa aa b b b a a a x x x Choose an initial guess (i.e. all zeros) and Iterate until the equality is satisfied. No guarantee for convergence! Iterative methods provide an alternative to the elimination methods.
  • 55. Gauss-Seidel Iteration Method • The Gauss-Seidel method is a commonly used iterative method. • It is same as Jacobi technique except with one important difference: A newly computed x value (say xk) is substituted in the subsequent equations (equations k+1, k+2, …, n) in the same iteration. Example: Consider the 3x3 system below: • First, choose initial guesses for the x’s. • A simple way to obtain initial guesses is to assume that they are all zero. • Compute new x1 using the previous iteration values. • New x1 is substituted in the equations to calculate x2 and x3 • The process is repeated for x2, x3, …newold newnew new oldnew new oldold new XX a xaxab x a xaxab x a xaxab x }{}{        33 2321313 3 22 3231212 2 11 3132121 1
  • 56. 56 Convergence Criterion for Gauss-Seidel Method • Iterations are repeated until the convergence criterion is satisfied: For all i, where j and j-1 are the current and previous iterations. • As any other iterative method, the Gauss-Seidel method has problems: – It may not converge or it converges very slowly. • If the coefficient matrix A is Diagonally Dominant Gauss-Seidel is guaranteed to converge. • Note that this is not a necessary condition, i.e. the system may still have a chance to converge even if A is not diagonally dominant. sj i j i j i ia x xx  %100 1 ,   
  • 58.
  • 59.
  • 60.
  • 61.
  • 64. 2. 3.
  • 65. 4. 5. Use Gauss-Seidel method to solve the system