CSE 245: Computer Aided Circuit Simulation and Verification

30
CSE 245: Computer Aided Circuit Simulation and Verification Matrix Computations: Iterative Methods I Chung-Kuan Cheng

description

CSE 245: Computer Aided Circuit Simulation and Verification. Matrix Computations: Iterative Methods I Chung-Kuan Cheng. Outline. Introduction Direct Methods Iterative Methods Formulations Projection Methods Krylov Space Methods Preconditioned Iterations Multigrid Methods - PowerPoint PPT Presentation

Transcript of CSE 245: Computer Aided Circuit Simulation and Verification

Page 1: CSE 245: Computer Aided Circuit Simulation and Verification

CSE 245: Computer Aided Circuit Simulation and Verification

Matrix Computations: Iterative Methods I

Chung-Kuan Cheng

Page 2: CSE 245: Computer Aided Circuit Simulation and Verification

2

Outline IntroductionDirect Methods Iterative Methods Formulations Projection Methods Krylov Space Methods Preconditioned Iterations Multigrid Methods Domain Decomposition Methods

Page 3: CSE 245: Computer Aided Circuit Simulation and Verification

3

Introduction

Direct MethodLU Decomposition

Iterative Methods

Jacobi

Gauss-Seidel

Conjugate GradientGMRES

Multigrid

Domain Decomposition

PreconditioningGeneral and Robust but can be complicated ifN>= 1M

Excellent choice for SPD matricesRemain an art for arbitrary matrices

Page 4: CSE 245: Computer Aided Circuit Simulation and Verification

Introduction: Matrix Condition

4

Ax=bWith errors, we have

(A+eE)x(e)=b+edThus, the deviation isx(e)-x=e(A+eE)-1(d-Ex)|x(e)-x|/|x| <= e|A-1|(|d|/|x|+|E|)+O(e) <= e|A||A-1|(|d|/|b|+|E|/|A|)+O(e)We define the matrix condition as

K(A)=|A||A-1|, i.e.

|x(e)-x|/|x|<=K(A)(|ed|/|b|+|eE|/|A|)

Page 5: CSE 245: Computer Aided Circuit Simulation and Verification

Introduction: Gershgorin Circle Theorem

5

For all eigenvalues r of matrix A, there exists an i such that |r-aii|<= sumi=!j |aij|Proof: Given r and eigenvector V s.t. AV=rVLet vi>= vj for all j=!i, we have

sumj aijvj = rvi

Thus (r-aii)vi= sumj=!i aijvj

r-aii=(sumj=!i aij vj)/vi

Therefore|r-aii|<= sumj=!i |aij|

Note if equality holds then for all i, |vi| are equal.

Page 6: CSE 245: Computer Aided Circuit Simulation and Verification

6

Iterative Methods

Stationary: x(k+1) =Gx(k)+cwhere G and c do not depend on iteration

count (k)

Non Stationary:x(k+1) =x(k)+akp(k)

where computation involves information that change at each iteration

Page 7: CSE 245: Computer Aided Circuit Simulation and Verification

7

In the i-th equation solve for the value of xi while assuming the other entries of x remain fixed:

In matrix terms the method becomes:

where D, -L and -U represent the diagonal, the strictly lower-trg and strictly upper-trg parts of M

M=D-L-U

ii

ijjiji

i

N

jijij m

xmb

xbxm

1 ii

ij

kjiji

ki m

xmb

