# Math 472 Homework 5 - Math 472 Section 002 Professor Joseph...

• Homework Help
• 10
• 100% (2) 2 out of 2 people found this document helpful

This preview shows page 1 - 4 out of 10 pages.

Math 472 Section 002Professor Joseph Conlon Homework 511/30/2016
Problem 1A.)%Function: cholesky, 11/30/2016, Math 472%Compute Cholesky factorization of a matrix A to get matrix Rfunction [r,e,c]=cholesky(N)%input A matrixa=zeros(N);for i=1:Nfor j=1:Na(i,j)=1/(1+abs(i-j));endend%For part be=eig(a);c=cond(a);%Run GEfor k=1:(N-1)for i=(1+k):Nfor j=(1+k):Na(i,j)=a(i,j)-(a(i,k)/a(k,k))*a(k,j);endendendu=triu(a);%determine Rr=zeros(N);for i=1:Nfor j=1:Nr(i,j)=u(i,j)/(sqrt(u(i,i)));endendendB.)r=R matrix, e=eigenvalues of A, c=condition number of A>> [r,e,c]=cholesky(8)r =1.0000 0.5000 0.3333 0.2500 0.2000 0.1667 0.1429 0.12500 0.8660 0.3849 0.2406 0.1732 0.1347 0.1100 0.09280 0 0.8607 0.3765 0.2324 0.1657 0.1279 0.10370 0 0 0.8590 0.3735 0.2292 0.1626 0.12500 0 0 0 0.8582 0.3720 0.2275 0.16100 0 0 0 0 0.8577 0.3711 0.22650 0 0 0 0 0 0.8575 0.3705
0 0 0 0 0 0 0 0.8573e =0.39440.42010.46780.54920.68310.92941.41303.1430c =7.9699>> transpose(r)*rans =1.0000 0.5000 0.3333 0.2500 0.2000 0.1667 0.1429 0.12500.5000 1.0000 0.5000 0.3333 0.2500 0.2000 0.1667 0.14290.3333 0.5000 1.0000 0.5000 0.3333 0.2500 0.2000 0.16670.2500 0.3333 0.5000 1.0000 0.5000 0.3333 0.2500 0.20000.2000 0.2500 0.3333 0.5000 1.0000 0.5000 0.3333 0.25000.1667 0.2000 0.2500 0.3333 0.5000 1.0000 0.5000 0.33330.1429 0.1667 0.2000 0.2500 0.3333 0.5000 1.0000 0.50000.1250 0.1429 0.1667 0.2000 0.2500 0.3333 0.5000 1.0000Cond(A)=|Max eigenvalue of A|/|Min eigenvalue of A|. Here, we have 3.1430/.3944=7.969Cond(A)