Homework 5: (Due Tuesday, 11/13)
We consider the linear problem Ax = b where x is the vector
of unknowns, A is a matrix and b is a known vector. Formally,
the solution for this problem can be written as x = A-1b.
In class, we considered the conjugate gradient solution of this problem using
f(x) = (Ax - b)t(Ax - b). A concrete, step-by-step
algorithm was outlined.
An alternative target function is g(x) = .5xtAx - bx solves
exactly the same problem.
- Show that minimizing g(x) indeed solves the original problem.
- Write the following matlab routines:
- A routine to compute the gradient of the function that accepts
as input the coordinates.
- A routine to compute the coefficient lambda for the
one-dimensional search. The output should be the minimized
coordinate along the search direction.
- A routine to perform a convergence test that checks if the norm of
the gradient is smaller epsilon, where epsilon is an
input parameter.
- A "main engine" that loops over the one-dimensional
minimization.
- Derive an expression for the new search direction, h1,
to be used at the first step of a conjugate gradient minimization of the
function g(x).