A New Algorithm for Inverting General Cyclic Heptadiagonal ... - arXiv

1 downloads 0 Views 496KB Size Report
In this paper, we describe a reliable symbolic computational algorithm for inverting general cyclic ... 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 3. 2. 2. 2. 2. 2. 2. 1. 1. 1. 1. 1. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0 ... A C. D. B b d a. A. A. D. B b d a a. A. D. B b d.
A New Algorithm for Inverting General Cyclic Heptadiagonal Matrices Recursively A.A. KARAWIA1

Computer Science Unit, Deanship of Educational Services, Qassim University, Buraidah 51452, Saudi Arabia. [email protected]

ABSTRACT In this paper, we describe a reliable symbolic computational algorithm for inverting general cyclic heptadiagonal matrices by using parallel computing along with recursion. The algorithm is implementable to the Computer Algebra System(CAS) such as MAPLE, MATLAB and MATHEMATICA. An example is presented for the sake of illustration.

Key Words: Cyclic heptadiagonal matrices; LU factorization; Determinants; Inverse matrix; Linear systems; Computer Algebra System(CAS).

1. INTRODUCTION The n × n general periodic heptadiagonal matrices are takes the form: a1 A1 C 1 0 0 B 1 b1   d1 b A2 C2 0 0 B 2   2 d 2 a2  B 3 b3 d 3 a3 A3 C3 0 0    d3 a3 A3 C3 0  D 3 B 3 b3   0  H   0    0 D n 3 B n 3 b n 3 d n 3 an 3 A n 3 C n 3    0 D n  2 B n  2 b n  2 d n  2 an  2 A n  2   0 A 0 0 D n 1 B n 1 b n 1 d n 1 an 1   n 1   an An D B b d 0 0 0 n n n n  

(1.1)

Where n  8 . The inverses of cyclic heptadiagonal matrices are usually required in science and engineering applications, for more details (see special cases, [1-9]). The motivation of the current paper is to establish efficient algorithms for inverting cyclic heptadiagonal matrices of the form (1.1) and for solving linear systems of the form:

Hx  r

1

(1.2)

Home address: Mathematics Department, Faculty of Science, Mansoura University, Mansoura, 35516, Egypt. E-mail:[email protected]

where x  (x 1 , x 2 ,..., x n )T , r  ( r1 , r2 ,..., rn )T . To the best of our knowledge, the inversion of a general cyclic heptadiagonal matrix of the form (1.1) has not been considered. Very recently in [9], the inversion of a general cyclic pentadiagonal matrix using recursion is studied without imposing any restrictive conditions on the elements of the matrix. Also, in this paper we are going to compute the inverse of a general cyclic heptadiagonal matrix of the form (1.1) without imposing any restrictive conditions on the elements of the matrix H in (1.1). Our approach is mainly based on getting the elements of the last four columns of H-1 in suitable forms via the Doolittle LU factorization [10] along with parallel computation [6]. Then the elements of the remaining (n - 4) columns of H-1 may be obtained using relevant recursive relations. The inversion algorithm of this paper is a natural generalization of the algorithm presented in [9]. The development of a symbolic algorithm is considered in order to remove all cases where the numerical algorithm fails. The paper is organized as follows. In Section 2, new symbolic computational algorithms, that will not break, is constructed. In Section 3, an illustrative example is given. Conclusions of the work are given in Section 4.

2. Main results In this section we shall focus on the construction of new symbolic computational algorithms for computing the determinant and the inverse of general cyclic heptadiagonal matrices. The solution of cyclic heptadiagonal linear systems of the form (1.2) will be taken into account. Firstly we begin with computing the LU factorization of the matrix H. It is as in the following: (2.1) H  LU where               L                 

and

1

0

0

0

0

0

0

0

0

f

2

1

0

0

0

0

0

0

0

e3

f3

1

0

0

0

0

0

0

e4

f

1

0

0

0

0

0

1

0

n 2

1

0

D4

1

4

0

0

0

0

e n 3

0

0

0

D n 2

k1

k2

k3

h1

h2

h3

f

n 3

e n 2

f

k n 5

k n 4

k n 3

k n 2

1

0

h n 5

hn  4

h n 3

hn 2

h n 1

1

 n 5

                              

(2.2)

       U        

1

g1

0

2

z1 g2

C1 z2

0

0

3

g3

0

0 0

0 0

w1 w2

0

0

w3

z n 5

C n 5

w n 5

g n 4

z n 4 g n 3

w n 4 w n 3 w n 2

 n 3

