-
A small pivot in an otherwise simple system
Solve A*x = b with
A = [[10−14, 1], [1, 1]] and
b = [1 + 10−14, 2] in double
precision. Compare elimination without pivoting, the companion
Gaussian elimination code, and a library solve. Compute
max|A*x − b| and
max|x − [1,1]| using the original data.
Why can the order of elimination matter even though the exact
solution is [1,1]? Repeat with the top-left
entry set to 10−8 and adjust
b accordingly.
-
A small residual and sensitive data
Set δ = 10−8,
A = [[1,1], [1,1+δ]], and
b = [0,−δ]. Solve the system and
check against x = [1,−1]. Then replace
only the second component of b by
−δ + 10−10 and solve
again. The exact new solution is
[0.99,−0.99]. Compare each solve’s
residual against its own input data and the change in the
solution. Repeat with δ = 10−6.
Explain why a small residual alone does not measure uncertainty
in the supplied physical data.
-
Relaxation is a parameter, not a guarantee of speed
Apply SOR to A = [[5,1,0], [1,5,1], [0,1,5]]
and b = [7,10,−3]. Start from
x = [0,0,0], use
ω = 0.8, 1.0, 1.3, 1.8, and stop at
max|A*x − b| ≤ 10−10
or 500 sweeps. Record the sweep counts and compare each
result with [1,2,−1]. Which tested value
is fastest for this particular system? Vary the off-diagonal
entries while keeping the matrix strictly diagonally dominant.
-
When the Thomas algorithm needs a pivot
Consider the tridiagonal matrix
A = [[0,1,0], [1,2,1], [0,1,2]] with
b = [1,4,3]. Try the companion Thomas solver and
record its failure indication. Then solve with a pivoted
library routine and verify x = [1,1,1] to a
residual below 10−12. Explain
why tridiagonal structure alone does not make the no-pivot
algorithm safe. Change the first diagonal entry to 2,
recompute b = A*[1,1,1], and try again.
-
What a converged power method has found
Use A = diag(−5,2,1) and a residual
tolerance ||A*y − λy||2
≤ 10−8, with at most 500
iterations. First start from y = [1,1,1] and
check that the eigenvalue with largest magnitude is negative.
Then start from y = [0,1,1]. The latter run can
converge with a small residual to λ = 2,
because its initial vector has no component along the
−5 eigenvector. Explain why a small
residual ||A*y − λy||2
validates a computed eigenvalue and eigenvector but does not
establish that the eigenvalue is dominant.
-
Choosing a shift for one eigenvalue
For A = [[2,1,0], [1,2,0], [0,0,6]], compute
the full spectrum with Jacobi or a symmetric library solver.
Then use shifted inverse iteration with
y = [1,0,1], shift σ = 2.6,
residual tolerance 10−10 for
||A*y − λy||2,
and a limit of 100 iterations. It should select
λ = 3 from the exact spectrum
1, 3, 6. Try σ = 3 and explain
the singular shifted solve. At σ = 2,
the eigenvalues 1 and 3 are equally close. With this starting
vector their components have equal magnitude, so the
iteration stalls on a mixture and reaches the 100-iteration
limit without meeting the residual tolerance. Explain why
a unique convergence target is no longer assured.
-
Repeated eigenvalues and nonunique eigenvectors
Find all eigenvalues and eigenvectors of
A = [[3,1,0], [1,3,0], [0,0,2]] with the
companion Jacobi program and a symmetric library solver.
Use a squared off-diagonal tolerance of
10−18 and at most 100 Jacobi
sweeps. Verify ||A*v − λv||2
< 10−8 and
||XTX − I||∞
< 10−8. The eigenvalues are
2, 2, 4. The two vectors belonging to 2 may
differ between solvers: compare their two-dimensional span
instead of matching their components one by one.