On Solving a General Bordered Tridiagonal Linear System

4 downloads 3972 Views 129KB Size Report
Email: [email protected]. Q. M. Rizvi ... Email: [email protected]. ABSTRACT ...... 10-7. 1:012. Based on the result in Table.1, we can conclude that.
International Journal of Mathematical Sciences, ISSN: 2051-5995, Vol.33, Issue.2

1160

On Solving a General Bordered Tridiagonal Linear System A. A. Karawia* Computer science unit, Deanship of educational services, Qassim University, P.O.Box 6595, Buraidah 51452, Saudi Arabia. Email: [email protected]

Q. M. Rizvi Computer science unit, Deanship of educational services, Qassim University, P.O.Box 6595, Buraidah 51452, Saudi Arabia. Email: [email protected]

ABSTRACT In this paper, the authors present reliable symbolic algorithms for solving a general bordered tridiagonal linear system. The first algorithm is based on the LU decomposition of the coefficient matrix, and its computational cost is O(n). The second is based on The Sherman-Morrison-Woodbury formula. Algorithms are implementable to the Computer Algebra System (CAS) such as MAPLE, MATLAB and MATHEMATICA. Three examples are given to illustrate these algorithms.

Keywords - Bordered tridiagonal matrices; LU factorization; Sherman-Morrison-Woodbury Formula; Computer algebra systems (CAS).

1. INTRODUCTION A general bordered tridiagonal linear system takes the form:           

a1 c2 0  0 0 q1

b1 a2 c3    q2

0 b2 a3  0  

 0 0 p1   x 1   p 2   x 2  0 0  p3   x 3  0 b3      =    c n − 2 an − 2 b n − 2 p n − 2   x n − 2    0 c n −1 an −1 b n −1   x n −1  q n −3 q n − 2 c n an   x n 

 y1  y   2   y3       , n > 3 (1.1) y   n −2   y n −1  y   n 

Many problems in mathematics and applied science require the solution of a general bordered tridiagonal linear system. For example the solution of certain partial differential equations, spline approximation, computation of electric power system, etc. [1-4]. This area of research is still very active and has been consider by many authors. Recently in [5], the author presents an approach to find a solution to the linear system (1.1) in heterogeneous environments. In this approach, a bordered tridiagonal linear system is first converted into three or more tridiagonal linear systems that are independent from each other, then the solution of the bordered tridiagonal linear system is obtained by solving the tridiagonal linear systems via parallel computing under heterogeneous environments. The motivation of the current paper is to establish efficient algorithms for solving a general bordered tridiagonal linear system of the form (1.1).

This paper is organized as follows: In Section 2, a new symbolic algorithm is constructed. The ShermanMorrison-Woodbury algorithm is presented in Section 3. Three illustrative examples are given in Section 4. Conclusions of the work are presented in Section 5.

2. A NEW SYMBOLIC ALGORITHM In this section, we shall focus on the construction of a new symbolic algorithm for solving a general bordered tridiagonal linear system. To do this, we begin by considering the LU decomposition [6] of the coefficient matrix in (1.1):           

a1 c2 0  0 0 q1

          =           

0 0 0  p1  b2 0 0  p 2  a3 b3 0  p3         0 c n − 2 an − 2 bn − 2 p n − 2    0 c n −1 an −1 bn −1   q n −3 q n − 2 c n an 

b1 a2 c3    q2 1

0

0

0

0



c2 d1

1

0

0

0



0

c3 d2

1

0

0















0



0

cn −2 d n −3

1

0

0





0

c n −1 d n −2

1

α1

α2

 α n −3 α n − 2 α n −1

 0    0    0         0    0    1   

d1 0 0  0 0 0

b1 d2 0    0

0 b2 d3  0  

0 0  β1  0 0  β 2  0  β3  b3       0 d n − 2 bn − 2 βn − 2   0 0 d n −1 β n −1  0 0 0 d n 

(2.1)

where d i , α i and βi in (2.1) satisfy:

  a1  bi −1 di = ci ai − d i −1  n −1  an − ∑α j β j  j =1

if i = 1, if i = 2,3,..., n − 1,

(2.2)

if i = n,

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

© RECENT SCIENCE PUBLICATIONS ARCHIVES| July 2013|$25.00 | 27702561 | *This article is authorized for use only by Recent Science Journal Authors, Subscribers and Partnering Institutions*

International Journal of Mathematical Sciences, ISSN: 2051-5995, Vol.33, Issue.2

 q1  d1  1 αi =  (q i − α i −1bi −1 ) d1  1  (c n − α n − 2b n − 2 )   d n −1

