function out=my_summary(n,z0,sigma_sequence,iterations,Test_Case) % Input n,z0,sigma_sequence, iterations % Output out % Function my_summary.m plots a bar graph of approximation solution and % log10 graph of sigma values. % Used with a version of GMRES (gmres.m) organized as suggested by % R.J. Hanson and D.R. Kincaid,"Notes on GMRES Algorithm Organization", % Technical Report TR-05-05, March 2005, % Computer Sciences Department, University of Texas at Austin. % Date = 18 March 2005. button = questdlg('Summary Plots','GMRES(itmax) Demo','Soln','log_10 sigma','Both','Both'); switch button case 'Soln' switch Test_Case case 'test_x' bar(z0); title ('Exp 1. Approximate solution - all 1''s if sequence converged') case 'test_y' X = zeros(n+2,n+2); X(2:n+1,2:n+1) = reshape(z0,n,n); surf(X); title 'Exp 2. Approximate solution: Del(u)+1=0, u=0 on boundary of unit square' case 'test_z' X = zeros(n+2,n+2); X(2:n+1,2:n+1) = reshape(z0,n,n); surf(X); title 'Exp 3. Approximate solution: Large Problem' end case 'log_10 sigma' switch Test_Case case 'test_x' bar(log10(sigma_sequence(1:iterations))); title 'Exp 1. Log_{10} sigma for GMRES(itmax) - will decrease as sequence converges' case 'test_y' bar(log10(sigma_sequence(1:iterations))); title 'Exp 2. Log_{10} sigma for GMRES(itmax) - will decrease as sequence converges' case 'test_z' bar(log10(sigma_sequence(1:iterations))); title 'Exp 3. Log_{10} sigma for GMRES(itmax) - will decrease as sequence converges' end case 'Both' subplot(2,1,1) switch Test_Case case 'test_x' bar(z0); title ('Exp 1. Approximate solution - all 1''s if sequence converged') case 'test_y' X = zeros(n+2,n+2); X(2:n+1,2:n+1) = reshape(z0,n,n); surf(X); title 'Exp 2. Approximate solution: Del(u)+1=0, u=0 on boundary of unit square' case 'test_z' X = zeros(n+2,n+2); X(2:n+1,2:n+1) = reshape(z0,n,n); surf(X); title 'Exp 3. Approximate solution: Large Problem' end subplot(2,1,2) switch Test_Case case 'test_x' bar(log10(sigma_sequence(1:iterations))); title 'Exp 1. Log_{10} sigma for GMRES(itmax) - will decrease as sequence converges' case 'test_y' bar(log10(sigma_sequence(1:iterations))); title 'Exp 2. Log_{10} sigma for GMRES(itmax) - will decrease as sequence converges' case 'test_z' bar(log10(sigma_sequence(1:iterations))); title 'Exp 3. Log_{10} sigma for GMRES(itmax) - will decrease as sequence converges' end end out=0;