Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For this homework assignment, you may write a MATLAB script or use the MATLAB command line to perform the required operations, but you should write
For this homework assignment, you may write a MATLAB script or use the MATLAB command line to perform the required operations, but you should write up the solution separate from the MATLAB script. Although it appears in various applications, the Hilbert matrix is notoriously ill-conditioned. (a) Generate a single precision 6 times 6 Hilbert matrix (H) using the command. Find the condition number of the matrix. (b) Define a single precision vector, b, of length 6 which has each element equal to 1. You may use the ones command to do this. Find H^-1, the inverse of H. Find a solution to Hx_H = b by multiplying the inverse of H by the vector b. (c) Estimate the error (e) in the solution using the expression e = H^-1 gamma. (d) The true solution is x_t = [-6, 210, -1680, 5040, -6300, 2772]^T. Find the true error, e_t. Explain why this value is not the same as the error calculated in part (e). (e) Does the expression given in class, ||e||/||x_T|| lessthanorequalto cond(A) ||Delta A/A|| reasonably predict the expected number of significant (correct) digits in the calculated solution? Explain and show your work. (f) Find a solution to Hx_H = b using the left divide function and find the true error. Compare this result with that in part d. What conclusions can you draw regarding the accuracy of using different methods of solving linear systems in MATLAB? Repeat (a) through (d) above, but using double precision. (For (d), explain why the true error is much closer to the error calculated in part (c) than it was in problem 1.) Repeat (a) through (d) above using double precision, but this time for a 10 times 10 Hilbert matrix. Note that the true solution for the 10 times 10 system (b = a vector of length 10 with each element equal to one) is x_t = [-10, 990, -23760, 240240, -1261260, 3783780, -6726720, 700128, -3938220, 923780]. For this problem, in order to save paper, you need not print out the 10 times 10 Hilbert matrix. Without extended precision, it is difficult to do much about improving the solution for the Hilbert case. If you truly need to solve a poorly conditioned matrix equation, you may need to use an application that has extended precision capability. For this homework assignment, you may write a MATLAB script or use the MATLAB command line to perform the required operations, but you should write up the solution separate from the MATLAB script. Although it appears in various applications, the Hilbert matrix is notoriously ill-conditioned. (a) Generate a single precision 6 times 6 Hilbert matrix (H) using the command. Find the condition number of the matrix. (b) Define a single precision vector, b, of length 6 which has each element equal to 1. You may use the ones command to do this. Find H^-1, the inverse of H. Find a solution to Hx_H = b by multiplying the inverse of H by the vector b. (c) Estimate the error (e) in the solution using the expression e = H^-1 gamma. (d) The true solution is x_t = [-6, 210, -1680, 5040, -6300, 2772]^T. Find the true error, e_t. Explain why this value is not the same as the error calculated in part (e). (e) Does the expression given in class, ||e||/||x_T|| lessthanorequalto cond(A) ||Delta A/A|| reasonably predict the expected number of significant (correct) digits in the calculated solution? Explain and show your work. (f) Find a solution to Hx_H = b using the left divide function and find the true error. Compare this result with that in part d. What conclusions can you draw regarding the accuracy of using different methods of solving linear systems in MATLAB? Repeat (a) through (d) above, but using double precision. (For (d), explain why the true error is much closer to the error calculated in part (c) than it was in problem 1.) Repeat (a) through (d) above using double precision, but this time for a 10 times 10 Hilbert matrix. Note that the true solution for the 10 times 10 system (b = a vector of length 10 with each element equal to one) is x_t = [-10, 990, -23760, 240240, -1261260, 3783780, -6726720, 700128, -3938220, 923780]. For this problem, in order to save paper, you need not print out the 10 times 10 Hilbert matrix. Without extended precision, it is difficult to do much about improving the solution for the Hilbert case. If you truly need to solve a poorly conditioned matrix equation, you may need to use an application that has extended precision capability
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started