Download presentation

Presentation is loading. Please wait.

Published byNathaniel Wetherell Modified about 1 year ago

1
Linear System Remark: (1) has a unique solution We want to solve the following linear system A is invertable Remark: A is invertable det(A)=0 Remark: A is invertable Example: Solve:

2
Linear System We want to solve the following linear system Remark: A is invertable Rank(A)=n Remark:

3
Linear System We want to solve the following linear system These methods generate a sequence of approximate solutions Gaussian Elimination LU, Choleski 2 classes of methods Direct Methods Iterative Methods

4
Iterative Method These methods generate a sequence of approximate solutions Remark:

5
Jacobi Method Consider 4x4 case Example

6
K=6K=7K=8K=9K=10 x1 x2 x3 X4 K=1K=2K=3K=4K=5 x1 x2 x3 X4 Jacobi Method

7
K=1K=2K=3K=4K=5 x1 x2 x3 X4 Gauss Seidel Method Note that in the Jacobi iteration one does not use the most recently available information.

8
Gauss-Seidel iteration for general n: Gauss Seidel Method Jacobi iteration for general n:

9
DEF: with eigenvalues Splittings and Convergence DEF: spectral radius of A is defined to be Splitting A large family of iteration

10
Splittings and Convergence A large family of iteration DiagonalLowerUpper Jacobi:Gauss-Seidel:

11
Splittings and Convergence THM: A large family of iteration

12
Splittings and Convergence Example: Jacobi: U=triu(A,1) L=tril(A,-1) D=diag(diag(A)) eig(inv(M)*N) GS: i i

13
Splittings and Convergence THM: A large family of iteration Proof: (Golub p511) Remarks:

14
Splittings and Convergence THM: Proof: (Golub p512) show that all eigenvalues are less than one.

15
Example: Splittings and Convergence DEF: IF THM:

16
Successive over Relaxation The Gauss-Seidel iteration is very attractive because of its simplicity. Unfortunately, if the spectral radius is close to one, then convergence is vey slow. One solution for this Successive over Relaxation Jacobi: GS:

17
Successive over Relaxation Example:

18
K=1K=2K=3 x1 x2 x3 X4 Successive over Relaxation Example:

19
MATLAB CODE Jacobi iteration for general n: Ex: Write a Matlab function for Jacobi function [sol,X]=jacobi(A,b,x0) n=length(b); maxiter=10; x=x0; for k=1:maxiter for i=1:n sum1=0; for j=1:i-1 sum1=sum1+A(i,j)*x(j); end sum2=0; for j=i+1:n sum2=sum2+A(i,j)*x(j); end xnew(i)=(b(i)-sum1-sum2)/A(i,i) end X(1:n,k)=xnew; x=xnew; end sol=xnew;

20
MATLAB CODE GS iteration for general n: Ex: Write a Matlab function for GS function [sol,X]=gs(A,b,x0) n=length(b); maxiter=10; x=x0; for k=1:maxiter for i=1:n sum1=0; for j=1:i-1 sum1=sum1+A(i,j)*x(j); end sum2=0; for j=i+1:n sum2=sum2+A(i,j)*x(j); end x(i)=(b(i)-sum1-sum2)/A(i,i) end X(1:n,k)=x; end sol=x;

21
Another Look Remark: Given: We want to improve this approximate: Jacobi: GS:

22
Examples of Splittings 1) Non-symmetric Matrix: 2) Domain Decomposition: symmetricSkew-symmetric

Similar presentations

© 2016 SlidePlayer.com Inc.

All rights reserved.

Ads by Google