0

0

0 0 0

0

 n 2 0 0

 n 1 0

v1  v 2  v3    v n 5   v n 4  v n 3   v n 2  v n 1    n 

(2.3)

The elements in the matrices L and U in (2.2) and (2.3) satisfy:

d 1 d  f g  2 2 1 d 3  e 3z 1  f 3 g 2  d  D i C  e z  f g  i  i 3 i 3 i i  2 i i 1 i    n 2 d n 1  w j k j  j 1  n 1  d  v h  n j 1 j j

if i  1 if i  2 if i  3 if i  4(5)n  2

(2.4)

if i  n  1 if i  n ,

 A n 1   1  k 1g 1   2  ( k 1z 1  k 2 g 2 )  3   (k C  k z  k g ) k i   i 3 i 3 i  2 i  2 i 1 i 1 i   (D n 1  k n 7C n 7  k n 6 z n 6  k n 5 g n 5 )   n 4   (B  k C  k z  k g )  n 1 n 6 n 6 n 5 n 5 n  4 n  4  n 3   (b  k C  k z  k g )  n 1 n 5 n 5 n  4 n  4 n 3 n 3  n 2 

if i  1 if i  2 if i  3 if i  4(5)n  5 if i  n  4 if i  n  3 if i  n  2,

(2.5)

   an if i  1  1   A n  h1 g 1 if i  2  2   (h1z 1  h2 g 2 ) if i  3  3   (h C  hi  2 z i  2  hi 1 g i 1 ) hi   i 3 i 3 if i  4(5)n  4 i   (D n  hn 6C n 6  hn 5 z n 5  hn  4 g n  4 ) if i  n  3   n 3   (B  h C n n 5 n 5  hn  4 z n  4  hn 3 g n 3 ) if i  n  2   n 2   n 2  (b n   h jw j )  j 1 if i  n  1,   n 1       if i  1 b1  B 2  f 2v 1 if i  2  if i  3  e 3v 1  f 3v 2   Di v i   v i 3  e i v i  2  f i v i 1 if i  4(5)n  4   i 3  D if i  n  3 C n 3  n 3 v n 6  e n 3v n 5  f n 3v n  4  n 6   D  A n  2  n  2 v n 5  e n  2v n  4  f n  2v n 3 if i  n  2  n 5   n 2  an 1  v j k j if i  n  1,  j 1       if i  1 B 1 f 2w 1 if i  2   f w  e w if i 3 3 1  3 2   D w i   i w i 3  e iw i  2  f i w i 1 if i  4(5)n  5   i 3  D if i  n  4 C n  4  n  4 W n 7  e n  4w n 6  f n  4w n 5  n 7   D  A n 3  n 3 w n 6  e n 3w n 5  f n 3w n  4 if i  n  3   n 6  D n 2  an  2  w e w  f n  2w n 3 if i  n  2,  n 5 n 5 n  2 n  4  

(2.6)

(2.7)

(2.8)

 b  2  1  b  e 3 g 1 fi  3  2  D  bi  i z i 3  e i g i  2  i 3    i 1 

if i  2 if i  3

(2.9)

if i  4(5) n  2,

B3 if i  3  1   ei   Di  B i   g i 3 i 3  if i  4(5) n  2,  i 2   if i  1 a1  g i  a2  f 2 z 1 if i  2 a  f z  e C if i  3(4)n  3, i i 1 i i 2  i if i  1 A zi   1 if i  2(3)n  4. Ai  f i C i 1

(2.10)

(2.11) (2.12)

We also have: n

det H    i .

(2.13)

i 1

