Question: Please use Python preferably. Explain the answer thank you. 2.8. Multiplying both sides of a linear system Ax = b by a nonsingular diagonal matrix

Please use Python preferably. Explain the answer thank you.

2.8. Multiplying both sides of a linear system Ax = b by a nonsingular diagonal matrix D to obtain a new system DAx = Db simply rescales the rows of the system and in theory does not change the solution. Such scaling does affect the condition number of the matrix and the choice of pivots in Gaussian elimination, however, so it may affect the accuracy of the solution in finite- precision arithmetic. Note that scaling can intro- duce some rounding error in the matrix unless the entries of D are powers of the base of the floating- point arithmetic system being used (why?). Using a linear system with randomly chosen ma- trix A, and right-hand-side vector b chosen so that the solution is known, experiment with various scaling matrices D to see what effect they have on the condition number of the matrix DA and the solution given by a library routine for solv- ing the linear system DAx = Db. Be sure to try some fairly skewed scalings, where the magni- tudes of the diagonal entries of D vary widely (the purpose is to simulate a system with badly chosen units). Compare both the relative residuals and the error given by the various scalings. Can you find a scaling that gives very poor accuracy? Is the residual still small in this case?

Please use Python preferably. Explain the answer thank you. 2.8. Multiplying bothsides of a linear system Ax = b by a nonsingular diagonal

2.8. Multiplying both sides of a linear system Ax = b by a nonsingular diagonal matrix D to obtain a new system D Ax = Db simply rescales the rows of the system and in theory does not change the solution. Such scaling does affect the condition number of the matrix and the choice of pivots in Gaussian elimination, however, so it may affect the accuracy of the solution in finite- precision arithmetic. Note that scaling can intro- duce some rounding error in the matrix unless the entries of D are powers of the base of the floating- point arithmetic system being used (why?). Using a linear system with randomly chosen ma- trix A, and right-hand-side vector b chosen so that the solution is known, experiment with various scaling matrices D to see what effect they have on the condition number of the matrix DA and the solution given by a library routine for solv- ing the linear system DAx = Db. Be sure to try some fairly skewed scalings, where the magni- tudes of the diagonal entries of D vary widely (the purpose is to simulate a system with badly chosen units). Compare both the relative residuals and the error given by the various scalings. Can you find a scaling that gives very poor accuracy? Is the residual still small in this case? 2.8. Multiplying both sides of a linear system Ax = b by a nonsingular diagonal matrix D to obtain a new system D Ax = Db simply rescales the rows of the system and in theory does not change the solution. Such scaling does affect the condition number of the matrix and the choice of pivots in Gaussian elimination, however, so it may affect the accuracy of the solution in finite- precision arithmetic. Note that scaling can intro- duce some rounding error in the matrix unless the entries of D are powers of the base of the floating- point arithmetic system being used (why?). Using a linear system with randomly chosen ma- trix A, and right-hand-side vector b chosen so that the solution is known, experiment with various scaling matrices D to see what effect they have on the condition number of the matrix DA and the solution given by a library routine for solv- ing the linear system DAx = Db. Be sure to try some fairly skewed scalings, where the magni- tudes of the diagonal entries of D vary widely (the purpose is to simulate a system with badly chosen units). Compare both the relative residuals and the error given by the various scalings. Can you find a scaling that gives very poor accuracy? Is the residual still small in this case

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!