Download Homework for iterative methods.

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Matrix multiplication wikipedia , lookup

Cayley–Hamilton theorem wikipedia , lookup

Non-negative matrix factorization wikipedia , lookup

Singular-value decomposition wikipedia , lookup

Gaussian elimination wikipedia , lookup

Linear least squares (mathematics) wikipedia , lookup

Matrix calculus wikipedia , lookup

System of linear equations wikipedia , lookup

Transcript
Iterative Method Homework
 1  1
 0
 2
 , b    , u ( 0)    using conjugate gradients.
1. Solve Au = b with A  
1 2 
 2
 1
1
Note that the true solutions is u *    .
1
 2u  2u

 0 defined over the square 0  x 
x 2 y 2
6 and 0  y  6. Divide the square into three subdivisions in each direction (so that the x
and y increment is 2) and suppose that the boundary data is 0 except for x=6 it is u = 10.
Use the 5 point star stencil to write a system of 4 equations in 4 unknowns u1, u2, u3, u4.
2. Consider the boundary value problem
3. For n=2 use calculus to prove that a potential minimum point of F(u) = (1/ 2 ) uTA u a c 
e
 , b    and
bTu is the solution to A u = b if A is symmetric. Hint: let A  
f
c d 
 x
u    so that
 y
 a c  x 
 x
   (e f )   (1 / 2)ax 2  cxy  (1 / 2)dy 2  ex  fy  F ( x, y ).
F (u )  (1 / 2)( x y )
 c d  y 
 y
Set the partial derivatives of F with respect to x and y to zero.
4. Watkins exercise 8.1.12 (3rd edition) or 7.1.12 (2nd edition).
5. For n = 100, b = ones(n,1); and for each of the three matrices below apply 20 steps of
my cg_step code. One can do this using
k = 0; for i=1:20, cg_step, end
in Matlab. The cg_step code prints out ||r|| / ||b|| = || b – Au || / ||b|| which is a measure of
how well the current guess solves the system A u = b . Compare the final values of
||r||/||b|| for the three runs. Also for each matrix calculate cond(A) and gamma =
(sqrt(cond(A)) – 1 ) / ( sqrt(cond(A)) + 1 ). Discuss.
(a) A = diag( 1.01 .^ (0 : n – 1 ) );
(b) A = diag( 1.03 .^ (0 : n – 1 ) );
(c) A = diag( 1.1 .^ (0 : n – 1 ) );
6. For each of the following values of k = cond(A) predict how many steps are required
to reduce the error in conjugate gradients by 10-6 : k=4, 81, 9801, 99801. Use the
formulas   ( cond ( A)  1) /( cond ( A)  1) and || x m  x * || A  2  m || x0  x * || A .
According to the second formula the error will be reduced by a factor of 10 6 when
10 6  2  m .