Answered step by step
Verified Expert Solution
Question
1 Approved Answer
**please use Matlab for this problem** 2. The goal of this exercise is to emphasize how, when solving a linear system, the choice of which
**please use Matlab for this problem**
2. The goal of this exercise is to emphasize how, when solving a linear system, the choice of which method to use is extremely important, especially in the case of matrices which are close to singular (these matrices are often refereed to as ill conditioned.) Similarly to Exercise 1, in this exercise you will solve a system using two methods: the "" operator method and the inverse method. One of these two methods will produce extremely inaccurate results, while the other will produce the exact answer. Consider the 90 x 90 matrix: [ 1 -1 ... -1 ] o 1... : . . -1 O ... 0 1 Use the following MATLAB commands to generate the matrix B, the matrix A = BTB and two vectors b and z n = 90; B = eye(n) - triu(ones (n),1); A=B'*B; z = ones(n,1); b= A*z; Similarly to the previous problem, the exact solution of the system Ax=b is the vector z. Compute the solution using the "\" and using the inverse: x = A\b; y = inv(A)*b; Compare the accuracy of the two methods as in the previous problem, that is, compute sum (abs(x - 2)) sum (abs(y - z)) Recall that the two commands above compute how close the computed solution is to the exact solution. Thus the smaller value is associated to the more accurate method. Which method produces the more accurate solution? If you solved this exercise correctly, you should have found that the inverse method produced a very inaccurate result. This is not a coincidence. In fact, in real applications, the inverse matrix is never used to solve linear systems. Besides being inaccurate, this method is also numerically inefficient since it requires a high number of computations. Finding methods that are both efficient and accurate is one of the main goals of applied linear algebra. Just like the "\" operator, these methods are often based on matrix factorizations, which you will learn in later chaptersStep 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