Additional Assignment: Watch the following supplemental videos: \"Condition numb
ID: 3348584 • Letter: A
Question
Additional Assignment: Watch the following supplemental videos: "Condition number Parts 1 & 2" "Computation complexity "Benchmarking with tic and toc"Big Systems of ODEs Problem 1. Sensitivity of Linear Systems The Hilbert matrix H, of order n is defined with elements it j-1 in Matab, hi lb (n) will generate H,; usc help hilb for more information a. Compute the condition numbers of H, in the infinity-norm for n 2., nx, where is the maximum value of n such that the condition number is less than 1016. Save these condition numbers as an-1x1 column vector in Al.dat using the "save -ascii" command. Hint: Use help cond b. Let z, be a nxl column vector whose entries are all ones. Mathematically, " = H.-1 (H.z.) = H, (H:l.). Computationally, there are numerical errors due to the large condition numbers. Compute the infinity-norm of and llz"-H. (H%,L for n=2, ,nma . Save these norms as (nma-1)×2 matrix in liz,- norms as -1x2 matrix in A2.dat using the "save -ascii" command. The first and second columns ,' (H,il and k-H,(H%, correspond to the norms of .-H , respectively. Hint: Use help norm and DO NOT use inv. The inverse of H,, let's call it iH,, is calculated in Matlab using invhilb (n). Repeat (b) but with I:,-iH. (H?)L and Iz"-H, (iH?)L. Save these norms as (nmx-1) x2 matrix in A3.dat using the "save -ascii" command. The first and second columns c. correspond to the norms of , -H, (H.M. and F.-H. (u esson: Different orderings of matrix multiplication may introduce different numerical errors.Explanation / Answer
%%% A)
clc;
clear all;
close all;
format long
%%%% (a)
no_m=10^(16);
k=1;
n=2;
while k < no_m
for i=1:n
for j=1:n
H(i,j)=1/(i+j-1);
end
end
k=cond(H);
k1(n-1)=k;
n=n+1;
end
kl=k1(1:end-1);
save('A1.dat','kl','-ascii');
%%%%% (B)
clc;
clear all;
close all;
format long
%%%% (a)
no_m=10^(16);
k=1;
m=12;
for n=2:m
for i=1:n
for j=1:n
H(i,j)=1/(i+j-1);
end
end
Zn=ones(n,1);
kjh1=Zn-H(H*Zn);
kjh2=Zn-H*(HZn);
l1=norm(kjh1,'inf');
l2=norm(kjh2,'inf');
F2(n-1,:)= [l1,l2];
end
save('A2.dat','F2','-ascii');
%%%% (C)
clc;
clear all;
close all;
format long
%%%% (a)
no_m=10^(16);
k=1;
m=12;
for n=2:m
for i=1:n
for j=1:n
H(i,j)=1/(i+j-1);
end
end
Zn=ones(n,1);
kjh1=Zn-invhilb(n)*(H*Zn);
kjh2=Zn-H*(invhilb(n)*Zn);
l1=norm(kjh1,'inf');
l2=norm(kjh2,'inf');
F2(n-1,:)= [l1,l2];
end
save('A3.dat','F2','-ascii');
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.