A =

2 0 2

0 1 1

0 0 2

I =

1 0 0

0 1 0

0 0 1

b =

6

3

4

__Gilbert-Peierls algorithm __

Initially we assign values for L and U.

L= U = I =

1 0 0

0 1 0

0 0 1

Select three different values for b1 for several iterations k = 1:N; N= number of rows/columns in the matrix A.

First we solve for c using Lc = b1 to find out new L and U.

c = L\b1

When k = 1;

b1 = A(:,1) =

2 0

0

c = L\b1

c = L^{-1}b1 = b1

Find new U by updating 1st column of the initial U.

U(1,1)= c(1)=2, U(2,1) = c(2)=0, U(3,1)= c(3)=0

U =

2 0 0

0 1 0

0 0 1

Find new L by updating 1st column of the initial L.

L(1,1) = c(1)/U(1,1) =2/2 =1, L(2,1) = c(2)/U(1,1) =0, L(3,1) = c(3)/U(1,1) =0

L =

1 0 0

0 1 0

0 0 1

When k = 2;

b1 = A(:,2) =

0

1

0

c = L^{-1}b1 = b1

Update the second column of U

U(1,2)= c(1)=0, U(2,2) = c(2)=1, U(3,2)= c(3)=0

U=

2 0 0

0 1 0

0 0 1

Update the second column of L

L(2,2)= c(2)/U(2,2)=1/1=1, L(3,2)= c(3)/U(2,2)=0

L=

1 0 0

0 1 0

0 0 1

When k =3;

b1 = A(:,3) =

2

1

2

c = L^{-1}b1 = b1

Update the third column of U

U(1,3)= c(1)=2, U(2,3) = c(2)=1, U(3,3)= c(3)=2

U=

2 0 2

0 1 1

0 0 2

Update the third column of L

L(3,3)= c(3)/U(3,3)=2/2 =1

L=

1 0 0

0 1 0

0 0 1

__Finding x__

Ld = b

d = Ux

Since L is an Identity matrix L= L^{-1}

d = L^{-1}b = Lb = b

d =

6

3

4

d = Ux

x = U\d

6 = 2 0 2 x1 3 0 1 1 x2 4 0 0 2 x3

Since U is an triangular matrix, use backward substitution;

2x3 =4, x3 =2

x2+x3 =3

x2 =1

2x1+2x3 = 6,2x1 = 2, x1=1

All items (1)