0 Up votes0 Down votes

52 views29 pagesJacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Sep 17, 2013

© Attribution Non-Commercial (BY-NC)

PDF, TXT or read online from Scribd

Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Attribution Non-Commercial (BY-NC)

52 views

Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Attribution Non-Commercial (BY-NC)

- The Woman Who Smashed Codes: A True Story of Love, Spies, and the Unlikely Heroine who Outwitted America's Enemies
- Steve Jobs
- NIV, Holy Bible, eBook
- NIV, Holy Bible, eBook, Red Letter Edition
- Hidden Figures Young Readers' Edition
- Cryptonomicon
- Console Wars: Sega, Nintendo, and the Battle that Defined a Generation
- Make Your Mind Up: My Guide to Finding Your Own Style, Life, and Motavation!
- The Golden Notebook: A Novel
- Alibaba: The House That Jack Ma Built
- Hit Refresh: The Quest to Rediscover Microsoft's Soul and Imagine a Better Future for Everyone
- Hit Refresh: The Quest to Rediscover Microsoft's Soul and Imagine a Better Future for Everyone
- Autonomous: A Novel
- The 10X Rule: The Only Difference Between Success and Failure
- Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are
- Life After Google: The Fall of Big Data and the Rise of the Blockchain Economy

You are on page 1of 29

of Software Packages

Mike Renfro

February 20, 2008

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Outlines

Part I: Review of Previous Lecture

Part II: Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Review of Previous Lecture

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Outlines

Part I: Review of Previous Lecture

Part II: Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi and Gauss-Seidel Iteration Methods, Use of

Software Packages

Jacobi Iteration Method

Introduction

Example

Notes on Convergence Criteria

Gauss-Seidel Iteration Method

Introduction

Example

Use of Software Packages

MATLAB

Excel

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Part I

Review of Previous Lecture

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Review of Previous Lecture

Cramers Rule

Gauss Elimination

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Part II

Jacobi and Gauss-Seidel Iteration Method, Use of

Software Packages

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Notes on Convergence Criteria

Jacobi Iteration Method: Introduction

Consider a system of equations in algebraic form

a

11

x

1

+ a

12

x

2

+ a

13

x

3

+ a

14

x

4

+ + a

1n

x

n

=b

1

a

21

x

1

+ a

22

x

2

+ a

23

x

3

+ a

24

x

4

+ + a

2n

x

n

=b

2

a

31

x

1

+ a

32

x

2

+ a

33

x

3

+ a

34

x

4

+ + a

3n

x

n

=b

3

a

41

x

1

+ a

42

x

2

+ a

43

x

3

+ a

44

x

4

+ + a

4n

x

n

=b

4

.

.

.

a

n1

x

1

+ a

n2

x

2

+ a

n3

x

3

+ a

n4

x

4

+ + a

nn

x

n

=b

n

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Notes on Convergence Criteria

Jacobi Iteration Method: Introduction

These n equations can be rewritten to isolate an unknown on one

side of each equation:

x

1

=

1

a

11

(b

1

a

12

x

2

a

13

x

3

a

14

x

4

a

1n

x

n

)

x

2

=

1

a

22

(b

2

a

21

x

1

a

23

x

3

a

24

x

4

a

2n

x

n

)

x

3

=

1

a

33

(b

3

a

31

x

1

a

32

x

2

a

34

x

4

a

3n

x

n

)

x

4

=

1

a

44

(b

4

a

41

x

1

a

42

x

2

a

43

x

3

a

4n

x

n

)

.

.

.

x

n

=

1

a

nn

(b

n

a

n1

x

1

a

n2

x

2

a

n3

x

3

a

n,n1

x

n1

)

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Notes on Convergence Criteria

So Whats the Point?

It looks like all weve done at this point is some useless algebraic

manipulations. But if we substitute some assumed starting values

for x

1

, x

2

, , x

n

on the right hand side of each of the rewritten

equations, well get a new set of x

i

values on the left hand side. If

we repeat the process, substituting the just-calculated x values

into the right hand side of the equations, we should get closer and

closer to the actual values of x that solve the equations.

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Notes on Convergence Criteria

Example

Example 3.19 (p.184) Solve the following system of equations