At this point it is convenient to formulate our first result. It is a symbolic algorithm for computing the determinant of a cyclic heptadiagonal matrix H of the form (1.1) and can be considered as natural generalization of the symbolic algorithm DETCPENTA in [9]. Algorithm 2.1. To compute det H for the cyclic heptadiagonal matrix H in (1.1), we may proceed as follows: Step 1: Set α1=d1. If α1=0 then α1= t end if. Set g1=a1, z1=A1, k1=An-1/ α1, v1=b1, w1=B1, h1=an/ α1, w1=B1 , f2=b2/ α1, e3=B3/ α1, α2=d2-f2 *g1. If α2=0 then α2= t end if. Set K2=-k1*g1/ α2, v2=B2f2*v1, w2=-f2*w1, h2=(An-h1*g1)/ α2, g2=a2-f2*z1, f3=(b3-e3*g1)/α2, α3=d3-e3*z1-f3*g2. If α3=0 then α3= t end if. Set k3=-(k1*z1+k2*g2)/α3, h3=-(h1z1+h2g2)/α3, v3=-e3*v1-f3*v2, w3=-f3w2-e3w1. Step 2: Compute and simplify: For i from 4 to n-2 do ei=(Bi-Di* gi-3/ αi-3)/ αi-2 fi=(bi- Di* zi-3/ αi-3-ei*gi-2)/ αi-1 zi-2=Ai-2-fi-2*Ci-3 gi-1=ai-1-fi-1*zi-2-ei-1*Ci-3 αi=(di- Di* Ci-3/ αi-3-ei*zi-2-fi*gi-1) If αi=0 then αi= t end if End do Step 3: Compute and simplify: For i from 4 to n-5 do Ki=-(ki-3*Ci-3+ki-2*zi-2+ki-1*gi-1)/ αi wi=-(Di*wi-3/ αi-3+ei*wi-2+fi*wi-1) End do

Step 4: Compute and simplify: For i from 4 to n-4 do hi=-(hi-3*Ci-3+hi-2*zi-2+hi-1*gi-1)/ αi vi=-(Di*vi-3/ αi-3+ei*vi-2+fi*vi-1) End do Step 5: Compute simplify: kn-4=(Dn-1-kn-5*gn-5-kn-6*zn-6-kn-7*Cn-7)/ αn-4 kn-3=(Bn-1-kn-4*gn-4-kn-5*zn-5-kn-6*Cn-6)/ αn-3 kn-2=(bn-1-kn-3*gn-3-kn-4*zn-4-kn-5*Cn-5)/ αn-2 wn-4=Cn-4-Dn-4*wn-7/αn-7-en-4*wn-6-fn-4wn-5 wn-3=An-3-Dn-3*wn-6/αn-6-en-3*wn-5-fn-3wn-4 wn-2=an-2-Dn-2*wn-5/αn-5-en-2*wn-4-fn-2wn-3 hn-3=(Dn-hn-4*gn-4-hn-5*zn-5-hn-6*Cn-6)/ αn-3 hn-2=(Bn-hn-3*gn-3-hn-4*zn-4-hn-5*Cn-5)/ αn-2 vn-3=Cn-3-Dn-3*vn-6/αn-6-en-3*vn-5-fn-3*vn-4 vn-2=An-2-Dn-2*vn-5/αn-5-en-2*vn-4-fn-2*vn-3 n 2

k v

vn-1=an-1-

j 1

j

j

n 2

αn-1=dn-1-

k w j

j 1

j

If αn-1=0 then αn-1= t end if n 2

hn-1=(bn-

h w j

j 1

j

)/ αn-1

n 1

αn=dn-

h v j 1

j

j

If αn=0 then αn= t end if



n

 

Step 6: Compute det H = 

i 1

i

  . t 0

The symbolic Algorithm 2.1 will be referred to as DETCHEPTA. The new algorithm DETCHEPTA is very useful to check the nonsingularity of the matrix H when we consider, for example, the solution of the cyclic heptadiagonal linear systems of the form (1.2). Now, when the matrix H is nonsingular, its inversion is computed as follows: Let H 1  (S ij )1i , j n  (Col1,Col 2 ,...,Col n )

(2.14)

1

Where Col m denotes the m column of H , m  1, 2,..., n . Since the Doolittle LU factorization of the matrix H in (1.1) is always possible then we can use parallel computations to get the elements of the last five columns Col i  (S 1,i , S 2,i ,..., S n ,i ), th

i  n , n  1, n  2, n  3and n  4 of H 1 as follows [9]: S n ,n 

1

n

,

(2.15)

v n 1S n ,n

S n 1, n  

S i ,n  

 n 1

1

hn 1

n

(2.18)

(1 v n 1S n ,n 1 ),

(2.19)

 n 1

1 (g S z S C S w S v S ), i  n  5, n  4,...,1  i i i 1,n 1 i i  2,n 1 i i 3,n 1 i n 1,n 1 i n ,n 1 h  hn 1k n  2  n 2 ,

S i ,n 1  

S n ,n 2

n

S n 1,n  2  

1

(k n  2  v n 1S n ,n  2 ),

n

1

 n 1

(2.23)

(2.24) ,

(k n  2 f n  2  k n 3 v n 1S n ,n 3 ),

1

 n 2 1

S n 3,n 3 

(2.21)