αi = (qi − αi-1 ∗ bi-1)/di, βi = pi − βi-1 ∗ ci/di-1.

if i = 1, if i = 2,3,..., n − 2,

(2.3)

if i = n − 1,

1161

Step 4: Set αn-1 = (cn − αn-2 ∗ bn-2)/dn-1, Set βn-1 = bn-1 − βn-2 ∗ cn-1/dn-2, n −1

Set dn = an − ∑ α j β j

.

j =1

and    p1  βi −1  ci βi =  pi − d i −1   β b n −1 − n − 2 c n −1 d n −2  

If dn = 0 then dn = t end if.

if i = 1, if i = 2,3,..., n − 2,

(2.4)

n

Step 8: Compute

n −1

zn = yn − ∑ α j z j

(2.5)

i =1

j =1

xn = zn/dn, and xn-1 = (zn-1 − βn-1xn)/dn-1.

(2.6)

if i = 1,

(2.7)

if i = n.

Note - Since the solving of a general bordered tridiagonal linear system (1.1) is based on the LU factorization of the coefficient matrix, then the numeric algorithm may fail if di = 0; i ∈ {1; 2; :::; n − 2} as can be seen from (2.1)-(2.7). To remove all cases in which the numeric algorithm fails, it is convenient to give the following symbolic algorithm for computing the solution of a general bordered tridiagonal linear system (1.1) as follows:

2.1 Algorithm The solution of a general bordered tridiagonal linear system (1.1) may proceed as follows: INPUT number of equations in (1.1) n and the components ai, i = 1, 2, …, n, bi, i = 1, 2, …, n − 1, ci, i = 2, 3, …, n, pi and qi, i = 1, 2, …, n − 2. OUTPUT The solution of a general bordered tridiagonal linear system x. Step 1: Set d1 = a1, α1 = q1/d1, β1 = p1. If d1 = 0 then d1 = t(t is just a symbolic name) end if. Step 2: For i = 2, 3, …, n – 1, Compute di = ai − bi-1∗ ci/di-1, If di = 0 then di = t end if.

Step 3: For i = 2, 3, …, n − 2, Compute

Step 9: For i = n – 2, n – 3, …, 1, Compute xi = (zi − bixi+1 − βixn)/di. Step 10: Substitute t = 0 in all expressions of the solution vector x =[x1, x2, …, xn]T.

where

if i = 2,3,..., n − 1,

t = 0

Step 7: For i = 2, 3, …, n-1, Compute zi = yi − ci ∗ zi-1/di-1.

The solution of the system (1.1) is given by

  y 1  z i −1  zi = ci y i − d i −1  n −1   y n − ∑α j z j  j =1 



Step 6: Set z1 = y1.

We also have the determinant of the coefficient matrix in (1.1):

z n if i = n ,  d n   1 xi = n − 1, ( z n −1 − β n −1x n ) if i =   d n −1 1 n − 2, n − 3,..., 2,1,  ( z i − bi x i +1 − β i x n ) if i =  d i

n

 i =1

if i = n − 1.

Determinant=∏ d i .



Step 5: Compute Determinant=  ∏ d i  .

The symbolic Algorithm 2.1 will be referred to as SBTLS algorithm. The computational cost of SBTLS algorithm is 19n − 34 operations. In [7], the PERTRI algorithm is special case of our algorithm when pi = qi = 0, i = 2, 3, n − 2.

3. THE SHERMAN MORRISON WOODBURY ALGORITHM In this section, a new symbolic algorithm is going to be formulated for solving a general bordered tridiagonal linear system of the form (1.1) based on the ShermanMorrison-Woodbury formula and any symbolic tridigonal linear solver. A general bordered tridiagonal linear system of the form (1.1) can be written in the form: M 1 V   x ′   y ′  U T M   x ′′ =  y ′′    2 

(3.1)

where  a1 c  2 0 M1 =        0

U T = [ q1

b1 a2 c3   

0  b2 0 a3 b3   0 c n −1  0

 0       M = a ,V = p [ n] [ 1 2 ,  0 an −1 bn −1   c n −1 an −1 

q2 =  q n − 2 c n ], x ′

p 2  p n − 2 bn −1 ] , T