using the Jacobi iteration method with an initial guess of x

i

= 0:

5x

1

x

2

+ 2x

3

=1

2x

1

+ 6x

2

3x

3

=2

2x

1

+ x

2

+ 7x

3

=32

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Notes on Convergence Criteria

Example

Step 1: reformat the equations, solving the rst one for x

1

, the

second for x

2

, and the third for x

3

:

x

1

=

1

5

(1 + x

2

2x

3

)

x

2

=

1

6

(2 2x

1

+ 3x

3

)

x

3

=

1

7

(32 2x

1

x

2

)

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Notes on Convergence Criteria

Example

Step 2: Substitute the initial guesses for x

i

into the right-hand side

of the equations:

x

1

=

1

5

(1 + 0 2 (0))

x

2

=

1

6

(2 2 (0) + 3 (0))

x

3

=

1

7

(32 2 (0) (0))

x

(2)

1

= 0.2000

x

(2)

2

=0.3333

x

(2)

3

=4.5714

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Notes on Convergence Criteria

Example

Step 3: Substitute the calculated values for for x

i

into the

right-hand side of the equations:

x

1

=

1

5

(1 + 0.3333 2 (4.5714))

x

2

=

1

6

(2 2 (0.2000) + 3 (4.5714))

x

3

=

1

7

(32 2 (0.2000) (0.3333))

x

(3)

1

=1.5619

x

(3)

2

=2.6857

x

(3)

3

=4.5810

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Notes on Convergence Criteria

Example

Step 4, 5, : Continue substituting x

i

values into the right-hand

side of the equations and watch for them to converge to nal

values:

Iteration number x

1

x

2

x

3

1 0.0000 0.0000 0.0000

2 -0.2000 0.3333 4.5714

3 1.5619 2.6857 4.5810

4 1.0952 2.1032 3.7415

5 0.8760 1.8390 3.9580

6 1.0154 2.0204 4.0584

7 1.0193 2.0241 3.9927

8 0.9923 1.9899 3.9910

9 0.9984 1.9981 4.0037

10 1.0018 2.0023 4.0007

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Notes on Convergence Criteria

Notes on Convergence Criteria

Like many of the iterative root-nding methods in Chapter 2, the

Jacobi iteration method is not guaranteed to converge on the exact

answer in every possible case and every possible initial guess.

However, if the equations in the system are diagonally dominant,

then the Jacobi iteration method is guaranteed to converge

regardless of the starting guess for x.

Diagonal dominance is dened as the condition where the

coecient along the diagonal on any row is larger in absolute value

than the sum of the absolute values of the other coecients on the

same row.

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Notes on Convergence Criteria

Is Example 3.19 Diagonally Dominant?

5x

1

x

2

+ 2x

3

=1

2x

1

+ 6x

2

3x

3

=2

2x

1

+ x

2

+ 7x

3

=32

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Notes on Convergence Criteria

Is Example 3.19 Diagonally Dominant?

_

_

5 1 2

2 6 3

2 1 7

_

_

_

_

_

x

1

x

2

x

3

_

_

_

=

_

_

_

1

2

32

_

_

_

| 5| > | 1| + |2|

|6| > |2| + | 3|

|7| > |2| + |1|

Yes, this system of equations is diagonally dominant. We will

converge to the exact solution regardless of the values of x

i

we

start with.

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Gauss-Seidel Iteration: Introduction

Gauss-Seidel iteration is similar to Jacobi iteration, except that

new values for x

i

are used on the right-hand side of the equations

as soon as they become available. It improves upon the Jacobi

method in two respects:

Convergence is quicker, since you benet from the newer,

more accurate x

i

values earlier.

Memory requirements are reduced by 50%, since you only

need to keep track of one set of x

i

values, not two sets.

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Example

Example 3.20 (p.186) Solve the following system of equations

using the Gauss-Seidel iteration method with an initial guess of

x

i

= 0:

5x

1

x

2

+ 2x

3

=1

2x

1

+ 6x

2

3x

3

=2

2x

1

+ x

2

+ 7x

3

=32

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Example

Step 1: reformat the equations, solving the rst one for x

1

, the

second for x

