From: robin Subject: Re: Solve a n x n system with tridiagonal matrix method Date: Fri, 08 Oct 1999 12:59:49 GMT Newsgroups: sci.math.num-analysis "Nikos Hatzistelios" writes: > How can I do that ? > Pls point me to some directions or resources > or even better answer to me directly or in > this newsgroup. > > Thanks > hatzisn@x-treme.gr There is an example in "Introduction to PL/I, Algorithms, and Structured Programming" 0-8586384-8-2 with explanation. ============================================================================== From: rroachJUNK@cvd-pro.com.JUNK Subject: Re: Solve a n x n system with tridiagonal matrix method Date: Sun, 10 Oct 1999 08:03:17 GMT Newsgroups: sci.math.num-analysis I presume scalar tridiagonal (i.e. each nonzero element is only a 1x1 matrix). So let the three diagonals be represented by c(i),b(i),a(i) and let the rhs be represented by d(i) so that the linear system is given by: c(i)*x(i-1) + b(i)*x(i) + a(i)*x(i+1) = d(i) the array x(i) is the array of unknowns. Your matrix is nxn, so the algorithm is: rem--------- eliminate the c-diagonal ----------------- for i = 1 to n cbi = c(i)/b(i-1) b(i) = b(i) - cbi*a(i-1) d(i) = d(i) - cbi*d(i-1) next rem--------- solution on last row ------------------------ d(n) = d(n)/b(n) rem------------ back substitution ------------------------ for i = n-1 to 1 step -1 d(i) = (d(i) - a(i)*d(i+1))/b(i) next The solution is now in the d(i) array. If you want to transfer them to the x(i) array, then another loop will do it. If your system is block tridiagonal, the you'll need a block tridiagonal solver. I've got one if you want it. Bob [original article quoted --djr] ============================================================================== From: jzhang@cs.engr.uky.edu (Jun Zhang) Subject: Re: Solve a n x n system with tridiagonal matrix method Date: 8 Oct 1999 13:19:08 GMT Newsgroups: sci.math.num-analysis The LU factorization algorithm of a tridiagonal matrix can be found, e.g., on page 45 of P. Wesseling's book entitled "An Introduction to Multigrid Methods", Wiley, Chichester, 1992. There is, however, a printing error in the backsubstitution (4.3.7), the second formula of the second line should be u_{k} = y_{k} - \epsilon_{k}u_{k+1}, hope this help. Jun Zhang ---------- In article <9VlL3.425$_4.692@newsfeeds.bigpond.com>, robin wrote: [first article above quoted --djr] -- ********************************************************************** * Jun Zhang * E-mail: jzhang@cs.uky.edu * * Department of Computer Science * URL:http://www.cs.uky.edu/~jzhang * * University of Kentucky * Tel:(606)257-3892 *