x 1 , x 2 ,..., x n −1 ] , x ′′ [= y ′ = [ y 1 , y 2 ,..., y n −1 ] , and y ′′ = [ y n ]. T

[x n ],

Thus (3.1) is equivalent to: M 1x ′ +V x ′′ = y ′   T U x ′ + M 2 x ′′ = y ′′

© RECENT SCIENCE PUBLICATIONS ARCHIVES| July 2013|$25.00 | 27702561 | *This article is authorized for use only by Recent Science Journal Authors, Subscribers and Partnering Institutions*

(3.2)

International Journal of Mathematical Sciences, ISSN: 2051-5995, Vol.33, Issue.2

Assume that an ≠0. After the elimination of x′′ from (3.2), we get the linear system: (3.3) Mx ′ = yˆ where ˆ y ′ −V M 2−1 y ′′. M = M1 - VM 2−1U T , and y= If we apply the Sherman-Morrison-Woodbury formula [8] to M, we will obtain: M

−1

Let  32 3 0 0 0 0 9   x 1  90   27 26 52 0 0 0 62   x   24    2    0 55 63 39 0 0 35   x 3   43       0 0 99 12 24 0 71  x 4  = 97   0 0 0 74 61 51 53   x   51   5    0 0 0 0 1 68 42   x 6  52   29 65 9 45 72 59 33   x  56    7  

= M 1−1 + M 1−1V (M 2 − U T M 1−1V ) −1U T M 1−1 ,

and x′= M −1 yˆ = r + M 1−1V (M 2 − U T M 1−1V ) −1U T r .

i)

By applying the BTLE algorithm in [5], it yields xBTLE = [3.8709,−2.2703, 3.1714, 1.8793,−1:0861, 2.6376,−3.0065]T .

ii)

By applying the SBTLE algorithm, it yields xSBTLE = [3,8638,−2.2838, 3.1464, 1.9121,−1.0871, 2.6192,−2.9767]T .

where r is the solution of M 1r = yˆ . It is clear that the solution x ′′ can be found from the above formula by successive calculation of the expressions −1 ˆ = r M = M 1−1V , U T M 1−1V , (M 2 − U T M 1−1V ) −1 , 1 y,q

and −1 1

−1

(M 2 − U M V ) U r . T

T

The main part of the above calculations is finding the first two expressions, which is equivalent to solving two (n 1)-by-(n - 1) tridiagonal linear systems with the same coefficient matrix M1 and different right-hand sides. After finding the value of x ′ , we can get x ′′ from the second equation of (3.2) by the formula = x ′′ M 2−1 ( y ′′ − U T x ′)

At this point, it is convenient to formulate our second result. It is a symbolic algorithm for computing the solution of a general bordered tridiagonal linear system of the form (1.1) and can be considered as a natural generalization of the the Sherman-Morrison algorithm in [7].

3.1 Algorithm To compute the solution of a general bordered tridiagonal linear system (1.1), we may proceed as follows: ˆ y ′ −V M 2−1 y ′′. Step 1: Find M1, M2, UT, V, y ′, y ′′ and y= Step 2: Solve M 1r = yˆ , and M 1q =V . Step 3: Compute x′= r + q (M 2 − U T q ) −1U T r , and x ′′ M 2−1 ( y ′′ − U T x ′) =

Step 4: Compute the solution x ′ x =  .  x ′′t = 0

Two systems M 1r = yˆ and M 1q =V in algorithm 3.1 can be solved in parallel by any symbolic tridiagonal algorithm. The symbolic Algorithm 3.1 will be referred to as SMWBTLS algorithm.

4. ILLUSTRATIVE EXAMPLES In this section, three examples are given to demonstrate the viability of the proposed algorithms.

4.1 Example

1162

iii) By applying MATLAB command A\b, it yields xMATLAB = [3.8638,−2.2838, 3.1464, 1.9121,−1.0871, 2.6192,−2.9767]T . iv)

By applying SMWBTLE algorithm, it yields xSMW = [3.8638,−2.2838, 3.1464, 1.9121,−1.0871, 2.6192,−2.9767]T .

4.2 Example Let 0 13  0  0 0  0 0  0  0  3

2 2 9 0 0 0 0 0 0 2

0 0 12 0 1 5 3 15 0 2 0 0 0 0 0 0 0 0 1 7

0 0 0 1 3 7 0 0 0 5

0 0 0 0 10 1 −5 0 0 −2

0 0 0 0 0 2 2 2 0 4

0 0 0 0 0 0 2 1 5 2

0 0 0 0 0 0 0 1 2 1

5   x1   7  3   x 2   30  2   x 3  17      1   x 4   20  5   x 5  30    =   2   x 6  12  7   x 7   6     12   x 8  16      4   x 9  11  5   x 10   28

i) By applying the BTLE algorithm in [5], it breaks down ii) By applying the SBTLE algorithm, it yields xSBTLE = [ 12067595/(8154227 t+12067595), (8516457 t+12067595)/(8154227 t+12067595), (17567204 t+12067595)/(8154227 t+12067595), (6642982 t+12067595)/(8154227 t+12067595), (5142382t+12067595) /(8154227 t+12067595),(9396731 t+12067595)/(8154227 t+12067595), (41265687 t+241351902)/(8154227 t+12067595), (7736309 t + 12067595) /(8154227 t+12067595), (14315844 t+12067595)/(8154227 t+12067595), (5595816 t+12067595)/(8154227 t+12067595) ]Tt=0 = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]T .