2

, and the third for x

3

:

x

1

=

1

5

(1 + x

2

2x

3

)

x

2

=

1

6

(2 2x

1

+ 3x

3

)

x

3

=

1

7

(32 2x

1

x

2

)

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Example

Step 2a: Substitute the initial guesses for x

i

into the right-hand

side of the rst equation:

x

(2)

1

=

1

5

(1 + 0 2 (0)) = 0.2000

Step 2b: Substitute the new x

1

value with the initial guess for x

3

into the second equation:

x

(2)

2

=

1

6

(2 2 (0.2000) + 3 (0)) = 0.4000

Step 2c: Substitute the new x

1

and x

2

values into the third

equation:

x

(2)

3

=

1

7

(32 2 (0.2000) (0.4000)) = 4.5714

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

Introduction

Example

Example

Step 3, 4, : Repeat step 2 and watch for the x

i

values to

converge to an exact solution.

Iteration number x

1

x

2

x

3

1 0.0000 0.0000 0.0000

2 -0.2000 0.4000 4.5714

3 1.5486 2.1029 3.8286

4 0.9109 1.9440 4.0335

5 1.0246 2.0085 3.9918

6 0.9950 1.9975 4.0018

7 1.0012 2.0005 3.9996

8 0.9997 1.9999 4.0001

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

MATLAB

Excel

Example 3.27

Find the solution to the following system of equations:

_

_

4 1 1 0

1 4 0 1

1 0 4 1

0 1 1 4

_

_

_

_

x

1

x

2

x

3

x

4

_

_

=

_

_

200

400

0

200

_

_

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

MATLAB

Excel

MATLAB Setup

>> A=[-4 1 1 -0; 1 -4 0 1; 1 0 -4 1; 0 1 1 -4]

A =

-4 1 1 0

1 -4 0 1

1 0 -4 1

0 1 1 -4

>> b=[ -200; -400; 0; -200]

b =

-200

-400

0

-200

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

MATLAB

Excel

2 MATLAB Solutions

>> x=inv(A)*b

x =

100.0000

150.0000

50.0000

100.0000

>> x=A\b

x =

100.0000

150.0000

50.0000

100.0000

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

MATLAB

Excel

Example 3.29 (Corrected)

Use MATLAB to nd the inverse of the matrix [A] given by

[A] =

_

_

1

1

2

1

3

1

n

1

2

1

3

1

4

1

n+1

1

3

1

4

1

5

1

n+2

.

.

.

.

.

.

.

.

.

.

.

.

1

n

1

n+1

1

n+2

1

2n1

_

_

, n = 50

and nd the error in the inverse matrix by calculating

[C] = [A][A]

1

and summing up the absolute values of the matrix

elements. If there was no error at all, the sum would be n.

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

MATLAB

Excel

MATLAB Solution 1

>> A=hilb (50);

>> result=inv(A)*A;

Warning: Matrix is close to singular or badly scaled.

Results may be inaccurate. RCOND = 1.603366e -020.

>> err=sum(abs(result (:)))

err =

7.3886e+011

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

MATLAB

Excel

MATLAB Solution 2

>> A=hilb (50);

>> result=A\A;

Warning: Matrix is close to singular or badly scaled.

Results may be inaccurate. RCOND = 1.603366e -020.

>> err=sum(abs(result (:)))

err =

192.9856

>>

The error on this version is much, much lower. This is why we

dont use the inv() function on ill-conditioned matrices.

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

Jacobi Iteration Method

Gauss-Seidel Iteration Method

Use of Software Packages

MATLAB

Excel

Excel

Microsoft Excel can also do matrix inversion, but its a bit

cumbersome. However, if its the only tool you have at some

point, its better than nothing. See the the matrix inversion.xls

le located with the lecture slides on the web.

Mike Renfro Jacobi and Gauss-Seidel Iteration Methods, Use of Software Packages

