Docsity

Gaussian Elimination: Solving Linear Equations with Elimination and Substitution, Lecture notes of Differential Equations

Partial preview of the text

Download Gaussian Elimination: Solving Linear Equations with Elimination and Substitution and more Lecture notes Differential Equations in PDF only on Docsity!

1

Simultaneous Linear Equations

Topic: Gaussian Elimination

Gaussian Elimination

One of the most popular techniques for

solving simultaneous linear equations of the

form

Consists of 2 steps

  1. Forward Elimination of Unknowns.
  2. Back Substitution

 A  X  C

Forward Elimination

Linear Equations

A set of n equations and n unknowns

11 1 12 2 13 3 1 1

a x a x a x ... a x b

n n

21 1 22 2 23 3 2 2

a x a x a x ... a x b

n n

n n n nn n n

a x  a x  a x ... a x  b

1 1 2 2 3 3

.. .. ..

Forward Elimination

Transform to an Upper Triangular Matrix

Step 1: Eliminate x 1 in 2

nd equation using equation 1 as

the pivot equation

( )

1

21

11

a

a

Eqn  

Which will yield

1

11

21

1

11

21

12 2

11

21

21 1

... b

a

a

a x

a

a

a x

a

a

a x

n n

Forward Elimination

Repeat this procedure for the remaining

equations to reduce the set of equations as

11 1 12 2 13 3 1 1

a x a x a x ... a x b

n n

'

2

'

3 2

'

2 23

'

22

a x a x ... a x b

n n

'

3

'

3 3

'

2 33

'

32

a x a x ... a x b

n n

' '

3

'

2 3

'

2

... n n nn n n

a xa x   a xb

... ... ...

Forward Elimination

Step 2: Eliminate x 2

in the 3

rd equation.

Equivalent to eliminating x 1 in the 2

nd equation

using equation 2 as the pivot equation.

32

22

a

a

Eqn

Eqn 

Forward Elimination

Continue this procedure by using the third equation as the pivot

equation and so on.

At the end of (n-1) Forward Elimination steps, the system of

equations will look like:

'

2

'

3 2

'

2 23

'

22

a x a x ... a x b

n n

"

3

"

3

"

33

a x ... a x b n n

  

  1  ^ ^1 

n

n n

n

nn

a x b

.. .. ..

11 1 12 2 13 3 1 1

a x a x a x ... a x b

n n

Forward Elimination

At the end of the Forward Elimination steps

(n- )

n n

3

2

1

n

nn

n

n

n

b

b

b

b

x

x

x

x

a

a a

a a a

a a a a

1

"

3

'

2

1

( 1 )

"

3

"

33

'

2

'

23

'

22

11 12 13 1

Back Substitution

Start with the last equation because it has only

one unknown

( 1 )

( 1 )

n

nn

n

n

n

a

b

x

Solve the second from last equation (n-1)

th

using x n

solved for previously.

This solves for x n-

.

Back Substitution

Representing Back Substitution for all equations

by formula

   

 1 

1

1 1

 

 

i

ii

n

j i

j

i

ij

i

i

i

a
b a x
x

For i = n -1, n -2,….,

and

( 1 )

( 1 )

n

nn

n

n

n

a

b

x

Example: Rocket Velocity

Assume

v^ ^ t ^  a t  a t  a , 5  t  12.

2 3

2 1

3

2

1

3

2

3

2

2 2

1

2

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 date from the time / velocity table, 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: Rocket Velocity

Forward Elimination: Step 1

Row
Row

Yields

a
a
a

3

2

1

Example: Rocket Velocity

Yields

Row

Row

a
a
a

3

2

1

This is now ready for Back Substitution

Forward Elimination: Step 2

Example: Rocket Velocity

Back Substitution: Solve for a 3

using the third equation

3

a 

a

3

a 1. 050