% % emily_demo % % This demonstration of emily's abilities displays 5 precomputed matrices: % % 1. The FFT of the 100x100 identity matrix: fft(eye(100)) % 2. The FFT of the 324x324 5 pt. finite difference Lapacian on a square % domain: fft(full(delsq(numgrid('S',20)))) % 3. The inverse of the 196x196 5 pt. finite difference Lapacian on a square % domain: inv(delsq(numgrid('S',16))) % % The last two matrices are accumulations of the residual (R) and % search (D) vectors during a run of the CG (Congugate Gradient) algorithm % on the test matrix A. A was generated as follows: % % t2 = 1.0/(n*n); % for k=1:n % A(k) = k*k*t2; % end; % A = diag(A); % % The final two matrices are: % % 4. R transpose times R after 100 CG iterations on A above. % 5. D transpose times A times D after 100 CG iterations on A above. % load demo disp('fft of the 100x100 identity matrix (try changing the scaling to linear)'); emily(fft100); disp('324x324 matrix of the FFT of the 5 pt. Laplacian on a square domain'); emily(fftinv324); disp('196x196 matrix of the inverse of the 5 pt. finite difference Laplacian on a square domain'); emily(Lap196); disp('R''*R after 100 CG iterations on a test matrix'); emily(RtR); disp('D''*A*D after 100 CG iterations on a test matrix'); emily(DAD);