x

)1(

)(

bDxULDx kk 111)(

Stationary: Jacobi Method

Page 8: CSE 245: Computer Aided Circuit Simulation and Verification

8

Like Jacobi, but now assume that previously computed results are used as soon as they are available:

In matrix terms the method becomes:

where D, -L and -U represent the diagonal, the strictly lower-trg and strictly upper-trg parts of M

M=D-L-U

ii

ijjiji

i

N

jijij m

xmb

xbxm

1 ii

ij

kjij

ij

kjiji

ki m

xmxmb

x

)1()(

)(

)( 11)( bUxLDx kk

Stationary-Gause-Seidel

Page 9: CSE 245: Computer Aided Circuit Simulation and Verification

9

Devised by extrapolation applied to Gauss-Seidel in the form of weighted average:

In matrix terms the method becomes:

where D, -L and -U represent the diagonal, the strictly lower-trg and strictly upper-trg parts of M

M=D-L-U

ii

ij

kjij

ij

kjiji

ki m

xmxmb

x

)1()(

)(

bwLDwxDwwUwLDx kk 111)( )())1((

)1()()( )1( ki

ki

ki xwxwx

Stationary: Successive Overrelaxation (SOR)

Page 10: CSE 245: Computer Aided Circuit Simulation and Verification

SOR Choose w to accelerate the convergence

W =1 : Jacobi / Gauss-Seidel 2>W>1: Over-Relaxation W < 1: Under-Relaxation

)1()()( )1( ki

ki

ki xwxwx

Page 11: CSE 245: Computer Aided Circuit Simulation and Verification

Convergence of Stationary Method Linear Equation: MX=b A sufficient condition for convergence of the

solution(GS,Jacob) is that the matrix M is diagonally dominant.

If M is symmetric positive definite, SOR converges for any w (0<w<2)

A necessary and sufficient condition for the convergence is the magnitude of the largest eigenvalue of the matrix G is smaller than 1

Jacobi: Gauss-Seidel SOR:

N

ijjjiii mm

&1,

ULDG 1

ULDG 1)(

))1((1 DwwUwLDG

Page 12: CSE 245: Computer Aided Circuit Simulation and Verification

Convergence of Gauss-Seidel

Eigenvalues of G=(D-L)-1LT is inside a unit circle

Proof: G1=D1/2GD-1/2=(I-L1)-1L1

T, L1=D-1/2LD-1/2

Let G1x=rx we have

L1Tx=r(I-L1)x

xL1Tx=r(1-xTL1x)

y=r(1-y) r= y/(1-y), |r|<= 1 iff Re(y) <= ½.Since A=D-L-LT is PD, D-1/2AD-1/2 is PD,1-2xTL1x >= 0 or 1-2y>= 0, i.e. y<= ½.

Page 13: CSE 245: Computer Aided Circuit Simulation and Verification

Linear Equation: an optimization problem

Quadratic function of vector x

Matrix A is positive-definite, if for any nonzero vector x

If A is symmetric, positive-definite, f(x) is minimized by the solution bAx

cxbAxxxf TT 21)(

0AxxT

Page 14: CSE 245: Computer Aided Circuit Simulation and Verification

Linear Equation: an optimization problem

Quadratic function

Derivative

If A is symmetric

If A is positive-definite is minimized by setting to 0

cxbAxxxf TT 21)(

bAxxAxf T 21

21)(

bAxxf )(

)(xf )(xf

bAx

Page 15: CSE 245: Computer Aided Circuit Simulation and Verification

15

For symmetric positive definite matrix A

Page 16: CSE 245: Computer Aided Circuit Simulation and Verification

16

Gradient of quadratic form

The points in the direction of steepest increase of f(x)

Page 17: CSE 245: Computer Aided Circuit Simulation and Verification

If A is symmetric positive definite P is the arbitrary point X is the solution point

Symmetric Positive-Definite Matrix A

bAx 1

)()()()( 21 xpAxpxfpf T

0)()(21 xpAxp T

since

)()( xfpf We have,

If p != x

Page 18: CSE 245: Computer Aided Circuit Simulation and Verification

18

If A is not positive definite

a) Positive definite matrix b) negative-definite matrix c) Singular matrix d) positive indefinite matrix

Page 19: CSE 245: Computer Aided Circuit Simulation and Verification

Non-stationary Iterative Method State from initial guess x0, adjust it until

close enough to the exact solution