( g i S i 1,n  2  z i S i  2,n  2  C i S i 3,n  2  w i S n 1,n  2  v i S n ,n  2 ), i  n  5, n  6,...,1

i

S n  2,n 3  

(2.20)

(2.22)

(1 w n  2S n 1,n  2 v n  2S n ,n 2 ),

hn 3  hn  2 f n  2  hn 1 (k n  2 f n  2  k n 3 )

S n 1,n 3 

S n ,n 4 

 n 1

 n 2

S i ,n 2  

S n , n 3 

1

1

S n  2,n  2 

(2.17)

,

1

S n 1,n 1 

(2.16)

( g i S i 1,n  z i S i  2,n  C i S i 3,n  w i S n 1,n  v i S n ,n ), i  n  5, n  6,...,1

i

S n ,n 1  

,

(f n  2  w n  2S n 1,n 3  v n  2S n ,n 3 ),

(1  g n 3S n  2,n 3 w n 3S n 1,n 3 v n 3S n ,n 3 ),

 n 3

(2.25) (2.26) (2.27) (2.28)

1 (hn 4  hn 3f n 3  hn 2 (e n 2  f n 2 f n 3 )  hn 1 (k n 4  k n 3f n 3  k n 2 (e n 2  f n 2f n 3 ))) n

(2.29) S n 1,n  4 

1

 n 1

S n  2,n  4  

S n 3,n  4   S n  4,n  4 

(k n  4  k n 3f n 3  k n  2 (e n  2  f n  2f n 3 ) v n 1S n ,n  4 )

1

 n 2 1

 n 3 1

 n 4

(2.30)

((e n  2  f n  2 f n 3 )  w n  2S n 1,n  4  v n  2S n ,n  4 ),

(2.31)

(f n 3  g n 3S n  2, n 4  w n 3S n 1, n 4  v n 3S n , n 4 ),

(2.32)

(1  g n  4S n 3,n  4  z n  4S n  2, n  4 w n  4S n 1, n  4 v n  4S n , n  4 ),

(2.33)

1 (g S z S  C i S i 3,n  4  w i S n 1,n  4  v i S n ,n  4 ), i  n  5, n  6,...,1 (2.34)  i i i 1,n  4 i i  2,n  4 1  (w n  2S n 1, j  v n  2S n , j ), j  n , n  1 (2.35)

S i ,n 4 

S n  2, j

 n 2

S n 3, j  

1

 n 3

S n  4, j   Si,j  

( g n 3S n  2, j  w n 3S n 1, j  v n 3S n , j ), j  n , n  1, n  2

1

 n 4

(2.36)

( g n  4S n 3, j  z n  4S n  2, j  w n 4S n 1, j  v n 4S n , j ), j  n , n  1, n  2, n  3 (2.37)

1 ( g i S i 1, j  Ai S i  2, j  w i S n 1, j  v i S n , j ), i  n  5, n  6,...,1, j  n , n  1,..., n  4 i

(2.38)

The remaining (n - 5) columns are obtained by using the fact H 1H  I n , where I n is the identity matrix. They are as in the following: 1 Col n 5  (E n 2  A n 4Col n 4  an 3Col n 3  d n 2Col n 2  b n 1Col n 1  B nCol n ), C n 5 (2.39) Col j 

1 (E j 3  A j 1Col j 1  a j  2Col j  2  d j 3Col j 3  b j  4Col j  4  B j 5Col j 5  D j 6Col j 6 ). Cj

(2.40)

j  n  6, n  7,...,1 where Ei=1 if row=i. n 5

Remark 2.1. Eqs. (2.39) and (2.40) suggest an additional assumption

C i 1

i

 0, , which is

