Graphics Programs Reference
In-Depth Information
LUsol3
This is the function for the solutionphase. The vector y overwrites the constant vector
b during the forward substitution. Similarly, the solutionvector x replaces y in the
back substitutionprocess.
functionx=LUsol3(c,d,e,b)
%SolvesA*x=bwhereA=[c\d\e]istheLU
% decomposition of the original tridiagonal A.
%USAGE:x=LUsol3(c,d,e,b)
n = length(d);
fork=2:n %Forwardsubstitution
b(k) = b(k) - c(k-1)*b(k-1);
end
b(n) = b(n)/d(n);
% Back substitution
fork=n-1:-1:1
b(k) = (b(k) -e(k)*b(k+1))/d(k);
end
x=b;
Symmetric Coefficient Matrices
More often than not, coefficient matrices that arise in engineering problems are
symmetric as well as banded. Therefore, it is worthwhile to discover special prop-
erties of such matrices, and learn how to utilize theminthe construction of efficient
algorithms.
If the matrix A issymmetric, then the LU decomposition can be presentedinthe
form
LDL T
A
=
LU
=
(2.23)
LL T that
where D is a diagonal matrix. An example is Choleski's decomposition A
=
was discussedinthe previous article (in thiscase D
=
I ).ForDoolittle's decomposition
wehave
D 1
00
···
0
1 L 21
L 31
···
L n 1
0 D 2
0
···
0
0
1
L 32
···
L n 2
00 D 3
···
0
00 1
···
L n 3
DL T
U
=
=
.
.
.
. . .
.
.
.
.
. . .
.
000
···
D n
00 0
···
1
Search WWH ::




Custom Search