PDMA
PDMA
PDMA
r
X
i
v
:
0
8
0
3
.
2
3
1
9
v
1
[
c
s
.
S
C
]
1
5
M
a
r
2
0
0
8
Two Algorithms for Solving A General Backward
Pentadiagonal Linear Systems
A. A.KARAWIA
_
0 0 0 a
1
a
1
d
1
0 0 a
2
a
2
d
2
b
2
0 a
3
a
3
d
3
b
3
b
3
.
.
.
.
.
.
.
.
.
a
n2
a
n2
d
n2
b
n2
b
n2
0
a
n1
d
n1
b
n1
b
n1
0 0
d
n
b
n
b
n
0 0 0
_
_
, (1.2)
X = (x
1
, x
2
, . . . , x
n
)
T
, Y = (y
1
, y
2
, . . . , y
n
)
T
and n 5.
A general nn backward pentadiagonal matrix A of the form (1.2) can be stored in 5n6 memory locations
by using ve vectors a = ( a
1
, a
2
, . . . , a
n2
), a = (a
1
, a
2
, . . . , a
n1
), b = (b
2
, b
3
, . . . , b
n
),
b = (
b
3
,
b
4
, . . . ,
b
n
),
and d = (d
1
, d
2
, . . . , d
n
). When considering the system (1.1) it is advantageous to introduce three addi-
tional vectors = (
1
,
2
, . . . ,
n1
), = (
1
,
2
, . . . ,
n
) and = (
2
,
3
, . . . ,
n
). These vectors are
related to the vectors a, a, d, b, and
b.
The current paper is organized as follows. In section 2, the main results are given. An illustrative
examples are presented in section 3. In section 4, a Conclusion is given.
_
d
n
b
n
b
n
0 0 0
a
n1
d
n1
b
n1
b
n1
0 0
a
n2
a
n2
d
n2
b
n2
b
n2
0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
0 a
3
a
3
d
3
b
3
b
3
0 0 a
2
a
2
d
2
b
2
0 0 0 a
1
a
1
d
1
_
_
, (2.2)
Y
1
= (y
n
, y
n1
, . . . , y
1
)
T
and n 5.
Now considering the LU decomposition [4] of the matrix A
1
in the form:
_
_
d
n
b
n
b
n
0 0 0
a
n1
d
n1
b
n1
b
n1
0 0
a
n2
a
n2
d
n2
b
n2
b
n2
0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
0 a
3
a
3
d
3
b
3
b
3
0 0 a
2
a
2
d
2
b
2
0 0 0 a
1
a
1
d
1
_
_
=
_
_
1 0 0 0 0 0
2
1 0 0 0 0
an2
1
3
1 0 0 0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
0
a3
n4
n2
1 0 0
0 0
a2
n3
n1
1 0
0 0 0
a1
n2
n
1
_
_
_
1
1
b
n
0 0 0
0
2
2
b
n1
0 0
0 0
3
3
b
n2
0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
0 0 0
n2
n2
b
3
0 0 0 0
n1
n1
0 0 0 0 0
n
_
_
. (2.3)
From (2.3) we obtain
i
=
_
b
n
if i = 1
b
ni+1
i
b
ni+2
if i = 2(1)n 1,
(2.4)
i
=
_
_
_
d
n
if i = 1
d
n1
1
2
if i = 2
d
ni+1
ani+1
i2
b
ni+3
i1
i
if i = 3(1)n,
(2.5)
and
i
=
_
_
_
an1
1
if i = 2
ani+1
a
ni+1
i2
i2
i1
if i = 3(1)n.
(2.6)
It is not dicult to prove that the LU decomposition (2.3) exists only if
i
= 0, i = 1(1)n1. Moreover
2
a general backward pentadiagonal linear system (1.1) possesses a unique solution if, in addition,
n
= 0.
On the other hand, the Determinant of the matrix A
1
is given by
det(A
1
) =
n
i=1
i
, (2.7)
and this shown the importance of the vector [5].
We may now formulate the following results.
Algorithm 2.1 To solve the general backward pentadiagonal linear system (1.1), we may procced as fol-
lows:
step 1: Set
1
= d
n
,
2
=
an1
1
,
1
= b
n
,
2
= d
n1
1
2
, and
2
= b
n1
2
b
n
.
step 2: If
1
= 0 Or
2
= 0, then OUTPUT(the method is fails); STOP.
step 3: For i = 3, 4, . . . , n 1 Compute
i
=
ani+1
a
ni+1
i2
i2
i1
,
i
= b
ni+1
i
b
ni+2
,
i
= d
ni+1
ani+1
i2
b
ni+3
i1
i
,
If
i
= 0, then OUTPUT(the method is fails); STOP.
step 4: Compute
n
=
a1
a
1
n2
n2
n1
,
n
= d
1
a1
n2
b
3
n1
n
.
step 5: Set z
1
= y
n
, z
2
= y
n1
2
z
1
.
step 6: For i = 3, 4, . . . , n Compute
z
i
= y
ni+1
ani+1
i2
z
i2
i
z
i1
.
step 7: Compute the solution vector x using
x
n
=
zn
n
, x
n1
=
zn1n1xn
n1
,
For i = n 2, n 3, . . . , 1 compute
x
i
=
ziixi+1
bni+1xi+2
i
.
The new algorithm 2.1 will be referred to as KBPENTA algorithm. KBPENTA algorithm for solving
the backward pentadiagonal system (1.1) is generally preferable because the conditions
i
= 0, i = 1(1)n
are sucient for the validity of it. The advantage of the vector is now clear.
The following symbolic algorithm is developed in order to remove the cases where the numeric algorithm
KBPENTA fails.
Algorithm 2.2 To solve the general backward pentadiagonal linear system (1.1), we may procced as fol-
lows:
step 1: Set
1
= d
n
.
step 2: Set
1
= x(x is just a symbolic name) whenever
1
= 0.
step 3: Set
2
=
an1
1
,
1
= b
n
,
2
= d
n1
1
2
, and
2
= b
n1
2
b
n
.
step 4: Set
2
= x whenever
2
= 0.
step 5: For i = 3, 4, . . . , n 1 Compute
i
=
ani+1
a
ni+1
i2
i2
i1
,
i
= b
ni+1
i
b
ni+2
,
i
= d
ni+1
ani+1
i2
b
ni+3
i1
i
,
Set
i
= x whenever
i
= 0.
step 6: Compute
n
=
a1
a
1
n2
n2
n1
,
n
= d
1
a1
n2
b
3
n1
n
.
step 7: Set
n
= x whenever
n
= 0.
3
step 8: Set z
1
= y
n
, z
2
= y
n1
2
z
1
.
step 9: For i = 3, 4, . . . , n Compute
z
i
= y
ni+1
ani+1
i2
z
i2
i
z
i1
.
step 10: Compute the solution vector x using
x
n
=
zn
n
, x
n1
=
zn1n1xn
n1
,
For i = n 2, n 3, . . . , 1 compute
x
i
=
ziixi+1
bni+1xi+2
i
.
step 11: Substitute x = 0 in all expressions of the solution vector x
i
, i = 1, 2, . . . , n.
The symbolic algorithm 2.2 will be referred to as KSBPENTA algorithm.
In [6], Claerbout showed that the two-dimensional Laplacian operator, which appears in 3-D nite-dierence
migration, has the form of pentadiagonal matrix. If we choice d
i
= 4, i = 1(1)n, a
i
= b
i
= a
i
=
b
i
= 1,
and y
i
= y
j
, i = 1(1)n, j = n(1)1, we can obtain it.
3 An Illustrative Examples
In this section we are going to give an illustrative examples
Example 3.1. Solve the backward pentadiagonal linear system of size 5 given by
_
_
0 0 3 1 1
0 2 2 2 4
3 1 2 1 1
4 2 2 2 0
1 1 1 0 0
_
_
X =
_
_
10
26
20
14
4
_
_
(3.1)
by using the KBPENTA algorithm and KSBPENTA algorithm.
Solution
(i) The application of the KBPENTA algorithm gives:
1
= 1,
2
= 4,
1
= 1,
2
= 2, and
2
= 6 (Step 1).
[
3
,
4
] = [2,
8
7
,
2
3
], [
3
,
4
] = [7,
24
7
], [
3
,
4
] = [3,
20
7
] (Step 3).
5
=
2
3
,
5
=
10
3
(Step 4).
z
1
= 4, and z
2
= 30 (Step 5).
[z
3
, z
4
, z
5
] = [28, 28,
50
3
] (Step 6).
x
5
= 5, x
4
= 4, [x
1
, x
2
, x
3
] = [1, 2, 3] (Step 7).
Also the determinant of the matrix A
1
is det(A
1
) = 160 by using (2.7).
(ii) The application of the KSBPENTA algorithm gives:
X := back penta(
b, b, d, a, a, y) = [1, 2, 3, 4, 5].
4
Example 3.2. Solve the backward pentadiagonal linear system of size 5 given by
_
_
0 0 3 1 1
0 2 2 2 4
3 1 2 1 1
4 2 2 2 0
0 1 1 0 0
_
_
X =
_
_
10
26
20
14
5
_
_
(3.2)
by using the KBPENTA algorithm and KSBPENTA algorithm.
Solution
(i) The application of the KBPENTA algorithm gives:
The method is break down since
1
= d
5
= 0.
(ii) The application of the KSBPENTA algorithm gives:
X := back penta(
b, b, d, a, a, y)=[
11
9x11
,
22(x1)
9x11
,
34x33
9x11
,
51x44
9x11
,
39x55
9x11
]
x=0
=[1, 2, 3, 4, 5].
Also the determinant of the matrix A
1
is det(A
1
) = 88 and for more details about how to call this procedure,
see appendix 1.
4 Conclusion
The methods described here are a very eective, provided optimal LU factorization is used. Our symbolic
algorithm is competitive the other methods for solving a backward pentadiagonal linear systems which
appear in many applications.
5 Acknowledgement
I should like to thank Prof. Dr. M. E. A. El-Mikkawy for several comments and suggestions.
Appendix 1. A Maple procedure for solving a backward pentadiagonal linear systems
Notes: The procedure is based on the following results:
x
i
=
ziixi+1
bni+1xi+2
i
, i = n 2, n 3, . . . , 1, x
n
=
zn
n
, x
n1
=
zn1n1xn
n1
.
where
z
i
= y
ni+1
i
z
i1
ani+1
i2
z
i2
, i = 3, 4, . . . , n, z
1
= y
n
, z
2
= y
n1
2
z
1
,
i
=
ani+1
a
ni+1
i2
i2
i1
, i = 3, 4, . . . , n,
2
=
an1
1
,
i
= d
ni+1
ani+1
i2
b
ni+3
i1
i
, i = 3, 4, . . . , n,
1
= d
n
,
2
= d
n1
1
2
,
and
i
= b
ni+1
i
b
ni+2
, i = 2, 3, . . . , n 1,
1
= b
n
.
5
> # A Maple Procedure.
> # Written by Dr. A. A. Karawia.
> # To compute the solution of A general backward pentadiagonal Linear systems.
> restart:
> with(linalg,vector,vectdim):
> back penta:=proc(bb::vector,b::vector, d::vector,a::vector,aa::vector,y::vector)
local i,j,k,n; global T,alpha,beta,g,z,X;
n:=vectdim(d):alpha:=array(1..n-1):beta:=array(1..n): g:=array(1..n):
z:=array(1..n):X:=array(1..n):
#components of the vectors alpha,beta, and gamma #
beta[1]:=d[n]:
if beta[1]=0 then beta[1]:=x;d[n]:=x;:
g[2]:=a[n-1]/beta[1]:alpha[1]:=b[n]: beta[2]:=simplify(d[n-1]-alpha[1]*g[2]):
alpha[2]:=simplify(b[n-1]-g[2]*bb[n]):
if beta[2]=0 then beta[2]:=x;:
for i from 3 to n-1 do
g[i]:=simplify((a[n-i+1]-aa[n-i+1]*alpha[i-2]/beta[i-2])/beta[i-1]):
alpha[i]:=simplify(b[n-i+1]-g[i]*bb[n-i+2]):
beta[i]:=simplify(d[n-i+1]-aa[n-i+1]*bb[n-i+3]/beta[i-2]-alpha[i-1]*g[i]):
if beta[i]=0 then beta[i]:=x;:
end do:
g[n]:=simplify((a[1]-aa[1]*alpha[n-2]/beta[n-2])/beta[n-1]):
beta[n]:=simplify(d[1]-aa[1]*bb[3]/beta[n-2]-alpha[n-1]*g[n]):
# To compute the vector Z #
z[1]:=y[n]:z[2]:=y[n-1]-g[2]*z[1]:i:=i:
for i from 2 to n do
z[i]:=simplify(y[n-i+1]-aa[n-i+1]*z[i-2]/beta[i-2]-g[i]*z[i-1]):
end do:
# To compute the Solution of the system X. #
X[n]:=z[n]/beta[n]:i:=i:
X[n-1]:=simplify((z[n-1]-alpha[n-1]*X[n])/beta[n-1]):
for i from n-1 by -1 to 1 do
X[i]:=simplify((z[i]-alpha[i]*X[i+1]-bb[n-i+1]*X[i+2])/beta[i]):
end do:
# To compute the determinant T #
T:=subs(x=0,simplify(product(beta[r],r=1..n)));
eval(X):
end:
> # Call no. 1 for the procedure back penta. #
> x:=x:
> aa:=vector([3,-1,7,-2]);
aa := [3, -1, 7, -2]
>a:=vector([2,5,2,3,-5]);
a := [2, 5, 2, 3, -5]
> d:=vector([1,3,3,5,6,14]);
d := [1, 3, 3, 5, 6, 14]
> b:=vector([0,2,1,2,2,1]);
b := [0, 2, 1, 2, 2, 1]
> bb:=vector([0,0,-5,-7,3,-10]);
bb := [0, 0, -5, -7, 3, -10]
> y:=vector([6,9,8,1,6,5]);
y := [6, 9, 8, 1, 6, 5]
> X:=back penta(bb,b,d,a,aa,y);
X := [1, 1, 1, 1, 1, 1]
> T;
-8597
6
> # End of call no. 1. #
> # Call no. 2 for the procedure back tri. #
> x:=x:
> aa:=vector([3,-1,7,-2]);
aa := [3, -1, 7, -2]
>a:=vector([2,5,2,3,-5]);
a := [2, 5, 2, 3, -5]
> d:=vector([1,3,3,5,6,0]);
d := [1, 3, 3, 5, 6, 0]
> b:=vector([0,2,1,2,2,1]);
b := [0, 2, 1, 2, 2, 1]
> bb:=vector([0,0,-5,-7,3,-10]);
bb := [0, 0, -5, -7, 3, -10]
> y:=vector([6,9,8,1,6,-9]);
y := [6, 9, 8, 1, 6, -9]
> X:=back penta(bb,b,d,a,aa,y);
X := [
1777
741x1777
,
2x+1777
741x1777
,
489x1777
741x1777
,
1160x1777
741x1777
,
574x1777
741x1777
,
182x+1777
741x1777
]
> T;
1777
> x:=0:X:=map(eval,op(X));
X := [1, 1, 1, 1, 1, 1]
> # End of call no. 2. #
References
[1] W. Cheney, D Kincaid, Numerical Mathematics and Computing(Second Edition), Wadsworth, Inc., 1985.
[2] H. L. Stone, Iterative Solution of Impilicit Approximations of Multidimensional Partial Dierential equations,
SIAM J. Numer. Anal., Vol. 5, No. 3(1968), pp. 530-558.
[3] A. A. Karawia, Two algorithms for solving a general backward tridiagonal linear systems, Applied Mathematics
and Computation, Volume 194, Issue 2(2007), pp. 534-539.
[4] M. B. Allen III, E. L. Isaacson, Numerical Analysis for Applied Science, Wiley-Interscience, John Wiley & Sons,
1997.
[5] M. E. A. El-Mikkawy, A Fast Algorithm for Evaluating nth Order tridiagonal Determinants, J. Comput. Appl.
Math., Vol. 166(2004), pp. 581-584.
[6] J. F. Claerbout, Imaging the earths interior, Blackwell Scientic Publications, 1985.
7