- Computer demonstrations of solving dense linear systems and
solving sparse linear systems :
- Download and run the Matlab codes in
http://www.cse.ucsc.edu/~hongwang/Codes/Dense_linear_sys
"no_pivoting.m" in directory "well_conditioned" demonstrates that solving
a well-conditioned system using LU decomposition without pivoting
may result in large numerica errors.
"pivoting.m" in directory "well_conditioned" demonstrates that solving a
well-conditioned system using LU decomposition with pivoting yields
good results.
"perturbation.m" in directory "well_conditioned" demonstrates that
for a well-conditioned system small perturbations in A and b result
in a small change in x.
"perturbation.m" in directory "ill_conditioned" demonstrates that
for an ill-conditioned system small perturbations in A and b result
in a large change in x.
-
Download and run the Matlab codes in
http://www.cse.ucsc.edu/~hongwang/Codes/Sparse_linear_sys
"sd_0.m" and "sd_1D.m" in directory "Steepest_Descent" use the steepest descent method to solve A*u=b.
- "sd_0.m" solves a simple 2x2 linear system.
- "sd_1D.m" solves a 100x100 tridiagonal linear system.
"cg_0.m", "cg_1D.m" and "cg_2D.m" in directory "Conjugate_Gradient" use the conjugate gradient
method to solve A*u=b.
- "cg_0.m" solves a simple 2x2 linear system.
- "cg_1D.m" solves a 100x100 tridiagonal linear system.
- "cg_2D.m" solves a 10000x10000 sparse linear system obtained from
discretizing a two-dimensional Poisson equation with N=101.