1
$\begingroup$

I am studying the discretization of Poisson's equation in $1D$. In Matlab I created different discretization matrices (Laplace operator) according to different sizes of the mesh:

% Parameters
N = [40, 80, 160, 1280]; % Dimension 1-D grid

% Laplace operators
L1 = -1/((1/N(1))^2) * full( ( spdiags(repmat([1,-2,1], N(1)-1, 1), -1:1, N(1)-1, N(1)-1) ) );
L2 = -1/((1/N(2))^2) * full( ( spdiags(repmat([1,-2,1], N(2)-1, 1), -1:1, N(2)-1, N(2)-1) ) );
L3 = -1/((1/N(3))^2) * full( ( spdiags(repmat([1,-2,1], N(3)-1, 1), -1:1, N(3)-1, N(3)-1) ) );
L4 = -1/((1/N(4))^2) * full( ( spdiags(repmat([1,-2,1], N(4)-1, 1), -1:1, N(4)-1, N(4)-1) ) );

I then plotted the eigenvalues of the matrices using

[V1, D1] = eig(L1);
plot(diag(D1) / norm(diag(D1),2), '--');

What I see is that as I increase $N$ (so the step size goes to zero), the difference between the biggest and the smallest eigenvalues decreases. Therefore the condition number is getting better. Is there anything else I can see from such a plot?

$\endgroup$
4
  • $\begingroup$ I tried running your code snippet. You did not define D1. $\endgroup$ – Charles Mar 16 '17 at 16:38
  • 4
    $\begingroup$ The condition number is the ratio of largest to smallest eigenvalue. As $N$ increases, the condition number becomes larger not smaller. $\endgroup$ – Bill Greene Mar 16 '17 at 17:39
  • $\begingroup$ @BillGreene From my plots, I see that if $N$ increases the ratio is getting smaller. $\endgroup$ – wrong_path Mar 16 '17 at 17:42
  • 3
    $\begingroup$ @LorenzoFabbri The ratio between maximum and minimum eigenvalues are definitely getting larger. Try max(diag(D1))/min(diag(D1)). Why are you dividing by the norm of D1 in your plot? max(diag(D1) / norm(diag(D1),2) ) is getting smaller, but that's a meaningless quantity. $\endgroup$ – LedHead Mar 16 '17 at 18:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.