Title: Thomas algorithm to solve tridiagonal matrices
1Thomas algorithm to solve tridiagonal matrices
2Basically sets up an LU decomposition three
parts 1) decomposition 2) forward substitution 3)
backward substitution
31) decomposition loop from rows 2 to n ai
ai/bi-1 bi bi-aici-1 end loop 2) forward
substitution loop from 2 to n ri ri -
airi-1 end loop
43) back substitution xn rn/bn loop from n-1 to
1 xi (ri-cixi1)/bi end loop
5Example
First decompose T
6loop from rows 2 to 5 ai ai/bi-1 bi
bi-aici-1 end loop
7forward substitution loop from 2 to n ri ri -
airi-1 end loop
8back substitution xn rn/bn loop from n-1 to
1 xi (ri-cixi1)/bi end loop
9Crout algorithm - alternate LU decomposition Inste
ad of 1s on diagonal of L, get 1s on diagonal
of U Operate on rows and columns sequentially,
narrowing down to single element
10Algorithm
for j2 to n-1
11Cholesky decomposition A decomposition for
symmetric matrices Symmetric matrix e.g. a
covariance matrix
12For symmetric matrices, can write
Can develop relationships for l
13Example
1st row
Skip this equation
14Row 2
15Row 3
16Row 4
17(No Transcript)
18Iterative methods for solving matrix equations 1.
Jacobi 2. Gauss-Seidel 3. Successive
overrelaxation (SOR)
19What are C and d?
20Rewrite matrix equation in same way
becomes
21Then
22Jacobi method is like fixed point
iteration Example Shape of a stretched membrane
23Shape can be described by potential function
Let us give some boundary conditions
24Problem look likes this
Solve for us
25Leads to this system of equations
26Choose an initial u1 1 1 1 1
Iterate using xCxd
27Matlab solution, 49 iterations
28Gauss-Seidel method differs from Jacobi by
sequential updating - use new xis as they become
available
29Example
Jacobi
Gauss-Seidel