4.3 Example We consider the following general bordered linear system in order to demonstrate the efficiency of SBTLE algorithm and SMWBTLE algorithm. Let’s have a look at the following bordered linear system:

© RECENT SCIENCE PUBLICATIONS ARCHIVES| July 2013|$25.00 | 27702561 | *This article is authorized for use only by Recent Science Journal Authors, Subscribers and Partnering Institutions*

International Journal of Mathematical Sciences, ISSN: 2051-5995, Vol.33, Issue.2

2 1  0      0   5

3 2 1     5

0 3 2     5

 0 3     5

       

 0  0  0      3  2 5 1

4   x1   9  4   x 2   10  4   x 3   10             =            4   x n − 2   10       3  x n −1  6    2   x n  5n − 7 

It can be verified that the exact solution = is x [1, 1, …,1]T We used proposed algorithms, SBTLE and SMWBTLE Algorithms, and Gauss Elimination Algorithm to compute the solution, x . Results are given in the next table in which = ε x −x ∞. Table1. Errors and CPU times in seconds for SBTLE Algorithm, SMWBTLE Algorithm, and Gauss Elimination Algorithm when n=500, 1000, 5000, and 10000. ε x − x ∞ . and CPU time(second) = n

SBTLE Algorithm

SMWBTLE Algorithm

Linear Systems by Cyclic Reduction, Journal of Numerical Analysis, Industrial and Applied Mathematics, vol.1, no. 1, pp.5-12, 2006. [4]

P. Amodio, I. Gladwell, and G. Romanazzi, An algorithm for the solution of Bordered ABD linear systems arising from Boundary Value Problems, Multibody Dynamics 2007, ECCOMAS Thematic Conference, C.L. Bottasso, P.Maserati, L.Trainelli (eds), Milano, Italy, pp. 25-28, 2007.

[5]

W. Xing-Bo, A new algorithm with its scilab implementation for solution of bordered tridiagonal linear equations, Open-source Software for Scientific Computation (OSSC), 2009 IEEE International Workshop on Computing & Processing (Hardware/Software), pp. 11-14, 2009.

[6]

M. Allen III, E. Isaacson, Numerical Analysis for Applied Science, Wiley-Interscience, John Wiley & Sons, 1997.

[7]

M. El-Mikkawy, A new computational algorithm for solving periodic tri-diagonal linear systems, Applied Mathematics and Computation, vol. 161, pp.691-696, 2005.

[8]

G. Golub, C. Van Loan, Matrix Computations, third ed., The Johns Hopkins University Press, Baltimore and London, 1996.

Gauss Elimination Algorithm

500

3.41 x 10-8

0.061

4:40 x 1.46 x 0:163 10-8 10-7

0:062

1000

6.91 x 10-8

0.111

2.96 x 8:90 x 0:313 10-7 10-8

0:112

5000

3.49 x 10-7

0.511

1.50 x 4:49 x 1:513 10-6 10-7

0:512

10000

6.99 x 10-7

1.011

3.00 x 8:99 x 3:013 10-6 10-7

1:012

Based on the result in Table.1, we can conclude that SBTLE Algorithm is more accurate and faster than the other algorithms. Also, SMWBTLE Algorithm is better than Gauss Elimination Algorithm.

5.

CONCLUSIONS

In this paper, new symbolic computational algorithms have been developed for computing the solution of a general bordered tridiagonal linear system. The algorithms are reliable, computationally efficient and remove the cases where the numeric algorithms fail.

REFERENCES [1]

S. Pajic, Power System State Estimation and Contingency Constrained Optimal Power Flow-A Numerically Robust Implementation. Ph,D. Thesis. Worcester-Polytechnic Institute, 2007.

[2]

A. Udala, R. Reedera, E. Velmrea and P. Harrisonb, Comparison of methods for solving the Schrodinger equation for multiquantum well hetero structure applications, Proc. Estonian Acad. Sci. Eng.,vol. 12, pp.246-261, 2006.

[3]

P. Amodio, I. Gladwelly and G. Romanazzi, Numerical Solution of General Bordered ABD

1163

© RECENT SCIENCE PUBLICATIONS ARCHIVES| July 2013|$25.00 | 27702561 | *This article is authorized for use only by Recent Science Journal Authors, Subscribers and Partnering Institutions*

Suggest Documents