Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please solve these question as the requirement it shows Problem 9 (3 points) Write a Matlab function myCondInfinity that takes as input a matrix A

image text in transcribedimage text in transcribedplease solve these question as the requirement it shows

Problem 9 (3 points) Write a Matlab function myCondInfinity that takes as input a matrix A and returns as output the condition number of the matrix using the infinity norm. Within the function call the functions myInverse and myInfinityNorm you developed in problems 7 and 8. Problem 9 required submission. . Softcopy printout of well commented function you coded included in your Gradescope submission Upload of all your Matlab.m function and script files to the Take Home Eram 1 assignment on Canvas Problem 10 (30 points) (Core Course Outcomes 2 & 6) Consider the system of linear equations Ax b, where A is a 140x140 matrix containing random numbers (generate by A-rand (140,140);) and b is a column vector containing 140 entries, all of them 1 (generate by b-ones (140,1);). For 200 different random number matrices A do the following tasks a) Calculate the condition number of A using the infinity norm (use the function myCondInfinity de- veloped in Problem 9). Store the condition number for each of the 200 matrices A in an array c b) Solve the system for f using Gauss-Jordan without partial pivoting using your function myGauss Jordan from Homework 2. Calculate the infinity norm of the residual of your solution making use of function myInfinityNorm developed in Problem 8. To calculate the residual, you may use the Matlab construct A*x to calculate Ai. Store the infinity norm of the residual for each of the 200 solutions in an array c) Solve the system for using Gauss-Jordan with partial pivoting using the function myGaussPartialPivot developed in Problem 6. Calculate the infinity norm of the residual of your solution making use of function myInfinityNorm developed in Problem 8. To calculate the residual, you may use the Matlab construct A*x to calculate AT. Store the infinity norm of the residual for each of the 200 solutions in an array rp1 Having calculated 200 condition numbers and the corresponding residual norms without and with partial pivoting, next do the following tasks d) Plot the residual norms versus the condition number using a log-log scale. Use the matlab command loglog(c,r1, 'ro',c,rpi, 'b*') which plots the results without pivoting as red circles and the results with partial pivoting as blue stars. Add legends and axis labels e) Based on the graph, fill in the blank Smaller condition numbers of A result in using no pivoting Smaller condition numbers of A result in using partial pivoting Using pivoting smaller/larger) norms of the residual when (smaller/larger) norms of the residual when (no/partial) pivoting results in smaller error norms than using (no/partial) Write a script to solve problem 10 that calls all the required functions Problem 10 required submission: . Softcopy printout of any additional function you coded and potential setup/script of your problem included in your Gradescope submission, . Generated graph, Handwritten or typed answers to fill in the blank Upload of all your Matlab.m function and script files to the Take Home Eram 1 assignment on Canvas Problem 9 (3 points) Write a Matlab function myCondInfinity that takes as input a matrix A and returns as output the condition number of the matrix using the infinity norm. Within the function call the functions myInverse and myInfinityNorm you developed in problems 7 and 8. Problem 9 required submission. . Softcopy printout of well commented function you coded included in your Gradescope submission Upload of all your Matlab.m function and script files to the Take Home Eram 1 assignment on Canvas Problem 10 (30 points) (Core Course Outcomes 2 & 6) Consider the system of linear equations Ax b, where A is a 140x140 matrix containing random numbers (generate by A-rand (140,140);) and b is a column vector containing 140 entries, all of them 1 (generate by b-ones (140,1);). For 200 different random number matrices A do the following tasks a) Calculate the condition number of A using the infinity norm (use the function myCondInfinity de- veloped in Problem 9). Store the condition number for each of the 200 matrices A in an array c b) Solve the system for f using Gauss-Jordan without partial pivoting using your function myGauss Jordan from Homework 2. Calculate the infinity norm of the residual of your solution making use of function myInfinityNorm developed in Problem 8. To calculate the residual, you may use the Matlab construct A*x to calculate Ai. Store the infinity norm of the residual for each of the 200 solutions in an array c) Solve the system for using Gauss-Jordan with partial pivoting using the function myGaussPartialPivot developed in Problem 6. Calculate the infinity norm of the residual of your solution making use of function myInfinityNorm developed in Problem 8. To calculate the residual, you may use the Matlab construct A*x to calculate AT. Store the infinity norm of the residual for each of the 200 solutions in an array rp1 Having calculated 200 condition numbers and the corresponding residual norms without and with partial pivoting, next do the following tasks d) Plot the residual norms versus the condition number using a log-log scale. Use the matlab command loglog(c,r1, 'ro',c,rpi, 'b*') which plots the results without pivoting as red circles and the results with partial pivoting as blue stars. Add legends and axis labels e) Based on the graph, fill in the blank Smaller condition numbers of A result in using no pivoting Smaller condition numbers of A result in using partial pivoting Using pivoting smaller/larger) norms of the residual when (smaller/larger) norms of the residual when (no/partial) pivoting results in smaller error norms than using (no/partial) Write a script to solve problem 10 that calls all the required functions Problem 10 required submission: . Softcopy printout of any additional function you coded and potential setup/script of your problem included in your Gradescope submission, . Generated graph, Handwritten or typed answers to fill in the blank Upload of all your Matlab.m function and script files to the Take Home Eram 1 assignment on Canvas

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

OUTCOME 6 Explain and give examples of diversity management.

Answered: 1 week ago