Lab 13 · Lecture 13 · LU, Cholesky and Tridiagonal Systems
LU Cholesky Thomas Lab
Factor your own matrices step by step (LU with or without pivoting, Cholesky), then solve many right-hand sides and tridiagonal systems in code.
Type [A | b] (or just A). Watch L fill with the multipliers while U is eliminated, then the forward and backward substitutions. Turn on pivoting to see PA = LU.
Cholesky works only for symmetric positive definite matrices. Try changing one diagonal entry until it fails.
LU once, many right-hand sides
Try this
Thomas algorithm
Try this
Cholesky
Try this
Q1 Factor by Doolittle and solve with .
, ; ; .
Q2 Why is LU better than Gaussian elimination when there are many right-hand sides?
Elimination costs and depends only on ; LU stores its result (L and U). Each further needs only forward and back substitution, operations, instead of repeating the .
Q3 When can Cholesky be used, and what does it cost?
When is symmetric positive definite. costs about operations (half of LU) and needs no pivoting. If a number under a square root is , is not positive definite.
Q4 Find the Cholesky factor of .
, , , , , .
Q5 Solve , , , by the Thomas algorithm.
, ; back: , , , .