Lab 9 summary {@(#) Fri Feb 5 20:31:34 2016 } $Id: summary.txt,v 1.9 2017/04/04 18:00:28 mike Exp $ EXERCISE 1 1-4 exer1.m diag entries S= 7.3434 3.2082 1.4473 0.2327 (from random) 5 print norm(A-U*S*V','fro')= roundoff 6,7 x= 4.0002 -3.0003 2.0001 -1.0001 EXERCISE 2 1,2 exer2.m: d3=d1+d2, drop out fourth sing value. 3. V(:,4) is [1/sqrt(3) 1/sqrt(3) -1/sqrt(3) 0]' 4. find lin comb x and V(:,4) that makes [4 -3 2 -1]' x-(sqrt(3)/3)*V(:,4) EXERCISE 3 1. download TarantulaNebula.jpg 2. nasa=imread('TarantulaNebula.jpg'); 3. plot not required 4. nasa=greyscale image using code on page. 5. plot greyscale not required 6. svd: don't send 7. singular value semilog plot, 39-th singular value = 0.02*first 147-th singular value= 0.01*first 461-th singular value= 0.002*first 6. only nasa25 plot: lotsa artifacts EXERCISE 4 1. copy jacobi_svd.m and fix lines: alpha=sum(U(:,i).^2); OR alpha=U(:,k)'*U(:,k); beta=sum(U(:,j).^2); OR beta= U(:,j)'*U(:,j); gamma=sum(U(:,i).*U(:,j)); OR gamma=U(:,k)'e*U(:,j); c=1/sqrt(1+t^2); s=c*t; V(:,i)=c*T-s*V(:,j); V(:,j)=s*T+c*V(:,j); 2. A= 4.38406 -0.14142 1.13137 4.52548 U = V= S=diag([5,4]) 0.60000 -0.80000 0.70711 -0.70711 0.80000 0.60000 0.70711 0.70711 Second column U and V must be *(-1) to get agreement 3. norm(A1-U1*S1*V1','fro') is roundoff differ from Matlab in last digit in format long U1 = -0.9475806816931032 0.2124354640016070 -0.2386671852527193 0.3162370945482256 0.5168004524249504 -0.7955572841757300 0.0456612714861348 0.8293301308934751 0.5568900989230110 S1 = diag(1.13717372900606,16.75430798063765,1.73205080756888) V1 = 0.838248076909180 0.513405188225107 -0.183726084869850 -0.510062175291238 0.619109435357744 -0.597109775827013 -0.192812704185257 0.594237847797124 0.780835860696863 EXERCISE 5 1. copy bidiag_reduction.m fix: H=householder(B(k,:)',k+1); B=B*H', V=V*H'; 2. copy householder.m 3. Test: norm(A-U*B*V','fro')=roundoff, as do: norm(U*U'-eye(5),'fro'), norm(V*V'-eye(5),'fro') norm(U'*U-eye(5),'fro'), norm(V'*V-eye(5),'fro') EXPLAIN TESTS! U = -0.447214 -0.442554 0.604171 -0.462884 0.157675 -0.447214 -0.358347 0.018894 0.614928 -0.541381 -0.447214 -0.168645 -0.475469 0.213553 0.707024 -0.447214 0.187046 -0.519700 -0.566964 -0.416506 -0.447214 0.782500 0.372104 0.201367 0.093188 B = -2.23607 66.67233 rndoff rndoff rndoff rndoff -63.64581 6.29037 rndoff rndoff rndoff rndoff 2.81240 0.69305 rndoff rndoff rndoff rndoff 0.22060 -0.05315 rndoff rndoff rndoff rndoff 0.01133 V = 1.00000 0.00000 0.00000 0.00000 0.00000 0.00000 -0.10061 -0.54181 0.75183 -0.36203 0.00000 -0.23477 -0.61419 -0.11553 0.74452 0.00000 -0.46953 -0.36848 -0.59014 -0.54360 0.00000 -0.84516 0.43982 0.27044 0.13829 4. A=rand(100,100); norm(B-diag(diag(B))-diag(diag(B,1),1),'fro')=roundoff norm(A-U*B*V','fro')=roundoff, as do: norm(U*U'-eye(100),'fro'), norm(U'*U-eye(100),'fro') norm(V*V'-eye(100),'fro'), norm(V'*V-eye(100),'fro') EXERCISE 6 1. rot.m 2. yes, get c=1,s=0,r=1 3. [0;2] c = 0 s = 1 r = 2 4. [1;2] c = 0.44721, s = 0.89443, r = 2.2361 check matrix product 5. [-3;2] c = 0.8321, s = -0.5547, r = -3.6056 check matrix product EXERCISE 7 1. copy msweep.m 2. add 2 spy paragraphs 3. any one plot, B(10,10)=9.2260e-5 EXERCISE 8 1. vsweep.m 2. norm(diag(BB)-dd) and norm(diag(BB,1)-ee) are roundoff 3. times are about 100 times faster for vsweep. differences are roundoff EXERCISE 9 1. Plots peak to left, to zero at right, peak falling final lines are almost linear 2. backward-S-shaped 3. semilog line (100 steps) becomes linear. slope=r=0.86 EXERCISE 10 1. copy bd_svd.m 2. 2.5422e+01 2.1675e+01 1.8836e+01 1.6525e+01 1.4602e+01 1.3001e+01 1.1671e+01 1.0574e+01 9.7881e+00 9.2260e-05 276 iterations difference from svd= 4.9738e-14 3. random takes several thousand iterations, but only roundoff sized difference between bd_svd and svd results. EXERCISE 11 1. mysvd uses bidiag_reduction and bd_svd 2. norm difference=5.6338e-13, its=254 s= 5.0500e+02 2.5486e+02 1.2295e+02 3.6835e+01 3.0517e+01 2.3351e+01 2.0515e+01 1.8018e-14 7.0346e-15 3.0121e-15 3. rank is 7 because 3 null singular values EXERCISE 12 1. c{2} is a string while c(2) is a cell array numel(c(2))= 1, but numel(c{2}) is 13 (number of characters) 2. download reports_data.m, word_vec.m 3. nothing 4. distinguished 3 words appear, brinkman, cascade, code 5. 3 titles: titles{find(t==1)} A Mixed Finite Element Approximation of Stokes Brinkman and NS Brinkman Equation for Non Darcian Flows The joint helicity energy cascade for homogeneous, isotropic turbulence generated by approximate deconvolution models Changes in UTPRODJ3D a three dimension multiblock mixed hybrid finite element code 6. plot s=sing vals (sharp drop from 10 to under 4 in about 10, slow decline to about 1, drop to zero) 7. words(abs(V(:,k))>.2)= 1: element finite method mixed navier stokes 2: approximate deconvolution models turbulence 12: coupled flow time 13: acute inflammatory mathematical models response 8. authors(abs(U(:,k))>0.2) 2: W. Layton, M. Neda and K. Wyss W. Layton W. Layton and I. Stanculescu I. Stanculescu A. Labovschii, W. Layton, C. Manica, M. Neda, L. Rebholz, I. Stanculescu, C. Trenchea W. Layton and M. Neda W. Layton, C. Manica, M. Neda, and L. Rebholz W. Layton W. Layton and R. Lewandowski W. Layton and R. Lewandowski 8: B. Lal Sharma and A. Vainchtein Y. Zhen and A. Vainchtein Y. Zhen and A. Vainchtein L. Truskinovsky, A. Vainchtein 15: J. Rubin J. Rubin and K. Josic S. Kaya J. Drover, J. Rubin, J. Su, and B. Ermentrout 9. v=word_vec('canard');w=incidence*v;titles(w==1) Giant squid hidden canard the 3D geometry of the Hodkin Huxley model Analysis of a canard mechanism by which excitatory synaptic coupling can synchronize neurons at low firing frequencies 10. titles(abs(t)>.2) Bursting induced by excitatory synaptic coupling in non identical conditional relaxation oscillators or square wave bursters The firing of an excitable neuron in the presence of stochastic trains of strong synaptic inputs Analysis of a canard mechanism by which excitatory synaptic coupling can synchronize neurons at low firing frequencies