+ All Categories
Home > Documents > ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of...

ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of...

Date post: 21-Dec-2015
Category:
View: 224 times
Download: 0 times
Share this document with a friend
Popular Tags:
26
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations
Transcript
Page 1: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

ECIV 301

Programming & Graphics

Numerical Methods for Engineers

Lecture 15

Solution of Systems of Equations

Page 2: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Objectives

• Introduction to Matrix Algebra

• Express System of Equations in Matrix Form

• Introduce Methods for Solving Systems of Equations

• Advantages and Disadvantages of each Method

Page 3: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time Linear Equations in Matrix Form

10z8y3x5

6z3yx12

24z23y6x10

Page 4: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

23610

3112

835

z

y

x

24

6

10 10

z

y

x

835

6

z

y

x

3112

24

z

y

x

23610

# Equations = # Unknowns = n

Square Matrix n x n

Page 5: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time Solution of Linear Equations

10

7

9

500

310

835

z

y

x

Express In Matrix Form

Upper Triangular

What is the characteristic?

Solution by Back Substitution

Page 6: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time Solution of Linear Equations

Objective

Can we express any system of equations in a form

nnnn

n

n

n

b

b

b

b

x

x

x

x

a

aa

aaa

aaaa

3

2

1

3

2

1

333

22322

1131211

000

00

0

0

Page 7: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time Background

Consider

1035 yx(Eq 1)

5810 yx(Eq 2)

Solution

5.7

5.6

y

x

20610 yx2*(Eq 1)

5810 yx(Eq 2)

Solution

5.7

5.6

y

x!!!!!!

Scaling Does Not Change the SolutionScaling Does Not Change the Solution

Page 8: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time Background

Consider

20610 yx(Eq 1)

152 y(Eq 2)-(Eq 1)

Solution

5.7

5.6

y

x!!!!!!

20610 yx(Eq 1)

5810 yx(Eq 2)

Solution

5.7

5.6

y

x

Operations Do Not Change the SolutionOperations Do Not Change the Solution

Page 9: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time Gauss Elimination

10835 zyx

2423610 zyx

6312 zyx

Example

Forward Elimination

Page 10: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time-Correction Gauss Elimination

10835 zyx

24z23y6x10

zyx 835

5

1210

5

12

6312 zyx

-

305

81

5

310 zyx 302.162.60 zyx

Page 11: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time-Correction Gauss Elimination

10835 zyx

24z23y6x10

6312 zyx 302.162.60 zyx

Substitute 2nd eq with new

Page 12: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time-Correction Gauss Elimination

10835 zyx

24z23y6x10

302.162.60 zyx

zyx 835

5

1010

5

10-

439120 zyx

Page 13: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time-Correction Gauss Elimination

10835 zyx

24z23y6x10

302.162.60 zyx

Substitute 3rd eq with new

439120 zyx

Page 14: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time-Correction Gauss Elimination

10835 zyx

302.162.60 zyx

439120 zyx

zy 2.162.6

2.6

12 30

2.6

12-

064.62645.700 zyx

Page 15: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time-Correction Gauss Elimination

10835 zyx

30970 zyx

Substitute 3rd eq with new

439120 zyx 064.62645.700 zyx

Page 16: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time-Correction Gauss Elimination

064.62

30

10

645.700

2.162.60

835

z

y

x

Page 17: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time Gauss Elimination

Forward Elimination

064.62

30

10

645.700

2.162.60

835

z

y

x

Page 18: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Last Time-Correction Gauss Elimination

Back Substitution

118.8645.7/064.62 z

0502.26

2.6

118.82.1630

y

6413.0

5

118.880502.26310

x

064.62

30

10

645.700

2.162.60

835

z

y

x

Page 19: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Gauss Elimination – Potential Problem

10830 zyx

2423610 zyx

6312 zyx

Forward Elimination

Page 20: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Gauss Elimination – Potential Problem

10830 zyx

2423610 zyx

6312 zyx

0

12 Division By Zero!!Operation Failed

Page 21: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Gauss Elimination – Potential Problem

10830 zyx

2423610 zyx

6312 zyx

12

0OK!!

Page 22: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Gauss Elimination – Potential Problem

10830 zyx

2423610 zyx

6312 zyx

Pivoting

6312 zyx

10830 zyx

Page 23: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Partial Pivoting

nn

nnnnn

lll

n

n

n

b

b

b

b

x

x

x

x

aaaa

aaaa

aaaaaaaa

aaaa

3

2

1

3

2

1

321

ln321

3333231

2232221

1131211

a32>a22

al2>a22

NO

YES

Page 24: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Partial Pivoting

nn

nnnnn

n

n

lll

n

b

b

b

b

x

x

x

x

aaaa

aaaa

aaaaaaaa

aaaa

3

2

1

3

2

1

321

2232221

3333231

ln321

1131211

Page 25: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

Full Pivoting

• In addition to row swaping

• Search columns for max elements

• Swap Columns

• Change the order of xi

• Most cases not necessary

Page 26: ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.

EXAMPLE

We will work directly on the coefficient matrix


Recommended