How to choose direction and step size?

)()()()1( iiii paxx i=0,1,2,3,……

)(ip

)(iaAdjustment Direction

Step Size

Page 20: CSE 245: Computer Aided Circuit Simulation and Verification

Steepest Descent Method (1)

)()()( )( iii rAxbxf

Choose the direction in which f decrease most quickly: the direction opposite of

Which is also the direction of residue

)( )(ixf

)()()()1( iiii raxx

Page 21: CSE 245: Computer Aided Circuit Simulation and Verification

Steepest Descent Method (2)

How to choose step size ? Line Search should minimize f, along the direction

of , which means 0)( )1( idad xf

0)()()( )()1()1()1()1( iT

iidadT

iidad rxfxxfxf

)()(

)()(

)(

)()()()()(

)()()()(

)()1(

)()1(

)()(

0))((

0)(

0

iT

i

iT

i

Arr

rr

i

iT

iiiT

i

iT

iii

iT

i

iT

i

a

rArarAxb

rraxAb

rAxb

rr

)(ir)(ia

Orthogonal

Page 22: CSE 245: Computer Aided Circuit Simulation and Verification

Steepest Descent Algorithm

)()()()1(

)(

)()(

)()(

)()(

iiii

Arr

rr

i

ii

raxx

a

Axbr

iT

i

iT

i

Given x0, iterate until residue is smaller than error tolerance

Page 23: CSE 245: Computer Aided Circuit Simulation and Verification

23

Steepest Descent Method: example

8

2

62

23

2

1

x

x

a) Starting at (-2,-2) take thedirection of steepest descent of f

b) Find the point on the intersec-tion of these two surfaces that minimize f

c) Intersection of surfaces.

d) The gradient at the bottommostpoint is orthogonal to the gradientof the previous step

Page 24: CSE 245: Computer Aided Circuit Simulation and Verification

24

Iterations of Steepest Descent Method

Page 25: CSE 245: Computer Aided Circuit Simulation and Verification

Convergence of Steepest Descent-1

k

v Tk ]0,0,0,,1,,0,0,0[ let

n

jjji ve

1)( Eigenvector:

2/1)( Aeee T

AEnergy norm:

EigenValue:j j=1,2,…,n

Page 26: CSE 245: Computer Aided Circuit Simulation and Verification

Convergence of Steepest Descent-2

))((

)(

1,

))((

)(

1))((

)(1

)()()(2

2

)()(

232

222

222

)(

232

222

2

)()()()()(

2)()(2

)(

)()(

2)()(2

)()()(2

)()(

)()()()(

)()(

)()(2

)(

)()(2)()()()()()(

)()()()()()(

)1()1(

2

)1(

jjj

jjj

jjj

Ai

jjj

jjj

jjj

Aii

Tii

Ti

iTi

Ai

iTi

iTi

AiiTi

iTi

iTi

iTi

iTi

iTi

Ai

iTiii

Tiii

Ti

iiiTii

Ti

iTiAi

e

eAeeArr

rre

Arr

rreArr

Arr

rrrr

Arr

rre

ArraAeraAee

raeArae

Aeee

Page 27: CSE 245: Computer Aided Circuit Simulation and Verification

Convergence Study (n=2)

assume21

let21 /k Spectral condition number

2

1)(

jjji ve let 12 /u

))((

)(1

))((

)(1

232

222

32

22

31

212

221

21

222

22

21

212

ukuk

uk

Page 28: CSE 245: Computer Aided Circuit Simulation and Verification

28

Plot of w

Page 29: CSE 245: Computer Aided Circuit Simulation and Verification

29

Case Study

Page 30: CSE 245: Computer Aided Circuit Simulation and Verification

30

Bound of Convergence

1

1

)1(

)1(

2

41

))((

)(1

2

2

345

4

232

2222

k

k

k

k

kkk

k

ukuk

uk

It can be proved that it is also valid for n>2, where

minmax /k