Math 551 Section 01 Summer 2023
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
Math 551
Section 01
Summer 2023
Chapter 5 Homework due Tuesday, June 20th at 11:59 PM
Note: Try to answer all the questions by demonstrating all the steps of your calcu- lations. Please submit your homework on Gradescope. This homework assignment covers Sections 5.1-5.3, 5.5-5.6 and 5.8. Answer all the questions by demonstrating all the steps of your calculations. The MATLAB scripts for questions 1 and 2 are posted on Blackboard. |
1. (10 points) The Gaussian elimination algorithm is implemented in MATLAB, and subsequently a function (or subroutine) is stored as my_linsolver.m, which utilizes Gaussian elimination and backward substitution to solve a system consisting of n linear equations written in the form of
ax = b.
where a is an n × n (non-singular) matrix, b a given n-dimensional column vector, and x the (n-dimensional) solution vector.
Using the m-file my_linsolver.m, solve the linear system:
3z1 + z2 + 4z3 = 6.
z2 - 2z3 = -3.
z1 + 2z2 - z3 = -2.
The exact solution is x = [1.-1.1]T . Then, use the m-file in order to solve the 4 × 4 system:
z1 + z2 + z4 = 2.
2z1 + z2 - z3 + z4 = 1.
4z1 - z2 - 2z3 + 2z4 = 0.
3z1 - z2 - z3 + z4 = -3.
Compute the l2-norm of the residual llb - ax(ˆ)ll 2 where x(ˆ) is the approximate solution computed for the 4 × 4 system. Provide the MATLAB output.
2. (20 points) Modify them-file lu_decomp.m that implements the LU-decomposition
(without partial pivoting) algorithm in MATLAB. Modify and use the my_linsolver_lu. m script to solve the 4 × 4 linear system of Question 1. This script internally employs
Gaussian elimination (in order to convert a into U and L) together with forward and backward substitutions (recall the algorithm itself for solving a linear system by LU decomposition). Provide the MATLAB output.
3. (20 points) Find the Pa = LU decomposition for the matrix
a = |
|
1 2 3 |
2 1 2 |
3(4) ┐ . 4 ' |
Show all steps and clearly describe each of the matrices and algorithms at each stage.
4. (20 points) Find the Cholesky factorization a = LLT for the matrix
a = |
|
4 2 6 |
2 2 5 |
5(6) ┐ . 22 ' |
Show all steps, and you may use MATLAB’s chol command to verify your answer.
5. (30 points) Consider the following matrix a, rhs vector b, and two approximate solutions x1 and x2
a = ┌0.21(1.29)6(6)1(9) 0.14(0.86)4(4)1(8)┐ . b = ┌0.14(0.86)4(4)0(2)┐ . x1 = ┌1(0)┐ . x2 = ┌ -00(.)94(9)8(1)7(1)0┐ .
respectively.
(a) (5 points) Show that x = [2.-2]T is the exact solution of ax = b.
(b) (5 points) Compute the error and residual vectors for x1 and x2 .
(c) (10 points) Use MATLAB to find llall & , lla-1 ll & and the condition number K& (a). Note that in MATLAB the inverse of a matrix a is inv(A) while the condition number is available as a built-in command (try help cond).
(d) (10 points) In class, we proved that the relative error in the solution is bounded by
< K(a) .
where K(a) is the condition number of a, e = x -x(ˆ) and r(ˆ) are the error and residual vectors, respectively. Then, verify this result for the two approximate solutions x1 and x2 given by using the o-norm.
2023-06-19