function nma_math_228_fall_2010_HW5_plot_iterations
% plot number of iterations per N
% HW 5, math 228A, UC davis

noneIters = [42, 82, 157, 291];
ssorIters = [18, 30, 56, 103];
mgIters = [4, 4, 4, 4];
inc1Iters = [7, 13, 22, 39];
inc2Iters = [4, 6, 8, 14];
n = [225, 961, 3969, 16129];

plot(n,noneIters,'-o',n,ssorIters,'-o',n,mgIters,'-o',n,inc1Iters,'-o',...
   n,inc2Iters,'-o',n,n.^(1/2),'-.k',n,n.^(6/10),'-.k');
legend('NONE','SSOR','Multigrid','Incomplete Choleslky, tol=0.01',...
   'Incomplete Choleslky, tol=0.001','N**(0.5)','N**(0.6)');
title('Compare number of iterations for different solvers');
xlabel('N, number of unknowns');
ylabel('number of iterations');

end