MATLAB LEFT DIVISION Applied Numerical Methods with MATLAB fo

PROBLEMS 267 PROBLEMS 10.1 Determine the total flops as a function of the number of equations n for the a factorization, b forward substitu- tion, and c back substitution phases of the LU factorization version of Gauss elimination. 10.2 Use the rules of matrix multiplication to prove that Eqs. 10.7 and 10.8 follow from Eq. 10.6. 10.3 Use naive Gauss elimination to factor the following system according to the description in Section 10.2: 7x 1 + 2x 2 − 3x 3 = − 12 2x 1 + 5x 2 − 3x 3 = − 20 x 1 − x 2 − 6x 3 = − 26 Then, multiply the resulting [L] and [U] matrices to deter- mine that [A] is produced.

10.4 a

Use LU factorization to solve the system of equations in Prob. 10.3. Show all the steps in the computation. b Also solve the system for an alternative right-hand-side vector {b} T = ⌊ 12 18 − 6⌋ 10.5 Solve the following system of equations using LU factorization with partial pivoting: 2x 1 − 6x 2 − x 3 = − 38 − 3x 1 − x 2 + 6x 3 = − 34 − 8x 1 + x 2 − 2x 3 = − 40 10.6 Develop your own M-file to determine the LU factoriza- tion of a square matrix without partial pivoting. That is, de- velop a function that is passed the square matrix and returns the triangular matrices [L] and [U]. Test your function by using it to solve the system in Prob. 10.3. Confirm that your function is working properly by verifying that [L][U ] = [ A] and by using the built-in function lu . 10.7 Confirm the validity of the Cholesky factorization of Example 10.5 by substituting the results into Eq. 10.14 to verify that the product of [U] T and [U] yields [A].

10.8 a

Perform a Cholesky factorization of the following symmetric system by hand: ⎡ ⎣ 8 20 16 20 80 50 16 50 60 ⎤ ⎦ ⎧ ⎨ ⎩ x 1 x 2 x 3 ⎫ ⎬ ⎭ = ⎧ ⎨ ⎩ 100 250 100 ⎫ ⎬ ⎭ b Verify your hand calculation with the built-in chol function. c Employ the results of the factorization [U] to determine the solution for the right-hand-side vector. 10.9 Develop your own M-file to determine the Cholesky factorization of a symmetric matrix without pivoting. That is, develop a function that is passed the symmetric matrix and returns the matrix [U]. Test your function by using it to solve the system in Prob. 10.8 and use the built-in function chol to confirm that your function is working properly. 10.10 Solve the following set of equations with LU factor- ization with pivoting: 3x 1 − 2x 2 + x 3 = − 10 2x 1 + 6x 2 − 4x 3 = 44 − 8x 1 − 2x 2 + 5x 3 = − 26

10.11 a

Determine the LU factorization without pivoting by hand for the following matrix and check your results by validating that [L][U] = [A]. ⎡ ⎣ 8 5 1 3 7 4 2 3 9 ⎤ ⎦ b Employ the result of a to compute the determinant. c Repeat a and b using MATLAB.

10.12 Use the following LU factorization to a compute

the determinant and b solve [A]{x} = {b} with {b} T = ⌊− 10 50 − 26⌋. [ A] = [L][U ] = ⎡ ⎣ 1 0.6667 1 − 0.3333 − 0.3636 1 ⎤ ⎦ × ⎡ ⎣ 3 − 2 1 7.3333 − 4.6667 3.6364 ⎤ ⎦ 10.13 Use Cholesky factorization to determine [U] so that [ A] = [U ] T [U ] = ⎡ ⎣ 2 − 1 − 1 2 − 1 − 1 2 ⎤ ⎦ 10.14 Compute the Cholesky factorization of [ A] = ⎡ ⎣ 9 25 16 ⎤ ⎦ Do your results make sense in terms of Eqs. 10.15 and 10.16? 268 Matrix Inverse and Condition