Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Conditioning and relative error python For this question assume all norms and condition numbers refer to the 2-norm You are given a 50 50 matrix

Conditioning and relative error

python

image text in transcribedimage text in transcribed

For this question assume all norms and condition numbers refer to the 2-norm You are given a 50 50 matrix A. You are also given a true vector x (xt rue) and an approximate vector x (xhat) 1. Compute the error vector Xerr (between the true vector x and the approximate vector ) and store it in err_xhat. 2. Compute the relative error 3. Calculate the relative error in A with respect to Ax and store it in relerr_Axhat. 4. Compute the condition number of A and store it in cond_A (you may use numpy.linalg.cond) 5. Use the relative error of the approximate vector (rel_err_xhat) and the condition number of A Xerr (cond_A) to calculate an upper bound on the relative error of Ak and store this upper bound in the variable bound_rel_err_Axhat. The setup code gives the following variables: Description A matrix true solution approximate solution Name Type 2D numpy array 1D numpy array D numpy array xtrue xhat Your code snippet should define the following variables: Name err_xhat rel_err_xhat rel_err_Axhat cond A bound_rel_err_Axhat floating point number Type 1D numpy array floating point number floating point number floating point number Description error vector for relative error in x relative error in AR condition number of A upper bound on the relative error in AR user_code.py For this question assume all norms and condition numbers refer to the 2-norm You are given a 50 50 matrix A. You are also given a true vector x (xt rue) and an approximate vector x (xhat) 1. Compute the error vector Xerr (between the true vector x and the approximate vector ) and store it in err_xhat. 2. Compute the relative error 3. Calculate the relative error in A with respect to Ax and store it in relerr_Axhat. 4. Compute the condition number of A and store it in cond_A (you may use numpy.linalg.cond) 5. Use the relative error of the approximate vector (rel_err_xhat) and the condition number of A Xerr (cond_A) to calculate an upper bound on the relative error of Ak and store this upper bound in the variable bound_rel_err_Axhat. The setup code gives the following variables: Description A matrix true solution approximate solution Name Type 2D numpy array 1D numpy array D numpy array xtrue xhat Your code snippet should define the following variables: Name err_xhat rel_err_xhat rel_err_Axhat cond A bound_rel_err_Axhat floating point number Type 1D numpy array floating point number floating point number floating point number Description error vector for relative error in x relative error in AR condition number of A upper bound on the relative error in AR user_code.py

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

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

What are the three most common methods of setting a budget?

Answered: 1 week ago