$29
Note: Please use Matlab, or a public domain approximation to it in this assignment. The code must compile on one of the lab machines with your instructions. Document your code thoroughly!
Instructions
1. Complete the LU decomposition of the matrix A where the * entries are the unknowns.
4 1 −2
1
0
0
4 1
−2
4
4
−3
* 1
0
0
* *
.A =
=
8
4
0
*
* 1
0
0
*
0
Ax = 3
2. Using this decomposition determine the solution of
16
3. The two matrices B and C are superficially “similar” to matrix A above.
4 1
−2
2 1
−2
4
4
−3
and
4
4
−3
B =
C =
are their LU decompositions
8
4
2
8
4
4
similar too?
1
4. This is practical example of a small but real-life-type ill-conditioned problem The flow
1
⎤
⎡−2
1
⎤ ⎡
ℎ1
⎤
⎡ −
ℎ2
of water through two very different materials gives this system of linear equations :
0
1
−2
1
1
ℎ3
0
1
−2
⋱
⋱
⋮
⋮
12
⋱
0
=
1
−(1 + )
ℎ
⋮
∆
⋱
⋱
⋱
⋮
0
−2
0
−2
−2
ℎ −1
−
ℎ
The coefficient a
can be very small indeed a = 1.0e-7 giving
an ill-conditioned matrix.ℎ
−2
Use ∆
= 1= 21, 41, 81, 161 .
For values of a = 1.0, 1.0e-1,1.0e-3, 1.0e-5, 1.0e-7 and 1.0e-9, 1.0e-11, 1.0e-13, 1.0e-15 compute the estimated condition number using the matlab condition number estimator. How does the condition number vary with the value of a . Explain by using graphs.
If 1 = 8 = 4 Solve the system of equations for n= 161, where a = 1.0, a = 1.0e-5 and a = 1.0e-15. Use iterative refinement to check and improve your answer if possible.
What to turn in
For these assignments, we expect both SOURCE CODE and a written REPORT be uploaded as a zip or tarball file to Canvas.
Source code for all programs that you write, thoroughly documented.
o Include a README file describing how to compile and run your code.
Your report should be in PDF format and should stand on its own.
o It should describe the methods used, explain your results and contain figures. o It should also answer any questions asked above.
o It should cite any sources used for information, including source code. o It should list all of your collaborators.
This homework is due on March 11 by 11:59 pm. If you don't understand these directions, please send questions to the TAs or come to see one of the TAs or the instructor during office hours well in advance of the due date.