- Pre-Algebra Multi StepUploaded byDiane Mendez
- CBNST_1Uploaded byVibhu_Rastogi_4699
- Ubd Unit PlanUploaded byEllen
- Soluci__n-al-Flujo-de-Potencias-mediante-el-M__todo-de-Gauss.docxUploaded byEmmanuel Cordoba Ramirez
- Matrix Inverse and TransposeUploaded byAmit Shukla
- 6th period pre and post testsUploaded byapi-316781445
- 4.2 Algebraic Properties of Inverses.docUploaded bySusilo Wati
- equivqlent.pdfUploaded byWoon Bing
- Reflection paper_TravelUploaded byKristopher Archie Plaquia
- Tomographic ResolutionUploaded bysatyam mehta
- Complexity of MIMOUploaded byHuy Phạm
- Noise level estimation using SVDUploaded byVineeth Kumar
- 2018 maths olympaid.docxUploaded byHarminder Sangha
- 04 MatricesUploaded bychehor
- Matrices and VectorsUploaded byIzza
- Ch 2 Linear Equations 11Uploaded byzhero7
- Gauss Elimination NotesUploaded bynavin shukla
- 08_02.pdfUploaded byIrmala Ayu
- Sing ValueUploaded byTruong Cai
- MECH0801 Wk 03 Excel LecUploaded byThitaphol Huyanan
- PDF2Uploaded byboom_ittipat
- Matlab LAB1Uploaded byAngre Knight
- MatricesUploaded byAli Subhan
- ALGEBRA - Kinds of Functions.pdfUploaded bysmpaderna78
- hopfield netwokUploaded byAli Ezzat
- Assignment 1Uploaded bylaura
- Tech WorkUploaded bySushainSharma
- s mat k2 tspm09Uploaded byTeacher
- Java matrixUploaded byRodrigo Daza
- Representations and characters of groupsUploaded byNikola Komarcevski

- swot3Uploaded byMohd HelmiHazim
- Miet 2394 Cfd Lecture 7(1)Uploaded bycepong89
- Three Approaches Interests Rights & Power (Reading 1-2)Uploaded byZoe Jen Rodriguez
- the holocaust research projectUploaded byapi-312488394
- What is learning curveUploaded byTaltson Sunny
- Autocal Company ProfileUploaded byRonit Shirsat
- Are We Ready to Get on the Chariot Sermon and Outline by Charles a. YawnUploaded byCharles A. Yawn
- space research packetUploaded byapi-252135330
- OBLBoardLawsuitUploaded byNye Lavalle
- Meta Language notes (VCE)Uploaded byAtif
- Japanese Studies in the Ibero-American ContextUploaded byAmaury A. Garcia Rodriguez
- UoR Module 1 Unit 2 2015-0515 Shared Activities Pygmalion EffectUploaded byvhin84
- The Future of Brain-Computer Interfaces_ Blockchaining Your Way Into a CloudmindUploaded bypressorg
- DAFTAR PASIEN RUJUKAN 2017.xlsxUploaded byAnonymous wg0qhzPTnw
- 3_Jurassic.pdfUploaded byLaw
- Performance Task in GRASPS Form TLEUploaded byELENA JAMITO
- Capitalism as a Bearer of the Uncanny: An Interview with Michael Ashkin | #ASXUploaded byAnonymous qtQ2aQWfDT
- Renesas Sensorless Vector Control (Pag 13)Uploaded byrusuraduionel22
- Teach English Intonation in Discourse ApproachUploaded byHường Nguyễn
- 10 Elements of a Great StrategyUploaded bySrikanth Srinivas
- Mutual Coupling Reduction between Microstip Antennas Usingcomplementary Split Spiral Resonators (Cssrs)Uploaded byIOSRjournal
- RooFit Users Manual 2.91-33Uploaded byGica Joe
- Anatomy and Physiology of ReligionUploaded byDr.Sanat trivedi
- Smit HersUploaded byElizabeth Gay
- tarasewiczstandardizedtestingop-edUploaded byapi-223233249
- United States v. Roy C. Ames, 743 F.2d 46, 1st Cir. (1984)Uploaded byScribd Government Docs
- drug studyUploaded byudntnid2knwme
- Unifier Administration guideUploaded bySaurav Singh
- ArabIslamicNamesUploaded byfaheemfriends7984
- 24.-Clarificatory-en-banc-resolution-GR-No-83896-and-83815.docxUploaded byJohn Robert Bautista

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.