only formal and can be omitted by introducing auxiliary parameter t in Algorithm 2.2 given below. Now we formulate a second result. It is a symbolic computational algorithm to compute the inverse of a general cyclic heptadiagonal matrix of the form (1.1) when it exists. Algorithm 2.2. To find the n x n inverse matrix of the general cyclic heptadiagonal matrix H in (1.1) by using the relations (2.15)_(2.40). INPUT: Order of the matrix n and the components, Di, Bi, bi, di, ai, Ai, Ci, i=1,2, ...,n, where D1= D2 =D3=Cn-2 =Cn-1 = Cn =0. OUTPUT: Inverse matrix, H 1  (S ij )1i , j n . Step 1: If Ci=0 for any i = 1, 2, ..., n-5 set Ci= t (t is just a symbolic name). Step 2: If Bi=0 for any i = 6, 7, ..., n, Bi=t. Step 3: Use the DETCHEPTA algorithm to check the nonsingularity of the matrix H. If the matrix H is singular then OUTPUT (`The matrix H is singular'); Stop. Step 4: For i = 1, 2, ..., n, compute and simplify the components Si,n, Si,n-1, Si,n-2, Si,n-3 and Si,n-4 of the columns Cj, j=n, n-1, n-2, n-3 and n-4, respectively, by using (2.15)-(2.38). Step 5: For i = 1, 2, ..., n, compute and simplify the components Si,n-5 by using (2.39). Step 6: For j = n-6, n-7, ..., 1, do For i = 1, 2, ..., n, do Compute and simplify the components Si,j by using (2.40).

End do End do. Step 6: Substitute the actual value t = 0 in all expressions to obtain the elements, Si,j, i, j = 1, 2, ..., n. The symbolic Algorithm 2.2 will be referred to as CHINV algorithm. The Algorithms 2.2, 2.3 and 2.2 in [9], [11] and [12], respectively, are now special cases of the CHINV algorithm.

3. An illustrative example In this section we give an example for the sake of illustration. Example 3.1. Consider the 10 X 10 cyclic heptadiagonal linear system               

1 1 2 2

1 1 2 0 0 1 1 1 1 0 1 1 1 2 3 2 3 1 5 6

0 0 0 0 3 2

1 0 0 0 0 4

0 0 0 0

0 0 0 0

1 1 1 1 1 2 1 1 1 1 1 1 0 2 2 2 2 3 0 0 2 2 1 1 0 0 0 3 1 3 0 0 0 0 2 3

2 0 0 0 0 1 1 3 4 4

1  x 1   2  1   x 2   15  0   x 3   33      0 x4   0  0   x 5   43       0   x 6   24  3  x 7   47      5   x 8   70  1  x 9   78      1   x 10   94 

(3.1)

By using the coefficient matrix of the system (3.1) and applying the CHINV algorithm, we get:

By simple calculation we obtain the solution of cyclic heptadiagonal linear system (3.1) X=[x1, x2, x3, x4, x5, x6, x7, x8, x9, x10]=[1,2,3,4,5,6,7,8,9,10].

4. Conclusions In this work new recursive computational algorithms have been developed for computing the determinant and inverse of general cyclic heptadiagonal matrices and for solving linear systems of cyclic heptadiagonal type. The algorithms are reliable, computationally efficient and will not fail. The algorithms are natural generalizations of some algorithms in current use.

References [1] A.A. Karawia, A computational algorithm for solving periodic pentadiagonal linear systems, Appl. Math. Comput. 174 (2006) 613_618. [2] M. Batista, A method for solving cyclic block penta-diagonal systems of linear equations, arXiv:0806.3639V5 [math-ph]. [3] I.M. Navon, A periodic pentadiagonal systems solver, Commun. Appl. Numer. Methods 3 (1987) 63_69. [4] X.-G. Lv, J. Le, A note on solving nearly pentadiagonal linear systems, Appl. Math. Comput. 204 (2008) 707_712. [5] S.N. Neossi Nguetchue, S. Abelman, A computational algorithm for solving nearly pentadiagonal linear systems, Appl. Math. Comput. 203 (2008) 629_634. [6] T. Sogabe, New algorithms for solving periodic tridiagonal and periodic pentadiagonal linear systems, Appl. Math. Comput. 202 (2008) 850_856. [7] X.i-Le Zhao, Ting-Zhu Huang, On the inverse of a general pentadiagonal matrix, Appl. Math. Comput. 202 (2008) 639_646. [8] A. Driss Aiat Hadj, M. Elouafi, A fast numerical algorithm for the inverse of a tridiagonal and pentadiagonal matrix, Appl. Math. Comput. 202 (2008) 441_445.

[9] M. El-Mikkawy, El-Desouky Rahmo, Symbolic algorithm for inverting cyclic pentadiagonal matrices recursively - Derivation and implementation, Computers and Mathematics with Applications 59 (2010) 1386-1396. [10] J.W. Demmel, Numerical linear algebra, SIAM (1997). [11] M. El-Mikkawy, E. Rahmo, A new recursive algorithm for inverting general tridiagonal and anti-tridiagonal matrices, Appl. Math. Comput. 204 (2008) 368_372. [12] M. El-Mikkawy, E. Rahmo, A new recursive algorithm for inverting general periodic pentadiagonal and anti-pentadiagonal matrices, Appl. Math. Comput. 207 (2009) 164_170.

Suggest Documents