Docsity

Gaussian Elimination - Numerical Methods - Lecture Slides, Slides of Mathematical Methods for Numerical Analysis and Optimization

Partial preview of the text

Download Gaussian Elimination - Numerical Methods - Lecture Slides and more Slides Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Gaussian Elimination

Naïve Gaussian Elimination

A method to solve simultaneous linear

equations of the form [A][X]=[C]

Two steps

1. Forward Elimination

2. Back Substitution

Forward Elimination

A set of n equations and n unknowns

a 11 x 1 + a 12 x 2 + a 13 x 3 +... + a 1 n xn = b 1

a 21 x 1 + a 22 x 2 + a 23 x 3 +... + a 2 n xn = b 2

an 1 x 1 + an 2 x 2 + an 3 x 3 +...+ annxn = b n

.. .. ..

(n-1) steps of forward elimination

Forward Elimination

Step 1

For Equation 2, divide Equation 1 by and

multiply by.

11

21 a x a x a x a x b

a

a  + + + + n n =

a 21 (^) x 1 + aa 1121 a 12 x 2 +... + aa 1121 a 1 n xn = aa 1121 b 1

a 11

a 21

Forward Elimination

Repeat this procedure for the remaining

equations to reduce the set of equations as

a 11 x 1 + a 12 x 2 + a 13 x 3 +... + a 1 n xn = b 1 '

a 22 ' x 2 + a 23 ' x 3 +... + a 2 ' n xn = b (^2) ' a 32 ' x 2 + a 33 ' x 3 +... + a 3 ' n xn = b 3

an ' 2 x 2 + an ' 3 x 3 +... + ann ' xn = bn^ '

.. .. .. ...

End of Step 1

Step 2

Repeat the same procedure for the 3rd^ term of

Equation 3.

Forward Elimination

a 11 x 1 + a 12 x 2 + a 13 x 3 +... + a 1 n xn = b 1

a 22 ' x 2 + a 23 ' x 3 +... + a 2 ' n xn = b 2 '

a 33 " x 3 +... + a 3 " n xn = b 3 "

an " 3 x 3 +... + ann " xn = bn^ "

.. ..

..

End of Step 2

Matrix Form at End of Forward Elimination

=

− (^) n(n- )

"

'

nn(n ) n

" "n

' ' ' nn

b

b

b

b

x

x

x

x

a

a a

a a a

a a a a

1

3

2

1

3

2

1

1

33 3

22 23 2

11 12 13 1

0 0 0 0

0 0

0

      

Back Substitution

3

2

1

x

x

x

Solve each equation starting from the last equation

Example of a system of 3 equations

Back Substitution

Start with the last equation because it has only one unknown

( 1 )

( 1 ) −

−

= n

nn

nn

n a

x b

Back Substitution

( ) ( ) ( ) ( )

( ) for^1 ,...,^1

1

(^1) , (^111) , (^122) , 1

− −+ + −+ + −

x b a x aai x a x i n

ii i ii iii i iii i iin n ( ) ( )

( 11 ) for^1 ,...,^1

1 1

− −

a i^ n

b a x

x i

ii

n j i j ii iji i

( 1 )

( 1 ) −

−

= n

nn

nn

n a

x b

Example 1 Cont.

v ( ) t = a 1 t^2 + a 2 t + a 3 , 5 ≤ t ≤ 12.

Assume



 

 

 



 

 

 

 

 

 

 

 3

2

1 32 3

22 2

12 1 1

1

1 v

v

v a

a

a t t

t t

t t 3

2

1

Results in a matrix template of the form:

Using data from Table 1, the matrix becomes:



 

 

 



 

 

 

 

 

 

 

  1. 2

  2. 2

  3. 8 144 12 1

64 8 1

25 5 1 3

2

1 a

a

a

Example 1 Cont.

3

2

1 .

a

a

a

  1. Forward Elimination
    1. Back Substitution

Number of Steps of Forward Elimination

Number of steps of forward elimination is ( n −1)=(3−1)= 2

Divide Equation 1 by 25 and multiply it by 64,.

Forward Elimination: Step 1



 



 

144 12 1 279. 2

64 8 1 177. 2

25 5 1 106. 8 

.

[ 25 5 1  106. 8 ] × 2. 56 =[ 64 12. 8 2. 56  273. 408 ]

[ ]

[ ]

[ 0 4. 8 1. 56 96. 208 ]

64 12. 8 2. 56 273. 408

64 8 1 177. − − −

− 



 

 

 

 − − − 144 12 1 279. 2

0 4. 8 1. 56 96. 208

25 5 1 106. 8 

(^6425) = 2. 56

Subtract the result from Equation 2

Substitute new equation for Equation 2